Index: /temp/test-xoops.ec-cube.net/html/lostpass.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/lostpass.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/lostpass.php	(revision 405)
@@ -0,0 +1,99 @@
+<?php
+// $Id: lostpass.php,v 1.4 2006/05/01 02:37:26 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+$xoopsOption['pagetype'] = "user";
+include "mainfile.php";
+$email = isset($_GET['email']) ? trim($_GET['email']) : '';
+$email = isset($_POST['email']) ? trim($_POST['email']) : $email;
+if ($email == '') {
+    redirect_header("user.php",2,_US_SORRYNOTFOUND);
+    exit();
+}
+
+$myts =& MyTextSanitizer::getInstance();
+$member_handler =& xoops_gethandler('member');
+$getuser = $member_handler->getUsers(new Criteria('email', $myts->addSlashes($email)));
+
+if (empty($getuser)) {
+    redirect_header("user.php",2,_US_SORRYNOTFOUND);
+    exit();
+} else {
+    $code = isset($_GET['code']) ? trim($_GET['code']) : '';
+    $areyou = substr($getuser[0]->getVar("pass"), 0, 5);
+    if ($code != '' && $areyou == $code) {
+        $newpass = xoops_makepass();
+        $xoopsMailer =& getMailer();
+        $xoopsMailer->useMail();
+        $xoopsMailer->setTemplate("lostpass2.tpl");
+        $xoopsMailer->assign("SITENAME", $xoopsConfig['sitename']);
+        $xoopsMailer->assign("ADMINMAIL", $xoopsConfig['adminmail']);
+        $xoopsMailer->assign("SITEURL", XOOPS_URL."/");
+        $xoopsMailer->assign("IP", $_SERVER['REMOTE_ADDR']);
+        $xoopsMailer->assign("NEWPWD", $newpass);
+        $xoopsMailer->setToUsers($getuser[0]);
+        $xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
+        $xoopsMailer->setFromName($xoopsConfig['sitename']);
+        $xoopsMailer->setSubject(sprintf(_US_NEWPWDREQ,XOOPS_URL));
+        if ( !$xoopsMailer->send() ) {
+            echo $xoopsMailer->getErrors();
+        }
+
+        // Next step: add the new password to the database
+        $sql = sprintf("UPDATE %s SET pass = '%s' WHERE uid = %u", $xoopsDB->prefix("users"), md5($newpass), $getuser[0]->getVar('uid'));
+        if ( !$xoopsDB->queryF($sql) ) {
+            include "header.php";
+            echo _US_MAILPWDNG;
+            include "footer.php";
+            exit();
+        }
+        redirect_header("user.php", 3, sprintf(_US_PWDMAILED,$getuser[0]->getVar("uname")), false);
+        exit();
+    // If no Code, send it
+    } else {
+        $xoopsMailer =& getMailer();
+        $xoopsMailer->useMail();
+        $xoopsMailer->setTemplate("lostpass1.tpl");
+        $xoopsMailer->assign("SITENAME", $xoopsConfig['sitename']);
+        $xoopsMailer->assign("ADMINMAIL", $xoopsConfig['adminmail']);
+        $xoopsMailer->assign("SITEURL", XOOPS_URL."/");
+        $xoopsMailer->assign("IP", $_SERVER['REMOTE_ADDR']);
+        $xoopsMailer->assign("NEWPWD_LINK", XOOPS_URL."/lostpass.php?email=".$email."&code=".$areyou);
+        $xoopsMailer->setToUsers($getuser[0]);
+        $xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
+        $xoopsMailer->setFromName($xoopsConfig['sitename']);
+        $xoopsMailer->setSubject(sprintf(_US_NEWPWDREQ,$xoopsConfig['sitename']));
+        include "header.php";
+        if ( !$xoopsMailer->send() ) {
+            echo $xoopsMailer->getErrors();
+        }
+        echo "<h4>";
+        printf(_US_CONFMAIL,$getuser[0]->getVar("uname"));
+        echo "</h4>";
+        include "footer.php";
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/notifications.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/notifications.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/notifications.php	(revision 405)
@@ -0,0 +1,222 @@
+<?php
+// $Id: notifications.php,v 1.3 2005/09/04 20:46:08 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+$xoopsOption['pagetype'] = 'notification';
+include 'mainfile.php';
+
+if (empty($xoopsUser)) {
+    redirect_header('index.php', 3, _NOT_NOACCESS);
+    exit();
+}
+
+$uid = $xoopsUser->getVar('uid');
+
+$op = 'list';
+
+if (isset($_POST['op'])) {
+    $op = trim($_POST['op']);
+} elseif (isset($_GET['op'])) {
+    $op = trim($_GET['op']);
+}
+if (isset($_POST['delete'])) {
+    $op = 'delete';
+} elseif (isset($_GET['delete'])) {
+    $op = 'delete';
+}
+if (isset($_POST['delete_ok'])) {
+    $op = 'delete_ok';
+}
+if (isset($_POST['delete_cancel'])) {
+    $op = 'cancel';
+}
+
+switch ($op) {
+
+case 'cancel':
+
+    // FIXME: does this always go back to correct location??
+    redirect_header ('index.php');
+    break;
+
+case 'list':
+
+// Do we allow other users to see our notifications?  Nope, but maybe
+// see who else is monitoring a particular item (or at least how many)?
+// Well, maybe admin can see all...
+
+// TODO: need to span over multiple pages...???
+
+    // Get an array of all notifications for the selected user
+
+    $criteria = new Criteria ('not_uid', $uid);
+    $criteria->setSort ('not_modid,not_category,not_itemid');
+    $notification_handler =& xoops_gethandler('notification');
+    $notifications =& $notification_handler->getObjects($criteria);
+
+    // Generate the info for the template
+
+    $module_handler =& xoops_gethandler('module');
+    include_once XOOPS_ROOT_PATH . '/include/notification_functions.php';
+
+    $modules = array();
+    $prev_modid = -1;
+    $prev_category = -1;
+    $prev_item = -1;
+    foreach ($notifications as $n) {
+        $modid = $n->getVar('not_modid');
+        if ($modid != $prev_modid) {
+            $prev_modid = $modid;
+            $prev_category = -1;
+            $prev_item = -1;
+            $module =& $module_handler->get($modid);
+            $modules[$modid] = array ('id'=>$modid, 'name'=>$module->getVar('name'), 'categories'=>array());
+            // TODO: note, we could auto-generate the url from the id
+            // and category info... (except when category has multiple
+            // subscription scripts defined...)
+            // OR, add one more option to xoops_version 'view_from'
+            // which tells us where to redirect... BUT, e.g. forums, it
+            // still wouldn't give us all the required info... e.g. the
+            // topic ID doesn't give us the ID of the forum which is
+            // a required argument...
+
+            // Get the lookup function, if exists
+            $not_config = $module->getInfo('notification');
+            $lookup_func = '';
+            if (!empty($not_config['lookup_file'])) {
+                $lookup_file = XOOPS_ROOT_PATH . '/modules/' . $module->getVar('dirname') . '/' . $not_config['lookup_file'];
+                if (file_exists($lookup_file)) {
+                    include_once $lookup_file;
+                    if (!empty($not_config['lookup_func']) && function_exists($not_config['lookup_func'])) {
+                        $lookup_func = $not_config['lookup_func'];
+                    }
+                }
+            }
+        }
+        $category = $n->getVar('not_category');
+        if ($category != $prev_category) {
+            $prev_category = $category;
+            $prev_item = -1;
+            $category_info =& notificationCategoryInfo($category, $modid);
+            $modules[$modid]['categories'][$category] = array ('name'=>$category, 'title'=>$category_info['title'], 'items'=>array());
+        }
+        $item = $n->getVar('not_itemid');
+        if ($item != $prev_item) {
+            $prev_item = $item;
+            if (!empty($lookup_func)) {
+                $item_info = $lookup_func($category, $item);
+            } else {
+                $item_info = array ('name'=>'['._NOT_NAMENOTAVAILABLE.']', 'url'=>'');
+            }
+            $modules[$modid]['categories'][$category]['items'][$item] = array ('id'=>$item, 'name'=>$item_info['name'], 'url'=>$item_info['url'], 'notifications'=>array());
+        }
+        $event_info =& notificationEventInfo($category, $n->getVar('not_event'), $n->getVar('not_modid'));
+        $modules[$modid]['categories'][$category]['items'][$item]['notifications'][] = array ('id'=>$n->getVar('not_id'), 'module_id'=>$n->getVar('not_modid'), 'category'=>$n->getVar('not_category'), 'category_title'=>$category_info['title'], 'item_id'=>$n->getVar('not_itemid'), 'event'=>$n->getVar('not_event'), 'event_title'=>$event_info['title'], 'user_id'=>$n->getVar('not_uid'));
+    }
+    $xoopsOption['template_main'] = 'system_notification_list.html';
+    include XOOPS_ROOT_PATH.'/header.php';
+    $xoopsTpl->assign ('modules', $modules);    
+    $user_info = array ('uid' => $xoopsUser->getVar('uid'));
+    $xoopsTpl->assign ('user', $user_info);
+    $xoopsTpl->assign ('lang_cancel', _CANCEL);
+    $xoopsTpl->assign ('lang_clear', _NOT_CLEAR);
+    $xoopsTpl->assign ('lang_delete', _DELETE);
+    $xoopsTpl->assign ('lang_checkall', _NOT_CHECKALL);
+    $xoopsTpl->assign ('lang_module', _NOT_MODULE);
+    $xoopsTpl->assign ('lang_event', _NOT_EVENT);
+    $xoopsTpl->assign ('lang_events', _NOT_EVENTS);
+    $xoopsTpl->assign ('lang_category', _NOT_CATEGORY);
+    $xoopsTpl->assign ('lang_itemid', _NOT_ITEMID);
+    $xoopsTpl->assign ('lang_itemname', _NOT_ITEMNAME);
+    $xoopsTpl->assign ('lang_activenotifications', _NOT_ACTIVENOTIFICATIONS);
+    include XOOPS_ROOT_PATH.'/footer.php';
+
+// TODO: another display mode... instead of one notification per line,
+// show one line per item_id, with checkboxes for the available options...
+// and an update button to change them...  And still have the delete box
+// to delete all notification for that item
+
+// How about one line per ID, showing category, name, id, and list of
+// events...
+
+// TODO: it would also be useful to provide links to other available
+// options so we can say switch from new_message to 'bookmark' if we
+// are receiving too many emails.  OR, if we click on 'change options' 
+// we get a form for that page...
+
+// TODO: option to specify one-time??? or other modes??
+
+    break;
+
+case 'delete':
+    if (empty($_POST['del_not'])||!is_array($_POST['del_not'])) {
+        redirect_header('notifications.php', 2, _NOT_NOTHINGTODELETE);
+    }
+    $del_notifications = array();
+    foreach($_POST['del_not'] as $not_modid => $not_ids) {
+        if (!is_array($not_ids)) {
+            redirect_header('notifications.php', 2, _NOT_NOTHINGTODELETE);
+        }
+        foreach ($not_ids as $not_id) {
+            $del_notifications[] = intval($not_modid).'|'.intval($not_id);
+        }
+    }
+    $del_not = implode(',', $del_notifications);
+    include XOOPS_ROOT_PATH.'/header.php';
+    $hidden_vars = array('delete_ok'=>1, 'del_not'=>$del_not);
+    print '<h4>'._NOT_DELETINGNOTIFICATIONS.'</h4>';
+    xoops_confirm($hidden_vars, xoops_getenv('PHP_SELF'), _NOT_RUSUREDEL);
+    include XOOPS_ROOT_PATH.'/footer.php';
+    break;
+
+case 'delete_ok':
+    if(!xoops_confirm_validate()) {
+        redirect_header('notifications.php',2,'Ticket Error');
+    }
+    if (empty($_POST['del_not'])) {
+        redirect_header('notifications.php', 2, _NOT_NOTHINGTODELETE);
+    }
+    $del_notifications = explode(',', $_POST['del_not']);
+    if (!is_array($del_notifications) || count($del_notifications)==0) {
+        redirect_header('notifications.php', 2, _NOT_NOTHINGTODELETE);
+    }
+    $notification_handler =& xoops_gethandler('notification');
+    foreach ($del_notifications as $del_notification) {
+        $del_notification_items = explode('|',$del_notification);
+        if (is_array($del_notification_items) && (count($del_notification_items)==2) && !empty($del_notification_items[0]) && !empty($del_notification_items[1])) {
+            $notification =& $notification_handler->get(intval($del_notification_items[1]));
+            if (!empty($notification) && ($notification->getVar('not_uid') == $uid) && ($notification->getVar('not_modid') == intval($del_notification_items[0]))) {
+                $notification_handler->delete($notification);
+            }
+        }
+    }
+    redirect_header('notifications.php', 2, _NOT_DELETESUCCESS);
+    break;
+default:
+    break;
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/templates_c/%%8C^8C5^8C5E2080%%db%3Anewbb_viewforum.html.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/templates_c/%%8C^8C5^8C5E2080%%db%3Anewbb_viewforum.html.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/templates_c/%%8C^8C5^8C5E2080%%db%3Anewbb_viewforum.html.php	(revision 405)
@@ -0,0 +1,137 @@
+<?php /* Smarty version 2.6.12, created on 2006-11-24 11:10:58
+         compiled from db:newbb_viewforum.html */ ?>
+<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
+smarty_core_load_plugins(array('plugins' => array(array('function', 'cycle', 'db:newbb_viewforum.html', 36, false),array('modifier', 'default', 'db:newbb_viewforum.html', 41, false),)), $this); ?>
+<!-- start module contents -->
+<table border="0" width="100%" cellpadding="5" align="center">
+  <tr>
+    <td align="left"><img src="<?php echo $this->_tpl_vars['forum_image_folder']; ?>
+" alt="/" />&nbsp;&nbsp;<a href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/modules/newbb/index.php"><?php echo $this->_tpl_vars['forum_index_title']; ?>
+</a><br />&nbsp;&nbsp;&nbsp;<img src="<?php echo $this->_tpl_vars['forum_image_folder']; ?>
+" alt="/" />&nbsp;&nbsp;<b><?php echo $this->_tpl_vars['forum_name']; ?>
+</b><br />(<?php echo $this->_tpl_vars['lang_moderatedby']; ?>
+:<?php echo $this->_tpl_vars['forum_moderators']; ?>
+)</td>
+    <td align="right"><?php echo $this->_tpl_vars['forum_post_or_register']; ?>
+</td>
+  </tr>
+</table>
+<table align="center" border="0" width="100%">
+  <tr>
+    <td align="right"><?php echo $this->_tpl_vars['forum_pagenav']; ?>
+</td>
+  </tr>
+</table>
+
+<!-- start forum main table -->
+<form action="viewforum.php" method="get">
+<input type="hidden" name="mode" value="">
+<input type="hidden" name="topic_id" value="">
+<input type="hidden" name="start" value="<?php echo $_GET['start']; ?>
+">
+
+<table class="outer" cellspacing="1">
+  <tr>
+    <th colspan="8"> <?php echo $this->_tpl_vars['forum_name']; ?>
+</th>
+  </tr>
+  <tr class="head" align="left">
+    <td width="2%">&nbsp;</td>
+    <td width="2%">&nbsp;</td>
+    <td>&nbsp;<b><a href="<?php echo $this->_tpl_vars['h_topic_link']; ?>
+"><?php echo $this->_tpl_vars['lang_topic']; ?>
+</a></b></td>
+	<td width="7%" align="center" nowrap="nowrap"><b><a href="<?php echo $this->_tpl_vars['h_reply_response']; ?>
+"><?php echo $this->_tpl_vars['lang_response']; ?>
+</a></b></td>
+    <td width="5%" align="center" nowrap="nowrap"><b><a href="<?php echo $this->_tpl_vars['h_reply_link']; ?>
+"><?php echo $this->_tpl_vars['lang_replies']; ?>
+</a></b></td>
+    <td width="15%" align="center" nowrap="nowrap"><b><a href="<?php echo $this->_tpl_vars['h_poster_link']; ?>
+"><?php echo $this->_tpl_vars['lang_poster']; ?>
+</a></b></td>
+    <td width="8%" align="center" nowrap="nowrap"><b><a href="<?php echo $this->_tpl_vars['h_views_link']; ?>
+"><?php echo $this->_tpl_vars['lang_views']; ?>
+</a></b></td>
+    <td width="15%" align="center" nowrap="nowrap"><b><a href="<?php echo $this->_tpl_vars['h_date_link']; ?>
+"><?php echo $this->_tpl_vars['lang_date']; ?>
+</a></b></td>
+  </tr>
+  <!-- start forum topic -->
+  <?php $_from = $this->_tpl_vars['topics']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
+    foreach ($_from as $this->_tpl_vars['topic']):
+?>
+  <tr class="<?php echo smarty_function_cycle(array('values' => "even,odd"), $this);?>
+">
+    <td align="center"><img src="<?php echo $this->_tpl_vars['topic']['topic_folder']; ?>
+" alt="/" /></td>
+    <td align="center"><?php echo $this->_tpl_vars['topic']['topic_icon']; ?>
+</td>
+    <td>&nbsp;[<?php echo $this->_tpl_vars['topic']['fix']; ?>
+:<?php echo $this->_tpl_vars['topic']['topic_number']; ?>
+]<a href="<?php echo $this->_tpl_vars['topic']['topic_link']; ?>
+"><?php echo $this->_tpl_vars['topic']['topic_title']; ?>
+</a><?php echo $this->_tpl_vars['topic']['topic_page_jump']; ?>
+</td>
+    <td align="center" valign="middle">
+		<?php echo ((is_array($_tmp=@$this->_tpl_vars['arrResponse'][$this->_tpl_vars['topic']['topic_response']])) ? $this->_run_mod_handler('default', true, $_tmp, '¡Ý¡Ý¡Ý') : smarty_modifier_default($_tmp, '¡Ý¡Ý¡Ý')); ?>
+
+		<?php if ($this->_tpl_vars['arrResponse'][$this->_tpl_vars['topic']['topic_response']] != ""): ?> (<?php echo ((is_array($_tmp=@$this->_tpl_vars['topic']['topic_response_user'])) ? $this->_run_mod_handler('default', true, $_tmp, '¥²¥¹¥È') : smarty_modifier_default($_tmp, '¥²¥¹¥È')); ?>
+) <?php endif; ?>
+    	
+    </td>
+    <td align="center" valign="middle"><?php echo $this->_tpl_vars['topic']['topic_replies']; ?>
+</td>
+	<td align="center" valign="middle"><?php echo $this->_tpl_vars['topic']['topic_poster']; ?>
+</td>
+    <td align="center" valign="middle"><?php echo $this->_tpl_vars['topic']['topic_views']; ?>
+</td>
+	<td align="right" valign="middle"><?php echo $this->_tpl_vars['topic']['topic_last_posttime']; ?>
+<br /><?php echo $this->_tpl_vars['lang_by']; ?>
+ <?php echo $this->_tpl_vars['topic']['topic_last_poster']; ?>
+</td>
+  </tr>
+  <?php endforeach; endif; unset($_from); ?>
+  <!-- end forum topic -->
+  <tr class="foot">
+    <td colspan="8" align="center">
+    <b><?php echo $this->_tpl_vars['lang_sortby']; ?>
+</b> <?php echo $this->_tpl_vars['forum_selection_sort']; ?>
+ <?php echo $this->_tpl_vars['forum_selection_order']; ?>
+ <?php echo $this->_tpl_vars['forum_selection_since']; ?>
+ <input type="hidden" name="forum" value="<?php echo $this->_tpl_vars['forum_id']; ?>
+" /><input type="submit" name="refresh" value="<?php echo $this->_tpl_vars['lang_go']; ?>
+" />
+    </td>
+  </tr>
+</table>
+</form>
+<!-- end forum main table -->
+
+<table align="center" border="0" width="100%">
+  <tr>
+    <td valign="top"><img src="<?php echo $this->_tpl_vars['img_newposts']; ?>
+" alt="/" /> = <?php echo $this->_tpl_vars['lang_newposts']; ?>
+ (<img src="<?php echo $this->_tpl_vars['img_hotnewposts']; ?>
+" alt="/" /> = <?php echo $this->_tpl_vars['lang_hotnewposts']; ?>
+)<br /><img src="<?php echo $this->_tpl_vars['img_folder']; ?>
+" alt="/" /> = <?php echo $this->_tpl_vars['lang_nonewposts']; ?>
+ (<img src="<?php echo $this->_tpl_vars['img_hotfolder']; ?>
+" alt="/" /> = <?php echo $this->_tpl_vars['lang_hotnonewposts']; ?>
+)<br /><img src="<?php echo $this->_tpl_vars['img_locked']; ?>
+" alt="/" /> = <?php echo $this->_tpl_vars['lang_topiclocked']; ?>
+<br /><img src="<?php echo $this->_tpl_vars['img_sticky']; ?>
+" alt="/" /> = <?php echo $this->_tpl_vars['lang_topicsticky']; ?>
+</td>
+    <td align="right"><?php echo $this->_tpl_vars['forum_pagenav']; ?>
+<br /><?php echo $this->_tpl_vars['forum_jumpbox']; ?>
+</td>
+  </tr>
+</table>
+<?php $_smarty_tpl_vars = $this->_tpl_vars;
+$this->_smarty_include(array('smarty_include_tpl_file' => 'db:system_notification_select.html', 'smarty_include_vars' => array()));
+$this->_tpl_vars = $_smarty_tpl_vars;
+unset($_smarty_tpl_vars);
+ ?>
+<!-- end module contents -->
Index: /temp/test-xoops.ec-cube.net/html/templates_c/%%5D^5DD^5DDC7D64%%db%3Asystem_imagemanager.html.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/templates_c/%%5D^5DD^5DDC7D64%%db%3Asystem_imagemanager.html.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/templates_c/%%5D^5DD^5DDC7D64%%db%3Asystem_imagemanager.html.php	(revision 405)
@@ -0,0 +1,160 @@
+<?php /* Smarty version 2.6.12, created on 2006-11-27 15:03:35
+         compiled from db:system_imagemanager.html */ ?>
+<!DOCTYPE html PUBLIC '//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->_tpl_vars['xoops_langcode']; ?>
+" lang="<?php echo $this->_tpl_vars['xoops_langcode']; ?>
+">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=<?php echo $this->_tpl_vars['xoops_charset']; ?>
+" />
+<meta http-equiv="content-language" content="<?php echo $this->_tpl_vars['xoops_langcode']; ?>
+" />
+<title><?php echo $this->_tpl_vars['sitename']; ?>
+ <?php echo $this->_tpl_vars['lang_imgmanager']; ?>
+</title>
+<script type="text/javascript">
+<!--//
+function appendCode(addCode) {
+	var targetDom = window.opener.xoopsGetElementById('<?php echo $this->_tpl_vars['target']; ?>
+');
+	if (targetDom.createTextRange && targetDom.caretPos){
+  		var caretPos = targetDom.caretPos;
+		caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) 
+== ' ' ? addCode + ' ' : addCode;  
+	} else if (targetDom.getSelection && targetDom.caretPos){
+		var caretPos = targetDom.caretPos;
+		caretPos.text = caretPos.text.charat(caretPos.text.length - 1)  
+== ' ' ? addCode + ' ' : addCode;
+	} else {
+		targetDom.value = targetDom.value + addCode;
+  	}
+	window.close();
+	return;
+}
+//-->
+</script>
+<style type="text/css" media="all">
+body {margin: 0;}
+img {border: 0;}
+table {width: 100%; margin: 0;}
+a:link {color: #3a76d6; font-weight: bold; background-color: transparent;}
+a:visited {color: #9eb2d6; font-weight: bold; background-color: transparent;}
+a:hover {color: #e18a00; background-color: transparent;}
+table td {background-color: white; font-size: 12px; padding: 0; border-width: 0; vertical-align: top; font-family: Verdana, Arial, Helvetica, sans-serif;}
+table#imagenav td {vertical-align: bottom; padding: 5px;}
+table#imagemain td {border-right: 1px solid silver; border-bottom: 1px solid silver; padding: 5px; vertical-align: middle;}
+table#imagemain th {border: 0; background-color: #2F5376; color:white; font-size: 12px; padding: 5px; vertical-align: top; text-align:center; font-family: Verdana, Arial, Helvetica, sans-serif;}
+table#header td {width: 100%; background-color: #2F5376; vertical-align: middle;}
+table#header td#headerbar {border-bottom: 1px solid silver; background-color: #dddddd;}
+div#pagenav {text-align:center;}
+div#footer {text-align:right; padding: 5px;}
+</style>
+</head>
+
+<body onload="window.resizeTo(<?php echo $this->_tpl_vars['xsize']; ?>
+, <?php echo $this->_tpl_vars['ysize']; ?>
+);">
+  <table id="header" cellspacing="0">
+    <tr>
+      <td><a href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/"><img src="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/images/logo.gif" width="150" height="80" alt="" /></a></td><td> </td>
+    </tr>
+    <tr>
+      <td id="headerbar" colspan="2"> </td>
+    </tr>
+  </table>
+
+  <form action="imagemanager.php" method="get">
+    <table cellspacing="0" id="imagenav">
+      <tr>
+        <td>
+          <select name="cat_id" onchange="location='<?php echo $this->_tpl_vars['xoops_url']; ?>
+/imagemanager.php?target=<?php echo $this->_tpl_vars['target']; ?>
+&amp;cat_id='+this.options[this.selectedIndex].value"><?php echo $this->_tpl_vars['cat_options']; ?>
+</select> <input type="hidden" name="target" value="<?php echo $this->_tpl_vars['target']; ?>
+" /><input type="submit" value="<?php echo $this->_tpl_vars['lang_go']; ?>
+" />
+        </td>
+
+        <?php if ($this->_tpl_vars['show_cat'] > 0): ?>
+        <td align="right"><a href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/imagemanager.php?target=<?php echo $this->_tpl_vars['target']; ?>
+&amp;op=upload&amp;imgcat_id=<?php echo $this->_tpl_vars['show_cat']; ?>
+"><?php echo $this->_tpl_vars['lang_addimage']; ?>
+</a></td>
+        <?php endif; ?>
+
+      </tr>
+    </table>
+  </form>
+
+  <?php if ($this->_tpl_vars['image_total'] > 0): ?>
+
+  <table cellspacing="0" id="imagemain">
+    <tr>
+      <th><?php echo $this->_tpl_vars['lang_imagename']; ?>
+</th>
+      <th><?php echo $this->_tpl_vars['lang_image']; ?>
+</th>
+      <th><?php echo $this->_tpl_vars['lang_imagemime']; ?>
+</th>
+      <th><?php echo $this->_tpl_vars['lang_align']; ?>
+</th>
+    </tr>
+
+    <?php unset($this->_sections['i']);
+$this->_sections['i']['name'] = 'i';
+$this->_sections['i']['loop'] = is_array($_loop=$this->_tpl_vars['images']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
+$this->_sections['i']['show'] = true;
+$this->_sections['i']['max'] = $this->_sections['i']['loop'];
+$this->_sections['i']['step'] = 1;
+$this->_sections['i']['start'] = $this->_sections['i']['step'] > 0 ? 0 : $this->_sections['i']['loop']-1;
+if ($this->_sections['i']['show']) {
+    $this->_sections['i']['total'] = $this->_sections['i']['loop'];
+    if ($this->_sections['i']['total'] == 0)
+        $this->_sections['i']['show'] = false;
+} else
+    $this->_sections['i']['total'] = 0;
+if ($this->_sections['i']['show']):
+
+            for ($this->_sections['i']['index'] = $this->_sections['i']['start'], $this->_sections['i']['iteration'] = 1;
+                 $this->_sections['i']['iteration'] <= $this->_sections['i']['total'];
+                 $this->_sections['i']['index'] += $this->_sections['i']['step'], $this->_sections['i']['iteration']++):
+$this->_sections['i']['rownum'] = $this->_sections['i']['iteration'];
+$this->_sections['i']['index_prev'] = $this->_sections['i']['index'] - $this->_sections['i']['step'];
+$this->_sections['i']['index_next'] = $this->_sections['i']['index'] + $this->_sections['i']['step'];
+$this->_sections['i']['first']      = ($this->_sections['i']['iteration'] == 1);
+$this->_sections['i']['last']       = ($this->_sections['i']['iteration'] == $this->_sections['i']['total']);
+?>
+    <tr align="center">
+      <td><input type="hidden" name="image_id[]" value="<?php echo $this->_tpl_vars['images'][$this->_sections['i']['index']]['id']; ?>
+" /><?php echo $this->_tpl_vars['images'][$this->_sections['i']['index']]['nicename']; ?>
+</td>
+      <td><img src="<?php echo $this->_tpl_vars['images'][$this->_sections['i']['index']]['src']; ?>
+" alt="" /></td>
+      <td><?php echo $this->_tpl_vars['images'][$this->_sections['i']['index']]['mimetype']; ?>
+</td>
+      <td><a href="#" onclick="javascript:appendCode('<?php echo $this->_tpl_vars['images'][$this->_sections['i']['index']]['lxcode']; ?>
+');"><img src="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/images/alignleft.gif" alt="Left" /></a> <a href="#" onclick="javascript:appendCode('<?php echo $this->_tpl_vars['images'][$this->_sections['i']['index']]['xcode']; ?>
+');"><img src="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/images/aligncenter.gif" alt="Center" /></a> <a href="#" onclick="javascript:appendCode('<?php echo $this->_tpl_vars['images'][$this->_sections['i']['index']]['rxcode']; ?>
+');"><img src="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/images/alignright.gif" alt="Right" /></a></td>
+    </tr>
+    <?php endfor; endif; ?>
+  </table>
+
+  <?php endif; ?>
+
+  <div id="pagenav"><?php echo $this->_tpl_vars['pagenav']; ?>
+</div>
+
+  <div id="footer">
+    <input value="<?php echo $this->_tpl_vars['lang_close']; ?>
+" type="button" onclick="javascript:window.close();" />
+  </div>
+
+  </body>
+</html>
Index: /temp/test-xoops.ec-cube.net/html/templates_c/%%F3^F39^F3989731%%db%3Asystem_userform.html.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/templates_c/%%F3^F39^F3989731%%db%3Asystem_userform.html.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/templates_c/%%F3^F39^F3989731%%db%3Asystem_userform.html.php	(revision 405)
@@ -0,0 +1,36 @@
+<?php /* Smarty version 2.6.12, created on 2006-11-24 11:19:21
+         compiled from db:system_userform.html */ ?>
+<fieldset style="padding: 10px;">
+  <legend style="font-weight: bold;"><?php echo $this->_tpl_vars['lang_login']; ?>
+</legend>
+  <form action="user.php" method="post">
+    <?php echo $this->_tpl_vars['lang_username']; ?>
+ <input type="text" name="uname" size="26" maxlength="60" value="<?php echo $this->_tpl_vars['usercookie']; ?>
+" /><br />
+    <?php echo $this->_tpl_vars['lang_password']; ?>
+ <input type="password" name="pass" size="21" maxlength="32" /><br />
+    <input type="checkbox" name="rememberme" value="On" /><?php echo @_REMEMBERME; ?>
+<br />    <input type="hidden" name="op" value="login" />
+    <input type="hidden" name="xoops_redirect" value="<?php echo $this->_tpl_vars['redirect_page']; ?>
+" />
+    <input type="submit" value="<?php echo $this->_tpl_vars['lang_login']; ?>
+" />
+  </form>
+  <a name="lost"></a>
+  <div><?php echo $this->_tpl_vars['lang_notregister']; ?>
+<br /></div>
+</fieldset>
+
+<br />
+
+<fieldset style="padding: 10px;">
+  <legend style="font-weight: bold;"><?php echo $this->_tpl_vars['lang_lostpassword']; ?>
+</legend>
+  <div><br /><?php echo $this->_tpl_vars['lang_noproblem']; ?>
+</div>
+  <form action="lostpass.php" method="post">
+    <?php echo $this->_tpl_vars['lang_youremail']; ?>
+ <input type="text" name="email" size="26" maxlength="60" />&nbsp;&nbsp;<input type="hidden" name="op" value="mailpasswd" /><input type="submit" value="<?php echo $this->_tpl_vars['lang_sendpassword']; ?>
+" />
+  </form>
+</fieldset>
Index: /temp/test-xoops.ec-cube.net/html/templates_c/%%E1^E1E^E1E394A4%%theme_blockcenter_c.html.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/templates_c/%%E1^E1E^E1E394A4%%theme_blockcenter_c.html.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/templates_c/%%E1^E1E^E1E394A4%%theme_blockcenter_c.html.php	(revision 405)
@@ -0,0 +1,35 @@
+<?php /* Smarty version 2.6.12, created on 2006-11-28 16:32:06
+         compiled from default/theme_blockcenter_c.html */ ?>
+<div style="padding: 15px 15px 10px 15px;">
+	<?php if ($this->_tpl_vars['block']['title'] != 'escape'): ?>
+	<table border="0" cellspacing="0" cellpadding="0">
+		<tr bgcolor="#2b8200">
+			<td><img src="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/themes/default/img/top/title_left_top.gif" width="10" height="7" alt="" border="0"></td>
+			<td style="width:100%;"></td>
+			<td align="left"><img src="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/themes/default/img/top/title_right_top.gif" width="10" height="7" alt="" border="0"></td>
+		</tr>
+		<tr>
+			<td bgcolor="#2b8200" colspan="3">
+			<table border="0" cellspacing="0" cellpadding="0">
+				<tr>
+					<td class="blockIcon"><div class="blockTitle"><?php echo $this->_tpl_vars['block']['title']; ?>
+</div></td>
+				</tr>
+			</table>
+			</td>
+		</tr>
+		<tr bgcolor="#2b8200">
+			<td><img src="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/themes/default/img/top/title_left_bottom.gif" width="10" height="7" alt="" border="0"></td>
+			<td></td>
+			<td align="left"><img src="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/themes/default/img/top/title_right_bottom.gif" width="10" height="7" alt="" border="0"></td>
+		</tr>
+		<tr><td height="10"></td></tr>
+	</table>
+	<?php endif; ?>
+	<div class="blockContent"><?php echo $this->_tpl_vars['block']['content']; ?>
+</div>
+</div>
Index: /temp/test-xoops.ec-cube.net/html/templates_c/%%5A^5A2^5A255BBF%%db%3Asystem_notification_select.html.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/templates_c/%%5A^5A2^5A255BBF%%db%3Asystem_notification_select.html.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/templates_c/%%5A^5A2^5A255BBF%%db%3Asystem_notification_select.html.php	(revision 405)
@@ -0,0 +1,68 @@
+<?php /* Smarty version 2.6.12, created on 2006-11-24 11:10:58
+         compiled from db:system_notification_select.html */ ?>
+<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
+smarty_core_load_plugins(array('plugins' => array(array('function', 'counter', 'db:system_notification_select.html', 19, false),)), $this); ?>
+<?php if ($this->_tpl_vars['xoops_notification']['show']): ?>
+<form name="notification_select" action="<?php echo $this->_tpl_vars['xoops_notification']['target_page']; ?>
+" method="post">
+<h4 style="text-align:center;"><?php echo $this->_tpl_vars['lang_activenotifications']; ?>
+</h4>
+<input type="hidden" name="not_redirect" value="<?php echo $this->_tpl_vars['xoops_notification']['redirect_script']; ?>
+" />
+<table class="outer">
+  <tr><th colspan="3"><?php echo $this->_tpl_vars['lang_notificationoptions']; ?>
+</th></tr>
+  <tr>
+    <td class="head"><?php echo $this->_tpl_vars['lang_category']; ?>
+</td>
+    <td class="head"><input name="allbox" id="allbox" onclick="xoopsCheckAll('notification_select','allbox');" type="checkbox" value="<?php echo $this->_tpl_vars['lang_checkall']; ?>
+" /></td>
+    <td class="head"><?php echo $this->_tpl_vars['lang_events']; ?>
+</td>
+  </tr>
+  <?php $_from = $this->_tpl_vars['xoops_notification']['categories']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['outer'] = array('total' => count($_from), 'iteration' => 0);
+if ($this->_foreach['outer']['total'] > 0):
+    foreach ($_from as $this->_tpl_vars['category']):
+        $this->_foreach['outer']['iteration']++;
+?>
+  <?php $_from = $this->_tpl_vars['category']['events']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['inner'] = array('total' => count($_from), 'iteration' => 0);
+if ($this->_foreach['inner']['total'] > 0):
+    foreach ($_from as $this->_tpl_vars['event']):
+        $this->_foreach['inner']['iteration']++;
+?>
+  <tr>
+    <?php if (($this->_foreach['inner']['iteration'] <= 1)): ?>
+    <td class="even" rowspan="<?php echo $this->_foreach['inner']['total']; ?>
+"><?php echo $this->_tpl_vars['category']['title']; ?>
+</td>
+    <?php endif; ?>
+    <td class="odd">
+    <?php echo smarty_function_counter(array('assign' => 'index'), $this);?>
+
+    <input type="hidden" name="not_list[<?php echo $this->_tpl_vars['index']; ?>
+][params]" value="<?php echo $this->_tpl_vars['category']['name']; ?>
+,<?php echo $this->_tpl_vars['category']['itemid']; ?>
+,<?php echo $this->_tpl_vars['event']['name']; ?>
+" />
+    <input type="checkbox" id="not_list[]" name="not_list[<?php echo $this->_tpl_vars['index']; ?>
+][status]" value="1" <?php if ($this->_tpl_vars['event']['subscribed']): ?>checked="checked"<?php endif; ?> />
+    </td>
+    <td class="odd"><?php echo $this->_tpl_vars['event']['caption']; ?>
+</td>
+  </tr>
+  <?php endforeach; endif; unset($_from); ?>
+  <?php endforeach; endif; unset($_from); ?>
+  <tr>
+    <td class="foot" colspan="3" align="center"><input type="submit" name="not_submit" value="<?php echo $this->_tpl_vars['lang_updatenow']; ?>
+" /></td>
+  </tr>
+</table>
+<div align="center">
+<?php echo $this->_tpl_vars['lang_notificationmethodis']; ?>
+:&nbsp;<?php echo $this->_tpl_vars['user_method']; ?>
+&nbsp;&nbsp;[<a href="<?php echo $this->_tpl_vars['editprofile_url']; ?>
+"><?php echo $this->_tpl_vars['lang_change']; ?>
+</a>]
+</div>
+</form>
+<?php endif; ?>
Index: /temp/test-xoops.ec-cube.net/html/templates_c/%%E0^E0C^E0C06F16%%db%3Anewbb_viewtopic_flat.html.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/templates_c/%%E0^E0C^E0C06F16%%db%3Anewbb_viewtopic_flat.html.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/templates_c/%%E0^E0C^E0C06F16%%db%3Anewbb_viewtopic_flat.html.php	(revision 405)
@@ -0,0 +1,123 @@
+<?php /* Smarty version 2.6.12, created on 2006-11-28 11:45:32
+         compiled from db:newbb_viewtopic_flat.html */ ?>
+<!-- start module contents -->
+<table border="0" width="100%" cellpadding='5' align='center'>
+  <tr>
+    <td align='left'><img src='<?php echo $this->_tpl_vars['xoops_url']; ?>
+/modules/newbb/images/folder.gif' alt='' /> <a href='<?php echo $this->_tpl_vars['xoops_url']; ?>
+/modules/newbb/index.php'><?php echo $this->_tpl_vars['lang_forum_index']; ?>
+</a><br />&nbsp;&nbsp;<img src='<?php echo $this->_tpl_vars['xoops_url']; ?>
+/modules/newbb/images/folder.gif' alt='' /> <a href='<?php echo $this->_tpl_vars['xoops_url']; ?>
+/modules/newbb/viewforum.php?forum=<?php echo $this->_tpl_vars['forum_id']; ?>
+'><?php echo $this->_tpl_vars['forum_name']; ?>
+</a>
+<br />&nbsp;&nbsp;&nbsp;&nbsp;<img src='<?php echo $this->_tpl_vars['xoops_url']; ?>
+/modules/newbb/images/folder.gif' alt='' /> <b><?php echo $this->_tpl_vars['topic_title']; ?>
+</b></td><td align='right'><?php echo $this->_tpl_vars['forum_post_or_register']; ?>
+</td>
+  </tr>
+</table>
+
+<br />
+
+<!-- start topic thread -->
+<table cellpadding="4" width="100%">
+  <tr>
+    <td align="left"><a id="threadtop"></a><a href="viewtopic.php?viewmode=thread&amp;order=<?php echo $this->_tpl_vars['order_current']; ?>
+&amp;topic_id=<?php echo $this->_tpl_vars['topic_id']; ?>
+&amp;forum=<?php echo $this->_tpl_vars['forum_id']; ?>
+"><?php echo $this->_tpl_vars['lang_threaded']; ?>
+</a> | <a href="viewtopic.php?viewmode=flat&amp;order=<?php echo $this->_tpl_vars['order_other']; ?>
+&amp;topic_id=<?php echo $this->_tpl_vars['topic_id']; ?>
+&amp;forum=<?php echo $this->_tpl_vars['forum_id']; ?>
+"><?php echo $this->_tpl_vars['lang_order_other']; ?>
+</a></td>
+    <td align="right"><a href="viewtopic.php?viewmode=flat&amp;order=<?php echo $this->_tpl_vars['order_current']; ?>
+&amp;topic_id=<?php echo $this->_tpl_vars['topic_id']; ?>
+&amp;forum=<?php echo $this->_tpl_vars['forum_id']; ?>
+&amp;move=prev&amp;topic_time=<?php echo $this->_tpl_vars['topic_time']; ?>
+"><?php echo $this->_tpl_vars['lang_prevtopic']; ?>
+</a> | <a href="viewtopic.php?viewmode=flat&amp;order=<?php echo $this->_tpl_vars['order_current']; ?>
+&amp;topic_id=<?php echo $this->_tpl_vars['topic_id']; ?>
+&amp;forum=<?php echo $this->_tpl_vars['forum_id']; ?>
+&amp;move=next&amp;topic_time=<?php echo $this->_tpl_vars['topic_time']; ?>
+"><?php echo $this->_tpl_vars['lang_nexttopic']; ?>
+</a> | <a href="#threadbottom"><?php echo $this->_tpl_vars['lang_bottom']; ?>
+</a></td>
+  </tr>
+</table>
+<table cellspacing="1" class="outer">
+  <tr align='left'>
+    <th width='20%'><?php echo $this->_tpl_vars['lang_poster']; ?>
+</th>
+    <th><?php echo $this->_tpl_vars['lang_thread']; ?>
+</th>
+  </tr>
+  <?php $_from = $this->_tpl_vars['topic_posts']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
+    foreach ($_from as $this->_tpl_vars['topic_post']):
+?>
+  <?php $_smarty_tpl_vars = $this->_tpl_vars;
+$this->_smarty_include(array('smarty_include_tpl_file' => "db:newbb_thread.html", 'smarty_include_vars' => array('topic_post' => $this->_tpl_vars['topic_post'])));
+$this->_tpl_vars = $_smarty_tpl_vars;
+unset($_smarty_tpl_vars);
+ ?>
+  <?php endforeach; endif; unset($_from); ?>
+  <tr class="foot" align="left">
+    <td colspan="2" align="center"><?php echo $this->_tpl_vars['forum_page_nav']; ?>
+ </td>
+  </tr>
+</table>
+<table cellpadding="4" width="100%">
+  <tr>
+    <td align="left"><a id="threadbottom"></a><a href="viewtopic.php?viewmode=thread&amp;order=<?php echo $this->_tpl_vars['order_current']; ?>
+&amp;topic_id=<?php echo $this->_tpl_vars['topic_id']; ?>
+&amp;forum=<?php echo $this->_tpl_vars['forum_id']; ?>
+"><?php echo $this->_tpl_vars['lang_threaded']; ?>
+</a> | <a href="viewtopic.php?viewmode=flat&amp;order=<?php echo $this->_tpl_vars['order_other']; ?>
+&amp;topic_id=<?php echo $this->_tpl_vars['topic_id']; ?>
+&amp;forum=<?php echo $this->_tpl_vars['forum_id']; ?>
+"><?php echo $this->_tpl_vars['lang_order_other']; ?>
+</a></td>
+    <td align="right"><a href="viewtopic.php?viewmode=flat&amp;order=<?php echo $this->_tpl_vars['order_current']; ?>
+&amp;topic_id=<?php echo $this->_tpl_vars['topic_id']; ?>
+&amp;forum=<?php echo $this->_tpl_vars['forum_id']; ?>
+&amp;move=prev&amp;topic_time=<?php echo $this->_tpl_vars['topic_time']; ?>
+"><?php echo $this->_tpl_vars['lang_prevtopic']; ?>
+</a> | <a href="viewtopic.php?viewmode=flat&amp;order=<?php echo $this->_tpl_vars['order_current']; ?>
+&amp;topic_id=<?php echo $this->_tpl_vars['topic_id']; ?>
+&amp;forum=<?php echo $this->_tpl_vars['forum_id']; ?>
+&amp;move=next&amp;topic_time=<?php echo $this->_tpl_vars['topic_time']; ?>
+"><?php echo $this->_tpl_vars['lang_nexttopic']; ?>
+</a> | <a href="#threadtop"><?php echo $this->_tpl_vars['lang_top']; ?>
+</a></td>
+  </tr>
+</table>
+<!-- end topic thread -->
+
+<br />
+
+<table cellspacing="0" class="outer" width="100%">
+  <tr class='foot'>
+    <td align='left'> <?php echo $this->_tpl_vars['forum_post_or_register']; ?>
+</td>
+    <td align='right'><?php echo $this->_tpl_vars['forum_jumpbox']; ?>
+ </td>
+  </tr>
+  <tr class='foot' valign="bottom">
+    <?php if ($this->_tpl_vars['viewer_is_admin'] == true): ?>
+    <td colspan='2' align='center'>&nbsp;<?php echo $this->_tpl_vars['topic_lock_image']; ?>
+&nbsp;<?php echo $this->_tpl_vars['topic_move_image']; ?>
+&nbsp;<?php echo $this->_tpl_vars['topic_delete_image']; ?>
+&nbsp;<?php echo $this->_tpl_vars['topic_sticky_image']; ?>
+&nbsp;</td>
+    <?php else: ?>
+    <td colspan='2'>&nbsp;</td>
+    <?php endif; ?>
+  </tr>
+</table>
+<?php $_smarty_tpl_vars = $this->_tpl_vars;
+$this->_smarty_include(array('smarty_include_tpl_file' => 'db:system_notification_select.html', 'smarty_include_vars' => array()));
+$this->_tpl_vars = $_smarty_tpl_vars;
+unset($_smarty_tpl_vars);
+ ?>
+<!-- end module contents -->
Index: /temp/test-xoops.ec-cube.net/html/templates_c/%%05^052^052EA638%%db%3Anews_item.html.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/templates_c/%%05^052^052EA638%%db%3Anews_item.html.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/templates_c/%%05^052^052EA638%%db%3Anews_item.html.php	(revision 405)
@@ -0,0 +1,16 @@
+<?php /* Smarty version 2.6.12, created on 2006-11-24 11:16:07
+         compiled from db:news_item.html */ ?>
+<div class="news">
+	<dl>
+		<dt><img src="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/themes/default/img/top/arrow02.gif" width="2" height="5" alt=""><?php echo $this->_tpl_vars['story']['posttime']; ?>
+</dt>
+		<dd><?php echo $this->_tpl_vars['story']['text']; ?>
+</dd>
+	</dl>
+	<div style="clear: both;"></div>
+	<div class="itemFoot">
+	<span class="itemAdminLink"><?php echo $this->_tpl_vars['story']['adminlink']; ?>
+</span> <span class="itemPermaLink"></span>
+	</div>
+</div>
Index: /temp/test-xoops.ec-cube.net/html/templates_c/%%42^428^428512AB%%db%3Asystem_block_mainmenu.html.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/templates_c/%%42^428^428512AB%%db%3Asystem_block_mainmenu.html.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/templates_c/%%42^428^428512AB%%db%3Asystem_block_mainmenu.html.php	(revision 405)
@@ -0,0 +1,19 @@
+<?php /* Smarty version 2.6.12, created on 2006-11-28 11:42:05
+         compiled from db:system_block_mainmenu.html */ ?>
+<div class="blockContent"><div class="blockContent"><table cellspacing="0">
+	<tr>
+		<td id="mainmenu">
+		<a class="menuTop" href="/"><img src="/themes/default/img/left/mainmenu_arrow.gif">&nbsp;¥È¥Ã¥×¥Ú¡¼¥¸</a>
+		<a class="menuTop" href="/modules/tinyd0/index.php?id=5"><img src="/themes/default/img/left/mainmenu_arrow.gif">&nbsp;EC-CUBE¤Ë¤Ä¤¤¤Æ</a>
+		<a class="menuTop" href="/modules/tinyd0/index.php?id=3"><img src="/themes/default/img/left/mainmenu_arrow.gif">&nbsp;³«È¯¥Á¡¼¥à¾Ò²ð</a>
+		<a class="menuTop" href="/modules/tinyd0/index.php?id=2"><img src="/themes/default/img/left/mainmenu_arrow.gif">&nbsp;¥í¡¼¥É¥Þ¥Ã¥×</a>
+		<a class="menuTop" href="/modules/news/"><img src="/themes/default/img/left/mainmenu_arrow.gif">&nbsp;¥Ë¥å¡¼¥¹</a>
+		<a class="menuTop" href="/modules/tinyd0/index.php?id=1"><img src="/themes/default/img/left/mainmenu_arrow.gif">&nbsp;¥ê¥ê¡¼¥¹¥Î¡¼¥È</a>
+		<a class="menuTop" href="/modules/tinyd0/index.php?id=4"><img src="/themes/default/img/left/mainmenu_arrow.gif">&nbsp;¥À¥¦¥ó¥í¡¼¥É</a>
+		<span class="menuMain"><img src="/themes/default/img/left/mainmenu_arrow.gif">&nbsp;¥ê¥ó¥¯½¸</span>
+		<a class="menuSub" href="http://www.ec-cube.net/" target="_blank"><img src="/themes/default/img/left/submenu_arrow.gif">&nbsp;EC-CUBE¥ª¥Õ¥£¥·¥ã¥ë¥µ¥¤¥È</a>
+		<a class="menuSub" href="http://wiki.ec-cube.net/" target="_blank"><img src="/themes/default/img/left/submenu_arrow.gif">&nbsp;EC-CUBE¥Þ¥Ë¥å¥¢¥ë¥µ¥¤¥È</a>
+		</td>
+	</tr>
+	<tr><td height="10"></td></tr>
+</table></div></div>
Index: /temp/test-xoops.ec-cube.net/html/templates_c/%%E0^E02^E02EC780%%db%3ArssfitJ_rss.html.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/templates_c/%%E0^E02^E02EC780%%db%3ArssfitJ_rss.html.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/templates_c/%%E0^E02^E02EC780%%db%3ArssfitJ_rss.html.php	(revision 405)
@@ -0,0 +1,65 @@
+<?php /* Smarty version 2.6.12, created on 2006-11-24 11:10:49
+         compiled from db:rssfitJ_rss.html */ ?>
+<?php echo '<?xml'; ?>
+ version="1.0" encoding="<?php echo $this->_tpl_vars['rssj_encoding']; ?>
+"<?php echo '?>'; ?>
+
+<?php echo '<?xml'; ?>
+-stylesheet href="rss.css" type="text/css"<?php echo '?>'; ?>
+
+<rss version="2.0">
+	<channel>
+		<title><?php echo $this->_tpl_vars['channel_title']; ?>
+</title>
+		<link><?php echo $this->_tpl_vars['xoops_url']; ?>
+/</link>
+		<description><?php echo $this->_tpl_vars['channel_desc']; ?>
+</description>
+		<language><?php echo $this->_tpl_vars['xoops_langcode']; ?>
+</language>
+		<copyright><?php echo $this->_tpl_vars['channel_copyright']; ?>
+</copyright>
+		<lastBuildDate><?php echo $this->_tpl_vars['channel_lastbuild']; ?>
+</lastBuildDate>
+		<docs>http://backend.userland.com/rss/</docs>
+		<generator><?php echo $this->_tpl_vars['channel_generator']; ?>
+</generator>
+		<managingEditor><?php echo $this->_tpl_vars['channel_editor']; ?>
+</managingEditor>
+		<webMaster><?php echo $this->_tpl_vars['channel_webmaster']; ?>
+</webMaster>
+<?php if ($this->_tpl_vars['channel_ttl'] > 0): ?>		<ttl><?php echo $this->_tpl_vars['channel_ttl']; ?>
+</ttl>
+<?php endif; ?>
+		<image>
+			<title><?php echo $this->_tpl_vars['channel_title']; ?>
+</title>
+			<url><?php echo $this->_tpl_vars['xoops_url']; ?>
+/images/logo.gif</url>
+			<link><?php echo $this->_tpl_vars['xoops_url']; ?>
+/</link>
+			<width>144</width>
+			<height>80</height>
+		</image>
+<?php $_from = $this->_tpl_vars['items']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
+    foreach ($_from as $this->_tpl_vars['item']):
+?>
+		<item>
+			<title><?php echo $this->_tpl_vars['item']['title']; ?>
+</title>
+			<description><?php echo $this->_tpl_vars['item']['description']; ?>
+</description>
+			<pubDate><?php echo $this->_tpl_vars['item']['pubdate']; ?>
+</pubDate>
+<?php if ($this->_tpl_vars['item']['category'] != ""): ?>			<category<?php if ($this->_tpl_vars['item']['domain'] != ""): ?> domain="<?php echo $this->_tpl_vars['item']['domain']; ?>
+"<?php endif; ?>><?php echo $this->_tpl_vars['item']['category']; ?>
+</category>
+<?php endif; ?>
+			<link><?php echo $this->_tpl_vars['item']['link']; ?>
+</link>
+			<guid><?php echo $this->_tpl_vars['item']['guid']; ?>
+</guid>
+		</item>
+<?php endforeach; endif; unset($_from); ?>
+	</channel>
+</rss>
Index: /temp/test-xoops.ec-cube.net/html/templates_c/%%6E^6E8^6E8C036B%%db%3Asystem_block_login.html.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/templates_c/%%6E^6E8^6E8C036B%%db%3Asystem_block_login.html.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/templates_c/%%6E^6E8^6E8C036B%%db%3Asystem_block_login.html.php	(revision 405)
@@ -0,0 +1,88 @@
+<?php /* Smarty version 2.6.12, created on 2006-11-28 16:26:49
+         compiled from db:system_block_login.html */ ?>
+<div class="blockContent"><div style="width: 180px; background-color: #b1b5c2;">
+<table border="0" cellspacing="0" cellpadding="0" style="width: 170px; margin: 0 auto; text-align: center;">
+	<tr><td height="5"></td></tr>
+	<tr>
+		<td colspan="3"><img src="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/themes/default/img/left/login_top.gif" width="170" height="10" alt=""></td>
+	</tr>
+	<tr>
+		<td bgcolor="#e6e8ec" rowspan="2"><img src="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/themes/default/img/_.gif" width="1" height="10" alt=""></td>
+		<td bgcolor="#c9ccd5"><img src="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/themes/default/img/_.gif" width="168" height="1" alt=""></td>
+		<td bgcolor="#e6e8ec" rowspan="2"><img src="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/themes/default/img/_.gif" width="1" height="10" alt=""></td>
+	</tr>
+	<tr>
+		<td bgcolor="#c9ccd5" align="center">
+		<table border="0" cellspacing="0" cellpadding="0" style="width: 150px; text-align: left;">
+		<form style="margin-top: 0px;" action="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/user.php" method="post">
+			<tr>
+				<td><label for="uname"><img src="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/themes/default/img/left/login_user.gif" width="118" height="11" alt="¥æ¡¼¥¶ID ¤Þ¤¿¤Ï e-mail¡§"></label></td>
+			</tr>
+			<tr><td height="5"></td></tr>
+			<tr>
+				<td><input type="text" name="uname" id="uname" size="25" value="" maxlength="25" style="width:110pt; height:12pt" /></td>
+			</tr>
+			<tr><td height="10"></td></tr>
+			<tr>
+				<td><label for="password"><img src="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/themes/default/img/left/login_pass.gif" width="56" height="10" alt="¥Ñ¥¹¥ï¡¼¥É¡§"></label></td>
+			</tr>
+			<tr><td height="5"></td></tr>
+			<tr>
+				<td><input type="password" id="password" name="pass" size="25" maxlength="25" style="width:110pt; height:12pt" /></td>
+			</tr>
+			<tr><td height="5"></td></tr>
+			<tr><td><input type="checkbox" name="rememberme" id="rememberme" value="On" class ="formButton" /><label for="rememberme">¼¡²ó¤«¤é¼«Æ°¥í¥°¥¤¥ó</label></td></tr>
+			<tr><td height="8"></td></tr>
+			<tr>
+				<td style="text-align: center">
+				<input type="hidden" name="xoops_redirect" value="/" />
+				<input type="hidden" name="op" value="login" />
+				<input type="submit" value="¥í¥°¥¤¥ó" />
+				</td>
+			</tr>
+			<tr><td height="10"></td></tr>
+		</form>
+		</table>
+		</td>
+	</tr>
+</table>
+<table border="0" cellspacing="0" cellpadding="0" style="width: 170px; margin: 0 auto; text-align: center;">
+	<tr>
+		<td bgcolor="#e6e8ec" rowspan="2"><img src="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/themes/default/img/_.gif" width="1" height="10" alt=""></td>
+		<td bgcolor="#e6e8ec"><img src="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/themes/default/img/_.gif" width="168" height="1" alt=""></td>
+		<td bgcolor="#e6e8ec" rowspan="2"><img src="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/themes/default/img/_.gif" width="1" height="10" alt=""></td>
+	</tr>
+	<tr>
+		<td bgcolor="#c9ccd5" align="center">
+		<table border="0" cellspacing="0" cellpadding="0" style="width: 150px; text-align: left;">
+			<tr><td height="10"></td></tr>
+			<tr>
+				<td style="font-size: x-small;"><a href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/register.php"><img src="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/themes/default/img/left/login_arrow.gif" width="7" height="7" alt="" border="0">&nbsp;¿·µ¬ÅÐÏ¿</a></td>
+			</tr>
+			<tr><td height="5"></td></tr>
+			<tr>
+				<td style="font-size: x-small;"><a href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/user.php#lost"><img src="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/themes/default/img/left/login_arrow.gif" width="7" height="7" alt="" border="0">&nbsp;¥Ñ¥¹¥ï¡¼¥ÉÊ¶¼º</a></td>
+			</tr>
+		</table>
+	</tr>
+	<tr>
+		<td colspan="3"><img src="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/themes/default/img/left/login_bottom.gif" width="170" height="10" alt=""></td>
+	</tr>
+	<tr><td height="5"></td></tr>
+</table>
+</div></div>
Index: /temp/test-xoops.ec-cube.net/html/templates_c/%%47^47C^47C1B274%%db%3Amydownloads_modfile.html.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/templates_c/%%47^47C^47C1B274%%db%3Amydownloads_modfile.html.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/templates_c/%%47^47C^47C1B274%%db%3Amydownloads_modfile.html.php	(revision 405)
@@ -0,0 +1,82 @@
+<?php /* Smarty version 2.6.12, created on 2006-11-24 20:21:34
+         compiled from db:mydownloads_modfile.html */ ?>
+<br /><br />
+
+<p align="center">
+    <a href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/modules/mydownloads/index.php"><img src="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/modules/mydownloads/images/logo-en.gif" alt="" /></a>
+</p>
+
+<br /><br /><br />
+<h4><?php echo $this->_tpl_vars['lang_requestmod']; ?>
+</h4>
+<form action="modfile.php" method="post">
+<table width="80%">
+  <tr>
+    <td align="right"><?php echo $this->_tpl_vars['lang_fileid']; ?>
+</td>
+    <td><b><?php echo $this->_tpl_vars['file']['id']; ?>
+</b></td>
+  </tr>
+  <tr>
+    <td align="right"><?php echo $this->_tpl_vars['lang_sitetitle']; ?>
+</td>
+    <td><input type="text" name="title" size="50" maxlength="100" value="<?php echo $this->_tpl_vars['file']['title']; ?>
+"></td>
+  </tr>
+  <tr>
+    <td align="right"><?php echo $this->_tpl_vars['lang_siteurl']; ?>
+</td>
+    <td><input type="text" name="url" size="50" maxlength="100" value="<?php echo $this->_tpl_vars['file']['url']; ?>
+"></td>
+  </tr>
+  <tr>
+    <td align="right"><?php echo $this->_tpl_vars['lang_category']; ?>
+</td>
+    <td><?php echo $this->_tpl_vars['category_selbox']; ?>
+</td>
+  </tr>
+  <tr>
+    <td></td><td></td>
+  </tr>
+  <tr>
+    <td align="right"><?php echo $this->_tpl_vars['lang_homepage']; ?>
+</td>
+    <td><input type="text" name="homepage" size="50" maxlength="100" value="<?php echo $this->_tpl_vars['file']['homepage']; ?>
+"></td>
+  </tr>
+  <tr>
+    <td align="right"><?php echo $this->_tpl_vars['lang_version']; ?>
+</td>
+    <td><input type="text" name="version" size="10" maxlength="20" value="<?php echo $this->_tpl_vars['file']['version']; ?>
+"></td>
+  </tr>
+  <tr>
+    <td align="right"><?php echo $this->_tpl_vars['lang_size']; ?>
+</td>
+    <td><input type="text" name="size" size="10" maxlength="20" value="<?php echo $this->_tpl_vars['file']['size']; ?>
+"> <?php echo $this->_tpl_vars['lang_bytes']; ?>
+</td>
+  </tr>
+  <tr>
+    <td align="right"><?php echo $this->_tpl_vars['lang_platform']; ?>
+</td>
+    <td><input type="text" name="platform" size="50" maxlength="50" value="<?php echo $this->_tpl_vars['file']['plataform']; ?>
+"></td>
+  </tr>
+  <tr>
+    <td align="right" valign="top"><?php echo $this->_tpl_vars['lang_description']; ?>
+</td>
+    <td><textarea name=description cols=60 rows=5><?php echo $this->_tpl_vars['file']['description']; ?>
+</textarea></td>
+  </tr>
+  <tr>
+    <td colspan="2" align="center"><br /><input type="hidden" name="logourl" value="<?php echo $this->_tpl_vars['file']['logourl']; ?>
+"></input><input type="hidden" name="lid" value="<?php echo $this->_tpl_vars['file']['id']; ?>
+"></input><input type="submit" name="submit" value="<?php echo $this->_tpl_vars['lang_sendrequest']; ?>
+"></input>&nbsp;<input type=button value="<?php echo $this->_tpl_vars['lang_cancel']; ?>
+" onclick="javascript:history.go(-1)"></input></td>
+  </tr>
+</table>
+</form>
Index: /temp/test-xoops.ec-cube.net/html/templates_c/%%46^469^4694552B%%db%3Asystem_notification_list.html.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/templates_c/%%46^469^4694552B%%db%3Asystem_notification_list.html.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/templates_c/%%46^469^4694552B%%db%3Asystem_notification_list.html.php	(revision 405)
@@ -0,0 +1,79 @@
+<?php /* Smarty version 2.6.12, created on 2006-11-24 13:14:42
+         compiled from db:system_notification_list.html */ ?>
+<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
+smarty_core_load_plugins(array('plugins' => array(array('function', 'cycle', 'db:system_notification_list.html', 20, false),)), $this); ?>
+<h4><?php echo $this->_tpl_vars['lang_activenotifications']; ?>
+</h4>
+<form name="notificationlist" action="notifications.php" method="post">
+<table class="outer">
+  <tr>
+    <th><input name="allbox" id="allbox" onclick="xoopsCheckAll('notificationlist', 'allbox');" type="checkbox" value="<?php echo $this->_tpl_vars['lang_checkall']; ?>
+" /></th>
+    <th><?php echo $this->_tpl_vars['lang_event']; ?>
+</th>
+    <th><?php echo $this->_tpl_vars['lang_category']; ?>
+</th>
+    <th><?php echo $this->_tpl_vars['lang_itemid']; ?>
+</th>
+    <th><?php echo $this->_tpl_vars['lang_itemname']; ?>
+</th>
+  </tr>
+  <?php $_from = $this->_tpl_vars['modules']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
+    foreach ($_from as $this->_tpl_vars['module']):
+?>
+  <tr>
+    <td class="head"><input name="del_mod[<?php echo $this->_tpl_vars['module']['id']; ?>
+]" id="del_mod[<?php echo $this->_tpl_vars['module']['id']; ?>
+]" onclick="xoopsCheckGroup('notificationlist', 'del_mod[<?php echo $this->_tpl_vars['module']['id']; ?>
+]', 'del_not[<?php echo $this->_tpl_vars['module']['id']; ?>
+][]');" type="checkbox" value="<?php echo $this->_tpl_vars['module']['id']; ?>
+" /></td>
+    <td class="head" colspan="4"><?php echo $this->_tpl_vars['lang_module']; ?>
+: <?php echo $this->_tpl_vars['module']['name']; ?>
+</td>
+  </tr>
+  <?php $_from = $this->_tpl_vars['module']['categories']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
+    foreach ($_from as $this->_tpl_vars['category']):
+?>
+  <?php $_from = $this->_tpl_vars['category']['items']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
+    foreach ($_from as $this->_tpl_vars['item']):
+?>
+  <?php $_from = $this->_tpl_vars['item']['notifications']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
+    foreach ($_from as $this->_tpl_vars['notification']):
+?>
+  <tr>
+    <?php echo smarty_function_cycle(array('values' => "odd,even",'assign' => 'class'), $this);?>
+
+    <td class="<?php echo $this->_tpl_vars['class']; ?>
+"><input type="checkbox" name="del_not[<?php echo $this->_tpl_vars['module']['id']; ?>
+][]" id="del_not[<?php echo $this->_tpl_vars['module']['id']; ?>
+][]" value="<?php echo $this->_tpl_vars['notification']['id']; ?>
+" /></td>
+    <td class="<?php echo $this->_tpl_vars['class']; ?>
+"><?php echo $this->_tpl_vars['notification']['event_title']; ?>
+</td>
+    <td class="<?php echo $this->_tpl_vars['class']; ?>
+"><?php echo $this->_tpl_vars['notification']['category_title']; ?>
+</td>
+    <td class="<?php echo $this->_tpl_vars['class']; ?>
+"><?php if ($this->_tpl_vars['item']['id'] != 0):  echo $this->_tpl_vars['item']['id'];  endif; ?></td>
+    <td class="<?php echo $this->_tpl_vars['class']; ?>
+"><?php if ($this->_tpl_vars['item']['id'] != 0):  if ($this->_tpl_vars['item']['url'] != ''): ?><a href="<?php echo $this->_tpl_vars['item']['url']; ?>
+"><?php endif;  echo $this->_tpl_vars['item']['name'];  if ($this->_tpl_vars['item']['url'] != ''): ?></a><?php endif;  endif; ?></td>
+  </tr>
+  <?php endforeach; endif; unset($_from); ?>
+  <?php endforeach; endif; unset($_from); ?>
+  <?php endforeach; endif; unset($_from); ?>
+  <?php endforeach; endif; unset($_from); ?>
+  <tr>
+    <td class="foot" colspan="5">
+      <input type="submit" name="delete_cancel" value="<?php echo $this->_tpl_vars['lang_cancel']; ?>
+" />
+      <input type="reset" name="delete_reset" value="<?php echo $this->_tpl_vars['lang_clear']; ?>
+" />
+      <input type="submit" name="delete" value="<?php echo $this->_tpl_vars['lang_delete']; ?>
+" />
+    </td>
+  </tr>
+</table>
+</form>
Index: /temp/test-xoops.ec-cube.net/html/templates_c/%%9A^9AC^9ACC094F%%db%3Amydownloads_singlefile.html.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/templates_c/%%9A^9AC^9ACC094F%%db%3Amydownloads_singlefile.html.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/templates_c/%%9A^9AC^9ACC094F%%db%3Amydownloads_singlefile.html.php	(revision 405)
@@ -0,0 +1,67 @@
+<?php /* Smarty version 2.6.12, created on 2006-11-30 14:03:31
+         compiled from db:mydownloads_singlefile.html */ ?>
+<br /><br />
+
+<p align="center">
+    <a href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/modules/mydownloads/index.php"><img src="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/modules/mydownloads/images/logo-en.gif" alt="" /></a>
+</p>
+
+<br /><br /><br />
+<div>
+<table width="97%" cellspacing="2" cellpadding="2" border="0">
+  <tr>
+    <td class="newstitle"><?php echo $this->_tpl_vars['category_path']; ?>
+</td>
+  </tr>
+</table>
+</div>
+<br />
+<table width="100%" cellspacing="0" cellpadding="10" border="0">
+  <tr>
+    <td width="100%" align="center" valign="top">
+    <?php $_smarty_tpl_vars = $this->_tpl_vars;
+$this->_smarty_include(array('smarty_include_tpl_file' => "db:mydownloads_download.html", 'smarty_include_vars' => array('down' => $this->_tpl_vars['file'])));
+$this->_tpl_vars = $_smarty_tpl_vars;
+unset($_smarty_tpl_vars);
+ ?>   
+    </td>
+  </tr>
+</table>
+
+<div style="text-align: center; padding: 3px; margin:3px;">
+  <?php echo $this->_tpl_vars['commentsnav']; ?>
+
+  <?php echo $this->_tpl_vars['lang_notice']; ?>
+
+</div>
+
+<div style="margin:3px; padding: 3px;">
+<!-- start comments loop -->
+<?php if ($this->_tpl_vars['comment_mode'] == 'flat'): ?>
+  <?php $_smarty_tpl_vars = $this->_tpl_vars;
+$this->_smarty_include(array('smarty_include_tpl_file' => "db:system_comments_flat.html", 'smarty_include_vars' => array()));
+$this->_tpl_vars = $_smarty_tpl_vars;
+unset($_smarty_tpl_vars);
+ ?>
+<?php elseif ($this->_tpl_vars['comment_mode'] == 'thread'): ?>
+  <?php $_smarty_tpl_vars = $this->_tpl_vars;
+$this->_smarty_include(array('smarty_include_tpl_file' => "db:system_comments_thread.html", 'smarty_include_vars' => array()));
+$this->_tpl_vars = $_smarty_tpl_vars;
+unset($_smarty_tpl_vars);
+ ?>
+<?php elseif ($this->_tpl_vars['comment_mode'] == 'nest'): ?>
+  <?php $_smarty_tpl_vars = $this->_tpl_vars;
+$this->_smarty_include(array('smarty_include_tpl_file' => "db:system_comments_nest.html", 'smarty_include_vars' => array()));
+$this->_tpl_vars = $_smarty_tpl_vars;
+unset($_smarty_tpl_vars);
+ ?>
+<?php endif; ?>
+<!-- end comments loop -->
+</div>
+<?php $_smarty_tpl_vars = $this->_tpl_vars;
+$this->_smarty_include(array('smarty_include_tpl_file' => "db:system_notification_select.html", 'smarty_include_vars' => array()));
+$this->_tpl_vars = $_smarty_tpl_vars;
+unset($_smarty_tpl_vars);
+ ?>
Index: /temp/test-xoops.ec-cube.net/html/templates_c/%%F6^F69^F692B736%%db%3Asystem_redirect.html.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/templates_c/%%F6^F69^F692B736%%db%3Asystem_redirect.html.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/templates_c/%%F6^F69^F692B736%%db%3Asystem_redirect.html.php	(revision 405)
@@ -0,0 +1,21 @@
+<?php /* Smarty version 2.6.12, created on 2006-11-28 11:34:56
+         compiled from db:system_redirect.html */ ?>
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $this->_tpl_vars['xoops_charset']; ?>
+" />
+<meta http-equiv="Refresh" content="<?php echo $this->_tpl_vars['time']; ?>
+; url=<?php echo $this->_tpl_vars['url']; ?>
+" />
+<title><?php echo $this->_tpl_vars['xoops_sitename']; ?>
+</title>
+</head>
+<body>
+<div style="text-align:center; background-color: #EBEBEB; border-top: 1px solid #FFFFFF; border-left: 1px solid #FFFFFF; border-right: 1px solid #AAAAAA; border-bottom: 1px solid #AAAAAA; font-weight : bold;">
+  <h4><?php echo $this->_tpl_vars['message']; ?>
+</h4>
+  <p><?php echo $this->_tpl_vars['lang_ifnotreload']; ?>
+</p>
+</div>
+</body>
+</html>
Index: /temp/test-xoops.ec-cube.net/html/templates_c/%%5C^5CF^5CFF81B2%%db%3Anewbb_viewtopic_thread.html.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/templates_c/%%5C^5CF^5CFF81B2%%db%3Anewbb_viewtopic_thread.html.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/templates_c/%%5C^5CF^5CFF81B2%%db%3Anewbb_viewtopic_thread.html.php	(revision 405)
@@ -0,0 +1,137 @@
+<?php /* Smarty version 2.6.12, created on 2006-11-28 11:38:23
+         compiled from db:newbb_viewtopic_thread.html */ ?>
+<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
+smarty_core_load_plugins(array('plugins' => array(array('function', 'cycle', 'db:newbb_viewtopic_thread.html', 45, false),)), $this); ?>
+<!-- start module contents -->
+<table border="0" cellpadding='5' align='center'>
+  <tr>
+    <td align='left'><img src='<?php echo $this->_tpl_vars['xoops_url']; ?>
+/modules/newbb/images/folder.gif' alt='' /> <a href='<?php echo $this->_tpl_vars['xoops_url']; ?>
+/modules/newbb/index.php'><?php echo $this->_tpl_vars['lang_forum_index']; ?>
+</a><br />&nbsp;&nbsp;<img src='<?php echo $this->_tpl_vars['xoops_url']; ?>
+/modules/newbb/images/folder.gif' alt='' /> <a href='<?php echo $this->_tpl_vars['xoops_url']; ?>
+/modules/newbb/viewforum.php?forum=<?php echo $this->_tpl_vars['forum_id']; ?>
+'><?php echo $this->_tpl_vars['forum_name']; ?>
+</a>
+<br />&nbsp;&nbsp;&nbsp;&nbsp;<img src='<?php echo $this->_tpl_vars['xoops_url']; ?>
+/modules/newbb/images/folder.gif' alt='' /> <b><?php echo $this->_tpl_vars['topic_title']; ?>
+</b></td><td align='right'><?php echo $this->_tpl_vars['forum_post_or_register']; ?>
+</td>
+  </tr>
+</table>
+
+<img src="images/pixel.gif" height="5" alt="" /><br />
+
+<!-- start topic thread -->
+<table cellpadding="4" width="100%">
+  <tr>
+    <td align="left"><a href="viewtopic.php?viewmode=flat&amp;topic_id=<?php echo $this->_tpl_vars['topic_id']; ?>
+&amp;forum=<?php echo $this->_tpl_vars['forum_id']; ?>
+"><?php echo $this->_tpl_vars['lang_flat']; ?>
+</a></td>
+    <td align="right"><a href="viewtopic.php?viewmode=thread&amp;topic_id=<?php echo $this->_tpl_vars['topic_id']; ?>
+&amp;forum=<?php echo $this->_tpl_vars['forum_id']; ?>
+&amp;move=prev&amp;topic_time=<?php echo $this->_tpl_vars['topic_time']; ?>
+"><?php echo $this->_tpl_vars['lang_prevtopic']; ?>
+</a> | <a href="viewtopic.php?viewmode=thread&amp;topic_id=<?php echo $this->_tpl_vars['topic_id']; ?>
+&amp;forum=<?php echo $this->_tpl_vars['forum_id']; ?>
+&amp;move=next&amp;topic_time=<?php echo $this->_tpl_vars['topic_time']; ?>
+"><?php echo $this->_tpl_vars['lang_nexttopic']; ?>
+</a></td>
+  </tr>
+</table>
+<table cellspacing="1" class="outer">
+  <tr>
+    <th width='20%'><?php echo $this->_tpl_vars['lang_poster']; ?>
+</th>
+    <th><?php echo $this->_tpl_vars['lang_thread']; ?>
+</th>
+  </tr>
+  <?php $_from = $this->_tpl_vars['topic_posts']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
+    foreach ($_from as $this->_tpl_vars['topic_post']):
+?>
+    <?php $_smarty_tpl_vars = $this->_tpl_vars;
+$this->_smarty_include(array('smarty_include_tpl_file' => "db:newbb_thread.html", 'smarty_include_vars' => array('topic_post' => $this->_tpl_vars['topic_post'])));
+$this->_tpl_vars = $_smarty_tpl_vars;
+unset($_smarty_tpl_vars);
+ ?>
+  <?php endforeach; endif; unset($_from); ?>
+</table>
+
+<table cellpadding="4" width="100%">
+  <tr>
+    <td align="left"><a href="viewtopic.php?viewmode=flat&amp;order=<?php echo $this->_tpl_vars['order_current']; ?>
+&amp;topic_id=<?php echo $this->_tpl_vars['topic_id']; ?>
+&amp;forum=<?php echo $this->_tpl_vars['forum_id']; ?>
+"><?php echo $this->_tpl_vars['lang_flat']; ?>
+</a></td>
+    <td align="right"><a href="viewtopic.php?viewmode=thread&amp;topic_id=<?php echo $this->_tpl_vars['topic_id']; ?>
+&amp;forum=<?php echo $this->_tpl_vars['forum_id']; ?>
+&amp;move=prev&amp;topic_time=<?php echo $this->_tpl_vars['topic_time']; ?>
+"><?php echo $this->_tpl_vars['lang_prevtopic']; ?>
+</a> | <a href="viewtopic.php?viewmode=thread&amp;topic_id=<?php echo $this->_tpl_vars['topic_id']; ?>
+&amp;forum=<?php echo $this->_tpl_vars['forum_id']; ?>
+&amp;move=next&amp;topic_time=<?php echo $this->_tpl_vars['topic_time']; ?>
+"><?php echo $this->_tpl_vars['lang_nexttopic']; ?>
+</a></td>
+  </tr>
+</table>
+
+<br />
+
+<!-- start topic tree -->
+<table class="outer" cellspacing='1'>
+  <tr align='left'>
+    <th width='50%'><?php echo $this->_tpl_vars['lang_subject']; ?>
+</th>
+    <th width='20%'><?php echo $this->_tpl_vars['lang_poster']; ?>
+</th>
+    <th><?php echo $this->_tpl_vars['lang_date']; ?>
+</th>
+  </tr>
+  <?php $_from = $this->_tpl_vars['topic_trees']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
+    foreach ($_from as $this->_tpl_vars['topic_tree']):
+?>
+  <tr class="<?php echo smarty_function_cycle(array('values' => "even,odd"), $this);?>
+">
+    <td><?php echo $this->_tpl_vars['topic_tree']['post_prefix']; ?>
+ <?php echo $this->_tpl_vars['topic_tree']['post_image']; ?>
+ <?php echo $this->_tpl_vars['topic_tree']['post_title']; ?>
+</td>
+    <td><?php echo $this->_tpl_vars['topic_tree']['poster_uname']; ?>
+</td>
+    <td><?php echo $this->_tpl_vars['topic_tree']['post_date']; ?>
+</td>
+  </tr>
+  <?php endforeach; endif; unset($_from); ?>
+</table>
+<!-- end topic tree -->
+<!-- end topic thread -->
+
+<img src="images/pixel.gif" height="5" alt="" /><br />
+
+<table width="100%" class="outer" cellspacing="0">
+  <tr class='foot' valign="top">
+    <td align='left'> <?php echo $this->_tpl_vars['forum_post_or_register']; ?>
+</td>
+    <td align='right'><?php echo $this->_tpl_vars['forum_jumpbox']; ?>
+ </td>
+  </tr>
+  <tr class='foot' valign="bottom">
+    <?php if ($this->_tpl_vars['viewer_is_admin'] == true): ?>
+    <td colspan='2' align='center'>&nbsp;<?php echo $this->_tpl_vars['topic_lock_image']; ?>
+&nbsp;<?php echo $this->_tpl_vars['topic_move_image']; ?>
+&nbsp;<?php echo $this->_tpl_vars['topic_delete_image']; ?>
+&nbsp;<?php echo $this->_tpl_vars['topic_sticky_image']; ?>
+&nbsp;</td>
+    <?php else: ?>
+    <td colspan='2'>&nbsp;</td>
+    <?php endif; ?>
+  </tr>
+</table>
+<?php $_smarty_tpl_vars = $this->_tpl_vars;
+$this->_smarty_include(array('smarty_include_tpl_file' => 'db:system_notification_select.html', 'smarty_include_vars' => array()));
+$this->_tpl_vars = $_smarty_tpl_vars;
+unset($_smarty_tpl_vars);
+ ?>
+<!-- end module contents -->
Index: /temp/test-xoops.ec-cube.net/html/templates_c/%%80^806^8068F73F%%db%3Asystem_comments_nest.html.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/templates_c/%%80^806^8068F73F%%db%3Asystem_comments_nest.html.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/templates_c/%%80^806^8068F73F%%db%3Asystem_comments_nest.html.php	(revision 405)
@@ -0,0 +1,70 @@
+<?php /* Smarty version 2.6.12, created on 2006-11-30 14:03:31
+         compiled from db:system_comments_nest.html */ ?>
+<?php unset($this->_sections['i']);
+$this->_sections['i']['name'] = 'i';
+$this->_sections['i']['loop'] = is_array($_loop=$this->_tpl_vars['comments']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
+$this->_sections['i']['show'] = true;
+$this->_sections['i']['max'] = $this->_sections['i']['loop'];
+$this->_sections['i']['step'] = 1;
+$this->_sections['i']['start'] = $this->_sections['i']['step'] > 0 ? 0 : $this->_sections['i']['loop']-1;
+if ($this->_sections['i']['show']) {
+    $this->_sections['i']['total'] = $this->_sections['i']['loop'];
+    if ($this->_sections['i']['total'] == 0)
+        $this->_sections['i']['show'] = false;
+} else
+    $this->_sections['i']['total'] = 0;
+if ($this->_sections['i']['show']):
+
+            for ($this->_sections['i']['index'] = $this->_sections['i']['start'], $this->_sections['i']['iteration'] = 1;
+                 $this->_sections['i']['iteration'] <= $this->_sections['i']['total'];
+                 $this->_sections['i']['index'] += $this->_sections['i']['step'], $this->_sections['i']['iteration']++):
+$this->_sections['i']['rownum'] = $this->_sections['i']['iteration'];
+$this->_sections['i']['index_prev'] = $this->_sections['i']['index'] - $this->_sections['i']['step'];
+$this->_sections['i']['index_next'] = $this->_sections['i']['index'] + $this->_sections['i']['step'];
+$this->_sections['i']['first']      = ($this->_sections['i']['iteration'] == 1);
+$this->_sections['i']['last']       = ($this->_sections['i']['iteration'] == $this->_sections['i']['total']);
+?>
+<br />
+<table cellspacing="1" class="outer">
+  <tr>
+    <th width="20%"><?php echo $this->_tpl_vars['lang_poster']; ?>
+</th>
+    <th><?php echo $this->_tpl_vars['lang_thread']; ?>
+</th>
+  </tr>
+  <?php $_smarty_tpl_vars = $this->_tpl_vars;
+$this->_smarty_include(array('smarty_include_tpl_file' => "db:system_comment.html", 'smarty_include_vars' => array('comment' => $this->_tpl_vars['comments'][$this->_sections['i']['index']])));
+$this->_tpl_vars = $_smarty_tpl_vars;
+unset($_smarty_tpl_vars);
+ ?>
+</table>
+
+<!-- start comment replies -->
+<?php $_from = $this->_tpl_vars['comments'][$this->_sections['i']['index']]['replies']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
+    foreach ($_from as $this->_tpl_vars['reply']):
+?>
+<br />
+<table cellspacing="0" border="0">
+  <tr>
+    <td width="<?php echo $this->_tpl_vars['reply']['prefix']; ?>
+"></td>
+    <td>
+      <table class="outer" cellspacing="1">
+        <tr>
+          <th width="20%"><?php echo $this->_tpl_vars['lang_poster']; ?>
+</th>
+          <th><?php echo $this->_tpl_vars['lang_thread']; ?>
+</th>
+        </tr>
+        <?php $_smarty_tpl_vars = $this->_tpl_vars;
+$this->_smarty_include(array('smarty_include_tpl_file' => "db:system_comment.html", 'smarty_include_vars' => array('comment' => $this->_tpl_vars['reply'])));
+$this->_tpl_vars = $_smarty_tpl_vars;
+unset($_smarty_tpl_vars);
+ ?>
+      </table>
+    </td>
+  </tr>
+</table>
+<?php endforeach; endif; unset($_from); ?>
+<!-- end comment tree -->
+<?php endfor; endif; ?>
Index: /temp/test-xoops.ec-cube.net/html/templates_c/%%BE^BE1^BE1AA0FF%%db%3Amydownloads_viewcat.html.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/templates_c/%%BE^BE1^BE1AA0FF%%db%3Amydownloads_viewcat.html.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/templates_c/%%BE^BE1^BE1AA0FF%%db%3Amydownloads_viewcat.html.php	(revision 405)
@@ -0,0 +1,119 @@
+<?php /* Smarty version 2.6.12, created on 2006-11-27 13:12:02
+         compiled from db:mydownloads_viewcat.html */ ?>
+<br /><br />
+
+<p align="center">
+    <a href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/modules/mydownloads/index.php"><img src="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/modules/mydownloads/images/logo-en.gif" alt="" /></a>
+</p>
+
+<br /><br /><br />
+<div>
+<table width="97%" cellspacing="0" cellpadding="0" border="0">
+  <tr>
+    <td align="left">
+      <table width="100%" cellspacing="1" cellpadding="2" border="0">
+        <tr>
+          <td class="newstitle" height="18"><b><?php echo $this->_tpl_vars['category_path']; ?>
+</b></td>
+        </tr>
+      </table>
+    </td>
+  </tr>
+  <tr>
+    <td align="center">
+      <table width="90%">
+        <tr><br />
+          <?php $_from = $this->_tpl_vars['subcategories']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
+    foreach ($_from as $this->_tpl_vars['subcat']):
+?>
+            <td align="left"><b><a href="viewcat.php?cid=<?php echo $this->_tpl_vars['subcat']['id']; ?>
+"><?php echo $this->_tpl_vars['subcat']['title']; ?>
+</a></b>&nbsp;(<?php echo $this->_tpl_vars['subcat']['totallinks']; ?>
+)<br /><font class="subcategories"><?php echo $this->_tpl_vars['subcat']['infercategories']; ?>
+</font></td>
+            <?php if (!($this->_tpl_vars['subcat']['count'] % 4)): ?>
+            </tr><tr>
+            <?php endif; ?>
+          <?php endforeach; endif; unset($_from); ?>
+        </tr>
+      </table>
+      <br />
+      <hr />
+
+      <?php if ($this->_tpl_vars['show_links'] == true): ?>
+
+      <?php if ($this->_tpl_vars['show_nav'] == true): ?>
+      <div><?php echo $this->_tpl_vars['lang_sortby']; ?>
+&nbsp;&nbsp;<?php echo $this->_tpl_vars['lang_title']; ?>
+ (<a href="viewcat.php?cid=<?php echo $this->_tpl_vars['category_id']; ?>
+&amp;orderby=titleA"><img src="images/up.gif" border="0" align="middle" alt="" /></a><a href="viewcat.php?cid=<?php echo $this->_tpl_vars['category_id']; ?>
+&amp;orderby=titleD"><img src="images/down.gif" border="0" align="middle" alt="" /></a>)&nbsp;<?php echo $this->_tpl_vars['lang_date']; ?>
+ (<a href="viewcat.php?cid=<?php echo $this->_tpl_vars['category_id']; ?>
+&amp;orderby=dateA"><img src="images/up.gif" border="0" align="middle" alt="" /></a><a href="viewcat.php?cid=<?php echo $this->_tpl_vars['category_id']; ?>
+&amp;orderby=dateD"><img src="images/down.gif" border="0" align="middle" alt="" /></a>)&nbsp;<?php echo $this->_tpl_vars['lang_rating']; ?>
+ (<a href="viewcat.php?cid=<?php echo $this->_tpl_vars['category_id']; ?>
+&amp;orderby=ratingA"><img src="images/up.gif" border="0" align="middle" alt="" /></a><a href="viewcat.php?cid=<?php echo $this->_tpl_vars['category_id']; ?>
+&amp;orderby=ratingD"><img src="images/down.gif" border="0" align="middle" alt="" /></a>)&nbsp;<?php echo $this->_tpl_vars['lang_popularity']; ?>
+ (<a href="viewcat.php?cid=<?php echo $this->_tpl_vars['category_id']; ?>
+&amp;orderby=hitsA"><img src="images/up.gif" border="0" align="middle" alt="" /></a><a href="viewcat.php?cid=<?php echo $this->_tpl_vars['category_id']; ?>
+&amp;orderby=hitsD"><img src="images/down.gif" border="0" align="middle" alt="" /></a>)
+      <br /><b><?php echo $this->_tpl_vars['lang_cursortedby']; ?>
+</b>
+      </div>
+      <hr />
+      <?php endif; ?>
+
+    </td>
+  </tr>
+</table>
+<table width="100%" cellspacing="0" cellpadding="10" border="0">
+<tr>
+<td width="100%" align="center" valign="top">
+  <!-- Start link loop -->
+  <?php unset($this->_sections['i']);
+$this->_sections['i']['name'] = 'i';
+$this->_sections['i']['loop'] = is_array($_loop=$this->_tpl_vars['file']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
+$this->_sections['i']['show'] = true;
+$this->_sections['i']['max'] = $this->_sections['i']['loop'];
+$this->_sections['i']['step'] = 1;
+$this->_sections['i']['start'] = $this->_sections['i']['step'] > 0 ? 0 : $this->_sections['i']['loop']-1;
+if ($this->_sections['i']['show']) {
+    $this->_sections['i']['total'] = $this->_sections['i']['loop'];
+    if ($this->_sections['i']['total'] == 0)
+        $this->_sections['i']['show'] = false;
+} else
+    $this->_sections['i']['total'] = 0;
+if ($this->_sections['i']['show']):
+
+            for ($this->_sections['i']['index'] = $this->_sections['i']['start'], $this->_sections['i']['iteration'] = 1;
+                 $this->_sections['i']['iteration'] <= $this->_sections['i']['total'];
+                 $this->_sections['i']['index'] += $this->_sections['i']['step'], $this->_sections['i']['iteration']++):
+$this->_sections['i']['rownum'] = $this->_sections['i']['iteration'];
+$this->_sections['i']['index_prev'] = $this->_sections['i']['index'] - $this->_sections['i']['step'];
+$this->_sections['i']['index_next'] = $this->_sections['i']['index'] + $this->_sections['i']['step'];
+$this->_sections['i']['first']      = ($this->_sections['i']['iteration'] == 1);
+$this->_sections['i']['last']       = ($this->_sections['i']['iteration'] == $this->_sections['i']['total']);
+?>
+    <?php $_smarty_tpl_vars = $this->_tpl_vars;
+$this->_smarty_include(array('smarty_include_tpl_file' => "db:mydownloads_download.html", 'smarty_include_vars' => array('down' => $this->_tpl_vars['file'][$this->_sections['i']['index']])));
+$this->_tpl_vars = $_smarty_tpl_vars;
+unset($_smarty_tpl_vars);
+ ?>
+  <?php endfor; endif; ?>
+  <!-- End link loop -->
+</td></tr>
+</table>
+<?php echo $this->_tpl_vars['page_nav']; ?>
+
+<?php else: ?>
+    </td>
+  </tr>
+</table>
+<?php endif; ?>
+<?php $_smarty_tpl_vars = $this->_tpl_vars;
+$this->_smarty_include(array('smarty_include_tpl_file' => "db:system_notification_select.html", 'smarty_include_vars' => array()));
+$this->_tpl_vars = $_smarty_tpl_vars;
+unset($_smarty_tpl_vars);
+ ?>
Index: /temp/test-xoops.ec-cube.net/html/templates_c/%%3B^3B7^3B7BFD7A%%db%3Amydownloads_download.html.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/templates_c/%%3B^3B7^3B7BFD7A%%db%3Amydownloads_download.html.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/templates_c/%%3B^3B7^3B7BFD7A%%db%3Amydownloads_download.html.php	(revision 405)
@@ -0,0 +1,80 @@
+<?php /* Smarty version 2.6.12, created on 2006-11-24 20:20:21
+         compiled from db:mydownloads_download.html */ ?>
+<table width='100%' cellspacing='0' class='outer'>
+  <tr>
+    <td class="head" colspan='2' align='left' height="18"><?php echo $this->_tpl_vars['lang_category']; ?>
+ <?php echo $this->_tpl_vars['down']['category']; ?>
+</td>
+  </tr>
+  <tr>
+    <td class='even' width='65%' align='left' valign="bottom"><a href='visit.php?cid=<?php echo $this->_tpl_vars['down']['cid']; ?>
+&amp;lid=<?php echo $this->_tpl_vars['down']['id']; ?>
+' target='_blank'><img src='images/download.gif' border='0' alt='<?php echo $this->_tpl_vars['lang_dlnow']; ?>
+' /><b><?php echo $this->_tpl_vars['down']['title']; ?>
+</b></a></td>
+    <td class='even' align='right' width='35%'><b><?php echo $this->_tpl_vars['lang_version']; ?>
+:</b>&nbsp;<?php echo $this->_tpl_vars['down']['version']; ?>
+<br /><b><?php echo $this->_tpl_vars['lang_subdate']; ?>
+:</b>&nbsp;&nbsp;<?php echo $this->_tpl_vars['down']['updated']; ?>
+</td>
+  </tr>
+  <tr>
+    <td colspan='2' class='odd' align='left'><?php echo $this->_tpl_vars['down']['adminlink']; ?>
+<b><?php echo $this->_tpl_vars['lang_description']; ?>
+</b><br />
+
+<?php if ($this->_tpl_vars['down']['logourl'] != ""): ?>
+   <a href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/modules/mydownloads/visit.php?cid=<?php echo $this->_tpl_vars['down']['cid']; ?>
+&amp;lid=<?php echo $this->_tpl_vars['down']['id']; ?>
+" target="_blank"><img src="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/modules/mydownloads/images/shots/<?php echo $this->_tpl_vars['down']['logourl']; ?>
+" width="<?php echo $this->_tpl_vars['shotwidth']; ?>
+" alt=""  align="right" vspace="3" hspace="7"/></a>
+<?php endif; ?>
+
+<div style="text-align: justify"><?php echo $this->_tpl_vars['down']['description']; ?>
+</div><br /></td>
+  </tr>
+  <tr>
+    <td colspan='2' class='even' align='left'><img src='images/counter.gif' border='0' align='absmiddle' alt='<?php echo $this->_tpl_vars['down']['lang_dltimes']; ?>
+' />
+&nbsp;<?php echo $this->_tpl_vars['down']['hits']; ?>
+&nbsp;&nbsp;<img src='images/size.gif' border='0' align='absmiddle' alt='<?php echo $this->_tpl_vars['lang_size']; ?>
+' />&nbsp;<?php echo $this->_tpl_vars['down']['size']; ?>
+&nbsp;&nbsp;<img src='images/platform.gif' border='0' align='absmiddle' alt='<?php echo $this->_tpl_vars['lang_platform']; ?>
+' />&nbsp;<?php echo $this->_tpl_vars['down']['platform']; ?>
+&nbsp;&nbsp;<img src='images/home.gif' border='0' align='absmiddle' alt='<?php echo $this->_tpl_vars['lang_homepage']; ?>
+' />&nbsp;<a href="<?php echo $this->_tpl_vars['down']['homepage']; ?>
+" target="_BLANK"><?php echo $this->_tpl_vars['down']['homepage']; ?>
+</a></td>
+  </tr>
+  <tr>
+    <td colspan='2' class='foot' align='center'>
+    <div><b><?php echo $this->_tpl_vars['lang_ratingc']; ?>
+</b> <?php echo $this->_tpl_vars['down']['rating']; ?>
+ (<?php echo $this->_tpl_vars['down']['votes']; ?>
+)</div>
+    <a href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/modules/mydownloads/ratefile.php?cid=<?php echo $this->_tpl_vars['down']['cid']; ?>
+&amp;lid=<?php echo $this->_tpl_vars['down']['id']; ?>
+"><?php echo $this->_tpl_vars['lang_ratethissite']; ?>
+</a> | <a href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/modules/mydownloads/modfile.php?lid=<?php echo $this->_tpl_vars['down']['id']; ?>
+"><?php echo $this->_tpl_vars['lang_modify']; ?>
+</a> | <a href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/modules/mydownloads/brokenfile.php?lid=<?php echo $this->_tpl_vars['down']['id']; ?>
+"><?php echo $this->_tpl_vars['lang_reportbroken']; ?>
+</a> | <a target="_top" href="mailto:?subject=<?php echo $this->_tpl_vars['down']['mail_subject']; ?>
+&amp;body=<?php echo $this->_tpl_vars['down']['mail_body']; ?>
+"><?php echo $this->_tpl_vars['lang_tellafriend']; ?>
+</a> | <a href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/modules/mydownloads/singlefile.php?cid=<?php echo $this->_tpl_vars['down']['cid']; ?>
+&amp;lid=<?php echo $this->_tpl_vars['down']['id']; ?>
+"><?php echo $this->_tpl_vars['lang_comments']; ?>
+ (<?php echo $this->_tpl_vars['down']['comments']; ?>
+)</a>
+    </td>
+  </tr>
+</table>
+<br /><br />
Index: /temp/test-xoops.ec-cube.net/html/templates_c/%%2F^2F3^2F3FADF9%%db%3Anewbb_block_new.html.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/templates_c/%%2F^2F3^2F3FADF9%%db%3Anewbb_block_new.html.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/templates_c/%%2F^2F3^2F3FADF9%%db%3Anewbb_block_new.html.php	(revision 405)
@@ -0,0 +1,82 @@
+<?php /* Smarty version 2.6.12, created on 2006-11-28 11:30:43
+         compiled from db:newbb_block_new.html */ ?>
+<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
+smarty_core_load_plugins(array('plugins' => array(array('function', 'cycle', 'db:newbb_block_new.html', 13, false),)), $this); ?>
+<table class="outer" cellspacing="1">
+
+  <?php if ($this->_tpl_vars['block']['full_view'] == true): ?>
+  <tr>
+    <th><?php echo $this->_tpl_vars['block']['lang_forum']; ?>
+</th>
+    <th><?php echo $this->_tpl_vars['block']['lang_topic']; ?>
+</th>
+    <th align="center"><?php echo $this->_tpl_vars['block']['lang_replies']; ?>
+</th>
+    <th align="center"><?php echo $this->_tpl_vars['block']['lang_views']; ?>
+</th>
+    <th align="right"><?php echo $this->_tpl_vars['block']['lang_lastpost']; ?>
+</th>
+  </tr>
+
+  <?php $_from = $this->_tpl_vars['block']['topics']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
+    foreach ($_from as $this->_tpl_vars['topic']):
+?>
+  <tr class="<?php echo smarty_function_cycle(array('values' => "even,odd"), $this);?>
+">
+    <td><a href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/modules/newbb/viewforum.php?forum=<?php echo $this->_tpl_vars['topic']['forum_id']; ?>
+"><?php echo $this->_tpl_vars['topic']['forum_name']; ?>
+</a></td>
+    <td><a href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/modules/newbb/viewtopic.php?topic_id=<?php echo $this->_tpl_vars['topic']['id']; ?>
+&amp;forum=<?php echo $this->_tpl_vars['topic']['forum_id']; ?>
+&amp;post_id=<?php echo $this->_tpl_vars['topic']['post_id']; ?>
+#forumpost<?php echo $this->_tpl_vars['topic']['post_id']; ?>
+"><?php echo $this->_tpl_vars['topic']['title']; ?>
+</a></td>
+    <td align="center"><?php echo $this->_tpl_vars['topic']['replies']; ?>
+</td>
+    <td align="center"><?php echo $this->_tpl_vars['topic']['views']; ?>
+</td>
+    <td align="right"><?php echo $this->_tpl_vars['topic']['time']; ?>
+</td>
+  </tr>
+  <?php endforeach; endif; unset($_from); ?>
+
+  <?php else: ?>
+
+  <tr>
+    <td class="head"><?php echo $this->_tpl_vars['block']['lang_topic']; ?>
+</td>
+    <td class="head" align="center"><?php echo $this->_tpl_vars['block']['lang_replies']; ?>
+</td>
+    <td class="head" align="right"><?php echo $this->_tpl_vars['block']['lang_lastpost']; ?>
+</td>
+  </tr>
+
+  <?php $_from = $this->_tpl_vars['block']['topics']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
+    foreach ($_from as $this->_tpl_vars['topic']):
+?>
+  <tr class="<?php echo smarty_function_cycle(array('values' => "even,odd"), $this);?>
+">
+    <td><a href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/modules/newbb/viewtopic.php?topic_id=<?php echo $this->_tpl_vars['topic']['id']; ?>
+&amp;forum=<?php echo $this->_tpl_vars['topic']['forum_id']; ?>
+"><?php echo $this->_tpl_vars['topic']['title']; ?>
+</a></td>
+    <td align="center"><?php echo $this->_tpl_vars['topic']['replies']; ?>
+</td>
+    <td align="right"><?php echo $this->_tpl_vars['topic']['time']; ?>
+</td>
+  </tr>
+  <?php endforeach; endif; unset($_from); ?>
+
+  <?php endif; ?>
+
+</table>
+
+<div style="text-align:right; padding: 5px;">
+<a href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/modules/newbb/"><?php echo $this->_tpl_vars['block']['lang_visitforums']; ?>
+</a>
+</div>
Index: /temp/test-xoops.ec-cube.net/html/templates_c/%%27^278^2784E41B%%db%3Asystem_dummy.html.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/templates_c/%%27^278^2784E41B%%db%3Asystem_dummy.html.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/templates_c/%%27^278^2784E41B%%db%3Asystem_dummy.html.php	(revision 405)
@@ -0,0 +1,3 @@
+<?php /* Smarty version 2.6.12, created on 2006-11-28 11:30:43
+         compiled from db:system_dummy.html */ ?>
+<?php echo $this->_tpl_vars['dummy_content']; ?>
Index: /temp/test-xoops.ec-cube.net/html/templates_c/%%20^200^200DC337%%theme.html.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/templates_c/%%20^200^200DC337%%theme.html.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/templates_c/%%20^200^200DC337%%theme.html.php	(revision 405)
@@ -0,0 +1,192 @@
+<?php /* Smarty version 2.6.12, created on 2006-11-28 16:32:06
+         compiled from default/theme.html */ ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->_tpl_vars['xoops_langcode']; ?>
+" lang="<?php echo $this->_tpl_vars['xoops_langcode']; ?>
+">
+<head>
+<link rel="alternate" type="application/rss+xml" title="RSS" href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/modules/rssj/rss.php" />
+<meta http-equiv="content-type" content="text/html; charset=<?php echo $this->_tpl_vars['xoops_charset']; ?>
+" />
+<meta http-equiv="content-language" content="<?php echo $this->_tpl_vars['xoops_langcode']; ?>
+" />
+<meta name="robots" content="<?php echo $this->_tpl_vars['xoops_meta_robots']; ?>
+" />
+<meta name="keywords" content="<?php echo $this->_tpl_vars['xoops_meta_keywords']; ?>
+" />
+<meta name="description" content="<?php echo $this->_tpl_vars['xoops_meta_description']; ?>
+" />
+<meta name="rating" content="<?php echo $this->_tpl_vars['xoops_meta_rating']; ?>
+" />
+<meta name="author" content="<?php echo $this->_tpl_vars['xoops_meta_author']; ?>
+" />
+<meta name="copyright" content="<?php echo $this->_tpl_vars['xoops_meta_copyright']; ?>
+" />
+<meta name="generator" content="XOOPS" />
+<title><?php echo $this->_tpl_vars['xoops_sitename']; ?>
+ - <?php echo $this->_tpl_vars['xoops_pagetitle']; ?>
+</title>
+<link href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/favicon.ico" rel="SHORTCUT ICON" />
+<link rel="stylesheet" type="text/css" media="screen" href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/xoops.css" />
+<link rel="stylesheet" type="text/css" media="screen" href="<?php echo $this->_tpl_vars['xoops_themecss']; ?>
+" />
+<!-- RMV: added module header -->
+<?php echo $this->_tpl_vars['xoops_module_header']; ?>
+
+<script type="text/javascript">
+<!--
+<?php echo $this->_tpl_vars['xoops_js']; ?>
+
+//-->
+</script>
+</head>
+<body>
+<table cellspacing="0" width="780">
+	<tr id="header">
+		<td id="headerlogo"><a href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+"><img src="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/images/logo.jpg" width="236" height="68" alt="EC-CUBE" /></a></td>
+		<td><img src="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/themes/default/img/copy.jpg" width="260" height="68" alt="ÆüËÜÈ¯¤Î¡ÖEC¥ª¡¼¥×¥ó¥½¡¼¥¹¡×³«È¯¥³¥ß¥å¥Ë¥Æ¥£¥µ¥¤¥È" /></td>
+		<td id="headerbanner">
+		<table cellspacing="0">
+			<?php if ($this->_tpl_vars['xoops_uname'] != ""): ?>
+			<tr>
+				<td style="color: #fff; text-align:right;"><img src="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/images/arrow.gif" width="12" height="6" alt="" /> <strong>¤è¤¦¤³¤½¡ª<?php echo $this->_tpl_vars['xoops_uname']; ?>
+ ÍÍ</strong></td> 
+			</tr>
+			<?php endif; ?>
+			<tr><td height="5"></td></tr>
+			<tr>
+				<form action="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/search.php" method="get">
+				<td>
+				<input type="text" name="query" size="20">
+				<input type="hidden" name="action" value="results">
+				<input type="submit" name="searchSubmit" value="Ã±¸ì¸¡º÷">
+				</td>
+				</form>
+			</tr>
+		</table>
+		</td>
+	</tr>
+	<tr>
+		<td id="headerbar" colspan="3"><img src="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/images/bar.jpg" width="780" height="12" alt="" /></td>
+	</tr>
+</table>
+
+  <table cellspacing="0" width="780">
+    <tr>
+      <td id="leftcolumn">
+        <!-- Start left blocks loop -->
+        <?php $_from = $this->_tpl_vars['xoops_lblocks']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
+    foreach ($_from as $this->_tpl_vars['block']):
+?>
+          <?php $_smarty_tpl_vars = $this->_tpl_vars;
+$this->_smarty_include(array('smarty_include_tpl_file' => "default/theme_blockleft.html", 'smarty_include_vars' => array()));
+$this->_tpl_vars = $_smarty_tpl_vars;
+unset($_smarty_tpl_vars);
+ ?>
+        <?php endforeach; endif; unset($_from); ?>
+        <!-- End left blocks loop -->
+      </td>
+
+      <td id="centercolumn">
+
+        <!-- Display center blocks if any -->
+
+        <?php if ($this->_tpl_vars['xoops_showcblock'] == 1): ?>
+
+
+        <table cellspacing="0">
+          <tr>
+            <td id="centerCcolumn" colspan="2">
+
+            <!-- Start center-center blocks loop -->
+            <?php $_from = $this->_tpl_vars['xoops_ccblocks']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
+    foreach ($_from as $this->_tpl_vars['block']):
+?>
+              <?php $_smarty_tpl_vars = $this->_tpl_vars;
+$this->_smarty_include(array('smarty_include_tpl_file' => "default/theme_blockcenter_c.html", 'smarty_include_vars' => array()));
+$this->_tpl_vars = $_smarty_tpl_vars;
+unset($_smarty_tpl_vars);
+ ?>
+            <?php endforeach; endif; unset($_from); ?>
+            <!-- End center-center blocks loop -->
+
+            </td>
+          </tr>
+          <tr>
+            <td id="centerLcolumn">
+
+            <!-- Start center-left blocks loop -->
+              <?php $_from = $this->_tpl_vars['xoops_clblocks']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
+    foreach ($_from as $this->_tpl_vars['block']):
+?>
+                <?php $_smarty_tpl_vars = $this->_tpl_vars;
+$this->_smarty_include(array('smarty_include_tpl_file' => "default/theme_blockcenter_l.html", 'smarty_include_vars' => array()));
+$this->_tpl_vars = $_smarty_tpl_vars;
+unset($_smarty_tpl_vars);
+ ?>
+              <?php endforeach; endif; unset($_from); ?>
+            <!-- End center-left blocks loop -->
+
+            </td><td id="centerRcolumn">
+
+            <!-- Start center-right blocks loop -->
+              <?php $_from = $this->_tpl_vars['xoops_crblocks']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
+    foreach ($_from as $this->_tpl_vars['block']):
+?>
+                <?php $_smarty_tpl_vars = $this->_tpl_vars;
+$this->_smarty_include(array('smarty_include_tpl_file' => "default/theme_blockcenter_r.html", 'smarty_include_vars' => array()));
+$this->_tpl_vars = $_smarty_tpl_vars;
+unset($_smarty_tpl_vars);
+ ?>
+              <?php endforeach; endif; unset($_from); ?>
+            <!-- End center-right blocks loop -->
+
+            </td>
+          </tr>
+        </table>
+
+        <?php endif; ?>
+        <!-- End display center blocks -->
+
+        <div id="content">
+          <?php echo $this->_tpl_vars['xoops_contents']; ?>
+
+        </div>
+      </td>
+
+      <?php if ($this->_tpl_vars['xoops_showrblock'] == 1): ?>
+
+      <td id="rightcolumn">
+        <!-- Start right blocks loop -->
+        <?php $_from = $this->_tpl_vars['xoops_rblocks']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
+    foreach ($_from as $this->_tpl_vars['block']):
+?>
+          <?php $_smarty_tpl_vars = $this->_tpl_vars;
+$this->_smarty_include(array('smarty_include_tpl_file' => "default/theme_blockright.html", 'smarty_include_vars' => array()));
+$this->_tpl_vars = $_smarty_tpl_vars;
+unset($_smarty_tpl_vars);
+ ?>
+        <?php endforeach; endif; unset($_from); ?>
+        <!-- End right blocks loop -->
+      </td>
+
+      <?php endif; ?>
+
+    </tr>
+  </table>
+<table border="0" cellspacing="0" cellpadding="0"style="width:100%;">
+	<tr bgcolor="#3d3f4f">
+		<td style="text-align: right; color: #fff; font-size: x-small; padding: 10px 15px;">Copyright&copy; 2000-2006 LOCKON CO.,LTD. All Rights Reserved.</td>
+	</tr>
+</table>
+</body>
+</html>
Index: /temp/test-xoops.ec-cube.net/html/templates_c/%%5D^5D4^5D4563EF%%db%3Anewbb_search.html.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/templates_c/%%5D^5D4^5D4563EF%%db%3Anewbb_search.html.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/templates_c/%%5D^5D4^5D4563EF%%db%3Anewbb_search.html.php	(revision 405)
@@ -0,0 +1,74 @@
+<?php /* Smarty version 2.6.12, created on 2006-11-26 03:56:48
+         compiled from db:newbb_search.html */ ?>
+<!-- start module contents -->
+<table border="0" cellpadding="5" align="center">
+  <tr>
+    <td colspan="2" align="left"><img src="<?php echo $this->_tpl_vars['img_folder']; ?>
+" alt="" />&nbsp;&nbsp;<a href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/modules/newbb/index.php"><?php echo $this->_tpl_vars['lang_forumindex']; ?>
+</a><br />&nbsp;&nbsp;&nbsp;<img src="<?php echo $this->_tpl_vars['img_folder']; ?>
+" alt="" />&nbsp;&nbsp;<?php echo $this->_tpl_vars['lang_search']; ?>
+</td>
+  </tr>
+</table>
+
+<form name="Search" action="search.php" method="post">
+  <table class="outer" border="0" cellpadding="1" cellspacing="0" align="center" width="95%">
+    <tr>
+      <td>
+        <table border="0" cellpadding="1" cellspacing="1" width="100%" class="head">
+          <tr>
+            <td class="head" width="50%" align="right"><b><?php echo $this->_tpl_vars['lang_keywords']; ?>
+</b>&nbsp;</td>
+            <td class="even" width="50%"><input type="text" name="term" /></td>
+          </tr>
+          <tr>
+            <td class="head" width="50%">&nbsp;</td>
+            <td class="even" width="50%"><input type="radio" name="addterms" value="any" checked="checked" /><?php echo $this->_tpl_vars['lang_searchany']; ?>
+</td>
+          </tr>
+          <tr>
+            <td class="head" width="50%">&nbsp;</td>
+            <td class="even" width="50%"><input type="radio" name="addterms" value="all" /><?php echo $this->_tpl_vars['lang_searchall']; ?>
+</td>
+          </tr>
+          <tr>
+            <td class="head" width="50%" align="right"><b><?php echo $this->_tpl_vars['lang_forumc']; ?>
+</b>&nbsp;</td>
+            <td class="even" width="50%"><?php echo $this->_tpl_vars['forum_selection_box']; ?>
+</td>
+          </tr>
+	  <tr>
+            <td class="head" width="50%" align="right"><b><?php echo $this->_tpl_vars['lang_author']; ?>
+</b>&nbsp;</td>
+            <td class="even" width="50%"><input type="text" name="search_username" /></td>
+          </tr>
+          <tr>
+            <td class="head" width="50%" align="right"><b><?php echo $this->_tpl_vars['lang_sortby']; ?>
+</b>&nbsp;</td>
+            <td class="even" width="50%"><input type="radio" name="sortby" value="p.post_time desc" checked="checked" /><?php echo $this->_tpl_vars['lang_date']; ?>
+&nbsp;&nbsp;<input type="radio" name="sortby" value="t.topic_title" /><?php echo $this->_tpl_vars['lang_topic']; ?>
+&nbsp;&nbsp;<input type="radio" name="sortby" value="f.forum_name" /><?php echo $this->_tpl_vars['lang_forum']; ?>
+&nbsp;&nbsp;<input type="radio" name="sortby" value="u.uname" /><?php echo $this->_tpl_vars['lang_username']; ?>
+&nbsp;&nbsp;</td>
+          </tr>
+          <tr>
+            <td class="head" width="50%" align="right"><b><?php echo $this->_tpl_vars['lang_searchin']; ?>
+</b>&nbsp;</td>
+            <td class="even" width="50%"><input type="radio" name="searchboth" value="title" /><?php echo $this->_tpl_vars['lang_subject']; ?>
+&nbsp;&nbsp;<input type="radio" name="searchboth" value="text" checked="checked" /><?php echo $this->_tpl_vars['lang_body']; ?>
+&nbsp;&nbsp;<input type="radio" name="searchboth" value="both" /><?php echo $this->_tpl_vars['lang_subject']; ?>
+ & <?php echo $this->_tpl_vars['lang_body']; ?>
+&nbsp;&nbsp;</td>
+          </tr>
+          <tr>
+            <td class="head" width="50%" align="right">&nbsp;</td>
+            <td class="even"><input type="submit" name="submit" value="<?php echo $this->_tpl_vars['lang_search']; ?>
+" /></td>
+          </tr>
+        </table>
+      </td>
+    </tr>
+  </table>
+</form>
+<!-- end module contents -->
Index: /temp/test-xoops.ec-cube.net/html/templates_c/%%75^755^755EE737%%db%3Atinycontent0_index.html.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/templates_c/%%75^755^755EE737%%db%3Atinycontent0_index.html.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/templates_c/%%75^755^755EE737%%db%3Atinycontent0_index.html.php	(revision 405)
@@ -0,0 +1,90 @@
+<?php /* Smarty version 2.6.12, created on 2006-11-24 11:08:04
+         compiled from db:tinycontent0_index.html */ ?>
+<?php echo $this->_tpl_vars['content']; ?>
+
+
+
+
+<?php if ($this->_tpl_vars['is_display_print_icon']): ?>
+	<div style="float:right;width:40px;height:40px;"><a href="<?php echo $this->_tpl_vars['mod_url']; ?>
+/print.php?id=<?php echo $this->_tpl_vars['id']; ?>
+"><img src="<?php echo $this->_tpl_vars['mod_url']; ?>
+/images/print.gif" border="0" alt="<?php echo $this->_tpl_vars['lang_printerpage']; ?>
+" /></a></div>
+<?php endif; ?>
+<?php if ($this->_tpl_vars['is_display_friend_icon']): ?>
+	<div style="float:right;width:40px;height:40px;"><a href="<?php echo $this->_tpl_vars['mail_link']; ?>
+" target="_top"><img src="<?php echo $this->_tpl_vars['mod_url']; ?>
+/images/friend.gif" border="0" alt="<?php echo $this->_tpl_vars['lang_sendstory']; ?>
+" /></a></div>
+<?php endif; ?>
+
+<?php if ($this->_tpl_vars['is_display_pagenav']): ?>
+<hr style="clear:right;" />
+
+<table width="100%" border="0" cellpadding="0" cellspacing="0">
+<tr>
+	<td width="33%" align="left" valign="top">
+	<?php if ($this->_tpl_vars['prev_link']): ?>
+		<a href="<?php echo $this->_tpl_vars['vmod_url']; ?>
+/<?php echo $this->_tpl_vars['prev_link']; ?>
+" accesskey="P"><?php echo $this->_tpl_vars['lang_prevpage']; ?>
+</a><br />
+	<?php echo $this->_tpl_vars['prev_title']; ?>
+
+	<?php endif; ?>
+	</td>
+	<td width="34%" align="center" valign="top">
+		<a href="<?php echo $this->_tpl_vars['vmod_url']; ?>
+/<?php echo $this->_tpl_vars['top_link']; ?>
+" accesskey="H"><?php echo $this->_tpl_vars['lang_topofcontents']; ?>
+</a>
+	</td>
+	<td width="33%" align="right" valign="top">
+	<?php if ($this->_tpl_vars['next_link']): ?>
+		<a href="<?php echo $this->_tpl_vars['vmod_url']; ?>
+/<?php echo $this->_tpl_vars['next_link']; ?>
+" accesskey="N"><?php echo $this->_tpl_vars['lang_nextpage']; ?>
+</a><br />
+	<?php echo $this->_tpl_vars['next_title']; ?>
+
+	<?php endif; ?>
+	</td>
+</tr>
+</table>
+<?php endif; ?>
+
+
+<?php if ($this->_tpl_vars['nocomments'] == 0): ?>
+<br /><br />
+<div style="text-align: center; padding: 3px; margin: 3px;">
+  <?php echo $this->_tpl_vars['commentsnav']; ?>
+
+  <?php echo $this->_tpl_vars['lang_notice']; ?>
+
+</div>
+
+<div style="margin: 3px; padding: 3px;">
+<!-- start comments loop -->
+<?php if ($this->_tpl_vars['comment_mode'] == 'flat'): ?>
+  <?php $_smarty_tpl_vars = $this->_tpl_vars;
+$this->_smarty_include(array('smarty_include_tpl_file' => "db:system_comments_flat.html", 'smarty_include_vars' => array()));
+$this->_tpl_vars = $_smarty_tpl_vars;
+unset($_smarty_tpl_vars);
+ ?>
+<?php elseif ($this->_tpl_vars['comment_mode'] == 'thread'): ?>
+  <?php $_smarty_tpl_vars = $this->_tpl_vars;
+$this->_smarty_include(array('smarty_include_tpl_file' => "db:system_comments_thread.html", 'smarty_include_vars' => array()));
+$this->_tpl_vars = $_smarty_tpl_vars;
+unset($_smarty_tpl_vars);
+ ?>
+<?php elseif ($this->_tpl_vars['comment_mode'] == 'nest'): ?>
+  <?php $_smarty_tpl_vars = $this->_tpl_vars;
+$this->_smarty_include(array('smarty_include_tpl_file' => "db:system_comments_nest.html", 'smarty_include_vars' => array()));
+$this->_tpl_vars = $_smarty_tpl_vars;
+unset($_smarty_tpl_vars);
+ ?>
+<?php endif; ?>
+<!-- end comments loop -->
+</div>
+<?php endif; ?>
Index: /temp/test-xoops.ec-cube.net/html/templates_c/%%53^534^53481332%%db%3Anews_article.html.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/templates_c/%%53^534^53481332%%db%3Anews_article.html.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/templates_c/%%53^534^53481332%%db%3Anews_article.html.php	(revision 405)
@@ -0,0 +1,57 @@
+<?php /* Smarty version 2.6.12, created on 2006-11-24 12:44:53
+         compiled from db:news_article.html */ ?>
+<div style="text-align: left; margin: 10px;"><?php if ($this->_tpl_vars['pagenav']): ?>Page <?php echo $this->_tpl_vars['pagenav'];  endif; ?></div>
+
+<div style="padding: 3px; margin-right:3px;">
+<?php $_smarty_tpl_vars = $this->_tpl_vars;
+$this->_smarty_include(array('smarty_include_tpl_file' => "db:news_item.html", 'smarty_include_vars' => array('story' => $this->_tpl_vars['story'])));
+$this->_tpl_vars = $_smarty_tpl_vars;
+unset($_smarty_tpl_vars);
+ ?>
+</div>
+
+<div style="text-align: left; margin: 10px;"><?php if ($this->_tpl_vars['pagenav']): ?>Page <?php echo $this->_tpl_vars['pagenav'];  endif; ?></div>
+
+<div style="padding: 5px; text-align: right;
+margin-right:3px;">
+<a href="print.php?storyid=<?php echo $this->_tpl_vars['story']['id']; ?>
+"><img
+src="images/print.gif" border="0"
+alt="<?php echo $this->_tpl_vars['lang_printerpage']; ?>
+" /></a> <a target="_top"
+href="<?php echo $this->_tpl_vars['mail_link']; ?>
+"><img src="images/friend.gif"
+border="0" alt="<?php echo $this->_tpl_vars['lang_sendstory']; ?>
+" /></a>
+</div>
+
+<div style="text-align: center; padding: 3px;
+margin:3px;">
+<?php echo $this->_tpl_vars['commentsnav']; ?>
+
+<?php echo $this->_tpl_vars['lang_notice']; ?>
+
+</div>
+
+<div style="margin:3px; padding: 3px;">
+<!-- start comments loop -->
+<?php if ($this->_tpl_vars['comment_mode'] == 'flat'):  $_smarty_tpl_vars = $this->_tpl_vars;
+$this->_smarty_include(array('smarty_include_tpl_file' => "db:system_comments_flat.html", 'smarty_include_vars' => array()));
+$this->_tpl_vars = $_smarty_tpl_vars;
+unset($_smarty_tpl_vars);
+  elseif ($this->_tpl_vars['comment_mode'] == 'thread'):  $_smarty_tpl_vars = $this->_tpl_vars;
+$this->_smarty_include(array('smarty_include_tpl_file' => "db:system_comments_thread.html", 'smarty_include_vars' => array()));
+$this->_tpl_vars = $_smarty_tpl_vars;
+unset($_smarty_tpl_vars);
+  elseif ($this->_tpl_vars['comment_mode'] == 'nest'):  $_smarty_tpl_vars = $this->_tpl_vars;
+$this->_smarty_include(array('smarty_include_tpl_file' => "db:system_comments_nest.html", 'smarty_include_vars' => array()));
+$this->_tpl_vars = $_smarty_tpl_vars;
+unset($_smarty_tpl_vars);
+  endif; ?>
+<!-- end comments loop -->
+</div>
+<?php $_smarty_tpl_vars = $this->_tpl_vars;
+$this->_smarty_include(array('smarty_include_tpl_file' => 'db:system_notification_select.html', 'smarty_include_vars' => array()));
+$this->_tpl_vars = $_smarty_tpl_vars;
+unset($_smarty_tpl_vars);
+ ?>
Index: /temp/test-xoops.ec-cube.net/html/templates_c/%%FC^FC6^FC65089E%%db%3Amydownloads_index.html.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/templates_c/%%FC^FC6^FC65089E%%db%3Amydownloads_index.html.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/templates_c/%%FC^FC6^FC65089E%%db%3Amydownloads_index.html.php	(revision 405)
@@ -0,0 +1,99 @@
+<?php /* Smarty version 2.6.12, created on 2006-11-24 20:20:21
+         compiled from db:mydownloads_index.html */ ?>
+<br /><br />
+
+<p align="center">
+    <a href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/modules/mydownloads/index.php"><img src="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/modules/mydownloads/images/logo-en.gif" alt="" /></a>
+</p>
+
+<br /><br /><br />
+<a href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/modules/mydownloads/submit.php">¿·µ¬¥Õ¥¡¥¤¥ëÅÐÏ¿</a></li>
+<br />
+<?php if (count ( $this->_tpl_vars['categories'] ) > 0): ?>
+<hr noshade color=#000000">
+<table border='0' cellspacing='5' cellpadding='0' align="center">
+  <tr>
+  <!-- Start category loop -->
+  <?php $_from = $this->_tpl_vars['categories']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
+    foreach ($_from as $this->_tpl_vars['category']):
+?>
+
+    <td valign="top" >
+    <?php if ($this->_tpl_vars['category']['image'] != ""): ?>
+    <a href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/modules/mydownloads/viewcat.php?cid=<?php echo $this->_tpl_vars['category']['id']; ?>
+"><img src="<?php echo $this->_tpl_vars['category']['image']; ?>
+" height="50" border="0" alt="" /></a>
+    <?php endif; ?>
+    </td>
+    <td valign="top" width="40%"><a href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/modules/mydownloads/viewcat.php?cid=<?php echo $this->_tpl_vars['category']['id']; ?>
+"><b><?php echo $this->_tpl_vars['category']['title']; ?>
+</b></a>&nbsp;(<?php echo $this->_tpl_vars['category']['totaldownloads']; ?>
+)<br /><?php echo $this->_tpl_vars['category']['subcategories']; ?>
+</td>
+    <?php if (!($this->_tpl_vars['category']['count'] % 3)): ?>
+    </tr><tr>
+    <?php endif; ?>
+
+  <?php endforeach; endif; unset($_from); ?>
+  <!-- End category loop -->
+  </tr>
+</table>
+<br /><br />
+
+<div><?php echo $this->_tpl_vars['lang_thereare']; ?>
+</div>
+<hr noshade color=#000000">
+
+  <?php endif; ?>
+
+<?php if ($this->_tpl_vars['file'] != ""): ?>
+<h4><?php echo $this->_tpl_vars['lang_latestlistings']; ?>
+</h4>
+<table width="100%" cellspacing="0" cellpadding="10" border="0">
+<tr>
+<td width="100%" align="center" valign="top">
+  <!-- Start new link loop -->
+  <?php unset($this->_sections['i']);
+$this->_sections['i']['name'] = 'i';
+$this->_sections['i']['loop'] = is_array($_loop=$this->_tpl_vars['file']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
+$this->_sections['i']['show'] = true;
+$this->_sections['i']['max'] = $this->_sections['i']['loop'];
+$this->_sections['i']['step'] = 1;
+$this->_sections['i']['start'] = $this->_sections['i']['step'] > 0 ? 0 : $this->_sections['i']['loop']-1;
+if ($this->_sections['i']['show']) {
+    $this->_sections['i']['total'] = $this->_sections['i']['loop'];
+    if ($this->_sections['i']['total'] == 0)
+        $this->_sections['i']['show'] = false;
+} else
+    $this->_sections['i']['total'] = 0;
+if ($this->_sections['i']['show']):
+
+            for ($this->_sections['i']['index'] = $this->_sections['i']['start'], $this->_sections['i']['iteration'] = 1;
+                 $this->_sections['i']['iteration'] <= $this->_sections['i']['total'];
+                 $this->_sections['i']['index'] += $this->_sections['i']['step'], $this->_sections['i']['iteration']++):
+$this->_sections['i']['rownum'] = $this->_sections['i']['iteration'];
+$this->_sections['i']['index_prev'] = $this->_sections['i']['index'] - $this->_sections['i']['step'];
+$this->_sections['i']['index_next'] = $this->_sections['i']['index'] + $this->_sections['i']['step'];
+$this->_sections['i']['first']      = ($this->_sections['i']['iteration'] == 1);
+$this->_sections['i']['last']       = ($this->_sections['i']['iteration'] == $this->_sections['i']['total']);
+?>
+    <?php $_smarty_tpl_vars = $this->_tpl_vars;
+$this->_smarty_include(array('smarty_include_tpl_file' => "db:mydownloads_download.html", 'smarty_include_vars' => array('down' => $this->_tpl_vars['file'][$this->_sections['i']['index']])));
+$this->_tpl_vars = $_smarty_tpl_vars;
+unset($_smarty_tpl_vars);
+ ?>
+  <?php endfor; endif; ?>
+  <!-- End new link loop -->
+</td></tr>
+  </table>
+<?php endif; ?>
+<?php $_smarty_tpl_vars = $this->_tpl_vars;
+$this->_smarty_include(array('smarty_include_tpl_file' => "db:system_notification_select.html", 'smarty_include_vars' => array()));
+$this->_tpl_vars = $_smarty_tpl_vars;
+unset($_smarty_tpl_vars);
+ ?>
Index: /temp/test-xoops.ec-cube.net/html/templates_c/%%22^222^222153D0%%db%3Asystem_block_user.html.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/templates_c/%%22^222^222153D0%%db%3Asystem_block_user.html.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/templates_c/%%22^222^222153D0%%db%3Asystem_block_user.html.php	(revision 405)
@@ -0,0 +1,36 @@
+<?php /* Smarty version 2.6.12, created on 2006-11-28 11:42:31
+         compiled from db:system_block_user.html */ ?>
+<table cellspacing="0">
+  <tr>
+    <td id="usermenu">
+      <a class="menuTop" href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/user.php"><img src="/themes/default/img/left/mainmenu_arrow.gif">&nbsp;<?php echo $this->_tpl_vars['block']['lang_youraccount']; ?>
+</a>
+      <a class="menuTop" href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/edituser.php"><img src="/themes/default/img/left/mainmenu_arrow.gif">&nbsp;<?php echo $this->_tpl_vars['block']['lang_editaccount']; ?>
+</a>
+      <a class="menuTop" href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/notifications.php"><img src="/themes/default/img/left/mainmenu_arrow.gif">&nbsp;<?php echo $this->_tpl_vars['block']['lang_notifications']; ?>
+</a>
+      <a class="menuTop" href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/user.php?op=logout"><img src="/themes/default/img/left/mainmenu_arrow.gif">&nbsp;<?php echo $this->_tpl_vars['block']['lang_logout']; ?>
+</a>
+      <?php if ($this->_tpl_vars['block']['new_messages'] > 0): ?>
+        <a class="highlight" href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/viewpmsg.php"><?php echo $this->_tpl_vars['block']['lang_inbox']; ?>
+ (<span style="color:#ff0000; font-weight: bold;"><?php echo $this->_tpl_vars['block']['new_messages']; ?>
+</span>)</a>
+      <?php else: ?>
+        <a href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/viewpmsg.php"><?php echo $this->_tpl_vars['block']['lang_inbox']; ?>
+</a>
+      <?php endif; ?>
+
+      <?php if ($this->_tpl_vars['xoops_isadmin']): ?>
+        <a href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/admin.php"><?php echo $this->_tpl_vars['block']['lang_adminmenu']; ?>
+</a>
+      <?php endif; ?>
+    </td>
+  </tr>
+</table>
Index: /temp/test-xoops.ec-cube.net/html/templates_c/%%3E^3ED^3ED241A8%%db%3Asystem_userinfo.html.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/templates_c/%%3E^3ED^3ED241A8%%db%3Asystem_userinfo.html.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/templates_c/%%3E^3ED^3ED241A8%%db%3Asystem_userinfo.html.php	(revision 405)
@@ -0,0 +1,214 @@
+<?php /* Smarty version 2.6.12, created on 2006-11-28 11:38:12
+         compiled from db:system_userinfo.html */ ?>
+<?php if ($this->_tpl_vars['user_ownpage'] == true): ?>
+
+<form name="usernav" action="user.php" method="post">
+
+<br /><br />
+
+<table width="70%" align="center" border="0">
+  <tr align="center">
+    <td><input type="button" value="<?php echo $this->_tpl_vars['lang_editprofile']; ?>
+" onclick="location='edituser.php'" />
+    <input type="button" value="<?php echo $this->_tpl_vars['lang_avatar']; ?>
+" onclick="location='edituser.php?op=avatarform'" />
+    <input type="button" value="<?php echo $this->_tpl_vars['lang_inbox']; ?>
+" onclick="location='viewpmsg.php'" />
+
+    <?php if ($this->_tpl_vars['user_candelete'] == true): ?>
+    <input type="button" value="<?php echo $this->_tpl_vars['lang_deleteaccount']; ?>
+" onclick="location='user.php?op=delete'" />
+    <?php endif; ?>
+
+    <input type="button" value="<?php echo $this->_tpl_vars['lang_logout']; ?>
+" onclick="location='user.php?op=logout'" /></td>
+  </tr>
+</table>
+</form>
+
+<br /><br />
+<?php elseif ($this->_tpl_vars['xoops_isadmin'] != false): ?>
+
+<br /><br />
+
+<table width="70%" align="center" border="0">
+  <tr align="center">
+    <td><input type="button" value="<?php echo $this->_tpl_vars['lang_editprofile']; ?>
+" onclick="location='<?php echo $this->_tpl_vars['xoops_url']; ?>
+/modules/system/admin.php?fct=users&amp;uid=<?php echo $this->_tpl_vars['user_uid']; ?>
+&amp;op=modifyUser'" />
+    <input type="button" value="<?php echo $this->_tpl_vars['lang_deleteaccount']; ?>
+" onclick="location='<?php echo $this->_tpl_vars['xoops_url']; ?>
+/modules/system/admin.php?fct=users&amp;op=delUser&amp;uid=<?php echo $this->_tpl_vars['user_uid']; ?>
+'" /></td>
+  </tr>
+</table>
+
+<br /><br />
+<?php endif; ?>
+
+<table width="100%" border="0" cellspacing="5">
+  <tr valign="top">
+    <td width="50%">
+      <table class="outer" cellpadding="4" cellspacing="1" width="100%">
+        <tr>
+          <th colspan="2" align="center"><?php echo $this->_tpl_vars['lang_allaboutuser']; ?>
+</th>
+        </tr>
+        <tr valign="top">
+          <td class="head"><?php echo $this->_tpl_vars['lang_avatar']; ?>
+</td>
+          <td align="center" class="even"><img src="<?php echo $this->_tpl_vars['user_avatarurl']; ?>
+" alt="Avatar" /></td>
+        </tr>
+        <tr>
+          <td class="head"><?php echo $this->_tpl_vars['lang_realname']; ?>
+</td>
+          <td align="center" class="odd"><?php echo $this->_tpl_vars['user_realname']; ?>
+</td>
+        </tr>
+        <tr>
+          <td class="head"><?php echo $this->_tpl_vars['lang_website']; ?>
+</td>
+          <td class="even"><?php echo $this->_tpl_vars['user_websiteurl']; ?>
+</td>
+        </tr>
+        <tr valign="top">
+          <td class="head"><?php echo $this->_tpl_vars['lang_email']; ?>
+</td>
+          <td class="odd"><?php echo $this->_tpl_vars['user_email']; ?>
+</td>
+        </tr>
+	<tr valign="top">
+          <td class="head"><?php echo $this->_tpl_vars['lang_privmsg']; ?>
+</td>
+          <td class="even"><?php echo $this->_tpl_vars['user_pmlink']; ?>
+</td>
+        </tr>
+        <tr valign="top">
+          <td class="head"><?php echo $this->_tpl_vars['lang_icq']; ?>
+</td>
+          <td class="odd"><?php echo $this->_tpl_vars['user_icq']; ?>
+</td>
+        </tr>
+        <tr valign="top">
+          <td class="head"><?php echo $this->_tpl_vars['lang_aim']; ?>
+</td>
+          <td class="even"><?php echo $this->_tpl_vars['user_aim']; ?>
+</td>
+        </tr>
+        <tr valign="top">
+          <td class="head"><?php echo $this->_tpl_vars['lang_yim']; ?>
+</td>
+          <td class="odd"><?php echo $this->_tpl_vars['user_yim']; ?>
+</td>
+        </tr>
+        <tr valign="top">
+          <td class="head"><?php echo $this->_tpl_vars['lang_msnm']; ?>
+</td>
+          <td class="even"><?php echo $this->_tpl_vars['user_msnm']; ?>
+</td>
+        </tr>
+        <tr valign="top">
+          <td class="head"><?php echo $this->_tpl_vars['lang_location']; ?>
+</td>
+          <td class="odd"><?php echo $this->_tpl_vars['user_location']; ?>
+</td>
+        </tr>
+        <tr valign="top">
+          <td class="head"><?php echo $this->_tpl_vars['lang_occupation']; ?>
+</td>
+          <td class="even"><?php echo $this->_tpl_vars['user_occupation']; ?>
+</td>
+        </tr>
+        <tr valign="top">
+          <td class="head"><?php echo $this->_tpl_vars['lang_interest']; ?>
+</td>
+          <td class="odd"><?php echo $this->_tpl_vars['user_interest']; ?>
+</td>
+        </tr>
+        <tr valign="top">
+          <td class="head"><?php echo $this->_tpl_vars['lang_extrainfo']; ?>
+</td>
+          <td class="even"><?php echo $this->_tpl_vars['user_extrainfo']; ?>
+</td>
+        </tr>
+      </table>
+    </td>
+    <td width="50%">
+      <table class="outer" cellpadding="4" cellspacing="1" width="100%">
+        <tr valign="top">
+          <th colspan="2" align="center"><?php echo $this->_tpl_vars['lang_statistics']; ?>
+</th>
+        </tr>
+        <tr valign="top">
+          <td class="head"><?php echo $this->_tpl_vars['lang_membersince']; ?>
+</td>
+          <td align="center" class="even"><?php echo $this->_tpl_vars['user_joindate']; ?>
+</td>
+        </tr>
+        <tr valign="top">
+          <td class="head"><?php echo $this->_tpl_vars['lang_rank']; ?>
+</td>
+          <td align="center" class="odd"><?php echo $this->_tpl_vars['user_rankimage']; ?>
+<br /><?php echo $this->_tpl_vars['user_ranktitle']; ?>
+</td>
+        </tr>
+        <tr valign="top">
+          <td class="head"><?php echo $this->_tpl_vars['lang_posts']; ?>
+</td>
+          <td align="center" class="even"><?php echo $this->_tpl_vars['user_posts']; ?>
+</td>
+        </tr>
+	<tr valign="top">
+          <td class="head"><?php echo $this->_tpl_vars['lang_lastlogin']; ?>
+</td>
+          <td align="center" class="odd"><?php echo $this->_tpl_vars['user_lastlogin']; ?>
+</td>
+        </tr>
+      </table>
+      <br />
+      <table class="outer" cellpadding="4" cellspacing="1" width="100%">
+        <tr valign="top">
+          <th colspan="2" align="center"><?php echo $this->_tpl_vars['lang_signature']; ?>
+</th>
+        </tr>
+        <tr valign="top">
+          <td class="even"><?php echo $this->_tpl_vars['user_signature']; ?>
+</td>
+        </tr>
+      </table>
+    </td>
+  </tr>
+</table>
+
+<!-- start module search results loop -->
+<?php $_from = $this->_tpl_vars['modules']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
+    foreach ($_from as $this->_tpl_vars['module']):
+?>
+
+<p>
+<h4><?php echo $this->_tpl_vars['module']['name']; ?>
+</h4>
+
+  <!-- start results item loop -->
+  <?php $_from = $this->_tpl_vars['module']['results']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
+    foreach ($_from as $this->_tpl_vars['result']):
+?>
+
+  <img src="<?php echo $this->_tpl_vars['result']['image']; ?>
+" alt="<?php echo $this->_tpl_vars['module']['name']; ?>
+" /><b><a href="<?php echo $this->_tpl_vars['result']['link']; ?>
+"><?php echo $this->_tpl_vars['result']['title']; ?>
+</a></b><br /><small>(<?php echo $this->_tpl_vars['result']['time']; ?>
+)</small><br />
+
+  <?php endforeach; endif; unset($_from); ?>
+  <!-- end results item loop -->
+
+<?php echo $this->_tpl_vars['module']['showall_link']; ?>
+
+</p>
+
+<?php endforeach; endif; unset($_from); ?>
+<!-- end module search results loop -->
Index: /temp/test-xoops.ec-cube.net/html/templates_c/%%65^65E^65EDD54A%%db%3Anews_index.html.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/templates_c/%%65^65E^65EDD54A%%db%3Anews_index.html.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/templates_c/%%65^65E^65EDD54A%%db%3Anews_index.html.php	(revision 405)
@@ -0,0 +1,73 @@
+<?php /* Smarty version 2.6.12, created on 2006-11-24 11:16:07
+         compiled from db:news_index.html */ ?>
+<?php if ($this->_tpl_vars['displaynav'] == true): ?>
+  <div style="text-align: center;">
+    <form name="form1" action="index.php" method="get">
+    <?php echo $this->_tpl_vars['topic_select']; ?>
+ <select name="storynum"><?php echo $this->_tpl_vars['storynum_options']; ?>
+</select> <input type="submit" value="<?php echo $this->_tpl_vars['lang_go']; ?>
+" /></form>
+  </div>
+<?php endif; ?>
+
+<div style="padding: 15px 0;">
+	<table border="0" cellspacing="0" cellpadding="0">
+		<tr bgcolor="#2b8200">
+			<td><img src="http://test-xoops.ec-cube.net/themes/default/img/main/title_left_top.gif" width="17" height="12" alt="" border="0"></td>
+			<td style="width:100%;"></td>
+			<td align="left"><img src="http://test-xoops.ec-cube.net/themes/default/img/main/title_right_top.gif" width="17" height="12" alt="" border="0"></td>
+		</tr>
+		<tr>
+			<td bgcolor="#2b8200" colspan="3">
+			<table border="0" cellspacing="0" cellpadding="0">
+				<tr>
+					<td style="padding: 0 0 0 17px;"><img src="http://test-xoops.ec-cube.net/themes/default/img/main/title_news.gif" width="129" height="22" alt="¥Ë¥å¡¼¥¹°ìÍ÷" ></td>
+				</tr>
+			</table>
+			</td>
+		</tr>
+		<tr bgcolor="#2b8200">
+			<td><img src="http://test-xoops.ec-cube.net/themes/default/img/main/title_left_bottom.gif" width="17" height="12" alt="" border="0"></td>
+			<td style="width:100%;"></td>
+			<td align="left"><img src="http://test-xoops.ec-cube.net/themes/default/img/main/title_right_bottom.gif" width="17" height="12" alt="" border="0"></td>
+		</tr>
+	</table>
+	
+	<!-- start news item loop -->
+	<?php unset($this->_sections['i']);
+$this->_sections['i']['name'] = 'i';
+$this->_sections['i']['loop'] = is_array($_loop=$this->_tpl_vars['stories']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
+$this->_sections['i']['show'] = true;
+$this->_sections['i']['max'] = $this->_sections['i']['loop'];
+$this->_sections['i']['step'] = 1;
+$this->_sections['i']['start'] = $this->_sections['i']['step'] > 0 ? 0 : $this->_sections['i']['loop']-1;
+if ($this->_sections['i']['show']) {
+    $this->_sections['i']['total'] = $this->_sections['i']['loop'];
+    if ($this->_sections['i']['total'] == 0)
+        $this->_sections['i']['show'] = false;
+} else
+    $this->_sections['i']['total'] = 0;
+if ($this->_sections['i']['show']):
+
+            for ($this->_sections['i']['index'] = $this->_sections['i']['start'], $this->_sections['i']['iteration'] = 1;
+                 $this->_sections['i']['iteration'] <= $this->_sections['i']['total'];
+                 $this->_sections['i']['index'] += $this->_sections['i']['step'], $this->_sections['i']['iteration']++):
+$this->_sections['i']['rownum'] = $this->_sections['i']['iteration'];
+$this->_sections['i']['index_prev'] = $this->_sections['i']['index'] - $this->_sections['i']['step'];
+$this->_sections['i']['index_next'] = $this->_sections['i']['index'] + $this->_sections['i']['step'];
+$this->_sections['i']['first']      = ($this->_sections['i']['iteration'] == 1);
+$this->_sections['i']['last']       = ($this->_sections['i']['iteration'] == $this->_sections['i']['total']);
+?>
+	  <?php $_smarty_tpl_vars = $this->_tpl_vars;
+$this->_smarty_include(array('smarty_include_tpl_file' => "db:news_item.html", 'smarty_include_vars' => array('story' => $this->_tpl_vars['stories'][$this->_sections['i']['index']])));
+$this->_tpl_vars = $_smarty_tpl_vars;
+unset($_smarty_tpl_vars);
+ ?>
+	  <br />
+	<?php endfor; endif; ?>
+	<!-- end news item loop -->
+
+	<div style="clear: both;"></div> 
+</div>
+
+<!-- °Ê²¼¥¤¥Ù¥ó¥È½èÍý¤ÏÉ½¼¨¤·¤Ê¤¤ -->
Index: /temp/test-xoops.ec-cube.net/html/templates_c/%%82^82E^82EE6A08%%db%3Anewbb_thread.html.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/templates_c/%%82^82E^82EE6A08%%db%3Anewbb_thread.html.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/templates_c/%%82^82E^82EE6A08%%db%3Anewbb_thread.html.php	(revision 405)
@@ -0,0 +1,118 @@
+<?php /* Smarty version 2.6.12, created on 2006-11-24 11:11:08
+         compiled from db:newbb_thread.html */ ?>
+<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
+smarty_core_load_plugins(array('plugins' => array(array('modifier', 'default', 'db:newbb_thread.html', 6, false),)), $this); ?>
+<!-- start comment post -->
+        <tr>
+          <td class="head"><a id="forumpost<?php echo $this->_tpl_vars['topic_post']['post_id']; ?>
+"></a> <?php echo $this->_tpl_vars['topic_post']['poster_uname']; ?>
+</td>
+          <td class="head">
+          	<div class="comDate"><span class="comDateCaption"><?php echo $this->_tpl_vars['lang_postedon']; ?>
+</span> <?php echo $this->_tpl_vars['topic_post']['post_date']; ?>
+</div>
+          	<div class="comResponse"><span class="comDateCaption"><?php echo $this->_tpl_vars['lang_response']; ?>
+</span><?php echo ((is_array($_tmp=@$this->_tpl_vars['arrResponse'][$this->_tpl_vars['topic_post']['post_response']])) ? $this->_run_mod_handler('default', true, $_tmp, '¡Ý¡Ý¡Ý') : smarty_modifier_default($_tmp, '¡Ý¡Ý¡Ý')); ?>
+</div>
+          </td>
+        </tr>
+        <tr>
+
+          <?php if ($this->_tpl_vars['topic_post']['poster_uid'] != 0): ?>
+
+          <td class="odd"><div class="comUserRank"><div class="comUserRankText"><?php echo $this->_tpl_vars['topic_post']['poster_rank_title']; ?>
+</div><?php echo $this->_tpl_vars['topic_post']['poster_rank_image']; ?>
+</div><img class="comUserImg" src="<?php echo $this->_tpl_vars['xoops_upload_url']; ?>
+/<?php echo $this->_tpl_vars['topic_post']['poster_avatar']; ?>
+" alt="" /><div class="comUserStat"><span class="comUserStatCaption"><?php echo $this->_tpl_vars['lang_joined']; ?>
+:</span> <?php echo $this->_tpl_vars['topic_post']['poster_regdate']; ?>
+</div><div class="comUserStat"><span class="comUserStatCaption"><?php echo $this->_tpl_vars['lang_from']; ?>
+:</span> <?php echo $this->_tpl_vars['topic_post']['poster_from']; ?>
+</div><div class="comUserStat"><span class="comUserStatCaption"><?php echo $this->_tpl_vars['lang_posts']; ?>
+:</span> <?php echo $this->_tpl_vars['topic_post']['poster_postnum']; ?>
+</div><div class="comUserStatus"><?php echo $this->_tpl_vars['topic_post']['poster_status']; ?>
+</div></td>
+
+          <?php else: ?>
+
+          <td class="odd"> </td>
+
+          <?php endif; ?>
+
+          <td class="odd">
+            <div class="comTitle"><?php echo $this->_tpl_vars['topic_post']['post_title']; ?>
+</div><div class="comText"><?php echo $this->_tpl_vars['topic_post']['post_text']; ?>
+</div>
+          </td>
+        </tr>
+        <tr>
+          <td class="even"></td>
+
+          <?php if ($this->_tpl_vars['viewer_is_admin'] == true): ?>
+
+          <td class="even" align="right">
+            <a href="edit.php?forum=<?php echo $this->_tpl_vars['forum_id']; ?>
+&amp;post_id=<?php echo $this->_tpl_vars['topic_post']['post_id']; ?>
+&amp;topic_id=<?php echo $this->_tpl_vars['topic_id']; ?>
+&amp;viewmode=<?php echo $this->_tpl_vars['topic_viewmode']; ?>
+&amp;order=<?php echo $this->_tpl_vars['topic_order']; ?>
+"><img src="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/images/icons/edit.gif" alt="<?php echo $this->_tpl_vars['lang_edit']; ?>
+" /></a><a href='delete.php?forum=<?php echo $this->_tpl_vars['forum_id']; ?>
+&amp;topic_id=<?php echo $this->_tpl_vars['topic_id']; ?>
+&amp;post_id=<?php echo $this->_tpl_vars['topic_post']['post_id']; ?>
+&amp;viewmode=<?php echo $this->_tpl_vars['topic_viewmode']; ?>
+&amp;order=<?php echo $this->_tpl_vars['topic_order']; ?>
+'><img src="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/images/icons/delete.gif" alt="<?php echo $this->_tpl_vars['lang_delete']; ?>
+" /></a><a href='reply.php?forum=<?php echo $this->_tpl_vars['forum_id']; ?>
+&amp;post_id=<?php echo $this->_tpl_vars['topic_post']['post_id']; ?>
+&amp;topic_id=<?php echo $this->_tpl_vars['topic_id']; ?>
+&amp;viewmode=<?php echo $this->_tpl_vars['topic_viewmode']; ?>
+&amp;order=<?php echo $this->_tpl_vars['topic_order']; ?>
+'><img src="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/images/icons/reply.gif" alt="<?php echo $this->_tpl_vars['lang_reply']; ?>
+" /></a>
+          </td>
+
+          <?php elseif ($this->_tpl_vars['xoops_isuser'] == true && $this->_tpl_vars['xoops_userid'] == $this->_tpl_vars['topic_post']['poster_uid']): ?>
+
+          <td class="even" align="right">
+            <a href="edit.php?forum=<?php echo $this->_tpl_vars['forum_id']; ?>
+&amp;post_id=<?php echo $this->_tpl_vars['topic_post']['post_id']; ?>
+&amp;topic_id=<?php echo $this->_tpl_vars['topic_id']; ?>
+&amp;viewmode=<?php echo $this->_tpl_vars['topic_viewmode']; ?>
+&amp;order=<?php echo $this->_tpl_vars['topic_order']; ?>
+"><img src="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/images/icons/edit.gif" alt="<?php echo $this->_tpl_vars['lang_edit']; ?>
+" /></a><a href='reply.php?forum=<?php echo $this->_tpl_vars['forum_id']; ?>
+&amp;post_id=<?php echo $this->_tpl_vars['topic_post']['post_id']; ?>
+&amp;topic_id=<?php echo $this->_tpl_vars['topic_id']; ?>
+&amp;viewmode=<?php echo $this->_tpl_vars['topic_viewmode']; ?>
+&amp;order=<?php echo $this->_tpl_vars['topic_order']; ?>
+'><img src="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/images/icons/reply.gif" alt="<?php echo $this->_tpl_vars['lang_reply']; ?>
+" /></a>
+          </td>
+
+          <?php elseif ($this->_tpl_vars['viewer_can_post'] == true): ?>
+
+          <td class="even" align="right">
+            <a href='reply.php?forum=<?php echo $this->_tpl_vars['forum_id']; ?>
+&amp;post_id=<?php echo $this->_tpl_vars['topic_post']['post_id']; ?>
+&amp;topic_id=<?php echo $this->_tpl_vars['topic_id']; ?>
+&amp;viewmode=<?php echo $this->_tpl_vars['topic_viewmode']; ?>
+&amp;order=<?php echo $this->_tpl_vars['topic_order']; ?>
+'><img src="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/images/icons/reply.gif" alt="<?php echo $this->_tpl_vars['lang_reply']; ?>
+" /></a>
+          </td>
+
+          <?php else: ?>
+
+          <td class="even"> </td>
+
+          <?php endif; ?>
+
+        </tr>
+<!-- end comment post -->
Index: /temp/test-xoops.ec-cube.net/html/templates_c/%%1A^1A7^1A727310%%db%3Asystem_block_online.html.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/templates_c/%%1A^1A7^1A727310%%db%3Asystem_block_online.html.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/templates_c/%%1A^1A7^1A727310%%db%3Asystem_block_online.html.php	(revision 405)
@@ -0,0 +1,11 @@
+<?php /* Smarty version 2.6.12, created on 2006-11-28 11:30:43
+         compiled from db:system_block_online.html */ ?>
+<?php echo $this->_tpl_vars['block']['online_total']; ?>
+<br /><br /><?php echo $this->_tpl_vars['block']['lang_members']; ?>
+: <?php echo $this->_tpl_vars['block']['online_members']; ?>
+<br /><?php echo $this->_tpl_vars['block']['lang_guests']; ?>
+: <?php echo $this->_tpl_vars['block']['online_guests']; ?>
+<br /><br /><?php echo $this->_tpl_vars['block']['online_names']; ?>
+ <a href="javascript:openWithSelfMain('<?php echo $this->_tpl_vars['xoops_url']; ?>
+/misc.php?action=showpopups&amp;type=online','Online',420,350);"><?php echo $this->_tpl_vars['block']['lang_more']; ?>
+</a>
Index: /temp/test-xoops.ec-cube.net/html/templates_c/%%74^744^744285BA%%theme_blockleft.html.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/templates_c/%%74^744^744285BA%%theme_blockleft.html.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/templates_c/%%74^744^744285BA%%theme_blockleft.html.php	(revision 405)
@@ -0,0 +1,6 @@
+<?php /* Smarty version 2.6.12, created on 2006-11-24 11:07:55
+         compiled from default/theme_blockleft.html */ ?>
+<div class="blockTitle"><?php echo $this->_tpl_vars['block']['title']; ?>
+</div>
+<div class="blockContent"><?php echo $this->_tpl_vars['block']['content']; ?>
+</div>
Index: /temp/test-xoops.ec-cube.net/html/templates_c/%%64^64C^64C4A963%%theme_blockright.html.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/templates_c/%%64^64C^64C4A963%%theme_blockright.html.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/templates_c/%%64^64C^64C4A963%%theme_blockright.html.php	(revision 405)
@@ -0,0 +1,10 @@
+<?php /* Smarty version 2.6.12, created on 2006-11-24 11:07:55
+         compiled from default/theme_blockright.html */ ?>
+<div style="padding: 10px 0 0 0;">
+<?php if ($this->_tpl_vars['block']['title'] != 'escape'): ?>
+<div class="blockTitle"><?php echo $this->_tpl_vars['block']['title']; ?>
+</div>
+<?php endif; ?>
+<div class="blockContent"><?php echo $this->_tpl_vars['block']['content']; ?>
+</div>
+</div>
Index: /temp/test-xoops.ec-cube.net/html/templates_c/%%19^198^1989CD41%%db%3Amydownloads_submit.html.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/templates_c/%%19^198^1989CD41%%db%3Amydownloads_submit.html.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/templates_c/%%19^198^1989CD41%%db%3Amydownloads_submit.html.php	(revision 405)
@@ -0,0 +1,111 @@
+<?php /* Smarty version 2.6.12, created on 2006-11-24 20:20:01
+         compiled from db:mydownloads_submit.html */ ?>
+<br /><br />
+
+<p align="center">
+    <a href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/modules/mydownloads/index.php"><img src="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/modules/mydownloads/images/logo-en.gif" alt="" /></a>
+</p>
+
+<br />
+
+<table width="100%" cellspacing="1" cellpadding="4" border="0">
+  <tr>
+    <td>
+    <form action="submit.php" method="post" enctype="multipart/form-data">
+        
+
+        <table class ="outer" width="80%">
+          <tr> 
+            <td class="itemHead" align="left" nowrap colspan="2"><b><?php echo $this->_tpl_vars['lang_submitcath']; ?>
+</b> 
+            </td>
+          </tr>
+          <tr> 
+            <td class="head" align="left" nowrap><b><?php echo $this->_tpl_vars['lang_sitetitle']; ?>
+</b></td>
+            <td class="even"> 
+              <input type="text" name="title" size="50" maxlength="100" />
+            </td>
+          </tr>
+          <tr>
+            <td class="head"><b><?php echo $this->_tpl_vars['lang_upload']; ?>
+</b></td>
+            <td class="even"><INPUT TYPE='hidden' NAME='MAX_FILE_SIZE' VALUE='<?php echo $this->_tpl_vars['maxbyte']; ?>
+'>
+              <INPUT type='file' size='50' name='upfile' /> Max <?php echo $this->_tpl_vars['maxbyte_str']; ?>
+Byte.
+            </td>
+          </tr>
+          <tr> 
+            <td class="head" align="left" nowrap><b><?php echo $this->_tpl_vars['lang_siteurl']; ?>
+</b></td>
+            <td class="odd" > 
+              <input type="text" name="url" size="50" maxlength="250" value="http://" />
+            </td>
+          </tr>
+          <tr> 
+            <td class="head" align="left" nowrap><b><?php echo $this->_tpl_vars['lang_category']; ?>
+</b></td>
+            <td class="even"><?php echo $this->_tpl_vars['category_selbox']; ?>
+</td>
+          </tr>
+          <tr> 
+            <td class="head" align="left"><b><?php echo $this->_tpl_vars['lang_homepage']; ?>
+</b></td>
+            <td class="odd" > 
+              <input type="text" name="homepage" size="50" maxlength="100" value="<?php echo $this->_tpl_vars['file']['homepage']; ?>
+">
+            </td>
+          </tr>
+          <tr> 
+            <td class="head" align="left"><b><?php echo $this->_tpl_vars['lang_version']; ?>
+</b></td>
+            <td class="even"> 
+              <input type="text" name="version" size="10" maxlength="20" value="<?php echo $this->_tpl_vars['file']['version']; ?>
+">
+            </td>
+          </tr>
+          <tr> 
+            <td class="head" align="left"><b><?php echo $this->_tpl_vars['lang_size']; ?>
+</b></td>
+            <td class="odd"> 
+              <input type="text" name="size" size="10" maxlength="20" value="<?php echo $this->_tpl_vars['file']['size']; ?>
+">
+              <?php echo $this->_tpl_vars['lang_bytes']; ?>
+</td>
+          </tr>
+          <tr> 
+            <td class="head" align="left"><b><?php echo $this->_tpl_vars['lang_platform']; ?>
+</b></td>
+            <td class="even"> 
+              <input type="text" name="platform" size="50" maxlength="50" value="<?php echo $this->_tpl_vars['file']['plataform']; ?>
+">
+            </td>
+          </tr>
+          <tr> 
+            <td class="head" align="left" valign="top" nowrap><b><?php echo $this->_tpl_vars['lang_description']; ?>
+</b></td>
+            <td class="odd"><?php echo $this->_tpl_vars['xoops_codes'];  echo $this->_tpl_vars['xoops_smilies']; ?>
+</td>
+          </tr>
+          <tr>
+            <td class="head"><b><?php echo $this->_tpl_vars['lang_options']; ?>
+</b></td>
+            <td class="odd">
+            <?php if ($this->_tpl_vars['notify_show']): ?>
+              <input type="checkbox" name="notify" value="1"><?php echo $this->_tpl_vars['lang_notify']; ?>
+</input>
+            <?php endif; ?>
+            </td>
+          </tr>
+        </table>
+      <br />
+      <div style="text-align: center;"><input type="submit" name="submit" class="button" value="<?php echo $this->_tpl_vars['lang_submit']; ?>
+" />&nbsp;<input type="button" value="<?php echo $this->_tpl_vars['lang_cancel']; ?>
+" onclick="javascript:history.go(-1)" /></div>
+    </form>
+  </td>
+</tr>
+</table>
Index: /temp/test-xoops.ec-cube.net/html/templates_c/%%83^83B^83B425A2%%db%3Anewbb_index.html.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/templates_c/%%83^83B^83B425A2%%db%3Anewbb_index.html.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/templates_c/%%83^83B^83B425A2%%db%3Anewbb_index.html.php	(revision 405)
@@ -0,0 +1,142 @@
+<?php /* Smarty version 2.6.12, created on 2006-11-24 13:45:21
+         compiled from db:newbb_index.html */ ?>
+<!-- start module contents -->
+<table cellspacing="0" width="100%">
+  <tr>
+    <td colspan="2"><b><?php echo $this->_tpl_vars['lang_welcomemsg']; ?>
+</b><br /><small><?php echo $this->_tpl_vars['lang_tostart']; ?>
+</small><hr /></td>
+  </tr>
+  <tr valign="bottom">
+    <td><small><?php echo $this->_tpl_vars['lang_totaltopics']; ?>
+<b><?php echo $this->_tpl_vars['total_topics']; ?>
+</b> | <?php echo $this->_tpl_vars['lang_totalposts']; ?>
+<b><?php echo $this->_tpl_vars['total_posts']; ?>
+</b></small><br /><br /><a href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/modules/newbb/index.php"><?php echo $this->_tpl_vars['forum_index_title']; ?>
+</a></td>
+    <td align="right"><small><?php echo $this->_tpl_vars['lang_currenttime']; ?>
+<br /><?php echo $this->_tpl_vars['lang_lastvisit']; ?>
+</small></td>
+  </tr>
+</table>
+<br />
+
+<!-- start forum categories -->
+<?php unset($this->_sections['category']);
+$this->_sections['category']['name'] = 'category';
+$this->_sections['category']['loop'] = is_array($_loop=$this->_tpl_vars['categories']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
+$this->_sections['category']['show'] = true;
+$this->_sections['category']['max'] = $this->_sections['category']['loop'];
+$this->_sections['category']['step'] = 1;
+$this->_sections['category']['start'] = $this->_sections['category']['step'] > 0 ? 0 : $this->_sections['category']['loop']-1;
+if ($this->_sections['category']['show']) {
+    $this->_sections['category']['total'] = $this->_sections['category']['loop'];
+    if ($this->_sections['category']['total'] == 0)
+        $this->_sections['category']['show'] = false;
+} else
+    $this->_sections['category']['total'] = 0;
+if ($this->_sections['category']['show']):
+
+            for ($this->_sections['category']['index'] = $this->_sections['category']['start'], $this->_sections['category']['iteration'] = 1;
+                 $this->_sections['category']['iteration'] <= $this->_sections['category']['total'];
+                 $this->_sections['category']['index'] += $this->_sections['category']['step'], $this->_sections['category']['iteration']++):
+$this->_sections['category']['rownum'] = $this->_sections['category']['iteration'];
+$this->_sections['category']['index_prev'] = $this->_sections['category']['index'] - $this->_sections['category']['step'];
+$this->_sections['category']['index_next'] = $this->_sections['category']['index'] + $this->_sections['category']['step'];
+$this->_sections['category']['first']      = ($this->_sections['category']['iteration'] == 1);
+$this->_sections['category']['last']       = ($this->_sections['category']['iteration'] == $this->_sections['category']['total']);
+?>
+<table cellspacing="1" class="outer">
+  <tr align="left" valign="top"><th colspan="5"> <a href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/modules/newbb/index.php?cat=<?php echo $this->_tpl_vars['categories'][$this->_sections['category']['index']]['cat_id']; ?>
+" style="color:#FFFFFF"><?php echo $this->_tpl_vars['categories'][$this->_sections['category']['index']]['cat_title']; ?>
+</a></th></tr>
+  <tr class="head" align="center">
+    <td>&nbsp;</td>
+	<td nowrap="nowrap" align="left"><?php echo $this->_tpl_vars['lang_forum']; ?>
+</td>
+	<td nowrap="nowrap"><?php echo $this->_tpl_vars['lang_topics']; ?>
+</td>
+	<td nowrap="nowrap"><?php echo $this->_tpl_vars['lang_posts']; ?>
+</td>
+	<td nowrap="nowrap"><?php echo $this->_tpl_vars['lang_lastpost']; ?>
+</td>
+  </tr>
+  <!-- start forums -->
+  <?php unset($this->_sections['forum']);
+$this->_sections['forum']['name'] = 'forum';
+$this->_sections['forum']['loop'] = is_array($_loop=$this->_tpl_vars['categories'][$this->_sections['category']['index']]['forums']['forum_id']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
+$this->_sections['forum']['show'] = true;
+$this->_sections['forum']['max'] = $this->_sections['forum']['loop'];
+$this->_sections['forum']['step'] = 1;
+$this->_sections['forum']['start'] = $this->_sections['forum']['step'] > 0 ? 0 : $this->_sections['forum']['loop']-1;
+if ($this->_sections['forum']['show']) {
+    $this->_sections['forum']['total'] = $this->_sections['forum']['loop'];
+    if ($this->_sections['forum']['total'] == 0)
+        $this->_sections['forum']['show'] = false;
+} else
+    $this->_sections['forum']['total'] = 0;
+if ($this->_sections['forum']['show']):
+
+            for ($this->_sections['forum']['index'] = $this->_sections['forum']['start'], $this->_sections['forum']['iteration'] = 1;
+                 $this->_sections['forum']['iteration'] <= $this->_sections['forum']['total'];
+                 $this->_sections['forum']['index'] += $this->_sections['forum']['step'], $this->_sections['forum']['iteration']++):
+$this->_sections['forum']['rownum'] = $this->_sections['forum']['iteration'];
+$this->_sections['forum']['index_prev'] = $this->_sections['forum']['index'] - $this->_sections['forum']['step'];
+$this->_sections['forum']['index_next'] = $this->_sections['forum']['index'] + $this->_sections['forum']['step'];
+$this->_sections['forum']['first']      = ($this->_sections['forum']['iteration'] == 1);
+$this->_sections['forum']['last']       = ($this->_sections['forum']['iteration'] == $this->_sections['forum']['total']);
+?>
+  <tr>
+    <td class="even" align="center" valign="middle" width="5%"><img src="<?php echo $this->_tpl_vars['categories'][$this->_sections['category']['index']]['forums']['forum_folder'][$this->_sections['forum']['index']]; ?>
+" alt="" /></td>
+    <td class="odd" onclick="window.location='<?php echo $this->_tpl_vars['xoops_url']; ?>
+/modules/newbb/viewforum.php?forum=<?php echo $this->_tpl_vars['categories'][$this->_sections['category']['index']]['forums']['forum_id'][$this->_sections['forum']['index']]; ?>
+'"><a href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/modules/newbb/viewforum.php?forum=<?php echo $this->_tpl_vars['categories'][$this->_sections['category']['index']]['forums']['forum_id'][$this->_sections['forum']['index']]; ?>
+"><b><?php echo $this->_tpl_vars['categories'][$this->_sections['category']['index']]['forums']['forum_name'][$this->_sections['forum']['index']]; ?>
+</b></a><br /><?php echo $this->_tpl_vars['categories'][$this->_sections['category']['index']]['forums']['forum_desc'][$this->_sections['forum']['index']]; ?>
+<br /><span style="font-size:smaller;"><b><?php echo $this->_tpl_vars['lang_moderators']; ?>
+</b> <?php echo $this->_tpl_vars['categories'][$this->_sections['category']['index']]['forums']['forum_moderators'][$this->_sections['forum']['index']]; ?>
+</span></td>
+    <td class="even" width="5%" align="center" valign="middle"><?php echo $this->_tpl_vars['categories'][$this->_sections['category']['index']]['forums']['forum_topics'][$this->_sections['forum']['index']]; ?>
+</td>
+    <td class="odd" width="5%" align="center" valign="middle"><?php echo $this->_tpl_vars['categories'][$this->_sections['category']['index']]['forums']['forum_posts'][$this->_sections['forum']['index']]; ?>
+</td>
+    <td class="even" width="20%" align="center" valign="middle"><?php echo $this->_tpl_vars['categories'][$this->_sections['category']['index']]['forums']['forum_lastpost_time'][$this->_sections['forum']['index']]; ?>
+<br /><?php echo $this->_tpl_vars['categories'][$this->_sections['category']['index']]['forums']['forum_lastpost_user'][$this->_sections['forum']['index']]; ?>
+ <?php echo $this->_tpl_vars['categories'][$this->_sections['category']['index']]['forums']['forum_lastpost_icon'][$this->_sections['forum']['index']]; ?>
+</td>
+  </tr>
+  <?php endfor; endif; ?>
+  <!-- end forums -->
+</table>
+<img src="images/pixel.gif" height="5" alt="" /><br />
+<?php endfor; endif; ?>
+<!-- end forum categories -->
+
+<form name="search" action="search.php" method="post">
+  <table width="100%">
+    <tr>
+      <td valign="middle"><img src="<?php echo $this->_tpl_vars['img_hotfolder']; ?>
+" alt="" /> = <?php echo $this->_tpl_vars['lang_newposts']; ?>
+<br /><img src="<?php echo $this->_tpl_vars['img_folder']; ?>
+" alt="" /> = <?php echo $this->_tpl_vars['lang_nonewposts']; ?>
+<br />  <img src="<?php echo $this->_tpl_vars['img_locked']; ?>
+" alt="" /> = <?php echo $this->_tpl_vars['lang_private']; ?>
+</td>
+      <td align="right" valign="bottom"><b><?php echo $this->_tpl_vars['lang_search']; ?>
+</b>&nbsp;<input name="term" type="text" size="20" /><input type="hidden" name="forum" value="all" /><input type="hidden" name="sortby" value="p.post_time desc" /><input type="hidden" name="searchboth" value="both" /><input type="hidden" name="submit" value="<?php echo $this->_tpl_vars['lang_search']; ?>
+" /><br />[ <a href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/modules/newbb/search.php"><?php echo $this->_tpl_vars['lang_advsearch']; ?>
+</a> ]</td>
+    </tr>
+  </table>
+</form>
+<?php $_smarty_tpl_vars = $this->_tpl_vars;
+$this->_smarty_include(array('smarty_include_tpl_file' => 'db:system_notification_select.html', 'smarty_include_vars' => array()));
+$this->_tpl_vars = $_smarty_tpl_vars;
+unset($_smarty_tpl_vars);
+ ?>
+<!-- end module contents -->
Index: /temp/test-xoops.ec-cube.net/html/templates_c/%%AB^AB2^AB2016AE%%db%3Anews_block_new.html.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/templates_c/%%AB^AB2^AB2016AE%%db%3Anews_block_new.html.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/templates_c/%%AB^AB2^AB2016AE%%db%3Anews_block_new.html.php	(revision 405)
@@ -0,0 +1,13 @@
+<?php /* Smarty version 2.6.12, created on 2006-11-28 11:30:43
+         compiled from db:news_block_new.html */ ?>
+<ul>
+  <?php $_from = $this->_tpl_vars['block']['stories']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
+    foreach ($_from as $this->_tpl_vars['news']):
+?>
+    <li><a href="<?php echo $this->_tpl_vars['xoops_url']; ?>
+/modules/news/article.php?storyid=<?php echo $this->_tpl_vars['news']['id']; ?>
+"><?php echo $this->_tpl_vars['news']['title']; ?>
+</a> (<?php echo $this->_tpl_vars['news']['date']; ?>
+)</li>
+  <?php endforeach; endif; unset($_from); ?>
+</ul>
Index: /temp/test-xoops.ec-cube.net/html/cache/adminmenu.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/cache/adminmenu.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/cache/adminmenu.php	(revision 405)
@@ -0,0 +1,124 @@
+<?php
+$xoops_admin_menu_js = "function popUpL1() {
+shutdown();
+popUp(\"L1\",true);
+}
+function popUpL16() {
+shutdown();
+popUp(\"L16\",true);
+}
+function popUpL20() {
+shutdown();
+popUp(\"L20\",true);
+}
+function popUpL30() {
+shutdown();
+popUp(\"L30\",true);
+}
+function popUpL35() {
+shutdown();
+popUp(\"L35\",true);
+}
+function popUpL41() {
+shutdown();
+popUp(\"L41\",true);
+}
+";
+$xoops_admin_menu_ml[1] = "setleft('L1',105);
+settop('L1',150);
+";
+$xoops_admin_menu_ml[4] = "setleft('L16',105);
+settop('L16',165);
+";
+$xoops_admin_menu_ml[5] = "setleft('L20',105);
+settop('L20',180);
+";
+$xoops_admin_menu_ml[8] = "setleft('L30',105);
+settop('L30',195);
+";
+$xoops_admin_menu_ml[9] = "setleft('L35',105);
+settop('L35',210);
+";
+$xoops_admin_menu_ml[11] = "setleft('L41',105);
+settop('L41',225);
+";
+$xoops_admin_menu_sd[1] = "popUp('L1',false);
+";
+$xoops_admin_menu_sd[4] = "popUp('L16',false);
+";
+$xoops_admin_menu_sd[5] = "popUp('L20',false);
+";
+$xoops_admin_menu_sd[8] = "popUp('L30',false);
+";
+$xoops_admin_menu_sd[9] = "popUp('L35',false);
+";
+$xoops_admin_menu_sd[11] = "popUp('L41',false);
+";
+$xoops_admin_menu_ft[1] = "<a href='".XOOPS_URL."/modules/system/admin.php' onmouseover='moveLayerY(\"L1\", currentY,event) ; popUpL1();'><img src='".XOOPS_URL."/modules/system/images/system_slogo.png' alt='' /></a><br />
+";
+$xoops_admin_menu_ft[4] = "<a href='".XOOPS_URL."/modules/news/admin/index.php' onmouseover='moveLayerY(\"L16\", currentY,event) ; popUpL16();'><img src='".XOOPS_URL."/modules/news/images/news_slogo.png' alt='' /></a><br />
+";
+$xoops_admin_menu_ft[5] = "<a href='".XOOPS_URL."/modules/newbb/admin/index.php' onmouseover='moveLayerY(\"L20\", currentY,event) ; popUpL20();'><img src='".XOOPS_URL."/modules/newbb/images/xoopsbb_slogo.png' alt='' /></a><br />
+";
+$xoops_admin_menu_ft[8] = "<a href='".XOOPS_URL."/modules/rssj/admin/index.php' onmouseover='moveLayerY(\"L30\", currentY,event) ; popUpL30();'><img src='".XOOPS_URL."/modules/rssj/images/rssfitJ.png' alt='' /></a><br />
+";
+$xoops_admin_menu_ft[9] = "<a href='".XOOPS_URL."/modules/mydownloads/admin/index.php' onmouseover='moveLayerY(\"L35\", currentY,event) ; popUpL35();'><img src='".XOOPS_URL."/modules/mydownloads/images/mydl_slogo.png' alt='' /></a><br />
+";
+$xoops_admin_menu_ft[11] = "<a href='".XOOPS_URL."/modules/tinyd0/admin/index.php' onmouseover='moveLayerY(\"L41\", currentY,event) ; popUpL41();'><img src='".XOOPS_URL."/modules/tinyd0/images/tinycontent0.png' alt='' /></a><br />
+";
+$xoops_admin_menu_dv = "<div id='L1' style='position: absolute; visibility: hidden; z-index:1000;'><table class='outer' width='150' cellspacing='1'><tr><th nowrap='nowrap'>¥·¥¹¥Æ¥à´ÉÍý</th></tr><tr><td class='even' nowrap='nowrap'><img src='".XOOPS_URL."/images/pointer.gif' width='8' height='8' alt='' />&nbsp;<a href='".XOOPS_URL."/modules/system/admin.php?fct=banners' onmouseover='popUpL1();'>¥Ð¥Ê¡¼´ÉÍý</a><br />
+<img src='".XOOPS_URL."/images/pointer.gif' width='8' height='8' alt='' />&nbsp;<a href='".XOOPS_URL."/modules/system/admin.php?fct=blocksadmin' onmouseover='popUpL1();'>¥Ö¥í¥Ã¥¯´ÉÍý</a><br />
+<img src='".XOOPS_URL."/images/pointer.gif' width='8' height='8' alt='' />&nbsp;<a href='".XOOPS_URL."/modules/system/admin.php?fct=groups' onmouseover='popUpL1();'>¥°¥ë¡¼¥×´ÉÍý</a><br />
+<img src='".XOOPS_URL."/images/pointer.gif' width='8' height='8' alt='' />&nbsp;<a href='".XOOPS_URL."/modules/system/admin.php?fct=images' onmouseover='popUpL1();'>¥¤¥á¡¼¥¸¡¦¥Þ¥Í¥¸¥ã¡¼</a><br />
+<img src='".XOOPS_URL."/images/pointer.gif' width='8' height='8' alt='' />&nbsp;<a href='".XOOPS_URL."/modules/system/admin.php?fct=modulesadmin' onmouseover='popUpL1();'>¥â¥¸¥å¡¼¥ë´ÉÍý</a><br />
+<img src='".XOOPS_URL."/images/pointer.gif' width='8' height='8' alt='' />&nbsp;<a href='".XOOPS_URL."/modules/system/admin.php?fct=preferences' onmouseover='popUpL1();'>°ìÈÌÀßÄê</a><br />
+<img src='".XOOPS_URL."/images/pointer.gif' width='8' height='8' alt='' />&nbsp;<a href='".XOOPS_URL."/modules/system/admin.php?fct=smilies' onmouseover='popUpL1();'>´é¥¢¥¤¥³¥óÀßÄê</a><br />
+<img src='".XOOPS_URL."/images/pointer.gif' width='8' height='8' alt='' />&nbsp;<a href='".XOOPS_URL."/modules/system/admin.php?fct=userrank' onmouseover='popUpL1();'>¥æ¡¼¥¶¥é¥ó¥­¥ó¥°ÀßÄê</a><br />
+<img src='".XOOPS_URL."/images/pointer.gif' width='8' height='8' alt='' />&nbsp;<a href='".XOOPS_URL."/modules/system/admin.php?fct=users' onmouseover='popUpL1();'>¥æ¡¼¥¶´ÉÍý</a><br />
+<img src='".XOOPS_URL."/images/pointer.gif' width='8' height='8' alt='' />&nbsp;<a href='".XOOPS_URL."/modules/system/admin.php?fct=findusers' onmouseover='popUpL1();'>¥æ¡¼¥¶¸¡º÷</a><br />
+<img src='".XOOPS_URL."/images/pointer.gif' width='8' height='8' alt='' />&nbsp;<a href='".XOOPS_URL."/modules/system/admin.php?fct=mailusers' onmouseover='popUpL1();'>¥æ¡¼¥¶°¸¥á¡¼¥ëÁ÷¿®</a><br />
+<img src='".XOOPS_URL."/images/pointer.gif' width='8' height='8' alt='' />&nbsp;<a href='".XOOPS_URL."/modules/system/admin.php?fct=avatars' onmouseover='popUpL1();'>¥¢¥Ð¥¿¡¼¡¦¥Þ¥Í¥¸¥ã¡¼</a><br />
+<img src='".XOOPS_URL."/images/pointer.gif' width='8' height='8' alt='' />&nbsp;<a href='".XOOPS_URL."/modules/system/admin.php?fct=tplsets' onmouseover='popUpL1();'>¥Æ¥ó¥×¥ì¡¼¥È¡¦¥Þ¥Í¥¸¥ã¡¼</a><br />
+<img src='".XOOPS_URL."/images/pointer.gif' width='8' height='8' alt='' />&nbsp;<a href='".XOOPS_URL."/modules/system/admin.php?fct=comments' onmouseover='popUpL1();'>¥³¥á¥ó¥È¡¦¥Þ¥Í¥¸¥ã¡¼</a><br />
+<div style='margin-top: 5px; font-size: smaller; text-align: right;'><a href='#' onmouseover='shutdown();'>[ÊÄ¤¸¤ë]</a></div></td></tr><tr><th style='font-size: smaller; text-align: left;'><img src='".XOOPS_URL."/modules/system/images/system_slogo.png' alt='' /><br /><b>"._VERSION.":</b> 1<br /><b>"._DESCRIPTION.":</b> ¥µ¥¤¥È¤Î¥³¥¢ÉôÊ¬¤ÎÀßÄê¤ò¹Ô¤¤¤Þ¤¹</th></tr></table></div>
+<div id='L16' style='position: absolute; visibility: hidden; z-index:1000;'><table class='outer' width='150' cellspacing='1'><tr><th nowrap='nowrap'>¥Ë¥å¡¼¥¹</th></tr><tr><td class='even' nowrap='nowrap'><img src='".XOOPS_URL."/images/pointer.gif' width='8' height='8' alt='' />&nbsp;<a href='".XOOPS_URL."/modules/news/admin/index.php?op=topicsmanager' onmouseover='popUpL16();'>¥È¥Ô¥Ã¥¯´ÉÍý</a><br />
+<img src='".XOOPS_URL."/images/pointer.gif' width='8' height='8' alt='' />&nbsp;<a href='".XOOPS_URL."/modules/news/admin/index.php?op=newarticle' onmouseover='popUpL16();'>¥Ë¥å¡¼¥¹µ­»ö¤ÎÅê¹Æ / ÊÔ½¸</a><br />
+<img src='".XOOPS_URL."/images/pointer.gif' width='8' height='8' alt='' />&nbsp;<a href='".XOOPS_URL."/modules/system/admin.php?fct=preferences&amp;op=showmod&amp;mod=4' onmouseover='popUpL16();'>°ìÈÌÀßÄê</a><br />
+<div style='margin-top: 5px; font-size: smaller; text-align: right;'><a href='#' onmouseover='shutdown();'>[ÊÄ¤¸¤ë]</a></div></td></tr><tr><th style='font-size: smaller; text-align: left;'><img src='".XOOPS_URL."/modules/news/images/news_slogo.png' alt='' /><br /><b>"._VERSION.":</b> 1.1<br /><b>"._DESCRIPTION.":</b> ¥æ¡¼¥¶¤¬¼«Í³¤Ë¥³¥á¥ó¥È¤Ç¤­¤ë¡¢¥¹¥é¥Ã¥·¥å¥É¥Ã¥ÈÉ÷¤Î¥Ë¥å¡¼¥¹µ­»ö¥·¥¹¥Æ¥à¤ò¹½ÃÛ¤·¤Þ¤¹</th></tr></table></div>
+<div id='L20' style='position: absolute; visibility: hidden; z-index:1000;'><table class='outer' width='150' cellspacing='1'><tr><th nowrap='nowrap'>¥Õ¥©¡¼¥é¥à</th></tr><tr><td class='even' nowrap='nowrap'><img src='".XOOPS_URL."/images/pointer.gif' width='8' height='8' alt='' />&nbsp;<a href='".XOOPS_URL."/modules/newbb/admin/admin_forums.php?mode=addforum' onmouseover='popUpL20();'>¥Õ¥©¡¼¥é¥à¤ÎÄÉ²Ã</a><br />
+<img src='".XOOPS_URL."/images/pointer.gif' width='8' height='8' alt='' />&nbsp;<a href='".XOOPS_URL."/modules/newbb/admin/admin_forums.php?mode=editforum' onmouseover='popUpL20();'>¥Õ¥©¡¼¥é¥à¤ÎÊÔ½¸</a><br />
+<img src='".XOOPS_URL."/images/pointer.gif' width='8' height='8' alt='' />&nbsp;<a href='".XOOPS_URL."/modules/newbb/admin/admin_priv_forums.php?mode=editforum' onmouseover='popUpL20();'>¥×¥é¥¤¥Ù¡¼¥È¥Õ¥©¡¼¥é¥à¤ÎÀßÄê</a><br />
+<img src='".XOOPS_URL."/images/pointer.gif' width='8' height='8' alt='' />&nbsp;<a href='".XOOPS_URL."/modules/newbb/admin/admin_forums.php?mode=sync' onmouseover='popUpL20();'>¥¹¥ì¥Ã¥ÉÅê¹Æ¿ô¤ÎºÆ½¸·×</a><br />
+<img src='".XOOPS_URL."/images/pointer.gif' width='8' height='8' alt='' />&nbsp;<a href='".XOOPS_URL."/modules/newbb/admin/admin_forums.php?mode=addcat' onmouseover='popUpL20();'>¥«¥Æ¥´¥ê¤ÎÄÉ²Ã</a><br />
+<img src='".XOOPS_URL."/images/pointer.gif' width='8' height='8' alt='' />&nbsp;<a href='".XOOPS_URL."/modules/newbb/admin/admin_forums.php?mode=editcat' onmouseover='popUpL20();'>¥«¥Æ¥´¥ê¤ÎÊÔ½¸</a><br />
+<img src='".XOOPS_URL."/images/pointer.gif' width='8' height='8' alt='' />&nbsp;<a href='".XOOPS_URL."/modules/newbb/admin/admin_forums.php?mode=remcat' onmouseover='popUpL20();'>¥«¥Æ¥´¥ê¡¼¤Îºï½ü</a><br />
+<img src='".XOOPS_URL."/images/pointer.gif' width='8' height='8' alt='' />&nbsp;<a href='".XOOPS_URL."/modules/newbb/admin/admin_forums.php?mode=catorder' onmouseover='popUpL20();'>¥«¥Æ¥´¥ê¤ÎÇÛÃÖÊÑ¹¹</a><br />
+<img src='".XOOPS_URL."/images/pointer.gif' width='8' height='8' alt='' />&nbsp;<a href='".XOOPS_URL."/modules/system/admin.php?fct=preferences&amp;op=showmod&amp;mod=5' onmouseover='popUpL20();'>°ìÈÌÀßÄê</a><br />
+<div style='margin-top: 5px; font-size: smaller; text-align: right;'><a href='#' onmouseover='shutdown();'>[ÊÄ¤¸¤ë]</a></div></td></tr><tr><th style='font-size: smaller; text-align: left;'><img src='".XOOPS_URL."/modules/newbb/images/xoopsbb_slogo.png' alt='' /><br /><b>"._VERSION.":</b> 1<br /><b>"._DESCRIPTION.":</b> XOOPS¥Õ¥©¡¼¥é¥à¥â¥¸¥å¡¼¥ë</th></tr></table></div>
+<div id='L30' style='position: absolute; visibility: hidden; z-index:1000;'><table class='outer' width='150' cellspacing='1'><tr><th nowrap='nowrap'>XML (RSS ÇÛ¿®)</th></tr><tr><td class='even' nowrap='nowrap'><img src='".XOOPS_URL."/images/pointer.gif' width='8' height='8' alt='' />&nbsp;<a href='".XOOPS_URL."/modules/rssj/admin/index.php?op=intro' onmouseover='popUpL30();'>Í×ÌóÊ¸ÊÔ½¸</a><br />
+<img src='".XOOPS_URL."/images/pointer.gif' width='8' height='8' alt='' />&nbsp;<a href='".XOOPS_URL."/modules/rssj/admin/index.php?op=plugins' onmouseover='popUpL30();'>¥×¥é¥°¥¤¥ó´ÉÍý</a><br />
+<img src='".XOOPS_URL."/images/pointer.gif' width='8' height='8' alt='' />&nbsp;<a href='".XOOPS_URL."/modules/rssj/admin/index.php?op=param' onmouseover='popUpL30();'>¥Ñ¥é¥á¡¼¥¿´ÉÍý</a><br />
+<img src='".XOOPS_URL."/images/pointer.gif' width='8' height='8' alt='' />&nbsp;<a href='".XOOPS_URL."/modules/system/admin.php?fct=preferences&amp;op=showmod&amp;mod=8' onmouseover='popUpL30();'>°ìÈÌÀßÄê</a><br />
+<div style='margin-top: 5px; font-size: smaller; text-align: right;'><a href='#' onmouseover='shutdown();'>[ÊÄ¤¸¤ë]</a></div></td></tr><tr><th style='font-size: smaller; text-align: left;'><img src='".XOOPS_URL."/modules/rssj/images/rssfitJ.png' alt='' /><br /><b>"._VERSION.":</b> 1.1<br /><b>"._DESCRIPTION.":</b> ³ÈÄ¥ XML news ÇÛ¿®µ¡Ç½ÄÉ²Ã</th></tr></table></div>
+<div id='L35' style='position: absolute; visibility: hidden; z-index:1000;'><table class='outer' width='150' cellspacing='1'><tr><th nowrap='nowrap'>¥À¥¦¥ó¥í¡¼¥É</th></tr><tr><td class='even' nowrap='nowrap'><img src='".XOOPS_URL."/images/pointer.gif' width='8' height='8' alt='' />&nbsp;<a href='".XOOPS_URL."/modules/mydownloads/admin/index.php?op=downloadsConfigMenu' onmouseover='popUpL35();'>¥À¥¦¥ó¥í¡¼¥É¾ðÊó¤ÎÄÉ²Ã / ÊÔ½¸</a><br />
+<img src='".XOOPS_URL."/images/pointer.gif' width='8' height='8' alt='' />&nbsp;<a href='".XOOPS_URL."/modules/mydownloads/admin/index.php?op=listNewDownloads' onmouseover='popUpL35();'>¿·µ¬Åê¹Æ¥À¥¦¥ó¥í¡¼¥É¾ðÊó</a><br />
+<img src='".XOOPS_URL."/images/pointer.gif' width='8' height='8' alt='' />&nbsp;<a href='".XOOPS_URL."/modules/mydownloads/admin/index.php?op=listBrokenDownloads' onmouseover='popUpL35();'>¥Õ¥¡¥¤¥ëÇËÂ»Êó¹ð</a><br />
+<img src='".XOOPS_URL."/images/pointer.gif' width='8' height='8' alt='' />&nbsp;<a href='".XOOPS_URL."/modules/mydownloads/admin/index.php?op=listModReq' onmouseover='popUpL35();'>½¤Àµ¥À¥¦¥ó¥í¡¼¥É¾ðÊó</a><br />
+<img src='".XOOPS_URL."/images/pointer.gif' width='8' height='8' alt='' />&nbsp;<a href='".XOOPS_URL."/modules/system/admin.php?fct=preferences&amp;op=showmod&amp;mod=9' onmouseover='popUpL35();'>°ìÈÌÀßÄê</a><br />
+<div style='margin-top: 5px; font-size: smaller; text-align: right;'><a href='#' onmouseover='shutdown();'>[ÊÄ¤¸¤ë]</a></div></td></tr><tr><th style='font-size: smaller; text-align: left;'><img src='".XOOPS_URL."/modules/mydownloads/images/mydl_slogo.png' alt='' /><br /><b>"._VERSION.":</b> 1.04<br /><b>"._DESCRIPTION.":</b> ¥æ¡¼¥¶¤¬¼«Í³¤Ë¥À¥¦¥ó¥í¡¼¥É¾ðÊó¤ÎÅÐÏ¿¡¿É¾²Á¤ò¹Ô¤¨¤ë¥»¥¯¥·¥ç¥ó¤òºîÀ®¤·¤Þ¤¹¡£</th></tr></table></div>
+<div id='L41' style='position: absolute; visibility: hidden; z-index:1000;'><table class='outer' width='150' cellspacing='1'><tr><th nowrap='nowrap'>TinyD0</th></tr><tr><td class='even' nowrap='nowrap'><img src='".XOOPS_URL."/images/pointer.gif' width='8' height='8' alt='' />&nbsp;<a href='".XOOPS_URL."/modules/tinyd0/admin/index.php?op=show' onmouseover='popUpL41();'>¥³¥ó¥Æ¥ó¥Ä´ÉÍý</a><br />
+<img src='".XOOPS_URL."/images/pointer.gif' width='8' height='8' alt='' />&nbsp;<a href='".XOOPS_URL."/modules/tinyd0/admin/index.php?op=submit' onmouseover='popUpL41();'>¥³¥ó¥Æ¥ó¥Ä¤ÎÄÉ²Ã</a><br />
+<img src='".XOOPS_URL."/images/pointer.gif' width='8' height='8' alt='' />&nbsp;<a href='".XOOPS_URL."/modules/tinyd0/admin/index.php?op=nlink' onmouseover='popUpL41();'>¥Ú¡¼¥¸¥é¥Ã¥×¤ÎÄÉ²Ã</a><br />
+<img src='".XOOPS_URL."/images/pointer.gif' width='8' height='8' alt='' />&nbsp;<a href='".XOOPS_URL."/modules/tinyd0/admin/myblocksadmin.php' onmouseover='popUpL41();'>¥Ö¥í¥Ã¥¯¡¦¥¢¥¯¥»¥¹¸¢¸Â</a><br />
+<img src='".XOOPS_URL."/images/pointer.gif' width='8' height='8' alt='' />&nbsp;<a href='".XOOPS_URL."/modules/tinyd0/admin/mytplsadmin.php' onmouseover='popUpL41();'>¥Æ¥ó¥×¥ì¡¼¥È´ÉÍý</a><br />
+<img src='".XOOPS_URL."/images/pointer.gif' width='8' height='8' alt='' />&nbsp;<a href='".XOOPS_URL."/modules/system/admin.php?fct=preferences&amp;op=showmod&amp;mod=11' onmouseover='popUpL41();'>°ìÈÌÀßÄê</a><br />
+<div style='margin-top: 5px; font-size: smaller; text-align: right;'><a href='#' onmouseover='shutdown();'>[ÊÄ¤¸¤ë]</a></div></td></tr><tr><th style='font-size: smaller; text-align: left;'><img src='".XOOPS_URL."/modules/tinyd0/images/tinycontent0.png' alt='' /><br /><b>"._VERSION.":</b> 2.25<br /><b>"._DESCRIPTION.":</b> ¼ê·Ú¤Ë¥³¥ó¥Æ¥ó¥Ä¤Îºî¤ì¤ë¥â¥¸¥å¡¼¥ë</th></tr></table></div>
+<script language='JavaScript'>
+<!--
+moveLayers();
+loaded = 1;
+// -->
+</script>
+";
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/user.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/user.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/user.php	(revision 405)
@@ -0,0 +1,177 @@
+<?php
+// $Id: user.php,v 1.2.6.1 2005/03/30 15:49:04 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+$xoopsOption['pagetype'] = 'user';
+include 'mainfile.php';
+
+$op = 'main';
+
+if ( isset($_POST['op']) ) {
+    $op = trim($_POST['op']);
+} elseif ( isset($_GET['op']) ) {
+    $op = trim($_GET['op']);
+}
+
+if ($op == 'main') {
+    if ( !$xoopsUser ) {
+        $xoopsOption['template_main'] = 'system_userform.html';
+        include 'header.php';
+        $xoopsTpl->assign('lang_login', _LOGIN);
+        $xoopsTpl->assign('lang_username', _USERNAME);
+        if (isset($_COOKIE[$xoopsConfig['usercookie']])) {
+            $xoopsTpl->assign('usercookie', $_COOKIE[$xoopsConfig['usercookie']]);
+        }
+        if (isset($_GET['xoops_redirect'])) {
+            $xoopsTpl->assign('redirect_page', htmlspecialchars(trim($_GET['xoops_redirect']), ENT_QUOTES));
+        }
+        $xoopsTpl->assign('lang_password', _PASSWORD);
+        $xoopsTpl->assign('lang_notregister', _US_NOTREGISTERED);
+        $xoopsTpl->assign('lang_lostpassword', _US_LOSTPASSWORD);
+        $xoopsTpl->assign('lang_noproblem', _US_NOPROBLEM);
+        $xoopsTpl->assign('lang_youremail', _US_YOUREMAIL);
+        $xoopsTpl->assign('lang_sendpassword', _US_SENDPASSWORD);
+        include 'footer.php';
+    } elseif ( $xoopsUser ) {
+        header('Location: '.XOOPS_URL.'/userinfo.php?uid='.$xoopsUser->getVar('uid'));
+    }
+    exit();
+}
+
+if ($op == 'login') {
+    include_once XOOPS_ROOT_PATH.'/include/checklogin.php';
+    exit();
+}
+
+if ($op == 'logout') {
+    $message = '';
+    $_SESSION = array();
+    session_destroy();
+    if ($xoopsConfig['use_mysession'] && $xoopsConfig['session_name'] != '') {
+        setcookie($xoopsConfig['session_name'], '', time()- 3600, '/',  '', 0);
+    }
+    // autologin hack GIJ (clear autologin cookies)
+    $xoops_cookie_path = defined('XOOPS_COOKIE_PATH') ? XOOPS_COOKIE_PATH : preg_replace( '?http://[^/]+(/.*)$?' , "$1" , XOOPS_URL ) ;
+    if( $xoops_cookie_path == XOOPS_URL ) $xoops_cookie_path = '/' ;
+    setcookie('autologin_uname', '', time() - 3600, $xoops_cookie_path, '', 0);
+    setcookie('autologin_pass', '', time() - 3600, $xoops_cookie_path, '', 0);
+    setcookie('autologin_uname', '', time() - 3600, '/', '', 0); //
+    setcookie('autologin_pass', '', time() - 3600, '/', '', 0); // for older auto login hacks (should be removed)
+    // end of autologin hack GIJ
+    // clear entry from online users table
+    if (is_object($xoopsUser)) {
+        $online_handler =& xoops_gethandler('online');
+        $online_handler->destroy($xoopsUser->getVar('uid'));
+    }
+    $message = _US_LOGGEDOUT.'<br />'._US_THANKYOUFORVISIT;
+    redirect_header('index.php', 1, $message);
+    exit();
+}
+
+if ($op == 'actv') {
+    $id = intval($_GET['id']);
+    $actkey = trim($_GET['actkey']);
+    if (empty($id)) {
+        redirect_header('index.php',1,'');
+        exit();
+    }
+    $member_handler =& xoops_gethandler('member');
+    $thisuser =& $member_handler->getUser($id);
+    if (!is_object($thisuser)) {
+        exit();
+    }
+    if ($thisuser->getVar('actkey') != $actkey) {
+        redirect_header('index.php',5,_US_ACTKEYNOT);
+    } else {
+        if ($thisuser->getVar('level') > 0 ) {
+            redirect_header('user.php',5,_US_ACONTACT);
+        } else {
+            if (false != $member_handler->activateUser($thisuser)) {
+                $config_handler =& xoops_gethandler('config');
+                $xoopsConfigUser =& $config_handler->getConfigsByCat(XOOPS_CONF_USER);
+                if ($xoopsConfigUser['activation_type'] == 2) {
+                    $myts =& MyTextSanitizer::getInstance();
+                    $xoopsMailer =& getMailer();
+                    $xoopsMailer->useMail();
+                    $xoopsMailer->setTemplate('activated.tpl');
+                    $xoopsMailer->assign('SITENAME', $xoopsConfig['sitename']);
+                    $xoopsMailer->assign('ADMINMAIL', $xoopsConfig['adminmail']);
+                    $xoopsMailer->assign('SITEURL', XOOPS_URL."/");
+                    $xoopsMailer->setToUsers($thisuser);
+                    $xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
+                    $xoopsMailer->setFromName($xoopsConfig['sitename']);
+                    $xoopsMailer->setSubject(sprintf(_US_YOURACCOUNT,$xoopsConfig['sitename']));
+                    include 'header.php';
+                    if ( !$xoopsMailer->send() ) {
+                        printf(_US_ACTVMAILNG, $thisuser->getVar('uname'));
+                    } else {
+                        printf(_US_ACTVMAILOK, $thisuser->getVar('uname'));
+                    }
+                    include 'footer.php';
+                } else {
+                    redirect_header('user.php',5,_US_ACTLOGIN);
+                }
+            } else {
+                redirect_header('index.php',5,'Activation failed!');
+            }
+        }
+    }
+    exit();
+}
+
+if ($op == 'delete') {
+    $config_handler =& xoops_gethandler('config');
+    $xoopsConfigUser =& $config_handler->getConfigsByCat(XOOPS_CONF_USER);
+    if (!$xoopsUser || $xoopsConfigUser['self_delete'] != 1) {
+        redirect_header('index.php',5,_US_NOPERMISS);
+        exit();
+    } else {
+        $groups = $xoopsUser->getGroups();
+        if (in_array(XOOPS_GROUP_ADMIN, $groups)){
+            // users in the webmasters group may not be deleted
+            redirect_header('user.php', 5, _US_ADMINNO);
+            exit();
+        }
+        $ok = !isset($_POST['ok']) ? 0 : intval($_POST['ok']);
+        if ($ok != 1) {
+            include 'header.php';
+            xoops_confirm(array('op' => 'delete', 'ok' => 1), 'user.php', _US_SURETODEL.'<br/>'._US_REMOVEINFO);
+            include 'footer.php';
+        } else {
+            $del_uid = $xoopsUser->getVar("uid");
+            $member_handler =& xoops_gethandler('member');
+            if (false != $member_handler->deleteUser($xoopsUser)) {
+                $online_handler =& xoops_gethandler('online');
+                $online_handler->destroy($del_uid);
+                xoops_notification_deletebyuser($del_uid);
+                redirect_header('index.php', 5, _US_BEENDELED);
+            }
+            redirect_header('index.php',5,_US_NOPERMISS);
+        }
+        exit();
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/uploads/README
===================================================================
--- /temp/test-xoops.ec-cube.net/html/uploads/README	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/uploads/README	(revision 405)
@@ -0,0 +1,45 @@
+This is an avator collection for XOOPS.
+You can use these avators free.
+
+
+USAGE:
+
+- copy *.gif into uploads
+
+- replace 'xoops_avatar' to '(your db prefix)_avatar' by editing register.sql (it is unnecessary if you use 'xoops' as db prefix)
+
+- run a query of register.sql by phpMyAdmin or mysql shell.
+
+
+COPYRIGHT:
+
+All copyright is reserved by original author -Dart-
+http://www.angel.ne.jp/~oribia/
+
+If you want to re-distribute it, you have to be allowed by him.
+
+
+--------------------------------------------------------------
+(for Japanese)
+XOOPSÍÑ¤Î¥¢¥Ð¥¿¡¼¥³¥ì¥¯¥·¥ç¥ó¤Ç¤¹¡£
+¥Õ¥¡¥¤¥ëÌ¾¤ò¥·¥¹¥Æ¥à¥¢¥Ð¥¿¡¼ÍÑ¤ËÊÑ¹¹¤·¤Æ¡¢SQL¥Õ¥¡¥¤¥ë¤òÄÉ²Ã¤·¤Æ¤¤¤Þ¤¹¡£
+
+»È¤¤Êý¡§
+
+- XOOPS ¤Î uploads/ ¥Õ¥©¥ë¥À¤ËÁ´GIF¥Õ¥¡¥¤¥ë¤ò¥³¥Ô¡¼¤·¤Æ¤¯¤À¤µ¤¤¡£
+
+- ¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎÀÜÆ¬¼­¤¬ xoops ¤Ç¤Ê¤¤¿Í¤Ï¡¢register.sql ¤ò¥¨¥Ç¥£¥¿¤Ç³«¤¤¤Æ xoops_avatar ¤È¤¤¤¦ÉôÊ¬¤ò¤ª»È¤¤¤ÎÀÜÆ¬¼­¤ÇÃÖ´¹¤·¤Æ¤¯¤À¤µ¤¤
+
+- ¤½¤Î¸å¡¢phpMyAdmin ¤â¤·¤¯¤Ï mysql¥³¥Þ¥ó¥É¥é¥¤¥ó¤«¤é¡¢register.sql ¤òÈ¯¹Ô¤·¤Æ²¼¤µ¤¤
+
+
+Ãøºî¸¢¡§
+¥ª¥ê¥¸¥Ê¥ë¤Ï¡¢²Ã¹©¼«Í³¤«¤Ä¥Õ¥ê¡¼¥¦¥¨¥¢¤Ç¤¢¤ë´é¥¢¥¤¥³¥ó½¸¤Ç¤¹¤¬¡¢Ãøºî¸¢¤Ï¤â¤Á¤í¤óºî¼Ô¤Î¥À¡¼¥È¤µ¤ó¤¬ÊÝ»ý¤·¤Æ¤¤¤Þ¤¹¡£
+
+FB-¥Ù¥Æ¥é¥ó¤Î½é¿´¼Ô-
+http://www.angel.ne.jp/~oribia/
+¡Ê¤³¤Á¤é¤Ë¤Ï¡¢¤Ï¤ë¤«¤ËÂô»³¤Î´é¥¢¥¤¥³¥ó¤¬¤¢¤ê¤Þ¤¹¡£¸½ºß¤âÉÑÈË¤Ë¹¹¿·¤Ê¤µ¤ì¤Æ¤¤¤Þ¤¹¡Ë
+
+¤Ê¤ª¡¢ºÆÇÛÉÛ¤Ïºî¼Ô¤Îµö²Ä¤¬É¬Í×¤Ç¤¹¡£
+¤â¤Á¤í¤ó¡¢¤³¤Î¥¢¡¼¥«¥¤¥Ö¤â¡¢GIJOE¤¬¥À¡¼¥È¤µ¤ó¤ÎµöÂú¤òÆÀ¤Æ¤¤¤Þ¤¹¡£
+
Index: /temp/test-xoops.ec-cube.net/html/uploads/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/uploads/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/uploads/index.html	(revision 405)
@@ -0,0 +1,1 @@
+<script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/uploads/make_sql.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/uploads/make_sql.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/uploads/make_sql.php	(revision 405)
@@ -0,0 +1,16 @@
+#!/usr/local/bin/php
+<?
+
+for( $i = 1 ; $i <= 60 ; $i ++ ) {
+	$formatted_i = sprintf("%03d",$i) ;
+	$weight = $i + 1000 ;
+	echo "INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='$weight',avatar_type='S',avatar_name='Face-a$formatted_i',avatar_file='savt2a{$formatted_i}.gif';\n" ;
+}
+
+for( $i = 1 ; $i <= 40 ; $i ++ ) {
+	$formatted_i = sprintf("%03d",$i) ;
+	$weight = $i + 1300 ;
+	echo "INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='$weight',avatar_type='S',avatar_name='Face-d$formatted_i',avatar_file='savt2d{$formatted_i}.gif';\n" ;
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/uploads/register.sql
===================================================================
--- /temp/test-xoops.ec-cube.net/html/uploads/register.sql	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/uploads/register.sql	(revision 405)
@@ -0,0 +1,100 @@
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1001',avatar_type='S',avatar_name='Face-a001',avatar_file='savt2a001.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1002',avatar_type='S',avatar_name='Face-a002',avatar_file='savt2a002.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1003',avatar_type='S',avatar_name='Face-a003',avatar_file='savt2a003.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1004',avatar_type='S',avatar_name='Face-a004',avatar_file='savt2a004.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1005',avatar_type='S',avatar_name='Face-a005',avatar_file='savt2a005.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1006',avatar_type='S',avatar_name='Face-a006',avatar_file='savt2a006.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1007',avatar_type='S',avatar_name='Face-a007',avatar_file='savt2a007.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1008',avatar_type='S',avatar_name='Face-a008',avatar_file='savt2a008.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1009',avatar_type='S',avatar_name='Face-a009',avatar_file='savt2a009.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1010',avatar_type='S',avatar_name='Face-a010',avatar_file='savt2a010.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1011',avatar_type='S',avatar_name='Face-a011',avatar_file='savt2a011.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1012',avatar_type='S',avatar_name='Face-a012',avatar_file='savt2a012.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1013',avatar_type='S',avatar_name='Face-a013',avatar_file='savt2a013.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1014',avatar_type='S',avatar_name='Face-a014',avatar_file='savt2a014.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1015',avatar_type='S',avatar_name='Face-a015',avatar_file='savt2a015.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1016',avatar_type='S',avatar_name='Face-a016',avatar_file='savt2a016.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1017',avatar_type='S',avatar_name='Face-a017',avatar_file='savt2a017.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1018',avatar_type='S',avatar_name='Face-a018',avatar_file='savt2a018.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1019',avatar_type='S',avatar_name='Face-a019',avatar_file='savt2a019.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1020',avatar_type='S',avatar_name='Face-a020',avatar_file='savt2a020.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1021',avatar_type='S',avatar_name='Face-a021',avatar_file='savt2a021.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1022',avatar_type='S',avatar_name='Face-a022',avatar_file='savt2a022.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1023',avatar_type='S',avatar_name='Face-a023',avatar_file='savt2a023.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1024',avatar_type='S',avatar_name='Face-a024',avatar_file='savt2a024.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1025',avatar_type='S',avatar_name='Face-a025',avatar_file='savt2a025.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1026',avatar_type='S',avatar_name='Face-a026',avatar_file='savt2a026.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1027',avatar_type='S',avatar_name='Face-a027',avatar_file='savt2a027.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1028',avatar_type='S',avatar_name='Face-a028',avatar_file='savt2a028.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1029',avatar_type='S',avatar_name='Face-a029',avatar_file='savt2a029.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1030',avatar_type='S',avatar_name='Face-a030',avatar_file='savt2a030.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1031',avatar_type='S',avatar_name='Face-a031',avatar_file='savt2a031.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1032',avatar_type='S',avatar_name='Face-a032',avatar_file='savt2a032.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1033',avatar_type='S',avatar_name='Face-a033',avatar_file='savt2a033.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1034',avatar_type='S',avatar_name='Face-a034',avatar_file='savt2a034.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1035',avatar_type='S',avatar_name='Face-a035',avatar_file='savt2a035.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1036',avatar_type='S',avatar_name='Face-a036',avatar_file='savt2a036.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1037',avatar_type='S',avatar_name='Face-a037',avatar_file='savt2a037.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1038',avatar_type='S',avatar_name='Face-a038',avatar_file='savt2a038.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1039',avatar_type='S',avatar_name='Face-a039',avatar_file='savt2a039.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1040',avatar_type='S',avatar_name='Face-a040',avatar_file='savt2a040.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1041',avatar_type='S',avatar_name='Face-a041',avatar_file='savt2a041.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1042',avatar_type='S',avatar_name='Face-a042',avatar_file='savt2a042.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1043',avatar_type='S',avatar_name='Face-a043',avatar_file='savt2a043.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1044',avatar_type='S',avatar_name='Face-a044',avatar_file='savt2a044.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1045',avatar_type='S',avatar_name='Face-a045',avatar_file='savt2a045.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1046',avatar_type='S',avatar_name='Face-a046',avatar_file='savt2a046.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1047',avatar_type='S',avatar_name='Face-a047',avatar_file='savt2a047.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1048',avatar_type='S',avatar_name='Face-a048',avatar_file='savt2a048.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1049',avatar_type='S',avatar_name='Face-a049',avatar_file='savt2a049.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1050',avatar_type='S',avatar_name='Face-a050',avatar_file='savt2a050.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1051',avatar_type='S',avatar_name='Face-a051',avatar_file='savt2a051.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1052',avatar_type='S',avatar_name='Face-a052',avatar_file='savt2a052.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1053',avatar_type='S',avatar_name='Face-a053',avatar_file='savt2a053.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1054',avatar_type='S',avatar_name='Face-a054',avatar_file='savt2a054.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1055',avatar_type='S',avatar_name='Face-a055',avatar_file='savt2a055.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1056',avatar_type='S',avatar_name='Face-a056',avatar_file='savt2a056.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1057',avatar_type='S',avatar_name='Face-a057',avatar_file='savt2a057.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1058',avatar_type='S',avatar_name='Face-a058',avatar_file='savt2a058.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1059',avatar_type='S',avatar_name='Face-a059',avatar_file='savt2a059.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1060',avatar_type='S',avatar_name='Face-a060',avatar_file='savt2a060.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1301',avatar_type='S',avatar_name='Face-d001',avatar_file='savt2d001.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1302',avatar_type='S',avatar_name='Face-d002',avatar_file='savt2d002.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1303',avatar_type='S',avatar_name='Face-d003',avatar_file='savt2d003.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1304',avatar_type='S',avatar_name='Face-d004',avatar_file='savt2d004.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1305',avatar_type='S',avatar_name='Face-d005',avatar_file='savt2d005.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1306',avatar_type='S',avatar_name='Face-d006',avatar_file='savt2d006.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1307',avatar_type='S',avatar_name='Face-d007',avatar_file='savt2d007.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1308',avatar_type='S',avatar_name='Face-d008',avatar_file='savt2d008.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1309',avatar_type='S',avatar_name='Face-d009',avatar_file='savt2d009.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1310',avatar_type='S',avatar_name='Face-d010',avatar_file='savt2d010.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1311',avatar_type='S',avatar_name='Face-d011',avatar_file='savt2d011.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1312',avatar_type='S',avatar_name='Face-d012',avatar_file='savt2d012.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1313',avatar_type='S',avatar_name='Face-d013',avatar_file='savt2d013.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1314',avatar_type='S',avatar_name='Face-d014',avatar_file='savt2d014.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1315',avatar_type='S',avatar_name='Face-d015',avatar_file='savt2d015.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1316',avatar_type='S',avatar_name='Face-d016',avatar_file='savt2d016.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1317',avatar_type='S',avatar_name='Face-d017',avatar_file='savt2d017.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1318',avatar_type='S',avatar_name='Face-d018',avatar_file='savt2d018.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1319',avatar_type='S',avatar_name='Face-d019',avatar_file='savt2d019.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1320',avatar_type='S',avatar_name='Face-d020',avatar_file='savt2d020.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1321',avatar_type='S',avatar_name='Face-d021',avatar_file='savt2d021.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1322',avatar_type='S',avatar_name='Face-d022',avatar_file='savt2d022.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1323',avatar_type='S',avatar_name='Face-d023',avatar_file='savt2d023.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1324',avatar_type='S',avatar_name='Face-d024',avatar_file='savt2d024.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1325',avatar_type='S',avatar_name='Face-d025',avatar_file='savt2d025.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1326',avatar_type='S',avatar_name='Face-d026',avatar_file='savt2d026.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1327',avatar_type='S',avatar_name='Face-d027',avatar_file='savt2d027.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1328',avatar_type='S',avatar_name='Face-d028',avatar_file='savt2d028.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1329',avatar_type='S',avatar_name='Face-d029',avatar_file='savt2d029.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1330',avatar_type='S',avatar_name='Face-d030',avatar_file='savt2d030.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1331',avatar_type='S',avatar_name='Face-d031',avatar_file='savt2d031.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1332',avatar_type='S',avatar_name='Face-d032',avatar_file='savt2d032.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1333',avatar_type='S',avatar_name='Face-d033',avatar_file='savt2d033.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1334',avatar_type='S',avatar_name='Face-d034',avatar_file='savt2d034.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1335',avatar_type='S',avatar_name='Face-d035',avatar_file='savt2d035.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1336',avatar_type='S',avatar_name='Face-d036',avatar_file='savt2d036.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1337',avatar_type='S',avatar_name='Face-d037',avatar_file='savt2d037.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1338',avatar_type='S',avatar_name='Face-d038',avatar_file='savt2d038.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1339',avatar_type='S',avatar_name='Face-d039',avatar_file='savt2d039.gif';
+INSERT INTO xoops_avatar SET avatar_mimetype='image/gif',avatar_created=NOW(),avatar_display='1',avatar_weight='1340',avatar_type='S',avatar_name='Face-d040',avatar_file='savt2d040.gif';
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsmembers/index.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsmembers/index.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsmembers/index.php	(revision 405)
@@ -0,0 +1,418 @@
+<?php
+// $Id: index.php,v 1.4 2005/09/04 20:46:12 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+// ------------------------------------------------------------------------- //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+include "../../mainfile.php";
+
+$op = "form";
+if ( isset($_POST['op']) && $_POST['op'] == "submit" ) {
+	$op = "submit";
+}
+
+if ( $op == "form" ) {
+	$xoopsOption['template_main'] = 'xoopsmembers_searchform.html';
+	include XOOPS_ROOT_PATH."/header.php";
+	$member_handler =& xoops_gethandler('member');
+	$total = $member_handler->getUserCount(new Criteria('level', 0, '>'));
+	include_once XOOPS_ROOT_PATH."/class/xoopsformloader.php";
+	$uname_text = new XoopsFormText("", "user_uname", 30, 60);
+	$uname_match = new XoopsFormSelectMatchOption("", "user_uname_match");
+	$uname_tray = new XoopsFormElementTray(_MM_UNAME, "&nbsp;");
+	$uname_tray->addElement($uname_match);
+	$uname_tray->addElement($uname_text);
+	$name_text = new XoopsFormText("", "user_name", 30, 60);
+	$name_match = new XoopsFormSelectMatchOption("", "user_name_match");
+	$name_tray = new XoopsFormElementTray(_MM_REALNAME, "&nbsp;");
+	$name_tray->addElement($name_match);
+	$name_tray->addElement($name_text);
+	$email_text = new XoopsFormText("", "user_email", 30, 60);
+	$email_match = new XoopsFormSelectMatchOption("", "user_email_match");
+	$email_tray = new XoopsFormElementTray(_MM_EMAIL, "&nbsp;");
+	$email_tray->addElement($email_match);
+	$email_tray->addElement($email_text);
+	$url_text = new XoopsFormText(_MM_URLC, "user_url", 30, 100);
+	//$theme_select = new XoopsFormSelectTheme(_MM_THEME, "user_theme");
+	//$timezone_select = new XoopsFormSelectTimezone(_MM_TIMEZONE, "user_timezone_offset");
+	$icq_text = new XoopsFormText("", "user_icq", 30, 100);
+	$icq_match = new XoopsFormSelectMatchOption("", "user_icq_match");
+	$icq_tray = new XoopsFormElementTray(_MM_ICQ, "&nbsp;");
+	$icq_tray->addElement($icq_match);
+	$icq_tray->addElement($icq_text);
+	$aim_text = new XoopsFormText("", "user_aim", 30, 100);
+	$aim_match = new XoopsFormSelectMatchOption("", "user_aim_match");
+	$aim_tray = new XoopsFormElementTray(_MM_AIM, "&nbsp;");
+	$aim_tray->addElement($aim_match);
+	$aim_tray->addElement($aim_text);
+	$yim_text = new XoopsFormText("", "user_yim", 30, 100);
+	$yim_match = new XoopsFormSelectMatchOption("", "user_yim_match");
+	$yim_tray = new XoopsFormElementTray(_MM_YIM, "&nbsp;");
+	$yim_tray->addElement($yim_match);
+	$yim_tray->addElement($yim_text);
+	$msnm_text = new XoopsFormText("", "user_msnm", 30, 100);
+	$msnm_match = new XoopsFormSelectMatchOption("", "user_msnm_match");
+	$msnm_tray = new XoopsFormElementTray(_MM_MSNM, "&nbsp;");
+	$msnm_tray->addElement($msnm_match);
+	$msnm_tray->addElement($msnm_text);
+	$location_text = new XoopsFormText(_MM_LOCATION, "user_from", 30, 100);
+	$occupation_text = new XoopsFormText(_MM_OCCUPATION, "user_occ", 30, 100);
+	$interest_text = new XoopsFormText(_MM_INTEREST, "user_intrest", 30, 100);
+
+	//$bio_text = new XoopsFormText(_MM_EXTRAINFO, "user_bio", 30, 100);
+	$lastlog_more = new XoopsFormText(_MM_LASTLOGMORE, "user_lastlog_more", 10, 5);
+	$lastlog_less = new XoopsFormText(_MM_LASTLOGLESS, "user_lastlog_less", 10, 5);
+	$reg_more = new XoopsFormText(_MM_REGMORE, "user_reg_more", 10, 5);
+	$reg_less = new XoopsFormText(_MM_REGLESS, "user_reg_less", 10, 5);
+	$posts_more = new XoopsFormText(_MM_POSTSMORE, "user_posts_more", 10, 5);
+	$posts_less = new XoopsFormText(_MM_POSTSLESS, "user_posts_less", 10, 5);
+	$sort_select = new XoopsFormSelect(_MM_SORT, "user_sort");
+	$sort_select->addOptionArray(array("uname"=>_MM_UNAME,"email"=>_MM_EMAIL,"last_login"=>_MM_LASTLOGIN,"user_regdate"=>_MM_REGDATE,"posts"=>_MM_POSTS));
+	$order_select = new XoopsFormSelect(_MM_ORDER, "user_order");
+	$order_select->addOptionArray(array("ASC"=>_MM_ASC,"DESC"=>_MM_DESC));
+	$limit_text = new XoopsFormText(_MM_LIMIT, "limit", 6, 2);
+	$op_hidden = new XoopsFormHidden("op", "submit");
+	$submit_button = new XoopsFormButton("", "user_submit", _SUBMIT, "submit");
+
+	$form = new XoopsThemeForm("", "searchform", "index.php");
+	$form->addElement($uname_tray);
+	$form->addElement($name_tray);
+	$form->addElement($email_tray);
+	//$form->addElement($theme_select);
+	//$form->addElement($timezone_select);
+	$form->addElement($icq_tray);
+	$form->addElement($aim_tray);
+	$form->addElement($yim_tray);
+	$form->addElement($msnm_tray);
+	$form->addElement($url_text);
+	$form->addElement($location_text);
+	$form->addElement($occupation_text);
+	$form->addElement($interest_text);
+	//$form->addElement($bio_text);
+	$form->addElement($lastlog_more);
+	$form->addElement($lastlog_less);
+	$form->addElement($reg_more);
+	$form->addElement($reg_less);
+	$form->addElement($posts_more);
+	$form->addElement($posts_less);
+	$form->addElement($sort_select);
+	$form->addElement($order_select);
+	$form->addElement($limit_text);
+	$form->addElement($op_hidden);
+	$form->addElement($submit_button);
+	$form->assign($xoopsTpl);
+	$xoopsTpl->assign('lang_search', _MM_SEARCH);
+	$xoopsTpl->assign('lang_totalusers', sprintf(_MM_TOTALUSERS, '<span style="color:#ff0000;">'.$total.'</span>'));
+}
+
+if ( $op == "submit" ) {
+	$xoopsOption['template_main'] = 'xoopsmembers_searchresults.html';
+	include XOOPS_ROOT_PATH."/header.php";
+	$iamadmin = $xoopsUserIsAdmin;
+	$myts =& MyTextSanitizer::getInstance();
+	$criteria = new CriteriaCompo();
+	if ( !empty($_POST['user_uname']) ) {
+		$match = (!empty($_POST['user_uname_match'])) ? intval($_POST['user_uname_match']) : XOOPS_MATCH_START;
+		switch ( $match ) {
+		case XOOPS_MATCH_START:
+			$criteria->add(new Criteria('uname', $myts->addSlashes(trim($_POST['user_uname'])).'%', 'LIKE'));
+			break;
+		case XOOPS_MATCH_END:
+			$criteria->add(new Criteria('uname', '%'.$myts->addSlashes(trim($_POST['user_uname'])), 'LIKE'));
+			break;
+		case XOOPS_MATCH_EQUAL:
+			$criteria->add(new Criteria('uname', $myts->addSlashes(trim($_POST['user_uname']))));
+			break;
+		case XOOPS_MATCH_CONTAIN:
+			$criteria->add(new Criteria('uname', '%'.$myts->addSlashes(trim($_POST['user_uname'])).'%', 'LIKE'));
+			break;
+		}
+	}
+	if ( !empty($_POST['user_name']) ) {
+		$match = (!empty($_POST['user_name_match'])) ? intval($_POST['user_name_match']) : XOOPS_MATCH_START;
+		switch ($match) {
+		case XOOPS_MATCH_START:
+			$criteria->add(new Criteria('name', $myts->addSlashes(trim($_POST['user_name'])).'%', 'LIKE'));
+			break;
+		case XOOPS_MATCH_END:
+			$criteria->add(new Criteria('name', '%'.$myts->addSlashes(trim($_POST['user_name'])).'%', 'LIKE'));
+			break;
+		case XOOPS_MATCH_EQUAL:
+			$criteria->add(new Criteria('name', $myts->addSlashes(trim($_POST['user_name']))));
+			break;
+		case XOOPS_MATCH_CONTAIN:
+			$criteria->add(new Criteria('name', '%'.$myts->addSlashes(trim($_POST['user_name'])).'%', 'LIKE'));
+			break;
+		}
+	}
+	if ( !empty($_POST['user_email']) ) {
+		$match = (!empty($_POST['user_email_match'])) ? intval($_POST['user_email_match']) : XOOPS_MATCH_START;
+		switch ($match) {
+		case XOOPS_MATCH_START:
+			$criteria->add(new Criteria('email', $myts->addSlashes(trim($_POST['user_email'])).'%', 'LIKE'));
+			break;
+		case XOOPS_MATCH_END:
+			$criteria->add(new Criteria('email', '%'.$myts->addSlashes(trim($_POST['user_email'])), 'LIKE'));
+			break;
+		case XOOPS_MATCH_EQUAL:
+			$criteria->add(new Criteria('email', $myts->addSlashes(trim($_POST['user_email']))));
+			break;
+		case XOOPS_MATCH_CONTAIN:
+			$criteria->add(new Criteria('email', '%'.$myts->addSlashes(trim($_POST['user_email'])).'%', 'LIKE'));
+			break;
+		}
+		if ( !$iamadmin ) {
+			$criteria->add(new Criteria('user_viewemail', 1));
+		}
+	}
+	if ( !empty($_POST['user_url']) ) {
+		$url = formatURL(trim($_POST['user_url']));
+		$criteria->add(new Criteria('url', $myts->addSlashes($url).'%', 'LIKE'));
+	}
+	if ( !empty($_POST['user_icq']) ) {
+		$match = (!empty($_POST['user_icq_match'])) ? intval($_POST['user_icq_match']) : XOOPS_MATCH_START;
+		switch ($match) {
+		case XOOPS_MATCH_START:
+			$criteria->add(new Criteria('user_icq', $myts->addSlashes(trim($_POST['user_icq'])).'%', 'LIKE'));
+			break;
+		case XOOPS_MATCH_END:
+			$criteria->add(new Criteria('user_icq', '%'.$myts->addSlashes(trim($_POST['user_icq'])), 'LIKE'));
+			break;
+		case XOOPS_MATCH_EQUAL:
+			$criteria->add(new Criteria('user_icq', $myts->addSlashes(trim($_POST['user_icq']))));
+			break;
+		case XOOPS_MATCH_CONTAIN:
+			$criteria->add(new Criteria('user_icq', '%'.$myts->addSlashes(trim($_POST['user_icq'])).'%', 'LIKE'));
+			break;
+		}
+	}
+	if ( !empty($_POST['user_aim']) ) {
+		$match = (!empty($_POST['user_aim_match'])) ? intval($_POST['user_aim_match']) : XOOPS_MATCH_START;
+		switch ($match) {
+		case XOOPS_MATCH_START:
+			$criteria->add(new Criteria('user_aim', $myts->addSlashes(trim($_POST['user_aim'])).'%', 'LIKE'));
+			break;
+		case XOOPS_MATCH_END:
+			$criteria->add(new Criteria('user_aim', '%'.$myts->addSlashes(trim($_POST['user_aim'])), 'LIKE'));
+			break;
+		case XOOPS_MATCH_EQUAL:
+			$criteria->add(new Criteria('user_aim', $myts->addSlashes(trim($_POST['user_aim']))));
+			break;
+		case XOOPS_MATCH_CONTAIN:
+			$criteria->add(new Criteria('user_aim', '%'.$myts->addSlashes(trim($_POST['user_aim'])).'%', 'LIKE'));
+			break;
+		}
+	}
+	if ( !empty($_POST['user_yim']) ) {
+		$match = (!empty($_POST['user_yim_match'])) ? intval($_POST['user_yim_match']) : XOOPS_MATCH_START;
+		switch ($match) {
+		case XOOPS_MATCH_START:
+			$criteria->add(new Criteria('user_yim', $myts->addSlashes(trim($_POST['user_yim'])).'%', 'LIKE'));
+			break;
+		case XOOPS_MATCH_END:
+			$criteria->add(new Criteria('user_yim', '%'.$myts->addSlashes(trim($_POST['user_yim'])), 'LIKE'));
+			break;
+		case XOOPS_MATCH_EQUAL:
+			$criteria->add(new Criteria('user_yim', $myts->addSlashes(trim($_POST['user_yim']))));
+			break;
+		case XOOPS_MATCH_CONTAIN:
+			$criteria->add(new Criteria('user_yim', '%'.$myts->addSlashes(trim($_POST['user_yim'])).'%', 'LIKE'));
+			break;
+		}
+	}
+	if ( !empty($_POST['user_msnm']) ) {
+		$match = (!empty($_POST['user_msnm_match'])) ? intval($_POST['user_msnm_match']) : XOOPS_MATCH_START;
+		switch ($match) {
+		case XOOPS_MATCH_START:
+			$criteria->add(new Criteria('user_msnm', $myts->addSlashes(trim($_POST['user_msnm'])).'%', 'LIKE'));
+			break;
+		case XOOPS_MATCH_END:
+			$criteria->add(new Criteria('user_msnm', '%'.$myts->addSlashes(trim($_POST['user_msnm'])), 'LIKE'));
+			break;
+		case XOOPS_MATCH_EQUAL:
+			$criteria->add(new Criteria('user_msnm', $myts->addSlashes(trim($_POST['user_msnm']))));
+			break;
+		case XOOPS_MATCH_CONTAIN:
+			$criteria->add(new Criteria('user_msnm', '%'.$myts->addSlashes(trim($_POST['user_msnm'])).'%', 'LIKE'));
+			break;
+		}
+	}
+	if ( !empty($_POST['user_from']) ) {
+		$criteria->add(new Criteria('user_from', '%'.$myts->addSlashes(trim($_POST['user_from'])).'%', 'LIKE'));
+	}
+	if ( !empty($_POST['user_intrest']) ) {
+		$criteria->add(new Criteria('user_intrest', '%'.$myts->addSlashes(trim($_POST['user_intrest'])).'%', 'LIKE'));
+	}
+	if ( !empty($_POST['user_occ']) ) {
+		$criteria->add(new Criteria('user_occ', '%'.$myts->addSlashes(trim($_POST['user_occ'])).'%', 'LIKE'));
+	}
+
+	if ( !empty($_POST['user_lastlog_more']) && is_numeric($_POST['user_lastlog_more']) ) {
+		$f_user_lastlog_more = intval(trim($_POST['user_lastlog_more']));
+		$time = time() - (60 * 60 * 24 * $f_user_lastlog_more);
+		if ( $time > 0 ) {
+			$criteria->add(new Criteria('last_login', $time, '<'));
+		}
+	}
+	if ( !empty($_POST['user_lastlog_less']) && is_numeric($_POST['user_lastlog_less']) ) {
+		$f_user_lastlog_less = intval(trim($_POST['user_lastlog_less']));
+		$time = time() - (60 * 60 * 24 * $f_user_lastlog_less);
+		if ( $time > 0 ) {
+			$criteria->add(new Criteria('last_login', $time, '>'));
+		}
+	}
+	if ( !empty($_POST['user_reg_more']) && is_numeric($_POST['user_reg_more']) ) {
+		$f_user_reg_more = intval(trim($_POST['user_reg_more']));
+		$time = time() - (60 * 60 * 24 * $f_user_reg_more);
+		if ( $time > 0 ) {
+			$criteria->add(new Criteria('user_regdate', $time, '<'));
+		}
+	}
+	if ( !empty($_POST['user_reg_less']) && is_numeric($_POST['user_reg_less']) ) {
+		$f_user_reg_less = intval($_POST['user_reg_less']);
+		$time = time() - (60 * 60 * 24 * $f_user_reg_less);
+		if ( $time > 0 ) {
+			$criteria->add(new Criteria('user_regdate', $time, '>'));
+		}
+	}
+	if ( isset($_POST['user_posts_more']) && is_numeric($_POST['user_posts_more']) ) {
+		$criteria->add(new Criteria('posts', intval($_POST['user_posts_more']), '>'));
+	}
+	if ( !empty($_POST['user_posts_less']) && is_numeric($_POST['user_posts_less']) ) {
+		$criteria->add(new Criteria('posts', intval($_POST['user_posts_less']), '<'));
+	}
+	$criteria->add(new Criteria('level', 0, '>'));
+	$validsort = array("uname", "email", "last_login", "user_regdate", "posts");
+	$sort = (!in_array($_POST['user_sort'], $validsort)) ? "uname" : $_POST['user_sort'];
+	$order = "ASC";
+	if ( isset($_POST['user_order']) && $_POST['user_order'] == "DESC") {
+		$order = "DESC";
+	}
+	$limit = (!empty($_POST['limit'])) ? intval($_POST['limit']) : 20;
+	if ( $limit == 0 || $limit > 50 ) {
+		$limit = 50;
+	}
+	$start = (!empty($_POST['start'])) ? intval($_POST['start']) : 0;
+	$member_handler =& xoops_gethandler('member');
+	$total = $member_handler->getUserCount($criteria);
+	$xoopsTpl->assign('lang_search', _MM_SEARCH);
+	$xoopsTpl->assign('lang_results', _MM_RESULTS);
+	$xoopsTpl->assign('total_found', $total);
+	if ( $total == 0 ) {
+		$xoopsTpl->assign('lang_nonefound', _MM_NOFOUND);
+	} elseif ( $start < $total ) {
+		$xoopsTpl->assign('lang_username', _MM_UNAME);
+		$xoopsTpl->assign('lang_realname', _MM_REALNAME);
+		$xoopsTpl->assign('lang_avatar', _MM_AVATAR);
+		$xoopsTpl->assign('lang_email', _MM_EMAIL);
+		$xoopsTpl->assign('lang_privmsg', _MM_PM);
+		$xoopsTpl->assign('lang_regdate', _MM_REGDATE);
+		$xoopsTpl->assign('lang_lastlogin', _MM_LASTLOGIN);
+		$xoopsTpl->assign('lang_posts', _MM_POSTS);
+		$xoopsTpl->assign('lang_url', _MM_URL);
+		$xoopsTpl->assign('lang_admin', _MM_ADMIN);
+		if ( $iamadmin ) {
+			$xoopsTpl->assign('is_admin', true);
+		}
+		$criteria->setSort($sort);
+		$criteria->setOrder($order);
+		$criteria->setStart($start);
+		$criteria->setLimit($limit);
+		$foundusers =& $member_handler->getUsers($criteria, true);
+		foreach (array_keys($foundusers) as $j) {
+			$userdata['avatar'] = $foundusers[$j]->getVar("user_avatar") ? "<img src='".XOOPS_UPLOAD_URL."/".$foundusers[$j]->getVar("user_avatar")."' alt='' />" : "&nbsp;";
+			$userdata['realname'] = $foundusers[$j]->getVar("name") ? $foundusers[$j]->getVar("name") : "&nbsp;";
+			$userdata['name'] = $foundusers[$j]->getVar("uname");
+			$userdata['id'] = $foundusers[$j]->getVar("uid");
+			if ( $foundusers[$j]->getVar("user_viewemail") == 1 || $iamadmin ) {
+				$userdata['email'] = "<a href='mailto:".$foundusers[$j]->getVar("email")."'><img src='".XOOPS_URL."/images/icons/email.gif' border='0' alt='".sprintf(_SENDEMAILTO,$foundusers[$j]->getVar("uname", "E"))."' /></a>";
+			} else {
+				$userdata['email'] = "&nbsp;";
+			}
+			if ( $xoopsUser ) {
+				$userdata['pmlink'] = "<a href='javascript:openWithSelfMain(\"".XOOPS_URL."/pmlite.php?send2=1&amp;to_userid=".$foundusers[$j]->getVar("uid")."\",\"pmlite\",450,370);'><img src='".XOOPS_URL."/images/icons/pm.gif' border='0' alt='".sprintf(_SENDPMTO,$foundusers[$j]->getVar("uname", "E"))."' /></a>";
+			} else {
+				$userdata['pmlink'] = "&nbsp;";
+			}
+			if ( $foundusers[$j]->getVar("url","E") != "" ) {
+				$userdata['website'] =  "<a href='".$foundusers[$j]->getVar("url","E")."' target='_blank'><img src='".XOOPS_URL."/images/icons/www.gif' border='0' alt='"._VISITWEBSITE."' /></a>";
+			} else {
+				$userdata['website'] =  "&nbsp;";
+			}
+			$userdata['registerdate'] = formatTimeStamp($foundusers[$j]->getVar("user_regdate"),"s");
+			if ( $foundusers[$j]->getVar("last_login") != 0 ) {
+				$userdata['lastlogin'] =  formatTimeStamp($foundusers[$j]->getVar("last_login"),"m");
+			} else {
+				$userdata['lastlogin'] =  "&nbsp;";
+			}
+			$userdata['posts'] = $foundusers[$j]->getVar("posts");
+			if ( $iamadmin ) {
+				$userdata['adminlink'] = "<a href='".XOOPS_URL."/modules/system/admin.php?fct=users&amp;uid=".$foundusers[$j]->getVar("uid")."&amp;op=modifyUser'>"._EDIT."</a> | <a href='".XOOPS_URL."/modules/system/admin.php?fct=users&amp;op=delUser&amp;uid=".$foundusers[$j]->getVar("uid")."'>"._DELETE."</a>";
+			}
+			$xoopsTpl->append('users', $userdata);
+		}
+		$totalpages = ceil($total / $limit);
+		if ( $totalpages > 1 ) {
+			$hiddenform = "<form name='findnext' action='index.php' method='post'>";
+			foreach ( $_POST as $k => $v ) {
+				$hiddenform .= "<input type='hidden' name='".$myts->oopsHtmlSpecialChars($k)."' value='".$myts->makeTboxData4PreviewInForm($v)."' />\n";
+			}
+			if (!isset($_POST['limit'])) {
+				$hiddenform .= "<input type='hidden' name='limit' value='".$limit."' />\n";
+			}
+			if (!isset($_POST['start'])) {
+				$hiddenform .= "<input type='hidden' name='start' value='".$start."' />\n";
+			}
+			$prev = $start - $limit;
+			if ( $start - $limit >= 0 ) {
+				$hiddenform .= "<a href='#0' onclick='javascript:document.findnext.start.value=".$prev.";document.findnext.submit();'>"._MM_PREVIOUS."</a>&nbsp;\n";
+        	}
+			$counter = 1;
+			$currentpage = ($start+$limit) / $limit;
+			while ( $counter <= $totalpages ) {
+				if ( $counter == $currentpage ) {
+					$hiddenform .= "<b>".$counter."</b> ";
+				} elseif ( ($counter > $currentpage-4 && $counter < $currentpage+4) || $counter == 1 || $counter == $totalpages ) {
+					if ( $counter == $totalpages && $currentpage < $totalpages-4 ) {
+						$hiddenform .= "... ";
+					}
+					$hiddenform .= "<a href='#".$counter."' onclick='javascript:document.findnext.start.value=".($counter-1)*$limit.";document.findnext.submit();'>".$counter."</a> ";
+					if ( $counter == 1 && $currentpage > 5 ) {
+						$hiddenform .= "... ";
+					}
+				}
+				$counter++;
+			}
+			$next = $start+$limit;
+			if ( $total > $next ) {
+				$hiddenform .= "&nbsp;<a href='#".$total."' onclick='javascript:document.findnext.start.value=".$next.";document.findnext.submit();'>"._MM_NEXT."</a>\n";
+			}
+			$hiddenform .= "</form>";
+			$xoopsTpl->assign('pagenav', $hiddenform);
+			$xoopsTpl->assign('lang_numfound', sprintf(_MM_USERSFOUND, $total));
+		}
+	}
+}
+
+include_once XOOPS_ROOT_PATH."/footer.php";
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsmembers/templates/xoopsmembers_searchform.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsmembers/templates/xoopsmembers_searchform.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsmembers/templates/xoopsmembers_searchform.html	(revision 405)
@@ -0,0 +1,21 @@
+<h4 style='text-align:left;'><{$lang_search}></h4>(<{$lang_totalusers}>)
+
+<{$searchform.javascript}>
+<b><{$searchform.title}></b>
+<br /><br />
+<form name="<{$searchform.name}>" action="<{$searchform.action}>" method="<{$searchform.method}>" <{$searchform.extra}>>
+  <table class="outer" cellpadding="4" cellspacing="1">
+    <!-- start of form elements loop -->
+    <{foreach item=element from=$searchform.elements}>
+      <{if $element.hidden != true}>
+      <tr>
+        <td class="head"><b><{$element.caption}></b></td>
+        <td class="<{cycle values="even,odd"}>"><{$element.body}></td>
+      </tr>
+      <{else}>
+      <{$element.body}>
+      <{/if}>
+    <{/foreach}>
+    <!-- end of form elements loop -->
+  </table>
+</form>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsmembers/templates/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsmembers/templates/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsmembers/templates/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsmembers/templates/xoopsmembers_searchresults.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsmembers/templates/xoopsmembers_searchresults.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsmembers/templates/xoopsmembers_searchresults.html	(revision 405)
@@ -0,0 +1,24 @@
+<a href="index.php"><{$lang_search}></a>&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;<{$lang_results}><br /><br />
+
+<{if $total_found != 0}>
+<table class="outer" cellspacing="1" cellpadding="4">
+  <tr>
+    <th align="center"><{$lang_avatar}></th><th align="center"><{$lang_username}></th><th align="center"><{$lang_realname}></th><th align="center"><{$lang_email}></th><th align="center"><{$lang_privmsg}></th><th align="center"><{$lang_url}></th><th align="center"><{$lang_regdate}></th><th align="center"><{$lang_lastlogin}></th><th align="center"><{$lang_posts}></th>
+    <{if $is_admin == true}>
+    <th align="center"><{$lang_admin}></th>
+    <{/if}>
+  </tr>
+  <{section name=i loop=$users}>
+  <tr valign="middle">
+    <td class="even"><{$users[i].avatar}></td><td class="odd"><a href="<{$xoops_url}>/userinfo.php?uid=<{$users[i].id}>"><{$users[i].name}></a></td><td class="even"><{$users[i].realname}></td><td align="center" class="odd"><{$users[i].email}></td><td class="even" align="center"><{$users[i].pmlink}></td><td class="odd" align="center"><{$users[i].website}></td><td class="even" align="center"><{$users[i].registerdate}></td><td class="odd" align="center"><{$users[i].lastlogin}></td><td class="even" align="center"><{$users[i].posts}></td>
+    <{if $is_admin == true}><td class="odd" align="center"><{$users[i].adminlink}></td><{/if}>
+  </tr>
+  <{/section}>
+</table>
+<div style="text-align:center">
+  <{$pagenav}>
+  <{$lang_numfound}>
+</div>
+<{else}>
+  <{$lang_nonefound}>
+<{/if}>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsmembers/language/japanese/blocks.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsmembers/language/japanese/blocks.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsmembers/language/japanese/blocks.php	(revision 405)
@@ -0,0 +1,7 @@
+<?php
+define("_MB_MEMBERS_TITLE1","Åê¹Æ¿ô¥é¥ó¥­¥ó¥°");
+define("_MB_MEMBERS_TITLE2","ºÇ¶á¤ÎÅÐÏ¿¥æ¡¼¥¶");
+define("_MB_MEMBERS_DISPLAY","É½¼¨¿Í¿ô¡§%s¿Í");
+define("_MB_MEMBERS_DISPLAYA","¥¢¥Ð¥¿¡¼²èÁü¤òÉ½¼¨¤¹¤ë");
+define("_MB_MEMBERS_NODISPGR","°Ê²¼¤ÎÆÃÊÌ¥é¥ó¥¯¤Î¥æ¡¼¥¶¤Ï½ü³°¤¹¤ë");
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsmembers/language/japanese/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsmembers/language/japanese/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsmembers/language/japanese/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsmembers/language/japanese/main.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsmembers/language/japanese/main.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsmembers/language/japanese/main.php	(revision 405)
@@ -0,0 +1,41 @@
+<?php
+//%%%%%%	File Name memberslist.php 	%%%%%
+
+define("_MM_SEARCH","¥æ¡¼¥¶¸¡º÷");
+define("_MM_AVATAR","¥¢¥Ð¥¿¡¼");
+define("_MM_REALNAME","ËÜÌ¾");
+define("_MM_REGDATE","ÅÐÏ¿Æü»þ");
+define("_MM_EMAIL","Email");
+define("_MM_PM","PM");
+define("_MM_URL","URL");
+define("_MM_ADMIN",'´ÉÍý');
+define("_MM_PREVIOUS","Á°");
+define("_MM_NEXT","¼¡");
+define("_MM_USERSFOUND","%s ¿Í¤Î¥æ¡¼¥¶¤¬¸«¤Ä¤«¤ê¤Þ¤·¤¿");
+
+define("_MM_TOTALUSERS", "ÅÐÏ¿¥æ¡¼¥¶¹ç·×¡§ %s ¿Í");
+define("_MM_NOFOUND","¾ò·ï¤Ë¹ç¤¦¥æ¡¼¥¶¤¬¸«¤Ä¤«¤ê¤Þ¤»¤ó¤Ç¤·¤¿");
+define("_MM_UNAME","¥æ¡¼¥¶Ì¾");
+define("_MM_ICQ","ICQ¡ô");
+define("_MM_AIM","AOL¥¤¥ó¥¹¥¿¥ó¥È¥á¥Ã¥»¥ó¥¸¥ã¡¼");
+define("_MM_YIM","Yahoo!¥á¥Ã¥»¥ó¥¸¥ã¡¼");
+define("_MM_MSNM","MSN¥á¥Ã¥»¥ó¥¸¥ã¡¼");
+define("_MM_LOCATION","µï½»ÃÏ");
+define("_MM_OCCUPATION","¿¦¶È");
+define("_MM_INTEREST","¼ñÌ£");
+define("_MM_URLC","¥Û¡¼¥à¥Ú¡¼¥¸¤ÎURL");
+define("_MM_LASTLOGMORE","<span style='color:#ff0000;'>X</span>Æü°Ê¾å¥í¥°¥¤¥ó¤·¤Æ¤¤¤Ê¤¤");
+define("_MM_LASTLOGLESS","<span style='color:#ff0000;'>X</span>Æü°ÊÆâ¤Ë¥í¥°¥¤¥ó¤·¤Æ¤¤¤ë");
+define("_MM_REGMORE","¥æ¡¼¥¶ÅÐÏ¿Æü»þ¤¬<span style='color:#ff0000;'>X</span>Æü°Ê¾åÁ°");
+define("_MM_REGLESS","¥æ¡¼¥¶ÅÐÏ¿Æü»þ¤¬<span style='color:#ff0000;'>X</span>Æü°ÊÆâ");
+define("_MM_POSTSMORE","Åê¹Æ¿ô¤¬<span style='color:#ff0000;'>X</span>·ï°Ê¾å");
+define("_MM_POSTSLESS","Åê¹Æ¿ô¤¬<span style='color:#ff0000;'>X</span>·ï°ÊÆâ");
+define("_MM_SORT","¥½¡¼¥È¾ò·ï");
+define("_MM_ORDER","É½¼¨½ç");
+define("_MM_LASTLOGIN","ºÇ½ª¥í¥°¥¤¥óÆü»þ");
+define("_MM_POSTS","Åê¹Æ¿ô");
+define("_MM_ASC","¾º½ç");
+define("_MM_DESC","¹ß½ç");
+define("_MM_LIMIT","1¥Ú¡¼¥¸¤¢¤¿¤ê¤ËÉ½¼¨¤¹¤ë¥æ¡¼¥¶¿ô");
+define("_MM_RESULTS", "¸¡º÷·ë²Ì");
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsmembers/language/japanese/modinfo.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsmembers/language/japanese/modinfo.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsmembers/language/japanese/modinfo.php	(revision 405)
@@ -0,0 +1,10 @@
+<?php
+// Module Info
+
+// The name of this module
+define("_MI_MEMBERS_NAME","ÅÐÏ¿¥æ¡¼¥¶°ìÍ÷");
+
+// A brief description of this module
+define("_MI_MEMBERS_DESC","ÅÐÏ¿¥æ¡¼¥¶¤Î°ìÍ÷¤òÉ½¼¨¤·¤Þ¤¹");
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsmembers/language/english/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsmembers/language/english/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsmembers/language/english/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsmembers/language/english/main.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsmembers/language/english/main.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsmembers/language/english/main.php	(revision 405)
@@ -0,0 +1,42 @@
+<?php
+// $Id: main.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+//%%%%%%	File Name memberslist.php 	%%%%%
+
+define("_MM_SEARCH","Search Members");
+define("_MM_AVATAR","Avatar");
+define("_MM_REALNAME","Real Name");
+define("_MM_REGDATE","Joined Date");
+define("_MM_EMAIL","Email");
+define("_MM_PM","PM");
+define("_MM_URL","URL");
+define("_MM_ADMIN","ADMIN");
+define("_MM_PREVIOUS","Previous");
+define("_MM_NEXT","Next");
+define("_MM_USERSFOUND","%s member(s) found");
+
+define("_MM_TOTALUSERS", "Total: %s members");
+define("_MM_NOFOUND","No Members Found");
+define("_MM_UNAME","User Name");
+define("_MM_ICQ","ICQ Number");
+define("_MM_AIM","AIM Handle");
+define("_MM_YIM","YIM Handle");
+define("_MM_MSNM","MSNM Handle");
+define("_MM_LOCATION","Location contains");
+define("_MM_OCCUPATION","Occupation contains");
+define("_MM_INTEREST","Interest contains");
+define("_MM_URLC","URL contains");
+define("_MM_LASTLOGMORE","Last login is more than <span style='color:#ff0000;'>X</span> days ago");
+define("_MM_LASTLOGLESS","Last login is less than <span style='color:#ff0000;'>X</span> days ago");
+define("_MM_REGMORE","Joined date is more than <span style='color:#ff0000;'>X</span> days ago");
+define("_MM_REGLESS","Joined date is less than <span style='color:#ff0000;'>X</span> days ago");
+define("_MM_POSTSMORE","Number of Posts is greater than <span style='color:#ff0000;'>X</span>");
+define("_MM_POSTSLESS","Number of Posts is less than <span style='color:#ff0000;'>X</span>");
+define("_MM_SORT","Sort by");
+define("_MM_ORDER","Order");
+define("_MM_LASTLOGIN","Last login");
+define("_MM_POSTS","Number of posts");
+define("_MM_ASC","Ascending order");
+define("_MM_DESC","Descending order");
+define("_MM_LIMIT","Number of members per page");
+define("_MM_RESULTS", "Search results");
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsmembers/language/english/modinfo.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsmembers/language/english/modinfo.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsmembers/language/english/modinfo.php	(revision 405)
@@ -0,0 +1,12 @@
+<?php
+// $Id: modinfo.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+// Module Info
+
+// The name of this module
+define("_MI_MEMBERS_NAME","Members");
+
+// A brief description of this module
+define("_MI_MEMBERS_DESC","Shows a list of registered users");
+
+// Names of blocks for this module (Not all module has blocks)
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsmembers/language/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsmembers/language/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsmembers/language/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsmembers/xoops_version.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsmembers/xoops_version.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsmembers/xoops_version.php	(revision 405)
@@ -0,0 +1,50 @@
+<?php
+// $Id: xoops_version.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+$modversion['name'] = _MI_MEMBERS_NAME;
+$modversion['version'] = 1.00;
+$modversion['description'] = _MI_MEMBERS_DESC;
+$modversion['credits'] = "The XOOPS Project";
+$modversion['author'] = "Kazumi Ono<br />( http://www.myweb.ne.jp/ )";
+$modversion['help'] = "xoopsmembers.html";
+$modversion['license'] = "GPL see LICENSE";
+$modversion['official'] = "yes";
+$modversion['image'] = "members_slogo.png";
+$modversion['dirname'] = "xoopsmembers";
+
+// Admin things
+$modversion['hasAdmin'] = 0;
+$modversion['adminmenu'] = "";
+
+// Menu
+$modversion['hasMain'] = 1;
+
+// Templates
+$modversion['templates'][1]['file'] = 'xoopsmembers_searchform.html';
+$modversion['templates'][1]['description'] = '';
+$modversion['templates'][2]['file'] = 'xoopsmembers_searchresults.html';
+$modversion['templates'][2]['description'] = '';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/constants.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/constants.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/constants.php	(revision 405)
@@ -0,0 +1,43 @@
+<?php
+// $Id: constants.php,v 1.2 2005/03/18 12:52:38 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+define('XOOPS_SYSTEM_GROUP', 1);
+define('XOOPS_SYSTEM_USER', 2);
+define('XOOPS_SYSTEM_PREF', 3);
+define('XOOPS_SYSTEM_MODULE', 4);
+define('XOOPS_SYSTEM_BLOCK', 5);
+//define('XOOPS_SYSTEM_THEME', 6);
+define('XOOPS_SYSTEM_FINDU', 7);
+define('XOOPS_SYSTEM_MAILU', 8);
+define('XOOPS_SYSTEM_IMAGE', 9);
+define('XOOPS_SYSTEM_AVATAR', 10);
+define('XOOPS_SYSTEM_URANK', 11);
+define('XOOPS_SYSTEM_SMILE', 12);
+define('XOOPS_SYSTEM_BANNER', 13);
+define('XOOPS_SYSTEM_COMMENT', 14);
+define('XOOPS_SYSTEM_TPLSET', 15);
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/modinfo.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/modinfo.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/modinfo.php	(revision 405)
@@ -0,0 +1,39 @@
+<?php
+// Module Info
+
+// The name of this module
+define("_MI_SYSTEM_NAME","¥·¥¹¥Æ¥à´ÉÍý");
+
+// A brief description of this module
+define("_MI_SYSTEM_DESC","¥µ¥¤¥È¤Î¥³¥¢ÉôÊ¬¤ÎÀßÄê¤ò¹Ô¤¤¤Þ¤¹");
+
+// Names of blocks for this module (Not all module has blocks)
+define("_MI_SYSTEM_BNAME2", "¥æ¡¼¥¶¥á¥Ë¥å¡¼");
+define("_MI_SYSTEM_BNAME3", "¥í¥°¥¤¥ó");
+define("_MI_SYSTEM_BNAME4", "¸¡º÷");
+define("_MI_SYSTEM_BNAME5", "¾µÇ§ÂÔ¤Á¥³¥ó¥Æ¥ó¥Ä");
+define("_MI_SYSTEM_BNAME6", "¥á¥¤¥ó¥á¥Ë¥å¡¼");
+define("_MI_SYSTEM_BNAME7", "¥µ¥¤¥È¾ðÊó");
+define('_MI_SYSTEM_BNAME8', "¥ª¥ó¥é¥¤¥ó¾õ¶·");
+define('_MI_SYSTEM_BNAME9', "Åê¹Æ¿ô¥é¥ó¥­¥ó¥°");
+define('_MI_SYSTEM_BNAME10',"¿·¤·¤¤ÅÐÏ¿¥æ¡¼¥¶");
+define('_MI_SYSTEM_BNAME11',"ºÇ¶á¤Î¥³¥á¥ó¥È");
+define('_MI_SYSTEM_BNAME12', "¥¤¥Ù¥ó¥ÈÄÌÃÎÀßÄê");
+define('_MI_SYSTEM_BNAME13', "¥Æ¡¼¥ÞÁªÂò");
+
+// Names of admin menu items
+define("_MI_SYSTEM_ADMENU1", "¥Ð¥Ê¡¼´ÉÍý");
+define("_MI_SYSTEM_ADMENU2", "¥Ö¥í¥Ã¥¯´ÉÍý");
+define("_MI_SYSTEM_ADMENU3", "¥°¥ë¡¼¥×´ÉÍý");
+define("_MI_SYSTEM_ADMENU5", "¥â¥¸¥å¡¼¥ë´ÉÍý");
+define("_MI_SYSTEM_ADMENU6", "°ìÈÌÀßÄê");
+define("_MI_SYSTEM_ADMENU7", "´é¥¢¥¤¥³¥óÀßÄê");
+define("_MI_SYSTEM_ADMENU9", "¥æ¡¼¥¶¥é¥ó¥­¥ó¥°ÀßÄê");
+define("_MI_SYSTEM_ADMENU10","¥æ¡¼¥¶´ÉÍý");
+define("_MI_SYSTEM_ADMENU11","¥æ¡¼¥¶°¸¥á¡¼¥ëÁ÷¿®");
+define("_MI_SYSTEM_ADMENU12","¥æ¡¼¥¶¸¡º÷");
+define("_MI_SYSTEM_ADMENU13","¥¤¥á¡¼¥¸¡¦¥Þ¥Í¥¸¥ã¡¼");
+define("_MI_SYSTEM_ADMENU14","¥¢¥Ð¥¿¡¼¡¦¥Þ¥Í¥¸¥ã¡¼");
+define("_MI_SYSTEM_ADMENU15","¥Æ¥ó¥×¥ì¡¼¥È¡¦¥Þ¥Í¥¸¥ã¡¼");
+define("_MI_SYSTEM_ADMENU16","¥³¥á¥ó¥È¡¦¥Þ¥Í¥¸¥ã¡¼");
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/blocks.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/blocks.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/blocks.php	(revision 405)
@@ -0,0 +1,40 @@
+<?php
+// Blocks
+define("_MB_SYSTEM_ADMENU","´ÉÍý¼Ô¥á¥Ë¥å¡¼");
+define("_MB_SYSTEM_RNOW","¿·µ¬ÅÐÏ¿");
+define("_MB_SYSTEM_LPASS","¥Ñ¥¹¥ï¡¼¥ÉÊ¶¼º");
+define("_MB_SYSTEM_SEARCH","¸¡º÷");
+define("_MB_SYSTEM_ADVS","¹âÅÙ¤Ê¸¡º÷");
+define("_MB_SYSTEM_VACNT","¥¢¥«¥¦¥ó¥È¾ðÊó");
+define("_MB_SYSTEM_EACNT","¥¢¥«¥¦¥ó¥ÈÊÔ½¸");
+define("_MB_SYSTEM_LOUT","¥í¥°¥¢¥¦¥È");
+define("_MB_SYSTEM_INBOX","¼õ¿®È¢");
+define("_MB_SYSTEM_SUBMS","¿·µ¬Åê¹Æ¥Ë¥å¡¼¥¹µ­»ö");
+define("_MB_SYSTEM_WLNKS","¿·µ¬Åê¹Æ¥ê¥ó¥¯");
+define("_MB_SYSTEM_BLNK","ÇËÂ»¥ê¥ó¥¯Êó¹ð");
+define("_MB_SYSTEM_MLNKS","½¤Àµ¥ê¥ó¥¯");
+define("_MB_SYSTEM_WDLS","¿·µ¬Åê¹Æ¥À¥¦¥ó¥í¡¼¥É¾ðÊó");
+define("_MB_SYSTEM_BFLS","ÇËÂ»¥Õ¥¡¥¤¥ëÊó¹ð");
+define("_MB_SYSTEM_MFLS","½¤Àµ¥À¥¦¥ó¥í¡¼¥É¾ðÊó");
+define("_MB_SYSTEM_HOME","¥Û¡¼¥à"); // link to home page in main menu block
+define("_MB_SYSTEM_RECO","Åö¥µ¥¤¥È¤ò¿äÁ¦¤¹¤ë");
+define("_MB_SYSTEM_PWWIDTH","¥Ý¥Ã¥×¥¢¥Ã¥×¥¦¥£¥ó¥É¥¦¤Î²£Éý");
+define("_MB_SYSTEM_PWHEIGHT","¥Ý¥Ã¥×¥¢¥Ã¥×¥¦¥£¥ó¥É¥¦¤Î¹â¤µ");
+define("_MB_SYSTEM_LOGO","%s ¥Ç¥£¥ì¥¯¥È¥êÆâ¤Î¥í¥´¥Õ¥¡¥¤¥ëÌ¾");  // %s is your root image directory name
+define("_MB_SYSTEM_SADMIN","´ÉÍý¼Ô¥°¥ë¡¼¥×¤òÉ½¼¨¤¹¤ë");
+define("_MB_SYSTEM_SPMTO","%s¤µ¤ó°¸¤Ë¥×¥é¥¤¥Ù¡¼¥È¥á¥Ã¥»¡¼¥¸¤òÁ÷¿®¤¹¤ë");
+define("_MB_SYSTEM_SEMTO","%s¤µ¤ó°¸¤Ë¥á¡¼¥ë¤òÁ÷¿®¤¹¤ë");
+
+define("_MB_SYSTEM_DISPLAY","%s ¿Í¤òÉ½¼¨");
+define("_MB_SYSTEM_DISPLAYA","¥æ¡¼¥¶¤Î¥¢¥Ð¥¿¡¼¤òÉ½¼¨");
+define("_MB_SYSTEM_NODISPGR","°Ê²¼¤ÎÆÃÊÌ¥é¥ó¥¯¤Î¥æ¡¼¥¶¤Ï½ü³°¤¹¤ë:");
+define("_MB_SYSTEM_DISPLAYC","%s ·ïÉ½¼¨¤¹¤ë");
+define("_MB_SYSTEM_SECURE", "SSL");
+
+define("_MB_SYSTEM_NUMTHEME", "%s ¥Æ¡¼¥Þ");
+define("_MB_SYSTEM_THSHOW", "¥¹¥¯¥ê¡¼¥ó¥·¥ç¥Ã¥È²èÁü¤ÎÉ½¼¨");
+define("_MB_SYSTEM_THWIDTH", "¥¹¥¯¥ê¡¼¥ó¥·¥ç¥Ã¥È²èÁü¤Î¥Ô¥¯¥»¥ëÉý");
+define("_MB_SYSTEM_NOTIF", "¥¤¥Ù¥ó¥ÈÄÌÃÎµ¡Ç½");
+
+define("_MB_SYSTEM_COMPEND", "¥³¥á¥ó¥È");
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/modulesadmin.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/modulesadmin.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/modulesadmin.php	(revision 405)
@@ -0,0 +1,58 @@
+<?php
+//%%%%%%	File Name  modulesadmin.php 	%%%%%
+define("_MD_AM_MODADMIN","¥â¥¸¥å¡¼¥ë´ÉÍý");
+define("_MD_AM_MODULE","¥â¥¸¥å¡¼¥ë");
+define("_MD_AM_VERSION","¥Ð¡¼¥¸¥ç¥ó");
+define("_MD_AM_LASTUP","ºÇ½ª¹¹¿·Æü");
+define("_MD_AM_DEACTIVATED","Èó¥¢¥¯¥Æ¥£¥Ö");
+define("_MD_AM_ACTION","Áàºî");
+define("_MD_AM_DEACTIVATE","Èó¥¢¥¯¥Æ¥£¥Ö¤Ë¤¹¤ë");
+define("_MD_AM_ACTIVATE","¥¢¥¯¥Æ¥£¥Ö¤Ë¤¹¤ë");
+define("_MD_AM_UPDATE","¥¢¥Ã¥×¥Ç¡¼¥È");
+define("_MD_AM_DUPEN","¥â¥¸¥å¡¼¥ë¤¬DBÆâ¤Ë2½ÅÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤¹¡ª");
+define("_MD_AM_DEACTED","ÁªÂò¤µ¤ì¤¿¥â¥¸¥å¡¼¥ë¤òÈó¥¢¥¯¥Æ¥£¥Ö¤Ë¤·¤Þ¤·¤¿¡£¤³¤Î¥â¥¸¥å¡¼¥ë¤ò°ÂÁ´¤Ëºï½ü¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£");
+define("_MD_AM_ACTED","ÁªÂò¤µ¤ì¤¿¥â¥¸¥å¡¼¥ë¤ò¥¢¥¯¥Æ¥£¥Ö¤Ë¤·¤Þ¤·¤¿");
+define("_MD_AM_UPDTED","ÁªÂò¤µ¤ì¤¿¥â¥¸¥å¡¼¥ë¤ò¥¢¥Ã¥×¥Ç¡¼¥È¤·¤Þ¤·¤¿");
+define("_MD_AM_SYSNO","¥·¥¹¥Æ¥à¥â¥¸¥å¡¼¥ë¤òÈó¥¢¥¯¥Æ¥£¥Ö¤Ë¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó");
+define("_MD_AM_STRTNO","¤³¤Î¥â¥¸¥å¡¼¥ë¤ÏÅö¥µ¥¤¥È¤Î³«»Ï¥â¥¸¥å¡¼¥ë¤È¤·¤ÆÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤¹¡£¤³¤Î¥â¥¸¥å¡¼¥ë¤òÈó¥¢¥¯¥Æ¥£¥Ö¤Ë¤¹¤ë¤Ë¤Ï¡¢°ìÈÌÀßÄê¥á¥Ë¥å¡¼¤Ë¤ª¤¤¤Æ³«»Ï¥â¥¸¥å¡¼¥ë¤ÎÊÑ¹¹¤ò¹Ô¤Ã¤Æ¤¯¤À¤µ¤¤¡£");
+
+// added in RC2
+define("_MD_AM_PCMFM","°Ê²¼¤ÎÆâÍÆ¤Ç¹¹¿·¤ò¹Ô¤¤¤Þ¤¹");
+
+// added in RC3
+define("_MD_AM_ORDER","É½¼¨½ç");
+define("_MD_AM_ORDER0","¡Ê0 = ÈóÉ½¼¨¡Ë");
+define("_MD_AM_ACTIVE","¥¢¥¯¥Æ¥£¥Ö");
+define("_MD_AM_INACTIVE","Èó¥¢¥¯¥Æ¥£¥Ö");
+define("_MD_AM_NOTINSTALLED","Ì¤¥¤¥ó¥¹¥È¡¼¥ë");
+define("_MD_AM_NOCHANGE","ÊÑ¹¹¤Ê¤·");
+define("_MD_AM_INSTALL","¥¤¥ó¥¹¥È¡¼¥ë");
+define("_MD_AM_UNINSTALL","¥¢¥ó¥¤¥ó¥¹¥È¡¼¥ë");
+define("_MD_AM_SUBMIT","Á÷¿®");
+define("_MD_AM_CANCEL","¥­¥ã¥ó¥»¥ë");
+define("_MD_AM_DBUPDATE","¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò¹¹¿·¤·¤Þ¤·¤¿");
+define("_MD_AM_BTOMADMIN","¥â¥¸¥å¡¼¥ë´ÉÍý¥á¥Ë¥å¡¼¤ØÌá¤ë");
+
+// %s represents module name
+define("_MD_AM_FAILINS","%s¥â¥¸¥å¡¼¥ë¤ò¥¤¥ó¥¹¥È¡¼¥ë¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿");
+define("_MD_AM_FAILACT","%s¥â¥¸¥å¡¼¥ë¤ò¥¢¥¯¥Æ¥£¥Ö¤ËÀßÄê¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿");
+define("_MD_AM_FAILDEACT","%s¥â¥¸¥å¡¼¥ë¤òÈó¥¢¥¯¥Æ¥£¥Ö¤ËÀßÄê¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿");
+define("_MD_AM_FAILUPD","%s¥â¥¸¥å¡¼¥ë¤ò¥¢¥Ã¥×¥Ç¡¼¥È¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£");
+define("_MD_AM_FAILUNINS","%s¥â¥¸¥å¡¼¥ë¤ò¥¢¥ó¥¤¥ó¥¹¥È¡¼¥ë¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿");
+define("_MD_AM_FAILORDER","%s¥â¥¸¥å¡¼¥ë¤ÎÉ½¼¨½ç¤òÊÑ¹¹¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿");
+define("_MD_AM_FAILWRITE","¥á¥¤¥ó¥á¥Ë¥å¡¼¥Õ¥¡¥¤¥ë¤Ø¤Î½ñ¤­¹þ¤ß¤Ë¼ºÇÔ¤·¤Þ¤·¤¿");
+define("_MD_AM_ALEXISTS","%s¥â¥¸¥å¡¼¥ë¤Ï´û¤ËÂ¸ºß¤·¤Þ¤¹");
+define("_MD_AM_ERRORSC", "¥¨¥é¡¼¡§");
+define("_MD_AM_OKINS","%s¥â¥¸¥å¡¼¥ë¤Î¥¤¥ó¥¹¥È¡¼¥ë¤¬´°Î»¤·¤Þ¤·¤¿");
+define("_MD_AM_OKACT","%s¥â¥¸¥å¡¼¥ë¤ò¥¢¥¯¥Æ¥£¥Ö¤ËÀßÄê¤·¤Þ¤·¤¿");
+define("_MD_AM_OKDEACT","%s¥â¥¸¥å¡¼¥ë¤òÈó¥¢¥¯¥Æ¥£¥Ö¤ËÀßÄê¤·¤Þ¤·¤¿");
+define("_MD_AM_OKUPD","%s¥â¥¸¥å¡¼¥ë¤Î¥¢¥Ã¥×¥Ç¡¼¥È¤¬´°Î»¤·¤Þ¤·¤¿");
+define("_MD_AM_OKUNINS","%s¥â¥¸¥å¡¼¥ë¤Î¥¢¥ó¥¤¥ó¥¹¥È¡¼¥ë¤¬´°Î»¤·¤Þ¤·¤¿");
+define("_MD_AM_OKORDER","%s¥â¥¸¥å¡¼¥ë¤ÎÉ½¼¨½ç¤òÊÑ¹¹¤·¤Þ¤·¤¿");
+define('_MD_AM_RUSUREINS', '¤³¤Î¥â¥¸¥å¡¼¥ë¤ò¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¤Ë¤Ï²¼¤Î¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤Æ¤¯¤À¤µ¤¤');
+define('_MD_AM_RUSUREUPD', '¤³¤Î¥â¥¸¥å¡¼¥ë¤Î¥¢¥Ã¥×¥Ç¡¼¥È¤ò¹Ô¤¦¤Ë¤Ï²¼¤Î¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤Æ¤¯¤À¤µ¤¤');
+define('_MD_AM_RUSUREUNINS', 'ËÜÅö¤Ë¤³¤Î¥â¥¸¥å¡¼¥ë¤ò¥¢¥ó¥¤¥ó¥¹¥È¡¼¥ë¤·¤Æ¤â¤è¤í¤·¤¤¤Ç¤¹¤«¡©');
+define('_MD_AM_LISTUPBLKS', '¥â¥¸¥å¡¼¥ë¤Î¥¢¥Ã¥×¥Ç¡¼¥È¤ò¹Ô¤¤¤Þ¤¹¡£<br />ÁªÂò¤Î¥Ö¥í¥Ã¥¯¤ÎÃæ¿È(¥Æ¥ó¥×¥ì¡¼¥È¤È¥ª¥×¥·¥ç¥ó)¤Ï¾å½ñ¤­¤µ¤ì¤Þ¤¹¡£<br />');
+define('_MD_AM_NEWBLKS', '¿·µ¬¥Ö¥í¥Ã¥¯');
+define('_MD_AM_DEPREBLKS', 'Deprecated Blocks');  //-no use //[MADA]
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/filter.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/filter.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/filter.php	(revision 405)
@@ -0,0 +1,16 @@
+<?php
+//%%%%%%	Admin Module Name  Filter 	%%%%%
+define("_AM_DBUPDATED",_MD_AM_DBUPDATED);
+
+define("_AM_FILTERSETTINGS","¶Ø»ßÍÑ¸ì / ¥¢¥¯¥»¥¹µñÈÝIP / ¶Ø»ß¥æ¡¼¥¶Ì¾¤ÎÀßÄê");
+define("_AM_BADIPS","¥¢¥¯¥»¥¹µñÈÝIP");
+define("_AM_BADWORDS","¶Ø»ßÍÑ¸ì");
+define("_AM_BADUNAMES","¶Ø»ß¥æ¡¼¥¶Ì¾");
+define("_AM_ENTERIPS","¥µ¥¤¥È¤Ø¤Î¥¢¥¯¥»¥¹¤òµñÈÝ¤·¤¿¤¤IP¥¢¥É¥ì¥¹¤òÆþÎÏ¤·¤Æ¤¯¤À¤µ¤¤¡£<br />1¹Ô¤Ë¤Ä¤­1¤Ä¤ÎIP¥¢¥É¥ì¥¹¤òÆþÎÏ¤·¤Æ¤¯¤À¤µ¤¤¡£");
+define("_AM_BADIPSTART","^aaa.bbb.ccc ¤Ï aaa.bbb.ccc ¤Ç»Ï¤Þ¤ëIP¥¢¥É¥ì¥¹¤«¤é¤Î¥¢¥¯¥»¥¹¤òµñÈÝ¤·¤Þ¤¹¡£");
+define("_AM_BADIPEND","aaa.bbb.ccc$ ¤ÏËöÈø¤¬ aaa.bbb.ccc ¤ÎIP¥¢¥É¥ì¥¹¤«¤é¤Î¥¢¥¯¥»¥¹¤òµñÈÝ¤·¤Þ¤¹¡£");
+define("_AM_BADIPCONTAIN","aaa.bbb.ccc ¤Ï aaa.bbb.ccc ¤ò´Þ¤àIP¥¢¥É¥ì¥¹¤«¤é¤Î¥¢¥¯¥»¥¹¤òµñÈÝ¤·¤Þ¤¹¡£");
+define("_AM_ENTERUNAMES","¥æ¡¼¥¶Ì¾¤È¤·¤Æ¤Î»ÈÍÑ¤ò¶Ø»ß¤·¤¿¤¤Ì¾Á°¤òÆþÎÏ¤·¤Æ¤¯¤À¤µ¤¤¡£<br />1¹Ô¤Ë¤Ä¤­1¤Ä¤Î¥æ¡¼¥¶Ì¾¤òÆþÎÏ¤·¤Æ¤¯¤À¤µ¤¤¡£ÂçÊ¸»ú¡¦¾®Ê¸»ú¤Î¶èÊÌ¤Ï¤¢¤ê¤Þ¤»¤ó¡£");
+define("_AM_ENTERWORDS","Åê¹ÆÊ¸¤Ë¤ª¤¤¤Æ»ÈÍÑ¤ò¶Ø»ß¤·¤¿¤¤Ã±¸ì¤òÆþÎÏ¤·¤Æ¤¯¤À¤µ¤¤¡£¤³¤ì¤é¤ÎÃ±¸ì¤Ï¡Ö####¡×¤ÈÉ½¼¨¤µ¤ì¤Þ¤¹¡£<br />1¹Ô¤Ë¤Ä¤­1¤Ä¤ÎÃ±¸ì¤òÆþÎÏ¤·¤Æ¤¯¤À¤µ¤¤¡£ÂçÊ¸»ú¡¦¾®Ê¸»ú¤Î¶èÊÌ¤Ï¤¢¤ê¤Þ¤»¤ó¡£");
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/themes.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/themes.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/themes.php	(revision 405)
@@ -0,0 +1,58 @@
+<?php
+// $Id: themes.php,v 1.2 2005/03/18 13:00:59 onokazu Exp $
+//%%%%%% Template Manager %%%%%
+define('_MD_TPLMAIN','¥Æ¡¼¥Þ¥»¥Ã¥È¡¦¥Þ¥Í¥¸¥ã¡¼');
+define('_MD_INSTALL','¥¤¥ó¥¹¥È¡¼¥ë');
+define('_MD_EDITTEMPLATE','¥Æ¥ó¥×¥ì¡¼¥È¥Õ¥¡¥¤¥ë¤ÎÊÔ½¸');
+define('_MD_FILENAME','¥Õ¥¡¥¤¥ëÌ¾');
+define('_MD_FILEDESC','ÀâÌÀ');
+define('_MD_LASTMOD','ºÇ½ª¹¹¿·Æü');
+define('_MD_FILEMOD','ºÇ½ª¹¹¿·Æü(¥Õ¥¡¥¤¥ë)');
+define('_MD_FILECSS','CSS');
+define('_MD_FILEHTML','HTML');
+define('_MD_AM_BTOTADMIN', '¥Æ¡¼¥Þ¥»¥Ã¥È¡¦¥Þ¥Í¥¸¥ã¡¼¤ËÌá¤ë');
+define('_MD_RUSUREDELTH', 'ËÜÅö¤Ë¤³¤Î¥Æ¡¼¥Þ¥»¥Ã¥È¤È´ØÏ¢¤¹¤ë¤¹¤Ù¤Æ¤Î¥Æ¥ó¥×¥ì¡¼¥È¥Ç¡¼¥¿¤òºï½ü¤·¤Æ¤â¤è¤í¤·¤¤¤Ç¤¹¤«¡©');
+define('_MD_RUSUREDELTPL', 'ËÜÅö¤Ë¤³¤Î¥Æ¥ó¥×¥ì¡¼¥È¥Ç¡¼¥¿¤òºï½ü¤·¤Æ¤â¤è¤í¤·¤¤¤Ç¤¹¤«¡©');
+define('_MD_PLZINSTALL', '¥¤¥ó¥¹¥È¡¼¥ë¤ò¹Ô¤¦¤Ë¤Ï²¼¤Î¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤Æ¤¯¤À¤µ¤¤¡£');
+define('_MD_PLZGENERATE', '¥Õ¥¡¥¤¥ë¤òÀ¸À®¤¹¤ë¤Ë¤Ï²¼¤Î¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤Æ¤¯¤À¤µ¤¤¡£');
+define('_MD_CLONETHEME','¥Æ¡¼¥Þ¥»¥Ã¥È¤ÎÊ£À½¤òºîÀ®¤¹¤ë');
+define('_MD_THEMENAME','´ð¤Ë¤¹¤ë¥Æ¡¼¥Þ¥»¥Ã¥È');
+define('_MD_NEWNAME','¿·¤·¤¤¥Æ¡¼¥Þ¥»¥Ã¥ÈÌ¾¤òÆþÎÏ¤·¤Æ¤¯¤À¤µ¤¤');
+define('_MD_IMPORT','¥¤¥ó¥Ý¡¼¥È');
+define('_MD_RUSUREIMPT', '¥Æ¥ó¥×¥ì¡¼¥È¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤Î¥Æ¥ó¥×¥ì¡¼¥È¤Î¥¤¥ó¥Ý¡¼¥È¤Ï ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥Ç¡¼¥¿¤ò¾å½ñ¤­¤·¤Þ¤¹¡£<br />¼Â¹Ô¤¹¤ë¤Ë¤Ï ¡Ö¥¤¥ó¥Ý¡¼¥È¡×¤ò¥¯¥ê¥Ã¥¯¤·¤Æ¤¯¤À¤µ¤¤¡£');
+define('_MD_THMSETNAME','Ì¾Á°');
+define('_MD_CREATED','ºîÀ®Æü:');
+define('_MD_SKIN','¥¹¥­¥ó');
+define('_MD_TEMPLATES','¥Æ¥ó¥×¥ì¡¼¥È');
+define('_MD_EDITSKIN','¥¹¥­¥ó¤ÎÊÔ½¸');
+define('_MD_NOFILE','¥Õ¥¡¥¤¥ë¤Ï¤¢¤ê¤Þ¤»¤ó');
+define('_MD_VIEW','»²¾È');
+define('_MD_COPYDEFAULT','¥Ç¥Õ¥©¥ë¥È¤Î¥Õ¥¡¥¤¥ë¤ò¥³¥Ô¡¼¤¹¤ë');
+define('_MD_DLDEFAULT','¥Ç¥Õ¥©¥ë¥È¤Î¥Õ¥¡¥¤¥ë¤ò¥À¥¦¥ó¥í¡¼¥É¤¹¤ë');
+define('_MD_VIEWDEFAULT','¥Ç¥Õ¥©¥ë¥È¤Î¥Æ¥ó¥×¥ì¡¼¥È¤ò»²¾È¤¹¤ë');
+define('_MD_DOWNLOAD','¥À¥¦¥ó¥í¡¼¥É');
+define('_MD_UPLOAD','¥¢¥Ã¥×¥í¡¼¥É');
+define('_MD_GENERATE','ºîÀ®');
+define('_MD_CHOOSEFILE', '¥¢¥Ã¥×¥í¡¼¥É¤¹¤ë¥Õ¥¡¥¤¥ë¤ò»ØÄê¤·¤Æ¤¯¤À¤µ¤¤');
+define('_MD_UPWILLREPLACE', '¤³¤Î¥Õ¥¡¥¤¥ë¤ò¥¢¥Ã¥×¥Ç¡¼¥È¤¹¤ë¤È¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¾å¤Î¥Õ¥¡¥¤¥ë¤¬¾å½ñ¤­¤µ¤ì¤Þ¤¹!');
+define('_MD_UPLOADTAR', '¥Æ¡¼¥Þ¥»¥Ã¥È¤ò¥¢¥Ã¥×¥í¡¼¥É¤¹¤ë');
+define('_MD_CHOOSETAR', '¥¢¥Ã¥×¥í¡¼¥É¤¹¤ë¥Æ¡¼¥Þ¥»¥Ã¥È¤ò»ØÄê¤·¤Æ¤¯¤À¤µ¤¤');
+define('_MD_ONLYTAR', 'tar.gz/.tar ¥Õ¥¡¥¤¥ë¤Ï¡¢Àµ¤·¤¤ XOOPS¥Æ¡¼¥Þ¥»¥Ã¥È¹½Â¤¤Ç¤¢¤ëÉ¬Í×¤¬¤¢¤ê¤Þ¤¹¡£');
+define('_MD_NTHEMENAME', '¿·¤·¤¤¥Æ¡¼¥Þ¥»¥Ã¥ÈÌ¾');
+define('_MD_ENTERTH', '¤³¤Î¥Ñ¥Ã¥±¡¼¥¸¤ËÉÕ¤±¤ë¥Æ¡¼¥Þ¥»¥Ã¥ÈÌ¾¤òÆþÎÏ¤·¤Æ¤¯¤À¤µ¤¤¡£¶õÍó¤Ë¤¹¤ë¤È¼«Æ°¸¡½Ð¤·¤Þ¤¹¡£');
+define('_MD_TITLE','ÂêÌ¾');
+define('_MD_CONTENT','ÆâÍÆ');
+define('_MD_ACTION','¥¢¥¯¥·¥ç¥ó');
+define('_MD_DEFAULTTHEME','¤³¤Î¥Æ¡¼¥Þ¥»¥Ã¥È¤Ï¥Ç¥Õ¥©¥ë¥È»ÈÍÑ¤È¤·¤ÆÀßÄê¤µ¤ì¤Æ¤¤¤Þ¤¹');
+define('_MD_AM_ERRTHEME', '¥Æ¡¼¥Þ¥»¥Ã¥È¤¬Àµ¾ï¤Ê¥¹¥­¥ó¥Õ¥¡¥¤¥ë¥Ç¡¼¥¿¤ò´Þ¤ó¤Ç¤¤¤Þ¤»¤ó¡£³ºÅö¤¹¤ë¥Æ¡¼¥Þ¥»¥Ã¥È¤òºï½ü¤·¤Æ¤¯¤À¤µ¤¤¡£');
+define('_MD_SKINIMGS','¥¹¥­¥ó¥¤¥á¡¼¥¸¥Õ¥¡¥¤¥ë');
+define('_MD_EDITSKINIMG','¥¹¥­¥ó¥¤¥á¡¼¥¸¥Õ¥¡¥¤¥ë¤ÎÊÔ½¸');
+define('_MD_IMGFILE','¥Õ¥¡¥¤¥ëÌ¾');
+define('_MD_IMGNEWFILE','¿·µ¬¥Õ¥¡¥¤¥ë¤Î¥¢¥Ã¥×¥í¡¼¥É');
+define('_MD_IMGDELETE','ºï½ü');
+define('_MD_ADDSKINIMG','¥¹¥­¥ó¥¤¥á¡¼¥¸¥Õ¥¡¥¤¥ë¤ÎÄÉ²Ã');
+define('_MD_BLOCKHTML', '¥Ö¥í¥Ã¥¯HTML');
+define('_MD_IMAGES', '¥¤¥á¡¼¥¸');
+define('_MD_NOZLIB', '¥µ¡¼¥Ð¤Ç Zlib ¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ëÉ¬Í×¤¬¤¢¤ê¤Þ¤¹¡£');
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/comments.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/comments.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/comments.php	(revision 405)
@@ -0,0 +1,11 @@
+<?php
+// $Id: comments.php,v 1.2 2005/03/18 13:00:59 onokazu Exp $
+//%%%%%% Comment Manager %%%%%
+define('_MD_AM_COMMMAN','¥³¥á¥ó¥È¥Þ¥Í¥¸¥ã¡¼');
+
+define('_MD_AM_LISTCOMM','¥³¥á¥ó¥È°ìÍ÷');
+define('_MD_AM_ALLMODS','Á´¤Æ¤Î¥â¥¸¥å¡¼¥ë');
+define('_MD_AM_ALLSTATUS','Á´¤Æ¤Î¥¹¥Æ¡¼¥¿¥¹');
+define('_MD_AM_MODULE','¥â¥¸¥å¡¼¥ë');
+define('_MD_AM_COMFOUND','%s ·ï¤Î¥³¥á¥ó¥È¤¬¸«¤Ä¤«¤ê¤Þ¤·¤¿¡£');
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/version.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/version.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/version.php	(revision 405)
@@ -0,0 +1,6 @@
+<?php
+//%%%%%%	Admin Module Name  Version 	%%%%%
+define("_AM_DBUPDATED",_MD_AM_DBUPDATED);
+
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/blocksadmin.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/blocksadmin.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/blocksadmin.php	(revision 405)
@@ -0,0 +1,67 @@
+<?php
+//%%%%%%	Admin Module Name  Blocks 	%%%%%
+define("_AM_DBUPDATED",_MD_AM_DBUPDATED);
+
+//%%%%%%	blocks.php 	%%%%%
+define("_AM_BADMIN","¥Ö¥í¥Ã¥¯´ÉÍý");
+define("_AM_ADDBLOCK","¿·µ¬¥Ö¥í¥Ã¥¯ºîÀ®");
+define("_AM_LISTBLOCK","Á´¤Æ¤Î¥Ö¥í¥Ã¥¯¤òÉ½¼¨");
+define("_AM_SIDE","É½¼¨¥µ¥¤¥É");
+define("_AM_BLKDESC","¥Ö¥í¥Ã¥¯¤ÎÀâÌÀ");
+define("_AM_TITLE","¥¿¥¤¥È¥ë");
+define("_AM_WEIGHT","ÊÂ¤Ó½ç");
+define("_AM_ACTION","Áàºî");
+define("_AM_BLKTYPE","¥Ö¥í¥Ã¥¯¤Î¥¿¥¤¥×");
+define("_AM_LEFT","º¸Â¦");
+define("_AM_RIGHT","±¦Â¦");
+define("_AM_CENTER","Ãæ±û");
+define("_AM_VISIBLE","É½¼¨ / ÈóÉ½¼¨");
+define("_AM_POSCONTT","ÄÉ²Ã¥³¥ó¥Æ¥ó¥Ä¤òÁÞÆþ¤¹¤ë°ÌÃÖ");
+define("_AM_ABOVEORG","¸µ¤Î¥³¥ó¥Æ¥ó¥Ä¤Î¾å");
+define("_AM_AFTERORG","¸µ¤Î¥³¥ó¥Æ¥ó¥Ä¤Î²¼");
+define("_AM_EDIT","ÊÔ½¸");
+define("_AM_DELETE","ºï½ü");
+define("_AM_SBLEFT","¥µ¥¤¥É¥Ö¥í¥Ã¥¯ - º¸");
+define("_AM_SBRIGHT","¥µ¥¤¥É¥Ö¥í¥Ã¥¯ - ±¦");
+define("_AM_CBLEFT","Ãæ±û¥Ö¥í¥Ã¥¯ - º¸");
+define("_AM_CBRIGHT","Ãæ±û¥Ö¥í¥Ã¥¯ - ±¦");
+define("_AM_CBCENTER","Ãæ±û¥Ö¥í¥Ã¥¯ - Ãæ±û");
+define("_AM_CONTENT","¥³¥ó¥Æ¥ó¥Ä");
+define("_AM_OPTIONS","¥ª¥×¥·¥ç¥ó");
+define("_AM_CTYPE","¥³¥ó¥Æ¥ó¥Ä¤Î¥¿¥¤¥×");
+define("_AM_HTML","HTML¥¿¥°");
+define("_AM_PHP","PHP¥¹¥¯¥ê¥×¥È");
+define("_AM_AFWSMILE","¼«Æ°¥Õ¥©¡¼¥Þ¥Ã¥È¡Ê´é¥¢¥¤¥³¥óÍ­¸ú¡Ë");
+define("_AM_AFNOSMILE","¼«Æ°¥Õ¥©¡¼¥Þ¥Ã¥È¡Ê´é¥¢¥¤¥³¥óÌµ¸ú¡Ë");
+define("_AM_SUBMIT","Á÷¿®");
+define("_AM_CUSTOMHTML","¥«¥¹¥¿¥à¡ÊHTML¡Ë");
+define("_AM_CUSTOMPHP","¥«¥¹¥¿¥à¡ÊPHP¡Ë");
+define("_AM_CUSTOMSMILE","¥«¥¹¥¿¥à¡Ê´é¥¢¥¤¥³¥óÌµ¸ú¡Ë");
+define("_AM_CUSTOMNOSMILE","¥«¥¹¥¿¥à¡Ê´é¥¢¥¤¥³¥óÌµ¸ú¡Ë");
+define("_AM_DISPRIGHT","±¦¥Ö¥í¥Ã¥¯¤Î¤ßÉ½¼¨");
+define("_AM_SAVECHANGES","ÊÑ¹¹¤òÊÝÂ¸");
+define("_AM_EDITBLOCK","¥Ö¥í¥Ã¥¯¤òÊÔ½¸");
+define("_AM_SYSTEMCANT","¥·¥¹¥Æ¥à¥Ö¥í¥Ã¥¯¤Ïºï½ü¤Ç¤­¤Þ¤»¤ó");
+define("_AM_MODULECANT","¤³¤Î¥Ö¥í¥Ã¥¯¤òÄ¾ÀÜºï½ü¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£Àè¤Ë¤³¤Î¥Ö¥í¥Ã¥¯¤Î¥â¥¸¥å¡¼¥ë¤òÈó¥¢¥¯¥Æ¥£¥Ö¤Ë¤·¤Æ¤¯¤À¤µ¤¤");
+define("_AM_RUSUREDEL","<b>%s</b>¥Ö¥í¥Ã¥¯¤òËÜÅö¤Ëºï½ü¤·¤Æ¤â¤¤¤¤¤Ç¤¹¤«¡©");
+define("_AM_NAME","Ì¾¾Î");
+define("_AM_USEFULTAGS","»ÈÍÑ²ÄÇ½¤Ê¥¿¥°");
+define("_AM_BLOCKTAG1","%s ¤Ï %s ¤òÉ½¼¨¤·¤Þ¤¹");
+
+define('_AM_SVISIBLEIN', 'É½¼¨¤¹¤ë²èÌÌ¡§ %s ');//Show blocks visible in %s');
+define('_AM_TOPPAGE', '¥È¥Ã¥×¥Ú¡¼¥¸');
+define('_AM_VISIBLEIN', 'É½¼¨¤¹¤ë²èÌÌ');
+define('_AM_ALLPAGES', '¤¹¤Ù¤Æ¤Î¥Ú¡¼¥¸');
+define('_AM_TOPONLY', '¥È¥Ã¥×¥Ú¡¼¥¸¤Î¤ß');
+define('_AM_ADVANCED', '¹âÅÙ¤ÊÀßÄê');
+define('_AM_BCACHETIME', '¥­¥ã¥Ã¥·¥å¤Î¼÷Ì¿');
+define('_AM_BALIAS', '¥¨¥ê¥¢¥¹Ì¾');
+define('_AM_CLONE', 'Ê£À½');  // clone a block
+define('_AM_CLONEBLK', 'Ê£À½'); // cloned block
+define('_AM_CLONEBLOCK', 'Ê£À½¥Ö¥í¥Ã¥¯¤ÎºîÀ®');
+define('_AM_NOTSELNG', "'%s' ¤ÏÁªÂò¤µ¤ì¤Æ¤¤¤Þ¤»¤ó!"); // error message
+define('_AM_EDITTPL', '¥Æ¥ó¥×¥ì¡¼¥È¤òÊÔ½¸');
+define('_AM_MODULE', '¥â¥¸¥å¡¼¥ë');
+define('_AM_GROUP', '¥°¥ë¡¼¥×');
+define('_AM_UNASSIGNED', 'Ì¤³ä¤êÅö¤Æ');
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/banners.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/banners.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/banners.php	(revision 405)
@@ -0,0 +1,57 @@
+<?php
+//%%%%%%        Admin Module Name  Banners         %%%%%
+define("_AM_DBUPDATED",_MD_AM_DBUPDATED);
+
+define("_AM_CURACTBNR","¸½ºß¥¢¥¯¥Æ¥£¥Ö¤Ê¥Ð¥Ê¡¼");
+define("_AM_BANNERID","¥Ð¥Ê¡¼ID");
+define("_AM_IMPRESION","¥¤¥ó¥×¥ì¥Ã¥·¥ç¥ó¿ô");
+define("_AM_IMPLEFT","»Ä¤ê¥¤¥ó¥×¥ì¥Ã¥·¥ç¥ó¿ô");
+define("_AM_CLICKS","¥¯¥ê¥Ã¥¯¿ô");
+define("_AM_NCLICKS","¥¯¥ê¥Ã¥¯Î¨");
+define("_AM_CLINAME","¥¯¥é¥¤¥¢¥ó¥ÈÌ¾");
+define("_AM_FUNCTION","");
+define("_AM_UNLIMIT","ÌµÀ©¸Â");
+define("_AM_EDIT","ÊÔ½¸");
+define("_AM_DELETE","ºï½ü");
+define("_AM_FINISHBNR","·ÇºÜ½ªÎ»¥Ð¥Ê¡¼");
+define("_AM_IMPD","¥¤¥ó¥×¥ì¥Ã¥·¥ç¥ó¿ô");
+define("_AM_STARTDATE","³«»ÏÆü");
+define("_AM_ENDDATE","½ªÎ»Æü");
+define("_AM_ADVCLI","¥¯¥é¥¤¥¢¥ó¥È");
+define("_AM_ACTIVEBNR","¥¢¥¯¥Æ¥£¥Ö¤Ê¥Ð¥Ê¡¼");
+define("_AM_CONTNAME","Ã´Åö¼ÔÌ¾");
+define("_AM_CONTMAIL","Ã´Åö¼ÔEmail");
+define("_AM_CLINAMET","¥¯¥é¥¤¥¢¥ó¥ÈÌ¾¡§");
+define("_AM_ADDNWBNR","¥Ð¥Ê¡¼¤òÄÉ²Ã");
+define("_AM_IMPPURCHT","¹ØÆþºÑ¥¤¥ó¥×¥ì¥Ã¥·¥ç¥ó¿ô¡§");
+define("_AM_IMGURLT","²èÁüURL¡§");
+define("_AM_CLICKURLT","¥¯¥ê¥Ã¥¯ÀèURL¡§");
+define("_AM_ADDBNR","ÄÉ²Ã");
+define("_AM_ADDNWCLI","¿·µ¬¥¯¥é¥¤¥¢¥ó¥È¤ÎºîÀ®");
+define("_AM_CONTNAMET","Ã´Åö¼ÔÌ¾¡§");
+define("_AM_CONTMAILT","Ã´Åö¼ÔEmail¡§");
+define("_AM_CLILOGINT","¥í¥°¥¤¥óÌ¾¡§");
+define("_AM_CLIPASST","¥Ñ¥¹¥ï¡¼¥É¡§");
+define("_AM_ADDCLI","¥¯¥é¥¤¥¢¥ó¥È¤òÄÉ²Ã");
+define("_AM_DELEBNR","¥Ð¥Ê¡¼¤òºï½ü");
+define("_AM_SUREDELE","¤³¤Î¥Ð¥Ê¡¼¤òºï½ü¤·¤Æ¤â¤¤¤¤¤Ç¤¹¤«¡©");
+define("_AM_NO","¤¤¤¤¤¨");
+define("_AM_YES","¤Ï¤¤");
+define("_AM_EDITBNR","¥Ð¥Ê¡¼¤òÊÔ½¸");
+define("_AM_ADDIMPT","ÄÉ²Ã¥¤¥ó¥×¥ì¥Ã¥·¥ç¥ó¿ô¡§");
+define("_AM_PURCHT","¹ØÆþºÑ¥¤¥ó¥×¥ì¥Ã¥·¥ç¥ó¿ô¡§");
+define("_AM_MADET","¸½ºß¤Þ¤Ç¤Î¥¤¥ó¥×¥ì¥Ã¥·¥ç¥ó¿ô");
+define("_AM_CHGBNR","ÊÑ¹¹¤òÊÝÂ¸");
+define("_AM_DELEADC","¥¯¥é¥¤¥¢¥ó¥È¤òºï½ü");
+define("_AM_SUREDELCLI","¥¯¥é¥¤¥¢¥ó¥È <b>%s</b> ¤ª¤è¤Ó¤½¤Î¥Ð¥Ê¡¼¤òºï½ü¤·¤Þ¤¹");
+define("_AM_NOBNRRUN","¤³¤Î¥¯¥é¥¤¥¢¥ó¥È¤Î¥Ð¥Ê¡¼¤Ï¤¢¤ê¤Þ¤»¤ó");
+define("_AM_WARNING","·Ù¹ð¡ª¡ª");
+define("_AM_ACTBNRRUN","¥¯¥é¥¤¥¢¥ó¥È¤Î¥Ð¥Ê¡¼¡§");
+define("_AM_SUREDELBNR","¤³¤Î¥¯¥é¥¤¥¢¥ó¥È¤ª¤è¤Ó¤½¤Î¥Ð¥Ê¡¼¤òºï½ü¤·¤Þ¤¹");
+define("_AM_EDITADVCLI","¥¯¥é¥¤¥¢¥ó¥È¤òÊÔ½¸");
+define("_AM_EXTINFO","¤½¤ÎÂ¾¡§");
+define("_AM_CHGCLI","ÊÑ¹¹¤òÊÝÂ¸");
+define("_AM_USEHTML","HTML¤ò»ÈÍÑ");
+define("_AM_CODEHTML","HTML¥³¡¼¥É¡§");
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/userrank.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/userrank.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/userrank.php	(revision 405)
@@ -0,0 +1,27 @@
+<?php
+//%%%%%%	Admin Module Name  UserRank 	%%%%%
+define("_AM_DBUPDATED",_MD_AM_DBUPDATED);
+define("_AM_RANKSSETTINGS","¥æ¡¼¥¶¥é¥ó¥­¥ó¥°¤ÎÀßÄê");
+define("_AM_TITLE","¥é¥ó¥¯Ì¾");
+define("_AM_MINPOST","ºÇÄãÅê¹Æ¿ô");
+define("_AM_MAXPOST","ºÇ¹âÅê¹Æ¿ô");
+define("_AM_IMAGE","²èÁü");
+define("_AM_SPERANK","ÆÃÊÌ¥é¥ó¥¯");
+define("_AM_ON","¥ª¥ó");
+define("_AM_OFF","¥ª¥Õ");
+define("_AM_EDIT","ÊÔ½¸");
+define("_AM_DEL","ºï½ü");
+define("_AM_ADDNEWRANK","¿·µ¬¥é¥ó¥¯¤ÎÄÉ²Ã");
+define("_AM_RANKTITLE","¥é¥ó¥¯Ì¾");
+define("_AM_SPECIAL","ÆÃÊÌ¥é¥ó¥¯");
+define("_AM_ADD","ÄÉ²Ã");
+define("_AM_EDITRANK","¥é¥ó¥¯¤ÎÊÔ½¸");
+define("_AM_ACTIVE","¥¢¥¯¥Æ¥£¥Ö");
+define("_AM_SAVECHANGE","ÊÑ¹¹¤òÊÝÂ¸");
+define("_AM_WAYSYWTDTR","¤³¤Î¥é¥ó¥¯¤ÎÀßÄê¤òºï½ü¤·¤Æ¤â¤¤¤¤¤Ç¤¹¤«¡©");
+define("_AM_YES","¤Ï¤¤");
+define("_AM_NO","¤¤¤¤¤¨");
+define("_AM_VALIDUNDER","¡Ê<b>%s</b>¥Ç¥£¥ì¥¯¥È¥ê²¼¤Î²èÁü¥Õ¥¡¥¤¥ë¡Ë");
+define("_AM_SPECIALCAN","¡ÊÆÃÊÌ¥é¥ó¥¯¤Ï¥æ¡¼¥¶¤ÎÅê¹Æ¿ô¤È¤Ï´Ø·¸¤Ê¤¯¥æ¡¼¥¶¤ËÀßÄê¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¡Ë");
+define("_AM_ACTION","");
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/tplsets.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/tplsets.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/tplsets.php	(revision 405)
@@ -0,0 +1,62 @@
+<?php
+// $Id: tplsets.php,v 1.2 2005/03/18 13:00:59 onokazu Exp $
+//%%%%%% Template Manager %%%%%
+define('_MD_TPLMAIN','¥Æ¥ó¥×¥ì¡¼¥È¥»¥Ã¥È¡¦¥Þ¥Í¥¸¥ã¡¼');
+define('_MD_INSTALL','¥¤¥ó¥¹¥È¡¼¥ë');
+define('_MD_EDITTEMPLATE','¥Æ¥ó¥×¥ì¡¼¥È¥Õ¥¡¥¤¥ë¤ÎÊÔ½¸');
+define('_MD_FILENAME','¥Õ¥¡¥¤¥ëÌ¾');
+define('_MD_FILEDESC','ÀâÌÀ');
+define('_MD_LASTMOD','ºÇ½ª¹¹¿·Æü');
+define('_MD_FILEMOD','ºÇ½ª¹¹¿·Æü(¥Õ¥¡¥¤¥ë)');
+define('_MD_FILECSS','CSS');
+define('_MD_FILEHTML','HTML');
+define('_MD_AM_BTOTADMIN', '¥Æ¥ó¥×¥ì¡¼¥È¥»¥Ã¥È¡¦¥Þ¥Í¥¸¥ã¡¼¤ËÌá¤ë');
+define('_MD_RUSUREDELTH', 'ËÜÅö¤Ë¤³¤Î¥Æ¥ó¥×¥ì¡¼¥È¥»¥Ã¥È¤È´ØÏ¢¤¹¤ë¤¹¤Ù¤Æ¤Î¥Æ¥ó¥×¥ì¡¼¥È¥Ç¡¼¥¿¤òºï½ü¤·¤Æ¤â¤è¤í¤·¤¤¤Ç¤¹¤«¡©');
+define('_MD_RUSUREDELTPL', 'ËÜÅö¤Ë¤³¤Î¥Æ¥ó¥×¥ì¡¼¥È¥Ç¡¼¥¿¤òºï½ü¤·¤Æ¤â¤è¤í¤·¤¤¤Ç¤¹¤«¡©');
+define('_MD_PLZINSTALL', '²¼µ­¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤È¥¤¥ó¥¹¥È¡¼¥ë¤ò³«»Ï¤·¤Þ¤¹');
+define('_MD_PLZGENERATE', '²¼µ­¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤È¥Õ¥¡¥¤¥ë¤¬À¸À®¤µ¤ì¤Þ¤¹');
+define('_MD_CLONETHEME','¥Æ¥ó¥×¥ì¡¼¥È¥»¥Ã¥È¤ÎÊ£À½¤òºîÀ®¤¹¤ë');
+define('_MD_THEMENAME','´ð¤È¤Ê¤ë¥Æ¥ó¥×¥ì¡¼¥È¥»¥Ã¥È');
+define('_MD_NEWNAME','¿·¤·¤¤¥Æ¥ó¥×¥ì¡¼¥È¥»¥Ã¥ÈÌ¾¤òÆþÎÏ¤·¤Æ¤¯¤À¤µ¤¤');
+define('_MD_IMPORT','¥¤¥ó¥Ý¡¼¥È');
+define('_MD_RUSUREIMPT', '¥Æ¥ó¥×¥ì¡¼¥È¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¥Æ¥ó¥×¥ì¡¼¥È¤ò¥¤¥ó¥Ý¡¼¥È¤·¤¿¾ì¹ç¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹Æâ¤Î¥Ç¡¼¥¿¤ò¾å½ñ¤­¤µ¤ì¤Þ¤¹¡£<br />¼Â¹Ô¤¹¤ë¤Ë¤Ï ¡Ö¥¤¥ó¥Ý¡¼¥È¡×¤ò¥¯¥ê¥Ã¥¯¤·¤Æ¤¯¤À¤µ¤¤¡£');
+define('_MD_THMSETNAME','Ì¾Á°');
+define('_MD_CREATED','ºîÀ®Æü:');
+define('_MD_SKIN','¥¹¥­¥ó');
+define('_MD_TEMPLATES','¥Æ¥ó¥×¥ì¡¼¥È');
+define('_MD_EDITSKIN','¥¹¥­¥ó¤ÎÊÔ½¸');
+define('_MD_NOFILE','¥Õ¥¡¥¤¥ë¤Ï¤¢¤ê¤Þ¤»¤ó');
+define('_MD_VIEW','»²¾È');
+define('_MD_COPYDEFAULT','¡Ödefault¡Ê¥Ç¥Õ¥©¥ë¥È¡Ë¡×¥Æ¥ó¥×¥ì¡¼¥È¥»¥Ã¥È¤Î¥Õ¥¡¥¤¥ë¤ò¥³¥Ô¡¼¤¹¤ë');
+define('_MD_DLDEFAULT','¡Ödefault¡Ê¥Ç¥Õ¥©¥ë¥È¡Ë¡×¥Æ¥ó¥×¥ì¡¼¥È¥»¥Ã¥È¤Î¥Õ¥¡¥¤¥ë¤ò¥À¥¦¥ó¥í¡¼¥É¤¹¤ë');
+define('_MD_VIEWDEFAULT','¡Ödefault¡Ê¥Ç¥Õ¥©¥ë¥È¡Ë¡×¥Æ¥ó¥×¥ì¡¼¥È¥»¥Ã¥È¤Î¥Æ¥ó¥×¥ì¡¼¥È¤òÉ½¼¨¤¹¤ë');
+define('_MD_DOWNLOAD','¥À¥¦¥ó¥í¡¼¥É');
+define('_MD_UPLOAD','¥¢¥Ã¥×¥í¡¼¥É');
+define('_MD_GENERATE','ºîÀ®');
+define('_MD_CHOOSEFILE', '¥¢¥Ã¥×¥í¡¼¥É¤¹¤ë¥Õ¥¡¥¤¥ë¤ò»ØÄê¤·¤Æ¤¯¤À¤µ¤¤');
+define('_MD_UPWILLREPLACE', '¤³¤Î¥Õ¥¡¥¤¥ë¤ò¥¢¥Ã¥×¥Ç¡¼¥È¤¹¤ë¤È¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¾å¤Î¥Õ¥¡¥¤¥ë¤¬¾å½ñ¤­¤µ¤ì¤Þ¤¹!');
+define('_MD_UPLOADTAR', '¥Æ¥ó¥×¥ì¡¼¥È¥»¥Ã¥È¤ò¥¢¥Ã¥×¥í¡¼¥É¤¹¤ë');
+define('_MD_CHOOSETAR', '¥¢¥Ã¥×¥í¡¼¥É¤¹¤ë¥Æ¥ó¥×¥ì¡¼¥È¥»¥Ã¥È¤ò»ØÄê¤·¤Æ¤¯¤À¤µ¤¤');
+define('_MD_ONLYTAR', 'XOOPSÉ¸½à¤ÎÀµ¤·¤¤¹½Â¤¤òÍ­¤¹¤ë¥Æ¥ó¥×¥ì¡¼¥È¥»¥Ã¥È¤òtar.gz/.tar·Á¼°¤Ç¥¢¥Ã¥×¥í¡¼¥É¤·¤Æ¤¯¤À¤µ¤¤¡£');
+define('_MD_NTHEMENAME', '¿·¤·¤¤¥Æ¥ó¥×¥ì¡¼¥È¥»¥Ã¥ÈÌ¾');
+define('_MD_ENTERTH', '¤³¤Î¥Ñ¥Ã¥±¡¼¥¸¤ËÉÕ¤±¤ë¥Æ¥ó¥×¥ì¡¼¥È¥»¥Ã¥ÈÌ¾¤òÆþÎÏ¤·¤Æ¤¯¤À¤µ¤¤¡£¶õÍó¤Ë¤·¤¿¾ì¹ç¡¢¼«Æ°¸¡½Ð¤·¤Þ¤¹¡£');
+define('_MD_TITLE','ÂêÌ¾');
+define('_MD_CONTENT','ÆâÍÆ');
+define('_MD_ACTION','¥¢¥¯¥·¥ç¥ó');
+define('_MD_DEFAULTTHEME','¤³¤Î¥Æ¥ó¥×¥ì¡¼¥È¥»¥Ã¥È¤¬¥Ç¥Õ¥©¥ë¥È¤ËÀßÄê¤µ¤ì¤Æ¤¤¤Þ¤¹');
+define('_MD_AM_ERRTHEME', '¥Æ¥ó¥×¥ì¡¼¥È¥»¥Ã¥È¤¬Àµ¾ï¤Ê¥¹¥­¥ó¥Õ¥¡¥¤¥ë¥Ç¡¼¥¿¤ò´Þ¤ó¤Ç¤¤¤Þ¤»¤ó¡£³ºÅö¤¹¤ë¥Æ¥ó¥×¥ì¡¼¥È¥»¥Ã¥È¤òºï½ü¤·¤Æ¤¯¤À¤µ¤¤¡£');
+define('_MD_SKINIMGS','¥¹¥­¥ó¥¤¥á¡¼¥¸¥Õ¥¡¥¤¥ë');
+define('_MD_EDITSKINIMG','¥¹¥­¥ó¥¤¥á¡¼¥¸¥Õ¥¡¥¤¥ë¤ÎÊÔ½¸');
+define('_MD_IMGFILE','¥Õ¥¡¥¤¥ëÌ¾');
+define('_MD_IMGNEWFILE','¿·µ¬¥Õ¥¡¥¤¥ë¤Î¥¢¥Ã¥×¥í¡¼¥É');
+define('_MD_IMGDELETE','ºï½ü');
+define('_MD_ADDSKINIMG','¥¹¥­¥ó¥¤¥á¡¼¥¸¥Õ¥¡¥¤¥ë¤ÎÄÉ²Ã');
+define('_MD_BLOCKHTML', '¥Ö¥í¥Ã¥¯HTML');
+define('_MD_IMAGES', '¥¤¥á¡¼¥¸');
+define('_MD_NOZLIB', '¥µ¡¼¥Ð¤Ç Zlib ¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ëÉ¬Í×¤¬¤¢¤ê¤Þ¤¹¡£');
+define('_MD_LASTIMP', 'Last Imported');  //[MADA]
+define('_MD_FILENEWER', 'A newer file that has not been imported yet exists under the <b>templates</b> directory.');  //[MADA]
+define('_MD_FILEIMPORT', 'An older file that has not been imported yet exists under the <b>templates</b> directory.');  //[MADA]
+define('_MD_FILEGENER', 'Template file does not eixst. It can be generated (copied from the <b>default</b> template), uploaded, or imported from the <b>templates</b> directory.');  //[MADA]
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/users.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/users.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/users.php	(revision 405)
@@ -0,0 +1,57 @@
+<?php
+//%%%%%%	Admin Module Name  Users 	%%%%%
+define("_AM_DBUPDATED",_MD_AM_DBUPDATED);
+
+define("_AM_AYSYWTDU","¥æ¡¼¥¶Ì¾<b>%s</b>¤Î¥¢¥«¥¦¥ó¥È¤òºï½ü¤·¤Æ¤â¤¤¤¤¤Ç¤¹¤«¡©");
+define("_AM_BYTHIS","¥¢¥«¥¦¥ó¥È¤òºï½ü¤·¤¿¾ì¹ç¡¢¤³¤Î¥æ¡¼¥¶¤ÎÁ´¤Æ¤Î¾ðÊó¤¬¼º¤ï¤ì¤Þ¤¹¡£");
+define("_AM_YES","¤Ï¤¤");
+define("_AM_NO","¤¤¤¤¤¨");
+define("_AM_YMCACF","É¬Í×¤Ê¥Ç¡¼¥¿¤òÁ´¤ÆÆþÎÏ¤·¤Æ¤¯¤À¤µ¤¤¡£");
+define("_AM_CNRNU","¿·µ¬¥æ¡¼¥¶¤òÅÐÏ¿¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£");
+define("_AM_EDEUSER","¥æ¡¼¥¶¤ÎÊÔ½¸¡¿ºï½ü");
+define("_AM_NICKNAME","¥æ¡¼¥¶Ì¾");
+define("_AM_MODIFYUSER","¥æ¡¼¥¶¤ÎÊÔ½¸");
+define("_AM_DELUSER","¥æ¡¼¥¶¤Îºï½ü");
+define("_AM_GO","Á÷¿®");
+define("_AM_ADDUSER","¿·µ¬¥¢¥«¥¦¥ó¥ÈºîÀ®");
+define("_AM_NAME","Ì¾Á°");
+define("_AM_EMAIL","¥á¡¼¥ë¥¢¥É¥ì¥¹");
+define("_AM_OPTION","¥ª¥×¥·¥ç¥ó");
+define("_AM_AVATAR","¥¢¥Ð¥¿¡¼");
+define("_AM_THEME","¥Æ¡¼¥Þ");
+define("_AM_AOUTVTEAD","¤³¤Î¥á¡¼¥ë¥¢¥É¥ì¥¹¤ò¸ø³«¤¹¤ë");
+define("_AM_URL","¥Û¡¼¥à¥Ú¡¼¥¸");
+define("_AM_ICQ","ICQ");
+define("_AM_AIM","AIM");
+define("_AM_YIM","YIM");
+define("_AM_MSNM","MSNM");
+define("_AM_LOCATION","µï½»ÃÏ");
+define("_AM_OCCUPATION","¿¦¶È");
+define("_AM_INTEREST","¼ñÌ£");
+define("_AM_RANK","¥é¥ó¥¯");
+define("_AM_NSRA","ÆÃÊÌ¥é¥ó¥¯¤ÏÀßÄê¤µ¤ì¤Æ¤¤¤Þ¤»¤ó");
+define("_AM_NSRID","ÆÃÊÌ¥é¥ó¥¯¤ÎÀßÄê¤¬¤¢¤ê¤Þ¤»¤ó");
+define("_AM_ACCESSLEV","¥¢¥¯¥»¥¹¥ì¥Ù¥ë");
+define("_AM_SIGNATURE","½ðÌ¾");
+define("_AM_PASSWORD","¥Ñ¥¹¥ï¡¼¥É");
+define("_AM_INDICATECOF","* ¤ÏÉ¬¿Ü¹àÌÜ¤Ç¤¹");
+define("_AM_NOTACTIVE","¤³¤Î¥æ¡¼¥¶¤ÏÈó¥¢¥¯¥Æ¥£¥Ö¤Ç¤¹¡£º£¤¹¤°¥¢¥¯¥Æ¥£¥Ö¤Ë¤·¤Þ¤¹¤«¡©");
+define("_AM_UPDATEUSER","¥æ¡¼¥¶¾ðÊó¤ÎÊÔ½¸");
+define("_AM_USERINFO","¥æ¡¼¥¶´ðËÜ¾ðÊó");
+define("_AM_USERID","¥æ¡¼¥¶ID");
+define("_AM_RETYPEPD","¥Ñ¥¹¥ï¡¼¥É³ÎÇ§");
+define("_AM_CHANGEONLY","¡ÊÊÑ¹¹¤¹¤ë¾ì¹ç¤Î¤ß¡Ë");
+define("_AM_USERPOST","¥æ¡¼¥¶Åê¹Æ¾ðÊó");
+define("_AM_STORIES","Stories");  //[MADA]
+define("_AM_COMMENTS","Åê¹Æ¿ô");
+define("_AM_PTBBTSDIYT","¾åµ­¥Ç¡¼¥¿¤¬¸í¤Ã¤Æ¤¤¤ë¤È»×¤ï¤ì¤ë¾ì¹ç¤Ï¡¢²¼µ­¥Ü¥¿¥ó¤ò²¡¤¹¤È¤³¤È¤Ë¤è¤ê¥Ç¡¼¥¿¤ÎºÆ½¸·×¤ò¹Ô¤¨¤Þ¤¹¡£");
+define("_AM_SYNCHRONIZE","ºÆ½¸·×¤ò¹Ô¤¦");
+define("_AM_USERDONEXIT","³ºÅö¤¹¤ë¥æ¡¼¥¶¾ðÊó¤¬¤¢¤ê¤Þ¤»¤ó");
+define("_AM_STNPDNM","¥Ñ¥¹¥ï¡¼¥É¤¬Àµ¤·¤¯¤¢¤ê¤Þ¤»¤ó¡£Æ±¤¸¥Ñ¥¹¥ï¡¼¥É¤òÆóÅÙÆþÎÏ¤·¤Æ¤¯¤À¤µ¤¤¡£");
+define("_AM_CNGTCOM","Åê¹Æ¿ô¤ò¼èÆÀ¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿");
+define("_AM_CNGTST","Could not get total stories");  //[MADA]
+define("_AM_CNUUSER","¥æ¡¼¥¶¾ðÊó¤ò¹¹¿·¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿");
+define("_AM_CNGUSERID","¥æ¡¼¥¶ID¤ò¼èÆÀ¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿");
+define("_AM_LIST","°ìÍ÷");
+define("_AM_NOUSERS", "¥æ¡¼¥¶¤¬ÁªÂò¤µ¤ì¤Æ¤¤¤Þ¤»¤ó");
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/avatars.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/avatars.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/avatars.php	(revision 405)
@@ -0,0 +1,12 @@
+<?php
+// $Id
+//%%%%%% Avatar Manager %%%%%
+define('_MD_AVATARMAN','¥¢¥Ð¥¿¡¼¡¦¥Þ¥Í¥¸¥ã¡¼');
+
+define('_MD_SYSAVATARS','¥·¥¹¥Æ¥à¥¢¥Ð¥¿¡¼');
+define('_MD_CSTAVATARS','¥«¥¹¥¿¥à¥¢¥Ð¥¿¡¼');
+define('_MD_ADDAVT','¥¢¥Ð¥¿¡¼¤òÄÉ²Ã');
+define('_MD_USERS','¤³¤Î¥¢¥Ð¥¿¡¼¤ò»ÈÍÑÃæ¤Î¥æ¡¼¥¶¿ô');
+define('_MD_RUDELIMG','ËÜÅö¤Ë¤³¤Î¥¢¥Ð¥¿¡¼²èÁü¤òºï½ü¤·¤Æ¤â¤è¤í¤·¤¤¤Ç¤¹¤«¡©');
+define('_MD_FAILDEL', '¥¢¥Ð¥¿¡¼¤Îºï½ü¤¬¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡§ %s');
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/preferences.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/preferences.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/preferences.php	(revision 405)
@@ -0,0 +1,184 @@
+<?php
+//%%%%%%	Admin Module Name  AdminGroup 	%%%%%
+// dont change
+define("_AM_DBUPDATED",_MD_AM_DBUPDATED);
+
+define("_MD_AM_SITEPREF","¥µ¥¤¥È°ìÈÌÀßÄê");
+define("_MD_AM_SITENAME","¥µ¥¤¥ÈÌ¾");
+define("_MD_AM_SLOGAN","¥µ¥¤¥ÈÉûÂê");
+define("_MD_AM_ADMINML","´ÉÍý¼Ô¥á¡¼¥ë¥¢¥É¥ì¥¹");
+define("_MD_AM_LANGUAGE","»ÈÍÑ¸À¸ì");
+define("_MD_AM_STARTPAGE","³«»Ï¥â¥¸¥å¡¼¥ë");
+define("_MD_AM_NONE","¤Ê¤·");
+define("_MD_AM_SERVERTZ","¥µ¡¼¥Ð¤Î¥¿¥¤¥à¥¾¡¼¥ó");
+define("_MD_AM_DEFAULTTZ","¥Ç¥Õ¥©¥ë¥È¡¦¥¿¥¤¥à¥¾¡¼¥ó");
+define("_MD_AM_DTHEME","¥Ç¥Õ¥©¥ë¥È¡¦¥µ¥¤¥È¥Æ¡¼¥Þ");
+define("_MD_AM_THEMESET","¥Æ¡¼¥Þ¡¦¥»¥Ã¥È");
+define("_MD_AM_ANONNAME","Ì¤ÅÐÏ¿¥æ¡¼¥¶¤ÎÉ½¼¨Ì¾");
+define("_MD_AM_ANONPOST","Ì¤ÅÐÏ¿¥æ¡¼¥¶¤ÎÅê¹Æ¤òµö²Ä¤¹¤ë");
+define("_MD_AM_MINPASS","¥Ñ¥¹¥ï¡¼¥É¤ÎºÇÄãÊ¸»ú¿ô");
+define("_MD_AM_NEWUNOTIFY","¿·µ¬¥æ¡¼¥¶ÅÐÏ¿¤ÎºÝ¤Ë¥á¡¼¥ë¤Ë¤ÆÃÎ¤é¤»¤ò¼õ¤±¼è¤ë");
+define("_MD_AM_SELFDELETE","¥æ¡¼¥¶¤¬¼«Ê¬¼«¿È¤Î¥¢¥«¥¦¥ó¥È¤òºï½ü¤Ç¤­¤ë");
+define("_MD_AM_LOADINGIMG","¡Öloading..¡×²èÁü¤òÉ½¼¨¤µ¤»¤ë");
+define("_MD_AM_USEGZIP","gzip°µ½Ì¤ò»ÈÍÑ¤¹¤ë");
+define("_MD_AM_UNAMELVL","¥æ¡¼¥¶Ì¾¤È¤·¤Æ»ÈÍÑ²ÄÇ½¤ÊÊ¸»ú¤ÎÀßÄê¤ò¹Ô¤¤¤Þ¤¹¡£Ê¸»úÀ©¸Â¤ÎÄøÅÙ¤òÁªÂò¤·¤Æ¤¯¤À¤µ¤¤¡£");
+define("_MD_AM_STRICT","¶¯¡Ê¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È¤ª¤è¤Ó¿ô»ú¤Î¤ß¡Ë¢«¿ä¾©");
+define("_MD_AM_MEDIUM","Ãæ");
+define("_MD_AM_LIGHT","¼å¡Ê´Á»ú¡¦Ê¿²¾Ì¾¤â»ÈÍÑ²Ä¡Ë");
+define("_MD_AM_USERCOOKIE","¥æ¡¼¥¶Ì¾¤ÎÊÝÂ¸¤Ë»ÈÍÑ¤¹¤ë¥¯¥Ã¥­¡¼¤ÎÌ¾¾Î");
+define("_MD_AM_USERCOOKIEDSC","¤³¤Î¥¯¥Ã¥­¡¼¤Ë¤Ï¥æ¡¼¥¶Ì¾¤Î¤ß¤¬ÊÝÂ¸¤µ¤ì¡¢¥æ¡¼¥¶¤ÎPC¤Î¥Ï¡¼¥É¥Ç¥£¥¹¥¯Ãæ¤Ë1Ç¯´ÖÊÝ´É¤µ¤ì¤Þ¤¹¡£¤³¤Î¥¯¥Ã¥­¡¼¤ò»ÈÍÑ¤¹¤ë¤«¤·¤Ê¤¤¤«¤Ï¥æ¡¼¥¶¼«¿È¤¬ÁªÂò¤Ç¤­¤Þ¤¹¡£");//This cookie contains only a user name and is saved in a user pc for a year (if the user wishes). If a user have this cookie, username will be automatically inserted in the login box.");
+define("_MD_AM_USEMYSESS","¥»¥Ã¥·¥ç¥ó¤ÎÀßÄê¤ò¥«¥¹¥¿¥Þ¥¤¥º¤¹¤ë");
+define("_MD_AM_USEMYSESSDSC","¥»¥Ã¥·¥ç¥ó¤ÎÀßÄê¤Î¥«¥¹¥¿¥Þ¥¤¥º¡Ê¥»¥Ã¥·¥ç¥ó¤¬¥¿¥¤¥à¥¢¥¦¥È¤¹¤ë¤Þ¤Ç¤Î»þ´Ö¤ÎÀßÄê¤ä¡¢¥»¥Ã¥·¥ç¥óÌ¾¤ÎÊÑ¹¹¡Ë¤ò¹Ô¤¨¤Þ¤¹");
+
+define("_MD_AM_SESSNAME","¥»¥Ã¥·¥ç¥óID¤ÎÊÝÂ¸¤Ë»ÈÍÑ¤¹¤ë¥¯¥Ã¥­¡¼¤ÎÌ¾¾Î");
+define("_MD_AM_SESSNAMEDSC","¤³¤Î¥¯¥Ã¥­¡¼¤ËÊÝÂ¸¤µ¤ì¤ë¥»¥Ã¥·¥ç¥óID¤Ï¡¢¥»¥Ã¥·¥ç¥ó¤¬¥¿¥¤¥à¥¢¥¦¥È¤¹¤ë¤«¡¢¥æ¡¼¥¶¤¬¥í¥°¥¢¥¦¥È¤¹¤ë¤Þ¤Ç¤Î´ÖÍ­¸ú¤Ç¤¹¡£¡Ê¡Ö¥»¥Ã¥·¥ç¥ó¤ÎÀßÄê¤ò¥«¥¹¥¿¥Þ¥¤¥º¤¹¤ë¡×¤¬Í­¸ú¤Î¾ì¹ç¤Î¤ß¡Ë");
+define("_MD_AM_SESSEXPIRE","¥»¥Ã¥·¥ç¥ó¤¬¥¿¥¤¥à¥¢¥¦¥È¤¹¤ë¤Þ¤Ç¤Î»þ´Ö(Ã±°Ì¡§Ê¬¡Ë");
+define("_MD_AM_SESSEXPIREDSC","¥»¥Ã¥·¥ç¥ó¤¬¥¿¥¤¥à¥¢¥¦¥È¤¹¤ë¤Þ¤Ç¤Î»þ´Ö¤òÊ¬Ã±°Ì¤Ç»ØÄê¤·¤Æ¤¯¤À¤µ¤¤¡£¡Ê¡Ö¥»¥Ã¥·¥ç¥ó¤ÎÀßÄê¤ò¥«¥¹¥¿¥Þ¥¤¥º¤¹¤ë¡×¤¬Í­¸ú¤Î¾ì¹ç¤Î¤ß¡Ë");
+define("_MD_AM_BANNERS","¥Ð¥Ê¡¼¹­¹ð¤òÍ­¸ú¤Ë¤¹¤ë");
+//define("_MD_AM_ADMINGRAPHIC","´ÉÍý¼Ô¥á¥Ë¥å¡¼¤Ë¤ª¤¤¤Æ²èÁü¥á¥Ë¥å¡¼¤ò»ÈÍÑ¤·¤Þ¤¹¤«¡©");
+define("_MD_AM_MYIP","¤¢¤Ê¤¿¤ÎIP¥¢¥É¥ì¥¹¤òÆþÎÏ¤·¤Æ¤¯¤À¤µ¤¤¡£");
+define("_MD_AM_MYIPDSC","¤³¤ÎIP¤Ï¡¢¥Ð¥Ê¡¼¤Î¥¤¥ó¥×¥ì¥Ã¥·¥ç¥ó¤ª¤è¤Ó¥µ¥¤¥ÈÅý·×¤Ë¤ª¤¤¤Æ¥«¥¦¥ó¥È¤µ¤ì¤Þ¤»¤ó¡£");
+define("_MD_AM_ALWDHTML","Åê¹ÆÊ¸¤ÎÃæ¤Ç»ÈÍÑ²ÄÇ½¤ÊHTML¥¿¥°");
+define("_MD_AM_INVLDMINPASS","¥Ñ¥¹¥ï¡¼¥É¤ÎºÇÄãÊ¸»ú¿ô¤¬Àµ¤·¤¯¤¢¤ê¤Þ¤»¤ó¡£");
+define("_MD_AM_INVLDUCOOK","¥æ¡¼¥¶¥¯¥Ã¥­¡¼¤ÎÌ¾¾Î¤¬Àµ¤·¤¯¤¢¤ê¤Þ¤»¤ó¡£");
+define("_MD_AM_INVLDSCOOK","¥»¥Ã¥·¥ç¥óID¥¯¥Ã¥­¡¼¤ÎÌ¾¾Î¤¬Àµ¤·¤¯¤¢¤ê¤Þ¤»¤ó¡£");
+define("_MD_AM_INVLDSEXP","¥»¥Ã¥·¥ç¥ó¤Î¥¿¥¤¥à¥¢¥¦¥È»þ´Ö¤¬Àµ¤·¤¯¤¢¤ê¤Þ¤»¤ó¡£");
+define("_MD_AM_ADMNOTSET","´ÉÍý¼Ô¤Î¥á¡¼¥ë¥¢¥É¥ì¥¹¤¬ÀßÄê¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
+define("_MD_AM_YES","¤Ï¤¤");
+define("_MD_AM_NO","¤¤¤¤¤¨");
+define("_MD_AM_DONTCHNG","°Ê²¼¤ÏÀäÂÐ¤ËÊÑ¹¹¤·¤Ê¤¤¤Ç²¼¤µ¤¤");
+define("_MD_AM_REMEMBER","¤³¤Î¥Õ¥¡¥¤¥ë¤ò¥¦¥§¥Ö¾å¤Î´ÉÍý¼Ô²èÌÌ¤«¤éÊÔ½¸¤Ç¤­¤ë¤è¤¦¤Ë¤¹¤ë¤Ë¤Ï¡¢¤³¤Î¥Õ¥¡¥¤¥ë¤Î¥¢¥¯¥»¥¹¸¢¸Â¤ò666¡Êchmod 666¡Ë¤ËÀßÄê¤¹¤ëÉ¬Í×¤¬¤¢¤ê¤Þ¤¹¡£");
+define("_MD_AM_IFUCANT","¤â¤·¥Õ¥¡¥¤¥ë¤Î¥¢¥¯¥»¥¹¸¢¸Â¤òÊÑ¹¹¤Ç¤­¤Ê¤¤¾ì¹ç¤Ï¡¢¤³¤Î¥Õ¥¡¥¤¥ë¤òÄ¾ÀÜÊÔ½¸¤·¤Æ¤¯¤À¤µ¤¤¡£");
+
+define("_MD_AM_COMMODE","¥Ç¥Õ¥©¥ë¥È¤Î¥³¥á¥ó¥ÈÉ½¼¨¥â¡¼¥É");
+define("_MD_AM_COMORDER","¥Ç¥Õ¥©¥ë¥È¤Î¥³¥á¥ó¥ÈÉ½¼¨½ç");
+//define("_MD_AM_ALLOWSIG","¥³¥á¥ó¥ÈÊ¸¤Ë¤ª¤¤¤Æ½ðÌ¾¤Î»ÈÍÑ¤òµö²Ä¤¹¤ë");
+define("_MD_AM_ALLOWHTML","¥³¥á¥ó¥ÈÊ¸¤Ë¤ª¤¤¤ÆHTML¥¿¥°¤Î»ÈÍÑ¤òµö²Ä¤¹¤ë");
+define("_MD_AM_DEBUGMODE","¥Ç¥Ð¥Ã¥°¥â¡¼¥É¤òÍ­¸ú¤Ë¤¹¤ë");
+define("_MD_AM_DEBUGMODEDSC","¡Ê¥Ç¥Ð¥Ã¥°ÍÑ¤Ë»ÈÍÑ¤·¤Æ¤¯¤À¤µ¤¤¡£¼ÂºÝ¤Î¥µ¥¤¥È±¿±Ä»þ¤Ë¤Ï²ò½ü¤·¤Æ¤¯¤À¤µ¤¤¡£¡Ë");
+
+define("_MD_AM_AVATARALLOW","¥¢¥Ð¥¿¡¼²èÁü¤Î¥¢¥Ã¥×¥í¡¼¥É¤òµö²Ä¤¹¤ë");
+define('_MD_AM_AVATARMP','¥¢¥Ð¥¿¡¼¥¢¥Ã¥×¥í¡¼¥É¸¢¤òÆÀ¤ë¤¿¤á¤ÎÈ¯¸À¿ô');
+define('_MD_AM_AVATARMPDSC','¥æ¡¼¥¶¤¬¼«Ê¬¤ÇºîÀ®¤·¤¿¥¢¥Ð¥¿¡¼¤ò¥¢¥Ã¥×¥í¡¼¥É¤¹¤ë¤¿¤á¤ËÉ¬Í×¤ÊºÇÄãÅê¹Æ¿ô¤òÀßÄê¤·¤Æ¤¯¤À¤µ¤¤¡£');
+define("_MD_AM_AVATARW","¥¢¥Ð¥¿¡¼²èÁü¤ÎºÇÂçÉý(¥Ô¥¯¥»¥ë)");
+define("_MD_AM_AVATARH","¥¢¥Ð¥¿¡¼²èÁü¤ÎºÇÂç¹â¤µ(¥Ô¥¯¥»¥ë)");
+define("_MD_AM_AVATARMAX","¥¢¥Ð¥¿¡¼²èÁü¤ÎºÇÂç¥Õ¥¡¥¤¥ë¥µ¥¤¥º(¥Ð¥¤¥È)");
+define("_MD_AM_AVATARCONF","¥æ¡¼¥¶ÆÈ¼«¤Î¥¢¥Ð¥¿¡¼²èÁü¤Ë´Ø¤¹¤ëÀßÄê");
+define("_MD_AM_CHNGUTHEME","Á´¤Æ¤Î¥æ¡¼¥¶¤Î¥Æ¡¼¥Þ¤òÊÑ¹¹¤¹¤ë");
+define("_MD_AM_NOTIFYTO","ÄÌÃÎÀè¥°¥ë¡¼¥×");
+define("_MD_AM_ALLOWTHEME","¥µ¥¤¥È¥Æ¡¼¥Þ¤ÎÁªÂò¤òµö²Ä¤¹¤ë");
+
+define("_MD_AM_ALLOWIMAGE","Åê¹Æ¤Ø¤Î²èÁü¥Õ¥¡¥¤¥ë¤ÎÉ½¼¨¤òµö²Ä¤¹¤ë");
+
+define("_MD_AM_USERACTV","¥æ¡¼¥¶¼«¿È¤Î³ÎÇ§¤¬É¬Í×(¿ä¾©)");
+define("_MD_AM_AUTOACTV","¼«Æ°Åª¤Ë¥¢¥«¥¦¥ó¥È¤òÍ­¸ú¤Ë¤¹¤ë");
+define("_MD_AM_ADMINACTV","´ÉÍý¼Ô¤¬³ÎÇ§¤·¤Æ¥¢¥«¥¦¥ó¥È¤òÍ­¸ú¤Ë¤¹¤ë");
+define("_MD_AM_ACTVTYPE","¿·µ¬ÅÐÏ¿¥æ¡¼¥¶¥¢¥«¥¦¥ó¥È¤ÎÍ­¸ú²½¤ÎÊýË¡");
+define("_MD_AM_ACTVGROUP","¥¢¥«¥¦¥ó¥ÈÍ­¸ú²½°ÍÍê¤Î¥á¡¼¥ë¤ÎÁ÷¿®Àè¥°¥ë¡¼¥×");
+define("_MD_AM_ACTVGROUPDSC","¡Ö´ÉÍý¼Ô¤¬³ÎÇ§¤·¤Æ¥¢¥«¥¦¥ó¥È¤òÍ­¸ú¤Ë¤¹¤ë¡×ÀßÄê¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¤Î¤ßÍ­¸ú¤Ç¤¹");
+define('_MD_AM_USESSL', '¥í¥°¥¤¥ó¤ËSSL¤ò»ÈÍÑ¤¹¤ë');
+define('_MD_AM_SSLPOST', 'SSL¥í¥°¥¤¥ó»þ¤Ë»ÈÍÑ¤¹¤ëPOSTÊÑ¿ô¤ÎÌ¾¾Î');
+define('_MD_AM_DEBUGMODE0','¥ª¥Õ');
+define('_MD_AM_DEBUGMODE1','PHP¥Ç¥Ð¥°');
+define('_MD_AM_DEBUGMODE2','MySQL/Blocks¥Ç¥Ð¥°');
+define('_MD_AM_DEBUGMODE3','Smarty¥Æ¥ó¥×¥ì¡¼¥È¡¦¥Ç¥Ð¥°');
+define('_MD_AM_MINUNAME', '¥æ¡¼¥¶Ì¾¤ÎºÇÄãÊ¸»ú¿ô(byte)');
+define('_MD_AM_MAXUNAME', '¥æ¡¼¥¶Ì¾¤ÎºÇÂçÊ¸»ú¿ô(byte)');
+define('_MD_AM_GENERAL', '°ìÈÌÀßÄê');
+define('_MD_AM_USERSETTINGS', '¥æ¡¼¥¶¾ðÊóÀßÄê');
+define('_MD_AM_ALLWCHGMAIL', '¥æ¡¼¥¶¼«¿È¤ÎEmail¥¢¥É¥ì¥¹ÊÑ¹¹¤òµö²Ä¤¹¤ë');
+define('_MD_AM_ALLWCHGMAILDSC', '');
+define('_MD_AM_IPBAN', 'IP Banning'); //[MADA]
+define('_MD_AM_BADEMAILS', '¥æ¡¼¥¶¤Îemail¥¢¥É¥ì¥¹¤È¤·¤Æ»ÈÍÑ¤Ç¤­¤Ê¤¤Ê¸»úÎó');
+define('_MD_AM_BADEMAILSDSC', '¤½¤ì¤¾¤ì¤ÎÊ¸»úÎó¤Î´Ö¤Ï<b>|</b>¤Ç¶èÀÚ¤Ã¤Æ¤¯¤À¤µ¤¤¡£ÂçÊ¸»ú¾®Ê¸»ú¤Ï¶èÊÌ¤·¤Þ¤»¤ó¡£Àµµ¬É½¸½¤¬»ÈÍÑ²ÄÇ½¤Ç¤¹¡£');
+define('_MD_AM_BADUNAMES', '¥æ¡¼¥¶Ì¾¤È¤·¤Æ»ÈÍÑ¤Ç¤­¤Ê¤¤Ê¸»úÎó');
+define('_MD_AM_BADUNAMESDSC', '¤½¤ì¤¾¤ì¤ÎÊ¸»úÎó¤Î´Ö¤Ï<b>|</b>¤Ç¶èÀÚ¤Ã¤Æ¤¯¤À¤µ¤¤¡£ÂçÊ¸»ú¾®Ê¸»ú¤Ï¶èÊÌ¤·¤Þ¤»¤ó¡£Àµµ¬É½¸½¤¬»ÈÍÑ²ÄÇ½¤Ç¤¹¡£');
+define('_MD_AM_DOBADIPS', 'IP¥¢¥¯¥»¥¹µñÈÝ¤òÍ­¸ú¤Ë¤·¤Þ¤¹¤«¡©');
+define('_MD_AM_DOBADIPSDSC', '¥¢¥¯¥»¥¹µñÈÝIP¤«¤é¤Î¥æ¡¼¥¶¤Ï¤¢¤Ê¤¿¤Î¥µ¥¤¥È¤Ë¤ÏÆþ¤ì¤Þ¤»¤ó¡£');
+define('_MD_AM_BADIPS', '¤³¤Î¥µ¥¤¥È¤Ø¤Î¥¢¥¯¥»¥¹µñÈÝIP¤òÆþ¤ì¤Æ¤¯¤À¤µ¤¤¡£<br />IP¤ÈIP¤Î´Ö¤Ï<b>|</b>¤Ç¶èÀÚ¤Ã¤Æ¤¯¤À¤µ¤¤¡£ÂçÊ¸»ú¾®Ê¸»ú¤Ï¶èÊÌ¤·¤Þ¤»¤ó¡£Àµµ¬É½¸½¤¬»ÈÍÑ²ÄÇ½¤Ç¤¹¡£');
+define('_MD_AM_BADIPSDSC', '^aaa.bbb.ccc ¤Ï ¤½¤ì¤Ç»Ï¤Þ¤ë IP¥¢¥É¥ì¥¹¤«¤é¤Î¥¢¥¯¥»¥¹¤òµñÈÝ¤·¤Þ¤¹¡£<br />aaa.bbb.ccc$ ¤Ï ¤½¤ì¤Ç½ª¤ï¤ë IP¥¢¥É¥ì¥¹¤«¤é¤Î¥¢¥¯¥»¥¹¤òµñÈÝ¤·¤Þ¤¹¡£<br />aaa.bbb.ccc ¤Ï¤½¤Î IP¥¢¥É¥ì¥¹¤ò´Þ¤à¥¢¥É¥ì¥¹¤«¤é¤Î¥¢¥¯¥»¥¹¤òµñÈÝ¤·¤Þ¤¹¡£');
+define('_MD_AM_PREFMAIN', '¥·¥¹¥Æ¥àÀßÄê¥á¥¤¥ó');
+define('_MD_AM_METAKEY', 'META¥¿¥°(¥­¡¼¥ï¡¼¥É)');
+define('_MD_AM_METAKEYDSC', 'META¥­¡¼¥ï¡¼¥É¤Ï¤¢¤Ê¤¿¤Î¥µ¥¤¥È¤ÎÆâÍÆ¤òÉ½¤¹¤â¤Î¤Ç¤¹¡£¥­¡¼¥ï¡¼¥É¤Ï¥«¥ó¥Þ¤Ç¶èÀÚ¤Ã¤Æµ­½Ò¤·¤Æ¤¯¤À¤µ¤¤¡£(Îã: XOOPS, PHP, mySQL, ¥Ý¡¼¥¿¥ë)');
+define('_MD_AM_METARATING', 'META¥¿¥°(RATING)');
+define('_MD_AM_METARATINGDSC', '±ÜÍ÷ÂÐ¾ÝÇ¯ÎðÁØ¤Î»ØÄê');
+define('_MD_AM_METAOGEN', 'General'); //[MADA]
+define('_MD_AM_METAO14YRS', '14 years'); //[MADA]
+define('_MD_AM_METAOREST', 'Restricted'); //[MADA]
+define('_MD_AM_METAOMAT', 'Mature'); //[MADA]
+define('_MD_AM_METAROBOTS', 'META¥¿¥°(ROBOTS)');
+define('_MD_AM_METAROBOTSDSC', '¥í¥Ü¥Ã¥È·¿¸¡º÷¥¨¥ó¥¸¥ó¤Ø¤ÎÂÐ±þ');
+define('_MD_AM_INDEXFOLLOW', 'Index, Follow'); //[MADA]
+define('_MD_AM_NOINDEXFOLLOW', 'No Index, Follow'); //[MADA]
+define('_MD_AM_INDEXNOFOLLOW', 'Index, No Follow'); //[MADA]
+define('_MD_AM_NOINDEXNOFOLLOW', 'No Index, No Follow'); //[MADA]
+define('_MD_AM_METAAUTHOR', 'META¥¿¥°(ºîÀ®¼Ô)');
+define('_MD_AM_METAAUTHORDSC', 'ºîÀ®¼ÔMETA¥¿¥°¤Ï¡¢¥µ¥¤¥ÈÊ¸½ñ¤ÎºîÀ®¼Ô¾ðÊó¤òÄêµÁ¤·¤Þ¤¹¡£Ì¾Á°¡¢Webmaster¤ÎEMail¥¢¥É¥ì¥¹¡¢²ñ¼ÒÌ¾¡¢URL¤Ê¤É¤òµ­½Ò¤·¤Þ¤¹¡£');
+define('_MD_AM_METACOPYR', 'META¥¿¥°(¥³¥Ô¡¼¥é¥¤¥È)');
+define('_MD_AM_METACOPYRDSC', 'META¥³¥Ô¡¼¥é¥¤¥È¥¿¥°¤Ï¡¢¤¢¤Ê¤¿¤Î¥µ¥¤¥È¾å¤Î¾ðÊó¤ËÂÐ¤¹¤ë¤ÎÃøºî¸¢¾ðÊó¤òÄêµÁ¤·¤Þ¤¹¡£');
+define('_MD_AM_METADESC', 'META¥¿¥°(Description)');
+define('_MD_AM_METADESCDSC', 'META¥¿¥°(Description) ¤Ï¡¢¤¢¤Ê¤¿¤Î¥µ¥¤¥È¤ÎÆâÍÆ¤òÀâÌÀ¤¹¤ë°ìÈÌÅª¤Ê¥¿¥°¤Ç¤¹¡£');
+define('_MD_AM_METAFOOTER', 'META¥¿¥°/¥Õ¥Ã¥¿ÀßÄê');
+define('_MD_AM_FOOTER', '¥Õ¥Ã¥¿');
+define('_MD_AM_FOOTERDSC', '¥ê¥ó¥¯¤òµ­Æþ¤¹¤ë¾ì¹ç¤ÏÉ¬¤º¥Õ¥ë¥Ñ¥¹¡Êhttp://¡Á¡Ë¤ÇÆþÎÏ¤·¤Æ¤¯¤À¤µ¤¤¡£¥Õ¥ë¥Ñ¥¹¤ÇÆþÎÏ¤·¤Ê¤«¤Ã¤¿¾ì¹ç¡¢¥â¥¸¥å¡¼¥ëÆâ¥Ú¡¼¥¸¤Ç¤¦¤Þ¤¯É½¼¨¤µ¤ì¤Ê¤¤¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£');
+define('_MD_AM_CENSOR', '¶Ø»ßÍÑ¸ìÀßÄê');
+define('_MD_AM_DOCENSOR', '¶Ø»ßÍÑ¸ì½èÍý¤òÍ­¸ú¤Ë¤¹¤ë');
+define('_MD_AM_DOCENSORDSC', '¤³¤Î¥ª¥×¥·¥ç¥ó¤òÍ­¸ú¤Ë¤¹¤ë¤È¶Ø»ßÍÑ¸ì¤Î¥Á¥§¥Ã¥¯¤ò¹Ô¤¦¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£¤³¤Î¥ª¥×¥·¥ç¥ó¤òÌµ¸ú¤Ë¤¹¤ë¤³¤È¤Ç¥µ¥¤¥È¤Î½èÍýÂ®ÅÙ¤¬¸þ¾å¤¹¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£');
+define('_MD_AM_CENSORWRD', '¶Ø»ßÍÑ¸ì');
+define('_MD_AM_CENSORWRDDSC', '¥æ¡¼¥¶¤¬Åê¹Æ¤¹¤ëºÝ¤Ë»ÈÍÑ¤ò¶Ø»ß£ó¤¹¤ëÊ¸»úÎó¤òÆþÎÏ¤·¤Æ¤¯¤À¤µ¤¤¡£Ê¸»úÎó¤ÈÊ¸»úÎó¤Î´Ö¤Ï <br /> <b>|</b> ¤Ç¶èÀÚ¤ê¡¢ÂçÊ¸»ú¾®Ê¸»ú¤Ï¶èÊÌ¤·¤Þ¤»¤ó¡£');
+define('_MD_AM_CENSORRPLC', '¶Ø»ßÍÑ¸ì¤òÃÖ¤­´¹¤¨¤ëÊ¸»úÎó:');
+define('_MD_AM_CENSORRPLCDSC', '¶Ø»ßÍÑ¸ì¤¬¤³¤Î¥Æ¥­¥¹¥È¥Ü¥Ã¥¯¥¹¤Ç»ØÄê¤·¤¿Ê¸»úÎó¤ËÃÖ¤­´¹¤¨¤é¤ì¤Þ¤¹¡£');
+
+define('_MD_AM_SEARCH', '¸¡º÷¥ª¥×¥·¥ç¥ó');
+define('_MD_AM_DOSEARCH', '¥°¥í¡¼¥Ð¥ë¥µ¡¼¥Á¤òÍ­¸ú¤Ë¤¹¤ë');
+define('_MD_AM_DOSEARCHDSC', '¥µ¥¤¥ÈÆâ¤ÎÅê¹Æ/µ­»ö¤ÎÁ´¸¡º÷¤ò¹Ô¤¤¤Þ¤¹¡£');
+define('_MD_AM_MINSEARCH', '¥­¡¼¥ï¡¼¥ÉºÇÄãÊ¸»ú¿ô');
+define('_MD_AM_MINSEARCHDSC', '¥æ¡¼¥¶¤¬¸¡º÷¤ò¹Ô¤¦ºÝ¤ËÉ¬Í×¤Ê¥­¡¼¥ï¡¼¥É¤ÎºÇÄãÊ¸»ú¿ô¤ò»ØÄê¤·¤Æ¤¯¤À¤µ¤¤¡£');
+define('_MD_AM_MODCONFIG', '¥â¥¸¥å¡¼¥ëÀßÄê¥ª¥×¥·¥ç¥ó');
+define('_MD_AM_DSPDSCLMR', 'ÍøÍÑµöÂúÊ¸¤òÉ½¼¨¤¹¤ë');
+define('_MD_AM_DSPDSCLMRDSC', '¡Ö¤Ï¤¤¡×¤Ë¤¹¤ë¤È¥æ¡¼¥¶¤Î¿·µ¬ÅÐÏ¿¥Ú¡¼¥¸¤ËÍøÍÑµöÂú¤ÎÊ¸¾Ï¤òÉ½¼¨¤·¤Þ¤¹¡£');
+define('_MD_AM_REGDSCLMR', 'ÍøÍÑµöÂúÊ¸');
+define('_MD_AM_REGDSCLMRDSC', '¥æ¡¼¥¶¤Î¿·µ¬ÅÐÏ¿¥Ú¡¼¥¸¤ËÉ½¼¨¤¹¤ëÍøÍÑµöÂúÊ¸¤òÆþÎÏ¤·¤Æ¤¯¤À¤µ¤¤¡£');
+define('_MD_AM_ALLOWREG', '¿·µ¬¥æ¡¼¥¶¤ÎÅÐÏ¿¤òµö²Ä¤¹¤ë');
+define('_MD_AM_ALLOWREGDSC', '¡Ö¤Ï¤¤¡×¤òÁªÂò¤¹¤ë¤È¿·µ¬¥æ¡¼¥¶¤ÎÅÐÏ¿¤òµö²Ä¤·¤Þ¤¹¡£');
+define('_MD_AM_THEMEFILE', 'themes/ ¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤Î¼«Æ°¥¢¥Ã¥×¥Ç¡¼¥È¤òÍ­¸ú¤Ë¤¹¤ë');
+define('_MD_AM_THEMEFILEDSC', '¸½ºß»ÈÍÑÃæ¤Î¥Æ¡¼¥Þ¤è¤ê¤â¹¹¿·Æü»þ¤¬¿·¤·¤¤¥Õ¥¡¥¤¥ë¤¬ themes/¥Ç¥£¥ì¥¯¥È¥ê²¼¤Ë¤¢¤ë¾ì¹ç¤Ë¡¢¼«Æ°Åª¤Ë¥Ç¡¼¥¿¥Ù¡¼¥¹Æâ¤Î¥Ç¡¼¥¿¤ò¹¹¿·¤·¤Þ¤¹¡£¥µ¥¤¥È¸ø³«»þ¤Ë¤ÏÌµ¸ú¤Ë¤¹¤ë»ö¤ò¤ª´«¤á¤·¤Þ¤¹¡£');
+define('_MD_AM_CLOSESITE', '¥µ¥¤¥È¤òÊÄº¿¤¹¤ë');
+define('_MD_AM_CLOSESITEDSC', 'ÆÃÄê¥°¥ë¡¼¥×°Ê³°¤Ï¥µ¥¤¥È¤Ë¥¢¥¯¥»¥¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¤è¤¦¤Ë¤·¤Þ¤¹¡£');
+define('_MD_AM_CLOSESITEOK', '¥µ¥¤¥ÈÊÄº¿»þ¤Ç¤â¥¢¥¯¥»¥¹¤¬Ç§¤á¤é¤ì¤Æ¤¤¤ë¥°¥ë¡¼¥×');
+define('_MD_AM_CLOSESITEOKDSC', '¥Ç¥Õ¥©¥ë¥È¤Î´ÉÍý¼Ô¥°¥ë¡¼¥×¤Ï¾ï¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤Þ¤¹');
+define('_MD_AM_CLOSESITETXT', '¥µ¥¤¥ÈÊÄº¿¤ÎÍýÍ³');
+define('_MD_AM_CLOSESITETXTDSC', '¥µ¥¤¥ÈÊÄº¿»þ¤ËÉ½¼¨¤·¤Þ¤¹');
+define('_MD_AM_SITECACHE', '¥µ¥¤¥È¡¦¥­¥ã¥Ã¥·¥å');
+define('_MD_AM_SITECACHEDSC', '¥µ¥¤¥ÈÆâ¤Î¥³¥ó¥Æ¥ó¥Ä¤ò¥â¥¸¥å¡¼¥ëÊÌ¤Ë¥­¥ã¥Ã¥·¥å¤·¤Þ¤¹¡£¥µ¥¤¥È¡¦¥­¥ã¥Ã¥·¥å¤Ï¡¢¥â¥¸¥å¡¼¥ëÆÈ¼«¤Î¥­¥ã¥Ã¥·¥åµ¡Ç½¡Ê¤¢¤ë¾ì¹ç¡Ë¤è¤ê¤âÍ¥Àè¤µ¤ì¤Þ¤¹¡£'); //[MADA]
+define('_MD_AM_MODCACHE', '¥â¥¸¥å¡¼¥ë¡¦¥­¥ã¥Ã¥·¥å');
+define('_MD_AM_MODCACHEDSC', '³Æ¥â¥¸¥å¡¼¥ë¤Î¥³¥ó¥Æ¥ó¥Ä¤ò¥­¥ã¥Ã¥·¥å¤·¤Æ¤ª¤¯»þ´Ö¤ÎÄ¹¤µ¤ò»ØÄê¤·¤Æ¤¯¤À¤µ¤¤¡£¥â¥¸¥å¡¼¥ë¤Ë´û¤Ë¥­¥ã¥Ã¥·¥åµ¡Ç½¤¬¤¢¤ë¾ì¹ç¤Ï¡Ö¥­¥ã¥Ã¥·¥å¤·¤Ê¤¤¡×¤òÁªÂò¤¹¤ë¤³¤È¤ò¤ª´«¤á¤·¤Þ¤¹¡£¥Ö¥í¥Ã¥¯¡¦¥­¥ã¥Ã¥·¥å¤Ï´Þ¤Þ¤ì¤Þ¤»¤ó¡£');
+define('_MD_AM_NOMODULE', '¥­¥ã¥Ã¥·¥å²ÄÇ½¤Ê¥â¥¸¥å¡¼¥ë¤Ï¤¢¤ê¤Þ¤»¤ó¡£');
+define('_MD_AM_DTPLSET', '¥Ç¥Õ¥©¥ë¥È¤Î¥Æ¥ó¥×¥ì¡¼¥È¡¦¥»¥Ã¥È');
+define('_MD_AM_SSLLINK', 'SSL¥í¥°¥¤¥ó¥Ú¡¼¥¸¤Ø¤ÎURL');
+
+// added for mailer
+define("_MD_AM_MAILER","¥á¡¼¥ëÀßÄê");
+define("_MD_AM_MAILER_MAIL","");
+define("_MD_AM_MAILER_SENDMAIL","");
+define("_MD_AM_MAILER_","");
+define("_MD_AM_MAILFROM","Á÷¿®¼Ô¥á¡¼¥ë¥¢¥É¥ì¥¹");
+define("_MD_AM_MAILFROMDESC","");
+define("_MD_AM_MAILFROMNAME","Á÷¿®¼Ô");
+define("_MD_AM_MAILFROMNAMEDESC","¥á¡¼¥ëÁ÷¿®¤ÎºÝ¤ËÁ÷¿®¼Ô¤È¤·¤ÆÉ½¼¨¤µ¤ì¤ëÌ¾Á°¤òÆþÎÏ¤·¤Æ¤¯¤À¤µ¤¤");
+// RMV-NOTIFY
+define("_MD_AM_MAILFROMUID","PMÁ÷¿®¼Ô");
+define("_MD_AM_MAILFROMUIDDESC","¥×¥é¥¤¥Ù¡¼¥È¥á¥Ã¥»¡¼¥¸Á÷¿®¤ÎºÝ¤ËÁ÷¿®¼Ô¤È¤·¤Æ¥Ç¥Õ¥©¥ë¥ÈÉ½¼¨¤µ¤ì¤ë¥æ¡¼¥¶¤òÁªÂò¤·¤Æ¤¯¤À¤µ¤¤");
+define("_MD_AM_MAILERMETHOD","¥á¡¼¥ëÁ÷¿®ÊýË¡");
+define("_MD_AM_MAILERMETHODDESC","¥á¡¼¥ë¤òÁ÷¿®¤¹¤ëÊýË¡¤òÁªÂò¤·¤Æ¤¯¤À¤µ¤¤¡£¥Ç¥Õ¥©¥ë¥È¤Ç¤ÏPHP¤Îmail()´Ø¿ô¤ò»ÈÍÑ¤·¤Þ¤¹¡£");
+define("_MD_AM_SMTPHOST","SMTP¥µ¡¼¥Ð¥¢¥É¥ì¥¹");
+define("_MD_AM_SMTPHOSTDESC","SMTP¥µ¡¼¥Ð¤Î¥¢¥É¥ì¥¹¤Î°ìÍ÷¤òµ­Æþ¤·¤Æ¤¯¤À¤µ¤¤¡£");
+define("_MD_AM_SMTPUSER","SMTPAuth¥æ¡¼¥¶Ì¾");
+define("_MD_AM_SMTPUSERDESC","SMTPAuth¤ò»ÈÍÑ¤·¤ÆSMTP¥µ¡¼¥Ð¤Ë¥¢¥¯¥»¥¹¤¹¤ë¤¿¤á¤Î¥æ¡¼¥¶Ì¾");
+define("_MD_AM_SMTPPASS","SMTPAuth¥Ñ¥¹¥ï¡¼¥É");
+define("_MD_AM_SMTPPASSDESC","SMTPAuth¤ò»ÈÍÑ¤·¤ÆSMTP¥µ¡¼¥Ð¤Ë¥¢¥¯¥»¥¹¤¹¤ë¤¿¤á¤Î¥Ñ¥¹¥ï¡¼¥É");
+define("_MD_AM_SENDMAILPATH","sendmail¤Ø¤Î¥Ñ¥¹");
+define("_MD_AM_SENDMAILPATHDESC","sendmail¤Ø¤Î¥Õ¥ë¥Ñ¥¹¤òµ­Æþ¤·¤Æ¤¯¤À¤µ¤¤");
+define("_MD_AM_THEMEOK","ÁªÂò²ÄÇ½¤Ê¥Æ¡¼¥Þ");
+define("_MD_AM_THEMEOKDSC","¥æ¡¼¥¶¤¬ÁªÂò¤¹¤ë¤³¤È¤Î¤Ç¤­¤ë¥Æ¡¼¥Þ¥Õ¥¡¥¤¥ë¤ò»ØÄê¤·¤Æ¤¯¤À¤µ¤¤");
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/findusers.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/findusers.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/findusers.php	(revision 405)
@@ -0,0 +1,50 @@
+<?php
+//%%%%%%	File Name findusers.php 	%%%%%
+
+define("_AM_FINDUS","¥æ¡¼¥¶¸¡º÷");
+define("_AM_AVATAR","¥¢¥Ð¥¿¡¼");
+define("_AM_REALNAME","ËÜÌ¾");
+define("_AM_REGDATE","ÅÐÏ¿Æü»þ");
+define("_AM_EMAIL","Email");
+define("_AM_PM","PM");
+define("_AM_URL","URL");
+define("_AM_PREVIOUS","Á°");
+define("_AM_NEXT","¼¡");
+define("_AM_USERSFOUND","%s¿Í¤Î¥æ¡¼¥¶¤¬¸«¤Ä¤«¤ê¤Þ¤·¤¿");
+
+define("_AM_ACTUS", "¾µÇ§¤¬´°Î»¤·¤Æ¤¤¤ë¥æ¡¼¥¶¡§ %s¿Í");
+define("_AM_INACTUS", "¾µÇ§¤¬ºÑ¤ó¤Ç¤¤¤Ê¤¤¥æ¡¼¥¶¡§ %s¿Í");
+define("_AM_NOFOUND","¾ò·ï¤Ë¹ç¤¦¥æ¡¼¥¶¤¬¸«¤Ä¤«¤ê¤Þ¤»¤ó¤Ç¤·¤¿");
+define("_AM_UNAME","¥æ¡¼¥¶Ì¾");
+define("_AM_ICQ","ICQ¡ô");
+define("_AM_AIM","AOL¥¤¥ó¥¹¥¿¥ó¥È¥á¥Ã¥»¥ó¥¸¥ã¡¼");
+define("_AM_YIM","Yahoo!¥á¥Ã¥»¥ó¥¸¥ã¡¼");
+define("_AM_MSNM","MSN¥á¥Ã¥»¥ó¥¸¥ã¡¼");
+define("_AM_LOCATION","µï½»ÃÏ");
+define("_AM_OCCUPATION","¿¦¶È");
+define("_AM_INTEREST","¼ñÌ£");
+define("_AM_URLC","¥Û¡¼¥à¥Ú¡¼¥¸¤ÎURL");
+define("_AM_LASTLOGMORE","<span style='color:#ff0000;'>X</span>Æü°Ê¾å¥í¥°¥¤¥ó¤·¤Æ¤¤¤Ê¤¤");
+define("_AM_LASTLOGLESS","<span style='color:#ff0000;'>X</span>Æü°ÊÆâ¤Ë¥í¥°¥¤¥ó¤·¤Æ¤¤¤ë");
+define("_AM_REGMORE","¥æ¡¼¥¶ÅÐÏ¿Æü»þ¤¬<span style='color:#ff0000;'>X</span>Æü°Ê¾åÁ°");
+define("_AM_REGLESS","¥æ¡¼¥¶ÅÐÏ¿Æü»þ¤¬<span style='color:#ff0000;'>X</span>Æü°ÊÆâ");
+define("_AM_POSTSMORE","Åê¹Æ¿ô¤¬<span style='color:#ff0000;'>X</span>·ï°Ê¾å");
+define("_AM_POSTSLESS","Åê¹Æ¿ô¤¬<span style='color:#ff0000;'>X</span>·ï°ÊÆâ");
+define("_AM_SORT","¥½¡¼¥È¾ò·ï");
+define("_AM_ORDER","É½¼¨½ç");
+define("_AM_LASTLOGIN","ºÇ½ª¥í¥°¥¤¥óÆü»þ");
+define("_AM_POSTS","Åê¹Æ¿ô");
+define("_AM_ASC","¾º½ç");
+define("_AM_DESC","¹ß½ç");
+define("_AM_LIMIT","1¥Ú¡¼¥¸¤¢¤¿¤ê¤ËÉ½¼¨¤¹¤ë¥æ¡¼¥¶¿ô");
+define("_AM_RESULTS", "¸¡º÷·ë²Ì");
+define("_AM_SHOWMAILOK", "É½¼¨¤¹¤ë¥æ¡¼¥¶¤Î¥¿¥¤¥×");
+define("_AM_MAILOK","¥á¡¼¥ë¼õ¿®OK¤Î¥æ¡¼¥¶¤Î¤ß");
+define("_AM_MAILNG","¥á¡¼¥ë¼õ¿®NG¤Î¥æ¡¼¥¶¤Î¤ß");
+define("_AM_SHOWTYPE", "É½¼¨¤¹¤ë¥æ¡¼¥¶¤Î¼ïÎà");
+define("_AM_ACTIVE","¾µÇ§ºÑ¥æ¡¼¥¶¤Î¤ß");
+define("_AM_INACTIVE","¾µÇ§¤¬ºÑ¤ó¤Ç¤¤¤Ê¤¤¥æ¡¼¥¶¤Î¤ß");
+define("_AM_BOTH", "Á´¤Æ¤Î¥æ¡¼¥¶");
+define("_AM_SENDMAIL", "¥á¥Ã¥»¡¼¥¸¤òÁ÷¤ë");
+define("_AM_ADD2GROUP", "¥æ¡¼¥¶¤ò %s ¥°¥ë¡¼¥×¤Î¥á¥ó¥Ð¤Ë²Ã¤¨¤ë");
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/mailusers.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/mailusers.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/mailusers.php	(revision 405)
@@ -0,0 +1,37 @@
+<?php
+//%%%%%%	Admin Module Name  MailUsers	%%%%%
+define("_AM_DBUPDATED",_MD_AM_DBUPDATED);
+
+//%%%%%%	mailusers.php 	%%%%%
+define("_AM_SENDTOUSERS","Á÷¿®Àè¥æ¡¼¥¶¤ÎÁªÂò¡§");
+define("_AM_SENDTOUSERS2","Á÷¿®Àè:");
+define("_AM_GROUPIS","¥°¥ë¡¼¥×¡Ê¾ÊÎ¬²Ä¡Ë");
+define("_AM_TIMEFORMAT", "¡Êyyyy-mm-dd·Á¼°¤Çµ­Æþ¡¡¾ÊÎ¬²Ä¡Ë");
+define("_AM_LASTLOGMIN","ºÇ½ª¥í¥°¥¤¥óÆü»þ¤¬²¼µ­¤ÎÆü»þ¤è¤ê¤â¸å");
+define("_AM_LASTLOGMAX","ºÇ½ª¥í¥°¥¤¥óÆü»þ¤¬²¼µ­¤ÎÆü»þ¤è¤ê¤âÁ°");
+define("_AM_REGDMIN","ÅÐÏ¿Æü»þ¤¬²¼µ­¤ÎÆü»þ¤è¤ê¤â¸å");
+define("_AM_REGDMAX","ÅÐÏ¿Æü»þ¤¬²¼µ­¤ÎÆü»þ¤è¤ê¤âÁ°");
+define("_AM_IDLEMORE","ºÇ½ª¥í¥°¥¤¥óÆü»þ¤¬XÆüÁ°°Ê¾å¡Ê¾ÊÎ¬²Ä¡Ë");
+define("_AM_IDLELESS","ºÇ½ª¥í¥°¥¤¥óÆü»þ¤¬XÆüÁ°°ÊÆâ¡Ê¾ÊÎ¬²Ä¡Ë");
+define("_AM_MAILOK","Åö¥µ¥¤¥È¤«¤é¤Î¥á¡¼¥ëÇÛ¿®¤ò´õË¾¤·¤Æ¤¤¤ë¥æ¡¼¥¶¤Î¤ß¤ËÁ÷¿®¤¹¤ë¡Ê¾ÊÎ¬²Ä¡Ë");
+define("_AM_INACTIVE","Èó¥¢¥¯¥Æ¥£¥Ö¥æ¡¼¥¶°¸¤Ë¤Î¤ßÁ÷¿®¡Ê¾ÊÎ¬²Ä¡Ë");
+define("_AMIFCHECKD", "¥Á¥§¥Ã¥¯¤·¤¿¾ì¹ç¡¢¾å¤ÎÀßÄê¤ÏÌµ»ë¤µ¤ì¤Þ¤¹¡£¤Þ¤¿¡¢¥×¥é¥¤¥Ù¡¼¥È¥á¥Ã¥»¡¼¥¸¤ÎÁ÷¿®¤Ï¹Ô¤ï¤ì¤Þ¤»¤ó¡£");
+define("_AM_MAILFNAME","Á÷¿®¼Ô¡Ê¥á¡¼¥ë»ÈÍÑ»þ¡Ë");
+define("_AM_MAILFMAIL","Á÷¿®¼Ô¥á¡¼¥ë¥¢¥É¥ì¥¹¡Ê¥á¡¼¥ë»ÈÍÑ»þ¡Ë");
+define("_AM_MAILSUBJECT","É½Âê");
+define("_AM_MAILBODY","¥á¥Ã¥»¡¼¥¸ËÜÊ¸");
+define("_AM_MAILTAGS","»ÈÍÑ²ÄÇ½¤Ê¥¿¥°¡§");
+define("_AM_MAILTAGS1","{X_UID} ¤Ï¥æ¡¼¥¶ID¤òÉ½¼¨¤·¤Þ¤¹");
+define("_AM_MAILTAGS2","{X_UNAME} ¤Ï¥æ¡¼¥¶Ì¾¤òÉ½¼¨¤·¤Þ¤¹");
+define("_AM_MAILTAGS3","{X_UEMAIL} ¤Ï¥æ¡¼¥¶¤Î¥á¡¼¥ë¥¢¥É¥ì¥¹¤òÉ½¼¨¤·¤Þ¤¹");
+define("_AM_MAILTAGS4","{X_UACTLINK} ¤ÏÅÐÏ¿¤ò¾µÇ§¤¹¤ë¤¿¤á¤Î¥Ú¡¼¥¸¤Ø¤Î¥ê¥ó¥¯¤òÉ½¼¨¤·¤Þ¤¹");
+define("_AM_SENDTO","Á÷¿®ÊýË¡");
+define("_AM_EMAIL","¥á¡¼¥ë");
+define("_AM_PM","¥×¥é¥¤¥Ù¡¼¥È¥á¥Ã¥»¡¼¥¸");
+define("_AM_SENDMTOUSERS", "¥á¥Ã¥»¡¼¥¸¤ÎÁ÷¿®");
+define("_AM_SENT", "Á÷¿®ºÑ¥æ¡¼¥¶");
+define("_AM_SENTNUM", "%s - %s ¡Ê°¸Àè¥æ¡¼¥¶¿ô¹ç·×¡§ %s ¿Í¡Ë");
+define("_AM_SENDNEXT", "Â³¤±¤ë");
+define("_AM_NOUSERMATCH", "¾ò·ï¤Ë¹ç¤¦¥æ¡¼¥¶¤Ï¸«¤Ä¤«¤ê¤Þ¤»¤ó¤Ç¤·¤¿");
+define("_AM_SENDCOMP", "¥á¥Ã¥»¡¼¥¸¤ÎÁ÷¿®¤ò´°Î»¤·¤Þ¤·¤¿");
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/images.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/images.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/images.php	(revision 405)
@@ -0,0 +1,25 @@
+<?php
+// $Id: images.php,v 1.2 2005/03/18 13:00:59 onokazu Exp $
+//%%%%%% Image Manager %%%%%
+
+
+define('_MD_IMGMAIN','¥¤¥á¡¼¥¸´ÉÍý');
+
+define('_MD_ADDIMGCAT','¥¤¥á¡¼¥¸¥«¥Æ¥´¥ê¤ÎÄÉ²Ã:');
+define('_MD_EDITIMGCAT','¥¤¥á¡¼¥¸¥«¥Æ¥´¥ê¤ÎÊÔ½¸:');
+define('_MD_IMGCATNAME','¥«¥Æ¥´¥êÌ¾:');
+define('_MD_IMGCATRGRP','¥¤¥á¡¼¥¸¡¦¥Þ¥Í¥¸¥ã¡¼¤Î»ÈÍÑ¤òµö²Ä¤¹¤ë¥°¥ë¡¼¥×:<br /><br /><span style="font-weight: normal;">¥¤¥á¡¼¥¸¡¦¥Þ¥Í¥¸¥ã¡¼¤Î»ÈÍÑ¤òµö²Ä¤¹¤ë¥°¥ë¡¼¥×¤ò»ØÄê¤·¤Æ¤¯¤À¤µ¤¤¡£¥¤¥á¡¼¥¸¤ÎÁªÂò¤Î¤ß²ÄÇ½¤Ç¥¢¥Ã¥×¥í¡¼¥É¤Ï¤Ç¤­¤Þ¤»¤ó¡£Webmaster¤Ï¼«Æ°Åª¤Ë¥¢¥¯¥»¥¹µö²Ä¤Ë¤Ê¤ê¤Þ¤¹¡£</span>');
+define('_MD_IMGCATWGRP','¥¤¥á¡¼¥¸¤Î¥¢¥Ã¥×¥í¡¼¥É¤òµö²Ä¤¹¤ë¥°¥ë¡¼¥×:<br /><br /><span style="font-weight: normal;">°ìÈÌ¤Ë¡¢¥â¥Ç¥ì¡¼¥¿¤È´ÉÍý¼Ô¥°¥ë¡¼¥×¤Ëµö²Ä¤¹¤ë¤è¤¦¤ËÀßÄê¤·¤Þ¤¹¡£</span>');
+define('_MD_IMGCATWEIGHT','¥¤¥á¡¼¥¸¡¦¥Þ¥Í¥¸¥ã¡¼Æâ¤Ç¤ÎÉ½¼¨½ç½ø:');
+define('_MD_IMGCATDISPLAY','¤³¤Î¥«¥Æ¥´¥ê¤òÉ½¼¨¤¹¤ë:');
+define('_MD_IMGCATSTRTYPE','¥¤¥á¡¼¥¸¥Õ¥¡¥¤¥ë¤Î¥¢¥Ã¥×¥í¡¼¥ÉÀè:');
+define('_MD_STRTYOPENG','¤³¤ÎÀßÄê¤ò¸å¤ÇÊÑ¹¹¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡ª');
+define('_MD_INDB',' ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë³ÊÇ¼¡ÊBLOB ·Á¼°¤Ç³ÊÇ¼¤·¤Þ¤¹¡Ë');
+define('_MD_ASFILE',' ¥Õ¥¡¥¤¥ë¤È¤·¤ÆÊÝÂ¸¡Êuploads¥Ç¥£¥ì¥¯¥È¥ê¤ËÊÝÂ¸¤·¤Þ¤¹¡Ë<br />');
+define('_MD_RUDELIMGCAT','ËÜÅö¤Ë¤³¤Î¥«¥Æ¥´¥ê¤È¥«¥Æ¥´¥êÆâ¤ÎÁ´¤Æ¤Î¥¤¥á¡¼¥¸¤òºï½ü¤·¤Æ¤â¤è¤í¤·¤¤¤Ç¤¹¤«¡©');
+define('_MD_RUDELIMG','¤³¤Î¥¤¥á¡¼¥¸¥Õ¥¡¥¤¥ë¤òºï½ü¤·¤Æ¤â¤è¤í¤·¤¤¤Ç¤¹¤«¡©');
+
+define('_MD_FAILDEL', '¥¤¥á¡¼¥¸¥Ç¡¼¥¿ %s ¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤é¤Îºï½ü¤¬¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£');
+define('_MD_FAILDELCAT', '¥«¥Æ¥´¥ê %s ¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤é¤Îºï½ü¤¬¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£');
+define('_MD_FAILUNLINK', '¥¤¥á¡¼¥¸¥Õ¥¡¥¤¥ë %s ¤Î¥µ¡¼¥Ð¤«¤é¤Îºï½ü¤¬¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£');
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/metafooter.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/metafooter.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/metafooter.php	(revision 405)
@@ -0,0 +1,14 @@
+<?php
+//%%%%%%	Admin Module Name  MetaFooter 	%%%%%
+define("_AM_DBUPDATED",_MD_AM_DBUPDATED);
+
+define("_AM_ERRDELOLD","¥Ç¡¼¥¿¤Îºï½ü¤Ë¼ºÇÔ¤·¤Þ¤·¤¿");
+define("_AM_ERRINSERT","¥Ç¡¼¥¿¤Î¹¹¿·¤Ë¼ºÇÔ¤·¤Þ¤·¤¿");
+define("_AM_EDITMKF","¥á¥¿¥¿¥°¡¿¥Õ¥Ã¥¿¡¼¤ÎÊÔ½¸");
+define("_AM_METAKEY","¥á¥¿¥¿¥°¡Ê¥­¡¼¥ï¡¼¥É¡Ë");
+define("_AM_TYPEBYCOM","¥á¥¿¥¿¥°¡Ê¥­¡¼¥ï¡¼¥É¡Ë¤ò¡Ö,¡×¤Ç¶èÀÚ¤Ã¤Æµ­Æþ¤·¤Æ¤¯¤À¤µ¤¤¡ÊÎã¡§ XOOPS, PHP, mySQL, ¥Ý¡¼¥¿¥ë¡Ë");
+define("_AM_FOOTER","¥Õ¥Ã¥¿¡¼");
+define("_AM_BESURELINK","¥ê¥ó¥¯¤òµ­Æþ¤¹¤ë¾ì¹ç¤ÏÉ¬¤º¥Õ¥ë¥Ñ¥¹¡Êhttp://¡Á¡Ë¤ÇÆþÎÏ¤·¤Æ¤¯¤À¤µ¤¤¡£¥Õ¥ë¥Ñ¥¹¤ÇÆþÎÏ¤·¤Ê¤«¤Ã¤¿¾ì¹ç¡¢¥â¥¸¥å¡¼¥ëÆâ¥Ú¡¼¥¸¤Ç¤¦¤Þ¤¯É½¼¨¤µ¤ì¤Ê¤¤¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£");
+define("_AM_ADDCODE","Á÷¿®");
+define("_AM_CLEAR","¥¯¥ê¥¢");
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/smilies.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/smilies.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/smilies.php	(revision 405)
@@ -0,0 +1,21 @@
+<?php
+//%%%%%%	Admin Module Name  Smilies 	%%%%%
+define("_AM_DBUPDATED",_MD_AM_DBUPDATED);
+
+define("_AM_SMILESCONTROL","´é¥¢¥¤¥³¥óÀßÄê");
+define("_AM_CODE","´éÊ¸»ú");
+define("_AM_SMILIE","´é¥¢¥¤¥³¥ó");
+define("_AM_ACTION","");
+define("_AM_EDIT","ÊÔ½¸");
+define("_AM_DEL","ºï½ü");
+define("_AM_CNRFTSD","¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤é¥Ç¡¼¥¿¤ò¼èÆÀ¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿");
+define("_AM_ADDSMILE","´é¥¢¥¤¥³¥ó¤ÎÄÉ²Ã");
+define("_AM_SMILECODE","´éÊ¸»ú¡§");
+define("_AM_SMILEURL","²èÁüURL¡§");
+define("_AM_SMILEEMOTION","°ÕÌ£¡§");
+define("_AM_ADD","ÄÉ²Ã");
+define("_AM_SAVE","ÊÝÂ¸");
+define("_AM_WAYSYWTDTS","¤³¤Î´é¥¢¥¤¥³¥ó¤òºï½ü¤·¤Æ¤â¤¤¤¤¤Ç¤¹¤«¡©");
+define("_AM_EDITSMILE","´é¥¢¥¤¥³¥ó¤ÎÊÔ½¸");
+define('_AM_DISPLAYF', 'Åê¹Æ¥Õ¥©¡¼¥à¤ËÉ½¼¨');
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/groups.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/groups.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin/groups.php	(revision 405)
@@ -0,0 +1,32 @@
+<?php
+//%%%%%%	Admin Module Name  AdminGroup 	%%%%%
+define("_AM_DBUPDATED",_MD_AM_DBUPDATED);
+
+define("_AM_EDITADG","¥æ¡¼¥¶¥°¥ë¡¼¥×¤ÎÊÔ½¸");
+define("_AM_MODIFY","ÊÔ½¸");
+define("_AM_DELETE","ºï½ü");
+define("_AM_CREATENEWADG","¿·µ¬¥æ¡¼¥¶¥°¥ë¡¼¥×¤ÎºîÀ®");
+define("_AM_NAME","¥°¥ë¡¼¥×Ì¾");
+define("_AM_DESCRIPTION","ÀâÌÀ");
+define("_AM_INDICATES","* ¤ÏÉ¬¿Ü¹àÌÜ¤ò°ÕÌ£¤·¤Þ¤¹");
+define("_AM_SYSTEMRIGHTS","¥·¥¹¥Æ¥à´ÉÍý¼Ô¸¢¸Â");
+define("_AM_ACTIVERIGHTS","¥â¥¸¥å¡¼¥ë´ÉÍý¼Ô¸¢¸Â");
+define("_AM_IFADMIN","´ÉÍý¼Ô¸¢¸Â¤¬Í­¸ú¤Ê¥â¥¸¥å¡¼¥ë¤ËÂÐ¤·¤Æ¤Ï¡¢¼«Æ°Åª¤Ë¥¢¥¯¥»¥¹¸¢¸Â¤âÉÕÍ¿¤µ¤ì¤Þ¤¹¡£");
+define("_AM_ACCESSRIGHTS","¥â¥¸¥å¡¼¥ë¥¢¥¯¥»¥¹¸¢¸Â");
+define("_AM_UPDATEADG","¥°¥ë¡¼¥×¾ðÊó¤ò¹¹¿·");
+define("_AM_MODIFYADG","¥æ¡¼¥¶¥°¥ë¡¼¥×¤ÎÊÔ½¸");
+define("_AM_DELETEADG","¥æ¡¼¥¶¥°¥ë¡¼¥×¤òºï½ü");
+define("_AM_AREUSUREDEL","%s¥°¥ë¡¼¥×¤òºï½ü¤·¤Æ¤â¤¤¤¤¤Ç¤¹¤«¡©");
+define("_AM_YES","¤Ï¤¤");
+define("_AM_NO","¤¤¤¤¤¨");
+define("_AM_EDITMEMBER","¥°¥ë¡¼¥×¥á¥ó¥Ð¡¼¤ÎÄÉ²Ã¡¿ºï½ü");
+define("_AM_MEMBERS","¥á¥ó¥Ð¡¼");
+define("_AM_NONMEMBERS","Èó¥á¥ó¥Ð¡¼");
+define("_AM_ADDBUTTON"," ÄÉ²Ã --> ");
+define("_AM_DELBUTTON","<-- ºï½ü");
+define("_AM_UNEED2ENTER","É¬Í×¤Ê¾ðÊó¤òÁ´¤ÆÆþÎÏ¤·¤Æ¤¯¤À¤µ¤¤");
+define("_AM_BLOCKRIGHTS","¥Ö¥í¥Ã¥¯¥¢¥¯¥»¥¹¸¢¸Â");
+define('_AM_FINDU4GROUP', '¤³¤Î¥°¥ë¡¼¥×¤ËÄÉ²Ã¤¹¤ë¥æ¡¼¥¶¤ò¸¡º÷¤¹¤ë');
+define('_AM_GROUPSMAIN', '¥°¥ë¡¼¥×´ÉÍý');
+define('_AM_ADMINNO', '´ÉÍý¼Ô¥°¥ë¡¼¥×¤Ë¤Ï£±¿Í°Ê¾å¤Î¥æ¡¼¥¶¤¬ÅÐÏ¿¤µ¤ì¤Æ¤¤¤ëÉ¬Í×¤¬¤¢¤ê¤Þ¤¹');
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/language/japanese/admin.php	(revision 405)
@@ -0,0 +1,29 @@
+<?php
+//%%%%%%	File Name  admin.php 	%%%%%
+define("_MD_AM_DBUPDATED","¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò¹¹¿·¤·¤Þ¤·¤¿");
+
+
+// Admin Module Names
+define("_MD_AM_ADGS","¥°¥ë¡¼¥×´ÉÍý");
+define("_MD_AM_BANS","¥Ð¥Ê¡¼´ÉÍý");
+define("_MD_AM_BKAD","¥Ö¥í¥Ã¥¯´ÉÍý");
+define("_MD_AM_MDAD","¥â¥¸¥å¡¼¥ë´ÉÍý");
+define("_MD_AM_SMLS","´é¥¢¥¤¥³¥óÀßÄê");
+define("_MD_AM_RANK","¥æ¡¼¥¶¥é¥ó¥­¥ó¥°ÀßÄê");
+define("_MD_AM_USER","¥æ¡¼¥¶´ÉÍý");
+define("_MD_AM_FINDUSER", "¥æ¡¼¥¶¸¡º÷");
+define("_MD_AM_PREF","°ìÈÌÀßÄê");
+define("_MD_AM_VRSN","¥Ð¡¼¥¸¥ç¥ó");
+define("_MD_AM_MLUS", "¥æ¡¼¥¶°¸¤Ë¥á¡¼¥ëÁ÷¿®");
+define('_MD_AM_IMAGES', '¥¤¥á¡¼¥¸¡¦¥Þ¥Í¥¸¥ã¡¼');
+define('_MD_AM_AVATARS', '¥¢¥Ð¥¿¡¼¡¦¥Þ¥Í¥¸¥ã¡¼');
+define('_MD_AM_TPLSETS', '¥Æ¥ó¥×¥ì¡¼¥È');
+define('_MD_AM_COMMENTS', '¥³¥á¥ó¥È');
+
+// Group permission phrases
+define('_MD_AM_PERMADDNG', '¥°¥ë¡¼¥×¡¦¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤ÎÄÉ²Ã¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡Ê¥Ñ¡¼¥ß¥Ã¥·¥ç¥óÌ¾¡§%s ÂÐ¾Ý¥¢¥¤¥Æ¥à¡§%s ÂÐ¾Ý¥°¥ë¡¼¥×¡§%s¡Ë');
+define('_MD_AM_PERMADDOK','¥°¥ë¡¼¥×¡¦¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤òÄÉ²Ã¤·¤Þ¤·¤¿¡Ê¥Ñ¡¼¥ß¥Ã¥·¥ç¥óÌ¾¡§%s ÂÐ¾Ý¥¢¥¤¥Æ¥à¡§%s ÂÐ¾Ý¥°¥ë¡¼¥×¡§%s¡Ë');
+define('_MD_AM_PERMRESETNG','¡Ö%s¡×¥â¥¸¥å¡¼¥ë¤Î¥°¥ë¡¼¥×¡¦¥Ñ¡¼¥ß¥Ã¥·¥ç¥óÀßÄê¤Î½é´ü²½¤Ë¼ºÇÔ¤·¤Þ¤·¤¿');
+define('_MD_AM_PERMADDNGP', '¤³¤Î¥¢¥¤¥Æ¥à¤Î¾å°Ì¥¢¥¤¥Æ¥àÁ´¤Æ¤Ë¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤òÍ¿¤¨¤ëÉ¬Í×¤¬¤¢¤ê¤Þ¤¹');
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/language/english/modinfo.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/language/english/modinfo.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/language/english/modinfo.php	(revision 405)
@@ -0,0 +1,41 @@
+<?php
+// $Id: modinfo.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+// Module Info
+
+// The name of this module
+define("_MI_SYSTEM_NAME","System");
+
+// A brief description of this module
+define("_MI_SYSTEM_DESC","For administration of core settings of the site.");
+
+// Names of blocks for this module (Not all module has blocks)
+define("_MI_SYSTEM_BNAME2","User Menu");
+define("_MI_SYSTEM_BNAME3","Login");
+define("_MI_SYSTEM_BNAME4","Search");
+define("_MI_SYSTEM_BNAME5","Waiting Contents");
+define("_MI_SYSTEM_BNAME6","Main Menu");
+define("_MI_SYSTEM_BNAME7","Site Info");
+define('_MI_SYSTEM_BNAME8', "Who's Online");
+define('_MI_SYSTEM_BNAME9', "Top Posters");
+define('_MI_SYSTEM_BNAME10', "New Members");
+define('_MI_SYSTEM_BNAME11', "Recent Comments");
+// RMV-NOTIFY
+define('_MI_SYSTEM_BNAME12', "Notification Options");
+define('_MI_SYSTEM_BNAME13', "Themes");
+
+// Names of admin menu items
+define("_MI_SYSTEM_ADMENU1","Banners");
+define("_MI_SYSTEM_ADMENU2","Blocks");
+define("_MI_SYSTEM_ADMENU3","Groups");
+define("_MI_SYSTEM_ADMENU5","Modules");
+define("_MI_SYSTEM_ADMENU6","Preferences");
+define("_MI_SYSTEM_ADMENU7","Smilies");
+define("_MI_SYSTEM_ADMENU9","User Ranks");
+define("_MI_SYSTEM_ADMENU10","Edit User");
+define("_MI_SYSTEM_ADMENU11","Mail Users");
+define("_MI_SYSTEM_ADMENU12", "Find Users");
+define("_MI_SYSTEM_ADMENU13", "Images");
+define("_MI_SYSTEM_ADMENU14", "Avatars");
+define("_MI_SYSTEM_ADMENU15", "Templates");
+define("_MI_SYSTEM_ADMENU16", "Comments");
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/language/english/blocks.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/language/english/blocks.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/language/english/blocks.php	(revision 405)
@@ -0,0 +1,45 @@
+<?php
+// $Id: blocks.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+// Blocks
+define("_MB_SYSTEM_ADMENU","Administration Menu");
+define("_MB_SYSTEM_RNOW","Register now!");
+define("_MB_SYSTEM_LPASS","Lost Password?");
+define("_MB_SYSTEM_SEARCH","Search");
+define("_MB_SYSTEM_ADVS","Advanced Search");
+define("_MB_SYSTEM_VACNT","View Account");
+define("_MB_SYSTEM_EACNT","Edit Account");
+// RMV-NOTIFY
+define("_MB_SYSTEM_NOTIF", "Notifications");
+define("_MB_SYSTEM_LOUT","Logout");
+define("_MB_SYSTEM_INBOX","Inbox");
+define("_MB_SYSTEM_SUBMS","Submitted News");
+define("_MB_SYSTEM_WLNKS","Waiting Links");
+define("_MB_SYSTEM_BLNK","Broken Links");
+define("_MB_SYSTEM_MLNKS","Modified Links");
+define("_MB_SYSTEM_WDLS","Waiting Downloads");
+define("_MB_SYSTEM_BFLS","Broken Files");
+define("_MB_SYSTEM_MFLS","Modified Downloads");
+define("_MB_SYSTEM_HOME","Home"); // link to home page in main menu block
+define("_MB_SYSTEM_RECO","Recommend Us");
+define("_MB_SYSTEM_PWWIDTH","Pop-Up Window Width");
+define("_MB_SYSTEM_PWHEIGHT","Pop-Up Window Height");
+define("_MB_SYSTEM_LOGO","Logo image file under %s directory");  // %s is your root image directory name
+define("_MB_SYSTEM_COMPEND", "Comments");
+
+//define("_MB_SYSTEM_LOGGEDINAS", "Logged in as");
+define("_MB_SYSTEM_SADMIN","Show admin groups");
+define("_MB_SYSTEM_SPMTO","Send Private Message to %s");
+define("_MB_SYSTEM_SEMTO","Send Email to %s");
+
+define("_MB_SYSTEM_DISPLAY","Display %s members");
+define("_MB_SYSTEM_DISPLAYA","Display member avatars");
+define("_MB_SYSTEM_NODISPGR","Do not display users whose rank is:");
+
+define("_MB_SYSTEM_DISPLAYC","Display %s comments");
+define("_MB_SYSTEM_SECURE", "Secure Login");
+
+define("_MB_SYSTEM_NUMTHEME", "%s themes");
+define("_MB_SYSTEM_THSHOW", "Display screenshot image");
+define("_MB_SYSTEM_THWIDTH", "Screenshot image width");
+//define('_MB_SYSTEM_REMEMBERME', 'Remember me');
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/language/english/admin/tplsets.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/language/english/admin/tplsets.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/language/english/admin/tplsets.php	(revision 405)
@@ -0,0 +1,61 @@
+<?php
+// $Id: tplsets.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+//%%%%%% Template Manager %%%%%
+define('_MD_TPLMAIN','Template Set Manager');
+define('_MD_INSTALL','Install');
+define('_MD_EDITTEMPLATE','Edit template file');
+define('_MD_FILENAME','File name');
+define('_MD_FILEDESC','Description');
+define('_MD_LASTMOD','Last modified');
+define('_MD_FILEMOD','Last modified (file)');
+define('_MD_FILECSS','CSS');
+define('_MD_FILEHTML','HTML');
+define('_MD_AM_BTOTADMIN', 'Back to template set manager');
+define('_MD_RUSUREDELTH', 'Are you sure that you want to delete this template set and all its template data?');
+define('_MD_RUSUREDELTPL', 'Are you sure that you want to delete this template data?');
+define('_MD_PLZINSTALL', 'Press the button below to start installation');
+define('_MD_PLZGENERATE', 'Press the button below to generate file(s)');
+define('_MD_CLONETHEME','Clone a template set');
+define('_MD_THEMENAME','Base template set');
+define('_MD_NEWNAME','Enter new template set name');
+define('_MD_IMPORT','Import');
+define('_MD_RUSUREIMPT', 'Importing template data from the templates directory will overwrite your changes in database.<br />Click "Import" to proceed.');
+define('_MD_THMSETNAME','Name');
+define('_MD_CREATED','Created');
+define('_MD_SKIN','Skin');
+define('_MD_TEMPLATES','Templates');
+define('_MD_EDITSKIN','Edit skin');
+define('_MD_NOFILE','No File');
+define('_MD_VIEW','View');
+define('_MD_COPYDEFAULT','Copy default file');
+define('_MD_DLDEFAULT','Download default file');
+define('_MD_VIEWDEFAULT','View default template');
+define('_MD_DOWNLOAD','Download');
+define('_MD_UPLOAD','Upload');
+define('_MD_GENERATE','Generate');
+define('_MD_CHOOSEFILE', 'Choose file to upload');
+define('_MD_UPWILLREPLACE', 'Uploading this file will overwrite the data in database!');
+define('_MD_UPLOADTAR', 'Upload a template set');
+define('_MD_CHOOSETAR', 'Choose a template set package to upload');
+define('_MD_ONLYTAR', 'Must be a tar.gz/.tar file with a valid XOOPS template set structure');
+define('_MD_NTHEMENAME', 'New template set name');
+define('_MD_ENTERTH', 'Enter a template set name for this package. Leave it blank for automatic detection.');
+define('_MD_TITLE','Title');
+define('_MD_CONTENT','Content');
+define('_MD_ACTION','Action');
+define('_MD_DEFAULTTHEME','Your site uses this template set as default');
+define('_MD_AM_ERRTHEME', 'The following template sets have no valid skin files data. Press delete to remove data related to the template set.');
+define('_MD_SKINIMGS','Skin image files');
+define('_MD_EDITSKINIMG','Edit skin image files');
+define('_MD_IMGFILE','File name');
+define('_MD_IMGNEWFILE','Upload new file');
+define('_MD_IMGDELETE','Delete');
+define('_MD_ADDSKINIMG','Add skin image file');
+define('_MD_BLOCKHTML', 'Block HTML');
+define('_MD_IMAGES', 'Images');
+define('_MD_NOZLIB', 'Zlib support must be enabled on your server');
+define('_MD_LASTIMP', 'Last Imported');
+define('_MD_FILENEWER', 'A newer file that has not been imported yet exists under the <b>templates</b> directory.');
+define('_MD_FILEIMPORT', 'An older file that has not been imported yet exists under the <b>templates</b> directory.');
+define('_MD_FILEGENER', 'Template file does not eixst. It can be generated (copied from the <b>default</b> template), uploaded, or imported from the <b>templates</b> directory.');
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/language/english/admin/avatars.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/language/english/admin/avatars.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/language/english/admin/avatars.php	(revision 405)
@@ -0,0 +1,12 @@
+<?php
+// $Id
+//%%%%%% Avatar Manager %%%%%
+define('_MD_AVATARMAN','Avatar Manager');
+
+define('_MD_SYSAVATARS','System Avatars');
+define('_MD_CSTAVATARS','Custom Avatars');
+define('_MD_ADDAVT','Add Avatar');
+define('_MD_USERS','Users using this avatar');
+define('_MD_RUDELIMG','Are you sure that you want to delete this avatar image?');
+define('_MD_FAILDEL', 'Failed deleting avatar %s from the database');
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/language/english/admin/preferences.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/language/english/admin/preferences.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/language/english/admin/preferences.php	(revision 405)
@@ -0,0 +1,181 @@
+<?php
+// $Id: preferences.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+//%%%%%%	Admin Module Name  AdminGroup 	%%%%%
+// dont change
+define("_AM_DBUPDATED",_MD_AM_DBUPDATED);
+
+define("_MD_AM_SITEPREF","Site Preferences");
+define("_MD_AM_SITENAME","Site name");
+define("_MD_AM_SLOGAN","Slogan for your site");
+define("_MD_AM_ADMINML","Admin mail address");
+define("_MD_AM_LANGUAGE","Default language");
+define("_MD_AM_STARTPAGE","Module for your start page");
+define("_MD_AM_NONE","None");
+define("_MD_AM_SERVERTZ","Server timezone");
+define("_MD_AM_DEFAULTTZ","Default timezone");
+define("_MD_AM_DTHEME","Default theme");
+define("_MD_AM_THEMESET","Theme Set");
+define("_MD_AM_ANONNAME","Username for anonymous users");
+define("_MD_AM_MINPASS","Minimum length of password required");
+define("_MD_AM_NEWUNOTIFY","Notify by mail when a new user is registered?");
+define("_MD_AM_SELFDELETE","Allow users to delete own account?");
+define("_MD_AM_LOADINGIMG","Display loading... image?");
+define("_MD_AM_USEGZIP","Use gzip compression?");
+define("_MD_AM_UNAMELVL","Select the level of strictness for username filtering");
+define("_MD_AM_STRICT","Strict (only alphabets and numbers)");
+define("_MD_AM_MEDIUM","Medium");
+define("_MD_AM_LIGHT","Light (recommended for multi-byte chars)");
+define("_MD_AM_USERCOOKIE","Name for user cookies.");
+define("_MD_AM_USERCOOKIEDSC","This cookie contains only a user name and is saved in a user pc for a year (if the user wishes). If a user have this cookie, username will be automatically inserted in the login box.");
+define("_MD_AM_USEMYSESS","Use custom session");
+define("_MD_AM_USEMYSESSDSC","Select yes to customise session related values.");
+define("_MD_AM_SESSNAME","Session name");
+define("_MD_AM_SESSNAMEDSC","The name of session (Valid only when 'use custom session' is enabled)");
+define("_MD_AM_SESSEXPIRE","Session expiration");
+define("_MD_AM_SESSEXPIREDSC","Maximum duration of session idle time in minutes (Valid only when 'use custom session' is enabled. Works only when you are using PHP4.2.0 or later.)");
+define("_MD_AM_BANNERS","Activate banner ads?");
+define("_MD_AM_MYIP","Your IP address");
+define("_MD_AM_MYIPDSC","This IP will not counted as impression for banners");
+define("_MD_AM_ALWDHTML","HTML tags allowed in all posts.");
+define("_MD_AM_INVLDMINPASS","Invalid value for minimum length of password.");
+define("_MD_AM_INVLDUCOOK","Invalid value for usercookie name.");
+define("_MD_AM_INVLDSCOOK","Invalid value for sessioncookie name.");
+define("_MD_AM_INVLDSEXP","Invalid value for session expiration time.");
+define("_MD_AM_ADMNOTSET","Admin mail is not set.");
+define("_MD_AM_YES","Yes");
+define("_MD_AM_NO","No");
+define("_MD_AM_DONTCHNG","Don't change!");
+define("_MD_AM_REMEMBER","Remember to chmod 666 this file in order to let the system write to it properly.");
+define("_MD_AM_IFUCANT","If you can't change the permissions you can edit the rest of this file by hand.");
+
+
+define("_MD_AM_COMMODE","Default Comment Display Mode");
+define("_MD_AM_COMORDER","Default Comments Display Order");
+define("_MD_AM_ALLOWHTML","Allow HTML tags in user comments?");
+define("_MD_AM_DEBUGMODE","Debug mode");
+define("_MD_AM_DEBUGMODEDSC","Several debug options. A running website should have this turned off.");
+define("_MD_AM_AVATARALLOW","Allow custom avatar upload?");
+define('_MD_AM_AVATARMP','Minimum posts required');
+define('_MD_AM_AVATARMPDSC','Enter the minimum number of posts required to upload a custom avatar');
+define("_MD_AM_AVATARW","Avatar image max width (pixel)");
+define("_MD_AM_AVATARH","Avatar image max height (pixel)");
+define("_MD_AM_AVATARMAX","Avatar image max filesize (byte)");
+define("_MD_AM_AVATARCONF","Custom avatar settings");
+define("_MD_AM_CHNGUTHEME","Change all users' theme");
+define("_MD_AM_NOTIFYTO","Select group to which new user notification mail will be sent");
+define("_MD_AM_ALLOWTHEME","Allow users to select theme?");
+define("_MD_AM_ALLOWIMAGE","Allow users to display image files in posts?");
+
+define("_MD_AM_USERACTV","Requires activation by user (recommended)");
+define("_MD_AM_AUTOACTV","Activate automatically");
+define("_MD_AM_ADMINACTV","Activation by administrators");
+define("_MD_AM_ACTVTYPE","Select activation type of newly registered users");
+define("_MD_AM_ACTVGROUP","Select group to which activation mail will be sent");
+define("_MD_AM_ACTVGROUPDSC","Valid only when 'Activation by administrators' is selected");
+define('_MD_AM_USESSL', 'Use SSL for login?');
+define('_MD_AM_SSLPOST', 'SSL Post variable name');
+define('_MD_AM_SSLPOSTDSC', 'The name of variable used to transfer session value via POST. If you are unsure, set any name that is hard to guess.');
+define('_MD_AM_DEBUGMODE0','Off');
+define('_MD_AM_DEBUGMODE1','PHP Debug');
+define('_MD_AM_DEBUGMODE2','MySQL/Blocks Debug');
+define('_MD_AM_DEBUGMODE3','Smarty Templates Debug');
+define('_MD_AM_MINUNAME', 'Minimum length of username required');
+define('_MD_AM_MAXUNAME', 'Maximum length of username');
+define('_MD_AM_GENERAL', 'General Settings');
+define('_MD_AM_USERSETTINGS', 'User Info Settings');
+define('_MD_AM_ALLWCHGMAIL', 'Allow users to change email address?');
+define('_MD_AM_ALLWCHGMAILDSC', '');
+define('_MD_AM_IPBAN', 'IP Banning');
+define('_MD_AM_BADEMAILS', 'Enter emails that should not be used in user profile');
+define('_MD_AM_BADEMAILSDSC', 'Separate each with a <b>|</b>, case insensitive, regex enabled.');
+define('_MD_AM_BADUNAMES', 'Enter names that should not be selected as username');
+define('_MD_AM_BADUNAMESDSC', 'Separate each with a <b>|</b>, case insensitive, regex enabled.');
+define('_MD_AM_DOBADIPS', 'Enable IP bans?');
+define('_MD_AM_DOBADIPSDSC', 'Users from specified IP addresses will not be able to view your site');
+define('_MD_AM_BADIPS', 'Enter IP addresses that should be banned from the site.<br />Separate each with a <b>|</b>, case insensitive, regex enabled.');
+define('_MD_AM_BADIPSDSC', '^aaa.bbb.ccc will disallow visitors with an IP that starts with aaa.bbb.ccc<br />aaa.bbb.ccc$ will disallow visitors with an IP that ends with aaa.bbb.ccc<br />aaa.bbb.ccc will disallow visitors with an IP that contains aaa.bbb.ccc');
+define('_MD_AM_PREFMAIN', 'Preferences Main');
+define('_MD_AM_METAKEY', 'Meta Keywords');
+define('_MD_AM_METAKEYDSC', 'The keywords meta tag is a series of keywords that represents the content of your site. Type in keywords with each separated by a comma or a space in between. (Ex. XOOPS, PHP, mySQL, portal system)');
+define('_MD_AM_METARATING', 'Meta Rating');
+define('_MD_AM_METARATINGDSC', 'The rating meta tag defines your site age and content rating');
+define('_MD_AM_METAOGEN', 'General');
+define('_MD_AM_METAO14YRS', '14 years');
+define('_MD_AM_METAOREST', 'Restricted');
+define('_MD_AM_METAOMAT', 'Mature');
+define('_MD_AM_METAROBOTS', 'Meta Robots');
+define('_MD_AM_METAROBOTSDSC', 'The Robots Tag declares to search engines what content to index and spider');
+define('_MD_AM_INDEXFOLLOW', 'Index, Follow');
+define('_MD_AM_NOINDEXFOLLOW', 'No Index, Follow');
+define('_MD_AM_INDEXNOFOLLOW', 'Index, No Follow');
+define('_MD_AM_NOINDEXNOFOLLOW', 'No Index, No Follow');
+define('_MD_AM_METAAUTHOR', 'Meta Author');
+define('_MD_AM_METAAUTHORDSC', 'The author meta tag defines the name of the author of the document being read. Supported data formats include the name, email address of the webmaster, company name or URL.');
+define('_MD_AM_METACOPYR', 'Meta Copyright');
+define('_MD_AM_METACOPYRDSC', 'The copyright meta tag defines any copyright statements you wish to disclose about your web page documents.');
+define('_MD_AM_METADESC', 'Meta Description');
+define('_MD_AM_METADESCDSC', 'The description meta tag is a general description of what is contained in your web page');
+define('_MD_AM_METAFOOTER', 'Meta Tags and Footer');
+define('_MD_AM_FOOTER', 'Footer');
+define('_MD_AM_FOOTERDSC', 'Be sure to type links in full path starting from http://, otherwise the links will not work correctly in modules pages.');
+define('_MD_AM_CENSOR', 'Word Censoring Options');
+define('_MD_AM_DOCENSOR', 'Enable censoring of unwanted words?');
+define('_MD_AM_DOCENSORDSC', 'Words will be censored if this option is enabled. This option may be turned off for enhanced site speed.');
+define('_MD_AM_CENSORWRD', 'Words to censor');
+define('_MD_AM_CENSORWRDDSC', 'Enter words that should be censored in user posts.<br />Separate each with a <b>|</b>, case insensitive.');
+define('_MD_AM_CENSORRPLC', 'Bad words will be replaced with:');
+define('_MD_AM_CENSORRPLCDSC', 'Censored words will be replaced with the characters entered in this textbox');
+
+define('_MD_AM_SEARCH', 'Search Options');
+define('_MD_AM_DOSEARCH', 'Enable global searches?');
+define('_MD_AM_DOSEARCHDSC', 'Allow searching for posts/items within your site.');
+define('_MD_AM_MINSEARCH', 'Minimum keyword length');
+define('_MD_AM_MINSEARCHDSC', 'Enter the minimum keyword length that users are required to enter to perform search');
+define('_MD_AM_MODCONFIG', 'Module Config Options');
+define('_MD_AM_DSPDSCLMR', 'Display disclaimer?');
+define('_MD_AM_DSPDSCLMRDSC', 'Select yes to display disclaimer in registration page');
+define('_MD_AM_REGDSCLMR', 'Registration disclaimer');
+define('_MD_AM_REGDSCLMRDSC', 'Enter text to be displayed as registration disclaimer');
+define('_MD_AM_ALLOWREG', 'Allow new user registration?');
+define('_MD_AM_ALLOWREGDSC', 'Select yes to accept new user registration');
+define('_MD_AM_THEMEFILE', 'Update module template .html files from themes/your theme/templates directory?');
+define('_MD_AM_THEMEFILEDSC', 'If this option is enabled, module template .html files will be updated automatically if there are newer files under the themes/your theme/templates directory for the current theme. This should be turned off once the site goes public.');
+define('_MD_AM_CLOSESITE', 'Turn your site off?');
+define('_MD_AM_CLOSESITEDSC', 'Select yes to turn your site off so that only users in selected groups have access to the site. ');
+define('_MD_AM_CLOSESITEOK', 'Select groups that are allowed to access while the site is turned off.');
+define('_MD_AM_CLOSESITEOKDSC', 'Users in the default webmasters group are always granted access.');
+define('_MD_AM_CLOSESITETXT', 'Reason for turning off the site');
+define('_MD_AM_CLOSESITETXTDSC', 'The text that is presented when the site is closed.');
+define('_MD_AM_SITECACHE', 'Site-wide Cache');
+define('_MD_AM_SITECACHEDSC', 'Caches whole contents of the site for a specified amount of time to enhance performance. Setting site-wide cache will override module-level cache, block-level cache, and module item level cache if any.');
+define('_MD_AM_MODCACHE', 'Module-wide Cache');
+define('_MD_AM_MODCACHEDSC', 'Caches module contents for a specified amount of time to enhance performance. Setting module-wide cache will override module item level cache if any.');
+define('_MD_AM_NOMODULE', 'There is no module that can be cached.');
+define('_MD_AM_DTPLSET', 'Default template set');
+define('_MD_AM_SSLLINK', 'URL where SSL login page is located');
+
+// added for mailer
+define("_MD_AM_MAILER","Mail Setup");
+define("_MD_AM_MAILER_MAIL","");
+define("_MD_AM_MAILER_SENDMAIL","");
+define("_MD_AM_MAILER_","");
+define("_MD_AM_MAILFROM","FROM address");
+define("_MD_AM_MAILFROMDESC","");
+define("_MD_AM_MAILFROMNAME","FROM name");
+define("_MD_AM_MAILFROMNAMEDESC","");
+// RMV-NOTIFY
+define("_MD_AM_MAILFROMUID","FROM user");
+define("_MD_AM_MAILFROMUIDDESC","When the system sends a private message, which user should appear to have sent it?");
+define("_MD_AM_MAILERMETHOD","Mail delivery method");
+define("_MD_AM_MAILERMETHODDESC","Method used to deliver mail. Default is \"mail\", use others only if that makes trouble.");
+define("_MD_AM_SMTPHOST","SMTP host(s)");
+define("_MD_AM_SMTPHOSTDESC","List of SMTP servers to try to connect to.");
+define("_MD_AM_SMTPUSER","SMTPAuth username");
+define("_MD_AM_SMTPUSERDESC","Username to connect to an SMTP host with SMTPAuth.");
+define("_MD_AM_SMTPPASS","SMTPAuth password");
+define("_MD_AM_SMTPPASSDESC","Password to connect to an SMTP host with SMTPAuth.");
+define("_MD_AM_SENDMAILPATH","Path to sendmail");
+define("_MD_AM_SENDMAILPATHDESC","Path to the sendmail program (or substitute) on the webserver.");
+define("_MD_AM_THEMEOK","Selectable themes");
+define("_MD_AM_THEMEOKDSC","Choose themes that users can select as the default theme");
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/language/english/admin/users.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/language/english/admin/users.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/language/english/admin/users.php	(revision 405)
@@ -0,0 +1,58 @@
+<?php
+// $Id: users.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+//%%%%%%	Admin Module Name  Users 	%%%%%
+define("_AM_DBUPDATED",_MD_AM_DBUPDATED);
+
+define("_AM_AYSYWTDU","Are you sure you want to delete user %s?");
+define("_AM_BYTHIS","By doing this all the info for this user will be removed permanently.");
+define("_AM_YES","Yes");
+define("_AM_NO","No");
+define("_AM_YMCACF","You must complete all required fields");
+define("_AM_CNRNU","Could not register new user.");
+define("_AM_EDEUSER","Edit/Delete Users");
+define("_AM_NICKNAME","Nickname");
+define("_AM_MODIFYUSER","Modify User");
+define("_AM_DELUSER","Delete User");
+define("_AM_GO","Go!");
+define("_AM_ADDUSER","Add User");
+define("_AM_NAME","Name");
+define("_AM_EMAIL","Email");
+define("_AM_OPTION","Option");
+define("_AM_AVATAR","Avatar");
+define("_AM_THEME","Theme");
+define("_AM_AOUTVTEAD","Allow other users to view this email address");
+define("_AM_URL","URL");
+define("_AM_ICQ","ICQ");
+define("_AM_AIM","AIM");
+define("_AM_YIM","YIM");
+define("_AM_MSNM","MSNM");
+define("_AM_LOCATION","Location");
+define("_AM_OCCUPATION","Occupation");
+define("_AM_INTEREST","Interest");
+define("_AM_RANK","Rank");
+define("_AM_NSRA","No Special Rank Assigned");
+define("_AM_NSRID","No Special Ranks in Database");
+define("_AM_ACCESSLEV","Access Level");
+define("_AM_SIGNATURE","Signature");
+define("_AM_PASSWORD","Password");
+define("_AM_INDICATECOF","* indicates required fields");
+define("_AM_NOTACTIVE","This user has not been activated. Do you wish to activate this user?");
+define("_AM_UPDATEUSER","Update User");
+define("_AM_USERINFO","User Info");
+define("_AM_USERID","User ID");
+define("_AM_RETYPEPD","Retype Password");
+define("_AM_CHANGEONLY","(for changes only)");
+define("_AM_USERPOST","User Posts");
+define("_AM_STORIES","Stories");
+define("_AM_COMMENTS","Comments");
+define("_AM_PTBBTSDIYT","Push the button below to synchronize data if you think the above user posts info does not seem to indicate the actual status");
+define("_AM_SYNCHRONIZE","Synchronize");
+define("_AM_USERDONEXIT","User doesn't exist!");
+define("_AM_STNPDNM","Sorry, the new passwords do not match. Click back and try again");
+define("_AM_CNGTCOM","Could not get total comments");
+define("_AM_CNGTST","Could not get total stories");
+define("_AM_CNUUSER","Could not update user");
+define("_AM_CNGUSERID","Could not get user IDS");
+define("_AM_LIST","List");
+define("_AM_NOUSERS", "No users selected");
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/language/english/admin/findusers.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/language/english/admin/findusers.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/language/english/admin/findusers.php	(revision 405)
@@ -0,0 +1,51 @@
+<?php
+// $Id: findusers.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+//%%%%%%	File Name findusers.php 	%%%%%
+
+define("_AM_FINDUS","Find Users");
+define("_AM_AVATAR","Avatar");
+define("_AM_REALNAME","Real Name");
+define("_AM_REGDATE","Joined Date");
+define("_AM_EMAIL","Email");
+define("_AM_PM","PM");
+define("_AM_URL","URL");
+define("_AM_PREVIOUS","Previous");
+define("_AM_NEXT","Next");
+define("_AM_USERSFOUND","%s user(s) found");
+
+define("_AM_ACTUS", "Active Users: %s");
+define("_AM_INACTUS", "Inactive Users: %s");
+define("_AM_NOFOUND","No Users Found");
+define("_AM_UNAME","User Name");
+define("_AM_ICQ","ICQ Number");
+define("_AM_AIM","AIM Handle");
+define("_AM_YIM","YIM Handle");
+define("_AM_MSNM","MSNM Handle");
+define("_AM_LOCATION","Location contains");
+define("_AM_OCCUPATION","Occupation contains");
+define("_AM_INTEREST","Interest contains");
+define("_AM_URLC","URL contains");
+define("_AM_LASTLOGMORE","Last login is more than <span style='color:#ff0000;'>X</span> days ago");
+define("_AM_LASTLOGLESS","Last login is less than <span style='color:#ff0000;'>X</span> days ago");
+define("_AM_REGMORE","Joined date is more than <span style='color:#ff0000;'>X</span> days ago");
+define("_AM_REGLESS","Joined date is less than <span style='color:#ff0000;'>X</span> days ago");
+define("_AM_POSTSMORE","Number of Posts is greater than <span style='color:#ff0000;'>X</span>");
+define("_AM_POSTSLESS","Number of Posts is less than <span style='color:#ff0000;'>X</span>");
+define("_AM_SORT","Sort by");
+define("_AM_ORDER","Order");
+define("_AM_LASTLOGIN","Last login");
+define("_AM_POSTS","Number of posts");
+define("_AM_ASC","Ascending order");
+define("_AM_DESC","Descending order");
+define("_AM_LIMIT","Number of users per page");
+define("_AM_RESULTS", "Search results");
+define("_AM_SHOWMAILOK", "Type of users to show");
+define("_AM_MAILOK","Only users that accept mail");
+define("_AM_MAILNG","Only users that don't accept mail");
+define("_AM_SHOWTYPE", "Type of users to show");
+define("_AM_ACTIVE","Only active users");
+define("_AM_INACTIVE","Only inactive users");
+define("_AM_BOTH", "All users");
+define("_AM_SENDMAIL", "Send mail");
+define("_AM_ADD2GROUP", "Add users to %s group");
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/language/english/admin/mailusers.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/language/english/admin/mailusers.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/language/english/admin/mailusers.php	(revision 405)
@@ -0,0 +1,39 @@
+<?php
+// $Id: mailusers.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+//%%%%%%	Admin Module Name  MailUsers	%%%%%
+define("_AM_DBUPDATED",_MD_AM_DBUPDATED);
+
+//%%%%%%	mailusers.php 	%%%%%
+define("_AM_SENDTOUSERS","Send message to users whose:");
+define("_AM_SENDTOUSERS2","Send to:");
+define("_AM_GROUPIS","Group is (optional)");
+define("_AM_TIMEFORMAT", "(Format yyyy-mm-dd, optional)");
+define("_AM_LASTLOGMIN","Last Login is after");
+define("_AM_LASTLOGMAX","Last Login is before");
+define("_AM_REGDMIN","Registered date is after");
+define("_AM_REGDMAX","Registered date is before");
+define("_AM_IDLEMORE","Last Login was more than X days ago (optional)");
+define("_AM_IDLELESS","Last Login was less than X days ago (optional)");
+define("_AM_MAILOK","Send message only to users that accept notification messages (optional)");
+define("_AM_INACTIVE","Send message to inactive users only (optional)");
+define("_AMIFCHECKD", "If this is checked, all the above plus private messaging will be ignored");
+define("_AM_MAILFNAME","From Name (email only)");
+define("_AM_MAILFMAIL","From Email (email only)");
+define("_AM_MAILSUBJECT","Subject");
+define("_AM_MAILBODY","Body");
+define("_AM_MAILTAGS","Useful Tags:");
+define("_AM_MAILTAGS1","{X_UID} will print user id");
+define("_AM_MAILTAGS2","{X_UNAME} will print user name");
+define("_AM_MAILTAGS3","{X_UEMAIL} will print user email");
+define("_AM_MAILTAGS4","{X_UACTLINK} will print user activation link");
+define("_AM_SENDTO","Send to");
+define("_AM_EMAIL","Email");
+define("_AM_PM","Private Message");
+define("_AM_SENDMTOUSERS", "Send Message to Users");
+define("_AM_SENT", "Sent Users");
+define("_AM_SENTNUM", "%s - %s (total: %s users)");
+define("_AM_SENDNEXT", "Next");
+define("_AM_NOUSERMATCH", "No user matched");
+define("_AM_SENDCOMP", "Sending message completed.");
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/language/english/admin/images.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/language/english/admin/images.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/language/english/admin/images.php	(revision 405)
@@ -0,0 +1,25 @@
+<?php
+// $Id: images.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+//%%%%%% Image Manager %%%%%
+
+
+define('_MD_IMGMAIN','Image Manager Main');
+
+define('_MD_ADDIMGCAT','Add Image Category:');
+define('_MD_EDITIMGCAT','Edit Image Category:');
+define('_MD_IMGCATNAME','Category Name:');
+define('_MD_IMGCATRGRP','Select groups for image manager use:<br /><br /><span style="font-weight: normal;">These are groups allowed to use the image manager for selecting images but not uploading. Webmaster has automatic access.</span>');
+define('_MD_IMGCATWGRP','Select groups allowed to upload images:<br /><br /><span style="font-weight: normal;">Typical usage is for moderator and admin groups.</span>');
+define('_MD_IMGCATWEIGHT','Display order in image manager:');
+define('_MD_IMGCATDISPLAY','Display this category?');
+define('_MD_IMGCATSTRTYPE','Images are uploaded to:');
+define('_MD_STRTYOPENG','This can not be changed afterwards!');
+define('_MD_INDB',' Store in the database (as binary "blob" data)');
+define('_MD_ASFILE',' Store as files (in uploads directory)<br />');
+define('_MD_RUDELIMGCAT','Are you sure that you want to delete this category and all of its images files?');
+define('_MD_RUDELIMG','Are you sure that you want to delete this images file?');
+
+define('_MD_FAILDEL', 'Failed deleting image %s from the database');
+define('_MD_FAILDELCAT', 'Failed deleting image category %s from the database');
+define('_MD_FAILUNLINK', 'Failed deleting image %s from the server directory');
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/language/english/admin/smilies.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/language/english/admin/smilies.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/language/english/admin/smilies.php	(revision 405)
@@ -0,0 +1,21 @@
+<?php
+// $Id: smilies.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+//%%%%%%	Admin Module Name  Smilies 	%%%%%
+define('_AM_DBUPDATED',_MD_AM_DBUPDATED);
+
+define('_AM_SMILESCONTROL','Smilies Control');
+define('_AM_CODE','Code');
+define('_AM_SMILIE','Smilie');
+define('_AM_ACTION','Action');
+define('_AM_EDIT','Edit');
+define('_AM_DEL','Delete');
+define('_AM_CNRFTSD','Could not retrieve from the smilies database.');
+define('_AM_ADDSMILE','Add a Smilie');
+define('_AM_EDITSMILE','Edit a Smilie');
+define('_AM_SMILECODE','Smilie Code:');
+define('_AM_SMILEURL','Image URL:');
+define('_AM_SMILEEMOTION','Description:');
+define('_AM_ADD','Add');
+define('_AM_SAVE','Save');
+define('_AM_WAYSYWTDTS','WARNING: Are you sure you want to delete this Smile?');define('_AM_DISPLAYF', 'Display in form?');
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/language/english/admin/groups.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/language/english/admin/groups.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/language/english/admin/groups.php	(revision 405)
@@ -0,0 +1,37 @@
+<?php
+// $Id: groups.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+//%%%%%%	Admin Module Name  AdminGroup 	%%%%%
+define("_AM_DBUPDATED",_MD_AM_DBUPDATED);
+
+define("_AM_EDITADG","Edit Groups");
+define("_AM_MODIFY","Modify");
+define("_AM_DELETE","Delete");
+define("_AM_CREATENEWADG","Create New Group");
+define("_AM_NAME","Name");
+define("_AM_DESCRIPTION","Description");
+define("_AM_INDICATES","* indicates required fields");
+define("_AM_SYSTEMRIGHTS","System Admin rights");
+define("_AM_ACTIVERIGHTS","Module Admin rights");
+define("_AM_IFADMIN","If admin right for a module is checked, access right for the module will always be enabled.");
+define("_AM_ACCESSRIGHTS","Module Access rights");
+define("_AM_UPDATEADG","Update Group");
+define("_AM_MODIFYADG","Modify Group");
+define("_AM_DELETEADG","Delete Group");
+define("_AM_AREUSUREDEL","Are you sure you want to delete this group?");
+define("_AM_YES","Yes");
+define("_AM_NO","No");
+define("_AM_EDITMEMBER","Edit Members of this Group");
+define("_AM_MEMBERS","Members");
+define("_AM_NONMEMBERS","Non-members");
+define("_AM_ADDBUTTON"," add --> ");
+define("_AM_DELBUTTON","<--delete");
+define("_AM_UNEED2ENTER","You need to enter required info!");
+
+// Added in RC3
+define("_AM_BLOCKRIGHTS","Block Access Rights");
+
+define('_AM_FINDU4GROUP', 'Find users for this group');
+define('_AM_GROUPSMAIN', 'Groups Main');
+
+define('_AM_ADMINNO', 'There must be at least one user in the webmasters group');
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/language/english/admin/modulesadmin.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/language/english/admin/modulesadmin.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/language/english/admin/modulesadmin.php	(revision 405)
@@ -0,0 +1,60 @@
+<?php
+// $Id: modulesadmin.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+//%%%%%%	File Name  modulesadmin.php 	%%%%%
+define("_MD_AM_MODADMIN","Modules Administration");
+define("_MD_AM_MODULE","Module");
+define("_MD_AM_VERSION","Version");
+define("_MD_AM_LASTUP","Last Update");
+define("_MD_AM_DEACTIVATED","Deactivated");
+define("_MD_AM_ACTION","Action");
+define("_MD_AM_DEACTIVATE","Deactivate");
+define("_MD_AM_ACTIVATE","Activate");
+define("_MD_AM_UPDATE","Update");
+define("_MD_AM_DUPEN","Duplicate entry in modules table!");
+define("_MD_AM_DEACTED","The selected module has been deactivated. You can now safely uninstall the module.");
+define("_MD_AM_ACTED","The selected module has been activated!");
+define("_MD_AM_UPDTED","The selected module has been updated!");
+define("_MD_AM_SYSNO","System module cannot be deactivated.");
+define("_MD_AM_STRTNO","This module is set as your default start page. Please change the start module to whatever suits your preferences.");
+
+// added in RC2
+define("_MD_AM_PCMFM","Please confirm:");
+
+// added in RC3
+define("_MD_AM_ORDER","Order");
+define("_MD_AM_ORDER0","(0 = hide)");
+define("_MD_AM_ACTIVE","Active");
+define("_MD_AM_INACTIVE","Inactive");
+define("_MD_AM_NOTINSTALLED","Not Installed");
+define("_MD_AM_NOCHANGE","No Change");
+define("_MD_AM_INSTALL","Install");
+define("_MD_AM_UNINSTALL","Uninstall");
+define("_MD_AM_SUBMIT","Submit");
+define("_MD_AM_CANCEL","Cancel");
+define("_MD_AM_DBUPDATE","Database updated successfully!");
+define("_MD_AM_BTOMADMIN","Back to Module Administration page");
+
+// %s represents module name
+define("_MD_AM_FAILINS","Unable to install %s.");
+define("_MD_AM_FAILACT","Unable to activate %s.");
+define("_MD_AM_FAILDEACT","Unable to deactivate %s.");
+define("_MD_AM_FAILUPD","Unable to update %s.");
+define("_MD_AM_FAILUNINS","Unable to uninstall %s.");
+define("_MD_AM_FAILORDER","Unable to reorder %s.");
+define("_MD_AM_FAILWRITE","Unable to write to main menu.");
+define("_MD_AM_ALEXISTS","Module %s already exists.");
+define("_MD_AM_ERRORSC", "Error(s):");
+define("_MD_AM_OKINS","Module %s installed successfully.");
+define("_MD_AM_OKACT","Module %s activated successfully.");
+define("_MD_AM_OKDEACT","Module %s deactivated successfully.");
+define("_MD_AM_OKUPD","Module %s updated successfully.");
+define("_MD_AM_OKUNINS","Module %s uninstalled successfully.");
+define("_MD_AM_OKORDER","Module %s changed successfully.");
+
+define('_MD_AM_RUSUREINS', 'Press the button below to install this module');
+define('_MD_AM_RUSUREUPD', 'Press the button below to update this module');
+define('_MD_AM_RUSUREUNINS', 'Are you sure you would like to uninstall this module?');
+define('_MD_AM_LISTUPBLKS', 'The following blocks will be updated.<br />Select the blocks of which contents (template and options) may be overwritten.<br />');
+define('_MD_AM_NEWBLKS', 'New Blocks');
+define('_MD_AM_DEPREBLKS', 'Deprecated Blocks');
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/language/english/admin/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/language/english/admin/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/language/english/admin/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/language/english/admin/comments.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/language/english/admin/comments.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/language/english/admin/comments.php	(revision 405)
@@ -0,0 +1,11 @@
+<?php
+// $Id: comments.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+//%%%%%% Comment Manager %%%%%
+define('_MD_AM_COMMMAN','Comment Manager');
+
+define('_MD_AM_LISTCOMM','List Comments');
+define('_MD_AM_ALLMODS','All modules');
+define('_MD_AM_ALLSTATUS','Any status');
+define('_MD_AM_MODULE','Module');
+define('_MD_AM_COMFOUND','%s comment(s) found.');
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/language/english/admin/version.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/language/english/admin/version.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/language/english/admin/version.php	(revision 405)
@@ -0,0 +1,7 @@
+<?php
+// $Id: version.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+//%%%%%%	Admin Module Name  Version 	%%%%%
+define("_AM_DBUPDATED",_MD_AM_DBUPDATED);
+
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/language/english/admin/blocksadmin.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/language/english/admin/blocksadmin.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/language/english/admin/blocksadmin.php	(revision 405)
@@ -0,0 +1,67 @@
+<?php
+// $Id: blocksadmin.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+//%%%%%%	Admin Module Name  Blocks 	%%%%%
+define("_AM_DBUPDATED",_MD_AM_DBUPDATED);
+
+//%%%%%%	blocks.php 	%%%%%
+define("_AM_BADMIN","Blocks Administration");
+define("_AM_ADDBLOCK","Add a new block");
+define("_AM_LISTBLOCK","List all blocks");
+define("_AM_SIDE","Side");
+define("_AM_BLKDESC","Block Description");
+define("_AM_TITLE","Title");
+define("_AM_WEIGHT","Weight");
+define("_AM_ACTION","Action");
+define("_AM_BLKTYPE","Block Type");
+define("_AM_LEFT","Left");
+define("_AM_RIGHT","Right");
+define("_AM_CENTER","Center");
+define("_AM_VISIBLE","Visible");
+define("_AM_POSCONTT","Position of the additional content");
+define("_AM_ABOVEORG","Above the original content");
+define("_AM_AFTERORG","After the original content");
+define("_AM_EDIT","Edit");
+define("_AM_DELETE","Delete");
+define("_AM_SBLEFT","Side Block - Left");
+define("_AM_SBRIGHT","Side Block - Right");
+define("_AM_CBLEFT","Center Block - Left");
+define("_AM_CBRIGHT","Center Block - Right");
+define("_AM_CBCENTER","Center Block - Center");
+define("_AM_CONTENT","Content");
+define("_AM_OPTIONS","Options");
+define("_AM_CTYPE","Content Type");
+define("_AM_HTML","HTML");
+define("_AM_PHP","PHP Script");
+define("_AM_AFWSMILE","Auto Format (smilies enabled)");
+define("_AM_AFNOSMILE","Auto Format (smilies disabled)");
+define("_AM_SUBMIT","Submit");
+define("_AM_CUSTOMHTML","Custom Block (HTML)");
+define("_AM_CUSTOMPHP","Custom Block (PHP)");
+define("_AM_CUSTOMSMILE","Custom Block (Auto Format + smilies)");
+define("_AM_CUSTOMNOSMILE","Custom Block (Auto Format)");
+define("_AM_DISPRIGHT","Display only rightblocks");
+define("_AM_SAVECHANGES","Save Changes");
+define("_AM_EDITBLOCK","Edit a block");
+define("_AM_SYSTEMCANT","System blocks cannot be deleted!");
+define("_AM_MODULECANT","This block cannot be deleted directly! If you wish to disable this block, deactivate the module.");
+define("_AM_RUSUREDEL","Are you sure you want to delete block <b>%s</b>?");
+define("_AM_NAME","Name");
+define("_AM_USEFULTAGS","Useful Tags:");
+define("_AM_BLOCKTAG1","%s will print %s");
+define('_AM_SVISIBLEIN', 'Show blocks visible in %s');
+define('_AM_TOPPAGE', 'Top Page');
+define('_AM_VISIBLEIN', 'Visible in');
+define('_AM_ALLPAGES', 'All Pages');
+define('_AM_TOPONLY', 'Top Page Only');
+define('_AM_ADVANCED', 'Advanced Settings');
+define('_AM_BCACHETIME', 'Cache lifetime');
+define('_AM_BALIAS', 'Alias name');
+define('_AM_CLONE', 'Clone');  // clone a block
+define('_AM_CLONEBLK', 'Clone'); // cloned block
+define('_AM_CLONEBLOCK', 'Create a clone block');
+define('_AM_NOTSELNG', "'%s' is not selected!"); // error message
+define('_AM_EDITTPL', 'Edit Template');
+define('_AM_MODULE', 'Module');
+define('_AM_GROUP', 'Group');
+define('_AM_UNASSIGNED', 'Unassigned');
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/language/english/admin/banners.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/language/english/admin/banners.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/language/english/admin/banners.php	(revision 405)
@@ -0,0 +1,58 @@
+<?php
+// $Id: banners.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+//%%%%%%        Admin Module Name  Banners         %%%%%
+define("_AM_DBUPDATED",_MD_AM_DBUPDATED);
+
+define("_AM_CURACTBNR","Current Active Banners");
+define("_AM_BANNERID","Banner ID");
+define("_AM_IMPRESION","Impressions");
+define("_AM_IMPLEFT","Imp. Left");
+define("_AM_CLICKS","Clicks");
+define("_AM_NCLICKS","% Clicks");
+define("_AM_CLINAME","Client Name");
+define("_AM_FUNCTION","Functions");
+define("_AM_UNLIMIT","Unlimited");
+define("_AM_EDIT","Edit");
+define("_AM_DELETE","Delete");
+define("_AM_FINISHBNR","Finished Banners");
+define("_AM_IMPD","Imp.");
+define("_AM_STARTDATE","Date Started");
+define("_AM_ENDDATE","Date Ended");
+define("_AM_ADVCLI","Advertising Clients");
+define("_AM_ACTIVEBNR","Active Banners");
+define("_AM_CONTNAME","Contact Name");
+define("_AM_CONTMAIL","Contact Email");
+define("_AM_CLINAMET","Client Name:");
+define("_AM_ADDNWBNR","Add a New Banner");
+define("_AM_IMPPURCHT","Impressions Purchased:");
+define("_AM_IMGURLT","Image URL:");
+define("_AM_CLICKURLT","Click URL:");
+define("_AM_ADDBNR","Add Banner");
+define("_AM_ADDNWCLI","Add a New Client");
+define("_AM_CONTNAMET","Contact Name:");
+define("_AM_CONTMAILT","Contact Email:");
+define("_AM_CLILOGINT","Client Login:");
+define("_AM_CLIPASST","Client Password:");
+define("_AM_ADDCLI","Add Client");
+define("_AM_DELEBNR","Delete Banner");
+define("_AM_SUREDELE","Are you sure you want to delete this Banner?");
+define("_AM_NO","No");
+define("_AM_YES","Yes");
+define("_AM_EDITBNR","Edit Banner");
+define("_AM_ADDIMPT","Add More Impressions:");
+define("_AM_PURCHT","Purchased:");
+define("_AM_MADET","Made:");
+define("_AM_CHGBNR","Change Banner");
+define("_AM_DELEADC","Delete Advertising Client");
+define("_AM_SUREDELCLI","You are about to delete client <b>%s</b> and all its Banners!!!");
+define("_AM_NOBNRRUN","This client doesn't have any banner running now.");
+define("_AM_WARNING","WARNING!!!");
+define("_AM_ACTBNRRUN","This client has the following ACTIVE BANNERS running on our site:");
+define("_AM_SUREDELBNR","Are you sure you want to delete this Client and ALL its Banners?");
+define("_AM_EDITADVCLI","Edit Advertising Client");
+define("_AM_EXTINFO","Extra Info:");
+define("_AM_CHGCLI","Change Client");
+define("_AM_USEHTML","Use Html?");
+define("_AM_CODEHTML","Code Html:");
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/language/english/admin/userrank.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/language/english/admin/userrank.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/language/english/admin/userrank.php	(revision 405)
@@ -0,0 +1,28 @@
+<?php
+// $Id: userrank.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+//%%%%%%	Admin Module Name  UserRank 	%%%%%
+define("_AM_DBUPDATED",_MD_AM_DBUPDATED);
+define("_AM_RANKSSETTINGS","User Ranks Settings");
+define("_AM_TITLE","Title");
+define("_AM_MINPOST","Min. Posts");
+define("_AM_MAXPOST","Max. Posts");
+define("_AM_IMAGE","Image");
+define("_AM_SPERANK","Special Ranks");
+define("_AM_ON","on");
+define("_AM_OFF","off");
+define("_AM_EDIT","Edit");
+define("_AM_DEL","Delete");
+define("_AM_ADDNEWRANK","Add a New Rank");
+define("_AM_RANKTITLE","Rank Title");
+define("_AM_SPECIAL","Special");
+define("_AM_ADD","Add");
+define("_AM_EDITRANK","Edit Ranks");
+define("_AM_ACTIVE","active");
+define("_AM_SAVECHANGE","Save Changes");
+define("_AM_WAYSYWTDTR","WARNING: Are you sure you want to delete this Ranking?");
+define("_AM_YES","Yes");
+define("_AM_NO","No");
+define("_AM_VALIDUNDER","(A valid image file under <b>%s</b> directory)");
+define("_AM_SPECIALCAN","(Special ranks can be assigned to users irrespective of the number of user posts)");
+define("_AM_ACTION","Action");
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/language/english/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/language/english/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/language/english/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/language/english/admin.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/language/english/admin.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/language/english/admin.php	(revision 405)
@@ -0,0 +1,29 @@
+<?php
+// $Id: admin.php,v 1.2 2005/03/18 12:52:48 onokazu Exp $
+//%%%%%%	File Name  admin.php 	%%%%%
+define('_MD_AM_DBUPDATED','Database Updated Successfully!');
+
+
+// Admin Module Names
+define('_MD_AM_ADGS','Groups');
+define('_MD_AM_BANS','Banners');
+define('_MD_AM_BKAD','Blocks');
+define('_MD_AM_MDAD','Modules');
+define('_MD_AM_SMLS','Smilies');
+define('_MD_AM_RANK','User Ranks');
+define('_MD_AM_USER','Edit Users');
+define('_MD_AM_FINDUSER', 'Find Users');
+define('_MD_AM_PREF','Preferences');
+define('_MD_AM_VRSN','Version');
+define('_MD_AM_MLUS', 'Mail Users');
+define('_MD_AM_IMAGES', 'Image Manager');
+define('_MD_AM_AVATARS', 'Avatars');
+define('_MD_AM_TPLSETS', 'Templates');
+define('_MD_AM_COMMENTS', 'Comments');
+
+// Group permission phrases
+define('_MD_AM_PERMADDNG', 'Could not add %s permission to %s for group %s');
+define('_MD_AM_PERMADDOK','Added %s permission to %s for group %s');
+define('_MD_AM_PERMRESETNG','Could not reset group permission for module %s');
+define('_MD_AM_PERMADDNGP', 'All parent items must be selected.');
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/language/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/language/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/language/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/xoops_version.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/xoops_version.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/xoops_version.php	(revision 405)
@@ -0,0 +1,165 @@
+<?php
+// $Id: xoops_version.php,v 1.2 2005/03/18 12:52:38 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+$modversion['name'] = _MI_SYSTEM_NAME;
+$modversion['version'] = 1.00;
+$modversion['description'] = _MI_SYSTEM_DESC;
+$modversion['author'] = "";
+$modversion['credits'] = "The XOOPS Project";
+$modversion['help'] = "system.html";
+$modversion['license'] = "GPL see LICENSE";
+$modversion['official'] = 1;
+$modversion['image'] = "images/system_slogo.png";
+$modversion['dirname'] = "system";
+
+// Admin things
+$modversion['hasAdmin'] = 1;
+$modversion['adminindex'] = "admin.php";
+$modversion['adminmenu'] = "menu.php";
+
+// Templates
+$modversion['templates'][1]['file'] = 'system_imagemanager.html';
+$modversion['templates'][1]['description'] = '';
+$modversion['templates'][2]['file'] = 'system_imagemanager2.html';
+$modversion['templates'][2]['description'] = '';
+$modversion['templates'][3]['file'] = 'system_userinfo.html';
+$modversion['templates'][3]['description'] = '';
+$modversion['templates'][4]['file'] = 'system_userform.html';
+$modversion['templates'][4]['description'] = '';
+$modversion['templates'][5]['file'] = 'system_rss.html';
+$modversion['templates'][5]['description'] = '';
+$modversion['templates'][6]['file'] = 'system_redirect.html';
+$modversion['templates'][6]['description'] = '';
+$modversion['templates'][7]['file'] = 'system_comment.html';
+$modversion['templates'][7]['description'] = '';
+$modversion['templates'][8]['file'] = 'system_comments_flat.html';
+$modversion['templates'][8]['description'] = '';
+$modversion['templates'][9]['file'] = 'system_comments_thread.html';
+$modversion['templates'][9]['description'] = '';
+$modversion['templates'][10]['file'] = 'system_comments_nest.html';
+$modversion['templates'][10]['description'] = '';
+$modversion['templates'][11]['file'] = 'system_siteclosed.html';
+$modversion['templates'][11]['description'] = '';
+$modversion['templates'][12]['file'] = 'system_dummy.html';
+$modversion['templates'][12]['description'] = 'Dummy template file for holding non-template contents. This should not be edited.';
+$modversion['templates'][13]['file'] = 'system_notification_list.html';
+$modversion['templates'][13]['description'] = '';
+$modversion['templates'][14]['file'] = 'system_notification_select.html';
+$modversion['templates'][14]['description'] = '';
+
+// Blocks
+$modversion['blocks'][1]['file'] = "system_blocks.php";
+$modversion['blocks'][1]['name'] = _MI_SYSTEM_BNAME2;
+$modversion['blocks'][1]['description'] = "Shows user block";
+$modversion['blocks'][1]['show_func'] = "b_system_user_show";
+$modversion['blocks'][1]['template'] = 'system_block_user.html';
+
+$modversion['blocks'][2]['file'] = "system_blocks.php";
+$modversion['blocks'][2]['name'] = _MI_SYSTEM_BNAME3;
+$modversion['blocks'][2]['description'] = "Shows login form";
+$modversion['blocks'][2]['show_func'] = "b_system_login_show";
+$modversion['blocks'][2]['template'] = 'system_block_login.html';
+
+$modversion['blocks'][3]['file'] = "system_blocks.php";
+$modversion['blocks'][3]['name'] = _MI_SYSTEM_BNAME4;
+$modversion['blocks'][3]['description'] = "Shows search form block";
+$modversion['blocks'][3]['show_func'] = "b_system_search_show";
+$modversion['blocks'][3]['template'] = 'system_block_search.html';
+
+$modversion['blocks'][4]['file'] = "system_blocks.php";
+$modversion['blocks'][4]['name'] = _MI_SYSTEM_BNAME5;
+$modversion['blocks'][4]['description'] = "Shows contents waiting for approval";
+$modversion['blocks'][4]['show_func'] = "b_system_waiting_show";
+$modversion['blocks'][4]['template'] = 'system_block_waiting.html';
+
+$modversion['blocks'][5]['file'] = "system_blocks.php";
+$modversion['blocks'][5]['name'] = _MI_SYSTEM_BNAME6;
+$modversion['blocks'][5]['description'] = "Shows the main navigation menu of the site";
+$modversion['blocks'][5]['show_func'] = "b_system_main_show";
+$modversion['blocks'][5]['template'] = 'system_block_mainmenu.html';
+
+$modversion['blocks'][6]['file'] = "system_blocks.php";
+$modversion['blocks'][6]['name'] = _MI_SYSTEM_BNAME7;
+$modversion['blocks'][6]['description'] = "Shows basic info about the site and a link to Recommend Us pop up window";
+$modversion['blocks'][6]['show_func'] = "b_system_info_show";
+$modversion['blocks'][6]['edit_func'] = "b_system_info_edit";
+$modversion['blocks'][6]['options'] = "320|190|s_poweredby.gif|1";
+$modversion['blocks'][6]['template'] = 'system_block_siteinfo.html';
+
+$modversion['blocks'][7]['file'] = "system_blocks.php";
+$modversion['blocks'][7]['name'] = _MI_SYSTEM_BNAME8;
+$modversion['blocks'][7]['description'] = "Displays users/guests currently online";
+$modversion['blocks'][7]['show_func'] = "b_system_online_show";
+$modversion['blocks'][7]['template'] = 'system_block_online.html';
+
+$modversion['blocks'][8]['file'] = "system_blocks.php";
+$modversion['blocks'][8]['name'] = _MI_SYSTEM_BNAME9;
+$modversion['blocks'][8]['description'] = "Top posters";
+$modversion['blocks'][8]['show_func'] = "b_system_topposters_show";
+$modversion['blocks'][8]['options'] = "10|1";
+$modversion['blocks'][8]['edit_func'] = "b_system_topposters_edit";
+$modversion['blocks'][8]['template'] = 'system_block_topusers.html';
+
+$modversion['blocks'][9]['file'] = "system_blocks.php";
+$modversion['blocks'][9]['name'] = _MI_SYSTEM_BNAME10;
+$modversion['blocks'][9]['description'] = "Shows most recent users";
+$modversion['blocks'][9]['show_func'] = "b_system_newmembers_show";
+$modversion['blocks'][9]['options'] = "10|1";
+$modversion['blocks'][9]['edit_func'] = "b_system_newmembers_edit";
+$modversion['blocks'][9]['template'] = 'system_block_newusers.html';
+
+$modversion['blocks'][10]['file'] = "system_blocks.php";
+$modversion['blocks'][10]['name'] = _MI_SYSTEM_BNAME11;
+$modversion['blocks'][10]['description'] = "Shows most recent comments";
+$modversion['blocks'][10]['show_func'] = "b_system_comments_show";
+$modversion['blocks'][10]['options'] = "10";
+$modversion['blocks'][10]['edit_func'] = "b_system_comments_edit";
+$modversion['blocks'][10]['template'] = 'system_block_comments.html';
+
+// RMV-NOTIFY:
+// Adding a block...
+$modversion['blocks'][11]['file'] = "system_blocks.php";
+$modversion['blocks'][11]['name'] = _MI_SYSTEM_BNAME12;
+$modversion['blocks'][11]['description'] = "Shows notification options";
+$modversion['blocks'][11]['show_func'] = "b_system_notification_show";
+$modversion['blocks'][11]['template'] = 'system_block_notification.html';
+
+$modversion['blocks'][12]['file'] = "system_blocks.php";
+$modversion['blocks'][12]['name'] = _MI_SYSTEM_BNAME13;
+$modversion['blocks'][12]['description'] = "Shows theme selection box";
+$modversion['blocks'][12]['show_func'] = "b_system_themes_show";
+$modversion['blocks'][12]['options'] = "0|80";
+$modversion['blocks'][12]['edit_func'] = "b_system_themes_edit";
+$modversion['blocks'][12]['template'] = 'system_block_themes.html';
+
+// Menu
+$modversion['hasMain'] = 0;
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/style.css
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/style.css	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/style.css	(revision 405)
@@ -0,0 +1,66 @@
+/* General definitions */
+html { scrollbar-face-color: #eeeeee; scrollbar-highlight-color: #ffffff; scrollbar-shadow-color: #d5d5d5; scrollbar-3dlight-color: #000000; scrollbar-arrow-color: #000000; scrollbar-track-color: #ffffff; scrollbar-darkshadow-color: #000000;}
+
+body { background-color : transparent; font-size: 12px; font-family: Verdana, Arial, Helvetica, sans-serif; margin: 0px; padding: 0px;}
+
+img {border: none;}
+
+hr { height: 3px; border: 3px #E18A00 solid; width: 95%;}
+
+ul { margin: 2px; padding: 2px; list-style: decimal inside; text-align: left;}
+li { margin-left: 2px; list-style: square inside; color: #000000;}
+
+h1 { font-size: 20px;}
+h2 { font-size: 18px;}
+h3 { font-size: 16px;}
+h4 { font-size: 14px;}
+
+th {background-color: #2F5376; color: #FFFFFF; padding : 2px; vertical-align : middle;}
+
+a:link {text-decoration: none; color: #666666; font-weight: bold; background-color: transparent;}
+a:visited {text-decoration: none; color: #666666; font-weight: bold; background-color: transparent;}
+a:hover {text-decoration: none; color: #ff9966; font-weight: bold; background-color: transparent;}
+
+
+/* Code and Quote Definition */
+div.xoopsCode { font-size: 11px; color: #006600; background-color: #FAFAFA; border: #c2cdd6 1px dashed;}
+div.xoopsQuote { font-size: 11px; color: #444444; line-height: 125%; text-align: justify; background-color: #FAFAFA; border: #c2cdd6 1px dashed;}
+
+/* Links for Quotes */
+div.xoopsQuote a:link, div.xoopsQuote a:visited { color: #444444; font-weight: bold; background-color: transparent;}
+div.xoopsQuote a:hover, div.xoopsQuote a:active { color: #1778cb; background-color: transparent;}
+
+/* Redirect messages */
+div.errorMsg { background-color: #FF3737; color: White; text-align: center; border-top: 1px solid #DDDDFF; border-left: 1px solid #DDDDFF; border-right: 1px solid #AAAAAA; border-bottom: 1px solid #AAAAAA; font-weight: bold; padding: 10px;}
+div.confirmMsg { background-color : #DDFFDF; color: #136C99; text-align:center; border-top: 1px solid #DDDDFF; border-left: 1px solid #DDDDFF; border-right: 1px solid #AAAAAA; border-bottom: 1px solid #AAAAAA; font-weight : bold;}
+
+/* General small */
+.fontSmall { font-size : 10px; background-color: transparent;}
+a.fontSmall { color: #006699;}
+a.fontSmall:hover { color: #C23030; text-decoration: underline;}
+
+/*forms elements*/
+input { border-right: #000000 1px solid; border-top: #000000 1px solid; font: 11px verdana, arial, helvetica, sans-serif; border-left: #000000 1px solid;color: #000000; border-bottom: #000000 1px solid; background-color: #ffffff;}
+textarea { border: #000000 1px solid; width: 430px; font: 11px verdana, arial, helvetica, sans-serif;}
+input.formTextBox { border: #000000 1px solid; background: #ffffff; font: 11px verdana, arial, helvetica, sans-serif;}
+select { border: #000000 1px solid; font: 11px verdana, arial, helvetica, sans-serif;}
+
+div.content { text-align: left; padding: 0px 15px 0px 15px;}
+
+.xoopsCenter { text-align:center;}
+
+.bg1 { background-color: #E6E6E6;}
+.bg2 { background-color: #2F5376;}
+.bg3 { background-color: #2F5376; color: #ffffff;}
+.bg4 { background-color: #ECECEC;}
+.bg5 { background-color: #ECECEC;}
+
+.outer {border: 1px solid silver;}
+.head {background-color: #c2cdd6; padding: 5px; font-weight: bold;}
+.even {background-color: #dee3e7; padding: 5px;}
+.odd {background-color: #E6E6E6; padding: 5px;}
+.foot {background-color: #c2cdd6; padding: 5px; font-weight: bold;}
+tr.head td {background-color: #c2cdd6; padding: 5px; font-weight: bold;}
+tr.even td {background-color: #dee3e7; padding: 5px;}
+tr.odd td {background-color: #E6E6E6; padding: 5px;}
+tr.foot td {background-color: #c2cdd6; padding: 5px; font-weight: bold;}
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/modulesadmin/xoops_version.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/modulesadmin/xoops_version.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/modulesadmin/xoops_version.php	(revision 405)
@@ -0,0 +1,44 @@
+<?php
+// $Id: xoops_version.php,v 1.2 2005/03/18 12:52:38 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+$modversion['name'] = _MD_AM_MDAD;
+$modversion['version'] = "";
+$modversion['description'] = "Modules Administration";
+$modversion['author'] = "Kazumi Ono<br>( http://www.mywebaddons.com/ )";
+$modversion['credits'] = "";
+$modversion['help'] = "modulesadmin.html";
+$modversion['license'] = "GPL see LICENSE";
+$modversion['official'] = 1;
+$modversion['image'] = "modulesadmin.gif";
+$modversion['hasAdmin'] = 1;
+$modversion['adminpath'] = "admin.php?fct=modulesadmin";
+$modversion['category'] = XOOPS_SYSTEM_MODULE;
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/modulesadmin/modulesadmin.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/modulesadmin/modulesadmin.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/modulesadmin/modulesadmin.php	(revision 405)
@@ -0,0 +1,755 @@
+<?php
+// $Id: modulesadmin.php,v 1.5 2006/05/01 02:37:30 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+if ( !is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid()) ) {
+    exit("Access Denied");
+}
+
+/**
+ * @brief display error message & exit (Tentative)
+ */
+function system_modulesadmin_error($message)
+{
+    xoops_cp_header();
+    xoops_error($message);
+    xoops_cp_footer();
+    exit();
+}
+
+function xoops_module_list()
+{
+        xoops_cp_header();
+    //OpenTable();
+    echo "
+    <h4 style='text-align:left'>"._MD_AM_MODADMIN."</h4>
+    <form action='admin.php' method='post' name='moduleadmin' id='moduleadmin'>
+    <table class='outer' width='100%' cellpadding='4' cellspacing='1'>
+    <tr align='center'><th>"._MD_AM_MODULE."</th><th>"._MD_AM_VERSION."</th><th>"._MD_AM_LASTUP."</th><th>"._MD_AM_ACTIVE."</th><th>"._MD_AM_ORDER."<br /><small>"._MD_AM_ORDER0."</small></th><th>"._MD_AM_ACTION."</th></tr>
+    ";
+    $module_handler =& xoops_gethandler('module');
+    $installed_mods =& $module_handler->getObjects(new CriteriaCompo());
+    $listed_mods = array();
+    $count = 0;
+    foreach ( $installed_mods as $module ) {
+        if ($count % 2 == 0) {
+            $class = 'even';
+        } else {
+            $class = 'odd';
+        }
+        $count++;
+        echo "<tr class='$class' align='center' valign='middle'>\n";
+        echo "<td valign='bottom'>";
+        if ( $module->getVar('hasadmin') == 1 && $module->getVar('isactive') == 1) {
+            echo '<a href="'.XOOPS_URL.'/modules/'.$module->getVar('dirname').'/'.$module->getInfo('adminindex').'"><img src="'.XOOPS_URL.'/modules/'.$module->getVar('dirname').'/'.$module->getInfo('image').'" alt="'.$module->getVar('name', 'E').'" border="0" /></a><br /><input type="text" name="newname['.$module->getVar('mid').']" value="'.$module->getVar('name', 'E').'" maxlength="150" size="20" />';
+        } else {
+            echo '<img src="'.XOOPS_URL.'/modules/'.$module->getVar('dirname').'/'.$module->getInfo('image').'" alt="'.$module->getVar('name', 'E').'" border="0" /><br /><input type="text" name="newname['.$module->getVar('mid').']" value="'.$module->getVar('name', 'E').'" maxlength="150" size="20" />';
+        }
+        echo '<input type="hidden" name="oldname['.$module->getVar('mid').']" value="' .$module->getVar('name').'" /></td>';
+        echo "<td align='center'>".round($module->getVar('version') / 100, 2)."</td><td align='center'>".formatTimestamp($module->getVar('last_update'),'m')."<br />";
+        if ($module->getVar('dirname') != 'system' && $module->getVar('isactive') == 1) {
+            echo '</td><td><input type="checkbox" name="newstatus['.$module->getVar('mid').']" value="1" checked="checked" /><input type="hidden" name="oldstatus['.$module->getVar('mid').']" value="1" />';
+            $extra = '<a href="'.XOOPS_URL.'/modules/system/admin.php?fct=modulesadmin&amp;op=update&amp;module='.$module->getVar('dirname').'"><img src="'.XOOPS_URL.'/modules/system/images/update.gif" alt="'._MD_AM_UPDATE.'" /></a>';
+        } elseif ($module->getVar('dirname') != 'system') {
+            echo '</td><td><input type="checkbox" name="newstatus['.$module->getVar('mid').']" value="1" /><input type="hidden" name="oldstatus['.$module->getVar('mid').']" value="0" />';
+            $extra = '<a href="'.XOOPS_URL.'/modules/system/admin.php?fct=modulesadmin&amp;op=update&amp;module='.$module->getVar('dirname').'"><img src="'.XOOPS_URL.'/modules/system/images/update.gif" alt="'._MD_AM_UPDATE.'" /></a>&nbsp;<a href="'.XOOPS_URL.'/modules/system/admin.php?fct=modulesadmin&amp;op=uninstall&amp;module='.$module->getVar('dirname').'"><img src="'.XOOPS_URL.'/modules/system/images/uninstall.gif" alt="'._MD_AM_UNINSTALL.'" /></a>';
+        } else {
+            echo '</td><td><input type="checkbox" name="newstatus['.$module->getVar('mid').']" value="1" checked="checked" /><input type="hidden" name="oldstatus['.$module->getVar('mid').']" value="1" />';
+            $extra = '<a href="'.XOOPS_URL.'/modules/system/admin.php?fct=modulesadmin&amp;op=update&amp;module='.$module->getVar('dirname').'"><img src="'.XOOPS_URL.'/modules/system/images/update.gif" alt="'._MD_AM_UPDATE.'" /></a>';
+        }
+        echo "</td><td>";
+        if ($module->getVar('hasmain') == 1) {
+            echo '<input type="hidden" name="oldweight['.$module->getVar('mid').']" value="'.$module->getVar('weight').'" /><input type="text" name="weight['.$module->getVar('mid').']" size="3" maxlength="5" value="'.$module->getVar('weight').'" />';
+        } else {
+            echo '<input type="hidden" name="oldweight['.$module->getVar('mid').']" value="0" /><input type="hidden" name="weight['.$module->getVar('mid').']" value="0" />';
+        }
+        echo "
+        </td>
+        <td>".$extra."&nbsp;<a href='javascript:openWithSelfMain(\"".XOOPS_URL."/modules/system/admin.php?fct=version&amp;mid=".$module->getVar('mid')."\",\"Info\",300,230);'>";
+        echo '<img src="'.XOOPS_URL.'/modules/system/images/info.gif" alt="'._INFO.'" /></a><input type="hidden" name="module[]" value="'.$module->getVar('mid').'" /></td>
+        </tr>
+        ';
+        $listed_mods[] = $module->getVar('dirname');
+    }
+    echo "<tr class='foot'><td colspan='6' align='center'><input type='hidden' name='fct' value='modulesadmin' />
+    <input type='hidden' name='op' value='confirm' />
+    <input type='submit' name='submit' value='"._MD_AM_SUBMIT."' />
+    </td></tr></table>
+    </form>
+    <br />
+    <table width='100%' border='0' class='outer' cellpadding='4' cellspacing='1'>
+    <tr align='center'><th>"._MD_AM_MODULE."</th><th>"._MD_AM_VERSION."</th><th>"._MD_AM_ACTION."</th></tr>
+    ";
+    $modules_dir = XOOPS_ROOT_PATH."/modules";
+    $handle = opendir($modules_dir);
+    $count = 0;
+    while ($file = readdir($handle)) {
+        clearstatcache();
+        $file = trim($file);
+        if ($file != '' && strtolower($file) != 'cvs' && !preg_match("/^\..*$/",$file) && is_dir($modules_dir.'/'.$file)) {
+            if ( !in_array($file, $listed_mods) ) {
+                $module =& $module_handler->create();
+                $module->loadInfo($file);
+                if ($count % 2 == 0) {
+                    $class = 'even';
+                } else {
+                    $class = 'odd';
+                }
+                echo '<tr class="'.$class.'" align="center" valign="middle">
+                <td align="center" valign="bottom"><img src="'.XOOPS_URL.'/modules/'.$module->getInfo('dirname').'/'.$module->getInfo('image').'" alt="'.htmlspecialchars($module->getInfo('name')).'" border="0" /></td>
+                <td align="center">'.round($module->getInfo('version'), 2).'</td>
+                <td>
+                <a href="'.XOOPS_URL.'/modules/system/admin.php?fct=modulesadmin&amp;op=install&amp;module='.$module->getInfo('dirname').'"><img src="'.XOOPS_URL.'/modules/system/images/install.gif" alt="'._MD_AM_INSTALL.'" /></a>';
+                echo "&nbsp;<a href='javascript:openWithSelfMain(\"".XOOPS_URL."/modules/system/admin.php?fct=version&amp;mid=".$module->getInfo('dirname')."\",\"Info\",300,230);'>";
+                echo '<img src="'.XOOPS_URL.'/modules/system/images/info.gif" alt="'._INFO.'" /></a></td></tr>
+                ';
+                unset($module);
+                $count++;
+            }
+        }
+    }
+    echo "</table>";
+    //CloseTable();
+    xoops_cp_footer();
+}
+
+function xoops_module_install($dirname)
+{
+    global $xoopsUser, $xoopsConfig;
+    $dirname = trim($dirname);
+    $db =& Database::getInstance();
+ $reservedTables = array('avatar', 'avatar_users_link', 'block_module_link', 'xoopscomments', 'config', 'configcategory', 'configoption', 'image', 'imagebody', 'imagecategory', 'imgset', 'imgset_tplset_link', 'imgsetimg', 'groups','groups_users_link','group_permission', 'online', 'bannerclient', 'banner', 'bannerfinish', 'priv_msgs', 'ranks', 'session', 'smiles', 'users', 'newblocks', 'modules', 'tplfile', 'tplset', 'tplsource', 'xoopsnotifications', 'banner', 'bannerclient', 'bannerfinish');
+    $module_handler =& xoops_gethandler('module');
+    if ($module_handler->getCount(new Criteria('dirname', $dirname)) == 0) {
+        $module =& $module_handler->create();
+        $module->loadInfoAsVar($dirname);
+        $module->setVar('weight', 1);
+        $error = false;
+        $errs = array();
+        $sqlfile =& $module->getInfo('sqlfile');
+        $msgs = array();
+        $msgs[] = '<h4 style="text-align:left;margin-bottom: 0px;border-bottom: dashed 1px #000000;">Installing '.$module->getInfo('name').'</h4>';
+        if ($module->getInfo('image') != false && trim($module->getInfo('image')) != '') {
+            $msgs[] ='<img src="'.XOOPS_URL.'/modules/'.$dirname.'/'.trim($module->getInfo('image')).'" alt="" />';
+        }
+        $msgs[] ='<b>Version:</b> '.$module->getInfo('version');
+        if ($module->getInfo('author') != false && trim($module->getInfo('author')) != '') {
+            $msgs[] ='<b>Author:</b> '.trim($module->getInfo('author'));
+        }
+        $msgs[] = '';
+        $errs[] = '<h4 style="text-align:left;margin-bottom: 0px;border-bottom: dashed 1px #000000;">Installing '.$module->getInfo('name').'</h4>';
+        if ($sqlfile != false && is_array($sqlfile)) {
+
+            $sql_file_path = XOOPS_ROOT_PATH."/modules/".$dirname."/".$sqlfile[XOOPS_DB_TYPE];
+            if (!file_exists($sql_file_path)) {
+                $errs[] = "SQL file not found at <b>$sql_file_path</b>";
+                $error = true;
+            } else {
+                $msgs[] = "SQL file found at <b>$sql_file_path</b>.<br  /> Creating tables...";
+                include_once XOOPS_ROOT_PATH.'/class/database/sqlutility.php';
+                $sql_query = fread(fopen($sql_file_path, 'r'), filesize($sql_file_path));
+                $sql_query = trim($sql_query);
+                SqlUtility::splitMySqlFile($pieces, $sql_query);
+                $created_tables = array();
+                foreach ($pieces as $piece) {
+                    // [0] contains the prefixed query
+                    // [4] contains unprefixed table name
+                    $prefixed_query = SqlUtility::prefixQuery($piece, $db->prefix());
+                    if (!$prefixed_query) {
+                        $errs[] = "<b>$piece</b> is not a valid SQL!";
+                        $error = true;
+                        break;
+                    }
+                    // check if the table name is reserved
+                    if (!in_array($prefixed_query[4], $reservedTables)) {
+                        // not reserved, so try to create one
+                        if (!$db->query($prefixed_query[0])) {
+                            $errs[] = $db->error();
+                            $error = true;
+                            break;
+                        } else {
+
+                            if (!in_array($prefixed_query[4], $created_tables)) {
+                                $msgs[] = '&nbsp;&nbsp;Table <b>'.$db->prefix($prefixed_query[4]).'</b> created.';
+                                $created_tables[] = $prefixed_query[4];
+                            } else {
+                                $msgs[] = '&nbsp;&nbsp;Data inserted to table <b>'.$db->prefix($prefixed_query[4]).'</b>.';
+                            }
+                        }
+                    } else {
+                        // the table name is reserved, so halt the installation
+                        $errs[] = '<b>'.$prefixed_query[4]."</b> is a reserved table!";
+                        $error = true;
+                        break;
+                    }
+                }
+                // if there was an error, delete the tables created so far, so the next installation will not fail
+                if ($error == true) {
+                    foreach ($created_tables as $ct) {
+                        //echo $ct;
+                        $db->query("DROP TABLE ".$db->prefix($ct));
+                    }
+                }
+            }
+        }
+        // if no error, save the module info and blocks info associated with it
+        if ($error == false) {
+            if (!$module_handler->insert($module)) {
+                $errs[] = 'Could not insert <b>'.$module->getVar('name').'</b> to database.';
+                foreach ($created_tables as $ct) {
+                    $db->query("DROP TABLE ".$db->prefix($ct));
+                }
+                $ret = "<p>".sprintf(_MD_AM_FAILINS, "<b>".$module->name()."</b>")."&nbsp;"._MD_AM_ERRORSC."<br />";
+                foreach ( $errs as $err ) {
+                    $ret .= " - ".$err."<br />";
+                }
+                $ret .= "</p>";
+                unset($module);
+                unset($created_tables);
+                unset($errs);
+                unset($msgs);
+                return $ret;
+            } else {
+                $newmid = $module->getVar('mid');
+                unset($created_tables);
+                $msgs[] = 'Module data inserted successfully. Module ID: <b>'.$newmid.'</b>';
+                $tplfile_handler =& xoops_gethandler('tplfile');
+                $templates = $module->getInfo('templates');
+                if ($templates != false) {
+                    $msgs[] = 'Adding templates...';
+                    foreach ($templates as $tpl) {
+                        $tplfile =& $tplfile_handler->create();
+                        $tpldata =& xoops_module_gettemplate($dirname, $tpl['file']);
+                        $tplfile->setVar('tpl_source', $tpldata, true);
+                        $tplfile->setVar('tpl_refid', $newmid);
+
+                        $tplfile->setVar('tpl_tplset', 'default');
+                        $tplfile->setVar('tpl_file', $tpl['file']);
+                        $tplfile->setVar('tpl_desc', $tpl['description'], true);
+                        $tplfile->setVar('tpl_module', $dirname);
+                        $tplfile->setVar('tpl_lastmodified', time());
+                        $tplfile->setVar('tpl_lastimported', 0);
+                        $tplfile->setVar('tpl_type', 'module');
+                        if (!$tplfile_handler->insert($tplfile)) {
+                            $msgs[] = '&nbsp;&nbsp;<span style="color:#ff0000;">ERROR: Could not insert template <b>'.$tpl['file'].'</b> to the database.</span>';
+                        } else {
+                            $newtplid = $tplfile->getVar('tpl_id');
+                            $msgs[] = '&nbsp;&nbsp;Template <b>'.$tpl['file'].'</b> added to the database. (ID: <b>'.$newtplid.'</b>)';
+                            // generate compiled file
+                            include_once XOOPS_ROOT_PATH.'/class/template.php';
+                            if (!xoops_template_touch($newtplid)) {
+                                $msgs[] = '&nbsp;&nbsp;<span style="color:#ff0000;">ERROR: Failed compiling template <b>'.$tpl['file'].'</b>.</span>';
+                            } else {
+                                $msgs[] = '&nbsp;&nbsp;Template <b>'.$tpl['file'].'</b> compiled.</span>';
+                            }
+                        }
+                        unset($tpldata);
+                    }
+                }
+                include_once XOOPS_ROOT_PATH.'/class/template.php';
+                xoops_template_clear_module_cache($newmid);
+                $blocks = $module->getInfo('blocks');
+                if ($blocks != false) {
+                    $msgs[] = 'Adding blocks...';
+                    foreach ($blocks as $blockkey => $block) {
+                        // break the loop if missing block config
+                        if (!isset($block['file']) || !isset($block['show_func'])) {
+                            break;
+                        }
+                        $options = '';
+                        if (!empty($block['options'])) {
+                            $options = trim($block['options']);
+                        }
+                        $newbid = $db->genId($db->prefix('newblocks').'_bid_seq');
+                        $edit_func = isset($block['edit_func']) ? trim($block['edit_func']) : '';
+                        $template = '';
+                        if ((isset($block['template']) && trim($block['template']) != '')) {
+                            $content =& xoops_module_gettemplate($dirname, $block['template'], true);
+                        }
+                        if (!isset($content)) {
+                            $content = '';
+                        } else {
+                            $template = trim($block['template']);
+                        }
+                        $block_name = addslashes(trim($block['name']));
+                        $sql = "INSERT INTO ".$db->prefix("newblocks")." (bid, mid, func_num, options, name, title, content, side, weight, visible, block_type, c_type, isactive, dirname, func_file, show_func, edit_func, template, bcachetime, last_modified) VALUES ($newbid, $newmid, ".intval($blockkey).", '$options', '".$block_name."','".$block_name."', '', 0, 0, 0, 'M', 'H', 1, '".addslashes($dirname)."', '".addslashes(trim($block['file']))."', '".addslashes(trim($block['show_func']))."', '".addslashes($edit_func)."', '".$template."', 0, ".time().")";
+                        if (!$db->query($sql)) {
+                            $msgs[] = '&nbsp;&nbsp;<span style="color:#ff0000;">ERROR: Could not add block <b>'.$block['name'].'</b> to the database! Database error: <b>'.$db->error().'</b></span>';
+                        } else {
+                            if (empty($newbid)) {
+                                $newbid = $db->getInsertId();
+                            }
+                            $msgs[] = '&nbsp;&nbsp;Block <b>'.$block['name'].'</b> added. Block ID: <b>'.$newbid.'</b>';
+                            $sql = 'INSERT INTO '.$db->prefix('block_module_link').' (block_id, module_id) VALUES ('.$newbid.', -1)';
+                            $db->query($sql);
+                            if ($template != '') {
+                                $tplfile =& $tplfile_handler->create();
+                                $tplfile->setVar('tpl_refid', $newbid);
+                                $tplfile->setVar('tpl_source', $content, true);
+                                $tplfile->setVar('tpl_tplset', 'default');
+                                $tplfile->setVar('tpl_file', $block['template']);
+                                $tplfile->setVar('tpl_module', $dirname);
+                                $tplfile->setVar('tpl_type', 'block');
+                                $tplfile->setVar('tpl_desc', $block['description'], true);
+                                $tplfile->setVar('tpl_lastimported', 0);
+                                $tplfile->setVar('tpl_lastmodified', time());
+                                if (!$tplfile_handler->insert($tplfile)) {
+                                    $msgs[] = '&nbsp;&nbsp;<span style="color:#ff0000;">ERROR: Could not insert template <b>'.$block['template'].'</b> to the database.</span>';
+                                } else {
+                                    $newtplid = $tplfile->getVar('tpl_id');
+                                    $msgs[] = '&nbsp;&nbsp;Template <b>'.$block['template'].'</b> added to the database. (ID: <b>'.$newtplid.'</b>)';
+                                    // generate compiled file
+                                    include_once XOOPS_ROOT_PATH.'/class/template.php';
+                                    if (!xoops_template_touch($newtplid)) {
+                                        $msgs[] = '&nbsp;&nbsp;<span style="color:#ff0000;">ERROR: Failed compiling template <b>'.$block['template'].'</b>.</span>';
+                                    } else {
+                                        $msgs[] = '&nbsp;&nbsp;Template <b>'.$block['template'].'</b> compiled.</span>';
+                                    }
+                                }
+                            }
+                        }
+                        unset($content);
+                    }
+                    unset($blocks);
+                }
+                $configs = $module->getInfo('config');
+                if ($configs != false) {
+                    if ($module->getVar('hascomments') != 0) {
+                        include_once(XOOPS_ROOT_PATH.'/include/comment_constants.php');
+                        array_push($configs, array('name' => 'com_rule', 'title' => '_CM_COMRULES', 'description' => '', 'formtype' => 'select', 'valuetype' => 'int', 'default' => 1, 'options' => array('_CM_COMNOCOM' => XOOPS_COMMENT_APPROVENONE, '_CM_COMAPPROVEALL' => XOOPS_COMMENT_APPROVEALL, '_CM_COMAPPROVEUSER' => XOOPS_COMMENT_APPROVEUSER, '_CM_COMAPPROVEADMIN' => XOOPS_COMMENT_APPROVEADMIN)));
+                        array_push($configs, array('name' => 'com_anonpost', 'title' => '_CM_COMANONPOST', 'description' => '', 'formtype' => 'yesno', 'valuetype' => 'int', 'default' => 0));
+                    }
+                } else {
+                    if ($module->getVar('hascomments') != 0) {
+                        $configs = array();
+                        include_once(XOOPS_ROOT_PATH.'/include/comment_constants.php');
+                        $configs[] = array('name' => 'com_rule', 'title' => '_CM_COMRULES', 'description' => '', 'formtype' => 'select', 'valuetype' => 'int', 'default' => 1, 'options' => array('_CM_COMNOCOM' => XOOPS_COMMENT_APPROVENONE, '_CM_COMAPPROVEALL' => XOOPS_COMMENT_APPROVEALL, '_CM_COMAPPROVEUSER' => XOOPS_COMMENT_APPROVEUSER, '_CM_COMAPPROVEADMIN' => XOOPS_COMMENT_APPROVEADMIN));
+                        $configs[] = array('name' => 'com_anonpost', 'title' => '_CM_COMANONPOST', 'description' => '', 'formtype' => 'yesno', 'valuetype' => 'int', 'default' => 0);
+                    }
+                }
+                // RMV-NOTIFY
+                if ($module->getVar('hasnotification') != 0) {
+                    if (empty($configs)) {
+                        $configs = array();
+                    }
+                    // Main notification options
+                    include_once XOOPS_ROOT_PATH . '/include/notification_constants.php';
+                    include_once XOOPS_ROOT_PATH . '/include/notification_functions.php';
+                    $options = array();
+                    $options['_NOT_CONFIG_DISABLE'] = XOOPS_NOTIFICATION_DISABLE;
+                    $options['_NOT_CONFIG_ENABLEBLOCK'] = XOOPS_NOTIFICATION_ENABLEBLOCK;
+                    $options['_NOT_CONFIG_ENABLEINLINE'] = XOOPS_NOTIFICATION_ENABLEINLINE;
+                    $options['_NOT_CONFIG_ENABLEBOTH'] = XOOPS_NOTIFICATION_ENABLEBOTH;
+
+                    //$configs[] = array ('name' => 'notification_enabled', 'title' => '_NOT_CONFIG_ENABLED', 'description' => '_NOT_CONFIG_ENABLEDDSC', 'formtype' => 'yesno', 'valuetype' => 'int', 'default' => 1);
+                    $configs[] = array ('name' => 'notification_enabled', 'title' => '_NOT_CONFIG_ENABLE', 'description' => '_NOT_CONFIG_ENABLEDSC', 'formtype' => 'select', 'valuetype' => 'int', 'default' => XOOPS_NOTIFICATION_ENABLEBOTH, 'options' => $options);
+                    // Event-specific notification options
+                    // FIXME: doesn't work when update module... can't read back the array of options properly...  " changing to &quot;
+                    $options = array();
+                    $categories =& notificationCategoryInfo('',$module->getVar('mid'));
+                    foreach ($categories as $category) {
+                        $events =& notificationEvents ($category['name'], false, $module->getVar('mid'));
+                        foreach ($events as $event) {
+                            if (!empty($event['invisible'])) {
+                                continue;
+                            }
+                            $option_name = $category['title'] . ' : ' . $event['title'];
+                            $option_value = $category['name'] . '-' . $event['name'];
+                            $options[$option_name] = $option_value;
+                        }
+                    }
+                    $configs[] = array ('name' => 'notification_events', 'title' => '_NOT_CONFIG_EVENTS', 'description' => '_NOT_CONFIG_EVENTSDSC', 'formtype' => 'select_multi', 'valuetype' => 'array', 'default' => array_values($options), 'options' => $options);
+                }
+
+                if ($configs != false) {
+                    $msgs[] = 'Adding module config data...';
+                    $config_handler =& xoops_gethandler('config');
+                    $order = 0;
+                    foreach ($configs as $config) {
+                        $confobj =& $config_handler->createConfig();
+                        $confobj->setVar('conf_modid', $newmid);
+                        $confobj->setVar('conf_catid', 0);
+                        $confobj->setVar('conf_name', $config['name']);
+                        $confobj->setVar('conf_title', $config['title'], true);
+                        $confobj->setVar('conf_desc', $config['description'], true);
+                        $confobj->setVar('conf_formtype', $config['formtype']);
+                        $confobj->setVar('conf_valuetype', $config['valuetype']);
+                        $confobj->setConfValueForInput($config['default'], true);
+                        //$confobj->setVar('conf_value', $config['default'], true);
+                        $confobj->setVar('conf_order', $order);
+                        $confop_msgs = '';
+                        if (isset($config['options']) && is_array($config['options'])) {
+                            foreach ($config['options'] as $key => $value) {
+                                $confop =& $config_handler->createConfigOption();
+                                $confop->setVar('confop_name', $key, true);
+                                $confop->setVar('confop_value', $value, true);
+                                $confobj->setConfOptions($confop);
+                                $confop_msgs .= '<br />&nbsp;&nbsp;&nbsp;&nbsp;Config option added. Name: <b>'.$key.'</b> Value: <b>'.$value.'</b>';
+                                unset($confop);
+                            }
+                        }
+                        $order++;
+                        if ($config_handler->insertConfig($confobj) != false) {
+                            $msgs[] = '&nbsp;&nbsp;Config <b>'.$config['name'].'</b> added to the database.'.$confop_msgs;
+                        } else {
+                            $msgs[] = '&nbsp;&nbsp;<span style="color:#ff0000;">ERROR: Could not insert config <b>'.$config['name'].'</b> to the database.</span>';
+                        }
+                        unset($confobj);
+                    }
+                    unset($configs);
+                }
+            }
+
+            $groups = $xoopsUser->getGroups();
+            // retrieve all block ids for this module
+            $blocks =& XoopsBlock::getByModule($newmid, false);
+            $msgs[] = 'Setting group rights...';
+            $gperm_handler =& xoops_gethandler('groupperm');
+            foreach ($groups as $mygroup) {
+                if ($gperm_handler->checkRight('module_admin', 0, $mygroup)) {
+                    $mperm =& $gperm_handler->create();
+                    $mperm->setVar('gperm_groupid', $mygroup);
+                    $mperm->setVar('gperm_itemid', $newmid);
+                    $mperm->setVar('gperm_name', 'module_admin');
+                    $mperm->setVar('gperm_modid', 1);
+                    if (!$gperm_handler->insert($mperm)) {
+                        $msgs[] = '&nbsp;&nbsp;<span style="color:#ff0000;">ERROR: Could not add admin access right for Group ID <b>'.$mygroup.'</b></span>';
+                    } else {
+                        $msgs[] = '&nbsp;&nbsp;Added admin access right for Group ID <b>'.$mygroup.'</b>';
+                    }
+                    unset($mperm);
+                }
+                $mperm =& $gperm_handler->create();
+                $mperm->setVar('gperm_groupid', $mygroup);
+                $mperm->setVar('gperm_itemid', $newmid);
+                $mperm->setVar('gperm_name', 'module_read');
+                $mperm->setVar('gperm_modid', 1);
+                if (!$gperm_handler->insert($mperm)) {
+                    $msgs[] = '&nbsp;&nbsp;<span style="color:#ff0000;">ERROR: Could not add user access right for Group ID: <b>'.$mygroup.'</b></span>';
+                } else {
+                    $msgs[] = '&nbsp;&nbsp;Added user access right for Group ID: <b>'.$mygroup.'</b>';
+                }
+                unset($mperm);
+                foreach ($blocks as $blc) {
+                    $bperm =& $gperm_handler->create();
+                    $bperm->setVar('gperm_groupid', $mygroup);
+                    $bperm->setVar('gperm_itemid', $blc);
+                    $bperm->setVar('gperm_name', 'block_read');
+                    $bperm->setVar('gperm_modid', 1);
+                    if (!$gperm_handler->insert($bperm)) {
+                        $msgs[] = '&nbsp;&nbsp;<span style="color:#ff0000;">ERROR: Could not add block access right. Block ID: <b>'.$blc.'</b> Group ID: <b>'.$mygroup.'</b></span>';
+                    } else {
+                        $msgs[] = '&nbsp;&nbsp;Added block access right. Block ID: <b>'.$blc.'</b> Group ID: <b>'.$mygroup.'</b>';
+                    }
+                    unset($bperm);
+                }
+            }
+            unset($blocks);
+            unset($groups);
+
+            // execute module specific install script if any
+            $install_script = $module->getInfo('onInstall');
+            if (false != $install_script && trim($install_script) != '') {
+                include_once XOOPS_ROOT_PATH.'/modules/'.$dirname.'/'.trim($install_script);
+                if (function_exists('xoops_module_install_'.$dirname)) {
+                    $func = 'xoops_module_install_'.$dirname;
+                    if (!$func($module)) {
+                        $msgs[] = 'Failed to execute '.$func;
+                    } else {
+                        $msgs[] = '<b>'.$func.'</b> executed successfully.';
+                    }
+                }
+            }
+
+            $ret = '<p><code>';
+            foreach ($msgs as $m) {
+                $ret .= $m.'<br />';
+            }
+            unset($msgs);
+            unset($errs);
+            $ret .= '</code><br />'.sprintf(_MD_AM_OKINS, "<b>".$module->getVar('name')."</b>").'</p>';
+            unset($module);
+            return $ret;
+        } else {
+            $ret = '<p>';
+            foreach ($errs as $er) {
+                $ret .= '&nbsp;&nbsp;'.$er.'<br />';
+            }
+            unset($msgs);
+            unset($errs);
+            $ret .= '<br />'.sprintf(_MD_AM_FAILINS, '<b>'.$dirname.'</b>').'&nbsp;'._MD_AM_ERRORSC.'</p>';
+            return $ret;
+        }
+    }
+    else {
+        return "<p>".sprintf(_MD_AM_FAILINS, "<b>".$dirname."</b>")."&nbsp;"._MD_AM_ERRORSC."<br />&nbsp;&nbsp;".sprintf(_MD_AM_ALEXISTS, $dirname)."</p>";
+    }
+}
+
+function &xoops_module_gettemplate($dirname, $template, $block=false)
+{
+    global $xoopsConfig;
+    if ($block) {
+        $path = XOOPS_ROOT_PATH.'/modules/'.$dirname.'/templates/blocks/'.$template;
+    } else {
+        $path = XOOPS_ROOT_PATH.'/modules/'.$dirname.'/templates/'.$template;
+    }
+    if (!file_exists($path)) {
+        return false;
+    } else {
+        $lines = file($path);
+    }
+    if (!$lines) {
+        return false;
+    }
+    $ret = '';
+    $count = count($lines);
+    for ($i = 0; $i < $count; $i++) {
+        $ret .= str_replace("\n", "\r\n", str_replace("\r\n", "\n", $lines[$i]));
+    }
+    return $ret;
+}
+
+function xoops_module_uninstall($dirname)
+{
+    global $xoopsConfig;
+    $reservedTables = array('avatar', 'avatar_users_link', 'block_module_link', 'xoopscomments', 'config', 'configcategory', 'configoption', 'image', 'imagebody', 'imagecategory', 'imgset', 'imgset_tplset_link', 'imgsetimg', 'groups','groups_users_link','group_permission', 'online', 'bannerclient', 'banner', 'bannerfinish', 'priv_msgs', 'ranks', 'session', 'smiles', 'users', 'newblocks', 'modules', 'tplfile', 'tplset', 'tplsource', 'xoopsnotifications', 'banner', 'bannerclient', 'bannerfinish');
+    $db =& Database::getInstance();
+    $module_handler =& xoops_gethandler('module');
+    $module =& $module_handler->getByDirname($dirname);
+    include_once XOOPS_ROOT_PATH.'/class/template.php';
+    xoops_template_clear_module_cache($module->getVar('mid'));
+    if ($module->getVar('dirname') == 'system') {
+        return "<p>".sprintf(_MD_AM_FAILUNINS, "<b>".$module->getVar('name')."</b>")."&nbsp;"._MD_AM_ERRORSC."<br /> - "._MD_AM_SYSNO."</p>";
+    } elseif ($module->getVar('dirname') == $xoopsConfig['startpage']) {
+        return "<p>".sprintf(_MD_AM_FAILUNINS, "<b>".$module->getVar('name')."</b>")."&nbsp;"._MD_AM_ERRORSC."<br /> - "._MD_AM_STRTNO."</p>";
+    } else {
+        $msgs = array();
+        if (!$module_handler->delete($module)) {
+            $msgs[] = '&nbsp;&nbsp;<span style="color:#ff0000;">ERROR: Could not delete '.$module->getVar('name').'</span>';
+        } else {
+
+            // delete template files
+            $tplfile_handler = xoops_gethandler('tplfile');
+            $templates =& $tplfile_handler->find(null, 'module', $module->getVar('mid'));
+            $tcount = count($templates);
+            if ($tcount > 0) {
+                $msgs[] = 'Deleting templates...';
+                for ($i = 0; $i < $tcount; $i++) {
+                    if (!$tplfile_handler->delete($templates[$i])) {
+                        $msgs[] = '&nbsp;&nbsp;<span style="color:#ff0000;">ERROR: Could not delete template '.$templates[$i]->getVar('tpl_file').' from the database. Template ID: <b>'.$templates[$i]->getVar('tpl_id').'</b></span>';
+                    } else {
+                        $msgs[] = '&nbsp;&nbsp;Template <b>'.$templates[$i]->getVar('tpl_file').'</b> deleted from the database. Template ID: <b>'.$templates[$i]->getVar('tpl_id').'</b>';
+                    }
+                }
+            }
+            unset($templates);
+
+            // delete blocks and block tempalte files
+            $block_arr =& XoopsBlock::getByModule($module->getVar('mid'));
+            if (is_array($block_arr)) {
+                $bcount = count($block_arr);
+                $msgs[] = 'Deleting block...';
+                for ($i = 0; $i < $bcount; $i++) {
+                    if (!$block_arr[$i]->delete()) {
+                        $msgs[] = '&nbsp;&nbsp;<span style="color:#ff0000;">ERROR: Could not delete block <b>'.$block_arr[$i]->getVar('name').'</b> Block ID: <b>'.$block_arr[$i]->getVar('bid').'</b></span>';
+                    } else {
+                        $msgs[] = '&nbsp;&nbsp;Block <b>'.$block_arr[$i]->getVar('name').'</b> deleted. Block ID: <b>'.$block_arr[$i]->getVar('bid').'</b>';
+                    }
+                    if ($block_arr[$i]->getVar('template') != ''){
+                        $templates =& $tplfile_handler->find(null, 'block', $block_arr[$i]->getVar('bid'));
+                        $btcount = count($templates);
+                        if ($btcount > 0) {
+                            for ($j = 0; $j < $btcount; $j++) {
+                                if (!$tplfile_handler->delete($templates[$j])) {
+                                $msgs[] = '&nbsp;&nbsp;<span style="color:#ff0000;">ERROR: Could not delete block template '.$templates[$j]->getVar('tpl_file').' from the database. Template ID: <b>'.$templates[$j]->getVar('tpl_id').'</b></span>';
+                                } else {
+                                $msgs[] = '&nbsp;&nbsp;Block template <b>'.$templates[$j]->getVar('tpl_file').'</b> deleted from the database. Template ID: <b>'.$templates[$j]->getVar('tpl_id').'</b>';
+                                }
+                            }
+                        }
+                        unset($templates);
+                    }
+                }
+            }
+
+            // delete tables used by this module
+            $modtables = $module->getInfo('tables');
+            if ($modtables != false && is_array($modtables)) {
+                $msgs[] = 'Deleting module tables...';
+                foreach ($modtables as $table) {
+                    // prevent deletion of reserved core tables!
+                    if (!in_array($table, $reservedTables)) {
+                        $sql = 'DROP TABLE '.$db->prefix($table);
+                        if (!$db->query($sql)) {
+                            $msgs[] = '&nbsp;&nbsp;<span style="color:#ff0000;">ERROR: Could not drop table <b>'.$db->prefix($table).'<b>.</span>';
+                        } else {
+                            $msgs[] = '&nbsp;&nbsp;Table <b>'.$db->prefix($table).'</b> dropped.</span>';
+                        }
+                    } else {
+                        $msgs[] = '&nbsp;&nbsp;<span style="color:#ff0000;">ERROR: Not allowed to drop table <b>'.$db->prefix($table).'</b>!</span>';
+                    }
+                }
+            }
+
+            // delete comments if any
+            if ($module->getVar('hascomments') != 0) {
+                $msgs[] = 'Deleting comments...';
+                $comment_handler =& xoops_gethandler('comment');
+                if (!$comment_handler->deleteByModule($module->getVar('mid'))) {
+                    $msgs[] = '&nbsp;&nbsp;<span style="color:#ff0000;">ERROR: Could not delete comments</span>';
+                } else {
+                    $msgs[] = '&nbsp;&nbsp;Comments deleted';
+                }
+            }
+
+            // RMV-NOTIFY
+            // delete notifications if any
+            if ($module->getVar('hasnotification') != 0) {
+                $msgs[] = 'Deleting notifications...';
+                if (!xoops_notification_deletebymodule($module->getVar('mid'))) {
+                    $msgs[] = '&nbsp;&nbsp;<span style="color:#ff0000;">ERROR: Could not delete notifications</span>';
+                } else {
+                    $msgs[] = '&nbsp;&nbsp;Notifications deleted';
+                }
+            }
+
+            // delete permissions if any
+            $gperm_handler =& xoops_gethandler('groupperm');
+            if (!$gperm_handler->deleteByModule($module->getVar('mid'))) {
+                $msgs[] = '&nbsp;&nbsp;<span style="color:#ff0000;">ERROR: Could not delete group permissions</span>';
+            } else {
+                $msgs[] = '&nbsp;&nbsp;Group permissions deleted';
+            }
+
+            // delete module config options if any
+            if ($module->getVar('hasconfig') != 0 || $module->getVar('hascomments') != 0) {
+                $config_handler =& xoops_gethandler('config');
+                $configs =& $config_handler->getConfigs(new Criteria('conf_modid', $module->getVar('mid')));
+                $confcount = count($configs);
+                if ($confcount > 0) {
+                    $msgs[] = 'Deleting module config options...';
+                    for ($i = 0; $i < $confcount; $i++) {
+                        if (!$config_handler->deleteConfig($configs[$i])) {
+                            $msgs[] = '&nbsp;&nbsp;<span style="color:#ff0000;">ERROR: Could not delete config data from the database. Config ID: <b>'.$configs[$i]->getvar('conf_id').'</b></span>';
+                        } else {
+                            $msgs[] = '&nbsp;&nbsp;Config data deleted from the database. Config ID: <b>'.$configs[$i]->getVar('conf_id').'</b>';
+                        }
+                    }
+                }
+            }
+
+            // execute module specific install script if any
+            $uninstall_script = $module->getInfo('onUninstall');
+            if (false != $uninstall_script && trim($uninstall_script) != '') {
+                include_once XOOPS_ROOT_PATH.'/modules/'.$dirname.'/'.trim($uninstall_script);
+                if (function_exists('xoops_module_uninstall_'.$dirname)) {
+                    $func = 'xoops_module_uninstall_'.$dirname;
+                    if (!$func($module)) {
+                        $msgs[] = 'Failed to execute <b>'.$func.'</b>';
+                    } else {
+                        $msgs[] = '<b>'.$func.'</b> executed successfully.';
+                    }
+                }
+            }
+
+            $msgs[] = '</code><p>'.sprintf(_MD_AM_OKUNINS, "<b>".$module->getVar('name')."</b>").'</p>';
+        }
+        $ret = '<code>';
+        foreach ($msgs as $msg) {
+            $ret .= $msg.'<br />';
+        }
+        return $ret;
+    }
+}
+
+function xoops_module_activate($mid)
+{
+    $module_handler =& xoops_gethandler('module');
+    $module =& $module_handler->get($mid);
+    include_once XOOPS_ROOT_PATH.'/class/template.php';
+    xoops_template_clear_module_cache($module->getVar('mid'));
+    $module->setVar('isactive', 1);
+    if (!$module_handler->insert($module)) {
+        $ret = "<p>".sprintf(_MD_AM_FAILACT, "<b>".$module->getVar('name')."</b>")."&nbsp;"._MD_AM_ERRORSC."<br />".$module->getHtmlErrors();
+        return $ret."</p>";
+    }
+    $blocks =& XoopsBlock::getByModule($module->getVar('mid'));
+    $bcount = count($blocks);
+    for ($i = 0; $i < $bcount; $i++) {
+        $blocks[$i]->setVar('isactive', 1);
+        $blocks[$i]->store();
+    }
+    return "<p>".sprintf(_MD_AM_OKACT, "<b>".$module->getVar('name')."</b>")."</p>";
+}
+
+function xoops_module_deactivate($mid)
+{
+    global $xoopsConfig;
+    $module_handler =& xoops_gethandler('module');
+    $module =& $module_handler->get($mid);
+    include_once XOOPS_ROOT_PATH.'/class/template.php';
+    xoops_template_clear_module_cache($mid);
+    $module->setVar('isactive', 0);
+    if ($module->getVar('dirname') == "system") {
+        return "<p>".sprintf(_MD_AM_FAILDEACT, "<b>".$module->getVar('name')."</b>")."&nbsp;"._MD_AM_ERRORSC."<br /> - "._MD_AM_SYSNO."</p>";
+    } elseif ($module->getVar('dirname') == $xoopsConfig['startpage']) {
+        return "<p>".sprintf(_MD_AM_FAILDEACT, "<b>".$module->getVar('name')."</b>")."&nbsp;"._MD_AM_ERRORSC."<br /> - "._MD_AM_STRTNO."</p>";
+    } else {
+        if (!$module_handler->insert($module)) {
+            $ret = "<p>".sprintf(_MD_AM_FAILDEACT, "<b>".$module->getVar('name')."</b>")."&nbsp;"._MD_AM_ERRORSC."<br />".$module->getHtmlErrors();
+            return $ret."</p>";
+        }
+        $blocks =& XoopsBlock::getByModule($module->getVar('mid'));
+        $bcount = count($blocks);
+        for ($i = 0; $i < $bcount; $i++) {
+            $blocks[$i]->setVar('isactive', 0);
+            $blocks[$i]->store();
+        }
+        return "<p>".sprintf(_MD_AM_OKDEACT, "<b>".$module->getVar('name')."</b>")."</p>";
+    }
+}
+
+function xoops_module_change($mid, $weight, $name)
+{
+    $module_handler =& xoops_gethandler('module');
+    $module =& $module_handler->get($mid);
+    $module->setVar('weight', $weight);
+    $module->setVar('name', $name);
+    $myts =& MyTextSanitizer::getInstance();
+    if (!$module_handler->insert($module)) {
+        $ret = "<p>".sprintf(_MD_AM_FAILORDER, "<b>".$myts->stripSlashesGPC($name)."</b>")."&nbsp;"._MD_AM_ERRORSC."<br />";
+        $ret .= $module->getHtmlErrors()."</p>";
+        return $ret;
+    }
+    return "<p>".sprintf(_MD_AM_OKORDER, "<b>".$myts->stripSlashesGPC($name)."</b>")."</p>";
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/modulesadmin/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/modulesadmin/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/modulesadmin/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/modulesadmin/main.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/modulesadmin/main.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/modulesadmin/main.php	(revision 405)
@@ -0,0 +1,635 @@
+<?php
+// $Id: main.php,v 1.4 2005/08/03 12:39:16 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+if ( !is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid()) ) {
+    exit("Access Denied");
+}
+include_once XOOPS_ROOT_PATH.'/class/xoopsblock.php';
+include_once XOOPS_ROOT_PATH."/modules/system/admin/modulesadmin/modulesadmin.php";
+$op = "list";
+
+if (isset($_GET['op'])) {
+    $op = $_GET['op'];
+    $module = $_GET['module'];
+} elseif (isset($_POST['op'])) {
+    $op = $_POST['op'];
+}
+
+if ( $op == "list" ) {
+    xoops_module_list();
+    exit();
+}
+
+if ( $op == "confirm" ) {
+    $token =& XoopsSingleTokenHandler::quickCreate('modulesadmin_submit');
+    xoops_cp_header();
+    //OpenTable();
+    $error = array();
+    if ( !is_writable(XOOPS_CACHE_PATH.'/') ) {
+        // attempt to chmod 666
+        if ( !chmod(XOOPS_CACHE_PATH.'/', 0777) ) {
+            $error[] = sprintf(_MUSTWABLE, "<b>".XOOPS_CACHE_PATH.'/</b>');
+        }
+    }
+    if ( count($error) > 0 ) {
+        xoops_error($error);
+        echo "<p><a href='admin.php?fct=modulesadmin'>"._MD_AM_BTOMADMIN."</a></p>";
+        xoops_cp_footer();
+        exit();
+    }
+    echo "<h4 style='text-align:left;'>"._MD_AM_PCMFM."</h4>
+    <form action='admin.php' method='post'>";
+    echo $token->getHtml();
+    echo "<input type='hidden' name='fct' value='modulesadmin' />
+    <input type='hidden' name='op' value='submit' />
+    <table width='100%' border='0' cellspacing='1' class='outer'>
+    <tr align='center'><th>"._MD_AM_MODULE."</th><th>"._MD_AM_ACTION."</th><th>"._MD_AM_ORDER."</th></tr>";
+    $mcount = 0;
+    $myts =& MyTextsanitizer::getInstance();
+    foreach ($_POST['module'] as $mid) {
+        if ($mcount % 2 != 0) {
+            $class = 'odd';
+        } else {
+            $class = 'even';
+        }
+        echo '<tr class="'.$class.'"><td align="center">'.$myts->stripSlashesGPC($_POST['oldname'][$mid]);
+        $newname[$mid] = trim($myts->stripslashesGPC($_POST['newname'][$mid]));
+        if ($newname[$mid] != $_POST['oldname'][$mid]) {
+            echo '&nbsp;&raquo;&raquo;&nbsp;<span style="color:#ff0000;font-weight:bold;">'.htmlspecialchars($newname[$mid]).'</span>';
+        }
+        echo '</td><td align="center">';
+        if (isset($_POST['newstatus'][$mid]) && $_POST['newstatus'][$mid] ==1) {
+            if ($_POST['oldstatus'][$mid] == 0) {
+                echo "<span style='color:#ff0000;font-weight:bold;'>"._MD_AM_ACTIVATE."</span>";
+            } else {
+                echo _MD_AM_NOCHANGE;
+            }
+        } else {
+            $_POST['newstatus'][$mid] = 0;
+            if ($_POST['oldstatus'][$mid] == 1) {
+                echo "<span style='color:#ff0000;font-weight:bold;'>"._MD_AM_DEACTIVATE."</span>";
+            } else {
+                echo _MD_AM_NOCHANGE;
+            }
+        }
+        echo "</td><td align='center'>";
+        if ($_POST['oldweight'][$mid] != $_POST['weight'][$mid]) {
+            echo "<span style='color:#ff0000;font-weight:bold;'>".$_POST['weight'][$mid]."</span>";
+        } else {
+            echo $_POST['weight'][$mid];
+        }
+        echo "
+        <input type='hidden' name='module[]' value='".$mid."' />
+        <input type='hidden' name='oldname[".$mid."]' value='".htmlspecialchars($_POST['oldname'][$mid], ENT_QUOTES)."' />
+        <input type='hidden' name='newname[".$mid."]' value='".htmlspecialchars($newname[$mid], ENT_QUOTES)."' />
+        <input type='hidden' name='oldstatus[".$mid."]' value='".$_POST['oldstatus'][$mid]."' />
+        <input type='hidden' name='newstatus[".$mid."]' value='".$_POST['newstatus'][$mid]."' />
+        <input type='hidden' name='oldweight[".$mid."]' value='".intval($_POST['oldweight'][$mid])."' />
+        <input type='hidden' name='weight[".$mid."]' value='".intval($_POST['weight'][$mid])."' />
+        </td></tr>";
+    }
+    echo "
+    <tr class='foot' align='center'><td colspan='3'><input type='submit' value='"._MD_AM_SUBMIT."' />&nbsp;<input type='button' value='"._MD_AM_CANCEL."' onclick='location=\"admin.php?fct=modulesadmin\"' /></td></tr>
+    </table>
+    </form>";
+    xoops_cp_footer();
+    exit();
+}
+if ( $op == "submit" ) {
+    if(!XoopsSingleTokenHandler::quickValidate('modulesadmin_submit')) {
+        system_modulesadmin_error("Ticket Error");
+    }
+
+    $ret = array();
+    $write = false;
+    foreach ($_POST['module'] as $mid) {
+        if (isset($_POST['newstatus'][$mid]) && $_POST['newstatus'][$mid] ==1) {
+            if ($_POST['oldstatus'][$mid] == 0) {
+                $ret[] = xoops_module_activate($mid);
+            }
+        } else {
+            if ($_POST['oldstatus'][$mid] == 1) {
+                $ret[] = xoops_module_deactivate($mid);
+            }
+        }
+        $newname[$mid] = trim($_POST['newname'][$mid]);
+        if ($_POST['oldname'][$mid] != $_POST['newname'][$mid] || $_POST['oldweight'][$mid] != $_POST['weight'][$mid]) {
+            $ret[] = xoops_module_change($mid, $_POST['weight'][$mid], $_POST['newname'][$mid]);
+            $write = true;
+        }
+        flush();
+    }
+    if ( $write ) {
+        $contents = xoops_module_get_admin_menu();
+        if (!xoops_module_write_admin_menu($contents)) {
+            $ret[] = "<p>"._MD_AM_FAILWRITE."</p>";
+        }
+    }
+    xoops_cp_header();
+    if ( count($ret) > 0 ) {
+        foreach ($ret as $msg) {
+            if ($msg != '') {
+                echo $msg;
+            }
+        }
+    }
+    echo "<br /><a href='admin.php?fct=modulesadmin'>"._MD_AM_BTOMADMIN."</a>";
+    xoops_cp_footer();
+    exit();
+}
+
+if ($op == 'install') {
+    $module_handler =& xoops_gethandler('module');
+    $mod =& $module_handler->create();
+    $mod->loadInfoAsVar($module);
+    if ($mod->getInfo('image') != false && trim($mod->getInfo('image')) != '') {
+        $msgs ='<img src="'.XOOPS_URL.'/modules/'.$mod->getVar('dirname').'/'.trim($mod->getInfo('image')).'" alt="" />';
+    }
+    $msgs .= '<br /><span style="font-size:smaller;";>'.$mod->getVar('name').'</span><br /><br />'._MD_AM_RUSUREINS;
+    xoops_cp_header();
+    xoops_token_confirm(array('module' => $module, 'op' => 'install_ok', 'fct' => 'modulesadmin'), 'admin.php', $msgs, _MD_AM_INSTALL);
+    xoops_cp_footer();
+    exit();
+}
+
+if ($op == 'install_ok') {
+    if(!xoops_confirm_validate()) {
+        system_modulesadmin_error("Ticket Error");
+    }
+
+    $ret = array();
+    $ret[] = xoops_module_install($_POST['module']);
+    $contents = xoops_module_get_admin_menu();
+    if (!xoops_module_write_admin_menu($contents)) {
+        $ret[] = "<p>"._MD_AM_FAILWRITE."</p>";
+    }
+    xoops_cp_header();
+    if (count($ret) > 0) {
+        foreach ($ret as $msg) {
+            if ($msg != '') {
+                echo $msg;
+            }
+        }
+    }
+    echo "<br /><a href='admin.php?fct=modulesadmin'>"._MD_AM_BTOMADMIN."</a>";
+    xoops_cp_footer();
+    exit();
+}
+
+if ($op == 'uninstall') {
+    $module_handler =& xoops_gethandler('module');
+    $mod =& $module_handler->getByDirname($module);
+    if ($mod->getInfo('image') != false && trim($mod->getInfo('image')) != '') {
+        $msgs ='<img src="'.XOOPS_URL.'/modules/'.$mod->getVar('dirname').'/'.trim($mod->getInfo('image')).'" alt="" />';
+    }
+    $msgs .= '<br /><span style="font-size:smaller;";>'.$mod->getVar('name').'</span><br /><br />'._MD_AM_RUSUREUNINS;
+    xoops_cp_header();
+    xoops_token_confirm(array('module' => $module, 'op' => 'uninstall_ok', 'fct' => 'modulesadmin'), 'admin.php', $msgs, _YES);
+    xoops_cp_footer();
+    exit();
+}
+
+if ($op == 'uninstall_ok') {
+    if(!xoops_confirm_validate()) {
+        system_modulesadmin_error("Ticket Error");
+    }
+
+    $ret = array();
+    $ret[] = xoops_module_uninstall($_POST['module']);
+    $contents = xoops_module_get_admin_menu();
+    if (!xoops_module_write_admin_menu($contents)) {
+        $ret[] = "<p>"._MD_AM_FAILWRITE."</p>";
+    }
+    xoops_cp_header();
+    if (count($ret) > 0) {
+        foreach ($ret as $msg) {
+            if ($msg != '') {
+                echo $msg;
+            }
+        }
+    }
+    echo "<a href='admin.php?fct=modulesadmin'>"._MD_AM_BTOMADMIN."</a>";
+    xoops_cp_footer();
+    exit();
+}
+
+if ($op == 'update') {
+    $module_handler =& xoops_gethandler('module');
+    $mod =& $module_handler->getByDirname($module);
+    if ($mod->getInfo('image') != false && trim($mod->getInfo('image')) != '') {
+        $msgs ='<img src="'.XOOPS_URL.'/modules/'.$mod->getVar('dirname').'/'.trim($mod->getInfo('image')).'" alt="" />';
+    }
+    $msgs .= '<br /><span style="font-size:smaller;";>'.$mod->getVar('name').'</span><br /><br />'._MD_AM_RUSUREUPD;
+    xoops_cp_header();
+    xoops_token_confirm(array('dirname' => $module, 'op' => 'update_ok', 'fct' => 'modulesadmin'), 'admin.php', $msgs, _MD_AM_UPDATE);
+    xoops_cp_footer();
+    exit();
+}
+
+if ($op == 'update_ok') {
+    if(!xoops_confirm_validate()) {
+        system_modulesadmin_error("Ticket Error");
+    }
+
+    $dirname = trim($_POST['dirname']);
+    $module_handler =& xoops_gethandler('module');
+    $module =& $module_handler->getByDirname($dirname);
+    $prev_version = $module->getVar('version');
+    include_once XOOPS_ROOT_PATH.'/class/template.php';
+    xoops_template_clear_module_cache($module->getVar('mid'));
+    // we dont want to change the module name set by admin
+    $temp_name = $module->getVar('name');
+    $module->loadInfoAsVar($dirname);
+    $module->setVar('name', $temp_name);
+    xoops_cp_header();
+    if (!$module_handler->insert($module)) {
+        echo '<p>Could not update '.$module->getVar('name').'</p>';
+        echo "<br /><a href='admin.php?fct=modulesadmin'>"._MD_AM_BTOMADMIN."</a>";
+    } else {
+        $newmid = $module->getVar('mid');
+        $msgs = array();
+        $msgs[] = 'Module data updated.';
+        $tplfile_handler =& xoops_gethandler('tplfile');
+        $deltpl =& $tplfile_handler->find('default', 'module', $module->getVar('mid'));
+        $delng = array();
+        if (is_array($deltpl)) {
+            $xoopsTpl = new XoopsTpl();
+            // clear cache files
+            $xoopsTpl->clear_cache(null, 'mod_'.$dirname);
+            // delete template file entry in db
+            $dcount = count($deltpl);
+            for ($i = 0; $i < $dcount; $i++) {
+                if (!$tplfile_handler->delete($deltpl[$i])) {
+                    $delng[] = $deltpl[$i]->getVar('tpl_file');
+                }
+            }
+        }
+        $templates = $module->getInfo('templates');
+        if ($templates != false) {
+            $msgs[] = 'Updating templates...';
+            foreach ($templates as $tpl) {
+                $tpl['file'] = trim($tpl['file']);
+                if (!in_array($tpl['file'], $delng)) {
+                    $tpldata =& xoops_module_gettemplate($dirname, $tpl['file']);
+                    $tplfile =& $tplfile_handler->create();
+                    $tplfile->setVar('tpl_refid', $newmid);
+                    $tplfile->setVar('tpl_lastimported', 0);
+                    $tplfile->setVar('tpl_lastmodified', time());
+                    if (preg_match("/\.css$/i", $tpl['file'])) {
+                        $tplfile->setVar('tpl_type', 'css');
+                    } else {
+                        $tplfile->setVar('tpl_type', 'module');
+                    }
+                    $tplfile->setVar('tpl_source', $tpldata, true);
+                    $tplfile->setVar('tpl_module', $dirname);
+                    $tplfile->setVar('tpl_tplset', 'default');
+                    $tplfile->setVar('tpl_file', $tpl['file'], true);
+                    $tplfile->setVar('tpl_desc', $tpl['description'], true);
+                    if (!$tplfile_handler->insert($tplfile)) {
+                        $msgs[] = '&nbsp;&nbsp;<span style="color:#ff0000;">ERROR: Could not insert template <b>'.$tpl['file'].'</b> to the database.</span>';
+                    } else {
+                        $newid = $tplfile->getVar('tpl_id');
+                        $msgs[] = '&nbsp;&nbsp;Template <b>'.$tpl['file'].'</b> inserted to the database.';
+                        if ($xoopsConfig['template_set'] == 'default') {
+                            if (!xoops_template_touch($newid)) {
+                                $msgs[] = '&nbsp;&nbsp;<span style="color:#ff0000;">ERROR: Could not recompile template <b>'.$tpl['file'].'</b>.</span>';
+                            } else {
+                                $msgs[] = '&nbsp;&nbsp;Template <b>'.$tpl['file'].'</b> recompiled.</span>';
+                            }
+                        }
+                    }
+                    unset($tpldata);
+                } else {
+                    $msgs[] = '&nbsp;&nbsp;<span style="color:#ff0000;">ERROR: Could not delete old template <b>'.$tpl['file'].'</b>. Aborting update of this file.</span>';
+                }
+            }
+        }
+        $contents = xoops_module_get_admin_menu();
+        if (!xoops_module_write_admin_menu($contents)) {
+            $msgs[] = '<p><span style="color:#ff0000;">'._MD_AM_FAILWRITE.'</span></p>';
+        }
+        $blocks = $module->getInfo('blocks');
+        $msgs[] = 'Rebuilding blocks...';
+        if ($blocks != false) {
+            $count = count($blocks);
+            $showfuncs = array();
+            $funcfiles = array();
+            for ( $i = 1; $i <= $count; $i++ ) {
+                if (isset($blocks[$i]['show_func']) && $blocks[$i]['show_func'] != '' && isset($blocks[$i]['file']) && $blocks[$i]['file'] != '') {
+                    $editfunc = isset($blocks[$i]['edit_func']) ? $blocks[$i]['edit_func'] : '';
+                    $showfuncs[] = $blocks[$i]['show_func'];
+                    $funcfiles[] = $blocks[$i]['file'];
+                    $template = '';
+                    if ((isset($blocks[$i]['template']) && trim($blocks[$i]['template']) != '')) {
+                        $content =& xoops_module_gettemplate($dirname, $blocks[$i]['template'], true);
+                    }
+                    if (!$content) {
+                        $content = '';
+                    } else {
+                        $template = $blocks[$i]['template'];
+                    }
+                    $options = '';
+                    if (!empty($blocks[$i]['options'])) {
+                        $options = $blocks[$i]['options'];
+                    }
+                    $sql = "SELECT bid, name FROM ".$xoopsDB->prefix('newblocks')." WHERE mid=".$module->getVar('mid')." AND func_num=".$i." AND show_func='".addslashes($blocks[$i]['show_func'])."' AND func_file='".addslashes($blocks[$i]['file'])."'";
+                    $fresult = $xoopsDB->query($sql);
+                    $fcount = 0;
+                    while ($fblock = $xoopsDB->fetchArray($fresult)) {
+                        $fcount++;
+                        $sql = "UPDATE ".$xoopsDB->prefix("newblocks")." SET name='".addslashes($blocks[$i]['name'])."', edit_func='".addslashes($editfunc)."', options='".addslashes($options)."', content='', template='".$template."', last_modified=".time()." WHERE bid=".$fblock['bid'];
+                        $result = $xoopsDB->query($sql);
+                        if (!$result) {
+                            $msgs[] = '&nbsp;&nbsp;ERROR: Could not update '.$fblock['name'];
+                        } else {
+                            $msgs[] = '&nbsp;&nbsp;Block <b>'.$fblock['name'].'</b> updated. Block ID: <b>'.$fblock['bid'].'</b>';
+                            if ($template != '') {
+                                $tplfile =& $tplfile_handler->find('default', 'block', $fblock['bid']);
+                                if (count($tplfile) == 0) {
+                                    $tplfile_new =& $tplfile_handler->create();
+                                    $tplfile_new->setVar('tpl_module', $dirname);
+                                    $tplfile_new->setVar('tpl_refid', $fblock['bid']);
+                                    $tplfile_new->setVar('tpl_tplset', 'default');
+                                    $tplfile_new->setVar('tpl_file', $blocks[$i]['template'], true);
+                                    $tplfile_new->setVar('tpl_type', 'block');
+                                }
+                                else {
+                                    $tplfile_new = $tplfile[0];
+                                }
+                                $tplfile_new->setVar('tpl_source', $content, true);
+                                $tplfile_new->setVar('tpl_desc', $blocks[$i]['description'], true);
+                                $tplfile_new->setVar('tpl_lastmodified', time());
+                                $tplfile_new->setVar('tpl_lastimported', 0);
+                                if (!$tplfile_handler->insert($tplfile_new)) {
+                                    $msgs[] = '&nbsp;&nbsp;<span style="color:#ff0000;">ERROR: Could not update template <b>'.$blocks[$i]['template'].'</b>.</span>';
+                                } else {
+                                    $msgs[] = '&nbsp;&nbsp;Template <b>'.$blocks[$i]['template'].'</b> updated.';
+                                    if ($xoopsConfig['template_set'] == 'default') {
+                                        if (!xoops_template_touch($tplfile_new->getVar('tpl_id'))) {
+                                            $msgs[] = '&nbsp;&nbsp;<span style="color:#ff0000;">ERROR: Could not recompile template <b>'.$blocks[$i]['template'].'</b>.</span>';
+                                        } else {
+                                            $msgs[] = '&nbsp;&nbsp;Template <b>'.$blocks[$i]['template'].'</b> recompiled.';
+                                        }
+                                    }
+
+                                }
+                            }
+                        }
+                    }
+                    if ($fcount == 0) {
+                        $newbid = $xoopsDB->genId($xoopsDB->prefix('newblocks').'_bid_seq');
+                        $block_name = addslashes($blocks[$i]['name']);
+                        $sql = "INSERT INTO ".$xoopsDB->prefix("newblocks")." (bid, mid, func_num, options, name, title, content, side, weight, visible, block_type, isactive, dirname, func_file, show_func, edit_func, template, last_modified) VALUES (".$newbid.", ".$module->getVar('mid').", ".$i.",'".addslashes($options)."','".$block_name."', '".$block_name."', '', 0, 0, 0, 'M', 1, '".addslashes($dirname)."', '".addslashes($blocks[$i]['file'])."', '".addslashes($blocks[$i]['show_func'])."', '".addslashes($editfunc)."', '".$template."', ".time().")";
+                        $result = $xoopsDB->query($sql);
+                        if (!$result) {
+                            $msgs[] = '&nbsp;&nbsp;ERROR: Could not create '.$blocks[$i]['name'];echo $sql;
+                        } else {
+                            if (empty($newbid)) {
+                                $newbid = $xoopsDB->getInsertId();
+                            }
+                            $groups =& $xoopsUser->getGroups();
+                            $gperm_handler =& xoops_gethandler('groupperm');
+                            foreach ($groups as $mygroup) {
+                                $bperm =& $gperm_handler->create();
+                                $bperm->setVar('gperm_groupid', $mygroup);
+                                $bperm->setVar('gperm_itemid', $newbid);
+                                $bperm->setVar('gperm_name', 'block_read');
+                                $bperm->setVar('gperm_modid', 1);
+                                if (!$gperm_handler->insert($bperm)) {
+                                    $msgs[] = '&nbsp;&nbsp;<span style="color:#ff0000;">ERROR: Could not add block access right. Block ID: <b>'.$newbid.'</b> Group ID: <b>'.$mygroup.'</b></span>';
+                                } else {
+                                    $msgs[] = '&nbsp;&nbsp;Added block access right. Block ID: <b>'.$newbid.'</b> Group ID: <b>'.$mygroup.'</b>';
+                                }
+                            }
+
+                            if ($template != '') {
+                                $tplfile =& $tplfile_handler->create();
+                                $tplfile->setVar('tpl_module', $dirname);
+                                $tplfile->setVar('tpl_refid', $newbid);
+                                $tplfile->setVar('tpl_source', $content, true);
+                                $tplfile->setVar('tpl_tplset', 'default');
+                                $tplfile->setVar('tpl_file', $blocks[$i]['template'], true);
+                                $tplfile->setVar('tpl_type', 'block');
+                                $tplfile->setVar('tpl_lastimported', 0);
+                                $tplfile->setVar('tpl_lastmodified', time());
+                                $tplfile->setVar('tpl_desc', $blocks[$i]['description'], true);
+                                if (!$tplfile_handler->insert($tplfile)) {
+                                    $msgs[] = '&nbsp;&nbsp;<span style="color:#ff0000;">ERROR: Could not insert template <b>'.$blocks[$i]['template'].'</b> to the database.</span>';
+                                } else {
+                                    $newid = $tplfile->getVar('tpl_id');
+                                    $msgs[] = '&nbsp;&nbsp;Template <b>'.$blocks[$i]['template'].'</b> added to the database.';
+                                    if ($xoopsConfig['template_set'] == 'default') {
+                                        if (!xoops_template_touch($newid)) {
+                                            $msgs[] = '&nbsp;&nbsp;<span style="color:#ff0000;">ERROR: Template <b>'.$blocks[$i]['template'].'</b> recompile failed.</span>';
+                                        } else {
+                                            $msgs[] = '&nbsp;&nbsp;Template <b>'.$blocks[$i]['template'].'</b> recompiled.';
+                                        }
+                                    }
+                                }
+                            }
+                            $msgs[] = '&nbsp;&nbsp;Block <b>'.$blocks[$i]['name'].'</b> created. Block ID: <b>'.$newbid.'</b>';
+                            $sql = 'INSERT INTO '.$xoopsDB->prefix('block_module_link').' (block_id, module_id) VALUES ('.$newbid.', -1)';
+                            $xoopsDB->query($sql);
+                        }
+                    }
+                }
+            }
+            $block_arr = XoopsBlock::getByModule($module->getVar('mid'));
+            foreach ($block_arr as $block) {
+                if (!in_array($block->getVar('show_func'), $showfuncs) || !in_array($block->getVar('func_file'), $funcfiles)) {
+                    $sql = sprintf("DELETE FROM %s WHERE bid = %u", $xoopsDB->prefix('newblocks'), $block->getVar('bid'));
+                    if(!$xoopsDB->query($sql)) {
+                        $msgs[] = '&nbsp;&nbsp;<span style="color:#ff0000;">ERROR: Could not delete block <b>'.$block->getVar('name').'</b>. Block ID: <b>'.$block->getVar('bid').'</b></span>';
+                    } else {
+                        $msgs[] = '&nbsp;&nbsp;Block <b>'.$block->getVar('name').' deleted. Block ID: <b>'.$block->getVar('bid').'</b>';
+                        if ($block->getVar('template') != '') {
+                            $tplfiles =& $tplfile_handler->find(null, 'block', $block->getVar('bid'));
+                            if (is_array($tplfiles)) {
+                                $btcount = count($tplfiles);
+                                for ($k = 0; $k < $btcount; $k++) {
+                                    if (!$tplfile_handler->delete($tplfiles[$k])) {
+                                        $msgs[] = '&nbsp;&nbsp;<span style="color:#ff0000;">ERROR: Could not remove deprecated block template. (ID: <b>'.$tplfiles[$k]->getVar('tpl_id').'</b>)</span>';
+                                    } else {
+                                        $msgs[] = '&nbsp;&nbsp;Block template <b>'.$tplfiles[$k]->getVar('tpl_file').'</b> deprecated.';
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+
+        // first delete all config entries
+        $config_handler =& xoops_gethandler('config');
+        $configs =& $config_handler->getConfigs(new Criteria('conf_modid', $module->getVar('mid')));
+        $confcount = count($configs);
+        $config_delng = array();
+        if ($confcount > 0) {
+            $msgs[] = 'Deleting module config options...';
+            for ($i = 0; $i < $confcount; $i++) {
+                if (!$config_handler->deleteConfig($configs[$i])) {
+                    $msgs[] = '&nbsp;&nbsp;<span style="color:#ff0000;">ERROR: Could not delete config data from the database. Config ID: <b>'.$configs[$i]->getvar('conf_id').'</b></span>';
+                    // save the name of config failed to delete for later use
+                    $config_delng[] = $configs[$i]->getvar('conf_name');
+                } else {
+                    $config_old[$configs[$i]->getvar('conf_name')]['value'] = $configs[$i]->getvar('conf_value', 'N');
+                    $config_old[$configs[$i]->getvar('conf_name')]['formtype'] = $configs[$i]->getvar('conf_formtype');
+                    $config_old[$configs[$i]->getvar('conf_name')]['valuetype'] = $configs[$i]->getvar('conf_valuetype');
+                    $msgs[] = '&nbsp;&nbsp;Config data deleted from the database. Config ID: <b>'.$configs[$i]->getVar('conf_id').'</b>';
+                }
+            }
+        }
+
+        // now reinsert them with the new settings
+        $configs = $module->getInfo('config');
+        if ($configs != false) {
+            if ($module->getVar('hascomments') != 0) {
+                include_once(XOOPS_ROOT_PATH.'/include/comment_constants.php');
+                array_push($configs, array('name' => 'com_rule', 'title' => '_CM_COMRULES', 'description' => '', 'formtype' => 'select', 'valuetype' => 'int', 'default' => 1, 'options' => array('_CM_COMNOCOM' => XOOPS_COMMENT_APPROVENONE, '_CM_COMAPPROVEALL' => XOOPS_COMMENT_APPROVEALL, '_CM_COMAPPROVEUSER' => XOOPS_COMMENT_APPROVEUSER, '_CM_COMAPPROVEADMIN' => XOOPS_COMMENT_APPROVEADMIN)));
+                array_push($configs, array('name' => 'com_anonpost', 'title' => '_CM_COMANONPOST', 'description' => '', 'formtype' => 'yesno', 'valuetype' => 'int', 'default' => 0));
+            }
+        } else {
+            if ($module->getVar('hascomments') != 0) {
+                $configs = array();
+                include_once(XOOPS_ROOT_PATH.'/include/comment_constants.php');
+                $configs[] = array('name' => 'com_rule', 'title' => '_CM_COMRULES', 'description' => '', 'formtype' => 'select', 'valuetype' => 'int', 'default' => 1, 'options' => array('_CM_COMNOCOM' => XOOPS_COMMENT_APPROVENONE, '_CM_COMAPPROVEALL' => XOOPS_COMMENT_APPROVEALL, '_CM_COMAPPROVEUSER' => XOOPS_COMMENT_APPROVEUSER, '_CM_COMAPPROVEADMIN' => XOOPS_COMMENT_APPROVEADMIN));
+                $configs[] = array('name' => 'com_anonpost', 'title' => '_CM_COMANONPOST', 'description' => '', 'formtype' => 'yesno', 'valuetype' => 'int', 'default' => 0);
+            }
+        }
+        // RMV-NOTIFY
+        if ($module->getVar('hasnotification') != 0) {
+            if (empty($configs)) {
+                $configs = array();
+            }
+            // Main notification options
+            include_once XOOPS_ROOT_PATH . '/include/notification_constants.php';
+            include_once XOOPS_ROOT_PATH . '/include/notification_functions.php';
+            $options = array();
+            $options['_NOT_CONFIG_DISABLE'] = XOOPS_NOTIFICATION_DISABLE;
+            $options['_NOT_CONFIG_ENABLEBLOCK'] = XOOPS_NOTIFICATION_ENABLEBLOCK;
+            $options['_NOT_CONFIG_ENABLEINLINE'] = XOOPS_NOTIFICATION_ENABLEINLINE;
+            $options['_NOT_CONFIG_ENABLEBOTH'] = XOOPS_NOTIFICATION_ENABLEBOTH;
+
+            //$configs[] = array ('name' => 'notification_enabled', 'title' => '_NOT_CONFIG_ENABLED', 'description' => '_NOT_CONFIG_ENABLEDDSC', 'formtype' => 'yesno', 'valuetype' => 'int', 'default' => 1);
+            $configs[] = array ('name' => 'notification_enabled', 'title' => '_NOT_CONFIG_ENABLE', 'description' => '_NOT_CONFIG_ENABLEDSC', 'formtype' => 'select', 'valuetype' => 'int', 'default' => XOOPS_NOTIFICATION_ENABLEBOTH, 'options'=>$options);
+            // Event specific notification options
+            // FIXME: for some reason the default doesn't come up properly
+            //  initially is ok, but not when 'update' module..
+            $options = array();
+            $categories =& notificationCategoryInfo('',$module->getVar('mid'));
+            foreach ($categories as $category) {
+                $events =& notificationEvents ($category['name'], false, $module->getVar('mid'));
+                foreach ($events as $event) {
+                    if (!empty($event['invisible'])) {
+                        continue;
+                    }
+                    $option_name = $category['title'] . ' : ' . $event['title'];
+                    $option_value = $category['name'] . '-' . $event['name'];
+                    $options[$option_name] = $option_value;
+                    //$configs[] = array ('name' => notificationGenerateConfig($category,$event,'name'), 'title' => notificationGenerateConfig($category,$event,'title_constant'), 'description' => notificationGenerateConfig($category,$event,'description_constant'), 'formtype' => 'yesno', 'valuetype' => 'int', 'default' => 1);
+                }
+            }
+            $configs[] = array ('name' => 'notification_events', 'title' => '_NOT_CONFIG_EVENTS', 'description' => '_NOT_CONFIG_EVENTSDSC', 'formtype' => 'select_multi', 'valuetype' => 'array', 'default' => array_values($options), 'options' => $options);
+        }
+
+        if ($configs != false) {
+            $msgs[] = 'Adding module config data...';
+            $config_handler =& xoops_gethandler('config');
+            $order = 0;
+            foreach ($configs as $config) {
+                // only insert ones that have been deleted previously with success
+                if (!in_array($config['name'], $config_delng)) {
+                    $confobj =& $config_handler->createConfig();
+                    $confobj->setVar('conf_modid', $newmid);
+                    $confobj->setVar('conf_catid', 0);
+                    $confobj->setVar('conf_name', $config['name']);
+                    $confobj->setVar('conf_title', $config['title'], true);
+                    $confobj->setVar('conf_desc', $config['description'], true);
+                    $confobj->setVar('conf_formtype', $config['formtype']);
+                    $confobj->setVar('conf_valuetype', $config['valuetype']);
+                    if (isset($config_old[$config['name']]['value']) && $config_old[$config['name']]['formtype'] == $config['formtype'] && $config_old[$config['name']]['valuetype'] == $config['valuetype']) {
+                        // preserver the old value if any
+                        // form type and value type must be the same
+                        $confobj->setVar('conf_value', $config_old[$config['name']]['value'], true);
+                    } else {
+                        $confobj->setConfValueForInput($config['default'], true);
+
+                        //$confobj->setVar('conf_value', $config['default'], true);
+                    }
+                    $confobj->setVar('conf_order', $order);
+                    $confop_msgs = '';
+                    if (isset($config['options']) && is_array($config['options'])) {
+                        foreach ($config['options'] as $key => $value) {
+                            $confop =& $config_handler->createConfigOption();
+                            $confop->setVar('confop_name', $key, true);
+                            $confop->setVar('confop_value', $value, true);
+                            $confobj->setConfOptions($confop);
+                            $confop_msgs .= '<br />&nbsp;&nbsp;&nbsp;&nbsp;Config option added. Name: <b>'.$key.'</b> Value: <b>'.$value.'</b>';
+                            unset($confop);
+                        }
+                    }
+                    $order++;
+                    if (false != $config_handler->insertConfig($confobj)) {
+                        $msgs[] = '&nbsp;&nbsp;Config <b>'.$config['name'].'</b> added to the database.'.$confop_msgs;
+                    } else {
+                        $msgs[] = '&nbsp;&nbsp;<span style="color:#ff0000;">ERROR: Could not insert config <b>'.$config['name'].'</b> to the database.</span>';
+                    }
+                    unset($confobj);
+                }
+            }
+            unset($configs);
+        }
+
+        // execute module specific update script if any
+        $update_script = $module->getInfo('onUpdate');
+        if (false != $update_script && trim($update_script) != '') {
+            include_once XOOPS_ROOT_PATH.'/modules/'.$dirname.'/'.trim($update_script);
+            if (function_exists('xoops_module_update_'.$dirname)) {
+                $func = 'xoops_module_update_'.$dirname;
+                if (!$func($module, $prev_version)) {
+                    $msgs[] = 'Failed to execute '.$func;
+                } else {
+                    $msgs[] = '<b>'.$func.'</b> executed successfully.';
+                }
+            }
+        }
+
+        foreach ($msgs as $msg) {
+            echo '<code>'.$msg.'</code><br />';
+        }
+        echo "<p>".sprintf(_MD_AM_OKUPD, "<b>".$module->getVar('name')."</b>")."</p>";
+    }
+    echo "<br /><a href='admin.php?fct=modulesadmin'>"._MD_AM_BTOMADMIN."</a>";
+    xoops_cp_footer();
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/version/xoops_version.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/version/xoops_version.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/version/xoops_version.php	(revision 405)
@@ -0,0 +1,45 @@
+<?php
+// $Id: xoops_version.php,v 1.2 2005/03/18 12:52:48 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+$modversion['name'] = _MD_AM_VRSN;
+$modversion['type'] = "";
+$modversion['version'] = "XOOPS RC4";
+$modversion['description'] = "XOOPS Version";
+$modversion['author'] = "";
+$modversion['credits'] = "The XOOPS Project";
+$modversion['help'] = "";
+$modversion['license'] = "GPL see LICENSE";
+$modversion['official'] = 1;
+$modversion['image'] = "s_poweredby.gif";
+
+$modversion['hasAdmin'] = 0;
+$modversion['adminpath'] = "";
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/version/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/version/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/version/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/version/main.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/version/main.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/version/main.php	(revision 405)
@@ -0,0 +1,106 @@
+<?php
+// $Id: main.php,v 1.4 2005/08/03 12:40:00 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+if ( !is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->getVar('mid')) || !isset($_GET['mid'])) {
+    exit("Access Denied");
+}
+
+if (intval($_GET['mid'])) {
+    $module_handler =& xoops_gethandler('module');
+    $versioninfo =& $module_handler->get(intval($_GET['mid']));
+} else {
+    $mid = str_replace('..', '', trim($_GET['mid']));
+    if (file_exists(XOOPS_ROOT_PATH.'/modules/'.$mid.'/xoops_version.php')) {
+        $module_handler =& xoops_gethandler('module');
+        $versioninfo =& $module_handler->create();
+        $versioninfo->loadInfo($mid);
+    }
+}
+if (!isset($versioninfo) || !is_object($versioninfo)) {
+    exit();
+}
+
+//$css = getCss($theme);
+echo "<html>\n<head>\n";
+echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset="._CHARSET."\"></meta>\n";
+echo "<title>".htmlspecialchars($xoopsConfig['sitename'])."</title>\n";
+
+?>
+<script type="text/javascript">
+<!--//
+scrollID=0;
+vPos=0;
+
+function onWard() {
+   vPos+=2;
+   window.scroll(0,vPos);
+   vPos%=1000;
+   scrollID=setTimeout("onWard()",30);
+   }
+function stop(){
+   clearTimeout(scrollID);
+}
+//-->
+</script>
+<?php
+/*
+if($css){
+    echo "<link rel=\"stylesheet\" href=\"".$css."\" type=\"text/css\">\n\n";
+}
+*/
+echo "</head>\n";
+echo "<body onLoad=\"if(window.scroll)onWard()\" onmouseover=\"stop()\" onmouseout=\"if(window.scroll)onWard()\">\n";
+echo "<div><table width=\"100%\"><tr><td align=\"center\"><br /><br /><br /><br /><br />";
+if ($modimage = $versioninfo->getInfo('image')) {
+    $modimage_path = '/modules/'.$versioninfo->getInfo('dirname').'/'.$modimage;
+    $modimage_realpath = str_replace("\\", "/", realpath(XOOPS_ROOT_PATH.$modimage_path));
+    if (0 === strpos($modimage_realpath, XOOPS_ROOT_PATH) && is_file($modimage_realpath)) {
+        echo "<img src='".XOOPS_URL.$modimage_path."' border='0' /><br />";
+    }
+}
+if ($modname = $versioninfo->getInfo('name')) {
+    echo "<big><b>".htmlspecialchars($modname)."</b></big>";
+}
+
+$modinfo = array('Version', 'Description', 'Author', 'Credits', 'License');
+foreach ($modinfo as $info) {
+    if ($info_output = $versioninfo->getInfo(strtolower($info))) {
+        echo "<br /><br /><u>$info</u><br />";
+        echo htmlspecialchars($info_output);
+    }
+}
+echo "<br /><br /><br /><br /><br />";
+echo "<br /><br /><br /><br /><br />";
+echo "<a href=\"javascript:window.close();\">Close</a>";
+echo "<br /><br /><br /><br /><br /><br />";
+echo "</td></tr></table></div>";
+echo "</body></html>";
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/comments/admin_header.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/comments/admin_header.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/comments/admin_header.php	(revision 405)
@@ -0,0 +1,44 @@
+<?php
+// $Id: admin_header.php,v 1.2 2005/03/18 12:52:38 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+include '../../../../mainfile.php';
+include XOOPS_ROOT_PATH.'/include/cp_functions.php';
+if (is_object($xoopsUser)) {
+	$module_handler =& xoops_gethandler('module');
+	$xoopsModule =& $module_handler->getByDirname('system');
+	if (!in_array(XOOPS_GROUP_ADMIN, $xoopsUser->getGroups())) {
+		$sysperm_handler =& xoops_gethandler('groupperm');
+		if (!$sysperm_handler->checkRight('system_admin', XOOPS_SYSTEM_COMMENT, $xoopsUser->getGroups())) {
+			redirect_header(XOOPS_URL.'/', 3, _NOPERM);;
+			exit();
+		}
+	}
+} else {
+	redirect_header(XOOPS_URL.'/', 3, _NOPERM);
+	exit();
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/comments/comment_delete.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/comments/comment_delete.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/comments/comment_delete.php	(revision 405)
@@ -0,0 +1,29 @@
+<?php
+// $Id: comment_delete.php,v 1.2 2005/03/18 12:52:38 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+include './admin_header.php';
+include XOOPS_ROOT_PATH.'/include/comment_delete.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/comments/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/comments/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/comments/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/comments/main.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/comments/main.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/comments/main.php	(revision 405)
@@ -0,0 +1,163 @@
+<?php
+// $Id: main.php,v 1.6 2005/10/25 02:57:28 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+
+if ( !is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->getVar('mid')) ) {
+    exit("Access Denied");
+} else {
+    $op = 'list';
+    if (isset($_GET['op'])) {
+        $op = trim($_GET['op']);
+    }
+    switch ($op) {
+    case 'list':
+        include_once XOOPS_ROOT_PATH.'/include/comment_constants.php';
+        include_once XOOPS_ROOT_PATH.'/language/'.$xoopsConfig['language'].'/comment.php';
+        $limit_array = array(10, 20, 50, 100);
+        $status_array = array(XOOPS_COMMENT_PENDING => _CM_PENDING, XOOPS_COMMENT_ACTIVE => _CM_ACTIVE, XOOPS_COMMENT_HIDDEN => _CM_HIDDEN);
+        $status_array2 = array(XOOPS_COMMENT_PENDING => '<span style="text-decoration: none; font-weight: bold; color: #00ff00;">'._CM_PENDING.'</span>', XOOPS_COMMENT_ACTIVE => '<span style="text-decoration: none; font-weight: bold; color: #ff0000;">'._CM_ACTIVE.'</span>', XOOPS_COMMENT_HIDDEN => '<span style="text-decoration: none; font-weight: bold; color: #0000ff;">'._CM_HIDDEN.'</span>');
+        $status = (!isset($_GET['status']) || !in_array(intval($_GET['status']), array_keys($status_array))) ? 0 : intval($_GET['status']);
+        $module = !isset($_GET['module']) ? 0 : intval($_GET['module']);
+        $module_handler =& xoops_gethandler('module');
+        $module_array =& $module_handler->getList(new Criteria('hascomments', 1));
+        $comment_handler =& xoops_gethandler('comment');
+        $criteria = new CriteriaCompo();
+        if ($status > 0) {
+            $criteria->add(new Criteria('com_status', $status));
+        }
+        if ($module > 0) {
+            $criteria->add(new Criteria('com_modid', $module));
+        }
+        $total = $comment_handler->getCount($criteria);
+        if ($total > 0) {
+            $start = isset($_GET['start']) ? intval($_GET['start']) : 0;
+            $limit = isset($_GET['limit']) ? intval($_GET['limit']) : 0;
+            if (!in_array($limit, $limit_array)) {
+                $limit = 50;
+            }
+            $sort = (!isset($_GET['sort']) || !in_array($_GET['sort'], array('com_modid', 'com_status', 'com_created', 'com_uid', 'com_ip', 'com_title'))) ? 'com_id' : $_GET['sort'];
+            if (!isset($_GET['order']) || $_GET['order'] != 'ASC') {
+                $order = 'DESC';
+                $otherorder = 'ASC';
+            } else {
+                $order = 'ASC';
+                $otherorder = 'DESC';
+            }
+            $criteria->setSort($sort);
+            $criteria->setOrder($order);
+            $criteria->setLimit($limit);
+            $criteria->setStart($start);
+            $comments =& $comment_handler->getObjects($criteria, true);
+        } else {
+            $start = 0;
+            $limit = 0;
+            $otherorder = 'DESC';
+            $comments = array();
+        }
+        $form = '<form action="admin.php" method="get">';
+        $form .= '<select name="module">';
+        $module_array[0] = _MD_AM_ALLMODS;
+        foreach ($module_array as $k => $v) {
+            $sel = '';
+            if ($k == $module) {
+                $sel = ' selected="selected"';
+            }
+            $form .= '<option value="'.$k.'"'.$sel.'>'.$v.'</option>';
+        }
+        $form .= '</select>&nbsp;<select name="status">';
+        $status_array[0] = _MD_AM_ALLSTATUS;
+        foreach ($status_array as $k => $v) {
+            $sel = '';
+            if (isset($status) && $k == $status) {
+                $sel = ' selected="selected"';
+            }
+            $form .= '<option value="'.$k.'"'.$sel.'>'.$v.'</option>';
+        }
+        $form .= '</select>&nbsp;<select name="limit">';
+        foreach ($limit_array as $k) {
+            $sel = '';
+            if (isset($limit) && $k == $limit) {
+                $sel = ' selected="selected"';
+            }
+            $form .= '<option value="'.$k.'"'.$sel.'>'.$k.'</option>';
+        }
+        $form .= '</select>&nbsp;<input type="hidden" name="fct" value="comments" /><input type="submit" value="'._GO.'" name="selsubmit" /></form>';
+
+        xoops_cp_header();
+        echo '<h4 style="text-align:left">'._MD_AM_COMMMAN.'</h4>';
+        echo $form;
+        echo '<table width="100%" class="outer" cellspacing="1"><tr><th colspan="8">'._MD_AM_LISTCOMM.'</th></tr><tr align="center"><td class="head">&nbsp;</td><td class="head" align="left"><a href="admin.php?fct=comments&amp;op=list&amp;sort=com_title&amp;order='.$otherorder.'&amp;module='.$module.'&amp;status='.$status.'&amp;start='.$start.'&amp;limit='.$limit.'">'._CM_TITLE.'</a></td><td class="head"><a href="admin.php?fct=comments&amp;op=list&amp;sort=com_created&amp;order='.$otherorder.'&amp;module='.$module.'&amp;status='.$status.'&amp;start='.$start.'&amp;limit='.$limit.'">'._CM_POSTED.'</a></td><td class="head"><a href="admin.php?fct=comments&amp;op=list&amp;sort=com_uid&amp;order='.$otherorder.'&amp;module='.$module.'&amp;status='.$status.'&amp;start='.$start.'&amp;limit='.$limit.'">'._CM_POSTER.'</a></td><td class="head"><a href="admin.php?fct=comments&amp;op=list&amp;sort=com_ip&amp;order='.$otherorder.'&amp;module='.$module.'&amp;status='.$status.'&amp;start='.$start.'&amp;limit='.$limit.'">IP</a></td><td class="head"><a href="admin.php?fct=comments&amp;op=list&amp;sort=com_modid&amp;order='.$otherorder.'&amp;module='.$module.'&amp;status='.$status.'&amp;start='.$start.'&amp;limit='.$limit.'">'._MD_AM_MODULE.'</a></td><td class="head"><a href="admin.php?fct=comments&amp;op=list&amp;sort=com_status&amp;order='.$otherorder.'&amp;module='.$module.'&amp;status='.$status.'&amp;start='.$start.'&amp;limit='.$limit.'">'._CM_STATUS.'</a></td><td class="head">&nbsp;</td></tr>';
+        $class = 'even';
+        foreach (array_keys($comments) as $i) {
+            $class = ($class == 'odd') ? 'even' : 'odd';
+            $poster_uname = $xoopsConfig['anonymous'];
+            if ($comments[$i]->getVar('com_uid') > 0) {
+                $poster =& $member_handler->getUser($comments[$i]->getVar('com_uid'));
+                if (is_object($poster)) {
+                    $poster_uname = '<a href="'.XOOPS_URL.'/userinfo.php?uid='.$comments[$i]->getVar('com_uid').'">'.$poster->getVar('uname').'</a>';
+                }
+            }
+            $icon = ($comments[$i]->getVar('com_icon') != '') ? '<img src="'.XOOPS_URL.'/images/subject/'.htmlspecialchars($comments[$i]->getVar('com_icon')).'" alt="" />' : '<img src="'.XOOPS_URL.'/images/icons/no_posticon.gif" alt="" />';
+            echo '<tr align="center"><td class="'.$class.'">'.$icon.'</td><td class="'.$class.'" align="left"><a href="admin.php?fct=comments&amp;op=jump&amp;com_id='.$i.'">'. $comments[$i]->getVar('com_title').'</a></td><td class="'.$class.'">'.formatTimestamp($comments[$i]->getVar('com_created'), 'm').'</td><td class="'.$class.'">'.$poster_uname.'</td><td class="'.$class.'">'.$comments[$i]->getVar('com_ip').'</td><td class="'.$class.'">'.$module_array[$comments[$i]->getVar('com_modid')].'</td><td class="'.$class.'">'.$status_array2[$comments[$i]->getVar('com_status')].'</td><td class="'.$class.'" align="right"><a href="admin/comments/comment_edit.php?com_id='.$i.'">'._EDIT.'</a> <a href="admin/comments/comment_delete.php?com_id='.$i.'">'._DELETE.'</a></td></tr>';
+        }
+        echo '</table>';
+        echo '<table style="width: 100%; border: 0; margin: 3px; padding: 3px;"><tr><td>'.sprintf(_MD_AM_COMFOUND, '<b>'.$total.'</b>');
+        if ($total > $limit) {
+            include_once XOOPS_ROOT_PATH.'/class/pagenav.php';
+            $nav = new XoopsPageNav($total, $limit, $start, 'start', 'fct=comments&amp;op=list&amp;limit='.$limit.'&amp;sort='.$sort.'&amp;order='.$order.'&amp;module='.$module);
+            echo '</td><td align="right">'.$nav->renderNav();
+        }
+        echo '</td></tr></table>';
+        xoops_cp_footer();
+        break;
+
+    case 'jump':
+        $com_id = (isset($_GET['com_id'])) ? intval($_GET['com_id']) : 0;
+        if ($com_id > 0) {
+            $comment_handler =& xoops_gethandler('comment');
+            $comment =& $comment_handler->get($com_id);
+            if (is_object($comment)) {
+                $module_handler =& xoops_gethandler('module');
+                $module =& $module_handler->get($comment->getVar('com_modid'));
+                $comment_config = $module->getInfo('comments');
+                header('Location: '.XOOPS_URL.'/modules/'.$module->getVar('dirname').'/'.$comment_config['pageName'].'?'.$comment_config['itemName'].'='.$comment->getVar('com_itemid').'&com_id='.$comment->getVar('com_id').'&com_rootid='.$comment->getVar('com_rootid').'&com_mode=thread&'.$comment->getVar('com_exparams').'#comment'.$comment->getVar('com_id'));
+                exit();
+            }
+        }
+        redirect_header('admin.php?fct=comments', 1);
+        break;
+
+    default:
+        break;
+    }
+
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/comments/comment_edit.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/comments/comment_edit.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/comments/comment_edit.php	(revision 405)
@@ -0,0 +1,29 @@
+<?php
+// $Id: comment_edit.php,v 1.2 2005/03/18 12:52:38 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+include './admin_header.php';
+include XOOPS_ROOT_PATH.'/include/comment_edit.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/comments/comment_post.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/comments/comment_post.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/comments/comment_post.php	(revision 405)
@@ -0,0 +1,29 @@
+<?php
+// $Id: comment_post.php,v 1.2 2005/03/18 12:52:38 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+include './admin_header.php';
+include XOOPS_ROOT_PATH.'/include/comment_post.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/comments/xoops_version.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/comments/xoops_version.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/comments/xoops_version.php	(revision 405)
@@ -0,0 +1,45 @@
+<?php
+// $Id: xoops_version.php,v 1.2 2005/03/18 12:52:38 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+$modversion['name'] = _MD_AM_COMMENTS;
+$modversion['version'] = "";
+$modversion['description'] = "XOOPS Site Comment Manager";
+$modversion['author'] = "";
+$modversion['credits'] = "The XOOPS Project";
+$modversion['help'] = "comments.html";
+$modversion['license'] = "GPL see LICENSE";
+$modversion['official'] = 1;
+$modversion['image'] = "comments.gif";
+
+$modversion['hasAdmin'] = 1;
+$modversion['adminpath'] = "admin.php?fct=comments";
+$modversion['category'] = XOOPS_SYSTEM_COMMENT;
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/blocksadmin/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/blocksadmin/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/blocksadmin/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/blocksadmin/main.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/blocksadmin/main.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/blocksadmin/main.php	(revision 405)
@@ -0,0 +1,305 @@
+<?php
+// $Id: main.php,v 1.5 2006/05/01 02:37:29 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+if ( !is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid()) ) {
+    exit("Access Denied");
+}
+include_once XOOPS_ROOT_PATH.'/class/xoopsblock.php';
+
+$op = "list";
+
+if ( isset($_GET['op']) ) {
+    if ($_GET['op'] == "edit" || $_GET['op'] == "delete" || $_GET['op'] == "delete_ok" || $_GET['op'] == "clone") {
+        $op = $_GET['op'];
+        $bid = isset($_GET['bid']) ? intval($_GET['bid']) : 0;
+    }
+} elseif (!empty($_POST['op'])) {
+    $op = $_POST['op'];
+}
+
+if (isset($_POST['previewblock'])) {
+    if (!XoopsMultiTokenHandler::quickValidate('block')) {
+        redirect_header("admin.php?fct=blocksadmin");
+        exit();
+    }
+    xoops_cp_header();
+    include_once XOOPS_ROOT_PATH.'/class/template.php';
+    $xoopsTpl = new XoopsTpl();
+    $xoopsTpl->xoops_setCaching(0);
+    $bid = !empty($_POST['bid']) ? intval($_POST['bid']) : 0;
+    if (!empty($bid)) {
+        $block['bid'] = $bid;
+        $block['form_title'] = _AM_EDITBLOCK;
+        $myblock = new XoopsBlock($bid);
+        $block['name'] = $myblock->getVar('name');
+    } else {
+        if ($op == 'save') {
+            $block['form_title'] = _AM_ADDBLOCK;
+        } else {
+            $block['form_title'] = _AM_CLONEBLOCK;
+        }
+        $myblock = new XoopsBlock();
+        $myblock->setVar('block_type', 'C');
+    }
+    $myts =& MyTextSanitizer::getInstance();
+    $myblock->setVar('title', $myts->stripSlashesGPC($_POST['btitle']));
+    $myblock->setVar('content', $myts->stripSlashesGPC($_POST['bcontent']));
+    $dummyhtml = '<html><head><meta http-equiv="content-type" content="text/html; charset='._CHARSET.'" /><meta http-equiv="content-language" content="'._LANGCODE.'" /><title>'.htmlspecialchars($xoopsConfig['sitename']).'</title><link rel="stylesheet" type="text/css" media="all" href="'.getcss($xoopsConfig['theme_set']).'" /></head><body><table><tr><th>'.$myblock->getVar('title').'</th></tr><tr><td>'.$myblock->getContent('S', $_POST['bctype']).'</td></tr></table></body></html>';
+
+    $block['edit_form'] = false;
+    $block['template'] = '';
+    $block['op'] = $op;
+    $block['side'] = $_POST['bside'];
+    $block['weight'] = $_POST['bweight'];
+    $block['visible'] = $_POST['bvisible'];
+    $block['title'] = $myblock->getVar('title', 'E');
+    $block['content'] = $myblock->getVar('content', 'E');
+    $block['modules'] =& $_POST['bmodule'];
+    $block['ctype'] = isset($_POST['bctype']) ? $_POST['bctype'] : $myblock->getVar('c_type');
+    $block['is_custom'] = true;
+    $block['cachetime'] = intval($_POST['bcachetime']);
+    echo '<a href="admin.php?fct=blocksadmin">'. _AM_BADMIN .'</a>&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;'.$block['form_title'].'<br /><br />';
+    include XOOPS_ROOT_PATH.'/modules/system/admin/blocksadmin/blockform.php';
+    $form->display();
+    xoops_cp_footer();
+    echo '<script type="text/javascript">
+    <!--//
+    win = openWithSelfMain("", "xoops_system_block_preview", 250, 200, true);
+    ';
+    $lines = preg_split("/(\r\n|\r|\n)( *)/", $dummyhtml);
+    foreach ($lines as $line) {
+        echo 'win.document.writeln("'.str_replace('"', '\"', $line).'");';
+    }
+    echo '
+    win.document.close();
+    //-->
+    </script>';
+    exit();
+}
+
+if ( $op == "list" ) {
+    require_once XOOPS_ROOT_PATH."/modules/system/admin/blocksadmin/blocksadmin.php";
+    xoops_cp_header();
+    list_blocks();
+    xoops_cp_footer();
+    exit();
+}
+
+if ( $op == "order" ) {
+    if (is_array($_POST['bid'])) {
+        require_once XOOPS_ROOT_PATH."/modules/system/admin/blocksadmin/blocksadmin.php";
+        foreach (array_keys($_POST['bid']) as $i) {
+            if ($_POST['oldweight'][$i] != $_POST['weight'][$i] || $_POST['oldvisible'][$i] != $_POST['visible'][$i] || $_POST['oldside'][$i] != $_POST['side'][$i])
+            order_block($_POST['bid'][$i], $_POST['weight'][$i], $_POST['visible'][$i], $_POST['side'][$i]);
+        }
+    }
+    redirect_header("admin.php?fct=blocksadmin",1,_AM_DBUPDATED);
+    exit();
+}
+
+if ( $op == "save" ) {
+    if (empty($_POST['bmodule']) || !XoopsMultiTokenHandler::quickValidate('block')) {
+        xoops_cp_header();
+        xoops_error(sprintf(_AM_NOTSELNG, _AM_VISIBLEIN));
+        xoops_cp_footer();
+        exit();
+    }
+    $myblock = new XoopsBlock();
+    $myblock->setVar('side', $_POST['bside']);
+    $myblock->setVar('weight', $_POST['bweight']);
+    $myblock->setVar('visible', $_POST['bvisible']);
+    $myblock->setVar('weight', $_POST['bweight']);
+    $myblock->setVar('title', $_POST['btitle']);
+    $myblock->setVar('content', $_POST['bcontent']);
+    $myblock->setVar('c_type', $_POST['bctype']);
+    $myblock->setVar('block_type', 'C');
+    $myblock->setVar('bcachetime', $_POST['bcachetime']);
+    switch ($_POST['bctype']) {
+    case 'H':
+        $name = _AM_CUSTOMHTML;
+        break;
+    case 'P':
+        $name = _AM_CUSTOMPHP;
+        break;
+    case 'S':
+        $name = _AM_CUSTOMSMILE;
+        break;
+    default:
+        $name = _AM_CUSTOMNOSMILE;
+        break;
+    }
+    $myblock->setVar('name', $name);
+    $newid = $myblock->store();
+    if (!$newid) {
+        xoops_cp_header();
+        $myblock->getHtmlErrors();
+        xoops_cp_footer();
+        exit();
+    }
+    $db =& Database::getInstance();
+    foreach ($_POST['bmodule'] as $bmid) {
+        $sql = 'INSERT INTO '.$db->prefix('block_module_link').' (block_id, module_id) VALUES ('.$newid.', '.intval($bmid).')';
+            $db->query($sql);
+    }
+    $groups = $xoopsUser->getGroups();
+    $count = count($groups);
+    for ($i = 0; $i < $count; $i++) {
+        $sql = "INSERT INTO ".$db->prefix('group_permission')." (gperm_groupid, gperm_itemid, gperm_name, gperm_modid) VALUES (".$groups[$i].", ".$newid.", 'block_read', 1)";
+        $db->query($sql);
+    }
+    redirect_header('admin.php?fct=blocksadmin&amp;t='.time(),1,_AM_DBUPDATED);
+    exit();
+}
+
+if ( $op == "update" ) {
+    $bid = !empty($_POST['bid']) ? intval($_POST['bid']) : 0;
+    if ($bid <= 0) {
+        exit();
+    }
+    $bcachetime = isset($_POST['bcachetime']) ? intval($_POST['bcachetime']) : 0;
+    $options = isset($_POST['options']) ? $_POST['options'] : array();
+    $bcontent = isset($_POST['bcontent']) ? $_POST['bcontent'] : '';
+    $bctype = isset($_POST['bctype']) ? $_POST['bctype'] : '';
+    if (empty($_POST['bmodule']) || !XoopsMultiTokenHandler::quickValidate('block')) {
+        xoops_cp_header();
+        xoops_error(sprintf(_AM_NOTSELNG, _AM_VISIBLEIN));
+        xoops_cp_footer();
+        exit();
+    }
+    $myblock = new XoopsBlock($bid);
+    $myblock->setVar('side', $_POST['bside']);
+    $myblock->setVar('weight', $_POST['bweight']);
+    $myblock->setVar('visible', $_POST['bvisible']);
+    $myblock->setVar('title', $_POST['btitle']);
+    $myblock->setVar('content', $bcontent);
+    $myblock->setVar('bcachetime', $bcachetime);
+    $options_count = count($options);
+    if ($options_count > 0) {
+        //Convert array values to comma-separated
+        for ( $i = 0; $i < $options_count; $i++ ) {
+            if (is_array($options[$i])) {
+                $options[$i] = implode(',', $options[$i]);
+            }
+        }
+        $options = implode('|', $options);
+        $myblock->setVar('options', $options);
+    }
+    if ($myblock->getVar('block_type') == 'C') {
+        switch ($bctype) {
+        case 'H':
+            $name = _AM_CUSTOMHTML;
+            break;
+        case 'P':
+            $name = _AM_CUSTOMPHP;
+            break;
+        case 'S':
+            $name = _AM_CUSTOMSMILE;
+            break;
+        default:
+            $name = _AM_CUSTOMNOSMILE;
+            break;
+        }
+        $myblock->setVar('name', $name);
+        $myblock->setVar('c_type', $bctype);
+    } else {
+        $myblock->setVar('c_type', 'H');
+    }
+    $msg = _AM_DBUPDATED;
+    if ($myblock->store() != false) {
+        $db =& Database::getInstance();
+        $sql = sprintf("DELETE FROM %s WHERE block_id = %u", $db->prefix('block_module_link'), $bid);
+        $db->query($sql);
+        foreach ($_POST['bmodule'] as $bmid) {
+            $sql = sprintf("INSERT INTO %s (block_id, module_id) VALUES (%u, %d)", $db->prefix('block_module_link'), $bid, intval($bmid));
+            $db->query($sql);
+        }
+        include_once XOOPS_ROOT_PATH.'/class/template.php';
+        $xoopsTpl = new XoopsTpl();
+        $xoopsTpl->xoops_setCaching(2);
+        if ($myblock->getVar('template') != '') {
+            if ($xoopsTpl->is_cached('db:'.$myblock->getVar('template'), 'blk_'.$myblock->getVar('bid'))) {
+                if (!$xoopsTpl->clear_cache('db:'.$myblock->getVar('template'), 'blk_'.$myblock->getVar('bid'))) {
+                    $msg = 'Unable to clear cache for block ID '.$bid;
+                }
+            }
+        } else {
+            if ($xoopsTpl->is_cached('db:system_dummy.html', 'blk_'.$bid)) {
+                if (!$xoopsTpl->clear_cache('db:system_dummy.html', 'blk_'.$bid)) {
+                    $msg = 'Unable to clear cache for block ID '.$bid;
+                }
+            }
+        }
+    } else {
+        $msg = 'Failed update of block. ID:'.$bid;
+    }
+    redirect_header('admin.php?fct=blocksadmin&amp;t='.time(),1,$msg);
+    exit();
+}
+
+
+if ( $op == "delete_ok" ) {
+    $bid = !empty($_POST['bid']) ? intval($_POST['bid']) : 0;
+    if ($bid > 0) {
+        require_once XOOPS_ROOT_PATH."/modules/system/admin/blocksadmin/blocksadmin.php";
+        delete_block_ok($bid);
+    }
+    exit();
+}
+
+if ( $op == "delete" ) {
+    xoops_cp_header();
+    if ($bid > 0) {
+        require_once XOOPS_ROOT_PATH."/modules/system/admin/blocksadmin/blocksadmin.php";
+        delete_block($bid);
+    }
+    xoops_cp_footer();
+    exit();
+}
+
+if ( $op == "edit" ) {
+    xoops_cp_header();
+    if ($bid > 0) {
+        require_once XOOPS_ROOT_PATH."/modules/system/admin/blocksadmin/blocksadmin.php";
+        edit_block($bid);
+    }
+    xoops_cp_footer();
+    exit();
+}
+/*
+if ($op == 'clone') {
+    clone_block($bid);
+}
+
+if ($op == 'clone_ok') {
+    clone_block_ok($bid, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options);
+}
+*/
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/blocksadmin/blocksadmin.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/blocksadmin/blocksadmin.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/blocksadmin/blocksadmin.php	(revision 405)
@@ -0,0 +1,312 @@
+<?php
+// $Id: blocksadmin.php,v 1.4 2005/08/03 12:39:16 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+if ( !is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid()) ) {
+    exit("Access Denied");
+}
+// check if the user is authorised
+if ( $xoopsUser->isAdmin($xoopsModule->mid()) ) {
+    include_once XOOPS_ROOT_PATH.'/class/xoopsblock.php';
+
+    function list_blocks()
+    {
+        global $xoopsUser, $xoopsConfig;
+        include_once XOOPS_ROOT_PATH.'/class/xoopslists.php';
+        //OpenTable();
+        $selmod = isset($_GET['selmod']) ? intval($_GET['selmod']) : 0;
+        $selvis = isset($_GET['selvis']) ? intval($_GET['selvis']) : 2;
+        $selgrp = isset($_GET['selgrp']) ? intval($_GET['selgrp']) : XOOPS_GROUP_USERS;
+        echo "
+        <h4 style='text-align:left;'>"._AM_BADMIN."</h4>";
+        echo '<form action="admin.php" method="get">';
+        $form = "<select size=\"1\" name=\"selmod\" onchange=\"location='".XOOPS_URL."/modules/system/admin.php?fct=blocksadmin&amp;selvis=$selvis&amp;selgrp=$selgrp&amp;selmod='+this.options[this.selectedIndex].value\">";
+        $module_handler =& xoops_gethandler('module');
+        $criteria = new CriteriaCompo(new Criteria('hasmain', 1));
+        $criteria->add(new Criteria('isactive', 1));
+        $module_list =& $module_handler->getList($criteria);
+        $toponlyblock = false;
+        $module_list[-1] = _AM_TOPPAGE;
+        $selmod = isset($_GET['selmod']) ? intval($_GET['selmod']) : -1;
+        ksort($module_list);
+        foreach ($module_list as $k => $v) {
+            $sel = '';
+            if ($k == $selmod) {
+                $sel = ' selected="selected"';
+            }
+            $form .= '<option value="'.$k.'"'.$sel.'>'.$v.'</option>';
+        }
+        $form .= '</select>&nbsp;<input type="hidden" name="fct" value="blocksadmin" />';
+        printf(_AM_SVISIBLEIN, $form);
+        $member_handler =& xoops_gethandler('member');
+        $group_list =& $member_handler->getGroupList();
+        $group_sel = _AM_GROUP." <select size=\"1\" name=\"selgrp\" onchange=\"location='".XOOPS_URL."/modules/system/admin.php?fct=blocksadmin&amp;selvis=$selvis&amp;selmod=$selmod&amp;selgrp='+this.options[this.selectedIndex].value\">";
+        $group_list[0] = '#'._AM_UNASSIGNED; // fix for displaying blocks unassigned to any group
+        foreach ($group_list as $k => $v) {
+            $sel = '';
+            if ($k == $selgrp) {
+                $sel = ' selected="selected"';
+            }
+            $group_sel .= '<option value="'.$k.'"'.$sel.'>'.$v.'</option>';
+        }
+        $group_sel .= '</select> ';
+        echo $group_sel;
+        echo _AM_VISIBLE." <select size=\"1\" name=\"selvis\" onchange=\"location='".XOOPS_URL."/modules/system/admin.php?fct=blocksadmin&amp;selmod=$selmod&amp;selgrp=$selgrp&amp;selvis='+this.options[this.selectedIndex].value\">";
+        $selvis0 = $selvis1 = $selvis2 = "";
+        switch($selvis){
+        case 0:
+            $selvis0 = 'selected="selected"';
+            break;
+        case 1:
+            $selvis1 = 'selected="selected"';
+            break;
+        case 2:
+        default:
+            $selvis2 = 'selected="selected"';
+            break;
+        }
+        echo '<option value="0" '.$selvis0.'>'._NO.'</option>';
+        echo '<option value="1" '.$selvis1.'>'._YES.'</option>';
+        echo '<option value="2" '.$selvis2.'>'._ALL.'</option>';
+        echo '</select> <input type="submit" value="'._GO.'" name="selsubmit" />';
+        echo '</form>';
+        echo "<form action='admin.php' name='blockadmin' method='post'>
+        <table width='100%' class='outer' cellpadding='4' cellspacing='1'>
+        <tr valign='middle'><th width='20%'>"._AM_BLKDESC."</th><th>"._AM_TITLE."</th><th>"._AM_MODULE."</th><th align='center' nowrap='nowrap'>"._AM_SIDE."<br />"._LEFT."-"._CENTER."-"._RIGHT."</th><th align='center'>"._AM_WEIGHT."</th><th align='center'>"._AM_VISIBLE."</th><th align='right'>"._AM_ACTION."</th></tr>
+        ";
+        if ($selvis == 2) $selvis = null;
+        if ($selgrp == 0) {
+            // get blocks that are not assigned to any groups
+            $block_arr =& XoopsBlock::getNonGroupedBlocks($selmod, $toponlyblock, $selvis, 'b.side,b.weight,b.bid');
+        } else {
+            $block_arr =& XoopsBlock::getAllByGroupModule($selgrp, $selmod, $toponlyblock, $selvis, 'b.side,b.weight,b.bid');
+        }
+        $block_count = count($block_arr);
+        $class = 'even';
+        $module_list2 =& $module_handler->getList();
+        // for custom blocks
+        $module_list2[0] = '&nbsp;';
+        foreach (array_keys($block_arr) as $i) {
+            $sel0 = $sel1 = $ssel0 = $ssel1 = $ssel2 = $ssel3 = $ssel4 = "";
+            if ( $block_arr[$i]->getVar("visible") == 1 ) {
+                $sel1 = " checked='checked'";
+            } else {
+                $sel0 = " checked='checked'";
+            }
+            if ( $block_arr[$i]->getVar("side") == XOOPS_SIDEBLOCK_LEFT){
+                $ssel0 = " checked='checked'";
+            } elseif ( $block_arr[$i]->getVar("side") == XOOPS_SIDEBLOCK_RIGHT ){
+                $ssel1 = " checked='checked'";
+            } elseif ( $block_arr[$i]->getVar("side") == XOOPS_CENTERBLOCK_LEFT ){
+                $ssel2 = " checked='checked'";
+            } elseif ( $block_arr[$i]->getVar("side") == XOOPS_CENTERBLOCK_RIGHT ){
+                $ssel4 = " checked='checked'";
+            } elseif ( $block_arr[$i]->getVar("side") == XOOPS_CENTERBLOCK_CENTER ){
+                $ssel3 = " checked='checked'";
+            }
+            if ( $block_arr[$i]->getVar("title") == "" ) {
+                $title = "&nbsp;";
+            } else {
+                $title = $block_arr[$i]->getVar("title");
+            }
+            $name = $block_arr[$i]->getVar("name");
+            echo "<tr valign='top'><td class='$class'>".$name."</td><td class='$class'>".$title."</td><td class='$class'>".$module_list2[$block_arr[$i]->getVar('mid')]."</td><td class='$class' align='center' nowrap='nowrap'><input type='radio' name='side[$i]' value='".XOOPS_SIDEBLOCK_LEFT."'$ssel0 />-<input type='radio' name='side[$i]' value='".XOOPS_CENTERBLOCK_LEFT."'$ssel2 /><input type='radio' name='side[$i]' value='".XOOPS_CENTERBLOCK_CENTER."'$ssel3 /><input type='radio' name='side[$i]' value='".XOOPS_CENTERBLOCK_RIGHT."'$ssel4 />-<input type='radio' name='side[$i]' value='".XOOPS_SIDEBLOCK_RIGHT."'$ssel1 /></td><td class='$class' align='center'><input type='text' name='weight[$i]' value='".$block_arr[$i]->getVar("weight")."' size='5' maxlength='5' /></td><td class='$class' align='center' nowrap='nowrap'><input type='radio' name='visible[$i]' value='1'$sel1 />"._YES."&nbsp;<input type='radio' name='visible[$i]' value='0'$sel0 />"._NO."</td><td class='$class' align='right'><a href='admin.php?fct=blocksadmin&amp;op=edit&amp;bid=".$block_arr[$i]->getVar("bid")."'>"._EDIT."</a>";
+            if ($block_arr[$i]->getVar('block_type') != 'S') {
+                echo "&nbsp;<a href='admin.php?fct=blocksadmin&amp;op=delete&amp;bid=".$block_arr[$i]->getVar("bid")."'>"._DELETE."</a>";
+            }
+            echo "
+            <input type='hidden' name='oldside[$i]' value='".$block_arr[$i]->getVar('side')."' />
+            <input type='hidden' name='oldweight[$i]' value='".$block_arr[$i]->getVar('weight')."' />
+            <input type='hidden' name='oldvisible[$i]' value='".$block_arr[$i]->getVar('visible')."' />
+            <input type='hidden' name='bid[$i]' value='".$i."' />
+            </td></tr>
+            ";
+            $class = ($class == 'even') ? 'odd' : 'even';
+        }
+        echo "<tr><td class='foot' align='center' colspan='7'>
+        <input type='hidden' name='fct' value='blocksadmin' />
+        <input type='hidden' name='op' value='order' />
+        <input type='submit' name='submit' value='"._SUBMIT."' />
+        </td></tr></table>
+        </form>
+        <br /><br />";
+
+        $block = array('form_title' => _AM_ADDBLOCK, 'side' => 0, 'weight' => 0, 'visible' => 1, 'title' => '', 'content' => '', 'modules' => array(-1), 'is_custom' => true, 'ctype' => 'H', 'cachetime' => 0, 'op' => 'save', 'edit_form' => false);
+        include XOOPS_ROOT_PATH.'/modules/system/admin/blocksadmin/blockform.php';
+        $form->display();
+    }
+
+    function edit_block($bid)
+    {
+        $myblock = new XoopsBlock($bid);
+        $db =& Database::getInstance();
+        $sql = 'SELECT module_id FROM '.$db->prefix('block_module_link').' WHERE block_id='.intval($bid);
+        $result = $db->query($sql);
+        $modules = array();
+        while ($row = $db->fetchArray($result)) {
+            $modules[] = intval($row['module_id']);
+        }
+        $is_custom = ($myblock->getVar('block_type') == 'C' || $myblock->getVar('block_type') == 'E') ? true : false;
+        $block = array('form_title' => _AM_EDITBLOCK, 'name' => $myblock->getVar('name'), 'side' => $myblock->getVar('side'), 'weight' => $myblock->getVar('weight'), 'visible' => $myblock->getVar('visible'), 'title' => $myblock->getVar('title', 'E'), 'content' => $myblock->getVar('content', 'E'), 'modules' => $modules, 'is_custom' => $is_custom, 'ctype' => $myblock->getVar('c_type'), 'cachetime' => $myblock->getVar('bcachetime'), 'op' => 'update', 'bid' => $myblock->getVar('bid'), 'edit_form' => $myblock->getOptions(), 'template' => $myblock->getVar('template'), 'options' => $myblock->getVar('options'));
+        echo '<a href="admin.php?fct=blocksadmin">'. _AM_BADMIN .'</a>&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;'._AM_EDITBLOCK.'<br /><br />';
+        include XOOPS_ROOT_PATH.'/modules/system/admin/blocksadmin/blockform.php';
+        $form->display();
+    }
+
+    function delete_block($bid)
+    {
+        $myblock = new XoopsBlock($bid);
+        if ( $myblock->getVar('block_type') == 'S' ) {
+            $message = _AM_SYSTEMCANT;
+            redirect_header('admin.php?fct=blocksadmin',4,$message);
+            exit();
+        } elseif ($myblock->getVar('block_type') == 'M') {
+            // Fix for duplicated blocks created in 2.0.9 module update
+            // A module block can be deleted if there is more than 1 that
+            // has the same func_num/show_func which is mostly likely
+            // be the one that was duplicated in 2.0.9
+            if (1 >= $count = XoopsBlock::countSimilarBlocks($myblock->getVar('mid'), $myblock->getVar('func_num'), $myblock->getVar('show_func'))) {
+                $message = _AM_MODULECANT;
+                redirect_header('admin.php?fct=blocksadmin',4,$message);
+                exit();
+            }
+        }
+        xoops_token_confirm(array('fct' => 'blocksadmin', 'op' => 'delete_ok', 'bid' => $myblock->getVar('bid')), 'admin.php', sprintf(_AM_RUSUREDEL,$myblock->getVar('title')));
+    }
+
+    function delete_block_ok($bid)
+    {
+        if(!xoops_confirm_validate())
+            die("Ticket Error");
+
+        $myblock = new XoopsBlock($bid);
+        $myblock->delete();
+        if ($myblock->getVar('template') != '') {
+            $tplfile_handler =& xoops_gethandler('tplfile');
+            $btemplate =& $tplfile_handler->find($GLOBALS['xoopsConfig']['template_set'], 'block', $bid);
+            if (count($btemplate) > 0) {
+                $tplfile_handler->delete($btemplate[0]);
+            }
+        }
+        redirect_header('admin.php?fct=blocksadmin&amp;t='.time(),1,_AM_DBUPDATED);
+        exit();
+    }
+
+    function order_block($bid, $weight, $visible, $side)
+    {
+        $myblock = new XoopsBlock($bid);
+        $myblock->setVar('weight', $weight);
+        $myblock->setVar('visible', $visible);
+        $myblock->setVar('side', $side);
+        $myblock->store();
+    }
+
+    function clone_block($bid)
+    {
+        global $xoopsConfig;
+        xoops_cp_header();
+        $myblock = new XoopsBlock($bid);
+        $db =& Database::getInstance();
+        $sql = 'SELECT module_id FROM '.$db->prefix('block_module_link').' WHERE block_id='.intval($bid);
+        $result = $db->query($sql);
+        $modules = array();
+        while ($row = $db->fetchArray($result)) {
+            $modules[] = intval($row['module_id']);
+        }
+        $is_custom = ($myblock->getVar('block_type') == 'C' || $myblock->getVar('block_type') == 'E') ? true : false;
+        $block = array('form_title' => _AM_CLONEBLOCK, 'name' => $myblock->getVar('name'), 'side' => $myblock->getVar('side'), 'weight' => $myblock->getVar('weight'), 'visible' => $myblock->getVar('visible'), 'content' => $myblock->getVar('content', 'N'), 'modules' => $modules, 'is_custom' => $is_custom, 'ctype' => $myblock->getVar('c_type'), 'cachetime' => $myblock->getVar('bcachetime'), 'op' => 'clone_ok', 'bid' => $myblock->getVar('bid'), 'edit_form' => $myblock->getOptions(), 'template' => $myblock->getVar('template'), 'options' => $myblock->getVar('options'));
+        echo '<a href="admin.php?fct=blocksadmin">'. _AM_BADMIN .'</a>&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;'._AM_CLONEBLOCK.'<br /><br />';
+        include XOOPS_ROOT_PATH.'/modules/system/admin/blocksadmin/blockform.php';
+        $form->display();
+        xoops_cp_footer();
+        exit();
+    }
+
+    function clone_block_ok($bid, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options)
+    {
+        global $xoopsUser;
+        $block = new XoopsBlock($bid);
+        $clone =& $block->xoopsClone();
+        if (empty($bmodule)) {
+            xoops_cp_header();
+            xoops_error(sprintf(_AM_NOTSELNG, _AM_VISIBLEIN));
+            xoops_cp_footer();
+            exit();
+        }
+        $clone->setVar('side', $bside);
+        $clone->setVar('weight', $bweight);
+        $clone->setVar('visible', $bvisible);
+        $clone->setVar('content', $bcontent);
+        //$clone->setVar('title', $btitle);
+        $clone->setVar('bcachetime', $bcachetime);
+        if ( isset($options) && (count($options) > 0) ) {
+            $options = implode('|', $options);
+            $clone->setVar('options', $options);
+        }
+        $clone->setVar('bid', 0);
+        if ($block->getVar('block_type') == 'C' || $block->getVar('block_type') == 'E') {
+            $clone->setVar('block_type', 'E');
+        } else {
+            $clone->setVar('block_type', 'D');
+        }
+        $newid = $clone->store();
+        if (!$newid) {
+            xoops_cp_header();
+            $clone->getHtmlErrors();
+            xoops_cp_footer();
+            exit();
+        }
+        if ($clone->getVar('template') != '') {
+            $tplfile_handler =& xoops_gethandler('tplfile');
+            $btemplate =& $tplfile_handler->find($GLOBALS['xoopsConfig']['template_set'], 'block', $bid);
+            if (count($btemplate) > 0) {
+                $tplclone =& $btemplate[0]->xoopsClone();
+                $tplclone->setVar('tpl_id', 0);
+                $tplclone->setVar('tpl_refid', $newid);
+                $tplman->insert($tplclone);
+            }
+        }
+        $db =& Database::getInstance();
+        foreach ($bmodule as $bmid) {
+            $sql = 'INSERT INTO '.$db->prefix('block_module_link').' (block_id, module_id) VALUES ('.$newid.', '.$bmid.')';
+            $db->query($sql);
+        }
+        $groups =& $xoopsUser->getGroups();
+        $count = count($groups);
+        for ($i = 0; $i < $count; $i++) {
+            $sql = "INSERT INTO ".$db->prefix('group_permission')." (gperm_groupid, gperm_itemid, gperm_modid, gperm_name) VALUES (".$groups[$i].", ".$newid.", 1, 'block_read')";
+            $db->query($sql);
+        }
+        redirect_header('admin.php?fct=blocksadmin&amp;t='.time(),1,_AM_DBUPDATED);
+    }
+} else {
+    echo "Access Denied";
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/blocksadmin/xoops_version.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/blocksadmin/xoops_version.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/blocksadmin/xoops_version.php	(revision 405)
@@ -0,0 +1,44 @@
+<?php
+// $Id: xoops_version.php,v 1.2 2005/03/18 12:52:38 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+$modversion['name'] = _MD_AM_BKAD;
+$modversion['version'] = "";
+$modversion['description'] = "Side Blocks Administration";
+$modversion['author'] = "";
+$modversion['credits'] = "The MPN SE Project";
+$modversion['help'] = "blocks.html";
+$modversion['license'] = "GPL see LICENSE";
+$modversion['official'] = 1;
+$modversion['image'] = "blocksadmin.gif";
+$modversion['hasAdmin'] = 1;
+$modversion['adminpath'] = "admin.php?fct=blocksadmin";
+$modversion['category'] = XOOPS_SYSTEM_BLOCK;
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/blocksadmin/blockform.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/blocksadmin/blockform.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/blocksadmin/blockform.php	(revision 405)
@@ -0,0 +1,88 @@
+<?php
+// $Id: blockform.php,v 1.4 2005/08/03 12:39:16 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+include_once XOOPS_ROOT_PATH."/class/xoopsformloader.php";
+$form = new XoopsThemeForm($block['form_title'], 'blockform', 'admin.php');
+if (isset($block['name'])) {
+    $form->addElement(new XoopsFormLabel(_AM_NAME, $block['name']));
+}
+$side_select = new XoopsFormSelect(_AM_BLKTYPE, "bside", $block['side']);
+$side_select->addOptionArray(array(0 => _AM_SBLEFT, 1 => _AM_SBRIGHT, 3 => _AM_CBLEFT, 4 => _AM_CBRIGHT, 5 => _AM_CBCENTER, ));
+$form->addElement($side_select);
+$form->addElement(new XoopsFormText(_AM_WEIGHT, "bweight", 2, 5, $block['weight']));
+$form->addElement(new XoopsFormRadioYN(_AM_VISIBLE, 'bvisible', $block['visible']));
+$mod_select = new XoopsFormSelect(_AM_VISIBLEIN, "bmodule", $block['modules'], 5, true);
+$module_handler =& xoops_gethandler('module');
+$criteria = new CriteriaCompo(new Criteria('hasmain', 1));
+$criteria->add(new Criteria('isactive', 1));
+$module_list =& $module_handler->getList($criteria);
+$module_list[-1] = _AM_TOPPAGE;
+$module_list[0] = _AM_ALLPAGES;
+ksort($module_list);
+$mod_select->addOptionArray($module_list);
+$form->addElement($mod_select);
+$form->addElement(new XoopsFormText(_AM_TITLE, 'btitle', 50, 255, $block['title']), false);
+if ( $block['is_custom'] ) {
+    $textarea = new XoopsFormDhtmlTextArea(_AM_CONTENT, 'bcontent', $block['content'], 15, 70);
+    $textarea->setDescription('<span style="font-size:x-small;font-weight:bold;">'._AM_USEFULTAGS.'</span><br /><span style="font-size:x-small;font-weight:normal;">'.sprintf(_AM_BLOCKTAG1, '{X_SITEURL}', XOOPS_URL.'/').'</span>');
+    $form->addElement($textarea, true);
+    $ctype_select = new XoopsFormSelect(_AM_CTYPE, 'bctype', $block['ctype']);
+    $ctype_select->addOptionArray(array('H' => _AM_HTML, 'P' => _AM_PHP, 'S' => _AM_AFWSMILE, 'T' => _AM_AFNOSMILE));
+    $form->addElement($ctype_select);
+} else {
+    if ($block['template'] != '') {
+        $tplfile_handler =& xoops_gethandler('tplfile');
+        $btemplate =& $tplfile_handler->find($GLOBALS['xoopsConfig']['template_set'], 'block', $block['bid']);
+        if (count($btemplate) > 0) {
+            $form->addElement(new XoopsFormLabel(_AM_CONTENT, '<a href="'.XOOPS_URL.'/modules/system/admin.php?fct=tplsets&amp;op=edittpl&amp;id='.$btemplate[0]->getVar('tpl_id').'">'._AM_EDITTPL.'</a>'));
+        } else {
+            $btemplate2 =& $tplfile_handler->find('default', 'block', $block['bid']);
+            if (count($btemplate2) > 0) {
+                $form->addElement(new XoopsFormLabel(_AM_CONTENT, '<a href="'.XOOPS_URL.'/modules/system/admin.php?fct=tplsets&amp;op=edittpl&amp;id='.$btemplate2[0]->getVar('tpl_id').'" target="_blank">'._AM_EDITTPL.'</a>'));
+            }
+        }
+    }
+    if ($block['edit_form'] != false) {
+        $form->addElement(new XoopsFormLabel(_AM_OPTIONS, $block['edit_form']));
+    }
+}
+$cache_select = new XoopsFormSelect(_AM_BCACHETIME, 'bcachetime', $block['cachetime']);
+$cache_select->addOptionArray(array('0' => _NOCACHE, '30' => sprintf(_SECONDS, 30), '60' => _MINUTE, '300' => sprintf(_MINUTES, 5), '1800' => sprintf(_MINUTES, 30), '3600' => _HOUR, '18000' => sprintf(_HOURS, 5), '86400' => _DAY, '259200' => sprintf(_DAYS, 3), '604800' => _WEEK, '2592000' => _MONTH));
+$form->addElement($cache_select);
+if (isset($block['bid'])) {
+    $form->addElement(new XoopsFormHidden('bid', $block['bid']));
+}
+$form->addElement(new XoopsFormHidden('op', $block['op']));
+$form->addElement(new XoopsFormHidden('fct', 'blocksadmin'));
+$form->addElement(new XoopsFormToken(XoopsMultiTokenHandler::quickCreate('block')));
+$button_tray = new XoopsFormElementTray('', '&nbsp;');
+if ($block['is_custom']) {
+    $button_tray->addElement(new XoopsFormButton('', 'previewblock', _PREVIEW, "submit"));
+}
+$button_tray->addElement(new XoopsFormButton('', 'submitblock', _SUBMIT, "submit"));
+$form->addElement($button_tray);
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/banners/xoops_version.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/banners/xoops_version.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/banners/xoops_version.php	(revision 405)
@@ -0,0 +1,44 @@
+<?php
+// $Id: xoops_version.php,v 1.2 2005/03/18 12:52:38 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+$modversion['name'] = _MD_AM_BANS;
+$modversion['version'] = "";
+$modversion['description'] = "Banners Administration";
+$modversion['author'] = "Francisco Burzi <br>( http://phpnuke.org/ )";
+$modversion['credits'] = "The MPN SE Project";
+$modversion['help'] = "banners.html";
+$modversion['license'] = "GPL see LICENSE";
+$modversion['official'] = 1;
+$modversion['image'] = "banners.gif";
+$modversion['hasAdmin'] = 1;
+$modversion['adminpath'] = "admin.php?fct=banners";
+$modversion['category'] = XOOPS_SYSTEM_BANNER;
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/banners/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/banners/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/banners/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/banners/main.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/banners/main.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/banners/main.php	(revision 405)
@@ -0,0 +1,199 @@
+<?php
+// $Id: main.php,v 1.4 2005/08/03 12:39:15 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+// ------------------------------------------------------------------------- //
+
+if ( !is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid()) ) {
+    exit("Access Denied");
+}
+include_once XOOPS_ROOT_PATH."/modules/system/admin/banners/banners.php";
+include_once XOOPS_ROOT_PATH."/class/module.textsanitizer.php";
+
+$op = "BannersAdmin";
+if (isset($_GET['op'])) {
+    $op = $_GET['op'];
+} elseif (isset($_POST['op'])) {
+    $op = $_POST['op'];
+}
+
+switch ( $op ) {
+case "BannersAdmin":
+    BannersAdmin();
+    break;
+
+case "BannersAdd":
+    if (!XoopsMultiTokenHandler::quickValidate('banners_BannersAdd')) {
+        redirect_header("admin.php?fct=banners&amp;op=BannersAdmin#top");
+    }
+    $name = isset($_POST['name']) ? trim($_POST['name']) : '';
+    $cid = isset($_POST['cid']) ? intval($_POST['cid']) : 0;
+    $imageurl = isset($_POST['imageurl']) ? trim($_POST['imageurl']) : '';
+    $clickurl = isset($_POST['clickurl']) ? trim($_POST['clickurl']) : '';
+    $imptotal = isset($_POST['imptotal']) ? intval($_POST['imptotal']) : 0;
+    $htmlbanner = isset($_POST['htmlbanner']) ? intval($_POST['htmlbanner']) : 0;
+    $htmlcode = isset($_POST['htmlcode']) ? trim($_POST['htmlcode']) : '';
+    if ($cid <= 0) {
+        redirect_header("admin.php?fct=banners&amp;op=BannersAdmin#top");
+    }
+    $db =& Database::getInstance();
+    $myts =& MyTextSanitizer::getInstance();
+    $newid = $db->genId($db->prefix("banner")."_bid_seq");
+    $sql = sprintf("INSERT INTO %s (bid, cid, imptotal, impmade, clicks, imageurl, clickurl, date, htmlbanner, htmlcode) VALUES (%d, %d, %d, 1, 0, %s, %s, %d, %d, %s)", $db->prefix("banner"), intval($newid), $cid, $imptotal, $db->quoteString($myts->stripSlashesGPC($imageurl)), $db->quoteString($myts->stripSlashesGPC($clickurl)), time(), $htmlbanner, $db->quoteString($myts->stripSlashesGPC($htmlcode)));
+    $db->query($sql);
+    redirect_header("admin.php?fct=banners&amp;op=BannersAdmin#top",1,_AM_DBUPDATED);
+    exit();
+    break;
+
+case "BannerAddClient":
+    if (!XoopsSingleTokenHandler::quickValidate('banners_AddClient')) {
+        redirect_header("admin.php?fct=banners&amp;op=BannersAdmin#top");
+    }
+    $name = isset($_POST['name']) ? trim($_POST['name']) : '';
+    $contact = isset($_POST['contact']) ? trim($_POST['contact']) : '';
+    $email = isset($_POST['email']) ? trim($_POST['email']) : '';
+    $login = isset($_POST['login']) ? trim($_POST['login']) : '';
+    $passwd = isset($_POST['passwd']) ? trim($_POST['passwd']) : '';
+    $extrainfo = isset($_POST['extrainfo']) ? trim($_POST['extrainfo']) : '';
+    $db =& Database::getInstance();
+    $myts =& MyTextSanitizer::getInstance();
+    $newid = $db->genId($xoopsDB->prefix("bannerclient")."_cid_seq");
+    $sql = sprintf("INSERT INTO %s (cid, name, contact, email, login, passwd, extrainfo) VALUES (%d, %s, %s, %s, %s, %s, %s)", $db->prefix("bannerclient"), intval($newid), $db->quoteString($myts->stripSlashesGPC($name)), $db->quoteString($myts->stripSlashesGPC($contact)), $db->quoteString($myts->stripSlashesGPC($email)), $db->quoteString($myts->stripSlashesGPC($login)), $db->quoteString($myts->stripSlashesGPC($passwd)), $db->quoteString($myts->stripSlashesGPC($extrainfo)));
+    $db->query($sql);
+    redirect_header("admin.php?fct=banners&amp;op=BannersAdmin#top",1,_AM_DBUPDATED);
+    exit();
+    break;
+
+case "BannerFinishDelete":
+    xoops_cp_header();
+    xoops_token_confirm(array('op' => 'BannerFinishDelete2', 'bid' => intval($_GET['bid']), 'fct' => 'banners'), 'admin.php', _AM_SUREDELE);
+    xoops_cp_footer();
+    break;
+
+case "BannerFinishDelete2":
+    $bid = isset($_POST['bid']) ? intval($_POST['bid']) : 0;
+    if ($bid <= 0 || !xoops_confirm_validate() ) {
+        redirect_header("admin.php?fct=banners&amp;op=BannersAdmin#top");
+    }
+    $db =& Database::getInstance();
+    $sql = sprintf("DELETE FROM %s WHERE bid = %u", $db->prefix("bannerfinish"), $bid);
+    $db->query($sql);
+    redirect_header("admin.php?fct=banners&amp;op=BannersAdmin#top",1,_AM_DBUPDATED);
+    exit();
+    break;
+
+case "BannerDelete":
+    $bid = isset($_GET['bid']) ? intval($_GET['bid']) : 0;
+    if ($bid > 0) {
+        BannerDelete($bid);
+    }
+    break;
+
+case "BannerDelete2":
+    $bid = isset($_POST['bid']) ? intval($_POST['bid']) : 0;
+    if ($bid <= 0 || !xoops_confirm_validate()) {
+        redirect_header("admin.php?fct=banners&amp;op=BannersAdmin#top");
+    }
+    $db =& Database::getInstance();
+    $sql = sprintf("DELETE FROM %s WHERE bid = %u", $db->prefix("banner"), $bid);
+    $db->query($sql);
+    redirect_header("admin.php?fct=banners&amp;op=BannersAdmin#top",1,_AM_DBUPDATED);
+    break;
+
+case "BannerEdit":
+    $bid = isset($_GET['bid']) ? intval($_GET['bid']) : 0;
+    if ($bid > 0) {
+        BannerEdit($bid);
+    }
+    break;
+
+case "BannerChange":
+    $bid = isset($_POST['bid']) ? intval($_POST['bid']) : 0;
+    $cid = isset($_POST['cid']) ? intval($_POST['cid']) : 0;
+    if ($cid <= 0 || $bid <= 0 || !XoopsMultiTokenHandler::quickValidate('banners_BannerChange')) {
+        redirect_header("admin.php?fct=banners&amp;op=BannersAdmin#top");
+    }
+    $imageurl = isset($_POST['imageurl']) ? trim($_POST['imageurl']) : '';
+    $clickurl = isset($_POST['clickurl']) ? trim($_POST['clickurl']) : '';
+    $imptotal = isset($_POST['imptotal']) ? intval($_POST['imptotal']) : 0;
+    $impadded = isset($_POST['impadded']) ? intval($_POST['impadded']) : 0;
+    $htmlbanner = isset($_POST['htmlbanner']) ? intval($_POST['htmlbanner']) : 0;
+    $htmlcode = isset($_POST['htmlcode']) ? trim($_POST['htmlcode']) : '';
+    $db =& Database::getInstance();
+    $myts =& MyTextSanitizer::getInstance();
+    $sql = sprintf("UPDATE %s SET cid = %d, imptotal = %d, imageurl = %s, clickurl = %s, htmlbanner = %d, htmlcode = %s WHERE bid = %d", $db->prefix("banner"), $cid, $imptotal + $impadded, $db->quoteString($myts->stripSlashesGPC($imageurl)), $db->quoteString($myts->stripSlashesGPC($clickurl)), $htmlbanner, $db->quoteString($myts->stripSlashesGPC($htmlcode)), $bid);
+    $db->query($sql);
+    redirect_header("admin.php?fct=banners&amp;op=BannersAdmin#top",1,_AM_DBUPDATED);
+    break;
+
+case "BannerClientDelete":
+    $cid = isset($_GET['cid']) ? intval($_GET['cid']) : 0;
+    if ($cid > 0) {
+        BannerClientDelete($cid);
+    }
+    break;
+
+case "BannerClientDelete2":
+    $cid = isset($_POST['cid']) ? intval($_POST['cid']) : 0;
+    $db =& Database::getInstance();
+    if ($cid <= 0 || !xoops_confirm_validate()) {
+        redirect_header("admin.php?fct=banners&amp;op=BannersAdmin#top");
+    }
+    $sql = sprintf("DELETE FROM %s WHERE cid = %u", $db->prefix("banner"), $cid);
+    $db->query($sql);
+    $sql = sprintf("DELETE FROM %s WHERE cid = %u", $db->prefix("bannerclient"), $cid);
+    $db->query($sql);
+    redirect_header("admin.php?fct=banners&amp;op=BannersAdmin#top",1,_AM_DBUPDATED);
+    break;
+
+case "BannerClientEdit":
+    $cid = isset($_GET['cid']) ? intval($_GET['cid']) : 0;
+    if ($cid > 0) {
+        BannerClientEdit($cid);
+    }
+    break;
+
+case "BannerClientChange":
+    $cid = isset($_POST['cid']) ? intval($_POST['cid']) : 0;
+    if ($cid <= 0 || !XoopsSingleTokenHandler::quickValidate('banners_ClientChange')) {
+        redirect_header("admin.php?fct=banners&amp;op=BannersAdmin#top");
+    }
+    $name = isset($_POST['name']) ? trim($_POST['name']) : '';
+    $contact = isset($_POST['contact']) ? trim($_POST['contact']) : '';
+    $email = isset($_POST['email']) ? trim($_POST['email']) : '';
+    $login = isset($_POST['login']) ? trim($_POST['login']) : '';
+    $passwd = isset($_POST['passwd']) ? trim($_POST['passwd']) : '';
+    $extrainfo = isset($_POST['extrainfo']) ? trim($_POST['extrainfo']) : '';
+    $db =& Database::getInstance();
+    $myts =& MyTextSanitizer::getInstance();
+    $sql = sprintf("UPDATE %s SET name = %s, contact = %s, email = %s, login = %s, passwd = %s, extrainfo = %s WHERE cid = %d", $db->prefix("bannerclient"), $db->quoteString($myts->stripSlashesGPC($name)), $db->quoteString($myts->stripSlashesGPC($contact)), $db->quoteString($myts->stripSlashesGPC($email)), $db->quoteString($myts->stripSlashesGPC($login)), $db->quoteString($myts->stripSlashesGPC($passwd)), $db->quoteString($myts->stripSlashesGPC($extrainfo)), $cid);
+    $db->query($sql);
+    redirect_header("admin.php?fct=banners&amp;op=BannersAdmin#top",1,_AM_DBUPDATED);
+    break;
+
+default:
+    BannersAdmin();
+    break;
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/banners/banners.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/banners/banners.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/banners/banners.php	(revision 405)
@@ -0,0 +1,421 @@
+<?php
+// $Id: banners.php,v 1.4 2005/08/03 12:39:15 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+if (!is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid()) ) {
+    exit("Access Denied");
+} else {
+/*********************************************************/
+/* Banners Administration Functions                      */
+/*********************************************************/
+function BannersAdmin()
+{
+    global $xoopsConfig, $xoopsModule;
+    $xoopsDB =& Database::getInstance();
+    xoops_cp_header();
+    // Banners List
+    echo "<a name='top'></a>";
+    echo "<table width='100%' border='0' cellspacing='1' class='outer'><tr><td class=\"odd\">";
+    echo "<div style='text-align:center'><b>"._AM_CURACTBNR."</b></div><br />
+    <table width='100%' border='0'><tr>
+    <td align='center'>"._AM_BANNERID."</td>
+    <td align='center'>"._AM_IMPRESION."</td>
+    <td align='center'>"._AM_IMPLEFT."</td>
+    <td align='center'>"._AM_CLICKS."</td>
+    <td align='center'>"._AM_NCLICKS."</td>
+    <td align='center'>"._AM_CLINAME."</td>
+    <td align='center'>"._AM_FUNCTION."</td></tr><tr align='center'>";
+    $result = $xoopsDB->query("SELECT bid, cid, imptotal, impmade, clicks, date FROM ".$xoopsDB->prefix("banner")." ORDER BY bid");
+    $myts =& MyTextSanitizer::getInstance();
+    while(list($bid, $cid, $imptotal, $impmade, $clicks, $date) = $xoopsDB->fetchRow($result)) {
+        $result2 = $xoopsDB->query("SELECT cid, name FROM ".$xoopsDB->prefix("bannerclient")." WHERE cid=$cid");
+        list($cid, $name) = $xoopsDB->fetchRow($result2);
+        $name = $myts->makeTboxData4Show($name);
+        if ( $impmade == 0 ) {
+            $percent = 0;
+        } else {
+            $percent = substr(100 * $clicks / $impmade, 0, 5);
+        }
+        if ( $imptotal == 0 ) {
+            $left = ""._AM_UNLIMIT."";
+        } else {
+            $left = $imptotal-$impmade;
+        }
+        echo "<td align='center'>$bid</td>
+        <td align='center'>$impmade</td>
+        <td align='center'>$left</td>
+        <td align='center'>$clicks</td>
+        <td align='center'>$percent%</td>
+        <td align='center'>$name</td>
+        <td align='center'><a href='admin.php?fct=banners&amp;op=BannerEdit&amp;bid=$bid'>"._AM_EDIT."</a> | <a href='admin.php?fct=banners&amp;op=BannerDelete&amp;bid=$bid'>"._AM_DELETE."</a></td><tr>";
+    }
+    echo "</td></tr></table>";
+    echo "</td></tr></table>";
+    echo "<br />";
+    // Finished Banners List
+    echo "<a name='top'></a>";
+    echo "<table width='100%' border='0' cellspacing='1' class='outer'><tr><td class=\"odd\">";
+    echo "<div style='text-align:center'><b>"._AM_FINISHBNR."</b></div><br />
+    <table width='100%' border='0'><tr>
+    <td align='center'>"._AM_BANNERID."</td>
+    <td align='center'>"._AM_IMPD."</td>
+    <td align='center'>"._AM_CLICKS."</td>
+    <td align='center'>"._AM_NCLICKS."</td>
+    <td align='center'>"._AM_STARTDATE."</td>
+    <td align='center'>"._AM_ENDDATE."</td>
+    <td align='center'>"._AM_CLINAME."</td>
+    <td align='center'>"._AM_FUNCTION."</td></tr>
+    <tr>";
+    $result = $xoopsDB->query("SELECT bid, cid, impressions, clicks, datestart, dateend FROM ".$xoopsDB->prefix("bannerfinish")." ORDER BY bid");
+    while(list($bid, $cid, $impressions, $clicks, $datestart, $dateend) = $xoopsDB->fetchRow($result)) {
+        $result2 = $xoopsDB->query("SELECT cid, name FROM ".$xoopsDB->prefix("bannerclient")." WHERE cid=$cid");
+        list($cid, $name) = $xoopsDB->fetchRow($result2);
+        $name = $myts->makeTboxData4Show($name);
+        $percent = substr(100 * $clicks / $impressions, 0, 5);
+        echo "
+        <td align='center'>$bid</td>
+        <td align='center'>$impressions</td>
+        <td align='center'>$clicks</td>
+        <td align='center'>$percent%</td>
+        <td align='center'>".formatTimestamp($datestart,"m")."</td>
+        <td align='center'>".formatTimestamp($dateend,"m")."</td>
+        <td align='center'>$name</td>
+        <td align='center'><a href='admin.php?fct=banners&amp;op=BannerFinishDelete&amp;bid=$bid'>"._AM_DELETE."</a></td><tr>";
+    }
+    echo "</td></tr></table>";
+    echo "</td></tr></table>";
+    echo "<br />";
+    // Clients List
+    echo "<table width='100%' border='0' cellspacing='1' class='outer'><tr><td class=\"odd\">";
+    echo "
+    <div style='text-align:center'><b>"._AM_ADVCLI."</b></div><br />
+    <table width='100%' border='0'><tr align='center'>
+    <td align='center'>"._AM_BANNERID."</td>
+    <td align='center'>"._AM_CLINAME."</td>
+    <td align='center'>"._AM_ACTIVEBNR."</td>
+    <td align='center'>"._AM_CONTNAME."</td>
+    <td align='center'>"._AM_CONTMAIL."</td>
+    <td align='center'>"._AM_FUNCTION."</td></tr><tr align='center'>";
+    $result = $xoopsDB->query("SELECT cid, name, contact, email FROM ".$xoopsDB->prefix("bannerclient")." ORDER BY cid");
+    while(list($cid, $name, $contact, $email) = $xoopsDB->fetchRow($result)) {
+        $name = htmlspecialchars($name,ENT_QUOTES);
+        $contact = htmlspecialchars($contact,ENT_QUOTES);
+        $email = htmlspecialchars($email,ENT_QUOTES);
+        $result2 = $xoopsDB->query("SELECT COUNT(*) FROM ".$xoopsDB->prefix("banner")." WHERE cid=$cid");
+        list($numrows) = $xoopsDB->fetchRow($result2);
+        echo "
+        <td align='center'>$cid</td>
+        <td align='center'>$name</td>
+        <td align='center'>$numrows</td>
+        <td align='center'>$contact</td>
+        <td align='center'>$email</td>
+        <td align='center'><a href='admin.php?fct=banners&amp;op=BannerClientEdit&amp;cid=$cid'>"._AM_EDIT."</a> | <a href='admin.php?fct=banners&amp;op=BannerClientDelete&amp;cid=$cid'>"._AM_DELETE."</a></td><tr>";
+    }
+    echo "</td></tr></table>";
+    echo "</td></tr></table>";
+    echo "<br />";
+    // Add Banner
+    $result = $xoopsDB->query("SELECT COUNT(*) FROM ".$xoopsDB->prefix("bannerclient"));
+    list($numrows) = $xoopsDB->fetchRow($result);
+        if ( $numrows > 0 ) {
+            $token_Banner =& XoopsMultiTokenHandler::quickCreate('banners_BannersAdd');
+
+            echo"<table width='100%' border='0' cellspacing='1' class='outer'><tr><td class=\"odd\">";
+            echo"
+            <h4>"._AM_ADDNWBNR."</h4>
+            <form action='admin.php' method='post'>";
+            echo $token_Banner->getHtml();
+            echo"
+            "._AM_CLINAMET."
+            <select name='cid'>";
+            $result = $xoopsDB->query("SELECT cid, name FROM ".$xoopsDB->prefix("bannerclient"));
+            while(list($cid, $name) = $xoopsDB->fetchRow($result)) {
+                $name = $myts->makeTboxData4Show($name);
+                echo "<option value='$cid'>$name</option>";
+
+            }
+            echo "
+            </select><br />
+            "._AM_IMPPURCHT."<input type='text' name='imptotal' size='12' maxlength='11' /> 0 = "._AM_UNLIMIT."<br />
+            "._AM_IMGURLT."<input type='text' name='imageurl' size='50' maxlength='255' /><br />
+            "._AM_CLICKURLT."<input type='text' name='clickurl' size='50' maxlength='255' /><br />
+            "._AM_USEHTML." <input type='checkbox' name='htmlbanner' value='1' />
+            <br />
+            "._AM_CODEHTML."
+            <br />
+            <textarea name='htmlcode' rows='6'></textarea>
+            <br />
+            <input type='hidden' name='fct' value='banners' />
+            <input type='hidden' name='op' value='BannersAdd' />
+            <input type='submit' value='"._AM_ADDBNR."' />
+            </form>";
+            echo"</td></tr></table>";
+        }
+    // Add Client
+    $token_Client=&XoopsSingleTokenHandler::quickCreate('banners_AddClient');
+    echo "<br />";
+    echo "<table width='100%' border='0' cellspacing='1' class='outer'><tr><td class=\"odd\">";
+    echo "
+    <h4>"._AM_ADDNWCLI."</h4>
+    <form action='admin.php' method='post'>";
+    echo $token_Client->getHtml();
+    echo _AM_CLINAMET."<input type='text' name='name' size='30' maxlength='60' /><br />
+    "._AM_CONTNAMET."<input type='text' name='contact' size='30' maxlength='60' /><br />
+    "._AM_CONTMAILT."<input type='text' name='email' size='30' maxlength='60' /><br />
+    "._AM_CLILOGINT."<input type='text' name='login' size='12' maxlength='10' /><br />
+    "._AM_CLIPASST."<input type='text' name='passwd' size='12' maxlength='10' /><br />
+    "._AM_EXTINFO."<br /><textarea name='extrainfo' cols='60' rows='10' /></textarea><br />
+    <input type='hidden' name='op' value='BannerAddClient' />
+    <input type='hidden' name='fct' value='banners' />
+    <input type='submit' value='"._AM_ADDCLI."' />
+    </form>";
+    echo "</td></tr></table>";
+    xoops_cp_footer();
+}
+
+function BannerDelete($bid)
+{
+    $bid = intval($bid);
+    global $xoopsConfig, $xoopsModule;
+    $xoopsDB =& Database::getInstance();
+    $myts =& MyTextSanitizer::getInstance();
+    xoops_cp_header();
+    $result=$xoopsDB->query("SELECT cid, imptotal, impmade, clicks, imageurl, clickurl, htmlbanner, htmlcode FROM ".$xoopsDB->prefix("banner")." where bid=$bid");
+    $imageurl = !empty($imageurl) ? htmlspecialchars($imageurl,ENT_QUOTES) : '';
+    $clickurl = !empty($clickurl) ? htmlspecialchars($clickurl,ENT_QUOTES) : '';
+    list($cid, $imptotal, $impmade, $clicks, $imageurl, $clickurl, $htmlbanner, $htmlcode) = $xoopsDB->fetchRow($result);
+    echo"<table width='100%' border='0' cellspacing='1' class='outer'><tr><td class=\"odd\">";
+    echo "<h4>"._AM_DELEBNR."</h4>";
+    if ($htmlbanner){
+        echo $myts->displayTarea($htmlcode,1);
+    }else{
+        if(strtolower(substr($imageurl,strrpos($imageurl,".")))==".swf") {
+            echo "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/ swflash.cab#version=6,0,40,0\"; width=\"468\" height=\"60\">";
+            echo "<param name='movie' value='$imageurl'></param>";
+            echo "<param name='quality' value='high'></param>";
+            echo "<embed src='$imageurl' quality='high' pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='468' height='60'>";
+            echo "</embed>";
+            echo "</object>";
+        } else {
+            echo "<img src='$imageurl' alt='' />";
+        }
+    }
+    echo "<a href='$clickurl'>$clickurl</a><br /><br />
+        <table width='100%' border='0'><tr align='center'>
+        <td align='center'>"._AM_BANNERID."</td>
+        <td align='center'>"._AM_IMPRESION."</td>
+        <td align='center'>"._AM_IMPLEFT."</td>
+        <td align='center'>"._AM_CLICKS."</td>
+        <td align='center'>"._AM_NCLICKS."</td>
+        <td align='center'>"._AM_CLINAME."</td></tr><tr align='center'>";
+    $result2 = $xoopsDB->query("SELECT cid, name FROM ".$xoopsDB->prefix("bannerclient")." WHERE cid=$cid");
+    list($cid, $name) = $xoopsDB->fetchRow($result2);
+    $name = $myts->makeTboxData4Show($name);
+    $percent = substr(100 * $clicks / $impmade, 0, 5);
+    if ( $imptotal == 0 ) {
+        $left = 'unlimited';
+    } else {
+        $left = $imptotal-$impmade;
+    }
+    echo "
+    <td align='center'>$bid</td>
+    <td align='center'>$impmade</td>
+    <td align='center'>$left</td>
+    <td align='center'>$clicks</td>
+    <td align='center'>$percent%</td>
+    <td align='center'>$name</td>
+    </tr></table><br />";
+    xoops_confirm(array('fct' => 'banners', 'op' => 'BannerDelete2', 'bid' => $bid), 'admin.php', _AM_SUREDELE);
+    echo"</td></tr></table>";
+    xoops_cp_footer();
+}
+
+function BannerEdit($bid)
+{
+    $bid = intval($bid);
+    global $xoopsConfig, $xoopsModule;
+    xoops_cp_header();
+    $xoopsDB =& Database::getInstance();
+    $myts =& MyTextSanitizer::getInstance();
+    $result=$xoopsDB->query("SELECT cid, imptotal, impmade, clicks, imageurl, clickurl, htmlbanner, htmlcode FROM ".$xoopsDB->prefix("banner")." where bid=$bid");
+    list($cid, $imptotal, $impmade, $clicks, $imageurl, $clickurl, $htmlbanner, $htmlcode) = $xoopsDB->fetchRow($result);
+    echo"<table width='100%' border='0' cellspacing='1' class='outer'><tr><td class=\"odd\">";
+    //echo"<h4>"._AM_EDITBNR."</h4>
+    //<img src='$imageurl' border='1' /><br /><br />
+    //<form action='admin.php' method='post'>
+    echo"<h4>"._AM_EDITBNR."</h4>";
+    if ($htmlbanner){
+        echo $myts->displayTarea($htmlcode,0);
+    }else{
+        if(strtolower(substr($imageurl,strrpos($imageurl,".")))==".swf") {
+            echo "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/ swflash.cab#version=6,0,40,0\"; width=\"468\" height=\"60\">";
+            echo "<param name='movie' value='$imageurl'></param>";
+            echo "<param name='quality' value='high'></param>";
+            echo "<embed src='$imageurl' quality='high' pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='468' height='60'>";
+            echo "</embed>";
+            echo "</object>";
+        } else {
+            echo "<img src='$imageurl' alt='' />";
+        }
+    }
+    $token=&XoopsMultiTokenHandler::quickCreate('banners_BannerChange');
+    echo "<form action='admin.php' method='post'>";
+    echo $token->getHtml();
+    echo _AM_CLINAMET."<select name='cid'>\n";
+    $result = $xoopsDB->query("SELECT cid, name FROM ".$xoopsDB->prefix("bannerclient")." where cid=$cid");
+    list($cid, $name) = $xoopsDB->fetchRow($result);
+    $name = $myts->makeTboxData4Show($name);
+    echo "<option value='$cid' selected='selected'>$name</option>";
+    $result = $xoopsDB->query("SELECT cid, name FROM ".$xoopsDB->prefix("bannerclient"));
+    while(list($ccid, $name) = $xoopsDB->fetchRow($result)) {
+        $name = $myts->makeTboxData4Show($name);
+        if ( $cid != $ccid ) {
+            echo "<option value='$ccid'>$name</option>";
+        }
+    }
+    echo "</select><br />";
+    if ( $imptotal == 0 ) {
+        $impressions = ""._AM_UNLIMIT."";
+    } else {
+        $impressions = $imptotal;
+    }
+    echo "
+    "._AM_ADDIMPT."<input type='text' name='impadded' size='12' maxlength='11' /> "._AM_PURCHT."<b>$impressions</b> "._AM_MADET."<b>$impmade</b><br />
+    "._AM_IMGURLT."<input type='text' name='imageurl' size='50' maxlength='200' value=\"".htmlspecialchars($imageurl,ENT_QUOTES)."\" /><br />
+    "._AM_CLICKURLT."<input type='text' name='clickurl' size='50' maxlength='200' value='$clickurl' />".htmlspecialchars($clickurl,ENT_QUOTES)."<br />
+    "._AM_USEHTML;
+    if ($htmlbanner){
+        echo " <input type='checkbox' name='htmlbanner' value='1' checked='checked' />";
+    }else{
+        echo " <input type='checkbox' name='htmlbanner' value='1' />";
+    }
+    echo "
+    <br />
+    "._AM_CODEHTML."
+    <br />
+    <textarea name='htmlcode' rows='6'>".$myts->makeTboxData4Edit($htmlcode)."</textarea>
+    <br />
+    <input type='hidden' name='bid' value='$bid' />
+    <input type='hidden' name='imptotal' value='$imptotal' />
+    <input type='hidden' name='fct' value='banners' />
+    <input type='hidden' name='op' value='BannerChange' />
+    <input type='submit' value='"._AM_CHGBNR."' />
+    </form>";
+    echo"</td></tr></table>";
+    xoops_cp_footer();
+}
+
+function BannerClientDelete($cid)
+{
+    global $xoopsConfig, $xoopsModule;
+    $cid = intval($cid);
+    $xoopsDB =& Database::getInstance();
+    $myts =& MyTextSanitizer::getInstance();
+    xoops_cp_header();
+    $result = $xoopsDB->query("SELECT cid, name FROM ".$xoopsDB->prefix("bannerclient")." WHERE cid=$cid");
+    list($cid, $name) = $xoopsDB->fetchRow($result);
+    $name = $myts->makeTboxData4Show($name);
+    echo "<table width='100%' border='0' cellspacing='1' class='outer'><tr><td class=\"odd\">";
+    echo "
+    <h4>"._AM_DELEADC."</h4>
+    ".sprintf(_AM_SUREDELCLI,$name)."<br /><br />";
+    $result2 = $xoopsDB->query("SELECT imageurl, clickurl, htmlbanner, htmlcode FROM ".$xoopsDB->prefix("banner")." WHERE cid=$cid");
+    $numrows = $xoopsDB->getRowsNum($result2);
+    if ( $numrows == 0 ) {
+        echo ""._AM_NOBNRRUN."<br /><br />";
+    } else {
+        echo "<font color='#ff0000'><b>"._AM_WARNING."</b></font><br />
+        "._AM_ACTBNRRUN."<br /><br />";
+    }
+    while(list($imageurl, $clickurl, $htmlbanner, $htmlcode) = $xoopsDB->fetchRow($result2)) {
+        $imageurl=htmlspecialchars($imageurl,ENT_QUOTES);
+        $clickurl=htmlspecialchars($clickurl,ENT_QUOTES);
+        $bannerobject = "";
+        if ($htmlbanner){
+            $bannerobject = $myts->displayTarea($htmlcode,1);
+        }else{
+            $bannerobject = '<div><a href="'.$clickurl.'" target="_blank">';
+                if(strtolower(substr($imageurl,strrpos($imageurl,".")))==".swf") {
+                    $bannerobject = $bannerobject
+                        .'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" width="468" height="60">'
+                        .'<param name="movie" value="'.$imageurl.'"></param>'
+                        .'<param name="quality" value="high"></param>'
+                        .'<embed src="'.$imageurl.'" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="468" height="60">'
+                        .'</embed>'
+                        .'</object>';
+                } else {
+                    $bannerobject = $bannerobject.'<img src="'.$imageurl.'" alt="" />';
+                }
+            $bannerobject = $bannerobject.'</a></div>';
+        }
+        echo $bannerobject."<a href='$clickurl'>$clickurl</a><br /><br />";
+    }
+    xoops_token_confirm(array('fct' => 'banners', 'op' => 'BannerClientDelete2', 'cid' => $cid), 'admin.php', _AM_SUREDELBNR);
+    echo "</td></tr></table>";
+    xoops_cp_footer();
+}
+
+function BannerClientEdit($cid)
+{
+    $cid = intval($cid);
+    $token=&XoopsSingleTokenHandler::quickCreate('banners_ClientChange');
+
+    global $xoopsConfig, $xoopsModule;
+    $xoopsDB =& Database::getInstance();
+    $myts =& MyTextSanitizer::getInstance();
+    xoops_cp_header();
+    $result = $xoopsDB->query("SELECT name, contact, email, login, passwd, extrainfo FROM ".$xoopsDB->prefix("bannerclient")." WHERE cid=$cid");
+    list($name, $contact, $email, $login, $passwd, $extrainfo) = $xoopsDB->fetchRow($result);
+    $name = $myts->makeTboxData4Edit($name);
+    $contact = $myts->makeTboxData4Show($contact);
+    $email = $myts->makeTboxData4Edit($email);
+    $login = $myts->makeTboxData4Edit($login);
+    $passwd = $myts->makeTboxData4Edit($passwd);
+    $extrainfo = $myts->makeTareaData4Show($extrainfo);
+    echo "<table width='100%' border='0' cellspacing='1' class='outer'><tr><td class=\"odd\">";
+    echo "
+    <h4>"._AM_EDITADVCLI."</h4>
+    <form action='admin.php' method='post'>";
+    echo $token->getHtml();
+    echo _AM_CLINAMET."<input type='text' name='name' value='$name' size='30' maxlength='60' /><br />
+    "._AM_CONTNAMET."<input type='text' name='contact' value='$contact' size='30' maxlength='60' /><br />
+    "._AM_CONTMAILT ."<input type='text' name='email' size='30' maxlength='60' value='$email' /><br />
+    "._AM_CLILOGINT."<input type='text' name='login' size='12' maxlength='10' value='$login' /><br />
+    "._AM_CLIPASST."<input type='text' name='passwd' size='12' maxlength='10' value='$passwd' /><br />
+    "._AM_EXTINFO."<br /><textarea name='extrainfo' cols='60' rows='10'>$extrainfo</textarea><br />
+    <input type='hidden' name='cid' value='$cid' />
+    <input type='hidden' name='op' value='BannerClientChange' />
+    <input type='hidden' name='fct' value='banners' />
+    <input type='submit' value='"._AM_CHGCLI."' />";
+    echo "</td></tr></table>";
+    xoops_cp_footer();
+}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/userrank/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/userrank/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/userrank/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/userrank/main.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/userrank/main.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/userrank/main.php	(revision 405)
@@ -0,0 +1,160 @@
+<?php
+// $Id: main.php,v 1.4 2005/08/03 12:40:00 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+/**
+ * Manage user rank.
+ * @copyright XOOPS Project
+ * @todo    Fix register_globals!
+ **/
+
+if ( !is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid()) ) {
+    exit("Access Denied");
+}
+
+$op = 'RankForumAdmin';
+
+if (isset($_GET['op'])) {
+    $op = $_GET['op'];
+} elseif (isset($_POST['op'])) {
+    $op = $_POST['op'];
+}
+
+switch ($op) {
+
+case "RankForumEdit":
+    $rank_id = isset($_GET['rank_id']) ? intval($_GET['rank_id']) : 0;
+    if ($rank_id > 0) {
+        include_once XOOPS_ROOT_PATH."/modules/system/admin/userrank/userrank.php";
+        RankForumEdit($rank_id);
+    }
+    break;
+
+case "RankForumDel":
+    $rank_id = isset($_GET['rank_id']) ? intval($_GET['rank_id']) : 0;
+    if ($rank_id > 0) {
+        xoops_cp_header();
+        xoops_token_confirm(array('fct' => 'userrank', 'op' => 'RankForumDelGo', 'rank_id' => $rank_id), 'admin.php', _AM_WAYSYWTDTR);
+        xoops_cp_footer();
+    }
+    break;
+
+case "RankForumDelGo":
+    $rank_id = isset($_POST['rank_id']) ? intval($_POST['rank_id']) : 0;
+    if ($rank_id <= 0 || !xoops_confirm_validate()) {
+        redirect_header("admin.php?fct=userrank");
+    }
+    $db =& Database::getInstance();
+    $sql = sprintf("DELETE FROM %s WHERE rank_id = %u", $db->prefix("ranks"), $rank_id);
+    $db->query($sql);
+    redirect_header("admin.php?fct=userrank&amp;op=ForumAdmin",1,_AM_DBUPDATED);
+    break;
+
+case "RankForumAdd":
+    if (!XoopsMultiTokenHandler::quickValidate('userrank_RankForumAdd')) {
+        redirect_header("admin.php?fct=userrank");
+    }
+    $db =& Database::getInstance();
+    $myts =& MyTextSanitizer::getInstance();
+    $rank_special = isset($_POST['rank_special']) && intval($_POST['rank_special']) ? 1 : 0;
+    $rank_title = $myts->stripSlashesGPC($_POST['rank_title']);
+    $rank_image = '';
+    include_once XOOPS_ROOT_PATH.'/class/uploader.php';
+    $uploader = new XoopsMediaUploader(XOOPS_UPLOAD_PATH, array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/x-png'), 100000, 120, 120);
+    $uploader->setAllowedExtensions(array('gif', 'jpeg', 'jpg', 'png'));
+    $uploader->setPrefix('rank');
+    if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
+        if ($uploader->upload()) {
+            $rank_image = $uploader->getSavedFileName();
+        }
+    }
+    $newid = $db->genId($db->prefix("ranks")."_rank_id_seq");
+    if ($rank_special == 1) {
+        $sql = "INSERT INTO ".$db->prefix("ranks")." (rank_id, rank_title, rank_min, rank_max, rank_special, rank_image) VALUES ($newid, ".$db->quoteString($rank_title).", -1, -1, 1, ".$db->quoteString($rank_image).")";
+    } else {
+        $sql = "INSERT INTO ".$db->prefix("ranks")." (rank_id, rank_title, rank_min, rank_max, rank_special, rank_image) VALUES ($newid, ".$db->quoteString($rank_title).", ".intval($_POST['rank_min'])." , ".intval($_POST['rank_max'])." , 0, ".$db->quoteString($rank_image).")";
+    }
+    if (!$db->query($sql)) {
+        xoops_cp_header();
+        xoops_error('Failed storing rank data into the database');
+        xoops_cp_footer();
+    } else {
+        redirect_header("admin.php?fct=userrank&amp;op=RankForumAdmin",1,_AM_DBUPDATED);
+    }
+    break;
+
+case "RankForumSave":
+    $rank_id = isset($_POST['rank_id']) ? intval($_POST['rank_id']) : 0;
+    if ($rank_id <= 0 || !XoopsMultiTokenHandler::quickValidate('userrank_RankForumSave')) {
+        redirect_header("admin.php?fct=userrank");
+    }
+    $db =& Database::getInstance();
+    $myts =& MyTextSanitizer::getInstance();
+    $rank_special = isset($_POST['rank_special']) && intval($_POST['rank_special']) ? 1 : 0;
+    $rank_title = $myts->stripSlashesGPC($_POST['rank_title']);
+    $delete_old_image = false;
+    include_once XOOPS_ROOT_PATH.'/class/uploader.php';
+    $uploader = new XoopsMediaUploader(XOOPS_UPLOAD_PATH, array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/x-png'), 100000, 120, 120);
+    $uploader->setAllowedExtensions(array('gif', 'jpeg', 'jpg', 'png'));
+    $uploader->setPrefix('rank');
+    if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
+        if ($uploader->upload()) {
+            $rank_image = $uploader->getSavedFileName();
+            $delete_old_image = true;
+        }
+    }
+    if ($rank_special > 0) {
+        $_POST['rank_min'] = $_POST['rank_max'] = -1;
+    }
+    $sql = "UPDATE ".$db->prefix("ranks")." SET rank_title = ".$db->quoteString($rank_title).", rank_min = ".intval($_POST['rank_min']).", rank_max = ".intval($_POST['rank_max']).", rank_special = ".$rank_special;
+    if ($delete_old_image) {
+        $sql .= ", rank_image = ".$db->quoteString($rank_image);
+    }
+    $sql .= " WHERE rank_id = ".$rank_id;
+    if (!$db->query($sql)) {
+        xoops_cp_header();
+        xoops_error('Failed storing rank data into the database');
+        xoops_cp_footer();
+    } else {
+        if ($delete_old_image) {
+            $old_rank_path = str_replace("\\", "/", realpath(XOOPS_UPLOAD_PATH.'/'.trim($_POST['old_rank'])));
+            if (0 === strpos($old_rank_path, XOOPS_UPLOAD_PATH) && is_file($old_rank_path)) {
+                unlink($old_rank_path);
+            }
+        }
+        redirect_header("admin.php?fct=userrank&amp;op=RankForumAdmin",1,_AM_DBUPDATED);
+    }
+    break;
+
+default:
+    include_once XOOPS_ROOT_PATH."/modules/system/admin/userrank/userrank.php";
+    RankForumAdmin();
+    break;
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/userrank/userrank.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/userrank/userrank.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/userrank/userrank.php	(revision 405)
@@ -0,0 +1,108 @@
+<?php
+// $Id: userrank.php,v 1.4 2005/08/03 12:40:00 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+if ( !is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid()) ) {
+    exit("Access Denied");
+}
+
+function RankForumAdmin()
+{
+    $db =& Database::getInstance();
+    xoops_cp_header();
+    echo "<h4 style='text-align:left;'>"._AM_RANKSSETTINGS."</h4>
+    <table width='100%' class='outer' cellpadding='4' cellspacing='1'>
+    <tr align='center'>
+    <th align='left'>"._AM_TITLE."</th>
+    <th>"._AM_MINPOST."</th>
+    <th>"._AM_MAXPOST."</th>
+    <th>"._AM_IMAGE."</th>
+    <th>"._AM_SPERANK."</th>
+    <th>"._AM_ACTION."</th></tr>";
+    $result = $db->query("SELECT * FROM ".$db->prefix("ranks")." ORDER BY rank_id");
+    $count = 0;
+    while ( $rank = $db->fetchArray($result) ) {
+        if ($count % 2 == 0) {
+            $class = 'even';
+        } else {
+            $class = 'odd';
+        }
+        echo "<tr class='$class' align='center'>
+        <td align='left'>".$rank['rank_title']."</td>
+        <td>".$rank['rank_min']."</td>
+        <td>".$rank['rank_max']."</td>
+        <td>";
+        if ($rank['rank_image'] && file_exists(XOOPS_UPLOAD_PATH.'/'.$rank['rank_image'])) {
+            echo '<img src="'.XOOPS_UPLOAD_URL.'/'.$rank['rank_image'].'" alt="" /></td>';
+        } else {
+            echo '&nbsp;';
+        }
+        if ($rank['rank_special'] == 1) {
+            echo '<td>'._AM_ON.'</td>';
+        } else {
+            echo '<td>'._AM_OFF.'</td>';
+        }
+        echo"<td><a href='admin.php?fct=userrank&amp;op=RankForumEdit&amp;rank_id=".$rank['rank_id']."'>"._AM_EDIT."</a> <a href='admin.php?fct=userrank&amp;op=RankForumDel&amp;rank_id=".$rank['rank_id']."&amp;ok=0'>"._AM_DEL."</a></td></tr>";
+        $count++;
+    }
+    echo '</table><br /><br />';
+    $rank['rank_min'] = 0;
+    $rank['rank_max'] = 0;
+    $rank['rank_special'] = 0;
+    $rank['rank_id'] = '';
+    $rank['rank_title'] = '';
+    $rank['rank_image'] = 'blank.gif';
+    $rank['form_title'] = _AM_ADDNEWRANK;
+    $rank['op'] = 'RankForumAdd';
+    include_once XOOPS_ROOT_PATH.'/modules/system/admin/userrank/rankform.php';
+    $rank_form->display();
+    xoops_cp_footer();
+}
+
+
+function RankForumEdit($rank_id)
+{
+    $db =& Database::getInstance();
+    $myts =& MyTextSanitizer::getInstance();
+    xoops_cp_header();
+    echo '<a href="admin.php?fct=userrank">'. _AM_RANKSSETTINGS .'</a>&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;'._AM_EDITRANK.'<br /><br />';
+    $result = $db->query("SELECT * FROM ".$db->prefix("ranks")." WHERE rank_id=".$rank_id);
+    $rank = $db->fetchArray($result);
+    $rank['rank_title'] = $myts->makeTboxData4Edit($rank['rank_title']);
+    $rank['rank_image'] = $myts->makeTboxData4Edit($rank['rank_image']);
+    $rank['form_title'] = _AM_EDITRANK;
+    $rank['op'] = 'RankForumSave';
+    include_once XOOPS_ROOT_PATH.'/modules/system/admin/userrank/rankform.php';
+    $rank_form->addElement(new XoopsFormHidden('old_rank', $rank['rank_image']));
+    $rank_form->display();
+    xoops_cp_footer();
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/userrank/xoops_version.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/userrank/xoops_version.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/userrank/xoops_version.php	(revision 405)
@@ -0,0 +1,45 @@
+<?php
+// $Id: xoops_version.php,v 1.2 2005/03/18 12:52:48 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+$modversion['name'] = _MD_AM_RANK;
+$modversion['version'] = "";
+$modversion['description'] = "User Posts Ranks Configuration";
+$modversion['author'] = "phpBB Group ( http://www.phpbb.com/ )";
+$modversion['credits'] = "";
+$modversion['help'] = "userrank.html";
+$modversion['license'] = "GPL see LICENSE";
+$modversion['official'] = 1;
+$modversion['image'] = "userrank.gif";
+
+$modversion['hasAdmin'] = 1;
+$modversion['adminpath'] = "admin.php?fct=userrank";
+$modversion['category'] = XOOPS_SYSTEM_URANK;
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/userrank/rankform.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/userrank/rankform.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/userrank/rankform.php	(revision 405)
@@ -0,0 +1,55 @@
+<?php
+// $Id: rankform.php,v 1.4 2005/08/03 12:40:00 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
+$rank_form = new XoopsThemeForm($rank['form_title'], 'rankform', 'admin.php');
+$rank_form->setExtra('enctype="multipart/form-data"');
+$rank_form->addElement(new XoopsFormToken(XoopsMultiTokenHandler::quickCreate('userrank_'.$rank['op'])));
+$rank_form->addElement(new XoopsFormText(_AM_RANKTITLE, 'rank_title', 50, 50, $rank['rank_title']), true);
+$rank_form->addElement(new XoopsFormText(_AM_MINPOST, 'rank_min', 10, 10, $rank['rank_min']));
+$rank_form->addElement(new XoopsFormText(_AM_MAXPOST, 'rank_max', 10, 10, $rank['rank_max']));
+$rank_tray = new XoopsFormElementTray(_AM_IMAGE, '&nbsp;');
+$rank_select = new XoopsFormFile('', 'rank_image', 5000000);
+$rank_tray->addElement($rank_select);
+if (trim($rank['rank_image']) != '' && file_exists(XOOPS_UPLOAD_PATH.'/'.$rank['rank_image'])) {
+    $rank_label = new XoopsFormLabel('', '<img src="'.XOOPS_UPLOAD_URL.'/'.$rank['rank_image'].'" alt="" />');
+    $rank_tray->addElement($rank_label);
+}
+$rank_form->addElement($rank_tray);
+$tray = new XoopsFormElementTray(_AM_SPECIAL, '<br />');
+$tray->addElement(new XoopsFormRadioYN('', 'rank_special', $rank['rank_special']));
+$tray->addElement(new XoopsFormLabel('', _AM_SPECIALCAN));
+$rank_form->addElement($tray);
+$rank_form->addElement(new XoopsFormHidden('rank_id', $rank['rank_id']));
+$rank_form->addElement(new XoopsFormHidden('op', $rank['op']));
+$rank_form->addElement(new XoopsFormHidden('fct', 'userrank'));
+$rank_form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/tplsets/xoops_version.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/tplsets/xoops_version.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/tplsets/xoops_version.php	(revision 405)
@@ -0,0 +1,45 @@
+<?php
+// $Id: xoops_version.php,v 1.2 2005/03/18 12:52:38 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+$modversion['name'] = _MD_AM_TPLSETS;
+$modversion['version'] = "";
+$modversion['description'] = "XOOPS Template Set Manager";
+$modversion['author'] = "";
+$modversion['credits'] = "The XOOPS Project";
+$modversion['help'] = "tplsets.html";
+$modversion['license'] = "GPL see LICENSE";
+$modversion['official'] = 1;
+$modversion['image'] = "tplsets.gif";
+
+$modversion['hasAdmin'] = 1;
+$modversion['adminpath'] = "admin.php?fct=tplsets";
+$modversion['category'] = XOOPS_SYSTEM_TPLSET;
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/tplsets/themeimgform.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/tplsets/themeimgform.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/tplsets/themeimgform.php	(revision 405)
@@ -0,0 +1,56 @@
+<?php
+// $Id: themeimgform.php,v 1.3 2005/08/03 12:39:17 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+$image_handler =& xoops_gethandler('imageset', 'imagesetimg');
+$criteria = new CriteriaCompo(new Criteria('tplset_name', $tplset));
+// skin image sets have reference ID 0
+$criteria->add(new Criteria('imgset_refid', 0));
+$imgs =& $image_handler->getObjects($criteria);
+$icount = count($imgs);
+if ($tplset != 'default') {
+	if ($icount > 0) {
+		echo '<form action="admin.php" method="post" enctype="multipart/form-data"><table width="100%" class="outer" cellspacing="1"><tr><th colspan="3">'._MD_EDITSKINIMG.'</th></tr>';
+		for ($i = 0; $i < $icount; $i++) {
+			echo '<tr><td rowspan="3" valign="middle" align="center" class="odd"><img src="admin.php?fct=tplsets&amp;op=showimage&amp;id='.$imgs[$i]->getVar('imgsetimg_id').'" alt="" /></td><td class="head">'._MD_IMGFILE.'</td><td class="even">'.$imgs[$i]->getVar('imgsetimg_file').'</td></tr><tr><td class="head">'._MD_IMGNEWFILE.'</td><td class="even"><input type="file" name="imgfiles['.$imgs[$i]->getVar('imgsetimg_id').']" /></td></tr><tr><td class="head">'._MD_IMGDELETE.'</td><td class="even"><input type="checkbox" name="imgdelete['.$imgs[$i]->getVar('imgsetimg_id').']" value="1" /><input type="hidden" name="imgids[]" value="'.$imgs[$i]->getVar('imgsetimg_id').'" /></td></tr>';
+		}
+		echo '<tr class="foot"><td colspan="3" align="center"><input type="hidden" name="tplset" value="'.$tplset.'" /><input type="hidden" name="op" value="updateimage" /><input type="hidden" name="fct" value="tplsets" /><input type="hidden" name="imgset" value="'.$imgs[0]->getVar('imgsetimg_imgset').'" /><input type="submit" name="imgsubmit" value="'._SUBMIT.'" /></td></tr></table></form>';
+	}
+	echo '<form action="admin.php" method="post" enctype="multipart/form-data"><table width="100%" class="outer" cellspacing="1"><tr><th colspan="3">'._MD_ADDSKINIMG.'</th></tr>';
+	echo '<tr><td class="head">'._MD_IMGNEWFILE.'</td><td class="even"><input type="file" name="imgfile" /></td></tr>';
+	echo '<tr><td class="head">&nbsp;</td><td class="even"><input type="hidden" name="tplset" value="'.$tplset.'" /><input type="hidden" name="op" value="addimage" /><input type="hidden" name="fct" value="tplsets" /><input type="submit" name="imgsubmit" value="'._SUBMIT.'" /><input type="hidden" name="imgset" value="';
+	if ($icount > 0) {
+		echo $imgs[0]->getVar('imgsetimg_imgset');
+	}
+	echo '" /></td></tr></table></form>';
+} else {
+	echo '<table width="100%" class="outer" cellspacing="1"><tr><th colspan="3">'._MD_SKINIMGS.'</th></tr>';
+	for ($i = 0; $i < $icount; $i++) {
+		echo '<tr><td valign="middle" align="center" class="odd"><img src="admin.php?fct=tplsets&amp;op=showimage&amp;id='.$imgs[$i]->getVar('imgsetimg_id').'" alt="" /></td><td class="head">'._MD_IMGFILE.'</td><td class="even">'.$imgs[$i]->getVar('imgsetimg_file').'</td></tr>';
+	}
+	echo '</table>';
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/tplsets/tplform.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/tplsets/tplform.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/tplsets/tplform.php	(revision 405)
@@ -0,0 +1,48 @@
+<?php
+// $Id: tplform.php,v 1.4 2005/08/03 12:39:17 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
+$form = new XoopsThemeForm(_MD_EDITTEMPLATE, 'template_form', 'admin.php');
+$form->addElement(new XoopsFormLabel(_MD_FILENAME, $tform['tpl_file']));
+$form->addElement(new XoopsFormLabel(_MD_FILEDESC, $tform['tpl_desc']));
+$form->addElement(new XoopsFormLabel(_MD_LASTMOD, formatTimestamp($tform['tpl_lastmodified'], 'l')));
+$form->addElement(new XoopsFormTextArea(_MD_FILEHTML, 'html', $tform['tpl_source'], 25, 70));
+$form->addElement(new XoopsFormHidden('id', $tform['tpl_id']));
+$form->addElement(new XoopsFormHidden('op', 'edittpl_go'));
+$form->addElement(new XoopsFormToken(XoopsMultiTokenHandler::quickCreate('tplform')));
+$form->addElement(new XoopsFormHidden('redirect', 'edittpl'));
+$form->addElement(new XoopsFormHidden('fct', 'tplsets'));
+$form->addElement(new XoopsFormHidden('moddir', $tform['tpl_module']));
+if ($tform['tpl_tplset'] != 'default') {
+    $button_tray = new XoopsFormElementTray('');
+    $button_tray->addElement(new XoopsFormButton('', 'previewtpl', _PREVIEW, 'submit'));
+    $button_tray->addElement(new XoopsFormButton('', 'submittpl', _SUBMIT, 'submit'));
+    $form->addElement($button_tray);
+} else {
+    $form->addElement(new XoopsFormButton('', 'previewtpl', _MD_VIEW, 'submit'));
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/tplsets/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/tplsets/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/tplsets/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/tplsets/main.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/tplsets/main.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/tplsets/main.php	(revision 405)
@@ -0,0 +1,1426 @@
+<?php
+// $Id: main.php,v 1.6 2006/07/27 00:17:18 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+if ( !is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid()) ) {
+    exit("Access Denied");
+} else {
+    $myts =& MyTextsanitizer::getInstance();
+    $op = 'list';
+    if (isset($_GET['op'])) {
+        $op = trim($_GET['op']);
+        $id = $moddir = $file = $type = $tplset = null;
+        if (isset($_GET['id'])) {
+            $id = intval($_GET['id']);
+        }
+        if (isset($_GET['moddir'])) {
+            $moddir = trim($_GET['moddir']);
+        }
+        if (isset($_GET['file'])) {
+            $file = trim($_GET['file']);
+        }
+        if (isset($_GET['type'])) {
+            $type = trim($_GET['type']);
+        }
+        if (isset($_GET['tplset'])) {
+            $tplset = $myts->stripslashesGPC(trim($_GET['tplset']));
+            $tplset4disp = htmlspecialchars($tplset, ENT_QUOTES);
+            $tplset4url = urlencode($tplset);
+        }
+    } elseif (!empty($_POST['op'])) {
+        $op = $_POST['op'];
+    }
+
+    if ($op == 'edittpl_go') {
+        if (isset($_POST['previewtpl'])) {
+            $op = 'previewtpl';
+        }
+    }
+
+    switch ($op) {
+    case 'list':
+        $tplset_handler =& xoops_gethandler('tplset');
+        $tplsets =& $tplset_handler->getObjects();
+        xoops_cp_header();
+        echo '<h4 style="text-align:left">'._MD_TPLMAIN.'</h4>';
+        $installed = array();
+        $tpltpl_handler =& xoops_gethandler('tplfile');
+        $installed_mods = $tpltpl_handler->getModuleTplCount('default');
+        $tcount = count($tplsets);
+        echo '<table width="100%" cellspacing="1" class="outer"><tr align="center"><th width="25%">'._MD_THMSETNAME.'</th><th>'._MD_CREATED.'</th><th>'._MD_TEMPLATES.'</th><th>'._MD_ACTION.'</th><th>&nbsp;</th></tr>';
+        $class = 'even';
+        for ($i = 0; $i < $tcount; $i++) {
+            $tplsetname = $tplsets[$i]->getVar('tplset_name');
+            $tplsetname4disp = htmlspecialchars($tplsetname, ENT_QUOTES);
+            $tplsetname4url = urlencode($tplsetname);
+//          $installed_themes[] = $tplsetname;
+            $class = ($class == 'even') ? 'odd' : 'even';
+            echo '<tr class="'.$class.'" align="center"><td class="head">'.$tplsetname4disp.'<br /><br /><span style="font-weight:normal;">'.$tplsets[$i]->getVar('tplset_desc').'</span></td><td>'.formatTimestamp($tplsets[$i]->getVar('tplset_created'), 's').'</td><td align="left"><ul>';
+            $tplstats = $tpltpl_handler->getModuleTplCount($tplsetname);
+            if (count($tplstats) > 0) {
+                $module_handler =& xoops_gethandler('module');
+                echo '<ul>';
+                foreach ($tplstats as $moddir => $filecount) {
+                    $module =& $module_handler->getByDirname($moddir);
+                    if (is_object($module)) {
+                        if ($installed_mods[$moddir] > $filecount) {
+                            $filecount = '<span style="color:#ff0000;">'.$filecount.'</span>';
+                        }
+                        echo '<li>'.$module->getVar('name').' [<a href="admin.php?fct=tplsets&amp;op=listtpl&amp;tplset='.$tplsetname4url.'&amp;moddir='.$moddir.'">'._LIST.'</a> (<b>'.$filecount.'</b>)]</li>';
+                    }
+                    unset($module);
+                }
+                $not_installed = array_diff(array_keys($installed_mods), array_keys($tplstats));
+            } else {
+                $not_installed = array_keys($installed_mods);
+            }
+            foreach ($not_installed as $ni) {
+                $module =& $module_handler->getByDirname($ni);
+                echo '<li>'.$module->getVar('name').' [<a href="admin.php?fct=tplsets&amp;op=listtpl&amp;tplset='.$tplsetname4url.'&amp;moddir='.$ni.'">'._LIST.'</a> (<span style="color:#ff0000; font-weight: bold;">0</span>)] [<a href="admin.php?fct=tplsets&amp;op=generatemod&amp;tplset='.$tplsetname4url.'&amp;moddir='.$ni.'">'._MD_GENERATE.'</a>]</li>';
+            }
+            echo '</ul></td><td>';
+            echo '[<a href="admin.php?fct=tplsets&amp;op=download&amp;method=tar&amp;tplset='.$tplsetname4url.'">'._MD_DOWNLOAD.'</a>]<br />[<a href="admin.php?fct=tplsets&amp;op=clone&amp;tplset='.$tplsetname4url.'">'._CLONE.'</a>]';
+            if ($tplsetname != 'default' && $tplsetname != $xoopsConfig['template_set']) {
+                echo '<br />[<a href="admin.php?fct=tplsets&amp;op=delete&amp;tplset='.$tplsetname4url.'">'._DELETE.'</a>]';
+            }
+            echo '</td>';
+            if ($tplsetname === $xoopsConfig['template_set']) {
+                echo '<td><img src="'.XOOPS_URL.'/modules/system/images/check.gif" alt="'._MD_DEFAULTTHEME.'" /></td>';
+            } else {
+                echo '<td>&nbsp;</td>';
+            }
+            echo '</tr>';
+        }
+        echo '</table><br />';
+
+        include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
+        $form = new XoopsThemeForm(_MD_UPLOADTAR, 'tplupload_form', 'admin.php');
+        $form->setExtra('enctype="multipart/form-data"');
+        $form->addElement(new XoopsFormToken(XoopsSingleTokenHandler::quickCreate('tplsets_uploadtar')));
+        $form->addElement(new XoopsFormFile(_MD_CHOOSETAR.'<br /><span style="color:#ff0000;">'._MD_ONLYTAR.'</span>', 'tpl_upload', 1000000));
+        $form->addElement(new XoopsFormText(_MD_NTHEMENAME.'<br /><span style="font-weight:normal;">'._MD_ENTERTH.'</span>', 'tplset_name', 20, 50));
+        $form->addElement(new XoopsFormHidden('op', 'uploadtar_go'));
+        $form->addElement(new XoopsFormHidden('fct', 'tplsets'));
+        $form->addElement(new XoopsFormButton('', 'upload_button', _MD_UPLOAD, 'submit'));
+        $form->display();
+        xoops_cp_footer();
+        break;
+    case 'listtpl':
+         if ($tplset == '') {
+            redirect_header('admin.php?fct=tplsets',1);
+        }
+        if ($moddir == '') {
+            redirect_header('admin.php?fct=tplsets',1);
+        }
+        xoops_cp_header();
+        $module_handler =& xoops_gethandler('module');
+        $module =& $module_handler->getByDirname($moddir);
+        $modname = $module->getVar('name');
+        echo '<a href="admin.php?fct=tplsets">'. _MD_TPLMAIN .'</a>&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;'.$tplset4disp.'<br /><br />';
+
+        $token=&XoopsMultiTokenHandler::quickCreate('tplsets_update');
+
+        echo '<h4>'.$modname.'</h4><form action="admin.php" method="post" enctype="multipart/form-data"><table width="100%" class="outer" cellspacing="1"><tr><th width="40%">'._MD_FILENAME.'</th><th>'._MD_LASTMOD.'</th>';
+        echo $token->getHtml();
+        if ($tplset != 'default') {
+            echo '<th>'._MD_LASTIMP.'</th><th colspan="2">'._MD_ACTION.'</th></tr>';
+        } else {
+            echo '<th>'._MD_ACTION.'</th></tr>';
+        }
+        $tpltpl_handler =& xoops_gethandler('tplfile');
+        // get files that are already installed
+        $templates =& $tpltpl_handler->find($tplset, 'module', null, $moddir);
+        $inst_files = array();
+        $tcount = count($templates);
+        for ($i = 0; $i < $tcount; $i++) {
+            if ($i % 2 == 0) {
+                $class = 'even';
+            } else {
+                $class = 'odd';
+            }
+            $last_modified = $templates[$i]->getVar('tpl_lastmodified');
+            $last_imported = $templates[$i]->getVar('tpl_lastimported');
+            $last_imported_f = ($last_imported > 0) ? formatTimestamp($last_imported, 'l') : '';
+            echo  '<tr class="'.$class.'"><td class="head">'.$templates[$i]->getVar('tpl_file').'<br /><br /><span style="font-weight:normal;">'.$templates[$i]->getVar('tpl_desc').'</span></td><td>'.formatTimestamp($last_modified, 'l').'</td>';
+            $filename = $templates[$i]->getVar('tpl_file');
+            if ($tplset != 'default') {
+                $physical_file = XOOPS_THEME_PATH.'/'.$tplset.'/templates/'.$moddir.'/'.$filename;
+                if (file_exists($physical_file)) {
+                    $mtime = filemtime($physical_file);
+                    if ($last_imported < $mtime) {
+                        if ($mtime > $last_modified) {
+                            $bg = '#ff9999';
+                        } elseif($mtime > $last_imported) {
+                            $bg = '#99ff99';
+                        }
+                        echo '<td style="background-color:'.$bg.';">'.$last_imported_f.' [<a href="admin.php?fct=tplsets&amp;tplset='.$tplset4url.'&amp;moddir='.$moddir.'&amp;op=importtpl&amp;id='.$templates[$i]->getVar('tpl_id').'">'._MD_IMPORT.'</a>]';
+                    } else {
+                        echo '<td>'.$last_imported_f;
+                    }
+                } else {
+                    echo '<td>'.$last_imported_f;
+                }
+                echo '</td><td>[<a href="admin.php?fct=tplsets&amp;op=edittpl&amp;id='.$templates[$i]->getVar('tpl_id').'">'._EDIT.'</a>] [<a href="admin.php?fct=tplsets&amp;op=deletetpl&amp;id='.$templates[$i]->getVar('tpl_id').'">'._DELETE.'</a>] [<a href="admin.php?fct=tplsets&amp;op=downloadtpl&amp;id='.$templates[$i]->getVar('tpl_id').'">'._MD_DOWNLOAD.'</a>]</td><td align="right"><input type="file" name="'.$filename.'" id="'.$filename.'" /><input type="hidden" name="xoops_upload_file[]" id="xoops_upload_file[]" value="'.$filename.'" /><input type="hidden" name="old_template['.$filename.']" value="'.$templates[$i]->getVar('tpl_id').'" /></td>';
+            } else {
+                echo '<td>[<a href="admin.php?fct=tplsets&amp;op=edittpl&amp;id='.$templates[$i]->getVar('tpl_id').'">'._MD_VIEW.'</a>] [<a href="admin.php?fct=tplsets&amp;op=downloadtpl&amp;id='.$templates[$i]->getVar('tpl_id').'">'._MD_DOWNLOAD.'</a>]</td>';
+            }
+            echo '</tr>'."\n";
+            $inst_files[] = $filename;
+        }
+        if ($tplset != 'default') {
+            include_once XOOPS_ROOT_PATH.'/class/xoopslists.php';
+            // get difference between already installed files and the files under modules directory. which will be recognized as files that are not installed
+            $notinst_files = array_diff(XoopsLists::getFileListAsArray(XOOPS_ROOT_PATH.'/modules/'.$moddir.'/templates/'), $inst_files);
+            foreach ($notinst_files as $nfile) {
+                if ($nfile != 'index.html') {
+                    echo  '<tr><td style="background-color:#FFFF99; padding: 5px;">'.$nfile.'</td><td style="background-color:#FFFF99; padding: 5px;">&nbsp;</td><td style="background-color:#FFFF99; padding: 5px;">';
+                    $physical_file = XOOPS_THEME_PATH.'/'.$tplset.'/templates/'.$moddir.'/'.$nfile;
+                    if (file_exists($physical_file)) {
+                        echo '[<a href="admin.php?fct=tplsets&amp;moddir='.$moddir.'&amp;tplset='.$tplset4url.'&amp;op=importtpl&amp;file='.urlencode($nfile).'">'._MD_IMPORT.'</a>]';
+                    } else {
+                        echo '&nbsp;';
+                    }
+                    echo '</td><td style="background-color:#FFFF99; padding: 5px;">[<a href="admin.php?fct=tplsets&amp;moddir='.$moddir.'&amp;tplset='.$tplset4url.'&amp;op=generatetpl&amp;type=module&amp;file='.urlencode($nfile).'">'._MD_GENERATE.'</a>]</td><td style="background-color:#FFFF99; padding: 5px; text-align:right;"><input type="file" name="'.$nfile.'" id="'.$nfile.'" /><input type="hidden" name="xoops_upload_file[]" id="xoops_upload_file[]" value="'.$nfile.'" /></td></tr>'."\n";
+                }
+            }
+        }
+        echo '</table><br /><table width="100%" class="outer" cellspacing="1"><tr><th width="40%">'._MD_FILENAME.'</th><th>'._MD_LASTMOD.'</th>';
+        if ($tplset != 'default') {
+            echo '<th>'._MD_LASTIMP.'</th><th colspan="2">'._MD_ACTION.'</th></tr>';
+        } else {
+            echo '<th>'._MD_ACTION.'</th></tr>';
+        }
+        $btemplates =& $tpltpl_handler->find($tplset, 'block', null, $moddir);
+        $binst_files = array();
+        $btcount = count($btemplates);
+        for ($j = 0; $j < $btcount; $j++) {
+            $last_imported = $btemplates[$j]->getVar('tpl_lastimported');
+            $last_imported_f = ($last_imported > 0) ? formatTimestamp($last_imported, 'l') : '';
+            $last_modified = $btemplates[$j]->getVar('tpl_lastmodified');
+            if ($j % 2 == 0) {
+                $class = 'even';
+            } else {
+                $class = 'odd';
+            }
+            echo  '<tr class="'.$class.'"><td class="head"><span style="font-weight:bold;">'.$btemplates[$j]->getVar('tpl_file').'</span><br /><br /><span style="font-weight:normal;">'.$btemplates[$j]->getVar('tpl_desc').'</span></td><td>'.formatTimestamp($last_modified, 'l').'</td>';
+            $filename = $btemplates[$j]->getVar('tpl_file');
+            $physical_file = XOOPS_THEME_PATH.'/'.$tplset.'/templates/'.$moddir.'/blocks/'.$filename;
+            if ($tplset != 'default') {
+                if (file_exists($physical_file)) {
+                    $mtime = filemtime($physical_file);
+                    if ($last_imported < $mtime) {
+                        if ($mtime > $last_modified) {
+                            $bg = '#ff9999';
+                        } elseif($mtime > $last_imported) {
+                            $bg = '#99ff99';
+                        }
+                        echo '<td style="background-color:'.$bg.';">'.$last_imported_f.' [<a href="admin.php?fct=tplsets&amp;tplset='.$tplset4url.'&amp;op=importtpl&amp;moddir='.$moddir.'&amp;id='.$btemplates[$j]->getVar('tpl_id').'">'._MD_IMPORT.'</a>]';
+                    } else {
+                        echo '<td>'.$last_imported_f;
+                    }
+                } else {
+                    echo '<td>'.$last_imported_f;
+                }
+                echo '</td><td>[<a href="admin.php?fct=tplsets&amp;op=edittpl&amp;id='.$btemplates[$j]->getVar('tpl_id').'">'._EDIT.'</a>] [<a href="admin.php?fct=tplsets&amp;op=deletetpl&amp;id='.$btemplates[$j]->getVar('tpl_id').'">'._DELETE.'</a>] [<a href="admin.php?fct=tplsets&amp;op=downloadtpl&amp;id='.$btemplates[$j]->getVar('tpl_id').'">'._MD_DOWNLOAD.'</a>]</td><td align="right"><input type="file" name="'.$filename.'" id="'.$filename.'" /><input type="hidden" name="xoops_upload_file[]" id="xoops_upload_file[]" value="'.$filename.'" /><input type="hidden" name="old_template['.$filename.']" value="'.$btemplates[$j]->getVar('tpl_id').'" /></td>';
+            } else {
+                echo '<td>[<a href="admin.php?fct=tplsets&amp;op=edittpl&amp;id='.$btemplates[$j]->getVar('tpl_id').'">'._MD_VIEW.'</a>] [<a href="admin.php?fct=tplsets&amp;op=downloadtpl&amp;id='.$btemplates[$j]->getVar('tpl_id').'">'._MD_DOWNLOAD.'</a>]</td>';
+            }
+            echo '</tr>'."\n";
+            $binst_files[] = $filename;
+        }
+        if ($tplset != 'default') {
+            include_once XOOPS_ROOT_PATH.'/class/xoopslists.php';
+            $bnotinst_files = array_diff(XoopsLists::getFileListAsArray(XOOPS_ROOT_PATH.'/modules/'.$moddir.'/templates/blocks/'), $binst_files);
+            foreach ($bnotinst_files as $nfile) {
+                if ($nfile != 'index.html') {
+                    echo  '<tr style="background-color:#FFFF99;"><td style="background-color:#FFFF99; padding: 5px;">'.$nfile.'</td><td style="background-color:#FFFF99; padding: 5px;">&nbsp;</td><td style="background-color:#FFFF99; padding: 5px;">';
+                    $physical_file = XOOPS_THEME_PATH.'/'.$tplset.'/templates/'.$moddir.'/blocks/'.$nfile;
+                    if (file_exists($physical_file)) {
+                        echo '[<a href="admin.php?fct=tplsets&amp;moddir='.$moddir.'&amp;tplset='.$tplset4url.'&amp;op=importtpl&amp;file='.urlencode($nfile).'">'._MD_IMPORT.'</a>]';
+                    } else {
+                        echo '&nbsp;';
+                    }
+                    echo '</td><td style="background-color:#FFFF99; padding: 5px;">[<a href="admin.php?fct=tplsets&amp;moddir='.$moddir.'&amp;tplset='.$tplset4url.'&amp;op=generatetpl&amp;type=block&amp;file='.urlencode($nfile).'">'._MD_GENERATE.'</a>]</td><td style="background-color:#FFFF99; padding: 5px; text-align: right"><input type="file" name="'.$nfile.'" id="'.$nfile.'" /><input type="hidden" name="xoops_upload_file[]" id="xoops_upload_file[]" value="'.$nfile.'" /></td></tr>'."\n";
+                }
+            }
+        }
+        echo '</table>';
+        if ($tplset != 'default') {
+            echo '<div style="text-align: right; margin-top: 5px;"><input type="hidden" name="fct" value="tplsets" /><input type="hidden" name="op" value="update" />';
+            echo '<input type="hidden" name="moddir" value="'.$moddir.'" /><input type="hidden" name="tplset" value="'.$tplset4disp.'" /><input type="submit" value="'._MD_UPLOAD.'" /></div></form>';
+        }
+        xoops_cp_footer();
+        break;
+    case 'edittpl':
+        if ($id <= 0) {
+            redirect_header('admin.php?fct=tplsets', 1);
+        }
+        $tpltpl_handler =& xoops_gethandler('tplfile');
+        $tplfile =& $tpltpl_handler->get($id, true);
+        if (is_object($tplfile)) {
+            $tplset = $tplfile->getVar('tpl_tplset');
+            $tplset4disp = htmlspecialchars($tplset, ENT_QUOTES);
+            $tplset4url = urlencode($tplset);
+            $tform = array('tpl_tplset' => $tplset, 'tpl_id' => $id, 'tpl_file' => $tplfile->getVar('tpl_file'), 'tpl_desc' => $tplfile->getVar('tpl_desc'), 'tpl_lastmodified' => $tplfile->getVar('tpl_lastmodified'), 'tpl_source' => $tplfile->getVar('tpl_source', 'E'), 'tpl_module' => $tplfile->getVar('tpl_module'));
+            include_once XOOPS_ROOT_PATH.'/modules/system/admin/tplsets/tplform.php';
+            xoops_cp_header();
+            echo '<a href="admin.php?fct=tplsets">'. _MD_TPLMAIN .'</a>&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;<a href="./admin.php?fct=tplsets&amp;op=listtpl&amp;moddir='.$tplfile->getVar('tpl_module').'&amp;tplset='.$tplset4url.'">'.$tplset4disp.'</a>&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;'._MD_EDITTEMPLATE.'<br /><br />';
+            $form->display();
+            xoops_cp_footer();
+            exit();
+        } else {
+            $err[] = 'Selected template (ID: $id) does not exist';
+        }
+        xoops_cp_header();
+        xoops_error($err);
+        echo '<br /><a href="admin.php?fct=tplsets">'._MD_AM_BTOTADMIN.'</a>';
+        xoops_cp_footer();
+        break;
+    case 'edittpl_go':
+        $id = !empty($_POST['id']) ? intval($_POST['id']) : 0;
+        if ($id <= 0 || !XoopsMultiTokenHandler::quickValidate('tplform')) {
+            redirect_header('admin.php?fct=tplsets');
+        }
+        $tpltpl_handler =& xoops_gethandler('tplfile');
+        $tplfile =& $tpltpl_handler->get($id, true);
+        $err = array();
+        if (!is_object($tplfile)) {
+            $err[] = 'Selected template (ID: $id) does not exist';
+        } else {
+            if ($tplfile->getVar('tpl_tplset') != 'default') {
+                $tplfile->setVar('tpl_source', $_POST['html']);
+                $tplfile->setVar('tpl_lastmodified', time());
+
+                if (!$tpltpl_handler->insert($tplfile)) {
+                    $err[] = 'Could not insert template file to the database.';
+                } else {
+                    include_once XOOPS_ROOT_PATH.'/class/template.php';
+                    $xoopsTpl = new XoopsTpl();
+                    if ($xoopsTpl->is_cached('db:'.$tplfile->getVar('tpl_file'))) {
+                        if (!$xoopsTpl->clear_cache('db:'.$tplfile->getVar('tpl_file'))) {
+                        }
+                    }
+                    if ($tplfile->getVar('tpl_tplset') === $xoopsConfig['template_set']) {
+                        xoops_template_touch($id);
+                    }
+                }
+            } else {
+                $err[] = 'Default template files cannot be edited.';
+            }
+        }
+        if (count($err) == 0) {
+            if (!empty($_POST['moddir'])) {
+                redirect_header('admin.php?fct=tplsets&amp;op=edittpl&amp;id='.$tplfile->getVar('tpl_id'), 2, _MD_AM_DBUPDATED);
+            } elseif (isset($_POST['redirect'])) {
+                redirect_header('admin.php?fct=tplsets&amp;tplset='.urlencode($tplfile->getVar('tpl_tplset')).'&amp;op='.trim($_POST['redirect']), 2, _MD_AM_DBUPDATED);
+            } else {
+                redirect_header('admin.php?fct=tplsets', 2, _MD_AM_DBUPDATED);
+            }
+        }
+        xoops_cp_header();
+        xoops_error($err);
+        echo '<br /><a href="admin.php?fct=tplsets">'._MD_AM_BTOTADMIN.'</a>';
+        xoops_cp_footer();
+        break;
+    case 'deletetpl':
+        xoops_cp_header();
+        xoops_confirm(array('id' => $id, 'op' => 'deletetpl_go', 'fct' => 'tplsets'), 'admin.php', _MD_RUSUREDELTPL, _YES);
+        xoops_cp_footer();
+        break;
+    case 'deletetpl_go':
+        $id = !empty($_POST['id']) ? intval($_POST['id']) : 0;
+        if ($id <= 0 || !xoops_confirm_validate()) {
+            redirect_header('admin.php?fct=tplsets', 1);
+        }
+        $tpltpl_handler =& xoops_gethandler('tplfile');
+        $tplfile =& $tpltpl_handler->get($id);
+        $err = array();
+        if (!is_object($tplfile)) {
+            $err[] = 'Selected template (ID: $id) does not exist';
+        } else {
+            if ($tplfile->getVar('tpl_tplset') != 'default') {
+                if (!$tpltpl_handler->delete($tplfile)) {
+                    $err[] = 'Could not delete '.$tplfile->getVar('tpl_file').' from the database.';
+                } else {
+                    // need to compile default xoops template
+                    if ($tplfile->getVar('tpl_tplset') === $xoopsConfig['template_set']) {
+                        $defaulttpl =& $tpltpl_handler->find('default', $tplfile->getVar('tpl_type'), $tplfile->getVar('tpl_refid'), null, $tplfile->getVar('tpl_file'));
+                        if (count($defaulttpl) > 0) {
+                            include_once XOOPS_ROOT_PATH.'/class/template.php';
+                            xoops_template_touch($defaulttpl[0]->getVar('tpl_id'), true);
+                        }
+                    }
+                }
+            } else {
+                $err[] = 'Default template files cannot be deleted.';
+            }
+        }
+        if (count($err) == 0) {
+            redirect_header('admin.php?fct=tplsets&amp;op=listtpl&amp;moddir='.$tplfile->getVar('tpl_module').'&amp;tplset='.urlencode($tplfile->getVar('tpl_tplset')), 2, _MD_AM_DBUPDATED);
+        }
+        xoops_cp_header();
+        xoops_error($err);
+        echo '<br /><a href="admin.php?fct=tplsets">'._MD_AM_BTOTADMIN.'</a>';
+        xoops_cp_footer();
+        break;
+    case 'delete':
+        xoops_cp_header();
+        xoops_token_confirm(array('tplset' => $tplset, 'op' => 'delete_go', 'fct' => 'tplsets'), 'admin.php', _MD_RUSUREDELTH, _YES);
+        xoops_cp_footer();
+        break;
+    case 'delete_go':
+        if(!xoops_confirm_validate()) {
+            redirect_header('admin.php?fct=tplsets',3,'Ticket Error');
+        }
+        $tplset = isset($_POST['tplset']) ? $myts->stripslashesGPC(trim($_POST['tplset'])) : '';
+        $msgs = array();
+        if ($tplset !== '' && $tplset != 'default' && $tplset !== $xoopsConfig['template_set']) {
+            $tpltpl_handler =& xoops_gethandler('tplfile');
+            $templates =& $tpltpl_handler->getObjects(new Criteria('tpl_tplset', addslashes($tplset)));
+            $tcount = count($templates);
+            if ($tcount > 0) {
+                $msgs[] = 'Deleting template files...';
+                for ($i = 0; $i < $tcount; $i++) {
+                    if (!$tpltpl_handler->delete($templates[$i])) {
+                        $msgs[] = '&nbsp;&nbsp;<span style="color:#ff0000;">ERROR: Could not delete template <b>'.$templates[$i]->getVar('tpl_file').'</b>. ID: <b>'.$templates[$i]->getVar('tpl_id').'</b></span>';
+                    } else {
+                        $msgs[] = '&nbsp;&nbsp;Template <b>'.$templates[$i]->getVar('tpl_file').'</b> deleted. ID: <b>'.$templates[$i]->getVar('tpl_id').'</b>';
+                    }
+                }
+            }
+/*
+            $image_handler =& xoops_gethandler('imagesetimg');
+            $imagefiles =& $image_handler->getObjects(new Criteria('tplset_name', $tplset));
+            $icount = count($imagefiles);
+            if ($icount > 0) {
+                $msgs[] = 'Deleting image files...';
+                for ($i = 0; $i < $icount; $i++) {
+                    if (!$image_handler->delete($imagefiles[$i])) {
+                        $msgs[] = '&nbsp;&nbsp;<span style="color:#ff0000;">ERROR: Could not remove file <b>'.$imagefiles[$i]->getVar('imgsetimg_file').'</b> from the database (ID: <b>'.$imagefiles[$i]->getVar('imgsetimg_id').'</b>)</span>';
+                    } else {
+                        $msgs[] = '&nbsp;&nbsp;File <b>'.$imagefiles[$i]->getVar('imgsetimg_file').'</b> deleted from the database (ID: <b>'.$imagefiles[$i]->getVar('imgsetimg_id').'</b>)</span>';
+                    }
+                }
+            }
+            $imageset_handler =& xoops_gethandler('imageset');
+            $imagesets =& $imageset_handler->getObjects(new Criteria('tplset_name', $tplset));
+            $scount = count($imagesets);
+            if ($scount > 0) {
+                $msgs[] = 'Deleting image set data...';
+                for ($i = 0; $i < $scount; $i++) {
+                    if (!$imageset_handler->unlinktplset($imagesets[$i]->getVar('imgset_id'), $tplset)) {
+                        $msgs[] = '&nbsp;&nbsp;<span style="color:#ff0000;">ERROR: Could not remove link between <b>'.$imagesets[$i]->getVar('imgset_name').'</b> (ID: <b>'.$imagesets[$i]->getVar('imgset_id').'</b>) and '.$tplset.' from the database.</span>';
+                    } else {
+                        $msgs[] = '&nbsp;&nbsp;Link between <b>'.$imagesets[$i]->getVar('imgset_name').'</b> (ID: <b>'.$imagesets[$i]->getVar('imgset_id').'</b>) and <b>'.$tplset.'</b> removed from the database.</span>';
+                    }
+                    if (!$imageset_handler->delete($imagesets[$i])) {
+                        $msgs[] = '&nbsp;&nbsp;<span style="color:#ff0000;">ERROR: Could not delete image set <b>'.$imagesets[$i]->getVar('imgset_name').'</b> (ID: <b>'.$imagesets[$i]->getVar('imgset_id').'</b>) from the database.</span>';
+                    } else {
+                        $msgs[] = '&nbsp;&nbsp;Image set <b>'.$imagesets[$i]->getVar('imgset_name').'</b> (ID: <b>'.$imagesets[$i]->getVar('imgset_id').'</b>) removed from the database.</span>';
+                    }
+                }
+            }
+*/
+            $tplset_handler =& xoops_gethandler('tplset');
+            $tplsets =& $tplset_handler->getObjects(new Criteria('tplset_name', addslashes($tplset)));
+            if (count($tplsets) > 0 && is_object($tplsets[0])) {
+                $msgs[] = 'Deleting template set data...';
+                if (!$tplset_handler->delete($tplsets[0])) {
+                    $msgs[] = '&nbsp;&nbsp;<span style="color:#ff0000;">ERROR: Template set '.htmlspecialchars($tplset, ENT_QUOTES).' could not be deleted.</span>';
+                } else {
+                    $msgs[] = '&nbsp;&nbsp;Template set data <b>'.htmlspecialchars($tplset, ENT_QUOTES).'</b> removed from the database.';
+                }
+            }
+        } else {
+            $msgs[] = '<span style="color:#ff0000;">ERROR: Default template files cannot be deleted</span>';
+        }
+        xoops_cp_header();
+        foreach ($msgs as $msg) {
+            echo '<code>'.$msg.'</code><br />';
+        }
+        echo '<br /><a href="admin.php?fct=tplsets">'._MD_AM_BTOTADMIN.'</a>';
+        xoops_cp_footer();
+        break;
+    case 'clone':
+        include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
+        $form = new XoopsThemeForm(_MD_CLONETHEME, 'template_form', 'admin.php');
+        $form->addElement(new XoopsFormToken(XoopsSingleTokenHandler::quickCreate('tplsets_clone')));
+        $form->addElement(new XoopsFormLabel(_MD_THEMENAME, $tplset4disp));
+        $form->addElement(new XoopsFormText(_MD_NEWNAME, 'newtheme', 30, 50), true);
+        $form->addElement(new XoopsFormHidden('tplset', $tplset4disp));
+        $form->addElement(new XoopsFormHidden('op', 'clone_go'));
+        $form->addElement(new XoopsFormHidden('fct', 'tplsets'));
+        $form->addElement(new XoopsFormButton('', 'tpl_button', _SUBMIT, 'submit'));
+        xoops_cp_header();
+        echo '<a href="admin.php?fct=tplsets">'. _MD_TPLMAIN .'</a>&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;'._MD_CLONETHEME.'<br /><br />';
+        $form->display();
+        xoops_cp_footer();
+        break;
+    case 'clone_go':
+        $msgs = array();
+        $tplset = isset($_POST['tplset']) ? $myts->stripslashesGPC(trim($_POST['tplset'])) : '';
+        $newtheme = isset($_POST['newtheme']) ? trim($_POST['newtheme']) : '';
+        if ($tplset === '' || $newtheme === '') {
+            redirect_header('admin.php?fct=tplsets',3,'Invalid Template Set Name');
+        }
+        if (preg_match('/['.preg_quote('\/:*?"<>|','/').']/', $newtheme)) {
+            redirect_header('admin.php?fct=tplsets',3,'Invalid Template Set Name');
+        }
+        $tpltpl_handler =& xoops_gethandler('tplfile');
+        xoops_cp_header();
+        if(!XoopsSingleTokenHandler::quickValidate('tplsets_clone')) {
+            redirect_header('admin.php?fct=tplsets',3,'Ticket Error');
+        } elseif ($tplset === $newtheme) {
+            xoops_error('Template set name must be a different name.');
+        } elseif ($tpltpl_handler->getCount(new Criteria('tpl_tplset', addslashes($newtheme))) > 0) {
+            xoops_error('Template set <b>'.$newtheme.'</b> already exists.');
+        } else {
+            $tplset_handler =& xoops_gethandler('tplset');
+            $tplsetobj =& $tplset_handler->create();
+            $tplsetobj->setVar('tplset_name', $newtheme);
+            $tplsetobj->setVar('tplset_created', time());
+            if (!$tplset_handler->insert($tplsetobj)) {
+                $msgs[] = '<span style="color:#ff0000;">ERROR: Could not create template set <b>'.htmlspecialchars($newtheme, ENT_QUOTES).'</b>.</span><br />';
+            } else {
+                $tplsetid = $tplsetobj->getVar('tplset_id');
+                $templates =& $tpltpl_handler->getObjects(new Criteria('tpl_tplset', addslashes($tplset)), true);
+                $tcount = count($templates);
+                if ($tcount > 0) {
+                    $msgs[] = 'Copying template files...';
+                    for ($i = 0; $i < $tcount; $i++) {
+                        $newtpl =& $templates[$i]->xoopsClone();
+                        $newtpl->setVar('tpl_tplset', $newtheme);
+                        $newtpl->setVar('tpl_id', 0);
+                        $newtpl->setVar('tpl_lastimported', 0);
+                        $newtpl->setVar('tpl_lastmodified', time());
+                        if (!$tpltpl_handler->insert($newtpl)) {
+                            $msgs[] = '&nbsp;&nbsp;<span style="color:#ff0000;">ERROR: Failed copying template <b>'.$templates[$i]->getVar('tpl_file').'</b>. ID: <b>'.$templates[$i]->getVar('tpl_id').'</b></span>';
+                        } else {
+                            $msgs[] = '&nbsp;&nbsp;Template <b>'.$templates[$i]->getVar('tpl_file').'</b> copied. ID: <b>'.$newtpl->getVar('tpl_id').'</b>';
+                        }
+                        unset($newtpl);
+                    }
+/*
+                    $imageset_handler =& xoops_gethandler('imageset');
+                    $orig_imgset =& $imageset_handler->getObjects(new Criteria('tplset_name', $tplset));
+                    $msgs[] = 'Copying image files...';
+                    $imgsetcount = count($orig_imgset);
+                    for ($i = 0; $i < $imgsetcount; $i++) {
+                        if ($orig_imgset[$i]->getVar('imgset_refid') == 0) {
+                            $new_imgset =& $orig_imgset[$i]->xoopsClone();
+                            $new_imgset->setVar('imgset_id', 0);
+                            $new_imgset->setVar('imgset_name', $newtheme);
+                            if (!$imageset_handler->insert($new_imgset)) {
+                                $msgs[] = '&nbsp;&nbsp;<span style="color:#ff0000;">ERROR: Failed copying template image set data.</span>';
+                            } else {
+                                $new_imgsetid = $new_imgset->getVar('imgset_id');
+                                $msgs[] = '&nbsp;&nbsp;Template image set data copied. (Name: <b>'.$newtheme.'</b> ID: <b>'.$new_imgsetid.'</b>)</span>';
+                                $image_handler = xoops_gethandler('imagesetimg');
+                                $orig_images =& $image_handler->getByImageset($orig_imgset[$i]->getVar('imgset_id'));
+                                $imgcount = count($orig_images);
+                                for ($j = 0; $j < $imgcount; $j++) {
+                                    $new_image =& $orig_images[$j]->xoopsClone();
+                                    $new_image->setVar('imgsetimg_id', 0);
+                                    $new_image->setVar('imgsetimg_imgset', $new_imgsetid);
+                                    if (!$image_handler->insert($new_image)) {
+                                        $msgs[] = '&nbsp;&nbsp;<span style="color:#ff0000;">ERROR: Failed copying data for image file <b>'.$orig_images[$j]->getVar('imgsetimg_file').'</b>.</span>';
+                                    } else {
+                                        $thisimage = $orig_images[$j]->getVar('imgsetimg_file');
+                                        $msgs[] = '&nbsp;&nbsp;Data for image file <b>'.$thisimage.'</b> copied.</span>';
+                                    }
+                                }
+                                if (!$imageset_handler->linktplset($new_imgsetid, $newtheme)) {
+                                    $msgs[] = '&nbsp;&nbsp;<span style="color:#ff0000;">ERROR: Failed creating link between template image set (ID : <b>'.$new_imgsetid.'</b>) and template set <b>'.$newtheme.'</b>.</span>';
+                                } else {
+                                    $msgs[] = '&nbsp;&nbsp;Template image set (ID: <b>'.$new_imgsetid.'</b>) and template set <b>'.$newtheme.'</b> linked.</span>';
+                                }
+                            }
+                        } else {
+                            // module image set, so just create another link to the new template set
+                            if (!$imageset_handler->linktplset($orig_imgset[$i]->getVar('imgset_id'), $newtheme)) {
+                                $msgs[] = '&nbsp;&nbsp;<span style="color:#ff0000;">ERROR: Failed creating link between module image set  <b>'.$orig_imgset[$i]->getVar('imgset_name').'</b> (ID <b>'.$orig_imgset[$i]->getVar('imgset_id').'</b>) and template set <b>'.$newtheme.'</b>.</span>';
+                            } else {
+                                $msgs[] = '&nbsp;&nbsp;Module image set <b>'.$orig_imgset[$i]->getVar('imgset_name').'</b> (ID <b>'.$orig_imgset[$i]->getVar('imgset_id').'</b>) and template set <b>'.$newtheme.'</b> linked.';
+                            }
+                        }
+                    }
+*/
+                    $msgs[] = 'Template set <b>'.htmlspecialchars($newtheme, ENT_QUOTES).'</b> created. (ID: <b>'.$tplsetid.'</b>)<br />';
+                } else {
+                    $msgs[] = '<span style="color:#ff0000;">ERROR: Template files for '.$theme.' do not exist</span>';
+                }
+            }
+        }
+        foreach ($msgs as $msg) {
+            echo '<code>'.$msg.'</code><br />';
+        }
+        echo '<br /><a href="admin.php?fct=tplsets">'._MD_AM_BTOTADMIN.'</a>';
+        xoops_cp_footer();
+        break;
+/*
+    case 'editimage':
+        xoops_cp_header();
+        echo '<a href="admin.php?fct=tplsets">'. _MD_TPLMAIN .'</a>&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;'._MD_EDITSKINIMG.' ('.$tplset.')<br /><br />';
+        include XOOPS_ROOT_PATH.'/modules/system/admin/tplsets/tplimgform.php';
+        xoops_cp_footer();
+        break;
+    case 'updateimage':
+
+        $tplset = trim($tplset);
+        $err = array();
+        if ($tplset != 'default') {
+            include_once XOOPS_ROOT_PATH.'/class/uploader.php';
+            $mimetypes = array('image/gif', "image/pjpeg", "image/jpeg", "image/jpeg", "image/jpeg", "image/png", 'image/x-png', "application/x-shockwave-flash", "image/tiff", "image/tiff", 'image/bmp');
+            if ($tplset == $xoopsConfig['template_set']) {
+                //directly upload to cache to reduce one step ;-)
+                $uploader = new XoopsMediaUploader(XOOPS_CACHE_PATH, $mimetypes, 500000);
+            } else {
+                $uploader = new XoopsMediaUploader(XOOPS_UPLOAD_PATH, $mimetypes, 500000);
+            }
+            $uploader->setAllowedExtensions(array('gif', 'jpeg', 'jpg', 'png', 'bmp', 'tiff', 'tif', 'swf'));
+            $image_handler =& xoops_gethandler('imagesetimg');
+            foreach ($imgids as $id) {
+                if (isset($imgfiles[$id]) && trim($imgfiles[$id]) != '') {
+                    if ($uploader->fetchMedia('imgfiles', $id)) {
+                        $image =& $image_handler->get($id);
+                        $uploader->setTargetFileName($image->getVar('imgsetimg_file'));
+                        if (!$uploader->upload()) {
+                            $err[] = $uploader->getErrors();
+                        } else {
+                            $fp = @fopen($uploader->getSavedDestination(), 'rb');
+                            $image->setVar('imgsetimg_body', @fread($fp, filesize($uploader->getSavedDestination())), true);
+                            @fclose($fp);
+                            if ($tplset != $xoopsConfig['template_set']) {
+                                @unlink($uploader->getSavedDestination());
+                            }
+                            if (!$image_handler->insert($image)) {
+                                $err[] = 'Could not save '.$image->getVar('imgsetimg_file');
+                            }
+                        }
+                    } else {
+                        $err[] = $uploader->getErrors();
+                    }
+                } elseif (!empty($imgdelete[$id])) {
+                    $image =& $image_handler->get($id);
+                    if (!$image_handler->delete($image)) {
+                        $err[] = 'Could not remove image file '.$image->getVar('imgsetimg_file');
+                    } else {
+                        if ($tplset == $xoopsConfig['template_set']) {
+                            @unlink(XOOPS_CACHE_PATH.'/'.$image->getVar('imgsetimg_file'));
+                        }
+                    }
+                }
+            }
+        } else {
+            $err[] = 'Cannot change XOOPS system default theme set images';
+        }
+        // delete image set if no more images
+        $current_imgs =& $image_handler->getByImageset($imgset);
+        if (count($current_imgs) == 0) {
+            $imageset_handler =& xoops_gethandler('imageset');
+            $imgset =& $imageset_handler->get($imgset);
+            if (!$imageset_handler->delete($imgset)) {
+                $err[] = 'Could not remove image set '.$imgset->getVar('imgset_name');
+            }
+        }
+        if (count($err) > 0) {
+            xoops_cp_header();
+            xoops_error($err);
+            xoops_cp_footer();
+        } else {
+            redirect_header('admin.php?fct=tplsets&amp;op=editimage&amp;tplset='.$tplset, 2, _MD_AM_DBUPDATED);
+        }
+        break;
+    case 'addimage':
+        $tplset = trim($tplset);
+        $err = array();
+        if ($tplset != 'default') {
+            include_once XOOPS_ROOT_PATH.'/class/uploader.php';
+            $mimetypes = array('image/gif', "image/pjpeg", "image/jpeg", "image/jpeg", "image/jpeg", "image/png", 'image/x-png', "application/x-shockwave-flash", "image/tiff", "image/tiff", 'image/bmp');
+            if ($tplset == $xoopsConfig['template_set']) {
+                //directly upload to cache to reduce one step ;-)
+                $uploader = new XoopsMediaUploader(XOOPS_CACHE_PATH, $mimetypes, 500000);
+            } else {
+                $uploader = new XoopsMediaUploader(XOOPS_UPLOAD_PATH, $mimetypes, 500000);
+            }
+            $uploader->setAllowedExtensions(array('gif', 'jpeg', 'jpg', 'png', 'bmp', 'tiff', 'tif', 'swf'));
+            $image_handler =& xoops_gethandler('imagesetimg');
+            if ($uploader->fetchMedia('imgfile')) {
+
+                if (!empty($imgset)) {
+                    //check if an image with the same name exists
+                    if ($image_handler->imageExists($uploader->getMediaName(), $imgset)) {
+                        $err[] = 'Image file '.$uploader->getMediaName().' already exists';
+                    }
+                }
+                if (empty($err)) {
+                    $image =& $image_handler->create();
+                    if (!$uploader->upload()) {
+                        $err[] = $uploader->getErrors();
+                    } else {
+                        if (!$fp = @fopen($uploader->getSavedDestination(), 'rb')) {
+                            $err[] = 'Could not read '.$uploader->getSavedFileName();
+                        } else {
+                            $image->setVar('imgsetimg_body', @fread($fp, filesize($uploader->getSavedDestination())), true);
+                            @fclose($fp);
+                            if ($tplset != $xoopsConfig['template_set']) {
+                                @unlink($uploader->getSavedDestination());
+                            }
+                            $image->setVar('imgsetimg_file', $uploader->getSavedFileName());
+                            if (!empty($imgset)) {
+                                $image->setVar('imgsetimg_imgset', $imgset);
+                            } else {
+                                $imageset_handler =& xoops_gethandler('imageset');
+                                $imgset =& $imageset_handler->create();
+                                $imgset->setVar('imgset_name', $tplset);
+                                $imgset->setVar('imgset_refid', 0);
+                                if (!$imageset_handler->insert($imgset)) {
+                                    $err[] = 'Could not create image set.';
+                                } else {
+                                    $newimgsetid = $imgset->getVar('imgset_id');
+                                    $image->setVar('imgsetimg_imgset', $newimgsetid);
+                                    if (!$imageset_handler->linktplset($newimgsetid, $tplset)) {
+                                        $err[] = 'Failed linking image set to template set '.$tplset;
+                                    }
+                                }
+                            }
+                            if (count($err) == 0) {
+                                if (!$image_handler->insert($image)) {
+                                    $err[] = 'Could not save '.$image->getVar('imgsetimg_file');
+                                }
+                            }
+                        }
+                    }
+                }
+            } else {
+                $err[] = $uploader->getErrors();
+            }
+        }
+        if (count($err) > 0) {
+            xoops_cp_header();
+            xoops_error($err);
+            xoops_cp_footer();
+        } else {
+            redirect_header('admin.php?fct=tplsets&amp;op=editimage&amp;tplset='.$tplset, 2, _MD_AM_DBUPDATED);
+        }
+        break;
+    case 'showimage':
+        $image_id = isset($_GET['id']) ? intval($_GET['id']) : 0;
+        if (empty($image_id)) {
+            header('Content-type: image/gif');
+            readfile(XOOPS_UPLOAD_PATH.'/blank.gif');
+            exit();
+        }
+        $image_handler =& xoops_gethandler('imagesetimg');
+        $image =& $image_handler->getObjects(new Criteria('imgsetimg_id', $image_id));
+        if (count($image) > 0) {
+            $mimetypes = array('gif' => 'image/gif', "jpe"=>"image/jpeg", "jpeg"=>"image/jpeg", "jpg"=>"image/jpeg", "png"=>"image/png", "swf"=>"application/x-shockwave-flash", "tif"=>"image/tiff", "tiff"=>"image/tiff", "bmp" => 'image/bmp');
+            $ext = substr(strtolower(strrchr($image[0]->getVar('imgsetimg_file'), '.')), 1);
+            if (in_array($ext, array_keys($mimetypes))) {
+                header('Content-type: '.$mimetypes[$ext]);
+            }
+            header('Cache-control: max-age=31536000');
+            header('Expires: '.gmdate("D, d M Y H:i:s",time()+31536000).'GMT');
+            header('Content-disposition: filename='.$image[0]->getVar('imgsetimg_file'));
+            header('Content-Length: '.strlen($image[0]->getVar('imgsetimg_body')));
+            header('Last-Modified: '.gmdate("D, d M Y H:i:s", time()).'GMT');
+            echo $image[0]->getVar('imgsetimg_body');
+        } else {
+            header('Content-type: image/gif');
+            readfile(XOOPS_UPLOAD_PATH.'/blank.gif');
+        }
+        break;
+*/
+    case 'viewdefault':
+        $tpltpl_handler =& xoops_gethandler('tplfile');
+        $tplfile =& $tpltpl_handler->get($id);
+        $default =& $tpltpl_handler->find('default', $tplfile->getVar('tpl_type'), $tplfile->getVar('tpl_refid'), null, $tplfile->getVar('tpl_file'));
+        echo "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>";
+        echo '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="'._LANGCODE.'" lang="'._LANGCODE.'">
+        <head>
+        <meta http-equiv="content-type" content="text/html; charset='._CHARSET.'" />
+        <meta http-equiv="content-language" content="'._LANGCODE.'" />
+        <title>'.htmlspecialchars($xoopsConfig['sitename']).' Administration</title>
+        <link rel="stylesheet" type="text/css" media="all" href="'.XOOPS_URL.'/xoops.css" />
+            <link rel="stylesheet" type="text/css" media="all" href="'.XOOPS_URL.'/modules/system/style.css" />
+        </head><body>';
+        if (is_object($default[0])) {
+            $tpltpl_handler->loadSource($default[0]);
+            $last_modified = $default[0]->getVar('tpl_lastmodified');
+            $last_imported = $default[0]->getVar('tpl_lastimported');
+            if ($default[0]->getVar('tpl_type') == 'block') {
+                $path = XOOPS_ROOT_PATH.'/modules/'.$default[0]->getVar('tpl_module').'/blocks/'.$default[0]->getVar('tpl_file');
+            } else {
+                $path = XOOPS_ROOT_PATH.'/modules/'.$default[0]->getVar('tpl_module').'/'.$default[0]->getVar('tpl_file');
+            }
+            $colorchange = '';
+            if (!file_exists($path)) {
+                $filemodified_date = _MD_NOFILE;
+                $lastimported_date = _MD_NOFILE;
+            } else {
+                $tpl_modified = filemtime($path);
+                $filemodified_date = formatTimestamp($tpl_modified, 'l');
+                if ($tpl_modified > $last_imported) {
+                    $colorchange = ' bgcolor="#ffCC99"';
+                }
+                $lastimported_date = formatTimestamp($last_imported, 'l');
+            }
+            include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
+            $form = new XoopsThemeForm(_MD_VIEWDEFAULT, 'template_form', 'admin.php');
+            $form->addElement(new XoopsFormTextArea(_MD_FILEHTML, 'html', $default[0]->getVar('tpl_source'), 25));
+            $form->display();
+        } else {
+            echo 'Selected file does not exist';
+        }
+        echo '<div style="text-align:center;">[<a href="#" onclick="javascript:window.close();">'._CLOSE.'</a>]</div></body></html>';
+        break;
+    case 'downloadtpl':
+        $tpltpl_handler =& xoops_gethandler('tplfile');
+        $tpl =& $tpltpl_handler->get($id, true);
+        if (is_object($tpl)) {
+            $output = $tpl->getVar('tpl_source');
+            strlen($output);
+            header('Cache-Control: no-cache, must-revalidate');
+            header('Pragma: no-cache');
+            header('Content-Type: application/force-download');
+            if (preg_match("/MSIE 5.5/", $_SERVER['HTTP_USER_AGENT'])) {
+                header('Content-Disposition: filename='.$tpl->getVar('tpl_file'));
+            } else {
+                header('Content-Disposition: attachment; filename='.$tpl->getVar('tpl_file'));
+            }
+            header('Content-length: '.strlen($output));
+            echo $output;
+        }
+        break;
+    case 'uploadtpl':
+        $tpltpl_handler =& xoops_gethandler('tplfile');
+        $tpl =& $tpltpl_handler->get($id);
+        xoops_cp_header();
+        echo '<a href="admin.php?fct=tplsets">'. _MD_TPLMAIN .'</a>&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;<a href="./admin.php?fct=tplsets&amp;op=listtpl&amp;moddir='.$tpl->getVar('tpl_module').'&amp;tplset='.urlencode($tpl->getVar('tpl_tplset')).'">'.$tpl->getVar('tpl_tplset').'</a>&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;'._MD_UPLOAD.'<br /><br />';
+        if (is_object($tpl)) {
+            include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
+            $form = new XoopsThemeForm(_MD_UPLOAD, 'tplupload_form', 'admin.php');
+            $form->setExtra('enctype="multipart/form-data"');
+            $form->addElement(new XoopsFormLabel(_MD_FILENAME, $tpl->getVar('tpl_file').' ('.$tpl->getVar('tpl_tplset').')'));
+            $form->addElement(new XoopsFormFile(_MD_CHOOSEFILE.'<br /><span style="color:#ff0000;">'._MD_UPWILLREPLACE.'</span>', 'tpl_upload', 200000), true);
+            $form->addElement(new XoopsFormHidden('tpl_id', $id));
+            $form->addElement(new XoopsFormHidden('op', 'uploadtpl_go'));
+            $form->addElement(new XoopsFormHidden('fct', 'tplsets'));
+            $form->addElement(new XoopsFormButton('', 'upload_button', _MD_UPLOAD, 'submit'));
+            $form->display();
+            xoops_cp_footer();
+            exit();
+        } else {
+            echo 'Selected template does not exist';
+        }
+        xoops_cp_footer();
+        break;
+    case 'uploadtpl_go':
+        $tpl_id = !empty($_POST['id']) ? $_POST['id'] : 0;
+        $tpltpl_handler =& xoops_gethandler('tplfile');
+        $tpl =& $tpltpl_handler->get($tpl_id);
+        if (is_object($tpl)) {
+            include_once XOOPS_ROOT_PATH.'/class/uploader.php';
+            $uploader = new XoopsMediaUploader(XOOPS_UPLOAD_PATH, array('text/html', 'application/x-cdf', 'text/plain'), 200000);
+            $uploader->setAllowedExtensions(array('html', 'htm'));
+            $uploader->setPrefix('tmp');
+            if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
+                if (!$uploader->upload()) {
+                    $err = $uploader->getErrors();
+                } else {
+                    $tpl->setVar('tpl_lastmodified', time());
+                    $fp = @fopen($uploader->getSavedDestination(), 'r');
+                    $fsource = @fread($fp, filesize($uploader->getSavedDestination()));
+                    @fclose($fp);
+                    $tpl->setVar('tpl_source', $fsource, true);
+                    @unlink($uploader->getSavedDestination());
+                    if (!$tpltpl_handler->insert($tpl)) {
+                        $err = 'Failed inserting data to database';
+                    } else {
+                        if ($tpl->getVar('tpl_tplset') === $xoopsConfig['template_set']) {
+                            include_once XOOPS_ROOT_PATH.'/class/template.php';
+                            xoops_template_touch($tpl_id, true);
+                        }
+                    }
+                }
+            } else {
+                $err = 'Failed uploading file';
+            }
+            if (isset($err)) {
+                xoops_cp_header(false);
+                xoops_error($err);
+                xoops_cp_footer();
+                exit();
+            }
+            redirect_header('admin.php?fct=tplsets&amp;op=listtpl&amp;moddir='.$tpl->getVar('tpl_module').'&amp;tplset='.urlencode($tpl->getVar('tpl_tplset')), 2, _MD_AM_DBUPDATED);
+        }
+        break;
+    // upload new file
+    case 'uploadtpl2':
+        xoops_cp_header();
+        $moddir = htmlspecialchars($moddir);
+        echo '<a href="admin.php?fct=tplsets">'. _MD_TPLMAIN .'</a>&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;<a href="./admin.php?fct=tplsets&amp;op=listtpl&amp;moddir='.$moddir.'&amp;tplset='.$tplset4url.'">'.$tplset4disp.'</a>&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;'._MD_UPLOAD.'<br /><br />';
+        include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
+        $form = new XoopsThemeForm(_MD_UPLOAD, 'tplupload_form', 'admin.php');
+        $form->setExtra('enctype="multipart/form-data"');
+        $form->addElement(new XoopsFormLabel(_MD_FILENAME, $file));
+        $form->addElement(new XoopsFormFile(_MD_CHOOSEFILE.'<br /><span style="color:#ff0000;">'._MD_UPWILLREPLACE.'</span>', 'tpl_upload', 200000), true);
+        $form->addElement(new XoopsFormHidden('moddir', $moddir));
+        $form->addElement(new XoopsFormHidden('tplset', $tplset4disp));
+        $form->addElement(new XoopsFormHidden('file', $file));
+        $form->addElement(new XoopsFormHidden('type', $type));
+        $form->addElement(new XoopsFormHidden('op', 'uploadtpl2_go'));
+        $form->addElement(new XoopsFormHidden('fct', 'tplsets'));
+        $form->addElement(new XoopsFormButton('', 'ploadtarupload_button', _MD_UPLOAD, 'submit'));
+        $form->display();
+        xoops_cp_footer();
+        break;
+    case 'uploadtpl2_go':
+        $tplset = isset($_POST['tplset']) ? $myts->stripslashesGPC(trim($_POST['tplset'])) : '';
+        include_once XOOPS_ROOT_PATH.'/class/uploader.php';
+        $uploader = new XoopsMediaUploader(XOOPS_UPLOAD_PATH, array('text/html', 'application/x-cdf', 'text/plain'), 200000);
+        $uploader->setAllowedExtensions(array('html', 'htm'));
+        $uploader->setPrefix('tmp');
+        if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
+            if (!$uploader->upload()) {
+                $err = $uploader->getErrors();
+            } else {        
+                $tpltpl_handler =& xoops_gethandler('tplfile');
+                $tplfile =& $tpltpl_handler->find('default', $_POST['type'], null, $_POST['moddir'], $_POST['file']);
+                if (is_array($tplfile)) {
+                    $tpl =& $tplfile[0]->xoopsClone();
+                    $tpl->setVar('tpl_id', 0);
+                    $tpl->setVar('tpl_tplset', $tplset);
+                    $tpl->setVar('tpl_lastmodified', time());
+                    $fp = @fopen($uploader->getSavedDestination(), 'r');
+                    $fsource = @fread($fp, filesize($uploader->getSavedDestination()));
+                    @fclose($fp);
+                    $tpl->setVar('tpl_source', $fsource, true);
+                    @unlink($uploader->getSavedDestination());
+                    if (!$tpltpl_handler->insert($tpl)) {
+                        $err = 'Failed inserting data to database';
+                    } else {
+                        if ($tplset === $xoopsConfig['template_set']) {
+                            include_once XOOPS_ROOT_PATH.'/class/template.php';
+                            xoops_template_touch($tpl->getVar('tpl_id'), true);
+                        }
+                    }
+                } else {
+                    $err = 'This template file does not need to be installed (PHP files using this template file does not exist)';
+                }
+            }
+        } else {
+            $err = 'Failed uploading file';
+        }
+        if (isset($err)) {
+            xoops_cp_header(false);
+            xoops_error($err);
+            xoops_cp_footer();
+            exit();
+        }
+        redirect_header('admin.php?fct=tplsets&amp;op=listtpl&amp;moddir='.$_POST['moddir'].'&amp;tplset='.urlencode($tplset), 2, _MD_AM_DBUPDATED);
+        break;
+    case 'download':
+        if (isset($tplset)) {
+            if (false != extension_loaded('zlib')) {
+                if (isset($_GET['method']) && $_GET['method'] == 'tar') {
+                    if (@function_exists('gzencode')) {
+                        require_once(XOOPS_ROOT_PATH.'/class/tardownloader.php');
+                        $downloader = new XoopsTarDownloader();
+                    }
+                } else {
+                    if (@function_exists('gzcompress')) {
+                        require_once(XOOPS_ROOT_PATH.'/class/zipdownloader.php');
+                        $downloader = new XoopsZipDownloader();
+                    }
+                }
+                $tplset_handler =& xoops_gethandler('tplset');
+                $tplsetobj =& $tplset_handler->getByName($tplset);
+                $xml = "<"."?xml version=\"1.0\"?".">\r\n<tplset>\r\n  <name>".$tplset."</name>\r\n  <dateCreated>".$tplsetobj->getVar('tplset_created')."</dateCreated>\r\n  <credits>\r\n".$tplsetobj->getVar('tplset_credits')."\r\n  </credits>\r\n  <generator>".XOOPS_VERSION."</generator>\r\n  <templates>";
+                $tpltpl_handler =& xoops_gethandler('tplfile');
+                $files =& $tpltpl_handler->getObjects(new Criteria('tpl_tplset', addslashes($tplset)), true);
+                $fcount = count($files);
+                if ($fcount > 0) {
+                    for ($i = 0; $i < $fcount; $i++) {
+                        if ($files[$i]->getVar('tpl_type') == 'block') {
+                            $path = $tplset.'/templates/'.$files[$i]->getVar('tpl_module').'/blocks/'.$files[$i]->getVar('tpl_file');
+                            $xml .= "\r\n    <template name=\"".$files[$i]->getVar('tpl_file')."\">\r\n      <module>".$files[$i]->getVar('tpl_module')."</module>\r\n      <type>block</type>\r\n      <lastModified>".$files[$i]->getVar('tpl_lastmodified')."</lastModified>\r\n    </template>";
+                        } elseif ($files[$i]->getVar('tpl_type') == 'module') {
+                            $path = $tplset.'/templates/'.$files[$i]->getVar('tpl_module').'/'.$files[$i]->getVar('tpl_file');
+                            $xml .= "\r\n    <template name=\"".$files[$i]->getVar('tpl_file')."\">\r\n      <module>".$files[$i]->getVar('tpl_module')."</module>\r\n      <type>module</type>\r\n      <lastModified>".$files[$i]->getVar('tpl_lastmodified')."</lastModified>\r\n    </template>";
+                        }
+                        $downloader->addFileData($files[$i]->getVar('tpl_source'), $path, $files[$i]->getVar('tpl_lastmodified'));
+                    }
+
+                    $xml .= "\r\n  </templates>";
+/*
+                    $xml ." "\r\n  <images>";
+                    $image_handler =& xoops_gethandler('imagesetimg');
+                    $criteria = new CriteriaCompo(new Criteria('l.tplset_name', $tplset));
+                    $criteria->add(new Criteria('s.imgset_refid', 0));
+                    $ifiles =& $image_handler->getObjects($criteria);
+                    $fcount = count($ifiles);
+                    for ($i = 0; $i < $fcount; $i++) {
+                        $dummyimage = XOOPS_CACHE_PATH.'/_dummyimage'.$i.time();
+                        $fp = @fopen($dummyimage, 'wb');
+                        @fwrite($fp, $ifiles[$i]->getVar('imgsetimg_body'));
+                        @fclose($fp);
+                        $downloader->addBinaryFile($dummyimage, $tplset.'/images/'.$ifiles[$i]->getVar('imgsetimg_file'));
+                        @unlink($dummyimage);
+                        $xml .= " \r\n   <image name=\"".$ifiles[$i]->getVar('imgsetimg_file')."\"></image>";
+                    }
+*/
+                }
+                //$xml .= "\r\n  </images>
+                $xml .= "\r\n</tplset>";
+                $downloader->addFileData($xml, $tplset.'/tplset.xml', time());
+                echo $downloader->download($tplset, true);
+            } else {
+                xoops_cp_header();
+                xoops_error(_MD_NOZLIB);
+                xoops_cp_footer();
+            }
+        }
+        break;
+    case 'generatetpl':
+        xoops_cp_header();
+        xoops_token_confirm(array('tplset' => $tplset, 'moddir' => $moddir, 'file' => $file, 'type' => $type, 'op' => 'generatetpl_go', 'fct' => 'tplsets'), 'admin.php', _MD_PLZGENERATE, _MD_GENERATE);
+        xoops_cp_footer();
+        break;
+    case 'generatetpl_go':
+        $tplset = isset($_POST['tplset']) ? $myts->stripslashesGPC(trim($_POST['tplset'])) : '';
+        if(!xoops_confirm_validate()) {
+            redirect_header('admin.php?fct=tplsets',3,'Ticket Error');
+        }
+
+        $tpltpl_handler =& xoops_gethandler('tplfile');
+        $tplfile =& $tpltpl_handler->find('default', $_POST['type'], null, $_POST['moddir'], $_POST['file'], true);
+        if (count($tplfile) > 0) {
+            $newtpl =& $tplfile[0]->xoopsClone();
+            $newtpl->setVar('tpl_id', 0);
+            $newtpl->setVar('tpl_tplset', $tplset);
+            $newtpl->setVar('tpl_lastmodified', time());
+            $newtpl->setVar('tpl_lastimported', 0);
+            if (!$tpltpl_handler->insert($newtpl)) {
+                $err = 'ERROR: Could not insert template <b>'.$tplfile[0]->getVar('tpl_file').'</b> to the database.';
+            } else {
+                if ($tplset === $xoopsConfig['template_set']) {
+                    include_once XOOPS_ROOT_PATH.'/class/template.php';
+                    xoops_template_touch($newtpl->getVar('tpl_id'));
+                }
+            }
+        } else {
+            $err = 'Selected file does not exist)';
+        }
+        if (!isset($err)) {
+            redirect_header('admin.php?fct=tplsets&amp;op=listtpl&amp;moddir='.$newtpl->getVar('tpl_module').'&amp;tplset='.urlencode($newtpl->getVar('tpl_tplset')), 2, _MD_AM_DBUPDATED);
+        }
+        xoops_cp_header();
+        xoops_error($err);
+        echo '<br /><a href="admin.php?fct=tplsets">'._MD_AM_BTOTADMIN.'</a>';
+        xoops_cp_footer();
+        break;
+    case 'generatemod':
+        xoops_cp_header();
+        xoops_token_confirm(array('tplset' => $tplset, 'op' => 'generatemod_go', 'fct' => 'tplsets', 'moddir' => $moddir), 'admin.php', _MD_PLZGENERATE, _MD_GENERATE);
+        xoops_cp_footer();
+        break;
+    case 'generatemod_go':
+        $tplset = isset($_POST['tplset']) ? $myts->stripslashesGPC(trim($_POST['tplset'])) : '';
+        if(!xoops_confirm_validate()) {
+            redirect_header('admin.php?fct=tplsets',3,'Ticket Error');
+        }
+
+        $tpltpl_handler =& xoops_gethandler('tplfile');
+        xoops_cp_header();
+        echo '<code>';
+        $tplfiles =& $tpltpl_handler->find('default', 'module', null, $_POST['moddir'], null, true);
+        $fcount = count($tplfiles);
+        if ($fcount > 0) {
+            echo 'Installing module template files for template set '.htmlspecialchars($tplset, ENT_QUOTES).'...<br />';
+            for ($i = 0; $i < $fcount; $i++) {
+                $newtpl =& $tplfiles[$i]->xoopsClone();
+                $newtpl->setVar('tpl_id', 0);
+                $newtpl->setVar('tpl_tplset', $tplset);
+                $newtpl->setVar('tpl_lastmodified', time());
+                $newtpl->setVar('tpl_lastimported', 0);
+                if (!$tpltpl_handler->insert($newtpl)) {
+                    echo '&nbsp;&nbsp;<span style="color:#ff0000;">ERROR: Could not insert template to the database.</span><br />';
+                } else {
+                    if ($tplset === $xoopsConfig['template_set']) {
+                        include_once XOOPS_ROOT_PATH.'/class/template.php';
+                        xoops_template_touch($newtpl->getVar('tpl_id'));
+                    }
+                    echo '&nbsp;&nbsp;Template <b>'.$tplfiles[$i]->getVar('tpl_file').'</b> added to the database.<br />';
+                }
+            }
+            flush();
+            unset($newtpl);
+        }
+        unset($tplfiles);
+        $tplfiles =& $tpltpl_handler->find('default', 'block', null, $_POST['moddir'], null, true);
+        $fcount = count($tplfiles);
+        if ($fcount > 0) {
+            echo '&nbsp;&nbsp;Installing block template files...<br />';
+            for ($i = 0; $i < $fcount; $i++) {
+                $newtpl =& $tplfiles[$i]->xoopsClone();
+                $newtpl->setVar('tpl_id', 0);
+                $newtpl->setVar('tpl_tplset', $tplset);
+                $newtpl->setVar('tpl_lastmodified', time());
+                $newtpl->setVar('tpl_lastimported', 0);
+                if (!$tpltpl_handler->insert($newtpl)) {
+                    echo '&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#ff0000;">ERROR: Could not insert block template <b>'.$tplfiles[$i]->getVar('tpl_file').'</b> to the database.</span><br />';echo $newtpl->getHtmlErrors();
+                } else {
+                    if ($tplset == $xoopsConfig['template_set']) {
+                        include_once XOOPS_ROOT_PATH.'/class/template.php';
+                        xoops_template_touch($newtpl->getVar('tpl_id'));
+                    }
+                    echo '&nbsp;&nbsp;&nbsp;&nbsp;Block template <b>'.$tplfiles[$i]->getVar('tpl_file').'</b> added to the database.<br />';
+                }
+            }
+            flush();
+            unset($newtpl);
+        }
+        echo '<br />Module template files for template set <b>'.htmlspecialchars($tplset, ENT_QUOTES).'</b> generated and installed.<br /></code><br /><a href="admin.php?fct=tplsets">'._MD_AM_BTOTADMIN.'</a>';
+        xoops_cp_footer();
+        break;
+    case 'uploadtar_go':
+        if(!XoopsSingleTokenHandler::quickValidate('tplsets_uploadtar')) {
+            redirect_header('admin.php?fct=tplsets',3,'Ticket Error');
+        }
+
+        include_once XOOPS_ROOT_PATH.'/class/uploader.php';
+        $uploader = new XoopsMediaUploader(XOOPS_UPLOAD_PATH, array('application/x-gzip', 'application/gzip', 'application/gzip-compressed', 'application/x-gzip-compressed', 'application/x-tar', 'application/x-tar-compressed', 'application/octet-stream'), 1000000);
+        $uploader->setAllowedExtensions(array('tar', 'tar.gz', 'tgz', 'gz'));
+        $uploader->setPrefix('tmp');
+        xoops_cp_header();
+        echo '<code>';
+        if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
+            if (!$uploader->upload()) {
+                xoops_error($uploader->getErrors());
+            } else {
+                include_once XOOPS_ROOT_PATH.'/class/class.tar.php';
+                $tar = new tar();
+                $tar->openTar($uploader->getSavedDestination());
+                @unlink($uploader->getSavedDestination());
+                $themefound = false;
+                foreach ($tar->files as $id => $info) {
+                    $infoarr = explode('/', str_replace("\\", '/', $info['name']));
+                    if (!isset($_POST['tplset_name'])) {
+                        $tplset_name = trim($infoarr[0]);
+                    } else {
+                        $tplset_name = trim($_POST['tplset_name']);
+                        if ($tplset_name === '') {
+                            $tplset_name = trim($infoarr[0]);
+                        }
+                    }
+                    if ($tplset_name !== '') {
+                        break;
+                    }
+                }
+                if ($tplset_name === '') {
+                    echo '<span style="color:#ff0000;">ERROR: Template file not found</span><br />';
+                } elseif  (preg_match('/['.preg_quote('\/:*?"<>|','/').']/', $tplset_name)) {
+                    echo '<span style="color:#ff0000;">ERROR: Invalid Template Set Name</span><br />';
+                } else {
+                    $tplset_handler =& xoops_gethandler('tplset');
+                    if ($tplset_handler->getCount(new Criteria('tplset_name', addslashes($tplset_name))) > 0) {
+                        echo '<span style="color:#ff0000;">ERROR: Template set <b>'.htmlspecialchars($tplset_name, ENT_QUOTES).'</b> already exists.</span><br />';
+                    } else {
+                        $tplset =& $tplset_handler->create();
+                        $tplset->setVar('tplset_name', $tplset_name);
+                        $tplset->setVar('tplset_created', time());
+                        if (!$tplset_handler->insert($tplset)) {
+                            echo '<span style="color:#ff0000;">ERROR: Could not create template set <b>'.htmlspecialchars($tplset_name, ENT_QUOTES).'</b>.</span><br />';
+                        } else {
+                            $tplsetid = $tplset->getVar('tplset_id');
+                            echo 'Template set <b>'.htmlspecialchars($tplset_name, ENT_QUOTES).'</b> created. (ID: <b>'.$tplsetid.'</b>)</span><br />';
+                            $tpltpl_handler = xoops_gethandler('tplfile');
+                            $themeimages = array();
+                            foreach ($tar->files as $id => $info) {
+                                $infoarr = explode('/', str_replace("\\", '/', $info['name']));
+                                if (isset($infoarr[3]) && trim($infoarr[3]) == 'blocks') {
+                                    $default =& $tpltpl_handler->find('default', 'block', null, trim($infoarr[2]), trim($infoarr[4]));
+                                } elseif ((!isset($infoarr[4]) || trim($infoarr[4]) == '') && $infoarr[1] == 'templates') {
+                                    $default =& $tpltpl_handler->find('default', 'module', null, trim($infoarr[2]), trim($infoarr[3]));
+                                } elseif (isset($infoarr[3]) && trim($infoarr[3]) == 'images') {
+                                    $infoarr[2] = trim($infoarr[2]);
+                                    if (preg_match("/(.*)\.(gif|jpg|jpeg|png)$/i", $infoarr[2], $match)) {
+                                        $themeimages[] = array('name' => $infoarr[2], 'content' => $info['file']);
+                                    }
+                                }
+                                if (isset($default) && count($default) > 0) {
+                                    $newtpl =& $default[0]->xoopsClone();
+                                    $newtpl->setVar('tpl_id', 0);
+                                    $newtpl->setVar('tpl_tplset', $tplset_name);
+                                    $newtpl->setVar('tpl_source', $info['file'], true);
+                                    $newtpl->setVar('tpl_lastmodified', time());
+                                    if (!$tpltpl_handler->insert($newtpl)) {
+                                        echo '&nbsp;&nbsp;<span style="color:#ff0000;">ERROR: Could not insert <b>'.$info['name'].'</b> to the database.</span><br />';
+                                    } else {
+                                        echo '&nbsp;&nbsp;<b>'.$info['name'].'</b> inserted to the database.<br />';
+                                    }
+                                    unset($default);
+                                }
+                                unset($info);
+                            }
+                            $icount = count($themeimages);
+                            if ($icount > 0) {
+                                $imageset_handler =& xoops_gethandler('imageset');
+                                $imgset =& $imageset_handler->create();
+                                $imgset->setVar('imgset_name', $tplset_name);
+                                $imgset->setVar('imgset_refid', 0);
+                                if (!$imageset_handler->insert($imgset)) {
+                                    echo '&nbsp;&nbsp;<span style="color:#ff0000;">ERROR: Could not create image set.</span><br />';
+                                } else {
+                                    $newimgsetid = $imgset->getVar('imgset_id');
+                                    echo '&nbsp;&nbsp;Image set <b>'.htmlspecialchars($tplset_name, ENT_QUOTES).'</b> created. (ID: <b>'.$newimgsetid.'</b>)<br />';
+                                    if (!$imageset_handler->linktplset($newimgsetid, $tplset_name)) {
+                                        echo '&nbsp;&nbsp;<span style="color:#ff0000;">ERROR: Failed linking image set to template set <b>'.htmlspecialchars($tplset_name, ENT_QUOTES).'</b></span><br />';
+                                    }
+                                    $image_handler =& xoops_gethandler('imagesetimg');
+                                    for ($i = 0; $i < $icount; $i++) {
+                                        if (isset($themeimages[$i]['name']) && $themeimages[$i]['name'] != '') {
+                                            $image =& $image_handler->create();
+                                            $image->setVar('imgsetimg_file', $themeimages[$i]['name']);
+                                            $image->setVar('imgsetimg_imgset', $newimgsetid);
+                                            $image->setVar('imgsetimg_body', $themeimages[$i]['content'], true);
+                                            if (!$image_handler->insert($image)) {
+                                                echo '&nbsp;&nbsp;<span style="color:#ff0000;">ERROR: Failed storing image file data to database.</span><br />';
+                                            } else {
+                                                echo '&nbsp;&nbsp;Image file data stored into database. (ID: <b>'.$image->getVar('imgsetimg_id').'</b>)<br />';
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        } else {
+            echo '<span style="color:#ff0000;">ERROR: Failed uploading file</span>';
+        }
+        echo '</code><br /><a href="admin.php?fct=tplsets">'._MD_AM_BTOTADMIN.'</a>';
+        xoops_cp_footer();
+        break;
+    case 'previewtpl':
+        $id = isset($_POST['id']) ? intval($_POST['id']) : 0;
+        if ($id <= 0 || !XoopsMultiTokenHandler::quickValidate('tplform')) {
+            redirect_header('admin.php?fct=tplsets',3);
+        }
+        require_once XOOPS_ROOT_PATH.'/class/template.php';
+        $html = !empty($_POST['html']) ? $myts->stripSlashesGPC($_POST['html']) : '';
+        $tpltpl_handler =& xoops_gethandler('tplfile');
+        $tplfile =& $tpltpl_handler->get($id, true);
+        $xoopsTpl = new XoopsTpl();
+
+        if (is_object($tplfile)) {
+            $moddir = $_POST['moddir'];
+            $dummylayout = '<html><head><meta http-equiv="content-type" content="text/html; charset='._CHARSET.'" /><meta http-equiv="content-language" content="'._LANGCODE.'" /><title>'.htmlspecialchars($xoopsConfig['sitename']).'</title><style type="text/css" media="all">';
+            $css =& $tpltpl_handler->find($xoopsConfig['template_set'], 'css', 0, null, null, true);
+            $csscount = count($css);
+            for ($i = 0; $i < $csscount; $i++) {
+                $dummylayout .= "\n".$css[$i]->getVar('tpl_source');
+            }
+            $dummylayout .= "\n".'</style></head><body><{$content}></body></html>';
+            if ($tplfile->getVar('tpl_type') == 'block') {
+                include_once XOOPS_ROOT_PATH.'/class/xoopsblock.php';
+                $block = new XoopsBlock($tplfile->getVar('tpl_refid'));
+                $xoopsTpl->assign('block', $block->buildBlock());
+            }
+            $dummytpl = '_dummytpl_'.time().'.html';
+            $fp = fopen(XOOPS_CACHE_PATH.'/'.$dummytpl, 'w');
+            fwrite($fp, $html);
+            fclose($fp);
+            $xoopsTpl->assign('content', $xoopsTpl->fetch('file:'.XOOPS_CACHE_PATH.'/'.$dummytpl));
+            $xoopsTpl->clear_compiled_tpl('file:'.XOOPS_CACHE_PATH.'/'.$dummytpl);
+            unlink(XOOPS_CACHE_PATH.'/'.$dummytpl);
+            $dummyfile = '_dummy_'.time().'.html';
+            $fp = fopen(XOOPS_CACHE_PATH.'/'.$dummyfile, 'w');
+            fwrite($fp, $dummylayout);
+            fclose($fp);
+            $tplset= $tplfile->getVar('tpl_tplset');
+            $tform = array('tpl_tplset' => $tplset, 'tpl_id' => $id, 'tpl_file' => $tplfile->getVar('tpl_file'), 'tpl_desc' => $tplfile->getVar('tpl_desc'), 'tpl_lastmodified' => $tplfile->getVar('tpl_lastmodified'), 'tpl_source' => htmlspecialchars($html, ENT_QUOTES), 'tpl_module' => $moddir);
+            include_once XOOPS_ROOT_PATH.'/modules/system/admin/tplsets/tplform.php';
+            xoops_cp_header();
+            echo '<a href="admin.php?fct=tplsets">'. _MD_TPLMAIN .'</a>&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;<a href="./admin.php?fct=tplsets&amp;op=listtpl&amp;moddir='.$moddir.'&amp;tplset='.urlencode($tplset).'">'.htmlspecialchars($tplset, ENT_QUOTES).'</a>&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;'._MD_EDITTEMPLATE.'<br /><br />';
+            $form->display();
+            xoops_cp_footer();
+            echo '<script type="text/javascript">
+            <!--//
+            preview_window = openWithSelfMain("", "xoops_system_template_preview", 680, 450, true);
+            ';
+            $lines = preg_split("/(\r\n|\r|\n)( *)/", $xoopsTpl->fetch('file:'.XOOPS_CACHE_PATH.'/'.$dummyfile));
+            $xoopsTpl->clear_compiled_tpl('file:'.XOOPS_CACHE_PATH.'/'.$dummyfile);
+            unlink(XOOPS_CACHE_PATH.'/'.$dummyfile);
+            foreach ($lines as $line) {
+                echo 'preview_window.document.writeln("'.str_replace('"', '\"', $line).'");';
+            }
+            echo '
+            preview_window.document.close();
+            //-->
+            </script>';
+
+        }
+        break;
+    case 'update':
+         if (!XoopsMultiTokenHandler::quickValidate('tplsets_update')) {
+            redirect_header('admin.php?fct=tplsets',3,'Ticket Error');
+        }
+        $tplset = isset($_POST['tplset']) ? $myts->stripslashesGPC(trim($_POST['tplset'])) : '';
+        $moddir = $_POST['moddir'];
+        include_once XOOPS_ROOT_PATH.'/class/uploader.php';
+        $uploader = new XoopsMediaUploader(XOOPS_UPLOAD_PATH, array('text/html', 'application/x-cdf'), 200000);
+        $uploader->setAllowedExtensions(array('html', 'htm'));
+        $uploader->setPrefix('tmp');
+        $msg = array();
+        foreach ($_POST['xoops_upload_file'] as $upload_file) {
+            // '.' is converted to '_' when upload
+            $upload_file2 = str_replace('.', '_', $upload_file);
+            if ($uploader->fetchMedia($upload_file2)) {
+                if (!$uploader->upload()) {
+                    $msg[] = $uploader->getErrors();
+                } else {
+                    $tpltpl_handler =& xoops_gethandler('tplfile');
+                    if (empty($_POST['old_template'][$upload_file])) {
+                        $tplfile =& $tpltpl_handler->find('default', null, null, $moddir, $upload_file);
+                        if (count($tplfile) > 0) {
+                            $tpl =& $tplfile[0]->xoopsClone();
+                            $tpl->setVar('tpl_id', 0);
+                            $tpl->setVar('tpl_tplset', $tplset);
+                        } else {
+                            $msg[] = 'Template file <b>'.$upload_file.'</b> does not need to be installed (PHP files using this template file does not exist)';
+                            continue;
+                        }
+                    } else {
+                        $tpl =& $tpltpl_handler->get($_POST['old_template'][$upload_file]);
+                    }
+                    $tpl->setVar('tpl_lastmodified', time());
+                    $fp = @fopen($uploader->getSavedDestination(), 'r');
+                    $fsource = @fread($fp, filesize($uploader->getSavedDestination()));
+                    @fclose($fp);
+                    $tpl->setVar('tpl_source', $fsource, true);
+                    @unlink($uploader->getSavedDestination());
+                    if (!$tpltpl_handler->insert($tpl)) {
+                        $msg[] = 'Failed inserting data for '.$upload_file.' to database';
+                    } else {
+                        $msg[] = 'Template file <b>'.$upload_file.'</b> updated.';
+                        if ($tplset === $xoopsConfig['template_set']) {
+                            include_once XOOPS_ROOT_PATH.'/class/template.php';
+                            if (xoops_template_touch($tpl->getVar('tpl_id'), true)) {
+                                $msg[] = 'Template file <b>'.$upload_file.'</b> compiled.';
+                            }
+
+                        }
+                    }
+                }
+            } else {
+                if ($uploader->getMediaName() == '') {
+                    continue;
+                } else {
+                    $msg[] = $uploader->getErrors();
+                }
+            }
+        }
+        xoops_cp_header();
+        echo '<code>';
+        foreach ($msg as $m) {
+            echo $m.'<br />';
+        }
+        echo '</code><br /><a href="admin.php?fct=tplsets&amp;op=listtpl&amp;tplset='.urlencode($tplset).'&amp;moddir='.$moddir.'">'._MD_AM_BTOTADMIN.'</a>';
+        xoops_cp_footer();
+        break;
+    case 'importtpl':
+        xoops_cp_header();
+        if (!empty($id)) {
+            xoops_confirm(array('tplset' => $tplset, 'moddir' => $moddir, 'id' => $id, 'op' => 'importtpl_go', 'fct' => 'tplsets'), 'admin.php', _MD_RUSUREIMPT, _MD_IMPORT);
+        } elseif (isset($file)) {
+            xoops_confirm(array('tplset' => $tplset, 'moddir' => $moddir, 'file' => $file, 'op' => 'importtpl_go', 'fct' => 'tplsets'), 'admin.php', _MD_RUSUREIMPT, _MD_IMPORT);
+        }
+        xoops_cp_footer();
+        break;
+    case 'importtpl_go':
+        if (!xoops_confirm_validate()) {
+            redirect_header('admin.php?fct=tplsets',3,'Ticket Error');
+        }
+        $tplset = isset($_POST['tplset']) ? $myts->stripslashesGPC(trim($_POST['tplset'])) : '';
+        $moddir = $_POST['moddir'];
+        $id = !empty($_POST['id']) ? intval($_POST['id']) : 0;
+        $file = !empty($_POST['file']) ? $_POST['file'] : null;
+        $tpltpl_handler =& xoops_gethandler('tplfile');
+        $tplfile = '';
+        if (!empty($id)) {
+            $tplfile =& $tpltpl_handler->get($id, true);
+        } else {
+            $tplfiles =& $tpltpl_handler->find('default', null, null, null, $file, true);
+            $tplfile = (count($tplfiles) > 0) ? $tplfiles[0] : '';
+        }
+        $error = true;
+        if (is_object($tplfile)) {
+            switch ($tplfile->getVar('tpl_type')) {
+                case 'module':
+                    $filepath = XOOPS_THEME_PATH.'/'.$tplset.'/templates/'.$tplfile->getVar('tpl_module').'/'.$tplfile->getVar('tpl_file');
+                    break;
+                case 'block':
+                    $filepath = XOOPS_THEME_PATH.'/'.$tplset.'/templates/'.$tplfile->getVar('tpl_module').'/blocks/'.$tplfile->getVar('tpl_file');
+                    break;
+                default:
+                    break;
+            }
+            if (file_exists($filepath)) {
+                if (false != $fp = fopen($filepath, 'r')) {
+                    $filesource = fread($fp, filesize($filepath));
+                    fclose($fp);
+                    $tplfile->setVar('tpl_source', $filesource, true);
+                    $tplfile->setVar('tpl_tplset', $tplset);
+                    $tplfile->setVar('tpl_lastmodified', time());
+                    $tplfile->setVar('tpl_lastimported', time());
+                    if (!$tpltpl_handler->insert($tplfile)) {
+                    } else {
+                        $error = false;
+                    }
+                }
+            }
+        }
+        if (false != $error) {
+            xoops_cp_header();
+            xoops_error('Could not import file '.$filepath);
+            echo '<br /><a href="admin.php?fct=tplsets&amp;op=listtpl&amp;tplset='.urlencode($tplset).'&amp;moddir='.$moddir.'">'._MD_AM_BTOTADMIN.'</a>';
+            xoops_cp_footer();
+            exit();
+        }
+        redirect_header('admin.php?fct=tplsets&amp;op=listtpl&amp;moddir='.$tplfile->getVar('tpl_module').'&amp;tplset='.urlencode($tplfile->getVar('tpl_tplset')), 2, _MD_AM_DBUPDATED);
+        break;
+    default:
+        break;
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/avatars/xoops_version.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/avatars/xoops_version.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/avatars/xoops_version.php	(revision 405)
@@ -0,0 +1,45 @@
+<?php
+// $Id: xoops_version.php,v 1.2 2005/03/18 12:52:38 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+$modversion['name'] = _MD_AM_AVATARS;
+$modversion['version'] = "";
+$modversion['description'] = "XOOPS Site Avatar Manager";
+$modversion['author'] = "";
+$modversion['credits'] = "The XOOPS Project";
+$modversion['help'] = "images.html";
+$modversion['license'] = "GPL see LICENSE";
+$modversion['official'] = 1;
+$modversion['image'] = "avatars.gif";
+
+$modversion['hasAdmin'] = 1;
+$modversion['adminpath'] = "admin.php?fct=avatars";
+$modversion['category'] = XOOPS_SYSTEM_AVATAR;
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/avatars/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/avatars/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/avatars/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/avatars/main.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/avatars/main.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/avatars/main.php	(revision 405)
@@ -0,0 +1,244 @@
+<?php
+// $Id: main.php,v 1.4 2005/08/03 12:39:15 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+if ( !is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid()) ) {
+    exit("Access Denied");
+} else {
+    $op = 'list';
+    if (isset($_GET['op'])) {
+        $op = trim($_GET['op']);
+    } elseif (isset($_POST['op'])) {
+        $op = trim($_POST['op']);
+    }
+    if ($op == 'list') {
+        xoops_cp_header();
+        echo '<h4 style="text-align:left">'._MD_AVATARMAN.'</h4>';
+        $avt_handler =& xoops_gethandler('avatar');
+        $savatar_count = $avt_handler->getCount(new Criteria('avatar_type', 'S'));
+        $cavatar_count = $avt_handler->getCount(new Criteria('avatar_type', 'C'));
+        echo '<ul><li>'._MD_SYSAVATARS.' ('.sprintf(_NUMIMAGES, '<b>'.$savatar_count.'</b>').') [<a href="admin.php?fct=avatars&amp;op=listavt&amp;type=S">'._LIST.'</a>]</li><li>'._MD_CSTAVATARS.' ('.sprintf(_NUMIMAGES, '<b>'.$cavatar_count.'</b>').') [<a href="admin.php?fct=avatars&amp;op=listavt&amp;type=C">'._LIST.'</a>]</li></ul>';
+        include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
+        $form = new XoopsThemeForm(_MD_ADDAVT, 'avatar_form', 'admin.php');
+        $form->setExtra('enctype="multipart/form-data"');
+        $form->addElement(new XoopsFormToken(XoopsMultiTokenHandler::quickCreate('avatars_addfile')));
+        $form->addElement(new XoopsFormText(_IMAGENAME, 'avatar_name', 50, 255), true);
+        $form->addElement(new XoopsFormFile(_IMAGEFILE, 'avatar_file', 500000));
+        $form->addElement(new XoopsFormText(_IMGWEIGHT, 'avatar_weight', 3, 4, 0));
+        $form->addElement(new XoopsFormRadioYN(_IMGDISPLAY, 'avatar_display', 1, _YES, _NO));
+        $form->addElement(new XoopsFormHidden('op', 'addfile'));
+        $form->addElement(new XoopsFormHidden('fct', 'avatars'));
+        $form->addElement(new XoopsFormButton('', 'avt_button', _SUBMIT, 'submit'));
+        $form->display();
+        xoops_cp_footer();
+        exit();
+    }
+
+    if ($op == 'listavt') {
+        $avt_handler =& xoops_gethandler('avatar');
+        xoops_cp_header();
+        $type = (isset($_GET['type']) && $_GET['type'] == 'C') ? 'C' : 'S';
+        echo '<a href="admin.php?fct=avatars">'. _MD_AVATARMAN .'</a>&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;';
+        if ($type == 'S') {
+            echo _MD_SYSAVATARS;
+        } else {
+            echo _MD_CSTAVATARS;
+        }
+        echo '<br /><br />';
+        $criteria = new Criteria('avatar_type', $type);
+        $avtcount = $avt_handler->getCount($criteria);
+        $start = isset($_GET['start']) ? intval($_GET['start']) : 0;
+        $criteria->setStart($start);
+        $criteria->setLimit(10);
+        $avatars =& $avt_handler->getObjects($criteria, true);
+
+        $token =& XoopsMultiTokenHandler::quickCreate('avatars_save');
+
+        if ($type == 'S') {
+            foreach (array_keys($avatars) as $i) {
+                echo '<form action="admin.php" method="post">';
+                echo $token->getHtml();
+                $id = $avatars[$i]->getVar('avatar_id');
+                echo '<table class="outer" cellspacing="1" width="100%"><tr><td align="center" width="30%" rowspan="6"><img src="'.XOOPS_UPLOAD_URL.'/'.$avatars[$i]->getVar('avatar_file').'" alt="" /></td><td class="head">'._IMAGENAME,'</td><td class="even"><input type="hidden" name="avatar_id[]" value="'.$id.'" /><input type="text" name="avatar_name[]" value="'.$avatars[$i]->getVar('avatar_name', 'E').'" size="20" maxlength="255" /></td></tr><tr><td class="head">'._IMAGEMIME.'</td><td class="odd">'.$avatars[$i]->getVar('avatar_mimetype').'</td></tr><tr><td class="head">'._MD_USERS.'</td><td class="even">'.$avatars[$i]->getUserCount().'</td></tr><tr><td class="head">'._IMGWEIGHT.'</td><td class="odd"><input type="text" name="avatar_weight[]" value="'.$avatars[$i]->getVar('avatar_weight').'" size="3" maxlength="4" /></td></tr><tr><td class="head">'._IMGDISPLAY.'</td><td class="even"><input type="checkbox" name="avatar_display[]" value="1"';
+                if ($avatars[$i]->getVar('avatar_display') == 1) {
+                    echo ' checked="checked"';
+                }
+                echo ' /></td></tr><tr><td class="head">&nbsp;</td><td class="even"><a href="admin.php?fct=avatars&amp;op=delfile&amp;avatar_id='.$id.'">'._DELETE.'</a></td></tr></table><br />';
+            }
+        } else {
+            foreach (array_keys($avatars) as $i) {
+                echo '<table cellspacing="1" class="outer" width="100%"><tr><td width="30%" rowspan="6" align="center"><img src="'.XOOPS_UPLOAD_URL.'/'.$avatars[$i]->getVar('avatar_file').'" alt="" /></td><td class="head">'._IMAGENAME,'</td><td class="even"><a href="'.XOOPS_URL.'/userinfo.php?uid=';
+                $userids =& $avt_handler->getUser($avatars[$i]);
+                echo $userids[0].'">'.$avatars[$i]->getVar('avatar_name').'</a></td></tr><tr><td class="head">'._IMAGEMIME.'</td><td class="odd">'.$avatars[$i]->getVar('avatar_mimetype').'</td></tr><tr><td class="head">&nbsp;</td><td align="center" class="even"><a href="admin.php?fct=avatars&amp;op=delfile&amp;avatar_id='.$avatars[$i]->getVar('avatar_id').'&amp;user_id='.$userids[0].'">'._DELETE.'</a></td></tr></table><br />';
+            }
+        }
+        if ($avtcount > 0) {
+            if ($avtcount > 10) {
+                include_once XOOPS_ROOT_PATH.'/class/pagenav.php';
+                $nav = new XoopsPageNav($avtcount, 10, $start, 'start', 'fct=avatars&amp;type='.$type.'&amp;op=listavt');
+                echo '<div style="text-align:right;">'.$nav->renderImageNav().'</div>';
+            }
+            if ($type == 'S') {
+                echo '<div style="text-align:center;"><input type="hidden" name="op" value="save" /><input type="hidden" name="fct" value="avatars" /><input type="submit" name="submit" value="'._SUBMIT.'" /></div></form>';
+            }
+        }
+        xoops_cp_footer();
+        exit();
+    }
+
+    if ($op == 'save') {
+        if(!XoopsMultiTokenHandler::quickValidate('avatars_save')) {
+            xoops_cp_header();
+            xoops_error('Ticket Error');
+            xoops_cp_footer();
+            exit();
+        }
+
+        $count = count($_POST['avatar_id']);
+        if ($count > 0) {
+            $avt_handler =& xoops_gethandler('avatar');
+            $error = array();
+            for ($i = 0; $i < $count; $i++) {
+                $avatar =& $avt_handler->get($_POST['avatar_id'][$i]);
+                if (!is_object($avatar)) {
+                    $error[] = sprintf(_FAILGETIMG, $_POST['avatar_id'][$i]);
+                    continue;
+                }
+                $avatar_display[$i] = empty($_POST['avatar_display'][$i]) ? 0 : 1;
+                $avatar->setVar('avatar_display', $avatar_display[$i]);
+                $avatar->setVar('avatar_weight', $_POST['avatar_weight'][$i]);
+                $avatar->setVar('avatar_name', $_POST['avatar_name'][$i]);
+                if (!$avt_handler->insert($avatar)) {
+                    $error[] = sprintf(_FAILSAVEIMG, $_POST['avatar_id'][$i]);
+                }
+                unset($avatar_id[$i]);
+                unset($avatar_name[$i]);
+                unset($avatar_weight[$i]);
+                unset($avatar_display[$i]);
+            }
+            if (count($error) > 0) {
+                xoops_cp_header();
+                foreach ($error as $err) {
+                    echo $err.'<br />';
+                }
+                xoops_cp_footer();
+                exit();
+            }
+        }
+        redirect_header('admin.php?fct=avatars',2,_MD_AM_DBUPDATED);
+    }
+
+    if ($op == 'addfile') {
+        if(!XoopsMultiTokenHandler::quickValidate('avatars_addfile')) {
+            xoops_cp_header();
+            xoops_error('Ticket Error');
+            xoops_cp_footer();
+            exit();
+        }
+
+        include_once XOOPS_ROOT_PATH.'/class/uploader.php';
+        $uploader = new XoopsMediaUploader(XOOPS_UPLOAD_PATH, array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/x-png', 'image/png'), 500000);
+        $uploader->setAllowedExtensions(array('gif', 'jpeg', 'jpg', 'png'));
+        $uploader->setPrefix('savt');
+        $err = array();
+        $ucount = count($_POST['xoops_upload_file']);
+        for ($i = 0; $i < $ucount; $i++) {
+            if ($uploader->fetchMedia($_POST['xoops_upload_file'][$i])) {
+                if (!$uploader->upload()) {
+                    $err[] = $uploader->getErrors();
+                } else {
+                    $avt_handler =& xoops_gethandler('avatar');
+                    $avatar =& $avt_handler->create();
+                    $avatar->setVar('avatar_file', $uploader->getSavedFileName());
+                    $avatar->setVar('avatar_name', $_POST['avatar_name']);
+                    $avatar->setVar('avatar_mimetype', $uploader->getMediaType());
+                    $avatar_display = empty($_POST['avatar_display']) ? 0 : 1;
+                    $avatar->setVar('avatar_display', $avatar_display);
+                    $avatar->setVar('avatar_weight', $_POST['avatar_weight']);
+                    $avatar->setVar('avatar_type', 'S');
+                    if (!$avt_handler->insert($avatar)) {
+                        $err[] = sprintf(_FAILSAVEIMG, $avatar->getVar('avatar_name'));
+                    }
+                }
+            } else {
+                $err[] = sprintf(_FAILFETCHIMG, $i);
+            }
+        }
+        if (count($err) > 0) {
+            xoops_cp_header();
+            xoops_error($err);
+            xoops_cp_footer();
+            exit();
+        }
+        redirect_header('admin.php?fct=avatars',2,_MD_AM_DBUPDATED);
+    }
+
+    if ($op == 'delfile') {
+        xoops_cp_header();
+        $user_id = isset($_GET['user_id']) ? intval($_GET['user_id']) : 0;
+        xoops_token_confirm(array('op' => 'delfileok', 'avatar_id' => intval($_GET['avatar_id']), 'fct' => 'avatars', 'user_id' => $user_id), 'admin.php', _MD_RUDELIMG);
+        xoops_cp_footer();
+        exit();
+    }
+
+    if ($op == 'delfileok') {
+        if(!xoops_confirm_validate()) {
+            xoops_cp_header();
+            xoops_error("Ticket Error");
+            xoops_cp_footer();
+            exit();
+        }
+
+        $avatar_id = intval($_POST['avatar_id']);
+        if ($avatar_id <= 0) {
+            redirect_header('admin.php?fct=avatars',1);
+        }
+        $avt_handler = xoops_gethandler('avatar');
+        $avatar =& $avt_handler->get($avatar_id);
+        if (!is_object($avatar)) {
+            redirect_header('admin.php?fct=avatars',1);
+        }
+        if (!$avt_handler->delete($avatar)) {
+            xoops_cp_header();
+            xoops_error(sprintf(_MD_FAILDEL, $avatar->getVar('avatar_id')));
+            xoops_cp_footer();
+            exit();
+        }
+        $file = $avatar->getVar('avatar_file');
+        @unlink(XOOPS_UPLOAD_PATH.'/'.$file);
+        if (isset($user_id) && $avatar->getVar('avatar_type') == 'C') {
+            $xoopsDB->query("UPDATE ".$xoopsDB->prefix('users')." SET user_avatar='blank.gif' WHERE uid=".intval($user_id));
+        } else {
+            $xoopsDB->query("UPDATE ".$xoopsDB->prefix('users')." SET user_avatar='blank.gif' WHERE user_avatar='".$file."'");
+        }
+        redirect_header('admin.php?fct=avatars',2,_MD_AM_DBUPDATED);
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/preferences/xoops_version.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/preferences/xoops_version.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/preferences/xoops_version.php	(revision 405)
@@ -0,0 +1,45 @@
+<?php
+// $Id: xoops_version.php,v 1.2 2005/03/18 12:52:38 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+$modversion['name'] = _MD_AM_PREF;
+$modversion['version'] = "";
+$modversion['description'] = "XOOPS Site Preferences";
+$modversion['author'] = "";
+$modversion['credits'] = "The XOOPS Project";
+$modversion['help'] = "preferences.html";
+$modversion['license'] = "GPL see LICENSE";
+$modversion['official'] = 1;
+$modversion['image'] = "pref.gif";
+
+$modversion['hasAdmin'] = 1;
+$modversion['adminpath'] = "admin.php?fct=preferences";
+$modversion['category'] = XOOPS_SYSTEM_PREF;
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/preferences/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/preferences/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/preferences/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/preferences/main.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/preferences/main.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/preferences/main.php	(revision 405)
@@ -0,0 +1,450 @@
+<?php
+// $Id: main.php,v 1.6 2006/05/01 02:37:30 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+if ( !is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid()) ) {
+    exit("Access Denied");
+} else {
+    $op = 'list';
+    if (isset($_GET['op'])) {
+        $op = trim($_GET['op']);
+    } elseif (isset($_POST['op'])) {
+        $op = $_POST['op'];
+    }
+    if (isset($_GET['confcat_id'])) {
+        $confcat_id = intval($_GET['confcat_id']);
+    }
+    if ($op == 'list') {
+        $confcat_handler =& xoops_gethandler('configcategory');
+        $confcats =& $confcat_handler->getObjects();
+        $catcount = count($confcats);
+        xoops_cp_header();
+        echo '<h4 style="text-align:left">'._MD_AM_SITEPREF.'</h4><ul>';
+        for ($i = 0; $i < $catcount; $i++) {
+            echo '<li>'.constant($confcats[$i]->getVar('confcat_name')).' [<a href="admin.php?fct=preferences&amp;op=show&amp;confcat_id='.$confcats[$i]->getVar('confcat_id').'">'._EDIT.'</a>]</li>';
+        }
+        echo '</ul>';
+        xoops_cp_footer();
+        exit();
+    }
+
+    if ($op == 'show') {
+        if (empty($confcat_id)) {
+            $confcat_id = 1;
+        }
+        $confcat_handler =& xoops_gethandler('configcategory');
+        $confcat =& $confcat_handler->get($confcat_id);
+        if (!is_object($confcat)) {
+            redirect_header('admin.php?fct=preferences', 1);
+        }
+        include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
+        include_once XOOPS_ROOT_PATH.'/class/xoopslists.php';
+        $form = new XoopsThemeForm(constant($confcat->getVar('confcat_name')), 'pref_form', 'admin.php?fct=preferences');
+        $form->addElement(new XoopsFormToken(XoopsMultiTokenHandler::quickCreate('preferences')));
+        $config_handler =& xoops_gethandler('config');
+        $criteria = new CriteriaCompo();
+        $criteria->add(new Criteria('conf_modid', 0));
+        $criteria->add(new Criteria('conf_catid', $confcat_id));
+        $config =& $config_handler->getConfigs($criteria);
+        $confcount = count($config);
+        for ($i = 0; $i < $confcount; $i++) {
+            $title = (!defined($config[$i]->getVar('conf_desc')) || constant($config[$i]->getVar('conf_desc')) == '') ? constant($config[$i]->getVar('conf_title')) : constant($config[$i]->getVar('conf_title')).'<br /><br /><span style="font-weight:normal;">'.constant($config[$i]->getVar('conf_desc')).'</span>';
+            switch ($config[$i]->getVar('conf_formtype')) {
+            case 'textarea':
+                $myts =& MyTextSanitizer::getInstance();
+                if ($config[$i]->getVar('conf_valuetype') == 'array') {
+                    // this is exceptional.. only when value type is arrayneed a smarter way for this
+                    $ele = ($config[$i]->getVar('conf_value') != '') ? new XoopsFormTextArea($title, $config[$i]->getVar('conf_name'), $myts->htmlspecialchars(implode('|', $config[$i]->getConfValueForOutput())), 5, 50) : new XoopsFormTextArea($title, $config[$i]->getVar('conf_name'), '', 5, 50);
+                } else {
+                    $ele = new XoopsFormTextArea($title, $config[$i]->getVar('conf_name'), $myts->htmlspecialchars($config[$i]->getConfValueForOutput()), 5, 50);
+                }
+                break;
+            case 'select':
+                $ele = new XoopsFormSelect($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput());
+                $options =& $config_handler->getConfigOptions(new Criteria('conf_id', $config[$i]->getVar('conf_id')));
+                $opcount = count($options);
+                for ($j = 0; $j < $opcount; $j++) {
+                    $optval = defined($options[$j]->getVar('confop_value')) ? constant($options[$j]->getVar('confop_value')) : $options[$j]->getVar('confop_value');
+                    $optkey = defined($options[$j]->getVar('confop_name')) ? constant($options[$j]->getVar('confop_name')) : $options[$j]->getVar('confop_name');
+                    $ele->addOption($optval, $optkey);
+                }
+                break;
+            case 'select_multi':
+                $ele = new XoopsFormSelect($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput(), 5, true);
+                $options =& $config_handler->getConfigOptions(new Criteria('conf_id', $config[$i]->getVar('conf_id')));
+                $opcount = count($options);
+                for ($j = 0; $j < $opcount; $j++) {
+                    $optval = defined($options[$j]->getVar('confop_value')) ? constant($options[$j]->getVar('confop_value')) : $options[$j]->getVar('confop_value');
+                    $optkey = defined($options[$j]->getVar('confop_name')) ? constant($options[$j]->getVar('confop_name')) : $options[$j]->getVar('confop_name');
+                    $ele->addOption($optval, $optkey);
+                }
+                break;
+            case 'yesno':
+                $ele = new XoopsFormRadioYN($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput(), _YES, _NO);
+                break;
+            case 'theme':
+            case 'theme_multi':
+                $ele = ($config[$i]->getVar('conf_formtype') != 'theme_multi') ? new XoopsFormSelect($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput()) : new XoopsFormSelect($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput(), 5, true);
+                $handle = opendir(XOOPS_THEME_PATH.'/');
+                $dirlist = array();
+                while (false !== ($file = readdir($handle))) {
+                    if (is_dir(XOOPS_THEME_PATH.'/'.$file) && !preg_match("/^\..*$/",$file) && strtolower($file) != 'cvs') {
+                        $dirlist[$file]=$file;
+                    }
+                }
+                closedir($handle);
+                if (!empty($dirlist)) {
+                    asort($dirlist);
+                    $ele->addOptionArray($dirlist);
+                }
+                //$themeset_handler =& xoops_gethandler('themeset');
+                //$themesetlist =& $themeset_handler->getList();
+                //asort($themesetlist);
+                //foreach ($themesetlist as $key => $name) {
+                //  $ele->addOption($key, $name.' ('._MD_AM_THEMESET.')');
+                //}
+                // old theme value is used to determine whether to update cache or not. kind of dirty way
+                $form->addElement(new XoopsFormHidden('_old_theme', $config[$i]->getConfValueForOutput()));
+                break;
+            case 'tplset':
+                $ele = new XoopsFormSelect($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput());
+                $tplset_handler =& xoops_gethandler('tplset');
+                $tplsetlist =& $tplset_handler->getList();
+                asort($tplsetlist);
+                foreach ($tplsetlist as $key => $name) {
+                    $ele->addOption($key, htmlspecialchars($name, ENT_QUOTES));
+                }
+                // old theme value is used to determine whether to update cache or not. kind of dirty way
+                $form->addElement(new XoopsFormHidden('_old_theme', $config[$i]->getConfValueForOutput()));
+                break;
+            case 'timezone':
+                $ele = new XoopsFormSelectTimezone($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput());
+                break;
+            case 'language':
+                $ele = new XoopsFormSelectLang($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput());
+                break;
+            case 'startpage':
+                $ele = new XoopsFormSelect($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput());
+                $module_handler =& xoops_gethandler('module');
+                $criteria = new CriteriaCompo(new Criteria('hasmain', 1));
+                $criteria->add(new Criteria('isactive', 1));
+                $moduleslist =& $module_handler->getList($criteria, true);
+                $moduleslist['--'] = _MD_AM_NONE;
+                $ele->addOptionArray($moduleslist);
+                break;
+            case 'group':
+                $ele = new XoopsFormSelectGroup($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput(), 1, false);
+                break;
+            case 'group_multi':
+                $ele = new XoopsFormSelectGroup($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput(), 5, true);
+                break;
+            // RMV-NOTIFY - added 'user' and 'user_multi'
+            case 'user':
+                $ele = new XoopsFormSelectUser($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput(), 1, false);
+                break;
+            case 'user_multi':
+                $ele = new XoopsFormSelectUser($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput(), 5, true);
+                break;
+            case 'module_cache':
+                $module_handler =& xoops_gethandler('module');
+                $modules =& $module_handler->getObjects(new Criteria('hasmain', 1), true);
+                $currrent_val = $config[$i]->getConfValueForOutput();
+                $cache_options = array('0' => _NOCACHE, '30' => sprintf(_SECONDS, 30), '60' => _MINUTE, '300' => sprintf(_MINUTES, 5), '1800' => sprintf(_MINUTES, 30), '3600' => _HOUR, '18000' => sprintf(_HOURS, 5), '86400' => _DAY, '259200' => sprintf(_DAYS, 3), '604800' => _WEEK);
+                if (count($modules) > 0) {
+                    $ele = new XoopsFormElementTray($title, '<br />');
+                    foreach (array_keys($modules) as $mid) {
+                        $c_val = isset($currrent_val[$mid]) ? intval($currrent_val[$mid]) : null;
+                        $selform = new XoopsFormSelect($modules[$mid]->getVar('name'), $config[$i]->getVar('conf_name')."[$mid]", $c_val);
+                        $selform->addOptionArray($cache_options);
+                        $ele->addElement($selform);
+                        unset($selform);
+                    }
+                } else {
+                    $ele = new XoopsFormLabel($title, _MD_AM_NOMODULE);
+                }
+                break;
+            case 'site_cache':
+                $ele = new XoopsFormSelect($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput());
+                $ele->addOptionArray(array('0' => _NOCACHE, '30' => sprintf(_SECONDS, 30), '60' => _MINUTE, '300' => sprintf(_MINUTES, 5), '1800' => sprintf(_MINUTES, 30), '3600' => _HOUR, '18000' => sprintf(_HOURS, 5), '86400' => _DAY, '259200' => sprintf(_DAYS, 3), '604800' => _WEEK));
+                break;
+            case 'password':
+                $myts =& MyTextSanitizer::getInstance();
+                $ele = new XoopsFormPassword($title, $config[$i]->getVar('conf_name'), 50, 255, $myts->htmlspecialchars($config[$i]->getConfValueForOutput()));
+                break;
+            case 'textbox':
+            default:
+                $myts =& MyTextSanitizer::getInstance();
+                $ele = new XoopsFormText($title, $config[$i]->getVar('conf_name'), 50, 255, $myts->htmlspecialchars($config[$i]->getConfValueForOutput()));
+                break;
+            }
+            $hidden = new XoopsFormHidden('conf_ids[]', $config[$i]->getVar('conf_id'));
+            $form->addElement($ele);
+            $form->addElement($hidden);
+            unset($ele);
+            unset($hidden);
+        }
+        $form->addElement(new XoopsFormHidden('op', 'save'));
+        $form->addElement(new XoopsFormButton('', 'button', _GO, 'submit'));
+        xoops_cp_header();
+        echo '<a href="admin.php?fct=preferences">'. _MD_AM_PREFMAIN .'</a>&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;'.constant($confcat->getVar('confcat_name')).'<br /><br />';
+        $form->display();
+        xoops_cp_footer();
+        exit();
+    }
+
+    if ($op == 'showmod') {
+        $config_handler =& xoops_gethandler('config');
+        $mod = isset($_GET['mod']) ? intval($_GET['mod']) : 0;
+        if (empty($mod)) {
+            header('Location: admin.php?fct=preferences');
+            exit();
+        }
+        $config =& $config_handler->getConfigs(new Criteria('conf_modid', $mod));
+        $count = count($config);
+        if ($count < 1) {
+            redirect_header('admin.php?fct=preferences', 1);
+        }
+        include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
+        $form = new XoopsThemeForm(_MD_AM_MODCONFIG, 'pref_form', 'admin.php?fct=preferences');
+        $form->addElement(new XoopsFormToken(XoopsMultiTokenHandler::quickCreate('preferences')));
+        $module_handler =& xoops_gethandler('module');
+        $module =& $module_handler->get($mod);
+        if (file_exists(XOOPS_ROOT_PATH.'/modules/'.$module->getVar('dirname').'/language/'.$xoopsConfig['language'].'/modinfo.php')) {
+            include_once XOOPS_ROOT_PATH.'/modules/'.$module->getVar('dirname').'/language/'.$xoopsConfig['language'].'/modinfo.php';
+        }
+
+        // if has comments feature, need comment lang file
+        if ($module->getVar('hascomments') == 1) {
+            include_once XOOPS_ROOT_PATH.'/language/'.$xoopsConfig['language'].'/comment.php';
+        }
+        // RMV-NOTIFY
+        // if has notification feature, need notification lang file
+        if ($module->getVar('hasnotification') == 1) {
+            include_once XOOPS_ROOT_PATH.'/language/'.$xoopsConfig['language'].'/notification.php';
+        }
+
+        $modname = $module->getVar('name');
+        if ($module->getInfo('adminindex')) {
+            $form->addElement(new XoopsFormHidden('redirect', XOOPS_URL.'/modules/'.$module->getVar('dirname').'/'.$module->getInfo('adminindex')));
+        }
+        for ($i = 0; $i < $count; $i++) {
+            $title = (!defined($config[$i]->getVar('conf_desc')) || constant($config[$i]->getVar('conf_desc')) == '') ? constant($config[$i]->getVar('conf_title')) : constant($config[$i]->getVar('conf_title')).'<br /><br /><span style="font-weight:normal;">'.constant($config[$i]->getVar('conf_desc')).'</span>';
+            switch ($config[$i]->getVar('conf_formtype')) {
+            case 'textarea':
+                $myts =& MyTextSanitizer::getInstance();
+                if ($config[$i]->getVar('conf_valuetype') == 'array') {
+                    // this is exceptional.. only when value type is arrayneed a smarter way for this
+                    $ele = ($config[$i]->getVar('conf_value') != '') ? new XoopsFormTextArea($title, $config[$i]->getVar('conf_name'), $myts->htmlspecialchars(implode('|', $config[$i]->getConfValueForOutput())), 5, 50) : new XoopsFormTextArea($title, $config[$i]->getVar('conf_name'), '', 5, 50);
+                } elseif ($config[$i]->getVar('conf_valuetype') == 'textarea') {
+                    // another exception for textarea value type..
+                    $ele = new XoopsFormTextArea($title, $config[$i]->getVar('conf_name'), $config[$i]->getVar('conf_value', 'e'), 5, 50);
+                } else {
+                    $ele = new XoopsFormTextArea($title, $config[$i]->getVar('conf_name'), $myts->htmlspecialchars($config[$i]->getConfValueForOutput()), 5, 50);
+                }
+                break;
+            case 'select':
+                $ele = new XoopsFormSelect($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput());
+                $options =& $config_handler->getConfigOptions(new Criteria('conf_id', $config[$i]->getVar('conf_id')));
+                $opcount = count($options);
+                for ($j = 0; $j < $opcount; $j++) {
+                    $optval = defined($options[$j]->getVar('confop_value')) ? constant($options[$j]->getVar('confop_value')) : $options[$j]->getVar('confop_value');
+                    $optkey = defined($options[$j]->getVar('confop_name')) ? constant($options[$j]->getVar('confop_name')) : $options[$j]->getVar('confop_name');
+                    $ele->addOption($optval, $optkey);
+                }
+                break;
+            case 'select_multi':
+                $ele = new XoopsFormSelect($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput(), 5, true);
+                $options =& $config_handler->getConfigOptions(new Criteria('conf_id', $config[$i]->getVar('conf_id')));
+                $opcount = count($options);
+                for ($j = 0; $j < $opcount; $j++) {
+                    $optval = defined($options[$j]->getVar('confop_value')) ? constant($options[$j]->getVar('confop_value')) : $options[$j]->getVar('confop_value');
+                    $optkey = defined($options[$j]->getVar('confop_name')) ? constant($options[$j]->getVar('confop_name')) : $options[$j]->getVar('confop_name');
+                    $ele->addOption($optval, $optkey);
+                }
+                break;
+            case 'yesno':
+                $ele = new XoopsFormRadioYN($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput(), _YES, _NO);
+                break;
+            case 'group':
+                include_once XOOPS_ROOT_PATH.'/class/xoopslists.php';
+                $ele = new XoopsFormSelectGroup($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput(), 1, false);
+                break;
+            case 'group_multi':
+                include_once XOOPS_ROOT_PATH.'/class/xoopslists.php';
+                $ele = new XoopsFormSelectGroup($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput(), 5, true);
+                break;
+            // RMV-NOTIFY: added 'user' and 'user_multi'
+            case 'user':
+                include_once XOOPS_ROOT_PATH.'/class/xoopslists.php';
+                $ele = new XoopsFormSelectUser($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput(), 1, false);
+                break;
+            case 'user_multi':
+                include_once XOOPS_ROOT_PATH.'/class/xoopslists.php';
+                $ele = new XoopsFormSelectUser($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput(), 5, true);
+                break;
+            case 'password':
+                $myts =& MyTextSanitizer::getInstance();
+                $ele = new XoopsFormPassword($title, $config[$i]->getVar('conf_name'), 50, 255, $myts->htmlspecialchars($config[$i]->getConfValueForOutput()));
+                break;
+            case 'textbox':
+            default:
+                $myts =& MyTextSanitizer::getInstance();
+                $ele = new XoopsFormText($title, $config[$i]->getVar('conf_name'), 50, 255, $myts->htmlspecialchars($config[$i]->getConfValueForOutput()));
+                break;
+            }
+            $hidden = new XoopsFormHidden('conf_ids[]', $config[$i]->getVar('conf_id'));
+            $form->addElement($ele);
+            $form->addElement($hidden);
+            unset($ele);
+            unset($hidden);
+        }
+        $form->addElement(new XoopsFormHidden('op', 'save'));
+        $form->addElement(new XoopsFormButton('', 'button', _GO, 'submit'));
+        xoops_cp_header();
+        $form->display();
+        xoops_cp_footer();
+        exit();
+    }
+
+    if ($op == 'save') {
+        if(!XoopsMultiTokenHandler::quickValidate('preferences')) {
+            xoops_cp_header();
+            xoops_error("Token Error");
+            xoops_cp_footer();
+        }
+
+        require_once(XOOPS_ROOT_PATH.'/class/template.php');
+        $xoopsTpl = new XoopsTpl();
+        $xoopsTpl->clear_all_cache();
+        // regenerate admin menu file
+        xoops_module_write_admin_menu(xoops_module_get_admin_menu());
+        $count = count($_POST['conf_ids']);
+        $conf_ids = $_POST['conf_ids'];
+        $tpl_updated = false;
+        $theme_updated = false;
+        $startmod_updated = false;
+        $lang_updated = false;
+        if ($count > 0) {
+            for ($i = 0; $i < $count; $i++) {
+				$config_handler=&xoops_gethandler('config');
+                $config =& $config_handler->getConfig($conf_ids[$i]);
+                $new_value =& $_POST[$config->getVar('conf_name')];
+                if (is_array($new_value) || $new_value != $config->getVar('conf_value')) {
+                    // if language has been changed
+                    if (!$lang_updated && $config->getVar('conf_catid') == XOOPS_CONF && $config->getVar('conf_name') == 'language') {
+                        // regenerate admin menu file
+                        $xoopsConfig['language'] = $new_value;
+                        xoops_module_write_admin_menu(xoops_module_get_admin_menu());
+                        $lang_updated = true;
+                    }
+
+                    // if default theme has been changed
+                    if (!$theme_updated && $config->getVar('conf_catid') == XOOPS_CONF && $config->getVar('conf_name') == 'theme_set') {
+                        $member_handler =& xoops_gethandler('member');
+                        $member_handler->updateUsersByField('theme', $new_value);
+                        $theme_updated = true;
+                    }
+
+                    // if default template set has been changed
+                    if (!$tpl_updated && $config->getVar('conf_catid') == XOOPS_CONF && $config->getVar('conf_name') == 'template_set') {
+                        // clear cached/compiled files and regenerate them if default theme has been changed
+                        if ($xoopsConfig['template_set'] != $new_value) {
+                            $newtplset = $new_value;
+
+                            // clear all compiled and cachedfiles
+                            $xoopsTpl->clear_compiled_tpl();
+
+                            // generate compiled files for the new theme
+                            // block files only for now..
+                            $tplfile_handler =& xoops_gethandler('tplfile');
+                            $dtemplates =& $tplfile_handler->find('default', 'block');
+                            $dcount = count($dtemplates);
+
+                            // need to do this to pass to xoops_template_touch function
+                            $GLOBALS['xoopsConfig']['template_set'] = $newtplset;
+
+                            for ($i = 0; $i < $dcount; $i++) {
+                                $found =& $tplfile_handler->find($newtplset, 'block', $dtemplates[$i]->getVar('tpl_refid'), null);
+                                if (count($found) > 0) {
+                                    // template for the new theme found, compile it
+                                    xoops_template_touch($found[0]->getVar('tpl_id'));
+                                } else {
+                                    // not found, so compile 'default' template file
+                                    xoops_template_touch($dtemplates[$i]->getVar('tpl_id'));
+                                }
+                            }
+
+                            // generate image cache files from image binary data, save them under cache/
+                            $image_handler =& xoops_gethandler('imagesetimg');
+                            $imagefiles =& $image_handler->getObjects(new Criteria('tplset_name', $newtplset), true);
+                            foreach (array_keys($imagefiles) as $i) {
+                                if (!$fp = fopen(XOOPS_CACHE_PATH.'/'.$newtplset.'_'.$imagefiles[$i]->getVar('imgsetimg_file'), 'wb')) {
+                                } else {
+                                    fwrite($fp, $imagefiles[$i]->getVar('imgsetimg_body'));
+                                    fclose($fp);
+                                }
+                            }
+                        }
+                        $tpl_updated = true;
+                    }
+
+                    // add read permission for the start module to all groups
+                    if (!$startmod_updated  && $new_value != '--' && $config->getVar('conf_catid') == XOOPS_CONF && $config->getVar('conf_name') == 'startpage') {
+                        $member_handler =& xoops_gethandler('member');
+                        $groups =& $member_handler->getGroupList();
+                        $moduleperm_handler =& xoops_gethandler('groupperm');
+                        $module_handler =& xoops_gethandler('module');
+                        $module =& $module_handler->getByDirname($new_value);
+                        foreach ($groups as $groupid => $groupname) {
+                            if (!$moduleperm_handler->checkRight('module_read', $module->getVar('mid'), $groupid)) {
+                                $moduleperm_handler->addRight('module_read', $module->getVar('mid'), $groupid);
+                            }
+                        }
+                        $startmod_updated = true;
+                    }
+
+                    $config->setConfValueForInput($new_value);
+                    $config_handler->insertConfig($config);
+                }
+                unset($new_value);
+            }
+        }
+        if (!empty($_POST['use_mysession']) && $xoopsConfig['use_mysession'] == 0 && $_POST['session_name'] != '') {
+                setcookie($_POST['session_name'], session_id(), time()+(60*intval($_POST['session_expire'])), '/',  '', 0);
+        }
+        if (!empty($_POST['redirect'])) {
+            redirect_header($_POST['redirect'], 2, _MD_AM_DBUPDATED);
+        } else {
+            redirect_header("admin.php?fct=preferences",2,_MD_AM_DBUPDATED);
+        }
+    }
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/users/xoops_version.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/users/xoops_version.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/users/xoops_version.php	(revision 405)
@@ -0,0 +1,45 @@
+<?php
+// $Id: xoops_version.php,v 1.2 2005/03/18 12:52:48 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+$modversion['name'] = _MD_AM_USER;
+$modversion['version'] = "";
+$modversion['description'] = "Users Administration";
+$modversion['author'] = "Francisco Burzi<br>( http://phpnuke.org/ )";
+$modversion['credits'] = "Modified by Kazumi Ono<br>( http://www.mywebaddons.com/ )";
+$modversion['help'] = "users.html";
+$modversion['license'] = "GPL see LICENSE";
+$modversion['official'] = 1;
+$modversion['image'] = "users.gif";
+
+$modversion['hasAdmin'] = 1;
+$modversion['adminpath'] = "admin.php?fct=users";
+$modversion['category'] = XOOPS_SYSTEM_USER;
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/users/users.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/users/users.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/users/users.php	(revision 405)
@@ -0,0 +1,235 @@
+<?php
+// $Id: users.php,v 1.4 2005/08/03 12:40:00 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+if ( !is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid()) ) {
+    exit("Access Denied");
+}
+/*********************************************************/
+/* Users Functions                                       */
+/*********************************************************/
+include_once XOOPS_ROOT_PATH."/class/xoopslists.php";
+include_once XOOPS_ROOT_PATH."/class/xoopsformloader.php";
+
+/**
+ * @brief display error message & exit (Tentative)
+ */
+function system_users_error($message)
+{
+    xoops_cp_header();
+    xoops_error($message);
+    xoops_cp_footer();
+    exit();
+}
+
+function displayUsers()
+{
+    global $xoopsDB, $xoopsConfig, $xoopsModule;
+    $userstart = isset($_GET['userstart']) ? intval($_GET['userstart']) : 0;
+    xoops_cp_header();
+    $member_handler =& xoops_gethandler('member');
+    $usercount = $member_handler->getUserCount();
+    $nav = new XoopsPageNav($usercount, 200, $userstart, "userstart", "fct=users");
+    $editform = new XoopsThemeForm(_AM_EDEUSER, "edituser", "admin.php", 'GET');
+    $user_select = new XoopsFormSelect('', "uid");
+    $criteria = new CriteriaCompo();
+    $criteria->setSort('uname');
+    $criteria->setOrder('ASC');
+    $criteria->setLimit(200);
+    $criteria->setStart($userstart);
+    $user_select->addOptionArray($member_handler->getUserList($criteria));
+    $user_select_tray = new XoopsFormElementTray(_AM_NICKNAME, "<br />");
+    $user_select_tray->addElement($user_select);
+    $user_select_nav = new XoopsFormLabel('', $nav->renderNav(4));
+    $user_select_tray->addElement($user_select_nav);
+    $op_select = new XoopsFormSelect("", "op");
+    $op_select->addOptionArray(array("modifyUser"=>_AM_MODIFYUSER, "delUser"=>_AM_DELUSER));
+    $submit_button = new XoopsFormButton("", "submit", _AM_GO, "submit");
+    $fct_hidden = new XoopsFormHidden("fct", "users");
+    $editform->addElement($user_select_tray);
+    $editform->addElement($op_select);
+    $editform->addElement($submit_button);
+    $editform->addElement($fct_hidden);
+    $editform->display();
+
+    echo "<br />\n";
+    $uid_value = "";
+    $uname_value = "";
+    $name_value = "";
+    $email_value = "";
+    $email_cbox_value = 0;
+    $url_value = "";
+//  $avatar_value = "blank.gif";
+//  $theme_value = $xoopsConfig['default_theme'];
+    $timezone_value = $xoopsConfig['default_TZ'];
+    $icq_value = "";
+    $aim_value = "";
+    $yim_value = "";
+    $msnm_value = "";
+    $location_value = "";
+    $occ_value = "";
+    $interest_value = "";
+    $sig_value = "";
+    $sig_cbox_value = 0;
+    $umode_value = $xoopsConfig['com_mode'];
+    $uorder_value = $xoopsConfig['com_order'];
+    // RMV-NOTIFY
+    include_once XOOPS_ROOT_PATH . '/include/notification_constants.php';
+    $notify_method_value = XOOPS_NOTIFICATION_METHOD_PM;
+    $notify_mode_value = XOOPS_NOTIFICATION_MODE_SENDALWAYS;
+    $bio_value = "";
+    $rank_value = 0;
+    $mailok_value = 0;
+    $op_value = "addUser";
+    $form_title = _AM_ADDUSER;
+    $form_isedit = false;
+    $groups = array(XOOPS_GROUP_USERS);
+    include XOOPS_ROOT_PATH."/modules/system/admin/users/userform.php";
+        xoops_cp_footer();
+}
+
+function modifyUser($user)
+{
+    global $xoopsDB, $xoopsConfig, $xoopsModule;
+    xoops_cp_header();
+    $member_handler =& xoops_gethandler('member');
+    $user =& $member_handler->getUser($user);
+    if (is_object($user)) {
+        if (!$user->isActive()) {
+            xoops_token_confirm(array('fct' => 'users', 'op' => 'reactivate', 'uid' => $user->getVar('uid')), 'admin.php', _AM_NOTACTIVE);
+            xoops_cp_footer();
+            exit();
+        }
+        $uid_value = $user->getVar("uid");
+        $uname_value = $user->getVar("uname", "E");
+        $name_value = $user->getVar("name", "E");
+        $email_value = $user->getVar("email", "E");
+        $email_cbox_value = $user->getVar("user_viewemail") ? 1 : 0;
+        $url_value = $user->getVar("url", "E");
+//      $avatar_value = $user->getVar("user_avatar");
+        $temp = $user->getVar("theme");
+//      $theme_value = empty($temp) ? $xoopsConfig['default_theme'] : $temp;
+        $timezone_value = $user->getVar("timezone_offset");
+        $icq_value = $user->getVar("user_icq", "E");
+        $aim_value = $user->getVar("user_aim", "E");
+        $yim_value = $user->getVar("user_yim", "E");
+        $msnm_value = $user->getVar("user_msnm", "E");
+        $location_value = $user->getVar("user_from", "E");
+        $occ_value = $user->getVar("user_occ", "E");
+        $interest_value = $user->getVar("user_intrest", "E");
+        $sig_value = $user->getVar("user_sig", "E");
+        $sig_cbox_value = ($user->getVar("attachsig") == 1) ? 1 : 0;
+        $umode_value = $user->getVar("umode");
+        $uorder_value = $user->getVar("uorder");
+        // RMV-NOTIFY
+        $notify_method_value = $user->getVar("notify_method");
+        $notify_mode_value = $user->getVar("notify_mode");
+        $bio_value = $user->getVar("bio", "E");
+        $rank_value = $user->rank(false);
+        $mailok_value = $user->getVar('user_mailok', 'E');
+        $op_value = "updateUser";
+        $form_title = _AM_UPDATEUSER.": ".$user->getVar("uname");
+        $form_isedit = true;
+        $groups = array_values($user->getGroups());
+
+        $token = XoopsMultiTokenHandler::quickCreate('users_synchronize');
+
+        include XOOPS_ROOT_PATH."/modules/system/admin/users/userform.php";
+        echo "<br /><b>"._AM_USERPOST."</b><br /><br />\n";
+        echo "<table>\n";
+        echo "<tr><td>"._AM_COMMENTS."</td><td>".$user->getVar("posts")."</td></tr>\n";
+        echo "</table>\n";
+        echo "<br />"._AM_PTBBTSDIYT."<br />\n";
+        echo "<form action=\"admin.php\" method=\"post\">\n";
+        echo $token->getHtml();
+        echo "<input type=\"hidden\" name=\"id\" value=\"".$user->getVar("uid")."\" />";
+        echo "<input type=\"hidden\" name=\"type\" value=\"user\" />\n";
+        echo "<input type=\"hidden\" name=\"fct\" value=\"users\" />\n";
+        echo "<input type=\"hidden\" name=\"op\" value=\"synchronize\" />\n";
+        echo "<input type=\"submit\" value=\""._AM_SYNCHRONIZE."\" />\n";
+        echo "</form>\n";
+    } else {
+        echo "<h4 style='text-align:left;'>";
+        echo _AM_USERDONEXIT;
+        echo "</h4>";
+    }
+    xoops_cp_footer();
+}
+
+function synchronize($id, $type)
+{
+    global $xoopsDB;
+    switch($type) {
+    case 'user':
+        $id = intval($id);
+        // Array of tables from which to count 'posts'
+        $tables = array();
+        // Count comments (approved only: com_status == XOOPS_COMMENT_ACTIVE)
+        include_once XOOPS_ROOT_PATH . '/include/comment_constants.php';
+        $tables[] = array ('table_name' => 'xoopscomments', 'uid_column' => 'com_uid', 'criteria' => new Criteria('com_status', XOOPS_COMMENT_ACTIVE));
+        // Count forum posts
+        $tables[] = array ('table_name' => 'bb_posts', 'uid_column' => 'uid');
+
+        $total_posts = 0;
+        foreach ($tables as $table) {
+            $criteria = new CriteriaCompo();
+            $criteria->add (new Criteria($table['uid_column'], $id));
+            if (!empty($table['criteria'])) {
+                $criteria->add ($table['criteria']);
+            }
+            $sql = "SELECT COUNT(*) AS total FROM ".$xoopsDB->prefix($table['table_name']) . ' ' . $criteria->renderWhere();
+            if ( $result = $xoopsDB->query($sql) ) {
+                if ($row = $xoopsDB->fetchArray($result)) {
+                    $total_posts = $total_posts + $row['total'];
+                }
+            }
+        }
+        $sql = "UPDATE ".$xoopsDB->prefix("users")." SET posts = $total_posts WHERE uid = $id";
+        if ( !$result = $xoopsDB->query($sql) ) {
+            exit(sprintf(_AM_CNUUSER %s ,$id));
+        }
+        break;
+    case 'all users':
+        $sql = "SELECT uid FROM ".$xoopsDB->prefix("users")."";
+        if ( !$result = $xoopsDB->query($sql) ) {
+            exit(_AM_CNGUSERID);
+        }
+        while ($row = $xoopsDB->fetchArray($result)) {
+            $id = $row['uid'];
+            synchronize($id, "user");
+        }
+        break;
+    default:
+        break;
+    }
+    redirect_header("admin.php?fct=users&amp;op=modifyUser&amp;uid=".$id,1,_AM_DBUPDATED);
+    exit();
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/users/userform.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/users/userform.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/users/userform.php	(revision 405)
@@ -0,0 +1,176 @@
+<?php
+// $Id: userform.php,v 1.4 2005/08/03 12:40:00 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+$uid_label = new XoopsFormLabel(_AM_USERID, $uid_value);
+$uname_text = new XoopsFormText(_AM_NICKNAME, "username", 25, 25, $uname_value);
+$name_text = new XoopsFormText(_AM_NAME, "name", 30, 60, $name_value);
+$email_tray = new XoopsFormElementTray(_AM_EMAIL, "<br />");
+$email_text = new XoopsFormText("", "email", 30, 60, $email_value);
+$email_tray->addElement($email_text, true);
+$email_cbox = new XoopsFormCheckBox("", "user_viewemail", $email_cbox_value);
+$email_cbox->addOption(1, _AM_AOUTVTEAD);
+$email_tray->addElement($email_cbox);
+$url_text = new XoopsFormText(_AM_URL, "url", 30, 100, $url_value);
+//  $avatar_select = new XoopsFormSelect("", "user_avatar", $avatar_value);
+//  $avatar_array = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH."/images/avatar/");
+//  $avatar_select->addOptionArray($avatar_array);
+//  $a_dirlist = XoopsLists::getDirListAsArray(XOOPS_ROOT_PATH."/images/avatar/");
+//  $a_dir_labels = array();
+//  $a_count = 0;
+//  $a_dir_link = "<a href=\"javascript:openWithSelfMain('".XOOPS_URL."/misc.php?action=showpopups&amp;type=avatars&amp;start=".$a_count."','avatars',600,400);\">XOOPS</a>";
+//  $a_count = $a_count + count($avatar_array);
+//  $a_dir_labels[] = new XoopsFormLabel("", $a_dir_link);
+//  foreach ($a_dirlist as $a_dir) {
+//      if ( $a_dir == "users" ) {
+//          continue;
+//      }
+//      $avatars_array = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH."/images/avatar/".$a_dir."/", $a_dir."/");
+//      $avatar_select->addOptionArray($avatars_array);
+//      $a_dir_link = "<a href=\"javascript:openWithSelfMain('".XOOPS_URL."/misc.php?action=showpopups&amp;type=avatars&amp;subdir=".$a_dir."&amp;start=".$a_count."','avatars',600,400);\">".$a_dir."</a>";
+//      $a_dir_labels[] = new XoopsFormLabel("", $a_dir_link);
+//      $a_count = $a_count + count($avatars_array);
+//  }
+//  if (!empty($uid_value)) {
+//      $myavatar = avatarExists($uid_value);
+//      if ( $myavatar != false ) {
+//          $avatar_select->addOption($myavatar, _US_MYAVATAR);
+//      }
+//  }
+//  $avatar_select->setExtra("onchange='showImgSelected(\"avatar\", \"user_avatar\", \"images/avatar\", \"\", \"".XOOPS_URL."\")'");
+//  $avatar_label = new XoopsFormLabel("", "<img src='".XOOPS_URL."/images/avatar/".$avatar_value."' name='avatar' id='avatar' alt='' />");
+//  $avatar_tray = new XoopsFormElementTray(_AM_AVATAR, "&nbsp;");
+//  $avatar_tray->addElement($avatar_select);
+//  $avatar_tray->addElement($avatar_label);
+//  foreach ($a_dir_labels as $a_dir_label) {
+//      $avatar_tray->addElement($a_dir_label);
+//  }
+//  $theme_select = new XoopsFormSelectTheme(_AM_THEME, "theme", $theme_value);
+$timezone_select = new XoopsFormSelectTimezone(_US_TIMEZONE, "timezone_offset", $timezone_value);
+$icq_text = new XoopsFormText(_AM_ICQ, "user_icq", 15, 15, $icq_value);
+$aim_text = new XoopsFormText(_AM_AIM, "user_aim", 18, 18, $aim_value);
+$yim_text = new XoopsFormText(_AM_YIM, "user_yim", 25, 25, $yim_value);
+$msnm_text = new XoopsFormText(_AM_MSNM, "user_msnm", 30, 100, $msnm_value);
+$location_text = new XoopsFormText(_AM_LOCATION, "user_from", 30, 100, $location_value);
+$occupation_text = new XoopsFormText(_AM_OCCUPATION, "user_occ", 30, 100, $occ_value);
+$interest_text = new XoopsFormText(_AM_INTEREST, "user_intrest", 30, 150, $interest_value);
+$sig_tray = new XoopsFormElementTray(_AM_SIGNATURE, "<br />");
+$sig_tarea = new XoopsFormTextArea("", "user_sig", $sig_value);
+$sig_tray->addElement($sig_tarea);
+$sig_cbox = new XoopsFormCheckBox("", "attachsig", $sig_cbox_value);
+$sig_cbox->addOption(1, _US_SHOWSIG);
+$sig_tray->addElement($sig_cbox);
+$umode_select = new XoopsFormSelect(_US_CDISPLAYMODE, "umode", $umode_value);
+$umode_select->addOptionArray(array("nest"=>_NESTED, "flat"=>_FLAT, "thread"=>_THREADED));
+$uorder_select = new XoopsFormSelect(_US_CSORTORDER, "uorder", $uorder_value);
+$uorder_select->addOptionArray(array("0"=>_OLDESTFIRST, "1"=>_NEWESTFIRST));
+// RMV-NOTIFY
+include_once XOOPS_ROOT_PATH. '/language/' . $xoopsConfig['language'] . '/notification.php';
+include_once XOOPS_ROOT_PATH . '/include/notification_constants.php';
+$notify_method_select = new XoopsFormSelect(_NOT_NOTIFYMETHOD, 'notify_method', $notify_method_value);
+$notify_method_select->addOptionArray(array(XOOPS_NOTIFICATION_METHOD_DISABLE=>_NOT_METHOD_DISABLE, XOOPS_NOTIFICATION_METHOD_PM=>_NOT_METHOD_PM, XOOPS_NOTIFICATION_METHOD_EMAIL=>_NOT_METHOD_EMAIL));
+$notify_mode_select = new XoopsFormSelect(_NOT_NOTIFYMODE, 'notify_mode', $notify_mode_value);
+$notify_mode_select->addOptionArray(array(XOOPS_NOTIFICATION_MODE_SENDALWAYS=>_NOT_MODE_SENDALWAYS, XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE=>_NOT_MODE_SENDONCE, XOOPS_NOTIFICATION_MODE_SENDONCETHENWAIT=>_NOT_MODE_SENDONCEPERLOGIN));
+$bio_tarea = new XoopsFormTextArea(_US_EXTRAINFO, "bio", $bio_value);
+$rank_select = new XoopsFormSelect(_AM_RANK, "rank", $rank_value);
+$ranklist = XoopsLists::getUserRankList();
+if ( count($ranklist) > 0 ) {
+    $rank_select->addOption(0, _AM_NSRA);
+    $rank_select->addOption(0, "--------------");
+    $rank_select->addOptionArray($ranklist);
+} else {
+    $rank_select->addOption(0, _AM_NSRID);
+}
+$pwd_text = new XoopsFormPassword(_AM_PASSWORD, "pass", 10, 32);
+$pwd_text2 = new XoopsFormPassword(_AM_RETYPEPD, "pass2", 10, 32);
+$mailok_radio = new XoopsFormRadioYN(_US_MAILOK, 'user_mailok', $mailok_value);
+
+// Groups administration addition XOOPS 2.0.9: Mith
+global $xoopsUser;
+$gperm_handler =& xoops_gethandler('groupperm');
+//If user has admin rights on groups
+if ($gperm_handler->checkRight("system_admin", XOOPS_SYSTEM_GROUP, $xoopsUser->getGroups(), 1)) {
+    //add group selection
+    $group_select = new XoopsFormSelectGroup(_US_GROUPS, 'groups', false, $groups, 5, true);
+}
+else {
+    //add empty variable
+    $group_select = new XoopsFormHidden('groups[]', XOOPS_GROUP_USERS);
+}
+
+$fct_hidden = new XoopsFormHidden("fct", "users");
+$op_hidden = new XoopsFormHidden("op", $op_value);
+$submit_button = new XoopsFormButton("", "submit", _SUBMIT, "submit");
+
+$form = new XoopsThemeForm($form_title, "userinfo", "admin.php");
+$form->addElement(new XoopsFormToken(XoopsMultiTokenHandler::quickCreate('users_'.$op_value)));
+$form->addElement($uname_text, true);
+$form->addElement($name_text);
+$form->addElement($email_tray, true);
+$form->addElement($url_text);
+//  $form->addElement($avatar_tray);
+//  $form->addElement($theme_select);
+$form->addElement($timezone_select);
+$form->addElement($icq_text);
+$form->addElement($aim_text);
+$form->addElement($yim_text);
+$form->addElement($msnm_text);
+$form->addElement($location_text);
+$form->addElement($occupation_text);
+$form->addElement($interest_text);
+$form->addElement($sig_tray);
+$form->addElement($umode_select);
+$form->addElement($uorder_select);
+// RMV-NOTIFY
+$form->addElement($notify_method_select);
+$form->addElement($notify_mode_select);
+$form->addElement($bio_tarea);
+$form->addElement($rank_select);
+// adding a new user requires password fields
+if (!$form_isedit) {
+    $form->addElement($pwd_text, true);
+    $form->addElement($pwd_text2, true);
+} else {
+    $form->addElement($pwd_text);
+    $form->addElement($pwd_text2);
+}
+$form->addElement($mailok_radio);
+$form->addElement($group_select);
+$form->addElement($fct_hidden);
+$form->addElement($op_hidden);
+$form->addElement($submit_button);
+if ( !empty($uid_value) ) {
+    $uid_hidden = new XoopsFormHidden("uid", $uid_value);
+    $form->addElement($uid_hidden);
+}
+//$form->setRequired($uname_text);
+//$form->setRequired($email_text);
+$form->display();
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/users/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/users/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/users/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/users/main.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/users/main.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/users/main.php	(revision 405)
@@ -0,0 +1,319 @@
+<?php
+// $Id: main.php,v 1.7 2006/05/01 02:37:30 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+if ( !is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid()) ) {
+    exit("Access Denied");
+}
+$op = 'mod_users';
+include_once XOOPS_ROOT_PATH."/modules/system/admin/users/users.php";
+if (isset($_GET['op'])) {
+    $op = trim($_GET['op']);
+    if (isset($_GET['uid'])) {
+        $uid = intval($_GET['uid']);
+    }
+} elseif (!empty($_POST['op'])) {
+    $op = $_POST['op'];
+}
+switch ($op) {
+
+case "modifyUser":
+    modifyUser($uid);
+    break;
+
+case "updateUser":
+    if(!XoopsMultiTokenHandler::quickValidate('users_updateUser'))
+        system_users_error("Ticket Error");
+
+    $myts =& MyTextSanitizer::getInstance();
+    $uid = !empty($_POST['uid']) ? intval($_POST['uid']) : 0;
+    $username = !empty($_POST['username']) ? $myts->stripSlashesGPC(trim($_POST['username'])) : '';
+    if ($uid > 0 && $username != '') {
+        $member_handler =& xoops_gethandler('member');
+        $edituser =& $member_handler->getUser($uid);
+        $myts =& MyTextSanitizer::getInstance();
+        if ($edituser->getVar('uname', 'n') != $username && $member_handler->getUserCount(new Criteria('uname', addslashes($username))) > 0) {
+            xoops_cp_header();
+            echo 'User name '.htmlspecialchars($username).' already exists';
+            xoops_cp_footer();
+            exit();
+        } else {
+            $edituser->setVar("name", $_POST['name']);
+            $edituser->setVar("uname", $_POST['username']);
+            $edituser->setVar("email", $_POST['email']);
+            if (!empty($_POST['url'])) {
+                $edituser->setVar("url", formatURL($_POST['url']));
+            }
+        //  $edituser->setVar("user_avatar", $_POST['user_avatar']);
+            $edituser->setVar("user_icq", $_POST['user_icq']);
+            $edituser->setVar("user_from", $_POST['user_from']);
+            $edituser->setVar("user_sig", $_POST['user_sig']);
+            $user_viewemail = !empty($_POST['user_viewemail']) ? 1 : 0;
+            $edituser->setVar("user_viewemail", $user_viewemail);
+            $edituser->setVar("user_aim", $_POST['user_aim']);
+            $edituser->setVar("user_yim", $_POST['user_yim']);
+            $edituser->setVar("user_msnm", $_POST['user_msnm']);
+            $edituser->setVar("attachsig", (empty($_POST['attachsig']) ? 0 : 1));
+            $edituser->setVar("timezone_offset", $_POST['timezone_offset']);
+        //  $edituser->setVar("theme", $_POST['theme']);
+            $edituser->setVar("uorder", $_POST['uorder']);
+            $edituser->setVar("umode", $_POST['umode']);
+            $edituser->setVar("notify_method", $_POST['notify_method']);
+            $edituser->setVar("notify_mode", $_POST['notify_mode']);
+            $edituser->setVar("bio", $_POST['bio']);
+            $edituser->setVar("rank", $_POST['rank']);
+            $edituser->setVar("user_occ", $_POST['user_occ']);
+            $edituser->setVar("user_intrest", $_POST['user_intrest']);
+            $edituser->setVar('user_mailok', $_POST['user_mailok']);
+            if ($_POST['pass2'] != "") {
+                if ( $_POST['pass'] != $_POST['pass2'] ) {
+                    xoops_cp_header();
+                    echo "<b>"._AM_STNPDNM."</b>";
+                    xoops_cp_footer();
+                    exit();
+                }
+                $edituser->setVar("pass", md5($myts->stripSlashesGPC(trim($_POST['pass']))));
+            }
+            if (!$member_handler->insertUser($edituser)) {
+                xoops_cp_header();
+                echo $edituser->getHtmlErrors();
+                xoops_cp_footer();
+                exit();
+            } else {
+                if (!empty($_POST['groups'])) {
+                    $oldgroups = $edituser->getGroups();
+                    //If the edited user is the current user and the current user WAS in the webmaster's group and is NOT in the new groups array
+                    if ($edituser->getVar('uid') == $xoopsUser->getVar('uid') && (in_array(XOOPS_GROUP_ADMIN, $oldgroups)) && !in_array(XOOPS_GROUP_ADMIN, $groups)) {
+                        //Add the webmaster's group to the groups array to prevent accidentally removing oneself from the webmaster's group
+                        array_push($_POST['groups'], XOOPS_GROUP_ADMIN);
+                    }
+                    $member_handler =& xoops_gethandler('member');
+                    foreach ($oldgroups as $groupid) {
+                        $member_handler->removeUsersFromGroup($groupid, array($edituser->getVar('uid')));
+                    }
+                    foreach ($_POST['groups'] as $groupid) {
+                        $member_handler->addUserToGroup($groupid, $edituser->getVar('uid'));
+                    }
+                }
+            }
+        }
+    }
+    redirect_header("admin.php?fct=users",1,_AM_DBUPDATED);
+    break;
+
+case "delUser":
+    xoops_cp_header();
+    $member_handler =& xoops_gethandler('member');
+    $userdata =& $member_handler->getUser($uid);
+    xoops_token_confirm(array('fct' => 'users', 'op' => 'delUserConf', 'del_uid' => $userdata->getVar('uid')), 'admin.php', sprintf(_AM_AYSYWTDU,$userdata->getVar('uname')));
+    xoops_cp_footer();
+    break;
+case "delete_many":
+    xoops_cp_header();
+    $count = count($_POST['memberslist_id']);
+
+    $token=&XoopsSingleTokenHandler::quickCreate('users_deletemany');
+
+    if ( $count > 0 ) {
+        $list = $hidden = '';
+        for ( $i = 0; $i < $count; $i++ ) {
+            $id = intval($_POST['memberslist_id'][$i]);
+            if ($id > 0) {
+                $list .= ", <a href='".XOOPS_URL."/userinfo.php?uid=$id' target='_blank'>".htmlspecialchars($_POST['memberslist_uname'][$id])."</a>";
+                $hidden .= "<input type='hidden' name='memberslist_id[]' value='$id' />\n";
+            }
+        }
+        echo "<div><h4>".sprintf(_AM_AYSYWTDU," ".$list." ")."</h4>";
+        echo _AM_BYTHIS."<br /><br />
+        <form action='admin.php' method='post'>
+        <input type='hidden' name='fct' value='users' />
+        <input type='hidden' name='op' value='delete_many_ok' />
+        <input type='submit' value='"._YES."' />
+        <input type='button' value='"._NO."' onclick='javascript:location.href=\"admin.php?op=adminMain\"' />";
+        echo $token->getHtml();
+        echo $hidden;
+        echo "</form></div>";
+    } else {
+        echo _AM_NOUSERS;
+    }
+    xoops_cp_footer();
+    break;
+case "delete_many_ok":
+    if(XoopsSingleTokenHandler::quickValidate('users_deletemany')) {
+        $count = count($_POST['memberslist_id']);
+        $output = "";
+        $member_handler =& xoops_gethandler('member');
+        for ( $i = 0; $i < $count; $i++ ) {
+            $deluser =& $member_handler->getUser($_POST['memberslist_id'][$i]);
+            if (is_object($deluser)) {
+                $groups = $deluser->getGroups();
+                if (in_array(XOOPS_GROUP_ADMIN, $groups)) {
+                    $output .= sprintf('Admin user cannot be deleted. (User: %s)', $deluser->getVar("uname"))."<br />";
+                } else {
+                    if (!$member_handler->deleteUser($deluser)) {
+                        $output .= "Could not delete ".$deluser->getVar("uname")."<br />";
+                    } else {
+                        $output .= $deluser->getVar("uname")." deleted<br />";
+                    }
+                    xoops_notification_deletebyuser($deluser->getVar('uid'));
+                }
+            }
+            unset($deluser);
+        }
+        xoops_cp_header();
+        echo $output;
+        xoops_cp_footer();
+    }
+    else {
+        xoops_cp_header();
+        xoops_error('Ticket Error');
+        xoops_cp_footer();
+    }
+    break;
+case "delUserConf":
+    if(!xoops_confirm_validate())
+        system_users_error("Ticket Error");
+
+    $del_uid = !empty($_POST['del_uid']) ? intval($_POST['del_uid']) : 0;
+    if ($del_uid > 0) {
+        $member_handler =& xoops_gethandler('member');
+        $user =& $member_handler->getUser($del_uid);
+        $groups = $user->getGroups();
+        if (in_array(XOOPS_GROUP_ADMIN, $groups)) {
+            xoops_cp_header();
+            echo sprintf('Admin user cannot be deleted. (User: %s)', $user->getVar("uname"));
+            xoops_cp_footer();
+        } elseif (!$member_handler->deleteUser($user)) {
+            xoops_cp_header();
+            echo "Could not delete ".$deluser->getVar("uname");
+            xoops_cp_footer();
+        } else {
+            $online_handler =& xoops_gethandler('online');
+            $online_handler->destroy($del_uid);
+            xoops_notification_deletebyuser($del_uid);
+            redirect_header("admin.php?fct=users",1,_AM_DBUPDATED);
+        }
+    }
+    break;
+case "addUser":
+    if(!XoopsMultiTokenHandler::quickValidate('users_addUser'))
+        system_users_error("Ticket Error");
+
+    $myts =& MyTextSanitizer::getInstance();
+    $username = !empty($_POST['username']) ? $myts->stripSlashesGPC(trim($_POST['username'])) : '';
+    $email = !empty($_POST['email']) ? $myts->stripSlashesGPC(trim($_POST['email'])) : '';
+    $password = !empty($_POST['pass']) ? $myts->stripSlashesGPC(trim($_POST['pass'])) : '';
+    if ($username == '' || $email == '' || $password == '') {
+        $adduser_errormsg = _AM_YMCACF;
+    } else {
+        $member_handler =& xoops_gethandler('member');
+        // make sure the username doesnt exist yet
+        if ($member_handler->getUserCount(new Criteria('uname', addslashes($username))) > 0) {
+            $adduser_errormsg = 'User name '.$username.' already exists';
+        } else {
+            $newuser =& $member_handler->createUser();
+            if ( isset($_POST['user_viewemail']) ) {
+                $newuser->setVar("user_viewemail",$_POST['user_viewemail']);
+            }
+            if ( isset($_POST['attachsig']) ) {
+                $newuser->setVar("attachsig",$_POST['attachsig']);
+            }
+            $newuser->setVar("name", $_POST['name']);
+            $newuser->setVar("uname", $_POST['username']);
+            $newuser->setVar("email", $_POST['email']);
+            $newuser->setVar("url", formatURL($_POST['url']));
+            $newuser->setVar("user_avatar",'blank.gif');
+            $newuser->setVar("user_icq", $_POST['user_icq']);
+            $newuser->setVar("user_from", $_POST['user_from']);
+            $newuser->setVar("user_sig", $_POST['user_sig']);
+            $newuser->setVar("user_aim", $_POST['user_aim']);
+            $newuser->setVar("user_yim", $_POST['user_yim']);
+            $newuser->setVar("user_msnm", $_POST['user_msnm']);
+            if ($_POST['pass2'] != "") {
+                if ( $_POST['pass'] != $_POST['pass2'] ) {
+                    xoops_cp_header();
+                    echo "
+                    <b>"._AM_STNPDNM."</b>";
+                    xoops_cp_footer();
+                    exit();
+                }
+                $newuser->setVar("pass", md5($myts->stripSlashesGPC(trim($_POST['pass']))));
+            }
+            $newuser->setVar("timezone_offset", $_POST['timezone_offset']);
+            $newuser->setVar("uorder", $_POST['uorder']);
+            $newuser->setVar("umode", $_POST['umode']);
+            $newuser->setVar("notify_method", $_POST['notify_method']);
+            $newuser->setVar("notify_mode", $_POST['notify_mode']);
+            $newuser->setVar("bio", $_POST['bio']);
+            $newuser->setVar("rank", $_POST['rank']);
+            $newuser->setVar("level", 1);
+            $newuser->setVar("user_occ", $_POST['user_occ']);
+            $newuser->setVar("user_intrest", $_POST['user_intrest']);
+            $newuser->setVar('user_mailok', $_POST['user_mailok']);
+            if (!$member_handler->insertUser($newuser)) {
+                $adduser_errormsg = _AM_CNRNU;
+            } else {
+                if (!empty($_POST['groups'])) {
+                    foreach ($_POST['groups'] as $groupid) {
+                        $member_handler->addUserToGroup(intval($groupid), $newuser->getVar('uid'));
+                    }
+                }
+                redirect_header("admin.php?fct=users",1,_AM_DBUPDATED);
+                exit();
+            }
+        }
+    }
+    xoops_cp_header();
+    xoops_error($adduser_errormsg);
+    xoops_cp_footer();
+    break;
+case "synchronize":
+    if(!XoopsMultiTokenHandler::quickValidate('users_synchronize'))
+        system_users_error("Ticket Error");
+
+    synchronize($_POST['id'], $_POST['type']);
+    break;
+case "reactivate":
+    if(!xoops_confirm_validate())
+        system_users_error("Ticket Error");
+
+    $uid = !empty($_POST['uid']) ? intval($_POST['uid']) : 0;
+    if ($uid > 0) {
+        $result=$xoopsDB->query("UPDATE ".$xoopsDB->prefix("users")." SET level=1 WHERE uid=".$uid);
+    }
+    redirect_header("admin.php?fct=users&amp;op=modifyUser&amp;uid=".$uid,1,_AM_DBUPDATED);
+    break;
+case "mod_users":
+default:
+    include_once XOOPS_ROOT_PATH.'/class/pagenav.php';
+    displayUsers();
+    break;
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/findusers/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/findusers/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/findusers/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/findusers/main.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/findusers/main.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/findusers/main.php	(revision 405)
@@ -0,0 +1,456 @@
+<?php
+// $Id: main.php,v 1.6 2006/05/01 02:37:29 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+if ( !is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid()) ) {
+    exit("Access Denied");
+}
+$op = "form";
+
+if ( isset($_POST['op']) && $_POST['op'] == "submit" ) {
+    $op = "submit";
+}
+
+xoops_cp_header();
+//OpenTable();
+
+if ( $op == "form" ) {
+    $member_handler =& xoops_gethandler('member');
+    $acttotal = $member_handler->getUserCount(new Criteria('level', 0, '>'));
+    $inacttotal = $member_handler->getUserCount(new Criteria('level', 0));
+    include_once XOOPS_ROOT_PATH."/class/xoopsformloader.php";
+    $uname_text = new XoopsFormText("", "user_uname", 30, 60);
+    $uname_match = new XoopsFormSelectMatchOption("", "user_uname_match");
+    $uname_tray = new XoopsFormElementTray(_AM_UNAME, "&nbsp;");
+    $uname_tray->addElement($uname_match);
+    $uname_tray->addElement($uname_text);
+    $name_text = new XoopsFormText("", "user_name", 30, 60);
+    $name_match = new XoopsFormSelectMatchOption("", "user_name_match");
+    $name_tray = new XoopsFormElementTray(_AM_REALNAME, "&nbsp;");
+    $name_tray->addElement($name_match);
+    $name_tray->addElement($name_text);
+    $email_text = new XoopsFormText("", "user_email", 30, 60);
+    $email_match = new XoopsFormSelectMatchOption("", "user_email_match");
+    $email_tray = new XoopsFormElementTray(_AM_EMAIL, "&nbsp;");
+    $email_tray->addElement($email_match);
+    $email_tray->addElement($email_text);
+    $url_text = new XoopsFormText(_AM_URLC, "user_url", 30, 100);
+    //$theme_select = new XoopsFormSelectTheme(_AM_THEME, "user_theme");
+    //$timezone_select = new XoopsFormSelectTimezone(_AM_TIMEZONE, "user_timezone_offset");
+    $icq_text = new XoopsFormText("", "user_icq", 30, 100);
+    $icq_match = new XoopsFormSelectMatchOption("", "user_icq_match");
+    $icq_tray = new XoopsFormElementTray(_AM_ICQ, "&nbsp;");
+    $icq_tray->addElement($icq_match);
+    $icq_tray->addElement($icq_text);
+    $aim_text = new XoopsFormText("", "user_aim", 30, 100);
+    $aim_match = new XoopsFormSelectMatchOption("", "user_aim_match");
+    $aim_tray = new XoopsFormElementTray(_AM_AIM, "&nbsp;");
+    $aim_tray->addElement($aim_match);
+    $aim_tray->addElement($aim_text);
+    $yim_text = new XoopsFormText("", "user_yim", 30, 100);
+    $yim_match = new XoopsFormSelectMatchOption("", "user_yim_match");
+    $yim_tray = new XoopsFormElementTray(_AM_YIM, "&nbsp;");
+    $yim_tray->addElement($yim_match);
+    $yim_tray->addElement($yim_text);
+    $msnm_text = new XoopsFormText("", "user_msnm", 30, 100);
+    $msnm_match = new XoopsFormSelectMatchOption("", "user_msnm_match");
+    $msnm_tray = new XoopsFormElementTray(_AM_MSNM, "&nbsp;");
+    $msnm_tray->addElement($msnm_match);
+    $msnm_tray->addElement($msnm_text);
+    $location_text = new XoopsFormText(_AM_LOCATION, "user_from", 30, 100);
+    $occupation_text = new XoopsFormText(_AM_OCCUPATION, "user_occ", 30, 100);
+    $interest_text = new XoopsFormText(_AM_INTEREST, "user_intrest", 30, 100);
+
+    //$bio_text = new XoopsFormText(_AM_EXTRAINFO, "user_bio", 30, 100);
+    $lastlog_more = new XoopsFormText(_AM_LASTLOGMORE, "user_lastlog_more", 10, 5);
+    $lastlog_less = new XoopsFormText(_AM_LASTLOGLESS, "user_lastlog_less", 10, 5);
+    $reg_more = new XoopsFormText(_AM_REGMORE, "user_reg_more", 10, 5);
+    $reg_less = new XoopsFormText(_AM_REGLESS, "user_reg_less", 10, 5);
+    $posts_more = new XoopsFormText(_AM_POSTSMORE, "user_posts_more", 10, 5);
+    $posts_less = new XoopsFormText(_AM_POSTSLESS, "user_posts_less", 10, 5);
+    $mailok_radio = new XoopsFormRadio(_AM_SHOWMAILOK, "user_mailok", "both");
+    $mailok_radio->addOptionArray(array("mailok"=>_AM_MAILOK, "mailng"=>_AM_MAILNG, "both"=>_AM_BOTH));
+    $type_radio = new XoopsFormRadio(_AM_SHOWTYPE, "user_type", "actv");
+    $type_radio->addOptionArray(array("actv"=>_AM_ACTIVE, "inactv"=>_AM_INACTIVE, "both"=>_AM_BOTH));
+    $sort_select = new XoopsFormSelect(_AM_SORT, "user_sort");
+    $sort_select->addOptionArray(array("uname"=>_AM_UNAME,"email"=>_AM_EMAIL,"last_login"=>_AM_LASTLOGIN,"user_regdate"=>_AM_REGDATE,"posts"=>_AM_POSTS));
+    $order_select = new XoopsFormSelect(_AM_ORDER, "user_order");
+    $order_select->addOptionArray(array("ASC"=>_AM_ASC,"DESC"=>_AM_DESC));
+    $limit_text = new XoopsFormText(_AM_LIMIT, "limit", 6, 2);
+    $fct_hidden = new XoopsFormHidden("fct", "findusers");
+    $op_hidden = new XoopsFormHidden("op", "submit");
+    $submit_button = new XoopsFormButton("", "user_submit", _SUBMIT, "submit");
+
+    $form = new XoopsThemeForm(_AM_FINDUS, "uesr_findform", "admin.php");
+    $form->addElement($uname_tray);
+    $form->addElement($name_tray);
+    $form->addElement($email_tray);
+    //$form->addElement($theme_select);
+    //$form->addElement($timezone_select);
+    $form->addElement($icq_tray);
+    $form->addElement($aim_tray);
+    $form->addElement($yim_tray);
+    $form->addElement($msnm_tray);
+    $form->addElement($url_text);
+    $form->addElement($location_text);
+    $form->addElement($occupation_text);
+    $form->addElement($interest_text);
+    //$form->addElement($bio_text);
+    $form->addElement($lastlog_more);
+    $form->addElement($lastlog_less);
+    $form->addElement($reg_more);
+    $form->addElement($reg_less);
+    $form->addElement($posts_more);
+    $form->addElement($posts_less);
+    $form->addElement($mailok_radio);
+    $form->addElement($type_radio);
+    $form->addElement($sort_select);
+    $form->addElement($order_select);
+    $form->addElement($fct_hidden);
+    $form->addElement($limit_text);
+    $form->addElement($op_hidden);
+
+    // if this is to find users for a specific group
+    if ( !empty($_GET['group']) && intval($_GET['group']) > 0 ) {
+        $group_hidden = new XoopsFormHidden("group", intval($_GET['group']));
+        $form->addElement($group_hidden);
+    }
+    $form->addElement($submit_button);
+    echo "<h4 style='text-align:left;'>"._AM_FINDUS."</h4>(".sprintf(_AM_ACTUS, "<span style='color:#ff0000;'>$acttotal</span>")." ".sprintf(_AM_INACTUS, "<span style='color:#ff0000;'>$inacttotal</span>").")";
+    $form->display();
+}
+
+if ( $op == "submit" ) {
+    $myts =& MyTextSanitizer::getInstance();
+    $criteria = new CriteriaCompo();
+    if ( !empty($_POST['user_uname']) ) {
+        $match = (!empty($_POST['user_uname_match'])) ? intval($_POST['user_uname_match']) : XOOPS_MATCH_START;
+        switch ($match) {
+        case XOOPS_MATCH_START:
+            $criteria->add(new Criteria('uname', $myts->addSlashes(trim($_POST['user_uname'])).'%', 'LIKE'));
+            break;
+        case XOOPS_MATCH_END:
+            $criteria->add(new Criteria('uname', '%'.$myts->addSlashes(trim($_POST['user_uname'])), 'LIKE'));
+            break;
+        case XOOPS_MATCH_EQUAL:
+            $criteria->add(new Criteria('uname', $myts->addSlashes(trim($_POST['user_uname']))));
+            break;
+        case XOOPS_MATCH_CONTAIN:
+            $criteria->add(new Criteria('uname', '%'.$myts->addSlashes(trim($_POST['user_uname'])).'%', 'LIKE'));
+            break;
+        }
+    }
+    if ( !empty($_POST['user_name']) ) {
+        $match = (!empty($_POST['user_name_match'])) ? intval($_POST['user_name_match']) : XOOPS_MATCH_START;
+        switch ($match) {
+        case XOOPS_MATCH_START:
+            $criteria->add(new Criteria('name', $myts->addSlashes(trim($_POST['user_name'])).'%', 'LIKE'));
+            break;
+        case XOOPS_MATCH_END:
+            $criteria->add(new Criteria('name', '%'.$myts->addSlashes(trim($_POST['user_name'])), 'LIKE'));
+            break;
+        case XOOPS_MATCH_EQUAL:
+            $criteria->add(new Criteria('name', $myts->addSlashes(trim($_POST['user_name']))));
+            break;
+        case XOOPS_MATCH_CONTAIN:
+            $criteria->add(new Criteria('name', '%'.$myts->addSlashes(trim($_POST['user_name'])).'%', 'LIKE'));
+            break;
+        }
+    }
+    if ( !empty($_POST['user_email']) ) {
+        $match = (!empty($_POST['user_email_match'])) ? intval($_POST['user_email_match']) : XOOPS_MATCH_START;
+        switch ($match) {
+        case XOOPS_MATCH_START:
+            $criteria->add(new Criteria('email', $myts->addSlashes(trim($_POST['user_email'])).'%', 'LIKE'));
+            break;
+        case XOOPS_MATCH_END:
+            $criteria->add(new Criteria('email', '%'.$myts->addSlashes(trim($_POST['user_email'])), 'LIKE'));
+            break;
+        case XOOPS_MATCH_EQUAL:
+            $criteria->add(new Criteria('email', $myts->addSlashes(trim($_POST['user_email']))));
+            break;
+        case XOOPS_MATCH_CONTAIN:
+            $criteria->add(new Criteria('email', '%'.$myts->addSlashes(trim($_POST['user_email'])).'%', 'LIKE'));
+            break;
+        }
+    }
+    if ( !empty($_POST['user_url']) ) {
+        $url = formatURL(trim($_POST['user_url']));
+        $criteria->add(new Criteria('url', $url.'%', 'LIKE'));
+    }
+    if ( !empty($_POST['user_icq']) ) {
+        $match = (!empty($_POST['user_icq_match'])) ? intval($_POST['user_icq_match']) : XOOPS_MATCH_START;
+        switch ($match) {
+        case XOOPS_MATCH_START:
+            $criteria->add(new Criteria('user_icq', $myts->addSlashes(trim($_POST['user_icq'])).'%', 'LIKE'));
+            break;
+        case XOOPS_MATCH_END:
+            $criteria->add(new Criteria('user_icq', '%'.$myts->addSlashes(trim($_POST['user_icq'])), 'LIKE'));
+            break;
+        case XOOPS_MATCH_EQUAL:
+            $criteria->add(new Criteria('user_icq', '%'.$myts->addSlashes(trim($_POST['user_icq']))));
+            break;
+        case XOOPS_MATCH_CONTAIN:
+            $criteria->add(new Criteria('user_icq', '%'.$myts->addSlashes(trim($_POST['user_icq'])).'%', 'LIKE'));
+            break;
+        }
+    }
+    if ( !empty($_POST['user_aim']) ) {
+        $match = (!empty($_POST['user_aim_match'])) ? intval($_POST['user_aim_match']) : XOOPS_MATCH_START;
+        switch ($match) {
+        case XOOPS_MATCH_START:
+            $criteria->add(new Criteria('user_aim', $myts->addSlashes(trim($_POST['user_aim'])).'%', 'LIKE'));
+            break;
+        case XOOPS_MATCH_END:
+            $criteria->add(new Criteria('user_aim', '%'.$myts->addSlashes(trim($_POST['user_aim'])), 'LIKE'));
+            break;
+        case XOOPS_MATCH_EQUAL:
+            $criteria->add(new Criteria('user_aim', $myts->addSlashes(trim($_POST['user_aim']))));
+            break;
+        case XOOPS_MATCH_CONTAIN:
+            $criteria->add(new Criteria('user_aim', '%'.$myts->addSlashes(trim($_POST['user_aim'])).'%', 'LIKE'));
+            break;
+        }
+    }
+    if ( !empty($_POST['user_yim']) ) {
+        $match = (!empty($_POST['user_yim_match'])) ? intval($_POST['user_yim_match']) : XOOPS_MATCH_START;
+        switch ($match) {
+        case XOOPS_MATCH_START:
+            $criteria->add(new Criteria('user_yim', $myts->addSlashes(trim($_POST['user_yim'])).'%', 'LIKE'));
+            break;
+        case XOOPS_MATCH_END:
+            $criteria->add(new Criteria('user_yim', '%'.$myts->addSlashes(trim($_POST['user_yim'])), 'LIKE'));
+            break;
+        case XOOPS_MATCH_EQUAL:
+            $criteria->add(new Criteria('user_yim', $myts->addSlashes(trim($_POST['user_yim']))));
+            break;
+        case XOOPS_MATCH_CONTAIN:
+            $criteria->add(new Criteria('user_yim', '%'.$myts->addSlashes(trim($_POST['user_yim'])).'%', 'LIKE'));
+            break;
+        }
+    }
+    if ( !empty($_POST['user_msnm']) ) {
+        $match = (!empty($_POST['user_msnm_match'])) ? intval($_POST['user_msnm_match']) : XOOPS_MATCH_START;
+        switch ($match) {
+        case XOOPS_MATCH_START:
+            $criteria->add(new Criteria('user_msnm', $myts->addSlashes(trim($_POST['user_msnm'])).'%', 'LIKE'));
+            break;
+        case XOOPS_MATCH_END:
+            $criteria->add(new Criteria('user_msnm', '%'.$myts->addSlashes(trim($_POST['user_msnm'])), 'LIKE'));
+            break;
+        case XOOPS_MATCH_EQUAL:
+            $criteria->add(new Criteria('user_msnm', '%'.$myts->addSlashes(trim($_POST['user_msnm']))));
+            break;
+        case XOOPS_MATCH_CONTAIN:
+            $criteria->add(new Criteria('user_msnm', '%'.$myts->addSlashes(trim($_POST['user_msnm'])).'%', 'LIKE'));
+            break;
+        }
+    }
+    if ( !empty($_POST['user_from']) ) {
+        $criteria->add(new Criteria('user_from', '%'.$myts->addSlashes(trim($_POST['user_from'])).'%', 'LIKE'));
+    }
+    if ( !empty($_POST['user_intrest']) ) {
+        $criteria->add(new Criteria('user_intrest', '%'.$myts->addSlashes(trim($_POST['user_intrest'])).'%', 'LIKE'));
+    }
+    if ( !empty($_POST['user_occ']) ) {
+        $criteria->add(new Criteria('user_occ', '%'.$myts->addSlashes(trim($_POST['user_occ'])).'%', 'LIKE'));
+    }
+
+    if ( !empty($_POST['user_lastlog_more']) && is_numeric($_POST['user_lastlog_more']) ) {
+        $f_user_lastlog_more = intval(trim($_POST['user_lastlog_more']));
+        $time = time() - (60 * 60 * 24 * $f_user_lastlog_more);
+        if ( $time > 0 ) {
+            $criteria->add(new Criteria('last_login', $time, '<'));
+        }
+    }
+    if ( !empty($_POST['user_lastlog_less']) && is_numeric($_POST['user_lastlog_less']) ) {
+        $f_user_lastlog_less = intval(trim($_POST['user_lastlog_less']));
+        $time = time() - (60 * 60 * 24 * $f_user_lastlog_less);
+        if ( $time > 0 ) {
+            $criteria->add(new Criteria('last_login', $time, '>'));
+        }
+    }
+    if ( !empty($_POST['user_reg_more']) && is_numeric($_POST['user_reg_more']) ) {
+        $f_user_reg_more = intval(trim($_POST['user_reg_more']));
+        $time = time() - (60 * 60 * 24 * $f_user_reg_more);
+        if ( $time > 0 ) {
+            $criteria->add(new Criteria('user_regdate', $time, '<'));
+        }
+    }
+    if ( !empty($_POST['user_reg_less']) && is_numeric($_POST['user_reg_less']) ) {
+        $f_user_reg_less = intval($_POST['user_reg_less']);
+        $time = time() - (60 * 60 * 24 * $f_user_reg_less);
+        if ( $time > 0 ) {
+            $criteria->add(new Criteria('user_regdate', $time, '>'));
+        }
+    }
+    if ( !empty($_POST['user_posts_more']) && is_numeric($_POST['user_posts_more']) ) {
+        $criteria->add(new Criteria('posts', intval($_POST['user_posts_more']), '>'));
+    }
+    if ( !empty($_POST['user_posts_less']) && is_numeric($_POST['user_posts_less']) ) {
+        $criteria->add(new Criteria('posts', intval($_POST['user_posts_less']), '<'));
+    }
+    if ( isset($_POST['user_mailok']) ) {
+        if ( $_POST['user_mailok'] == "mailng" ) {
+            $criteria->add(new Criteria('user_mailok', 0));
+        } elseif ( $_POST['user_mailok'] == "mailok" ) {
+            $criteria->add(new Criteria('user_mailok', 1));
+        } else {
+            $criteria->add(new Criteria('user_mailok', 0, '>='));
+        }
+    }
+    if ( isset($_POST['user_type']) ) {
+        if ( $_POST['user_type'] == "inactv" ) {
+            $criteria->add(new Criteria('level', 0, '='));
+        } elseif ( $_POST['user_type'] == "actv" ) {
+            $criteria->add(new Criteria('level', 0, '>'));
+        } else {
+            $criteria->add(new Criteria('level', 0, '>='));
+        }
+    }
+
+    $validsort = array("uname", "email", "last_login", "user_regdate", "posts");
+    $sort = (!in_array($_POST['user_sort'], $validsort)) ? "uname" : $_POST['user_sort'];
+    $order = "ASC";
+    if ( isset($_POST['user_order']) && $_POST['user_order'] == "DESC") {
+        $order = "DESC";
+    }
+    $limit = (!empty($_POST['limit'])) ? intval($_POST['limit']) : 50;
+    if ( $limit == 0 || $limit > 50 ) {
+        $limit = 50;
+    }
+    $start = (!empty($_POST['start'])) ? intval($_POST['start']) : 0;
+    $member_handler =& xoops_gethandler('member');
+    $total = $member_handler->getUserCount($criteria);
+    echo "<a href='admin.php?fct=findusers&amp;op=form'>". _AM_FINDUS ."</a>&nbsp;<span style='font-weight:bold;'>&raquo;&raquo;</span>&nbsp;". _AM_RESULTS."<br /><br />";
+    if ( $total == 0 ) {
+        echo "<h4>"._AM_NOFOUND,"</h4>";
+    } elseif ( $start < $total ) {
+        echo sprintf(_AM_USERSFOUND, $total)."<br />";
+        echo "<form action='admin.php' method='post' name='memberslist' id='memberslist'><input type='hidden' name='op' value='delete_many' />
+        <table width='100%' border='0' cellspacing='1' cellpadding='4' class='outer'><tr><th align='center'><input type='checkbox' name='memberslist_checkall' id='memberslist_checkall' onclick='xoopsCheckAll(\"memberslist\", \"memberslist_checkall\");' /></th><th align='center'>"._AM_AVATAR."</th><th align='center'>"._AM_UNAME."</th><th align='center'>"._AM_REALNAME."</th><th align='center'>"._AM_EMAIL."</th><th align='center'>"._AM_PM."</th><th align='center'>"._AM_URL."</th><th align='center'>"._AM_REGDATE."</th><th align='center'>"._AM_LASTLOGIN."</th><th align='center'>"._AM_POSTS."</th><th align='center'>&nbsp;</th></tr>";
+        $criteria->setSort($sort);
+        $criteria->setOrder($order);
+        $criteria->setLimit($limit);
+        $criteria->setStart($start);
+        $foundusers = $member_handler->getUsers($criteria, true);
+        $ucount = 0;
+        foreach (array_keys($foundusers) as $j) {
+            if ($ucount % 2 == 0) {
+                $class = 'even';
+            } else {
+                $class = 'odd';
+            }
+            $ucount++;
+            $fuser_avatar = $foundusers[$j]->getVar("user_avatar") ? "<img src='".XOOPS_UPLOAD_URL."/".$foundusers[$j]->getVar("user_avatar")."' alt='' />" : "&nbsp;";
+            $fuser_name = $foundusers[$j]->getVar("name") ? $foundusers[$j]->getVar("name") : "&nbsp;";
+            echo "<tr class='$class'><td align='center'><input type='checkbox' name='memberslist_id[]' id='memberslist_id[]' value='".$foundusers[$j]->getVar("uid")."' /><input type='hidden' name='memberslist_uname[".$foundusers[$j]->getVar("uid")."]' id='memberslist_uname[".$foundusers[$j]->getVar("uid")."]' value='".$foundusers[$j]->getVar("uname")."' /></td>";
+            echo "<td>$fuser_avatar</td><td><a href='".XOOPS_URL."/userinfo.php?uid=".$foundusers[$j]->getVar("uid")."'>".$foundusers[$j]->getVar("uname")."</a></td><td>".$fuser_name."</td><td align='center'><a href='mailto:".$foundusers[$j]->getVar("email")."'><img src='".XOOPS_URL."/images/icons/email.gif' border='0' alt='";
+            printf(_SENDEMAILTO,$foundusers[$j]->getVar("uname", "E"));
+            echo "' /></a></td><td align='center'><a href='javascript:openWithSelfMain(\"".XOOPS_URL."/pmlite.php?send2=1&amp;to_userid=".$foundusers[$j]->getVar("uid")."\",\"pmlite\",450,370);'><img src='".XOOPS_URL."/images/icons/pm.gif' border='0' alt='";
+            printf(_SENDPMTO,$foundusers[$j]->getVar("uname", "E"));
+            echo "' /></a></td><td align='center'>";
+            if ( $foundusers[$j]->getVar("url","E") != "" ) {
+                echo "<a href='".$foundusers[$j]->getVar("url","E")."' target='_blank'><img src='".XOOPS_URL."/images/icons/www.gif' border='0' alt='"._VISITWEBSITE."' /></a>";
+            } else {
+                echo "&nbsp;";
+            }
+            echo "</td><td align='center'>".formatTimeStamp($foundusers[$j]->getVar("user_regdate"),"s")."</td><td align='center'>";
+            if ( $foundusers[$j]->getVar("last_login") != 0 ) {
+                echo formatTimeStamp($foundusers[$j]->getVar("last_login"),"m");
+            } else {
+                echo "&nbsp;";
+            }
+            echo "</td><td align='center'>".$foundusers[$j]->getVar("posts")."</td>";
+            echo "<td align='center'><a href='".XOOPS_URL."/modules/system/admin.php?fct=users&amp;uid=".$foundusers[$j]->getVar("uid")."&amp;op=modifyUser'>"._EDIT."</a></td></tr>\n";
+        }
+        echo "<tr class='foot'><td><select name='fct'><option value='users'>"._DELETE."</option><option value='mailusers'>"._AM_SENDMAIL."</option>";
+        $group = !empty($_POST['group']) ? intval($_POST['group']) : 0;
+        if ( $group > 0 ) {
+            // token required for add-user-to-group operation
+            $token =& XoopsMultiTokenHandler::quickCreate('groups_User');
+            $member_handler =& xoops_gethandler('member');
+            $add2group =& $member_handler->getGroup($group);
+            echo "<option value='groups' selected='selected'>".sprintf(_AM_ADD2GROUP, $add2group->getVar('name'))."</option>";
+        }
+        echo "</select>&nbsp;";
+        if (!empty($token) && is_object($token)) {
+            echo $token->getHtml();
+        }
+        if ( $group > 0 ) {
+            echo "<input type='hidden' name='groupid' value='".$group."' />";
+        }
+        echo "</td><td colspan='10'><input type='submit' value='"._SUBMIT."' /></td></tr></table></form>\n";
+        $totalpages = ceil($total / $limit);
+        if ( $totalpages > 1 ) {
+            $hiddenform = "<form name='findnext' action='admin.php' method='post'><input type='hidden' name='op' value='findusers' />";
+            foreach ( $_POST as $k => $v ) {
+                $hiddenform .= "<input type='hidden' name='".$myts->htmlSpecialChars($k)."' value='".$myts->htmlSpecialChars($myts->stripSlashesGPC($v))."' />\n";
+            }
+            if (!isset($_POST['limit'])) {
+                $hiddenform .= "<input type='hidden' name='limit' value='".$limit."' />\n";
+            }
+            if (!isset($_POST['start'])) {
+                $hiddenform .= "<input type='hidden' name='start' value='".$start."' />\n";
+            }
+            $prev = $start - $limit;
+            if ( $start - $limit >= 0 ) {
+                $hiddenform .= "<a href='#0' onclick='javascript:document.findnext.start.value=".$prev.";document.findnext.submit();'>"._AM_PREVIOUS."</a>&nbsp;\n";
+            }
+            $counter = 1;
+            $currentpage = ($start+$limit) / $limit;
+            while ( $counter <= $totalpages ) {
+                if ( $counter == $currentpage ) {
+                    $hiddenform .= "<b>".$counter."</b> ";
+                } elseif ( ($counter > $currentpage-4 && $counter < $currentpage+4) || $counter == 1 || $counter == $totalpages ) {
+                    if ( $counter == $totalpages && $currentpage < $totalpages-4 ) {
+                        $hiddenform .= "... ";
+                    }
+                    $hiddenform .= "<a href='#".$counter."' onclick='javascript:document.findnext.start.value=".($counter-1)*$limit.";document.findnext.submit();'>".$counter."</a> ";
+                    if ( $counter == 1 && $currentpage > 5 ) {
+                        $hiddenform .= "... ";
+                    }
+                }
+                $counter++;
+            }
+            $next = $start+$limit;
+            if ( $total > $next ) {
+                $hiddenform .= "&nbsp;<a href='#".$total."' onclick='javascript:document.findnext.start.value=".$next.";document.findnext.submit();'>"._AM_NEXT."</a>\n";
+            }
+            $hiddenform .= "</form>";
+            echo "<div style='text-align:center'>".$hiddenform."<br />";
+            printf(_AM_USERSFOUND, $total);
+            echo "</div>";
+        }
+    }
+}
+//CloseTable();
+xoops_cp_footer();
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/findusers/xoops_version.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/findusers/xoops_version.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/findusers/xoops_version.php	(revision 405)
@@ -0,0 +1,45 @@
+<?php
+// $Id: xoops_version.php,v 1.2 2005/03/18 12:52:38 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+$modversion['name'] = _MD_AM_FINDUSER;
+$modversion['version'] = "";
+$modversion['description'] = "Find Users";
+$modversion['author'] = "Kazumi Ono<br>( http://www.myweb.ne.jp/ )";
+$modversion['credits'] = "The XOOPS Project";
+$modversion['help'] = "findusers.html";
+$modversion['license'] = "GPL see LICENSE";
+$modversion['official'] = 1;
+$modversion['image'] = "users.gif";
+
+$modversion['hasAdmin'] = 1;
+$modversion['adminpath'] = "admin.php?fct=findusers";
+$modversion['category'] = XOOPS_SYSTEM_FINDU;
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/mailusers/xoops_version.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/mailusers/xoops_version.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/mailusers/xoops_version.php	(revision 405)
@@ -0,0 +1,45 @@
+<?php
+// $Id: xoops_version.php,v 1.2 2005/03/18 12:52:38 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+$modversion['name'] = _MD_AM_MLUS;
+$modversion['version'] = "";
+$modversion['description'] = "Send message to users via Email and PM";
+$modversion['author'] = "Kazumi Ono<br>( http://www.myweb.ne.jp/ )";
+$modversion['credits'] = "";
+$modversion['help'] = "mailusers.html";
+$modversion['license'] = "GPL see LICENSE";
+$modversion['official'] = 1;
+$modversion['image'] = "mailusers.gif";
+
+$modversion['hasAdmin'] = 1;
+$modversion['adminpath'] = "admin.php?fct=mailusers";
+$modversion['category'] = XOOPS_SYSTEM_MAILU;
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/mailusers/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/mailusers/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/mailusers/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/mailusers/mailusers.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/mailusers/mailusers.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/mailusers/mailusers.php	(revision 405)
@@ -0,0 +1,257 @@
+<?php
+// $Id: mailusers.php,v 1.6 2006/07/27 00:17:18 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+define ('SEND_SIM_PROCESS_AMMO',100);
+
+if ( !is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid()) ) {
+    exit("Access Denied");
+} else {
+    include_once XOOPS_ROOT_PATH."/class/xoopsformloader.php";
+    $op = "form";
+
+    if (!empty($_POST['op']) && $_POST['op'] == "send") {
+        $op =  $_POST['op'];
+    }
+
+    if ( $op == "form" ) {
+        xoops_cp_header();
+        //OpenTable();
+        $display_criteria = 1;
+        include XOOPS_ROOT_PATH."/modules/system/admin/mailusers/mailform.php";
+        $form->display();
+        //CloseTable();
+        xoops_cp_footer();
+    }
+
+    if ( $op == "send" && !empty($_POST['mail_send_to']) ) {
+        if(!XoopsSingleTokenHandler::quickValidate('mailusers_send')) {
+            xoops_cp_header();
+            xoops_error("Ticket Error");
+            xoops_cp_footer();
+            exit();
+        }
+
+        $added = array();
+        $added_id = array();
+        $criteria = array();
+        if ( !empty($_POST['mail_inactive']) ) {
+            $criteria[] = "level = 0";
+        } else {
+            if (!empty($_POST['mail_mailok'])) {
+                $criteria[] = 'user_mailok = 1';
+            }
+            if (!empty($_POST['mail_to_group'])) {
+                $member_handler =& xoops_gethandler('member');
+                $user_list = array();
+                foreach ($_POST['mail_to_group'] as $groupid ) {
+                    $members = $member_handler->getUsersByGroup($groupid, false);
+                    // Mith: Changed this to not fetch user objects with getUsersByGroup 
+                    // as it is resource-intensive and all we want is the userIDs
+                    $user_list = array_merge($members, $user_list);
+                        
+                    // RMV: changed this because makes more sense to me
+                    // if options all grouped by 'AND', not 'OR'
+                    /*
+                    foreach ($members as $member) {
+                        if (!in_array($member->getVar('uid'), $user_list)) {
+                            $user_list[] = $member->getVar('uid');
+                        }
+                    }
+                    */
+                    //  if (!in_array($member->getVar('uid'), $added_id) ) {
+                    //      $added_id[] = $member->getVar('uid');
+                    //      $added[] =& $member;
+                    //      unset($member);
+                    //  }
+                    //}
+                }
+                if (!empty($user_list)) {
+                    $criteria[] = 'uid IN (' . join(',', $user_list) . ')';
+                }
+            }
+            if ( !empty($_POST['mail_lastlog_min']) ) {
+                $f_mail_lastlog_min = trim($_POST['mail_lastlog_min']);
+                $time = mktime(0,0,0,substr($f_mail_lastlog_min,5,2),substr($f_mail_lastlog_min,8,2),substr($f_mail_lastlog_min,0,4));
+                if ( $time > 0 ) {
+                    $criteria[] = "last_login > $time";
+                }
+            }
+            if ( !empty($_POST['mail_lastlog_max']) ) {
+                $f_mail_lastlog_max = trim($_POST['mail_lastlog_max']);
+                $time = mktime(0,0,0,substr($f_mail_lastlog_max,5,2),substr($f_mail_lastlog_max,8,2),substr($f_mail_lastlog_max,0,4));
+                if ( $time > 0 ) {
+                    $criteria[] = "last_login < $time";
+                }
+            }
+            if ( !empty($_POST['mail_idle_more']) && is_numeric($_POST['mail_idle_more']) ) {
+                $f_mail_idle_more = intval(trim($_POST['mail_idle_more']));
+                $time = 60 * 60 * 24 * $f_mail_idle_more;
+                $time = time() - $time;
+                if ( $time > 0 ) {
+                    $criteria[] = "last_login < $time";
+                }
+            }
+            if ( !empty($_POST['mail_idle_less']) && is_numeric($_POST['mail_idle_less']) ) {
+                $f_mail_idle_less = intval(trim($_POST['mail_idle_less']));
+                $time = 60 * 60 * 24 * $f_mail_idle_less;
+                $time = time() - $time;
+                if ( $time > 0 ) {
+                    $criteria[] = "last_login > $time";
+                }
+            }
+        }
+        if ( !empty($_POST['mail_regd_min']) ) {
+            $f_mail_regd_min = trim($_POST['mail_regd_min']);
+            $time = mktime(0,0,0,substr($f_mail_regd_min,5,2),substr($f_mail_regd_min,8,2),substr($f_mail_regd_min,0,4));
+            if ( $time > 0 ) {
+                $criteria[] = "user_regdate > $time";
+            }
+        }
+        if ( !empty($_POST['mail_regd_max']) ) {
+            $f_mail_regd_max = trim($_POST['mail_regd_max']);
+            $time = mktime(0,0,0,substr($f_mail_regd_max,5,2),substr($f_mail_regd_max,8,2),substr($f_mail_regd_max,0,4));
+            if ( $time > 0 ) {
+                $criteria[] = "user_regdate < $time";
+            }
+        }
+        if ( !empty($criteria) ) {
+            if ( empty($_POST['mail_inactive']) ) {
+                $criteria[] = "level > 0";
+            }
+            $criteria_object = new CriteriaCompo();
+            foreach ($criteria as $c) {
+                list ($field, $op, $value) = split(' ', $c);
+                $criteria_object->add(new Criteria($field,$value,$op), 'AND');
+            }
+            $member_handler =& xoops_gethandler('member');
+            $getusers = $member_handler->getUsers($criteria_object);
+            foreach (array_keys($getusers) as $i) {
+                if ( !in_array($getusers[$i]->getVar("uid"), $added_id) ) {
+                    $added[] =& $getusers[$i];
+                    $added_id[] = $getusers[$i]->getVar("uid");
+                }
+            }
+        }
+        if ( !empty($_POST['mail_to_user']) ) {
+            foreach ($_POST['mail_to_user'] as $to_user) {
+                if ( !in_array($to_user, $added_id) ) {
+                    $added[] =& new XoopsUser($to_user);
+                    $added_id[] = $to_user;
+                }
+            }
+        }
+        $added_count = count($added);
+        xoops_cp_header();
+        //OpenTable();
+        if ( $added_count > 0 ) {
+            $mail_start = !empty($_POST['mail_start']) ? $_POST['mail_start'] : 0;
+            $mail_end = ($added_count > ($mail_start + SEND_SIM_PROCESS_AMMO)) ? ($mail_start + SEND_SIM_PROCESS_AMMO) : $added_count;
+            $myts =& MyTextSanitizer::getInstance();
+            $xoopsMailer =& getMailer();
+            for ( $i = $mail_start; $i < $mail_end; $i++) {
+                $xoopsMailer->setToUsers($added[$i]);
+            }
+            $xoopsMailer->setFromName($myts->oopsStripSlashesGPC($_POST['mail_fromname']));
+            $xoopsMailer->setFromEmail($myts->oopsStripSlashesGPC($_POST['mail_fromemail']));
+            $xoopsMailer->setSubject($myts->oopsStripSlashesGPC($_POST['mail_subject']));
+            $xoopsMailer->setBody($myts->oopsStripSlashesGPC($_POST['mail_body']));
+            if ( in_array("mail", $_POST['mail_send_to']) ) {
+                $xoopsMailer->useMail();
+            }
+            if ( in_array("pm", $_POST['mail_send_to']) && empty($_POST['mail_inactive']) ) {
+                $xoopsMailer->usePM();
+            }
+            $xoopsMailer->send(true);
+            echo $xoopsMailer->getSuccess();
+            echo $xoopsMailer->getErrors();
+
+
+            if ( $added_count > $mail_end ) {
+                $form = new XoopsThemeForm(_AM_SENDMTOUSERS, "mailusers", "admin.php?fct=mailusers");
+                $form->addElement(new XoopsFormToken(XoopsSingleTokenHandler::quickCreate('mailusers_send')));
+                if ( !empty($_POST['mail_to_group']) ) {
+                    foreach ( $_POST['mail_to_group'] as $mailgroup) {
+                        $group_hidden = new XoopsFormHidden("mail_to_group[]", $mailgroup);
+                        $form->addElement($group_hidden);
+                    }
+                }
+                if(isset($_POST['mail_inactive']))
+                    $form->addElement(new XoopsFormHidden("mail_inactive", intval($_POST['mail_inactive'])));
+                if(isset($_POST['mail_mailok']))
+                    $form->addElement(new XoopsFormHidden("mail_mailok", intval($_POST['mail_mailok'])));
+                $lastlog_min_hidden = new XoopsFormHidden("mail_lastlog_min", $myts->makeTboxData4PreviewInForm($_POST['mail_lastlog_min']));
+                $lastlog_max_hidden = new XoopsFormHidden("mail_lastlog_max", $myts->makeTboxData4PreviewInForm($_POST['mail_lastlog_max']));
+                $regd_min_hidden = new XoopsFormHidden("mail_regd_min", $myts->makeTboxData4PreviewInForm($_POST['mail_regd_max']));
+                $regd_max_hidden = new XoopsFormHidden("mail_regd_max", $myts->makeTboxData4PreviewInForm($_POST['mail_regd_max']));
+                $idle_more_hidden = new XoopsFormHidden("mail_idle_more", $myts->makeTboxData4PreviewInForm($_POST['mail_idle_more']));
+                $idle_less_hidden = new XoopsFormHidden("mail_idle_less", $myts->makeTboxData4PreviewInForm($_POST['mail_idle_less']));
+                $fname_hidden = new XoopsFormHidden("mail_fromname", $myts->makeTboxData4PreviewInForm($_POST['mail_fromname']));
+                $femail_hidden = new XoopsFormHidden("mail_fromemail", $myts->makeTboxData4PreviewInForm($_POST['mail_fromemail']));
+                $subject_hidden = new XoopsFormHidden("mail_subject", $myts->makeTboxData4PreviewInForm($_POST['mail_subject']));
+                $body_hidden = new XoopsFormHidden("mail_body", $myts->makeTareaData4PreviewInForm($_POST['mail_body']));
+                $start_hidden = new XoopsFormHidden("mail_start", $mail_end);
+                $op_hidden = new XoopsFormHidden("op", "send");
+                $submit_button = new XoopsFormButton("", "mail_submit", _AM_SENDNEXT, "submit");
+                $sent_label = new XoopsFormLabel(_AM_SENT, sprintf(_AM_SENTNUM, $_POST['mail_start']+1, $mail_end, $added_count));
+                $form->addElement($sent_label);
+                $form->addElement($lastlog_min_hidden);
+                $form->addElement($lastlog_max_hidden);
+                $form->addElement($regd_min_hidden);
+                $form->addElement($regd_max_hidden);
+                $form->addElement($idle_more_hidden);
+                $form->addElement($idle_less_hidden);
+                $form->addElement($fname_hidden);
+                $form->addElement($femail_hidden);
+                $form->addElement($subject_hidden);
+                $form->addElement($body_hidden);
+                if (in_array('mail', $_POST['mail_send_to'])) {
+                    $to_hidden = new XoopsFormHidden('mail_send_to[]', 'mail');
+                    $form->addElement($to_hidden);
+                }
+                if (in_array('pm', $_POST['mail_send_to']) && empty($_POST['mail_inactive'])) {
+                    $to_hidden = new XoopsFormHidden('mail_send_to[]', 'pm');
+                    $form->addElement($to_hidden);
+                }
+                $form->addElement($op_hidden);
+                $form->addElement($start_hidden);
+                $form->addElement($submit_button);
+                $form->display();
+            } else {
+                echo "<h4>"._AM_SENDCOMP."</h4>";
+            }
+        } else {
+            echo "<h4>"._AM_NOUSERMATCH."</h4>";
+        }
+        //CloseTable();
+        xoops_cp_footer();
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/mailusers/main.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/mailusers/main.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/mailusers/main.php	(revision 405)
@@ -0,0 +1,33 @@
+<?php
+// $Id: main.php,v 1.2 2005/03/18 12:52:38 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+include_once XOOPS_ROOT_PATH."/modules/system/admin/mailusers/mailusers.php";
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/mailusers/mailform.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/mailusers/mailform.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/mailusers/mailform.php	(revision 405)
@@ -0,0 +1,102 @@
+<?php
+// $Id: mailform.php,v 1.4 2005/08/03 12:39:16 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+$form = new XoopsThemeForm(_AM_SENDMTOUSERS, "mailusers", "admin.php?fct=mailusers");
+$form->addElement(new XoopsFormToken(XoopsSingleTokenHandler::quickCreate('mailusers_send')));
+
+// from finduser section
+if (!empty($_POST['memberslist_id'])) {
+    $user_count = count($_POST['memberslist_id']);
+    $display_names = "";
+    for ( $i = 0; $i < $user_count; $i++ ) {
+        $uid_hidden = new XoopsFormHidden("mail_to_user[]", $_POST['memberslist_id'][$i]);
+        $form->addElement($uid_hidden);
+        $display_names .= "<a href='".XOOPS_URL."/userinfo.php?uid=".$_POST['memberslist_id'][$i]."' target='_blank'>".$_POST['memberslist_uname'][$_POST['memberslist_id'][$i]]."</a>, ";
+        unset($uid_hidden);
+    }
+    $users_label = new XoopsFormLabel(_AM_SENDTOUSERS2, substr($display_names, 0, -2));
+    $form->addElement($users_label);
+    $display_criteria = 0;
+}
+if ( !empty($display_criteria) ) {
+    $selected_groups = array();
+    $group_select = new XoopsFormSelectGroup(_AM_GROUPIS."<br />", "mail_to_group", false, $selected_groups, 5, true);
+    $lastlog_min = new XoopsFormText(_AM_LASTLOGMIN."<br />"._AM_TIMEFORMAT."<br />", "mail_lastlog_min", 20, 10);
+    $lastlog_max = new XoopsFormText(_AM_LASTLOGMAX."<br />"._AM_TIMEFORMAT."<br />", "mail_lastlog_max", 20, 10);
+    $regd_min = new XoopsFormText(_AM_REGDMIN."<br />"._AM_TIMEFORMAT."<br />", "mail_regd_min", 20, 10);
+    $regd_max = new XoopsFormText(_AM_REGDMAX."<br />"._AM_TIMEFORMAT."<br />", "mail_regd_max", 20, 10);
+    $idle_more = new XoopsFormText(_AM_IDLEMORE."<br />", "mail_idle_more", 10, 5);
+    $idle_less = new XoopsFormText(_AM_IDLELESS."<br />", "mail_idle_less", 10, 5);
+    $mailok_cbox = new XoopsFormCheckBox('', 'mail_mailok');
+    $mailok_cbox->addOption(1, _AM_MAILOK);
+    $inactive_cbox = new XoopsFormCheckBox(_AM_INACTIVE."<br />", "mail_inactive");
+    $inactive_cbox->addOption(1, _AMIFCHECKD);
+    $inactive_cbox->setExtra("onclick='javascript:disableElement(\"mail_lastlog_min\");disableElement(\"mail_lastlog_max\");disableElement(\"mail_idle_more\");disableElement(\"mail_idle_less\");disableElement(\"mail_to_group[]\");'");
+    $criteria_tray = new XoopsFormElementTray(_AM_SENDTOUSERS, "<br /><br />");
+    $criteria_tray->addElement($group_select);
+    $criteria_tray->addElement($lastlog_min);
+    $criteria_tray->addElement($lastlog_max);
+    $criteria_tray->addElement($idle_more);
+    $criteria_tray->addElement($idle_less);
+    $criteria_tray->addElement($mailok_cbox);
+    $criteria_tray->addElement($inactive_cbox);
+    $criteria_tray->addElement($regd_min);
+    $criteria_tray->addElement($regd_max);
+    $form->addElement($criteria_tray);
+}
+
+$fname_text = new XoopsFormText(_AM_MAILFNAME, "mail_fromname", 30, 255, htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES));
+$fromemail = !empty($xoopsConfig['adminmail']) ? $xoopsConfig['adminmail'] : $xoopsUser->getVar("email", "E");
+$femail_text = new XoopsFormText(_AM_MAILFMAIL, "mail_fromemail", 30, 255, $fromemail);
+//$subject_caption = _AM_MAILSUBJECT."<br /><br /><span style='font-size:x-small;font-weight:bold;'>"._AM_MAILTAGS."</span><br /><span style='font-size:x-small;font-weight:normal;'>"._AM_MAILTAGS1."<br />"._AM_MAILTAGS2."<br />"._AM_MAILTAGS3."</span>";
+$subject_caption = _AM_MAILSUBJECT."<br /><br /><span style='font-size:x-small;font-weight:bold;'>"._AM_MAILTAGS."</span><br /><span style='font-size:x-small;font-weight:normal;'>"._AM_MAILTAGS2."</span>";
+$subject_text = new XoopsFormText($subject_caption, "mail_subject", 50, 255);
+$body_caption = _AM_MAILBODY."<br /><br /><span style='font-size:x-small;font-weight:bold;'>"._AM_MAILTAGS."</span><br /><span style='font-size:x-small;font-weight:normal;'>"._AM_MAILTAGS1."<br />"._AM_MAILTAGS2."<br />"._AM_MAILTAGS3."<br />"._AM_MAILTAGS4."</span>";
+$body_text = new XoopsFormTextArea($body_caption, "mail_body", "", 10);
+$to_checkbox = new XoopsFormCheckBox(_AM_SENDTO, "mail_send_to", "mail");
+$to_checkbox->addOption("mail", _AM_EMAIL);
+$to_checkbox->addOption("pm", _AM_PM);
+$start_hidden = new XoopsFormHidden("mail_start", 0);
+$op_hidden = new XoopsFormHidden("op", "send");
+$submit_button = new XoopsFormButton("", "mail_submit", _SEND, "submit");
+
+$form->addElement($fname_text);
+$form->addElement($femail_text);
+$form->addElement($subject_text);
+$form->addElement($body_text);
+$form->addElement($to_checkbox);
+$form->addElement($op_hidden);
+$form->addElement($start_hidden);
+$form->addElement($submit_button);
+$form->setRequired($subject_text);
+$form->setRequired($body_text);
+//$form->setRequired($to_checkbox);
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/images/xoops_version.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/images/xoops_version.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/images/xoops_version.php	(revision 405)
@@ -0,0 +1,45 @@
+<?php
+// $Id: xoops_version.php,v 1.2 2005/03/18 12:52:38 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+$modversion['name'] = _MD_AM_IMAGES;
+$modversion['version'] = "";
+$modversion['description'] = "XOOPS Image Manager";
+$modversion['author'] = "";
+$modversion['credits'] = "The XOOPS Project";
+$modversion['help'] = "images.html";
+$modversion['license'] = "GPL see LICENSE";
+$modversion['official'] = 1;
+$modversion['image'] = "images.gif";
+
+$modversion['hasAdmin'] = 1;
+$modversion['adminpath'] = "admin.php?fct=images";
+$modversion['category'] = XOOPS_SYSTEM_IMAGE;
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/images/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/images/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/images/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/images/main.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/images/main.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/images/main.php	(revision 405)
@@ -0,0 +1,504 @@
+<?php
+// $Id: main.php,v 1.4 2005/08/03 12:39:16 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+/**
+ * @brief display error message & exit (Tentative)
+ */
+function system_images_error($message)
+{
+    xoops_cp_header();
+    xoops_error($message);
+    xoops_cp_footer();
+    exit();
+}
+
+if ( !is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid()) ) {
+    exit("Access Denied");
+} else {
+    $op = 'list';
+    if (isset($_GET['op'])) {
+        $op = trim($_GET['op']);
+    } elseif (isset($_POST['op'])) {
+        $op = $_POST['op'];
+    }
+    if (isset($_GET['image_id'])) {
+        $image_id = intval($_GET['image_id']);
+    }
+    if (isset($_GET['imgcat_id'])) {
+        $imgcat_id = intval($_GET['imgcat_id']);
+    }
+    if ($op == 'list') {
+        $imgcat_handler = xoops_gethandler('imagecategory');
+        $imagecategorys =& $imgcat_handler->getObjects();
+        xoops_cp_header();
+        echo '<h4 style="text-align:left">'._IMGMANAGER.'</h4><ul>';
+        $catcount = count($imagecategorys);
+        $image_handler =& xoops_gethandler('image');
+        for ($i = 0; $i < $catcount; $i++) {
+            $count = $image_handler->getCount(new Criteria('imgcat_id', $imagecategorys[$i]->getVar('imgcat_id')));
+            echo '<li>'.$imagecategorys[$i]->getVar('imgcat_name').' ('.sprintf(_NUMIMAGES, '<b>'.$count.'</b>').') [<a href="admin.php?fct=images&amp;op=listimg&amp;imgcat_id='.$imagecategorys[$i]->getVar('imgcat_id').'">'._LIST.'</a>] [<a href="admin.php?fct=images&amp;op=editcat&amp;imgcat_id='.$imagecategorys[$i]->getVar('imgcat_id').'">'._EDIT.'</a>]';
+            if ($imagecategorys[$i]->getVar('imgcat_type') == 'C') {
+                echo ' [<a href="admin.php?fct=images&amp;op=delcat&amp;imgcat_id='.$imagecategorys[$i]->getVar('imgcat_id').'">'._DELETE.'</a>]';
+            }
+            echo '</li>';
+        }
+        echo '</ul>';
+        include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
+        if (!empty($catcount)) {
+            $form = new XoopsThemeForm(_ADDIMAGE, 'image_form', 'admin.php');
+            $form->setExtra('enctype="multipart/form-data"');
+            $form->addElement(new XoopsFormToken(XoopsSingleTokenHandler::quickCreate('images_addfile')));
+            $form->addElement(new XoopsFormText(_IMAGENAME, 'image_nicename', 50, 255), true);
+            $select = new XoopsFormSelect(_IMAGECAT, 'imgcat_id');
+            $select->addOptionArray($imgcat_handler->getList());
+            $form->addElement($select, true);
+            $form->addElement(new XoopsFormFile(_IMAGEFILE, 'image_file', 5000000));
+            $form->addElement(new XoopsFormText(_IMGWEIGHT, 'image_weight', 3, 4, 0));
+            $form->addElement(new XoopsFormRadioYN(_IMGDISPLAY, 'image_display', 1, _YES, _NO));
+            $form->addElement(new XoopsFormHidden('op', 'addfile'));
+            $form->addElement(new XoopsFormHidden('fct', 'images'));
+            $form->addElement(new XoopsFormButton('', 'img_button', _SUBMIT, 'submit'));
+            $form->display();
+        }
+        $form = new XoopsThemeForm(_MD_ADDIMGCAT, 'imagecat_form', 'admin.php');
+        $form->addElement(new XoopsFormToken(XoopsSingleTokenHandler::quickCreate('images_addcat')));
+        $form->addElement(new XoopsFormText(_MD_IMGCATNAME, 'imgcat_name', 50, 255), true);
+        $form->addElement(new XoopsFormSelectGroup(_MD_IMGCATRGRP, 'readgroup', true, XOOPS_GROUP_ADMIN, 5, true));
+        $form->addElement(new XoopsFormSelectGroup(_MD_IMGCATWGRP, 'writegroup', true, XOOPS_GROUP_ADMIN, 5, true));
+        $form->addElement(new XoopsFormText(_IMGMAXSIZE, 'imgcat_maxsize', 10, 10, 50000));
+        $form->addElement(new XoopsFormText(_IMGMAXWIDTH, 'imgcat_maxwidth', 3, 4, 120));
+        $form->addElement(new XoopsFormText(_IMGMAXHEIGHT, 'imgcat_maxheight', 3, 4, 120));
+        $form->addElement(new XoopsFormText(_MD_IMGCATWEIGHT, 'imgcat_weight', 3, 4, 0));
+        $form->addElement(new XoopsFormRadioYN(_MD_IMGCATDISPLAY, 'imgcat_display', 1, _YES, _NO));
+        $storetype = new XoopsFormRadio(_MD_IMGCATSTRTYPE.'<br /><span style="color:#ff0000;">'._MD_STRTYOPENG.'</span>', 'imgcat_storetype', 'file');
+        $storetype->addOptionArray(array('file' => _MD_ASFILE, 'db' => _MD_INDB));
+        $form->addElement($storetype);
+        $form->addElement(new XoopsFormHidden('op', 'addcat'));
+        $form->addElement(new XoopsFormHidden('fct', 'images'));
+        $form->addElement(new XoopsFormButton('', 'imgcat_button', _SUBMIT, 'submit'));
+        $form->display();
+        xoops_cp_footer();
+        exit();
+    }
+
+    if ($op == 'listimg') {
+        $imgcat_id = intval($imgcat_id);
+        if ($imgcat_id <= 0) {
+            redirect_header('admin.php?fct=images',1);
+        }
+        $imgcat_handler = xoops_gethandler('imagecategory');
+        $imagecategory =& $imgcat_handler->get($imgcat_id);
+        if (!is_object($imagecategory)) {
+            redirect_header('admin.php?fct=images',1);
+        }
+        $image_handler = xoops_gethandler('image');
+        xoops_cp_header();
+        echo '<a href="admin.php?fct=images">'. _MD_IMGMAIN .'</a>&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;'.$imagecategory->getVar('imgcat_name').'<br /><br />';
+        $criteria = new Criteria('imgcat_id', $imgcat_id);
+        $imgcount = $image_handler->getCount($criteria);
+        $start = isset($_GET['start']) ? intval($_GET['start']) : 0;
+        $criteria->setStart($start);
+        $criteria->setLimit(20);
+        $images =& $image_handler->getObjects($criteria, true, false);
+
+        $token =& XoopsSingleTokenHandler::quickCreate('images_save');
+
+        echo '<form action="admin.php" method="post">';
+        echo $token->getHtml();
+        foreach (array_keys($images) as $i) {
+
+            echo '<table width="100%" class="outer"><tr><td width="30%" rowspan="6">';
+            if ($imagecategory->getVar('imgcat_storetype') == 'db') {
+                echo '<img src="'.XOOPS_URL.'/image.php?id='.$i.'" alt="" />';
+            } else {
+                echo '<img src="'.XOOPS_UPLOAD_URL.'/'.$images[$i]->getVar('image_name').'" alt="" />';
+            }
+            echo '</td><td class="head">'._IMAGENAME,'</td><td class="even"><input type="hidden" name="image_id[]" value="'.$i.'" /><input type="text" name="image_nicename[]" value="'.$images[$i]->getVar('image_nicename', 'E').'" size="20" maxlength="255" /></td></tr><tr><td class="head">'._IMAGEMIME.'</td><td class="odd">'.$images[$i]->getVar('image_mimetype').'</td></tr><tr><td class="head">'._IMAGECAT.'</td><td class="even"><select name="imgcat_id[]" size="1">';
+            $list =& $imgcat_handler->getList(array(), null, null, $imagecategory->getVar('imgcat_storetype'));
+            foreach ($list as $value => $name) {
+                $sel = '';
+                if ($value == $images[$i]->getVar('imgcat_id')) {
+                    $sel = ' selected="selected"';
+                }
+                echo '<option value="'.$value.'"'.$sel.'>'.$name.'</option>';
+            }
+            echo '</select></td></tr><tr><td class="head">'._IMGWEIGHT.'</td><td class="odd"><input type="text" name="image_weight[]" value="'.$images[$i]->getVar('image_weight').'" size="3" maxlength="4" /></td></tr><tr><td class="head">'._IMGDISPLAY.'</td><td class="even"><input type="checkbox" name="image_display[]" value="1"';
+            if ($images[$i]->getVar('image_display') == 1) {
+                echo ' checked="checked"';
+            }
+            echo ' /></td></tr><tr><td class="head">&nbsp;</td><td class="odd"><a href="admin.php?fct=images&amp;op=delfile&amp;image_id='.$i.'">'._DELETE.'</a></td></tr></table><br />';
+        }
+        if ($imgcount > 0) {
+            if ($imgcount > 20) {
+                include_once XOOPS_ROOT_PATH.'/class/pagenav.php';
+                $nav = new XoopsPageNav($imgcount, 20, $start, 'start', 'fct=images&amp;op=listimg&amp;imgcat_id='.$imgcat_id);
+                echo '<div text-align="right">'.$nav->renderNav().'</div>';
+            }
+            echo '<div style="text-align:center;"><input type="hidden" name="op" value="save" /><input type="hidden" name="fct" value="images" /><input type="submit" name="submit" value="'._SUBMIT.'" /></div></form>';
+        }
+        xoops_cp_footer();
+        exit();
+    }
+
+    if ($op == 'save') {
+        if(!XoopsSingleTokenHandler::quickValidate('images_save')) {
+            system_images_error("Ticket Error");
+        }
+
+        $count = count($_POST['image_id']);
+        if ($count > 0) {
+            $image_handler =& xoops_gethandler('image');
+            $error = array();
+            for ($i = 0; $i < $count; $i++) {
+                $image =& $image_handler->get($_POST['image_id'][$i]);
+                if (!is_object($image)) {
+                    $error[] = sprintf(_FAILGETIMG, $_POST['image_id'][$i]);
+                    continue;
+                }
+                $image_display[$i] = empty($_POST['image_display'][$i]) ? 0 : 1;
+                $image->setVar('image_display', $image_display[$i]);
+                $image->setVar('image_weight', $_POST['image_weight'][$i]);
+                $image->setVar('image_nicename', $_POST['image_nicename'][$i]);
+                $image->setVar('imgcat_id', $_POST['imgcat_id'][$i]);
+                if (!$image_handler->insert($image)) {
+                    $error[] = sprintf(_FAILSAVEIMG, $_POST['image_id'][$i]);
+                }
+            }
+            if (count($error) > 0) {
+                xoops_cp_header();
+                foreach ($error as $err) {
+                    echo $err.'<br />';
+                }
+                xoops_cp_footer();
+                exit();
+            }
+        }
+        redirect_header('admin.php?fct=images',2,_MD_AM_DBUPDATED);
+    }
+
+    if ($op == 'addfile') {
+        if(!XoopsSingleTokenHandler::quickValidate('images_addfile')) {
+            system_images_error("Ticket Error");
+        }
+
+        $imgcat_handler =& xoops_gethandler('imagecategory');
+        $imagecategory =& $imgcat_handler->get(intval($_POST['imgcat_id']));
+        if (!is_object($imagecategory)) {
+            redirect_header('admin.php?fct=images',1);
+        }
+        include_once XOOPS_ROOT_PATH.'/class/uploader.php';
+        $uploader = new XoopsMediaUploader(XOOPS_UPLOAD_PATH, array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/x-png', 'image/png', 'image/bmp'), $imagecategory->getVar('imgcat_maxsize'), $imagecategory->getVar('imgcat_maxwidth'), $imagecategory->getVar('imgcat_maxheight'));
+        $uploader->setAllowedExtensions(array('gif', 'jpeg', 'jpg', 'png', 'bmp'));
+        $uploader->setPrefix('img');
+        $err = array();
+        $ucount = count($_POST['xoops_upload_file']);
+        for ($i = 0; $i < $ucount; $i++) {
+            if ($uploader->fetchMedia($_POST['xoops_upload_file'][$i])) {
+                if (!$uploader->upload()) {
+                    $err[] = $uploader->getErrors();
+                } else {
+                    $image_handler =& xoops_gethandler('image');
+                    $image =& $image_handler->create();
+                    $image->setVar('image_name', $uploader->getSavedFileName());
+                    $image->setVar('image_nicename', $_POST['image_nicename']);
+                    $image->setVar('image_mimetype', $uploader->getMediaType());
+                    $image->setVar('image_created', time());
+                    $image_display = empty($_POST['image_display']) ? 0 : 1;
+                    $image->setVar('image_display', $image_display);
+                    $image->setVar('image_weight', $_POST['image_weight']);
+                    $image->setVar('imgcat_id', $_POST['imgcat_id']);
+                    if ($imagecategory->getVar('imgcat_storetype') == 'db') {
+                        $fp = @fopen($uploader->getSavedDestination(), 'rb');
+                        $fbinary = @fread($fp, filesize($uploader->getSavedDestination()));
+                        @fclose($fp);
+                        $image->setVar('image_body', $fbinary, true);
+                        @unlink($uploader->getSavedDestination());
+                    }
+                    if (!$image_handler->insert($image)) {
+                        $err[] = sprintf(_FAILSAVEIMG, $image->getVar('image_nicename'));
+                    }
+                }
+            } else {
+                $err[] = sprintf(_FAILFETCHIMG, $i);
+            }
+        }
+        if (count($err) > 0) {
+            xoops_cp_header();
+            xoops_error($err);
+            xoops_cp_footer();
+            exit();
+        }
+        redirect_header('admin.php?fct=images',2,_MD_AM_DBUPDATED);
+    }
+
+    if ($op == 'addcat') {
+        if(!XoopsSingleTokenHandler::quickValidate('images_addcat')) {
+            system_images_error("Ticket Error");
+        }
+
+        $imgcat_handler =& xoops_gethandler('imagecategory');
+        $imagecategory =& $imgcat_handler->create();
+        $imagecategory->setVar('imgcat_name', $_POST['imgcat_name']);
+        $imagecategory->setVar('imgcat_maxsize', $_POST['imgcat_maxsize']);
+        $imagecategory->setVar('imgcat_maxwidth', $_POST['imgcat_maxwidth']);
+        $imagecategory->setVar('imgcat_maxheight', $_POST['imgcat_maxheight']);
+        $imgcat_display = empty($_POST['imgcat_display']) ? 0 : 1;
+        $imagecategory->setVar('imgcat_display', $imgcat_display);
+        $imagecategory->setVar('imgcat_weight', $_POST['imgcat_weight']);
+        $imagecategory->setVar('imgcat_storetype', $_POST['imgcat_storetype']);
+        $imagecategory->setVar('imgcat_type', 'C');
+        if (!$imgcat_handler->insert($imagecategory)) {
+            exit();
+        }
+        $newid = $imagecategory->getVar('imgcat_id');
+        $imagecategoryperm_handler =& xoops_gethandler('groupperm');
+        if (!isset($_POST['readgroup'])) {
+            $readgroup = array();
+        } else {
+            $readgroup = $_POST['readgroup'];
+        }
+        if (!in_array(XOOPS_GROUP_ADMIN, $readgroup)) {
+            array_push($readgroup, XOOPS_GROUP_ADMIN);
+        }
+        foreach ($readgroup as $rgroup) {
+            $imagecategoryperm =& $imagecategoryperm_handler->create();
+            $imagecategoryperm->setVar('gperm_groupid', $rgroup);
+            $imagecategoryperm->setVar('gperm_itemid', $newid);
+            $imagecategoryperm->setVar('gperm_name', 'imgcat_read');
+            $imagecategoryperm->setVar('gperm_modid', 1);
+            $imagecategoryperm_handler->insert($imagecategoryperm);
+            unset($imagecategoryperm);
+        }
+        if (!isset($_POST['writegroup'])) {
+            $writegroup = array();
+        } else {
+            $writegroup = $_POST['writegroup'];
+        }
+        if (!in_array(XOOPS_GROUP_ADMIN, $writegroup)) {
+            array_push($writegroup, XOOPS_GROUP_ADMIN);
+        }
+        foreach ($writegroup as $wgroup) {
+            $imagecategoryperm =& $imagecategoryperm_handler->create();
+            $imagecategoryperm->setVar('gperm_groupid', $wgroup);
+            $imagecategoryperm->setVar('gperm_itemid', $newid);
+            $imagecategoryperm->setVar('gperm_name', 'imgcat_write');
+            $imagecategoryperm->setVar('gperm_modid', 1);
+            $imagecategoryperm_handler->insert($imagecategoryperm);
+            unset($imagecategoryperm);
+        }
+        redirect_header('admin.php?fct=images',2,_MD_AM_DBUPDATED);
+    }
+
+    if ($op == 'editcat') {
+        if ($imgcat_id <= 0) {
+            redirect_header('admin.php?fct=images',1);
+        }
+        $imgcat_handler = xoops_gethandler('imagecategory');
+        $imagecategory =& $imgcat_handler->get($imgcat_id);
+        if (!is_object($imagecategory)) {
+            redirect_header('admin.php?fct=images',1);
+        }
+        include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
+        $imagecategoryperm_handler =& xoops_gethandler('groupperm');
+        $form = new XoopsThemeForm(_MD_EDITIMGCAT, 'imagecat_form', 'admin.php');
+        $form->addElement(new XoopsFormToken(XoopsSingleTokenHandler::quickCreate('images_updatecat')));
+        $form->addElement(new XoopsFormText(_MD_IMGCATNAME, 'imgcat_name', 50, 255, $imagecategory->getVar('imgcat_name')), true);
+        $form->addElement(new XoopsFormSelectGroup(_MD_IMGCATRGRP, 'readgroup', true, $imagecategoryperm_handler->getGroupIds('imgcat_read', $imgcat_id), 5, true));
+        $form->addElement(new XoopsFormSelectGroup(_MD_IMGCATWGRP, 'writegroup', true, $imagecategoryperm_handler->getGroupIds('imgcat_write', $imgcat_id), 5, true));
+        $form->addElement(new XoopsFormText(_IMGMAXSIZE, 'imgcat_maxsize', 10, 10, $imagecategory->getVar('imgcat_maxsize')));
+        $form->addElement(new XoopsFormText(_IMGMAXWIDTH, 'imgcat_maxwidth', 3, 4, $imagecategory->getVar('imgcat_maxwidth')));
+        $form->addElement(new XoopsFormText(_IMGMAXHEIGHT, 'imgcat_maxheight', 3, 4, $imagecategory->getVar('imgcat_maxheight')));
+        $form->addElement(new XoopsFormText(_MD_IMGCATWEIGHT, 'imgcat_weight', 3, 4, $imagecategory->getVar('imgcat_weight')));
+        $form->addElement(new XoopsFormRadioYN(_MD_IMGCATDISPLAY, 'imgcat_display', $imagecategory->getVar('imgcat_display'), _YES, _NO));
+        $storetype = array('db' => _MD_INDB, 'file' => _MD_ASFILE);
+        $form->addElement(new XoopsFormLabel(_MD_IMGCATSTRTYPE, $storetype[$imagecategory->getVar('imgcat_storetype')]));
+        $form->addElement(new XoopsFormHidden('imgcat_id', $imgcat_id));
+        $form->addElement(new XoopsFormHidden('op', 'updatecat'));
+        $form->addElement(new XoopsFormHidden('fct', 'images'));
+        $form->addElement(new XoopsFormButton('', 'imgcat_button', _SUBMIT, 'submit'));
+        xoops_cp_header();
+        echo '<a href="admin.php?fct=images">'. _MD_IMGMAIN .'</a>&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;'.$imagecategory->getVar('imgcat_name').'<br /><br />';
+        $form->display();
+        xoops_cp_footer();
+        exit();
+    }
+
+    if ($op == 'updatecat') {
+        if(!XoopsSingleTokenHandler::quickValidate('images_updatecat')) {
+            system_images_error("Ticket Error");
+        }
+
+        $imgcat_id = !empty($_POST['imgcat_id']) ? intval($_POST['imgcat_id']) : 0;
+        if ($imgcat_id <= 0) {
+            redirect_header('admin.php?fct=images',1);
+        }
+        $imgcat_handler = xoops_gethandler('imagecategory');
+        $imagecategory =& $imgcat_handler->get($imgcat_id);
+        if (!is_object($imagecategory)) {
+            redirect_header('admin.php?fct=images',1);
+        }
+        $imagecategory->setVar('imgcat_name', $_POST['imgcat_name']);
+        $imgcat_display = empty($_POST['imgcat_display']) ? 0 : 1;
+        $imagecategory->setVar('imgcat_display', $imgcat_display);
+        $imagecategory->setVar('imgcat_maxsize', $_POST['imgcat_maxsize']);
+        $imagecategory->setVar('imgcat_maxwidth', $_POST['imgcat_maxwidth']);
+        $imagecategory->setVar('imgcat_maxheight', $_POST['imgcat_maxheight']);
+        $imagecategory->setVar('imgcat_weight', $_POST['imgcat_weight']);
+        if (!$imgcat_handler->insert($imagecategory)) {
+            exit();
+        }
+        $imagecategoryperm_handler =& xoops_gethandler('groupperm');
+        $criteria = new CriteriaCompo(new Criteria('gperm_itemid', $imgcat_id));
+        $criteria->add(new Criteria('gperm_modid', 1));
+        $criteria2 = new CriteriaCompo(new Criteria('gperm_name', 'imgcat_write'));
+        $criteria2->add(new Criteria('gperm_name', 'imgcat_read'), 'OR');
+        $criteria->add($criteria2);
+        $imagecategoryperm_handler->deleteAll($criteria);
+        if (!isset($_POST['readgroup'])) {
+            $readgroup = array();
+        } else {
+            $readgroup = $_POST['readgroup'];
+        }
+        if (!in_array(XOOPS_GROUP_ADMIN, $readgroup)) {
+            array_push($readgroup, XOOPS_GROUP_ADMIN);
+        }
+        foreach ($readgroup as $rgroup) {
+            $imagecategoryperm =& $imagecategoryperm_handler->create();
+            $imagecategoryperm->setVar('gperm_groupid', $rgroup);
+            $imagecategoryperm->setVar('gperm_itemid', $imgcat_id);
+            $imagecategoryperm->setVar('gperm_name', 'imgcat_read');
+            $imagecategoryperm->setVar('gperm_modid', 1);
+            $imagecategoryperm_handler->insert($imagecategoryperm);
+            unset($imagecategoryperm);
+        }
+        if (!isset($_POST['writegroup'])) {
+            $writegroup = array();
+        } else {
+            $writegroup = $_POST['writegroup'];
+        }
+        if (!in_array(XOOPS_GROUP_ADMIN, $writegroup)) {
+            array_push($writegroup, XOOPS_GROUP_ADMIN);
+        }
+        foreach ($writegroup as $wgroup) {
+            $imagecategoryperm =& $imagecategoryperm_handler->create();
+            $imagecategoryperm->setVar('gperm_groupid', $wgroup);
+            $imagecategoryperm->setVar('gperm_itemid', $imgcat_id);
+            $imagecategoryperm->setVar('gperm_name', 'imgcat_write');
+            $imagecategoryperm->setVar('gperm_modid', 1);
+            $imagecategoryperm_handler->insert($imagecategoryperm);
+            unset($imagecategoryperm);
+        }
+        redirect_header('admin.php?fct=images',2,_MD_AM_DBUPDATED);
+    }
+
+    if ($op == 'delfile') {
+        xoops_cp_header();
+        xoops_token_confirm(array('op' => 'delfileok', 'image_id' => $image_id, 'fct' => 'images'), 'admin.php', _MD_RUDELIMG);
+        xoops_cp_footer();
+        exit();
+    }
+
+    if ($op == 'delfileok') {
+        if(!xoops_confirm_validate()) {
+            system_images_error("Ticket Error");
+        }
+
+        $image_id = intval($_POST['image_id']);
+        if ($image_id <= 0) {
+            redirect_header('admin.php?fct=images',1);
+        }
+        $image_handler =& xoops_gethandler('image');
+        $image =& $image_handler->get($image_id);
+        if (!is_object($image)) {
+            redirect_header('admin.php?fct=images',1);
+        }
+        if (!$image_handler->delete($image)) {
+            xoops_cp_header();
+            xoops_error(sprintf(_MD_FAILDEL, $image->getVar('image_id')));
+            xoops_cp_footer();
+            exit();
+        }
+        @unlink(XOOPS_UPLOAD_PATH.'/'.$image->getVar('image_name'));
+        redirect_header('admin.php?fct=images',2,_MD_AM_DBUPDATED);
+    }
+
+    if ($op == 'delcat') {
+        xoops_cp_header();
+        xoops_token_confirm(array('op' => 'delcatok', 'imgcat_id' => $imgcat_id, 'fct' => 'images'), 'admin.php', _MD_RUDELIMGCAT);
+        xoops_cp_footer();
+        exit();
+    }
+
+    if ($op == 'delcatok') {
+        if(!xoops_confirm_validate()) {
+            system_images_error("Ticket Error");
+        }
+
+        $imgcat_id = intval($_POST['imgcat_id']);
+        if ($imgcat_id <= 0) {
+            redirect_header('admin.php?fct=images',1);
+        }
+        $imgcat_handler = xoops_gethandler('imagecategory');
+        $imagecategory =& $imgcat_handler->get($imgcat_id);
+        if (!is_object($imagecategory)) {
+            redirect_header('admin.php?fct=images',1);
+        }
+        if ($imagecategory->getVar('imgcat_type') != 'C') {
+            xoops_cp_header();
+            xoops_error(_MD_SCATDELNG);
+            xoops_cp_footer();
+            exit();
+        }
+        $image_handler =& xoops_gethandler('image');
+        $images =& $image_handler->getObjects(new Criteria('imgcat_id', $imgcat_id), true, false);
+        $errors = array();
+        foreach (array_keys($images) as $i) {
+            if (!$image_handler->delete($images[$i])) {
+                $errors[] = sprintf(_MD_FAILDEL, $i);
+            } else {
+                if (file_exists(XOOPS_UPLOAD_PATH.'/'.$images[$i]->getVar('image_name')) && !unlink(XOOPS_UPLOAD_PATH.'/'.$images[$i]->getVar('image_name'))) {
+                    $errors[] = sprintf(_MD_FAILUNLINK, $i);
+                }
+            }
+        }
+        if (!$imgcat_handler->delete($imagecategory)) {
+            $errors[] = sprintf(_MD_FAILDELCAT, $imagecategory->getVar('imgcat_name'));
+        }
+        if (count($errors) > 0) {
+            xoops_cp_header();
+            xoops_error($errors);
+            xoops_cp_footer();
+            exit();
+        }
+        redirect_header('admin.php?fct=images',2,_MD_AM_DBUPDATED);
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/smilies/smileform.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/smilies/smileform.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/smilies/smileform.php	(revision 405)
@@ -0,0 +1,49 @@
+<?php
+// $Id: smileform.php,v 1.4 2005/08/03 12:39:17 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
+$smile_form = new XoopsThemeForm($smiles['smile_form'], 'smileform', 'admin.php');
+$smile_form->setExtra('enctype="multipart/form-data"');
+$smile_form->addElement(new XoopsFormToken(XoopsMultiTokenHandler::quickCreate('smilies_'.$smiles['op'])));
+$smile_form->addElement(new XoopsFormText(_AM_SMILECODE, 'smile_code', 26, 25, $smiles['smile_code']), true);
+$smile_form->addElement(new XoopsFormText(_AM_SMILEEMOTION, 'smile_desc', 26, 25, $smiles['smile_desc']), true);
+$smile_select = new XoopsFormFile('', 'smile_url', 5000000);
+$smile_label = new XoopsFormLabel('', '<img src="'.XOOPS_UPLOAD_URL.'/'.$smiles['smile_url'].'" alt="" />');
+$smile_tray = new XoopsFormElementTray(_IMAGEFILE.':', '&nbsp;');
+$smile_tray->addElement($smile_select);
+$smile_tray->addElement($smile_label);
+$smile_form->addElement($smile_tray);
+$smile_form->addElement(new XoopsFormRadioYN(_AM_DISPLAYF, 'smile_display', $smiles['smile_display']));
+$smile_form->addElement(new XoopsFormHidden('id', $smiles['id']));
+$smile_form->addElement(new XoopsFormHidden('op', $smiles['op']));
+$smile_form->addElement(new XoopsFormHidden('fct', 'smilies'));
+$smile_form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/smilies/xoops_version.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/smilies/xoops_version.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/smilies/xoops_version.php	(revision 405)
@@ -0,0 +1,45 @@
+<?php
+// $Id: xoops_version.php,v 1.2 2005/03/18 12:52:38 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+$modversion['name'] = _MD_AM_SMLS;
+$modversion['version'] = "";
+$modversion['description'] = "Smilies Settings";
+$modversion['author'] = "";
+$modversion['credits'] = "The MPN SE Project";
+$modversion['help'] = "smilies.html";
+$modversion['license'] = "GPL see LICENSE";
+$modversion['official'] = 1;
+$modversion['image'] = "smiles.gif";
+
+$modversion['hasAdmin'] = 1;
+$modversion['adminpath'] = "admin.php?fct=smilies";
+$modversion['category'] = XOOPS_SYSTEM_SMILE;
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/smilies/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/smilies/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/smilies/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/smilies/main.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/smilies/main.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/smilies/main.php	(revision 405)
@@ -0,0 +1,182 @@
+<?php
+// $Id: main.php,v 1.4 2005/08/03 12:39:17 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+if ( !is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid()) ) {
+    exit("Access Denied");
+}
+
+include_once XOOPS_ROOT_PATH."/modules/system/admin/smilies/smilies.php";
+$op ='SmilesAdmin';
+
+if (!empty($_GET['op'])) {
+    $op = $_GET['op'];
+} elseif (!empty($_POST['op'])) {
+    $op = $_POST['op'];
+}
+
+switch($op) {
+
+case "SmilesUpdate":
+    if (!XoopsMultiTokenHandler::quickValidate('smilies_SmilesUpdate')) {
+        redirect_header('admin.php?fct=smilies',3,"Ticket Error");
+    }
+    $count = (!empty($_POST['smile_id']) && is_array($_POST['smile_id'])) ? count($_POST['smile_id']) : 0;
+    $db =& Database::getInstance();
+    for ($i = 0; $i < $count; $i++) {
+        $smile_id = intval($_POST['smile_id'][$i]);
+        if (empty($smile_id)) {
+            continue;
+        }
+        $smile_display = empty($_POST['smile_display'][$i]) ? 0 : 1;
+        if (isset($_POST['old_display'][$i]) && $_POST['old_display'][$i] != $smile_display[$i]) {
+            $db->query('UPDATE '.$db->prefix('smiles').' SET display='.$smile_display.' WHERE id ='.$smile_id);
+        }
+    }
+    redirect_header('admin.php?fct=smilies',2,_AM_DBUPDATED);
+    break;
+
+case "SmilesAdd":
+    if (!XoopsMultiTokenHandler::quickValidate('smilies_SmilesAdd')) {
+        redirect_header('admin.php?fct=smilies',3,"Ticket Error");
+    }
+    $db =& Database::getInstance();
+    $myts =& MyTextSanitizer::getInstance();
+    include_once XOOPS_ROOT_PATH.'/class/uploader.php';
+    $uploader = new XoopsMediaUploader(XOOPS_UPLOAD_PATH, array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/x-png'), 100000, 120, 120);
+    $uploader->setAllowedExtensions(array('gif', 'jpeg', 'jpg', 'png'));
+    $uploader->setPrefix('smil');
+    if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
+        if (!$uploader->upload()) {
+            $err = $uploader->getErrors();
+        } else {
+            $smile_url = $uploader->getSavedFileName();
+            $smile_code = $myts->stripSlashesGPC($_POST['smile_code']);
+            $smile_desc = $myts->stripSlashesGPC($_POST['smile_desc']);
+            $smile_display = intval($_POST['smile_display']) > 0 ? 1 : 0;
+            $newid = $db->genId($db->prefix('smilies')."_id_seq");
+            $sql = sprintf("INSERT INTO %s (id, code, smile_url, emotion, display) VALUES (%d, %s, %s, %s, %d)", $db->prefix('smiles'), $newid, $db->quoteString($smile_code), $db->quoteString($smile_url), $db->quoteString($smile_desc), $smile_display);
+            if (!$db->query($sql)) {
+                $err = 'Failed storing smiley data into the database';
+            }
+        }
+    } else {
+        $err = $uploader->getErrors();
+    }
+    if (!isset($err)) {
+        redirect_header('admin.php?fct=smilies&amp;op=SmilesAdmin',2,_AM_DBUPDATED);
+    } else {
+        xoops_cp_header();
+        xoops_error($err);
+        xoops_cp_footer();
+    }
+    break;
+
+case "SmilesEdit":
+    $id = isset($_GET['id']) ? intval($_GET['id']) : 0;
+    if ($id > 0) {
+        SmilesEdit($id);
+    }
+    break;
+
+case "SmilesSave":
+    $id = isset($_POST['id']) ? intval($_POST['id']) : 0;
+    if ($id <= 0 || !XoopsMultiTokenHandler::quickValidate('smilies_SmilesSave')) {
+        redirect_header('admin.php?fct=smilies',3,"Ticket Error");
+    }
+    $myts =& MyTextSanitizer::getInstance();
+    $smile_code = $myts->stripSlashesGPC($_POST['smile_code']);
+    $smile_desc = $myts->stripSlashesGPC($_POST['smile_desc']);
+    $smile_display = intval($_POST['smile_display']) > 0 ? 1 : 0;
+    $db =& Database::getInstance();
+    if (!empty($_POST['smile_url'])) {
+        include_once XOOPS_ROOT_PATH.'/class/uploader.php';
+        $uploader = new XoopsMediaUploader(XOOPS_UPLOAD_PATH, array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/x-png'), 100000, 120, 120);
+        $uploader->setAllowedExtensions(array('gif', 'jpeg', 'jpg', 'png'));
+        $uploader->setPrefix('smil');
+        if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
+            if (!$uploader->upload()) {
+                $err = $uploader->getErrors();
+            } else {
+                $smile_url = $uploader->getSavedFileName();
+                if (!$db->query(sprintf("UPDATE %s SET code = %s, smile_url = %s, emotion = %s, display = %d WHERE id = %d", $db->prefix('smiles'), $db->quoteString($smile_code), $db->quoteString($smile_url), $db->quoteString($smile_desc), $smile_display, $id))) {
+                    $err = 'Failed storing smiley data into the database';
+                } else {
+                    $oldsmile_path = str_replace("\\", "/", realpath(XOOPS_UPLOAD_PATH.'/'.trim($_POST['old_smile'])));
+                    if (0 === strpos($oldsmile_path, XOOPS_UPLOAD_PATH) && is_file($oldsmile_path)) {
+                        unlink($oldsmile_path);
+                    }
+                }
+            }
+        } else {
+            $err = $uploader->getErrors();
+        }
+    } else {
+        $sql = sprintf("UPDATE %s SET code = %s, emotion = %s, display = %d WHERE id = %d", $db->prefix('smiles'), $db->quoteString($smile_code), $db->quoteString($smile_desc), $smile_display, $id);
+        if (!$db->query($sql)) {
+            $err = 'Failed storing smiley data into the database';
+        }
+    }
+    if (!isset($err)) {
+        redirect_header('admin.php?fct=smilies&amp;op=SmilesAdmin',2,_AM_DBUPDATED);
+    } else {
+        xoops_cp_header();
+        xoops_error($err);
+        xoops_cp_footer();
+        exit();
+    }
+    break;
+
+case "SmilesDel":
+    $id = isset($_GET['id']) ? intval($_GET['id']) : 0;
+    if ($id > 0 ) {
+        xoops_cp_header();
+        xoops_token_confirm(array('fct' => 'smilies', 'op' => 'SmilesDelOk', 'id' => $id), 'admin.php', _AM_WAYSYWTDTS);
+        xoops_cp_footer();
+    }
+    break;
+
+case "SmilesDelOk":
+    $id = isset($_POST['id']) ? intval($_POST['id']) : 0;
+    if ($id <= 0 || !xoops_confirm_validate()) {
+        redirect_header('admin.php?fct=smilies',3,"Ticket Error");
+    }
+    $db =& Database::getInstance();
+    $sql = sprintf("DELETE FROM %s WHERE id = %u", $db->prefix('smiles'), $id);
+    $db->query($sql);
+    redirect_header("admin.php?fct=smilies&amp;op=SmilesAdmin",2,_AM_DBUPDATED);
+    break;
+
+case "SmilesAdmin":
+default:
+    SmilesAdmin();
+    break;
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/smilies/smilies.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/smilies/smilies.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/smilies/smilies.php	(revision 405)
@@ -0,0 +1,126 @@
+<?php
+// $Id: smilies.php,v 1.4 2005/08/03 12:39:17 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+if ( !is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid()) ) {
+    exit("Access Denied");
+}
+function SmilesAdmin()
+{
+    $db =& Database::getInstance();
+    $url_smiles = XOOPS_UPLOAD_URL;
+    $myts =& MyTextSanitizer::getInstance();
+    xoops_cp_header();
+    echo "<h4 style='text-align:left;'>"._AM_SMILESCONTROL."</h4>";
+
+    if ($getsmiles = $db->query("SELECT * FROM ".$db->prefix("smiles"))) {
+        if (($numsmiles = $db->getRowsNum($getsmiles)) == "0") {
+            //EMPTY
+        } else {
+            $token=&XoopsMultiTokenHandler::quickCreate('smilies_SmilesUpdate');
+            echo '<form action="admin.php" method="post"><table width="100%" class="outer" cellpadding="4" cellspacing="1">';
+            echo $token->getHtml();
+            echo "<tr align='center'><th align='left'>" ._AM_CODE."</th>";
+            echo "<th>" ._AM_SMILIE."</th>";
+            echo "<th>"._AM_SMILEEMOTION."</th>";
+            echo "<th>" ._AM_DISPLAYF."</th>";
+            echo "<th>"._AM_ACTION."</th>";
+            echo "</tr>\n";
+            $i = 0;
+            while ($smiles = $db->fetchArray($getsmiles)) {
+                if ($i % 2 == 0) {
+                    $class = 'even';
+                } else {
+                    $class= 'odd';
+                }
+                $smiles['code'] = $myts->makeTboxData4Show($smiles['code']);
+                $smiles['smile_url'] = $myts->makeTboxData4Edit($smiles['smile_url']);
+                $smiles['smile_emotion'] = $myts->makeTboxData4Edit($smiles['emotion']);
+                echo "<tr align='center' class='$class'>";
+                echo "<td align='left'>".$smiles['code']."</td>";
+                echo "<td><img src='".$url_smiles."/".$smiles['smile_url']."' alt='' /></td>";
+                echo '<td>'.$smiles['smile_emotion'].'</td>';
+                echo '<td><input type="hidden" name="smile_id['.$i.']" value="'.$smiles['id'].'" /><input type="hidden" name="old_display['.$i.']" value="'.$smiles['display'].'" /><input type="checkbox" value="1" name="smile_display['.$i.']"';
+                if ($smiles['display'] == 1) {
+                    echo ' checked="checked"';
+                }
+                echo " /></td><td><a href='admin.php?fct=smilies&amp;op=SmilesEdit&amp;id=".$smiles['id']."'>" ._AM_EDIT."</a>&nbsp;";
+                echo "<a href='admin.php?fct=smilies&amp;op=SmilesDel&amp;id=".$smiles['id']."'>" ._AM_DEL."</a></td>";
+                echo "</tr>\n";
+                $i++;
+            }
+            echo '<tr><td class="foot" colspan="5" align="center"><input type="hidden" name="op" value="SmilesUpdate" /><input type="hidden" name="fct" value="smilies" />';
+            //echo xoops_token_gethtml();
+            echo '<input type="submit" value="'._SUBMIT.'" /></tr></table></form>';
+        }
+    } else {
+        echo _AM_CNRFTSD;
+    }
+    $smiles['smile_code'] = '';
+    $smiles['smile_url'] = 'blank.gif';
+    $smiles['smile_desc'] = '';
+    $smiles['smile_display'] = 1;
+    $smiles['smile_form'] = _AM_ADDSMILE;
+    $smiles['op'] = 'SmilesAdd';
+    $smiles['id'] = '';
+    include XOOPS_ROOT_PATH.'/modules/system/admin/smilies/smileform.php';
+    $smile_form->display();
+    xoops_cp_footer();
+}
+
+function SmilesEdit($id)
+{
+    $db =& Database::getInstance();
+    $myts =& MyTextSanitizer::getInstance();
+    xoops_cp_header();
+    echo '<a href="admin.php?fct=smilies">'._AM_SMILESCONTROL .'</a>&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;'._AM_EDITSMILE.'<br /><br />';
+    if ($getsmiles = $db->query("SELECT * FROM ".$db->prefix("smiles")." WHERE id = $id")) {
+        $numsmiles = $db->getRowsNum($getsmiles);
+        if ( $numsmiles == 0 ) {
+            //EMPTY
+        } else {
+            if ($smiles = $db->fetchArray($getsmiles)) {
+                $smiles['smile_code'] = $myts->makeTboxData4Edit($smiles['code']);
+                $smiles['smile_url'] = $myts->makeTboxData4Edit($smiles['smile_url']);
+                $smiles['smile_desc'] = $myts->makeTboxData4Edit($smiles['emotion']);
+                $smiles['smile_display'] = $smiles['display'];
+                $smiles['smile_form'] = _AM_EDITSMILE;
+                $smiles['op'] = 'SmilesSave';
+                include XOOPS_ROOT_PATH.'/modules/system/admin/smilies/smileform.php';
+                //$smile_form->addElement(new XoopsFormHidden('old_smile', $smiles['smile_url']));
+                $smile_form->display();
+            }
+        }
+    } else {
+        echo _AM_CNRFTSD;
+    }
+    xoops_cp_footer();
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/groupperm.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/groupperm.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/groupperm.php	(revision 405)
@@ -0,0 +1,70 @@
+<?php
+// $Id: groupperm.php,v 1.2 2005/03/18 12:52:38 onokazu Exp $
+
+include '../../../include/cp_header.php';
+$modid = isset($_POST['modid']) ? intval($_POST['modid']) : 0;
+
+// we dont want system module permissions to be changed here
+if ($modid <= 1 || !is_object($xoopsUser) || !$xoopsUser->isAdmin($modid)) {
+	redirect_header(XOOPS_URL.'/index.php', 1, _NOPERM);
+	exit();
+}
+$module_handler =& xoops_gethandler('module');
+$module =& $module_handler->get($modid);
+if (!is_object($module) || !$module->getVar('isactive')) {
+	redirect_header(XOOPS_URL.'/admin.php', 1, _MODULENOEXIST);
+	exit();
+}
+$member_handler =& xoops_gethandler('member');
+$group_list =& $member_handler->getGroupList();
+if (is_array($_POST['perms']) && !empty($_POST['perms'])) {
+	$gperm_handler = xoops_gethandler('groupperm');
+	foreach ($_POST['perms'] as $perm_name => $perm_data) {
+		if (false != $gperm_handler->deleteByModule($modid, $perm_name)) {
+			foreach ($perm_data['groups'] as $group_id => $item_ids) {
+				foreach ($item_ids as $item_id => $selected) {
+					if ($selected == 1) {
+						// make sure that all parent ids are selected as well
+						if ($perm_data['parents'][$item_id] != '') {
+							$parent_ids = explode(':', $perm_data['parents'][$item_id]);
+							foreach ($parent_ids as $pid) {
+								if ($pid != 0 && !in_array($pid, array_keys($item_ids))) {
+									// one of the parent items were not selected, so skip this item
+									$msg[] = sprintf(_MD_AM_PERMADDNG, '<b>'.$perm_name.'</b>', '<b>'.$perm_data['itemname'][$item_id].'</b>', '<b>'.$group_list[$group_id].'</b>').' ('._MD_AM_PERMADDNGP.')';
+									continue 2;
+								}
+							}
+						}
+						$gperm =& $gperm_handler->create();
+						$gperm->setVar('gperm_groupid', $group_id);
+						$gperm->setVar('gperm_name', $perm_name);
+						$gperm->setVar('gperm_modid', $modid);
+						$gperm->setVar('gperm_itemid', $item_id);
+						if (!$gperm_handler->insert($gperm)) {
+							$msg[] = sprintf(_MD_AM_PERMADDNG, '<b>'.$perm_name.'</b>', '<b>'.$perm_data['itemname'][$item_id].'</b>', '<b>'.$group_list[$group_id].'</b>');
+						} else {
+							$msg[] = sprintf(_MD_AM_PERMADDOK, '<b>'.$perm_name.'</b>', '<b>'.$perm_data['itemname'][$item_id].'</b>', '<b>'.$group_list[$group_id].'</b>');
+						}
+						unset($gperm);
+					}
+				}
+			}
+		} else {
++ $msg[] = sprintf(_MD_AM_PERMRESETNG, $module->getVar('name').'('.$perm_name.')');
+		}
+	}
+}
+
+$backlink = XOOPS_URL.'/admin.php';
+if ($module->getVar('hasadmin')) {
+    $adminindex = isset($_POST['redirect_url']) ? $_POST['redirect_url'] : $module->getInfo('adminindex');
+	if ($adminindex) {
+		$backlink = XOOPS_URL.'/modules/'.$module->getVar('dirname').'/'.$adminindex;
+	}
+}
+
+$msg[] = '<br /><br /><a href="'.$backlink.'">'._BACK.'</a>';
+xoops_cp_header();
+xoops_result($msg);
+xoops_cp_footer();
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/groups/groupform.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/groups/groupform.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/groups/groupform.php	(revision 405)
@@ -0,0 +1,114 @@
+<?php
+// $Id: groupform.php,v 1.4 2005/08/03 12:39:16 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+include_once XOOPS_ROOT_PATH."/class/xoopsformloader.php";
+
+$name_text = new XoopsFormText(_AM_NAME, "name", 30, 50, $name_value);
+$desc_text = new XoopsFormTextArea(_AM_DESCRIPTION, "desc", $desc_value);
+
+$s_cat_checkbox = new XoopsFormCheckBox(_AM_SYSTEMRIGHTS, "system_catids[]", $s_cat_value);
+//if (isset($s_cat_disable) && $s_cat_disable) {
+//	$s_cat_checkbox->setExtra('checked="checked" disabled="disabled"');
+//}
+include_once(XOOPS_ROOT_PATH.'/modules/system/constants.php');
+$handle = opendir(XOOPS_ROOT_PATH.'/modules/system/admin');
+while (false != $file = readdir($handle)) {
+	if (strtolower($file) != 'cvs' && !preg_match("/[.]/", $file) && is_dir(XOOPS_ROOT_PATH.'/modules/system/admin/'.$file)) {
+		include XOOPS_ROOT_PATH.'/modules/system/admin/'.$file.'/xoops_version.php';
+		if (!empty($modversion['category'])) {
+			$s_cat_checkbox->addOption($modversion['category'], $modversion['name']);
+		}
+		unset($modversion);
+	}
+}
+
+$a_mod_checkbox = new XoopsFormCheckBox(_AM_ACTIVERIGHTS, "admin_mids[]", $a_mod_value);
+$module_handler =& xoops_gethandler('module');
+$criteria = new CriteriaCompo(new Criteria('hasadmin', 1));
+$criteria->add(new Criteria('isactive', 1));
+$criteria->add(new Criteria('dirname', 'system', '<>'));
+$a_mod_checkbox->addOptionArray($module_handler->getList($criteria));
+
+$r_mod_checkbox = new XoopsFormCheckBox(_AM_ACCESSRIGHTS, "read_mids[]", $r_mod_value);
+$criteria = new CriteriaCompo(new Criteria('hasmain', 1));
+$criteria->add(new Criteria('isactive', 1));
+$r_mod_checkbox->addOptionArray($module_handler->getList($criteria));
+
+$r_lblock_checkbox = new XoopsFormCheckBox('<b>'._LEFT.'</b><br />', "read_bids[]", $r_block_value);
+$new_blocks_array = array();
+$blocks_array = XoopsBlock::getAllBlocks("list", XOOPS_SIDEBLOCK_LEFT);
+foreach ($blocks_array as $key=>$value) {
+	$new_blocks_array[$key] = "<a href='".XOOPS_URL."/modules/system/admin.php?fct=blocksadmin&amp;op=edit&amp;bid=".$key."'>".$value." (ID: ".$key.")</a>";
+}
+$r_lblock_checkbox->addOptionArray($new_blocks_array);
+
+$r_cblock_checkbox = new XoopsFormCheckBox("<b>"._CENTER."</b><br />", "read_bids[]", $r_block_value);
+$new_blocks_array = array();
+$blocks_array = XoopsBlock::getAllBlocks("list", XOOPS_CENTERBLOCK_ALL);
+foreach ($blocks_array as $key=>$value) {
+	$new_blocks_array[$key] = "<a href='".XOOPS_URL."/modules/system/admin.php?fct=blocksadmin&amp;op=edit&amp;bid=".$key."'>".$value." (ID: ".$key.")</a>";
+}
+$r_cblock_checkbox->addOptionArray($new_blocks_array);
+
+$r_rblock_checkbox = new XoopsFormCheckBox("<b>"._RIGHT."</b><br />", "read_bids[]", $r_block_value);
+$new_blocks_array = array();
+$blocks_array = XoopsBlock::getAllBlocks("list", XOOPS_SIDEBLOCK_RIGHT);
+foreach ($blocks_array as $key=>$value) {
+	$new_blocks_array[$key] = "<a href='".XOOPS_URL."/modules/system/admin.php?fct=blocksadmin&amp;op=edit&amp;bid=".$key."'>".$value." (ID: ".$key.")</a>";
+}
+$r_rblock_checkbox->addOptionArray($new_blocks_array);
+
+$r_block_tray = new XoopsFormElementTray(_AM_BLOCKRIGHTS, "<br /><br />");
+$r_block_tray->addElement($r_lblock_checkbox);
+$r_block_tray->addElement($r_cblock_checkbox);
+$r_block_tray->addElement($r_rblock_checkbox);
+
+$op_hidden = new XoopsFormHidden("op", $op_value);
+$fct_hidden = new XoopsFormHidden("fct", "groups");
+$submit_button = new XoopsFormButton("", "groupsubmit", $submit_value, "submit");
+$form = new XoopsThemeForm($form_title, "groupform", "admin.php");
+$form->addElement(new XoopsFormToken(XoopsMultiTokenHandler::quickCreate('groups_'.$op_value)));
+$form->addElement($name_text);
+$form->addElement($desc_text);
+$form->addElement($s_cat_checkbox);
+$form->addElement($a_mod_checkbox);
+$form->addElement($r_mod_checkbox);
+$form->addElement($r_block_tray);
+$form->addElement($op_hidden);
+$form->addElement($fct_hidden);
+if ( !empty($g_id_value) ) {
+	$g_id_hidden = new XoopsFormHidden("g_id", $g_id_value);
+	$form->addElement($g_id_hidden);
+}
+$form->addElement($submit_button);
+$form->setRequired($name_text);
+$form->display();
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/groups/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/groups/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/groups/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/groups/main.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/groups/main.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/groups/main.php	(revision 405)
@@ -0,0 +1,264 @@
+<?php
+// $Id: main.php,v 1.5 2006/05/01 02:37:29 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+if ( !is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid()) ) {
+    exit("Access Denied");
+} else {
+    include_once XOOPS_ROOT_PATH.'/class/xoopsblock.php';
+    include_once XOOPS_ROOT_PATH."/modules/system/admin/groups/groups.php";
+    $op = "display";
+
+    if ( isset($_GET['op']) ) {
+        if ($_GET['op'] == "modify" || $_GET['op'] == "del") {
+            $op = $_GET['op'];
+            $g_id = $_GET['g_id'];
+        }
+    } elseif (isset($_POST['op'])) {
+        $op = $_POST['op'];
+    }
+
+    // from finduser section
+    if ( !empty($_POST['memberslist_id']) && is_array($_POST['memberslist_id']) ) {
+        $op = "addUser";
+        $_POST['uids'] = $_POST['memberslist_id'];
+    }
+
+    switch ($op) {
+    case "modify":
+        include_once XOOPS_ROOT_PATH.'/class/pagenav.php';
+        modifyGroup($g_id);
+        break;
+    case "update":
+        if(!XoopsMultiTokenHandler::quickValidate('groups_update'))
+            system_groups_error("Ticket Error");
+
+        $g_id = !empty($_POST['g_id']) ? intval($_POST['g_id']) : 0;
+        if ($g_id <= 0) {
+            exit();
+        }
+        $system_catids = empty($_POST['system_catids']) ? array() : $_POST['system_catids'];
+        $admin_mids = empty($_POST['admin_mids']) ? array() : $_POST['admin_mids'];
+        $read_mids = empty($_POST['read_mids']) ? array() : $_POST['read_mids'];
+        $read_bids = empty($_POST['read_bids']) ? array() : $_POST['read_bids'];
+        $member_handler =& xoops_gethandler('member');
+        $group =& $member_handler->getGroup($g_id);
+        $group->setVar('name', $_POST['name']);
+        $group->setVar('description', $_POST['desc']);
+        // if this group is not one of the default groups
+        if (!in_array($group->getVar('groupid'), array(XOOPS_GROUP_ADMIN, XOOPS_GROUP_USERS, XOOPS_GROUP_ANONYMOUS))) {
+            if (count($system_catids) > 0) {
+                $group->setVar('group_type', 'Admin');
+            } else {
+                $group->setVar('group_type', '');
+            }
+        }
+        if (!$member_handler->insertGroup($group)) {
+            xoops_cp_header();
+            echo $group->getHtmlErrors();
+            xoops_cp_footer();
+        } else {
+            $groupid = $group->getVar('groupid');
+            $gperm_handler =& xoops_gethandler('groupperm');
+            $criteria = new CriteriaCompo(new Criteria('gperm_groupid', $groupid));
+            $criteria->add(new Criteria('gperm_modid', 1));
+            $criteria2 = new CriteriaCompo(new Criteria('gperm_name', 'system_admin'));
+            $criteria2->add(new Criteria('gperm_name', 'module_admin'), 'OR');
+            $criteria2->add(new Criteria('gperm_name', 'module_read'), 'OR');
+            $criteria2->add(new Criteria('gperm_name', 'block_read'), 'OR');
+            $criteria->add($criteria2);
+            $gperm_handler->deleteAll($criteria);
+            if (count($system_catids) > 0) {
+                array_push($admin_mids, 1);
+                foreach ($system_catids as $s_cid) {
+                    $sysperm =& $gperm_handler->create();
+                    $sysperm->setVar('gperm_groupid', $groupid);
+                    $sysperm->setVar('gperm_itemid', $s_cid);
+                    $sysperm->setVar('gperm_name', 'system_admin');
+                    $sysperm->setVar('gperm_modid', 1);
+                    $gperm_handler->insert($sysperm);
+                }
+            }
+            foreach ($admin_mids as $a_mid) {
+                $modperm =& $gperm_handler->create();
+                $modperm->setVar('gperm_groupid', $groupid);
+                $modperm->setVar('gperm_itemid', $a_mid);
+                $modperm->setVar('gperm_name', 'module_admin');
+                $modperm->setVar('gperm_modid', 1);
+                $gperm_handler->insert($modperm);
+            }
+            array_push($read_mids, 1);
+            foreach ($read_mids as $r_mid) {
+                $modperm =& $gperm_handler->create();
+                $modperm->setVar('gperm_groupid', $groupid);
+                $modperm->setVar('gperm_itemid', $r_mid);
+                $modperm->setVar('gperm_name', 'module_read');
+                $modperm->setVar('gperm_modid', 1);
+                $gperm_handler->insert($modperm);
+            }
+            foreach ($read_bids as $r_bid) {
+                $blockperm =& $gperm_handler->create();
+                $blockperm->setVar('gperm_groupid', $groupid);
+                $blockperm->setVar('gperm_itemid', $r_bid);
+                $blockperm->setVar('gperm_name', 'block_read');
+                $blockperm->setVar('gperm_modid', 1);
+                $gperm_handler->insert($blockperm);
+            }
+            redirect_header("admin.php?fct=groups&amp;op=adminMain",1,_AM_DBUPDATED);
+        }
+        break;
+    case "add":
+        if(!XoopsMultiTokenHandler::quickValidate('groups_add'))
+            system_groups_error("Ticket Error");
+
+        $name = !empty($_POST['name']) ? trim($_POST['name']) : '';
+        if ($name == '') {
+            xoops_cp_header();
+            echo _AM_UNEED2ENTER;
+            xoops_cp_footer();
+            exit();
+        }
+        $system_catids = empty($_POST['system_catids']) ? array() : $_POST['system_catids'];
+        $admin_mids = empty($_POST['admin_mids']) ? array() : $_POST['admin_mids'];
+        $read_mids = empty($_POST['read_mids']) ? array() : $_POST['read_mids'];
+        $read_bids = empty($_POST['read_bids']) ? array() : $_POST['read_bids'];
+        $member_handler =& xoops_gethandler('member');
+        $group =& $member_handler->createGroup();
+        $group->setVar("name", $name);
+        $group->setVar("description", $_POST['desc']);
+        if (count($system_catids) > 0) {
+            $group->setVar("group_type", 'Admin');
+        }
+        if (!$member_handler->insertGroup($group)) {
+            xoops_cp_header();
+            echo $group->getHtmlErrors();
+            xoops_cp_footer();
+        } else {
+            $groupid = $group->getVar('groupid');
+            $gperm_handler =& xoops_gethandler('groupperm');
+            if (count($system_catids) > 0) {
+                array_push($admin_mids, 1);
+                foreach ($system_catids as $s_cid) {
+                    $sysperm =& $gperm_handler->create();
+                    $sysperm->setVar('gperm_groupid', $groupid);
+                    $sysperm->setVar('gperm_itemid', $s_cid);
+                    $sysperm->setVar('gperm_name', 'system_admin');
+                    $sysperm->setVar('gperm_modid', 1);
+                    $gperm_handler->insert($sysperm);
+                }
+            }
+            foreach ($admin_mids as $a_mid) {
+                $modperm =& $gperm_handler->create();
+                $modperm->setVar('gperm_groupid', $groupid);
+                $modperm->setVar('gperm_itemid', $a_mid);
+                $modperm->setVar('gperm_name', 'module_admin');
+                $modperm->setVar('gperm_modid', 1);
+                $gperm_handler->insert($modperm);
+            }
+            array_push($read_mids, 1);
+            foreach ($read_mids as $r_mid) {
+                $modperm =& $gperm_handler->create();
+                $modperm->setVar('gperm_groupid', $groupid);
+                $modperm->setVar('gperm_itemid', $r_mid);
+                $modperm->setVar('gperm_name', 'module_read');
+                $modperm->setVar('gperm_modid', 1);
+                $gperm_handler->insert($modperm);
+            }
+            foreach ($read_bids as $r_bid) {
+                $blockperm =& $gperm_handler->create();
+                $blockperm->setVar('gperm_groupid', $groupid);
+                $blockperm->setVar('gperm_itemid', $r_bid);
+                $blockperm->setVar('gperm_name', 'block_read');
+                $blockperm->setVar('gperm_modid', 1);
+                $gperm_handler->insert($blockperm);
+            }
+            redirect_header("admin.php?fct=groups&amp;op=adminMain",1,_AM_DBUPDATED);
+        }
+        break;
+    case "del":
+        xoops_cp_header();
+        $member_handler =& xoops_gethandler('member');
+        $group =& $member_handler->getGroup($g_id);
+        xoops_token_confirm(array('fct' => 'groups', 'op' => 'delConf', 'g_id' => $g_id), 'admin.php', sprintf(_AM_AREUSUREDEL,$group->getVar('name')));
+        xoops_cp_footer();
+        break;
+    case "delConf":
+        if(!xoops_confirm_validate())
+            system_groups_error("Ticket Error");
+
+        $g_id = !empty($_POST['g_id']) ? intval($_POST['g_id']) : 0;
+        if ($g_id > 0 && !in_array($g_id, array(XOOPS_GROUP_ADMIN, XOOPS_GROUP_USERS, XOOPS_GROUP_ANONYMOUS))) {
+            $member_handler =& xoops_gethandler('member');
+            $group =& $member_handler->getGroup($g_id);
+            $member_handler->deleteGroup($group);
+            $gperm_handler =& xoops_gethandler('groupperm');
+            $gperm_handler->deleteByGroup($g_id);
+        }
+        redirect_header("admin.php?fct=groups&amp;op=adminMain",1,_AM_DBUPDATED);
+        break;
+    case "addUser":
+        if(!XoopsMultiTokenHandler::quickValidate('groups_User'))
+            system_groups_error("Ticket Error");
+
+        $member_handler =& xoops_gethandler('member');
+        $groupid = intval($_POST['groupid']);
+        if ($groupid > 0) {
+            $size = isset($_POST['uids']) ? count($_POST['uids']) : 0;
+            for ( $i = 0; $i < $size; $i++ ) {
+                $member_handler->addUserToGroup($_POST['groupid'], $_POST['uids'][$i]);
+            }
+        }
+        redirect_header("admin.php?fct=groups&amp;op=modify&amp;g_id=".$groupid, 0, _AM_DBUPDATED);
+        break;
+    case "delUser":
+        if(!XoopsMultiTokenHandler::quickValidate('groups_User'))
+            system_groups_error("Ticket Error");
+
+        $groupid = !empty($_POST['groupid']) ? intval($_POST['groupid']) : 0;
+        if ($groupid > 0) {
+            $member_handler =& xoops_gethandler('member');
+            $memstart = isset($_POST['memstart']) ? intval($_POST['memstart']) : 0;
+            if ($groupid == XOOPS_GROUP_ADMIN) {
+                if ($member_handler->getUserCountByGroup($groupid) > count($_POST['uids'])){
+                    $member_handler->removeUsersFromGroup($groupid, $_POST['uids']);
+                }
+            } else {
+                $member_handler->removeUsersFromGroup($groupid, $_POST['uids']);
+            }
+            redirect_header('admin.php?fct=groups&amp;op=modify&amp;g_id='.$groupid.'&amp;memstart='.$memstart,0,_AM_DBUPDATED);
+        }
+        break;
+    case "display":
+        default:
+        displayGroups();
+        break;
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/groups/xoops_version.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/groups/xoops_version.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/groups/xoops_version.php	(revision 405)
@@ -0,0 +1,44 @@
+<?php
+// $Id: xoops_version.php,v 1.2 2005/03/18 12:52:38 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+$modversion['name'] = _MD_AM_ADGS;
+$modversion['version'] = "";
+$modversion['description'] = "User Groups Configuration";
+$modversion['author'] = "";
+$modversion['credits'] = "";
+$modversion['help'] = "groups.html";
+$modversion['license'] = "GPL see LICENSE";
+$modversion['official'] = 1;
+$modversion['image'] = "groups.gif";
+$modversion['hasAdmin'] = 1;
+$modversion['adminpath'] = "admin.php?fct=groups";
+$modversion['category'] = XOOPS_SYSTEM_GROUP;
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin/groups/groups.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin/groups/groups.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin/groups/groups.php	(revision 405)
@@ -0,0 +1,215 @@
+<?php
+// $Id: groups.php,v 1.5 2006/05/01 02:37:29 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+if ( !is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid()) ) {
+    exit("Access Denied");
+}
+
+/**
+ * Display error message & exit (Tentative)
+ */
+function system_groups_error($message)
+{
+    xoops_cp_header();
+    xoops_error($message);
+    xoops_cp_footer();
+    exit();
+}
+
+/*********************************************************/
+/* Admin/Authors Functions                               */
+/*********************************************************/
+function displayGroups()
+{
+    xoops_cp_header();
+    //OpenTable();
+    echo "<h4 style='text-align:left'>"._AM_EDITADG."</h4>";
+    $member_handler =& xoops_gethandler('member');
+    $groups = $member_handler->getGroups();
+        echo "<table class='outer' width='40%' cellpadding='4' cellspacing='1'><tr><th colspan='2'>"._AM_EDITADG."</th></tr>";
+    $count = count($groups);
+    for ($i = 0; $i < $count; $i++) {
+        $id = $groups[$i]->getVar('groupid');
+                echo '<tr><td class="head">'.$groups[$i]->getVar('name').'</td>';
+        echo '<td class="even"><a href="admin.php?fct=groups&amp;op=modify&amp;g_id='.$id.'">'._AM_MODIFY.'</a>';
+        if (XOOPS_GROUP_ADMIN == $id || XOOPS_GROUP_USERS == $id || XOOPS_GROUP_ANONYMOUS == $id) {
+            echo '</td></tr>';
+        } else {
+            echo '&nbsp;<a href="admin.php?fct=groups&amp;op=del&amp;g_id='.$id.'">'._AM_DELETE.'</a></td></tr>';
+        }
+    }
+    echo "</table>";
+    $name_value = "";
+    $desc_value = "";
+    $s_cat_value = '';
+    $a_mod_value = array();
+    $r_mod_value = array();
+    $r_block_value = array();
+    $op_value = "add";
+    $submit_value = _AM_CREATENEWADG;
+    $g_id_value = "";
+    $type_value = "";
+    $form_title = _AM_CREATENEWADG;
+    include XOOPS_ROOT_PATH."/modules/system/admin/groups/groupform.php";
+    //CloseTable();
+    xoops_cp_footer();
+}
+
+function modifyGroup($g_id)
+{
+    $userstart = $memstart = 0;
+    if ( !empty($_POST['userstart']) ) {
+        $userstart = intval($_POST['userstart']);
+    } elseif (!empty($_GET['userstart'])) {
+        $userstart = intval($_GET['userstart']);
+    }
+    if ( !empty($_POST['memstart']) ) {
+        $memstart = intval($_POST['memstart']);
+    } elseif (!empty($_GET['memstart'])) {
+        $memstart = intval($_GET['memstart']);
+    }
+    xoops_cp_header();
+    //OpenTable();
+    echo '<a href="admin.php?fct=groups">'. _AM_GROUPSMAIN .'</a>&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;'. _AM_MODIFYADG.'<br /><br />';
+    $member_handler =& xoops_gethandler('member');
+    $thisgroup =& $member_handler->getGroup($g_id);
+    $name_value = $thisgroup->getVar("name", "E");
+    $desc_value = $thisgroup->getVar("description", "E");
+    $moduleperm_handler =& xoops_gethandler('groupperm');
+    $a_mod_value = $moduleperm_handler->getItemIds('module_admin', $thisgroup->getVar('groupid'));
+    $r_mod_value = $moduleperm_handler->getItemIds('module_read', $thisgroup->getVar('groupid'));
+    $r_block_value =& XoopsBlock::getAllBlocksByGroup($thisgroup->getVar("groupid"), false);
+    $op_value = "update";
+    $submit_value = _AM_UPDATEADG;
+    $g_id_value = $thisgroup->getVar("groupid");
+    $type_value = $thisgroup->getVar("group_type", "E");
+    $form_title = _AM_MODIFYADG;
+    if (XOOPS_GROUP_ADMIN == $g_id) {
+        $s_cat_disable = true;
+    }
+
+    $sysperm_handler =& xoops_gethandler('groupperm');
+    $s_cat_value = $sysperm_handler->getItemIds('system_admin', $g_id);
+
+    include XOOPS_ROOT_PATH."/modules/system/admin/groups/groupform.php";
+    echo "<br /><h4 style='text-align:left'>"._AM_EDITMEMBER."</h4>";
+    $usercount = $member_handler->getUserCount(new Criteria('level', 0, '>'));
+    $member_handler =& xoops_gethandler('member');
+    $membercount = $member_handler->getUserCountByGroup($g_id);
+    $token=&XoopsMultiTokenHandler::quickCreate('groups_User');
+    if ($usercount < 200 && $membercount < 200) {
+        // do the old way only when counts are small
+        $mlist = array();
+        $members = $member_handler->getUsersByGroup($g_id, false);
+        if (count($members) > 0) {
+            $member_criteria = new Criteria('uid', "(".implode(',', $members).")", "IN");
+            $member_criteria->setSort('uname');
+            $mlist = $member_handler->getUserList($member_criteria);
+        }
+        $criteria = new Criteria('level', 0, '>');
+        $criteria->setSort('uname');
+        $userslist = $member_handler->getUserList($criteria);
+        $users = array_diff($userslist, $mlist);
+        echo '<table class="outer">
+        <tr><th align="center">'._AM_NONMEMBERS.'<br />';
+        echo '</th><th></th><th align="center">'._AM_MEMBERS.'<br />';
+        echo '</th></tr>
+        <tr><td class="even">
+        <form action="admin.php" method="post">';
+
+        echo $token->getHtml();
+
+        echo '<select name="uids[]" size="10" multiple="multiple">'."\n";
+        foreach ($users as $u_id => $u_name) {
+            echo '<option value="'.$u_id.'">'.$u_name.'</option>'."\n";
+        }
+        echo '</select>';
+
+
+        echo "</td><td align='center' class='odd'>
+        <input type='hidden' name='op' value='addUser' />
+        <input type='hidden' name='fct' value='groups' />
+        <input type='hidden' name='groupid' value='".$thisgroup->getVar("groupid")."' />
+        <input type='submit' name='submit' value='"._AM_ADDBUTTON."' />
+        </form><br />
+        <form action='admin.php' method='post' />";
+
+        echo $token->getHtml();
+
+        echo "<input type='hidden' name='op' value='delUser' />
+        <input type='hidden' name='fct' value='groups' />
+        <input type='hidden' name='groupid' value='".$thisgroup->getVar("groupid")."' />
+        <input type='submit' name='submit' value='"._AM_DELBUTTON."' />
+        </td>
+        <td class='even'>";
+        echo "<select name='uids[]' size='10' multiple='multiple'>";
+        foreach ($mlist as $m_id => $m_name) {
+            echo '<option value="'.$m_id.'">'.$m_name.'</option>'."\n";
+        }
+        echo "</select>";
+        echo '</td></tr>
+        </form>
+        </table>';
+    } else {
+        $members =& $member_handler->getUsersByGroup($g_id, false, 200, $memstart);
+        $mlist = array();
+        if (count($members) > 0) {
+            $member_criteria = new Criteria('uid', "(".implode(',', $members).")", "IN");
+            $member_criteria->setSort('uname');
+            $mlist = $member_handler->getUserList($member_criteria);
+        }
+        echo '<a href="'.XOOPS_URL.'/modules/system/admin.php?fct=findusers&amp;group='.$g_id.'">'._AM_FINDU4GROUP.'</a><br />';
+        echo '<form action="admin.php" method="post">
+        <table class="outer">
+        <tr><th align="center">'._AM_MEMBERS.'<br />';
+        $nav = new XoopsPageNav($membercount, 200, $memstart, "memstart", "fct=groups&amp;op=modify&amp;g_id=".$g_id);
+        echo $token->getHtml();
+        echo $nav->renderNav(4);
+        echo "</th></tr>
+        <tr><td class='even' align='center'>
+        <input type='hidden' name='op' value='delUser' />
+        <input type='hidden' name='fct' value='groups' />
+        <input type='hidden' name='groupid' value='".$thisgroup->getVar("groupid")."' />
+        <input type='hidden' name='memstart' value='".$memstart."' />
+        <select name='uids[]' size='10' multiple='multiple'>";
+        foreach ($mlist as $m_id => $m_name ) {
+            echo '<option value="'.$m_id.'">'.$m_name.'</option>'."\n";
+        }
+        echo "</select><br />
+        <input type='submit' name='submit' value='"._DELETE."' />
+        </td></tr>
+        </table>
+        </form>";
+    }
+    //CloseTable();
+    xoops_cp_footer();
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/menu.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/menu.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/menu.php	(revision 405)
@@ -0,0 +1,60 @@
+<?php
+// $Id: menu.php,v 1.2 2005/03/18 12:52:38 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+$adminmenu[0]['title'] = _MI_SYSTEM_ADMENU1;
+$adminmenu[0]['link'] = "admin.php?fct=banners";
+$adminmenu[1]['title'] = _MI_SYSTEM_ADMENU2;
+$adminmenu[1]['link'] = "admin.php?fct=blocksadmin";
+$adminmenu[2]['title'] = _MI_SYSTEM_ADMENU3;
+$adminmenu[2]['link'] = "admin.php?fct=groups";
+$adminmenu[3]['title'] = _MI_SYSTEM_ADMENU13;
+$adminmenu[3]['link'] = "admin.php?fct=images";
+$adminmenu[4]['title'] = _MI_SYSTEM_ADMENU5;
+$adminmenu[4]['link'] = "admin.php?fct=modulesadmin";
+$adminmenu[5]['title'] = _MI_SYSTEM_ADMENU6;
+$adminmenu[5]['link'] = "admin.php?fct=preferences";
+$adminmenu[6]['title'] = _MI_SYSTEM_ADMENU7;
+$adminmenu[6]['link'] = "admin.php?fct=smilies";
+$adminmenu[7]['title'] = _MI_SYSTEM_ADMENU9;
+$adminmenu[7]['link'] = "admin.php?fct=userrank";
+$adminmenu[8]['title'] = _MI_SYSTEM_ADMENU10;
+$adminmenu[8]['link'] = "admin.php?fct=users";
+$adminmenu[9]['title'] = _MI_SYSTEM_ADMENU12;
+$adminmenu[9]['link'] = "admin.php?fct=findusers";
+$adminmenu[10]['title'] = _MI_SYSTEM_ADMENU11;
+$adminmenu[10]['link'] = "admin.php?fct=mailusers";
+$adminmenu[11]['title'] = _MI_SYSTEM_ADMENU14;
+$adminmenu[11]['link'] = "admin.php?fct=avatars";
+$adminmenu[12]['title'] = _MI_SYSTEM_ADMENU15;
+$adminmenu[12]['link'] = "admin.php?fct=tplsets";
+$adminmenu[13]['title'] = _MI_SYSTEM_ADMENU16;
+$adminmenu[13]['link'] = "admin.php?fct=comments";
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/blocks/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/blocks/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/blocks/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/blocks/system_blocks.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/blocks/system_blocks.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/blocks/system_blocks.php	(revision 405)
@@ -0,0 +1,522 @@
+<?php
+// $Id: system_blocks.php,v 1.42.2.2 2004/10/13 13:07:53 mithyt2 Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+function b_system_online_show()
+{
+	global $xoopsUser, $xoopsModule;
+	$online_handler =& xoops_gethandler('online');
+	mt_srand((double)microtime()*1000000);
+	// set gc probabillity to 10% for now..
+	if (mt_rand(1, 100) < 11) {
+		$online_handler->gc(300);
+	}
+	if (is_object($xoopsUser)) {
+		$uid = $xoopsUser->getVar('uid');
+		$uname = $xoopsUser->getVar('uname');
+	} else {
+		$uid = 0;
+		$uname = '';
+	}
+	if (is_object($xoopsModule)) {
+		$online_handler->write($uid, $uname, time(), $xoopsModule->getVar('mid'), $_SERVER['REMOTE_ADDR']);
+	} else {
+		$online_handler->write($uid, $uname, time(), 0, $_SERVER['REMOTE_ADDR']);
+	}
+	$onlines =& $online_handler->getAll();
+	if (false != $onlines) {
+		$total = count($onlines);
+		$block = array();
+		$guests = 0;
+		$members = '';
+		for ($i = 0; $i < $total; $i++) {
+			if ($onlines[$i]['online_uid'] > 0) {
+				$members .= ' <a href="'.XOOPS_URL.'/userinfo.php?uid='.$onlines[$i]['online_uid'].'">'.$onlines[$i]['online_uname'].'</a>,';
+			} else {
+				$guests++;
+			}
+		}
+		$block['online_total'] = sprintf(_ONLINEPHRASE, $total);
+		if (is_object($xoopsModule)) {
+			$mytotal = $online_handler->getCount(new Criteria('online_module', $xoopsModule->getVar('mid')));
+			$block['online_total'] .= ' ('.sprintf(_ONLINEPHRASEX, $mytotal, $xoopsModule->getVar('name')).')';
+		}
+		$block['lang_members'] = _MEMBERS;
+		$block['lang_guests'] = _GUESTS;
+		$block['online_names'] = $members;
+		$block['online_members'] = $total - $guests;
+		$block['online_guests'] = $guests;
+		$block['lang_more'] = _MORE;
+		return $block;
+	} else {
+		return false;
+	}
+}
+
+function b_system_login_show()
+{
+	global $xoopsUser, $xoopsConfig;
+	if (!$xoopsUser) {
+		$block = array();
+		$block['lang_username'] = _USERNAME;
+		$block['unamevalue'] = "";
+		if (isset($_COOKIE[$xoopsConfig['usercookie']])) {
+			$block['unamevalue'] = $_COOKIE[$xoopsConfig['usercookie']];
+		}
+		$block['lang_password'] = _PASSWORD;
+		$block['lang_login'] = _LOGIN;
+		$block['lang_lostpass'] = _MB_SYSTEM_LPASS;
+		$block['lang_registernow'] = _MB_SYSTEM_RNOW;
+		$block['lang_rememberme'] = _REMEMBERME; // autologin hack
+		if ($xoopsConfig['use_ssl'] == 1 && $xoopsConfig['sslloginlink'] != '') {
+			$block['sslloginlink'] = "<a href=\"javascript:openWithSelfMain('".$xoopsConfig['sslloginlink']."', 'ssllogin', 300, 200);\">"._MB_SYSTEM_SECURE."</a>";
+		}
+    	return $block;
+    }
+	return false;
+}
+
+function b_system_main_show()
+{
+	global $xoopsUser,$xoopsModule;
+	$block = array();
+	$block['lang_home'] = _MB_SYSTEM_HOME;
+	$block['lang_close'] = _CLOSE;
+	$module_handler =& xoops_gethandler('module');
+	$criteria = new CriteriaCompo(new Criteria('hasmain', 1));
+	$criteria->add(new Criteria('isactive', 1));
+	$criteria->add(new Criteria('weight', 0, '>'));
+	$modules =& $module_handler->getObjects($criteria, true);
+	$moduleperm_handler =& xoops_gethandler('groupperm');
+	$groups = is_object($xoopsUser) ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS;
+	$read_allowed =& $moduleperm_handler->getItemIds('module_read', $groups);
+	foreach (array_keys($modules) as $i) {
+		if (in_array($i, $read_allowed)) {
+			$block['modules'][$i]['name'] = $modules[$i]->getVar('name');
+			$block['modules'][$i]['directory'] = $modules[$i]->getVar('dirname');
+			$sublinks =& $modules[$i]->subLink();
+			if ((count($sublinks) > 0) && (!empty($xoopsModule)) && ($i == $xoopsModule->getVar('mid'))) {
+				foreach($sublinks as $sublink){
+					$block['modules'][$i]['sublinks'][] = array('name' => $sublink['name'], 'url' => XOOPS_URL.'/modules/'.$modules[$i]->getVar('dirname').'/'.$sublink['url']);
+				}
+			} else {
+				$block['modules'][$i]['sublinks'] = array();
+			}
+		}
+	}
+	return $block;
+}
+
+function b_system_search_show()
+{
+	$block = array();
+	$block['lang_search'] = _MB_SYSTEM_SEARCH;
+	$block['lang_advsearch'] = _MB_SYSTEM_ADVS;
+	return $block;
+}
+
+function b_system_user_show()
+{
+	global $xoopsUser;
+	if (is_object($xoopsUser)) {
+		$pm_handler =& xoops_gethandler('privmessage');
+		$block = array();
+		$block['lang_youraccount'] = _MB_SYSTEM_VACNT;
+		$block['lang_editaccount'] = _MB_SYSTEM_EACNT;
+		$block['lang_notifications'] = _MB_SYSTEM_NOTIF;
+		$block['uid'] = $xoopsUser->getVar('uid');
+		$block['lang_logout'] = _MB_SYSTEM_LOUT;
+		$criteria = new CriteriaCompo(new Criteria('read_msg', 0));
+		$criteria->add(new Criteria('to_userid', $xoopsUser->getVar('uid')));
+		$block['new_messages'] = $pm_handler->getCount($criteria);
+		$block['lang_inbox'] = _MB_SYSTEM_INBOX;
+		$block['lang_adminmenu'] = _MB_SYSTEM_ADMENU;
+		return $block;
+	}
+	return false;
+}
+
+// this block is deprecated
+function b_system_waiting_show()
+{
+	global $xoopsUser;
+	$xoopsDB =& Database::getInstance();
+	$module_handler =& xoops_gethandler('module');
+	$block = array();
+	if ($module_handler->getCount(new Criteria('dirname', 'news'))) {
+		$result = $xoopsDB->query("SELECT COUNT(*) FROM ".$xoopsDB->prefix("stories")." WHERE published=0");
+		if ( $result ) {
+			$block['modules'][0]['adminlink'] = XOOPS_URL."/modules/news/admin/index.php?op=newarticle";
+			list($block['modules'][0]['pendingnum']) = $xoopsDB->fetchRow($result);
+			$block['modules'][0]['lang_linkname'] = _MB_SYSTEM_SUBMS;
+		}
+	}
+	if ($module_handler->getCount(new Criteria('dirname', 'mylinks'))) {
+		$result = $xoopsDB->query("SELECT COUNT(*) FROM ".$xoopsDB->prefix("mylinks_links")." WHERE status=0");
+		if ( $result ) {
+			$block['modules'][1]['adminlink'] = XOOPS_URL."/modules/mylinks/admin/index.php?op=listNewLinks";
+			list($block['modules'][1]['pendingnum']) = $xoopsDB->fetchRow($result);
+			$block['modules'][1]['lang_linkname'] = _MB_SYSTEM_WLNKS;
+		}
+		$result = $xoopsDB->query("SELECT COUNT(*) FROM ".$xoopsDB->prefix("mylinks_broken"));
+		if ( $result ) {
+			$block['modules'][2]['adminlink'] = XOOPS_URL."/modules/mylinks/admin/index.php?op=listBrokenLinks";
+			list($block['modules'][2]['pendingnum']) = $xoopsDB->fetchRow($result);
+			$block['modules'][2]['lang_linkname'] = _MB_SYSTEM_BLNK;
+		}
+		$result = $xoopsDB->query("SELECT COUNT(*) FROM ".$xoopsDB->prefix("mylinks_mod"));
+		if ( $result ) {
+			$block['modules'][3]['adminlink'] = XOOPS_URL."/modules/mylinks/admin/index.php?op=listModReq";
+			list($block['modules'][3]['pendingnum']) = $xoopsDB->fetchRow($result);
+			$block['modules'][3]['lang_linkname'] = _MB_SYSTEM_MLNKS;
+		}
+	}
+	if ($module_handler->getCount(new Criteria('dirname', 'mydownloads'))) {
+		$result = $xoopsDB->query("SELECT COUNT(*) FROM ".$xoopsDB->prefix("mydownloads_downloads")." WHERE status=0");
+		if ( $result ) {
+			$block['modules'][4]['adminlink'] = XOOPS_URL."/modules/mydownloads/admin/index.php?op=listNewDownloads";
+			list($block['modules'][4]['pendingnum']) = $xoopsDB->fetchRow($result);
+			$block['modules'][4]['lang_linkname'] = _MB_SYSTEM_WDLS;
+		}
+		$result = $xoopsDB->query("SELECT COUNT(*) FROM ".$xoopsDB->prefix("mydownloads_broken")."");
+		if ( $result ) {
+			$block['modules'][5]['adminlink'] = XOOPS_URL."/modules/mydownloads/admin/index.php?op=listBrokenDownloads";
+			list($block['modules'][5]['pendingnum']) = $xoopsDB->fetchRow($result);
+			$block['modules'][5]['lang_linkname'] = _MB_SYSTEM_BFLS;
+		}
+		$result = $xoopsDB->query("SELECT COUNT(*) FROM ".$xoopsDB->prefix("mydownloads_mod")."");
+		if ( $result ) {
+			$block['modules'][6]['adminlink'] = XOOPS_URL."/modules/mydownloads/admin/index.php?op=listModReq";
+			list($block['modules'][6]['pendingnum']) = $xoopsDB->fetchRow($result);
+			$block['modules'][6]['lang_linkname'] = _MB_SYSTEM_MFLS;
+		}
+	}
+		$result = $xoopsDB->query("SELECT COUNT(*) FROM ".$xoopsDB->prefix("xoopscomments")." WHERE com_status=1");
+		if ( $result ) {
+			$block['modules'][7]['adminlink'] = XOOPS_URL."/modules/system/admin.php?module=0&status=1&fct=comments";
+			list($block['modules'][7]['pendingnum']) = $xoopsDB->fetchRow($result);
+			$block['modules'][7]['lang_linkname'] =_MB_SYSTEM_COMPEND;
+		}
+	return $block;
+}
+
+function b_system_info_show($options)
+{
+	global $xoopsConfig, $xoopsUser;
+	$xoopsDB =& Database::getInstance();
+	$myts =& MyTextSanitizer::getInstance();
+	$block = array();
+	if (!empty($options[3])) {
+		$block['showgroups'] = true;
+		$result = $xoopsDB->query("SELECT u.uid, u.uname, u.email, u.user_viewemail, u.user_avatar, g.name AS groupname FROM ".$xoopsDB->prefix("groups_users_link")." l LEFT JOIN ".$xoopsDB->prefix("users")." u ON l.uid=u.uid LEFT JOIN ".$xoopsDB->prefix("groups")." g ON l.groupid=g.groupid WHERE g.group_type='Admin' ORDER BY l.groupid, u.uid");
+		if ($xoopsDB->getRowsNum($result) > 0) {
+			$prev_caption = "";
+			$i = 0;
+			while  ($userinfo = $xoopsDB->fetchArray($result)) {
+				if ($prev_caption != $userinfo['groupname']) {
+					$prev_caption = $userinfo['groupname'];
+					$block['groups'][$i]['name'] = $myts->htmlSpecialChars($userinfo['groupname']);
+				}
+				if ($xoopsUser != '') {
+					$block['groups'][$i]['users'][] = array('id' => $userinfo['uid'], 'name' => $myts->htmlspecialchars($userinfo['uname']), 'msglink' => "<a href=\"javascript:openWithSelfMain('".XOOPS_URL."/pmlite.php?send2=1&amp;to_userid=".$userinfo['uid']."','pmlite',450,370);\"><img src=\"".XOOPS_URL."/images/icons/pm_small.gif\" border=\"0\" width=\"27\" height=\"17\" alt=\"\" /></a>", 'avatar' => XOOPS_UPLOAD_URL.'/'.$userinfo['user_avatar']);
+				} else {
+					if ($userinfo['user_viewemail']) {
+						$block['groups'][$i]['users'][] = array('id' => $userinfo['uid'], 'name' => $myts->htmlspecialchars($userinfo['uname']), 'msglink' => '<a href="mailto:'.$userinfo['email'].'"><img src="'.XOOPS_URL.'/images/icons/em_small.gif" border="0" width="16" height="14" alt="" /></a>', 'avatar' => XOOPS_UPLOAD_URL.'/'.$userinfo['user_avatar']);
+					} else {
+						$block['groups'][$i]['users'][] = array('id' => $userinfo['uid'], 'name' => $myts->htmlspecialchars($userinfo['uname']), 'msglink' => '&nbsp;', 'avatar' => XOOPS_UPLOAD_URL.'/'.$userinfo['user_avatar']);
+					}
+				}
+				$i++;
+			}
+		}
+	} else {
+		$block['showgroups'] = false;
+	}
+	$block['logourl'] = XOOPS_URL.'/images/'.$options[2];
+	$block['recommendlink'] = "<a href=\"javascript:openWithSelfMain('".XOOPS_URL."/misc.php?action=showpopups&amp;type=friend&amp;op=sendform&amp;t=".time()."','friend',".$options[0].",".$options[1].")\">"._MB_SYSTEM_RECO."</a>";
+	return $block;
+}
+
+function b_system_newmembers_show($options)
+{
+	$block = array();
+	$criteria = new CriteriaCompo(new Criteria('level', 0, '>'));
+	$limit = (!empty($options[0])) ? $options[0] : 10;
+	$criteria->setOrder('DESC');
+	$criteria->setSort('user_regdate');
+	$criteria->setLimit($limit);
+	$member_handler =& xoops_gethandler('member');
+	$newmembers =& $member_handler->getUsers($criteria);
+	$count = count($newmembers);
+	for ($i = 0; $i < $count; $i++) {
+		if ( $options[1] == 1 ) {
+			$block['users'][$i]['avatar'] = $newmembers[$i]->getVar('user_avatar') != 'blank.gif' ? XOOPS_UPLOAD_URL.'/'.$newmembers[$i]->getVar('user_avatar') : '';
+		} else {
+			$block['users'][$i]['avatar'] = '';
+		}
+		$block['users'][$i]['id'] = $newmembers[$i]->getVar('uid');
+		$block['users'][$i]['name'] = $newmembers[$i]->getVar('uname');
+		$block['users'][$i]['joindate'] = formatTimestamp($newmembers[$i]->getVar('user_regdate'), 's');
+	}
+	return $block;
+}
+
+function b_system_topposters_show($options)
+{
+	$block = array();
+	$criteria = new CriteriaCompo(new Criteria('level', 0, '>'));
+	$limit = (!empty($options[0])) ? $options[0] : 10;
+	$size = count($options);
+	for ( $i = 2; $i < $size; $i++) {
+		$criteria->add(new Criteria('rank', $options[$i], '<>'));
+	}
+	$criteria->setOrder('DESC');
+	$criteria->setSort('posts');
+	$criteria->setLimit($limit);
+	$member_handler =& xoops_gethandler('member');
+	$topposters =& $member_handler->getUsers($criteria);
+	$count = count($topposters);
+	for ($i = 0; $i < $count; $i++) {
+		$block['users'][$i]['rank'] = $i+1;
+		if ( $options[1] == 1 ) {
+			$block['users'][$i]['avatar'] = $topposters[$i]->getVar('user_avatar') != 'blank.gif' ? XOOPS_UPLOAD_URL.'/'.$topposters[$i]->getVar('user_avatar') : '';
+		} else {
+			$block['users'][$i]['avatar'] = '';
+		}
+		$block['users'][$i]['id'] = $topposters[$i]->getVar('uid');
+		$block['users'][$i]['name'] = $topposters[$i]->getVar('uname');
+		$block['users'][$i]['posts'] = $topposters[$i]->getVar('posts');
+	}
+	return $block;
+}
+
+
+function b_system_comments_show($options)
+{
+	$block = array();
+	include_once XOOPS_ROOT_PATH.'/include/comment_constants.php';
+	$comment_handler =& xoops_gethandler('comment');
+	$criteria = new CriteriaCompo(new Criteria('com_status', XOOPS_COMMENT_ACTIVE));
+	$criteria->setLimit(intval($options[0]));
+	$criteria->setSort('com_created');
+	$criteria->setOrder('DESC');
+	$comments =& $comment_handler->getObjects($criteria, true);
+	$member_handler =& xoops_gethandler('member');
+	$module_handler =& xoops_gethandler('module');
+	$modules =& $module_handler->getObjects(new Criteria('hascomments', 1), true);
+	$comment_config = array();
+	foreach (array_keys($comments) as $i) {
+		$mid = $comments[$i]->getVar('com_modid');
+		$com['module'] = '<a href="'.XOOPS_URL.'/modules/'.$modules[$mid]->getVar('dirname').'/">'.$modules[$mid]->getVar('name').'</a>';
+		if (!isset($comment_config[$mid])) {
+			$comment_config[$mid] = $modules[$mid]->getInfo('comments');
+		}
+		$com['id'] = $i;
+		$com['title'] = '<a href="'.XOOPS_URL.'/modules/'.$modules[$mid]->getVar('dirname').'/'.$comment_config[$mid]['pageName'].'?'.$comment_config[$mid]['itemName'].'='.$comments[$i]->getVar('com_itemid').'&amp;com_id='.$i.'&amp;com_rootid='.$comments[$i]->getVar('com_rootid').'&amp;'.$comments[$i]->getVar('com_exparams').'#comment'.$i.'">'.$comments[$i]->getVar('com_title').'</a>';
+		$com['icon'] = $comments[$i]->getVar('com_icon');
+		$com['icon'] = ($com['icon'] != '') ? $com['icon'] : 'icon1.gif';
+		$com['time'] = formatTimestamp($comments[$i]->getVar('com_created'),'m');
+		if ($comments[$i]->getVar('com_uid') > 0) {
+			$poster =& $member_handler->getUser($comments[$i]->getVar('com_uid'));
+			if (is_object($poster)) {
+				$com['poster'] = '<a href="'.XOOPS_URL.'/userinfo.php?uid='.$comments[$i]->getVar('com_uid').'">'.$poster->getVar('uname').'</a>';
+			} else {
+				$com['poster'] = $GLOBALS['xoopsConfig']['anonymous'];
+			}
+		} else {
+			$com['poster'] = $GLOBALS['xoopsConfig']['anonymous'];
+		}
+		$block['comments'][] =& $com;
+		unset($com);
+	}
+    return $block;
+}
+
+// RMV-NOTIFY
+function b_system_notification_show()
+{
+	global $xoopsConfig, $xoopsUser, $xoopsModule;
+	include_once XOOPS_ROOT_PATH . '/include/notification_functions.php';
+	include_once XOOPS_ROOT_PATH . '/language/' . $xoopsConfig['language'] . '/notification.php';
+	// Notification must be enabled, and user must be logged in
+	if (empty($xoopsUser) || !notificationEnabled('block')) {
+		return false; // do not display block
+	}
+	$notification_handler =& xoops_gethandler('notification');
+	// Now build the a nested associative array of info to pass
+	// to the block template.
+	$block = array();
+	$categories =& notificationSubscribableCategoryInfo();
+	if (empty($categories)) {
+		return false;
+	}
+	foreach ($categories as $category) {
+		$section['name'] = $category['name'];
+		$section['title'] = $category['title'];
+		$section['description'] = $category['description'];
+		$section['itemid'] = $category['item_id'];
+		$section['events'] = array();
+		$subscribed_events =& $notification_handler->getSubscribedEvents ($category['name'], $category['item_id'], $xoopsModule->getVar('mid'), $xoopsUser->getVar('uid'));
+		foreach (notificationEvents($category['name'], true) as $event) {
+			if (!empty($event['admin_only']) && !$xoopsUser->isAdmin($xoopsModule->getVar('mid'))) {
+				continue;
+			}
+			$subscribed = in_array($event['name'], $subscribed_events) ? 1 : 0;
+			$section['events'][$event['name']] = array ('name'=>$event['name'], 'title'=>$event['title'], 'caption'=>$event['caption'], 'description'=>$event['description'], 'subscribed'=>$subscribed);
+		}
+		$block['categories'][$category['name']] = $section;
+	}
+	// Additional form data
+	$block['target_page'] = "notification_update.php";
+	// FIXME: better or more standardized way to do this?
+	$script_url = explode('/', $_SERVER['PHP_SELF']);
+	$script_name = $script_url[count($script_url)-1];
+	$block['redirect_script'] = $script_name;
+	$block['submit_button'] = _NOT_UPDATENOW;
+	return $block;
+}
+
+function b_system_comments_edit($options)
+{
+	$inputtag = "<input type='text' name='options[]' value='".intval($options[0])."' />";
+	$form = sprintf(_MB_SYSTEM_DISPLAYC, $inputtag);
+	return $form;
+}
+
+function b_system_topposters_edit($options)
+{
+	include_once XOOPS_ROOT_PATH.'/class/xoopslists.php';
+	$inputtag = "<input type='text' name='options[]' value='".intval($options[0])."' />";
+	$form = sprintf(_MB_SYSTEM_DISPLAY,$inputtag);
+	$form .= "<br />"._MB_SYSTEM_DISPLAYA."&nbsp;<input type='radio' id='options[]' name='options[]' value='1'";
+	if ( $options[1] == 1 ) {
+		$form .= " checked='checked'";
+	}
+	$form .= " />&nbsp;"._YES."<input type='radio' id='options[]' name='options[]' value='0'";
+	if ( $options[1] == 0 ) {
+		$form .= " checked='checked'";
+	}
+	$form .= " />&nbsp;"._NO."";
+	$form .= "<br />"._MB_SYSTEM_NODISPGR."<br /><select id='options[]' name='options[]' multiple='multiple'>";
+	$ranks =& XoopsLists::getUserRankList();
+	$size = count($options);
+	foreach ($ranks as $k => $v) {
+		$sel = "";
+		for ( $i = 2; $i < $size; $i++ ) {
+			if ($k == $options[$i]) {
+				$sel = " selected='selected'";
+			}
+		}
+		$form .= "<option value='$k'$sel>$v</option>";
+	}
+	$form .= "</select>";
+	return $form;
+}
+
+function b_system_newmembers_edit($options)
+{
+	$inputtag = "<input type='text' name='options[]' value='".$options[0]."' />";
+	$form = sprintf(_MB_SYSTEM_DISPLAY,$inputtag);
+	$form .= "<br />"._MB_SYSTEM_DISPLAYA."&nbsp;<input type='radio' id='options[]' name='options[]' value='1'";
+	if ( $options[1] == 1 ) {
+		$form .= " checked='checked'";
+	}
+	$form .= " />&nbsp;"._YES."<input type='radio' id='options[]' name='options[]' value='0'";
+	if ( $options[1] == 0 ) {
+		$form .= " checked='checked'";
+	}
+	$form .= " />&nbsp;"._NO."";
+	return $form;
+}
+
+function b_system_info_edit($options)
+{
+	$form = _MB_SYSTEM_PWWIDTH."&nbsp;";
+	$form .= "<input type='text' name='options[]' value='".$options[0]."' />";
+	$form .= "<br />"._MB_SYSTEM_PWHEIGHT."&nbsp;";
+	$form .= "<input type='text' name='options[]' value='".$options[1]."' />";
+	$form .= "<br />".sprintf(_MB_SYSTEM_LOGO,XOOPS_URL."/images/")."&nbsp;";
+	$form .= "<input type='text' name='options[]' value='".$options[2]."' />";
+	$chk = "";
+	$form .= "<br />"._MB_SYSTEM_SADMIN."&nbsp;";
+	if ( $options[3] == 1 ) {
+		$chk = " checked='checked'";
+	}
+	$form .= "<input type='radio' name='options[3]' value='1'".$chk." />&nbsp;"._YES."";
+	$chk = "";
+	if ( $options[3] == 0 ) {
+		$chk = " checked=\"checked\"";
+	}
+	$form .= "&nbsp;<input type='radio' name='options[3]' value='0'".$chk." />"._NO."";
+	return $form;
+}
+
+function b_system_themes_show($options)
+{
+	global $xoopsConfig;
+	$theme_options = '';
+	foreach ($xoopsConfig['theme_set_allowed'] as $theme) {
+		$theme_options .= '<option value="'.$theme.'"';
+		if ($theme == $xoopsConfig['theme_set']) {
+			$theme_options .= ' selected="selected"';
+		}
+		$theme_options .= '>'.$theme.'</option>';
+	}
+	$block = array();
+	if ($options[0] == 1) {
+		$block['theme_select'] = "<img vspace=\"2\" id=\"xoops_theme_img\" src=\"".XOOPS_THEME_URL."/".$xoopsConfig['theme_set']."/shot.gif\" alt=\"screenshot\" width=\"".intval($options[1])."\" /><br /><select id=\"xoops_theme_select\" name=\"xoops_theme_select\" onchange=\"showImgSelected('xoops_theme_img', 'xoops_theme_select', 'themes', '/shot.gif', '".XOOPS_URL."');\">".$theme_options."</select><input type=\"submit\" value=\""._GO."\" />";
+	} else {
+		$block['theme_select'] = '<select name="xoops_theme_select" onchange="submit();" size="3">'.$theme_options.'</select>';
+	}
+	
+	$block['theme_select'] .= '<br />('.sprintf(_MB_SYSTEM_NUMTHEME, '<b>'.count($xoopsConfig['theme_set_allowed']).'</b>').')<br />';
+	return $block;
+}
+
+function b_system_themes_edit($options)
+{
+	
+	$chk = "";
+	$form = _MB_SYSTEM_THSHOW."&nbsp;";
+	if ( $options[0] == 1 ) {
+		$chk = " checked='checked'";
+	}
+	$form .= "<input type='radio' name='options[0]' value='1'".$chk." />&nbsp;"._YES;
+	$chk = "";
+	if ( $options[0] == 0 ) {
+		$chk = ' checked="checked"';
+	}
+	$form .= '&nbsp;<input type="radio" name="options[0]" value="0"'.$chk.' />'._NO;
+	$form .= '<br />'._MB_SYSTEM_THWIDTH.'&nbsp;';
+	$form .= "<input type='text' name='options[1]' value='".$options[1]."' />";
+	return $form;
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/admin.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/admin.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/admin.php	(revision 405)
@@ -0,0 +1,155 @@
+<?php
+// $Id: admin.php,v 1.3 2006/05/01 02:37:29 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+if (isset($_POST['fct'])) {
+    $fct = trim($_POST['fct']);
+}
+if (isset($_GET['fct'])) {
+    $fct = trim($_GET['fct']);
+}
+if (isset($fct) && $fct == "users") {
+    $xoopsOption['pagetype'] = "user";
+}
+include "../../mainfile.php";
+include XOOPS_ROOT_PATH."/include/cp_functions.php";
+if ( file_exists(XOOPS_ROOT_PATH."/modules/system/language/".$xoopsConfig['language']."/admin.php") ) {
+    include XOOPS_ROOT_PATH."/modules/system/language/".$xoopsConfig['language']."/admin.php";
+} else {
+    include XOOPS_ROOT_PATH."/modules/system/language/english/admin.php";
+}
+include_once XOOPS_ROOT_PATH."/class/xoopsmodule.php";
+
+$admintest = 0;
+
+if (is_object($xoopsUser)) {
+    $xoopsModule =& XoopsModule::getByDirname("system");
+    if ( !$xoopsUser->isAdmin($xoopsModule->mid()) ) {
+        redirect_header(XOOPS_URL."/",3,_NOPERM);
+        exit();
+    }
+    $admintest=1;
+} else {
+    redirect_header(XOOPS_URL."/",3,_NOPERM);
+    exit();
+}
+
+// include system category definitions
+include_once XOOPS_ROOT_PATH."/modules/system/constants.php";
+$error = false;
+if ($admintest != 0) {
+    if (isset($fct) && $fct != '') {
+        if (file_exists(XOOPS_ROOT_PATH."/modules/system/admin/".$fct."/xoops_version.php")) {
+        
+            if (file_exists(XOOPS_ROOT_PATH."/modules/system/language/".$xoopsConfig['language']."/admin/".$fct.".php")) {
+                include XOOPS_ROOT_PATH."/modules/system/language/".$xoopsConfig['language']."/admin/".$fct.".php";
+            } elseif (file_exists(XOOPS_ROOT_PATH."/modules/system/language/english/admin/".$fct.".php")) {
+                include XOOPS_ROOT_PATH."/modules/system/language/english/admin/".$fct.".php";
+            }
+            include XOOPS_ROOT_PATH."/modules/system/admin/".$fct."/xoops_version.php";
+            $sysperm_handler =& xoops_gethandler('groupperm');
+            $category = !empty($modversion['category']) ? intval($modversion['category']) : 0;
+            unset($modversion);
+            if ($category > 0) {
+                $groups = $xoopsUser->getGroups();
+                if (in_array(XOOPS_GROUP_ADMIN, $groups) || false != $sysperm_handler->checkRight('system_admin', $category, $groups, $xoopsModule->getVar('mid'))){
+                    if (file_exists(XOOPS_ROOT_PATH."/modules/system/admin/".$fct."/main.php")) {
+                        include_once XOOPS_ROOT_PATH."/modules/system/admin/".$fct."/main.php";
+                    } else {
+                        $error = true;
+                    }
+                } else {
+                    $error = true;
+                }
+            } elseif ($fct == 'version') {
+                if (file_exists(XOOPS_ROOT_PATH."/modules/system/admin/version/main.php")) {
+                    include_once XOOPS_ROOT_PATH."/modules/system/admin/version/main.php";
+                } else {
+                    $error = true;
+                }
+            } else {
+                $error = true;
+            }
+        } else {
+            $error = true;
+        }
+    } else {
+        $error = true;
+    }
+}
+
+if (false != $error) {
+    xoops_cp_header();
+    echo "<h4>System Configuration</h4>";
+    echo '<table class="outer" cellpadding="4" cellspacing="1">';
+    echo '<tr>';
+    $groups = $xoopsUser->getGroups();
+    $all_ok = false;
+    if (!in_array(XOOPS_GROUP_ADMIN, $groups)) {
+        $sysperm_handler =& xoops_gethandler('groupperm');
+        $ok_syscats = $sysperm_handler->getItemIds('system_admin', $groups);
+    } else {
+        $all_ok = true;
+    }
+    $admin_dir = XOOPS_ROOT_PATH."/modules/system/admin";
+    $handle = opendir($admin_dir);
+    $counter = 0;
+    $class = 'even';
+    while ($file = readdir($handle)) {
+        if (strtolower($file) != 'cvs' && !preg_match("/[.]/", $file) && is_dir($admin_dir.'/'.$file)) {
+            include $admin_dir.'/'.$file.'/xoops_version.php';
+            if ($modversion['hasAdmin']) {
+                $category = isset($modversion['category']) ? intval($modversion['category']) : 0;
+                if (false != $all_ok || in_array($modversion['category'], $ok_syscats)) {
+                    echo "<td class='$class' align='center' valign='bottom' width='19%'>";
+                    echo "<a href='".XOOPS_URL."/modules/system/admin.php?fct=".$file."'><b>" .trim($modversion['name'])."</b></a>\n";
+                    echo "</td>";
+                    $counter++;
+                    $class = ($class == 'even') ? 'odd' : 'even';
+                }
+                if ( $counter > 4 ) {
+                    $counter = 0;
+                    echo "</tr>";
+                    echo "<tr>";
+                }
+            }
+            unset($modversion);
+        }
+    }
+    while ($counter < 5) {
+        echo '<td class="'.$class.'">&nbsp;</td>';
+        $class = ($class == 'even') ? 'odd' : 'even';
+        $counter++;
+    }
+    echo '</tr></table>';
+    xoops_cp_footer();
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/templates/system_userinfo.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/templates/system_userinfo.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/templates/system_userinfo.html	(revision 405)
@@ -0,0 +1,151 @@
+<{if $user_ownpage == true}>
+
+<form name="usernav" action="user.php" method="post">
+
+<br /><br />
+
+<table width="70%" align="center" border="0">
+  <tr align="center">
+    <td><input type="button" value="<{$lang_editprofile}>" onclick="location='edituser.php'" />
+    <input type="button" value="<{$lang_avatar}>" onclick="location='edituser.php?op=avatarform'" />
+    <input type="button" value="<{$lang_inbox}>" onclick="location='viewpmsg.php'" />
+
+    <{if $user_candelete == true}>
+    <input type="button" value="<{$lang_deleteaccount}>" onclick="location='user.php?op=delete'" />
+    <{/if}>
+
+    <input type="button" value="<{$lang_logout}>" onclick="location='user.php?op=logout'" /></td>
+  </tr>
+</table>
+</form>
+
+<br /><br />
+<{elseif $xoops_isadmin != false}>
+
+<br /><br />
+
+<table width="70%" align="center" border="0">
+  <tr align="center">
+    <td><input type="button" value="<{$lang_editprofile}>" onclick="location='<{$xoops_url}>/modules/system/admin.php?fct=users&amp;uid=<{$user_uid}>&amp;op=modifyUser'" />
+    <input type="button" value="<{$lang_deleteaccount}>" onclick="location='<{$xoops_url}>/modules/system/admin.php?fct=users&amp;op=delUser&amp;uid=<{$user_uid}>'" /></td>
+  </tr>
+</table>
+
+<br /><br />
+<{/if}>
+
+<table width="100%" border="0" cellspacing="5">
+  <tr valign="top">
+    <td width="50%">
+      <table class="outer" cellpadding="4" cellspacing="1" width="100%">
+        <tr>
+          <th colspan="2" align="center"><{$lang_allaboutuser}></th>
+        </tr>
+        <tr valign="top">
+          <td class="head"><{$lang_avatar}></td>
+          <td align="center" class="even"><img src="<{$user_avatarurl}>" alt="Avatar" /></td>
+        </tr>
+        <tr>
+          <td class="head"><{$lang_realname}></td>
+          <td align="center" class="odd"><{$user_realname}></td>
+        </tr>
+        <tr>
+          <td class="head"><{$lang_website}></td>
+          <td class="even"><{$user_websiteurl}></td>
+        </tr>
+        <tr valign="top">
+          <td class="head"><{$lang_email}></td>
+          <td class="odd"><{$user_email}></td>
+        </tr>
+	<tr valign="top">
+          <td class="head"><{$lang_privmsg}></td>
+          <td class="even"><{$user_pmlink}></td>
+        </tr>
+        <tr valign="top">
+          <td class="head"><{$lang_icq}></td>
+          <td class="odd"><{$user_icq}></td>
+        </tr>
+        <tr valign="top">
+          <td class="head"><{$lang_aim}></td>
+          <td class="even"><{$user_aim}></td>
+        </tr>
+        <tr valign="top">
+          <td class="head"><{$lang_yim}></td>
+          <td class="odd"><{$user_yim}></td>
+        </tr>
+        <tr valign="top">
+          <td class="head"><{$lang_msnm}></td>
+          <td class="even"><{$user_msnm}></td>
+        </tr>
+        <tr valign="top">
+          <td class="head"><{$lang_location}></td>
+          <td class="odd"><{$user_location}></td>
+        </tr>
+        <tr valign="top">
+          <td class="head"><{$lang_occupation}></td>
+          <td class="even"><{$user_occupation}></td>
+        </tr>
+        <tr valign="top">
+          <td class="head"><{$lang_interest}></td>
+          <td class="odd"><{$user_interest}></td>
+        </tr>
+        <tr valign="top">
+          <td class="head"><{$lang_extrainfo}></td>
+          <td class="even"><{$user_extrainfo}></td>
+        </tr>
+      </table>
+    </td>
+    <td width="50%">
+      <table class="outer" cellpadding="4" cellspacing="1" width="100%">
+        <tr valign="top">
+          <th colspan="2" align="center"><{$lang_statistics}></th>
+        </tr>
+        <tr valign="top">
+          <td class="head"><{$lang_membersince}></td>
+          <td align="center" class="even"><{$user_joindate}></td>
+        </tr>
+        <tr valign="top">
+          <td class="head"><{$lang_rank}></td>
+          <td align="center" class="odd"><{$user_rankimage}><br /><{$user_ranktitle}></td>
+        </tr>
+        <tr valign="top">
+          <td class="head"><{$lang_posts}></td>
+          <td align="center" class="even"><{$user_posts}></td>
+        </tr>
+	<tr valign="top">
+          <td class="head"><{$lang_lastlogin}></td>
+          <td align="center" class="odd"><{$user_lastlogin}></td>
+        </tr>
+      </table>
+      <br />
+      <table class="outer" cellpadding="4" cellspacing="1" width="100%">
+        <tr valign="top">
+          <th colspan="2" align="center"><{$lang_signature}></th>
+        </tr>
+        <tr valign="top">
+          <td class="even"><{$user_signature}></td>
+        </tr>
+      </table>
+    </td>
+  </tr>
+</table>
+
+<!-- start module search results loop -->
+<{foreach item=module from=$modules}>
+
+<p>
+<h4><{$module.name}></h4>
+
+  <!-- start results item loop -->
+  <{foreach item=result from=$module.results}>
+
+  <img src="<{$result.image}>" alt="<{$module.name}>" /><b><a href="<{$result.link}>"><{$result.title}></a></b><br /><small>(<{$result.time}>)</small><br />
+
+  <{/foreach}>
+  <!-- end results item loop -->
+
+<{$module.showall_link}>
+</p>
+
+<{/foreach}>
+<!-- end module search results loop -->
Index: /temp/test-xoops.ec-cube.net/html/modules/system/templates/system_comments_flat.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/templates/system_comments_flat.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/templates/system_comments_flat.html	(revision 405)
@@ -0,0 +1,9 @@
+<table class="outer" cellpadding="5" cellspacing="1">
+  <tr>
+    <th width="20%"><{$lang_poster}></th>
+    <th><{$lang_thread}></th>
+  </tr>
+  <{foreach item=comment from=$comments}>
+    <{include file="db:system_comment.html" comment=$comment}>
+  <{/foreach}>
+</table>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/templates/system_dummy.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/templates/system_dummy.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/templates/system_dummy.html	(revision 405)
@@ -0,0 +1,1 @@
+<{$dummy_content}>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/templates/system_siteclosed.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/templates/system_siteclosed.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/templates/system_siteclosed.html	(revision 405)
@@ -0,0 +1,52 @@
+<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<{$xoops_langcode}>" lang="<{$xoops_langcode}>">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=<{$xoops_charset}>" />
+<meta http-equiv="content-language" content="<{$xoops_langcode}>" />
+<title><{$xoops_sitename}></title>
+<link rel="stylesheet" type="text/css" media="all" href="<{$xoops_url}>/xoops.css" />
+
+</head>
+<body>
+  <table cellspacing="0">
+    <tr id="header">
+      <td style="width: 150px; background-color: #2F5376; vertical-align: middle; text-align:center;"><a href="<{$xoops_url}>/"><img src="<{$xoops_imageurl}>logo.gif" width="150" alt="" /></a></td>
+      <td style="width: 100%; background-color: #2F5376; vertical-align: middle; text-align:center;">&nbsp;</td>
+    </tr>
+    <tr>
+      <td style="height: 8px; border-bottom: 1px solid silver; background-color: #dddddd;" colspan="2">&nbsp;</td>
+    </tr>
+  </table>
+
+  <table cellspacing="1" align="center" width="80%" border="0" cellpadding="10px;">
+    <tr>
+      <td align="center"><div style="background-color: #DDFFDF; color: #136C99; text-align: center; border-top: 1px solid #DDDDFF; border-left: 1px solid #DDDDFF; border-right: 1px solid #AAAAAA; border-bottom: 1px solid #AAAAAA; font-weight: bold; padding: 10px;"><{$lang_siteclosemsg}></div></td>
+    </tr>
+  </table>
+  
+  <form action="<{$xoops_url}>/user.php" method="post">
+    <table cellspacing="0" align="center" style="border: 1px solid silver; width: 200px;">
+      <tr>
+        <th style="background-color: #2F5376; color: #FFFFFF; padding : 2px; vertical-align : middle;" colspan="2"><{$lang_login}></th>
+      </tr>
+      <tr>
+        <td style="padding: 2px;"><{$lang_username}></td><td style="padding: 2px;"><input type="text" name="uname" size="12" value="" /></td>
+      </tr>
+      <tr>
+        <td style="padding: 2px;"><{$lang_password}></td><td style="padding: 2px;"><input type="password" name="pass" size="12" /></td>
+      </tr>
+      <tr>
+        <td style="padding: 2px;">&nbsp;</td>
+        <td style="padding: 2px;"><input type="hidden" name="xoops_login" value="1" /><input type="submit" value="<{$lang_login}>" /></td>
+      </tr>
+    </table>
+  </form>
+
+  <table cellspacing="0" width="100%">
+    <tr>
+      <td style="height:8px; border-bottom: 1px solid silver; border-top: 1px solid silver; background-color: #dddddd;" colspan="2">&nbsp;</td>
+    </tr>
+  </table>
+
+  </body>
+</html>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/templates/system_imagemanager2.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/templates/system_imagemanager2.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/templates/system_imagemanager2.html	(revision 405)
@@ -0,0 +1,65 @@
+<!DOCTYPE html PUBLIC '//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<{$xoops_langcode}>" lang="<{$xoops_langcode}>">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=<{$xoops_charset}>" />
+<meta http-equiv="content-language" content="<{$xoops_langcode}>" />
+<title><{$xoops_sitename}> <{$lang_imgmanager}></title>
+<{$image_form.javascript}>
+<style type="text/css" media="all">
+body {margin: 0;}
+img {border: 0;}
+table {width: 100%; margin: 0;}
+a:link {color: #3a76d6; font-weight: bold; background-color: transparent;}
+a:visited {color: #9eb2d6; font-weight: bold; background-color: transparent;}
+a:hover {color: #e18a00; background-color: transparent;}
+table td {background-color: white; font-size: 12px; padding: 0; border-width: 0; vertical-align: top; font-family: Verdana, Arial, Helvetica, sans-serif;}
+table#imagenav td {vertical-align: bottom; padding: 5px;}
+td.body {padding: 5px; vertical-align: middle;}
+td.caption {border: 0; background-color: #2F5376; color:white; font-size: 12px; padding: 5px; vertical-align: top; text-align:left; font-family: Verdana, Arial, Helvetica, sans-serif;}
+table#imageform {border: 1px solid silver;}
+table#header td {width: 100%; background-color: #2F5376; vertical-align: middle;}
+table#header td#headerbar {border-bottom: 1px solid silver; background-color: #dddddd;}
+div#footer {text-align:right; padding: 5px;}
+</style>
+</head>
+
+<body onload="window.resizeTo(<{$xsize}>, <{$ysize}>);">
+  <table id="header" cellspacing="0">
+    <tr>
+      <td><a href="<{$xoops_url}>/"><img src="<{$xoops_url}>/images/logo.gif" width="150" height="80" alt="" /></a></td><td> </td>
+    </tr>
+    <tr>
+      <td id="headerbar" colspan="2"> </td>
+    </tr>
+  </table>
+
+  <table cellspacing="0" id="imagenav">
+    <tr>
+      <td align="left"><a href="<{$xoops_url}>/imagemanager.php?target=<{$target}>&amp;cat_id=<{$show_cat}>"><{$lang_imgmanager}></a></td>
+    </tr>
+  </table>
+
+  <form name="<{$image_form.name}>" id="<{$image_form.name}>" action="<{$image_form.action}>" method="<{$image_form.method}>" <{$image_form.extra}>>
+    <table id="imageform" cellspacing="0">
+    <!-- start of form elements loop -->
+    <{foreach item=element from=$image_form.elements}>
+      <{if $element.hidden != true}>
+      <tr valign="top">
+        <td class="caption"><{$element.caption}></td>
+        <td class="body"><{$element.body}></td>
+      </tr>
+      <{else}>
+      <{$element.body}>
+      <{/if}>
+    <{/foreach}>
+    <!-- end of form elements loop -->
+    </table>
+  </form>
+
+
+  <div id="footer">
+    <input value="<{$lang_close}>" type="button" onclick="javascript:window.close();" />
+  </div>
+
+  </body>
+</html>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/templates/system_redirect.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/templates/system_redirect.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/templates/system_redirect.html	(revision 405)
@@ -0,0 +1,13 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<{$xoops_charset}>" />
+<meta http-equiv="Refresh" content="<{$time}>; url=<{$url}>" />
+<title><{$xoops_sitename}></title>
+</head>
+<body>
+<div style="text-align:center; background-color: #EBEBEB; border-top: 1px solid #FFFFFF; border-left: 1px solid #FFFFFF; border-right: 1px solid #AAAAAA; border-bottom: 1px solid #AAAAAA; font-weight : bold;">
+  <h4><{$message}></h4>
+  <p><{$lang_ifnotreload}></p>
+</div>
+</body>
+</html>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/templates/system_comment.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/templates/system_comment.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/templates/system_comment.html	(revision 405)
@@ -0,0 +1,50 @@
+<!-- start comment post -->
+        <tr>
+          <td class="head"><a id="comment<{$comment.id}>"></a> <{$comment.poster.uname}></td>
+          <td class="head"><div class="comDate"><span class="comDateCaption"><{$lang_posted}>:</span> <{$comment.date_posted}>&nbsp;&nbsp;<span class="comDateCaption"><{$lang_updated}>:</span> <{$comment.date_modified}></div></td>
+        </tr>
+        <tr>
+
+          <{if $comment.poster.id != 0}>
+
+          <td class="odd"><div class="comUserRank"><div class="comUserRankText"><{$comment.poster.rank_title}></div><img class="comUserRankImg" src="<{$xoops_upload_url}>/<{$comment.poster.rank_image}>" alt="" /></div><img class="comUserImg" src="<{$xoops_upload_url}>/<{$comment.poster.avatar}>" alt="" /><div class="comUserStat"><span class="comUserStatCaption"><{$lang_joined}>:</span> <{$comment.poster.regdate}></div><div class="comUserStat"><span class="comUserStatCaption"><{$lang_from}>:</span> <{$comment.poster.from}></div><div class="comUserStat"><span class="comUserStatCaption"><{$lang_posts}>:</span> <{$comment.poster.postnum}></div><div class="comUserStatus"><{$comment.poster.status}></div></td>
+
+          <{else}>
+
+          <td class="odd"> </td>
+
+          <{/if}>
+
+          <td class="odd">
+            <div class="comTitle"><{$comment.image}><{$comment.title}></div><div class="comText"><{$comment.text}></div>
+          </td>
+        </tr>
+        <tr>
+          <td class="even"></td>
+
+          <{if $xoops_iscommentadmin == true}>
+
+          <td class="even" align="right">
+            <a href="<{$editcomment_link}>&amp;com_id=<{$comment.id}>"><img src="<{$xoops_url}>/images/icons/edit.gif" alt="<{$lang_edit}>" /></a><a href="<{$deletecomment_link}>&amp;com_id=<{$comment.id}>"><img src="<{$xoops_url}>/images/icons/delete.gif" alt="<{$lang_delete}>" /></a><a href="<{$replycomment_link}>&amp;com_id=<{$comment.id}>"><img src="<{$xoops_url}>/images/icons/reply.gif" alt="<{$lang_reply}>" /></a>
+          </td>
+
+          <{elseif $xoops_isuser == true && $xoops_userid == $comment.poster.id}>
+
+          <td class="even" align="right">
+            <a href="<{$editcomment_link}>&amp;com_id=<{$comment.id}>"><img src="<{$xoops_url}>/images/icons/edit.gif" alt="<{$lang_edit}>" /></a><a href="<{$replycomment_link}>&amp;com_id=<{$comment.id}>"><img src="<{$xoops_url}>/images/icons/reply.gif" alt="<{$lang_reply}>" /></a>
+          </td>
+
+          <{elseif $xoops_isuser == true || $anon_canpost == true}>
+
+          <td class="even" align="right">
+            <a href="<{$replycomment_link}>&amp;com_id=<{$comment.id}>"><img src="<{$xoops_url}>/images/icons/reply.gif" alt="<{$lang_reply}>" /></a>
+          </td>
+
+          <{else}>
+
+          <td class="even"> </td>
+
+          <{/if}>
+
+        </tr>
+<!-- end comment post -->
Index: /temp/test-xoops.ec-cube.net/html/modules/system/templates/system_userform.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/templates/system_userform.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/templates/system_userform.html	(revision 405)
@@ -0,0 +1,23 @@
+<fieldset style="padding: 10px;">
+  <legend style="font-weight: bold;"><{$lang_login}></legend>
+  <form action="user.php" method="post">
+    <{$lang_username}> <input type="text" name="uname" size="26" maxlength="60" value="<{$usercookie}>" /><br />
+    <{$lang_password}> <input type="password" name="pass" size="21" maxlength="32" /><br />
+    <input type="checkbox" name="rememberme" value="On" /><{$smarty.const._REMEMBERME}><br /><{* autologin hack GIJ *}>
+    <input type="hidden" name="op" value="login" />
+    <input type="hidden" name="xoops_redirect" value="<{$redirect_page}>" />
+    <input type="submit" value="<{$lang_login}>" />
+  </form>
+  <a name="lost"></a>
+  <div><{$lang_notregister}><br /></div>
+</fieldset>
+
+<br />
+
+<fieldset style="padding: 10px;">
+  <legend style="font-weight: bold;"><{$lang_lostpassword}></legend>
+  <div><br /><{$lang_noproblem}></div>
+  <form action="lostpass.php" method="post">
+    <{$lang_youremail}> <input type="text" name="email" size="26" maxlength="60" />&nbsp;&nbsp;<input type="hidden" name="op" value="mailpasswd" /><input type="submit" value="<{$lang_sendpassword}>" />
+  </form>
+</fieldset>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/templates/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/templates/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/templates/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/templates/blocks/system_block_user.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/templates/blocks/system_block_user.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/templates/blocks/system_block_user.html	(revision 405)
@@ -0,0 +1,19 @@
+<table cellspacing="0">
+  <tr>
+    <td id="usermenu">
+      <a class="menuTop" href="<{$xoops_url}>/user.php"><{$block.lang_youraccount}></a>
+      <a href="<{$xoops_url}>/edituser.php"><{$block.lang_editaccount}></a>
+      <a href="<{$xoops_url}>/notifications.php"><{$block.lang_notifications}></a>
+      <a href="<{$xoops_url}>/user.php?op=logout"><{$block.lang_logout}></a>
+      <{if $block.new_messages > 0}>
+        <a class="highlight" href="<{$xoops_url}>/viewpmsg.php"><{$block.lang_inbox}> (<span style="color:#ff0000; font-weight: bold;"><{$block.new_messages}></span>)</a>
+      <{else}>
+        <a href="<{$xoops_url}>/viewpmsg.php"><{$block.lang_inbox}></a>
+      <{/if}>
+
+      <{if $xoops_isadmin}>
+        <a href="<{$xoops_url}>/admin.php"><{$block.lang_adminmenu}></a>
+      <{/if}>
+    </td>
+  </tr>
+</table>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/templates/blocks/system_block_siteinfo.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/templates/blocks/system_block_siteinfo.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/templates/blocks/system_block_siteinfo.html	(revision 405)
@@ -0,0 +1,28 @@
+<table class="outer" cellspacing="0">
+
+  <{if $block.showgroups == true}>
+
+  <!-- start group loop -->
+  <{foreach item=group from=$block.groups}>
+  <tr>
+    <th colspan="2"><{$group.name}></th>
+  </tr>
+
+  <!-- start group member loop -->
+  <{foreach item=user from=$group.users}>
+  <tr>
+    <td class="even" valign="middle" align="center"><img src="<{$user.avatar}>" alt="" width="32" /><br /><a href="<{$xoops_url}>/userinfo.php?uid=<{$user.id}>"><{$user.name}></a></td><td class="odd" width="20%" align="right" valign="middle"><{$user.msglink}></td>
+  </tr>
+  <{/foreach}>
+  <!-- end group member loop -->
+
+  <{/foreach}>
+  <!-- end group loop -->
+  <{/if}>
+</table>
+
+<br />
+
+<div style="margin: 3px; text-align:center;">
+  <img src="<{$block.logourl}>" alt="" border="0" /><br /><{$block.recommendlink}>
+</div>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/templates/blocks/system_block_waiting.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/templates/blocks/system_block_waiting.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/templates/blocks/system_block_waiting.html	(revision 405)
@@ -0,0 +1,5 @@
+<ul>
+  <{foreach item=module from=$block.modules}>
+  <li><a href="<{$module.adminlink}>"><{$module.lang_linkname}></a>: <{$module.pendingnum}></li>
+  <{/foreach}>
+</ul>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/templates/blocks/system_block_online.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/templates/blocks/system_block_online.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/templates/blocks/system_block_online.html	(revision 405)
@@ -0,0 +1,1 @@
+<{$block.online_total}><br /><br /><{$block.lang_members}>: <{$block.online_members}><br /><{$block.lang_guests}>: <{$block.online_guests}><br /><br /><{$block.online_names}> <a href="javascript:openWithSelfMain('<{$xoops_url}>/misc.php?action=showpopups&amp;type=online','Online',420,350);"><{$block.lang_more}></a>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/templates/blocks/system_block_topusers.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/templates/blocks/system_block_topusers.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/templates/blocks/system_block_topusers.html	(revision 405)
@@ -0,0 +1,14 @@
+<table cellspacing="1" class="outer">
+  <{foreach item=user from=$block.users}>
+  <tr class="<{cycle values="even,odd"}>" valign="middle">
+    <td><{$user.rank}></td>
+    <td align="center">
+      <{if $user.avatar != ""}>
+      <img src="<{$user.avatar}>" alt="" width="32" /><br />
+      <{/if}>
+      <a href="<{$xoops_url}>/userinfo.php?uid=<{$user.id}>"><{$user.name}></a>
+    </td>
+    <td align="center"><{$user.posts}></td>
+  </tr>
+  <{/foreach}>
+</table>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/templates/blocks/system_block_comments.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/templates/blocks/system_block_comments.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/templates/blocks/system_block_comments.html	(revision 405)
@@ -0,0 +1,11 @@
+<table width="100%" cellspacing="1" class="outer">
+  <{foreach item=comment from=$block.comments}>
+  <tr class="<{cycle values="even,odd"}>">
+    <td align="center"><img src="<{$xoops_url}>/images/subject/<{$comment.icon}>" alt="" /></td>
+    <td><{$comment.title}></td>
+    <td align="center"><{$comment.module}></td>
+    <td align="center"><{$comment.poster}></td>
+    <td align="right"><{$comment.time}></td>
+  </tr>
+  <{/foreach}>
+</table>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/templates/blocks/system_block_search.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/templates/blocks/system_block_search.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/templates/blocks/system_block_search.html	(revision 405)
@@ -0,0 +1,4 @@
+<form style="margin-top: 0px;" action="<{$xoops_url}>/search.php" method="get">
+  <input type="text" name="query" size="14" /><input type="hidden" name="action" value="results" /><br /><input type="submit" value="<{$block.lang_search}>" />
+</form>
+<a href="<{$xoops_url}>/search.php"><{$block.lang_advsearch}></a>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/templates/blocks/system_block_themes.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/templates/blocks/system_block_themes.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/templates/blocks/system_block_themes.html	(revision 405)
@@ -0,0 +1,5 @@
+<div style="text-align: center;">
+<form action="index.php" method="post">
+<{$block.theme_select}>
+</form>
+</div>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/templates/blocks/system_block_notification.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/templates/blocks/system_block_notification.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/templates/blocks/system_block_notification.html	(revision 405)
@@ -0,0 +1,20 @@
+<form action="<{$block.target_page}>" method="post">
+<table class="outer">
+  <{foreach item=category from=$block.categories}>
+  <{foreach name=inner item=event from=$category.events}>
+  <{if $smarty.foreach.inner.first}>
+  <tr>
+    <td class="head" colspan="2"><{$category.title}></td>
+  </tr>
+  <{/if}>
+  <tr>
+    <td class="odd"><{counter assign=index}><input type="hidden" name="not_list[<{$index}>][params]" value="<{$category.name}>,<{$category.itemid}>,<{$event.name}>" /><input type="checkbox" name="not_list[<{$index}>][status]" value="1" <{if $event.subscribed}>checked="checked"<{/if}> /></td>
+    <td class="odd"><{$event.caption}></td>
+  </tr>
+  <{/foreach}>
+  <{/foreach}>
+  <tr>
+    <td class="foot" colspan="2"><input type="hidden" name="not_redirect" value="<{$block.redirect_script}>" /><input type="submit" name="not_submit" value="<{$block.submit_button}>" /></td>
+  </tr>
+</table>
+</form>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/templates/blocks/system_block_login.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/templates/blocks/system_block_login.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/templates/blocks/system_block_login.html	(revision 405)
@@ -0,0 +1,14 @@
+<form style="margin-top: 0px;" action="<{$xoops_url}>/user.php" method="post">
+    <{$block.lang_username}><br />
+    <input type="text" name="uname" size="12" value="<{$block.unamevalue}>" maxlength="60" /><br />
+    <{$block.lang_password}><br />
+    <input type="password" name="pass" size="12" maxlength="32" /><br />
+    <input type="checkbox" name="rememberme" value="On" class ="formButton" /><{$smarty.const._REMEMBERME}><br /><{* autologin hack GIJ *}>
+    <input type="hidden" name="xoops_redirect" value="<{$xoops_requesturi}>" />
+    <input type="hidden" name="op" value="login" />
+    <input type="submit" value="<{$block.lang_login}>" /><br />
+    <{$block.sslloginlink}>
+</form>
+<a href="<{$xoops_url}>/user.php#lost"><{$block.lang_lostpass}></a>
+<br /><br />
+<a href="<{$xoops_url}>/register.php"><{$block.lang_registernow}></a>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/templates/blocks/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/templates/blocks/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/templates/blocks/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/templates/blocks/system_block_mainmenu.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/templates/blocks/system_block_mainmenu.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/templates/blocks/system_block_mainmenu.html	(revision 405)
@@ -0,0 +1,15 @@
+<table cellspacing="0">
+  <tr>
+    <td id="mainmenu">
+      <a class="menuTop" href="<{$xoops_url}>/"><{$block.lang_home}></a>
+      <!-- start module menu loop -->
+      <{foreach item=module from=$block.modules}>
+      <a class="menuMain" href="<{$xoops_url}>/modules/<{$module.directory}>/"><{$module.name}></a>
+        <{foreach item=sublink from=$module.sublinks}>
+          <a class="menuSub" href="<{$sublink.url}>"><{$sublink.name}></a>
+        <{/foreach}>
+      <{/foreach}>
+      <!-- end module menu loop -->
+    </td>
+  </tr>
+</table>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/templates/blocks/system_block_newusers.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/templates/blocks/system_block_newusers.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/templates/blocks/system_block_newusers.html	(revision 405)
@@ -0,0 +1,13 @@
+<table cellspacing="1" class="outer">
+  <{foreach item=user from=$block.users}>
+    <tr class="<{cycle values="even,odd"}>" valign="middle">
+      <td align="center">
+      <{if $user.avatar != ""}>
+      <img src="<{$user.avatar}>" alt="" width="32" /><br />
+      <{/if}>
+      <a href="<{$xoops_url}>/userinfo.php?uid=<{$user.id}>"><{$user.name}></a>
+      </td>
+      <td align="center"><{$user.joindate}></td>
+    </tr>
+  <{/foreach}>
+</table>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/templates/system_rss.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/templates/system_rss.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/templates/system_rss.html	(revision 405)
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<rss version="2.0">
+  <channel>
+    <title><{$channel_title}></title>
+    <link><{$channel_link}></link>
+    <description><{$channel_desc}></description>
+    <lastBuildDate><{$channel_lastbuild}></lastBuildDate>
+    <docs>http://backend.userland.com/rss/</docs>
+    <generator><{$channel_generator}></generator>
+    <category><{$channel_category}></category>
+    <managingEditor><{$channel_editor}></managingEditor>
+    <webMaster><{$channel_webmaster}></webMaster>
+    <language><{$channel_language}></language>
+    <{if $image_url != ""}>
+    <image>
+      <title><{$channel_title}></title>
+      <url><{$image_url}></url>
+      <link><{$channel_link}></link>
+      <width><{$image_width}></width>
+      <height><{$image_height}></height>
+    </image>
+    <{/if}>
+    <{foreach item=item from=$items}>
+    <item>
+      <title><{$item.title}></title>
+      <link><{$item.link}></link>
+      <description><{$item.description}></description>
+      <pubDate><{$item.pubdate}></pubDate>
+      <guid><{$item.guid}></guid>
+    </item>
+    <{/foreach}>
+  </channel>
+</rss>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/templates/system_comments_thread.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/templates/system_comments_thread.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/templates/system_comments_thread.html	(revision 405)
@@ -0,0 +1,37 @@
+<{section name=i loop=$comments}>
+<br />
+<table cellspacing="1" class="outer">
+  <tr>
+    <th width="20%"><{$lang_poster}></th>
+    <th><{$lang_thread}></th>
+  </tr>
+  <{include file="db:system_comment.html" comment=$comments[i]}>
+</table>
+
+<{if $show_threadnav == true}>
+<div style="text-align:left; margin:3px; padding: 5px;">
+<a href="<{$comment_url}>"><{$lang_top}></a> | <a href="<{$comment_url}>&amp;com_id=<{$comments[i].pid}>&amp;com_rootid=<{$comments[i].rootid}>#newscomment<{$comments[i].pid}>"><{$lang_parent}></a>
+</div>
+<{/if}>
+
+<{if $comments[i].show_replies == true}>
+<!-- start comment tree -->
+<br />
+<table cellspacing="1" class="outer">
+  <tr>
+    <th width="50%"><{$lang_subject}></th>
+    <th width="20%" align="center"><{$lang_poster}></th>
+    <th align="right"><{$lang_posted}></th>
+  </tr>
+  <{foreach item=reply from=$comments[i].replies}>
+  <tr>
+    <td class="even"><{$reply.prefix}> <a href="<{$comment_url}>&amp;com_id=<{$reply.id}>&amp;com_rootid=<{$reply.root_id}>"><{$reply.title}></a></td>
+    <td class="odd" align="center"><{$reply.poster.uname}></td>
+    <td class="even" align="right"><{$reply.date_posted}></td>
+  </tr>
+  <{/foreach}>
+</table>
+<!-- end comment tree -->
+<{/if}>
+
+<{/section}>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/templates/system_imagemanager.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/templates/system_imagemanager.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/templates/system_imagemanager.html	(revision 405)
@@ -0,0 +1,99 @@
+<!DOCTYPE html PUBLIC '//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<{$xoops_langcode}>" lang="<{$xoops_langcode}>">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=<{$xoops_charset}>" />
+<meta http-equiv="content-language" content="<{$xoops_langcode}>" />
+<title><{$sitename}> <{$lang_imgmanager}></title>
+<script type="text/javascript">
+<!--//
+function appendCode(addCode) {
+	var targetDom = window.opener.xoopsGetElementById('<{$target}>');
+	if (targetDom.createTextRange && targetDom.caretPos){
+  		var caretPos = targetDom.caretPos;
+		caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) 
+== ' ' ? addCode + ' ' : addCode;  
+	} else if (targetDom.getSelection && targetDom.caretPos){
+		var caretPos = targetDom.caretPos;
+		caretPos.text = caretPos.text.charat(caretPos.text.length - 1)  
+== ' ' ? addCode + ' ' : addCode;
+	} else {
+		targetDom.value = targetDom.value + addCode;
+  	}
+	window.close();
+	return;
+}
+//-->
+</script>
+<style type="text/css" media="all">
+body {margin: 0;}
+img {border: 0;}
+table {width: 100%; margin: 0;}
+a:link {color: #3a76d6; font-weight: bold; background-color: transparent;}
+a:visited {color: #9eb2d6; font-weight: bold; background-color: transparent;}
+a:hover {color: #e18a00; background-color: transparent;}
+table td {background-color: white; font-size: 12px; padding: 0; border-width: 0; vertical-align: top; font-family: Verdana, Arial, Helvetica, sans-serif;}
+table#imagenav td {vertical-align: bottom; padding: 5px;}
+table#imagemain td {border-right: 1px solid silver; border-bottom: 1px solid silver; padding: 5px; vertical-align: middle;}
+table#imagemain th {border: 0; background-color: #2F5376; color:white; font-size: 12px; padding: 5px; vertical-align: top; text-align:center; font-family: Verdana, Arial, Helvetica, sans-serif;}
+table#header td {width: 100%; background-color: #2F5376; vertical-align: middle;}
+table#header td#headerbar {border-bottom: 1px solid silver; background-color: #dddddd;}
+div#pagenav {text-align:center;}
+div#footer {text-align:right; padding: 5px;}
+</style>
+</head>
+
+<body onload="window.resizeTo(<{$xsize}>, <{$ysize}>);">
+  <table id="header" cellspacing="0">
+    <tr>
+      <td><a href="<{$xoops_url}>/"><img src="<{$xoops_url}>/images/logo.gif" width="150" height="80" alt="" /></a></td><td> </td>
+    </tr>
+    <tr>
+      <td id="headerbar" colspan="2"> </td>
+    </tr>
+  </table>
+
+  <form action="imagemanager.php" method="get">
+    <table cellspacing="0" id="imagenav">
+      <tr>
+        <td>
+          <select name="cat_id" onchange="location='<{$xoops_url}>/imagemanager.php?target=<{$target}>&amp;cat_id='+this.options[this.selectedIndex].value"><{$cat_options}></select> <input type="hidden" name="target" value="<{$target}>" /><input type="submit" value="<{$lang_go}>" />
+        </td>
+
+        <{if $show_cat > 0}>
+        <td align="right"><a href="<{$xoops_url}>/imagemanager.php?target=<{$target}>&amp;op=upload&amp;imgcat_id=<{$show_cat}>"><{$lang_addimage}></a></td>
+        <{/if}>
+
+      </tr>
+    </table>
+  </form>
+
+  <{if $image_total > 0}>
+
+  <table cellspacing="0" id="imagemain">
+    <tr>
+      <th><{$lang_imagename}></th>
+      <th><{$lang_image}></th>
+      <th><{$lang_imagemime}></th>
+      <th><{$lang_align}></th>
+    </tr>
+
+    <{section name=i loop=$images}>
+    <tr align="center">
+      <td><input type="hidden" name="image_id[]" value="<{$images[i].id}>" /><{$images[i].nicename}></td>
+      <td><img src="<{$images[i].src}>" alt="" /></td>
+      <td><{$images[i].mimetype}></td>
+      <td><a href="#" onclick="javascript:appendCode('<{$images[i].lxcode}>');"><img src="<{$xoops_url}>/images/alignleft.gif" alt="Left" /></a> <a href="#" onclick="javascript:appendCode('<{$images[i].xcode}>');"><img src="<{$xoops_url}>/images/aligncenter.gif" alt="Center" /></a> <a href="#" onclick="javascript:appendCode('<{$images[i].rxcode}>');"><img src="<{$xoops_url}>/images/alignright.gif" alt="Right" /></a></td>
+    </tr>
+    <{/section}>
+  </table>
+
+  <{/if}>
+
+  <div id="pagenav"><{$pagenav}></div>
+
+  <div id="footer">
+    <input value="<{$lang_close}>" type="button" onclick="javascript:window.close();" />
+  </div>
+
+  </body>
+</html>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/templates/system_comments_nest.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/templates/system_comments_nest.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/templates/system_comments_nest.html	(revision 405)
@@ -0,0 +1,30 @@
+<{section name=i loop=$comments}>
+<br />
+<table cellspacing="1" class="outer">
+  <tr>
+    <th width="20%"><{$lang_poster}></th>
+    <th><{$lang_thread}></th>
+  </tr>
+  <{include file="db:system_comment.html" comment=$comments[i]}>
+</table>
+
+<!-- start comment replies -->
+<{foreach item=reply from=$comments[i].replies}>
+<br />
+<table cellspacing="0" border="0">
+  <tr>
+    <td width="<{$reply.prefix}>"></td>
+    <td>
+      <table class="outer" cellspacing="1">
+        <tr>
+          <th width="20%"><{$lang_poster}></th>
+          <th><{$lang_thread}></th>
+        </tr>
+        <{include file="db:system_comment.html" comment=$reply}>
+      </table>
+    </td>
+  </tr>
+</table>
+<{/foreach}>
+<!-- end comment tree -->
+<{/section}>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/templates/system_notification_list.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/templates/system_notification_list.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/templates/system_notification_list.html	(revision 405)
@@ -0,0 +1,39 @@
+<h4><{$lang_activenotifications}></h4>
+<form name="notificationlist" action="notifications.php" method="post">
+<table class="outer">
+  <tr>
+    <th><input name="allbox" id="allbox" onclick="xoopsCheckAll('notificationlist', 'allbox');" type="checkbox" value="<{$lang_checkall}>" /></th>
+    <th><{$lang_event}></th>
+    <th><{$lang_category}></th>
+    <th><{$lang_itemid}></th>
+    <th><{$lang_itemname}></th>
+  </tr>
+  <{foreach item=module from=$modules}>
+  <tr>
+    <td class="head"><input name="del_mod[<{$module.id}>]" id="del_mod[<{$module.id}>]" onclick="xoopsCheckGroup('notificationlist', 'del_mod[<{$module.id}>]', 'del_not[<{$module.id}>][]');" type="checkbox" value="<{$module.id}>" /></td>
+    <td class="head" colspan="4"><{$lang_module}>: <{$module.name}></td>
+  </tr>
+  <{foreach item=category from=$module.categories}>
+  <{foreach item=item from=$category.items}>
+  <{foreach item=notification from=$item.notifications}>
+  <tr>
+    <{cycle values="odd,even" assign="class"}>
+    <td class="<{$class}>"><input type="checkbox" name="del_not[<{$module.id}>][]" id="del_not[<{$module.id}>][]" value="<{$notification.id}>" /></td>
+    <td class="<{$class}>"><{$notification.event_title}></td>
+    <td class="<{$class}>"><{$notification.category_title}></td>
+    <td class="<{$class}>"><{if $item.id != 0}><{$item.id}><{/if}></td>
+    <td class="<{$class}>"><{if $item.id != 0}><{if $item.url != ''}><a href="<{$item.url}>"><{/if}><{$item.name}><{if $item.url != ''}></a><{/if}><{/if}></td>
+  </tr>
+  <{/foreach}>
+  <{/foreach}>
+  <{/foreach}>
+  <{/foreach}>
+  <tr>
+    <td class="foot" colspan="5">
+      <input type="submit" name="delete_cancel" value="<{$lang_cancel}>" />
+      <input type="reset" name="delete_reset" value="<{$lang_clear}>" />
+      <input type="submit" name="delete" value="<{$lang_delete}>" />
+    </td>
+  </tr>
+</table>
+</form>
Index: /temp/test-xoops.ec-cube.net/html/modules/system/templates/system_notification_select.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/system/templates/system_notification_select.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/system/templates/system_notification_select.html	(revision 405)
@@ -0,0 +1,35 @@
+<{if $xoops_notification.show}>
+<form name="notification_select" action="<{$xoops_notification.target_page}>" method="post">
+<h4 style="text-align:center;"><{$lang_activenotifications}></h4>
+<input type="hidden" name="not_redirect" value="<{$xoops_notification.redirect_script}>" />
+<table class="outer">
+  <tr><th colspan="3"><{$lang_notificationoptions}></th></tr>
+  <tr>
+    <td class="head"><{$lang_category}></td>
+    <td class="head"><input name="allbox" id="allbox" onclick="xoopsCheckAll('notification_select','allbox');" type="checkbox" value="<{$lang_checkall}>" /></td>
+    <td class="head"><{$lang_events}></td>
+  </tr>
+  <{foreach name=outer item=category from=$xoops_notification.categories}>
+  <{foreach name=inner item=event from=$category.events}>
+  <tr>
+    <{if $smarty.foreach.inner.first}>
+    <td class="even" rowspan="<{$smarty.foreach.inner.total}>"><{$category.title}></td>
+    <{/if}>
+    <td class="odd">
+    <{counter assign=index}>
+    <input type="hidden" name="not_list[<{$index}>][params]" value="<{$category.name}>,<{$category.itemid}>,<{$event.name}>" />
+    <input type="checkbox" id="not_list[]" name="not_list[<{$index}>][status]" value="1" <{if $event.subscribed}>checked="checked"<{/if}> />
+    </td>
+    <td class="odd"><{$event.caption}></td>
+  </tr>
+  <{/foreach}>
+  <{/foreach}>
+  <tr>
+    <td class="foot" colspan="3" align="center"><input type="submit" name="not_submit" value="<{$lang_updatenow}>" /></td>
+  </tr>
+</table>
+<div align="center">
+<{$lang_notificationmethodis}>:&nbsp;<{$user_method}>&nbsp;&nbsp;[<a href="<{$editprofile_url}>"><{$lang_change}></a>]
+</div>
+</form>
+<{/if}>
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/modlink.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/modlink.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/modlink.php	(revision 405)
@@ -0,0 +1,99 @@
+<?php
+// $Id: modlink.php,v 1.3 2005/09/04 20:46:10 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+include "header.php";
+$myts =& MyTextSanitizer::getInstance(); // MyTextSanitizer object
+include_once XOOPS_ROOT_PATH."/class/xoopstree.php";
+include_once XOOPS_ROOT_PATH."/class/module.errorhandler.php";
+$mytree = new XoopsTree($xoopsDB->prefix("mylinks_cat"),"cid","pid");
+
+if (!empty($_POST['submit'])) {
+	$eh = new ErrorHandler; //ErrorHandler object
+	if (empty($xoopsUser)) {
+		redirect_header(XOOPS_URL."/user.php",2,_MD_MUSTREGFIRST);
+		exit();
+	} else {
+		$user = $xoopsUser->getVar('uid');
+	}
+   	$lid = intval($_POST["lid"]);
+
+	// Check if Title exist
+   	if ($_POST["title"]=="") {
+       	$eh->show("1001");
+   	}
+	// Check if URL exist
+   	if ($_POST["url"]=="") {
+       	$eh->show("1016");
+   	}
+	// Check if Description exist
+   	if ($_POST['description']=="") {
+       	$eh->show("1008");
+   	}
+
+	$url = $myts->makeTboxData4Save($_POST["url"]);
+	$logourl = $myts->makeTboxData4Save($_POST["logourl"]);
+	$cid = intval($_POST["cid"]);
+	$title = $myts->makeTboxData4Save($_POST["title"]);
+	$description = $myts->makeTareaData4Save($_POST["description"]);
+	$newid = $xoopsDB->genId($xoopsDB->prefix("mylinks_mod")."_requestid_seq");
+	$sql = sprintf("INSERT INTO %s (requestid, lid, cid, title, url, logourl, description, modifysubmitter) VALUES (%u, %u, %u, '%s', '%s', '%s', '%s', %u)", $xoopsDB->prefix("mylinks_mod"), $newid, $lid, $cid, $title, $url, $logourl, $description, $user);
+	$xoopsDB->query($sql) or $eh->show("0013");
+    $tags = array();
+	$tags['MODIFYREPORTS_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/admin/index.php?op=listModReq';
+    $notification_handler =& xoops_gethandler('notification');
+    $notification_handler->triggerEvent('global', 0, 'link_modify', $tags);
+	redirect_header("index.php",2,_MD_THANKSFORINFO);
+	exit();
+} else {
+	$lid = intval($_GET['lid']);
+	if (empty($xoopsUser)) {
+		redirect_header(XOOPS_URL."/user.php",2,_MD_MUSTREGFIRST);
+		exit();
+	}
+	$xoopsOption['template_main'] = 'mylinks_modlink.html';
+	include XOOPS_ROOT_PATH."/header.php";
+	$result = $xoopsDB->query("select cid, title, url, logourl from ".$xoopsDB->prefix("mylinks_links")." where lid=$lid and status>0");
+	$xoopsTpl->assign('lang_requestmod', _MD_REQUESTMOD);
+	list($cid, $title, $url, $logourl) = $xoopsDB->fetchRow($result);
+	$result2 = $xoopsDB->query("SELECT description FROM ".$xoopsDB->prefix("mylinks_text")." WHERE lid=$lid");
+	list($description)=$xoopsDB->fetchRow($result2);
+	$xoopsTpl->assign('link', array('id' => $lid, 'rating' => number_format($rating, 2), 'title' => $myts->htmlSpecialChars($title), 'url' => $myts->htmlSpecialChars($url), '$logourl' => $myts->htmlSpecialChars($logourl), 'updated' => formatTimestamp($time,"m"), 'description' => $myts->htmlSpecialChars($description), 'adminlink' => $adminlink, 'hits' => $hits, 'votes' => $votestring));
+	$xoopsTpl->assign('lang_linkid', _MD_LINKID);
+	$xoopsTpl->assign('lang_sitetitle', _MD_SITETITLE);
+	$xoopsTpl->assign('lang_siteurl', _MD_SITEURL);
+	$xoopsTpl->assign('lang_category', _MD_CATEGORYC);
+	ob_start();
+	$mytree->makeMySelBox("title", "title", $cid);
+	$selbox = ob_get_contents();
+	ob_end_clean();
+	$xoopsTpl->assign('category_selbox', $selbox);
+	$xoopsTpl->assign('lang_description', _MD_DESCRIPTIONC);
+	$xoopsTpl->assign('lang_sendrequest', _MD_SENDREQUEST);
+	$xoopsTpl->assign('lang_cancel', _CANCEL);
+	include XOOPS_ROOT_PATH.'/footer.php';
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/japanese/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/japanese/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/japanese/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/japanese/main.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/japanese/main.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/japanese/main.php	(revision 405)
@@ -0,0 +1,171 @@
+<?php
+
+//%%%%%%        Module Name 'MyLinks'       %%%%%
+
+define("_MD_THANKSFORINFO","¾ðÊó¤ò¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£¤¤¤¿¤À¤¤¤¿¥ê¥¯¥¨¥¹¥È¤Ï¤¹¤°¤ËÄ´ºº¤·¤Þ¤¹¡£");
+define("_MD_THANKSFORHELP","¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê°Ý»ý¤Ë¤´¶¨ÎÏ¤¤¤¿¤À¤­¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£");
+define("_MD_FORSECURITY","¥»¥­¥å¥ê¥Æ¥£¡¼¤Î°Ù¤Ë°ì»þÅª¤Ë¤¢¤Ê¤¿¤Î¥æ¡¼¥¶Ì¾¤ÈIP¥¢¥É¥ì¥¹¤òµ­Ï¿¤µ¤»¤Æ¤¤¤¿¤À¤­¤Þ¤¹¡£");
+
+define("_MD_SEARCHFOR","¸¡º÷"); //-no use
+define("_MD_ANY","¤É¤ì¤«");
+
+define("_MD_SEARCH","¸¡º÷");
+
+define("_MD_MAIN","¥á¥¤¥ó");
+define("_MD_SUBMITLINK","¥ê¥ó¥¯ÅÐÏ¿");
+define("_MD_SUBMITLINKHEAD","¥ê¥ó¥¯¥Õ¥©¡¼¥à¤òÅÐÏ¿");
+define("_MD_POPULAR","¿Íµ¤");
+define("_MD_TOPRATED","¥È¥Ã¥×¥ì¡¼¥È");
+
+define("_MD_NEWTHISWEEK","º£½µ¤ÎºÇ¿·¥µ¥¤¥È");
+define("_MD_UPTHISWEEK","º£½µ¤Î¹¹¿·¥µ¥¤¥È");
+
+define("_MD_POPULARITYLTOM","¿Íµ¤ (¥Ò¥Ã¥È¿ô¤Î¾¯¤Ê¤¤½ç)");
+define("_MD_POPULARITYMTOL","¿Íµ¤ (¥Ò¥Ã¥È¿ô¤ÎÂ¿¤¤½ç)");
+define("_MD_TITLEATOZ","¥¿¥¤¥È¥ë (A to Z)");
+define("_MD_TITLEZTOA","¥¿¥¤¥È¥ë (Z to A)");
+define("_MD_DATEOLD","ÆüÉÕ (ÅÐÏ¿Æü¤Î¸Å¤¤½ç)");
+define("_MD_DATENEW","ÆüÉÕ (ÅÐÏ¿Æü¤Î¿·¤·¤¤½ç)");
+define("_MD_RATINGLTOH","É¾²Á (É¾²Á¤ÎÄã¤¤½ç)");
+define("_MD_RATINGHTOL","É¾²Á (É¾²Á¤Î¹â¤¤½ç)");
+
+define("_MD_NOSHOTS","¥¹¥¯¥ê¡¼¥ó¥·¥ç¥Ã¥È¤Ê¤·");
+define("_MD_EDITTHISLINK","¤³¤Î¥ê¥ó¥¯¤òÊÔ½¸");
+
+define("_MD_DESCRIPTIONC","ÀâÌÀ¡§");
+define("_MD_EMAILC","Email: ");
+define("_MD_CATEGORYC","¥«¥Æ¥´¥ê: ");
+define("_MD_LASTUPDATEC","ºÇ½ª¹¹¿·Æü: ");
+define("_MD_HITSC","¥Ò¥Ã¥È¿ô: ");
+define("_MD_RATINGC","É¾²Á: ");
+define("_MD_ONEVOTE","ÅêÉ¼¿ô 1");
+define("_MD_NUMVOTES","ÅêÉ¼¿ô %s ");
+define("_MD_RATETHISSITE","¤³¤Î¥µ¥¤¥È¤òÉ¾²Á¤¹¤ë");
+define("_MD_MODIFY","½¤Àµ");
+define("_MD_REPORTBROKEN","¥ê¥ó¥¯ÀÚ¤ìÊó¹ð");
+define("_MD_TELLAFRIEND","Í§Ã£¤Ë¾Ò²ð");
+
+define("_MD_THEREARE","¸½ºß¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë¤Ï<b>%s</b>·ï¤Î¥ê¥ó¥¯¤¬ÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤¹¡£");
+define("_MD_LATESTLIST","ºÇ¿·¥ê¥¹¥È");
+
+define("_MD_REQUESTMOD","¥ê¥ó¥¯½¤Àµ¥ê¥¯¥¨¥¹¥È");
+define("_MD_LINKID","¥ê¥ó¥¯ ID: ");
+define("_MD_SITETITLE","¥¦¥§¥Ö¥µ¥¤¥ÈÌ¾: ");
+define("_MD_SITEURL","¥¦¥§¥Ö¥µ¥¤¥È URL: ");
+define("_MD_OPTIONS", '¥ª¥×¥·¥ç¥ó¡§');
+define("_MD_NOTIFYAPPROVE", '¤³¤Î¥ê¥ó¥¯¤¬¾µÇ§¤µ¤ì¤¿¾ì¹ç¤ËÄÌÃÎ¤¹¤ë');
+define("_MD_SHOTIMAGE","¥¹¥¯¥ê¡¼¥ó¥·¥ç¥Ã¥È²èÁü: ");
+define("_MD_SENDREQUEST","¥ê¥¯¥¨¥¹¥È¤òÁ÷¤ë");
+
+define("_MD_VOTEAPPRE","¤¢¤Ê¤¿¤ÎÅêÉ¼¤¬È¿±Ç¤µ¤ì¤Þ¤¹¡£");
+define("_MD_THANKURATE","%s¤Ë¤´¶¨ÎÏ¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£");
+define("_MD_VOTEFROMYOU","¤¢¤Ê¤¿¤ÎÅêÉ¼¤ÏÂ¾¤Î¥æ¡¼¥¶¤¬¥ê¥ó¥¯¤¹¤ë»þ¤ÎÈ½ÃÇ´ð½à¤ËÌòÎ©¤Á¤Þ¤¹¡£");
+define("_MD_VOTEONCE","Æ±°ì¥µ¥¤¥È¤ËÂÐ¤·¤ÆÅêÉ¼¤Ç¤­¤ë¤Î¤Ï£±²ó¸Â¤ê¤È¤µ¤»¤Æ¤¤¤¿¤À¤­¤Þ¤¹¡£");
+define("_MD_RATINGSCALE","É¾²Á¤ò1¡Á10¤Î´Ö¤«¤é¤ªÁª¤Ó¤¯¤À¤µ¤¤¡£¿ô»ú¤¬Âç¤­¤¤¤Û¤ÉÉ¾²Á¤¬¹â¤¤¤³¤È¤ò¼¨¤·¤Þ¤¹¡£");
+define("_MD_BEOBJECTIVE","¸øÀµ¤ÊÈ½ÃÇ¤Ë¤è¤ëÅêÉ¼¤ò¤ª´ê¤¤Ã×¤·¤Þ¤¹");
+define("_MD_DONOTVOTE","¼«Ê¬¼«¿È¤Î¥µ¥¤¥È¤ËÂÐ¤·¤Æ¤ÎÅêÉ¼¤Ï¤Ç¤­¤Þ¤»¤ó¡£");
+define("_MD_RATEIT","É¾²Á¤¹¤ë");
+
+define("_MD_INTRESTLINK","%s¤Ç¤Î¶½Ì£¿¼¤¤¥¦¥§¥Ö¥µ¥¤¥È¥ê¥ó¥¯");  // %s is your site name
+define("_MD_INTLINKFOUND","%s¤Ë¤Æ¤È¤Æ¤â¶½Ì£¿¼¤¤¥¦¥§¥Ö¥µ¥¤¥È¤ò¸«¤Ä¤±¤Þ¤·¤¿¡£");  // %s is your site name
+
+define("_MD_RECEIVED","¥¦¥§¥Ö¥µ¥¤¥È¾ðÊó¤ò¼õÉÕ¤±¤Þ¤·¤¿¡£¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£");
+define("_MD_WHENAPPROVED","¥ê¥ó¥¯¾ðÊó¤Ï¡¢Åö¥µ¥¤¥È¥¹¥¿¥Ã¥Õ¤Ë¤è¤ë¾µÇ§¸å¤ËÀµ¼°·ÇºÜ¤È¤Ê¤ë¤³¤È¤ò¤´Î»¾µ¤¯¤À¤µ¤¤¡£");
+define("_MD_SUBMITONCE","Æ±°ì¤Î¥ê¥ó¥¯Àè¤Ï£±²ó¤·¤«ÅÐÏ¿¤Ç¤­¤Þ¤»¤ó¡£");
+define("_MD_ALLPENDING","¥ê¥ó¥¯¾ðÊó¤Ï°ìÃ¶²¾ÅÐÏ¿¤µ¤ì¡¢¥¹¥¿¥Ã¥Õ¤Ë¤è¤ë³ÎÇ§¸å¸ø³«¤µ¤ì¤Þ¤¹¡£");
+define("_MD_DONTABUSE","¤¢¤Ê¤¿¤Î¥æ¡¼¥¶Ì¾¤ÈIP ¥¢¥É¥ì¥¹¤Ïµ­Ï¿¤µ¤ì¤Þ¤¹¤Î¤Ç¡¢°­µº¤Ê¤É¤Ï¤ª»ß¤á¤¯¤À¤µ¤¤¡£");
+define("_MD_TAKESHOT","¤¢¤Ê¤¿¤Î¥¦¥§¥Ö¥µ¥¤¥È¤Î¥¹¥¯¥ê¡¼¥ó¥·¥ç¥Ã¥È¤ò¼è¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡¢¤Þ¤¿¥ê¥ó¥¯ÅÐÏ¿¤Ë»þ´Ö¤¬¤«¤«¤ë¾ì¹ç¤¬¤¢¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¤¬Í½¤á¤´Î»¾µ¤¯¤À¤µ¤¤¡£");
+
+define("_MD_RANK","½ç°Ì");
+define("_MD_CATEGORY","¥«¥Æ¥´¥ê");
+define("_MD_HITS","¥Ò¥Ã¥È¿ô");
+define("_MD_RATING","É¾²Á");
+define("_MD_VOTE","ÅêÉ¼¿ô");
+define("_MD_TOP10","%s ¥È¥Ã¥× 10"); // %s is a link category title
+
+define("_MD_SEARCHRESULTS","¸¡º÷·ë²Ì: <b>%s</b>:"); // %s is search keywords
+define("_MD_SORTBY","¥½¡¼¥È½ç:");
+define("_MD_TITLE","¥¿¥¤¥È¥ë");
+define("_MD_DATE","ÆüÉÕ");
+define("_MD_POPULARITY","¿Íµ¤");
+define("_MD_CURSORTEDBY","¸½ºß¤Î¥½¡¼¥È½ç¥µ¥¤¥È: %s");
+define("_MD_PREVIOUS","Á°¤Î¥Ú¡¼¥¸");
+define("_MD_NEXT","¼¡¤Î¥Ú¡¼¥¸");
+define("_MD_NOMATCH","°ìÃ×¤¹¤ë¥Ç¡¼¥¿¤Ï¸«¤Ä¤«¤ê¤Þ¤»¤ó¤Ç¤·¤¿¡£");
+
+define("_MD_SUBMIT","Á÷¿®");
+define("_MD_CANCEL","Ãæ»ß");
+
+define("_MD_ALREADYREPORTED","¤¢¤Ê¤¿¤«¤é¤Î¥ê¥ó¥¯ÀÚ¤ì¤ÎÊó¹ð¤Ï´û¤Ë¼õ¤±ÉÕ¤±¤Þ¤·¤¿¡£");
+define("_MD_MUSTREGFIRST","¿½¤·Ìõ¤´¤¶¤¤¤Þ¤»¤ó¤¬¤¢¤Ê¤¿¤Ï¤³¤Î¥Ú¡¼¥¸¤Ë¤Ï¥¢¥¯¥»¥¹¤Ç¤­¤Þ¤»¤ó¡£<br />¤Þ¤ºÅÐÏ¿¤µ¤ì¤ë¤«¡¢¥í¥°¥¤¥ó¤·¤Æ²¼¤µ¤¤¡£");
+define("_MD_NORATING","É¾²Á¤¬ÁªÂò¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
+define("_MD_CANTVOTEOWN","¤¢¤Ê¤¿¤¬ÅÐÏ¿¤·¤¿¥ê¥ó¥¯¤Ë¤ÏÅêÉ¼¤Ç¤­¤Þ¤»¤ó¡£<br />ÅêÉ¼¤ÏÁ´¤Æµ­Ï¿¤µ¤ìÄ´ºº¤µ¤ì¤Þ¤¹¡£");
+define("_MD_VOTEONCE2","¿½¤·Ìõ¤¢¤ê¤Þ¤»¤ó¤¬¡¢Æ±°ì¥ê¥ó¥¯¾ðÊó¤Ø¤ÎÅêÉ¼¤Ï°ì²ó¸Â¤ê¤È¤µ¤»¤Æ¤¤¤¿¤À¤¤¤Æ¤¤¤Þ¤¹¡£");
+
+//%%%%%%    Module Name 'MyLinks' (Admin)     %%%%%
+
+define("_MD_WEBLINKSCONF","¥ê¥ó¥¯½¸´ÉÍý");
+define("_MD_GENERALSET","°ìÈÌÀßÄê");
+define("_MD_ADDMODDELETE","¥«¥Æ¥´¥ê¤ª¤è¤Ó¥ê¥ó¥¯¾ðÊó¤ÎÄÉ²Ã¡¿½¤Àµ¡¿ºï½ü");
+define("_MD_LINKSWAITING","¾µÇ§ÂÔ¤Á¥ê¥ó¥¯");
+define("_MD_BROKENREPORTS","¥ê¥ó¥¯ÀÚ¤ìÊó¹ð");
+define("_MD_MODREQUESTS","¥ê¥ó¥¯¾ðÊó½¤Àµ¤Î¥ê¥¯¥¨¥¹¥È");
+define("_MD_SUBMITTER","Åê¹Æ¼Ô: ");
+define("_MD_VISIT","Ë¬Ìä");
+define("_MD_SHOTMUST","¥¹¥¯¥ê¡¼¥ó¥·¥ç¥Ã¥È²èÁü¤Ï %s ¥Ç¥£¥ì¥¯¥È¥ê²¼¤Î¥Õ¥¡¥¤¥ëÌ¾¤Ç»ØÄê¤·¤Æ²¼¤µ¤¤¡£ (Îã. shot.gif). ¤â¤·²èÁü¥Õ¥¡¥¤¥ë¤¬¤Ê¤¤¾ì¹ç¤Ï¶õÇò¤Ë¤·¤Æ¤ª¤¤¤Æ²¼¤µ¤¤¡£");
+define("_MD_APPROVE","¾µÇ§¤¹¤ë");
+define("_MD_DELETE","ºï½ü");
+define("_MD_NOSUBMITTED","¿·¤·¤¤¥ê¥ó¥¯ÅÐÏ¿¤Î¿½ÀÁ¤Ï¤¢¤ê¤Þ¤»¤ó¡£");
+define("_MD_ADDMAIN","¥á¥¤¥ó¥«¥Æ¥´¥êÄÉ²Ã");
+define("_MD_TITLEC","¥¿¥¤¥È¥ë: ");
+define("_MD_IMGURL","¥«¥Æ¥´¥ê²èÁüURL¡Ê¥ª¥×¥·¥ç¥ó¤Ç¤¹¡£²èÁü¥Õ¥¡¥¤¥ë¤Î¹â¤µ¤Ï¼«Æ°Åª¤Ë50¥Ô¥¯¥»¥ë¤ËÄ´À°¤µ¤ì¤Þ¤¹¡£¥á¥¤¥ó¥«¥Æ¥´¥êÍÑ¡Ë¡§");
+define("_MD_ADD","ÄÉ²Ã");
+define("_MD_ADDSUB","¥µ¥Ö¥«¥Æ¥´¥êÄÉ²Ã");
+define("_MD_IN","¿Æ¥«¥Æ¥´¥ê¡§");
+define("_MD_ADDNEWLINK","¿·¤·¤¤¥ê¥ó¥¯ÄÉ²Ã");
+define("_MD_MODCAT","¥«¥Æ¥´¥ê½¤Àµ");
+define("_MD_MODLINK","¥ê¥ó¥¯½¤Àµ");
+define("_MD_TOTALVOTES","¥ê¥ó¥¯¤ÎÅêÉ¼¿ô (ÅêÉ¼¿ô¤Î¹ç·×: %s)");
+define("_MD_USERTOTALVOTES","ÅÐÏ¿¥æ¡¼¥¶¤Ë¤è¤ëÉ¾²Á¿ô (ÅêÉ¼¿ô¤Î¹ç·×: %s)");
+define("_MD_ANONTOTALVOTES","Ì¤ÅÐÏ¿¥æ¡¼¥¶¤Ë¤è¤ëÉ¾²Á¿ô (ÅêÉ¼¿ô¤Î¹ç·×: %s)");
+define("_MD_USER","¥æ¡¼¥¶");
+define("_MD_IP","IP ¥¢¥É¥ì¥¹");
+define("_MD_USERAVG","¥æ¡¼¥¶¤ÎÊ¿¶ÑÉ¾²ÁÅÀ");
+define("_MD_TOTALRATE","ÁíÉ¾¿ô");
+define("_MD_NOREGVOTES","ÅÐÏ¿¥æ¡¼¥¶¤Ë¤è¤ëÉ¾²Á¤Ï¤¢¤ê¤Þ¤»¤ó");
+define("_MD_NOUNREGVOTES","Ì¤ÅÐÏ¿¥æ¡¼¥¶¤Ë¤è¤ëÉ¾²Á¤Ï¤¢¤ê¤Þ¤»¤ó");
+define("_MD_VOTEDELETED","ÅêÉ¼¥Ç¡¼¥¿¤Ïºï½ü¤µ¤ì¤Þ¤·¤¿¡£");
+define("_MD_NOBROKEN","¥ê¥ó¥¯ÀÚ¤ìÊó¹ð¤Ï¤¢¤ê¤Þ¤»¤ó¡£");
+define("_MD_IGNOREDESC","Ìµ»ë¤¹¤ë (<b>¥ê¥ó¥¯ÀÚ¤ìÊó¹ð</b>¤òºï½ü¤·¡¢Êó¹ð¤òÌµ»ë¤¹¤ë)");
+define("_MD_DELETEDESC","ºï½ü¤¹¤ë (<b>Êó¹ð¤Ë¤¢¤Ã¤¿¥¦¥§¥Ö¥µ¥¤¥È¤Î¥Ç¡¼¥¿</b>¤È<b>¥ê¥ó¥¯ÀÚ¤ìÊó¹ð</b>¤òºï½ü¤¹¤ë)");
+define("_MD_REPORTER","Á÷¿®¼Ô¡§");
+define("_MD_LINKSUBMITTER","¥ê¥ó¥¯¾ðÊóÄó¶¡¼Ô¡§");
+define("_MD_IGNORE","Ìµ»ë");
+define("_MD_LINKDELETED","¥ê¥ó¥¯¾ðÊó¤òºï½ü¤·¤Þ¤·¤¿¡£");
+define("_MD_BROKENDELETED","¥ê¥ó¥¯ÀÚ¤ìÊó¹ð¤òºï½ü¤·¤Þ¤·¤¿¡£");
+define("_MD_USERMODREQ","¥ê¥ó¥¯½¤Àµ¥ê¥¯¥¨¥¹¥È¥æ¡¼¥¶");
+define("_MD_ORIGINAL","½¤ÀµÁ°");
+define("_MD_PROPOSED","½¤Àµ¸å");
+define("_MD_OWNER","¥ê¥ó¥¯¾ðÊóÄó¶¡¼Ô¡§");
+define("_MD_NOMODREQ","¥ê¥ó¥¯½¤Àµ¥ê¥¯¥¨¥¹¥È¤Ï¤¢¤ê¤Þ¤»¤ó¡£");
+define("_MD_DBUPDATED","¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò¹¹¿·¤·¤Þ¤·¤¿¡£");
+define("_MD_MODREQDELETED","½¤Àµ¥ê¥¯¥¨¥¹¥È¤òºï½ü¤·¤Þ¤·¤¿¡£");
+define("_MD_IMGURLMAIN","¥«¥Æ¥´¥ê²èÁüURL¡Ê¥ª¥×¥·¥ç¥ó¤Ç¤¹¡£²èÁü¥Õ¥¡¥¤¥ë¤Î¹â¤µ¤Ï¼«Æ°Åª¤Ë50¥Ô¥¯¥»¥ë¤ËÄ´À°¤µ¤ì¤Þ¤¹¡£¥á¥¤¥ó¥«¥Æ¥´¥êÍÑ¡Ë¡§");
+define("_MD_PARENT","¿Æ¥«¥Æ¥´¥ê:");
+define("_MD_SAVE","ÊÑ¹¹¤òÊÝÂ¸");
+define("_MD_CATDELETED","¥«¥Æ¥´¥ê¤òºï½ü¤·¤Þ¤·¤¿¡£");
+define("_MD_WARNING","Ãí°Õ: ËÜÅö¤Ë¤³¤Î¥«¥Æ¥´¥êµÚ¤Ó¤½¤ì¤Ë´ØÏ¢¤¹¤ë¥ê¥ó¥¯¡¢¥³¥á¥ó¥È¤òºï½ü¤·¤Þ¤¹¤«¡©");
+define("_MD_YES","¤Ï¤¤");
+define("_MD_NO","¤¤¤¤¤¨");
+define("_MD_NEWCATADDED","¥«¥Æ¥´¥ê¤òÄÉ²Ã¤·¤Þ¤·¤¿¡£");
+define("_MD_ERROREXIST","¥¨¥é¡¼: ¤½¤Î¥ê¥ó¥¯¤Ï´û¤Ë¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤¹¡£");
+define("_MD_ERRORTITLE","¥¨¥é¡¼: ¥¿¥¤¥È¥ë¤òÆþÎÏ¤·¤Æ²¼¤µ¤¤¡£");
+define("_MD_ERRORDESC","¥¨¥é¡¼: ¥¿¥¤¥×¤òÁªÂò¤·¤Æ²¼¤µ¤¤¡£");
+define("_MD_NEWLINKADDED","¿·¤·¤¤¥ê¥ó¥¯¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÄÉ²Ã¤µ¤ì¤Þ¤·¤¿¡£");
+define("_MD_YOURLINK","Your link submitted at %s"); //[MADA]
+define("_MD_YOUCANBROWSE","%s¤Î¥ê¥ó¥¯½¸¤Ë¤ÆÍÍ¡¹¤Ê¥¦¥§¥Ö¥µ¥¤¥È¤Î¥ê¥ó¥¯¾ðÊó¤ò¤´Í÷¤Ë¤Ê¤ì¤Þ¤¹¡£");
+define("_MD_HELLO","%s¤µ¤ó¡¢¤³¤ó¤Ë¤Á¤Ï");
+define("_MD_WEAPPROVED","¤¢¤Ê¤¿¤«¤é¤Î¥¦¥§¥Ö¥ê¥ó¥¯¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤Î¥ê¥ó¥¯ÅÐÏ¿¿½ÀÁ¤Ï¾µÇ§¤µ¤ì¤Þ¤·¤¿¡£");
+define("_MD_THANKSSUBMIT","¥ê¥ó¥¯ÅÐÏ¿¿½ÀÁ¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£");
+define("_MD_ISAPPROVED","¤¢¤Ê¤¿¤«¤é¤Î¥ê¥ó¥¯ÅÐÏ¿¿½ÀÁ¤Ï¾µÇ§¤µ¤ì¤Þ¤·¤¿¡£");
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/japanese/mail_template/category_linksubmit_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/japanese/mail_template/category_linksubmit_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/japanese/mail_template/category_linksubmit_notify.tpl	(revision 405)
@@ -0,0 +1,21 @@
+{X_UNAME}¤µ¤ó¡¢¤³¤ó¤Ë¤Á¤Ï
+
+¡Ö{X_SITENAME}¡×¥ê¥ó¥¯½¸¤Ë¤ª¤¤¤Æ¡Ö{CATEGORY_NAME}¡×¥«¥Æ¥´¥ê²¼¤Ë¿·µ¬¥ê¥ó¥¯¤¬Åê¹Æ¤µ¤ì¤Þ¤·¤¿¡£
+
+¥ê¥ó¥¯Ì¾¡§¡¡{LINK_NAME}
+
+¤³¤Î¥ê¥ó¥¯¤ò¸«¤ë¤Ë¤Ï²¼µ­URL¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡§
+{WAITINGLINKS_URL}
+
+-----------
+
+¤³¤Î¥á¡¼¥ë¤ÏXOOPS¤Î¼«Æ°ÄÌÃÎµ¡Ç½¤Ë¤è¤Ã¤ÆÁ÷¿®¤µ¤ì¤Æ¤¤¤Þ¤¹
+
+¼«Æ°ÄÌÃÎ¤òÄä»ß¤·¤¿¤¤¾ì¹ç¤Ï²¼µ­¤ÎURL¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡§
+{X_UNSUBSCRIBE_URL}
+
+-----------
+{X_SITENAME} ({X_SITEURL}) 
+´ÉÍý¿Í
+{X_ADMINMAIL}
+-----------
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/japanese/mail_template/global_linkbroken_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/japanese/mail_template/global_linkbroken_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/japanese/mail_template/global_linkbroken_notify.tpl	(revision 405)
@@ -0,0 +1,19 @@
+{X_UNAME}¤µ¤ó¡¢¤³¤ó¤Ë¤Á¤Ï
+
+¥ê¥ó¥¯ÀÚ¤ìÊó¹ð¤ÎÅê¹Æ¤¬¤¢¤ê¤Þ¤·¤¿¡£
+
+¤³¤ÎÊó¹ð¤Î¾ÜºÙ¤ò¸«¤ë¤Ë¤Ï²¼µ­¤ÎURL¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡§
+{BROKENREPORTS_URL}
+
+-----------
+
+¤³¤Î¥á¡¼¥ë¤ÏXOOPS¤Î¼«Æ°ÄÌÃÎµ¡Ç½¤Ë¤è¤Ã¤ÆÁ÷¿®¤µ¤ì¤Æ¤¤¤Þ¤¹
+
+¼«Æ°ÄÌÃÎ¤òÄä»ß¤·¤¿¤¤¾ì¹ç¤Ï²¼µ­¤ÎURL¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡§
+{X_UNSUBSCRIBE_URL}
+
+-----------
+{X_SITENAME} ({X_SITEURL}) 
+´ÉÍý¿Í
+{X_ADMINMAIL}
+-----------
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/japanese/mail_template/global_linksubmit_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/japanese/mail_template/global_linksubmit_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/japanese/mail_template/global_linksubmit_notify.tpl	(revision 405)
@@ -0,0 +1,21 @@
+{X_UNAME}¤µ¤ó¡¢¤³¤ó¤Ë¤Á¤Ï
+
+¡Ö{X_SITENAME}¡×¥ê¥ó¥¯½¸¤Ë¤ª¤¤¤Æ¿·µ¬¥ê¥ó¥¯¤¬Åê¹Æ¤µ¤ì¤Þ¤·¤¿¡£
+
+¥ê¥ó¥¯Ì¾¡§¡¡{LINK_NAME}
+
+¤³¤Î¥ê¥ó¥¯¤Î¾ÜºÙ¤ò¸«¤ë¤Ë¤Ï²¼µ­URL¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡§
+{WAITINGLINKS_URL}
+
+-----------
+
+¤³¤Î¥á¡¼¥ë¤ÏXOOPS¤Î¼«Æ°ÄÌÃÎµ¡Ç½¤Ë¤è¤Ã¤ÆÁ÷¿®¤µ¤ì¤Æ¤¤¤Þ¤¹
+
+¼«Æ°ÄÌÃÎ¤òÄä»ß¤·¤¿¤¤¾ì¹ç¤Ï²¼µ­¤ÎURL¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡§
+{X_UNSUBSCRIBE_URL}
+
+-----------
+{X_SITENAME} ({X_SITEURL}) 
+´ÉÍý¿Í
+{X_ADMINMAIL}
+-----------
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/japanese/mail_template/category_newlink_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/japanese/mail_template/category_newlink_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/japanese/mail_template/category_newlink_notify.tpl	(revision 405)
@@ -0,0 +1,24 @@
+{X_UNAME}¤µ¤ó¡¢¤³¤ó¤Ë¤Á¤Ï
+
+¡Ö{X_SITENAME}¡×¥ê¥ó¥¯½¸¤Ë¤ª¤¤¤Æ¡Ö{CATEGORY_NAME}¡×¥«¥Æ¥´¥ê²¼¤Ë¿·µ¬¥ê¥ó¥¯¤¬ÅÐÏ¿¤µ¤ì¤Þ¤·¤¿¡£
+
+¥ê¥ó¥¯Ì¾¡§¡¡{LINK_NAME}
+
+¤³¤Î¥ê¥ó¥¯¤ò¸«¤ë¤Ë¤Ï²¼µ­URL¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡§
+{LINK_URL}
+
+¤³¤Î¥ê¥ó¥¯¤¬ÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¥«¥Æ¥´¥ê¤ò¸«¤ë¤Ë¤Ï²¼µ­URL¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡§
+{CATEGORY_URL}
+
+-----------
+
+¤³¤Î¥á¡¼¥ë¤ÏXOOPS¤Î¼«Æ°ÄÌÃÎµ¡Ç½¤Ë¤è¤Ã¤ÆÁ÷¿®¤µ¤ì¤Æ¤¤¤Þ¤¹
+
+¼«Æ°ÄÌÃÎ¤òÄä»ß¤·¤¿¤¤¾ì¹ç¤Ï²¼µ­¤ÎURL¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡§
+{X_UNSUBSCRIBE_URL}
+
+-----------
+{X_SITENAME} ({X_SITEURL}) 
+´ÉÍý¿Í
+{X_ADMINMAIL}
+-----------
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/japanese/mail_template/global_linkmodify_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/japanese/mail_template/global_linkmodify_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/japanese/mail_template/global_linkmodify_notify.tpl	(revision 405)
@@ -0,0 +1,19 @@
+{X_UNAME}¤µ¤ó¡¢¤³¤ó¤Ë¤Á¤Ï
+
+¥ê¥ó¥¯½¤Àµ¤Î¥ê¥¯¥¨¥¹¥È¤¬Åê¹Æ¤µ¤ì¤Þ¤·¤¿¡£
+
+¤³¤Î½¤Àµ¥ê¥¯¥¨¥¹¥È¤ò¸«¤ë¤Ë¤Ï²¼µ­URL¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡§
+{MODIFYREPORTS_URL}
+
+-----------
+
+¤³¤Î¥á¡¼¥ë¤ÏXOOPS¤Î¼«Æ°ÄÌÃÎµ¡Ç½¤Ë¤è¤Ã¤ÆÁ÷¿®¤µ¤ì¤Æ¤¤¤Þ¤¹
+
+¼«Æ°ÄÌÃÎ¤òÄä»ß¤·¤¿¤¤¾ì¹ç¤Ï²¼µ­¤ÎURL¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡§
+{X_UNSUBSCRIBE_URL}
+
+-----------
+{X_SITENAME} ({X_SITEURL}) 
+´ÉÍý¿Í
+{X_ADMINMAIL}
+-----------
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/japanese/mail_template/global_newcategory_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/japanese/mail_template/global_newcategory_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/japanese/mail_template/global_newcategory_notify.tpl	(revision 405)
@@ -0,0 +1,21 @@
+{X_UNAME}¤µ¤ó¡¢¤³¤ó¤Ë¤Á¤Ï
+
+{X_SITENAME}¤Ë¤Æ¥ê¥ó¥¯½¸¤Ë¿·µ¬¥«¥Æ¥´¥ê¤¬ºîÀ®¤µ¤ì¤Þ¤·¤¿¡£
+
+¥«¥Æ¥´¥êÌ¾¡§¡¡{CATEGORY_NAME}
+
+¤³¤Î¥«¥Æ¥´¥ê¤ò¸«¤ë¤Ë¤Ï²¼µ­URL¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡§
+{CATEGORY_URL}
+
+-----------
+
+¤³¤Î¥á¡¼¥ë¤ÏXOOPS¤Î¼«Æ°ÄÌÃÎµ¡Ç½¤Ë¤è¤Ã¤ÆÁ÷¿®¤µ¤ì¤Æ¤¤¤Þ¤¹
+
+¼«Æ°ÄÌÃÎ¤òÄä»ß¤·¤¿¤¤¾ì¹ç¤Ï²¼µ­¤ÎURL¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡§
+{X_UNSUBSCRIBE_URL}
+
+-----------
+{X_SITENAME} ({X_SITEURL}) 
+´ÉÍý¿Í
+{X_ADMINMAIL}
+-----------
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/japanese/mail_template/global_newlink_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/japanese/mail_template/global_newlink_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/japanese/mail_template/global_newlink_notify.tpl	(revision 405)
@@ -0,0 +1,21 @@
+{X_UNAME}¤µ¤ó¡¢¤³¤ó¤Ë¤Á¤Ï
+
+{X_SITENAME}¤Ë¤Æ¿·µ¬¥Õ¥¡¥¤¥ë¤¬ÅÐÏ¿¤µ¤ì¤Þ¤·¤¿¡£
+
+¥ê¥ó¥¯Ì¾¡§¡¡{LINK_NAME}
+
+¤³¤Î¥ê¥ó¥¯¤ò¸«¤ë¤Ë¤Ï²¼µ­URL¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡§
+{LINK_URL}
+
+-----------
+
+¤³¤Î¥á¡¼¥ë¤ÏXOOPS¤Î¼«Æ°ÄÌÃÎµ¡Ç½¤Ë¤è¤Ã¤ÆÁ÷¿®¤µ¤ì¤Æ¤¤¤Þ¤¹
+
+¼«Æ°ÄÌÃÎ¤òÄä»ß¤·¤¿¤¤¾ì¹ç¤Ï²¼µ­¤ÎURL¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡§
+{X_UNSUBSCRIBE_URL}
+
+-----------
+{X_SITENAME} ({X_SITEURL}) 
+´ÉÍý¿Í
+{X_ADMINMAIL}
+-----------
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/japanese/mail_template/link_approve_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/japanese/mail_template/link_approve_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/japanese/mail_template/link_approve_notify.tpl	(revision 405)
@@ -0,0 +1,19 @@
+{X_UNAME}¤µ¤ó¡¢¤³¤ó¤Ë¤Á¤Ï
+
+{X_SITENAME}¤Ë¤Æ¿·µ¬¥ê¥ó¥¯¡Ö{FILE_NAME}¡×¤¬¾µÇ§¤µ¤ì¤Þ¤·¤¿¡£
+
+¤³¤Î¥ê¥ó¥¯¤ò¸«¤ë¤Ë¤Ï²¼µ­URL¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡§
+{LINK_URL}
+
+-----------
+
+¤³¤Î¥á¡¼¥ë¤ÏXOOPS¤Î¼«Æ°ÄÌÃÎµ¡Ç½¤Ë¤è¤Ã¤ÆÁ÷¿®¤µ¤ì¤Æ¤¤¤Þ¤¹
+
+¼«Æ°ÄÌÃÎ¤òÄä»ß¤·¤¿¤¤¾ì¹ç¤Ï²¼µ­¤ÎURL¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡§
+{X_UNSUBSCRIBE_URL}
+
+-----------
+{X_SITENAME} ({X_SITEURL}) 
+´ÉÍý¿Í
+{X_ADMINMAIL}
+-----------
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/japanese/modinfo.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/japanese/modinfo.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/japanese/modinfo.php	(revision 405)
@@ -0,0 +1,94 @@
+<?php
+// Module Info
+
+// The name of this module
+define("_MI_MYLINKS_NAME","¥ê¥ó¥¯½¸");
+
+// A brief description of this module
+define("_MI_MYLINKS_DESC","¥æ¡¼¥¶¤¬¼«Í³¤Ë¥ê¥ó¥¯¾ðÊó¤ÎÅÐÏ¿¡¿½¤Àµ¡¿É¾²Á¤ò¹Ô¤¨¤ë¥»¥¯¥·¥ç¥ó¤òºîÀ®¤·¤Þ¤¹¡£");
+
+// Names of blocks for this module (Not all module has blocks)
+define("_MI_MYLINKS_BNAME1","¿·Ãå¥ê¥ó¥¯");
+define("_MI_MYLINKS_BNAME2","¹âÉ¾²Á¥ê¥ó¥¯");
+
+// Sub menu titles
+define("_MI_MYLINKS_SMNAME1","ÅÐÏ¿¤¹¤ë");
+define("_MI_MYLINKS_SMNAME2","¿Íµ¤¥ê¥ó¥¯");
+define("_MI_MYLINKS_SMNAME3","¹âÉ¾²Á¥ê¥ó¥¯");
+
+define("_MI_MYLINKS_ADMENU2","¥ê¥ó¥¯¾ðÊó¤ÎÄÉ²Ã / ÊÔ½¸");
+define("_MI_MYLINKS_ADMENU3","¿·µ¬Åê¹Æ¥ê¥ó¥¯");
+define("_MI_MYLINKS_ADMENU4","¥ê¥ó¥¯ÀÚ¤ìÊó¹ð");
+define("_MI_MYLINKS_ADMENU5","½¤Àµ¥ê¥ó¥¯¾ðÊó");
+
+// Title of config items
+define('_MI_MYLINKS_POPULAR','¡Ö¿Íµ¤¥ê¥ó¥¯¡×¤Ë¤Ê¤ë¤¿¤á¤Î¥Ò¥Ã¥È¿ô');
+define('_MI_MYLINKS_NEWLINKS','¥È¥Ã¥×¥Ú¡¼¥¸¤Î¡Ö¿·Ãå¥ê¥ó¥¯¡×¤ËÉ½¼¨¤¹¤ë·ï¿ô');
+define('_MI_MYLINKS_PERPAGE','£±¥Ú¡¼¥¸Ëè¤ËÉ½¼¨¤¹¤ë¥ê¥ó¥¯¤Î·ï¿ô');
+define('_MI_MYLINKS_USESHOTS','¥¹¥¯¥ê¡¼¥ó¥·¥ç¥Ã¥È¤ò»ÈÍÑ¤¹¤ë');
+define('_MI_MYLINKS_USEFRAMES','¥Õ¥ì¡¼¥à¤ò»ÈÍÑ¤¹¤ë');
+define('_MI_MYLINKS_SHOTWIDTH','¥¹¥¯¥ê¡¼¥ó¥·¥ç¥Ã¥È¤Î²èÁüÉý');
+define('_MI_MYLINKS_ANONPOST','Æ¿Ì¾¥æ¡¼¥¶¤Ë¤è¤ë¥ê¥ó¥¯¤ÎÅê¹Æ¤òµö²Ä¤¹¤ë');
+define('_MI_MYLINKS_AUTOAPPROVE','´ÉÍý¼Ô¤Î²ðºß¤·¤Ê¤¤¿·µ¬¥ê¥ó¥¯¤Î¼«Æ°¾µÇ§');
+
+// Description of each config items
+define('_MI_MYLINKS_POPULARDSC', '¡Ö¿Íµ¤¡ª¡×¥¢¥¤¥³¥ó¤¬É½¼¨¤µ¤ì¤ë¤¿¤á¤Î¥Ò¥Ã¥È¿ô¤ò»ØÄê¤·¤Æ¤¯¤À¤µ¤¤¡£');
+define('_MI_MYLINKS_NEWLINKSDSC', '¥È¥Ã¥×¥Ú¡¼¥¸¤Î¡Ö¿·Ãå¥ê¥ó¥¯¡×¥Ö¥í¥Ã¥¯¤ËÉ½¼¨¤¹¤ëºÇÂç·ï¿ô¤ò»ØÄê¤·¤Æ¤¯¤À¤µ¤¤¡£');
+define('_MI_MYLINKS_PERPAGEDSC', '¥ê¥ó¥¯°ìÍ÷É½¼¨¤Ç£±¥Ú¡¼¥¸¤¢¤¿¤ê¤ËÉ½¼¨¤¹¤ëºÇÂç·ï¿ô¤ò»ØÄê¤·¤Æ¤¯¤À¤µ¤¤¡£');
+define('_MI_MYLINKS_USEFRAMEDSC', '¥ê¥ó¥¯¥Ú¡¼¥¸¤ò¥Õ¥ì¡¼¥àÆâ¤ËÉ½¼¨¤¹¤ë¤«¤É¤¦¤«');
+define('_MI_MYLINKS_USESHOTSDSC', '¥ê¥ó¥¯¾ðÊó¤Ë¥¹¥¯¥ê¡¼¥ó¥·¥ç¥Ã¥È²èÁü¤òÉ½¼¨¤¹¤ë¾ì¹ç¤Ï¡Ö¤Ï¤¤¡×¤òÁªÂò¤·¤Æ¤¯¤À¤µ¤¤¡£');
+define('_MI_MYLINKS_SHOTWIDTHDSC', '¥¹¥¯¥ê¡¼¥ó¥·¥ç¥Ã¥È²èÁü¤Î²£Éý¤ÎºÇÂçÃÍ¤ò»ØÄê¤·¤Æ¤¯¤À¤µ¤¤¡£');
+define('_MI_MYLINKS_AUTOAPPROVEDSC','´ÉÍý¼Ô¤Î¾µÇ§Áàºî¤Ê¤·¤Ë¿·µ¬¥ê¥ó¥¯ÅÐÏ¿¤Î¾µÇ§¤ò¹Ô¤¦¾ì¹ç¤Ï¡Ö¤Ï¤¤¡×¤òÁªÂò¤·¤Æ¤¯¤À¤µ¤¤¡£');
+
+// Text for notifications
+
+define('_MI_MYLINKS_GLOBAL_NOTIFY', '¥â¥¸¥å¡¼¥ëÁ´ÂÎ');
+define('_MI_MYLINKS_GLOBAL_NOTIFYDSC', '¥ê¥ó¥¯½¸¥â¥¸¥å¡¼¥ëÁ´ÂÎ¤Ë¤ª¤±¤ëÄÌÃÎ¥ª¥×¥·¥ç¥ó');
+
+define('_MI_MYLINKS_CATEGORY_NOTIFY', 'É½¼¨Ãæ¤Î¥«¥Æ¥´¥ê');
+define('_MI_MYLINKS_CATEGORY_NOTIFYDSC', 'É½¼¨Ãæ¤Î¥«¥Æ¥´¥ê¤ËÂÐ¤¹¤ëÄÌÃÎ¥ª¥×¥·¥ç¥ó');
+
+define('_MI_MYLINKS_LINK_NOTIFY', 'É½¼¨Ãæ¤Î¥ê¥ó¥¯');
+define('_MI_MYLINKS_LINK_NOTIFYDSC', 'É½¼¨Ãæ¤Î¥ê¥ó¥¯¤ËÂÐ¤¹¤ëÄÌÃÎ¥ª¥×¥·¥ç¥ó');
+
+define('_MI_MYLINKS_GLOBAL_NEWCATEGORY_NOTIFY', '¿·µ¬¥«¥Æ¥´¥ê');
+define('_MI_MYLINKS_GLOBAL_NEWCATEGORY_NOTIFYCAP', '¿·µ¬¥«¥Æ¥´¥ê¤¬ºîÀ®¤µ¤ì¤¿¾ì¹ç¤ËÄÌÃÎ¤¹¤ë');
+define('_MI_MYLINKS_GLOBAL_NEWCATEGORY_NOTIFYDSC', '¿·µ¬¥«¥Æ¥´¥ê¤¬ºîÀ®¤µ¤ì¤¿¾ì¹ç¤ËÄÌÃÎ¤¹¤ë');
+define('_MI_MYLINKS_GLOBAL_NEWCATEGORY_NOTIFYSBJ', '[{X_SITENAME}] {X_MODULE} auto-notify : ¿·µ¬¥«¥Æ¥´¥ê¤¬ºîÀ®¤µ¤ì¤Þ¤·¤¿¡Ê¥ê¥ó¥¯½¸¡Ë');
+
+define('_MI_MYLINKS_GLOBAL_LINKMODIFY_NOTIFY', '¥ê¥ó¥¯½¤Àµ¤Î¥ê¥¯¥¨¥¹¥È');
+define('_MI_MYLINKS_GLOBAL_LINKMODIFY_NOTIFYCAP', '¥ê¥ó¥¯½¤Àµ¤Î¥ê¥¯¥¨¥¹¥È¤¬¤¢¤Ã¤¿¾ì¹ç¤ËÄÌÃÎ¤¹¤ë');
+define('_MI_MYLINKS_GLOBAL_LINKMODIFY_NOTIFYDSC', '¥ê¥ó¥¯½¤Àµ¤Î¥ê¥¯¥¨¥¹¥È¤¬¤¢¤Ã¤¿¾ì¹ç¤ËÄÌÃÎ¤¹¤ë');
+define('_MI_MYLINKS_GLOBAL_LINKMODIFY_NOTIFYSBJ', '[{X_SITENAME}] {X_MODULE}: ¥ê¥ó¥¯½¤Àµ¤Î¥ê¥¯¥¨¥¹¥È¤¬¤¢¤ê¤Þ¤·¤¿');
+
+define('_MI_MYLINKS_GLOBAL_LINKBROKEN_NOTIFY', '¥ê¥ó¥¯ÀÚ¤ìÊó¹ð');
+define('_MI_MYLINKS_GLOBAL_LINKBROKEN_NOTIFYCAP', '¥ê¥ó¥¯ÀÚ¤ì¤ÎÊó¹ð¤¬¤¢¤Ã¤¿¾ì¹ç¤ËÄÌÃÎ¤¹¤ë');
+define('_MI_MYLINKS_GLOBAL_LINKBROKEN_NOTIFYDSC', '¥ê¥ó¥¯ÀÚ¤ì¤ÎÊó¹ð¤¬¤¢¤Ã¤¿¾ì¹ç¤ËÄÌÃÎ¤¹¤ë');
+define('_MI_MYLINKS_GLOBAL_LINKBROKEN_NOTIFYSBJ', '[{X_SITENAME}] {X_MODULE}: ¥ê¥ó¥¯ÀÚ¤ì¤ÎÊó¹ð¤¬¤¢¤ê¤Þ¤·¤¿');
+
+define('_MI_MYLINKS_GLOBAL_LINKSUBMIT_NOTIFY', '¿·µ¬¥ê¥ó¥¯Åê¹Æ');
+define('_MI_MYLINKS_GLOBAL_LINKSUBMIT_NOTIFYCAP', '¿·µ¬¥ê¥ó¥¯¤ÎÅê¹Æ¤¬¤¢¤Ã¤¿¾ì¹ç¤ËÄÌÃÎ¤¹¤ë');
+define('_MI_MYLINKS_GLOBAL_LINKSUBMIT_NOTIFYDSC', '¿·µ¬¥ê¥ó¥¯¤ÎÅê¹Æ¤¬¤¢¤Ã¤¿¾ì¹ç¤ËÄÌÃÎ¤¹¤ë');
+define('_MI_MYLINKS_GLOBAL_LINKSUBMIT_NOTIFYSBJ', '[{X_SITENAME}] {X_MODULE}: ¿·µ¬¥ê¥ó¥¯¤ÎÅê¹Æ¤¬¤¢¤ê¤Þ¤·¤¿');
+
+define('_MI_MYLINKS_GLOBAL_NEWLINK_NOTIFY', '¿·µ¬¥ê¥ó¥¯·ÇºÜ');
+define('_MI_MYLINKS_GLOBAL_NEWLINK_NOTIFYCAP', '¿·µ¬¥ê¥ó¥¯¤¬·ÇºÜ¤µ¤ì¤¿¾ì¹ç¤ËÄÌÃÎ¤¹¤ë');
+define('_MI_MYLINKS_GLOBAL_NEWLINK_NOTIFYDSC', '¿·µ¬¥ê¥ó¥¯¤¬·ÇºÜ¤µ¤ì¤¿¾ì¹ç¤ËÄÌÃÎ¤¹¤ë');
+define('_MI_MYLINKS_GLOBAL_NEWLINK_NOTIFYSBJ', '[{X_SITENAME}] {X_MODULE}: ¿·µ¬¥ê¥ó¥¯¤¬·ÇºÜ¤µ¤ì¤Þ¤·¤¿');
+
+define('_MI_MYLINKS_CATEGORY_LINKSUBMIT_NOTIFY', '¿·µ¬¥ê¥ó¥¯Åê¹Æ¡ÊÆÃÄê¥«¥Æ¥´¥ê¡Ë');
+define('_MI_MYLINKS_CATEGORY_LINKSUBMIT_NOTIFYCAP', '¤³¤Î¥«¥Æ¥´¥ê¤Ë¤ª¤¤¤Æ¿·µ¬¥ê¥ó¥¯¤¬Åê¹Æ¤µ¤ì¤¿¾ì¹ç¤ËÄÌÃÎ¤¹¤ë');
+define('_MI_MYLINKS_CATEGORY_LINKSUBMIT_NOTIFYDSC', '¤³¤Î¥«¥Æ¥´¥ê¤Ë¤ª¤¤¤Æ¿·µ¬¥ê¥ó¥¯¤¬Åê¹Æ¤µ¤ì¤¿¾ì¹ç¤ËÄÌÃÎ¤¹¤ë');
+define('_MI_MYLINKS_CATEGORY_LINKSUBMIT_NOTIFYSBJ', '[{X_SITENAME}] {X_MODULE}: ¿·µ¬¥ê¥ó¥¯¤ÎÅê¹Æ¤¬¤¢¤ê¤Þ¤·¤¿');
+
+define('_MI_MYLINKS_CATEGORY_NEWLINK_NOTIFY', '¿·µ¬¥ê¥ó¥¯·ÇºÜ¡ÊÆÃÄê¥«¥Æ¥´¥ê¡Ë');
+define('_MI_MYLINKS_CATEGORY_NEWLINK_NOTIFYCAP', '¤³¤Î¥«¥Æ¥´¥ê¤Ë¤ª¤¤¤Æ¿·µ¬¥ê¥ó¥¯¤¬·ÇºÜ¤µ¤ì¤¿¾ì¹ç¤ËÄÌÃÎ¤¹¤ë');
+define('_MI_MYLINKS_CATEGORY_NEWLINK_NOTIFYDSC', '¤³¤Î¥«¥Æ¥´¥ê¤Ë¤ª¤¤¤Æ¿·µ¬¥ê¥ó¥¯¤¬·ÇºÜ¤µ¤ì¤¿¾ì¹ç¤ËÄÌÃÎ¤¹¤ë');
+define('_MI_MYLINKS_CATEGORY_NEWLINK_NOTIFYSBJ', '[{X_SITENAME}] {X_MODULE}: ¿·µ¬¥ê¥ó¥¯¤¬·ÇºÜ¤µ¤ì¤Þ¤·¤¿');
+
+define('_MI_MYLINKS_LINK_APPROVE_NOTIFY', '¥ê¥ó¥¯¾µÇ§');
+define('_MI_MYLINKS_LINK_APPROVE_NOTIFYCAP', '¤³¤Î¥ê¥ó¥¯¤¬¾µÇ§¤µ¤ì¤¿¾ì¹ç¤ËÄÌÃÎ¤¹¤ë');
+define('_MI_MYLINKS_LINK_APPROVE_NOTIFYDSC', '¤³¤Î¥ê¥ó¥¯¤¬¾µÇ§¤µ¤ì¤¿¾ì¹ç¤ËÄÌÃÎ¤¹¤ë');
+define('_MI_MYLINKS_LINK_APPROVE_NOTIFYSBJ', '[{X_SITENAME}] {X_MODULE}: ¥ê¥ó¥¯¤¬¾µÇ§¤µ¤ì¤Þ¤·¤¿');
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/japanese/blocks.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/japanese/blocks.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/japanese/blocks.php	(revision 405)
@@ -0,0 +1,7 @@
+<?php
+// Blocks
+define("_MB_MYLINKS_DISP","É½¼¨¥ê¥ó¥¯¿ô¡§");
+define("_MB_MYLINKS_LINKS","·ï");
+define("_MB_MYLINKS_CHARS","É½¼¨¥ê¥ó¥¯Ì¾¤ÎÄ¹¤µ");
+define("_MB_MYLINKS_LENGTH"," ¥Ð¥¤¥È");
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/english/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/english/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/english/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/english/main.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/english/main.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/english/main.php	(revision 405)
@@ -0,0 +1,170 @@
+<?php
+// $Id: main.php,v 1.2 2005/03/18 12:52:25 onokazu Exp $
+//%%%%%%		Module Name 'MyLinks'		%%%%%
+
+define("_MD_THANKSFORINFO","Thanks for the information. We'll look into your request shortly.");
+define("_MD_THANKSFORHELP","Thank you for helping to maintain this directory's integrity.");
+define("_MD_FORSECURITY","For security reasons your user name and IP address will also be temporarily recorded.");
+
+define("_MD_SEARCHFOR","Search for");
+define("_MD_ANY","ANY");
+define("_MD_SEARCH","Search");
+
+define("_MD_MAIN","Main");
+define("_MD_SUBMITLINK","Submit Link");
+define("_MD_SUBMITLINKHEAD","Submit Link Form");
+define("_MD_POPULAR","Popular");
+define("_MD_TOPRATED","Top Rated");
+
+define("_MD_NEWTHISWEEK","New this week");
+define("_MD_UPTHISWEEK","Updated this week");
+
+define("_MD_POPULARITYLTOM","Popularity (Least to Most Hits)");
+define("_MD_POPULARITYMTOL","Popularity (Most to Least Hits)");
+define("_MD_TITLEATOZ","Title (A to Z)");
+define("_MD_TITLEZTOA","Title (Z to A)");
+define("_MD_DATEOLD","Date (Old Links Listed First)");
+define("_MD_DATENEW","Date (New Links Listed First)");
+define("_MD_RATINGLTOH","Rating (Lowest Score to Highest Score)");
+define("_MD_RATINGHTOL","Rating (Highest Score to Lowest Score)");
+
+define("_MD_NOSHOTS","No Screenshots Available");
+define("_MD_EDITTHISLINK","Edit This Link");
+
+define("_MD_DESCRIPTIONC","Description: ");
+define("_MD_EMAILC","Email: ");
+define("_MD_CATEGORYC","Category: ");
+define("_MD_LASTUPDATEC","Last Update: ");
+define("_MD_HITSC","Hits: ");
+define("_MD_RATINGC","Rating: ");
+define("_MD_ONEVOTE","1 vote");
+define("_MD_NUMVOTES","%s votes");
+define("_MD_RATETHISSITE","Rate this Site");
+define("_MD_MODIFY","Modify");
+define("_MD_REPORTBROKEN","Report Broken Link");
+define("_MD_TELLAFRIEND","Tell a Friend");
+
+define("_MD_THEREARE","There are <b>%s</b> Links in our Database");
+define("_MD_LATESTLIST","Latest Listings");
+
+define("_MD_REQUESTMOD","Request Link Modification");
+define("_MD_LINKID","Link ID: ");
+define("_MD_SITETITLE","Website Title: ");
+define("_MD_SITEURL","Website URL: ");
+define("_MD_OPTIONS","Options: ");
+define("_MD_NOTIFYAPPROVE", "Notify me when this link is approved");
+define("_MD_SHOTIMAGE","Screenshot Img: ");
+define("_MD_SENDREQUEST","Send Request");
+
+define("_MD_VOTEAPPRE","Your vote is appreciated.");
+define("_MD_THANKURATE","Thank you for taking the time to rate a site here at %s.");
+define("_MD_VOTEFROMYOU","Input from users such as yourself will help other visitors better decide which link to choose.");
+define("_MD_VOTEONCE","Please do not vote for the same resource more than once.");
+define("_MD_RATINGSCALE","The scale is 1 - 10, with 1 being poor and 10 being excellent.");
+define("_MD_BEOBJECTIVE","Please be objective, if everyone receives a 1 or a 10, the ratings aren't very useful.");
+define("_MD_DONOTVOTE","Do not vote for your own resource.");
+define("_MD_RATEIT","Rate It!");
+
+define("_MD_INTRESTLINK","Interesting Website Link at %s");  // %s is your site name
+define("_MD_INTLINKFOUND","Here is an interesting website link I have found at %s");  // %s is your site name
+
+define("_MD_RECEIVED","We received your Website information. Thanks!");
+define("_MD_WHENAPPROVED","You'll receive an E-mail when it's approved.");
+define("_MD_SUBMITONCE","Submit your link only once.");
+define("_MD_ALLPENDING","All link information are posted pending verification.");
+define("_MD_DONTABUSE","Username and IP are recorded, so please don't abuse the system.");
+define("_MD_TAKESHOT","We will take a screen shot of your website and it may take several days for your website link to be added to our database.");
+
+define("_MD_RANK","Rank");
+define("_MD_CATEGORY","Category");
+define("_MD_HITS","Hits");
+define("_MD_RATING","Rating");
+define("_MD_VOTE","Vote");
+define("_MD_TOP10","%s Top 10"); // %s is a link category title
+
+define("_MD_SEARCHRESULTS","Search results for <b>%s</b>:"); // %s is search keywords
+define("_MD_SORTBY","Sort by:");
+define("_MD_TITLE","Title");
+define("_MD_DATE","Date");
+define("_MD_POPULARITY","Popularity");
+define("_MD_CURSORTEDBY","Sites currently sorted by: %s");
+define("_MD_PREVIOUS","Previous");
+define("_MD_NEXT","Next");
+define("_MD_NOMATCH","No matches found to your query");
+
+define("_MD_SUBMIT","Submit");
+define("_MD_CANCEL","Cancel");
+
+define("_MD_ALREADYREPORTED","You have already submitted a broken report for this resource.");
+define("_MD_MUSTREGFIRST","Sorry, you don't have the permission to perform this action.<br />Please register or login first!");
+define("_MD_NORATING","No rating selected.");
+define("_MD_CANTVOTEOWN","You cannot vote on the resource you submitted.<br />All votes are logged and reviewed.");
+define("_MD_VOTEONCE2","Vote for the selected resource only once.<br />All votes are logged and reviewed.");
+
+//%%%%%%	Module Name 'MyLinks' (Admin)	  %%%%%
+
+define("_MD_WEBLINKSCONF","Web Links Configuration");
+define("_MD_GENERALSET","My Links General Settings");
+define("_MD_ADDMODDELETE","Add, Modify, and Delete Categories/Links");
+define("_MD_LINKSWAITING","Links Waiting for Validation");
+define("_MD_BROKENREPORTS","Broken Link Reports");
+define("_MD_MODREQUESTS","Link Modification Requests");
+define("_MD_SUBMITTER","Submitter: ");
+define("_MD_VISIT","Visit");
+define("_MD_SHOTMUST","Screenshot image must be a valid image file under %s directory (ex. shot.gif). Leave it blank if no image file.");
+define("_MD_APPROVE","Approve");
+define("_MD_DELETE","Delete");
+define("_MD_NOSUBMITTED","No New Submitted Links.");
+define("_MD_ADDMAIN","Add a MAIN Category");
+define("_MD_TITLEC","Title: ");
+define("_MD_IMGURL","Image URL (OPTIONAL Image height will be resized to 50): ");
+define("_MD_ADD","Add");
+define("_MD_ADDSUB","Add a SUB-Category");
+define("_MD_IN","in");
+define("_MD_ADDNEWLINK","Add a New Link");
+define("_MD_MODCAT","Modify Category");
+define("_MD_MODLINK","Modify Link");
+define("_MD_TOTALVOTES","Link Votes (total votes: %s)");
+define("_MD_USERTOTALVOTES","Registered User Votes (total votes: %s)");
+define("_MD_ANONTOTALVOTES","Anonymous User Votes (total votes: %s)");
+define("_MD_USER","User");
+define("_MD_IP","IP Address");
+define("_MD_USERAVG","User AVG Rating");
+define("_MD_TOTALRATE","Total Ratings");
+define("_MD_NOREGVOTES","No Registered User Votes");
+define("_MD_NOUNREGVOTES","No Unregistered User Votes");
+define("_MD_VOTEDELETED","Vote data deleted.");
+define("_MD_NOBROKEN","No reported broken links.");
+define("_MD_IGNOREDESC","Ignore (Ignores the report and only deletes the <b>broken link report</b>)");
+define("_MD_DELETEDESC","Delete (Deletes <b>the reported website data</b> and <b>broken link reports</b> for the link.)");
+define("_MD_REPORTER","Report Sender");
+define("_MD_LINKSUBMITTER","Link Submitter");
+define("_MD_IGNORE","Ignore");
+define("_MD_LINKDELETED","Link Deleted.");
+define("_MD_BROKENDELETED","Broken link report deleted.");
+define("_MD_USERMODREQ","User Link Modification Requests");
+define("_MD_ORIGINAL","Original");
+define("_MD_PROPOSED","Proposed");
+define("_MD_OWNER","Owner: ");
+define("_MD_NOMODREQ","No Link Modification Request.");
+define("_MD_DBUPDATED","Database Updated Successfully!");
+define("_MD_MODREQDELETED","Modification Request Deleted.");
+define("_MD_IMGURLMAIN","Image URL (OPTIONAL and Only valid for main categories. Image height will be resized to 50): ");
+define("_MD_PARENT","Parent Category:");
+define("_MD_SAVE","Save Changes");
+define("_MD_CATDELETED","Category Deleted.");
+define("_MD_WARNING","WARNING: Are you sure you want to delete this Category and ALL of its Links and Comments?");
+define("_MD_YES","Yes");
+define("_MD_NO","No");
+define("_MD_NEWCATADDED","New Category Added Successfully!");
+define("_MD_ERROREXIST","ERROR: The Link you provided is already in the database!");
+define("_MD_ERRORTITLE","ERROR: You need to enter TITLE!");
+define("_MD_ERRORDESC","ERROR: You need to enter DESCRIPTION!");
+define("_MD_NEWLINKADDED","New Link added to the Database.");
+define("_MD_YOURLINK","Your Website Link at %s");
+define("_MD_YOUCANBROWSE","You can browse our web links at %s");
+define("_MD_HELLO","Hello %s");
+define("_MD_WEAPPROVED","We approved your link submission to our web links database.");
+define("_MD_THANKSSUBMIT","Thanks for your submission!");
+define("_MD_ISAPPROVED","We approved your link submission");
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/english/mail_template/global_linksubmit_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/english/mail_template/global_linksubmit_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/english/mail_template/global_linksubmit_notify.tpl	(revision 405)
@@ -0,0 +1,21 @@
+Hello {X_UNAME},
+
+A new link "{LINK_NAME}" has been submitted at {X_SITENAME} and is awaiting approval.
+
+You can view this link submission here:
+{WAITINGLINKS_URL}
+
+-----------
+
+You are receiving this message because you selected to be notified when new links are submitted to our site.
+
+If this is an error or you wish not to receive further such notifications, please update your subscriptions by visiting the link below:
+{X_UNSUBSCRIBE_URL}
+
+Please do not reply to this message.
+
+-----------
+
+{X_SITENAME} ({X_SITEURL}) 
+webmaster
+{X_ADMINMAIL}
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/english/mail_template/category_newlink_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/english/mail_template/category_newlink_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/english/mail_template/category_newlink_notify.tpl	(revision 405)
@@ -0,0 +1,24 @@
+Hello {X_UNAME},
+
+A new link "{LINK_NAME}" has been added in category "{CATEGORY_NAME}" at {X_SITENAME}.
+
+You can view this link here:
+{LINK_URL}
+
+You can view the whole category here:
+{CATEGORY_URL}
+
+-----------
+
+You are receiving this message because you selected to be notified when new links are added in this category.
+
+If this is an error or you wish not to receive further such notifications, please update your subscriptions by visiting the link below:
+{X_UNSUBSCRIBE_URL}
+
+Please do not reply to this message.
+
+-----------
+
+{X_SITENAME} ({X_SITEURL}) 
+webmaster
+{X_ADMINMAIL}
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/english/mail_template/global_linkmodify_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/english/mail_template/global_linkmodify_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/english/mail_template/global_linkmodify_notify.tpl	(revision 405)
@@ -0,0 +1,21 @@
+Hello {X_UNAME},
+
+A link modification request has been submitted and is awaiting approval.
+
+You can view this request here:
+{MODIFYREPORTS_URL}
+
+-----------
+
+You are receiving this message because you selected to be notified when link modification requests are submitted.
+
+If this is an error or you wish not to receive further such notifications, please update your subscriptions by visiting the link below:
+{X_UNSUBSCRIBE_URL}
+
+Please do not reply to this message.
+
+-----------
+
+{X_SITENAME} ({X_SITEURL}) 
+webmaster
+{X_ADMINMAIL}
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/english/mail_template/global_newcategory_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/english/mail_template/global_newcategory_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/english/mail_template/global_newcategory_notify.tpl	(revision 405)
@@ -0,0 +1,24 @@
+Hello {X_UNAME},
+
+A new link category "{CATEGORY_NAME}" has been created at {X_SITENAME}.
+
+Follow this link to view this link category:
+{CATEGORY_URL}
+
+Follow this link to view the category index:
+{X_MODULE_URL}
+
+-----------
+
+You are receiving this message because you selected to be notified when new link categories are added to our site.
+
+If this is an error or you wish not to receive further such notifications, please update your subscriptions by visiting the link below:
+{X_UNSUBSCRIBE_URL}
+
+Please do not reply to this message.
+
+-----------
+
+{X_SITENAME} ({X_SITEURL}) 
+webmaster
+{X_ADMINMAIL}
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/english/mail_template/global_newlink_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/english/mail_template/global_newlink_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/english/mail_template/global_newlink_notify.tpl	(revision 405)
@@ -0,0 +1,21 @@
+Hello {X_UNAME},
+
+A new link "{LINK_NAME}" has been added at {X_SITENAME}.
+
+You can view this link here:
+{LINK_URL}
+
+-----------
+
+You are receiving this message because you selected to be notified when new links are added to our site.
+
+If this is an error or you wish not to receive further such notifications, please update your subscriptions by visiting the link below:
+{X_UNSUBSCRIBE_URL}
+
+Please do not reply to this message.
+
+-----------
+
+{X_SITENAME} ({X_SITEURL}) 
+webmaster
+{X_ADMINMAIL}
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/english/mail_template/link_approve_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/english/mail_template/link_approve_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/english/mail_template/link_approve_notify.tpl	(revision 405)
@@ -0,0 +1,21 @@
+Hello {X_UNAME},
+
+The submitted link "{LINK_NAME}" has been approved at {X_SITENAME}.
+
+You can view this link here:
+{LINK_URL}
+
+-----------
+
+You are receiving this message because you selected to be notified when this link was approved.
+
+If this is an error or you wish not to receive further such notifications, please update your subscriptions by visiting the link below:
+{X_UNSUBSCRIBE_URL}
+
+Please do not reply to this message.
+
+-----------
+
+{X_SITENAME} ({X_SITEURL}) 
+webmaster
+{X_ADMINMAIL}
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/english/mail_template/category_linksubmit_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/english/mail_template/category_linksubmit_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/english/mail_template/category_linksubmit_notify.tpl	(revision 405)
@@ -0,0 +1,21 @@
+Hello {X_UNAME},
+
+A new link "{LINK_NAME}" has been submitted in the category "{CATEGORY_NAME}" at {X_SITENAME} and is awaiting approval.
+
+You can view this link submission here (note this page shows waiting links in ALL categories):
+{WAITINGLINKS_URL}
+
+-----------
+
+You are receiving this message because you selected to be notified when new links are submitted in this category.
+
+If this is an error or you wish not to receive further such notifications, please update your subscriptions by visiting the link below:
+{X_UNSUBSCRIBE_URL}
+
+Please do not reply to this message.
+
+-----------
+
+{X_SITENAME} ({X_SITEURL}) 
+webmaster
+{X_ADMINMAIL}
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/english/mail_template/global_linkbroken_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/english/mail_template/global_linkbroken_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/english/mail_template/global_linkbroken_notify.tpl	(revision 405)
@@ -0,0 +1,21 @@
+Hello {X_UNAME},
+
+A broken link report has been submitted and is awaiting approval.
+
+You can view this request here:
+{BROKENREPORTS_URL}
+
+-----------
+
+You are receiving this message because you selected to be notified when broken link reports are submitted.
+
+If this is an error or you wish not to receive further such notifications, please update your subscriptions by visiting the link below:
+{X_UNSUBSCRIBE_URL}
+
+Please do not reply to this message.
+
+-----------
+
+{X_SITENAME} ({X_SITEURL}) 
+webmaster
+{X_ADMINMAIL}
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/english/modinfo.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/english/modinfo.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/english/modinfo.php	(revision 405)
@@ -0,0 +1,97 @@
+<?php
+// $Id: modinfo.php,v 1.2 2005/03/18 12:52:25 onokazu Exp $
+// Module Info
+
+// The name of this module
+define("_MI_MYLINKS_NAME","Web Links");
+
+// A brief description of this module
+define("_MI_MYLINKS_DESC","Creates a web links section where users can search/submit/rate various web sites.");
+
+// Names of blocks for this module (Not all module has blocks)
+define("_MI_MYLINKS_BNAME1","Recent Links");
+define("_MI_MYLINKS_BNAME2","Top Links");
+
+// Sub menu titles
+define("_MI_MYLINKS_SMNAME1","Submit");
+define("_MI_MYLINKS_SMNAME2","Popular");
+define("_MI_MYLINKS_SMNAME3","Top Rated");
+
+// Names of admin menu items
+define("_MI_MYLINKS_ADMENU2","Add/Edit Links");
+define("_MI_MYLINKS_ADMENU3","Submitted Links");
+define("_MI_MYLINKS_ADMENU4","Broken Links");
+define("_MI_MYLINKS_ADMENU5","Modified Links");
+define("_MI_MYLINKS_ADMENU6","Link Checker");
+
+// Title of config items
+define('_MI_MYLINKS_POPULAR', 'Select the number of hits for links to be marked as popular');
+define('_MI_MYLINKS_NEWLINKS', 'Select the maximum number of new links displayed on top page');
+define('_MI_MYLINKS_PERPAGE', 'Select the maximum number of links displayed in each page');
+define('_MI_MYLINKS_USESHOTS', 'Select yes to display screenshot images for each link');
+define('_MI_MYLINKS_USEFRAMES', 'Would you like to display the linked page withing a frame?');
+define('_MI_MYLINKS_SHOTWIDTH', 'Maximum allowed width of each screenshot image');
+define('_MI_MYLINKS_ANONPOST','Allow anonymous users to post links?');
+define('_MI_MYLINKS_AUTOAPPROVE','Auto approve new links without admin intervention?');
+
+// Description of each config items
+define('_MI_MYLINKS_POPULARDSC', '');
+define('_MI_MYLINKS_NEWLINKSDSC', '');
+define('_MI_MYLINKS_PERPAGEDSC', '');
+define('_MI_MYLINKS_USEFRAMEDSC', '');
+define('_MI_MYLINKS_USESHOTSDSC', '');
+define('_MI_MYLINKS_SHOTWIDTHDSC', '');
+define('_MI_MYLINKS_AUTOAPPROVEDSC','');
+
+// Text for notifications
+
+define('_MI_MYLINKS_GLOBAL_NOTIFY', 'Global');
+define('_MI_MYLINKS_GLOBAL_NOTIFYDSC', 'Global links notification options.');
+
+define('_MI_MYLINKS_CATEGORY_NOTIFY', 'Category');
+define('_MI_MYLINKS_CATEGORY_NOTIFYDSC', 'Notification options that apply to the current link category.');
+
+define('_MI_MYLINKS_LINK_NOTIFY', 'Link');
+define('_MI_MYLINKS_LINK_NOTIFYDSC', 'Notification options that aply to the current link.');
+
+define('_MI_MYLINKS_GLOBAL_NEWCATEGORY_NOTIFY', 'New Category');
+define('_MI_MYLINKS_GLOBAL_NEWCATEGORY_NOTIFYCAP', 'Notify me when a new link category is created.');
+define('_MI_MYLINKS_GLOBAL_NEWCATEGORY_NOTIFYDSC', 'Receive notification when a new link category is created.');
+define('_MI_MYLINKS_GLOBAL_NEWCATEGORY_NOTIFYSBJ', '[{X_SITENAME}] {X_MODULE} auto-notify : New link category');
+
+define('_MI_MYLINKS_GLOBAL_LINKMODIFY_NOTIFY', 'Modify Link Requested');
+define('_MI_MYLINKS_GLOBAL_LINKMODIFY_NOTIFYCAP', 'Notify me of any link modification request.');
+define('_MI_MYLINKS_GLOBAL_LINKMODIFY_NOTIFYDSC', 'Receive notification when any link modification request is submitted.');
+define('_MI_MYLINKS_GLOBAL_LINKMODIFY_NOTIFYSBJ', '[{X_SITENAME}] {X_MODULE} auto-notify : Link Modification Requested');
+
+define('_MI_MYLINKS_GLOBAL_LINKBROKEN_NOTIFY', 'Broken Link Submitted');
+define('_MI_MYLINKS_GLOBAL_LINKBROKEN_NOTIFYCAP', 'Notify me of any broken link report.');
+define('_MI_MYLINKS_GLOBAL_LINKBROKEN_NOTIFYDSC', 'Receive notification when any broken link report is submitted.');
+define('_MI_MYLINKS_GLOBAL_LINKBROKEN_NOTIFYSBJ', '[{X_SITENAME}] {X_MODULE} auto-notify : Broken Link Reported');
+
+define('_MI_MYLINKS_GLOBAL_LINKSUBMIT_NOTIFY', 'New Link Submitted');
+define('_MI_MYLINKS_GLOBAL_LINKSUBMIT_NOTIFYCAP', 'Notify me when any new link is submitted (awaiting approval).');
+define('_MI_MYLINKS_GLOBAL_LINKSUBMIT_NOTIFYDSC', 'Receive notification when any new link is submitted (awaiting approval).');
+define('_MI_MYLINKS_GLOBAL_LINKSUBMIT_NOTIFYSBJ', '[{X_SITENAME}] {X_MODULE} auto-notify : New link submitted');
+
+define('_MI_MYLINKS_GLOBAL_NEWLINK_NOTIFY', 'New Link');
+define('_MI_MYLINKS_GLOBAL_NEWLINK_NOTIFYCAP', 'Notify me when any new link is posted.');
+define('_MI_MYLINKS_GLOBAL_NEWLINK_NOTIFYDSC', 'Receive notification when any new link is posted.');
+define('_MI_MYLINKS_GLOBAL_NEWLINK_NOTIFYSBJ', '[{X_SITENAME}] {X_MODULE} auto-notify : New link');
+
+define('_MI_MYLINKS_CATEGORY_LINKSUBMIT_NOTIFY', 'New Link Submitted');
+define('_MI_MYLINKS_CATEGORY_LINKSUBMIT_NOTIFYCAP', 'Notify me when a new link is submitted (awaiting approval) to the current category.');
+define('_MI_MYLINKS_CATEGORY_LINKSUBMIT_NOTIFYDSC', 'Receive notification when a new link is submitted (awaiting approval) to the current category.');
+define('_MI_MYLINKS_CATEGORY_LINKSUBMIT_NOTIFYSBJ', '[{X_SITENAME}] {X_MODULE} auto-notify : New link submitted in category');
+
+define('_MI_MYLINKS_CATEGORY_NEWLINK_NOTIFY', 'New Link');
+define('_MI_MYLINKS_CATEGORY_NEWLINK_NOTIFYCAP', 'Notify me when a new link is posted to the current category.');
+define('_MI_MYLINKS_CATEGORY_NEWLINK_NOTIFYDSC', 'Receive notification when a new link is posted to the current category.');
+define('_MI_MYLINKS_CATEGORY_NEWLINK_NOTIFYSBJ', '[{X_SITENAME}] {X_MODULE} auto-notify : New link in category');
+
+define('_MI_MYLINKS_LINK_APPROVE_NOTIFY', 'Link Approved');
+define('_MI_MYLINKS_LINK_APPROVE_NOTIFYCAP', 'Notify me when this link is approved.');
+define('_MI_MYLINKS_LINK_APPROVE_NOTIFYDSC', 'Receive notification when this link is approved.');
+define('_MI_MYLINKS_LINK_APPROVE_NOTIFYSBJ', '[{X_SITENAME}] {X_MODULE} auto-notify : Link approved');
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/english/blocks.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/english/blocks.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/language/english/blocks.php	(revision 405)
@@ -0,0 +1,8 @@
+<?php
+// $Id: blocks.php,v 1.2 2005/03/18 12:52:25 onokazu Exp $
+// Blocks
+define("_MB_MYLINKS_DISP","Display");
+define("_MB_MYLINKS_LINKS","Links");
+define("_MB_MYLINKS_CHARS","Length of the title");
+define("_MB_MYLINKS_LENGTH"," characters");
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/include/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/include/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/include/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/include/functions.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/include/functions.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/include/functions.php	(revision 405)
@@ -0,0 +1,148 @@
+<?php
+// $Id: functions.php,v 1.2 2005/03/18 12:52:25 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+function newlinkgraphic($time, $status) {
+	$count = 7;
+	$new = '';
+	$startdate = (time()-(86400 * $count));
+	if ($startdate < $time) {
+		if($status==1){
+			$new = "&nbsp;<img src=\"".XOOPS_URL."/modules/mylinks/images/newred.gif\" alt=\""._MD_NEWTHISWEEK."\" />";
+		}elseif($status==2){
+			$new = "&nbsp;<img src=\"".XOOPS_URL."/modules/mylinks/images/update.gif\" alt=\""._MD_UPTHISWEEK."\" />";
+		}
+	}
+	return $new;
+}
+
+function popgraphic($hits) {
+	global $xoopsModuleConfig;
+	if ($hits >= $xoopsModuleConfig['popular']) {
+		return "&nbsp;<img src=\"".XOOPS_URL."/modules/mylinks/images/pop.gif\" alt=\""._MD_POPULAR."\" />";
+	}
+	return '';
+}
+//Reusable Link Sorting Functions
+function convertorderbyin($orderby) {
+	switch (trim($orderby)) {
+	case "titleA":
+		$orderby = "title ASC";
+		break;
+	case "dateA":
+		$orderby = "date ASC";
+		break;
+	case "hitsA":
+		$orderby = "hits ASC";
+		break;
+	case "ratingA":
+		$orderby = "rating ASC";
+		break;
+	case "titleD":
+		$orderby = "title DESC";
+		break;
+	case "hitsD":
+		$orderby = "hits DESC";
+		break;
+	case "ratingD":
+		$orderby = "rating DESC";
+		break;
+	case"dateD":
+	default:
+		$orderby = "date DESC";
+		break;
+	}
+	return $orderby;
+}
+function convertorderbytrans($orderby) {
+            if ($orderby == "hits ASC")   $orderbyTrans = ""._MD_POPULARITYLTOM."";
+            if ($orderby == "hits DESC")    $orderbyTrans = ""._MD_POPULARITYMTOL."";
+            if ($orderby == "title ASC")    $orderbyTrans = ""._MD_TITLEATOZ."";
+           if ($orderby == "title DESC")   $orderbyTrans = ""._MD_TITLEZTOA."";
+            if ($orderby == "date ASC") $orderbyTrans = ""._MD_DATEOLD."";
+            if ($orderby == "date DESC")   $orderbyTrans = ""._MD_DATENEW."";
+            if ($orderby == "rating ASC")  $orderbyTrans = ""._MD_RATINGLTOH."";
+            if ($orderby == "rating DESC") $orderbyTrans = ""._MD_RATINGHTOL."";
+            return $orderbyTrans;
+}
+function convertorderbyout($orderby) {
+            if ($orderby == "title ASC")            $orderby = "titleA";
+            if ($orderby == "date ASC")            $orderby = "dateA";
+            if ($orderby == "hits ASC")          $orderby = "hitsA";
+            if ($orderby == "rating ASC")        $orderby = "ratingA";
+            if ($orderby == "title DESC")              $orderby = "titleD";
+            if ($orderby == "date DESC")            $orderby = "dateD";
+            if ($orderby == "hits DESC")          $orderby = "hitsD";
+            if ($orderby == "rating DESC")        $orderby = "ratingD";
+            return $orderby;
+}
+
+
+
+//updates rating data in itemtable for a given item
+function updaterating($sel_id){
+        global $xoopsDB;
+        $query = "select rating FROM ".$xoopsDB->prefix("mylinks_votedata")." WHERE lid = ".$sel_id."";
+        //echo $query;
+        $voteresult = $xoopsDB->query($query);
+            $votesDB = $xoopsDB->getRowsNum($voteresult);
+        $totalrating = 0;
+            while(list($rating)=$xoopsDB->fetchRow($voteresult)){
+                $totalrating += $rating;
+        }
+        $finalrating = $totalrating/$votesDB;
+        $finalrating = number_format($finalrating, 4);
+        $query =  "UPDATE ".$xoopsDB->prefix("mylinks_links")." SET rating=$finalrating, votes=$votesDB WHERE lid = $sel_id";
+        //echo $query;
+            $xoopsDB->query($query) or exit();
+}
+
+//returns the total number of items in items table that are accociated with a given table $table id
+function getTotalItems($sel_id, $status=""){
+        global $xoopsDB, $mytree;
+        $count = 0;
+        $arr = array();
+        $query = "select count(*) from ".$xoopsDB->prefix("mylinks_links")." where cid=".$sel_id."";
+        if($status!=""){
+                $query .= " and status>=$status";
+        }
+        $result = $xoopsDB->query($query);
+        list($thing) = $xoopsDB->fetchRow($result);
+        $count = $thing;
+        $arr = $mytree->getAllChildId($sel_id);
+        $size = count($arr);
+        for($i=0;$i<$size;$i++){
+                $query2 = "select count(*) from ".$xoopsDB->prefix("mylinks_links")." where cid=".$arr[$i]."";
+                if($status!=""){
+                        $query2 .= " and status>=$status";
+                }
+                $result2 = $xoopsDB->query($query2);
+                list($thing) = $xoopsDB->fetchRow($result2);
+                $count += $thing;
+        }
+        return $count;
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/include/comment_functions.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/include/comment_functions.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/include/comment_functions.php	(revision 405)
@@ -0,0 +1,13 @@
+<?php
+// comment callback functions
+
+function mylinks_com_update($link_id, $total_num){
+	$db =& Database::getInstance();
+	$sql = 'UPDATE '.$db->prefix('mylinks_links').' SET comments = '.$total_num.' WHERE lid = '.$link_id;
+	$db->query($sql);
+}
+
+function mylinks_com_approve(&$comment){
+	// notification mail here
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/include/search.inc.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/include/search.inc.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/include/search.inc.php	(revision 405)
@@ -0,0 +1,58 @@
+<?php
+// $Id: search.inc.php,v 1.2 2005/03/18 12:52:25 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+function mylinks_search($queryarray, $andor, $limit, $offset, $userid){
+	global $xoopsDB;
+	$sql = "SELECT l.lid,l.cid,l.title,l.submitter,l.date,t.description FROM ".$xoopsDB->prefix("mylinks_links")." l LEFT JOIN ".$xoopsDB->prefix("mylinks_text")." t ON t.lid=l.lid WHERE status>0";
+	if ( $userid != 0 ) {
+		$sql .= " AND l.submitter=".$userid." ";
+	}
+	// because count() returns 1 even if a supplied variable
+	// is not an array, we must check if $querryarray is really an array
+	if ( is_array($queryarray) && $count = count($queryarray) ) {
+		$sql .= " AND ((l.title LIKE '%$queryarray[0]%' OR t.description LIKE '%$queryarray[0]%')";
+		for($i=1;$i<$count;$i++){
+			$sql .= " $andor ";
+			$sql .= "(l.title LIKE '%$queryarray[$i]%' OR t.description LIKE '%$queryarray[$i]%')";
+		}
+		$sql .= ") ";
+	}
+	$sql .= "ORDER BY l.date DESC";
+	$result = $xoopsDB->query($sql,$limit,$offset);
+	$ret = array();
+	$i = 0;
+ 	while($myrow = $xoopsDB->fetchArray($result)){
+		$ret[$i]['image'] = "images/home.gif";
+		$ret[$i]['link'] = "singlelink.php?cid=".$myrow['cid']."&amp;lid=".$myrow['lid']."";
+		$ret[$i]['title'] = $myrow['title'];
+		$ret[$i]['time'] = $myrow['date'];
+		$ret[$i]['uid'] = $myrow['submitter'];
+		$i++;
+	}
+	return $ret;
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/include/notification.inc.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/include/notification.inc.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/include/notification.inc.php	(revision 405)
@@ -0,0 +1,71 @@
+<?php
+// $Id: notification.inc.php,v 1.2 2005/03/18 12:52:25 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+function mylinks_notify_iteminfo($category, $item_id)
+{
+	global $xoopsModule, $xoopsModuleConfig, $xoopsConfig;
+
+	if (empty($xoopsModule) || $xoopsModule->getVar('dirname') != 'mylinks') {	
+		$module_handler =& xoops_gethandler('module');
+		$module =& $module_handler->getByDirname('mylinks');
+		$config_handler =& xoops_gethandler('config');
+		$config =& $config_handler->getConfigsByCat(0,$module->getVar('mid'));
+	} else {
+		$module =& $xoopsModule;
+		$config =& $xoopsModuleConfig;
+	}
+
+	//include_once XOOPS_ROOT_PATH . '/modules/' . $module->getVar('dirname') . '/language/' . $xoopsConfig['language'] . '/main.php';
+
+	if ($category=='global') {
+		$item['name'] = '';
+		$item['url'] = '';
+		return $item;
+	}
+
+	global $xoopsDB;
+	if ($category=='category') {
+		// Assume we have a valid category id
+		$sql = 'SELECT title FROM ' . $xoopsDB->prefix('mylinks_cat') . ' WHERE cid = '.$item_id;
+		$result = $xoopsDB->query($sql); // TODO: error check
+		$result_array = $xoopsDB->fetchArray($result);
+		$item['name'] = $result_array['title'];
+		$item['url'] = XOOPS_URL . '/modules/' . $module->getVar('dirname') . '/viewcat.php?cid=' . $item_id;
+		return $item;
+	}
+
+	if ($category=='link') {
+		// Assume we have a valid link id
+		$sql = 'SELECT cid,title FROM '.$xoopsDB->prefix('mylinks_links') . ' WHERE lid = ' . $item_id;
+		$result = $xoopsDB->query($sql); // TODO: error check
+		$result_array = $xoopsDB->fetchArray($result);
+		$item['name'] = $result_array['title'];
+		$item['url'] = XOOPS_URL . '/modules/' . $module->getVar('dirname') . '/singlelink.php?cid=' . $result_array['cid'] . '&amp;lid=' . $item_id;
+		return $item;
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/myheader.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/myheader.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/myheader.php	(revision 405)
@@ -0,0 +1,61 @@
+<?php
+// $Id: myheader.php,v 1.6 2006/05/01 02:37:28 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+/////////////////////////////////////////////////////////////
+// Title    : Frame Branding Hack for Xoops Mylinks        //
+// Author   : Freeop                                       //
+// Email    : Webmaster@belizecountry.com                  //
+// Website  : http://www.Belizecountry.com                 //
+// System   : Xoops RC 3.0.4 / 3.0.5             10-14-02  //
+// Filename : myheader.php                                 //
+// Type     : Module Hack for MyLinks                      //
+/////////////////////////////////////////////////////////////
+
+// Code below uses users current selected theme style      //
+
+include "../../mainfile.php";
+$url = htmlspecialchars(preg_replace( '/javascript:/si' , 'java script:', $_GET['url'] ));
+$lid = intval($_GET['lid']);
+$cid = intval($_GET['cid']);
+echo"<html><head><style><!--.bg1 {    background-color : #E3E4E0;}.bg2 {    background-color : #e5e5e5;}.bg3 {     background-color : #f6f6f6;}.bg4 {    background-color : #f0f0f0;}.bg5 {    background-color : f8f8f8;}body { margin-left: 0px;margin-top: 0px;margin-right: 0px;margin-bottom: 0px;font-family: Tahoma, taipei; color;#000000; font-size: 10px; background-color : #2F5376; color: #ffffff;}a {  font-weight: bold;font-family: Tahoma, taipei; font-size: 10px; text-decoration: none; color: #666666; font-style: normal}A:hover {  font-weight: bold;text-decoration: underline;  font-family: Tahoma, taipei; font-size: 10px; color: #FF9966; font-style: normal}td {  font-family: Tahoma, taipei; color: #000000; font-size: 10px;border-top-width : 1px; border-right-width : 1px; border-bottom-width : 1px; border-left-width : 1px;}img { border:0;}//--></style>";
+$mail_subject = rawurlencode(sprintf(_MD_INTRESTLINK,$xoopsConfig['sitename']));
+$mail_body = rawurlencode(sprintf(_MD_INTLINKFOUND,$xoopsConfig['sitename']).':  '.XOOPS_URL.'/modules/mylinks/singlelink.php?cid='.$cid.'&lid='.$lid);
+?>
+
+</head><body>
+<table width="100%" border="0" cellspacing="0" cellpadding="0">
+<tr>
+<td width="150"><a href="<?php echo XOOPS_URL; ?>" target="_BLANK"><img src="<?php echo XOOPS_URL; ?>/images/logo.gif" alt="" /></a>
+<td width="100%" align="center">
+<table class="bg3" width=95% cellspacing="2" cellpadding="3" border="0" style="border: #e0e0e0 1px solid;"><tr>
+<td style="border-bottom: #e0e0e0 1px solid;">
+<b><?php echo htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES); ?></b></td>
+</tr>
+<tr>
+<td class='bg4' align="center"><small>
+<a target="main" href="ratelink.php?cid=<?php echo $cid; ?>&amp;lid=<?php echo $lid; ?>"><?php echo _MD_RATETHISSITE; ?></a> | <a target="main" href="modlink.php?lid=<?php echo $lid; ?>"><?php echo _MD_MODIFY; ?></a> | <a target="main" href="brokenlink.php?lid=<?php echo $lid; ?>"><?php echo _MD_REPORTBROKEN; ?></a> | <a target='_top' href='mailto:?subject=<?php echo $mail_subject; ?>&amp;body=<?php echo $mail_body;?>'><?php echo _MD_TELLAFRIEND; ?></a> | <a target='_top' href="<?php echo XOOPS_URL; ?>">Back to <?php echo htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES); ?></a> | <a target='_top' href="<?php echo $url; ?>">Close Frame</a>
+</small></td></tr></table>
+</td></tr></table></body></html>
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/brokenlink.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/brokenlink.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/brokenlink.php	(revision 405)
@@ -0,0 +1,74 @@
+<?php
+// $Id: brokenlink.php,v 1.3 2005/09/04 20:46:10 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+// ------------------------------------------------------------------------- //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+include "header.php";
+$myts =& MyTextSanitizer::getInstance(); // MyTextSanitizer object
+
+if (!empty($_POST['submit'])) {
+	if (empty($xoopsUser)) {
+		$sender = 0;
+	} else {
+		$sender = $xoopsUser->getVar('uid');
+	}
+	$lid = intval($_POST['lid']);
+	$ip = getenv("REMOTE_ADDR");
+	if ($sender != 0) {
+		// Check if REG user is trying to report twice.
+   		$result=$xoopsDB->query("SELECT COUNT(*) FROM ".$xoopsDB->prefix("mylinks_broken")." WHERE lid=".$lid." AND sender=".$sender."");
+       	list($count)=$xoopsDB->fetchRow($result);
+       	if ($count > 0) {
+			redirect_header("index.php",2,_MD_ALREADYREPORTED);
+			exit();
+        }
+  	} else {
+   		// Check if the sender is trying to vote more than once.
+    	$result=$xoopsDB->query("SELECT COUNT(*) FROM ".$xoopsDB->prefix("mylinks_broken")." WHERE lid=$lid AND ip = '$ip'");
+   		list($count)=$xoopsDB->fetchRow($result);
+    	if ($count > 0) {
+			redirect_header("index.php",2,_MD_ALREADYREPORTED);
+			exit();
+    	}
+	}
+	$newid = $xoopsDB->genId($xoopsDB->prefix("mylinks_broken")."_reportid_seq");
+	$sql = sprintf("INSERT INTO %s (reportid, lid, sender, ip) VALUES (%u, %u, %u, '%s')", $xoopsDB->prefix("mylinks_broken"), $newid, $lid, $sender, $ip);
+	$xoopsDB->query($sql) or exit();
+	$tags = array();
+	$tags['BROKENREPORTS_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/admin/index.php?op=listBrokenLinks';
+	$notification_handler =& xoops_gethandler('notification');
+	$notification_handler->triggerEvent('global', 0, 'link_broken', $tags);
+	redirect_header("index.php",2,_MD_THANKSFORINFO);
+	exit();
+} else {
+	$xoopsOption['template_main'] = 'mylinks_brokenlink.html';
+	include XOOPS_ROOT_PATH.'/header.php';
+	$xoopsTpl->assign('lang_reportbroken', _MD_REPORTBROKEN);
+	$xoopsTpl->assign('link_id', intval($_GET['lid']));
+	$xoopsTpl->assign('lang_thanksforhelp', _MD_THANKSFORHELP);
+	$xoopsTpl->assign('lang_forsecurity', _MD_FORSECURITY);
+	$xoopsTpl->assign('lang_cancel', _MD_CANCEL);
+	include_once XOOPS_ROOT_PATH.'/footer.php';
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/visit.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/visit.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/visit.php	(revision 405)
@@ -0,0 +1,62 @@
+<?php
+// $Id: visit.php,v 1.4 2005/08/03 12:39:13 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+include '../../mainfile.php';
+$lid = intval($_GET['lid']);
+if (empty($lid)) {
+    header('Location: '.XOOPS_URL.'/');
+    exit();
+}
+$cid = intval($_GET['cid']);
+$sql = sprintf("UPDATE %s SET hits = hits+1 WHERE lid = %u AND status > 0", $xoopsDB->prefix("mylinks_links"), $lid);
+$xoopsDB->queryF($sql);
+$result = $xoopsDB->query("select url from ".$xoopsDB->prefix("mylinks_links")." where lid=$lid and status>0");
+list($url) = $xoopsDB->fetchRow($result);
+if (empty($url)) {
+    header('Location: '.XOOPS_URL.'/');
+    exit();
+}
+$url = htmlspecialchars(preg_replace( '/javascript:/si' , 'java script:', $url ), ENT_QUOTES);
+if ( $xoopsModuleConfig['frame'] != "" ) {
+    header('Content-Type:text/html; charset='._CHARSET);
+    header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
+    header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
+    header('Cache-Control: no-store, no-cache, must-revalidate');
+    header("Cache-Control: post-check=0, pre-check=0", false);
+    header("Pragma: no-cache");
+    echo "<html><head>
+        <title>".htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES)."</title>
+        </head>
+        <frameset rows='70px,100%' cols='*' border='0' frameborder='0' framespacing='0' >
+        <frame src='myheader.php?url=$url&amp;cid=$cid&amp;lid=$lid' frame name='xoopshead' scrolling='no' target='main' Noresize>
+        <frame src='".$url."' frame name='main' scrolling='auto' target='Main'>
+        </frameset></html>";
+} else {
+    echo "<html><head><meta http-equiv=\"Refresh\" content=\"0; URL=".$url."\"></meta></head><body></body></html>";
+}
+exit();
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/singlelink.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/singlelink.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/singlelink.php	(revision 405)
@@ -0,0 +1,79 @@
+<?php
+// $Id: singlelink.php,v 1.5 2005/09/04 20:46:10 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+// ------------------------------------------------------------------------- //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+include "header.php";
+$myts =& MyTextSanitizer::getInstance();// MyTextSanitizer object
+include_once XOOPS_ROOT_PATH."/class/xoopstree.php";
+$mytree = new XoopsTree($xoopsDB->prefix("mylinks_cat"),"cid","pid");
+$lid = intval($_GET['lid']);
+$cid = intval($_GET['cid']);
+$xoopsOption['template_main'] = 'mylinks_singlelink.html';
+include XOOPS_ROOT_PATH."/header.php";
+
+$result = $xoopsDB->query("select l.lid, l.cid, l.title, l.url, l.logourl, l.status, l.date, l.hits, l.rating, l.votes, l.comments, t.description from ".$xoopsDB->prefix("mylinks_links")." l, ".$xoopsDB->prefix("mylinks_text")." t where l.lid=$lid and l.lid=t.lid and status>0");
+list($lid, $cid, $ltitle, $url, $logourl, $status, $time, $hits, $rating, $votes, $comments, $description) = $xoopsDB->fetchRow($result);
+
+$pathstring = "<a href='index.php'>"._MD_MAIN."</a>&nbsp;:&nbsp;";
+$pathstring .= $mytree->getNicePathFromId($cid, "title", "viewcat.php?op=");
+$xoopsTpl->assign('category_path', $pathstring);
+
+if ($xoopsUser && $xoopsUser->isAdmin($xoopsModule->mid())) {
+        $adminlink = '<a href="'.XOOPS_URL.'/modules/mylinks/admin/?op=modLink&amp;lid='.$lid.'"><img src="'.XOOPS_URL.'/modules/mylinks/images/editicon.gif" border="0" alt="'._MD_EDITTHISLINK.'" /></a>';
+} else {
+        $adminlink = '';
+}
+if ($votes == 1) {
+        $votestring = _MD_ONEVOTE;
+} else {
+        $votestring = sprintf(_MD_NUMVOTES,$votes);
+}
+
+if ($xoopsModuleConfig['useshots'] == 1) {
+        $xoopsTpl->assign('shotwidth', $xoopsModuleConfig['shotwidth']);
+        $xoopsTpl->assign('tablewidth', $xoopsModuleConfig['shotwidth'] + 10);
+        $xoopsTpl->assign('show_screenshot', true);
+        $xoopsTpl->assign('lang_noscreenshot', _MD_NOSHOTS);
+}
+$path = $mytree->getPathFromId($cid, "title");
+$path = substr($path, 1);
+$path = str_replace("/"," <img src='".XOOPS_URL."/modules/mylinks/images/arrow.gif' board='0' alt='' /> ",$path);
+$new = newlinkgraphic($time, $status);
+$pop = popgraphic($hits);
+$xoopsTpl->assign('link', array('id' => $lid, 'cid' => $cid, 'rating' => number_format($rating, 2), 'title' => $myts->makeTboxData4Show($ltitle).$new.$pop, 'category' => $path, 'logourl' => $myts->makeTboxData4Show($logourl), 'updated' => formatTimestamp($time,"m"), 'description' => $myts->makeTareaData4Show($description,0), 'adminlink' => $adminlink, 'hits' => $hits, 'votes' => $votestring, 'comments' => $comments, 'mail_subject' => rawurlencode(sprintf(_MD_INTRESTLINK,$xoopsConfig['sitename'])), 'mail_body' => rawurlencode(sprintf(_MD_INTLINKFOUND,$xoopsConfig['sitename']).':  '.XOOPS_URL.'/modules/mylinks/singlelink.php?lid='.$lid)));
+$xoopsTpl->assign('lang_description', _MD_DESCRIPTIONC);
+$xoopsTpl->assign('lang_lastupdate', _MD_LASTUPDATEC);
+$xoopsTpl->assign('lang_hits', _MD_HITSC);
+$xoopsTpl->assign('lang_rating', _MD_RATINGC);
+$xoopsTpl->assign('lang_ratethissite', _MD_RATETHISSITE);
+$xoopsTpl->assign('lang_reportbroken', _MD_REPORTBROKEN);
+$xoopsTpl->assign('lang_tellafriend', _MD_TELLAFRIEND);
+$xoopsTpl->assign('lang_modify', _MD_MODIFY);
+$xoopsTpl->assign('lang_category' , _MD_CATEGORYC);
+$xoopsTpl->assign('lang_visit' , _MD_VISIT);
+$xoopsTpl->assign('lang_comments' , _COMMENTS);
+include XOOPS_ROOT_PATH.'/include/comment_view.php';
+include XOOPS_ROOT_PATH.'/footer.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/admin/menu.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/admin/menu.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/admin/menu.php	(revision 405)
@@ -0,0 +1,36 @@
+<?php
+// $Id: menu.php,v 1.2 2005/03/18 12:52:24 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+$adminmenu[1]['title'] = _MI_MYLINKS_ADMENU2;
+$adminmenu[1]['link'] = "admin/index.php?op=linksConfigMenu";
+$adminmenu[2]['title'] = _MI_MYLINKS_ADMENU3;
+$adminmenu[2]['link'] = "admin/index.php?op=listNewLinks";
+$adminmenu[3]['title'] = _MI_MYLINKS_ADMENU4;
+$adminmenu[3]['link'] = "admin/index.php?op=listBrokenLinks";
+$adminmenu[4]['title'] = _MI_MYLINKS_ADMENU5;
+$adminmenu[4]['link'] = "admin/index.php?op=listModReq";
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/admin/index.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/admin/index.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/admin/index.php	(revision 405)
@@ -0,0 +1,977 @@
+<?php
+// ------------------------------------------------------------------------- //
+//                XOOPS - PHP Content Management System                      //
+//                       <http://www.xoops.org/>                             //
+// ------------------------------------------------------------------------- //
+// Based on:                                     //
+// myPHPNUKE Web Portal System - http://myphpnuke.com/               //
+// PHP-NUKE Web Portal System - http://phpnuke.org/              //
+// Thatware - http://thatware.org/                       //
+// ------------------------------------------------------------------------- //
+//  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 //
+// ------------------------------------------------------------------------- //
+include '../../../include/cp_header.php';
+if ( file_exists("../language/".$xoopsConfig['language']."/main.php") ) {
+    include "../language/".$xoopsConfig['language']."/main.php";
+} else {
+    include "../language/english/main.php";
+}
+include '../include/functions.php';
+include_once XOOPS_ROOT_PATH.'/class/xoopstree.php';
+include_once XOOPS_ROOT_PATH."/class/xoopslists.php";
+include_once XOOPS_ROOT_PATH."/include/xoopscodes.php";
+include_once XOOPS_ROOT_PATH.'/class/module.errorhandler.php';
+$myts =& MyTextSanitizer::getInstance();
+$eh = new ErrorHandler;
+$mytree = new XoopsTree($xoopsDB->prefix("mylinks_cat"),"cid","pid");
+
+function mylinks()
+{
+    global $xoopsDB, $xoopsModule;
+    xoops_cp_header();
+    echo "<h4>"._MD_WEBLINKSCONF."</h4>";
+        echo"<table width='100%' border='0' cellspacing='1' class='outer'>"
+        ."<tr class=\"odd\"><td>";
+    // Temporarily 'homeless' links (to be revised in admin.php breakup)
+        $result = $xoopsDB->query("select count(*) from ".$xoopsDB->prefix("mylinks_broken")."");
+        list($totalbrokenlinks) = $xoopsDB->fetchRow($result);
+    if($totalbrokenlinks>0){
+        $totalbrokenlinks = "<span style='color: #ff0000; font-weight: bold'>$totalbrokenlinks</span>";
+    }
+        $result2 = $xoopsDB->query("select count(*) from ".$xoopsDB->prefix("mylinks_mod")."");
+        list($totalmodrequests) = $xoopsDB->fetchRow($result2);
+    if($totalmodrequests>0){
+        $totalmodrequests = "<span style='color: #ff0000; font-weight: bold'>$totalmodrequests</span>";
+    }
+    $result3 = $xoopsDB->query("select count(*) from ".$xoopsDB->prefix("mylinks_links")." where status=0");
+        list($totalnewlinks) = $xoopsDB->fetchRow($result3);
+    if($totalnewlinks>0){
+        $totalnewlinks = "<span style='color: #ff0000; font-weight: bold'>$totalnewlinks</span>";
+    }
+    echo " - <a href='".XOOPS_URL."/modules/system/admin.php?fct=preferences&amp;op=showmod&amp;mod=".$xoopsModule->getVar('mid')."'>"._MD_GENERALSET."</a>";
+    echo "<br /><br />";
+    echo " - <a href=index.php?op=linksConfigMenu>"._MD_ADDMODDELETE."</a>";
+    echo "<br /><br />";
+    echo " - <a href=index.php?op=listNewLinks>"._MD_LINKSWAITING." ($totalnewlinks)</a>";
+    echo "<br /><br />";
+    echo " - <a href=index.php?op=listBrokenLinks>"._MD_BROKENREPORTS." ($totalbrokenlinks)</a>";
+    echo "<br /><br />";
+    echo " - <a href=index.php?op=listModReq>"._MD_MODREQUESTS." ($totalmodrequests)</a>";
+    $result=$xoopsDB->query("select count(*) from ".$xoopsDB->prefix("mylinks_links")." where status>0");
+    list($numrows) = $xoopsDB->fetchRow($result);
+    echo "<br /><br /><div>";
+    printf(_MD_THEREARE,$numrows);  echo "</div>";
+    echo"</td></tr></table>";
+    xoops_cp_footer();
+}
+
+function listNewLinks()
+{
+    global $xoopsDB, $xoopsConfig, $myts, $eh, $mytree;
+    // List links waiting for validation
+    $linkimg_array = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH."/modules/mylinks/images/shots/");
+    $result = $xoopsDB->query("select lid, cid, title, url, logourl, submitter from ".$xoopsDB->prefix("mylinks_links")." where status=0 order by date DESC");
+    $numrows = $xoopsDB->getRowsNum($result);
+    xoops_cp_header();
+    echo "<h4>"._MD_WEBLINKSCONF."</h4>";
+        echo"<table width='100%' border='0' cellspacing='1' class='outer'>"
+           ."<tr class=\"odd\"><td>";
+    echo "<h4>"._MD_LINKSWAITING."&nbsp;($numrows)</h4><br />";
+    if ( $numrows > 0 ) {
+        while(list($lid, $cid, $title, $url, $logourl, $submitterid) = $xoopsDB->fetchRow($result)) {
+            $result2 = $xoopsDB->query("select description from ".$xoopsDB->prefix("mylinks_text")." where lid=$lid");
+            list($description) = $xoopsDB->fetchRow($result2);
+            $title = $myts->makeTboxData4Edit($title);
+            $url = $myts->makeTboxData4Edit($url);
+            //      $url = urldecode($url);
+            //      $logourl = $myts->makeTboxData4Edit($logourl);
+            //      $logourl = urldecode($logourl);
+            $description = $myts->makeTareaData4Edit($description);
+            $submitter = XoopsUser::getUnameFromId($submitterid);
+            echo "<form action=\"index.php\" method='post'>\n";
+            echo "<table width=\"80%\">";
+            echo "<tr><td align=\"right\" nowrap=\"nowrap\">"._MD_SUBMITTER."</td><td>\n";
+            echo "<a href=\"".XOOPS_URL."/userinfo.php?uid=".$submitterid."\">$submitter</a>";
+            echo "</td></tr>\n";
+            echo "<tr><td align=\"right\" nowrap=\"nowrap\">"._MD_SITETITLE."</td><td>";
+            echo "<input type=\"text\" name=\"title\" size=\"50\" maxlength=\"100\" value=\"$title\" />";
+            echo "</td></tr><tr><td align=\"right\" nowrap=\"nowrap\">"._MD_SITEURL."</td><td>";
+            echo "<input type=\"text\" name=\"url\" size=\"50\" maxlength=\"250\" value=\"$url\" />";
+            echo "&nbsp;[&nbsp;<a href=\"".preg_replace("/javascript:/si", 'java script:', $url)."\" target=\"_blank\">"._MD_VISIT."</a>&nbsp;]";
+            echo "</td></tr>";
+            echo "<tr><td align=\"right\" nowrap=\"nowrap\">"._MD_CATEGORYC."</td><td>";
+            $mytree->makeMySelBox("title", "title", $cid);
+            echo "</td></tr>\n";
+            echo "<tr><td align=\"right\" valign=\"top\" nowrap=\"nowrap\">"._MD_DESCRIPTIONC."</td><td>\n";
+            echo "<textarea name='description' cols=\"60\" rows=\"5\">$description</textarea>\n";
+            echo "</td></tr>\n";
+            echo "<tr><td align=\"right\" nowrap=\"nowrap\">"._MD_SHOTIMAGE."</td><td>\n";
+            //echo "<input type=\"text\" name=\"logourl\" size=\"50\" maxlength=\"60\">\n";
+            echo "<select size='1' name='logourl'>";
+            echo "<option value=' '>------</option>";
+            foreach($linkimg_array as $image){
+                echo "<option value='".$image."'>".$image."</option>";
+            }
+            echo "</select>";
+            echo "</td></tr><tr><td></td><td>";
+            $shotdir = "<b>".XOOPS_URL."/modules/mylinks/images/shots/</b>";
+            printf(_MD_SHOTMUST,$shotdir);
+            echo "</td></tr>\n";
+            echo "</table>\n";
+            echo "<br /><input type=\"hidden\" name=\"op\" value=\"approve\" />";
+            echo "<input type=\"hidden\" name=\"lid\" value=\"$lid\" />";
+            echo "<input type=\"submit\" value=\""._MD_APPROVE."\" /></form>\n";
+            echo myTextForm("index.php?op=delNewLink&amp;lid=$lid",_MD_DELETE);
+            echo "<br /><br />";
+        }
+    } else {
+        echo ""._MD_NOSUBMITTED."";
+    }
+    echo"</td></tr></table>";
+    xoops_cp_footer();
+}
+
+function linksConfigMenu()
+{
+    global $xoopsDB,$xoopsConfig, $myts, $eh, $mytree;
+    // Add a New Main Category
+    xoops_cp_header();
+    $linkimg_array = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH."/modules/mylinks/images/shots/");
+    echo "<h4>"._MD_WEBLINKSCONF."</h4>";
+    echo "<table width='100%' border='0' cellspacing='1' class='outer'>"
+    ."<tr class=\"odd\"><td>";
+    echo "<form method='post' action='index.php'>\n";
+        echo "<h4>"._MD_ADDMAIN."</h4><br />"._MD_TITLEC."<input type='text' name='title' size='30' maxlength='50' /><br />";
+    echo ""._MD_IMGURL."<br /><input type=\"text\" name=\"imgurl\" size=\"100\" maxlength=\"150\" value=\"http://\" /><br /><br />";
+    echo "<input type='hidden' name='cid' value='0' />\n";
+    echo "<input type='hidden' name='op' value='addCat' />";
+    echo "<input type='submit' value='"._MD_ADD."' /><br /></form>";
+    echo"</td></tr></table>";
+    echo "<br />";
+    // Add a New Sub-Category
+    $result=$xoopsDB->query("select count(*) from ".$xoopsDB->prefix("mylinks_cat")."");
+    list($numrows)=$xoopsDB->fetchRow($result);
+    if ( $numrows > 0 ) {
+    echo"<table width='100%' border='0' cellspacing='1' class='outer'>"
+    ."<tr class=\"odd\"><td>";
+        echo "<form method='post' action='index.php'>";
+        echo "<h4>"._MD_ADDSUB."</h4><br />"._MD_TITLEC."<input type='text' name='title' size='30' maxlength='50' />&nbsp;"._MD_IN."&nbsp;";
+        $mytree->makeMySelBox("title", "title");
+        #       echo "<br />"._MD_IMGURL."<br /><input type=\"text\" name=\"imgurl\" size=\"100\" maxlength=\"150\">\n";
+        echo "<input type='hidden' name='op' value='addCat' /><br /><br />";
+        echo "<input type='submit' value='"._MD_ADD."' /><br /></form>";
+        echo"</td></tr></table>";
+        echo "<br />";
+        // If there is a category, add a New Link
+
+    echo"<table width='100%' border='0' cellspacing='1' class='outer'>"
+    ."<tr class=\"odd\"><td>";
+        echo "<form method='post' action='index.php'>\n";
+        echo "<h4>"._MD_ADDNEWLINK."</h4><br />\n";
+        echo "<table width=\"80%\"><tr>\n";
+        echo "<td align=\"right\">"._MD_SITETITLE."</td><td>";
+        echo "<input type='text' name='title' size='50' maxlength='100' />";
+        echo "</td></tr><tr><td align='right' nowrap='nowrap'>"._MD_SITEURL."</td><td>";
+        echo "<input type='text' name='url' size='50' maxlength='250' value='http://' />";
+        echo "</td></tr>";
+        echo "<tr><td align=\"right\" nowrap=\"nowrap\">"._MD_CATEGORYC."</td><td>";
+        $mytree->makeMySelBox("title", "title");
+        echo "<tr><td align=\"right\" valign=\"top\" nowrap=\"nowrap\">"._MD_DESCRIPTIONC."</td><td>\n";
+        xoopsCodeTarea("description",60,8);
+        xoopsSmilies("description");
+        //echo "<textarea name=description cols=60 rows=5></textarea>\n";
+        echo "</td></tr>\n";
+        echo "<tr><td align=\"right\" nowrap=\"nowrap\">"._MD_SHOTIMAGE."</td><td>\n";
+        //echo "<input type=\"text\" name=\"logourl\" size=\"50\" maxlength=\"60\">";
+        echo "<select size='1' name='logourl'>";
+        echo "<option value=' '>------</option>";
+        foreach($linkimg_array as $image){
+            echo "<option value='".$image."'>".$image."</option>";
+        }
+        echo "</select>";
+        echo "</td></tr>\n";
+        $shotdir = "<b>".XOOPS_URL."/modules/mylinks/images/shots/</b>";
+        echo "<tr><td></td><td>";
+        printf(_MD_SHOTMUST,$shotdir);
+        echo "</td></tr>\n";
+        echo "</table>\n<br />";
+        echo  "<input type=\"hidden\" name=\"op\" value=\"addLink\"></input>";
+        echo "<input type=\"submit\" class=\"button\" value=\""._MD_ADD."\"></input>\n";
+        echo "</form>";
+        echo"</td></tr></table>";
+        echo "<br />";
+
+        // Modify Category
+    echo"<table width='100%' border='0' cellspacing='1' class='outer'>"
+    ."<tr class=\"odd\"><td>";
+        echo "
+        </center><form method='post' action='index.php'>
+        <h4>"._MD_MODCAT."</h4><br />";
+        echo _MD_CATEGORYC;
+        $mytree->makeMySelBox("title", "title");
+        echo "<br /><br />\n";
+        echo "<input type='hidden' name='op' value='modCat' />\n";
+        echo "<input type='submit' value='"._MD_MODIFY."' />\n";
+        echo "</form>";
+        echo"</td></tr></table>";
+        echo "<br />";
+    }
+    // Modify Link
+    $result2 = $xoopsDB->query("select count(*) from ".$xoopsDB->prefix("mylinks_links")."");
+    list($numrows2) = $xoopsDB->fetchRow($result2);
+    if ( $numrows2 > 0 ) {
+    echo"<table width='100%' border='0' cellspacing='1' class='outer'>"
+    ."<tr class=\"odd\"><td>";
+        echo "<form method='get' action=\"index.php\">\n";
+        echo "<h4>"._MD_MODLINK."</h4><br />\n";
+        echo _MD_LINKID."<input type='text' name='lid' size='12' maxlength='11' />\n";
+        echo "<input type='hidden' name='fct' value='mylinks' />\n";
+        echo "<input type='hidden' name='op' value='modLink' /><br /><br />\n";
+        echo "<input type='submit' value='"._MD_MODIFY."' /></form>\n";
+        echo"</td></tr></table>";
+    }
+    xoops_cp_footer();
+}
+
+function modLink()
+{
+    global $xoopsDB, $myts, $eh, $mytree, $xoopsConfig;
+    $linkimg_array = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH."/modules/mylinks/images/shots/");
+    $lid = $_GET['lid'];
+    xoops_cp_header();
+    echo "<h4>"._MD_WEBLINKSCONF."</h4>";
+    echo"<table width='100%' border='0' cellspacing='1' class='outer'>"
+    ."<tr class=\"odd\"><td>";
+    $result = $xoopsDB->query("select cid, title, url, logourl from ".$xoopsDB->prefix("mylinks_links")." where lid=$lid") or $eh->show("0013");
+    echo "<h4>"._MD_MODLINK."</h4><br />";
+    list($cid, $title, $url, $logourl) = $xoopsDB->fetchRow($result);
+    $title = $myts->makeTboxData4Edit($title);
+    $url = $myts->makeTboxData4Edit($url);
+    //      $url = urldecode($url);
+    $logourl = $myts->makeTboxData4Edit($logourl);
+    //      $logourl = urldecode($logourl);
+    $result2 = $xoopsDB->query("select description from ".$xoopsDB->prefix("mylinks_text")." where lid=$lid");
+    list($description)=$xoopsDB->fetchRow($result2);
+    $GLOBALS['description'] = $myts->makeTareaData4Edit($description);
+    echo "<table>";
+    echo "<form method='post' action='index.php'>";
+    echo "<tr><td>"._MD_LINKID."</td><td><b>$lid</b></td></tr>";
+    echo "<tr><td>"._MD_SITETITLE."</td><td><input type='text' name='title' value=\"$title\" size='50' maxlength='100' /></td></tr>\n";
+    echo "<tr><td>"._MD_SITEURL."</td><td><input type='text' name='url' value=\"$url\" size='50' maxlength='250' /></td></tr>\n";
+    echo "<tr><td valign=\"top\">"._MD_DESCRIPTIONC."</td><td>";
+    xoopsCodeTarea("description",60,8);
+    xoopsSmilies("description");
+    //echo "<textarea name=description cols=60 rows=5>$description</textarea>";
+    echo "</td></tr>";
+    echo "<tr><td>"._MD_CATEGORYC."</td><td>";
+    $mytree->makeMySelBox("title", "title", $cid);
+    echo "</td></tr>\n";
+    echo "<tr><td>"._MD_SHOTIMAGE."</td><td>";
+    //echo "<input type=text name=logourl value=\"$logourl\" size=\"50\" maxlength=\"60\"></input>
+    echo "<select size='1' name='logourl'>";
+    echo "<option value=' '>------</option>";
+    foreach($linkimg_array as $image){
+        if ( $image == $logourl ) {
+            $opt_selected = "selected='selected'";
+        }else{
+            $opt_selected = "";
+        }
+        echo "<option value='".$image."' $opt_selected>".$image."</option>";
+    }
+    echo "</select>";
+    echo "</td></tr>\n";
+    $shotdir = "<b>".XOOPS_URL."/modules/mylinks/images/shots/</b>";
+    echo "<tr><td></td><td>";
+    printf(_MD_SHOTMUST,$shotdir);
+    echo "</td></tr>\n";
+    echo "</table>";
+    echo "<br /><br /><input type='hidden' name='lid' value='$lid' />\n";
+    echo "<input type='hidden' name='op' value='modLinkS' /><input type='submit' value='"._MD_MODIFY."' />";
+
+
+    echo "</form>\n";
+
+    echo "<table><tr><td>\n";
+    echo myTextForm("index.php?op=delLink&amp;lid=".$lid , _MD_DELETE);
+    echo "</td><td>\n";
+    echo myTextForm("index.php?op=linksConfigMenu", _MD_CANCEL);
+    echo "</td></tr></table>\n";
+    echo "<hr />";
+
+    $result5=$xoopsDB->query("SELECT count(*) FROM ".$xoopsDB->prefix("mylinks_votedata")." WHERE lid = $lid");
+    list($totalvotes) = $xoopsDB->fetchRow($result5);
+    echo "<table width='100%'>\n";
+    echo "<tr><td colspan='7'><b>";
+    printf(_MD_TOTALVOTES,$totalvotes);
+    echo "</b><br /><br /></td></tr>\n";
+    // Show Registered Users Votes
+    $result5=$xoopsDB->query("SELECT ratingid, ratinguser, rating, ratinghostname, ratingtimestamp FROM ".$xoopsDB->prefix("mylinks_votedata")." WHERE lid = $lid AND ratinguser >0 ORDER BY ratingtimestamp DESC");
+    $votes = $xoopsDB->getRowsNum($result5);
+    echo "<tr><td colspan='7'><br /><br /><b>";
+    printf(_MD_USERTOTALVOTES,$votes);
+    echo "</b><br /><br /></td></tr>\n";
+    echo "<tr><td><b>" ._MD_USER."  </b></td><td><b>" ._MD_IP."  </b></td><td><b>" ._MD_RATING."  </b></td><td><b>" ._MD_USERAVG."  </b></td><td><b>" ._MD_TOTALRATE."  </b></td><td><b>" ._MD_DATE."  </b></td><td align=\"center\"><b>" ._MD_DELETE."</b></td></tr>\n";
+    if ($votes == 0){
+        echo "<tr><td align=\"center\" colspan=\"7\">" ._MD_NOREGVOTES."<br /></td></tr>\n";
+    }
+    $x=0;
+    $colorswitch="dddddd";
+    while(list($ratingid, $ratinguser, $rating, $ratinghostname, $ratingtimestamp)=$xoopsDB->fetchRow($result5)) {
+        //  $ratingtimestamp = formatTimestamp($ratingtimestamp);
+        //Individual user information
+        $result2=$xoopsDB->query("SELECT rating FROM ".$xoopsDB->prefix("mylinks_votedata")." WHERE ratinguser = '$ratinguser'");
+        $uservotes = $xoopsDB->getRowsNum($result2);
+        $useravgrating = 0;
+        while ( list($rating2) = $xoopsDB->fetchRow($result2) ) {
+            $useravgrating = $useravgrating + $rating2;
+        }
+        $useravgrating = $useravgrating / $uservotes;
+        $useravgrating = number_format($useravgrating, 1);
+        $ratingusername = XoopsUser::getUnameFromId($ratinguser);
+        echo "<tr><td bgcolor=\"".$colorswitch."\">".$ratingusername."</td><td bgcolor=\"$colorswitch\">".$ratinghostname."</td><td bgcolor=\"$colorswitch\">$rating</td><td bgcolor=\"$colorswitch\">".$useravgrating."</td><td bgcolor=\"$colorswitch\">".$uservotes."</td><td bgcolor=\"$colorswitch\">".$ratingtimestamp."</td><td bgcolor=\"$colorswitch\" align=\"center\"><b>".myTextForm("index.php?op=delVote&amp;lid=$lid&amp;rid=$ratingid", "X")."</b></td></tr>\n";
+        $x++;
+        if ( $colorswitch == "dddddd" ) {
+            $colorswitch="ffffff";
+        } else {
+            $colorswitch="dddddd";
+        }
+    }
+    // Show Unregistered Users Votes
+    $result5=$xoopsDB->query("SELECT ratingid, rating, ratinghostname, ratingtimestamp FROM ".$xoopsDB->prefix("mylinks_votedata")." WHERE lid = $lid AND ratinguser = 0 ORDER BY ratingtimestamp DESC");
+    $votes = $xoopsDB->getRowsNum($result5);
+    echo "<tr><td colspan='7'><b><br /><br />";
+    printf(_MD_ANONTOTALVOTES,$votes);
+    echo "</b><br /><br /></td></tr>\n";
+    echo "<tr><td colspan='2'><b>" ._MD_IP."  </b></td><td colspan='3'><b>" ._MD_RATING."  </b></td><td><b>" ._MD_DATE."  </b></b></td><td align=\"center\"><b>" ._MD_DELETE."</b></td><br /></tr>";
+    if ( $votes == 0 ) {
+        echo "<tr><td colspan=\"7\" align=\"center\">" ._MD_NOUNREGVOTES."<br /></td></tr>";
+    }
+    $x=0;
+    $colorswitch="dddddd";
+    while ( list($ratingid, $rating, $ratinghostname, $ratingtimestamp)=$xoopsDB->fetchRow($result5) ) {
+        $formatted_date = formatTimestamp($ratingtimestamp);
+        echo "<td colspan=\"2\" bgcolor=\"$colorswitch\">$ratinghostname</td><td colspan=\"3\" bgcolor=\"$colorswitch\">$rating</td><td bgcolor=\"$colorswitch\">$formatted_date</td><td bgcolor=\"$colorswitch\" aling=\"center\"><b>".myTextForm("index.php?op=delVote&amp;lid=$lid&amp;rid=$ratingid", "X")."</b></td></tr>";
+        $x++;
+        if ( $colorswitch == "dddddd" ) {
+            $colorswitch="ffffff";
+        } else {
+            $colorswitch="dddddd";
+        }
+    }
+    echo "<tr><td colspan=\"6\">&nbsp;<br /></td></tr>\n";
+    echo "</table>\n";
+    echo"</td></tr></table>";
+    xoops_cp_footer();
+}
+
+function delVote()
+{
+    global $xoopsDB, $eh;
+    $rid = $_GET['rid'];
+    $lid = $_GET['lid'];
+    $sql = sprintf("DELETE FROM %s WHERE ratingid = %u", $xoopsDB->prefix("mylinks_votedata"), $rid);
+    $xoopsDB->query($sql) or $eh->show("0013");
+    updaterating($lid);
+    redirect_header("index.php",1,_MD_VOTEDELETED);
+    exit();
+}
+
+function listBrokenLinks()
+{
+    global $xoopsDB, $eh;
+    $result = $xoopsDB->query("select * from ".$xoopsDB->prefix("mylinks_broken")." group by lid order by reportid DESC");
+    $totalbrokenlinks = $xoopsDB->getRowsNum($result);
+    xoops_cp_header();
+    echo "<h4>"._MD_WEBLINKSCONF."</h4>";
+    echo"<table width='100%' border='0' cellspacing='1' class='outer'>"
+    ."<tr class=\"odd\"><td>";
+    echo "<h4>"._MD_BROKENREPORTS." ($totalbrokenlinks)</h4><br />";
+
+    if ( $totalbrokenlinks == 0 ) {
+        echo _MD_NOBROKEN;
+    } else {
+        echo "<center>
+        "._MD_IGNOREDESC."<br />
+        "._MD_DELETEDESC."</center><br /><br /><br />";
+        $colorswitch="dddddd";
+        echo "<table align=\"center\" width=\"90%\">";
+        echo "
+        <tr>
+        <td><b>Link Name</b></td>
+        <td><b>" ._MD_REPORTER."</b></td>
+        <td><b>" ._MD_LINKSUBMITTER."</b></td>
+        <td><b>" ._MD_IGNORE."</b></td>
+        <td><b>" ._EDIT."</b></td>
+        <td><b>" ._MD_DELETE."</b></td>
+        </tr>";
+        while ( list($reportid, $lid, $sender, $ip)=$xoopsDB->fetchRow($result) ) {
+            $result2 = $xoopsDB->query("select title, url, submitter from ".$xoopsDB->prefix("mylinks_links")." where lid=$lid");
+            if ( $sender != 0 ) {
+                $result3 = $xoopsDB->query("select uname, email from ".$xoopsDB->prefix("users")." where uid=$sender");
+                list($uname, $email)=$xoopsDB->fetchRow($result3);
+            }
+            list($title, $url, $ownerid)=$xoopsDB->fetchRow($result2);
+            //          $url=urldecode($url);
+            $result4 = $xoopsDB->query("select uname, email from ".$xoopsDB->prefix("users")." where uid='$ownerid'");
+            list($owner, $owneremail)=$xoopsDB->fetchRow($result4);
+            echo "<tr><td bgcolor=$colorswitch><a href=$url target='_blank'>$title</a></td>";
+            if ( $email=='' ) {
+                echo "<td bgcolor=\"".$colorswitch."\">".$sender." (".$ip.")";
+            } else {
+                echo "<td bgcolor=\"".$colorswitch."\"><a href=\"mailto:".$email."\">".$uname."</a> (".$ip.")";
+            }
+            echo "</td>";
+            if ( $owneremail == '' ) {
+                echo "<td bgcolor=\"".$colorswitch."\">".$owner."";
+            } else {
+                echo "<td bgcolor=\"".$colorswitch."\"><a href=\"mailto:".$owneremail."\">".$owner."</a>";
+            }
+
+            echo "</td><td bgcolor='$colorswitch' align='center'>\n";
+            echo myTextForm("index.php?op=ignoreBrokenLinks&amp;lid=$lid" , "X");
+            echo "</td><td bgcolor='$colorswitch' align='center'>\n";
+            echo myTextForm("index.php?op=modLink&amp;lid=$lid" , "X");
+            echo "</td><td align='center' bgcolor='$colorswitch'>\n";
+            echo myTextForm("index.php?op=delBrokenLinks&amp;lid=$lid" , "X");
+            echo "</td></tr>\n";
+
+            if ( $colorswitch == "#dddddd" ) {
+                $colorswitch="#ffffff";
+            } else {
+                $colorswitch="#dddddd";
+            }
+        }
+        echo "</table>";
+    }
+
+    echo"</td></tr></table>";
+    xoops_cp_footer();
+}
+
+function delBrokenLinks()
+{
+    global $xoopsDB, $eh;
+    $lid = $_GET['lid'];
+    $sql = sprintf("DELETE FROM %s WHERE lid = %u", $xoopsDB->prefix("mylinks_broken"), $lid);
+    $xoopsDB->query($sql) or $eh->show("0013");
+    $sql = sprintf("DELETE FROM %s WHERE lid = %u", $xoopsDB->prefix("mylinks_links"), $lid);
+    $xoopsDB->query($sql) or $eh->show("0013");
+    redirect_header("index.php",1,_MD_LINKDELETED);
+    exit();
+}
+
+function ignoreBrokenLinks()
+{
+    global $xoopsDB, $eh;
+    $sql = sprintf("DELETE FROM %s WHERE lid = %u", $xoopsDB->prefix("mylinks_broken"), $_GET['lid']);
+    $xoopsDB->query($sql) or $eh->show("0013");
+    redirect_header("index.php",1,_MD_BROKENDELETED);
+    exit();
+}
+
+function listModReq()
+{
+    global $xoopsDB, $myts, $eh, $mytree, $xoopsModuleConfig;
+    $result = $xoopsDB->query("select requestid,lid,cid,title,url,logourl,description,modifysubmitter from ".$xoopsDB->prefix("mylinks_mod")." order by requestid");
+    $totalmodrequests = $xoopsDB->getRowsNum($result);
+    xoops_cp_header();
+    echo "<h4>"._MD_WEBLINKSCONF."</h4>";
+    echo"<table width='100%' border='0' cellspacing='1' class='outer'>"
+    ."<tr class=\"odd\"><td>";
+    echo "<h4>"._MD_USERMODREQ." ($totalmodrequests)</h4><br />";
+    if ( $totalmodrequests > 0 ) {
+        echo "<table width='95%'><tr><td>";
+        $lookup_lid = array();
+        while ( list($requestid, $lid, $cid, $title, $url, $logourl, $description, $submitterid)=$xoopsDB->fetchRow($result) ) {
+            $lookup_lid[$requestid] = $lid;
+            $result2 = $xoopsDB->query("select cid, title, url, logourl, submitter from ".$xoopsDB->prefix("mylinks_links")." where lid=$lid");
+            list($origcid, $origtitle, $origurl, $origlogourl, $ownerid)=$xoopsDB->fetchRow($result2);
+            $result2 = $xoopsDB->query("select description from ".$xoopsDB->prefix("mylinks_text")." where lid=$lid");
+            list($origdescription) = $xoopsDB->fetchRow($result2);
+            $result7 = $xoopsDB->query("select uname, email from ".$xoopsDB->prefix("users")." where uid='$submitterid'");
+            $result8 = $xoopsDB->query("select uname, email from ".$xoopsDB->prefix("users")." where uid='$ownerid'");
+            $cidtitle=$mytree->getPathFromId($cid, "title");
+            $origcidtitle=$mytree->getPathFromId($origcid, "title");
+            list($submitter, $submitteremail)=$xoopsDB->fetchRow($result7);
+            list($owner, $owneremail)=$xoopsDB->fetchRow($result8);
+            $title = $myts->makeTboxData4Show($title);
+            $url = $myts->makeTboxData4Show($url);
+            //          $url = urldecode($url);
+
+            // use original image file to prevent users from changing screen shots file
+            $origlogourl = $myts->makeTboxData4Show($origlogourl);
+            $logourl = $origlogourl;
+
+            //          $logourl = urldecode($logourl);
+            $description = $myts->makeTareaData4Show($description, 0);
+            $origurl = $myts->makeTboxData4Show($origurl);
+            //          $origurl = urldecode($origurl);
+            //          $origlogourl = urldecode($origlogourl);
+            $origdescription = $myts->makeTareaData4Show($origdescription, 0);
+            if ( $owner == "" ) {
+                $owner="administration";
+            }
+            echo "<table border='1' bordercolor='black' cellpadding='5' cellspacing='0' align='center' width='450'><tr><td>
+            <table width='100%' bgcolor='#dddddd'>
+            <tr>
+            <td valign='top' width='45%'><b>"._MD_ORIGINAL."</b></td>
+            <td rowspan='14' valign='top' align='left'><small><br />"._MD_DESCRIPTIONC."<br />$origdescription</small></td>
+            </tr>
+            <tr><td valign='top' width='45%'><small>"._MD_SITETITLE."$origtitle</small></td></tr>
+            <tr><td valign='top' width='45%'><small>"._MD_SITEURL."".$origurl."</small></td></tr>
+            <tr><td valign='top' width='45%'><small>"._MD_CATEGORYC."$origcidtitle</small></td></tr>
+            <tr><td valign='top' width='45%'><small>"._MD_SHOTIMAGE."</small>";
+            if ( $xoopsModuleConfig['useshots'] && !empty($origlogourl) ) {
+                echo "<img src=\"".XOOPS_URL."/modules/mylinks/images/shots/".$origlogourl."\" width=\"".$xoopsModuleConfig['shotwidth']."\" />";
+            } else {
+                echo "&nbsp;";
+            }
+            echo "</td></tr>
+            </table></td></tr><tr><td>
+            <table width=100%>
+            <tr>
+            <td valign='top' width='45%'><b>"._MD_PROPOSED."</b></td>
+            <td rowspan='14' valign='top' align='left'><small><br />"._MD_DESCRIPTIONC."<br />$description</small></td>
+            </tr>
+            <tr><td valign='top' width='45%'><small>"._MD_SITETITLE."$title</small></td></tr>
+            <tr><td valign='top' width='45%'><small>"._MD_SITEURL."".$url."</small></td></tr>
+            <tr><td valign='top' width='45%'><small>"._MD_CATEGORYC."$cidtitle</small></td></tr>
+            <tr><td valign='top' width='45%'><small>"._MD_SHOTIMAGE."</small>";
+            if ( $xoopsModuleConfig['useshots'] == 1 && !empty($logourl) ) {
+                echo "<img src=\"".XOOPS_URL."/modules/mylinks/images/shots/".$logourl."\" width=\"".$xoopsModuleConfig['shotwidth']."\" alt=\"/\" />";
+            } else {
+                echo "&nbsp;";
+            }
+            echo "</td></tr>
+            </table></td></tr></table>
+            <table align='center' width='450'>
+            <tr>";
+            if ( $submitteremail == "" ) {
+                echo "<td align='left'><small>"._MD_SUBMITTER."$submitter</small></td>";
+            } else {
+                echo "<td align='left'><small>"._MD_SUBMITTER."<a href=mailto:".$submitteremail.">".$submitter."</a></small></td>";
+            }
+            if ( $owneremail == "" ) {
+                echo "<td align='center'><small>"._MD_OWNER."".$owner."</small></td>";
+            } else {
+                echo "<td align='center'><small>"._MD_OWNER."<a href=mailto:".$owneremail.">".$owner."</a></small></td>";
+            }
+            echo "<td align='right'><small>\n";
+            echo "<table><tr><td>\n";
+            echo myTextForm("index.php?op=changeModReq&amp;requestid=$requestid" , _MD_APPROVE);
+            echo "</td><td>\n";
+            echo myTextForm("index.php?op=modLink&amp;lid=$lookup_lid[$requestid]", _EDIT);
+            echo "</td><td>\n";
+            echo myTextForm("index.php?op=ignoreModReq&amp;requestid=$requestid", _MD_IGNORE);
+            echo "</td></tr></table>\n";
+            echo "</small></td></tr>\n";
+            echo "</table><br /><br />";
+        }
+        echo "</td></tr></table>";
+    } else {
+        echo _MD_NOMODREQ;
+    }
+    echo"</td></tr></table>";
+    xoops_cp_footer();
+}
+
+function changeModReq()
+{
+    global $xoopsDB, $eh, $myts;
+    $requestid = $_GET['requestid'];
+    $query = "select lid, cid, title, url, logourl, description from ".$xoopsDB->prefix("mylinks_mod")." where requestid=".$requestid."";
+    $result = $xoopsDB->query($query);
+    while ( list($lid, $cid, $title, $url, $logourl, $description)=$xoopsDB->fetchRow($result) ) {
+        if ( get_magic_quotes_runtime() ) {
+            $title = stripslashes($title);
+            $url = stripslashes($url);
+            $logourl = stripslashes($logourl);
+            $description = stripslashes($description);
+        }
+        $title = addslashes($title);
+        $url = addslashes($url);
+        $logourl = addslashes($logourl);
+        $description = addslashes($description);
+        $sql= sprintf("UPDATE %s SET cid = %u, title = '%s', url = '%s', logourl = '%s', status = 2, date = %u WHERE lid = %u", $xoopsDB->prefix("mylinks_links"), $cid, $title, $url, $logourl, time(), $lid);
+        $xoopsDB->query($sql) or $eh->show("0013");
+        $sql = sprintf("UPDATE %s SET description = '%s' WHERE lid = %u", $xoopsDB->prefix("mylinks_text"), $description, $lid);
+        $xoopsDB->query($sql) or $eh->show("0013");
+        $sql = sprintf("DELETE FROM %s WHERE requestid = %u", $xoopsDB->prefix("mylinks_mod"), $requestid);
+        $xoopsDB->query($sql) or $eh->show("0013");
+    }
+    redirect_header("index.php",1,_MD_DBUPDATED);
+    exit();
+}
+
+function ignoreModReq()
+{
+    global $xoopsDB, $eh;
+    $sql = sprintf("DELETE FROM %s WHERE requestid = %u", $xoopsDB->prefix("mylinks_mod"), $_GET['requestid']);
+    $xoopsDB->query($sql) or $eh->show("0013");
+    redirect_header("index.php",1,_MD_MODREQDELETED);
+    exit();
+}
+
+function modLinkS()
+{
+    global $xoopsDB, $myts, $eh;
+    $cid = $_POST["cid"];
+    if ( ($_POST["url"]) || ($_POST["url"]!="") ) {
+        //      $url = $myts->formatURL($_POST["url"]);
+        //      $url = urlencode($url);
+        $url = $myts->makeTboxData4Save($_POST["url"]);
+    }
+    $logourl = $myts->makeTboxData4Save($_POST["logourl"]);
+    $title = $myts->makeTboxData4Save($_POST["title"]);
+
+    $description = $myts->makeTareaData4Save($_POST["description"]);
+    $xoopsDB->query("update ".$xoopsDB->prefix("mylinks_links")." set cid='$cid', title='$title', url='$url', logourl='$logourl', status=2, date=".time()." where lid=".$_POST['lid']."")  or $eh->show("0013");
+    $xoopsDB->query("update ".$xoopsDB->prefix("mylinks_text")." set description='$description' where lid=".$_POST['lid']."")  or $eh->show("0013");
+    redirect_header("index.php",1,_MD_DBUPDATED);
+    exit();
+}
+
+function delLink()
+{
+    global $xoopsDB, $eh, $xoopsModule;
+    $sql = sprintf("DELETE FROM %s WHERE lid = %u", $xoopsDB->prefix("mylinks_links"), $_GET['lid']);
+    $xoopsDB->query($sql) or $eh->show("0013");
+    $sql = sprintf("DELETE FROM %s WHERE lid = %u", $xoopsDB->prefix("mylinks_text"), $_GET['lid']);
+    $xoopsDB->query($sql) or $eh->show("0013");
+    $sql = sprintf("DELETE FROM %s WHERE lid = %u", $xoopsDB->prefix("mylinks_votedata"), $_GET['lid']);
+    $xoopsDB->query($sql) or $eh->show("0013");
+    // delete comments
+    xoops_comment_delete($xoopsModule->getVar('mid'), $_GET['lid']);
+    // delete notifications
+    xoops_notification_deletebyitem ($xoopsModule->getVar('mid'), 'link', $_GET['lid']);
+
+    redirect_header("index.php",1,_MD_LINKDELETED);
+    exit();
+}
+
+function modCat()
+{
+    global $xoopsDB, $myts, $eh, $mytree;
+    $cid = $_POST["cid"];
+    xoops_cp_header();
+    echo "<h4>"._MD_WEBLINKSCONF."</h4>";
+    echo"<table width='100%' border='0' cellspacing='1' class='outer'>"
+    ."<tr class=\"odd\"><td>";
+    echo "<h4>"._MD_MODCAT."</h4><br />";
+    $result=$xoopsDB->query("select pid, title, imgurl from ".$xoopsDB->prefix("mylinks_cat")." where cid=$cid");
+    list($pid,$title,$imgurl) = $xoopsDB->fetchRow($result);
+    $title = $myts->makeTboxData4Edit($title);
+    $imgurl = $myts->makeTboxData4Edit($imgurl);
+    echo "<form action='index.php' method='post'>"._MD_TITLEC."<input type='text' name='title' value='$title' size='51' maxlength='50' /><br /><br />"._MD_IMGURLMAIN."<br /><input type='text' name='imgurl' value='$imgurl' size='100' maxlength='150' /><br /><br />";
+    echo _MD_PARENT."&nbsp;";
+    $mytree->makeMySelBox("title", "title", $pid, 1, "pid");
+    //  <input type=hidden name=pid value=\"$pid\">
+    echo "<br /><input type='hidden' name='cid' value='".$cid."' />
+    <input type=\"hidden\" name=\"op\" value=\"modCatS\" /><br />
+    <input type=\"submit\" value=\""._MD_SAVE."\" />
+    <input type=\"button\" value=\""._MD_DELETE."\" onClick=\"location='index.php?pid=$pid&amp;cid=$cid&amp;op=delCat'\" />";
+    echo "&nbsp;<input type=\"button\" value=\""._MD_CANCEL."\" onclick=\"javascript:history.go(-1)\ /\" />";
+    echo "</form>";
+    echo"</td></tr></table>";
+    xoops_cp_footer();
+}
+
+function modCatS()
+{
+    global $xoopsDB, $myts, $eh;
+    $cid =  $_POST['cid'];
+    $pid =  $_POST['pid'];
+    $title =  $myts->makeTboxData4Save($_POST['title']);
+    if (empty($title)) {
+        redirect_header("index.php", 2, _MD_ERRORTITLE);
+    }
+    if ( ($_POST["imgurl"]) || ($_POST["imgurl"]!="") ) {
+        $imgurl = $myts->makeTboxData4Save($_POST["imgurl"]);
+    }
+    $xoopsDB->query("update ".$xoopsDB->prefix("mylinks_cat")." set pid=$pid, title='$title', imgurl='$imgurl' where cid=$cid") or $eh->show("0013");
+    redirect_header("index.php",1,_MD_DBUPDATED);
+}
+
+function delCat()
+{
+    global $xoopsDB, $eh, $mytree, $xoopsModule;
+    $cid =  isset($_POST['cid']) ? intval($_POST['cid']) : intval($_GET['cid']);
+    $ok =  isset($_POST['ok']) ? intval($_POST['ok']) : 0;
+    if ( $ok == 1 ) {
+        //get all subcategories under the specified category
+        $arr=$mytree->getAllChildId($cid);
+        $dcount=count($arr);
+        for ( $i=0;$i<$dcount;$i++ ) {
+            //get all links in each subcategory
+            $result=$xoopsDB->query("select lid from ".$xoopsDB->prefix("mylinks_links")." where cid=".$arr[$i]."") or $eh->show("0013");
+            //now for each link, delete the text data and vote ata associated with the link
+            while ( list($lid)=$xoopsDB->fetchRow($result) ) {
+                $sql = sprintf("DELETE FROM %s WHERE lid = %u", $xoopsDB->prefix("mylinks_text"), $lid);
+                $xoopsDB->query($sql) or $eh->show("0013");
+                $sql = sprintf("DELETE FROM %s WHERE lid = %u", $xoopsDB->prefix("mylinks_votedata"), $lid);
+                $xoopsDB->query($sql) or $eh->show("0013");
+                $sql = sprintf("DELETE FROM %s WHERE lid = %u", $xoopsDB->prefix("mylinks_links"), $lid);
+                $xoopsDB->query($sql) or $eh->show("0013");
+                xoops_comment_delete($xoopsModule->getVar('mid'), $lid);
+                xoops_notification_deletebyitem($xoopsModule->getVar('mid'), 'link', $lid);
+            }
+            xoops_notification_deletebyitem($xoopsModule->getVar('mid'), 'category', $arr[$i]);
+
+            //all links for each subcategory is deleted, now delete the subcategory data
+            $sql = sprintf("DELETE FROM %s WHERE cid = %u", $xoopsDB->prefix("mylinks_cat"), $arr[$i]);
+            $xoopsDB->query($sql) or $eh->show("0013");
+        }
+        //all subcategory and associated data are deleted, now delete category data and its associated data
+        $result=$xoopsDB->query("select lid from ".$xoopsDB->prefix("mylinks_links")." where cid=".$cid."") or $eh->show("0013");
+        while ( list($lid)=$xoopsDB->fetchRow($result) ) {
+            $sql = sprintf("DELETE FROM %s WHERE lid = %u", $xoopsDB->prefix("mylinks_links"), $lid);
+            $xoopsDB->query($sql) or $eh->show("0013");
+            $sql = sprintf("DELETE FROM %s WHERE lid = %u", $xoopsDB->prefix("mylinks_text"), $lid);
+            $xoopsDB->query($sql) or $eh->show("0013");
+            $sql = sprintf("DELETE FROM %s WHERE lid = %u", $xoopsDB->prefix("mylinks_votedata"), $lid);
+            $xoopsDB->query($sql) or $eh->show("0013");
+            // delete comments
+            xoops_comment_delete($xoopsModule->getVar('mid'), $lid);
+            // delete notifications
+            xoops_notification_deletebyitem($xoopsModule->getVar('mid'), 'link', $lid);
+        }
+        $sql = sprintf("DELETE FROM %s WHERE cid = %u", $xoopsDB->prefix("mylinks_cat"), $cid);
+        $xoopsDB->query($sql) or $eh->show("0013");
+        xoops_notification_deletebyitem($xoopsModule->getVar('mid'), 'category', $cid);
+        redirect_header("index.php",1,_MD_CATDELETED);
+        exit();
+    } else {
+        xoops_cp_header();
+        xoops_confirm(array('op' => 'delCat', 'cid' => $cid, 'ok' => 1), 'index.php', _MD_WARNING);
+        xoops_cp_footer();
+    }
+}
+
+function delNewLink()
+{
+    global $xoopsDB, $eh, $xoopsModule;
+    $sql = sprintf("DELETE FROM %s WHERE lid = %u", $xoopsDB->prefix("mylinks_links"), $_GET['lid']);
+    $xoopsDB->query($sql) or $eh->show("0013");
+    $sql = sprintf("DELETE FROM %s WHERE lid = %u", $xoopsDB->prefix("mylinks_text"), $_GET['lid']);
+    $xoopsDB->query($sql) or $eh->show("0013");
+    // delete comments
+    xoops_comment_delete($xoopsModule->getVar('mid'), $_GET['lid']);
+    // delete notifications
+    xoops_notification_deletebyitem($xoopsModule->getVar('mid'), 'link', $_GET['lid']);
+    redirect_header("index.php",1,_MD_LINKDELETED);
+}
+
+function addCat()
+{
+    global $xoopsDB, $myts, $eh;
+    $pid = $_POST["cid"];
+    $title = $myts->makeTboxData4Save($_POST["title"]);
+    if (empty($title)) {
+        redirect_header("index.php",2,_MD_ERRORTITLE);
+        exit();
+    }
+    if ( ($_POST["imgurl"]) || ($_POST["imgurl"]!="") ) {
+        //      $imgurl = $myts->formatURL($_POST["imgurl"]);
+        //      $imgurl = urlencode($imgurl);
+        $imgurl = $myts->makeTboxData4Save($_POST["imgurl"]);
+    }
+    $newid = $xoopsDB->genId($xoopsDB->prefix("mylinks_cat")."_cid_seq");
+    $sql = sprintf("INSERT INTO %s (cid, pid, title, imgurl) VALUES (%u, %u, '%s', '%s')", $xoopsDB->prefix("mylinks_cat"), $newid, $pid, $title, $imgurl);
+    $xoopsDB->query($sql) or $eh->show("0013");
+    if ($newid == 0) {
+        $newid = $xoopsDB->getInsertId();
+    }
+    global $xoopsModule;
+    $tags = array();
+    $tags['CATEGORY_NAME'] = $title;
+    $tags['CATEGORY_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewcat.php?cid=' . $newid;
+    $notification_handler =& xoops_gethandler('notification');
+    $notification_handler->triggerEvent('global', 0, 'new_category', $tags);
+    redirect_header("index.php",1,_MD_NEWCATADDED);
+}
+
+function addLink()
+{
+    global $xoopsConfig, $xoopsDB, $myts, $xoopsUser, $xoopsModule, $eh, $_POST;
+    if ( ($_POST["url"]) || ($_POST["url"]!="") ) {
+        //  $url=$myts->formatURL($_POST["url"]);
+        //      $url = urlencode($url);
+        $url = $myts->makeTboxData4Save($_POST["url"]);
+    }
+    $logourl = $myts->makeTboxData4Save($_POST["logourl"]);
+    $title = $myts->makeTboxData4Save($_POST["title"]);
+    $description = $myts->makeTareaData4Save($_POST["description"]);
+    $submitter = $xoopsUser->uid();
+    $result = $xoopsDB->query("select count(*) from ".$xoopsDB->prefix("mylinks_links")." where url='$url'");
+    list($numrows) = $xoopsDB->fetchRow($result);
+    $errormsg = "";
+    $error = 0;
+    if ( $numrows > 0 ) {
+        $errormsg .= "<h4 style='color: #ff0000'>";
+        $errormsg .= _MD_ERROREXIST."</h4>";
+        $error = 1;
+    }
+    // Check if Title exist
+    if ( $title == "" ) {
+        $errormsg .= "<h4 style='color: #ff0000'>";
+        $errormsg .= _MD_ERRORTITLE."</h4>";
+        $error =1;
+    }
+
+    // Check if Description exist
+    if ( $description == "" ) {
+        $errormsg .= "<h4 style='color: #ff0000'>";
+        $errormsg .= _MD_ERRORDESC."</h4>";
+        $error =1;
+    }
+    if ( $error == 1 ) {
+        xoops_cp_header();
+        echo $errormsg;
+        xoops_cp_footer();
+        exit();
+    }
+    if ( !empty($_POST['cid']) ) {
+        $cid = $_POST['cid'];
+    } else {
+        $cid = 0;
+    }
+    $newid = $xoopsDB->genId($xoopsDB->prefix("mylinks_links")."_lid_seq");
+    $sql = sprintf("INSERT INTO %s (lid, cid, title, url, logourl, submitter, status, date, hits, rating, votes, comments) VALUES (%u, %u, '%s', '%s', '%s', %u, %u, %u, %u, %u, %u, %u)", $xoopsDB->prefix("mylinks_links"), $newid, $cid, $title, $url, $logourl, $submitter, 1, time(), 0, 0, 0, 0);
+    $xoopsDB->query($sql) or $eh->show("0013");
+    if ( $newid == 0 ) {
+        $newid = $xoopsDB->getInsertId();
+    }
+    $sql = sprintf("INSERT INTO %s (lid, description) VALUES (%u, '%s')", $xoopsDB->prefix("mylinks_text"), $newid, $description);
+    $xoopsDB->query($sql) or $eh->show("0013");
+    $tags = array();
+    $tags['LINK_NAME'] = $title;
+    $tags['LINK_URL'] = XOOPS_URL . '/modules/'. $xoopsModule->getVar('dirname') . '/singlelink.php?cid=' . $cid . '&amp;lid=' . $newid;
+    $sql = "SELECT title FROM " . $xoopsDB->prefix("mylinks_cat") . " WHERE cid=" . $cid;
+    $result = $xoopsDB->query($sql);
+    $row = $xoopsDB->fetchArray($result);
+    $tags['CATEGORY_NAME'] = $row['title'];
+    $tags['CATEGORY_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewcat.php?cid=' . $cid;
+    $notification_handler =& xoops_gethandler('notification');
+    $notification_handler->triggerEvent('global', 0, 'new_link', $tags);
+    $notification_handler->triggerEvent('category', $cid, 'new_link', $tags);
+    redirect_header("index.php?op=linksConfigMenu",1,_MD_NEWLINKADDED);
+}
+
+function approve()
+{
+    global $xoopsConfig, $xoopsDB, $myts, $eh;
+    $lid = $_POST['lid'];
+    $title = $_POST['title'];
+    $cid = $_POST['cid'];
+    if ( empty($cid) ) {
+        $cid = 0;
+    }
+    $description = $_POST['description'];
+    if (($_POST["url"]) || ($_POST["url"]!="")) {
+        //      $url=$myts->formatURL($_POST["url"]);
+        //      $url = urlencode($url);
+        $url = $myts->makeTboxData4Save($_POST["url"]);
+    }
+    $logourl = $myts->makeTboxData4Save($_POST["logourl"]);
+    $title = $myts->makeTboxData4Save($title);
+    $description = $myts->makeTareaData4Save($description);
+    $query = "update ".$xoopsDB->prefix("mylinks_links")." set cid='$cid', title='$title', url='$url', logourl='$logourl', status=1, date=".time()." where lid=".$lid."";
+    $xoopsDB->query($query) or $eh->show("0013");
+    $query = "update ".$xoopsDB->prefix("mylinks_text")." set description='$description' where lid=".$lid."";
+    $xoopsDB->query($query) or $eh->show("0013");
+    global $xoopsModule;
+    $tags=array();
+    $tags['LINK_NAME'] = $title;
+    $tags['LINK_URL'] = XOOPS_URL . '/modules/'. $xoopsModule->getVar('dirname') . '/singlelink.php?cid=' . $cid . '&amp;lid=' . $lid;
+    $sql = "SELECT title FROM " . $xoopsDB->prefix("mylinks_cat") . " WHERE cid=" . $cid;
+    $result = $xoopsDB->query($sql);
+    $row = $xoopsDB->fetchArray($result);
+    $tags['CATEGORY_NAME'] = $row['title'];
+    $tags['CATEGORY_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewcat.php?cid=' . $cid;
+    $notification_handler =& xoops_gethandler('notification');
+    $notification_handler->triggerEvent('global', 0, 'new_link', $tags);
+    $notification_handler->triggerEvent('category', $cid, 'new_link', $tags);
+    $notification_handler->triggerEvent('link', $lid, 'approve', $tags);
+    redirect_header("index.php",1,_MD_NEWLINKADDED);
+}
+if(!isset($_POST['op'])) {
+    $op = isset($_GET['op']) ? $_GET['op'] : 'main';
+} else {
+    $op = $_POST['op'];
+}
+switch ($op) {
+case "delNewLink":
+    delNewLink();
+    break;
+case "approve":
+    approve();
+    break;
+case "addCat":
+    addCat();
+    break;
+case "addLink":
+    addLink();
+    break;
+case "listBrokenLinks":
+    listBrokenLinks();
+    break;
+case "delBrokenLinks":
+    delBrokenLinks();
+    break;
+case "ignoreBrokenLinks":
+    ignoreBrokenLinks();
+    break;
+case "listModReq":
+    listModReq();
+    break;
+case "changeModReq":
+    changeModReq();
+    break;
+case "ignoreModReq":
+    ignoreModReq();
+    break;
+case "delCat":
+    delCat();
+    break;
+case "modCat":
+    modCat();
+    break;
+case "modCatS":
+    modCatS();
+    break;
+case "modLink":
+    modLink();
+    break;
+case "modLinkS":
+    modLinkS();
+    break;
+case "delLink":
+    delLink();
+    break;
+case "delVote":
+    delVote();
+    break;
+case "linksConfigMenu":
+    linksConfigMenu();
+    break;
+case "listNewLinks":
+    listNewLinks();
+    break;
+case 'main':
+default:
+    mylinks();
+    break;
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/viewcat.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/viewcat.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/viewcat.php	(revision 405)
@@ -0,0 +1,173 @@
+<?php
+// $Id: viewcat.php,v 1.6 2006/05/01 02:37:28 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+// ------------------------------------------------------------------------- //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+include "header.php";
+$myts =& MyTextSanitizer::getInstance(); // MyTextSanitizer object
+include_once XOOPS_ROOT_PATH."/class/xoopstree.php";
+$mytree = new XoopsTree($xoopsDB->prefix("mylinks_cat"),"cid","pid");
+
+$cid = intval($_GET['cid']);
+$xoopsOption['template_main'] = 'mylinks_viewcat.html';
+include XOOPS_ROOT_PATH."/header.php";
+
+if (isset($_GET['show'])) {
+        $show = intval($_GET['show']);
+} else {
+        $show = $xoopsModuleConfig['perpage'];
+}
+$min = isset($_GET['min']) ? intval($_GET['min']) : 0;
+if (!isset($max)) {
+        $max = $min + $show;
+}
+if(isset($_GET['orderby'])) {
+        $orderby = convertorderbyin($_GET['orderby']);
+} else {
+        $orderby = "title ASC";
+}
+
+$pathstring = "<a href='index.php'>"._MD_MAIN."</a>&nbsp;:&nbsp;";
+$pathstring .= $mytree->getNicePathFromId($cid, "title", "viewcat.php?op=");
+$xoopsTpl->assign('category_path', $pathstring);
+$xoopsTpl->assign('category_id', $cid);
+// get child category objects
+$arr=array();
+$arr=$mytree->getFirstChild($cid, "title");
+if ( count($arr) > 0 ) {
+    $scount = 1;
+    foreach($arr as $ele){
+        $sub_arr=array();
+        $sub_arr=$mytree->getFirstChild($ele['cid'], "title");
+        $space = 0;
+        $chcount = 0;
+        $infercategories = "";
+        foreach($sub_arr as $sub_ele){
+            $chtitle=$myts->makeTboxData4Show($sub_ele['title']);
+            if ($chcount>5){
+                $infercategories .= "...";
+                break;
+            }
+            if ($space>0) {
+                $infercategories .= ", ";
+            }
+            $infercategories .= "<a href=\"".XOOPS_URL."/modules/mylinks/viewcat.php?cid=".$sub_ele['cid']."\">".$chtitle."</a>";
+            $space++;
+            $chcount++;
+        }
+        $xoopsTpl->append('subcategories', array('title' => $myts->makeTboxData4Show($ele['title']), 'id' => $ele['cid'], 'infercategories' => $infercategories, 'totallinks' => getTotalItems($ele['cid'], 1), 'count' => $scount));
+        $scount++;
+    }
+}
+
+if ($xoopsModuleConfig['useshots'] == 1) {
+    $xoopsTpl->assign('shotwidth', $xoopsModuleConfig['shotwidth']);
+    $xoopsTpl->assign('tablewidth', $xoopsModuleConfig['shotwidth'] + 10);
+    $xoopsTpl->assign('show_screenshot', true);
+    $xoopsTpl->assign('lang_noscreenshot', _MD_NOSHOTS);
+}
+
+if (!empty($xoopsUser) && $xoopsUser->isAdmin($xoopsModule->mid())) {
+    $isadmin = true;
+} else {
+    $isadmin = false;
+}
+$fullcountresult=$xoopsDB->query("select count(*) from ".$xoopsDB->prefix("mylinks_links")." where cid=$cid and status>0");
+list($numrows) = $xoopsDB->fetchRow($fullcountresult);
+$page_nav = '';
+if($numrows>0){
+    $xoopsTpl->assign('lang_description', _MD_DESCRIPTIONC);
+    $xoopsTpl->assign('lang_lastupdate', _MD_LASTUPDATEC);
+    $xoopsTpl->assign('lang_hits', _MD_HITSC);
+    $xoopsTpl->assign('lang_rating', _MD_RATINGC);
+    $xoopsTpl->assign('lang_ratethissite', _MD_RATETHISSITE);
+    $xoopsTpl->assign('lang_reportbroken', _MD_REPORTBROKEN);
+    $xoopsTpl->assign('lang_tellafriend', _MD_TELLAFRIEND);
+    $xoopsTpl->assign('lang_modify', _MD_MODIFY);
+    $xoopsTpl->assign('lang_category' , _MD_CATEGORYC);
+    $xoopsTpl->assign('lang_visit' , _MD_VISIT);
+    $xoopsTpl->assign('show_links', true);
+    $xoopsTpl->assign('lang_comments' , _COMMENTS);
+    $sql = "select l.lid, l.cid, l.title, l.url, l.logourl, l.status, l.date, l.hits, l.rating, l.votes, l.comments, t.description from ".$xoopsDB->prefix("mylinks_links")." l, ".$xoopsDB->prefix("mylinks_text")." t where cid=$cid and l.lid=t.lid and status>0 order by $orderby";
+    $result=$xoopsDB->query($sql,$show,$min);
+
+    //if 2 or more items in result, show the sort menu
+    if($numrows>1){
+        $xoopsTpl->assign('show_nav', true);
+        $orderbyTrans = convertorderbytrans($orderby);
+        $xoopsTpl->assign('lang_sortby', _MD_SORTBY);
+        $xoopsTpl->assign('lang_title', _MD_TITLE);
+        $xoopsTpl->assign('lang_date', _MD_DATE);
+        $xoopsTpl->assign('lang_rating', _MD_RATING);
+        $xoopsTpl->assign('lang_popularity', _MD_POPULARITY);
+        $xoopsTpl->assign('lang_cursortedby', sprintf(_MD_CURSORTEDBY, convertorderbytrans($orderby)));
+    }
+    while(list($lid, $cid,$ltitle, $url, $logourl, $status, $time, $hits, $rating, $votes, $comments, $description) = $xoopsDB->fetchRow($result)) {
+        if ($isadmin) {
+            $adminlink = '<a href="'.XOOPS_URL.'/modules/mylinks/admin/?op=modLink&amp;lid='.$lid.'"><img src="'.XOOPS_URL.'/modules/mylinks/images/editicon.gif" border="0" alt="'._MD_EDITTHISLINK.'" /></a>';
+        } else {
+            $adminlink = '';
+        }
+        if ($votes == 1) {
+            $votestring = _MD_ONEVOTE;
+        } else {
+            $votestring = sprintf(_MD_NUMVOTES,$votes);
+        }
+        $path = $mytree->getPathFromId($cid, "title");
+        $path = substr($path, 1);
+        $path = str_replace("/"," <img src='".XOOPS_URL."/modules/mylinks/images/arrow.gif' board='0' alt='' /> ",$path);
+        $new = newlinkgraphic($time, $status);
+        $pop = popgraphic($hits);
+        $xoopsTpl->append('links', array('id' => $lid, 'cid' => $cid, 'rating' => number_format($rating, 2), 'title' => $myts->makeTboxData4Show($ltitle).$new.$pop, 'category' => $path, 'logourl' => $myts->makeTboxData4Show($logourl), 'updated' => formatTimestamp($time,"m"), 'description' => $myts->makeTareaData4Show($description,0), 'adminlink' => $adminlink, 'hits' => $hits, 'comments' => $comments, 'votes' => $votestring, 'mail_subject' => rawurlencode(sprintf(_MD_INTRESTLINK,$xoopsConfig['sitename'])), 'mail_body' => rawurlencode(sprintf(_MD_INTLINKFOUND,$xoopsConfig['sitename']).':  '.XOOPS_URL.'/modules/mylinks/singlelink.php?cid='.$cid.'&lid='.$lid)));
+    }
+    $orderby = convertorderbyout($orderby);
+    //Calculates how many pages exist.  Which page one should be on, etc...
+    $linkpages = ceil($numrows / $show);
+    //Page Numbering
+    if ($linkpages!=1 && $linkpages!=0) {
+        $cid = intval($_GET['cid']);
+        $prev = $min - $show;
+        if ($prev>=0) {
+            $page_nav .= "<a href='viewcat.php?cid=$cid&amp;min=$prev&amp;orderby=$orderby&amp;show=$show'><b><u>&laquo;</u></b></a>&nbsp;";
+        }
+        $counter = 1;
+        $currentpage = ($max / $show);
+        while ( $counter<=$linkpages ) {
+            $mintemp = ($show * $counter) - $show;
+            if ($counter == $currentpage) {
+                $page_nav .= "<b>($counter)</b>&nbsp;";
+            } else {
+                $page_nav .= "<a href='viewcat.php?cid=$cid&amp;min=$mintemp&amp;orderby=$orderby&amp;show=$show'>$counter</a>&nbsp;";
+            }
+            $counter++;
+        }
+        if ( $numrows>$max ) {
+            $page_nav .= "<a href='viewcat.php?cid=$cid&amp;min=$max&amp;orderby=$orderby&amp;show=$show'>";
+            $page_nav .= "<b><u>&raquo;</u></b></a>";
+        }
+    }
+}
+$xoopsTpl->assign('page_nav', $page_nav);
+include XOOPS_ROOT_PATH.'/footer.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/submit.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/submit.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/submit.php	(revision 405)
@@ -0,0 +1,158 @@
+<?php
+// $Id: submit.php,v 1.4 2005/09/04 20:46:10 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+// ------------------------------------------------------------------------- //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+include "header.php";
+$myts =& MyTextSanitizer::getInstance();// MyTextSanitizer object
+include_once XOOPS_ROOT_PATH."/class/xoopstree.php";
+include_once XOOPS_ROOT_PATH."/class/module.errorhandler.php";
+include_once XOOPS_ROOT_PATH."/include/xoopscodes.php";
+
+$eh = new ErrorHandler; //ErrorHandler object
+$mytree = new XoopsTree($xoopsDB->prefix("mylinks_cat"),"cid","pid");
+
+if (empty($xoopsUser) and !$xoopsModuleConfig['anonpost']) {
+	redirect_header(XOOPS_URL."/user.php",2,_MD_MUSTREGFIRST);
+	exit();
+}
+
+if (!empty($_POST['submit'])) {
+
+	$submitter = !empty($xoopsUser) ? $xoopsUser->getVar('uid') : 0;
+
+	// RMV - why store submitter on form??
+   	//if (!$_POST['submitter'] and $xoopsUser) {
+    //   $submitter = $xoopsUser->uid();
+   	//}elseif(!$_POST['submitter'] and !$xoopsUser) {
+	//	$submitter = 0;
+	//}else{
+	//	$submitter = intval($_POST['submitter']);
+	//}
+
+	// Check if Title exist
+   	if ($_POST["title"]=="") {
+       	$eh->show("1001");
+   	}
+
+	// Check if URL exist
+	$url = $_POST["url"];
+   	if ($url=="" || !isset($url)) {
+       	$eh->show("1016");
+   	}
+
+	// Check if Description exist
+   	if ($_POST['message']=="") {
+       	$eh->show("1008");
+   	}
+
+	$notify = !empty($_POST['notify']) ? 1 : 0;
+
+	if ( !empty($_POST['cid']) ) {
+   		$cid = intval($_POST['cid']);
+	} else {
+		$cid = 0;
+	}
+
+	//	$url = urlencode($url);
+	$url = $myts->makeTboxData4Save($url);
+
+	$title = $myts->makeTboxData4Save($_POST["title"]);
+    $description = $myts->makeTareaData4Save($_POST["message"]);
+	$date = time();
+	$newid = $xoopsDB->genId($xoopsDB->prefix("mylinks_links")."_lid_seq");
+	if ( $xoopsModuleConfig['autoapprove'] == 1 ) {
+		// RMV-FIXME: shouldn't this be 'APPROVE' or something (also in mydl)?
+		$status = $xoopsModuleConfig['autoapprove'];
+	} else {
+		$status = 0;
+	}
+	$sql = sprintf("INSERT INTO %s (lid, cid, title, url, logourl, submitter, status, date, hits, rating, votes, comments) VALUES (%u, %u, '%s', '%s', '%s', %u, %u, %u, %u, %u, %u, %u)", $xoopsDB->prefix("mylinks_links"), $newid, $cid, $title, $url, ' ', $submitter, $status, $date, 0, 0, 0, 0);
+	$xoopsDB->query($sql) or $eh->show("0013");
+	if ($newid == 0) {
+		$newid = $xoopsDB->getInsertId();
+	}
+	$sql = sprintf("INSERT INTO %s (lid, description) VALUES (%u, '%s')", $xoopsDB->prefix("mylinks_text"), $newid, $description);
+	$xoopsDB->query($sql) or $eh->show("0013");
+	// RMV-NEW
+	// Notify of new link (anywhere) and new link in category.
+	$notification_handler =& xoops_gethandler('notification');
+	$tags = array();
+	$tags['LINK_NAME'] = $title;
+	$tags['LINK_URL'] = XOOPS_URL . '/modules/'. $xoopsModule->getVar('dirname') . '/singlelink.php?cid=' . $cid . '&amp;lid=' . $newid;
+	$sql = "SELECT title FROM " . $xoopsDB->prefix("mylinks_cat") . " WHERE cid=" . $cid;
+	$result = $xoopsDB->query($sql);
+	$row = $xoopsDB->fetchArray($result);
+	$tags['CATEGORY_NAME'] = $row['title'];
+	$tags['CATEGORY_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewcat.php?cid=' . $cid;
+	if ( $xoopsModuleConfig['autoapprove'] == 1 ) {
+		$notification_handler->triggerEvent('global', 0, 'new_link', $tags);
+		$notification_handler->triggerEvent('category', $cid, 'new_link', $tags);
+		redirect_header("index.php",2,_MD_RECEIVED."<br />"._MD_ISAPPROVED."");
+	}else{
+		$tags['WAITINGLINKS_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/admin/index.php?op=listNewLinks';
+		$notification_handler->triggerEvent('global', 0, 'link_submit', $tags);
+		$notification_handler->triggerEvent('category', $cid, 'link_submit', $tags);
+		if ($notify) {
+			include_once XOOPS_ROOT_PATH . '/include/notification_constants.php';
+			$notification_handler->subscribe('link', $newid, 'approve', XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE);
+		}
+		redirect_header("index.php",2,_MD_RECEIVED);
+	}
+	exit();
+
+} else {
+
+	$xoopsOption['template_main'] = 'mylinks_submit.html';
+	include XOOPS_ROOT_PATH."/header.php";
+	ob_start();
+	xoopsCodeTarea("message",37,8);
+	$xoopsTpl->assign('xoops_codes', ob_get_contents());
+	ob_end_clean();
+	ob_start();
+	xoopsSmilies("message");
+	$xoopsTpl->assign('xoops_smilies', ob_get_contents());
+	ob_end_clean();
+	$xoopsTpl->assign('notify_show', !empty($xoopsUser) && !$xoopsModuleConfig['autoapprove'] ? 1 : 0);
+	$xoopsTpl->assign('lang_submitonce', _MD_SUBMITONCE);
+	$xoopsTpl->assign('lang_submitlinkh', _MD_SUBMITLINKHEAD);
+	$xoopsTpl->assign('lang_allpending', _MD_ALLPENDING);
+	$xoopsTpl->assign('lang_dontabuse', _MD_DONTABUSE);
+	$xoopsTpl->assign('lang_wetakeshot', _MD_TAKESHOT);
+	$xoopsTpl->assign('lang_sitetitle', _MD_SITETITLE);
+	$xoopsTpl->assign('lang_siteurl', _MD_SITEURL);
+	$xoopsTpl->assign('lang_category', _MD_CATEGORYC);
+	$xoopsTpl->assign('lang_options', _MD_OPTIONS);
+	$xoopsTpl->assign('lang_notify', _MD_NOTIFYAPPROVE);
+	$xoopsTpl->assign('lang_description', _MD_DESCRIPTIONC);
+	$xoopsTpl->assign('lang_submit', _SUBMIT);
+	$xoopsTpl->assign('lang_cancel', _CANCEL);
+	ob_start();
+	$mytree->makeMySelBox("title", "title",0,1);
+	$selbox = ob_get_contents();
+	ob_end_clean();
+	$xoopsTpl->assign('category_selbox', $selbox);
+	include XOOPS_ROOT_PATH.'/footer.php';
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/comment_edit.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/comment_edit.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/comment_edit.php	(revision 405)
@@ -0,0 +1,29 @@
+<?php
+// $Id: comment_edit.php,v 1.2 2005/03/18 12:52:24 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+include '../../mainfile.php';
+include XOOPS_ROOT_PATH.'/include/comment_edit.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/comment_post.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/comment_post.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/comment_post.php	(revision 405)
@@ -0,0 +1,29 @@
+<?php
+// $Id: comment_post.php,v 1.2 2005/03/18 12:52:24 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+include '../../mainfile.php';
+include XOOPS_ROOT_PATH.'/include/comment_post.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/index.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/index.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/index.php	(revision 405)
@@ -0,0 +1,113 @@
+<?php
+// $Id: index.php,v 1.5 2006/05/01 02:37:28 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+// ------------------------------------------------------------------------- //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+include "header.php";
+$myts =& MyTextSanitizer::getInstance(); // MyTextSanitizer object
+include_once XOOPS_ROOT_PATH."/class/xoopstree.php";
+$mytree = new XoopsTree($xoopsDB->prefix("mylinks_cat"),"cid","pid");
+$xoopsOption['template_main'] = 'mylinks_index.html';
+include XOOPS_ROOT_PATH."/header.php";
+$result=$xoopsDB->query("SELECT cid, title, imgurl FROM ".$xoopsDB->prefix("mylinks_cat")." WHERE pid = 0 ORDER BY title") or exit("Error");
+
+$count = 1;
+while($myrow = $xoopsDB->fetchArray($result)) {
+    $imgurl = '';
+    if ($myrow['imgurl'] && $myrow['imgurl'] != "http://"){
+        $imgurl = $myts->makeTboxData4Edit($myrow['imgurl']);
+    }
+    $totallink = getTotalItems($myrow['cid'], 1);
+    // get child category objects
+    $arr = array();
+    $arr = $mytree->getFirstChild($myrow['cid'], "title");
+    $space = 0;
+    $chcount = 0;
+    $subcategories = '';
+    foreach($arr as $ele){
+        $chtitle = $myts->makeTboxData4Show($ele['title']);
+        if ($chcount > 5) {
+            $subcategories .= "...";
+            break;
+        }
+        if ($space>0) {
+            $subcategories .= ", ";
+        }
+        $subcategories .= "<a href=\"".XOOPS_URL."/modules/mylinks/viewcat.php?cid=".$ele['cid']."\">".$chtitle."</a>";
+        $space++;
+        $chcount++;
+    }
+    $xoopsTpl->append('categories', array('image' => $imgurl, 'id' => $myrow['cid'], 'title' => $myts->makeTboxData4Show($myrow['title']), 'subcategories' => $subcategories, 'totallink' => $totallink, 'count' => $count));
+    $count++;
+}
+list($numrows) = $xoopsDB->fetchRow($xoopsDB->query("select count(*) from ".$xoopsDB->prefix("mylinks_links")." where status>0"));
+$xoopsTpl->assign('lang_thereare', sprintf(_MD_THEREARE,$numrows));
+
+if ($xoopsModuleConfig['useshots'] == 1) {
+    $xoopsTpl->assign('shotwidth', $xoopsModuleConfig['shotwidth']);
+    $xoopsTpl->assign('tablewidth', $xoopsModuleConfig['shotwidth'] + 10);
+    $xoopsTpl->assign('show_screenshot', true);
+    $xoopsTpl->assign('lang_noscreenshot', _MD_NOSHOTS);
+}
+
+if ($xoopsUser && $xoopsUser->isAdmin($xoopsModule->mid())) {
+    $isadmin = true;
+} else {
+    $isadmin = false;
+}
+
+$xoopsTpl->assign('lang_description', _MD_DESCRIPTIONC);
+$xoopsTpl->assign('lang_lastupdate', _MD_LASTUPDATEC);
+$xoopsTpl->assign('lang_hits', _MD_HITSC);
+$xoopsTpl->assign('lang_rating', _MD_RATINGC);
+$xoopsTpl->assign('lang_ratethissite', _MD_RATETHISSITE);
+$xoopsTpl->assign('lang_reportbroken', _MD_REPORTBROKEN);
+$xoopsTpl->assign('lang_tellafriend', _MD_TELLAFRIEND);
+$xoopsTpl->assign('lang_modify', _MD_MODIFY);
+$xoopsTpl->assign('lang_latestlistings' , _MD_LATESTLIST);
+$xoopsTpl->assign('lang_category' , _MD_CATEGORYC);
+$xoopsTpl->assign('lang_visit' , _MD_VISIT);
+$xoopsTpl->assign('lang_comments' , _COMMENTS);
+
+$result = $xoopsDB->query("SELECT l.lid, l.cid, l.title, l.url, l.logourl, l.status, l.date, l.hits, l.rating, l.votes, l.comments, t.description FROM ".$xoopsDB->prefix("mylinks_links")." l, ".$xoopsDB->prefix("mylinks_text")." t where l.status>0 and l.lid=t.lid ORDER BY date DESC", $xoopsModuleConfig['newlinks'], 0);
+while(list($lid, $cid, $ltitle, $url, $logourl, $status, $time, $hits, $rating, $votes, $comments, $description) = $xoopsDB->fetchRow($result)) {
+    if ($isadmin) {
+        $adminlink = '<a href="'.XOOPS_URL.'/modules/mylinks/admin/?op=modLink&amp;lid='.$lid.'"><img src="'.XOOPS_URL.'/modules/mylinks/images/editicon.gif" border="0" alt="'._MD_EDITTHISLINK.'" /></a>';
+    } else {
+        $adminlink = '';
+    }
+    if ($votes == 1) {
+        $votestring = _MD_ONEVOTE;
+    } else {
+        $votestring = sprintf(_MD_NUMVOTES,$votes);
+    }
+    $path = $mytree->getPathFromId($cid, "title");
+    $path = substr($path, 1);
+    $path = str_replace("/"," <img src='".XOOPS_URL."/modules/mylinks/images/arrow.gif' board='0' alt='' /> ",$path);
+    $new = newlinkgraphic($time, $status);
+    $pop = popgraphic($hits);
+    $xoopsTpl->append('links', array('id' => $lid, 'cid' => $cid, 'rating' => number_format($rating, 2), 'title' => $myts->makeTboxData4Show($ltitle).$new.$pop, 'category' => $path, 'logourl' => $myts->makeTboxData4Show($logourl), 'updated' => formatTimestamp($time,"m"), 'description' => $myts->makeTareaData4Show($description,0), 'adminlink' => $adminlink, 'hits' => $hits, 'votes' => $votestring, 'comments' => $comments, 'mail_subject' => rawurlencode(sprintf(_MD_INTRESTLINK,$xoopsConfig['sitename'])), 'mail_body' => rawurlencode(sprintf(_MD_INTLINKFOUND,$xoopsConfig['sitename']).':  '.XOOPS_URL.'/modules/mylinks/singlelink.php?cid='.$cid.'&lid='.$lid)));
+}
+include XOOPS_ROOT_PATH.'/footer.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/templates/blocks/mylinks_block_top.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/templates/blocks/mylinks_block_top.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/templates/blocks/mylinks_block_top.html	(revision 405)
@@ -0,0 +1,5 @@
+<ul>
+  <{foreach item=link from=$block.links}>
+    <li><a href="<{$xoops_url}>/modules/mylinks/singlelink.php?cid=<{$link.cid}>&amp;lid=<{$link.id}>"><{$link.title}></a> (<{$link.hits}>)</li>
+  <{/foreach}>
+</ul>
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/templates/blocks/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/templates/blocks/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/templates/blocks/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/templates/blocks/mylinks_block_new.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/templates/blocks/mylinks_block_new.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/templates/blocks/mylinks_block_new.html	(revision 405)
@@ -0,0 +1,5 @@
+<ul>
+  <{foreach item=link from=$block.links}>
+    <li><a href="<{$xoops_url}>/modules/mylinks/singlelink.php?cid=<{$link.cid}>&amp;lid=<{$link.id}>"><{$link.title}></a> (<{$link.date}>)</li>
+  <{/foreach}>
+</ul>
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/templates/mylinks_index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/templates/mylinks_index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/templates/mylinks_index.html	(revision 405)
@@ -0,0 +1,54 @@
+<br /><br />
+
+<p align="center">
+    <a href="<{$xoops_url}>/modules/mylinks/index.php"><img src="<{$xoops_url}>/modules/mylinks/images/logo.gif" alt="" /></a>
+</p>
+
+<br /><br /><br />
+  <{if count($categories) gt 0}>
+<hr />
+<table border='0' cellspacing='5' cellpadding='0' align="center">
+  <tr>
+  <!-- Start category loop -->
+  <{foreach item=category from=$categories}>
+
+    <td valign="top">
+
+    <{if $category.image != ""}>
+    <a href="<{$xoops_url}>/modules/mylinks/viewcat.php?cid=<{$category.id}>"><img src="<{$category.image}>" height="50" border="0" alt="" /></a>
+    <{/if}>
+
+    </td>
+    <td valign="top" width="40%"><a href="<{$xoops_url}>/modules/mylinks/viewcat.php?cid=<{$category.id}>"><b><{$category.title}></b></a>&nbsp;(<{$category.totallink}>)<br /><{$category.subcategories}></td>
+
+    <{if $category.count is div by 3}>
+    </tr><tr>
+    <{/if}>
+
+  <{/foreach}>
+  <!-- End category loop -->
+
+  </tr>
+</table>
+
+<br /><br />
+
+<div><{$lang_thereare}></div>
+<hr /><br />
+<{/if}>
+<{if $links != ""}>
+<h4><{$lang_latestlistings}></h4>
+<table width="100%" cellspacing="0" cellpadding="10" border="0">
+<tr>
+<td width="100%" align="center" valign="top">
+
+  <!-- Start new link loop -->
+  <{section name=i loop=$links}>
+    <{include file="db:mylinks_link.html" link=$links[i]}>
+  <{/section}>
+  <!-- End new link loop -->
+
+</td></tr>
+</table>
+<{/if}>
+<{include file='db:system_notification_select.html'}>
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/templates/mylinks_ratelink.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/templates/mylinks_ratelink.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/templates/mylinks_ratelink.html	(revision 405)
@@ -0,0 +1,30 @@
+<br /><br />
+
+<p align="center">
+    <a href="<{$xoops_url}>/modules/mylinks/index.php"><img src="<{$xoops_url}>/modules/mylinks/images/logo.gif" border="0" alt="" /></a>
+</p>
+
+<hr size="1" noshade="noshade" />
+<table border="0" cellpadding="1" cellspacing="0" width="80%">
+  <tr>
+    <td>
+      <h4><{$link.title}></h4>
+      <ul>
+     	<li><{$lang_voteonce}></li>
+     	<li><{$lang_ratingscale}></li>
+     	<li><{$lang_beobjective}></li>
+     	<li><{$lang_donotvote}></li>
+      </ul>
+    </td>
+  </tr>
+  <tr>
+    <td align="center">
+      <form method="post" action="ratelink.php">
+        <input type="hidden" name="lid" value="<{$link.id}>" />
+        <input type="hidden" name="cid" value="<{$link.cid}>" />
+     	<select name="rating"><option>--</option><option>10</option><option>9</option><option>8</option><option>7</option><option>6</option><option>5</option><option>4</option><option>3</option><option>2</option><option>1</option></select>&nbsp;&nbsp;
+        <input type="submit" name="submit" value="<{$lang_rateit}>" /><input type=button value="<{$lang_cancel}>" onclick="location='<{$xoops_url}>/modules/mylinks/singlelink.php?cid=<{$link.cid}>&amp;lid=<{$link.id}>'" />
+      </form>
+    </td>
+  </tr>
+</table>
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/templates/mylinks_topten.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/templates/mylinks_topten.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/templates/mylinks_topten.html	(revision 405)
@@ -0,0 +1,38 @@
+<br /><br />
+
+<div style="margin-top: 2px;text-align: center;"><a href="<{$xoops_url}>/modules/mylinks/index.php"><img src="<{$xoops_url}>/modules/mylinks/images/logo.gif" alt="" /></a></div>
+<br /><br /><br />
+<!-- Start ranking loop -->
+<{foreach item=ranking from=$rankings}>
+<table class="outer">
+  <tr>
+    <th colspan="6"><{$ranking.title}> (<{$lang_sortby}>)</th>
+  </tr>
+  <tr>
+    <td class="head" width='7%'><{$lang_rank}></td>
+    <td class="head" width='28%'><{$lang_title}></td>
+    <td class="head" width='40%'><{$lang_category}></td>
+    <td class="head" width='8%' align='center'><{$lang_hits}></td>
+    <td class="head" width='9%' align='center'><{$lang_rating}></td>
+    <td class="head" width='8%' align='right'><{$lang_vote}></td>
+  </tr>
+
+  <!-- Start links loop -->
+  <{foreach item=link from=$ranking.links}>
+
+  <tr>
+    <td class="even"><{$link.rank}></td>
+    <td class="odd"><a href='singlelink.php?cid=<{$link.cid}>&amp;lid=<{$link.id}>'><{$link.title}></a></td>
+    <td class="even"><{$link.category}></td>
+    <td class="odd" align='center'><{$link.hits}></td>
+    <td class="even" align='center'><{$link.rating}></td>
+    <td class="odd" align='right'><{$link.votes}></td>
+  </tr>
+
+  <{/foreach}>
+  <!-- End links loop-->
+
+</table>
+<br />
+<{/foreach}>
+<!-- End ranking loop -->
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/templates/mylinks_link.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/templates/mylinks_link.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/templates/mylinks_link.html	(revision 405)
@@ -0,0 +1,23 @@
+<table class="outer" width='100%' cellspacing='0'>
+  <tr>
+    <td class="head" colspan='2' align='left' height="18"><{$lang_category}> <{$link.category}></td>
+  </tr>
+  <tr>
+    <td class="even" width='60%' align='left' valign="bottom"><a href='visit.php?cid=<{$link.cid}>&amp;lid=<{$link.id}>' target='_blank'><img src='images/link.gif' border='0' alt='<{$lang_visit}>' /><b><{$link.title}></b></a></td>
+    <td class="even" align='right' width='40%'><b><{$lang_lastupdate}></b><{$link.updated}></td>
+  </tr>
+  <tr>
+    <td class="odd" colspan='2' align='left'><{$link.adminlink}><b><{$lang_description}></b><br />
+<{if $link.logourl != ""}>
+   <a href="<{$xoops_url}>/modules/mylinks/visit.php?cid=<{$link.cid}>&amp;lid=<{$link.id}>" target="_blank"><img src="<{$xoops_url}>/modules/mylinks/images/shots/<{$link.logourl}>" width="<{$shotwidth}>" alt=""  align="right" vspace="3" hspace="7"/></a>
+<{/if}>
+    <div style="text-align: justify"><{$link.description}></div><br /></td>
+  </tr>
+  <tr>
+    <td class="even" colspan='2' align='center'><b><{$lang_hits}></b><{$link.hits}> <b>&nbsp;&nbsp;<{$lang_rating}></b><{$link.rating}> (<{$link.votes}>)</td>
+  </tr>
+  <tr>
+    <td class="foot" colspan='2' align='center'><a href="<{$xoops_url}>/modules/mylinks/ratelink.php?cid=<{$link.cid}>&amp;lid=<{$link.id}>"><{$lang_ratethissite}></a> | <a href="<{$xoops_url}>/modules/mylinks/modlink.php?lid=<{$link.id}>"><{$lang_modify}></a> |<a href="<{$xoops_url}>/modules/mylinks/brokenlink.php?lid=<{$link.id}>"><{$lang_reportbroken}></a> | <a target="_top" href="mailto:?subject=<{$link.mail_subject}>&amp;body=<{$link.mail_body}>"><{$lang_tellafriend}></a> | <a href="<{$xoops_url}>/modules/mylinks/singlelink.php?cid=<{$link.cid}>&amp;lid=<{$link.id}>"><{$lang_comments}> (<{$link.comments}>)</a></td>
+  </tr>
+</table>
+<br />
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/templates/mylinks_modlink.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/templates/mylinks_modlink.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/templates/mylinks_modlink.html	(revision 405)
@@ -0,0 +1,37 @@
+<br /><br />
+
+<p align="center">
+    <a href="<{$xoops_url}>/modules/mylinks/index.php"><img src="<{$xoops_url}>/modules/mylinks/images/logo.gif" border="0" alt="" /></a>
+</p>
+
+<h4><{$lang_requestmod}></h4>
+<form action="modlink.php" method="post">
+<table width="80%">
+  <tr>
+    <td align="right"><{$lang_linkid}></td>
+    <td><b><{$link.id}></b></td>
+  </tr>
+  <tr>
+    <td align="right"><{$lang_sitetitle}></td>
+    <td><input type="text" name="title" size="50" maxlength="100" value="<{$link.title}>" /></td>
+  </tr>
+  <tr>
+    <td align="right"><{$lang_siteurl}></td>
+    <td><input type="text" name="url" size="50" maxlength="100" value="<{$link.url}>" /></td>
+  </tr>
+  <tr>
+    <td align="right"><{$lang_category}></td>
+    <td><{$category_selbox}></td>
+  </tr>
+  <tr>
+    <td></td><td></td>
+  </tr>
+  <tr>
+    <td align="right" valign="top"><{$lang_description}></td>
+    <td><textarea name="description" cols="60" rows="5"><{$link.description}></textarea></td>
+  </tr>
+  <tr>
+    <td colspan="2" align="center"><br /><input type="hidden" name="logourl" value="<{$link.logourl}>" /><input type="hidden" name="lid" value="<{$link.id}>" /><input type="submit" name="submit" value="<{$lang_sendrequest}>" />&nbsp;<input type=button value="<{$lang_cancel}>" onclick="javascript:history.go(-1)" /></td>
+  </tr>
+</table>
+</form>
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/templates/mylinks_brokenlink.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/templates/mylinks_brokenlink.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/templates/mylinks_brokenlink.html	(revision 405)
@@ -0,0 +1,14 @@
+<br /><br />
+
+<p align="center">
+    <a href="<{$xoops_url}>/modules/mylinks/index.php"><img src="<{$xoops_url}>/modules/mylinks/images/logo.gif" border="0" alt="" /></a>
+</p>
+
+<div>
+  <h4><{$lang_reportbroken}></h4>
+  <form action="brokenlink.php" method="POST">
+    <input type="hidden" name="lid" value="<{$link_id}>" /><{$lang_thanksforhelp}><br /><{$lang_forsecurity}><br /><br /><input type="submit" name="submit" value="<{$lang_reportbroken}>" />&nbsp;<input type=button value="<{$lang_cancel}>" onclick="javascript:history.go(-1)" />
+  </form>
+</div>
+
+<br />
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/templates/mylinks_singlelink.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/templates/mylinks_singlelink.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/templates/mylinks_singlelink.html	(revision 405)
@@ -0,0 +1,41 @@
+<br /><br />
+
+<p align='center'>
+  <a href="<{$xoops_url}>/modules/mylinks/index.php"><img src="<{$xoops_url}>/modules/mylinks/images/logo.gif" alt="" /></a>
+</p>
+
+<div>
+  <table width="97%" cellspacing="2" cellpadding="2" border="0" >
+    <tr>
+      <td class="newstitle"><{$category_path}></td>
+    </tr>
+  </table>
+</div>
+
+<br />
+
+<table width="100%" cellspacing="0" cellpadding="10" border="0">
+  <tr>
+    <td align="center">
+    <{include file="db:mylinks_link.html" link=$link}>
+    </td>
+  </tr>
+</table>
+
+<div style="text-align: center; padding: 3px; margin:3px;">
+  <{$commentsnav}>
+  <{$lang_notice}>
+</div>
+
+<div style="margin:3px; padding: 3px;">
+<!-- start comments loop -->
+<{if $comment_mode == "flat"}>
+  <{include file="db:system_comments_flat.html"}>
+<{elseif $comment_mode == "thread"}>
+  <{include file="db:system_comments_thread.html"}>
+<{elseif $comment_mode == "nest"}>
+  <{include file="db:system_comments_nest.html"}>
+<{/if}>
+<!-- end comments loop -->
+</div>
+<{include file='db:system_notification_select.html'}>
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/templates/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/templates/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/templates/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/templates/mylinks_viewcat.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/templates/mylinks_viewcat.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/templates/mylinks_viewcat.html	(revision 405)
@@ -0,0 +1,68 @@
+<br /><br />
+
+<p align="center">
+    <a href="<{$xoops_url}>/modules/mylinks/index.php"><img src="<{$xoops_url}>/modules/mylinks/images/logo.gif" border="0" alt="" /></a>
+</p>
+
+<br />
+<table width="97%" cellspacing="0" cellpadding="0" border="0" align="center">
+  <tr>
+    <td>
+      <table width="100%" cellspacing="1" cellpadding="2" border="0">
+        <tr>
+          <td class="newstitle"><b><{$category_path}></b></td>
+        </tr>
+      </table>
+    </td>
+  </tr>
+  <tr>
+    <td align="center">
+      <table width="90%">
+        <tr>
+          <{foreach item=subcat from=$subcategories}>
+            <td align="left"><b><a href="viewcat.php?cid=<{$subcat.id}>"><{$subcat.title}></a></b>&nbsp;(<{$subcat.totallinks}>)<br /><font class="subcategories"><{$subcat.infercategories}></font></td>
+            <{if $subcat.count is div by 4}>
+            </tr><tr>
+            <{/if}>
+          <{/foreach}>
+        </tr>
+      </table>
+      <br />
+      <hr />
+
+      <{if $show_links == true}>
+
+      <{if $show_nav == true}>
+      <div><{$lang_sortby}>&nbsp;&nbsp;<{$lang_title}> (<a href="viewcat.php?cid=<{$category_id}>&amp;orderby=titleA"><img src="images/up.gif" border="0" align="middle" alt="" /></a><a href="viewcat.php?cid=<{$category_id}>&amp;orderby=titleD"><img src="images/down.gif" border="0" align="middle" alt="" /></a>)<{$lang_date}> (<a href="viewcat.php?cid=<{$category_id}>&amp;orderby=dateA"><img src="images/up.gif" border="0" align="middle" alt="" /></a><a href="viewcat.php?cid=<{$category_id}>&amp;orderby=dateD"><img src="images/down.gif" border="0" align="middle" alt="" /></a>)<{$lang_rating}> (<a href="viewcat.php?cid=<{$category_id}>&amp;orderby=ratingA"><img src="images/up.gif" border="0" align="middle" alt="" /></a><a href="viewcat.php?cid=<{$category_id}>&amp;orderby=ratingD"><img src="images/down.gif" border="0" align="middle" alt="" /></a>)<{$lang_popularity}> (<a href="viewcat.php?cid=<{$category_id}>&amp;orderby=hitsA"><img src="images/up.gif" border="0" align="middle" alt="" /></a><a href="viewcat.php?cid=<{$category_id}>&amp;orderby=hitsD"><img src="images/down.gif" border="0" align="middle" alt="" /></a>)
+      <br /><b><{$lang_cursortedby}></b>
+      </div>
+      <hr />
+      <{/if}>
+
+      <br />
+    </td>
+  </tr>
+</table>
+
+<table width="100%" cellspacing="0" cellpadding="10" border="0">
+  <tr>
+    <td width="100%" align="center" valign="top">
+    <!-- Start link loop -->
+    <{section name=i loop=$links}>
+      <{include file="db:mylinks_link.html" link=$links[i]}>
+    <{/section}>
+    <!-- End link loop -->
+    </td>
+  </tr>
+</table>
+
+<br /><br />
+<div style="text-align:center;"><{$page_nav}></div>
+
+<{else}>
+
+    </td>
+  </tr>
+</table>
+<{/if}>
+<{include file='db:system_notification_select.html'}>
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/templates/mylinks_submit.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/templates/mylinks_submit.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/templates/mylinks_submit.html	(revision 405)
@@ -0,0 +1,72 @@
+<br /><br />
+<p align='center'>
+    <a href="<{$xoops_url}>/modules/mylinks/index.php"><img src="<{$xoops_url}>/modules/mylinks/images/logo.gif" alt="" /></a>
+</p>
+
+<br />
+
+<table width="100%" cellspacing="1" cellpadding="4" border="0">
+  <tr>
+    <td>
+	<ul>
+	    <li><{$lang_submitonce}></li>
+		<li><{$lang_allpending}></li>
+		<li><{$lang_dontabuse}></li>
+		<li><{$lang_wetakeshot}></li>
+		</ul>
+    <form action="submit.php" method="post">
+        <table width="80%">
+          <tr> 
+            <td align="right" nowrap="nowrap" colspan="2" class="itemHead"> 
+              <div align="left"><b><{$lang_submitlinkh}></b></div>
+            </td>
+          </tr>
+          <tr> 
+            <td class="head" align="right" nowrap="nowrap"> 
+              <div align="left">
+                <b><{$lang_sitetitle}></b>
+              </div>
+            </td>
+            <td class="even"> 
+              <input type="text" name="title" size="50" maxlength="100" />
+            </td>
+          </tr>
+          <tr> 
+            <td class="head" align="right" nowrap="nowrap"> 
+              <div align="left"><b><{$lang_siteurl}></b></div>
+            </td>
+            <td class="odd"> 
+              <input type="text" name="url" size="50" maxlength="255" value="http://" />
+            </td>
+          </tr>
+          <tr> 
+            <td class="head" align="right" nowrap="nowrap"> 
+              <div align="left"><b><{$lang_category}></b></div>
+            </td>
+            <td class="even">
+				<{$category_selbox}></td>
+          </tr>
+          <tr> 
+            <td class="head" align="right" valign="top" nowrap="nowrap"> 
+              <div align="left"><b><{$lang_description}></b></div>
+            </td>
+            <td class="odd" >
+			<{$xoops_codes}><{$xoops_smilies}></td>
+          </tr>
+          <tr>
+            <td class="head" align="right" valign="top">
+              <div align="left"><b><{$lang_options}></b></div>
+            </td>
+              <td class="even" >
+			  <{if $notify_show}>
+                <input type="checkbox" name="notify" value="1"><{$lang_notify}></input>
+              <{/if}>
+              </td>
+          </tr>
+        </table>
+      <br />
+      <div style="text-align: center;"><input type="submit" name="submit" class="button" value="<{$lang_submit}>" />&nbsp;<input type="button" value="<{$lang_cancel}>" onclick="javascript:history.go(-1)" /></div>
+    </form>
+  </td>
+</tr>
+</table>
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/topten.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/topten.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/topten.php	(revision 405)
@@ -0,0 +1,76 @@
+<?php
+// $Id: topten.php,v 1.2 2005/03/18 12:52:24 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+// ------------------------------------------------------------------------- //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+include "header.php";
+$myts =& MyTextSanitizer::getInstance(); // MyTextSanitizer object
+include_once XOOPS_ROOT_PATH."/class/xoopstree.php";
+$mytree = new XoopsTree($xoopsDB->prefix("mylinks_cat"),"cid","pid");
+$xoopsOption['template_main'] = 'mylinks_topten.html';
+include XOOPS_ROOT_PATH."/header.php";
+//generates top 10 charts by rating and hits for each main category
+
+if(!empty($_GET['rate'])){
+	$sort = _MD_RATING;
+	$sortDB = "rating";
+}else{
+	$sort = _MD_HITS;
+	$sortDB = "hits";
+}
+$xoopsTpl->assign('lang_sortby' ,$sort);
+$xoopsTpl->assign('lang_rank' , _MD_RANK);
+$xoopsTpl->assign('lang_title' , _MD_TITLE);
+$xoopsTpl->assign('lang_category' , _MD_CATEGORY);
+$xoopsTpl->assign('lang_hits' , _MD_HITS);
+$xoopsTpl->assign('lang_rating' , _MD_RATING);
+$xoopsTpl->assign('lang_vote' , _MD_VOTE);
+$arr=array();
+$result=$xoopsDB->query("select cid, title from ".$xoopsDB->prefix("mylinks_cat")." where pid=0");
+$e = 0;
+$rankings = array();
+while(list($cid, $ctitle)=$xoopsDB->fetchRow($result)){
+	$rankings[$e]['title'] = sprintf(_MD_TOP10, $myts->htmlSpecialChars($ctitle));
+	$query = "select lid, cid, title, hits, rating, votes from ".$xoopsDB->prefix("mylinks_links")." where status>0 and (cid=$cid";
+	// get all child cat ids for a given cat id
+	$arr=$mytree->getAllChildId($cid);
+	$size = count($arr);
+	for($i=0;$i<$size;$i++){
+		$query .= " or cid=".$arr[$i]."";
+	}
+	$query .= ") order by ".$sortDB." DESC";
+	$result2 = $xoopsDB->query($query,10,0);
+	$rank = 1;
+	while(list($lid,$lcid,$ltitle,$hits,$rating,$votes)=$xoopsDB->fetchRow($result2)){
+		$catpath = $mytree->getPathFromId($lcid, "title");
+		$catpath= substr($catpath, 1);
+		$catpath = str_replace("/"," <span class='fg2'>&raquo;</span> ",$catpath);
+		$rankings[$e]['links'][] = array('id' => $lid, 'cid' => $cid, 'rank' => $rank, 'title' => $myts->htmlSpecialChars($ltitle), 'category' => $catpath, 'hits' => $hits, 'rating' => number_format($rating, 2), 'votes' => $votes);
+		$rank++;
+	}
+	$e++;
+}
+$xoopsTpl->assign('rankings', $rankings);
+include XOOPS_ROOT_PATH.'/footer.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/sql/mysql.sql
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/sql/mysql.sql	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/sql/mysql.sql	(revision 405)
@@ -0,0 +1,104 @@
+# phpMyAdmin MySQL-Dump
+# version 2.2.2
+# http://phpwizard.net/phpMyAdmin/
+# http://phpmyadmin.sourceforge.net/ (download page)
+#
+# --------------------------------------------------------
+
+#
+# Table structure for table `mylinks_broken`
+#
+
+CREATE TABLE mylinks_broken (
+  reportid int(5) NOT NULL auto_increment,
+  lid int(11) unsigned NOT NULL default '0',
+  sender int(11) unsigned NOT NULL default '0',
+  ip varchar(20) NOT NULL default '',
+  PRIMARY KEY  (reportid),
+  KEY lid (lid),
+  KEY sender (sender),
+  KEY ip (ip)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `mylinks_cat`
+#
+
+CREATE TABLE mylinks_cat (
+  cid int(5) unsigned NOT NULL auto_increment,
+  pid int(5) unsigned NOT NULL default '0',
+  title varchar(50) NOT NULL default '',
+  imgurl varchar(150) NOT NULL default '',
+  PRIMARY KEY  (cid),
+  KEY pid (pid)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `mylinks_links`
+#
+
+CREATE TABLE mylinks_links (
+  lid int(11) unsigned NOT NULL auto_increment,
+  cid int(5) unsigned NOT NULL default '0',
+  title varchar(100) NOT NULL default '',
+  url varchar(250) NOT NULL default '',
+  logourl varchar(60) NOT NULL default '',
+  submitter int(11) unsigned NOT NULL default '0',
+  status tinyint(2) NOT NULL default '0',
+  date int(10) NOT NULL default '0',
+  hits int(11) unsigned NOT NULL default '0',
+  rating double(6,4) NOT NULL default '0.0000',
+  votes int(11) unsigned NOT NULL default '0',
+  comments int(11) unsigned NOT NULL default '0',
+  PRIMARY KEY  (lid),
+  KEY cid (cid),
+  KEY status (status),
+  KEY title (title(40))
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `mylinks_mod`
+#
+
+CREATE TABLE mylinks_mod (
+  requestid int(11) unsigned NOT NULL auto_increment,
+  lid int(11) unsigned NOT NULL default '0',
+  cid int(5) unsigned NOT NULL default '0',
+  title varchar(100) NOT NULL default '',
+  url varchar(250) NOT NULL default '',
+  logourl varchar(150) NOT NULL default '',
+  description text NOT NULL,
+  modifysubmitter int(11) unsigned NOT NULL default '0',
+  PRIMARY KEY  (requestid)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `mylinks_text`
+#
+
+CREATE TABLE mylinks_text (
+  lid int(11) unsigned NOT NULL default '0',
+  description text NOT NULL,
+  KEY lid (lid)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `mylinks_votedata`
+#
+
+CREATE TABLE mylinks_votedata (
+  ratingid int(11) unsigned NOT NULL auto_increment,
+  lid int(11) unsigned NOT NULL default '0',
+  ratinguser int(11) unsigned NOT NULL default '0',
+  rating tinyint(3) unsigned NOT NULL default '0',
+  ratinghostname varchar(60) NOT NULL default '',
+  ratingtimestamp int(10) NOT NULL default '0',
+  PRIMARY KEY  (ratingid),
+  KEY ratinguser (ratinguser),
+  KEY ratinghostname (ratinghostname)
+) TYPE=MyISAM;
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/sql/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/sql/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/sql/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/ratelink.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/ratelink.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/ratelink.php	(revision 405)
@@ -0,0 +1,115 @@
+<?php
+// $Id: ratelink.php,v 1.5 2005/09/04 20:46:10 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+// ------------------------------------------------------------------------- //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+include "header.php";
+include_once XOOPS_ROOT_PATH."/class/module.errorhandler.php";
+$myts =& MyTextSanitizer::getInstance(); // MyTextSanitizer object
+
+if (!empty($_POST['submit'])) {
+    $eh = new ErrorHandler; //ErrorHandler object
+    if(empty($xoopsUser)){
+        $ratinguser = 0;
+    }else{
+        $ratinguser = $xoopsUser->getVar('uid');
+    }
+
+    //Make sure only 1 anonymous from an IP in a single day.
+    $anonwaitdays = 1;
+    $ip = getenv("REMOTE_ADDR");
+    $lid = intval($_POST['lid']);
+    $cid = intval($_POST['cid']);
+    $rating = intval($_POST['rating']);
+
+    // Check if Rating is Null
+    if ($rating=="--") {
+        redirect_header("ratelink.php?cid=".$cid."&amp;lid=".$lid."",4,_MD_NORATING);
+        exit();
+    }
+
+    // Check if Link POSTER is voting (UNLESS Anonymous users allowed to post)
+    if ($ratinguser != 0) {
+        $result=$xoopsDB->query("select submitter from ".$xoopsDB->prefix("mylinks_links")." where lid=$lid");
+        while(list($ratinguserDB) = $xoopsDB->fetchRow($result)) {
+            if ($ratinguserDB == $ratinguser) {
+                redirect_header("index.php",4,_MD_CANTVOTEOWN);
+                exit();
+            }
+        }
+
+        // Check if REG user is trying to vote twice.
+        $result=$xoopsDB->query("select ratinguser from ".$xoopsDB->prefix("mylinks_votedata")." where lid=$lid");
+        while(list($ratinguserDB) = $xoopsDB->fetchRow($result)) {
+            if ($ratinguserDB == $ratinguser) {
+                redirect_header("index.php",4,_MD_VOTEONCE2);
+                exit();
+            }
+        }
+
+    } else {
+
+        // Check if ANONYMOUS user is trying to vote more than once per day.
+        $yesterday = (time()-(86400 * $anonwaitdays));
+        $result=$xoopsDB->query("select count(*) FROM ".$xoopsDB->prefix("mylinks_votedata")." WHERE lid=$lid AND ratinguser=0 AND ratinghostname = '$ip' AND ratingtimestamp > $yesterday");
+        list($anonvotecount) = $xoopsDB->fetchRow($result);
+        if ($anonvotecount > 0) {
+            redirect_header("index.php",4,_MD_VOTEONCE2);
+            exit();
+        }
+    }
+    if($rating > 10){
+        $rating = 10;
+    }
+
+    //All is well.  Add to Line Item Rate to DB.
+    $newid = $xoopsDB->genId($xoopsDB->prefix("mylinks_votedata")."_ratingid_seq");
+    $datetime = time();
+    $sql = sprintf("INSERT INTO %s (ratingid, lid, ratinguser, rating, ratinghostname, ratingtimestamp) VALUES (%u, %u, %u, %u, '%s', %u)", $xoopsDB->prefix("mylinks_votedata"), $newid, $lid, $ratinguser, $rating, $ip, $datetime);
+    $xoopsDB->query($sql) or $eh->show("0013");
+
+    //All is well.  Calculate Score & Add to Summary (for quick retrieval & sorting) to DB.
+    updaterating($lid);
+    $ratemessage = _MD_VOTEAPPRE."<br />".sprintf(_MD_THANKURATE, htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES));
+    redirect_header("index.php",2,$ratemessage);
+    exit();
+
+} else {
+
+    $xoopsOption['template_main'] = 'mylinks_ratelink.html';
+    include XOOPS_ROOT_PATH."/header.php";
+    $lid = intval($_GET['lid']);
+    $cid = intval($_GET['cid']);
+    $result=$xoopsDB->query("select title from ".$xoopsDB->prefix("mylinks_links")." where lid=$lid");
+    list($title) = $xoopsDB->fetchRow($result);
+    $xoopsTpl->assign('link', array('id' => $lid, 'cid' => $cid, 'title' => $myts->htmlSpecialChars($title)));
+    $xoopsTpl->assign('lang_voteonce', _MD_VOTEONCE);
+    $xoopsTpl->assign('lang_ratingscale', _MD_RATINGSCALE);
+    $xoopsTpl->assign('lang_beobjective', _MD_BEOBJECTIVE);
+    $xoopsTpl->assign('lang_donotvote', _MD_DONOTVOTE);
+    $xoopsTpl->assign('lang_rateit', _MD_RATEIT);
+    $xoopsTpl->assign('lang_cancel', _CANCEL);
+    include XOOPS_ROOT_PATH.'/footer.php';
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/comment_new.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/comment_new.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/comment_new.php	(revision 405)
@@ -0,0 +1,38 @@
+<?php
+// $Id: comment_new.php,v 1.3 2005/09/04 20:46:10 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+include '../../mainfile.php';
+$com_itemid = isset($_GET['com_itemid']) ? intval($_GET['com_itemid']) : 0;
+if ($com_itemid > 0) {
+	// Get link title
+	$sql = "SELECT title FROM " . $xoopsDB->prefix('mylinks_links') . " WHERE lid=" . $com_itemid . "";
+	$result = $xoopsDB->query($sql);
+	$row = $xoopsDB->fetchArray($result);
+    $com_replytitle = $row['title'];
+    include XOOPS_ROOT_PATH.'/include/comment_new.php';
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/xoops_version.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/xoops_version.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/xoops_version.php	(revision 405)
@@ -0,0 +1,291 @@
+<?php
+// $Id: xoops_version.php,v 1.2 2005/03/18 12:52:25 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+$modversion['name'] = _MI_MYLINKS_NAME;
+$modversion['version'] = 1.10;
+$modversion['description'] = _MI_MYLINKS_DESC;
+$modversion['credits'] = "Kazumi Ono<br />( http://www.mywebaddons.com/ )<br />The XOOPS Project";
+$modversion['help'] = "mylinks.html";
+$modversion['license'] = "GPL see LICENSE";
+$modversion['official'] = 1;
+$modversion['image'] = "images/mylinks_slogo.png";
+$modversion['dirname'] = "mylinks";
+
+// Sql file (must contain sql generated by phpMyAdmin or phpPgAdmin)
+// All tables should not have any prefix!
+$modversion['sqlfile']['mysql'] = "sql/mysql.sql";
+//$modversion['sqlfile']['postgresql'] = "sql/pgsql.sql";
+
+// Tables created by sql file (without prefix!)
+$modversion['tables'][0] = "mylinks_broken";
+$modversion['tables'][1] = "mylinks_cat";
+$modversion['tables'][2] = "mylinks_links";
+$modversion['tables'][3] = "mylinks_mod";
+$modversion['tables'][4] = "mylinks_text";
+$modversion['tables'][5] = "mylinks_votedata";
+
+// Admin things
+$modversion['hasAdmin'] = 1;
+$modversion['adminindex'] = "admin/index.php";
+$modversion['adminmenu'] = "admin/menu.php";
+
+// Blocks
+$modversion['blocks'][1]['file'] = "mylinks_top.php";
+$modversion['blocks'][1]['name'] = _MI_MYLINKS_BNAME1;
+$modversion['blocks'][1]['description'] = "Shows recently added web links";
+$modversion['blocks'][1]['show_func'] = "b_mylinks_top_show";
+$modversion['blocks'][1]['edit_func'] = "b_mylinks_top_edit";
+$modversion['blocks'][1]['options'] = "date|10|25";
+$modversion['blocks'][1]['template'] = 'mylinks_block_new.html';
+
+$modversion['blocks'][2]['file'] = "mylinks_top.php";
+$modversion['blocks'][2]['name'] = _MI_MYLINKS_BNAME2;
+$modversion['blocks'][2]['description'] = "Shows most visited web links";
+$modversion['blocks'][2]['show_func'] = "b_mylinks_top_show";
+$modversion['blocks'][2]['edit_func'] = "b_mylinks_top_edit";
+$modversion['blocks'][2]['options'] = "hits|10|25";
+$modversion['blocks'][2]['template'] = 'mylinks_block_top.html';
+
+// Menu
+$modversion['hasMain'] = 1;
+$modversion['sub'][1]['name'] = _MI_MYLINKS_SMNAME1;
+$modversion['sub'][1]['url'] = "submit.php";
+$modversion['sub'][2]['name'] = _MI_MYLINKS_SMNAME2;
+$modversion['sub'][2]['url'] = "topten.php?hit=1";
+$modversion['sub'][3]['name'] = _MI_MYLINKS_SMNAME3;
+$modversion['sub'][3]['url'] = "topten.php?rate=1";
+
+// Search
+$modversion['hasSearch'] = 1;
+$modversion['search']['file'] = "include/search.inc.php";
+$modversion['search']['func'] = "mylinks_search";
+
+// Comments
+$modversion['hasComments'] = 1;
+$modversion['comments']['itemName'] = 'lid';
+$modversion['comments']['pageName'] = 'singlelink.php';
+$modversion['comments']['extraParams'] = array('cid');
+// Comment callback functions
+$modversion['comments']['callbackFile'] = 'include/comment_functions.php';
+$modversion['comments']['callback']['approve'] = 'mylinks_com_approve';
+$modversion['comments']['callback']['update'] = 'mylinks_com_update';
+
+// Templates
+$modversion['templates'][1]['file'] = 'mylinks_brokenlink.html';
+$modversion['templates'][1]['description'] = '';
+$modversion['templates'][2]['file'] = 'mylinks_link.html';
+$modversion['templates'][2]['description'] = '';
+$modversion['templates'][3]['file'] = 'mylinks_index.html';
+$modversion['templates'][3]['description'] = '';
+$modversion['templates'][4]['file'] = 'mylinks_modlink.html';
+$modversion['templates'][4]['description'] = '';
+$modversion['templates'][5]['file'] = 'mylinks_ratelink.html';
+$modversion['templates'][5]['description'] = '';
+$modversion['templates'][6]['file'] = 'mylinks_singlelink.html';
+$modversion['templates'][6]['description'] = '';
+$modversion['templates'][7]['file'] = 'mylinks_submit.html';
+$modversion['templates'][7]['description'] = '';
+$modversion['templates'][8]['file'] = 'mylinks_topten.html';
+$modversion['templates'][8]['description'] = '';
+$modversion['templates'][9]['file'] = 'mylinks_viewcat.html';
+$modversion['templates'][9]['description'] = '';
+
+// Config Settings (only for modules that need config settings generated automatically)
+
+// name of config option for accessing its specified value. i.e. $xoopsModuleConfig['storyhome']
+$modversion['config'][1]['name'] = 'popular';
+
+// title of this config option displayed in config settings form
+$modversion['config'][1]['title'] = '_MI_MYLINKS_POPULAR';
+
+// description of this config option displayed under title
+$modversion['config'][1]['description'] = '_MI_MYLINKS_POPULARDSC';
+
+// form element type used in config form for this option. can be one of either textbox, textarea, select, select_multi, yesno, group, group_multi
+$modversion['config'][1]['formtype'] = 'select';
+
+// value type of this config option. can be one of either int, text, float, array, or other
+// form type of 'group_multi', 'select_multi' must always be 'array'
+// form type of 'yesno', 'group' must be always be 'int'
+$modversion['config'][1]['valuetype'] = 'int';
+
+// the default value for this option
+// ignore it if no default
+// 'yesno' formtype must be either 0(no) or 1(yes)
+$modversion['config'][1]['default'] = 100;
+
+// options to be displayed in selection box
+// required and valid for 'select' or 'select_multi' formtype option only
+// language constants can be used for both array keys and values
+$modversion['config'][1]['options'] = array('5' => 5, '10' => 10, '50' => 50, '100' => 100, '200' => 200, '500' => 500, '1000' => 1000);
+
+
+$modversion['config'][2]['name'] = 'newlinks';
+$modversion['config'][2]['title'] = '_MI_MYLINKS_NEWLINKS';
+$modversion['config'][2]['description'] = '_MI_MYLINKS_NEWLINKSDSC';
+$modversion['config'][2]['formtype'] = 'select';
+$modversion['config'][2]['valuetype'] = 'int';
+$modversion['config'][2]['default'] = 10;
+$modversion['config'][2]['options'] = array('5' => 5, '10' => 10, '15' => 15, '20' => 20, '25' => 25, '30' => 30, '50' => 50);
+
+$modversion['config'][3]['name'] = 'perpage';
+$modversion['config'][3]['title'] = '_MI_MYLINKS_PERPAGE';
+$modversion['config'][3]['description'] = '_MI_MYLINKS_PERPAGEDSC';
+$modversion['config'][3]['formtype'] = 'select';
+$modversion['config'][3]['valuetype'] = 'int';
+$modversion['config'][3]['default'] = 10;
+$modversion['config'][3]['options'] = array('5' => 5, '10' => 10, '15' => 15, '20' => 20, '25' => 25, '30' => 30, '50' => 50);
+
+$modversion['config'][4]['name'] = 'anonpost';
+$modversion['config'][4]['title'] = '_MI_MYLINKS_ANONPOST';
+$modversion['config'][4]['description'] = '';
+$modversion['config'][4]['formtype'] = 'yesno';
+$modversion['config'][4]['valuetype'] = 'int';
+$modversion['config'][4]['default'] = 0;
+
+$modversion['config'][5]['name'] = 'autoapprove';
+$modversion['config'][5]['title'] = '_MI_MYLINKS_AUTOAPPROVE';
+$modversion['config'][5]['description'] = '_MI_MYLINKS_AUTOAPPROVEDSC';
+$modversion['config'][5]['formtype'] = 'yesno';
+$modversion['config'][5]['valuetype'] = 'int';
+$modversion['config'][5]['default'] = 0;
+
+$modversion['config'][6]['name'] = 'frame';
+$modversion['config'][6]['title'] = '_MI_MYLINKS_USEFRAMES';
+$modversion['config'][6]['description'] = '_MI_MYLINKS_USEFRAMEDSC';
+$modversion['config'][6]['formtype'] = 'yesno';
+$modversion['config'][6]['valuetype'] = 'int';
+$modversion['config'][6]['default'] = 0;
+
+$modversion['config'][7]['name'] = 'useshots';
+$modversion['config'][7]['title'] = '_MI_MYLINKS_USESHOTS';
+$modversion['config'][7]['description'] = '_MI_MYLINKS_USESHOTSDSC';
+$modversion['config'][7]['formtype'] = 'yesno';
+$modversion['config'][7]['valuetype'] = 'int';
+$modversion['config'][7]['default'] = 0;
+
+$modversion['config'][8]['name'] = 'shotwidth';
+$modversion['config'][8]['title'] = '_MI_MYLINKS_SHOTWIDTH';
+$modversion['config'][8]['description'] = '_MI_MYLINKS_SHOTWIDTHDSC';
+$modversion['config'][8]['formtype'] = 'textbox';
+$modversion['config'][8]['valuetype'] = 'int';
+$modversion['config'][8]['default'] = 140;
+
+// Notification
+
+$modversion['hasNotification'] = 1;
+$modversion['notification']['lookup_file'] = 'include/notification.inc.php';
+$modversion['notification']['lookup_func'] = 'mylinks_notify_iteminfo';
+
+$modversion['notification']['category'][1]['name'] = 'global';
+$modversion['notification']['category'][1]['title'] = _MI_MYLINKS_GLOBAL_NOTIFY;
+$modversion['notification']['category'][1]['description'] = _MI_MYLINKS_GLOBAL_NOTIFYDSC;
+$modversion['notification']['category'][1]['subscribe_from'] = array('index.php','viewcat.php','singlelink.php');
+
+$modversion['notification']['category'][2]['name'] = 'category';
+$modversion['notification']['category'][2]['title'] = _MI_MYLINKS_CATEGORY_NOTIFY;
+$modversion['notification']['category'][2]['description'] = _MI_MYLINKS_CATEGORY_NOTIFYDSC;
+$modversion['notification']['category'][2]['subscribe_from'] = array('viewcat.php', 'singlelink.php');
+$modversion['notification']['category'][2]['item_name'] = 'cid';
+$modversion['notification']['category'][2]['allow_bookmark'] = 1;
+
+$modversion['notification']['category'][3]['name'] = 'link';
+$modversion['notification']['category'][3]['title'] = _MI_MYLINKS_LINK_NOTIFY;
+$modversion['notification']['category'][3]['description'] = _MI_MYLINKS_LINK_NOTIFYDSC;
+$modversion['notification']['category'][3]['subscribe_from'] = 'singlelink.php';
+$modversion['notification']['category'][3]['item_name'] = 'lid';
+$modversion['notification']['category'][3]['allow_bookmark'] = 1;
+
+$modversion['notification']['event'][1]['name'] = 'new_category';
+$modversion['notification']['event'][1]['category'] = 'global';
+$modversion['notification']['event'][1]['title'] = _MI_MYLINKS_GLOBAL_NEWCATEGORY_NOTIFY;
+$modversion['notification']['event'][1]['caption'] = _MI_MYLINKS_GLOBAL_NEWCATEGORY_NOTIFYCAP;
+$modversion['notification']['event'][1]['description'] = _MI_MYLINKS_GLOBAL_NEWCATEGORY_NOTIFYDSC;
+$modversion['notification']['event'][1]['mail_template'] = 'global_newcategory_notify';
+$modversion['notification']['event'][1]['mail_subject'] = _MI_MYLINKS_GLOBAL_NEWCATEGORY_NOTIFYSBJ;
+
+$modversion['notification']['event'][2]['name'] = 'link_modify';
+$modversion['notification']['event'][2]['category'] = 'global';
+$modversion['notification']['event'][2]['admin_only'] = 1;
+$modversion['notification']['event'][2]['title'] = _MI_MYLINKS_GLOBAL_LINKMODIFY_NOTIFY;
+$modversion['notification']['event'][2]['caption'] = _MI_MYLINKS_GLOBAL_LINKMODIFY_NOTIFYCAP;
+$modversion['notification']['event'][2]['description'] = _MI_MYLINKS_GLOBAL_LINKMODIFY_NOTIFYDSC;
+$modversion['notification']['event'][2]['mail_template'] = 'global_linkmodify_notify';
+$modversion['notification']['event'][2]['mail_subject'] = _MI_MYLINKS_GLOBAL_LINKMODIFY_NOTIFYSBJ;
+
+$modversion['notification']['event'][3]['name'] = 'link_broken';
+$modversion['notification']['event'][3]['category'] = 'global';
+$modversion['notification']['event'][3]['admin_only'] = 1;
+$modversion['notification']['event'][3]['title'] = _MI_MYLINKS_GLOBAL_LINKBROKEN_NOTIFY;
+$modversion['notification']['event'][3]['caption'] = _MI_MYLINKS_GLOBAL_LINKBROKEN_NOTIFYCAP;
+$modversion['notification']['event'][3]['description'] = _MI_MYLINKS_GLOBAL_LINKBROKEN_NOTIFYDSC;
+$modversion['notification']['event'][3]['mail_template'] = 'global_linkbroken_notify';
+$modversion['notification']['event'][3]['mail_subject'] = _MI_MYLINKS_GLOBAL_LINKBROKEN_NOTIFYSBJ;
+
+$modversion['notification']['event'][4]['name'] = 'link_submit';
+$modversion['notification']['event'][4]['category'] = 'global';
+$modversion['notification']['event'][4]['admin_only'] = 1;
+$modversion['notification']['event'][4]['title'] = _MI_MYLINKS_GLOBAL_LINKSUBMIT_NOTIFY;
+$modversion['notification']['event'][4]['caption'] = _MI_MYLINKS_GLOBAL_LINKSUBMIT_NOTIFYCAP;
+$modversion['notification']['event'][4]['description'] = _MI_MYLINKS_GLOBAL_LINKSUBMIT_NOTIFYDSC;
+$modversion['notification']['event'][4]['mail_template'] = 'global_linksubmit_notify';
+$modversion['notification']['event'][4]['mail_subject'] = _MI_MYLINKS_GLOBAL_LINKSUBMIT_NOTIFYSBJ;
+
+$modversion['notification']['event'][5]['name'] = 'new_link';
+$modversion['notification']['event'][5]['category'] = 'global';
+$modversion['notification']['event'][5]['title'] = _MI_MYLINKS_GLOBAL_NEWLINK_NOTIFY;
+$modversion['notification']['event'][5]['caption'] = _MI_MYLINKS_GLOBAL_NEWLINK_NOTIFYCAP;
+$modversion['notification']['event'][5]['description'] = _MI_MYLINKS_GLOBAL_NEWLINK_NOTIFYDSC;
+$modversion['notification']['event'][5]['mail_template'] = 'global_newlink_notify';
+$modversion['notification']['event'][5]['mail_subject'] = _MI_MYLINKS_GLOBAL_NEWLINK_NOTIFYSBJ;
+
+$modversion['notification']['event'][6]['name'] = 'link_submit';
+$modversion['notification']['event'][6]['category'] = 'category';
+$modversion['notification']['event'][6]['admin_only'] = 1;
+$modversion['notification']['event'][6]['title'] = _MI_MYLINKS_CATEGORY_LINKSUBMIT_NOTIFY;
+$modversion['notification']['event'][6]['caption'] = _MI_MYLINKS_CATEGORY_LINKSUBMIT_NOTIFYCAP;
+$modversion['notification']['event'][6]['description'] = _MI_MYLINKS_CATEGORY_LINKSUBMIT_NOTIFYDSC;
+$modversion['notification']['event'][6]['mail_template'] = 'category_linksubmit_notify';
+$modversion['notification']['event'][6]['mail_subject'] = _MI_MYLINKS_CATEGORY_LINKSUBMIT_NOTIFYSBJ;
+
+$modversion['notification']['event'][7]['name'] = 'new_link';
+$modversion['notification']['event'][7]['category'] = 'category';
+$modversion['notification']['event'][7]['title'] = _MI_MYLINKS_CATEGORY_NEWLINK_NOTIFY;
+$modversion['notification']['event'][7]['caption'] = _MI_MYLINKS_CATEGORY_NEWLINK_NOTIFYCAP;
+$modversion['notification']['event'][7]['description'] = _MI_MYLINKS_CATEGORY_NEWLINK_NOTIFYDSC;
+$modversion['notification']['event'][7]['mail_template'] = 'category_newlink_notify';
+$modversion['notification']['event'][7]['mail_subject'] = _MI_MYLINKS_CATEGORY_NEWLINK_NOTIFYSBJ;
+
+$modversion['notification']['event'][8]['name'] = 'approve';
+$modversion['notification']['event'][8]['category'] = 'link';
+$modversion['notification']['event'][8]['invisible'] = 1;
+$modversion['notification']['event'][8]['title'] = _MI_MYLINKS_LINK_APPROVE_NOTIFY;
+$modversion['notification']['event'][8]['caption'] = _MI_MYLINKS_LINK_APPROVE_NOTIFYCAP;
+$modversion['notification']['event'][8]['description'] = _MI_MYLINKS_LINK_APPROVE_NOTIFYDSC;
+$modversion['notification']['event'][8]['mail_template'] = 'link_approve_notify';
+$modversion['notification']['event'][8]['mail_subject'] = _MI_MYLINKS_LINK_APPROVE_NOTIFYSBJ;
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/comment_reply.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/comment_reply.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/comment_reply.php	(revision 405)
@@ -0,0 +1,29 @@
+<?php
+// $Id: comment_reply.php,v 1.2 2005/03/18 12:52:24 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+include '../../mainfile.php';
+include XOOPS_ROOT_PATH.'/include/comment_reply.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/images/shots/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/images/shots/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/images/shots/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/images/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/images/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/images/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/comment_delete.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/comment_delete.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/comment_delete.php	(revision 405)
@@ -0,0 +1,29 @@
+<?php
+// $Id: comment_delete.php,v 1.2 2005/03/18 12:52:24 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+include '../../mainfile.php';
+include XOOPS_ROOT_PATH.'/include/comment_delete.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/blocks/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/blocks/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/blocks/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/blocks/mylinks_top.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/blocks/mylinks_top.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/blocks/mylinks_top.php	(revision 405)
@@ -0,0 +1,75 @@
+<?php
+// $Id: mylinks_top.php,v 1.4 2005/08/03 12:39:13 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+/******************************************************************************
+ * Function: b_mylinks_top_show
+ * Input   : $options[0] = date for the most recent links
+ *                    hits for the most popular links
+ *           $block['content'] = The optional above content
+ *           $options[1]   = How many reviews are displayes
+ * Output  : Returns the desired most recent or most popular links
+ ******************************************************************************/
+function b_mylinks_top_show($options) {
+    global $xoopsDB;
+    $block = array();
+    $myts =& MyTextSanitizer::getInstance();
+    $result = $xoopsDB->query("SELECT lid, cid, title, date, hits FROM ".$xoopsDB->prefix("mylinks_links")." WHERE status>0 ORDER BY ".$options[0]." DESC",$options[1],0);
+    while($myrow = $xoopsDB->fetchArray($result)){
+        $link = array();
+        $title = $myts->makeTboxData4Show($myrow["title"]);
+        if ( !XOOPS_USE_MULTIBYTES ) {
+            if (strlen($myrow['title']) >= $options[2]) {
+                $title = $myts->makeTboxData4Show(substr($myrow['title'],0,($options[2] -1)))."...";
+            }
+        }
+        $link['id'] = $myrow['lid'];
+        $link['cid'] = $myrow['cid'];
+        $link['title'] = $title;
+        if($options[0] == "date"){
+            $link['date'] = formatTimestamp($myrow['date'],'s');
+        }elseif($options[0] == "hits"){
+            $link['hits'] = $myrow['hits'];
+        }
+        $block['links'][] = $link;
+    }
+    return $block;
+}
+
+function b_mylinks_top_edit($options) {
+    $form = ""._MB_MYLINKS_DISP."&nbsp;";
+    $form .= "<input type='hidden' name='options[]' value='";
+    if($options[0] == "date"){
+        $form .= "date'";
+    }else {
+        $form .= "hits'";
+    }
+    $form .= " />";
+    $form .= "<input type='text' name='options[]' value='".$options[1]."' />&nbsp;"._MB_MYLINKS_LINKS."";
+    $form .= "&nbsp;<br />"._MB_MYLINKS_CHARS."&nbsp;<input type='text' name='options[]' value='".$options[2]."' />&nbsp;"._MB_MYLINKS_LENGTH."";
+
+    return $form;
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/header.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/header.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/header.php	(revision 405)
@@ -0,0 +1,34 @@
+<?php
+// $Id: header.php,v 1.2 2005/03/18 12:52:24 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+// Based on:								     //
+// myPHPNUKE Web Portal System - http://myphpnuke.com/	  		     //
+// PHP-NUKE Web Portal System - http://phpnuke.org/	  		     //
+// Thatware - http://thatware.org/					     //
+// ------------------------------------------------------------------------- //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+include "../../mainfile.php";
+include XOOPS_ROOT_PATH."/modules/mylinks/include/functions.php";
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mylinks/notification_update.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mylinks/notification_update.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mylinks/notification_update.php	(revision 405)
@@ -0,0 +1,4 @@
+<?php
+include '../../mainfile.php';
+include XOOPS_ROOT_PATH.'/include/notification_update.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/sections/language/japanese/modinfo.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/sections/language/japanese/modinfo.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/sections/language/japanese/modinfo.php	(revision 405)
@@ -0,0 +1,14 @@
+<?php
+// Module Info
+
+// The name of this module
+define("_MI_SECTIONS_NAME","¥»¥¯¥·¥ç¥ó");
+
+// A brief description of this module
+define("_MI_SECTIONS_DESC","µ­»ö¤ä¥«¥¿¥í¥°¤Ê¤É¤ò·ÇºÜ¤¹¤ë¥»¥¯¥·¥ç¥ó¤òºîÀ®¤·¤Þ¤¹¡£");
+
+// Names of blocks for this module (Not all module has blocks)
+//define("_MI_","");
+
+define("_MI_SECT_ADMENU1","¥»¥¯¥·¥ç¥ó¤Î°ìÍ÷");
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/sections/language/japanese/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/sections/language/japanese/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/sections/language/japanese/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/sections/language/japanese/main.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/sections/language/japanese/main.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/sections/language/japanese/main.php	(revision 405)
@@ -0,0 +1,49 @@
+<?php
+define("_AM_SECCONF","¥»¥¯¥·¥ç¥ó ÀßÄê");
+define("_MD_MUSTREGFIRST","ÊÑ¹¹¥ê¥¯¥¨¥¹¥È¤òÁ÷¿®¤¹¤ë¤Ë¤Ï²ñ°÷¤È¤·¤Æ¥í¥°¥¤¥ó¤¹¤ëÉ¬Í×¤¬¤¢¤ê¤Þ¤¹¡£");
+
+define("_MD_WELCOMETOSEC","");  // %s is your site name
+define("_MD_HEREUCANFIND",""); 
+define("_MD_THISISSECTION","<b>%s</b>");  // %s is a section name
+define("_MD_THEFOLLOWING","¤³¤Î¥»¥¯¥·¥ç¥ó¤Ë¤Ï°Ê²¼¤Îµ­»ö¤¬¤¢¤ê¤Þ¤¹");
+define("_MD_PRINTERPAGE","°õºþÍÑ¥Ú¡¼¥¸");
+define("_MD_RETURN2INDEX","¥á¥¤¥ó¤ËÌá¤ë");
+define("_MD_BACK2SEC","%s¤ØÌá¤ë");
+define("_MD_NEXTPAGE","¼¡¤Î¥Ú¡¼¥¸");
+define("_MD_PREVPAGE","Á°¤Î¥Ú¡¼¥¸");
+define("_MD_COMESFROM","%s¤Ë¤Æ¹¹¤ËÂ¿¤¯¤Îµ­»ö¤òÆÉ¤à¤³¤È¤¬¤Ç¤­¤Þ¤¹");
+define("_MD_URLFORTHIS","¤³¤Î¥Ë¥å¡¼¥¹µ­»ö¤¬·ÇºÜ¤µ¤ì¤Æ¤¤¤ëURL¡§");
+
+define("_MD_CURACTIVESEC","¥»¥¯¥·¥ç¥ó°ìÍ÷");
+define("_MD_CLICK2EDIT","ÊÔ½¸¤¹¤ë¤Ë¤Ï¥»¥¯¥·¥ç¥óÌ¾¤ò¥¯¥ê¥Ã¥¯¤·¤Æ¤¯¤À¤µ¤¤");
+define("_MD_ADDARTICLE","¥»¥¯¥·¥ç¥óÆâ¤Ëµ­»ö¤òÄÉ²Ã¤¹¤ë");
+define("_MD_TITLEC","É½Âê¡§");
+define("_MD_CONTENTC","ËÜÊ¸¡§");
+define("_MD_DOADDARTICLE","Á÷¿®");
+define("_MD_LAST20ART","ºÇ¿·20µ­»ö");
+define("_MD_EDIT","ÊÔ½¸");
+define("_MD_EDITARTID","ÊÔ½¸¤¹¤ëµ­»öID:");
+define("_MD_GO","Á÷¿®");
+define("_MD_ADDNEWSEC","¿·µ¬¥»¥¯¥·¥ç¥ó¤ÎÄÉ²Ã");
+define("_MD_SECNAMEC","¥»¥¯¥·¥ç¥óÌ¾¡§");
+define("_MD_MAXCHAR","¡ÊºÇÂçÁ´³Ñ20Ê¸»ú¡Ë");
+define("_MD_SECIMAGEC","²èÁü¥Õ¥¡¥¤¥ë¡§");
+define("_MD_EXIMAGE","¡ÊÎã: opinion.gif¡Ë");
+define("_MD_GOADDSECTION","Á÷¿®");
+define("_MD_EDITARTICLE","µ­»ö¤ÎÊÔ½¸");
+define("_MD_SAVECHANGES","ÊÑ¹¹¤òÊÝÂ¸");
+define("_MD_DELETE","ºï½ü");
+define("_MD_EDITTHISSEC","ÊÔ½¸¤¹¤ë¥»¥¯¥·¥ç¥ó¡§ %s"); // %s is a section name
+define("_MD_THISSECHAS","Åö¥»¥¯¥·¥ç¥óÆâ¤Ë¤Ï%s·ï¤Îµ­»ö¤¬¤¢¤ê¤Þ¤¹");
+define("_MD_RUSUREDELSEC","¤³¤Î¥»¥¯¥·¥ç¥ó¤òºï½ü¤·¤Æ¤â¤¤¤¤¤Ç¤¹¤«¡©");
+define("_MD_THISDELETESALL","¥»¥¯¥·¥ç¥ó¤òºï½ü¤¹¤ë¤È¡¢¥»¥¯¥·¥ç¥óÆâ¤ÎÁ´¤Æ¤Îµ­»ö¤âºï½ü¤µ¤ì¤Þ¤¹¡£");
+define("_MD_YES","¤Ï¤¤");
+define("_MD_NO","¤¤¤¤¤¨");
+define("_MD_DELETETHISART","ºï½ü¤¹¤ëµ­»ö¡§ %s"); // %s is a section name
+define("_MD_RUSUREDELART","¤³¤Îµ­»ö¤òºï½ü¤·¤Æ¤â¤¤¤¤¤Ç¤¹¤«¡©");
+define("_MD_DBUPDATED","¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò¹¹¿·¤·¤Þ¤·¤¿¡£");
+
+define("_MD_ERRORSECNAME", "¥»¥¯¥·¥ç¥óÌ¾¤¬ÆþÎÏ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
+define("_MD_DBNOTUPDATED","µ­»ö¤òÄÉ²Ã¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£<br/ >¥»¥¯¥·¥ç¥ó¤¬ÁªÂò¤µ¤ì¤Æ¤¤¤ë¤«³ÎÇ§¤·¤Æ¤¯¤À¤µ¤¤¡£");
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/sections/language/english/modinfo.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/sections/language/english/modinfo.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/sections/language/english/modinfo.php	(revision 405)
@@ -0,0 +1,16 @@
+<?php
+// $Id: modinfo.php,v 1.2 2005/03/18 12:52:38 onokazu Exp $
+// Module Info
+
+// The name of this module
+define("_MI_SECTIONS_NAME","Sections");
+
+// A brief description of this module
+define("_MI_SECTIONS_DESC","Creates a section where admins can post various articles.");
+
+// Names of blocks for this module (Not all module has blocks)
+//define("_MI_","");
+
+// Names of admin menu items
+define("_MI_SECT_ADMENU1","List Sections");
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/sections/language/english/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/sections/language/english/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/sections/language/english/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/sections/language/english/main.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/sections/language/english/main.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/sections/language/english/main.php	(revision 405)
@@ -0,0 +1,47 @@
+<?php
+// $Id: main.php,v 1.4 2005/08/03 12:39:15 onokazu Exp $
+define("_AM_SECCONF","Sections Configuration");
+define("_MD_MUSTREGFIRST","You need to be a registered user or logged in to send a modify request.<br />Please register or login first!");
+define("_MD_WELCOMETOSEC","Welcome to the Special Sections at %s");  // %s is your site name
+define("_MD_HEREUCANFIND","Here you can find some cool articles that are not presented on the homepage.");
+define("_MD_THISISSECTION","This is Section <b>%s</b>");  // %s is a section name
+define("_MD_THEFOLLOWING","The following are articles published in this section.");
+define("_MD_PRINTERPAGE","Printer Friendly Page");
+define("_MD_RETURN2INDEX","Return to Sections Index");
+define("_MD_BACK2SEC","Back to %s");
+define("_MD_NEXTPAGE","Next Page");
+define("_MD_PREVPAGE","Previous Page");
+define("_MD_COMESFROM","This article comes from %s");
+define("_MD_URLFORTHIS","The URL for this story is:");
+
+define("_MD_CURACTIVESEC","Current Active Sections");
+define("_MD_CLICK2EDIT","Click to Edit");
+define("_MD_ADDARTICLE","Add Article in Sections");
+define("_MD_TITLEC","Title:");
+define("_MD_CONTENTC","Content:");
+define("_MD_DOADDARTICLE","Add Article!");
+define("_MD_LAST20ART","Last 20 Articles");
+define("_MD_EDIT","Edit");
+define("_MD_EDITARTID","Edit Article ID:");
+define("_MD_GO","Go!");
+define("_MD_ADDNEWSEC","Add a New Section");
+define("_MD_SECNAMEC","Section Name:");
+define("_MD_MAXCHAR","(40 characters Max.)");
+define("_MD_SECIMAGEC","Section Image:");
+define("_MD_EXIMAGE","(example: opinion.gif)");
+define("_MD_GOADDSECTION","Add Section!");
+define("_MD_EDITARTICLE","Edit Article");
+define("_MD_SAVECHANGES","Save Changes");
+define("_MD_DELETE","Delete");
+define("_MD_EDITTHISSEC","Edit Section: %s"); // %s is a section name
+define("_MD_THISSECHAS","This Section has %s articles attached");
+define("_MD_RUSUREDELSEC","Are you sure you want to delete section?");
+define("_MD_THISDELETESALL","This will delete ALL its articles!");
+define("_MD_YES","Yes");
+define("_MD_NO","No");
+define("_MD_DELETETHISART","Delete Article: %s"); // %s is a section name
+define("_MD_RUSUREDELART","Are you sure you want to delete article?");
+define("_MD_DBUPDATED","Database Updated Successfully!");
+define("_MD_ERRORSECNAME", "You must enter a section name!");
+define("_MD_DBNOTUPDATED","Error adding article to the database.<br/>Did you select a section? Please go back and correct the form.");
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/sections/language/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/sections/language/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/sections/language/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/sections/xoops_version.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/sections/xoops_version.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/sections/xoops_version.php	(revision 405)
@@ -0,0 +1,55 @@
+<?php
+// $Id: xoops_version.php,v 1.2 2005/03/18 12:52:38 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+$modversion['name'] = _MI_SECTIONS_NAME;
+$modversion['version'] = 1.00;
+$modversion['description'] = _MI_SECTIONS_DESC;
+$modversion['credits'] = "The XOOPS Project";
+$modversion['author'] = "Francisco Burzi<br />( http://www.phpnuke.org/ )";
+$modversion['help'] = "sections.html";
+$modversion['license'] = "GPL see LICENSE";
+$modversion['official'] = 1;
+$modversion['image'] = "images/sections_slogo.png";
+$modversion['dirname'] = "sections";
+
+// Sql file (must contain sql generated by phpMyAdmin or phpPgAdmin)
+// All tables should not have any prefix!
+$modversion['sqlfile']['mysql'] = "sql/mysql.sql";
+//$modversion['sqlfile']['postgresql'] = "sql/pgsql.sql";
+
+// Tables created by sql file (without prefix!)
+$modversion['tables'][0] = "seccont";
+$modversion['tables'][1] = "sections";
+
+// Admin things
+$modversion['hasAdmin'] = 1;
+$modversion['adminindex'] = "admin/index.php";
+$modversion['adminmenu'] = "admin/menu.php";
+
+// Menu
+$modversion['hasMain'] = 1;
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/sections/images/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/sections/images/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/sections/images/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/sections/admin/menu.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/sections/admin/menu.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/sections/admin/menu.php	(revision 405)
@@ -0,0 +1,30 @@
+<?php
+// $Id: menu.php,v 1.2 2005/03/18 12:52:38 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+$adminmenu[0]['title'] = _MI_SECT_ADMENU1;
+$adminmenu[0]['link'] = "admin/index.php";
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/sections/admin/index.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/sections/admin/index.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/sections/admin/index.php	(revision 405)
@@ -0,0 +1,312 @@
+<?php
+// $Id: index.php,v 1.6 2005/09/04 20:46:11 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+// Based on:                                     //
+// myPHPNUKE Web Portal System - http://myphpnuke.com/               //
+// PHP-NUKE Web Portal System - http://phpnuke.org/              //
+// Thatware - http://thatware.org/                       //
+// ------------------------------------------------------------------------- //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+include '../../../include/cp_header.php';
+if ( file_exists("../language/".$xoopsConfig['language']."/main.php") ) {
+    include "../language/".$xoopsConfig['language']."/main.php";
+} else {
+    include "../language/english/main.php";
+}
+/*********************************************************/
+/* Sections Manager Functions                            */
+/*********************************************************/
+
+function sections() {
+    global $xoopsConfig, $xoopsDB, $xoopsModule;
+    xoops_cp_header();
+    echo "<h4>"._AM_SECCONF."</h4>";
+    $result = $xoopsDB->query("select secid, secname from ".$xoopsDB->prefix("sections")." order by secid");
+    if ($xoopsDB->getRowsNum($result) > 0) {
+        $myts =& MyTextSanitizer::getInstance();
+        echo "<hr />
+        <b><center>"._MD_CURACTIVESEC."</b><br />"._MD_CLICK2EDIT."<br />
+        <table border='0' width='100%' align='center' cellpadding='1'><tr><td align='center'>";
+        echo "<ul>";
+        while(list($secid, $secname) = $xoopsDB->fetchRow($result)) {
+            $secname=$myts->makeTboxData4Show($secname);
+            echo "<li><a href=\"index.php?op=sectionedit&amp;secid=".$secid."\">".$secname."</a></li>";
+        }
+        echo "</ul>";
+        echo "</td></tr></table>";
+    ?>
+        <br />
+        <hr /><h4><?php echo _MD_ADDARTICLE; ?></h4>
+        <br /><br />
+    <?php echo "<form action=\"index.php\" method=\"post\">"; ?><br />
+    <b><?php echo _MD_TITLEC; ?></b><br />
+    <input class=textbox type="text" name="title" size=60 value=""><br /><br />
+    <?php
+    $result = $xoopsDB->query("select secid, secname from ".$xoopsDB->prefix("sections")." order by secid");
+    $checked = " checked='checked'"; // select first section by default
+    while(list($secid, $secname) = $xoopsDB->fetchRow($result)) {
+        $secname=$myts->makeTboxData4Show($secname);
+        echo "<input type='radio' name='secid' value='$secid'$checked />$secname<br />";
+        $checked = '';
+    } ?>
+    <br />
+    <b><?php echo _MD_CONTENTC; ?></b><br />
+    <textarea class="textbox" name="content" cols="60" rows="10"></textarea><br /><br />
+    <?php echo _MULTIPAGE ?><br/><br />
+    <input type="hidden" name="op" value="secarticleadd" />
+    <input type="submit" value="<?php echo _MD_DOADDARTICLE; ?>" />
+    </form>
+    <br />
+    <hr /><h4><?php echo _MD_LAST20ART; ?></h4>
+    <br /><br />
+    <ul>
+    <?php
+    $result = $xoopsDB->query("select artid, secid, title from ".$xoopsDB->prefix("seccont")." order by artid desc",20,0);
+    while ( list($artid, $secid, $title) = $xoopsDB->fetchRow($result) ) {
+        $title = $myts->makeTboxData4Show($title);
+        $result2 = $xoopsDB->query("select secid, secname from ".$xoopsDB->prefix("sections")." where secid='$secid'");
+        list($secid, $secname) = $xoopsDB->fetchRow($result2);
+        $secname = $myts->makeTboxData4Show($secname);
+        echo "<li>$title ($secname) [ <a href=index.php?op=secartedit&amp;artid=$artid>"._MD_EDIT."</a> ]</li>";
+    } ?>
+    </ul>
+    <?php echo "<form action=\"index.php\" method=\"post\">"; ?>
+    <?php echo _MD_EDITARTID; ?> <input class="textbox" type="text" NAME="artid" size="10" />
+    <input type="hidden" name="op" value="secartedit" />
+    <input type="submit" value="<?php echo _MD_GO;?>" />
+    </form>
+<?php
+    }
+    echo "<br />";  ?>
+    <hr /><h4><?php echo _MD_ADDNEWSEC; ?></h4>
+    <br /><br />
+    <?php echo "<form action=\"index.php\" method=\"post\">"; ?><br />
+    <b><?php echo _MD_SECNAMEC; ?></b>  <?php echo _MD_MAXCHAR; ?><br />
+    <input class="textbox" type="text" name="secname" size="40" maxlength="40" /><br /><br />
+    <b><?php echo _MD_SECIMAGEC; ?></b>&nbsp;<?php echo _MD_EXIMAGE; ?><br />
+    <input class="textbox" type="text" name="image" size="40" maxlength="50" /><br /><br />
+    <input type="hidden" name="op" value="sectionmake" />
+    <input type="submit" value="<?php echo _MD_GOADDSECTION; ?>" />
+    </form>
+<?php
+}
+
+function secartedit($artid) {
+    global $xoopsDB, $xoopsConfig, $xoopsModule;
+    $myts =& MyTextSanitizer::getInstance();
+    xoops_cp_header();
+    echo "<h4>"._AM_SECCONF."</h4>";
+    $result = $xoopsDB->query("select artid, secid, title, content from ".$xoopsDB->prefix("seccont")." where artid='$artid'");
+    list($artid, $secid, $title, $content) = $xoopsDB->fetchRow($result);
+    $title = $myts->makeTboxData4Edit($title);
+    $content = $myts->makeTareaData4Edit($content);
+    ?>
+    <hr /><h4><?php echo _MD_EDITARTICLE; ?></h4>
+    <br /><br />
+    <?php echo "<form action=\"index.php\" method=\"post\">"; ?><br />
+    <b><?php echo _MD_TITLEC; ?></b><br />
+    <input class="textbox" type="text" name="title" size="60" value="<?php echo "$title"; ?>" /><br /><br />
+    <?php
+    $result2 = $xoopsDB->query("select secid, secname from ".$xoopsDB->prefix("sections")." order by secname");
+    while(list($secid2, $secname) = $xoopsDB->fetchRow($result2)) {
+    $secname = $myts->makeTboxData4Show($secname);
+        if ($secid2==$secid) { $che = " checked='checked'"; }
+        echo "<input type='radio' name='secid' value='$secid2'$che />$secname<br />";
+        $che = "";
+    } ?>
+    <br />
+    <b><?php echo _MD_CONTENTC; ?></b><br />
+    <textarea class="textbox" name="content" cols="60" rows="10"><?php echo "$content"; ?></textarea>
+    <input type="hidden" name="artid" value="<?php echo "$artid"; ?>" />
+    <input type="hidden" name="op" value="secartchange" />
+    <table border="0"><tr><td>
+    <input type="submit" value="<?php echo _MD_SAVECHANGES; ?>" />
+    </form></td><td>
+    <?php echo "<form action=\"index.php\" method=\"post\">"; ?>
+    <input type="hidden" name="artid" value="<?php echo "$artid"; ?>" />
+    <input type="hidden" name="op" value="secartdelete" />
+    <input type="submit" value="<?php echo _MD_DELETE; ?>" />
+    </form></td></tr></table>
+<?php
+}
+
+function sectionedit($secid) {
+    global $xoopsDB, $xoopsConfig, $xoopsModule;
+    xoops_cp_header();
+    echo "<h4>"._AM_SECCONF."</h4><br />";
+    $myts =& MyTextSanitizer::getInstance();
+    $result = $xoopsDB->query("select secid, secname, image from ".$xoopsDB->prefix("sections")." where secid=$secid");
+    list($secid, $secname, $image) = $xoopsDB->fetchRow($result);
+    $secname = $myts->makeTboxData4Edit($secname);
+    $image = $myts->makeTboxData4Edit($image);
+    $result2 = $xoopsDB->query("select artid from ".$xoopsDB->prefix("seccont")." where secid=$secid");
+    $number = $xoopsDB->getRowsNum($result2);
+    ?>
+    <?php echo "<img src=\"".XOOPS_URL."/modules/sections/images/".$image."\" border=\"0\" /><br /><br />"; ?>
+    <h4><?php printf(_MD_EDITTHISSEC,$secname); ?></h4>
+    <br />
+     <?php
+      $help = sprintf(_MD_THISSECHAS,$number);
+      echo "$help";
+     ?>
+    <br /><br />
+    <?php echo "<form action=\"index.php\" method=\"post\">"; ?><br />
+    <b><?php echo _MD_SECNAMEC; ?></b> <?php echo _MD_MAXCHAR; ?><br />
+    <input class="textbox" type="text" name="secname" size="40" maxlength="40" value="<?php echo "$secname"; ?>" /><br /><br />
+    <b><?php echo _MD_SECIMAGEC; ?></b> <?php echo _MD_EXIMAGE; ?><br />
+    <input class="textbox" type="text" name="image" size="40" maxlength="50" value="<?php echo "$image"; ?>" /><br /><br />
+    <input type="hidden" name="secid" value="<?php echo "$secid"; ?>" />
+    <input type="hidden" name="op" value="sectionchange" />
+    <table border="0"><tr><td>
+    <input type="submit" value="<?php echo _MD_SAVECHANGES; ?>" />
+    </form></td><td>
+    <?php echo "<form action=\"index.php\" method=\"post\">"; ?>
+    <input type="hidden" name="secid" value="<?php echo "$secid"; ?>" />
+    <input type="hidden" name="op" value="sectiondelete" />
+    <input type="submit" value="<?php echo _MD_DELETE; ?>" />
+    </form></td></tr></table>
+<?php
+}
+
+$op = '';
+
+if (isset($_GET['op'])) {
+    $op = trim($_GET['op']);
+    if (isset($_GET['artid'])) {
+        $artid = intval($_GET['artid']);
+    }
+    if (isset($_GET['secid'])) {
+        $secid = intval($_GET['secid']);
+    }
+} elseif (!empty($_POST['op'])) {
+    $op = $_POST['op'];
+    $secid = !empty($_POST['secid']) ? intval($_POST['secid']) : 0;
+}
+
+switch ($op) {
+case "sections":
+    sections();
+    break;
+case "sectionedit":
+    sectionedit($secid);
+    break;
+case "sectionmake":
+    $myts =& MyTextSanitizer::getInstance();
+    $secname = !empty($_POST['secname']) ? $myts->stripSlashesGPC($_POST['secname']) : '';
+    if (empty($secname)) {
+        redirect_header("index.php", 2, _MD_ERRORSECNAME);
+    }
+    $image = !empty($_POST['image']) ? $myts->stripSlashesGPC($_POST['image']) : '';
+    $newid = $xoopsDB->genId($xoopsDB->prefix("sections")."_secid_seq");
+    $xoopsDB->query("INSERT INTO ".$xoopsDB->prefix("sections")." (secid, secname, image) VALUES ($newid, ".$xoopsDB->quoteString($secname).", ".$xoopsDB->quoteString($image).")");
+    redirect_header("index.php?op=sections",2,_MD_DBUPDATED);
+    break;
+case "secartdelete":
+    xoops_cp_header();
+    echo "<h4>"._AM_SECCONF."</h4>";
+    $myts =& MyTextSanitizer::getInstance();
+    $artid = !empty($_POST['artid']) ? intval($_POST['artid']) : 0;
+    $result = $xoopsDB->query("select title from ".$xoopsDB->prefix("seccont")." where artid=$artid");
+    list($title) = $xoopsDB->fetchRow($result);
+    $title = $myts->makeTboxData4Show($title);
+    xoops_confirm(array('op' => 'secartdelete_ok', 'artid' => $artid), 'index.php', sprintf(_MD_DELETETHISART,$title).'<br /><br />'._MD_RUSUREDELART);
+    break;
+case 'secartdelete_ok':
+    $artid = !empty($_POST['artid']) ? intval($_POST['artid']) : 0;
+    if ($artid <= 0) {
+        redirect_header("index.php?op=sections",2,_MD_DBNOTUPDATED);
+    }
+    $sql = sprintf("DELETE FROM %s WHERE artid = %u", $xoopsDB->prefix("seccont"), $artid);
+    $xoopsDB->query($sql);
+    redirect_header("index.php?op=sections",2,_MD_DBUPDATED);
+    break;
+case "sectionchange":
+    if ($secid <= 0) {
+        redirect_header("index.php?op=sections",2,_MD_DBNOTUPDATED);
+    }
+    $myts =& MyTextSanitizer::getInstance();
+    $secname = !empty($_POST['secname']) ? $myts->stripSlashesGPC($_POST['secname']) : '';
+    if (empty($secname)) {
+        redirect_header("index.php", 2, _MD_ERRORSECNAME);
+    }
+    $image = !empty($_POST['image']) ? $myts->stripSlashesGPC($_POST['image']) : '';
+    $xoopsDB->query("update ".$xoopsDB->prefix("sections")." set secname=".$xoopsDB->quoteString($secname).", image=".$xoopsDB->quoteString($image)." where secid=$secid");
+    redirect_header("index.php?op=sections",2,_MD_DBUPDATED);
+    break;
+case "secarticleadd":
+    if ($secid <= 0) {
+        redirect_header("index.php?op=sections",2,_MD_DBNOTUPDATED);
+    }
+    $myts =& MyTextSanitizer::getInstance();
+    $title = !empty($_POST['title']) ? $myts->stripSlashesGPC($_POST['title']) : '';
+    $content = !empty($_POST['content']) ? $myts->stripSlashesGPC($_POST['content']) : '';
+    $newid = $xoopsDB->genId($xoopsDB->prefix("seccont")."_artid_seq");
+    $success = $xoopsDB->query("INSERT INTO ".$xoopsDB->prefix("seccont")." (artid, secid, title, content, counter) VALUES ($newid, $secid, ".$xoopsDB->quoteString($title).", ".$xoopsDB->quoteString($content).", 0)");
+    if ( !$success ) {
+        xoops_cp_header();
+        echo "<table width='100%' border='0' cellspacing='1' class='outer'><tr><td class=\"odd\">";
+        echo "<a href='./index.php'><h4>"._AM_SECCONF."</h4></a>";
+        echo _MD_DBNOTUPDATED;
+        echo"</td></tr></table>";
+        xoops_cp_footer();
+        exit();
+    }
+    redirect_header("index.php?op=sections",2,_MD_DBUPDATED);
+    break;
+case "secartedit":
+    $artid = !empty($_REQUEST['artid']) ? intval($_REQUEST['artid']) : 0;
+    if ($artid > 0) {
+        secartedit($artid);
+    }
+    break;
+case "secartchange":
+    $artid = !empty($_POST['artid']) ? intval($_POST['artid']) : 0;
+    if ($artid <= 0) {
+        redirect_header("index.php?op=sections",2,_MD_DBNOTUPDATED);
+    }
+    $myts =& MyTextSanitizer::getInstance();
+    $title = !empty($_POST['title']) ? $myts->stripSlashesGPC($_POST['title']) : '';
+    $content = !empty($_POST['content']) ? $myts->stripSlashesGPC($_POST['content']) : '';
+    $xoopsDB->query("update ".$xoopsDB->prefix("seccont")." set secid=$secid, title=".$xoopsDB->quoteString($title).", content=".$xoopsDB->quoteString($content)." where artid=$artid");
+    redirect_header("index.php?op=sections",2,_MD_DBUPDATED);
+    break;
+case "sectiondelete":
+    xoops_cp_header();
+    echo "<h4>"._AM_SECCONF."</h4>";
+    xoops_confirm(array('op' => 'sectiondelete_ok', 'secid' => $secid), 'index.php', _MD_RUSUREDELSEC.'<br />'._MD_THISDELETESALL);
+    break;
+case 'sectiondelete_ok':
+    $sql = sprintf("DELETE FROM %s WHERE secid = %u", $xoopsDB->prefix("seccont"), $secid);
+    $xoopsDB->query($sql);
+    $sql = sprintf("DELETE FROM %s WHERE secid = %u", $xoopsDB->prefix("sections"), $secid);
+    $xoopsDB->query($sql);
+    redirect_header("index.php?op=sections",2,_MD_DBUPDATED);
+    break;
+default:
+    sections();
+    break;
+}
+xoops_cp_footer();
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/sections/index.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/sections/index.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/sections/index.php	(revision 405)
@@ -0,0 +1,184 @@
+<?php
+// $Id: index.php,v 1.5 2005/09/04 20:46:11 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+// Based on:                                     //
+// myPHPNUKE Web Portal System - http://myphpnuke.com/               //
+// PHP-NUKE Web Portal System - http://phpnuke.org/              //
+// Thatware - http://thatware.org/                       //
+// ------------------------------------------------------------------------- //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+include 'header.php';
+
+function listsections()
+{
+    global $xoopsConfig, $xoopsDB, $xoopsUser, $xoopsTheme, $xoopsLogger, $xoopsModule, $xoopsTpl, $xoopsUserIsAdmin;
+    include XOOPS_ROOT_PATH.'/header.php';
+    $myts =& MyTextSanitizer::getInstance();
+    $result = $xoopsDB->query("SELECT secid, secname, image FROM ".$xoopsDB->prefix("sections")." ORDER BY secname");
+    echo "<div style='text-align: center;'>";
+    printf(_MD_WELCOMETOSEC,htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES));
+    echo "<br /><br />";
+    echo _MD_HEREUCANFIND.'<br /><br /><table border="0">';
+    $count = 0;
+    while ( list($secid, $secname, $image) = $xoopsDB->fetchRow($result) ) {
+        $secname = $myts->makeTboxData4Show($secname);
+        $image = $myts->makeTboxData4Show($image);
+        if ( $count == 2 ) {
+            echo "<tr>";
+            $count = 0;
+        }
+        echo "<td><a href='index.php?op=listarticles&amp;secid=$secid'><img src='images/$image' border='0' alt='$secname' /></a>";
+        $count++;
+        if ( $count == 2 ) {
+            echo "</tr>";
+        }
+        echo "</td>";
+    }
+    echo "</table></div>";
+    include '../../footer.php';
+}
+
+function listarticles($secid)
+{
+    global $xoopsConfig, $xoopsUser, $xoopsDB, $xoopsTheme, $xoopsLogger, $xoopsModule, $xoopsTpl, $xoopsUserIsAdmin;
+    include '../../header.php';
+    $myts =& MyTextSanitizer::getInstance();
+    $result = $xoopsDB->query("SELECT secname, image FROM ".$xoopsDB->prefix("sections")." WHERE secid=$secid");
+    list($secname, $image) = $xoopsDB->fetchRow($result);
+    $secname = $myts->makeTboxData4Show($secname);
+    $image = $myts->makeTboxData4Show($image);
+    $result = $xoopsDB->query("SELECT artid, secid, title, content, counter FROM ".$xoopsDB->prefix("seccont")." WHERE secid=$secid");
+    echo "<div><img src='images/$image' border='0' /><br /><br />";
+    printf(_MD_THISISSECTION,$secname);
+    echo "<br />"._MD_THEFOLLOWING."<br /><br /><table border='0'>";
+    while ( list($artid, $secid, $title, $content, $counter) = $xoopsDB->fetchRow($result) ) {
+        $title = $myts->makeTboxData4Show($title);
+        $content = $myts->makeTareaData4Show($content);
+        echo "<tr><td align='left'>&nbsp;&nbsp;<strong><big>&middot;</big></strong>&nbsp;<a href='index.php?op=viewarticle&amp;artid=$artid'>$title</a>";
+        printf(" (read: %s times)",$counter);
+        echo "<a href='index.php?op=printpage&amp;artid=$artid'>&nbsp;&nbsp;<img src='".XOOPS_URL."/modules/sections/images/print.gif' border='0' alt='" . _MD_PRINTERPAGE."' /></a></td></tr>";
+    }
+    echo "</table><br /><br /><br />[ <a href=index.php>"._MD_RETURN2INDEX."</a> ]</div>";
+    include '../../footer.php';
+}
+
+function viewarticle($artid,$page)
+{
+    global $xoopsConfig, $xoopsUser, $xoopsDB, $xoopsTheme, $xoopsLogger, $xoopsModule, $xoopsTpl, $xoopsUserIsAdmin;
+    include '../../header.php';
+    $myts =& MyTextSanitizer::getInstance();
+    $xoopsDB->queryF("UPDATE ".$xoopsDB->prefix("seccont")." SET counter=counter+1 WHERE artid=$artid");
+    $result = $xoopsDB->query("SELECT artid, secid, title, content, counter FROM ".$xoopsDB->prefix("seccont")." WHERE artid=$artid");
+    list($artid, $secid, $title, $content, $counter) = $xoopsDB->fetchRow($result);
+    $title = $myts->makeTboxData4Show($title);
+    $content = $myts->makeTareaData4Show($content);
+    $result2 = $xoopsDB->query("SELECT secid, secname FROM ".$xoopsDB->prefix("sections")." WHERE secid=$secid");
+    list($secid, $secname) = $xoopsDB->fetchRow($result2);
+    $secname = $myts->makeTboxData4Show($secname);
+    $words = count(explode(" ", $content));
+    //echo "<center>";
+    /* Rip the article into pages. Delimiter string is "[pagebreak]"  */
+    $contentpages = explode( "[pagebreak]", $content);
+    $pageno = count($contentpages);
+    /* Define the current page  */
+    if ( $page=="" || $page < 1 ) {
+        $page = 1;
+    }
+    if ( $page > $pageno ) {
+        $page = $pageno;
+    }
+    $arrayelement = (int)$page;
+    $arrayelement --;
+    echo "<table width='100%'><tr><td><b>$title</b><br /><br />";
+    if ( $page >= $pageno ) {
+        $next_page = '<a href="index.php">' ._MD_RETURN2INDEX.'</a>';
+    } else {
+        $next_pagenumber = $page + 1;
+        $next_page = "<a href='index.php?op=viewarticle&amp;artid=$artid&amp;page=$next_pagenumber'>"._MD_NEXTPAGE." ".sprintf("(%s/%s)",$next_pagenumber,$pageno)." >></a>";
+    }
+    if( $page <= 1 ) {
+        $previous_page = '<a href="index.php">' ._MD_RETURN2INDEX.'</a>';
+    } else {
+        $previous_pagenumber = $page -1;
+        $previous_page = "<a href='index.php?op=viewarticle&amp;artid=$artid&amp;page=$previous_pagenumber'><< "._MD_PREVPAGE." ".sprintf("(%s/%s)",$previous_pagenumber,$pageno)."</a>";
+    }
+    echo ($contentpages[$arrayelement]);
+    echo "<br /><table width='100%' border='0' cellspacing='0' cellpadding='2'><tr><td>$previous_page</td>        <td align='right'>$next_page</td></tr></table>";
+    echo "</td></tr>
+    <tr><td align='center'>[ <a href='index.php?op=listarticles&amp;secid=$secid'>".sprintf(_MD_BACK2SEC,$secname)."</a> |
+        <a href='index.php'>"._MD_RETURN2INDEX."</a> | <a href='index.php?op=printpage&amp;artid=$artid'><img src='".XOOPS_URL."/modules/sections/images/print.gif' border='0' alt='" . _MD_PRINTERPAGE."' /></a>]</td></tr></table>";
+    include '../../footer.php';
+}
+
+function PrintSecPage($artid)
+{
+    global $xoopsConfig, $xoopsUser, $xoopsDB, $xoopsTpl, $xoopsUserIsAdmin;
+    $myts =& MyTextSanitizer::getInstance();
+    $result=$xoopsDB->query("SELECT title, content FROM ".$xoopsDB->prefix("seccont")." WHERE artid=$artid");
+    list($title, $content) = $xoopsDB->fetchRow($result);
+    $title = $myts->makeTboxData4Show($title);
+    $content = $myts->makeTareaData4Show($content);
+    echo "
+        <html>
+        <head><title>".htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES)."</title></head>
+        <body>
+        <table border='0'><tr><td>
+        <table border='0' width='640' cellpadding='0' cellspacing='1' bgcolor='#000000'><tr><td>
+        <table border='0' width='640' cellpadding='20' cellspacing='1' bgcolor='#ffffff'><tr><td>
+        <img src='".XOOPS_URL."/images/logo.gif' border='0' alt='' /><br /><br />
+        <b>$title</b><br />
+        ".str_replace("[pagebreak]","",$content)."<br /><br />";
+        echo "</td></tr></table></td></tr></table>";
+        echo "<br /><br />";
+        printf(_MD_COMESFROM, htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES));
+        echo "<br /><a href='".XOOPS_URL."'>".XOOPS_URL."</a><br /><br />";
+        echo _MD_URLFORTHIS."<br />
+        <a href='".XOOPS_URL."/modules/sections/index.php?op=viewarticle&amp;artid=$artid'>".XOOPS_URL."/modules/sections/index.php?op=viewarticle&amp;artid=$artid</a>
+        </td></tr></table>
+        </body>
+        </html>";
+}
+
+$op = isset($_GET['op']) ? trim($_GET['op']) : '';
+$secid = isset($_GET['secid']) ? intval($_GET['secid']) : 0;
+$page = isset($_GET['page']) ? intval($_GET['page']) : 0;
+$artid = isset($_GET['artid']) ? intval($_GET['artid']) : 0;
+
+
+switch ( $op ) {
+case "viewarticle":
+    viewarticle($artid, $page);
+    break;
+case "listarticles":
+    listarticles($secid);
+    break;
+case "printpage":
+    PrintSecPage($artid);
+    break;
+default:
+    listsections();
+    break;
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/sections/header.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/sections/header.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/sections/header.php	(revision 405)
@@ -0,0 +1,29 @@
+<?php
+// $Id: header.php,v 1.2 2005/03/18 12:52:38 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+include '../../mainfile.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/sections/sql/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/sections/sql/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/sections/sql/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/sections/sql/mysql.sql
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/sections/sql/mysql.sql	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/sections/sql/mysql.sql	(revision 405)
@@ -0,0 +1,34 @@
+# phpMyAdmin MySQL-Dump
+# version 2.2.2
+# http://phpwizard.net/phpMyAdmin/
+# http://phpmyadmin.sourceforge.net/ (download page)
+#
+# --------------------------------------------------------
+
+#
+# Table structure for table `seccont`
+#
+
+CREATE TABLE seccont (
+  artid int(11) NOT NULL auto_increment,
+  secid int(11) NOT NULL default '0',
+  title text NOT NULL,
+  content text NOT NULL,
+  counter int(11) NOT NULL default '0',
+  PRIMARY KEY  (artid),
+  KEY idxseccontsecid (secid),
+  KEY idxseccontcounterdesc (counter)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `sections`
+#
+
+CREATE TABLE sections (
+  secid int(11) NOT NULL auto_increment,
+  secname varchar(40) NOT NULL default '',
+  image varchar(50) NOT NULL default '',
+  PRIMARY KEY  (secid),
+  KEY idxsectionssecname (secname)
+) TYPE=MyISAM;
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/images/mk_slogo.sh
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/images/mk_slogo.sh	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/images/mk_slogo.sh	(revision 405)
@@ -0,0 +1,1 @@
+composite +dither -compose over $1.png tinycontent.png tinycontent$1.png
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/class/tinyd.textsanitizer.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/class/tinyd.textsanitizer.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/class/tinyd.textsanitizer.php	(revision 405)
@@ -0,0 +1,169 @@
+<?php
+
+if( ! class_exists( 'TinyDTextSanitizer' ) ) {
+
+include_once( XOOPS_ROOT_PATH . '/class/module.textsanitizer.php' ) ;
+
+class TinyDTextSanitizer extends MyTextSanitizer {
+
+	var $nbsp = 0 ;
+
+	/*
+	* Constructor of this class
+    *
+	* Gets allowed html tags from admin config settings
+	* <br> should not be allowed since nl2br will be used
+	* when storing data.
+    *
+    * @access	private
+    *
+    * @todo Sofar, this does nuttin' ;-)
+	*/
+	function TinyDTextSanitizer()
+	{
+		parent::MyTextSanitizer() ;
+	}
+
+	/**
+	 * Access the only instance of this class
+     *
+     * @return	object
+     *
+     * @static
+     * @staticvar   object
+	 */
+	function &getInstance()
+	{
+		static $instance;
+		if (!isset($instance)) {
+			$instance = new TinyDTextSanitizer();
+		}
+		return $instance;
+	}
+
+	/**
+	 * Filters textarea form data in DB for display
+	 *
+	 * @param   string  $text
+	 * @param   bool    $html   allow html?
+	 * @param   bool    $smiley allow smileys?
+	 * @param   bool    $xcode  allow xoopscode?
+	 * @param   bool    $image  allow inline images?
+	 * @param   bool    $br     convert linebreaks?
+	 * @return  string
+	 **/
+	function displayTarea( $text, $html = 0, $smiley = 1, $xcode = 1, $image = 1, $br = 1 , $nbsp = 0 )
+	{
+		// save "javascript:"
+		$text = preg_replace( "/javascript:/si" , "jjaavvaassccrriipptt::" , $text ) ;
+
+		$this->nbsp = $nbsp ;
+		$text = parent::displayTarea( $text , $html , $smiley , $xcode , $image , $br ) ;
+		// restore "javascript:"
+		$text = preg_replace( "/jjaavvaassccrriipptt::/" , "javascript:" , $text ) ;
+		return $this->tinyDCodeDecode( $text , $nbsp ) ;
+/*		if ($html != 1) {
+			// html not allowed
+			$text =& $this->htmlSpecialChars($text);
+		}
+		$text =& $this->makeClickable($text);
+		if ($smiley != 0) {
+			// process smiley
+			$text =& $this->smiley($text);
+		}
+		if ($xcode != 0) {
+			// decode xcode
+			if ($image != 0) {
+				// image allowed
+				$text =& $this->xoopsCodeDecode($text);
+            		} else {
+                		// image not allowed
+                		$text =& $this->xoopsCodeDecode($text, 0);
+			}
+		}
+		if ($br != 0) {
+			$text =& $this->nl2Br($text);
+		}
+		return $text; */
+	}
+
+
+	/**
+	 * Replace TinyDCodes with their equivalent HTML formatting
+	 *
+	 * @param   string  $text
+	 * @return  string
+	 **/
+	function tinyDCodeDecode( $text )
+	{
+		$removal_tags = array( '[summary]' , '[/summary]' , '[pagebreak]' ) ;
+		$text = str_replace( $removal_tags , '' , $text ) ;
+
+		$patterns = array();
+		$replacements = array();
+
+		$patterns[] = "/\[siteimg align=(['\"]?)(left|center|right)\\1]([^\"\(\)\?\&'<>]*)\[\/siteimg\]/sU";
+		$replacements[] = '<img src="'.XOOPS_URL.'/\\3" align="\\2" alt="" />';
+
+		$patterns[] = "/\[siteimg]([^\"\(\)\?\&'<>]*)\[\/siteimg\]/sU";
+		$replacements[] = '<img src="'.XOOPS_URL.'/\\1" alt="" />';
+
+		return preg_replace($patterns, $replacements, $text);
+	}
+
+
+	/**
+	 * get inside of tags [summary] and [/summary]
+	 *
+	 * @param   string  $text
+	 * @return  string
+	 **/
+	function tinyExtractSummary( $text )
+	{
+		$patterns[] = "/^(.*)\[summary\](.*)\[\/summary\](.*)$/sU";
+		$replacements[] = '$2';
+
+		return preg_replace($patterns, $replacements, $text);
+	}
+
+
+	/**
+	 * Convert linebreaks to <br /> tags
+     *
+     * @param	string  $text
+     *
+     * @return	string
+	 */
+	function nl2Br( $text )
+	{
+		$text = preg_replace("/(\015\012)|(\015)|(\012)/","<br />",$text);
+		if( $this->nbsp ) {
+			$patterns = array( '  ' , '\"' ) ;
+			$replaces = array( ' &nbsp;' , '"' ) ;
+			$text = substr(preg_replace('/\>.*\</esU',"str_replace(\$patterns,\$replaces,'\\0')",">$text<"),1,-1);
+		}
+		return $text ;
+	}
+
+
+	/*
+	*  for displaying data in html textbox forms
+    *
+    * @param	string  $text
+    *
+    * @return	string
+	*/
+	function htmlSpecialChars($text)
+	{
+		return htmlspecialchars($text, ENT_QUOTES);
+		//return preg_replace("/&amp;/i", '&', htmlspecialchars($text, ENT_QUOTES));
+		// return preg_replace(array("/&amp;/i", "/&nbsp;/i"), array('&', '&amp;nbsp;'), htmlspecialchars($text, ENT_QUOTES));
+	}
+
+
+// The End of Class
+}
+
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/TODO
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/TODO	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/TODO	(revision 405)
@@ -0,0 +1,10 @@
+- Document or Sample for Usage
+
+magic_quotes GPC ¤Î¥Á¥§¥Ã¥¯
+eval() ¤ò¾¯¤·¤Ç¤â¸º¤é¤¹
+
+username¥Ù¡¼¥¹¤ÇÊÔ½¸¸¢¸Â¤òÅÏ¤¹µ¡Ç½¡ÊÊÔ½¸¼ÔÀìÍÑ¥³¥ó¥È¥í¡¼¥é¡Ë
+
+Smarty¤Ë¥Ñ¡¼¥¹¤µ¤»¤ë¥â¡¼¥É
+
+¤½¤í¤½¤í onUpdate ¤À¤±¤ÎÂÐ±þ¤ËÀÚ¤êÂØ¤¨¤ë
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/preview.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/preview.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/preview.php	(revision 405)
@@ -0,0 +1,83 @@
+<?php
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+// ------------------------------------------------------------------------- //
+// Author: Tobias Liegl (AKA CHAPI)                                          //
+// Site: http://www.chapi.de                                                 //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+// Hacker: GIJ=CHECKMATE (AKA GIJOE)                                         //
+// Site: http://www.peak.ne.jp/xoops/                                        //
+// ------------------------------------------------------------------------- //
+
+// sleep( 1 ) ;	// for getting session
+
+include( '../../mainfile.php' ) ;
+include_once( 'class/tinyd.textsanitizer.php' ) ;
+include_once( 'include/render_function.inc.php' ) ;
+include_once( 'include/constants.inc.php' ) ;
+// include_once( "include/gtickets.php" ) ;
+
+// $myts
+$myts =& TinyDTextSanitizer::getInstance() ;
+
+// only Administrator can show
+if( ! is_object( $xoopsUser ) || ! $xoopsUser->isAdmin() ) exit ;
+
+// for "Duplicatable"
+$mydirname = basename( dirname( __FILE__ ) ) ;
+if( ! preg_match( '/^(\D+)(\d*)$/' , $mydirname , $regs ) ) echo ( "invalid dirname: " . htmlspecialchars( $mydirname ) ) ;
+$mydirnumber = $regs[2] === '' ? '' : intval( $regs[2] ) ;
+
+// utility variables
+$mymodpath = XOOPS_ROOT_PATH."/modules/$mydirname" ;
+$mytablename = $xoopsDB->prefix( "tinycontent{$mydirnumber}" ) ;
+
+// check if post data is passed via session...
+if( empty( $_SESSION['tinyd_preview_post'] ) ) exit ;
+
+$post = $_SESSION['tinyd_preview_post'] ;
+unset( $_SESSION['tinyd_preview_post'] ) ;
+
+// cache file name check (thx JM2)
+/* if( ! preg_match( '/^'.$mydirname.'_preview_\d{10}$/' , $_GET['preview'] ) ) exit ;
+
+$content_cache_full_path = XOOPS_CACHE_PATH . '/' . $_GET['preview'] ;
+$fp = fopen( $content_cache_full_path , 'r' ) ;
+if( $fp === false ) die( _TC_FILENOTFOUND . " $content_cache_full_path" ) ;
+$text = fread( $fp , 65536 ) ;
+fclose( $fp ) ;
+@unlink( $content_cache_full_path ) ;*/
+
+// force turning PHP debug on
+$original_level = error_reporting( E_ALL ) ;
+
+$content = tc_content_render( $post['message'] , $post['nohtml'] , $post['nosmiley'] , $post['nobreaks'] , $xoopsModuleConfig['tc_space2nbsp'] ) ;
+
+// restore error_report_level
+error_reporting( $original_level ) ;
+
+echo '<html><head><meta http-equiv="content-type" content="text/html; charset='._CHARSET.'" /><meta http-equiv="content-language" content="'._LANGCODE.'" /><title>'.$xoopsConfig['sitename'].'</title></head><body>'.$content.'</body></html>';
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/rewrite.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/rewrite.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/rewrite.php	(revision 405)
@@ -0,0 +1,87 @@
+<?php
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+// ------------------------------------------------------------------------- //
+// Author: Tobias Liegl (AKA CHAPI)                                          //
+// Site: http://www.chapi.de                                                 //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+// Hacker: GIJ=CHECKMATE (AKA GIJOE)                                         //
+// Site: http://www.peak.ne.jp/xoops/                                        //
+// ------------------------------------------------------------------------- //
+
+// check modulesless rewrite
+if( ! stristr( $_SERVER['REQUEST_URI'] , 'modules' ) ) {
+	$tinyd_vmod_dir = $_SERVER['REQUEST_URI'] ;
+	$_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'] ;
+}
+
+include( '../../mainfile.php' ) ;
+include_once( 'class/tinyd.textsanitizer.php' ) ;
+include_once( 'include/render_function.inc.php' ) ;
+include_once( 'include/constants.inc.php' ) ;
+
+// for "Duplicatable"
+$mydirname = basename( dirname( __FILE__ ) ) ;
+if( ! preg_match( '/^(\D+)(\d*)$/' , $mydirname , $regs ) ) echo ( "invalid dirname: " . htmlspecialchars( $mydirname ) ) ;
+$mydirnumber = $regs[2] === '' ? '' : intval( $regs[2] ) ;
+
+// utility variables
+$mymodpath = XOOPS_ROOT_PATH."/modules/$mydirname" ;
+$mytablename = $xoopsDB->prefix( "tinycontent{$mydirnumber}" ) ;
+
+// check if $_GET['wrap'] is specified & exists the file
+if( empty( $_GET['wrap'] ) ) {
+	redirect_header( XOOPS_URL , 2 , _TC_FILENOTFOUND ) ;
+	exit ;
+}
+
+// before fopen it eliminates '..' (thx JM2)
+$wrap = str_replace( '..' , '' , $_GET['wrap'] ) ;
+if( ! ( $fp = fopen( "content/$wrap" , "r" ) ) ) {
+	redirect_header( XOOPS_URL , 2 , _TC_FILENOTFOUND ) ;
+	exit ;
+}
+
+$body_flag = false ;
+$content = "" ;
+while( $buf = fgets( $fp , 4096 ) ) {
+//	if( ! $body_flag && preg_match( "/<body.*>(.*)/i" , $buf , $regs ) ) {
+//		$body_flag = true ;
+//		$content .= $regs[1] ;
+//	} else {
+		$content .= $buf ;
+//	}
+}
+fclose( $fp ) ;
+
+/* $str=str_replace("\r\n","\n",$str);
+   $str=str_replace("\r","\n",$str);
+   $lines = explode("\n",$str); */
+
+include XOOPS_ROOT_PATH."/header.php";
+echo tc_convert_wrap_to_ie( $content ) ;
+include XOOPS_ROOT_PATH."/footer.php";
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/content/sample.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/content/sample.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/content/sample.html	(revision 405)
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<title>HTML file for sample of page wrapping</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+
+<body>
+
+<p>Hello everybody .. this is a wrapped html file</p>
+
+<p>check if it works :-)</p>
+
+<p>TinyD can change the base of page wrapping.</p>
+
+<p>You can see a gif image below this line<br />
+if you set this page wrapping as WRAP2(=content Base) or WRAP3(=mod_rewrite) or WRAP4(='src' or 'href' change) with success.</p>
+
+<p><img src="sample.gif" /><br />
+&lt;img src&#061;&quot;sample.gif&quot; /&gt;
+</p>
+
+<p>
+You see this link is relative from sample.html itself.
+</p>
+
+<p>Of course, you can remove sample.html and sample.gif from content folder.<br />
+However, don't remove index.php in content folder.</p>
+
+
+<p><b>Sample of relative link</b><br />
+<a href="sample.gif">Link to GIF</a><br />
+&lt;a href&#061;&quot;sample.gif&quot;&gt;Link to GIF&lt;/a&gt;</p>
+
+<p><b>Sample of absolute link</b><br />
+<a href="http://www.peak.ne.jp/xoops/">PEAK XOOPS</a><br />
+&lt;a href&#061;&quot;http://www.peak.ne.jp/xoops/&quot;&gt;PEAK XOOPS&lt;/a&gt;</p>
+
+<p>{<b></b>X_SITEURL} will be converted to {X_SITEURL}</p>
+
+
+</body>
+</html>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/content/index.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/content/index.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/content/index.php	(revision 405)
@@ -0,0 +1,122 @@
+<?php
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+// ------------------------------------------------------------------------- //
+// Author: Tobias Liegl (AKA CHAPI)                                          //
+// Site: http://www.chapi.de                                                 //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+// Hacker: GIJ=CHECKMATE (AKA GIJOE)                                         //
+// Site: http://www.peak.ne.jp/xoops/                                        //
+// ------------------------------------------------------------------------- //
+
+include( '../../../mainfile.php' ) ;
+include_once( '../class/tinyd.textsanitizer.php' ) ;
+include_once( '../include/render_function.inc.php' ) ;
+include_once( '../include/constants.inc.php' ) ;
+
+// for "Duplicatable"
+$mydirname = basename( dirname( dirname( __FILE__ ) ) ) ;
+if( ! preg_match( '/^(\D+)(\d*)$/' , $mydirname , $regs ) ) echo ( "invalid dirname: " . htmlspecialchars( $mydirname ) ) ;
+$mydirnumber = $regs[2] === '' ? '' : intval( $regs[2] ) ;
+
+//
+// import from common.php 
+//
+	if (file_exists('../xoops_version.php')) {
+		$module_handler =& xoops_gethandler('module');
+		$xoopsModule =& $module_handler->getByDirname($mydirname);
+		// unset($url_arr);
+		if (!$xoopsModule || !$xoopsModule->getVar('isactive')) {
+			include_once XOOPS_ROOT_PATH."/header.php";
+			echo "<h4>"._MODULENOEXIST."</h4>";
+			include_once XOOPS_ROOT_PATH."/footer.php";
+			exit();
+		} 
+		$moduleperm_handler =& xoops_gethandler('groupperm');
+		if ($xoopsUser) {
+			if (!$moduleperm_handler->checkRight('module_read', $xoopsModule->getVar('mid'), $xoopsUser->getGroups())) {
+				redirect_header(XOOPS_URL."/user.php",1,_NOPERM);
+				exit();
+			}
+		} else {
+			if (!$moduleperm_handler->checkRight('module_read', $xoopsModule->getVar('mid'), XOOPS_GROUP_ANONYMOUS)) {
+				redirect_header(XOOPS_URL."/user.php",1,_NOPERM);
+				exit();
+			}
+		}
+		if ( file_exists(XOOPS_ROOT_PATH."/modules/".$xoopsModule->getVar('dirname')."/language/".$xoopsConfig['language']."/main.php") ) {
+			include_once XOOPS_ROOT_PATH."/modules/".$xoopsModule->getVar('dirname')."/language/".$xoopsConfig['language']."/main.php";
+		} else {
+			if ( file_exists(XOOPS_ROOT_PATH."/modules/".$xoopsModule->getVar('dirname')."/language/english/main.php") ) {
+				include_once XOOPS_ROOT_PATH."/modules/".$xoopsModule->getVar('dirname')."/language/english/main.php";
+			}
+		}
+		if ($xoopsModule->getVar('hasconfig') == 1 || $xoopsModule->getVar('hascomments') == 1 || $xoopsModule->getVar( 'hasnotification' ) == 1) {
+			$xoopsModuleConfig =& $config_handler->getConfigsByCat(0, $xoopsModule->getVar('mid'));
+		}
+	}
+//
+// end of import from common.php
+//
+
+
+// utility variables
+$mymodpath = XOOPS_ROOT_PATH."/modules/$mydirname" ;
+$mytablename = $xoopsDB->prefix( "tinycontent{$mydirnumber}" ) ;
+
+// get id of homepage
+$result = $xoopsDB->query( "SELECT storyid,link FROM $mytablename WHERE visible='1' ORDER BY homepage DESC, blockid" ) ;
+if( $xoopsDB->getRowsNum( $result ) < 1 ) {
+	redirect_header( XOOPS_URL , 2 , _TC_FILENOTFOUND ) ;
+	exit ;
+}
+list( $homepage_id , $homepage_link_type ) = $xoopsDB->fetchRow( $result ) ;
+
+// check if $_GET['id'] is specified
+$id = empty( $_GET['id'] ) ? 0 : intval( $_GET['id'] ) ;
+if( $id <= 0 )  {
+	redirect_header( XOOPS_URL , 2 , _TC_FILENOTFOUND ) ;
+	exit ;
+}
+
+// main query
+$result = $xoopsDB->query( "SELECT storyid,title,text,visible,nohtml,nosmiley,nobreaks,nocomments,link,address,UNIX_TIMESTAMP(last_modified) AS last_modified,html_header FROM $mytablename WHERE storyid='$id' AND visible" ) ;
+if( ( $result_array = $xoopsDB->fetchArray( $result ) ) == false ) {
+	redirect_header( XOOPS_URL , 2 , _TC_FILENOTFOUND ) ;
+	exit ;
+}
+
+// disable comment feature of XOOPS
+// $result_array['nocomments'] = 1 ;
+
+
+// branch if op=print
+if( isset( $_GET['op'] ) && $_GET['op'] == 'print' ) {
+	include( '../include/print.inc.php' ) ;
+} else {
+	include( "../include/display.inc.php" ) ;
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/comment_delete.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/comment_delete.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/comment_delete.php	(revision 405)
@@ -0,0 +1,29 @@
+<?php
+// $Id: comment_delete.php,v 1.5 2003/02/12 11:36:35 okazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+include '../../mainfile.php';
+include XOOPS_ROOT_PATH.'/include/comment_delete.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/blocks/tinycontent_navigation.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/blocks/tinycontent_navigation.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/blocks/tinycontent_navigation.php	(revision 405)
@@ -0,0 +1,94 @@
+<?php
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+// ------------------------------------------------------------------------- //
+// Author: Tobias Liegl (AKA CHAPI)                                          //
+// Site: http://www.chapi.de                                                 //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+if( ! defined( 'XOOPS_ROOT_PATH' ) ) exit ;
+$mydirname = basename( dirname( dirname( __FILE__ ) ) ) ;
+if( ! preg_match( '/^(\D+)(\d*)$/' , $mydirname , $regs ) ) echo ( "invalid dirname: " . htmlspecialchars( $mydirname ) ) ;
+$mydirnumber = $regs[2] === '' ? '' : intval( $regs[2] ) ;
+
+include_once( XOOPS_ROOT_PATH . "/modules/$mydirname/include/constants.inc.php" ) ;
+
+
+
+eval( '
+
+function tinycontent'.$mydirnumber.'_block_nav()
+{
+	return tinyd_block_nav_base( "'.$mydirname.'" , "'.$mydirnumber.'" ) ;
+}
+
+' ) ;
+
+
+if( ! function_exists( 'tinyd_block_nav_base' ) ) {
+
+function tinyd_block_nav_base( $mydirname , $mydirnumber )
+{
+	// get my config
+	$module_handler =& xoops_gethandler('module');
+	$config_handler =& xoops_gethandler('config');
+	$module =& $module_handler->getByDirname($mydirname);
+	$config =& $config_handler->getConfigsByCat(0, $module->getVar('mid'));
+	$navblock_target = empty( $config['tc_navblock_target'] ) ? 1 : intval( $config['tc_navblock_target'] ) ;
+
+	if( empty( $config['tc_modulesless_dir'] ) ) { 
+		$block["mod_url"] = XOOPS_URL . "/modules/$mydirname" ;
+		$tc_rewrite_dir = TC_REWRITE_DIR ;
+	} else {
+		$block["mod_url"] = XOOPS_URL . '/' . $config['tc_modulesless_dir'] ;
+		$tc_rewrite_dir = "" ;
+	}
+
+	$myts =& MyTextSanitizer::getInstance() ;
+	$db =& Database::getInstance() ;
+
+	$whr_submenu = $navblock_target == 2 ? "submenu=1" : "1" ;
+
+	$result = $db->query("SELECT storyid,title,link,UNIX_TIMESTAMP(last_modified) FROM ".$db->prefix("tinycontent{$mydirnumber}")." WHERE visible=1 AND $whr_submenu ORDER BY blockid" ) ;
+
+	while( list( $id , $title , $link , $last_modified ) = $db->fetchRow( $result ) ) {
+		if( ! empty( $config['tc_force_mod_rewrite'] ) || $link == TC_WRAPTYPE_USEREWRITE ) $href = $tc_rewrite_dir . sprintf( TC_REWRITE_FILENAME_FMT , $id ) ;
+		else if( $link == TC_WRAPTYPE_CONTENTBASE ) $href = "content/index.php?id=$id" ;
+		else $href = "index.php?id=$id" ;
+
+		$block["links"][] = array(
+			"href" => $href ,
+			"id" => $id ,
+			"title" => $myts->makeTboxData4Show( $title ) ,
+			"date" => formatTimestamp( $last_modified ) ,
+			"last_modified" => $last_modified
+		) ;
+	}
+	return $block ;
+}
+
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/blocks/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/blocks/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/blocks/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/blocks/.htaccess
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/blocks/.htaccess	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/blocks/.htaccess	(revision 405)
@@ -0,0 +1,2 @@
+order deny,allow
+deny from all
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/blocks/tinycontent_content.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/blocks/tinycontent_content.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/blocks/tinycontent_content.php	(revision 405)
@@ -0,0 +1,157 @@
+<?php
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+// ------------------------------------------------------------------------- //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+if( ! defined( 'TC_BLOCK_CONTENT_INCLUDED' ) ) {
+
+define( 'TC_BLOCK_CONTENT_INCLUDED' , 1 ) ;
+
+function b_tinycontent_content_show( $options )
+{
+	global $xoopsDB , $xoopsConfig ;
+
+	$mydirname = $options[0] ;
+	if( ! preg_match( '/^(\D+)(\d*)$/' , $mydirname , $regs ) ) echo ( "invalid dirname: " . htmlspecialchars( $mydirname ) ) ;
+	$mydirnumber = $regs[2] === '' ? '' : intval( $regs[2] ) ;
+
+	$mytablename = $xoopsDB->prefix( "tinycontent{$mydirnumber}" ) ;
+	$mymodpath = XOOPS_ROOT_PATH . "/modules/$mydirname" ;
+	$mymoddir = XOOPS_URL . "/modules/$mydirname" ;
+
+	if( ! class_exists( 'TinyDTextSanitizer' ) ) {
+		include_once( "$mymodpath/class/tinyd.textsanitizer.php" ) ;
+	}
+	if( ! defined( 'TC_RENDER_FUNCTIONS_INCLUDED' ) ) {
+		include_once( "$mymodpath/include/render_function.inc.php" ) ;
+	}
+
+	if( ! defined( 'TINYCONTENT_MB_LOADED' ) ) {
+		if ( file_exists( "$mymodpath/language/{$xoopsConfig['language']}/main.php" ) ) {
+			include_once( "$mymodpath/language/{$xoopsConfig['language']}/main.php" ) ;
+		} else {
+			include_once( "$mymodpath/language/english/main.php" ) ;
+		}
+	}
+
+	// get my config
+	$module_handler =& xoops_gethandler('module');
+	$config_handler =& xoops_gethandler('config');
+	$module =& $module_handler->getByDirname($mydirname);
+	$config =& $config_handler->getConfigsByCat(0, $module->getVar('mid'));
+	$space2nbsp = empty( $config['tc_space2nbsp'] ) ? 0 : 1 ;
+
+	$result = $xoopsDB->query( "SELECT text,title,link,nohtml,nosmiley,nobreaks,address FROM $mytablename WHERE storyid='{$options[1]}'" ) ;
+	list( $text,$title,$link,$nohtml,$nosmiley,$nobreaks,$address ) = $xoopsDB->fetchRow( $result ) ;
+
+	// getting "content"
+	if( $link > 0 ) {
+	
+		// external (=wrapped) content
+		$wrap_file = "$mymodpath/content/$address" ;
+		if( ! file_exists( $wrap_file ) ) {
+			redirect_header( XOOPS_URL , 2 , _TC_FILENOTFOUND ) ;
+			exit ;
+		}
+
+		ob_start() ;
+		include( $wrap_file ) ;
+		$content = tc_convert_wrap_to_ie( ob_get_contents() ) ;
+		/* if( $link == TC_WRAPTYPE_CHANGESRCHREF ) */ $content = tc_change_srchref( $content , "$mymoddir/content" ) ;
+		ob_end_clean() ;
+
+	} else {
+
+		$myts =& TinyDTextSanitizer::getInstance();
+		$shorten_text = $myts->tinyExtractSummary( $text ) ;
+		$is_summary = ( $shorten_text != $text ) ;
+		$content = tc_content_render( $shorten_text , $nohtml , $nosmiley , $nobreaks , $space2nbsp ) ;
+
+	}
+
+	// if template file exists, parse it.
+	if( file_exists( "$mymodpath/templates/blocks/tinycontent_content_block.html" ) ) {
+		$myts =& TinyDTextSanitizer::getInstance() ;
+		$tpl = new XoopsTpl();
+		$tpl->assign( array(
+			'storyid' => $options[1] ,
+			'mymoddir' => $mymoddir ,
+			'is_summary' => $is_summary ,
+			'lang_more' => _MORE ,
+			'title' => $myts->makeTboxData4Show( $title ) ,
+			'content' => $content
+		) ) ;
+		$block['content'] = $tpl->fetch( "file:$mymodpath/templates/blocks/tinycontent_content_block.html" ) ;
+
+	} else {
+
+		$block['content'] = $content ;
+
+	}
+
+
+	return $block ;
+}
+
+
+function b_tinycontent_content_edit( $options )
+{
+	global $xoopsDB , $xoopsConfig ;
+
+	$mydirname = $options[0] ;
+	if( ! preg_match( '/^(\D+)(\d*)$/' , $mydirname , $regs ) ) echo ( "invalid dirname: " . htmlspecialchars( $mydirname ) ) ;
+	$mydirnumber = $regs[2] === '' ? '' : intval( $regs[2] ) ;
+
+	$mytablename = $xoopsDB->prefix( "tinycontent{$mydirnumber}" ) ;
+	$mymoddir = XOOPS_URL . "/modules/$mydirname" ;
+	$mydirname4edit = htmlspecialchars( $mydirname , ENT_QUOTES ) ;
+	$old_storyid = empty( $options[1] ) ? 0 : intval( $options[1] ) ;
+
+	$storyid_options = "<option value='0'>----</option>\n" ;
+	$result = $xoopsDB->query( "SELECT storyid,title FROM $mytablename" ) ;
+	while( list( $storyid , $title ) = $xoopsDB->fetchRow( $result ) ) {
+		$selected = $storyid == $old_storyid ? "selected='selected'" : "" ;
+		$storyid_options .= "<option value='$storyid' $selected>".htmlspecialchars(xoops_substr($title,0,50),ENT_QUOTES)."</option>\n" ;
+	}
+
+	$ret = "
+		<input type='hidden' name='options[0]' value='$mydirname4edit' />
+		<input type='hidden' name='id4js' value='$old_storyid' />
+		<input type='hidden' name='title4js' value='----' />
+		<select name='options[1]' onchange='document.blockform.id4js.value=this.value;document.blockform.title4js.value=this.options[this.selectedIndex].text;'>$storyid_options</select>
+		<img src='$mymoddir/images/reflect.gif' onClick=\"document.blockform.btitle.value=document.blockform.title4js.value\" alt='reflect' />
+		<img src='$mymoddir/images/editicon.gif' onClick=\"window.open('{$mymoddir}/admin/index.php?op=edit&amp;id='+document.blockform.id4js.value,'','');return(false);\" alt='"._EDIT."' />
+	\n" ;
+
+	return $ret ;
+}
+
+
+
+}
+
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/print.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/print.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/print.php	(revision 405)
@@ -0,0 +1,74 @@
+<?php
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+// ------------------------------------------------------------------------- //
+// Author: Tobias Liegl (AKA CHAPI)                                          //
+// Site: http://www.chapi.de                                                 //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+// Hacker: GIJ=CHECKMATE (AKA GIJOE)                                         //
+// Site: http://www.peak.ne.jp/xoops/                                        //
+// ------------------------------------------------------------------------- //
+
+include( '../../mainfile.php' ) ;
+include_once( 'class/tinyd.textsanitizer.php' ) ;
+include_once( 'include/render_function.inc.php' ) ;
+include_once( 'include/constants.inc.php' ) ;
+
+// for "Duplicatable"
+$mydirname = basename( dirname( __FILE__ ) ) ;
+if( ! preg_match( '/^(\D+)(\d*)$/' , $mydirname , $regs ) ) echo ( "invalid dirname: " . htmlspecialchars( $mydirname ) ) ;
+$mydirnumber = $regs[2] === '' ? '' : intval( $regs[2] ) ;
+
+// utility variables
+$mymodpath = XOOPS_ROOT_PATH."/modules/$mydirname" ;
+$mytablename = $xoopsDB->prefix( "tinycontent{$mydirnumber}" ) ;
+
+// check if $_GET['id'] is specified
+$id = empty( $_GET['id'] ) ? 0 : intval( $_GET['id'] ) ;
+if( $id <= 0 )  {
+	redirect_header( XOOPS_URL , 2 , _TC_FILENOTFOUND ) ;
+	exit ;
+}
+
+// main query
+$result = $xoopsDB->query( "SELECT storyid,title,text,visible,nohtml,nosmiley,nobreaks,nocomments,link,address,UNIX_TIMESTAMP(last_modified) AS last_modified,html_header FROM $mytablename WHERE storyid='$id' AND visible" ) ;
+if( ( $result_array = $xoopsDB->fetchArray( $result ) ) == false ) {
+	redirect_header( XOOPS_URL , 2 , _TC_FILENOTFOUND ) ;
+	exit ;
+}
+
+// redirect if its base of wrapping is wrap_path (content)
+if( $result_array['link'] >= TC_WRAPTYPE_CONTENTBASE ) {
+	if( headers_sent() ) {
+		redirect_header( XOOPS_URL . "/modules/$mydirname/content/index.php?op=print&id={$result_array['storyid']}" , 0 , '&nbsp;' ) ;
+	} else {
+		header( "Location: content/index.php?op=print&id={$result_array['storyid']}" ) ;
+	}
+	exit ;
+}
+
+include( "include/print.inc.php" ) ;
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/tchinese/main.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/tchinese/main.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/tchinese/main.php	(revision 405)
@@ -0,0 +1,44 @@
+<?php
+
+if( defined( 'FOR_XOOPS_LANG_CHECKER' ) || ! defined( 'TINYCONTENT_MB_LOADED' ) ) {
+
+
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-04-19 18:26:42
+define('_TC_FMT_DEFAULT_COMMENT_TITLE','Re: %s');
+
+// Appended by Xoops Language Checker -GIJOE- in 2004-06-02 17:58:48
+define('_TC_NEXTPAGE','Next');
+define('_TC_PREVPAGE','Prev');
+define('_TC_TOPOFCONTENTS','Top of contents');
+
+define( 'TINYCONTENT_MB_LOADED' , 1 ) ;
+
+define('_TC_FILENOTFOUND','File not found! Please check the URL!');
+define("_TC_PRINTERFRIENDLY","Printer Friendly Page");
+define("_TC_SENDSTORY","Send this Story to a Friend");
+
+// whether parameter for "mailto:" is already rawurlencoded
+define("_TC_DONE_MAILTOENCODE" , false ) ;
+
+// %s is your site name. for single byte languages (ignored when _TC_DONE_MAILTOENCODE is true)
+define("_TC_INTARTICLE","Interesting Article at %s");
+define("_TC_INTARTFOUND","Here is an interesting article I have found at %s");
+
+// for multibyte languages (ignored when _TC_DONE_MAILTOENCODE is false)
+define("_TC_MB_INTARTICLE","" ) ;
+define("_TC_MB_INTARTFOUND","" ) ;
+
+// %s represents your site name
+define("_TC_THISCOMESFROM","This article comes from %s");
+define("_TC_URLFORSTORY","The URL for this story is:");
+}
+
+if( ! defined( 'FOR_XOOPS_LANG_CHECKER' ) && ! function_exists( 'tc_convert_wrap_to_ie' ) ) {
+	function tc_convert_wrap_to_ie( $str ) {
+		return $str ;
+	}
+}
+
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/tchinese/admin.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/tchinese/admin.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/tchinese/admin.php	(revision 405)
@@ -0,0 +1,107 @@
+<?php
+
+
+if( defined( 'FOR_XOOPS_LANG_CHECKER' ) || ! defined( 'TINYCONTENT_AM_LOADED' ) ) {
+
+
+
+
+
+
+// Appended by Xoops Language Checker -GIJOE- in 2006-04-11 11:14:42
+define('_TC_UPDATE_WRAP_CONTENTS','Update wrapped contents for searching');
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-04-13 05:53:24
+define('_TC_HTML_HEADER','HTML header');
+define('_TC_CHECKED_ITEMS_ARE','Checked records are:');
+define('_TC_BUTTON_MOVETO','Export(Move)');
+define('_TC_CREATED','Created');
+define('_TC_SAVEAS','Save as');
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-02-11 18:59:09
+define('_TC_TYPE_HTMLNOBB','HTML Content (bb code disabled)');
+define('_TC_TYPE_TEXTNOBB','Text Content (bb code disabled)');
+
+// Appended by Xoops Language Checker -GIJOE- in 2004-06-18 15:39:56
+define('_TC_FMT_WRAPCHANGESRCHREF','rewrite attributes of html (experimental)<br /> this option rewrites relative links to absolute links.<br />This probably mis-recognizes sentences looks like HTML source<br />');
+
+// Appended by Xoops Language Checker -GIJOE- in 2004-05-06 09:53:54
+define('_TC_SPAWLANG','en');
+define('_TC_TH_VISIBLE','Vis');
+define('_TC_ENABLECOM','Comments enabled');
+define('_TC_TH_ENABLECOM','Com');
+define('_TC_TH_SUBMENU','Sub');
+define('_TC_DISP_YES','Display');
+define('_TC_DISP_NO','Not Display');
+define('_TC_CONTENT_TYPE','Page Type');
+define('_TC_TYPE_HTML','HTML Content (bb code enabled)');
+define('_TC_TYPE_TEXTWITHBB','Text Content (bb code enabled)');
+define('_TC_TYPE_PHPHTML','PHP codes (bb code disabled)');
+define('_TC_TYPE_PHPWITHBB','PHP codes (bb code enabled)');
+define('_TC_TYPE_PEARWIKI','PEAR Wiki (bb code disabled)');
+define('_TC_TYPE_PEARWIKIWITHBB','PEAR Wiki (bb code enabled)');
+define('_TC_TYPE_PUKIWIKI','PukiWiki (bb code disabled)');
+define('_TC_TYPE_PUKIWIKIWITHBB','PukiWiki (bb code enabled)');
+define('_TC_LASTMODIFIED','Last Modified');
+define('_TC_DONTUPDATELASTMODIFIED','Do not update it automatically');
+define('_TC_CONTENTTYPE','Type');
+define('_TC_ELINK','Modify');
+define('_TC_DELLINK','Cut');
+define('_TC_WRAPROOT','PageWrap\'s Base');
+define('_TC_FMT_WRAPROOTTC','Same as TinyContent module<br /> (%s) <br />');
+define('_TC_FMT_WRAPROOTPAGE','Same as wrapped page. (you can\'t use comment features)<br /> (%s) <br />use mod_rewrite if you can.<br />');
+define('_TC_FMT_WRAPBYREWRITE','use mod_rewrite (experimental)<br /> upload HTMLs and others into %s<br />Do not forget turning mod_rewrite on<br />');
+define('_TC_ERROREXIST','Error. the same filename exists');
+define('_TC_FMT_WRAPPATHPERMOFF','<span style=\'font-size:xx-small;\'>The directory for wrapping (%s) is not allowed to be written by httpd. <br />If you\'d like to upload or delete files via HTTP, turn the writing permission on.<br />I recommend to upload or delete files only via ftp for security reason, thus the writing permission of the directory should be still off.</span>');
+define('_TC_FMT_WRAPPATHPERMON','<span style=\'font-size:xx-small;\'>I don\'t recommend you to upload via HTTP. Try to upload the files for wrapping via ftp, if you can.</span>');
+define('_TC_ALTER_TABLE','Alter Table');
+define('_TC_JS_CONFIRMDISCARD','Changes will be discarded. OK?');
+
+define( 'TINYCONTENT_AM_LOADED' , 1 ) ;
+
+
+//Admin Page Titles
+define("_TC_ADMINTITLE","Tiny Content");
+
+//Table Titles
+define("_TC_ADDCONTENT","¥[¤J·s¤º®e");
+define("_TC_EDITCONTENT","½s¿è¤º®e");
+define("_TC_ADDLINK","¥[¤J³s±µ");
+define("_TC_EDITLINK","½s¿è³s±µ");
+define("_TC_ULFILE","¤W¸üÀÉ®×");
+define("_TC_SFILE","·j´M");
+define("_TC_DELFILE","§R°£ÀÉ®×");
+
+//Table Data
+define("_TC_HOMEPAGE","­º­¶");
+define("_TC_LINKNAME","³s±µ¼ÐÃD");
+define("_TC_STORYID","ID");
+define("_TC_VISIBLE","Åã¥Ü");
+define("_TC_CONTENT","¤º®e");
+define("_TC_YES","¬O");
+define("_TC_NO","§_");
+define("_TC_URL","¿ï¾ÜÀÉ®×");
+define("_TC_UPLOAD","¤W¸ü");
+
+define("_TC_LINKID","³s±µ-ID");
+define("_TC_ACTION","½T©w");
+define("_TC_EDIT","½s¿è");
+define("_TC_DELETE","§R°£");
+
+define('_TC_DISABLECOM','¤£¨Ï¥Îª`ÄÀ');
+define('_TC_DBUPDATED','¸ê®Æ®w§ó·s¦¨¥\!');
+define('_TC_ERRORINSERT','¸ê®Æ®w§ó·s¥¢±Ñ!');
+define('_TC_RUSUREDEL','½T©w§R°£³o¶µ¤º®e?');
+define('_TC_RUSUREDELF','½T©w§R°£³o­ÓÀÉ®×?');
+define('_TC_UPLOADED','ÀÉ®×¤W¸ü¦¨¥\!');
+define('_TC_FDELETED','ÀÉ®×§R°£¦¨¥\!');
+define('_TC_ERRORUPL','ÀÉ®×¤W¸ü¥¢±Ñ!');
+define('_TC_PERMERROR','ERROR: ¤£¯à¨ú¦s¥Ø¿ý. ½Ð§ïÅÜ¥Ø¿ý¦s©ñªºÅv­­¬° 777!');
+
+// Added in v1.4
+define('_TC_DISABLEBREAKS','Disable Linebreak Conversion (Activate when using HTML)');
+define('_TC_SUBMENU','Submenu');
+
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/tchinese/modinfo.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/tchinese/modinfo.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/tchinese/modinfo.php	(revision 405)
@@ -0,0 +1,93 @@
+<?php
+
+if( defined( 'FOR_XOOPS_LANG_CHECKER' ) || ! defined( 'TINYCONTENT_MI_LOADED' ) ) {
+
+
+
+
+
+
+
+
+
+
+// Appended by Xoops Language Checker -GIJOE- in 2006-04-11 11:14:42
+define('_TC_MD_ADMENU_MYTPLSADMIN','Templates');
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-08-27 16:00:20
+define('_MI_TC_BDESC1','Builds the navigation');
+define('_MI_TC_BDESC2','Show a content as a block. [summary] tag valid');
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-05-11 05:12:34
+define('_MI_COMMON_HTMLHEADER','Common HTML headers');
+define('_MI_COMMON_HTMLHEADER_DESC','Check if xoops_module_header exists in your theme');
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-04-20 05:52:51
+define('_MI_DISPLAY_PAGENAV_PERSUB','Divide by submenu');
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-04-13 05:53:24
+define('_MI_HEADER_TAREA_HEIGHT','Height of TextArea for HTML header');
+define('_MI_HEADER_TAREA_HEIGHT_DESC','');
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-02-19 08:26:11
+define('_MI_MODULESLESS_DIR','Name of the directory with modules/less mode');
+define('_MI_MODULESLESS_DIR_DESC','experimental implementation. you should add some specific sentences into XOOPS_ROOT_PATH/.htaccess<br />leave blank normally');
+define('_MI_USE_TAF_MODULE','User "Tell a Friend" module');
+
+// Appended by Xoops Language Checker -GIJOE- in 2004-06-18 15:39:56
+define('_MI_TC_BNAME2','TinyD %s Content');
+define('_MI_SPACE2NBSP','doubled space is changed as space+&amp;nbsp; (when linebreak on)');
+
+// Appended by Xoops Language Checker -GIJOE- in 2004-06-02 17:58:48
+define('_TC_MD_ADMENU_MYBLOCKSADMIN','Blocks/Groups');
+define('_MI_DISPLAY_PRINT_ICON','Displays icon of "Printer friendly"');
+define('_MI_DISPLAY_FRIEND_ICON','Displays icon of "Tell a friend"');
+define('_MI_DISPLAY_PAGENAV','Page Navigation');
+define('_MI_DISPLAY_PAGENAV_NONE','Not display');
+define('_MI_DISPLAY_PAGENAV_DISP','All of visible contents');
+define('_MI_DISPLAY_PAGENAV_SUB','Only about submenu contents');
+define('_MI_NAVBLOCK_TARGET','Target for tinycontent block');
+define('_MI_NAVBLOCK_TARGET_DISP','Titles of all of visible contents');
+define('_MI_NAVBLOCK_TARGET_SUB','Titles of only about submenu contents');
+
+// Appended by Xoops Language Checker -GIJOE- in 2004-05-06 09:53:54
+define('_MI_TAREA_WIDTH','Width of textarea');
+define('_MI_TAREA_WIDTH_DESC','');
+define('_MI_TAREA_HEIGHT','Height of textarea');
+define('_MI_TAREA_HEIGHT_DESC','');
+define('_MI_FORCE_MOD_REWRITE','use mod_rewrite with whole of this module');
+define('_MI_FORCE_MOD_REWRITE_DESC','Don\'t forget turning mod_rewrite on. eg) rename .htaccess.rewrite to .htaccess');
+
+define( 'TINYCONTENT_MI_LOADED' , 1 ) ;
+
+
+// Module Info Tiny_Event
+
+// The name of this module
+define("_MI_TINYCONTENT_NAME","TinyD");
+
+// A brief description of this module
+define("_MI_TINYCONTENT_DESC","Creating content as easy as it can be.");
+
+// Name for Menu Block
+define("_MI_TC_BNAME1","Tiny Content¿ï¶µ");
+
+// Admin Menu
+define("_TC_MD_ADMENU1","¥[¤J¤º®e");
+define("_TC_MD_ADMENU2","¥[¤J¤ÀÃþ");
+define("_TC_MD_ADMENU3","½s¿è/§R°£ ¤º®e");
+
+// WYSIWYG Defines for v1.4
+define('_MI_WYSIWYG',' Use Wysiwyg Editor?');
+define('_MI_WYSIWYG_DESC','');
+
+//***********************************************************************//
+// No language config below!!! Do not change this!!!                     //
+//***********************************************************************//
+
+define("_MI_TINYCONTENT_PREFIX", "tinycontent");
+define("_MI_DIR_NAME", "tinycontent");
+
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/french/admin.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/french/admin.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/french/admin.php	(revision 405)
@@ -0,0 +1,106 @@
+<?php
+
+if( defined( 'FOR_XOOPS_LANG_CHECKER' ) || ! defined( 'TINYCONTENT_AM_LOADED' ) ) {
+
+
+
+
+
+
+// Appended by Xoops Language Checker -GIJOE- in 2006-04-11 11:14:42
+define('_TC_UPDATE_WRAP_CONTENTS','Update wrapped contents for searching');
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-04-13 05:53:24
+define('_TC_HTML_HEADER','HTML header');
+define('_TC_CHECKED_ITEMS_ARE','Checked records are:');
+define('_TC_BUTTON_MOVETO','Export(Move)');
+define('_TC_CREATED','Created');
+define('_TC_SAVEAS','Save as');
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-02-11 18:59:08
+define('_TC_TYPE_HTMLNOBB','HTML Content (bb code disabled)');
+define('_TC_TYPE_TEXTNOBB','Text Content (bb code disabled)');
+
+// Appended by Xoops Language Checker -GIJOE- in 2004-06-18 15:39:55
+define('_TC_FMT_WRAPCHANGESRCHREF','rewrite attributes of html (experimental)<br /> this option rewrites relative links to absolute links.<br />This probably mis-recognizes sentences looks like HTML source<br />');
+
+// Appended by Xoops Language Checker -GIJOE- in 2004-05-06 09:53:53
+define('_TC_SPAWLANG','en');
+define('_TC_TH_VISIBLE','Vis');
+define('_TC_ENABLECOM','Comments enabled');
+define('_TC_TH_ENABLECOM','Com');
+define('_TC_TH_SUBMENU','Sub');
+define('_TC_DISP_YES','Display');
+define('_TC_DISP_NO','Not Display');
+define('_TC_CONTENT_TYPE','Page Type');
+define('_TC_TYPE_HTML','HTML Content (bb code enabled)');
+define('_TC_TYPE_TEXTWITHBB','Text Content (bb code enabled)');
+define('_TC_TYPE_PHPHTML','PHP codes (bb code disabled)');
+define('_TC_TYPE_PHPWITHBB','PHP codes (bb code enabled)');
+define('_TC_TYPE_PEARWIKI','PEAR Wiki (bb code disabled)');
+define('_TC_TYPE_PEARWIKIWITHBB','PEAR Wiki (bb code enabled)');
+define('_TC_TYPE_PUKIWIKI','PukiWiki (bb code disabled)');
+define('_TC_TYPE_PUKIWIKIWITHBB','PukiWiki (bb code enabled)');
+define('_TC_LASTMODIFIED','Last Modified');
+define('_TC_DONTUPDATELASTMODIFIED','Do not update it automatically');
+define('_TC_CONTENTTYPE','Type');
+define('_TC_ELINK','Modify');
+define('_TC_DELLINK','Cut');
+define('_TC_WRAPROOT','PageWrap\'s Base');
+define('_TC_FMT_WRAPROOTTC','Same as TinyContent module<br /> (%s) <br />');
+define('_TC_FMT_WRAPROOTPAGE','Same as wrapped page. (you can\'t use comment features)<br /> (%s) <br />use mod_rewrite if you can.<br />');
+define('_TC_FMT_WRAPBYREWRITE','use mod_rewrite (experimental)<br /> upload HTMLs and others into %s<br />Do not forget turning mod_rewrite on<br />');
+define('_TC_ERROREXIST','Error. the same filename exists');
+define('_TC_FMT_WRAPPATHPERMOFF','<span style=\'font-size:xx-small;\'>The directory for wrapping (%s) is not allowed to be written by httpd. <br />If you\'d like to upload or delete files via HTTP, turn the writing permission on.<br />I recommend to upload or delete files only via ftp for security reason, thus the writing permission of the directory should be still off.</span>');
+define('_TC_FMT_WRAPPATHPERMON','<span style=\'font-size:xx-small;\'>I don\'t recommend you to upload via HTTP. Try to upload the files for wrapping via ftp, if you can.</span>');
+define('_TC_ALTER_TABLE','Alter Table');
+define('_TC_JS_CONFIRMDISCARD','Changes will be discarded. OK?');
+
+define( 'TINYCONTENT_AM_LOADED' , 1 ) ;
+
+
+//Admin Page Titles
+define("_TC_ADMINTITLE","Tiny Content");
+
+//Table Titles
+define("_TC_ADDCONTENT","Ajouter du contenu");
+define("_TC_EDITCONTENT","Editer un contentu");
+define("_TC_ADDLINK","Ajouter un lien vers un fichier");
+define("_TC_EDITLINK","Editer un lien");
+define("_TC_ULFILE","Poster un fichier");
+define("_TC_SFILE","Rechercher");
+define("_TC_DELFILE","Effacer un fichier");
+
+//Table Data
+define("_TC_HOMEPAGE","Accueil");
+define("_TC_LINKNAME","Titre du lien");
+define("_TC_STORYID","ID");
+define("_TC_VISIBLE","Visible");
+define("_TC_CONTENT","Contenu");
+define("_TC_YES","Oui");
+define("_TC_NO","Non");
+define("_TC_URL","Choisir le fichier");
+define("_TC_UPLOAD","Poster");
+
+define("_TC_LINKID","Link-ID");
+define("_TC_ACTION","Action");
+define("_TC_EDIT","Editer");
+define("_TC_DELETE","Effacer");
+
+define("_TC_DISABLECOM","Desactiver les commentaires");
+define("_TC_DBUPDATED","Base mise à jour avec succes");
+define("_TC_ERRORINSERT","Erreur lors de la mise à jour de la base");
+define("_TC_RUSUREDEL","Etes vous sur de vouloir effacer ce contenu ?");
+define("_TC_RUSUREDELF","Etes vous sur de vouloir effacer ce fichier ?");
+define("_TC_UPLOADED","Envoie de fichier accomplie ");
+define("_TC_FDELETED","Fichier effacé");
+define("_TC_ERRORUPL","Erreur lors de l'envoie du fichier");
+define("_TC_PERMERROR","ERREUR: Impossible d'acceder au repertoire en ecriture. Changez les attributs du repertoire content à 777");
+
+// Added in v1.4
+define('_TC_DISABLEBREAKS','Disable Linebreak Conversion (Activate when using HTML)');
+define('_TC_SUBMENU','Submenu');
+
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/french/modinfo.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/french/modinfo.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/french/modinfo.php	(revision 405)
@@ -0,0 +1,93 @@
+<?php
+
+if( defined( 'FOR_XOOPS_LANG_CHECKER' ) || ! defined( 'TINYCONTENT_MI_LOADED' ) ) {
+
+
+
+
+
+
+
+
+
+
+// Appended by Xoops Language Checker -GIJOE- in 2006-04-11 11:14:42
+define('_TC_MD_ADMENU_MYTPLSADMIN','Templates');
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-08-27 16:00:20
+define('_MI_TC_BDESC1','Builds the navigation');
+define('_MI_TC_BDESC2','Show a content as a block. [summary] tag valid');
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-05-11 05:12:33
+define('_MI_COMMON_HTMLHEADER','Common HTML headers');
+define('_MI_COMMON_HTMLHEADER_DESC','Check if xoops_module_header exists in your theme');
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-04-20 05:52:50
+define('_MI_DISPLAY_PAGENAV_PERSUB','Divide by submenu');
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-04-13 05:53:24
+define('_MI_HEADER_TAREA_HEIGHT','Height of TextArea for HTML header');
+define('_MI_HEADER_TAREA_HEIGHT_DESC','');
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-02-19 08:26:10
+define('_MI_MODULESLESS_DIR','Name of the directory with modules/less mode');
+define('_MI_MODULESLESS_DIR_DESC','experimental implementation. you should add some specific sentences into XOOPS_ROOT_PATH/.htaccess<br />leave blank normally');
+define('_MI_USE_TAF_MODULE','User "Tell a Friend" module');
+
+// Appended by Xoops Language Checker -GIJOE- in 2004-06-18 15:39:55
+define('_MI_TC_BNAME2','TinyD %s Content');
+define('_MI_SPACE2NBSP','doubled space is changed as space+&amp;nbsp; (when linebreak on)');
+
+// Appended by Xoops Language Checker -GIJOE- in 2004-06-02 17:58:47
+define('_TC_MD_ADMENU_MYBLOCKSADMIN','Blocks/Groups');
+define('_MI_DISPLAY_PRINT_ICON','Displays icon of "Printer friendly"');
+define('_MI_DISPLAY_FRIEND_ICON','Displays icon of "Tell a friend"');
+define('_MI_DISPLAY_PAGENAV','Page Navigation');
+define('_MI_DISPLAY_PAGENAV_NONE','Not display');
+define('_MI_DISPLAY_PAGENAV_DISP','All of visible contents');
+define('_MI_DISPLAY_PAGENAV_SUB','Only about submenu contents');
+define('_MI_NAVBLOCK_TARGET','Target for tinycontent block');
+define('_MI_NAVBLOCK_TARGET_DISP','Titles of all of visible contents');
+define('_MI_NAVBLOCK_TARGET_SUB','Titles of only about submenu contents');
+
+// Appended by Xoops Language Checker -GIJOE- in 2004-05-06 09:53:53
+define('_MI_TAREA_WIDTH','Width of textarea');
+define('_MI_TAREA_WIDTH_DESC','');
+define('_MI_TAREA_HEIGHT','Height of textarea');
+define('_MI_TAREA_HEIGHT_DESC','');
+define('_MI_FORCE_MOD_REWRITE','use mod_rewrite with whole of this module');
+define('_MI_FORCE_MOD_REWRITE_DESC','Don\'t forget turning mod_rewrite on. eg) rename .htaccess.rewrite to .htaccess');
+
+define( 'TINYCONTENT_MI_LOADED' , 1 ) ;
+
+
+// Module Info Tiny_Event
+
+// The name of this module
+define("_MI_TINYCONTENT_NAME","TinyD");
+
+// A brief description of this module
+define("_MI_TINYCONTENT_DESC","Ajouter du contenu devient plus simple.");
+
+// Name for Menu Block
+define("_MI_TC_BNAME1","Menu Tiny Content");
+
+// Admin Menu
+define("_TC_MD_ADMENU1","Ajouter un texte");
+define("_TC_MD_ADMENU2","Ajouter un fichier");
+define("_TC_MD_ADMENU3","Editer/Supprimer un contenu");
+
+// WYSIWYG Defines for v1.4
+define('_MI_WYSIWYG',' Use Wysiwyg Editor?');
+define('_MI_WYSIWYG_DESC','');
+
+//***********************************************************************//
+// No language config below!!! Do not change this!!!                     //
+//***********************************************************************//
+
+define("_MI_TINYCONTENT_PREFIX", "tinycontent");
+define("_MI_DIR_NAME", "tinycontent");
+
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/french/main.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/french/main.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/french/main.php	(revision 405)
@@ -0,0 +1,44 @@
+<?php
+
+if( defined( 'FOR_XOOPS_LANG_CHECKER' ) || ! defined( 'TINYCONTENT_MB_LOADED' ) ) {
+
+
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-04-19 18:26:41
+define('_TC_FMT_DEFAULT_COMMENT_TITLE','Re: %s');
+
+// Appended by Xoops Language Checker -GIJOE- in 2004-06-02 17:58:47
+define('_TC_NEXTPAGE','Next');
+define('_TC_PREVPAGE','Prev');
+define('_TC_TOPOFCONTENTS','Top of contents');
+
+define( 'TINYCONTENT_MB_LOADED' , 1 ) ;
+
+define('_TC_FILENOTFOUND','File not found! Please check the URL!');
+define("_TC_PRINTERFRIENDLY","Printer Friendly Page");
+define("_TC_SENDSTORY","Send this Story to a Friend");
+
+// whether parameter for "mailto:" is already rawurlencoded
+define("_TC_DONE_MAILTOENCODE" , false ) ;
+
+// %s is your site name. for single byte languages (ignored when _TC_DONE_MAILTOENCODE is true)
+define("_TC_INTARTICLE","Interesting Article at %s");
+define("_TC_INTARTFOUND","Here is an interesting article I have found at %s");
+
+// for multibyte languages (ignored when _TC_DONE_MAILTOENCODE is false)
+define("_TC_MB_INTARTICLE","" ) ;
+define("_TC_MB_INTARTFOUND","" ) ;
+
+// %s represents your site name
+define("_TC_THISCOMESFROM","This article comes from %s");
+define("_TC_URLFORSTORY","The URL for this story is:");
+}
+
+if( ! defined( 'FOR_XOOPS_LANG_CHECKER' ) && ! function_exists( 'tc_convert_wrap_to_ie' ) ) {
+	function tc_convert_wrap_to_ie( $str ) {
+		return $str ;
+	}
+}
+
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/spanish/modinfo.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/spanish/modinfo.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/spanish/modinfo.php	(revision 405)
@@ -0,0 +1,93 @@
+<?php
+
+if( defined( 'FOR_XOOPS_LANG_CHECKER' ) || ! defined( 'TINYCONTENT_MI_LOADED' ) ) {
+
+
+
+
+
+
+
+
+
+
+// Appended by Xoops Language Checker -GIJOE- in 2006-04-11 11:14:42
+define('_TC_MD_ADMENU_MYTPLSADMIN','Templates');
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-08-27 16:00:20
+define('_MI_TC_BDESC1','Builds the navigation');
+define('_MI_TC_BDESC2','Show a content as a block. [summary] tag valid');
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-05-11 05:12:34
+define('_MI_COMMON_HTMLHEADER','Common HTML headers');
+define('_MI_COMMON_HTMLHEADER_DESC','Check if xoops_module_header exists in your theme');
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-04-20 05:52:50
+define('_MI_DISPLAY_PAGENAV_PERSUB','Divide by submenu');
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-04-13 05:53:24
+define('_MI_HEADER_TAREA_HEIGHT','Height of TextArea for HTML header');
+define('_MI_HEADER_TAREA_HEIGHT_DESC','');
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-02-19 08:26:11
+define('_MI_MODULESLESS_DIR','Name of the directory with modules/less mode');
+define('_MI_MODULESLESS_DIR_DESC','experimental implementation. you should add some specific sentences into XOOPS_ROOT_PATH/.htaccess<br />leave blank normally');
+define('_MI_USE_TAF_MODULE','User "Tell a Friend" module');
+
+// Appended by Xoops Language Checker -GIJOE- in 2004-06-18 15:39:55
+define('_MI_TC_BNAME2','TinyD %s Content');
+define('_MI_SPACE2NBSP','doubled space is changed as space+&amp;nbsp; (when linebreak on)');
+
+// Appended by Xoops Language Checker -GIJOE- in 2004-06-02 17:58:48
+define('_TC_MD_ADMENU_MYBLOCKSADMIN','Blocks/Groups');
+define('_MI_DISPLAY_PRINT_ICON','Displays icon of "Printer friendly"');
+define('_MI_DISPLAY_FRIEND_ICON','Displays icon of "Tell a friend"');
+define('_MI_DISPLAY_PAGENAV','Page Navigation');
+define('_MI_DISPLAY_PAGENAV_NONE','Not display');
+define('_MI_DISPLAY_PAGENAV_DISP','All of visible contents');
+define('_MI_DISPLAY_PAGENAV_SUB','Only about submenu contents');
+define('_MI_NAVBLOCK_TARGET','Target for tinycontent block');
+define('_MI_NAVBLOCK_TARGET_DISP','Titles of all of visible contents');
+define('_MI_NAVBLOCK_TARGET_SUB','Titles of only about submenu contents');
+
+// Appended by Xoops Language Checker -GIJOE- in 2004-05-06 09:53:54
+define('_MI_TAREA_WIDTH','Width of textarea');
+define('_MI_TAREA_WIDTH_DESC','');
+define('_MI_TAREA_HEIGHT','Height of textarea');
+define('_MI_TAREA_HEIGHT_DESC','');
+define('_MI_FORCE_MOD_REWRITE','use mod_rewrite with whole of this module');
+define('_MI_FORCE_MOD_REWRITE_DESC','Don\'t forget turning mod_rewrite on. eg) rename .htaccess.rewrite to .htaccess');
+
+define( 'TINYCONTENT_MI_LOADED' , 1 ) ;
+
+
+// Module Info Tiny_Event
+
+// The name of this module
+define("_MI_TINYCONTENT_NAME","TinyD");
+
+// A brief description of this module
+define("_MI_TINYCONTENT_DESC","Creando contenido tan facil como pueda ser.");
+
+// Name for Menu Block
+define("_MI_TC_BNAME1","Menu de Tiny Content");
+
+// Admin Menu
+define("_TC_MD_ADMENU1","Agregar Contenido");
+define("_TC_MD_ADMENU2","Agregar PageWrap");
+define("_TC_MD_ADMENU3","Editar/Borrar Contenido");
+
+// WYSIWYG Defines for v1.4
+define('_MI_WYSIWYG',' Use Wysiwyg Editor?');
+define('_MI_WYSIWYG_DESC','');
+
+//***********************************************************************//
+// No language config below!!! Do not change this!!!                     //
+//***********************************************************************//
+
+define("_MI_TINYCONTENT_PREFIX", "tinycontent");
+define("_MI_DIR_NAME", "tinycontent");
+
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/spanish/main.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/spanish/main.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/spanish/main.php	(revision 405)
@@ -0,0 +1,44 @@
+<?php
+
+if( defined( 'FOR_XOOPS_LANG_CHECKER' ) || ! defined( 'TINYCONTENT_MB_LOADED' ) ) {
+
+
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-04-19 18:26:42
+define('_TC_FMT_DEFAULT_COMMENT_TITLE','Re: %s');
+
+// Appended by Xoops Language Checker -GIJOE- in 2004-06-02 17:58:48
+define('_TC_NEXTPAGE','Next');
+define('_TC_PREVPAGE','Prev');
+define('_TC_TOPOFCONTENTS','Top of contents');
+
+define( 'TINYCONTENT_MB_LOADED' , 1 ) ;
+
+define('_TC_FILENOTFOUND','File not found! Please check the URL!');
+define("_TC_PRINTERFRIENDLY","Printer Friendly Page");
+define("_TC_SENDSTORY","Send this Story to a Friend");
+
+// whether parameter for "mailto:" is already rawurlencoded
+define("_TC_DONE_MAILTOENCODE" , false ) ;
+
+// %s is your site name. for single byte languages (ignored when _TC_DONE_MAILTOENCODE is true)
+define("_TC_INTARTICLE","Interesting Article at %s");
+define("_TC_INTARTFOUND","Here is an interesting article I have found at %s");
+
+// for multibyte languages (ignored when _TC_DONE_MAILTOENCODE is false)
+define("_TC_MB_INTARTICLE","" ) ;
+define("_TC_MB_INTARTFOUND","" ) ;
+
+// %s represents your site name
+define("_TC_THISCOMESFROM","This article comes from %s");
+define("_TC_URLFORSTORY","The URL for this story is:");
+}
+
+if( ! defined( 'FOR_XOOPS_LANG_CHECKER' ) && ! function_exists( 'tc_convert_wrap_to_ie' ) ) {
+	function tc_convert_wrap_to_ie( $str ) {
+		return $str ;
+	}
+}
+
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/spanish/admin.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/spanish/admin.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/spanish/admin.php	(revision 405)
@@ -0,0 +1,109 @@
+<?php
+
+if( defined( 'FOR_XOOPS_LANG_CHECKER' ) || ! defined( 'TINYCONTENT_AM_LOADED' ) ) {
+
+
+
+
+
+
+// Appended by Xoops Language Checker -GIJOE- in 2006-04-11 11:14:42
+define('_TC_UPDATE_WRAP_CONTENTS','Update wrapped contents for searching');
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-04-13 05:53:24
+define('_TC_HTML_HEADER','HTML header');
+define('_TC_CHECKED_ITEMS_ARE','Checked records are:');
+define('_TC_BUTTON_MOVETO','Export(Move)');
+define('_TC_CREATED','Created');
+define('_TC_SAVEAS','Save as');
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-02-11 18:59:09
+define('_TC_TYPE_HTMLNOBB','HTML Content (bb code disabled)');
+define('_TC_TYPE_TEXTNOBB','Text Content (bb code disabled)');
+
+// Appended by Xoops Language Checker -GIJOE- in 2004-06-18 15:39:55
+define('_TC_FMT_WRAPCHANGESRCHREF','rewrite attributes of html (experimental)<br /> this option rewrites relative links to absolute links.<br />This probably mis-recognizes sentences looks like HTML source<br />');
+
+// Appended by Xoops Language Checker -GIJOE- in 2004-05-06 09:53:54
+define('_TC_SPAWLANG','en');
+define('_TC_ULFILE','Upload File');
+define('_TC_SFILE','Search');
+define('_TC_DELFILE','Delete File');
+define('_TC_TH_VISIBLE','Vis');
+define('_TC_ENABLECOM','Comments enabled');
+define('_TC_TH_ENABLECOM','Com');
+define('_TC_TH_SUBMENU','Sub');
+define('_TC_DISP_YES','Display');
+define('_TC_DISP_NO','Not Display');
+define('_TC_CONTENT_TYPE','Page Type');
+define('_TC_TYPE_HTML','HTML Content (bb code enabled)');
+define('_TC_TYPE_TEXTWITHBB','Text Content (bb code enabled)');
+define('_TC_TYPE_PHPHTML','PHP codes (bb code disabled)');
+define('_TC_TYPE_PHPWITHBB','PHP codes (bb code enabled)');
+define('_TC_TYPE_PEARWIKI','PEAR Wiki (bb code disabled)');
+define('_TC_TYPE_PEARWIKIWITHBB','PEAR Wiki (bb code enabled)');
+define('_TC_TYPE_PUKIWIKI','PukiWiki (bb code disabled)');
+define('_TC_TYPE_PUKIWIKIWITHBB','PukiWiki (bb code enabled)');
+define('_TC_LASTMODIFIED','Last Modified');
+define('_TC_DONTUPDATELASTMODIFIED','Do not update it automatically');
+define('_TC_CONTENTTYPE','Type');
+define('_TC_ELINK','Modify');
+define('_TC_DELLINK','Cut');
+define('_TC_WRAPROOT','PageWrap\'s Base');
+define('_TC_FMT_WRAPROOTTC','Same as TinyContent module<br /> (%s) <br />');
+define('_TC_FMT_WRAPROOTPAGE','Same as wrapped page. (you can\'t use comment features)<br /> (%s) <br />use mod_rewrite if you can.<br />');
+define('_TC_FMT_WRAPBYREWRITE','use mod_rewrite (experimental)<br /> upload HTMLs and others into %s<br />Do not forget turning mod_rewrite on<br />');
+define('_TC_ERROREXIST','Error. the same filename exists');
+define('_TC_FMT_WRAPPATHPERMOFF','<span style=\'font-size:xx-small;\'>The directory for wrapping (%s) is not allowed to be written by httpd. <br />If you\'d like to upload or delete files via HTTP, turn the writing permission on.<br />I recommend to upload or delete files only via ftp for security reason, thus the writing permission of the directory should be still off.</span>');
+define('_TC_FMT_WRAPPATHPERMON','<span style=\'font-size:xx-small;\'>I don\'t recommend you to upload via HTTP. Try to upload the files for wrapping via ftp, if you can.</span>');
+define('_TC_ALTER_TABLE','Alter Table');
+define('_TC_JS_CONFIRMDISCARD','Changes will be discarded. OK?');
+
+define( 'TINYCONTENT_AM_LOADED' , 1 ) ;
+
+
+//Admin Page Titles
+define("_TC_ADMINTITLE","Tiny Content");
+
+//Table Titles
+define("_TC_ADDCONTENT","Agregar contenido ");
+define("_TC_EDITCONTENT","Editar contenido");
+define("_TC_ADDLINK","Agregar un enlace");
+define("_TC_EDITLINK","Editar un enlace");
+
+//Table Data
+define("_TC_HOMEPAGE","Pagina principal");
+define("_TC_LINKNAME","Titulo del enlace");
+define("_TC_VISIBLE","Visible");
+define("_TC_CONTENT","Contenido");
+define("_TC_YES","Si");
+define("_TC_NO","No");
+define("_TC_URL","URL");
+
+define("_TC_LINKID","Enlace-ID");
+define("_TC_ACTION","Acci
+Ï");
+define("_TC_EDIT","Editar");
+define("_TC_DELETE","Borrar");
+
+define('_TC_DBUPDATED','Base de datos actualizada exitosamente!');
+define('_TC_ERRORINSERT','Error al actualizar la base de datos!');
+
+// Added in v1.4
+define('_TC_DISABLEBREAKS','Deshabilitar conversi
+Ï de Linebreak (Activado cuando usas HTML)');
+define('_TC_SUBMENU','Submenu');
+
+define("_TC_STORYID","ID");
+define("_TC_UPLOAD","Subir");
+define('_TC_DISABLECOM','Deshabilitar comentarios');
+define('_TC_RUSUREDEL','¿EstáÔ seguro que quieres eliminar este contenido?');
+define('_TC_RUSUREDELF','¿EstáÔ seguro que quieres eliminar este archivo?');
+define('_TC_UPLOADED','¡Archivo actualizado exitosamente!');
+define('_TC_FDELETED','¡Archivo eliminado exitosamente!');
+define('_TC_ERRORUPL','¡Error al subir archivo!');
+define('_TC_PERMERROR','ERROR: no se puede accesar al directorio. por favor cambia los permisos a 777!');
+
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/danish/main.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/danish/main.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/danish/main.php	(revision 405)
@@ -0,0 +1,44 @@
+<?php
+
+if( defined( 'FOR_XOOPS_LANG_CHECKER' ) || ! defined( 'TINYCONTENT_MB_LOADED' ) ) {
+
+
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-04-19 18:26:41
+define('_TC_FMT_DEFAULT_COMMENT_TITLE','Re: %s');
+
+// Appended by Xoops Language Checker -GIJOE- in 2004-06-02 17:58:47
+define('_TC_NEXTPAGE','Next');
+define('_TC_PREVPAGE','Prev');
+define('_TC_TOPOFCONTENTS','Top of contents');
+
+define( 'TINYCONTENT_MB_LOADED' , 1 ) ;
+
+define('_TC_FILENOTFOUND','File not found! Please check the URL!');
+define("_TC_PRINTERFRIENDLY","Printer Friendly Page");
+define("_TC_SENDSTORY","Send this Story to a Friend");
+
+// whether parameter for "mailto:" is already rawurlencoded
+define("_TC_DONE_MAILTOENCODE" , false ) ;
+
+// %s is your site name. for single byte languages (ignored when _TC_DONE_MAILTOENCODE is true)
+define("_TC_INTARTICLE","Interesting Article at %s");
+define("_TC_INTARTFOUND","Here is an interesting article I have found at %s");
+
+// for multibyte languages (ignored when _TC_DONE_MAILTOENCODE is false)
+define("_TC_MB_INTARTICLE","" ) ;
+define("_TC_MB_INTARTFOUND","" ) ;
+
+// %s represents your site name
+define("_TC_THISCOMESFROM","This article comes from %s");
+define("_TC_URLFORSTORY","The URL for this story is:");
+}
+
+if( ! defined( 'FOR_XOOPS_LANG_CHECKER' ) && ! function_exists( 'tc_convert_wrap_to_ie' ) ) {
+	function tc_convert_wrap_to_ie( $str ) {
+		return $str ;
+	}
+}
+
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/danish/admin.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/danish/admin.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/danish/admin.php	(revision 405)
@@ -0,0 +1,106 @@
+<?php
+
+if( defined( 'FOR_XOOPS_LANG_CHECKER' ) || ! defined( 'TINYCONTENT_AM_LOADED' ) ) {
+
+
+
+
+
+
+// Appended by Xoops Language Checker -GIJOE- in 2006-04-11 11:14:42
+define('_TC_UPDATE_WRAP_CONTENTS','Update wrapped contents for searching');
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-04-13 05:53:23
+define('_TC_HTML_HEADER','HTML header');
+define('_TC_CHECKED_ITEMS_ARE','Checked records are:');
+define('_TC_BUTTON_MOVETO','Export(Move)');
+define('_TC_CREATED','Created');
+define('_TC_SAVEAS','Save as');
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-02-11 18:59:08
+define('_TC_TYPE_HTMLNOBB','HTML Content (bb code disabled)');
+define('_TC_TYPE_TEXTNOBB','Text Content (bb code disabled)');
+
+// Appended by Xoops Language Checker -GIJOE- in 2004-06-18 15:39:55
+define('_TC_FMT_WRAPCHANGESRCHREF','rewrite attributes of html (experimental)<br /> this option rewrites relative links to absolute links.<br />This probably mis-recognizes sentences looks like HTML source<br />');
+
+// Appended by Xoops Language Checker -GIJOE- in 2004-05-06 09:53:53
+define('_TC_SPAWLANG','en');
+define('_TC_TH_VISIBLE','Vis');
+define('_TC_ENABLECOM','Comments enabled');
+define('_TC_TH_ENABLECOM','Com');
+define('_TC_TH_SUBMENU','Sub');
+define('_TC_DISP_YES','Display');
+define('_TC_DISP_NO','Not Display');
+define('_TC_CONTENT_TYPE','Page Type');
+define('_TC_TYPE_HTML','HTML Content (bb code enabled)');
+define('_TC_TYPE_TEXTWITHBB','Text Content (bb code enabled)');
+define('_TC_TYPE_PHPHTML','PHP codes (bb code disabled)');
+define('_TC_TYPE_PHPWITHBB','PHP codes (bb code enabled)');
+define('_TC_TYPE_PEARWIKI','PEAR Wiki (bb code disabled)');
+define('_TC_TYPE_PEARWIKIWITHBB','PEAR Wiki (bb code enabled)');
+define('_TC_TYPE_PUKIWIKI','PukiWiki (bb code disabled)');
+define('_TC_TYPE_PUKIWIKIWITHBB','PukiWiki (bb code enabled)');
+define('_TC_LASTMODIFIED','Last Modified');
+define('_TC_DONTUPDATELASTMODIFIED','Do not update it automatically');
+define('_TC_CONTENTTYPE','Type');
+define('_TC_ELINK','Modify');
+define('_TC_DELLINK','Cut');
+define('_TC_WRAPROOT','PageWrap\'s Base');
+define('_TC_FMT_WRAPROOTTC','Same as TinyContent module<br /> (%s) <br />');
+define('_TC_FMT_WRAPROOTPAGE','Same as wrapped page. (you can\'t use comment features)<br /> (%s) <br />use mod_rewrite if you can.<br />');
+define('_TC_FMT_WRAPBYREWRITE','use mod_rewrite (experimental)<br /> upload HTMLs and others into %s<br />Do not forget turning mod_rewrite on<br />');
+define('_TC_ERROREXIST','Error. the same filename exists');
+define('_TC_FMT_WRAPPATHPERMOFF','<span style=\'font-size:xx-small;\'>The directory for wrapping (%s) is not allowed to be written by httpd. <br />If you\'d like to upload or delete files via HTTP, turn the writing permission on.<br />I recommend to upload or delete files only via ftp for security reason, thus the writing permission of the directory should be still off.</span>');
+define('_TC_FMT_WRAPPATHPERMON','<span style=\'font-size:xx-small;\'>I don\'t recommend you to upload via HTTP. Try to upload the files for wrapping via ftp, if you can.</span>');
+define('_TC_ALTER_TABLE','Alter Table');
+define('_TC_JS_CONFIRMDISCARD','Changes will be discarded. OK?');
+
+define( 'TINYCONTENT_AM_LOADED' , 1 ) ;
+
+
+//Admin Page Titles
+define("_TC_ADMINTITLE","Tiny Content");
+
+//Table Titles
+define("_TC_ADDCONTENT","TilfË nyt indhold");
+define("_TC_EDITCONTENT","RedigñÓ indhold");
+define("_TC_ADDLINK","TilfË link");
+define("_TC_EDITLINK","RedigñÓ link");
+define("_TC_ULFILE","Upload fil");
+define("_TC_SFILE","SÈ");
+define("_TC_DELFILE","Slet fil");
+
+//Table Data
+define("_TC_HOMEPAGE","Hjemmeside");
+define("_TC_LINKNAME","Link overskrift");
+define("_TC_STORYID","ID");
+define("_TC_VISIBLE","Synlig");
+define("_TC_CONTENT","Indhold");
+define("_TC_YES","Ja");
+define("_TC_NO","Nej");
+define("_TC_URL","VëÍg fil");
+define("_TC_UPLOAD","Upload");
+
+define("_TC_LINKID","Link-ID");
+define("_TC_ACTION","Handling");
+define("_TC_EDIT","RedigñÓ");
+define("_TC_DELETE","Slet");
+
+define('_TC_DISABLECOM','Deaktiver kommentarer');
+define('_TC_DBUPDATED','Ændringerne er gemt i databasen!');
+define('_TC_ERRORINSERT','Der opstod en fejl under skrivningen til databasen!');
+define('_TC_RUSUREDEL','Er du sikker på at du vil slette dette indhold?');
+define('_TC_RUSUREDELF','Er du sikker på at du vil slette denne fil?');
+define('_TC_UPLOADED','Filen er blevet sendt til serveren!');
+define('_TC_FDELETED','Filen er blevet slettet!');
+define('_TC_ERRORUPL','OverfÓslen af filen til serveren fejlede!');
+define('_TC_PERMERROR','FEJL: Kan ikke skrive til fil mappen. UdfÓ venligst "chmod 777" på mappen!');
+
+// Added in v1.4
+define('_TC_DISABLEBREAKS','Deaktiver konvertering af linieskift (Aktiver denne nnéÓ der benyttes HTML)');
+define('_TC_SUBMENU','Under-menu');
+
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/danish/modinfo.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/danish/modinfo.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/danish/modinfo.php	(revision 405)
@@ -0,0 +1,97 @@
+<?php
+
+if( defined( 'FOR_XOOPS_LANG_CHECKER' ) || ! defined( 'TINYCONTENT_MI_LOADED' ) ) {
+
+
+
+
+
+
+
+
+
+
+// Appended by Xoops Language Checker -GIJOE- in 2006-04-11 11:14:42
+define('_TC_MD_ADMENU_MYTPLSADMIN','Templates');
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-08-27 16:00:20
+define('_MI_TC_BDESC1','Builds the navigation');
+define('_MI_TC_BDESC2','Show a content as a block. [summary] tag valid');
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-05-11 05:12:33
+define('_MI_COMMON_HTMLHEADER','Common HTML headers');
+define('_MI_COMMON_HTMLHEADER_DESC','Check if xoops_module_header exists in your theme');
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-04-20 05:52:50
+define('_MI_DISPLAY_PAGENAV_PERSUB','Divide by submenu');
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-04-13 05:53:23
+define('_MI_HEADER_TAREA_HEIGHT','Height of TextArea for HTML header');
+define('_MI_HEADER_TAREA_HEIGHT_DESC','');
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-02-19 08:26:10
+define('_MI_MODULESLESS_DIR','Name of the directory with modules/less mode');
+define('_MI_MODULESLESS_DIR_DESC','experimental implementation. you should add some specific sentences into XOOPS_ROOT_PATH/.htaccess<br />leave blank normally');
+define('_MI_USE_TAF_MODULE','User "Tell a Friend" module');
+
+// Appended by Xoops Language Checker -GIJOE- in 2004-06-18 15:39:55
+define('_MI_TC_BNAME2','TinyD %s Content');
+define('_MI_SPACE2NBSP','doubled space is changed as space+&amp;nbsp; (when linebreak on)');
+
+// Appended by Xoops Language Checker -GIJOE- in 2004-06-02 17:58:47
+define('_TC_MD_ADMENU_MYBLOCKSADMIN','Blocks/Groups');
+define('_MI_DISPLAY_PRINT_ICON','Displays icon of "Printer friendly"');
+define('_MI_DISPLAY_FRIEND_ICON','Displays icon of "Tell a friend"');
+define('_MI_DISPLAY_PAGENAV','Page Navigation');
+define('_MI_DISPLAY_PAGENAV_NONE','Not display');
+define('_MI_DISPLAY_PAGENAV_DISP','All of visible contents');
+define('_MI_DISPLAY_PAGENAV_SUB','Only about submenu contents');
+define('_MI_NAVBLOCK_TARGET','Target for tinycontent block');
+define('_MI_NAVBLOCK_TARGET_DISP','Titles of all of visible contents');
+define('_MI_NAVBLOCK_TARGET_SUB','Titles of only about submenu contents');
+
+// Appended by Xoops Language Checker -GIJOE- in 2004-05-06 09:53:53
+define('_MI_TAREA_WIDTH','Width of textarea');
+define('_MI_TAREA_WIDTH_DESC','');
+define('_MI_TAREA_HEIGHT','Height of textarea');
+define('_MI_TAREA_HEIGHT_DESC','');
+define('_MI_FORCE_MOD_REWRITE','use mod_rewrite with whole of this module');
+define('_MI_FORCE_MOD_REWRITE_DESC','Don\'t forget turning mod_rewrite on. eg) rename .htaccess.rewrite to .htaccess');
+
+define( 'TINYCONTENT_MI_LOADED' , 1 ) ;
+
+
+// Module Info Tiny_Event
+
+// The name of this module
+define("_MI_TINYCONTENT_NAME","TinyD");
+
+// A brief description of this module
+define("_MI_TINYCONTENT_DESC","Den nemmeste méÅe at lave indhold.");
+
+// Name for Menu Block
+define("_MI_TC_BNAME1","Tiny Content Menu");
+
+// Admin Menu
+define("_TC_MD_ADMENU1","TilfË indhold");
+define("_TC_MD_ADMENU2","TilfË ekstern side");
+define("_TC_MD_ADMENU3","RedigñÓ/Slet Indhold");
+
+// WYSIWYG Defines for v1.4
+define('_MI_WYSIWYG',' Benyt Wysiwyg?');
+define('_MI_WYSIWYG_DESC','');
+
+
+//***********************************************************************//
+// No language config below! Only if you want to change the Prefix       //
+// or the directory of the module! So you can sipmly duplicate this      //
+// module by copying it in another folder and change the settings below! //
+// Also before install a clone change the prefix in the sql file! ;-)    //
+//***********************************************************************//
+
+define("_MI_TINYCONTENT_PREFIX", "tinycontent");
+define("_MI_DIR_NAME", "tinycontent");
+
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/japanese/main.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/japanese/main.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/japanese/main.php	(revision 405)
@@ -0,0 +1,40 @@
+<?php
+
+if( defined( 'FOR_XOOPS_LANG_CHECKER' ) || ! defined( 'TINYCONTENT_MB_LOADED' ) ) {
+
+define( 'TINYCONTENT_MB_LOADED' , 1 ) ;
+
+define( "_TC_FMT_DEFAULT_COMMENT_TITLE" , "Re: %s" ) ;
+
+define('_TC_FILENOTFOUND','¥Õ¥¡¥¤¥ë¤¬¸«¤Ä¤«¤ê¤Þ¤»¤ó¡£URL¤ò³ÎÇ§¤·¤Æ²¼¤µ¤¤');
+define("_TC_PRINTERFRIENDLY","¥×¥ê¥ó¥¿½ÐÎÏÍÑ²èÌÌ");
+define("_TC_SENDSTORY","Í§Ã£¤ËÅÁ¤¨¤ë");
+
+define("_TC_NEXTPAGE","¼¡¤Î¥Ú¡¼¥¸");
+define("_TC_PREVPAGE","Á°¤Î¥Ú¡¼¥¸");
+define("_TC_TOPOFCONTENTS","¥³¥ó¥Æ¥ó¥Ä¤Î¥È¥Ã¥×");
+
+// whether parameter for "mailto:" is already rawurlencoded
+define("_TC_DONE_MAILTOENCODE" , true ) ;
+
+// %s is your site name. for single byte languages (ignored when _TC_DONE_MAILTOENCODE is true)
+define("_TC_INTARTICLE","%s¤Ç¸«¤Ä¤±¤¿¶½Ì£¿¼¤¤µ­»ö");
+define("_TC_INTARTFOUND","¤³¤Î¥µ¥¤¥È¤ò¸«¤Æ²¼¤µ¤¤ %s");
+
+// for multibyte languages (ignored when _TC_DONE_MAILTOENCODE is false)
+define("_TC_MB_INTARTICLE","%97%C7%82%A2%83T%83C%83g%82%F0%8C%A9%82%C2%82%AF%82%BD%82%CC%82%C5%8F%D0%89%EE%82%B5%82%DC%82%B7");	// ¡ÖÎÉ¤¤¥µ¥¤¥È¤ò¸«¤Ä¤±¤¿¤Î¤Ç¾Ò²ð¤·¤Þ¤¹¡×¤ÎSJISÊ¸»úÎó¤ò rawurlencode() ¤·¤¿¤â¤Î
+define("_TC_MB_INTARTFOUND","%83%54%83%43%83%67%82%CCURL");	// ¡Ö¥µ¥¤¥È¤ÎURL¡×¤ÎSJISÊ¸»úÎó¤ò rawurlencode() ¤·¤¿¤â¤Î
+
+// %s represents your site name
+define("_TC_THISCOMESFROM","¥µ¥¤¥ÈÌ¾: %s");
+define("_TC_URLFORSTORY","¤³¤Îµ­»ö¤ÎURL:");
+}
+
+if( ! defined( 'FOR_XOOPS_LANG_CHECKER' ) && ! function_exists( 'tc_convert_wrap_to_ie' ) ) {
+	function tc_convert_wrap_to_ie( $str ) {
+		return mb_convert_encoding( $str , mb_internal_encoding() , "auto" ) ;
+	}
+}
+
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/japanese/text_wiki_sample.wiki
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/japanese/text_wiki_sample.wiki	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/japanese/text_wiki_sample.wiki	(revision 405)
@@ -0,0 +1,353 @@
+[[toc]]
+
+----
+
+++ ÁíÏÀ
+
+The markup described on this page is for the default {{Text_Wiki}} rules; \
+it is a combination of the [http://tavi.sourceforge.net WikkTikkiTavi] \
+and [http://develnet.org/ coWiki] markup styles.
+
+All text is entered as plain text, and will be converted to HTML entities as \
+necessary.  This means that {{<}}, {{>}}, {{&}}, and so on are converted for \
+you (except in special situations where the characters are Wiki markup; \
+Text_Wiki is generally smart enough to know when to convert and when not to).
+
+Just hit "return" twice to make a paragraph break.  If you want \
+to keep the same logical line but have to split it across \
+two physical lines (such as when your editor only shows a certain number \
+of characters per line), end the line with a backslash {{\}} and hit \
+return once.  This will cause the two lines to be joined on display, and the \
+backslash will not show.  (If you end a line with a backslash and a tab \
+or space, it will ''not'' be joined with the next line, and the backslash \
+will be printed.)
+
+
+----
+
+++ ¥¤¥ó¥é¥¤¥ó½ñ¼°
+
+|| {{``//¥¤¥¿¥ê¥Ã¥¯//``}}                 || //¥¤¥¿¥ê¥Ã¥¯// ||
+|| {{``**¥Ü¡¼¥ë¥É**``}}                   || **¥Ü¡¼¥ë¥É** ||
+|| {{``//**¥Ü¡¼¥ë¥É&¥¤¥¿¥ê¥Ã¥¯**//``}}       || //**¥Ü¡¼¥ë¥É&¥¤¥¿¥ê¥Ã¥¯**// ||
+|| {{``{{¥¿¥¤¥×¥é¥¤¥¿¡¼ÂÎ}}``}}                    || {{¥¿¥¤¥×¥é¥¤¥¿¡¼ÂÎ}} ||
+|| {{``@@--- ÂÇ¤Á¾Ã¤·Àþ +++ ÁÞÆþÊ¸ @@``}} || @@--- ÂÇ¤Á¾Ã¤·Àþ +++ ÁÞÆþÊ¸ @@ ||
+|| {{``@@--- ÂÇ¤Á¾Ã¤·Àþ @@``}}                 || @@--- ÂÇ¤Á¾Ã¤·Àþ @@ ||
+|| {{``@@+++ ÁÞÆþÊ¸ @@``}}                 || @@+++ ÁÞÆþÊ¸ @@ ||
+
+
+----
+
+++ ½¤¾þ½èÍý¤Î¥¹¥­¥Ã¥×
+
+If you don't want Text_Wiki to parse some text, enclose it in two backticks (not single-quotes).
+
+<code>
+
+This //text// gets **parsed**.
+
+``This //text// does not get **parsed**.``
+
+</code>
+
+This //text// gets **parsed**.
+
+``This //text// does not get **parsed**.``
+
+----
+
+++ ¸«½Ð¤·
+
+You can make various levels of heading by putting \
+equals-signs before and after the text (all on its \
+own line):
+
+<code>
++++ Level 3 Heading
+++++ Level 4 Heading
++++++ Level 5 Heading
+++++++ Level 6 Heading
+</code>
+
++++ Level 3 Heading
+++++ Level 4 Heading
++++++ Level 5 Heading
+++++++ Level 6 Heading
+
+----
+
+++ ÌÜ¼¡
+
+To create a list of every heading, with a link to that heading, put a table of contents tag on its own line.
+
+<code>
+[[toc]]
+</code>
+
+----
+
+++ ¿åÊ¿Àþ
+
+Use four dashes ({{``----``}}) to create a horizontal rule.
+
+----
+
+++ ¥ê¥¹¥È
+
++++ µ­¹æÉÕ¥ê¥¹¥È
+
+You can create bullet lists by starting a paragraph with one or \
+more asterisks.
+
+<code>
+* Bullet one
+ * Sub-bullet
+</code>
+
+* Bullet one
+ * Sub-bullet
+
++++ ÈÖ¹æÉÕ¥ê¥¹¥È
+
+Similarly, you can create numbered lists by starting a paragraph \
+with one or more hashes.
+
+<code>
+# Numero uno
+# Number two
+ # Sub-item
+</code>
+
+# Numero uno
+# Number two
+ # Sub-item
+
+
++++ ÈÖ¹æÉÕ¥ê¥¹¥È¤Èµ­¹æÉÕ¥ê¥¹¥È¤Îº®ºß
+
+You can mix and match bullet and number lists:
+
+<code>
+# Number one
+ * Bullet
+ * Bullet
+# Number two
+ * Bullet
+ * Bullet
+  * Sub-bullet
+   # Sub-sub-number
+   # Sub-sub-number
+# Number three
+ * Bullet
+ * Bullet
+</code>
+
+# Number one
+ * Bullet
+ * Bullet
+# Number two
+ * Bullet
+ * Bullet
+  * Sub-bullet
+   # Sub-sub-number
+   # Sub-sub-number
+# Number three
+ * Bullet
+ * Bullet
+
+
+
++++ ÄêµÁÊ¸
+
+You can create a definition (description) list with the following syntax:
+
+<code>
+: Item 1 : Something
+: Item 2 : Something else
+</code>
+
+: Item 1 : Something
+: Item 2 : Something else
+
+----
+
+++ °úÍÑÊ¸
+
+You can mark a blockquote by starting a line with one or more '>' \
+characters, followed by a space and the text to be quoted.
+
+<code>
+This is normal text here.
+
+> Indent me! The quick brown fox jumps over the lazy dog. \ 
+Now this the time for all good men to come to the aid of \ 
+their country. Notice how we can continue the block-quote \ 
+in the same "paragraph" by using a backslash at the end of \ 
+the line.
+>
+> Another block, leading to...
+>> Second level of indenting.  This second is indented even \ 
+more than the previous one.
+
+Back to normal text.
+</code>
+
+This is normal text here.
+
+> Indent me! The quick brown fox jumps over the lazy dog. \
+Now this the time for all good men to come to the aid of \
+their country. Notice how we can continue the block-quote \
+in the same "paragraph" by using a backslash at the end of \
+the line.
+>
+> Another block, leading to...
+>> Second level of indenting.  This second is indented even \
+more than the previous one.
+
+Back to normal text.
+
+
+----
+
+++ ¥ê¥ó¥¯¤È²èÁü
+
++++ Wiki ¥ê¥ó¥¯
+
+SmashWordsTogether to create a page link.
+
+You can force a WikiPage name '''not''' to be clickable by putting \
+an exclamation mark in front of it.
+
+<code>
+WikiPage !WikiPage
+</code>
+
+WikiPage !WikiPage
+
+You can create a "described" or "labeled" link to a wiki page by putting the page name in brackets, followed by some text.
+
+<code>
+[WikiPage Descriptive text for the link.]
+</code>
+
+[WikiPage Descriptive text for the link.]
+
+> **Note:** existing wiki pages must be in the [RuleWikilink wikilink] {{pages}} configuration,  and the [RuleWikilink wikilink] {{view_url}} configuration value must be set for the linking to work.
+
++++ Interwiki ¥ê¥ó¥¯
+
+Interwiki links are links to pages on other Wiki sites. \
+Type the {{``SiteName:PageName``}} like this:
+
+* MeatBall:RecentChanges
+* Advogato:proj/WikkiTikkiTavi
+* Wiki:WorseIsBetter
+
+> **Note:** the interwiki site must be in the [RuleInterwiki interwiki] {{sites}} configuration array.
+
++++ URL
+
+Create a remote link simply by typing its URL: http://ciaweb.net.
+
+If you like, enclose it in brackets to create a numbered reference \
+and avoid cluttering the page; {{``[http://ciaweb.net/free/]``}} becomes [http://ciaweb.net/free/].
+
+Or you can have a described-reference instead of a numbered reference:
+<code>
+[http://pear.php.net PEAR]
+</code>
+[http://pear.php.net PEAR]
+
++++ ²èÁü
+
+You can put a picture in a page by typing the URL to the picture \
+(it must end in gif, jpg, or png).
+<code>
+http://c2.com/sig/wiki.gif
+</code>
+
+http://c2.com/sig/wiki.gif
+
+You can use the described-reference URL markup to give the image an ALT tag:
+<code>
+[http://phpsavant.com/etc/fester.jpg Fester]
+</code>
+
+[http://phpsavant.com/etc/fester.jpg Fester]
+
+----
+
+++ ¥³¡¼¥É¥Ö¥í¥Ã¥¯
+
+Create code blocks by using {{<code>...</code>}} tags (each on its own line).
+
+<code>
+This is an example code block!
+</code>
+
+
+To create PHP blocks that get automatically colorized when you use PHP tags, simply surround the code with {{<code type="php">...</code>}} tags (the tags themselves should each be on their own lines, and no need for the {{<?php ... ?>}} tags).
+
+<code>
+ <code type="php">
+ // Set up the wiki options
+ $options = array();
+ $options['view_url'] = "index.php?page=";
+
+ // load the text for the requested page
+ $text = implode('', file($page . '.wiki.txt'));
+
+ // create a Wiki objext with the loaded options
+ $wiki = new Text_Wiki($options);
+
+ // transform the wiki text.
+ echo $wiki->transform($text);
+ </code>
+</code>
+
+<code type="php">
+// Set up the wiki options
+$options = array();
+$options['view_url'] = "index.php?page=";
+
+// load the text for the requested page
+$text = implode('', file($page . '.wiki.txt'));
+
+// create a Wiki objext with the loaded options
+$wiki = new Text_Wiki($options);
+
+// transform the wiki text.
+echo $wiki->transform($text);
+</code>
+
+----
+
+++ ¥Æ¡¼¥Ö¥ë
+
+You can create tables using pairs of vertical bars:
+
+<code>
+|| cell one || cell two ||
+|||| big ol' line ||
+|| cell four || cell five ||
+|| cell six || here's a very long cell ||
+</code>
+
+|| cell one || cell two ||
+|||| big ol' line ||
+|| cell four || cell five ||
+|| cell six || here's a very long cell ||
+
+<code>
+|| lines must start and end || with double vertical bars || nothing ||
+|| cells are separated by || double vertical bars || nothing ||
+|||| you can span multiple columns by || starting each cell ||
+|| with extra cell |||| separators ||
+|||||| but perhaps an example is the easiest way to see ||
+</code>
+
+|| lines must start and end || with double vertical bars || nothing ||
+|| cells are separated by || double vertical bars || nothing ||
+|||| you can span multiple columns by || starting each cell ||
+|| with extra cell |||| separators ||
+|||||| but perhaps an example is the easiest way to see ||
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/japanese/admin.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/japanese/admin.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/japanese/admin.php	(revision 405)
@@ -0,0 +1,95 @@
+<?php
+
+if( defined( 'FOR_XOOPS_LANG_CHECKER' ) || ! defined( 'TINYCONTENT_AM_LOADED' ) ) {
+
+define( 'TINYCONTENT_AM_LOADED' , 1 ) ;
+
+//Admin Page Titles
+define("_TC_ADMINTITLE","Tiny Content");
+
+// SPAW
+define('_TC_SPAWLANG','jp') ;
+
+//Table Titles
+define("_TC_ADDCONTENT","¿·µ¬¥³¥ó¥Æ¥ó¥Ä¤ÎÄÉ²Ã");
+define("_TC_EDITCONTENT","¥³¥ó¥Æ¥ó¥Ä¤ÎÊÔ½¸");
+define("_TC_ADDLINK","¥Ú¡¼¥¸¥é¥Ã¥×¤ÎÄÉ²Ã");
+define("_TC_EDITLINK","¥Ú¡¼¥¸¥é¥Ã¥×¤ÎÊÑ¹¹");
+define("_TC_ULFILE","¥Õ¥¡¥¤¥ë¤Î¥¢¥Ã¥×¥í¡¼¥É");
+define("_TC_SFILE","¥í¡¼¥«¥ë¥Õ¥¡¥¤¥ë¤ÎÁªÂò");
+define("_TC_DELFILE","¥Õ¥¡¥¤¥ë¤Îºï½ü");
+define("_TC_UPDATE_WRAP_CONTENTS","¥Ú¡¼¥¸¥é¥Ã¥×¸¡º÷¸ì¤Î¹¹¿·");
+
+//Table Data
+define("_TC_HOMEPAGE","HP");
+define("_TC_LINKNAME","¥¿¥¤¥È¥ë");
+define("_TC_STORYID","ID");
+define("_TC_VISIBLE","É½¼¨¤òµö²Ä¤¹¤ë");
+define("_TC_TH_VISIBLE","É½¼¨");
+define("_TC_ENABLECOM","¥³¥á¥ó¥È²ÄÇ½");
+define("_TC_TH_ENABLECOM","Com");
+define("_TC_HTML_HEADER","HTML¥Ø¥Ã¥À");
+define("_TC_CONTENT","¥³¥ó¥Æ¥ó¥Ä");
+define("_TC_YES","YES");
+define("_TC_NO","NO");
+define("_TC_URL","¥Õ¥¡¥¤¥ë¤ÎÁªÂò");
+define("_TC_UPLOAD","¥¢¥Ã¥×¥í¡¼¥É");
+define("_TC_DISABLEBREAKS","²þ¹Ô¤ò¡ãbr¡ä¤ËÊÑ´¹¤·¤Ê¤¤");
+define("_TC_SUBMENU","¥µ¥Ö¥á¥Ë¥å¡¼¤ËÉ½¼¨¤¹¤ë");
+define("_TC_TH_SUBMENU","Sub");
+define("_TC_DISP_YES","É½¼¨¤¹¤ë");
+define("_TC_DISP_NO","É½¼¨¤·¤Ê¤¤");
+
+define("_TC_CONTENT_TYPE","¥³¥ó¥Æ¥ó¥Ä¥¿¥¤¥×");
+define("_TC_TYPE_HTML","HTML¥³¥ó¥Æ¥ó¥Ä (bb codeÍ­¸ú)"); // nohtml=0
+define("_TC_TYPE_HTMLNOBB","HTML¥³¥ó¥Æ¥ó¥Ä (bb codeÌµ¸ú)"); // nohtml=2
+define("_TC_TYPE_TEXTWITHBB","¥Æ¥­¥¹¥È¥³¥ó¥Æ¥ó¥Ä (bb codeÍ­¸ú)"); // nohtml=1
+define("_TC_TYPE_TEXTNOBB","¥Æ¥­¥¹¥È¥³¥ó¥Æ¥ó¥Ä (bb codeÌµ¸ú)"); // nohtml=3
+define("_TC_TYPE_PHPHTML","PHP¥³¡¼¥É (bb codeÌµ¸ú)"); // nohtml=8
+define("_TC_TYPE_PHPWITHBB","PHP¥³¡¼¥É (bb codeÍ­¸ú)"); // nohtml=10
+define("_TC_TYPE_PEARWIKI","PEAR Wiki (bb codeÌµ¸ú)"); // nohtml=16
+define("_TC_TYPE_PEARWIKIWITHBB","PEAR Wiki (bb codeÍ­¸ú)"); // nohtml=18
+define("_TC_TYPE_PUKIWIKI","PukiWiki (bb codeÌµ¸ú)"); // nohtml=32
+define("_TC_TYPE_PUKIWIKIWITHBB","PukiWiki (bb codeÍ­¸ú)"); // nohtml=34 ¡Ä¡Ä¤Ê¡Á¤ó¤Æ¡¢ÆÈÎ©¤·¤¿PukiWiki¥ì¥ó¥À¡¼¤¬¤¢¤Ã¤¿¤éÎÉ¤¤¤Ê¤¢¡£
+
+define("_TC_CHECKED_ITEMS_ARE","±¦Ã¼¤¬¥Á¥§¥Ã¥¯¤µ¤ì¤¿µ­»ö¤ò:");
+define("_TC_BUTTON_MOVETO","°ÜÆ°");
+
+define("_TC_LASTMODIFIED","ºÇ½ª¹¹¿·Æü»þ");
+define("_TC_DONTUPDATELASTMODIFIED","¼«Æ°¹¹¿·¤·¤Ê¤¤");
+define("_TC_CREATED","ºîÀ®Æü»þ");
+define("_TC_SAVEAS","ÊÌ¥ì¥³¡¼¥É¤È¤·¤ÆÊÝÂ¸");
+
+define("_TC_LINKID","É½¼¨½ç");
+define("_TC_CONTENTTYPE","Type");
+define("_TC_ACTION","¥¢¥¯¥·¥ç¥ó");
+define("_TC_EDIT","ÊÔ½¸");
+define("_TC_DELETE","ºï½ü");
+define("_TC_ELINK","ÊÑ¹¹");
+define("_TC_DELLINK","ÀÚÃÇ");
+
+define("_TC_WRAPROOT","¥Ú¡¼¥¸¥é¥Ã¥×¤Î´ðÅÀ");
+define("_TC_FMT_WRAPROOTTC","TinyD¥â¥¸¥å¡¼¥ë¥Ç¥£¥ì¥¯¥È¥ê<br /> (%s) <br />");
+define("_TC_FMT_WRAPROOTPAGE","¥é¥Ã¥×¤·¤¿¥Ú¡¼¥¸¤ÈÆ±¤¸¥Ç¥£¥ì¥¯¥È¥ê<br /> (%s) <br />mod_rewrite¤¬»È¤¨¤Ê¤¤»þ¤Ï¤³¤Á¤é¤ò¤ª»È¤¤²¼¤µ¤¤<br />¥Ö¥í¥Ã¥¯¤Ë¤Ï¸þ¤¤¤Æ¤¤¤Þ¤»¤ó<br />");
+define("_TC_FMT_WRAPBYREWRITE","mod_rewrite¤Ë¤è¤ë½ñ¤­´¹¤¨¡Ê¼Â¸³Ãæ¡Ë<br /> %s ¤Ë¥¢¥Ã¥×¤·¤Æ²¼¤µ¤¤<br />¤¿¤À¤·¡¢mod_rewrite¤òÍ­¸ú¤Ë¤¹¤ëÉ¬Í×¤¬¤¢¤ê¤Þ¤¹<br />¥Ö¥í¥Ã¥¯¤Ë¤ÏÂÐ±þ¤·¤Æ¤¤¤Þ¤»¤ó<br />");
+define("_TC_FMT_WRAPCHANGESRCHREF","HTML¥¿¥°½ñ¤­´¹¤¨¡Ê¥Ñ¥¿¡¼¥óÎý¹þÃæ¡Ë<br /> ¥é¥Ã¥×¤µ¤ì¤¿HTML¥Õ¥¡¥¤¥ë¤ÎÁêÂÐ¥ê¥ó¥¯¤òÀäÂÐ¥ê¥ó¥¯¤Ë½ñ¤­´¹¤¨¤Þ¤¹<br />HTML¥½¡¼¥¹¥³¡¼¥É¤Ë»÷¤¿Ê¸¾Ï¤Ï¸íÇ§¼±¤·¤Æ¤·¤Þ¤¦¶²¤ì¤¬¤¢¤ê¤Þ¤¹<br />");
+
+define("_TC_DISABLECOM","¥³¥á¥ó¥ÈÉÔ²Ä");
+define("_TC_DBUPDATED","¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò¹¹¿·¤·¤Þ¤·¤¿");
+define("_TC_ERRORINSERT","¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¹¹¿·¤Ë¼ºÇÔ¤·¤Þ¤·¤¿");
+define("_TC_RUSUREDEL","ËÜÅö¤Ë¥³¥ó¥Æ¥ó¥Ä¤òºï½ü¤·¤Æ¤è¤í¤·¤¤¤Ç¤¹¤«¡©<br />¤³¤Î¥³¥ó¥Æ¥ó¥Ä¤Ë¤Ä¤±¤é¤ì¤¿¥³¥á¥ó¥È¤â¤¹¤Ù¤Æ¾Ã¤¨¤Þ¤¹¡£");
+define("_TC_RUSUREDELF","ËÜÅö¤Ë¥Õ¥¡¥¤¥ë¤òºï½ü¤·¤Æ¤è¤í¤·¤¤¤Ç¤¹¤«¡©");
+define("_TC_UPLOADED","¥Õ¥¡¥¤¥ë¤Î¥¢¥Ã¥×¥í¡¼¥É¤¬´°Î»¤·¤Þ¤·¤¿");
+define("_TC_FDELETED","¥Õ¥£¥ë¤Îºï½ü¤¬½ª¤ï¤ê¤Þ¤·¤¿");
+define("_TC_ERROREXIST","Æ±Ì¾¤Î¥Õ¥¡¥¤¥ë¤¬¤¢¤ë¤¿¤á¥¢¥Ã¥×¥í¡¼¥É½ÐÍè¤Þ¤»¤ó");
+define("_TC_ERRORUPL","¥Õ¥¡¥¤¥ë¤Î¥³¥Ô¡¼¤Ë¼ºÇÔ¤·¤Þ¤·¤¿");
+define("_TC_FMT_WRAPPATHPERMOFF","<span style='font-size:xx-small;'>¥Ú¡¼¥¸¥é¥Ã¥×ÍÑ¥Ç¥£¥ì¥¯¥È¥ê(%s)¤Ï½ñ¹þ¶Ø»ß¤È¤Ê¤Ã¤Æ¤Þ¤¹¡£<br />¥Õ¥¡¥¤¥ë¤Î¥¢¥Ã¥×¥í¡¼¥É¤äºï½ü¤ò¤³¤³¤«¤é¹Ô¤¤¤¿¤¤¾ì¹ç¤Ï¡¢½ñ¹þ¤òµö²Ä¤·¤Æ²¼¤µ¤¤¡£<br />¡ÊUnix¤Î¾ì¹ç¤Ï¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤ò777¤«707¤Ë¤·¤Þ¤¹¡Ë<br />¤ª¤¹¤¹¤á¤Ï¡¢½ñ¹þ¶Ø»ß¤Î¤Þ¤Þ¤Ç¡¢¥Ú¡¼¥¸¥é¥Ã¥×ÍÑ¥Ç¥£¥ì¥¯¥È¥ê¤ËFTP¤Ç¥Õ¥¡¥¤¥ë¤ò¥¢¥Ã¥×¥í¡¼¥É¤¹¤ëÊýË¡¤Ç¤¹¡£</span>");
+define("_TC_FMT_WRAPPATHPERMON","<span style='font-size:xx-small;'>¤³¤Î²èÌÌ¤«¤é¥Õ¥¡¥¤¥ë¤Î¥¢¥Ã¥×¥í¡¼¥É¤ò¹Ô¤¦ÊýË¡¤Ï¤¢¤Þ¤ê¿ä¾©¤Ç¤­¤Þ¤»¤ó¡£²ÄÇ½¤Ê¤é¡¢¥Ú¡¼¥¸¥é¥Ã¥×ÍÑ¥Ç¥£¥ì¥¯¥È¥ê(%s)¤ò½ñ¹þ¶Ø»ß(755)¤È¤·¤Æ¡¢FTP¤Ç¥Õ¥¡¥¤¥ë¤ò¥¢¥Ã¥×¥í¡¼¥É¤·¤Æ²¼¤µ¤¤¡£</span>" ) ;
+
+define("_TC_ALTER_TABLE","¥Æ¡¼¥Ö¥ë¹½Â¤¹¹¿·");
+
+define("_TC_JS_CONFIRMDISCARD","ÊÔ½¸ÆâÍÆ¤¬ÇË´þ¤µ¤ì¤Þ¤¹¤¬¤è¤í¤·¤¤¤Ç¤¹¤«¡©");
+
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/japanese/modinfo.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/japanese/modinfo.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/japanese/modinfo.php	(revision 405)
@@ -0,0 +1,66 @@
+<?php
+// Module Info Tiny_Event
+
+if( defined( 'FOR_XOOPS_LANG_CHECKER' ) || ! defined( 'TINYCONTENT_MI_LOADED' ) ) {
+
+define( 'TINYCONTENT_MI_LOADED' , 1 ) ;
+
+// The name of this module
+define("_MI_TINYCONTENT_NAME","TinyD");
+
+// A brief description of this module
+define("_MI_TINYCONTENT_DESC","¼ê·Ú¤Ë¥³¥ó¥Æ¥ó¥Ä¤Îºî¤ì¤ë¥â¥¸¥å¡¼¥ë");
+
+// Name for Menu Block
+define("_MI_TC_BNAME1","TinyD%s ¥á¥Ë¥å¡¼");
+define("_MI_TC_BNAME2","TinyD%s ÆâÍÆÉ½¼¨");
+define("_MI_TC_BDESC1","¥Ê¥Ó¥²¡¼¥·¥ç¥ó¥á¥Ë¥å¡¼");
+define("_MI_TC_BDESC2","³Æ¼ï¥³¥ó¥Æ¥ó¥Ä¤ò¥Ö¥í¥Ã¥¯¤È¤·¤ÆÉ½¼¨¤¹¤ë [summary]¥¿¥°ÍøÍÑ²ÄÇ½");
+
+// Admin Menu
+define("_TC_MD_ADMENU1","¥³¥ó¥Æ¥ó¥Ä¤ÎÄÉ²Ã");
+define("_TC_MD_ADMENU2","¥Ú¡¼¥¸¥é¥Ã¥×¤ÎÄÉ²Ã");
+define("_TC_MD_ADMENU3","¥³¥ó¥Æ¥ó¥Ä´ÉÍý");
+define("_TC_MD_ADMENU_MYBLOCKSADMIN","¥Ö¥í¥Ã¥¯¡¦¥¢¥¯¥»¥¹¸¢¸Â");
+define("_TC_MD_ADMENU_MYTPLSADMIN","¥Æ¥ó¥×¥ì¡¼¥È´ÉÍý");
+
+// WYSIWYG Defines for v1.4
+//define('_MI_WYSIWYG','WYSIWYG¥¨¥Ç¥£¥¿(SPAW)¤ò»ÈÍÑ¤¹¤ë');
+//define('_MI_WYSIWYG_DESC','¤³¤³¤¬Í­¸ú¤Ç¤â¡¢IE5.5°Ê¾å¤Ç¤Ê¤¤¤Èµ¡Ç½¤·¤Þ¤»¤ó');
+define('_MI_COMMON_HTMLHEADER','Á´¥³¥ó¥Æ¥ó¥Ä¶¦ÄÌHTML¥Ø¥Ã¥À');
+define('_MI_COMMON_HTMLHEADER_DESC','¥³¥ó¥Æ¥ó¥Ä¡¦¥Ú¡¼¥¸¥é¥Ã¥×¤ÎÎ¾Êý¤Ë¤Ä¤¤¤Æ¡¢¤³¤³¤Ç»ØÄê¤µ¤ì¤¿HTML¥Ø¥Ã¥À¤¬ÄÉ²Ã¤µ¤ì¤Þ¤¹¡£¤´ÍøÍÑ¤Î¥Æ¡¼¥ÞÆâ¤Ëxoops_module_header¤Îµ­½Ò¤¬¤¢¤ë¤³¤È¤ò³ÎÇ§¤·¤Æ¤¯¤À¤µ¤¤');
+define('_MI_TAREA_WIDTH','³Æ¼ïÊÔ½¸¥¨¥ê¥¢¤Î²£Éý');
+define('_MI_TAREA_WIDTH_DESC','');
+define('_MI_HEADER_TAREA_HEIGHT','¥Ø¥Ã¥ÀÊÔ½¸¥¨¥ê¥¢¤Î¹â¤µ');
+define('_MI_HEADER_TAREA_HEIGHT_DESC','');
+define('_MI_TAREA_HEIGHT','¥³¥ó¥Æ¥ó¥ÄÊÔ½¸¥¨¥ê¥¢¤Î¹â¤µ');
+define('_MI_TAREA_HEIGHT_DESC','');
+define('_MI_FORCE_MOD_REWRITE','¤¹¤Ù¤Æ¤Î¥³¥ó¥Æ¥ó¥Ä¤Çmod_rewrite¤ò»È¤¦');
+define('_MI_FORCE_MOD_REWRITE_DESC','.htaccess Åù¤Çmod_rewrite¤¬on¤Ë¤Ê¤Ã¤Æ¤¤¤ëÉ¬Í×¤¬¤¢¤ê¤Þ¤¹');
+define('_MI_MODULESLESS_DIR','modules/¤Î¤Ê¤¤rewrite¥â¡¼¥É¤Ç¤Î¥Ç¥£¥ì¥¯¥È¥êÌ¾');
+define('_MI_MODULESLESS_DIR_DESC','¡Ö¤¹¤Ù¤Æ¤Î¥³¥ó¥Æ¥ó¥Ä¤Çmod_rewrite¤ò»È¤¦¡×¤È¤·¤¿¾å¤Ç¡¢XOOPS_ROOT_PATH/.htaccess¤ËÆÃÄê¤Îµ­½Ò¤¬É¬Í×¤Ç¤¹<br />»È¤ï¤Ê¤¤¾ì¹ç¤Ï¶õÍó¤Ë¤·¤Æ²¼¤µ¤¤¡£');
+define('_MI_SPACE2NBSP','Ï¢Â³¤·¤¿¥¹¥Ú¡¼¥¹¤ò&amp;nbsp;¤ËÊÑ´¹¤¹¤ë¡Ê²þ¹ÔÊÑ´¹»þ¡Ë');
+define('_MI_DISPLAY_PRINT_ICON','¡Ö°õºþÍÑ²èÌÌ¡×¥¢¥¤¥³¥ó¤òÉ½¼¨¤¹¤ë');
+define('_MI_DISPLAY_FRIEND_ICON','¡ÖÍ§Ã£¤Ø¾Ò²ð¤¹¤ë¡×¥¢¥¤¥³¥ó¤òÉ½¼¨¤¹¤ë');
+define('_MI_USE_TAF_MODULE','Tell a Friend¥â¥¸¥å¡¼¥ë¤òÍøÍÑ¤¹¤ë');
+define('_MI_DISPLAY_PAGENAV','¥Ú¡¼¥¸¥Ê¥Ó¥²¡¼¥·¥ç¥ó');
+define('_MI_DISPLAY_PAGENAV_NONE','É½¼¨¤·¤Ê¤¤');
+define('_MI_DISPLAY_PAGENAV_DISP','É½¼¨¥³¥ó¥Æ¥ó¥ÄÁ´¤Æ¤òÂÐ¾Ý¤È¤¹¤ë');
+define('_MI_DISPLAY_PAGENAV_SUB','¥µ¥Ö¥á¥Ë¥å¡¼»ØÄê¤µ¤ì¤¿¥³¥ó¥Æ¥ó¥Ä¤òÂÐ¾Ý¤È¤¹¤ë');
+define('_MI_DISPLAY_PAGENAV_PERSUB','¥µ¥Ö¥á¥Ë¥å¡¼»ØÄê¤µ¤ì¤¿¥³¥ó¥Æ¥ó¥Ä¤Ç¶èÀÚ¤ë');
+define('_MI_NAVBLOCK_TARGET','TinyD¥á¥Ë¥å¡¼¥Ö¥í¥Ã¥¯¤Ç¤ÎÉ½¼¨ÂÐ¾Ý');
+define('_MI_NAVBLOCK_TARGET_DISP','É½¼¨¥³¥ó¥Æ¥ó¥ÄÁ´¤Æ¤Î¥¿¥¤¥È¥ë');
+define('_MI_NAVBLOCK_TARGET_SUB','¥µ¥Ö¥á¥Ë¥å¡¼»ØÄê¤µ¤ì¤¿¥³¥ó¥Æ¥ó¥Ä¤Î¥¿¥¤¥È¥ë');
+
+
+//***********************************************************************//
+// No language config below!!! Do not change this!!!                     //
+//  (TinyD¤Ç¤Ï¤³¤ÎÄê¿ô¤Ï»ÈÍÑ¤·¤Æ¤¤¤Þ¤»¤ó)                                //
+//***********************************************************************//
+
+define("_MI_TINYCONTENT_PREFIX", "tinycontent");
+define("_MI_DIR_NAME", "tinycontent");
+
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/portuguesebr/main.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/portuguesebr/main.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/portuguesebr/main.php	(revision 405)
@@ -0,0 +1,40 @@
+<?php
+
+if( defined( 'FOR_XOOPS_LANG_CHECKER' ) || ! defined( 'tc_convert_wrap_to_ie' ) ) {
+
+define( 'TINYCONTENT_MB_LOADED' , 1 ) ;
+
+define( "_TC_FMT_DEFAULT_COMMENT_TITLE" , "Re: %s" ) ;
+
+define('_TC_FILENOTFOUND','Arquivo não achado! Por favor confira a URL!');
+define("_TC_PRINTERFRIENDLY","Imprimir");
+define("_TC_SENDSTORY","Enviar para um Amigo");
+
+define("_TC_NEXTPAGE","Próximo");
+define("_TC_PREVPAGE","Anterior");
+define("_TC_TOPOFCONTENTS","Mais visualizados");
+
+// whether parameter for "mailto:" is already rawurlencoded
+define("_TC_DONE_MAILTOENCODE" , false ) ;
+
+// %s is your site name. for single byte languages (ignored when _TC_DONE_MAILTOENCODE is true)
+define("_TC_INTARTICLE","Mais interessados  %s");
+define("_TC_INTARTFOUND","Isto é muito interessante achei %s");
+
+// for multibyte languages (ignored when _TC_DONE_MAILTOENCODE is false)
+define("_TC_MB_INTARTICLE","" ) ;
+define("_TC_MB_INTARTFOUND","" ) ;
+
+// %s represents your site name
+define("_TC_THISCOMESFROM","Este artigo vem de %s");
+define("_TC_URLFORSTORY","A URL para este artigo é:");
+}
+
+if( ! defined( 'FOR_XOOPS_LANG_CHECKER' ) && ! function_exists( 'tc_convert_wrap_to_ie' ) ) {
+	function tc_convert_wrap_to_ie( $str ) {
+		return $str ;
+	}
+}
+
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/portuguesebr/text_wiki_sample.wiki
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/portuguesebr/text_wiki_sample.wiki	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/portuguesebr/text_wiki_sample.wiki	(revision 405)
@@ -0,0 +1,353 @@
+[[toc]]
+
+----
+
+++ General Notes
+
+The markup described on this page is for the default {{Text_Wiki}} rules; \
+it is a combination of the [http://tavi.sourceforge.net WikkTikkiTavi] \
+and [http://develnet.org/ coWiki] markup styles.
+
+All text is entered as plain text, and will be converted to HTML entities as \
+necessary.  This means that {{<}}, {{>}}, {{&}}, and so on are converted for \
+you (except in special situations where the characters are Wiki markup; \
+Text_Wiki is generally smart enough to know when to convert and when not to).
+
+Just hit "return" twice to make a paragraph break.  If you want \
+to keep the same logical line but have to split it across \
+two physical lines (such as when your editor only shows a certain number \
+of characters per line), end the line with a backslash {{\}} and hit \
+return once.  This will cause the two lines to be joined on display, and the \
+backslash will not show.  (If you end a line with a backslash and a tab \
+or space, it will ''not'' be joined with the next line, and the backslash \
+will be printed.)
+
+
+----
+
+++ Inline Formatting
+
+|| {{``//emphasis text//``}}                 || //emphasis text// ||
+|| {{``**strong text**``}}                   || **strong text** ||
+|| {{``//**emphasis and strong**//``}}       || //**emphasis and strong**// ||
+|| {{``{{teletype text}}``}}                    || {{teletype text}} ||
+|| {{``@@--- delete text +++ insert text @@``}} || @@--- delete text +++ insert text @@ ||
+|| {{``@@--- delete only @@``}}                 || @@--- delete only @@ ||
+|| {{``@@+++ insert only @@``}}                 || @@+++ insert only @@ ||
+
+
+----
+
+++ Literal Text
+
+If you don't want Text_Wiki to parse some text, enclose it in two backticks (not single-quotes).
+
+<code>
+
+This //text// gets **parsed**.
+
+``This //text// does not get **parsed**.``
+
+</code>
+
+This //text// gets **parsed**.
+
+``This //text// does not get **parsed**.``
+
+----
+
+++ Headings
+
+You can make various levels of heading by putting \
+equals-signs before and after the text (all on its \
+own line):
+
+<code>
++++ Level 3 Heading
+++++ Level 4 Heading
++++++ Level 5 Heading
+++++++ Level 6 Heading
+</code>
+
++++ Level 3 Heading
+++++ Level 4 Heading
++++++ Level 5 Heading
+++++++ Level 6 Heading
+
+----
+
+++ Table of Contents
+
+To create a list of every heading, with a link to that heading, put a table of contents tag on its own line.
+
+<code>
+[[toc]]
+</code>
+
+----
+
+++ Horizontal Rules
+
+Use four dashes ({{``----``}}) to create a horizontal rule.
+
+----
+
+++ Lists
+
++++ Bullet Lists
+
+You can create bullet lists by starting a paragraph with one or \
+more asterisks.
+
+<code>
+* Bullet one
+ * Sub-bullet
+</code>
+
+* Bullet one
+ * Sub-bullet
+
++++ Numbered Lists
+
+Similarly, you can create numbered lists by starting a paragraph \
+with one or more hashes.
+
+<code>
+# Numero uno
+# Number two
+ # Sub-item
+</code>
+
+# Numero uno
+# Number two
+ # Sub-item
+
+
++++ Mixing Bullet and Number List Items
+
+You can mix and match bullet and number lists:
+
+<code>
+# Number one
+ * Bullet
+ * Bullet
+# Number two
+ * Bullet
+ * Bullet
+  * Sub-bullet
+   # Sub-sub-number
+   # Sub-sub-number
+# Number three
+ * Bullet
+ * Bullet
+</code>
+
+# Number one
+ * Bullet
+ * Bullet
+# Number two
+ * Bullet
+ * Bullet
+  * Sub-bullet
+   # Sub-sub-number
+   # Sub-sub-number
+# Number three
+ * Bullet
+ * Bullet
+
+
+
++++ Definition Lists
+
+You can create a definition (description) list with the following syntax:
+
+<code>
+: Item 1 : Something
+: Item 2 : Something else
+</code>
+
+: Item 1 : Something
+: Item 2 : Something else
+
+----
+
+++ Block Quotes
+
+You can mark a blockquote by starting a line with one or more '>' \
+characters, followed by a space and the text to be quoted.
+
+<code>
+This is normal text here.
+
+> Indent me! The quick brown fox jumps over the lazy dog. \ 
+Now this the time for all good men to come to the aid of \ 
+their country. Notice how we can continue the block-quote \ 
+in the same "paragraph" by using a backslash at the end of \ 
+the line.
+>
+> Another block, leading to...
+>> Second level of indenting.  This second is indented even \ 
+more than the previous one.
+
+Back to normal text.
+</code>
+
+This is normal text here.
+
+> Indent me! The quick brown fox jumps over the lazy dog. \
+Now this the time for all good men to come to the aid of \
+their country. Notice how we can continue the block-quote \
+in the same "paragraph" by using a backslash at the end of \
+the line.
+>
+> Another block, leading to...
+>> Second level of indenting.  This second is indented even \
+more than the previous one.
+
+Back to normal text.
+
+
+----
+
+++ Links and Images
+
++++ Wiki Links
+
+SmashWordsTogether to create a page link.
+
+You can force a WikiPage name '''not''' to be clickable by putting \
+an exclamation mark in front of it.
+
+<code>
+WikiPage !WikiPage
+</code>
+
+WikiPage !WikiPage
+
+You can create a "described" or "labeled" link to a wiki page by putting the page name in brackets, followed by some text.
+
+<code>
+[WikiPage Descriptive text for the link.]
+</code>
+
+[WikiPage Descriptive text for the link.]
+
+> **Note:** existing wiki pages must be in the [RuleWikilink wikilink] {{pages}} configuration,  and the [RuleWikilink wikilink] {{view_url}} configuration value must be set for the linking to work.
+
++++ Interwiki Links
+
+Interwiki links are links to pages on other Wiki sites. \
+Type the {{``SiteName:PageName``}} like this:
+
+* MeatBall:RecentChanges
+* Advogato:proj/WikkiTikkiTavi
+* Wiki:WorseIsBetter
+
+> **Note:** the interwiki site must be in the [RuleInterwiki interwiki] {{sites}} configuration array.
+
++++ URLs
+
+Create a remote link simply by typing its URL: http://ciaweb.net.
+
+If you like, enclose it in brackets to create a numbered reference \
+and avoid cluttering the page; {{``[http://ciaweb.net/free/]``}} becomes [http://ciaweb.net/free/].
+
+Or you can have a described-reference instead of a numbered reference:
+<code>
+[http://pear.php.net PEAR]
+</code>
+[http://pear.php.net PEAR]
+
++++ Images
+
+You can put a picture in a page by typing the URL to the picture \
+(it must end in gif, jpg, or png).
+<code>
+http://c2.com/sig/wiki.gif
+</code>
+
+http://c2.com/sig/wiki.gif
+
+You can use the described-reference URL markup to give the image an ALT tag:
+<code>
+[http://phpsavant.com/etc/fester.jpg Fester]
+</code>
+
+[http://phpsavant.com/etc/fester.jpg Fester]
+
+----
+
+++ Code Blocks
+
+Create code blocks by using {{<code>...</code>}} tags (each on its own line).
+
+<code>
+This is an example code block!
+</code>
+
+
+To create PHP blocks that get automatically colorized when you use PHP tags, simply surround the code with {{<code type="php">...</code>}} tags (the tags themselves should each be on their own lines, and no need for the {{<?php ... ?>}} tags).
+
+<code>
+ <code type="php">
+ // Set up the wiki options
+ $options = array();
+ $options['view_url'] = "index.php?page=";
+
+ // load the text for the requested page
+ $text = implode('', file($page . '.wiki.txt'));
+
+ // create a Wiki objext with the loaded options
+ $wiki = new Text_Wiki($options);
+
+ // transform the wiki text.
+ echo $wiki->transform($text);
+ </code>
+</code>
+
+<code type="php">
+// Set up the wiki options
+$options = array();
+$options['view_url'] = "index.php?page=";
+
+// load the text for the requested page
+$text = implode('', file($page . '.wiki.txt'));
+
+// create a Wiki objext with the loaded options
+$wiki = new Text_Wiki($options);
+
+// transform the wiki text.
+echo $wiki->transform($text);
+</code>
+
+----
+
+++ Tables
+
+You can create tables using pairs of vertical bars:
+
+<code>
+|| cell one || cell two ||
+|||| big ol' line ||
+|| cell four || cell five ||
+|| cell six || here's a very long cell ||
+</code>
+
+|| cell one || cell two ||
+|||| big ol' line ||
+|| cell four || cell five ||
+|| cell six || here's a very long cell ||
+
+<code>
+|| lines must start and end || with double vertical bars || nothing ||
+|| cells are separated by || double vertical bars || nothing ||
+|||| you can span multiple columns by || starting each cell ||
+|| with extra cell |||| separators ||
+|||||| but perhaps an example is the easiest way to see ||
+</code>
+
+|| lines must start and end || with double vertical bars || nothing ||
+|| cells are separated by || double vertical bars || nothing ||
+|||| you can span multiple columns by || starting each cell ||
+|| with extra cell |||| separators ||
+|||||| but perhaps an example is the easiest way to see ||
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/portuguesebr/admin.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/portuguesebr/admin.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/portuguesebr/admin.php	(revision 405)
@@ -0,0 +1,98 @@
+<?php
+
+if( defined( 'FOR_XOOPS_LANG_CHECKER' ) || ! defined( 'TINYCONTENT_AM_LOADED' ) ) {
+
+
+// Appended by Xoops Language Checker -GIJOE- in 2006-04-11 11:14:42
+define('_TC_UPDATE_WRAP_CONTENTS','Update wrapped contents for searching');
+
+define( 'TINYCONTENT_AM_LOADED' , 1 ) ;
+
+//Admin Page Titles
+define("_TC_ADMINTITLE","Tiny Content");
+
+// SPAW
+define('_TC_SPAWLANG','en') ;
+
+//Table Titles
+define("_TC_ADDCONTENT","Inserir novo Conteúdo");
+define("_TC_EDITCONTENT","Editar Conteúdo");
+define("_TC_ADDLINK","Adicionar Página Pronta (formato HTML por ex.)");
+define("_TC_EDITLINK","Modificar Página Pronta");
+define("_TC_ULFILE","Enviar Arquivo");
+define("_TC_SFILE","Procurar");
+define("_TC_DELFILE","Excluir Arquivo");
+
+//Table Data
+define("_TC_HOMEPAGE","Início");
+define("_TC_LINKNAME","Link do Título");
+define("_TC_STORYID","ID");
+define("_TC_VISIBLE","Vísivel");
+define("_TC_TH_VISIBLE","Vis");
+define("_TC_ENABLECOM","Habilitar Comentários");
+define("_TC_TH_ENABLECOM","Com");
+define("_TC_HTML_HEADER","HTML header");
+define("_TC_CONTENT","Conteúdo");
+define("_TC_YES","Sim");
+define("_TC_NO","Não");
+define("_TC_URL","Selecionar arquivo");
+define("_TC_UPLOAD","Enviar");
+define("_TC_DISABLEBREAKS","Desabilitar conversão LineBreak (Ativar somente se usar HTML)");
+define("_TC_SUBMENU","Exibir em Submenu");
+define("_TC_TH_SUBMENU","Sub");
+define("_TC_DISP_YES","Exibir");
+define("_TC_DISP_NO","Do Not Display");
+
+define("_TC_CONTENT_TYPE","Tipo de Página");
+define("_TC_TYPE_HTML","Conteúdo HTML (bb code habilitar)"); // nohtml=0
+define("_TC_TYPE_HTMLNOBB","Conteúdo HTML (bb code desabilitar)"); // nohtml=2
+define("_TC_TYPE_TEXTWITHBB","Conteúdo do Texto (bb code habilitar)"); // nohtml=1
+define("_TC_TYPE_TEXTNOBB","Conteúdo do Texto (bb code desabilitar)"); // nohtml=3
+define("_TC_TYPE_PHPHTML","Códigos PHP (bb code desabilitar)"); // nohtml=8
+define("_TC_TYPE_PHPWITHBB","Códigos PHP (bb code habilitar)"); // nohtml=10
+define("_TC_TYPE_PEARWIKI","PEAR Wiki (bb code desabilitar)"); // nohtml=16
+define("_TC_TYPE_PEARWIKIWITHBB","PEAR Wiki (bb code habilitar)"); // nohtml=18
+define("_TC_TYPE_PUKIWIKI","PukiWiki (bb code desabilitar)"); // nohtml=32 (resv)
+define("_TC_TYPE_PUKIWIKIWITHBB","PukiWiki (bb code habilitar)"); // nohtml=34 (resv)
+
+define("_TC_CHECKED_ITEMS_ARE","Registros conferidos:");
+define("_TC_BUTTON_MOVETO","Exportar (Mover)");
+
+define("_TC_LASTMODIFIED","Última Modificação");
+define("_TC_DONTUPDATELASTMODIFIED","Não realizar atualização automática");
+define("_TC_CREATED","Feito por");
+define("_TC_SAVEAS","Salvar como");
+
+define("_TC_LINKID","Prioridade");
+define("_TC_CONTENTTYPE","Tipo");
+define("_TC_ACTION","Ação");
+define("_TC_EDIT","Editar");
+define("_TC_DELETE","Excluir");
+define("_TC_ELINK","Modificar");
+define("_TC_DELLINK","Cortar");
+
+define("_TC_WRAPROOT","Base do arquivo pronto");
+define("_TC_FMT_WRAPROOTTC","Mesmo como módulo de TinyContent<br /> (%s) <br />");
+define("_TC_FMT_WRAPROOTPAGE","Mesmo como página pronta.<br /> (%s) <br /> usa mod_rewrite se puder.<br />");
+define("_TC_FMT_WRAPBYREWRITE","use mod_rewrite (experimental)<br / > transfira o HTML e outros em %s <br /> não esqueça de mod_rewrite em <br />");
+define("_TC_FMT_WRAPCHANGESRCHREF","reescreva atributos de html (experimental)<br /> esta opção reescreve ligações relativas a ligações absolutas.<br /> Isto reconhece qualquer tipo de comando provavelmente como fonte de HTML <br />");
+
+define("_TC_DISABLECOM","Desabilitar comentários");
+define("_TC_DBUPDATED","Banco de dados atualizado com sucesso!");
+define("_TC_ERRORINSERT","Erro na atualização do Banco de Dados!");
+define("_TC_RUSUREDEL","Você tem certeza que quer excluit este conteúdo? <br /> serão removidos todos os comentários junto com o conteúdo");
+define("_TC_RUSUREDELF","Você tem certeza que deseja excluir este arquivo?");
+define("_TC_UPLOADED","Arquivo atualizado com Sucesso!");
+define("_TC_FDELETED","Arquivo Excluído com Sucesso!");
+define("_TC_ERROREXIST","Erro. O mesmo arquivo já existe");
+define("_TC_ERRORUPL","Erro no envio do arquivo! (tente outra vez!)");
+define("_TC_FMT_WRAPPATHPERMOFF","<span style='font-size:xx-small;'>O diretório por conteúdo (%s) não é permitido ser escrito para através de httpd. <br />Se você gostaria de transferir ou apagar arquivos por HTTP, mude a permissão de escritura em<br /> recomenda-se transferir ou só apagar arquivos por ftp para segurança</span>");
+define("_TC_FMT_WRAPPATHPERMON","<span style='font-size:xx-small;'>Recomenda-se que não transfira por HTTP. Tente transferir os arquivos por FTP.</span>" ) ;
+
+define("_TC_ALTER_TABLE","Alterar Tabela");
+
+define("_TC_JS_CONFIRMDISCARD","Descartar Mudanças. OK?");
+
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/portuguesebr/modinfo.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/portuguesebr/modinfo.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/portuguesebr/modinfo.php	(revision 405)
@@ -0,0 +1,69 @@
+<?php
+// Module Info Tiny Content
+
+if( defined( 'FOR_XOOPS_LANG_CHECKER' ) || ! defined( 'TINYCONTENT_MI_LOADED' ) ) {
+
+
+// Appended by Xoops Language Checker -GIJOE- in 2006-04-11 11:14:42
+define('_TC_MD_ADMENU_MYTPLSADMIN','Templates');
+
+define( 'TINYCONTENT_MI_LOADED' , 1 ) ;
+
+// The name of this module
+define("_MI_TINYCONTENT_NAME","TinyD");
+
+// A brief description of this module
+define("_MI_TINYCONTENT_DESC","Criando conteúdo feito tão fácil quanto pode ser.");
+
+// Name for Menu Block
+define("_MI_TC_BNAME1","TinyD %s Menu");
+define("_MI_TC_BNAME2","TinyD %s Conteúdo");
+define("_MI_TC_BDESC1","Construindo a navegação");
+define("_MI_TC_BDESC2","Mostre um conteúdo como um bloco. [resumo] tag válida");
+
+// Admin Menu
+define("_TC_MD_ADMENU1","Inserir Conteúdo");
+define("_TC_MD_ADMENU2","Adicionar conteúdo pronto");
+define("_TC_MD_ADMENU3","Editar/Excluir Conteúdo");
+define("_TC_MD_ADMENU_MYBLOCKSADMIN","Blocos/Grupos");
+
+// WYSIWYG Defines for v1.4
+//define('_MI_WYSIWYG','Use Wysiwyg Editor?');
+//define('_MI_WYSIWYG_DESC','');
+define('_MI_COMMON_HTMLHEADER','Cabeçalhos HTML header');
+define('_MI_COMMON_HTMLHEADER_DESC','Cheque a tag xoops_module_header existe em seu tema');
+define('_MI_TAREA_WIDTH','Largura do TextAreas');
+define('_MI_TAREA_WIDTH_DESC','');
+define('_MI_HEADER_TAREA_HEIGHT','Altura do TextArea para cabeçalho HTML');
+define('_MI_HEADER_TAREA_HEIGHT_DESC','');
+define('_MI_TAREA_HEIGHT','Altura de TextArea para body');
+define('_MI_TAREA_HEIGHT_DESC','');
+define('_MI_FORCE_MOD_REWRITE','usar mod_rewrite par este módulo');
+define('_MI_FORCE_MOD_REWRITE_DESC',"Não esqueça de mod_rewrite renomeiar o .htaccess.rewrite para .htaccess");
+define('_MI_MODULESLESS_DIR','Nome do diretório com módulos/menos modo?');
+define('_MI_MODULESLESS_DIR_DESC','implementação experimental. você deveria somar alguns artigos específicos em XOOPS_ROOT_PATH /. htaccess < br / > deixe espaço em branco normalmente');
+define('_MI_SPACE2NBSP','espaço dobrado é mudado como space+&amp;nbsp; (quando linebreak selecionado)');
+define('_MI_DISPLAY_PRINT_ICON','Ícone de exibições de "Impressora"');
+define('_MI_DISPLAY_FRIEND_ICON','Ícone de exibições de "Recomendo ao amigo"');
+define('_MI_USE_TAF_MODULE','Modo Usuário "Fale para um Amigo" ');
+define('_MI_DISPLAY_PAGENAV','Navegação de Página');
+define('_MI_DISPLAY_PAGENAV_NONE','Não mostrar');
+define('_MI_DISPLAY_PAGENAV_DISP','Visualizar todos conteúdos');
+define('_MI_DISPLAY_PAGENAV_SUB','Só conteúdos de submenu');
+define('_MI_DISPLAY_PAGENAV_PERSUB','Divida através de submenu');
+define('_MI_NAVBLOCK_TARGET','Target para bloco de tinycontent');
+define('_MI_NAVBLOCK_TARGET_DISP','Títulos de conteúdos todos visíveis');
+define('_MI_NAVBLOCK_TARGET_SUB','Títulos de só conteúdos de submenu');
+
+
+//***********************************************************************//
+// No language config below!!! Do not change this!!!                     //
+//  (These constants are not used in Duplicatable)                       //
+//***********************************************************************//
+
+define("_MI_TINYCONTENT_PREFIX", "tinycontent");
+define("_MI_DIR_NAME", "tinycontent");
+
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/swedish/main.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/swedish/main.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/swedish/main.php	(revision 405)
@@ -0,0 +1,42 @@
+<?php
+
+if( defined( 'FOR_XOOPS_LANG_CHECKER' ) || ! defined( 'TINYCONTENT_MB_LOADED' ) ) {
+
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-04-19 18:26:42
+define('_TC_FMT_DEFAULT_COMMENT_TITLE','Re: %s');
+
+define( 'TINYCONTENT_MB_LOADED' , 1 ) ;
+
+define('_TC_FILENOTFOUND','Filen hittades inte! VçÏligen kontrollera URL!');
+define("_TC_PRINTERFRIENDLY","UtskriftsvçÏlig Sida");
+define("_TC_SENDSTORY","Skicka denna artikel till en vçÏ");
+
+define("_TC_NEXTPAGE","NçÔta");
+define("_TC_PREVPAGE","FÓegéÆnde");
+define("_TC_TOPOFCONTENTS","Index");
+
+// whether parameter for "mailto:" is already rawurlencoded
+define("_TC_DONE_MAILTOENCODE" , false ) ;
+
+// %s is your site name. for single byte languages (ignored when _TC_DONE_MAILTOENCODE is true)
+define("_TC_INTARTICLE","Intressant artikel på %s");
+define("_TC_INTARTFOUND","HçÓ çÓ en intressant artikel som jag har hittat på %s");
+
+// for multibyte languages (ignored when _TC_DONE_MAILTOENCODE is false)
+define("_TC_MB_INTARTICLE","" ) ;
+define("_TC_MB_INTARTFOUND","" ) ;
+
+// %s represents your site name
+define("_TC_THISCOMESFROM","Denna artikel kommer fréÏ %s");
+define("_TC_URLFORSTORY","Addressen fÓ denna artikel çÓ:");
+}
+
+if( ! defined( 'FOR_XOOPS_LANG_CHECKER' ) && ! function_exists( 'tc_convert_wrap_to_ie' ) ) {
+	function tc_convert_wrap_to_ie( $str ) {
+		return $str ;
+	}
+}
+
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/swedish/admin.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/swedish/admin.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/swedish/admin.php	(revision 405)
@@ -0,0 +1,106 @@
+<?php
+
+if( defined( 'FOR_XOOPS_LANG_CHECKER' ) || ! defined( 'TINYCONTENT_AM_LOADED' ) ) {
+
+
+
+
+
+// Appended by Xoops Language Checker -GIJOE- in 2006-04-11 11:14:42
+define('_TC_UPDATE_WRAP_CONTENTS','Update wrapped contents for searching');
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-04-13 05:53:24
+define('_TC_HTML_HEADER','HTML header');
+define('_TC_CHECKED_ITEMS_ARE','Checked records are:');
+define('_TC_BUTTON_MOVETO','Export(Move)');
+define('_TC_CREATED','Created');
+define('_TC_SAVEAS','Save as');
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-02-11 18:59:09
+define('_TC_TYPE_HTMLNOBB','HTML Content (bb code disabled)');
+define('_TC_TYPE_TEXTNOBB','Text Content (bb code disabled)');
+
+// Appended by Xoops Language Checker -GIJOE- in 2004-06-18 15:39:56
+define('_TC_FMT_WRAPCHANGESRCHREF','rewrite attributes of html (experimental)<br /> this option rewrites relative links to absolute links.<br />This probably mis-recognizes sentences looks like HTML source<br />');
+
+define( 'TINYCONTENT_AM_LOADED' , 1 ) ;
+
+//Admin Page Titles
+define("_TC_ADMINTITLE","Tiny Content");
+
+// SPAW
+define('_TC_SPAWLANG','en') ;
+
+//Table Titles
+define("_TC_ADDCONTENT","LçÈg till nytt InnehéÍl");
+define("_TC_EDITCONTENT","Editera InnehéÍl");
+define("_TC_ADDLINK","LçÏka HTML sida");
+define("_TC_EDITLINK","Modifiera HTML sida");
+define("_TC_ULFILE","Ladda upp HTML fil");
+define("_TC_SFILE","SÌ");
+define("_TC_DELFILE","Radera Fil");
+
+//Table Data
+define("_TC_HOMEPAGE","Index");
+define("_TC_LINKNAME","LçÏktitel");
+define("_TC_STORYID","Fil ID");
+define("_TC_VISIBLE","Synlig");
+define("_TC_TH_VISIBLE","Syn");
+define("_TC_ENABLECOM","Kommentarer tilléÕna");
+define("_TC_TH_ENABLECOM","Kom");
+define("_TC_CONTENT","InnehéÍl");
+define("_TC_YES","Ja");
+define("_TC_NO","Nej");
+define("_TC_URL","VçÍj Fil");
+define("_TC_UPLOAD","Ladda upp");
+define("_TC_DISABLEBREAKS","Inaktivera radbytes konvertering (Aktiveras nçÓ HTML anvçÏds)");
+define("_TC_SUBMENU","Visa i Undermeny");
+define("_TC_TH_SUBMENU","Und");
+define("_TC_DISP_YES","Visa");
+define("_TC_DISP_NO","Visa inte");
+
+define("_TC_CONTENT_TYPE","Typ av sida");
+define("_TC_TYPE_HTML","HTML InnehéÍl (bb kod aktiverad)"); // nohtml=0
+define("_TC_TYPE_TEXTWITHBB","Text InnehéÍl (bb kod aktiverad)"); // nohtml=1
+define("_TC_TYPE_PHPHTML","PHP koder (bb kod inaktiverad)"); // nohtml=8
+define("_TC_TYPE_PHPWITHBB","PHP koder (bb kod inaktiverad)"); // nohtml=10
+define("_TC_TYPE_PEARWIKI","PEAR Wiki (bb kod inaktiverad)"); // nohtml=16
+define("_TC_TYPE_PEARWIKIWITHBB","PEAR Wiki (bb kod aktiverad)"); // nohtml=18
+define("_TC_TYPE_PUKIWIKI","PukiWiki (bb kod inaktiverad)"); // nohtml=32 (resv)
+define("_TC_TYPE_PUKIWIKIWITHBB","PukiWiki (bb kod aktiverad)"); // nohtml=34 (resv)
+
+define("_TC_LASTMODIFIED","Ändrad senast");
+define("_TC_DONTUPDATELASTMODIFIED","Uppdateras inte automatiskt");
+
+define("_TC_LINKID","Prioritet");
+define("_TC_CONTENTTYPE","Typ");
+define("_TC_ACTION","ÅtgçÓd");
+define("_TC_EDIT","Editera");
+define("_TC_DELETE","Radera");
+define("_TC_ELINK","Modifiera");
+define("_TC_DELLINK","Radera");
+
+define("_TC_WRAPROOT","HTML-sida sÌvçÈ");
+define("_TC_FMT_WRAPROOTTC","Samma som TinyContent modulen<br /> (%s) <br />");
+define("_TC_FMT_WRAPROOTPAGE","Samma som wrapped page. (you can't use comment features)<br /> (%s) <br />use mod_rewrite if you can.<br />");
+define("_TC_FMT_WRAPBYREWRITE","AnvçÏd mod_rewrite (experimentell)<br /> ladda upp HTMLs och annat till %s<br />GlÎ inte att aktivera mod_rewrite<br />");
+
+define("_TC_DISABLECOM","Inaktivera kommentarer");
+define("_TC_DBUPDATED","Uppdatering av Databasen lyckades!");
+define("_TC_ERRORINSERT","Ooops, ett fel uppstod vid uppdatering av databasen!");
+define("_TC_RUSUREDEL","Är Ni sçÌer på att Ni vill radera innehéÍlet? <br />Alla kommentarer som çÓ lçÏkade till denna artikel kommer att tas bort.");
+define("_TC_RUSUREDELF","Är Ni sçÌer på att Ni vill radera denna fil?");
+define("_TC_UPLOADED","Uppladdningen av Filen lyckades!");
+define("_TC_FDELETED","Raderingen av Filen lyckades!");
+define("_TC_ERROREXIST","Fel. Detta filnamn finns redan.");
+define("_TC_ERRORUPL","Fel under uppladdning av Fil!");
+define("_TC_FMT_WRAPPATHPERMOFF","<span style='font-size:xx-small;'>Katalogan fÓ HTML sidor (%s) çÓ inte tilléÕen att skrivas till av httpd. <br />Om Ni vill ladda upp eller radera filer via http, çÏdra katalogrçÕtigheterna.<br />Vi rekommenderar anvçÏdande av separat FTP program av sçÌerhetsskçÍ och i ock med detta så kan katalog rçÕtigheterna lçÎnas orÓda.</span>");
+define("_TC_FMT_WRAPPATHPERMON","<span style='font-size:xx-small;'>Vi rekommenderar inte att Ni laddar upp filer via HTTP. FÓsÌ istçÍlet att ladda upp filer via FTP istçÍlet om mËligt.</span>" ) ;
+
+define("_TC_ALTER_TABLE","Uppdatera Tabell");
+
+define("_TC_JS_CONFIRMDISCARD","Ändringarna kommer inte att sparas. OK?");
+
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/swedish/modinfo.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/swedish/modinfo.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/swedish/modinfo.php	(revision 405)
@@ -0,0 +1,87 @@
+<?php
+// Module Info Tiny Content
+
+if( defined( 'FOR_XOOPS_LANG_CHECKER' ) || ! defined( 'TINYCONTENT_MI_LOADED' ) ) {
+
+
+
+
+
+
+
+
+// Appended by Xoops Language Checker -GIJOE- in 2006-04-11 11:14:42
+define('_TC_MD_ADMENU_MYTPLSADMIN','Templates');
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-08-27 16:00:20
+define('_MI_TC_BDESC1','Builds the navigation');
+define('_MI_TC_BDESC2','Show a content as a block. [summary] tag valid');
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-05-11 05:12:34
+define('_MI_COMMON_HTMLHEADER','Common HTML headers');
+define('_MI_COMMON_HTMLHEADER_DESC','Check if xoops_module_header exists in your theme');
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-04-20 05:52:51
+define('_MI_DISPLAY_PAGENAV_PERSUB','Divide by submenu');
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-04-13 05:53:25
+define('_MI_HEADER_TAREA_HEIGHT','Height of TextArea for HTML header');
+define('_MI_HEADER_TAREA_HEIGHT_DESC','');
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-02-19 08:26:11
+define('_MI_MODULESLESS_DIR','Name of the directory with modules/less mode');
+define('_MI_MODULESLESS_DIR_DESC','experimental implementation. you should add some specific sentences into XOOPS_ROOT_PATH/.htaccess<br />leave blank normally');
+define('_MI_USE_TAF_MODULE','User "Tell a Friend" module');
+
+// Appended by Xoops Language Checker -GIJOE- in 2004-06-18 15:39:56
+define('_MI_TC_BNAME2','TinyD %s Content');
+define('_MI_SPACE2NBSP','doubled space is changed as space+&amp;nbsp; (when linebreak on)');
+
+define( 'TINYCONTENT_MI_LOADED' , 1 ) ;
+
+// The name of this module
+define("_MI_TINYCONTENT_NAME","TinyD");
+
+// A brief description of this module
+define("_MI_TINYCONTENT_DESC","Skapa innehéÍl så enkelt som mËligt.");
+
+// Name for Menu Block
+define("_MI_TC_BNAME1","Tiny Content %s Meny");
+
+// Admin Menu
+define("_TC_MD_ADMENU1","LçÈg till InnehéÍl");
+define("_TC_MD_ADMENU2","LçÏka HTML sida");
+define("_TC_MD_ADMENU3","Editera/Radera InnehéÍl");
+define("_TC_MD_ADMENU_MYBLOCKSADMIN","Block/Grupper");
+
+// WYSIWYG Defines for v1.4
+define('_MI_WYSIWYG','AnvçÏd Wysiwyg Editor?');
+define('_MI_WYSIWYG_DESC','');
+define('_MI_TAREA_WIDTH','Bredd på textarea');
+define('_MI_TAREA_WIDTH_DESC','');
+define('_MI_TAREA_HEIGHT','HËd på textarea');
+define('_MI_TAREA_HEIGHT_DESC','');
+define('_MI_FORCE_MOD_REWRITE','AnvçÏd mod_rewrite i hela denna modulen.');
+define('_MI_FORCE_MOD_REWRITE_DESC',"GlÎ inte att aktivera mod_rewrite. eg) namnçÏdra .htaccess.rewrite till .htaccess");
+define('_MI_DISPLAY_PRINT_ICON','Visa ikon fÓ "UtskriftsvçÏlig sida"');
+define('_MI_DISPLAY_FRIEND_ICON','Visa ikon fÓ "Tipsa en vçÏ"');
+define('_MI_DISPLAY_PAGENAV','Sidnavigering');
+define('_MI_DISPLAY_PAGENAV_NONE','Visa inte');
+define('_MI_DISPLAY_PAGENAV_DISP','Allt synligt innehéÍl');
+define('_MI_DISPLAY_PAGENAV_SUB','Endast innehéÍl med undermeny');
+define('_MI_NAVBLOCK_TARGET','InnehéÍl i Tinycontent block');
+define('_MI_NAVBLOCK_TARGET_DISP','Titlar på allt synligt innehéÍl');
+define('_MI_NAVBLOCK_TARGET_SUB','Titlar på innehéÍl med undermeny');
+
+
+//***********************************************************************//
+// No language config below!!! Do not change this!!!                     //
+//  (These constants are not used in Duplicatable)                       //
+//***********************************************************************//
+
+define("_MI_TINYCONTENT_PREFIX", "tinycontent");
+define("_MI_DIR_NAME", "tinycontent");
+
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/english/admin.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/english/admin.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/english/admin.php	(revision 405)
@@ -0,0 +1,95 @@
+<?php
+
+if( defined( 'FOR_XOOPS_LANG_CHECKER' ) || ! defined( 'TINYCONTENT_AM_LOADED' ) ) {
+
+define( 'TINYCONTENT_AM_LOADED' , 1 ) ;
+
+//Admin Page Titles
+define("_TC_ADMINTITLE","Tiny Content");
+
+// SPAW
+define('_TC_SPAWLANG','en') ;
+
+//Table Titles
+define("_TC_ADDCONTENT","Add new Content");
+define("_TC_EDITCONTENT","Edit Content");
+define("_TC_ADDLINK","Add PageWrap");
+define("_TC_EDITLINK","Modify PageWrap");
+define("_TC_ULFILE","Upload File");
+define("_TC_SFILE","Search");
+define("_TC_DELFILE","Delete File");
+define("_TC_UPDATE_WRAP_CONTENTS","Update wrapped contents for searching");
+
+//Table Data
+define("_TC_HOMEPAGE","Home");
+define("_TC_LINKNAME","Link Title");
+define("_TC_STORYID","ID");
+define("_TC_VISIBLE","Visible");
+define("_TC_TH_VISIBLE","Vis");
+define("_TC_ENABLECOM","Comments enabled");
+define("_TC_TH_ENABLECOM","Com");
+define("_TC_HTML_HEADER","HTML header");
+define("_TC_CONTENT","Content");
+define("_TC_YES","Yes");
+define("_TC_NO","No");
+define("_TC_URL","Select File");
+define("_TC_UPLOAD","Upload");
+define("_TC_DISABLEBREAKS","Disable Linebreak Conversion (Activate when using HTML)");
+define("_TC_SUBMENU","Display in Submenu");
+define("_TC_TH_SUBMENU","Sub");
+define("_TC_DISP_YES","Display");
+define("_TC_DISP_NO","Do Not Display");
+
+define("_TC_CONTENT_TYPE","Page Type");
+define("_TC_TYPE_HTML","HTML Content (bb code enabled)"); // nohtml=0
+define("_TC_TYPE_HTMLNOBB","HTML Content (bb code disabled)"); // nohtml=2
+define("_TC_TYPE_TEXTWITHBB","Text Content (bb code enabled)"); // nohtml=1
+define("_TC_TYPE_TEXTNOBB","Text Content (bb code disabled)"); // nohtml=3
+define("_TC_TYPE_PHPHTML","PHP codes (bb code disabled)"); // nohtml=8
+define("_TC_TYPE_PHPWITHBB","PHP codes (bb code enabled)"); // nohtml=10
+define("_TC_TYPE_PEARWIKI","PEAR Wiki (bb code disabled)"); // nohtml=16
+define("_TC_TYPE_PEARWIKIWITHBB","PEAR Wiki (bb code enabled)"); // nohtml=18
+define("_TC_TYPE_PUKIWIKI","PukiWiki (bb code disabled)"); // nohtml=32 (resv)
+define("_TC_TYPE_PUKIWIKIWITHBB","PukiWiki (bb code enabled)"); // nohtml=34 (resv)
+
+define("_TC_CHECKED_ITEMS_ARE","Checked records are:");
+define("_TC_BUTTON_MOVETO","Export(Move)");
+
+define("_TC_LASTMODIFIED","Last Modified");
+define("_TC_DONTUPDATELASTMODIFIED","Do not update it automatically");
+define("_TC_CREATED","Created");
+define("_TC_SAVEAS","Save as");
+
+define("_TC_LINKID","Priority");
+define("_TC_CONTENTTYPE","Type");
+define("_TC_ACTION","Action");
+define("_TC_EDIT","Edit");
+define("_TC_DELETE","Delete");
+define("_TC_ELINK","Modify");
+define("_TC_DELLINK","Cut");
+
+define("_TC_WRAPROOT","PageWrap's Base");
+define("_TC_FMT_WRAPROOTTC","Same as TinyContent module<br /> (%s) <br />");
+define("_TC_FMT_WRAPROOTPAGE","Same as wrapped page.<br /> (%s) <br />use mod_rewrite if you can.<br />");
+define("_TC_FMT_WRAPBYREWRITE","use mod_rewrite (experimental)<br /> upload HTMLs and others into %s<br />Do not forget turning mod_rewrite on<br />");
+define("_TC_FMT_WRAPCHANGESRCHREF","rewrite attributes of html (experimental)<br /> this option rewrites relative links to absolute links.<br />This probably mis-recognizes sentences looks like HTML source<br />");
+
+define("_TC_DISABLECOM","Disable comments");
+define("_TC_DBUPDATED","Database Updated Successfully!");
+define("_TC_ERRORINSERT","Error while updating database!");
+define("_TC_RUSUREDEL","Are you sure you want to delete this content? <br />All comments linked to the content will be removed");
+define("_TC_RUSUREDELF","Are you sure you want to delete this file?");
+define("_TC_UPLOADED","File Uploaded Successfully!");
+define("_TC_FDELETED","File Deleted Successfully!");
+define("_TC_ERROREXIST","Error. The same filename exists");
+define("_TC_ERRORUPL","Error while uploading file!");
+define("_TC_FMT_WRAPPATHPERMOFF","<span style='font-size:xx-small;'>The directory for wrapping (%s) is not allowed to be written to by httpd. <br />If you'd like to upload or delete files via HTTP, turn the writing permission on.<br />I recommend to upload or delete files only via ftp for security reasons, thus the writing permission of the directory should still be off.</span>");
+define("_TC_FMT_WRAPPATHPERMON","<span style='font-size:xx-small;'>I don't recommend you upload via HTTP. Try to upload the files for wrapping via ftp, if you can.</span>" ) ;
+
+define("_TC_ALTER_TABLE","Alter Table");
+
+define("_TC_JS_CONFIRMDISCARD","Changes will be discarded. OK?");
+
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/english/modinfo.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/english/modinfo.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/english/modinfo.php	(revision 405)
@@ -0,0 +1,66 @@
+<?php
+// Module Info Tiny Content
+
+if( defined( 'FOR_XOOPS_LANG_CHECKER' ) || ! defined( 'TINYCONTENT_MI_LOADED' ) ) {
+
+define( 'TINYCONTENT_MI_LOADED' , 1 ) ;
+
+// The name of this module
+define("_MI_TINYCONTENT_NAME","TinyD");
+
+// A brief description of this module
+define("_MI_TINYCONTENT_DESC","Creating content made as easy as it can be.");
+
+// Name for Menu Block
+define("_MI_TC_BNAME1","TinyD %s Menu");
+define("_MI_TC_BNAME2","TinyD %s Content");
+define("_MI_TC_BDESC1","Builds the navigation");
+define("_MI_TC_BDESC2","Show a content as a block. [summary] tag valid");
+
+// Admin Menu
+define("_TC_MD_ADMENU1","Add Content");
+define("_TC_MD_ADMENU2","Add PageWrap");
+define("_TC_MD_ADMENU3","Edit/Delete Content");
+define("_TC_MD_ADMENU_MYBLOCKSADMIN","Blocks/Groups");
+define("_TC_MD_ADMENU_MYTPLSADMIN","Templates");
+
+// WYSIWYG Defines for v1.4
+//define('_MI_WYSIWYG','Use Wysiwyg Editor?');
+//define('_MI_WYSIWYG_DESC','');
+define('_MI_COMMON_HTMLHEADER','Common HTML headers');
+define('_MI_COMMON_HTMLHEADER_DESC','Check if xoops_module_header exists in your theme');
+define('_MI_TAREA_WIDTH','Width of TextAreas');
+define('_MI_TAREA_WIDTH_DESC','');
+define('_MI_HEADER_TAREA_HEIGHT','Height of TextArea for HTML header');
+define('_MI_HEADER_TAREA_HEIGHT_DESC','');
+define('_MI_TAREA_HEIGHT','Height of TextArea for body');
+define('_MI_TAREA_HEIGHT_DESC','');
+define('_MI_FORCE_MOD_REWRITE','use mod_rewrite with whole of this module');
+define('_MI_FORCE_MOD_REWRITE_DESC',"Don't forget turning mod_rewrite on. eg) rename .htaccess.rewrite to .htaccess");
+define('_MI_MODULESLESS_DIR','Name of the directory with modules/less mode');
+define('_MI_MODULESLESS_DIR_DESC','experimental implementation. you should add some specific sentences into XOOPS_ROOT_PATH/.htaccess<br />leave blank normally');
+define('_MI_SPACE2NBSP','doubled space is changed as space+&amp;nbsp; (when linebreak on)');
+define('_MI_DISPLAY_PRINT_ICON','Displays icon of "Printer friendly"');
+define('_MI_DISPLAY_FRIEND_ICON','Displays icon of "Tell a friend"');
+define('_MI_USE_TAF_MODULE','User "Tell a Friend" module');
+define('_MI_DISPLAY_PAGENAV','Page Navigation');
+define('_MI_DISPLAY_PAGENAV_NONE','Do Not display');
+define('_MI_DISPLAY_PAGENAV_DISP','All visible contents');
+define('_MI_DISPLAY_PAGENAV_SUB','Only submenu contents');
+define('_MI_DISPLAY_PAGENAV_PERSUB','Divide by submenu');
+define('_MI_NAVBLOCK_TARGET','Target for tinycontent block');
+define('_MI_NAVBLOCK_TARGET_DISP','Titles of all visible contents');
+define('_MI_NAVBLOCK_TARGET_SUB','Titles of only submenu contents');
+
+
+//***********************************************************************//
+// No language config below!!! Do not change this!!!                     //
+//  (These constants are not used in Duplicatable)                       //
+//***********************************************************************//
+
+define("_MI_TINYCONTENT_PREFIX", "tinycontent");
+define("_MI_DIR_NAME", "tinycontent");
+
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/english/main.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/english/main.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/english/main.php	(revision 405)
@@ -0,0 +1,40 @@
+<?php
+
+if( defined( 'FOR_XOOPS_LANG_CHECKER' ) || ! defined( 'TINYCONTENT_MB_LOADED' ) ) {
+
+define( 'TINYCONTENT_MB_LOADED' , 1 ) ;
+
+define( "_TC_FMT_DEFAULT_COMMENT_TITLE" , "Re: %s" ) ;
+
+define('_TC_FILENOTFOUND','File not found! Please check the URL!');
+define("_TC_PRINTERFRIENDLY","Printer Friendly Page");
+define("_TC_SENDSTORY","Send this Story to a Friend");
+
+define("_TC_NEXTPAGE","Next");
+define("_TC_PREVPAGE","Previous");
+define("_TC_TOPOFCONTENTS","Top of contents");
+
+// whether parameter for "mailto:" is already rawurlencoded
+define("_TC_DONE_MAILTOENCODE" , false ) ;
+
+// %s is your site name. for single byte languages (ignored when _TC_DONE_MAILTOENCODE is true)
+define("_TC_INTARTICLE","Interesting Article at %s");
+define("_TC_INTARTFOUND","Here is an interesting article I have found at %s");
+
+// for multibyte languages (ignored when _TC_DONE_MAILTOENCODE is false)
+define("_TC_MB_INTARTICLE","" ) ;
+define("_TC_MB_INTARTFOUND","" ) ;
+
+// %s represents your site name
+define("_TC_THISCOMESFROM","This article comes from %s");
+define("_TC_URLFORSTORY","The URL for this story is:");
+}
+
+if( ! defined( 'FOR_XOOPS_LANG_CHECKER' ) && ! function_exists( 'tc_convert_wrap_to_ie' ) ) {
+	function tc_convert_wrap_to_ie( $str ) {
+		return $str ;
+	}
+}
+
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/english/text_wiki_sample.wiki
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/english/text_wiki_sample.wiki	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/english/text_wiki_sample.wiki	(revision 405)
@@ -0,0 +1,353 @@
+[[toc]]
+
+----
+
+++ General Notes
+
+The markup described on this page is for the default {{Text_Wiki}} rules; \
+it is a combination of the [http://tavi.sourceforge.net WikkTikkiTavi] \
+and [http://develnet.org/ coWiki] markup styles.
+
+All text is entered as plain text, and will be converted to HTML entities as \
+necessary.  This means that {{<}}, {{>}}, {{&}}, and so on are converted for \
+you (except in special situations where the characters are Wiki markup; \
+Text_Wiki is generally smart enough to know when to convert and when not to).
+
+Just hit "return" twice to make a paragraph break.  If you want \
+to keep the same logical line but have to split it across \
+two physical lines (such as when your editor only shows a certain number \
+of characters per line), end the line with a backslash {{\}} and hit \
+return once.  This will cause the two lines to be joined on display, and the \
+backslash will not show.  (If you end a line with a backslash and a tab \
+or space, it will ''not'' be joined with the next line, and the backslash \
+will be printed.)
+
+
+----
+
+++ Inline Formatting
+
+|| {{``//emphasis text//``}}                 || //emphasis text// ||
+|| {{``**strong text**``}}                   || **strong text** ||
+|| {{``//**emphasis and strong**//``}}       || //**emphasis and strong**// ||
+|| {{``{{teletype text}}``}}                    || {{teletype text}} ||
+|| {{``@@--- delete text +++ insert text @@``}} || @@--- delete text +++ insert text @@ ||
+|| {{``@@--- delete only @@``}}                 || @@--- delete only @@ ||
+|| {{``@@+++ insert only @@``}}                 || @@+++ insert only @@ ||
+
+
+----
+
+++ Literal Text
+
+If you don't want Text_Wiki to parse some text, enclose it in two backticks (not single-quotes).
+
+<code>
+
+This //text// gets **parsed**.
+
+``This //text// does not get **parsed**.``
+
+</code>
+
+This //text// gets **parsed**.
+
+``This //text// does not get **parsed**.``
+
+----
+
+++ Headings
+
+You can make various levels of heading by putting \
+equals-signs before and after the text (all on its \
+own line):
+
+<code>
++++ Level 3 Heading
+++++ Level 4 Heading
++++++ Level 5 Heading
+++++++ Level 6 Heading
+</code>
+
++++ Level 3 Heading
+++++ Level 4 Heading
++++++ Level 5 Heading
+++++++ Level 6 Heading
+
+----
+
+++ Table of Contents
+
+To create a list of every heading, with a link to that heading, put a table of contents tag on its own line.
+
+<code>
+[[toc]]
+</code>
+
+----
+
+++ Horizontal Rules
+
+Use four dashes ({{``----``}}) to create a horizontal rule.
+
+----
+
+++ Lists
+
++++ Bullet Lists
+
+You can create bullet lists by starting a paragraph with one or \
+more asterisks.
+
+<code>
+* Bullet one
+ * Sub-bullet
+</code>
+
+* Bullet one
+ * Sub-bullet
+
++++ Numbered Lists
+
+Similarly, you can create numbered lists by starting a paragraph \
+with one or more hashes.
+
+<code>
+# Numero uno
+# Number two
+ # Sub-item
+</code>
+
+# Numero uno
+# Number two
+ # Sub-item
+
+
++++ Mixing Bullet and Number List Items
+
+You can mix and match bullet and number lists:
+
+<code>
+# Number one
+ * Bullet
+ * Bullet
+# Number two
+ * Bullet
+ * Bullet
+  * Sub-bullet
+   # Sub-sub-number
+   # Sub-sub-number
+# Number three
+ * Bullet
+ * Bullet
+</code>
+
+# Number one
+ * Bullet
+ * Bullet
+# Number two
+ * Bullet
+ * Bullet
+  * Sub-bullet
+   # Sub-sub-number
+   # Sub-sub-number
+# Number three
+ * Bullet
+ * Bullet
+
+
+
++++ Definition Lists
+
+You can create a definition (description) list with the following syntax:
+
+<code>
+: Item 1 : Something
+: Item 2 : Something else
+</code>
+
+: Item 1 : Something
+: Item 2 : Something else
+
+----
+
+++ Block Quotes
+
+You can mark a blockquote by starting a line with one or more '>' \
+characters, followed by a space and the text to be quoted.
+
+<code>
+This is normal text here.
+
+> Indent me! The quick brown fox jumps over the lazy dog. \ 
+Now this the time for all good men to come to the aid of \ 
+their country. Notice how we can continue the block-quote \ 
+in the same "paragraph" by using a backslash at the end of \ 
+the line.
+>
+> Another block, leading to...
+>> Second level of indenting.  This second is indented even \ 
+more than the previous one.
+
+Back to normal text.
+</code>
+
+This is normal text here.
+
+> Indent me! The quick brown fox jumps over the lazy dog. \
+Now this the time for all good men to come to the aid of \
+their country. Notice how we can continue the block-quote \
+in the same "paragraph" by using a backslash at the end of \
+the line.
+>
+> Another block, leading to...
+>> Second level of indenting.  This second is indented even \
+more than the previous one.
+
+Back to normal text.
+
+
+----
+
+++ Links and Images
+
++++ Wiki Links
+
+SmashWordsTogether to create a page link.
+
+You can force a WikiPage name '''not''' to be clickable by putting \
+an exclamation mark in front of it.
+
+<code>
+WikiPage !WikiPage
+</code>
+
+WikiPage !WikiPage
+
+You can create a "described" or "labeled" link to a wiki page by putting the page name in brackets, followed by some text.
+
+<code>
+[WikiPage Descriptive text for the link.]
+</code>
+
+[WikiPage Descriptive text for the link.]
+
+> **Note:** existing wiki pages must be in the [RuleWikilink wikilink] {{pages}} configuration,  and the [RuleWikilink wikilink] {{view_url}} configuration value must be set for the linking to work.
+
++++ Interwiki Links
+
+Interwiki links are links to pages on other Wiki sites. \
+Type the {{``SiteName:PageName``}} like this:
+
+* MeatBall:RecentChanges
+* Advogato:proj/WikkiTikkiTavi
+* Wiki:WorseIsBetter
+
+> **Note:** the interwiki site must be in the [RuleInterwiki interwiki] {{sites}} configuration array.
+
++++ URLs
+
+Create a remote link simply by typing its URL: http://ciaweb.net.
+
+If you like, enclose it in brackets to create a numbered reference \
+and avoid cluttering the page; {{``[http://ciaweb.net/free/]``}} becomes [http://ciaweb.net/free/].
+
+Or you can have a described-reference instead of a numbered reference:
+<code>
+[http://pear.php.net PEAR]
+</code>
+[http://pear.php.net PEAR]
+
++++ Images
+
+You can put a picture in a page by typing the URL to the picture \
+(it must end in gif, jpg, or png).
+<code>
+http://c2.com/sig/wiki.gif
+</code>
+
+http://c2.com/sig/wiki.gif
+
+You can use the described-reference URL markup to give the image an ALT tag:
+<code>
+[http://phpsavant.com/etc/fester.jpg Fester]
+</code>
+
+[http://phpsavant.com/etc/fester.jpg Fester]
+
+----
+
+++ Code Blocks
+
+Create code blocks by using {{<code>...</code>}} tags (each on its own line).
+
+<code>
+This is an example code block!
+</code>
+
+
+To create PHP blocks that get automatically colorized when you use PHP tags, simply surround the code with {{<code type="php">...</code>}} tags (the tags themselves should each be on their own lines, and no need for the {{<?php ... ?>}} tags).
+
+<code>
+ <code type="php">
+ // Set up the wiki options
+ $options = array();
+ $options['view_url'] = "index.php?page=";
+
+ // load the text for the requested page
+ $text = implode('', file($page . '.wiki.txt'));
+
+ // create a Wiki objext with the loaded options
+ $wiki = new Text_Wiki($options);
+
+ // transform the wiki text.
+ echo $wiki->transform($text);
+ </code>
+</code>
+
+<code type="php">
+// Set up the wiki options
+$options = array();
+$options['view_url'] = "index.php?page=";
+
+// load the text for the requested page
+$text = implode('', file($page . '.wiki.txt'));
+
+// create a Wiki objext with the loaded options
+$wiki = new Text_Wiki($options);
+
+// transform the wiki text.
+echo $wiki->transform($text);
+</code>
+
+----
+
+++ Tables
+
+You can create tables using pairs of vertical bars:
+
+<code>
+|| cell one || cell two ||
+|||| big ol' line ||
+|| cell four || cell five ||
+|| cell six || here's a very long cell ||
+</code>
+
+|| cell one || cell two ||
+|||| big ol' line ||
+|| cell four || cell five ||
+|| cell six || here's a very long cell ||
+
+<code>
+|| lines must start and end || with double vertical bars || nothing ||
+|| cells are separated by || double vertical bars || nothing ||
+|||| you can span multiple columns by || starting each cell ||
+|| with extra cell |||| separators ||
+|||||| but perhaps an example is the easiest way to see ||
+</code>
+
+|| lines must start and end || with double vertical bars || nothing ||
+|| cells are separated by || double vertical bars || nothing ||
+|||| you can span multiple columns by || starting each cell ||
+|| with extra cell |||| separators ||
+|||||| but perhaps an example is the easiest way to see ||
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/german/main.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/german/main.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/german/main.php	(revision 405)
@@ -0,0 +1,44 @@
+<?php
+
+if( defined( 'FOR_XOOPS_LANG_CHECKER' ) || ! defined( 'TINYCONTENT_MB_LOADED' ) ) {
+
+
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-04-19 18:26:41
+define('_TC_FMT_DEFAULT_COMMENT_TITLE','Re: %s');
+
+// Appended by Xoops Language Checker -GIJOE- in 2004-06-02 17:58:47
+define('_TC_NEXTPAGE','Next');
+define('_TC_PREVPAGE','Prev');
+define('_TC_TOPOFCONTENTS','Top of contents');
+
+define( 'TINYCONTENT_MB_LOADED' , 1 ) ;
+
+define('_TC_FILENOTFOUND','File not found! Please check the URL!');
+define("_TC_PRINTERFRIENDLY","Printer Friendly Page");
+define("_TC_SENDSTORY","Send this Story to a Friend");
+
+// whether parameter for "mailto:" is already rawurlencoded
+define("_TC_DONE_MAILTOENCODE" , false ) ;
+
+// %s is your site name. for single byte languages (ignored when _TC_DONE_MAILTOENCODE is true)
+define("_TC_INTARTICLE","Interesting Article at %s");
+define("_TC_INTARTFOUND","Here is an interesting article I have found at %s");
+
+// for multibyte languages (ignored when _TC_DONE_MAILTOENCODE is false)
+define("_TC_MB_INTARTICLE","" ) ;
+define("_TC_MB_INTARTFOUND","" ) ;
+
+// %s represents your site name
+define("_TC_THISCOMESFROM","This article comes from %s");
+define("_TC_URLFORSTORY","The URL for this story is:");
+}
+
+if( ! defined( 'FOR_XOOPS_LANG_CHECKER' ) && ! function_exists( 'tc_convert_wrap_to_ie' ) ) {
+	function tc_convert_wrap_to_ie( $str ) {
+		return $str ;
+	}
+}
+
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/german/admin.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/german/admin.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/german/admin.php	(revision 405)
@@ -0,0 +1,107 @@
+<?php
+
+
+if( defined( 'FOR_XOOPS_LANG_CHECKER' ) || ! defined( 'TINYCONTENT_AM_LOADED' ) ) {
+
+
+
+
+
+
+// Appended by Xoops Language Checker -GIJOE- in 2006-04-11 11:14:42
+define('_TC_UPDATE_WRAP_CONTENTS','Update wrapped contents for searching');
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-04-13 05:53:24
+define('_TC_HTML_HEADER','HTML header');
+define('_TC_CHECKED_ITEMS_ARE','Checked records are:');
+define('_TC_BUTTON_MOVETO','Export(Move)');
+define('_TC_CREATED','Created');
+define('_TC_SAVEAS','Save as');
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-02-11 18:59:08
+define('_TC_TYPE_HTMLNOBB','HTML Content (bb code disabled)');
+define('_TC_TYPE_TEXTNOBB','Text Content (bb code disabled)');
+
+// Appended by Xoops Language Checker -GIJOE- in 2004-06-18 15:39:55
+define('_TC_FMT_WRAPCHANGESRCHREF','rewrite attributes of html (experimental)<br /> this option rewrites relative links to absolute links.<br />This probably mis-recognizes sentences looks like HTML source<br />');
+
+// Appended by Xoops Language Checker -GIJOE- in 2004-05-06 09:53:53
+define('_TC_SPAWLANG','en');
+define('_TC_TH_VISIBLE','Vis');
+define('_TC_ENABLECOM','Comments enabled');
+define('_TC_TH_ENABLECOM','Com');
+define('_TC_TH_SUBMENU','Sub');
+define('_TC_DISP_YES','Display');
+define('_TC_DISP_NO','Not Display');
+define('_TC_CONTENT_TYPE','Page Type');
+define('_TC_TYPE_HTML','HTML Content (bb code enabled)');
+define('_TC_TYPE_TEXTWITHBB','Text Content (bb code enabled)');
+define('_TC_TYPE_PHPHTML','PHP codes (bb code disabled)');
+define('_TC_TYPE_PHPWITHBB','PHP codes (bb code enabled)');
+define('_TC_TYPE_PEARWIKI','PEAR Wiki (bb code disabled)');
+define('_TC_TYPE_PEARWIKIWITHBB','PEAR Wiki (bb code enabled)');
+define('_TC_TYPE_PUKIWIKI','PukiWiki (bb code disabled)');
+define('_TC_TYPE_PUKIWIKIWITHBB','PukiWiki (bb code enabled)');
+define('_TC_LASTMODIFIED','Last Modified');
+define('_TC_DONTUPDATELASTMODIFIED','Do not update it automatically');
+define('_TC_CONTENTTYPE','Type');
+define('_TC_ELINK','Modify');
+define('_TC_DELLINK','Cut');
+define('_TC_WRAPROOT','PageWrap\'s Base');
+define('_TC_FMT_WRAPROOTTC','Same as TinyContent module<br /> (%s) <br />');
+define('_TC_FMT_WRAPROOTPAGE','Same as wrapped page. (you can\'t use comment features)<br /> (%s) <br />use mod_rewrite if you can.<br />');
+define('_TC_FMT_WRAPBYREWRITE','use mod_rewrite (experimental)<br /> upload HTMLs and others into %s<br />Do not forget turning mod_rewrite on<br />');
+define('_TC_ERROREXIST','Error. the same filename exists');
+define('_TC_FMT_WRAPPATHPERMOFF','<span style=\'font-size:xx-small;\'>The directory for wrapping (%s) is not allowed to be written by httpd. <br />If you\'d like to upload or delete files via HTTP, turn the writing permission on.<br />I recommend to upload or delete files only via ftp for security reason, thus the writing permission of the directory should be still off.</span>');
+define('_TC_FMT_WRAPPATHPERMON','<span style=\'font-size:xx-small;\'>I don\'t recommend you to upload via HTTP. Try to upload the files for wrapping via ftp, if you can.</span>');
+define('_TC_ALTER_TABLE','Alter Table');
+define('_TC_JS_CONFIRMDISCARD','Changes will be discarded. OK?');
+
+define( 'TINYCONTENT_AM_LOADED' , 1 ) ;
+
+
+//Admin Page Titles
+define("_TC_ADMINTITLE","Tiny Content");
+
+//Table Titles
+define("_TC_ADDCONTENT","Neuen Content hinzufÈen");
+define("_TC_EDITCONTENT","Content bearbeiten");
+define("_TC_ADDLINK","Link hinzufÈen");
+define("_TC_EDITLINK","Link editieren");
+define("_TC_ULFILE","Datei hochladen");
+define("_TC_SFILE","Durchsuchen");
+define("_TC_DELFILE","Datei lÔchen");
+
+//Table Data
+define("_TC_HOMEPAGE","Homepage");
+define("_TC_STORYID","ID");
+define("_TC_LINKNAME","Linkname");
+define("_TC_VISIBLE","Sichtbar");
+define("_TC_CONTENT","Content");
+define("_TC_YES","Ja");
+define("_TC_NO","Nein");
+define("_TC_URL","Datei auswçÉlen");
+define("_TC_UPLOAD","Hochladen");
+
+define("_TC_LINKID","Link-ID");
+define("_TC_ACTION","Aktion");
+define("_TC_EDIT","Ändern");
+define("_TC_DELETE","LÔchen");
+
+define('_TC_DISABLECOM','Kommentare deaktivieren');
+define('_TC_DBUPDATED','Datenbank erfolgreich aktualisiert!');
+define('_TC_ERRORINSERT','Fehler beim Aktualisieren der Datenbank!');
+define('_TC_RUSUREDEL','Diesen Content wirklich lÔchen?');
+define('_TC_RUSUREDELF','Diese Datei wirklich lÔchen?');
+define('_TC_UPLOADED','Datei erfolgreich hochgeladen!');
+define('_TC_FDELETED','Datei erfolgreich gelÔcht!');
+define('_TC_ERRORUPL','Fehler beim Hochladen der Datei!');
+define('_TC_PERMERROR','ERROR: cannot access file directory. Please chmod the content directory with value 777!');
+
+// Added in v1.4
+define('_TC_DISABLEBREAKS','Linebreak Conversion deaktivieren (Wichtig bei HTML Code!)');
+define('_TC_SUBMENU','Submenu');
+
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/german/modinfo.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/german/modinfo.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/german/modinfo.php	(revision 405)
@@ -0,0 +1,92 @@
+<?php
+
+if( defined( 'FOR_XOOPS_LANG_CHECKER' ) || ! defined( 'TINYCONTENT_MI_LOADED' ) ) {
+
+
+
+
+
+
+
+
+
+
+// Appended by Xoops Language Checker -GIJOE- in 2006-04-11 11:14:42
+define('_TC_MD_ADMENU_MYTPLSADMIN','Templates');
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-08-27 16:00:21
+define('_MI_TC_BDESC1','Builds the navigation');
+define('_MI_TC_BDESC2','Show a content as a block. [summary] tag valid');
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-05-11 05:12:33
+define('_MI_COMMON_HTMLHEADER','Common HTML headers');
+define('_MI_COMMON_HTMLHEADER_DESC','Check if xoops_module_header exists in your theme');
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-04-20 05:52:50
+define('_MI_DISPLAY_PAGENAV_PERSUB','Divide by submenu');
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-04-13 05:53:24
+define('_MI_HEADER_TAREA_HEIGHT','Height of TextArea for HTML header');
+define('_MI_HEADER_TAREA_HEIGHT_DESC','');
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-02-19 08:26:10
+define('_MI_MODULESLESS_DIR','Name of the directory with modules/less mode');
+define('_MI_MODULESLESS_DIR_DESC','experimental implementation. you should add some specific sentences into XOOPS_ROOT_PATH/.htaccess<br />leave blank normally');
+define('_MI_USE_TAF_MODULE','User "Tell a Friend" module');
+
+// Appended by Xoops Language Checker -GIJOE- in 2004-06-18 15:39:55
+define('_MI_TC_BNAME2','TinyD %s Content');
+define('_MI_SPACE2NBSP','doubled space is changed as space+&amp;nbsp; (when linebreak on)');
+
+// Appended by Xoops Language Checker -GIJOE- in 2004-06-02 17:58:47
+define('_TC_MD_ADMENU_MYBLOCKSADMIN','Blocks/Groups');
+define('_MI_DISPLAY_PRINT_ICON','Displays icon of "Printer friendly"');
+define('_MI_DISPLAY_FRIEND_ICON','Displays icon of "Tell a friend"');
+define('_MI_DISPLAY_PAGENAV','Page Navigation');
+define('_MI_DISPLAY_PAGENAV_NONE','Not display');
+define('_MI_DISPLAY_PAGENAV_DISP','All of visible contents');
+define('_MI_DISPLAY_PAGENAV_SUB','Only about submenu contents');
+define('_MI_NAVBLOCK_TARGET','Target for tinycontent block');
+define('_MI_NAVBLOCK_TARGET_DISP','Titles of all of visible contents');
+define('_MI_NAVBLOCK_TARGET_SUB','Titles of only about submenu contents');
+
+// Appended by Xoops Language Checker -GIJOE- in 2004-05-06 09:53:53
+define('_MI_TAREA_WIDTH','Width of textarea');
+define('_MI_TAREA_WIDTH_DESC','');
+define('_MI_TAREA_HEIGHT','Height of textarea');
+define('_MI_TAREA_HEIGHT_DESC','');
+define('_MI_FORCE_MOD_REWRITE','use mod_rewrite with whole of this module');
+define('_MI_FORCE_MOD_REWRITE_DESC','Don\'t forget turning mod_rewrite on. eg) rename .htaccess.rewrite to .htaccess');
+
+define( 'TINYCONTENT_MI_LOADED' , 1 ) ;
+
+
+// Module Info Tiny Content
+
+// The name of this module
+define("_MI_TINYCONTENT_NAME","TinyD");
+
+// A brief description of this module
+define("_MI_TINYCONTENT_DESC","Content pflegen auf die einfachste Art.");
+
+// Name for Menu Block
+define("_MI_TC_BNAME1","Tiny Content Menü");
+
+// Admin Menu
+define("_TC_MD_ADMENU1","Neuen Content hinzufÈen");
+define("_TC_MD_ADMENU2","Link hinzufÈen");
+define("_TC_MD_ADMENU3","Content bearbeiten/lÔchen");
+
+// WYSIWYG Defines for v1.4
+define('_MI_WYSIWYG','Wysiwyg Editor benutzen?');
+define('_MI_WYSIWYG_DESC','');
+
+//***********************************************************************//
+// No language config below!!! Do not change this!!!                     //
+//***********************************************************************//
+
+define("_MI_TINYCONTENT_PREFIX", "tinycontent");
+define("_MI_DIR_NAME", "tinycontent");
+
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/.htaccess
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/.htaccess	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/.htaccess	(revision 405)
@@ -0,0 +1,2 @@
+order deny,allow
+deny from all
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/nederlands/modinfo.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/nederlands/modinfo.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/nederlands/modinfo.php	(revision 405)
@@ -0,0 +1,93 @@
+<?php
+
+if( defined( 'FOR_XOOPS_LANG_CHECKER' ) || ! defined( 'TINYCONTENT_MI_LOADED' ) ) {
+
+
+
+
+
+
+
+
+
+
+// Appended by Xoops Language Checker -GIJOE- in 2006-04-11 11:14:41
+define('_TC_MD_ADMENU_MYTPLSADMIN','Templates');
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-08-27 16:00:20
+define('_MI_TC_BDESC1','Builds the navigation');
+define('_MI_TC_BDESC2','Show a content as a block. [summary] tag valid');
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-05-11 05:12:33
+define('_MI_COMMON_HTMLHEADER','Common HTML headers');
+define('_MI_COMMON_HTMLHEADER_DESC','Check if xoops_module_header exists in your theme');
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-04-20 05:52:50
+define('_MI_DISPLAY_PAGENAV_PERSUB','Divide by submenu');
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-04-13 05:53:24
+define('_MI_HEADER_TAREA_HEIGHT','Height of TextArea for HTML header');
+define('_MI_HEADER_TAREA_HEIGHT_DESC','');
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-02-19 08:26:11
+define('_MI_MODULESLESS_DIR','Name of the directory with modules/less mode');
+define('_MI_MODULESLESS_DIR_DESC','experimental implementation. you should add some specific sentences into XOOPS_ROOT_PATH/.htaccess<br />leave blank normally');
+define('_MI_USE_TAF_MODULE','User "Tell a Friend" module');
+
+// Appended by Xoops Language Checker -GIJOE- in 2004-06-18 15:39:55
+define('_MI_TC_BNAME2','TinyD %s Content');
+define('_MI_SPACE2NBSP','doubled space is changed as space+&amp;nbsp; (when linebreak on)');
+
+// Appended by Xoops Language Checker -GIJOE- in 2004-06-02 17:58:48
+define('_TC_MD_ADMENU_MYBLOCKSADMIN','Blocks/Groups');
+define('_MI_DISPLAY_PRINT_ICON','Displays icon of "Printer friendly"');
+define('_MI_DISPLAY_FRIEND_ICON','Displays icon of "Tell a friend"');
+define('_MI_DISPLAY_PAGENAV','Page Navigation');
+define('_MI_DISPLAY_PAGENAV_NONE','Not display');
+define('_MI_DISPLAY_PAGENAV_DISP','All of visible contents');
+define('_MI_DISPLAY_PAGENAV_SUB','Only about submenu contents');
+define('_MI_NAVBLOCK_TARGET','Target for tinycontent block');
+define('_MI_NAVBLOCK_TARGET_DISP','Titles of all of visible contents');
+define('_MI_NAVBLOCK_TARGET_SUB','Titles of only about submenu contents');
+
+// Appended by Xoops Language Checker -GIJOE- in 2004-05-06 09:53:54
+define('_MI_TAREA_WIDTH','Width of textarea');
+define('_MI_TAREA_WIDTH_DESC','');
+define('_MI_TAREA_HEIGHT','Height of textarea');
+define('_MI_TAREA_HEIGHT_DESC','');
+define('_MI_FORCE_MOD_REWRITE','use mod_rewrite with whole of this module');
+define('_MI_FORCE_MOD_REWRITE_DESC','Don\'t forget turning mod_rewrite on. eg) rename .htaccess.rewrite to .htaccess');
+
+define( 'TINYCONTENT_MI_LOADED' , 1 ) ;
+
+
+// Module Info Tiny_Event
+
+// The name of this module
+define("_MI_TINYCONTENT_NAME","TinyD");
+
+// A brief description of this module
+define("_MI_TINYCONTENT_DESC","Creating content as easy as it can be.");
+
+// Name for Menu Block
+define("_MI_TC_BNAME1","Tiny Content Menu");
+
+// Admin Menu
+define("_TC_MD_ADMENU1","Content toevoegen");
+define("_TC_MD_ADMENU2","PageWrap toevoegen");
+define("_TC_MD_ADMENU3","Content wijzigen/verwijderen");
+
+// WYSIWYG Defines for v1.4
+define('_MI_WYSIWYG',' Use Wysiwyg Editor?');
+define('_MI_WYSIWYG_DESC','');
+
+//***********************************************************************//
+// No language config below!!! Do not change this!!!                     //
+//***********************************************************************//
+
+define("_MI_TINYCONTENT_PREFIX", "tinycontent");
+define("_MI_DIR_NAME", "tinycontent");
+
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/nederlands/main.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/nederlands/main.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/nederlands/main.php	(revision 405)
@@ -0,0 +1,44 @@
+<?php
+
+if( defined( 'FOR_XOOPS_LANG_CHECKER' ) || ! defined( 'TINYCONTENT_MB_LOADED' ) ) {
+
+
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-04-19 18:26:41
+define('_TC_FMT_DEFAULT_COMMENT_TITLE','Re: %s');
+
+// Appended by Xoops Language Checker -GIJOE- in 2004-06-02 17:58:48
+define('_TC_NEXTPAGE','Next');
+define('_TC_PREVPAGE','Prev');
+define('_TC_TOPOFCONTENTS','Top of contents');
+
+define( 'TINYCONTENT_MB_LOADED' , 1 ) ;
+
+define('_TC_FILENOTFOUND','File not found! Please check the URL!');
+define("_TC_PRINTERFRIENDLY","Printer Friendly Page");
+define("_TC_SENDSTORY","Send this Story to a Friend");
+
+// whether parameter for "mailto:" is already rawurlencoded
+define("_TC_DONE_MAILTOENCODE" , false ) ;
+
+// %s is your site name. for single byte languages (ignored when _TC_DONE_MAILTOENCODE is true)
+define("_TC_INTARTICLE","Interesting Article at %s");
+define("_TC_INTARTFOUND","Here is an interesting article I have found at %s");
+
+// for multibyte languages (ignored when _TC_DONE_MAILTOENCODE is false)
+define("_TC_MB_INTARTICLE","" ) ;
+define("_TC_MB_INTARTFOUND","" ) ;
+
+// %s represents your site name
+define("_TC_THISCOMESFROM","This article comes from %s");
+define("_TC_URLFORSTORY","The URL for this story is:");
+}
+
+if( ! defined( 'FOR_XOOPS_LANG_CHECKER' ) && ! function_exists( 'tc_convert_wrap_to_ie' ) ) {
+	function tc_convert_wrap_to_ie( $str ) {
+		return $str ;
+	}
+}
+
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/nederlands/admin.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/nederlands/admin.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/language/nederlands/admin.php	(revision 405)
@@ -0,0 +1,105 @@
+<?php
+
+if( defined( 'FOR_XOOPS_LANG_CHECKER' ) || ! defined( 'TINYCONTENT_AM_LOADED' ) ) {
+
+
+
+
+
+
+// Appended by Xoops Language Checker -GIJOE- in 2006-04-11 11:14:42
+define('_TC_UPDATE_WRAP_CONTENTS','Update wrapped contents for searching');
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-04-13 05:53:24
+define('_TC_HTML_HEADER','HTML header');
+define('_TC_CHECKED_ITEMS_ARE','Checked records are:');
+define('_TC_BUTTON_MOVETO','Export(Move)');
+define('_TC_CREATED','Created');
+define('_TC_SAVEAS','Save as');
+
+// Appended by Xoops Language Checker -GIJOE- in 2005-02-11 18:59:09
+define('_TC_TYPE_HTMLNOBB','HTML Content (bb code disabled)');
+define('_TC_TYPE_TEXTNOBB','Text Content (bb code disabled)');
+
+// Appended by Xoops Language Checker -GIJOE- in 2004-06-18 15:39:55
+define('_TC_FMT_WRAPCHANGESRCHREF','rewrite attributes of html (experimental)<br /> this option rewrites relative links to absolute links.<br />This probably mis-recognizes sentences looks like HTML source<br />');
+
+// Appended by Xoops Language Checker -GIJOE- in 2004-05-06 09:53:54
+define('_TC_SPAWLANG','en');
+define('_TC_ULFILE','Upload File');
+define('_TC_SFILE','Search');
+define('_TC_DELFILE','Delete File');
+define('_TC_STORYID','ID');
+define('_TC_TH_VISIBLE','Vis');
+define('_TC_ENABLECOM','Comments enabled');
+define('_TC_TH_ENABLECOM','Com');
+define('_TC_UPLOAD','Upload');
+define('_TC_TH_SUBMENU','Sub');
+define('_TC_DISP_YES','Display');
+define('_TC_DISP_NO','Not Display');
+define('_TC_CONTENT_TYPE','Page Type');
+define('_TC_TYPE_HTML','HTML Content (bb code enabled)');
+define('_TC_TYPE_TEXTWITHBB','Text Content (bb code enabled)');
+define('_TC_TYPE_PHPHTML','PHP codes (bb code disabled)');
+define('_TC_TYPE_PHPWITHBB','PHP codes (bb code enabled)');
+define('_TC_TYPE_PEARWIKI','PEAR Wiki (bb code disabled)');
+define('_TC_TYPE_PEARWIKIWITHBB','PEAR Wiki (bb code enabled)');
+define('_TC_TYPE_PUKIWIKI','PukiWiki (bb code disabled)');
+define('_TC_TYPE_PUKIWIKIWITHBB','PukiWiki (bb code enabled)');
+define('_TC_LASTMODIFIED','Last Modified');
+define('_TC_DONTUPDATELASTMODIFIED','Do not update it automatically');
+define('_TC_CONTENTTYPE','Type');
+define('_TC_ELINK','Modify');
+define('_TC_DELLINK','Cut');
+define('_TC_WRAPROOT','PageWrap\'s Base');
+define('_TC_FMT_WRAPROOTTC','Same as TinyContent module<br /> (%s) <br />');
+define('_TC_FMT_WRAPROOTPAGE','Same as wrapped page. (you can\'t use comment features)<br /> (%s) <br />use mod_rewrite if you can.<br />');
+define('_TC_FMT_WRAPBYREWRITE','use mod_rewrite (experimental)<br /> upload HTMLs and others into %s<br />Do not forget turning mod_rewrite on<br />');
+define('_TC_DISABLECOM','Disable comments');
+define('_TC_RUSUREDEL','Are you sure you want to delete this content? <br />All comments linked to the content will be removed');
+define('_TC_RUSUREDELF','Are you sure you want to delete this file?');
+define('_TC_UPLOADED','File Uploaded Successfully!');
+define('_TC_FDELETED','File Deleted Successfully!');
+define('_TC_ERROREXIST','Error. the same filename exists');
+define('_TC_ERRORUPL','Error while uploading file!');
+define('_TC_FMT_WRAPPATHPERMOFF','<span style=\'font-size:xx-small;\'>The directory for wrapping (%s) is not allowed to be written by httpd. <br />If you\'d like to upload or delete files via HTTP, turn the writing permission on.<br />I recommend to upload or delete files only via ftp for security reason, thus the writing permission of the directory should be still off.</span>');
+define('_TC_FMT_WRAPPATHPERMON','<span style=\'font-size:xx-small;\'>I don\'t recommend you to upload via HTTP. Try to upload the files for wrapping via ftp, if you can.</span>');
+define('_TC_ALTER_TABLE','Alter Table');
+define('_TC_JS_CONFIRMDISCARD','Changes will be discarded. OK?');
+
+define( 'TINYCONTENT_AM_LOADED' , 1 ) ;
+
+
+//Admin Page Titles
+define("_TC_ADMINTITLE","Tiny Content");
+
+//Table Titles
+define("_TC_ADDCONTENT","Nieuwe content toevoegen");
+define("_TC_EDITCONTENT","Content wijzigen");
+define("_TC_ADDLINK","Link toevoegen");
+define("_TC_EDITLINK","Link wijzigen");
+
+//Table Data
+define("_TC_HOMEPAGE","Homepage");
+define("_TC_LINKNAME","Linktitel");
+define("_TC_VISIBLE","Zichtbaar");
+define("_TC_CONTENT","Content");
+define("_TC_YES","Ja");
+define("_TC_NO","Nee");
+define("_TC_URL","URL");
+
+define("_TC_LINKID","Link-ID");
+define("_TC_ACTION","Actie");
+define("_TC_EDIT","Wijzigen");
+define("_TC_DELETE","Verwijderen");
+
+define('_TC_DBUPDATED','Database succesvol bijgewerkt!');
+define('_TC_ERRORINSERT','Fout bij het bijwerken van de database!');
+
+// Added in v1.4
+define('_TC_DISABLEBREAKS','Disable Linebreak Conversion (Activate when using HTML)');
+define('_TC_SUBMENU','Submenu');
+
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/include/preferences.inc.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/include/preferences.inc.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/include/preferences.inc.php	(revision 405)
@@ -0,0 +1,458 @@
+<?php
+// $Id: main.php,v 1.23.20.1 2004/07/29 18:22:38 mithyt2 Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+
+$config_handler =& xoops_gethandler('config');
+
+if ( !is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid()) ) {
+  exit("Access Denied");
+} else {
+  $op = 'list';
+  if ( !empty($_POST['op']) ) { $op = $_POST['op']; }
+  if (isset($_GET['op'])) {
+    $op = trim($_GET['op']);
+  }
+  if (isset($_GET['confcat_id'])) {
+    $confcat_id = intval($_GET['confcat_id']);
+  }
+/*  if ($op == 'list') {
+    $confcat_handler =& xoops_gethandler('configcategory');
+    $confcats =& $confcat_handler->getObjects();
+    $catcount = count($confcats);
+    xoops_cp_header();
+    echo '<h4 style="text-align:left">'._MD_AM_SITEPREF.'</h4><ul>';
+    for ($i = 0; $i < $catcount; $i++) {
+      echo '<li>'.constant($confcats[$i]->getVar('confcat_name')).' [<a href="admin.php?fct=preferences&amp;op=show&amp;confcat_id='.$confcats[$i]->getVar('confcat_id').'">'._EDIT.'</a>]</li>';
+    }
+    echo '</ul>';
+    xoops_cp_footer();
+    exit();
+  } */
+
+/*   if ($op == 'show') {
+    if (empty($confcat_id)) {
+      $confcat_id = 1;
+    }
+    $confcat_handler =& xoops_gethandler('configcategory');
+    $confcat =& $confcat_handler->get($confcat_id);
+    if (!is_object($confcat)) {
+      redirect_header('admin.php?fct=preferences', 1);
+    }
+    include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
+    include_once XOOPS_ROOT_PATH.'/class/xoopslists.php';
+    $form = new XoopsThemeForm(constant($confcat->getVar('confcat_name')), 'pref_form', 'admin.php?fct=preferences');
+    $config_handler =& xoops_gethandler('config');
+    $criteria = new CriteriaCompo();
+    $criteria->add(new Criteria('conf_modid', 0));
+    $criteria->add(new Criteria('conf_catid', $confcat_id));
+    $config =& $config_handler->getConfigs($criteria);
+    $confcount = count($config);
+    for ($i = 0; $i < $confcount; $i++) {
+      $title = (!defined($config[$i]->getVar('conf_desc')) || constant($config[$i]->getVar('conf_desc')) == '') ? constant($config[$i]->getVar('conf_title')) : constant($config[$i]->getVar('conf_title')).'<br /><br /><span style="font-weight:normal;">'.constant($config[$i]->getVar('conf_desc')).'</span>';
+      switch ($config[$i]->getVar('conf_formtype')) {
+      case 'textarea':
+        $myts =& MyTextSanitizer::getInstance();
+        if ($config[$i]->getVar('conf_valuetype') == 'array') {
+          // this is exceptional.. only when value type is arrayneed a smarter way for this
+          $ele = ($config[$i]->getVar('conf_value') != '') ? new XoopsFormTextArea($title, $config[$i]->getVar('conf_name'), $myts->htmlspecialchars(implode('|', $config[$i]->getConfValueForOutput())), 5, 50) : new XoopsFormTextArea($title, $config[$i]->getVar('conf_name'), '', 5, 50);
+        } else {
+          $ele = new XoopsFormTextArea($title, $config[$i]->getVar('conf_name'), $myts->htmlspecialchars($config[$i]->getConfValueForOutput()), 5, 50);
+        }
+        break;
+      case 'select':
+        $ele = new XoopsFormSelect($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput());
+        $options =& $config_handler->getConfigOptions(new Criteria('conf_id', $config[$i]->getVar('conf_id')));
+        $opcount = count($options);
+        for ($j = 0; $j < $opcount; $j++) {
+          $optval = defined($options[$j]->getVar('confop_value')) ? constant($options[$j]->getVar('confop_value')) : $options[$j]->getVar('confop_value');
+          $optkey = defined($options[$j]->getVar('confop_name')) ? constant($options[$j]->getVar('confop_name')) : $options[$j]->getVar('confop_name');
+          $ele->addOption($optval, $optkey);
+        }
+        break;
+      case 'select_multi':
+        $ele = new XoopsFormSelect($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput(), 5, true);
+        $options =& $config_handler->getConfigOptions(new Criteria('conf_id', $config[$i]->getVar('conf_id')));
+        $opcount = count($options);
+        for ($j = 0; $j < $opcount; $j++) {
+          $optval = defined($options[$j]->getVar('confop_value')) ? constant($options[$j]->getVar('confop_value')) : $options[$j]->getVar('confop_value');
+          $optkey = defined($options[$j]->getVar('confop_name')) ? constant($options[$j]->getVar('confop_name')) : $options[$j]->getVar('confop_name');
+          $ele->addOption($optval, $optkey);
+        }
+        break;
+      case 'yesno':
+        $ele = new XoopsFormRadioYN($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput(), _YES, _NO);
+        break;
+      case 'theme':
+      case 'theme_multi':
+        $ele = ($config[$i]->getVar('conf_formtype') != 'theme_multi') ? new XoopsFormSelect($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput()) : new XoopsFormSelect($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput(), 5, true);
+        $handle = opendir(XOOPS_THEME_PATH.'/');
+        $dirlist = array();
+        while (false !== ($file = readdir($handle))) {
+          if (is_dir(XOOPS_THEME_PATH.'/'.$file) && !preg_match("/^[.]{1,2}$/",$file) && strtolower($file) != 'cvs') {
+            $dirlist[$file]=$file;
+          }
+        }
+        closedir($handle);
+        if (!empty($dirlist)) {
+          asort($dirlist);
+          $ele->addOptionArray($dirlist);
+        }
+        //$themeset_handler =& xoops_gethandler('themeset');
+        //$themesetlist =& $themeset_handler->getList();
+        //asort($themesetlist);
+        //foreach ($themesetlist as $key => $name) {
+        //  $ele->addOption($key, $name.' ('._MD_AM_THEMESET.')');
+        //}
+        // old theme value is used to determine whether to update cache or not. kind of dirty way
+        $form->addElement(new XoopsFormHidden('_old_theme', $config[$i]->getConfValueForOutput()));
+        break;
+      case 'tplset':
+        $ele = new XoopsFormSelect($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput());
+        $tplset_handler =& xoops_gethandler('tplset');
+        $tplsetlist =& $tplset_handler->getList();
+        asort($tplsetlist);
+        foreach ($tplsetlist as $key => $name) {
+          $ele->addOption($key, $name);
+        }
+        // old theme value is used to determine whether to update cache or not. kind of dirty way
+        $form->addElement(new XoopsFormHidden('_old_theme', $config[$i]->getConfValueForOutput()));
+        break;
+      case 'timezone':
+        $ele = new XoopsFormSelectTimezone($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput());
+        break;
+      case 'language':
+        $ele = new XoopsFormSelectLang($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput());
+        break;
+      case 'startpage':
+        $ele = new XoopsFormSelect($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput());
+        $module_handler =& xoops_gethandler('module');
+        $criteria = new CriteriaCompo(new Criteria('hasmain', 1));
+        $criteria->add(new Criteria('isactive', 1));
+        $moduleslist =& $module_handler->getList($criteria, true);
+        $moduleslist['--'] = _MD_AM_NONE;
+        $ele->addOptionArray($moduleslist);
+        break;
+      case 'group':
+        $ele = new XoopsFormSelectGroup($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput(), 1, false);
+        break;
+      case 'group_multi':
+        $ele = new XoopsFormSelectGroup($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput(), 5, true);
+        break;
+      // RMV-NOTIFY - added 'user' and 'user_multi'
+      case 'user':
+        $ele = new XoopsFormSelectUser($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput(), 1, false);
+        break;
+      case 'user_multi':
+        $ele = new XoopsFormSelectUser($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput(), 5, true);
+        break;
+      case 'module_cache':
+        $module_handler =& xoops_gethandler('module');
+        $modules =& $module_handler->getObjects(new Criteria('hasmain', 1), true);
+        $currrent_val = $config[$i]->getConfValueForOutput();
+        $cache_options = array('0' => _NOCACHE, '30' => sprintf(_SECONDS, 30), '60' => _MINUTE, '300' => sprintf(_MINUTES, 5), '1800' => sprintf(_MINUTES, 30), '3600' => _HOUR, '18000' => sprintf(_HOURS, 5), '86400' => _DAY, '259200' => sprintf(_DAYS, 3), '604800' => _WEEK);
+        if (count($modules) > 0) {
+          $ele = new XoopsFormElementTray($title, '<br />');
+          foreach (array_keys($modules) as $mid) {
+            $c_val = isset($currrent_val[$mid]) ? intval($currrent_val[$mid]) : null;
+            $selform = new XoopsFormSelect($modules[$mid]->getVar('name'), $config[$i]->getVar('conf_name')."[$mid]", $c_val);
+            $selform->addOptionArray($cache_options);
+            $ele->addElement($selform);
+            unset($selform);
+          }
+        } else {
+          $ele = new XoopsFormLabel($title, _MD_AM_NOMODULE);
+        }
+        break;
+      case 'site_cache':
+        $ele = new XoopsFormSelect($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput());
+        $ele->addOptionArray(array('0' => _NOCACHE, '30' => sprintf(_SECONDS, 30), '60' => _MINUTE, '300' => sprintf(_MINUTES, 5), '1800' => sprintf(_MINUTES, 30), '3600' => _HOUR, '18000' => sprintf(_HOURS, 5), '86400' => _DAY, '259200' => sprintf(_DAYS, 3), '604800' => _WEEK));
+        break;
+      case 'password':
+        $myts =& MyTextSanitizer::getInstance();
+        $ele = new XoopsFormPassword($title, $config[$i]->getVar('conf_name'), 50, 255, $myts->htmlspecialchars($config[$i]->getConfValueForOutput()));
+        break;
+      case 'textbox':
+      default:
+        $myts =& MyTextSanitizer::getInstance();
+        $ele = new XoopsFormText($title, $config[$i]->getVar('conf_name'), 50, 255, $myts->htmlspecialchars($config[$i]->getConfValueForOutput()));
+        break;
+      }
+      $hidden = new XoopsFormHidden('conf_ids[]', $config[$i]->getVar('conf_id'));
+      $form->addElement($ele);
+      $form->addElement($hidden);
+      unset($ele);
+      unset($hidden);
+    }
+    $form->addElement(new XoopsFormHidden('op', 'save'));
+    $xoopsGTicket->addTicketXoopsFormElement( $form , __LINE__ ) ;
+    $form->addElement(new XoopsFormButton('', 'button', _GO, 'submit'));
+    xoops_cp_header();
+    echo '<a href="admin.php?fct=preferences">'. _MD_AM_PREFMAIN .'</a>&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;'.constant($confcat->getVar('confcat_name')).'<br /><br />';
+    $form->display();
+    xoops_cp_footer();
+    exit();
+  } */
+
+  if ($op == 'showmod') {
+    $mod = isset($_GET['mod']) ? intval($_GET['mod']) : 0;
+    if (empty($mod)) {
+      header('Location: admin.php?fct=preferences');
+      exit();
+    }
+    $config =& $config_handler->getConfigs(new Criteria('conf_modid', $mod));
+    $count = count($config);
+    if ($count < 1) {
+      redirect_header('admin.php?fct=preferences', 1);
+    }
+    include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
+    $form = new XoopsThemeForm(_MD_AM_MODCONFIG, 'pref_form', 'admin.php?fct=preferences');
+    $module_handler =& xoops_gethandler('module');
+    $module =& $module_handler->get($mod);
+    if (file_exists(XOOPS_ROOT_PATH.'/modules/'.$module->getVar('dirname').'/language/'.$xoopsConfig['language'].'/modinfo.php')) {
+      include_once XOOPS_ROOT_PATH.'/modules/'.$module->getVar('dirname').'/language/'.$xoopsConfig['language'].'/modinfo.php';
+    }
+
+    // if has comments feature, need comment lang file
+    if ($module->getVar('hascomments') == 1) {
+      include_once XOOPS_ROOT_PATH.'/language/'.$xoopsConfig['language'].'/comment.php';
+    }
+    // RMV-NOTIFY
+    // if has notification feature, need notification lang file
+    if ($module->getVar('hasnotification') == 1) {
+      include_once XOOPS_ROOT_PATH.'/language/'.$xoopsConfig['language'].'/notification.php';
+    }
+
+    $modname = $module->getVar('name');
+	$button_tray = new XoopsFormElementTray("");
+    if ($module->getInfo('adminindex')) {
+//      $form->addElement(new XoopsFormHidden('redirect', XOOPS_URL.'/modules/'.$module->getVar('dirname').'/'.$module->getInfo('adminindex')));
+        $button_tray->addElement(new XoopsFormHidden('redirect', XOOPS_URL.'/modules/'.$module->getVar('dirname').'/admin/admin.php?fct=preferences&op=showmod&mod='.$module->getVar('mid'))); // GIJ Patch
+    }
+    for ($i = 0; $i < $count; $i++) {
+      $title4tray = (!defined($config[$i]->getVar('conf_desc')) || constant($config[$i]->getVar('conf_desc')) == '') ? constant($config[$i]->getVar('conf_title')) : constant($config[$i]->getVar('conf_title')).'<br /><br /><span style="font-weight:normal;">'.constant($config[$i]->getVar('conf_desc')).'</span>'; // GIJ
+      $title = '' ; // GIJ
+      switch ($config[$i]->getVar('conf_formtype')) {
+      case 'textarea':
+        $myts =& MyTextSanitizer::getInstance();
+        if ($config[$i]->getVar('conf_valuetype') == 'array') {
+          // this is exceptional.. only when value type is arrayneed a smarter way for this
+          $ele = ($config[$i]->getVar('conf_value') != '') ? new XoopsFormTextArea($title, $config[$i]->getVar('conf_name'), $myts->htmlspecialchars(implode('|', $config[$i]->getConfValueForOutput())), 5, 50) : new XoopsFormTextArea($title, $config[$i]->getVar('conf_name'), '', 5, 50);
+        } else {
+          $ele = new XoopsFormTextArea($title, $config[$i]->getVar('conf_name'), $myts->htmlspecialchars($config[$i]->getConfValueForOutput()), 5, 50);
+        }
+        break;
+      case 'select':
+        $ele = new XoopsFormSelect($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput());
+        $options =& $config_handler->getConfigOptions(new Criteria('conf_id', $config[$i]->getVar('conf_id')));
+        $opcount = count($options);
+        for ($j = 0; $j < $opcount; $j++) {
+          $optval = defined($options[$j]->getVar('confop_value')) ? constant($options[$j]->getVar('confop_value')) : $options[$j]->getVar('confop_value');
+          $optkey = defined($options[$j]->getVar('confop_name')) ? constant($options[$j]->getVar('confop_name')) : $options[$j]->getVar('confop_name');
+          $ele->addOption($optval, $optkey);
+        }
+        break;
+      case 'select_multi':
+        $ele = new XoopsFormSelect($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput(), 5, true);
+        $options =& $config_handler->getConfigOptions(new Criteria('conf_id', $config[$i]->getVar('conf_id')));
+        $opcount = count($options);
+        for ($j = 0; $j < $opcount; $j++) {
+          $optval = defined($options[$j]->getVar('confop_value')) ? constant($options[$j]->getVar('confop_value')) : $options[$j]->getVar('confop_value');
+          $optkey = defined($options[$j]->getVar('confop_name')) ? constant($options[$j]->getVar('confop_name')) : $options[$j]->getVar('confop_name');
+          $ele->addOption($optval, $optkey);
+        }
+        break;
+      case 'yesno':
+        $ele = new XoopsFormRadioYN($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput(), _YES, _NO);
+        break;
+      case 'group':
+        include_once XOOPS_ROOT_PATH.'/class/xoopslists.php';
+        $ele = new XoopsFormSelectGroup($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput(), 1, false);
+        break;
+      case 'group_multi':
+        include_once XOOPS_ROOT_PATH.'/class/xoopslists.php';
+        $ele = new XoopsFormSelectGroup($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput(), 5, true);
+        break;
+      // RMV-NOTIFY: added 'user' and 'user_multi'
+      case 'user':
+        include_once XOOPS_ROOT_PATH.'/class/xoopslists.php';
+        $ele = new XoopsFormSelectUser($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput(), 1, false);
+        break;
+      case 'user_multi':
+        include_once XOOPS_ROOT_PATH.'/class/xoopslists.php';
+        $ele = new XoopsFormSelectUser($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput(), 5, true);
+        break;
+      case 'password':
+        $myts =& MyTextSanitizer::getInstance();
+        $ele = new XoopsFormPassword($title, $config[$i]->getVar('conf_name'), 50, 255, $myts->htmlspecialchars($config[$i]->getConfValueForOutput()));
+        break;
+      case 'textbox':
+      default:
+        $myts =& MyTextSanitizer::getInstance();
+        $ele = new XoopsFormText($title, $config[$i]->getVar('conf_name'), 50, 255, $myts->htmlspecialchars($config[$i]->getConfValueForOutput()));
+        break;
+      }
+      $hidden = new XoopsFormHidden('conf_ids[]', $config[$i]->getVar('conf_id'));
+      $ele_tray = new XoopsFormElementTray( $title4tray , '' ) ;
+      $ele_tray->addElement($ele);
+      $ele_tray->addElement($hidden);
+      $form->addElement( $ele_tray ) ;
+      unset($ele_tray);
+      unset($ele);
+      unset($hidden);
+    }
+    $button_tray->addElement(new XoopsFormHidden('op', 'save'));
+    $xoopsGTicket->addTicketXoopsFormElement( $button_tray , __LINE__ , 1800 , 'mymenu' ) ;
+    $button_tray->addElement(new XoopsFormButton('', 'button', _GO, 'submit'));
+    $form->addElement( $button_tray ) ;
+    xoops_cp_header();
+	// GIJ patch start
+	include( './mymenu.php' ) ;
+	echo "<h3 style='text-align:left;'>".$module->getvar('name').' &nbsp; '._PREFERENCES."</h3>\n" ;
+	// GIJ patch end
+    $form->display();
+    xoops_cp_footer();
+    exit();
+  }
+
+  if ($op == 'save') {
+    //if ( !admin_refcheck("/modules/$admin_mydirname/admin/") ) {
+    //  exit('Invalid referer');
+    //}
+    if ( ! $xoopsGTicket->check( true , 'mymenu' ) ) {
+      redirect_header(XOOPS_URL.'/',3,$xoopsGTicket->getErrors());
+    }
+    require_once(XOOPS_ROOT_PATH.'/class/template.php');
+    $xoopsTpl = new XoopsTpl();
+    $xoopsTpl->clear_all_cache();
+    // regenerate admin menu file
+    xoops_module_write_admin_menu(xoops_module_get_admin_menu());
+    if ( !empty($_POST['conf_ids']) ) { $conf_ids = $_POST['conf_ids']; }
+    $count = count($conf_ids);
+    $tpl_updated = false;
+    $theme_updated = false;
+    $startmod_updated = false;
+    $lang_updated = false;
+    if ($count > 0) {
+      for ($i = 0; $i < $count; $i++) {
+        $config =& $config_handler->getConfig($conf_ids[$i]);
+        $new_value =& $_POST[$config->getVar('conf_name')];
+        if (is_array($new_value) || $new_value != $config->getVar('conf_value')) {
+          // if language has been changed
+          if (!$lang_updated && $config->getVar('conf_catid') == XOOPS_CONF && $config->getVar('conf_name') == 'language') {
+            // regenerate admin menu file
+            $xoopsConfig['language'] = $_POST[$config->getVar('conf_name')];
+            xoops_module_write_admin_menu(xoops_module_get_admin_menu());
+            $lang_updated = true;
+          }
+
+          // if default theme has been changed
+          if (!$theme_updated && $config->getVar('conf_catid') == XOOPS_CONF && $config->getVar('conf_name') == 'theme_set') {
+            $member_handler =& xoops_gethandler('member');
+            $member_handler->updateUsersByField('theme', $_POST[$config->getVar('conf_name')]);
+            $theme_updated = true;
+          }
+
+          // if default template set has been changed
+          if (!$tpl_updated && $config->getVar('conf_catid') == XOOPS_CONF && $config->getVar('conf_name') == 'template_set') {
+            // clear cached/compiled files and regenerate them if default theme has been changed
+            if ($xoopsConfig['template_set'] != $_POST[$config->getVar('conf_name')]) {
+              $newtplset = $_POST[$config->getVar('conf_name')];
+              
+              // clear all compiled and cachedfiles
+              $xoopsTpl->clear_compiled_tpl();
+
+              // generate compiled files for the new theme
+              // block files only for now..
+              $tplfile_handler =& xoops_gethandler('tplfile');
+              $dtemplates =& $tplfile_handler->find('default', 'block');
+              $dcount = count($dtemplates);
+
+              // need to do this to pass to xoops_template_touch function
+              $GLOBALS['xoopsConfig']['template_set'] = $newtplset;
+
+              for ($i = 0; $i < $dcount; $i++) {
+                $found =& $tplfile_handler->find($newtplset, 'block', $dtemplates[$i]->getVar('tpl_refid'), null);
+                if (count($found) > 0) {
+                  // template for the new theme found, compile it
+                  xoops_template_touch($found[0]->getVar('tpl_id'));
+                } else {
+                  // not found, so compile 'default' template file
+                  xoops_template_touch($dtemplates[$i]->getVar('tpl_id'));
+                }
+              }
+
+              // generate image cache files from image binary data, save them under cache/
+              $image_handler =& xoops_gethandler('imagesetimg');
+              $imagefiles =& $image_handler->getObjects(new Criteria('tplset_name', $newtplset), true);
+              foreach (array_keys($imagefiles) as $i) {
+                if (!$fp = fopen(XOOPS_CACHE_PATH.'/'.$newtplset.'_'.$imagefiles[$i]->getVar('imgsetimg_file'), 'wb')) {
+                } else {
+                  fwrite($fp, $imagefiles[$i]->getVar('imgsetimg_body'));
+                  fclose($fp);
+                }
+              }
+            }
+            $tpl_updated = true;
+          }
+
+          // add read permission for the start module to all groups
+          if (!$startmod_updated  && $new_value != '--' && $config->getVar('conf_catid') == XOOPS_CONF && $config->getVar('conf_name') == 'startpage') {
+            $member_handler =& xoops_gethandler('member');
+            $groups =& $member_handler->getGroupList();
+            $moduleperm_handler =& xoops_gethandler('groupperm');
+            $module_handler =& xoops_gethandler('module');
+            $module =& $module_handler->getByDirname($new_value);
+            foreach ($groups as $groupid => $groupname) {
+              if (!$moduleperm_handler->checkRight('module_read', $module->getVar('mid'), $groupid)) {
+                $moduleperm_handler->addRight('module_read', $module->getVar('mid'), $groupid);
+              }
+            }
+            $startmod_updated = true;
+          }
+
+          $config->setConfValueForInput($new_value);
+          $config_handler->insertConfig($config);
+        }
+        unset($new_value);
+      }
+    }
+    /* if (!empty($_POST['use_mysession']) && $xoopsConfig['use_mysession'] == 0 && $_POST['session_name'] != '') {
+        setcookie($_POST['session_name'], session_id(), time()+(60*intval($_POST['session_expire'])), '/',  '', 0);
+    } */
+    if ( ! empty( $_POST['redirect'] ) ) {
+      redirect_header($_POST['redirect'], 2, _MD_AM_DBUPDATED);
+    } else {
+      redirect_header("admin.php?fct=preferences",2,_MD_AM_DBUPDATED);
+    }
+  }
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/include/Text_Diff.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/include/Text_Diff.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/include/Text_Diff.php	(revision 405)
@@ -0,0 +1,843 @@
+<?php
+/**
+ * Text_Diff
+ *
+ * General API for generating and formatting diffs - the differences between
+ * two sequences of strings.
+ *
+ * The PHP diff code used in this package was originally written by Geoffrey
+ * T. Dairiki and is used with his permission.
+ *
+ * $Horde: framework/Text_Diff/Diff.php,v 1.13 2005/05/26 20:26:06 selsky Exp $
+ *
+ * @package Text_Diff
+ * @author  Geoffrey T. Dairiki <dairiki@dairiki.org>
+ */
+class Text_Diff {
+
+    /**
+     * Array of changes.
+     *
+     * @var array
+     */
+    var $_edits;
+
+    /**
+     * Computes diffs between sequences of strings.
+     *
+     * @param array $from_lines  An array of strings.  Typically these are
+     *                           lines from a file.
+     * @param array $to_lines    An array of strings.
+     */
+    function Text_Diff($from_lines, $to_lines)
+    {
+        array_walk($from_lines, array($this, '_trimNewlines'));
+        array_walk($to_lines, array($this, '_trimNewlines'));
+
+        if (extension_loaded('xdiff')) {
+            $engine = &new Text_Diff_Engine_xdiff();
+        } else {
+            $engine = &new Text_Diff_Engine_native();
+        }
+
+        $this->_edits = $engine->diff($from_lines, $to_lines);
+    }
+
+    /**
+     * Returns the array of differences.
+     */
+    function getDiff()
+    {
+        return $this->_edits;
+    }
+
+    /**
+     * Computes a reversed diff.
+     *
+     * Example:
+     * <code>
+     * $diff = &new Text_Diff($lines1, $lines2);
+     * $rev = $diff->reverse();
+     * </code>
+     *
+     * @return Text_Diff  A Diff object representing the inverse of the
+     *                    original diff.  Note that we purposely don't return a
+     *                    reference here, since this essentially is a clone()
+     *                    method.
+     */
+    function reverse()
+    {
+        if (version_compare(zend_version(), '2', '>')) {
+            $rev = clone($obj);
+        } else {
+            $rev = $this;
+        }
+        $rev->_edits = array();
+        foreach ($this->_edits as $edit) {
+            $rev->_edits[] = $edit->reverse();
+        }
+        return $rev;
+    }
+
+    /**
+     * Checks for an empty diff.
+     *
+     * @return boolean  True if two sequences were identical.
+     */
+    function isEmpty()
+    {
+        foreach ($this->_edits as $edit) {
+            if (!is_a($edit, 'Text_Diff_Op_copy')) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    /**
+     * Computes the length of the Longest Common Subsequence (LCS).
+     *
+     * This is mostly for diagnostic purposes.
+     *
+     * @return integer  The length of the LCS.
+     */
+    function lcs()
+    {
+        $lcs = 0;
+        foreach ($this->_edits as $edit) {
+            if (is_a($edit, 'Text_Diff_Op_copy')) {
+                $lcs += count($edit->orig);
+            }
+        }
+        return $lcs;
+    }
+
+    /**
+     * Gets the original set of lines.
+     *
+     * This reconstructs the $from_lines parameter passed to the constructor.
+     *
+     * @return array  The original sequence of strings.
+     */
+    function getOriginal()
+    {
+        $lines = array();
+        foreach ($this->_edits as $edit) {
+            if ($edit->orig) {
+                array_splice($lines, count($lines), 0, $edit->orig);
+            }
+        }
+        return $lines;
+    }
+
+    /**
+     * Gets the final set of lines.
+     *
+     * This reconstructs the $to_lines parameter passed to the constructor.
+     *
+     * @return array  The sequence of strings.
+     */
+    function getFinal()
+    {
+        $lines = array();
+        foreach ($this->_edits as $edit) {
+            if ($edit->final) {
+                array_splice($lines, count($lines), 0, $edit->final);
+            }
+        }
+        return $lines;
+    }
+
+    /**
+     * Removes trailing newlines from a line of text. This is meant to be used
+     * with array_walk().
+     *
+     * @param string $line  The line to trim.
+     * @param integer $key  The index of the line in the array. Not used.
+     */
+    function _trimNewlines(&$line, $key)
+    {
+        $line = str_replace(array("\n", "\r"), '', $line);
+    }
+
+    /**
+     * Checks a diff for validity.
+     *
+     * This is here only for debugging purposes.
+     */
+    function _check($from_lines, $to_lines)
+    {
+        if (serialize($from_lines) != serialize($this->getOriginal())) {
+            trigger_error("Reconstructed original doesn't match", E_USER_ERROR);
+        }
+        if (serialize($to_lines) != serialize($this->getFinal())) {
+            trigger_error("Reconstructed final doesn't match", E_USER_ERROR);
+        }
+
+        $rev = $this->reverse();
+        if (serialize($to_lines) != serialize($rev->getOriginal())) {
+            trigger_error("Reversed original doesn't match", E_USER_ERROR);
+        }
+        if (serialize($from_lines) != serialize($rev->getFinal())) {
+            trigger_error("Reversed final doesn't match", E_USER_ERROR);
+        }
+
+        $prevtype = null;
+        foreach ($this->_edits as $edit) {
+            if ($prevtype == get_class($edit)) {
+                trigger_error("Edit sequence is non-optimal", E_USER_ERROR);
+            }
+            $prevtype = get_class($edit);
+        }
+
+        return true;
+    }
+
+}
+
+/**
+ * $Horde: framework/Text_Diff/Diff.php,v 1.13 2005/05/26 20:26:06 selsky Exp $
+ *
+ * @package Text_Diff
+ * @author  Geoffrey T. Dairiki <dairiki@dairiki.org>
+ */
+class Text_MappedDiff extends Text_Diff {
+
+    /**
+     * Computes a diff between sequences of strings.
+     *
+     * This can be used to compute things like case-insensitve diffs, or diffs
+     * which ignore changes in white-space.
+     *
+     * @param array $from_lines         An array of strings.
+     * @param array $to_lines           An array of strings.
+     * @param array $mapped_from_lines  This array should have the same size
+     *                                  number of elements as $from_lines.  The
+     *                                  elements in $mapped_from_lines and
+     *                                  $mapped_to_lines are what is actually
+     *                                  compared when computing the diff.
+     * @param array $mapped_to_lines    This array should have the same number
+     *                                  of elements as $to_lines.
+     */
+    function Text_MappedDiff($from_lines, $to_lines,
+                             $mapped_from_lines, $mapped_to_lines)
+    {
+        assert(count($from_lines) == count($mapped_from_lines));
+        assert(count($to_lines) == count($mapped_to_lines));
+
+        parent::Text_Diff($mapped_from_lines, $mapped_to_lines);
+
+        $xi = $yi = 0;
+        for ($i = 0; $i < count($this->_edits); $i++) {
+            $orig = &$this->_edits[$i]->orig;
+            if (is_array($orig)) {
+                $orig = array_slice($from_lines, $xi, count($orig));
+                $xi += count($orig);
+            }
+
+            $final = &$this->_edits[$i]->final;
+            if (is_array($final)) {
+                $final = array_slice($to_lines, $yi, count($final));
+                $yi += count($final);
+            }
+        }
+    }
+
+}
+
+/**
+ * Class used internally by Diff to actually compute the diffs.  This class
+ * uses the xdiff PECL package (http://pecl.php.net/package/xdiff) to compute
+ * the differences between the two input arrays.
+ *
+ * @author  Jon Parise <jon@horde.org>
+ * @package Text_Diff
+ *
+ * @access private
+ */
+class Text_Diff_Engine_xdiff {
+
+    function diff($from_lines, $to_lines)
+    {
+        /* Convert the two input arrays into strings for xdiff processing. */
+        $from_string = implode("\n", $from_lines);
+        $to_string = implode("\n", $to_lines);
+
+        /* Diff the two strings and convert the result to an array. */
+        $diff = xdiff_string_diff($from_string, $to_string, count($to_lines));
+        $diff = explode("\n", $diff);
+
+        /* Walk through the diff one line at a time.  We build the $edits
+         * array of diff operations by reading the first character of the
+         * xdiff output (which is in the "unified diff" format).
+         *
+         * Note that we don't have enough information to detect "changed"
+         * lines using this approach, so we can't add Text_Diff_Op_changed
+         * instances to the $edits array.  The result is still perfectly
+         * valid, albeit a little less descriptive and efficient. */
+        $edits = array();
+        foreach ($diff as $line) {
+            switch ($line[0]) {
+            case ' ':
+                $edits[] = &new Text_Diff_Op_copy(array(substr($line, 1)));
+                break;
+
+            case '+':
+                $edits[] = &new Text_Diff_Op_add(array(substr($line, 1)));
+                break;
+
+            case '-':
+                $edits[] = &new Text_Diff_Op_delete(array(substr($line, 1)));
+                break;
+            }
+        }
+
+        return $edits;
+    }
+
+}
+
+/**
+ * Class used internally by Diff to actually compute the diffs.  This class is
+ * implemented using native PHP code.
+ *
+ * The algorithm used here is mostly lifted from the perl module
+ * Algorithm::Diff (version 1.06) by Ned Konz, which is available at:
+ * http://www.perl.com/CPAN/authors/id/N/NE/NEDKONZ/Algorithm-Diff-1.06.zip
+ *
+ * More ideas are taken from:
+ * http://www.ics.uci.edu/~eppstein/161/960229.html
+ *
+ * Some ideas (and a bit of code) are taken from analyze.c, of GNU
+ * diffutils-2.7, which can be found at:
+ * ftp://gnudist.gnu.org/pub/gnu/diffutils/diffutils-2.7.tar.gz
+ *
+ * Some ideas (subdivision by NCHUNKS > 2, and some optimizations) are from
+ * Geoffrey T. Dairiki <dairiki@dairiki.org>. The original PHP version of this
+ * code was written by him, and is used/adapted with his permission.
+ *
+ * @author  Geoffrey T. Dairiki <dairiki@dairiki.org>
+ * @package Text_Diff
+ *
+ * @access private
+ */
+class Text_Diff_Engine_native {
+
+    function diff($from_lines, $to_lines)
+    {
+        $n_from = count($from_lines);
+        $n_to = count($to_lines);
+
+        $this->xchanged = $this->ychanged = array();
+        $this->xv = $this->yv = array();
+        $this->xind = $this->yind = array();
+        unset($this->seq);
+        unset($this->in_seq);
+        unset($this->lcs);
+
+        // Skip leading common lines.
+        for ($skip = 0; $skip < $n_from && $skip < $n_to; $skip++) {
+            if ($from_lines[$skip] != $to_lines[$skip]) {
+                break;
+            }
+            $this->xchanged[$skip] = $this->ychanged[$skip] = false;
+        }
+
+        // Skip trailing common lines.
+        $xi = $n_from; $yi = $n_to;
+        for ($endskip = 0; --$xi > $skip && --$yi > $skip; $endskip++) {
+            if ($from_lines[$xi] != $to_lines[$yi]) {
+                break;
+            }
+            $this->xchanged[$xi] = $this->ychanged[$yi] = false;
+        }
+
+        // Ignore lines which do not exist in both files.
+        for ($xi = $skip; $xi < $n_from - $endskip; $xi++) {
+            $xhash[$from_lines[$xi]] = 1;
+        }
+        for ($yi = $skip; $yi < $n_to - $endskip; $yi++) {
+            $line = $to_lines[$yi];
+            if (($this->ychanged[$yi] = empty($xhash[$line]))) {
+                continue;
+            }
+            $yhash[$line] = 1;
+            $this->yv[] = $line;
+            $this->yind[] = $yi;
+        }
+        for ($xi = $skip; $xi < $n_from - $endskip; $xi++) {
+            $line = $from_lines[$xi];
+            if (($this->xchanged[$xi] = empty($yhash[$line]))) {
+                continue;
+            }
+            $this->xv[] = $line;
+            $this->xind[] = $xi;
+        }
+
+        // Find the LCS.
+        $this->_compareseq(0, count($this->xv), 0, count($this->yv));
+
+        // Merge edits when possible.
+        $this->_shiftBoundaries($from_lines, $this->xchanged, $this->ychanged);
+        $this->_shiftBoundaries($to_lines, $this->ychanged, $this->xchanged);
+
+        // Compute the edit operations.
+        $edits = array();
+        $xi = $yi = 0;
+        while ($xi < $n_from || $yi < $n_to) {
+            assert($yi < $n_to || $this->xchanged[$xi]);
+            assert($xi < $n_from || $this->ychanged[$yi]);
+
+            // Skip matching "snake".
+            $copy = array();
+            while ($xi < $n_from && $yi < $n_to
+                   && !$this->xchanged[$xi] && !$this->ychanged[$yi]) {
+                $copy[] = $from_lines[$xi++];
+                ++$yi;
+            }
+            if ($copy) {
+                $edits[] = &new Text_Diff_Op_copy($copy);
+            }
+
+            // Find deletes & adds.
+            $delete = array();
+            while ($xi < $n_from && $this->xchanged[$xi]) {
+                $delete[] = $from_lines[$xi++];
+            }
+
+            $add = array();
+            while ($yi < $n_to && $this->ychanged[$yi]) {
+                $add[] = $to_lines[$yi++];
+            }
+
+            if ($delete && $add) {
+                $edits[] = &new Text_Diff_Op_change($delete, $add);
+            } elseif ($delete) {
+                $edits[] = &new Text_Diff_Op_delete($delete);
+            } elseif ($add) {
+                $edits[] = &new Text_Diff_Op_add($add);
+            }
+        }
+
+        return $edits;
+    }
+
+    /**
+     * Divides the Largest Common Subsequence (LCS) of the sequences (XOFF,
+     * XLIM) and (YOFF, YLIM) into NCHUNKS approximately equally sized
+     * segments.
+     *
+     * Returns (LCS, PTS).  LCS is the length of the LCS. PTS is an array of
+     * NCHUNKS+1 (X, Y) indexes giving the diving points between sub
+     * sequences.  The first sub-sequence is contained in (X0, X1), (Y0, Y1),
+     * the second in (X1, X2), (Y1, Y2) and so on.  Note that (X0, Y0) ==
+     * (XOFF, YOFF) and (X[NCHUNKS], Y[NCHUNKS]) == (XLIM, YLIM).
+     *
+     * This function assumes that the first lines of the specified portions of
+     * the two files do not match, and likewise that the last lines do not
+     * match.  The caller must trim matching lines from the beginning and end
+     * of the portions it is going to specify.
+     */
+    function _diag ($xoff, $xlim, $yoff, $ylim, $nchunks)
+    {
+        $flip = false;
+
+        if ($xlim - $xoff > $ylim - $yoff) {
+            /* Things seems faster (I'm not sure I understand why) when the
+             * shortest sequence is in X. */
+            $flip = true;
+            list ($xoff, $xlim, $yoff, $ylim)
+                = array($yoff, $ylim, $xoff, $xlim);
+        }
+
+        if ($flip) {
+            for ($i = $ylim - 1; $i >= $yoff; $i--) {
+                $ymatches[$this->xv[$i]][] = $i;
+            }
+        } else {
+            for ($i = $ylim - 1; $i >= $yoff; $i--) {
+                $ymatches[$this->yv[$i]][] = $i;
+            }
+        }
+
+        $this->lcs = 0;
+        $this->seq[0]= $yoff - 1;
+        $this->in_seq = array();
+        $ymids[0] = array();
+
+        $numer = $xlim - $xoff + $nchunks - 1;
+        $x = $xoff;
+        for ($chunk = 0; $chunk < $nchunks; $chunk++) {
+            if ($chunk > 0) {
+                for ($i = 0; $i <= $this->lcs; $i++) {
+                    $ymids[$i][$chunk - 1] = $this->seq[$i];
+                }
+            }
+
+            $x1 = $xoff + (int)(($numer + ($xlim-$xoff)*$chunk) / $nchunks);
+            for (; $x < $x1; $x++) {
+                $line = $flip ? $this->yv[$x] : $this->xv[$x];
+                if (empty($ymatches[$line])) {
+                    continue;
+                }
+                $matches = $ymatches[$line];
+                foreach ($matches as $y) {
+                    if (empty($this->in_seq[$y])) {
+                        $k = $this->_lcsPos($y);
+                        assert($k > 0);
+                        $ymids[$k] = $ymids[$k - 1];
+                        break;
+                    }
+                }
+
+                while (list($junk, $y) = each($matches)) {
+                    if ($y > $this->seq[$k - 1]) {
+                        assert($y < $this->seq[$k]);
+                        /* Optimization: this is a common case: next match is
+                         * just replacing previous match. */
+                        $this->in_seq[$this->seq[$k]] = false;
+                        $this->seq[$k] = $y;
+                        $this->in_seq[$y] = 1;
+                    } elseif (empty($this->in_seq[$y])) {
+                        $k = $this->_lcsPos($y);
+                        assert($k > 0);
+                        $ymids[$k] = $ymids[$k - 1];
+                    }
+                }
+            }
+        }
+
+        $seps[] = $flip ? array($yoff, $xoff) : array($xoff, $yoff);
+        $ymid = $ymids[$this->lcs];
+        for ($n = 0; $n < $nchunks - 1; $n++) {
+            $x1 = $xoff + (int)(($numer + ($xlim - $xoff) * $n) / $nchunks);
+            $y1 = $ymid[$n] + 1;
+            $seps[] = $flip ? array($y1, $x1) : array($x1, $y1);
+        }
+        $seps[] = $flip ? array($ylim, $xlim) : array($xlim, $ylim);
+
+        return array($this->lcs, $seps);
+    }
+
+    function _lcsPos($ypos)
+    {
+        $end = $this->lcs;
+        if ($end == 0 || $ypos > $this->seq[$end]) {
+            $this->seq[++$this->lcs] = $ypos;
+            $this->in_seq[$ypos] = 1;
+            return $this->lcs;
+        }
+
+        $beg = 1;
+        while ($beg < $end) {
+            $mid = (int)(($beg + $end) / 2);
+            if ($ypos > $this->seq[$mid]) {
+                $beg = $mid + 1;
+            } else {
+                $end = $mid;
+            }
+        }
+
+        assert($ypos != $this->seq[$end]);
+
+        $this->in_seq[$this->seq[$end]] = false;
+        $this->seq[$end] = $ypos;
+        $this->in_seq[$ypos] = 1;
+        return $end;
+    }
+
+    /**
+     * Finds LCS of two sequences.
+     *
+     * The results are recorded in the vectors $this->{x,y}changed[], by
+     * storing a 1 in the element for each line that is an insertion or
+     * deletion (ie. is not in the LCS).
+     *
+     * The subsequence of file 0 is (XOFF, XLIM) and likewise for file 1.
+     *
+     * Note that XLIM, YLIM are exclusive bounds.  All line numbers are
+     * origin-0 and discarded lines are not counted.
+     */
+    function _compareseq ($xoff, $xlim, $yoff, $ylim)
+    {
+        /* Slide down the bottom initial diagonal. */
+        while ($xoff < $xlim && $yoff < $ylim
+               && $this->xv[$xoff] == $this->yv[$yoff]) {
+            ++$xoff;
+            ++$yoff;
+        }
+
+        /* Slide up the top initial diagonal. */
+        while ($xlim > $xoff && $ylim > $yoff
+               && $this->xv[$xlim - 1] == $this->yv[$ylim - 1]) {
+            --$xlim;
+            --$ylim;
+        }
+
+        if ($xoff == $xlim || $yoff == $ylim) {
+            $lcs = 0;
+        } else {
+            /* This is ad hoc but seems to work well.  $nchunks =
+             * sqrt(min($xlim - $xoff, $ylim - $yoff) / 2.5); $nchunks =
+             * max(2,min(8,(int)$nchunks)); */
+            $nchunks = min(7, $xlim - $xoff, $ylim - $yoff) + 1;
+            list($lcs, $seps)
+                = $this->_diag($xoff, $xlim, $yoff, $ylim, $nchunks);
+        }
+
+        if ($lcs == 0) {
+            /* X and Y sequences have no common subsequence: mark all
+             * changed. */
+            while ($yoff < $ylim) {
+                $this->ychanged[$this->yind[$yoff++]] = 1;
+            }
+            while ($xoff < $xlim) {
+                $this->xchanged[$this->xind[$xoff++]] = 1;
+            }
+        } else {
+            /* Use the partitions to split this problem into subproblems. */
+            reset($seps);
+            $pt1 = $seps[0];
+            while ($pt2 = next($seps)) {
+                $this->_compareseq ($pt1[0], $pt2[0], $pt1[1], $pt2[1]);
+                $pt1 = $pt2;
+            }
+        }
+    }
+
+    /**
+     * Adjusts inserts/deletes of identical lines to join changes as much as
+     * possible.
+     *
+     * We do something when a run of changed lines include a line at one end
+     * and has an excluded, identical line at the other.  We are free to
+     * choose which identical line is included.  `compareseq' usually chooses
+     * the one at the beginning, but usually it is cleaner to consider the
+     * following identical line to be the "change".
+     *
+     * This is extracted verbatim from analyze.c (GNU diffutils-2.7).
+     */
+    function _shiftBoundaries($lines, &$changed, $other_changed)
+    {
+        $i = 0;
+        $j = 0;
+
+        assert('count($lines) == count($changed)');
+        $len = count($lines);
+        $other_len = count($other_changed);
+
+        while (1) {
+            /* Scan forward to find the beginning of another run of
+             * changes. Also keep track of the corresponding point in the
+             * other file.
+             *
+             * Throughout this code, $i and $j are adjusted together so that
+             * the first $i elements of $changed and the first $j elements of
+             * $other_changed both contain the same number of zeros (unchanged
+             * lines).
+             *
+             * Furthermore, $j is always kept so that $j == $other_len or
+             * $other_changed[$j] == false. */
+            while ($j < $other_len && $other_changed[$j]) {
+                $j++;
+            }
+
+            while ($i < $len && ! $changed[$i]) {
+                assert('$j < $other_len && ! $other_changed[$j]');
+                $i++; $j++;
+                while ($j < $other_len && $other_changed[$j]) {
+                    $j++;
+                }
+            }
+
+            if ($i == $len) {
+                break;
+            }
+
+            $start = $i;
+
+            /* Find the end of this run of changes. */
+            while (++$i < $len && $changed[$i]) {
+                continue;
+            }
+
+            do {
+                /* Record the length of this run of changes, so that we can
+                 * later determine whether the run has grown. */
+                $runlength = $i - $start;
+
+                /* Move the changed region back, so long as the previous
+                 * unchanged line matches the last changed one.  This merges
+                 * with previous changed regions. */
+                while ($start > 0 && $lines[$start - 1] == $lines[$i - 1]) {
+                    $changed[--$start] = 1;
+                    $changed[--$i] = false;
+                    while ($start > 0 && $changed[$start - 1]) {
+                        $start--;
+                    }
+                    assert('$j > 0');
+                    while ($other_changed[--$j]) {
+                        continue;
+                    }
+                    assert('$j >= 0 && !$other_changed[$j]');
+                }
+
+                /* Set CORRESPONDING to the end of the changed run, at the
+                 * last point where it corresponds to a changed run in the
+                 * other file. CORRESPONDING == LEN means no such point has
+                 * been found. */
+                $corresponding = $j < $other_len ? $i : $len;
+
+                /* Move the changed region forward, so long as the first
+                 * changed line matches the following unchanged one.  This
+                 * merges with following changed regions.  Do this second, so
+                 * that if there are no merges, the changed region is moved
+                 * forward as far as possible. */
+                while ($i < $len && $lines[$start] == $lines[$i]) {
+                    $changed[$start++] = false;
+                    $changed[$i++] = 1;
+                    while ($i < $len && $changed[$i]) {
+                        $i++;
+                    }
+
+                    assert('$j < $other_len && ! $other_changed[$j]');
+                    $j++;
+                    if ($j < $other_len && $other_changed[$j]) {
+                        $corresponding = $i;
+                        while ($j < $other_len && $other_changed[$j]) {
+                            $j++;
+                        }
+                    }
+                }
+            } while ($runlength != $i - $start);
+
+            /* If possible, move the fully-merged run of changes back to a
+             * corresponding run in the other file. */
+            while ($corresponding < $i) {
+                $changed[--$start] = 1;
+                $changed[--$i] = 0;
+                assert('$j > 0');
+                while ($other_changed[--$j]) {
+                    continue;
+                }
+                assert('$j >= 0 && !$other_changed[$j]');
+            }
+        }
+    }
+
+}
+
+/**
+ * @package Text_Diff
+ * @author  Geoffrey T. Dairiki <dairiki@dairiki.org>
+ *
+ * @access private
+ */
+class Text_Diff_Op {
+
+    var $orig;
+    var $final;
+
+    function reverse()
+    {
+        trigger_error('Abstract method', E_USER_ERROR);
+    }
+
+    function norig()
+    {
+        return $this->orig ? count($this->orig) : 0;
+    }
+
+    function nfinal()
+    {
+        return $this->final ? count($this->final) : 0;
+    }
+
+}
+
+/**
+ * @package Text_Diff
+ * @author  Geoffrey T. Dairiki <dairiki@dairiki.org>
+ *
+ * @access private
+ */
+class Text_Diff_Op_copy extends Text_Diff_Op {
+
+    function Text_Diff_Op_copy($orig, $final = false)
+    {
+        if (!is_array($final)) {
+            $final = $orig;
+        }
+        $this->orig = $orig;
+        $this->final = $final;
+    }
+
+    function &reverse()
+    {
+        return $reverse = &new Text_Diff_Op_copy($this->final, $this->orig);
+    }
+
+}
+
+/**
+ * @package Text_Diff
+ * @author  Geoffrey T. Dairiki <dairiki@dairiki.org>
+ *
+ * @access private
+ */
+class Text_Diff_Op_delete extends Text_Diff_Op {
+
+    function Text_Diff_Op_delete($lines)
+    {
+        $this->orig = $lines;
+        $this->final = false;
+    }
+
+    function &reverse()
+    {
+        return $reverse = &new Text_Diff_Op_add($this->orig);
+    }
+
+}
+
+/**
+ * @package Text_Diff
+ * @author  Geoffrey T. Dairiki <dairiki@dairiki.org>
+ *
+ * @access private
+ */
+class Text_Diff_Op_add extends Text_Diff_Op {
+
+    function Text_Diff_Op_add($lines)
+    {
+        $this->final = $lines;
+        $this->orig = false;
+    }
+
+    function &reverse()
+    {
+        return $reverse = &new Text_Diff_Op_delete($this->final);
+    }
+
+}
+
+/**
+ * @package Text_Diff
+ * @author  Geoffrey T. Dairiki <dairiki@dairiki.org>
+ *
+ * @access private
+ */
+class Text_Diff_Op_change extends Text_Diff_Op {
+
+    function Text_Diff_Op_change($orig, $final)
+    {
+        $this->orig = $orig;
+        $this->final = $final;
+    }
+
+    function &reverse()
+    {
+        return $reverse = &new Text_Diff_Op_change($this->final, $this->orig);
+    }
+
+}
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/include/render_function.inc.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/include/render_function.inc.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/include/render_function.inc.php	(revision 405)
@@ -0,0 +1,124 @@
+<?php
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+// ------------------------------------------------------------------------- //
+// Hacker: GIJ=CHECKMATE (AKA GIJOE)                                         //
+// Site: http://www.peak.ne.jp/xoops/                                        //
+// ------------------------------------------------------------------------- //
+
+if( ! defined( 'TC_RENDER_FUNCTIONS_INCLUDED' ) ) {
+
+define( 'TC_RENDER_FUNCTIONS_INCLUDED' , 1 ) ;
+
+function tc_content_render( $text , $nohtml , $nosmiley , $nobreaks , $nbsp = 0 )
+{
+	$myts =& TinyDTextSanitizer::getInstance();
+
+	if( $nohtml >= 16 ) {
+
+		// db content (PEAR wiki)
+		if( ! defined( 'PATH_SEPARATOR' ) ) define( 'PATH_SEPARATOR' , DIRECTORY_SEPARATOR == '/' ? ':' : ';' ) ;
+		ini_set( 'include_path' , ini_get('include_path') . PATH_SEPARATOR . XOOPS_ROOT_PATH . '/common/PEAR' ) ;
+		include_once "Text/Wiki.php";
+		// include_once "Text/sunday_Wiki.php";
+		$wiki = new Text_Wiki(); // create instance
+
+		// Configuration
+		$wiki->deleteRule( 'Wikilink' ); // remove a rule for auto-linking
+		$wiki->setFormatConf( 'Xhtml' , 'translate' , HTML_SPECIALCHARS ) ; // HTML_ENTITIES -> HTML_SPECIALCHARS
+
+		// $wiki = new sunday_Text_Wiki(); // create instance
+		//$text = str_replace ( "\r\n", "\n", $text );
+		//$text = str_replace ( "~\n", "[br]", $text );
+		//$text = $wiki->transform($text);
+		//$content = str_replace ( "[br]", "<br/>", $text );
+		// special thx to minahito! you are great!!
+		$content = $wiki->transform($text);
+
+		if( $nohtml & 2 ) {
+			$content = $myts->displayTarea( $content , 1 , ! $nosmiley , 1 , 1 , ! $nobreaks , $nbsp ) ;
+		}
+
+	} else if( $nohtml >= 8 ) {
+
+		// db content (PHP)
+		ob_start() ;
+		eval( $text ) ;
+		$content = ob_get_contents() ;
+		ob_end_clean() ;
+
+		if( $nohtml & 2 ) {
+			$content = $myts->displayTarea( $content , 1 , ! $nosmiley , 1 , 1 , ! $nobreaks , $nbsp ) ;
+		}
+
+	} else if( $nohtml < 4 ) {
+
+		switch( $nohtml ) {
+			case 0 : // HTML with BB
+				$content = $myts->displayTarea( $text , 1 , ! $nosmiley , 1 , 1 , ! $nobreaks , $nbsp ) ;
+				break ;
+			case 1 : // Text with BB
+				$content = $myts->displayTarea( $text , 0 , ! $nosmiley , 1 , 1 , ! $nobreaks , $nbsp ) ;
+				break ;
+			case 2 : // HTML without BB
+				$content = $text ;
+				break ;
+			case 3 : // Text without BB
+				$content = htmlspecialchars( $text , ENT_QUOTES ) ;
+				if( ! $nobreaks ) $content = nl2br( $content ) ;
+				break ;
+		}
+
+	} else {
+
+		$content = $text ;
+
+	}
+
+	return $content ;
+}
+
+
+function tc_change_srchref( $content , $wrap_base_url )
+{
+	$patterns = array( "/src\=\"(?!http:|https:)([^, \r\n\"\(\)'<>]+)/i" , "/src\=\'(?!http:|https:)([^, \r\n\"\(\)'<>]+)/i" , "/src\=(?!http:|https:)([^, \r\n\"\(\)'<>]+)/i" , "/href\=\"(?!http:|https:)([^, \r\n\"\(\)'<>]+)/i" , "/href\=\'(?!http:|https:)([^, \r\n\"\(\)'<>]+)/i" , "/href\=(?!http:|https:)([^, \r\n\"\(\)'<>]+)/i" ) ;
+	$replacements = array( "src=\"$wrap_base_url/\\1" , "src='$wrap_base_url/\\1" , "src=$wrap_base_url/\\1" , "href=\"$wrap_base_url/\\1" , "href='$wrap_base_url/\\1" , "href=$wrap_base_url/\\1" ) ;
+
+	return preg_replace($patterns, $replacements, $content);
+}
+
+
+
+if( ! function_exists( 'mb_convert_encoding' ) ) {
+	function mb_convert_encoding( $str ) { return $str ; }
+}
+
+if( ! function_exists( 'mb_internal_encoding' ) ) {
+	function mb_internal_encoding( $str ) { return "UTF-8" ; }
+}
+
+
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/include/display.inc.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/include/display.inc.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/include/display.inc.php	(revision 405)
@@ -0,0 +1,214 @@
+<?php
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+// ------------------------------------------------------------------------- //
+// Author: Tobias Liegl (AKA CHAPI)                                          //
+// Site: http://www.chapi.de                                                 //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+// Hacker: GIJ=CHECKMATE (AKA GIJOE)                                         //
+// Site: http://www.peak.ne.jp/xoops/                                        //
+// ------------------------------------------------------------------------- //
+
+if( ! defined( 'XOOPS_ROOT_PATH' ) ) exit ;
+
+// XOOPS Header
+$xoopsOption['template_main'] = "tinycontent{$mydirnumber}_index.html" ;
+include( XOOPS_ROOT_PATH . '/header.php' ) ;
+
+// $myts
+$myts =& MyTextSanitizer::getInstance() ;
+
+extract( $result_array ) ;
+
+// getting "content"
+if( $link > 0 ) {
+
+	// external (=wrapped) content
+	$wrap_file = "$mymodpath/content/$address" ;
+	if( ! file_exists( $wrap_file ) ) {
+		redirect_header( XOOPS_URL , 2 , _TC_FILENOTFOUND ) ;
+		exit ;
+	}
+
+	ob_start() ;
+	include( $wrap_file ) ;
+	$content = tc_convert_wrap_to_ie( ob_get_contents() ) ;
+	if( $link == TC_WRAPTYPE_CHANGESRCHREF ) $content = tc_change_srchref( $content , XOOPS_URL . "/modules/$mydirname/content" ) ;
+	ob_end_clean() ;
+
+} else {
+
+	$content = tc_content_render( $text , $nohtml , $nosmiley , $nobreaks , $xoopsModuleConfig['tc_space2nbsp'] ) ;
+
+}
+
+// "tell to a friend" (It is too dificult to treat this for multibyte langs...)
+if( $xoopsModuleConfig['tc_use_taf_module'] ) {
+	$mail_link = XOOPS_URL.'/modules/tellafriend/index.php?target_uri='.rawurlencode( XOOPS_URL . "/modules/$mydirname/index.php?id=$id" ).'&amp;subject='.rawurlencode(sprintf(_TC_INTARTICLE,$xoopsConfig['sitename'])) ;
+} else {
+	if( _TC_DONE_MAILTOENCODE ) {
+		$mail_link = 'mailto:?subject=' . _TC_MB_INTARTICLE . '&amp;body=' . _TC_MB_INTARTFOUND . '%3A%20' . XOOPS_URL . "/modules/$mydirname/index.php?id=$id" ;
+	} else {
+		$mail_link = 'mailto:?subject='.rawurlencode(sprintf(_TC_INTARTICLE,$xoopsConfig['sitename'])).'&amp;body='.rawurlencode(sprintf(_TC_INTARTFOUND, $xoopsConfig['sitename'])).'%3A%20'.XOOPS_URL."/modules/$mydirname/index.php?id=$id" ;
+	}
+}
+
+// mod_url & vmod_url
+$mod_url = XOOPS_URL."/modules/$mydirname" ;
+// check modulesless rewrite
+if( ! empty( $xoopsModuleConfig['tc_modulesless_dir'] ) ) {
+	$vmod_url = XOOPS_URL.'/'.$xoopsModuleConfig['tc_modulesless_dir'];
+	$tc_rewrite_dir = '' ;
+} else {
+	$vmod_url = $mod_url ;
+	$tc_rewrite_dir = TC_REWRITE_DIR ;
+}
+
+
+// Page Navigation
+if( ! empty( $xoopsModuleConfig['tc_display_pagenav'] ) ) {
+
+	$whr_sub = $xoopsModuleConfig['tc_display_pagenav'] == 2 ? "(submenu=1 OR storyid='$id')" : "1" ;
+	$result = $xoopsDB->query("SELECT storyid,title,link,submenu FROM ".$xoopsDB->prefix( "tinycontent{$mydirnumber}" )." WHERE $whr_sub AND visible ORDER BY blockid" ) ;
+	while( $tmp_array = $xoopsDB->fetchArray( $result ) ) {
+		if( $tmp_array['storyid'] == $id ) {
+			$next_array = $xoopsDB->fetchArray( $result ) ;
+			break ;
+		}
+		$prev_array = $tmp_array ;
+	}
+}
+
+// submenu unit mode
+if( $xoopsModuleConfig['tc_display_pagenav'] == 3 ) {
+	if( ! empty( $next_array ) && $next_array['submenu'] ) {
+		unset( $next_array ) ;
+	}
+	if( ! empty( $tmp_array ) && $tmp_array['submenu'] ) {
+		unset( $prev_array ) ;
+	}
+}
+
+if( ! empty( $prev_array ) ) {
+	$prev_title = $myts->makeTboxData4Show( $prev_array['title'] ) ;
+	if( ! empty( $xoopsModuleConfig['tc_force_mod_rewrite'] ) || $prev_array['link'] == TC_WRAPTYPE_USEREWRITE ) {
+		$prev_link = $tc_rewrite_dir . sprintf( TC_REWRITE_FILENAME_FMT , $prev_array['storyid'] ) ;
+	} else {
+		$wraproot = $prev_array['link'] == TC_WRAPTYPE_CONTENTBASE ? "content/" : '' ;
+		$prev_link = "{$wraproot}index.php?id={$prev_array['storyid']}" ;
+	}
+} else {
+	$prev_title = $prev_link = '' ;
+}
+
+if( ! empty( $next_array ) ) {
+	$next_title = $myts->makeTboxData4Show( $next_array['title'] ) ;
+	if( ! empty( $xoopsModuleConfig['tc_force_mod_rewrite'] ) || $next_array['link'] == TC_WRAPTYPE_USEREWRITE ) {
+		$next_link = $tc_rewrite_dir . sprintf( TC_REWRITE_FILENAME_FMT , $next_array['storyid'] ) ;
+	} else {
+		$wraproot = $next_array['link'] == TC_WRAPTYPE_CONTENTBASE ? "content/" : '' ;
+		$next_link = "{$wraproot}index.php?id={$next_array['storyid']}" ;
+	}
+} else {
+	$next_title = $next_link = '' ;
+}
+
+if( ! empty( $homepage_id ) ) {
+	if( ! empty( $xoopsModuleConfig['tc_force_mod_rewrite'] ) || $homepage_link_type == TC_WRAPTYPE_USEREWRITE ) {
+		$top_link = $tc_rewrite_dir . sprintf( TC_REWRITE_FILENAME_FMT , $homepage_id ) ;
+	} else {
+		$wraproot = $homepage_link_type == TC_WRAPTYPE_CONTENTBASE ? "content/" : '' ;
+		$top_link = "{$wraproot}index.php?id=$homepage_id" ;
+	}
+} else {
+	$top_link = 'index.php' ;
+}
+
+
+// convert from {X_SITEURL} to XOOPS_URL
+$content = str_replace( '{X_SITEURL}' , XOOPS_URL , $content ) ;
+
+// assignment to Smarty
+$xoopsTpl->assign( 'mod_url' , $mod_url ) ;
+$xoopsTpl->assign( 'vmod_url' , $vmod_url ) ;
+$xoopsTpl->assign( 'title' , $myts->makeTboxData4Show( $title ) ) ;
+$xoopsTpl->assign( 'xoops_pagetitle' , $myts->makeTboxData4Show( $title ) ) ;
+$xoopsTpl->assign( 'xoops_default_comment_title' , sprintf( _TC_FMT_DEFAULT_COMMENT_TITLE , $myts->makeTboxData4Edit( $title ) ) ) ;
+$xoopsTpl->assign( 'xoops_module_header' , $xoopsModuleConfig['tc_common_htmlheader'] . "\n" . $html_header . "\n" . $xoopsTpl->get_template_vars( "xoops_module_header" ) ) ;
+$xoopsTpl->assign( 'content' , $content ) ;
+$xoopsTpl->assign( 'nocomments' , $nocomments ) ;
+$xoopsTpl->assign( 'mail_link', $mail_link ) ;
+$xoopsTpl->assign( 'lang_printerpage' , _TC_PRINTERFRIENDLY ) ;
+$xoopsTpl->assign( 'lang_sendstory' , _TC_SENDSTORY ) ;
+$xoopsTpl->assign( 'lang_nextpage' , _TC_NEXTPAGE ) ;
+$xoopsTpl->assign( 'lang_prevpage' , _TC_PREVPAGE ) ;
+$xoopsTpl->assign( 'lang_topofcontents' , _TC_TOPOFCONTENTS ) ;
+$xoopsTpl->assign( 'is_display_print_icon' , $xoopsModuleConfig['tc_display_print_icon'] ) ;
+$xoopsTpl->assign( 'is_display_friend_icon' , $xoopsModuleConfig['tc_display_friend_icon'] ) ;
+$xoopsTpl->assign( 'is_display_pagenav' , $xoopsModuleConfig['tc_display_pagenav'] ) ;
+$xoopsTpl->assign( 'prev_title' , $prev_title ) ;
+$xoopsTpl->assign( 'prev_link' , $prev_link ) ;
+$xoopsTpl->assign( 'next_title' , $next_title ) ;
+$xoopsTpl->assign( 'next_link' , $next_link ) ;
+$xoopsTpl->assign( 'top_link' , $top_link ) ;
+$xoopsTpl->assign( 'id' , $id ) ;
+$xoopsTpl->assign( 'homepage_id' , isset( $homepage_id ) ? $homepage_id : 0 ) ;
+$xoopsTpl->assign( 'last_modified' , $last_modified ) ;
+
+include( XOOPS_ROOT_PATH.'/include/comment_view.php' ) ;
+
+
+if( ! empty( $xoopsModuleConfig['tc_force_mod_rewrite'] ) || $link == TC_WRAPTYPE_USEREWRITE ) {
+	$mod_url_rewrite = $mod_url . '/' . substr( $tc_rewrite_dir , 0, -1 ) ;
+} else {
+	$mod_url_rewrite = $mod_url ;
+}
+
+$php_self_ab = $mod_url_rewrite . ($link == TC_WRAPTYPE_CONTENTBASE ? '/content' : '' ) . '/index.php' ;
+
+// relative link to absolut link of comment_links
+$commentsnav = $xoopsTpl->get_template_vars( "commentsnav" ) ;
+$commentsnav = str_replace( 'action="index.php"' , 'action="'.$php_self_ab.'"' , $commentsnav ) ;
+$commentsnav = str_replace( "href='comment_new.php" , "href='$mod_url_rewrite/comment_new.php" , $commentsnav ) ;
+$xoopsTpl->assign( 'commentsnav' , $commentsnav ) ;
+
+$editcomment_link = $xoopsTpl->get_template_vars( "editcomment_link" ) ;
+if( substr( $editcomment_link , 0 , 8 ) == 'comment_' ) {
+	$xoopsTpl->assign( 'editcomment_link' , "$mod_url_rewrite/$editcomment_link" ) ;
+}
+
+$deletecomment_link = $xoopsTpl->get_template_vars( "deletecomment_link" ) ;
+if( substr( $deletecomment_link , 0 , 8 ) == 'comment_' ) {
+	$xoopsTpl->assign( 'deletecomment_link' , "$mod_url_rewrite/$deletecomment_link" ) ;
+}
+
+$replycomment_link = $xoopsTpl->get_template_vars( "replycomment_link" ) ;
+if( substr( $replycomment_link , 0 , 8 ) == 'comment_' ) {
+	$xoopsTpl->assign( 'replycomment_link' , "$mod_url_rewrite/$replycomment_link" ) ;
+}
+
+include( XOOPS_ROOT_PATH.'/footer.php' ) ;
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/include/gtickets.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/include/gtickets.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/include/gtickets.php	(revision 405)
@@ -0,0 +1,314 @@
+<?php
+// GIJOE's Ticket Class (based on Marijuana's Oreteki XOOPS)
+// nobunobu's suggestions are applied
+
+if( ! class_exists( 'XoopsGTicket' ) ) {
+
+class XoopsGTicket {
+
+	var $_errors = array() ;
+	var $_latest_token = '' ;
+	var $messages = array() ;
+
+	function XoopsGTicket()
+	{
+		global $xoopsConfig ;
+
+		// language file
+		if( defined( 'XOOPS_ROOT_PATH' ) && ! empty( $xoopsConfig['language'] ) && ! strstr( $xoopsConfig['language'] , '/' ) ) {
+			if( file_exists( dirname( dirname( __FILE__ ) ) . '/language/' . $xoopsConfig['language'] . '/gticket_messages.phtml' ) ) {
+				include dirname( dirname( __FILE__ ) ) . '/language/' . $xoopsConfig['language'] . '/gticket_messages.phtml' ;
+			}
+		}
+
+		// default messages
+		if( empty( $this->messages ) ) $this->messages = array(
+			'err_general' => 'GTicket Error' ,
+			'err_nostubs' => 'No stubs found' ,
+			'err_noticket' => 'No ticket found' ,
+			'err_nopair' => 'No valid ticket-stub pair found' ,
+			'err_timeout' => 'Time out' ,
+			'err_areaorref' => 'Invalid area or referer' ,
+			'fmt_prompt4repost' => 'error(s) found:<br /><span style="background-color:red;font-weight:bold;color:white;">%s</span><br />Confirm it.<br />And do you want to post again?' ,
+			'btn_repost' => 'repost' ,
+		) ;
+	}
+
+	// render form as plain html
+	function getTicketHtml( $salt = '' , $timeout = 1800 , $area = '' )
+	{
+		return '<input type="hidden" name="XOOPS_G_TICKET" value="'.$this->issue( $salt , $timeout , $area ).'" />' ;
+	}
+
+	// returns an object of XoopsFormHidden including theh ticket
+	function getTicketXoopsForm( $salt = '' , $timeout = 1800 , $area = '' )
+	{
+		return new XoopsFormHidden( 'XOOPS_G_TICKET' , $this->issue( $salt , $timeout , $area ) ) ;
+	}
+
+	// add a ticket as Hidden Element into XoopsForm
+	function addTicketXoopsFormElement( &$form , $salt = '' , $timeout = 1800 , $area = '' )
+	{
+		$form->addElement( new XoopsFormHidden( 'XOOPS_G_TICKET' , $this->issue( $salt , $timeout , $area ) ) ) ;
+	}
+
+	// returns an array for xoops_confirm() ;
+	function getTicketArray( $salt = '' , $timeout = 1800 , $area = '' )
+	{
+		return array( 'XOOPS_G_TICKET' => $this->issue( $salt , $timeout , $area ) ) ;
+	}
+
+	// return GET parameter string.
+	function getTicketParamString( $salt = '' , $noamp = false , $timeout=1800 , $area = '' )
+	{
+	    return ( $noamp ? '' : '&amp;' ) . 'XOOPS_G_TICKET=' . $this->issue( $salt, $timeout , $area ) ;
+	}
+
+	// issue a ticket
+	function issue( $salt = '' , $timeout = 1800 , $area = '' )
+	{
+		global $xoopsModule ;
+	
+		// create a token
+		list( $usec , $sec ) = explode( " " , microtime() ) ;
+		$appendix_salt = empty( $_SERVER['PATH'] ) ? XOOPS_DB_NAME : $_SERVER['PATH'] ;
+		$token = crypt( $salt . $usec . $appendix_salt . $sec ) ;
+		$this->_latest_token = $token ;
+
+		if( empty( $_SESSION['XOOPS_G_STUBS'] ) ) $_SESSION['XOOPS_G_STUBS'] = array() ;
+
+		// limit max stubs 10
+		if( sizeof( $_SESSION['XOOPS_G_STUBS'] ) > 10 ) {
+			$_SESSION['XOOPS_G_STUBS'] = array_slice( $_SESSION['XOOPS_G_STUBS'] , -10 ) ;
+		}
+
+		// record referer if browser send it
+		$referer = empty( $_SERVER['HTTP_REFERER'] ) ? '' : $_SERVER['REQUEST_URI'] ;
+
+		// area as module's dirname
+		if( ! $area && is_object( @$xoopsModule ) ) {
+			$area = $xoopsModule->getVar('dirname') ;
+		}
+
+		// store stub
+		$_SESSION['XOOPS_G_STUBS'][] = array(
+			'expire' => time() + $timeout ,
+			'referer' => $referer ,
+			'area' => $area ,
+			'token' => $token
+		) ;
+
+		// paid md5ed token as a ticket
+		return md5( $token . XOOPS_DB_PREFIX ) ;
+	}
+
+	// check a ticket
+	function check( $post = true , $area = '' , $allow_repost = true )
+	{
+		global $xoopsModule ;
+
+		$this->_errors = array() ;
+
+		// CHECK: stubs are not stored in session
+		if( ! is_array(@$_SESSION['XOOPS_G_STUBS'])) {
+			$this->_errors[] = $this->messages['err_nostubs'] ;
+			$_SESSION['XOOPS_G_STUBS'] = array() ;
+		}
+
+		// get key&val of the ticket from a user's query
+		$ticket = $post ? @$_POST['XOOPS_G_TICKET'] : @$_GET['XOOPS_G_TICKET'] ;
+
+		// CHECK: no tickets found
+		if( empty( $ticket ) ) {
+			$this->_errors[] = $this->messages['err_noticket'] ;
+		}
+
+		// gargage collection & find a right stub
+		$stubs_tmp = $_SESSION['XOOPS_G_STUBS'] ;
+		$_SESSION['XOOPS_G_STUBS'] = array() ;
+		foreach( $stubs_tmp as $stub ) {
+			// default lifetime 30min
+			if( $stub['expire'] >= time() ) {
+				if( md5( $stub['token'] . XOOPS_DB_PREFIX ) === $ticket ) {
+					$found_stub = $stub ;
+				} else {
+					// store the other valid stubs into session
+					$_SESSION['XOOPS_G_STUBS'][] = $stub ;
+				}
+			} else {
+				if( md5( $stub['token'] . XOOPS_DB_PREFIX ) === $ticket ) {
+					// not CSRF but Time-Out
+					$timeout_flag = true ;
+				}
+			}
+		}
+
+		// CHECK: the right stub found or not
+		if( empty( $found_stub ) ) {
+			if( empty( $timeout_flag ) ) $this->_errors[] = $this->messages['err_nopair'] ;
+			else $this->_errors[] = $this->messages['err_timeout'] ;
+		} else {
+
+			// set area if necessary
+			// area as module's dirname
+			if( ! $area && is_object( @$xoopsModule ) ) {
+				$area = $xoopsModule->getVar('dirname') ;
+			}
+
+			// check area or referer
+			if( @$found_stub['area'] == $area ) $area_check = true ;
+			if( ! empty( $found_stub['referer'] ) && strstr( @$_SERVER['HTTP_REFERER'] , $found_stub['referer'] ) ) $referer_check = true ;
+
+			if( empty( $area_check ) && empty( $referer_check ) ) { // loose
+				$this->_errors[] = $this->messages['err_areaorref'] ;
+			}
+		}
+
+		if( ! empty( $this->_errors ) ) {
+			if( $allow_repost ) {
+				// repost form
+				$this->draw_repost_form( $area ) ;
+				exit ;
+			} else {
+				// failed
+				$this->clear() ;
+				return false ;
+			}
+		} else {
+			// all green
+			return true;
+		}
+	}
+
+	// draw form for repost
+	function draw_repost_form( $area = '' )
+	{
+		// Notify which file is broken
+		if( headers_sent() ) {
+			restore_error_handler() ;
+			set_error_handler( 'GTicket_ErrorHandler4FindOutput' ) ;
+			header( 'Dummy: for warning' ) ;
+			restore_error_handler() ;
+			exit ;
+		}
+	
+		error_reporting( 0 ) ;
+		while( ob_get_level() ) ob_end_clean() ;
+
+		$table = '<table>' ;
+		$form = '<form action="?'.htmlspecialchars(@$_SERVER['QUERY_STRING'],ENT_QUOTES).'" method="post" >' ;
+		foreach( $_POST as $key => $val ) {
+			if( $key == 'XOOPS_G_TICKET' ) continue ;
+			if( get_magic_quotes_gpc() ) {
+				$key = stripslashes( $key ) ;
+			}
+			if( is_array( $val ) ) {
+				list( $tmp_table , $tmp_form ) = $this->extract_post_recursive( htmlspecialchars($key,ENT_QUOTES) , $val ) ;
+				$table .= $tmp_table ;
+				$form .= $tmp_form ;
+			} else {
+				if( get_magic_quotes_gpc() ) {
+					$val = stripslashes( $val ) ;
+				}
+				$table .= '<tr><th>'.htmlspecialchars($key,ENT_QUOTES).'</th><td>'.htmlspecialchars($val,ENT_QUOTES).'</td></tr>'."\n" ;
+				$form .= '<input type="hidden" name="'.htmlspecialchars($key,ENT_QUOTES).'" value="'.htmlspecialchars($val,ENT_QUOTES).'" />'."\n" ;
+			}
+		}
+		$table .= '</table>' ;
+		$form .= $this->getTicketHtml(__LINE__,300,$area).'<input type="submit" value="'.$this->messages['btn_repost'].'" /></form>' ;
+
+		echo '<html><head><title>'.$this->messages['err_general'].'</title><style>table,td,th {border:solid black 1px; border-collapse:collapse;}</style></head><body>' . sprintf( $this->messages['fmt_prompt4repost'] , $this->getErrors() ) . $table . $form . '</body></html>' ;
+	}
+
+	function extract_post_recursive( $key_name , $tmp_array ) {
+		$table = '' ;
+		$form = '' ;
+		foreach( $tmp_array as $key => $val ) {
+			if( get_magic_quotes_gpc() ) {
+				$key = stripslashes( $key ) ;
+			}
+			if( is_array( $val ) ) {
+				list( $tmp_table , $tmp_form ) = $this->extract_post_recursive( $key_name.'['.htmlspecialchars($key,ENT_QUOTES).']' , $val ) ;
+				$table .= $tmp_table ;
+				$form .= $tmp_form ;
+			} else {
+				if( get_magic_quotes_gpc() ) {
+					$val = stripslashes( $val ) ;
+				}
+				$table .= '<tr><th>'.$key_name.'['.htmlspecialchars($key,ENT_QUOTES).']</th><td>'.htmlspecialchars($val,ENT_QUOTES).'</td></tr>'."\n" ;
+				$form .= '<input type="hidden" name="'.$key_name.'['.htmlspecialchars($key,ENT_QUOTES).']" value="'.htmlspecialchars($val,ENT_QUOTES).'" />'."\n" ;
+			}
+		}
+		return array( $table , $form ) ;
+	}
+
+
+	// clear all stubs
+	function clear()
+	{
+		$_SESSION['XOOPS_G_STUBS'] = array() ;
+	}
+
+
+	// Ticket Using
+	function using()
+	{
+		if( ! empty( $_SESSION['XOOPS_G_STUBS'] ) ) {
+			return true;
+		} else {
+			return false;
+		}
+	}
+
+
+	// return errors
+	function getErrors( $ashtml = true )
+	{
+		if( $ashtml ) {
+			$ret = '' ;
+			foreach( $this->_errors as $msg ) {
+				$ret .= "$msg<br />\n" ;
+			}
+		} else {
+			$ret = $this->_errors ;
+		}
+		return $ret ;
+	}
+
+// end of class
+}
+
+function GTicket_ErrorHandler4FindOutput($errNo, $errStr, $errFile, $errLine)
+{
+	if( preg_match( '?'.preg_quote(XOOPS_ROOT_PATH).'([^:]+)\:(\d+)?' , $errStr , $regs ) ) {
+		echo "Irregular output! check the file ".htmlspecialchars($regs[1])." line ".htmlspecialchars($regs[2]) ;
+	} else {
+		echo "Irregular output! check language files etc." ;
+	}
+	return ;
+}
+
+// create a instance in global scope
+$GLOBALS['xoopsGTicket'] = new XoopsGTicket() ;
+
+}
+
+if( ! function_exists( 'admin_refcheck' ) ) {
+
+//Admin Referer Check By Marijuana(Rev.011)
+function admin_refcheck($chkref = "") {
+	if( empty( $_SERVER['HTTP_REFERER'] ) ) {
+		return true ;
+	} else {
+		$ref = $_SERVER['HTTP_REFERER'];
+	}
+	$cr = XOOPS_URL;
+	if ( $chkref != "" ) { $cr .= $chkref; }
+	if ( strpos($ref, $cr) !== 0 ) { return false; }
+	return true;
+}
+
+}
+
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/include/search.inc.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/include/search.inc.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/include/search.inc.php	(revision 405)
@@ -0,0 +1,147 @@
+<?php
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+// ------------------------------------------------------------------------- //
+// Author: Tobias Liegl (AKA CHAPI)                                          //
+// Site: http://www.chapi.de                                                 //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+// Hacker: GIJ=CHECKMATE (AKA GIJOE)                                         //
+// Site: http://www.peak.ne.jp/xoops/                                        //
+// ------------------------------------------------------------------------- //
+
+if( ! defined( 'XOOPS_ROOT_PATH' ) ) exit ;
+$mydirname = basename( dirname( dirname( __FILE__ ) ) ) ;
+if( ! preg_match( '/^(\D+)(\d*)$/' , $mydirname , $regs ) ) echo ( "invalid dirname: " . htmlspecialchars( $mydirname ) ) ;
+$mydirnumber = $regs[2] === '' ? '' : intval( $regs[2] ) ;
+
+include_once( XOOPS_ROOT_PATH . "/modules/$mydirname/include/constants.inc.php" ) ;
+
+if( ! class_exists( 'TinyDTextSanitizer' ) ) {
+	include_once( XOOPS_ROOT_PATH . "/modules/$mydirname/class/tinyd.textsanitizer.php" ) ;
+}
+
+
+eval( '
+
+function tinycontent'.$mydirnumber.'_search( $keywords , $andor , $limit , $offset , $userid )
+{
+	return tinyd_search_base( "'.$mydirname.'" , "'.$mydirnumber.'" , $keywords , $andor , $limit , $offset , $userid ) ;
+}
+
+' ) ;
+
+
+if( ! function_exists( 'tinyd_search_base' ) ) {
+
+function tinyd_search_base( $mydirname , $mydirnumber , $keywords , $andor , $limit , $offset , $userid )
+{
+	// get my config
+	$module_handler =& xoops_gethandler('module');
+	$config_handler =& xoops_gethandler('config');
+	$module =& $module_handler->getByDirname($mydirname);
+	$config =& $config_handler->getConfigsByCat(0, $module->getVar('mid'));
+
+	$myts =& TinyDTextSanitizer::getInstance() ;
+	$db =& Database::getInstance() ;
+
+	// XOOPS Search module
+	$showcontext = empty( $_GET['showcontext'] ) ? 0 : 1 ;
+	$select4con = $showcontext ? "text" : "'' AS text" ;
+
+	$sql = "SELECT storyid,title,link,UNIX_TIMESTAMP(last_modified),$select4con FROM ".$db->prefix( "tinycontent$mydirnumber" )." WHERE visible AND ! (nohtml & 8) " ;
+
+	if( ! empty( $userid ) ) {
+		$sql .= " AND 0 ";
+	}
+
+	$whr = "" ;
+	if( is_array( $keywords ) && count( $keywords ) > 0 ) {
+		$whr = "AND (" ;
+		switch( strtolower( $andor ) ) {
+			case "and" :
+				foreach( $keywords as $keyword ) {
+					$whr .= "CONCAT(title,' ',text) LIKE '%$keyword%' AND " ;
+				}
+				$whr = substr( $whr , 0 , -5 ) ;
+				break ;
+			case "or" :
+				foreach( $keywords as $keyword ) {
+					$whr .= "CONCAT(title,' ',text) LIKE '%$keyword%' OR " ;
+				}
+				$whr = substr( $whr , 0 , -4 ) ;
+				break ;
+			default :
+				$whr .= "CONCAT(title,' ',text) LIKE '%{$keywords[0]}%'" ;
+				break ;
+		}
+		$whr .= ")" ;
+	}
+
+	$sql = "$sql $whr ORDER BY storyid ASC" ;
+	$result = $db->query( $sql , $limit , $offset ) ;
+	$ret = array() ;
+	$context = '' ;
+	while( list( $id , $title , $link , $timestamp , $text ) = $db->fetchRow( $result ) ) {
+
+		// get context for module "search"
+		if( function_exists( 'search_make_context' ) && $showcontext ) {
+			$full_context = strip_tags( $myts->displayTarea( $text , 1 , 1 , 1 , 1 , 1 ) ) ;
+			if( function_exists( 'easiestml' ) ) $full_context = easiestml( $full_context ) ;
+			$context = search_make_context( $full_context , $keywords ) ;
+		}
+
+		if( ! empty( $config['tc_force_mod_rewrite'] ) ) {
+			if( ! empty( $config['tc_modulesless_dir'] ) ) { 
+				$href = '../../' . $config['tc_modulesless_dir'] . '/' . sprintf( TC_REWRITE_FILENAME_FMT , $id ) ;
+			} else {
+				$href = TC_REWRITE_DIR . sprintf( TC_REWRITE_FILENAME_FMT , $id ) ;
+			}
+		} else {
+			if( $link == TC_WRAPTYPE_USEREWRITE ) {
+				$href = TC_REWRITE_DIR . sprintf( TC_REWRITE_FILENAME_FMT , $id ) ;
+			} else if( $link == TC_WRAPTYPE_CONTENTBASE ) {
+				$href = "content/index.php?id=$id" ;
+			} else {
+				$href = "index.php?id=$id" ;
+			}
+		}
+
+		$ret[] = array(
+			"image" => "images/content.gif" ,
+			"link" => $href ,
+			"title" => $title ,
+			"time" => $timestamp ,
+			"uid" => "0" ,
+			"context" => $context
+		) ;
+	}
+
+	return $ret ;
+}
+
+}
+
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/include/blocksadmin.inc.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/include/blocksadmin.inc.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/include/blocksadmin.inc.php	(revision 405)
@@ -0,0 +1,613 @@
+<?php
+// $Id: main.php,v 1.12 2004/01/06 09:36:20 okazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+if ( !is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid()) ) {
+  exit('Access Denied');
+}
+include_once XOOPS_ROOT_PATH.'/class/xoopsblock.php';
+include XOOPS_ROOT_PATH.'/modules/system/admin/blocksadmin/blocksadmin.php';
+
+$op = 'list';
+
+if ( !empty($_POST['op']) ) { $op = $_POST['op']; }
+if ( !empty($_POST['bid']) ) { $bid = intval($_POST['bid']); }
+
+if ( isset($_GET['op']) ) {
+  if ($_GET['op'] == 'edit' || $_GET['op'] == 'delete' || $_GET['op'] == 'delete_ok' || $_GET['op'] == 'clone' /* || $_GET['op'] == 'previewpopup'*/) {
+    $op = $_GET['op'];
+    $bid = isset($_GET['bid']) ? intval($_GET['bid']) : 0;
+  }
+}
+$dirname4disp = preg_replace( '[^a-zA-Z0-9_.-]' , '' , @$_GET['dirname'] ) ;
+
+
+if (isset($_POST['previewblock'])) {
+  //if ( !admin_refcheck("/modules/$admin_mydirname/admin/") ) {
+  //  exit('Invalid Referer');
+  //}
+  if ( ! $xoopsGTicket->check( true , 'myblocksadmin' ) ) {
+    redirect_header(XOOPS_URL.'/',3,$xoopsGTicket->getErrors());
+  }
+
+  if( empty( $bid ) ) die( 'Invalid bid.' ) ;
+
+  if ( !empty($_POST['bside']) ) { $bside = intval($_POST['bside']); } else { $bside = 0; }
+  if ( !empty($_POST['bweight']) ) { $bweight = intval($_POST['bweight']); } else { $bweight = 0; }
+  if ( !empty($_POST['bvisible']) ) { $bvisible = intval($_POST['bvisible']); } else { $bvisible = 0; }
+  if ( !empty($_POST['bmodule']) ) { $bmodule = $_POST['bmodule']; } else { $bmodule = array(); }
+  if ( !empty($_POST['btitle']) ) { $btitle = $_POST['btitle']; } else { $btitle = ""; }
+  if ( !empty($_POST['bcontent']) ) { $bcontent = $_POST['bcontent']; } else { $bcontent = ""; }
+  if ( !empty($_POST['bctype']) ) { $bctype = $_POST['bctype']; } else { $bctype = ""; }
+  if ( !empty($_POST['bcachetime']) ) { $bcachetime = intval($_POST['bcachetime']); } else { $bcachetime = 0; }
+  
+  xoops_cp_header();
+  include_once XOOPS_ROOT_PATH.'/class/template.php';
+  $xoopsTpl = new XoopsTpl();
+  $xoopsTpl->xoops_setCaching(0);
+  $block['bid'] = $bid;
+
+  if ($op == 'clone_ok') {
+    $block['form_title'] = _AM_CLONEBLOCK;
+    $block['submit_button'] = _CLONE;
+    $myblock = new XoopsBlock();
+    $myblock->setVar('block_type', 'C');
+  } else {
+    $op = 'update' ;
+    $block['form_title'] = _AM_EDITBLOCK;
+    $block['submit_button'] = _SUBMIT;
+    $myblock = new XoopsBlock($bid);
+    $block['name'] = $myblock->getVar('name');
+  }
+
+  $myts =& MyTextSanitizer::getInstance();
+  $myblock->setVar('title', $myts->stripSlashesGPC($btitle));
+  $myblock->setVar('content', $myts->stripSlashesGPC($bcontent));
+//  $dummyhtml = '<html><head><meta http-equiv="content-type" content="text/html; charset='._CHARSET.'" /><meta http-equiv="content-language" content="'._LANGCODE.'" /><title>'.$xoopsConfig['sitename'].'</title><link rel="stylesheet" type="text/css" media="all" href="'.getcss($xoopsConfig['theme_set']).'" /></head><body><table><tr><th>'.$myblock->getVar('title').'</th></tr><tr><td>'.$myblock->getContent('S', $bctype).'</td></tr></table></body></html>';
+
+  /* $dummyfile = '_dummyfile_'.time().'.html';
+  $fp = fopen(XOOPS_CACHE_PATH.'/'.$dummyfile, 'w');
+  fwrite($fp, $dummyhtml);
+  fclose($fp);*/
+  $block['edit_form'] = false;
+  $block['template'] = '';
+  $block['op'] = $op;
+  $block['side'] = $bside;
+  $block['weight'] = $bweight;
+  $block['visible'] = $bvisible;
+  $block['title'] = $myblock->getVar('title', 'E');
+  $block['content'] = $myblock->getVar('content','n');
+  $block['modules'] =& $bmodule;
+  $block['ctype'] = isset($bctype) ? $bctype : $myblock->getVar('c_type');
+  $block['is_custom'] = true;
+  $block['cachetime'] = intval($bcachetime);
+  echo '<a href="myblocksadmin.php?dirname='.$dirname4disp.'">'. _AM_BADMIN .'</a>&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;'.$block['form_title'].'<br /><br />';
+  include dirname(__FILE__).'/../admin/myblockform.php'; //GIJ
+  //echo '<a href="admin.php?fct=blocksadmin">'. _AM_BADMIN .'</a>&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;'.$block['form_title'].'<br /><br />';
+  //include XOOPS_ROOT_PATH.'/modules/system/admin/blocksadmin/blockform.php';
+  $xoopsGTicket->addTicketXoopsFormElement( $form , __LINE__ , 1800 , 'myblocksadmin' ) ; //GIJ
+  $form->display();
+
+  $original_level = error_reporting( E_ALL ) ;
+  echo "
+    <table width='100%' class='outer' cellspacing='1'>
+      <tr>
+        <th>".$myblock->getVar('title')."</th>
+      </tr>
+      <tr>
+        <td class='odd'>".$myblock->getContent('S', $bctype)."</td>
+      </tr>
+    </table>\n" ;
+  error_reporting( $original_level ) ;
+
+  xoops_cp_footer();
+  /* echo '<script type="text/javascript">
+  preview_window = openWithSelfMain("'.XOOPS_URL.'/modules/system/admin.php?fct=blocksadmin&op=previewpopup&file='.$dummyfile.'", "popup", 250, 200);
+  </script>';*/
+
+  exit();
+}
+
+/* if ($op == 'previewpopup') {
+  if ( !admin_refcheck("/modules/$admin_mydirname/admin/") ) {
+    exit('Invalid Referer');
+  }
+  $file = str_replace('..', '', XOOPS_CACHE_PATH.'/'.trim($_GET['file']));
+  if (file_exists($file)) {
+    include $file;
+    @unlink($file);
+  }
+  exit();
+} */
+
+/* if ( $op == "list" ) {
+  xoops_cp_header();
+  list_blocks();
+  xoops_cp_footer();
+  exit();
+} */
+
+if ( $op == 'order' ) {
+  //if ( !admin_refcheck("/modules/$admin_mydirname/admin/") ) {
+  //  exit('Invalid Referer');
+  //}
+  if ( ! $xoopsGTicket->check( true , 'myblocksadmin' ) ) {
+    redirect_header(XOOPS_URL.'/',3,$xoopsGTicket->getErrors());
+  }
+  if ( !empty($_POST['side']) ) { $side = $_POST['side']; }
+//  if ( !empty($_POST['weight']) ) { $weight = $_POST['weight']; }
+  if ( !empty($_POST['visible']) ) { $visible = $_POST['visible']; }
+//  if ( !empty($_POST['oldside']) ) { $oldside = $_POST['oldside']; }
+//  if ( !empty($_POST['oldweight']) ) { $oldweight = $_POST['oldweight']; }
+//  if ( !empty($_POST['oldvisible']) ) { $oldvisible = $_POST['oldvisible']; }
+  if ( !empty($_POST['bid']) ) { $bid = $_POST['bid']; } else { $bid = array(); }
+  // GIJ start
+  foreach (array_keys($bid) as $i) {
+		if( $side[$i] < 0 ) {
+			$visible[$i] = 0 ;
+			$side[$i] = -1 ;
+		} else {
+			$visible[$i] = 1 ;
+		}
+
+		$bmodule = (isset($_POST['bmodule'][$i]) && is_array($_POST['bmodule'][$i])) ? $_POST['bmodule'][$i] : array(-1) ;
+
+		myblocksadmin_update_block($i, $side[$i], $_POST['weight'][$i], $visible[$i], $_POST['title'][$i], null , null , $_POST['bcachetime'][$i], $bmodule, array());
+
+//    if ( $oldweight[$i] != $weight[$i] || $oldvisible[$i] != $visible[$i] || $oldside[$i] != $side[$i] )
+//    order_block($bid[$i], $weight[$i], $visible[$i], $side[$i]);
+  }
+  redirect_header("myblocksadmin.php?dirname=$dirname4disp",1,_AM_DBUPDATED);
+  // GIJ end
+  exit();
+}
+
+
+if ( $op == 'order2' ) {
+	if ( ! $xoopsGTicket->check( true , 'myblocksadmin' ) ) {
+		redirect_header(XOOPS_URL.'/',3,$xoopsGTicket->getErrors());
+	}
+
+	if( isset( $_POST['addblock'] ) && is_array( $_POST['addblock'] ) ) {
+
+		// addblock
+		foreach( $_POST['addblock'] as $bid => $val ) {
+			myblocksadmin_update_blockinstance( 0, 0, 0, 0, '', null , null , 0, array(), array(), intval( $bid ) );
+		}
+
+	} else {
+
+		// else change order
+		if ( !empty($_POST['side']) ) { $side = $_POST['side']; }
+		if ( !empty($_POST['visible']) ) { $visible = $_POST['visible']; }
+		if ( !empty($_POST['id']) ) { $id = $_POST['id']; } else { $id = array(); }
+
+		foreach (array_keys($id) as $i) {
+			// separate side and visible
+			if( $side[$i] < 0 ) {
+				$visible[$i] = 0 ;
+				$side[$i] = -1 ;  // for not to destroy the original position
+			} else {
+				$visible[$i] = 1 ;
+			}
+
+			$bmodule = (isset($_POST['bmodule'][$i]) && is_array($_POST['bmodule'][$i])) ? $_POST['bmodule'][$i] : array(-1) ;
+	
+			myblocksadmin_update_blockinstance($i, $side[$i], $_POST['weight'][$i], $visible[$i], $_POST['title'][$i], null , null , $_POST['bcachetime'][$i], $bmodule, array());
+
+		}
+	}
+
+	redirect_header("myblocksadmin.php?dirname=$dirname4disp",1,_MD_AM_DBUPDATED);
+	exit;
+}
+
+/* if ( $op == 'save' ) {
+  if ( !admin_refcheck("/modules/$admin_mydirname/admin/") ) {
+    exit('Invalid Referer');
+  }
+  if ( ! $xoopsGTicket->check( true , 'myblocksadmin' ) ) {
+    redirect_header(XOOPS_URL.'/',3,$xoopsGTicket->getErrors());
+  }
+  if ( !empty($_POST['bside']) ) { $bside = intval($_POST['bside']); } else { $bside = 0; }
+  if ( !empty($_POST['bweight']) ) { $bweight = intval($_POST['bweight']); } else { $bweight = 0; }
+  if ( !empty($_POST['bvisible']) ) { $bvisible = intval($_POST['bvisible']); } else { $bvisible = 0; }
+  if ( !empty($_POST['bmodule']) ) { $bmodule = $_POST['bmodule']; } else { $bmodule = array(); }
+  if ( !empty($_POST['btitle']) ) { $btitle = $_POST['btitle']; } else { $btitle = ""; }
+  if ( !empty($_POST['bcontent']) ) { $bcontent = $_POST['bcontent']; } else { $bcontent = ""; }
+  if ( !empty($_POST['bctype']) ) { $bctype = $_POST['bctype']; } else { $bctype = ""; }
+  if ( !empty($_POST['bcachetime']) ) { $bcachetime = intval($_POST['bcachetime']); } else { $bcachetime = 0; }
+  save_block($bside, $bweight, $bvisible, $btitle, $bcontent, $bctype, $bmodule, $bcachetime);
+  exit();
+} */
+
+if ( $op == 'update' ) {
+  //if ( !admin_refcheck("/modules/$admin_mydirname/admin/") ) {
+  //  exit('Invalid Referer');
+  //}
+  if ( ! $xoopsGTicket->check( true , 'myblocksadmin' ) ) {
+    redirect_header(XOOPS_URL.'/',3,$xoopsGTicket->getErrors());
+  }
+/*  if ( !empty($_POST['bside']) ) { $bside = intval($_POST['bside']); } else { $bside = 0; }
+  if ( !empty($_POST['bweight']) ) { $bweight = intval($_POST['bweight']); } else { $bweight = 0; }
+  if ( !empty($_POST['bvisible']) ) { $bvisible = intval($_POST['bvisible']); } else { $bvisible = 0; }
+  if ( !empty($_POST['btitle']) ) { $btitle = $_POST['btitle']; } else { $btitle = ""; }
+  if ( !empty($_POST['bcontent']) ) { $bcontent = $_POST['bcontent']; } else { $bcontent = ""; }
+  if ( !empty($_POST['bctype']) ) { $bctype = $_POST['bctype']; } else { $bctype = ""; }
+  if ( !empty($_POST['bcachetime']) ) { $bcachetime = intval($_POST['bcachetime']); } else { $bcachetime = 0; }
+  if ( !empty($_POST['bmodule']) ) { $bmodule = $_POST['bmodule']; } else { $bmodule = array(); }
+  if ( !empty($_POST['options']) ) { $options = $_POST['options']; } else { $options = array(); }
+  update_block($bid, $bside, $bweight, $bvisible, $btitle, $bcontent, $bctype, $bcachetime, $bmodule, $options);*/
+
+	$bcachetime = isset($_POST['bcachetime']) ? intval($_POST['bcachetime']) : 0;
+	$options = isset($_POST['options']) ? $_POST['options'] : array();
+	$bcontent = isset($_POST['bcontent']) ? $_POST['bcontent'] : '';
+	$bctype = isset($_POST['bctype']) ? $_POST['bctype'] : '';
+	$bmodule = (isset($_POST['bmodule']) && is_array($_POST['bmodule'])) ? $_POST['bmodule'] : array(-1) ; // GIJ +
+	$msg = myblocksadmin_update_block($_POST['bid'], $_POST['bside'], $_POST['bweight'], $_POST['bvisible'], $_POST['btitle'], $bcontent, $bctype, $bcachetime, $bmodule, $options); // GIJ !
+	redirect_header("myblocksadmin.php?dirname=$dirname4disp",1,$msg);
+}
+
+
+if ( $op == 'delete_ok' ) {
+  //if ( !admin_refcheck("/modules/$admin_mydirname/admin/") ) {
+  //  exit('Invalid Referer');
+  //}
+  if ( ! $xoopsGTicket->check( true , 'myblocksadmin' ) ) {
+    redirect_header(XOOPS_URL.'/',3,$xoopsGTicket->getErrors());
+  }
+  // delete_block_ok($bid); GIJ imported from blocksadmin.php
+		$myblock = new XoopsBlock($bid);
+		if ( $myblock->getVar('block_type') != 'D' && $myblock->getVar('block_type') != 'C' ) {
+			redirect_header('myblocksadmin.php',4,'Invalid block');
+			exit();
+		}
+		$myblock->delete();
+		if ($myblock->getVar('template') != '' && ! defined('XOOPS_ORETEKI') ) {
+			$tplfile_handler =& xoops_gethandler('tplfile');
+			$btemplate =& $tplfile_handler->find($GLOBALS['xoopsConfig']['template_set'], 'block', $bid);
+			if (count($btemplate) > 0) {
+				$tplman->delete($btemplate[0]);
+			}
+		}
+		redirect_header("myblocksadmin.php?dirname=$dirname4disp",1,_AM_DBUPDATED);
+		exit();
+  // end of delete_block_ok() GIJ
+  exit();
+}
+
+if ( $op == 'delete' ) {
+  xoops_cp_header();
+  // delete_block($bid); GIJ imported from blocksadmin.php
+		$myblock = new XoopsBlock($bid);
+		if ( $myblock->getVar('block_type') == 'S' ) {
+			$message = _AM_SYSTEMCANT;
+			redirect_header('admin.php?fct=blocksadmin',4,$message);
+			exit();
+		} elseif ($myblock->getVar('block_type') == 'M') {
+			$message = _AM_MODULECANT;
+			redirect_header('admin.php?fct=blocksadmin',4,$message);
+			exit();
+		} else {
+			xoops_confirm(array('fct' => 'blocksadmin', 'op' => 'delete_ok', 'bid' => $myblock->getVar('bid')) + $xoopsGTicket->getTicketArray( __LINE__ , 1800 , 'myblocksadmin' ) , "admin.php?dirname=$dirname4disp", sprintf(_AM_RUSUREDEL,$myblock->getVar('title')));
+		}
+  // end of delete_block() GIJ
+  xoops_cp_footer();
+  exit();
+}
+
+if ( $op == 'edit' ) {
+
+  xoops_cp_header();
+  // edit_block($bid); GIJ imported from blocksadmin.php
+		$myblock = new XoopsBlock($bid);
+
+		$db =& Database::getInstance();
+		$sql = 'SELECT module_id FROM '.$db->prefix('block_module_link').' WHERE block_id='.intval($bid);
+		$result = $db->query($sql);
+		$modules = array();
+		while ($row = $db->fetchArray($result)) {
+			$modules[] = intval($row['module_id']);
+		}
+		$is_custom = ($myblock->getVar('block_type') == 'C' || $myblock->getVar('block_type') == 'E') ? true : false;
+		$block = array('form_title' => _AM_EDITBLOCK, 'name' => $myblock->getVar('name'), 'side' => $myblock->getVar('side'), 'weight' => $myblock->getVar('weight'), 'visible' => $myblock->getVar('visible'), 'title' => $myblock->getVar('title','E'), 'content' => $myblock->getVar('content','n'), 'modules' => $modules, 'is_custom' => $is_custom, 'ctype' => $myblock->getVar('c_type'), 'cachetime' => $myblock->getVar('bcachetime'), 'op' => 'update', 'bid' => $myblock->getVar('bid'), 'edit_form' => $myblock->getOptions(), 'template' => $myblock->getVar('template'), 'options' => $myblock->getVar('options'), 'submit_button' => _SUBMIT);
+
+		echo '<a href="myblocksadmin.php?dirname='.$dirname4disp.'">'. _AM_BADMIN .'</a>&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;'._AM_EDITBLOCK.'<br /><br />';
+		include dirname(__FILE__).'/../admin/myblockform.php'; //GIJ
+		$xoopsGTicket->addTicketXoopsFormElement( $form , __LINE__ , 1800 , 'myblocksadmin' ) ; //GIJ
+		$form->display();
+  // end of edit_block() GIJ
+  xoops_cp_footer();
+  exit();
+}
+
+
+if ($op == 'clone') {
+	xoops_cp_header();
+	$myblock = new XoopsBlock($bid);
+
+	$db =& Database::getInstance();
+	$sql = 'SELECT module_id FROM '.$db->prefix('block_module_link').' WHERE block_id='.intval($bid);
+	$result = $db->query($sql);
+	$modules = array();
+	while ($row = $db->fetchArray($result)) {
+		$modules[] = intval($row['module_id']);
+	}
+	$is_custom = ($myblock->getVar('block_type') == 'C' || $myblock->getVar('block_type') == 'E') ? true : false;
+	$block = array('form_title' => _AM_CLONEBLOCK, 'name' => $myblock->getVar('name'), 'side' => $myblock->getVar('side'), 'weight' => $myblock->getVar('weight'), 'visible' => $myblock->getVar('visible'), 'content' => $myblock->getVar('content', 'N'), 'title' => $myblock->getVar('title','E'), 'modules' => $modules, 'is_custom' => $is_custom, 'ctype' => $myblock->getVar('c_type'), 'cachetime' => $myblock->getVar('bcachetime'), 'op' => 'clone_ok', 'bid' => $myblock->getVar('bid'), 'edit_form' => $myblock->getOptions(), 'template' => $myblock->getVar('template'), 'options' => $myblock->getVar('options'), 'submit_button' => _CLONE);
+	echo '<a href="myblocksadmin.php?dirname='.$dirname4disp.'">'. _AM_BADMIN .'</a>&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;'._AM_CLONEBLOCK.'<br /><br />';
+	include dirname(__FILE__).'/../admin/myblockform.php';
+	$xoopsGTicket->addTicketXoopsFormElement( $form , __LINE__ , 1800 , 'myblocksadmin' ) ; //GIJ
+	$form->display();
+	xoops_cp_footer();
+	exit();
+}
+
+
+if ($op == 'clone_ok') {
+	// Ticket Check
+	if ( ! $xoopsGTicket->check( true , 'myblocksadmin' ) ) {
+		redirect_header(XOOPS_URL.'/',3,$xoopsGTicket->getErrors());
+	}
+
+	$block = new XoopsBlock($bid);
+
+	// block type check
+	$block_type = $block->getVar('block_type') ;
+	if( $block_type != 'C' && $block_type != 'M' && $block_type != 'D' ) {
+		redirect_header('myblocksadmin.php',4,'Invalid block');
+	}
+
+	if( empty( $_POST['options'] ) ) $options = array() ;
+	else if( is_array( $_POST['options'] ) ) $options = $_POST['options'] ;
+	else $options = explode( '|' , $_POST['options'] ) ;
+
+	// for backward compatibility
+	// $cblock =& $block->clone(); or $cblock =& $block->xoopsClone();
+	$cblock = new XoopsBlock() ;
+	foreach( $block->vars as $k => $v ) {
+		$cblock->assignVar( $k , $v['value'] ) ;
+	}
+	$cblock->setNew();
+
+	$myts =& MyTextSanitizer::getInstance();
+	$cblock->setVar('side', $_POST['bside']);
+	$cblock->setVar('weight', $_POST['bweight']);
+	$cblock->setVar('visible', $_POST['bvisible']);
+	$cblock->setVar('title', $_POST['btitle']);
+	$cblock->setVar('content', @$_POST['bcontent']);
+	$cblock->setVar('c_type', @$_POST['bctype']);
+	$cblock->setVar('bcachetime', $_POST['bcachetime']);
+	if ( isset($options) && (count($options) > 0) ) {
+		$options = implode('|', $options);
+		$cblock->setVar('options', $options);
+	}
+	$cblock->setVar('bid', 0);
+	$cblock->setVar('block_type', $block_type == 'C' ? 'C' : 'D' );
+	$cblock->setVar('func_num', 255);
+	$newid = $cblock->store();
+	if (!$newid) {
+		xoops_cp_header();
+		$cblock->getHtmlErrors();
+		xoops_cp_footer();
+		exit();
+	}
+/*	if ($cblock->getVar('template') != '') {
+		$tplfile_handler =& xoops_gethandler('tplfile');
+		$btemplate =& $tplfile_handler->find($GLOBALS['xoopsConfig']['template_set'], 'block', $bid);
+		if (count($btemplate) > 0) {
+			$tplclone =& $btemplate[0]->clone();
+			$tplclone->setVar('tpl_id', 0);
+			$tplclone->setVar('tpl_refid', $newid);
+			$tplman->insert($tplclone);
+		}
+	} */
+	$db =& Database::getInstance();
+	$bmodule = (isset($_POST['bmodule']) && is_array($_POST['bmodule'])) ? $_POST['bmodule'] : array(-1) ; // GIJ +
+	foreach( $bmodule as $bmid ) {
+		$sql = 'INSERT INTO '.$db->prefix('block_module_link').' (block_id, module_id) VALUES ('.$newid.', '.$bmid.')';
+		$db->query($sql);
+	}
+
+/*	global $xoopsUser;
+	$groups =& $xoopsUser->getGroups();
+	$count = count($groups);
+	for ($i = 0; $i < $count; $i++) {
+		$sql = "INSERT INTO ".$db->prefix('group_permission')." (gperm_groupid, gperm_itemid, gperm_modid, gperm_name) VALUES (".$groups[$i].", ".$newid.", 1, 'block_read')";
+		$db->query($sql);
+	}
+*/
+
+	$sql = "SELECT gperm_groupid FROM ".$db->prefix('group_permission')." WHERE gperm_name='block_read' AND gperm_modid='1' AND gperm_itemid='$bid'" ;
+	$result = $db->query($sql);
+	while( list( $gid ) = $db->fetchRow( $result ) ) {
+		$sql = "INSERT INTO ".$db->prefix('group_permission')." (gperm_groupid, gperm_itemid, gperm_modid, gperm_name) VALUES ($gid, $newid, 1, 'block_read')";
+		$db->query($sql);
+	}
+
+	redirect_header("myblocksadmin.php?dirname=$dirname4disp",1,_AM_DBUPDATED);
+}
+
+	// import from modules/system/admin/blocksadmin/blocksadmin.php
+	function myblocksadmin_update_block($bid, $bside, $bweight, $bvisible, $btitle, $bcontent, $bctype, $bcachetime, $bmodule, $options=array())
+	{
+		global $xoopsConfig;
+		/* if (empty($bmodule)) {
+			xoops_cp_header();
+			xoops_error(sprintf(_AM_NOTSELNG, _AM_VISIBLEIN));
+			xoops_cp_footer();
+			exit();
+		} */
+		$myblock = new XoopsBlock($bid);
+		// $myblock->setVar('side', $bside); GIJ -
+		if( $bside >= 0 ) $myblock->setVar('side', $bside); // GIJ +
+		$myblock->setVar('weight', $bweight);
+		$myblock->setVar('visible', $bvisible);
+		$myblock->setVar('title', $btitle);
+		if( isset( $bcontent ) ) $myblock->setVar('content', $bcontent);
+		if( isset( $bctype ) ) $myblock->setVar('c_type', $bctype);
+		$myblock->setVar('bcachetime', $bcachetime);
+		if ( isset($options) && (count($options) > 0) ) {
+			$options = implode('|', $options);
+			$myblock->setVar('options', $options);
+		}
+		if ( $myblock->getVar('block_type') == 'C') {
+			switch ( $myblock->getVar('c_type') ) {
+			case 'H':
+				$name = _AM_CUSTOMHTML;
+				break;
+			case 'P':
+				$name = _AM_CUSTOMPHP;
+				break;
+			case 'S':
+				$name = _AM_CUSTOMSMILE;
+				break;
+			default:
+				$name = _AM_CUSTOMNOSMILE;
+				break;
+			}
+			$myblock->setVar('name', $name);
+		}
+		$msg = _AM_DBUPDATED;
+		if ($myblock->store() != false) {
+			$db =& Database::getInstance();
+			$sql = sprintf("DELETE FROM %s WHERE block_id = %u", $db->prefix('block_module_link'), $bid);
+			$db->query($sql);
+			foreach ($bmodule as $bmid) {
+				$sql = sprintf("INSERT INTO %s (block_id, module_id) VALUES (%u, %d)", $db->prefix('block_module_link'), $bid, intval($bmid));
+				$db->query($sql);
+			}
+			include_once XOOPS_ROOT_PATH.'/class/template.php';
+			$xoopsTpl = new XoopsTpl();
+			$xoopsTpl->xoops_setCaching(2);
+			if ($myblock->getVar('template') != '') {
+				if ($xoopsTpl->is_cached('db:'.$myblock->getVar('template'))) {
+					if (!$xoopsTpl->clear_cache('db:'.$myblock->getVar('template'))) {
+						$msg = 'Unable to clear cache for block ID'.$bid;
+					}
+				}
+			} else {
+				if ($xoopsTpl->is_cached('db:system_dummy.html', 'block'.$bid)) {
+					if (!$xoopsTpl->clear_cache('db:system_dummy.html', 'block'.$bid)) {
+						$msg = 'Unable to clear cache for block ID'.$bid;
+					}
+				}
+			}
+		} else {
+			$msg = 'Failed update of block. ID:'.$bid;
+		}
+		// redirect_header('admin.php?fct=blocksadmin&amp;t='.time(),1,$msg);
+		// exit(); GIJ -
+		return $msg ; // GIJ +
+	}
+
+
+	// update block instance for 2.2
+	function myblocksadmin_update_blockinstance($id, $bside, $bweight, $bvisible, $btitle, $bcontent, $bctype, $bcachetime, $bmodule, $options=array(), $bid=null)
+	{
+		global $xoopsDB ;
+
+		$instance_handler =& xoops_gethandler('blockinstance');
+		$block_handler =& xoops_gethandler('block') ;
+		if ($id > 0) {
+			// update
+			$instance =& $instance_handler->get($id);
+			if( $bside >= 0 ) $instance->setVar('side', $bside);
+			if( ! empty($options) ) $instance->setVar('options', $options);
+		} else {
+			// insert
+			$instance =& $instance_handler->create();
+			$instance->setVar( 'bid' , $bid ) ;
+			$instance->setVar('side', $bside);
+			$block = $block_handler->get( $bid ) ;
+			$instance->setVar('options', $block->getVar("options") );
+			if( empty( $btitle ) ) $btitle = $block->getVar("name") ;
+		}
+		$instance->setVar('weight', $bweight);
+		$instance->setVar('visible', $bvisible);
+		$instance->setVar('title', $btitle);
+		// if( isset( $bcontent ) ) $instance->setVar('content', $bcontent);
+		// if( isset( $bctype ) ) $instance->setVar('c_type', $bctype);
+		$instance->setVar('bcachetime', $bcachetime);
+
+		if ($instance_handler->insert($instance)) {
+			$GLOBALS['xoopsDB']->query("DELETE FROM ".$GLOBALS['xoopsDB']->prefix('block_module_link')." WHERE block_id=".$instance->getVar('instanceid'));
+			foreach ($bmodule as $mid) {
+				$page = explode('-', $mid);
+				$mid = $page[0];
+				$pageid = $page[1];
+				$GLOBALS['xoopsDB']->query("INSERT INTO ".$GLOBALS['xoopsDB']->prefix('block_module_link')." VALUES (".$instance->getVar('instanceid').", ".intval($mid).", ".intval($pageid).")");
+			}
+			return _MD_AM_DBUPDATED;
+		}
+		return 'Failed update of block instance. ID:'.$id;
+
+/*		// NAME for CUSTOM BLOCK
+		if ( $instance->getVar('block_type') == 'C') {
+			switch ( $instance->getVar('c_type') ) {
+			case 'H':
+				$name = _AM_CUSTOMHTML;
+				break;
+			case 'P':
+				$name = _AM_CUSTOMPHP;
+				break;
+			case 'S':
+				$name = _AM_CUSTOMSMILE;
+				break;
+			default:
+				$name = _AM_CUSTOMNOSMILE;
+				break;
+			}
+			$instance->setVar('name', $name);
+		}
+*/
+/*			// CLEAR TEMPLATE CACHE
+			include_once XOOPS_ROOT_PATH.'/class/template.php';
+			$xoopsTpl = new XoopsTpl();
+			$xoopsTpl->xoops_setCaching(2);
+			if ($instance->getVar('template') != '') {
+				if ($xoopsTpl->is_cached('db:'.$instance->getVar('template'))) {
+					if (!$xoopsTpl->clear_cache('db:'.$instance->getVar('template'))) {
+						$msg = 'Unable to clear cache for block ID'.$bid;
+					}
+				}
+			} else {
+				if ($xoopsTpl->is_cached('db:system_dummy.html', 'block'.$bid)) {
+					if (!$xoopsTpl->clear_cache('db:system_dummy.html', 'block'.$bid)) {
+						$msg = 'Unable to clear cache for block ID'.$bid;
+					}
+				}
+			}
+*/
+	}
+
+	// TODO  edit2, delete2, customblocks
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/include/Text_Diff_Renderer_inline.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/include/Text_Diff_Renderer_inline.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/include/Text_Diff_Renderer_inline.php	(revision 405)
@@ -0,0 +1,152 @@
+<?php
+/**
+ * "Inline" diff renderer.
+ *
+ * This class renders diffs in the Wiki-style "inline" format.
+ *
+ * $Horde: framework/Text_Diff/Diff/Renderer/inline.php,v 1.14 2005/07/22 19:45:15 chuck Exp $
+ *
+ * @author  Ciprian Popovici
+ * @package Text_Diff
+ */
+class Text_Diff_Renderer_inline extends Text_Diff_Renderer {
+
+    /**
+     * Number of leading context "lines" to preserve.
+     */
+    var $_leading_context_lines = 10000;
+
+    /**
+     * Number of trailing context "lines" to preserve.
+     */
+    var $_trailing_context_lines = 10000;
+
+    /**
+     * Prefix for inserted text.
+     */
+    var $_ins_prefix = '<ins>';
+
+    /**
+     * Suffix for inserted text.
+     */
+    var $_ins_suffix = '</ins>';
+
+    /**
+     * Prefix for deleted text.
+     */
+    var $_del_prefix = '<del>';
+
+    /**
+     * Suffix for deleted text.
+     */
+    var $_del_suffix = '</del>';
+
+    /**
+     * Header for each change block.
+     */
+    var $_block_header = '';
+
+    /**
+     * What are we currently splitting on? Used to recurse to show word-level
+     * changes.
+     */
+    var $_split_level = 'lines';
+
+    function _blockHeader($xbeg, $xlen, $ybeg, $ylen)
+    {
+        return $this->_block_header;
+    }
+
+    function _startBlock($header)
+    {
+        return $header;
+    }
+
+    function _lines($lines, $prefix = ' ', $encode = true)
+    {
+        if ($encode) {
+            array_walk($lines, array(&$this, '_encode'));
+        }
+
+        if ($this->_split_level == 'words') {
+            return implode('', $lines);
+        } else {
+            return implode("\n", $lines) . "\n";
+        }
+    }
+
+    function _added($lines)
+    {
+        array_walk($lines, array(&$this, '_encode'));
+        $lines[0] = $this->_ins_prefix . $lines[0];
+        $lines[count($lines) - 1] .= $this->_ins_suffix;
+        return $this->_lines($lines, ' ', false);
+    }
+
+    function _deleted($lines, $words = false)
+    {
+        array_walk($lines, array(&$this, '_encode'));
+        $lines[0] = $this->_del_prefix . $lines[0];
+        $lines[count($lines) - 1] .= $this->_del_suffix;
+        return $this->_lines($lines, ' ', false);
+    }
+
+    function _changed($orig, $final)
+    {
+        /* If we've already split on words, don't try to do so again - just
+         * display. */
+        if ($this->_split_level == 'words') {
+            $prefix = '';
+            while ($orig[0] !== false && $final[0] !== false &&
+                   substr($orig[0], 0, 1) == ' ' &&
+                   substr($final[0], 0, 1) == ' ') {
+                $prefix .= substr($orig[0], 0, 1);
+                $orig[0] = substr($orig[0], 1);
+                $final[0] = substr($final[0], 1);
+            }
+            return $prefix . $this->_deleted($orig) . $this->_added($final);
+        }
+
+        $text1 = implode("\n", $orig);
+        $text2 = implode("\n", $final);
+
+        /* Non-printing newline marker. */
+        $nl = "\0";
+
+        /* We want to split on word boundaries, but we need to
+         * preserve whitespace as well. Therefore we split on words,
+         * but include all blocks of whitespace in the wordlist. */
+        $diff = &new Text_Diff($this->_splitOnWords($text1, $nl),
+                               $this->_splitOnWords($text2, $nl));
+
+        /* Get the diff in inline format. */
+        $renderer = &new Text_Diff_Renderer_inline(array_merge($this->getParams(),
+                                                               array('split_level' => 'words')));
+
+        /* Run the diff and get the output. */
+        return str_replace($nl, "\n", $renderer->render($diff)) . "\n";
+    }
+
+    function _splitOnWords($string, $newlineEscape = "\n")
+    {
+        $words = array();
+        $length = strlen($string);
+        $pos = 0;
+
+        while ($pos < $length) {
+            // Eat a word with any preceding whitespace.
+            $spaces = strspn(substr($string, $pos), " \n");
+            $nextpos = strcspn(substr($string, $pos + $spaces), " \n");
+            $words[] = str_replace("\n", $newlineEscape, substr($string, $pos, $spaces + $nextpos));
+            $pos += $spaces + $nextpos;
+        }
+
+        return $words;
+    }
+
+    function _encode(&$string)
+    {
+        $string = htmlspecialchars($string);
+    }
+
+}
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/include/Text_Diff_Renderer.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/include/Text_Diff_Renderer.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/include/Text_Diff_Renderer.php	(revision 405)
@@ -0,0 +1,209 @@
+<?php
+/**
+ * A class to render Diffs in different formats.
+ *
+ * This class renders the diff in classic diff format. It is intended that
+ * this class be customized via inheritance, to obtain fancier outputs.
+ *
+ * $Horde: framework/Text_Diff/Diff/Renderer.php,v 1.9 2005/05/04 20:21:52 chuck Exp $
+ *
+ * @package Text_Diff
+ */
+class Text_Diff_Renderer {
+
+    /**
+     * Number of leading context "lines" to preserve.
+     *
+     * This should be left at zero for this class, but subclasses may want to
+     * set this to other values.
+     */
+    var $_leading_context_lines = 0;
+
+    /**
+     * Number of trailing context "lines" to preserve.
+     *
+     * This should be left at zero for this class, but subclasses may want to
+     * set this to other values.
+     */
+    var $_trailing_context_lines = 0;
+
+    /**
+     * Constructor.
+     */
+    function Text_Diff_Renderer($params = array())
+    {
+        foreach ($params as $param => $value) {
+            $v = '_' . $param;
+            if (isset($this->$v)) {
+                $this->$v = $value;
+            }
+        }
+    }
+
+    /**
+     * Get any renderer parameters.
+     *
+     * @return array  All parameters of this renderer object.
+     */
+    function getParams()
+    {
+        $params = array();
+        foreach (get_object_vars($this) as $k => $v) {
+            if ($k{0} == '_') {
+                $params[substr($k, 1)] = $v;
+            }
+        }
+
+        return $params;
+    }
+
+    /**
+     * Renders a diff.
+     *
+     * @param Text_Diff $diff  A Text_Diff object.
+     *
+     * @return string  The formatted output.
+     */
+    function render($diff)
+    {
+        $xi = $yi = 1;
+        $block = false;
+        $context = array();
+
+        $nlead = $this->_leading_context_lines;
+        $ntrail = $this->_trailing_context_lines;
+
+        $output = $this->_startDiff();
+
+        foreach ($diff->getDiff() as $edit) {
+            if (is_a($edit, 'Text_Diff_Op_copy')) {
+                if (is_array($block)) {
+                    if (count($edit->orig) <= $nlead + $ntrail) {
+                        $block[] = $edit;
+                    } else {
+                        if ($ntrail) {
+                            $context = array_slice($edit->orig, 0, $ntrail);
+                            $block[] = &new Text_Diff_Op_copy($context);
+                        }
+                        $output .= $this->_block($x0, $ntrail + $xi - $x0,
+                                                 $y0, $ntrail + $yi - $y0,
+                                                 $block);
+                        $block = false;
+                    }
+                }
+                $context = $edit->orig;
+            } else {
+                if (!is_array($block)) {
+                    $context = array_slice($context, count($context) - $nlead);
+                    $x0 = $xi - count($context);
+                    $y0 = $yi - count($context);
+                    $block = array();
+                    if ($context) {
+                        $block[] = &new Text_Diff_Op_copy($context);
+                    }
+                }
+                $block[] = $edit;
+            }
+
+            if ($edit->orig) {
+                $xi += count($edit->orig);
+            }
+            if ($edit->final) {
+                $yi += count($edit->final);
+            }
+        }
+
+        if (is_array($block)) {
+            $output .= $this->_block($x0, $xi - $x0,
+                                     $y0, $yi - $y0,
+                                     $block);
+        }
+
+        return $output . $this->_endDiff();
+    }
+
+    function _block($xbeg, $xlen, $ybeg, $ylen, &$edits)
+    {
+        $output = $this->_startBlock($this->_blockHeader($xbeg, $xlen, $ybeg, $ylen));
+
+        foreach ($edits as $edit) {
+            switch (strtolower(get_class($edit))) {
+            case 'text_diff_op_copy':
+                $output .= $this->_context($edit->orig);
+                break;
+
+            case 'text_diff_op_add':
+                $output .= $this->_added($edit->final);
+                break;
+
+            case 'text_diff_op_delete':
+                $output .= $this->_deleted($edit->orig);
+                break;
+
+            case 'text_diff_op_change':
+                $output .= $this->_changed($edit->orig, $edit->final);
+                break;
+            }
+        }
+
+        return $output . $this->_endBlock();
+    }
+
+    function _startDiff()
+    {
+        return '';
+    }
+
+    function _endDiff()
+    {
+        return '';
+    }
+
+    function _blockHeader($xbeg, $xlen, $ybeg, $ylen)
+    {
+        if ($xlen > 1) {
+            $xbeg .= ',' . ($xbeg + $xlen - 1);
+        }
+        if ($ylen > 1) {
+            $ybeg .= ',' . ($ybeg + $ylen - 1);
+        }
+
+        return $xbeg . ($xlen ? ($ylen ? 'c' : 'd') : 'a') . $ybeg;
+    }
+
+    function _startBlock($header)
+    {
+        return $header . "\n";
+    }
+
+    function _endBlock()
+    {
+        return '';
+    }
+
+    function _lines($lines, $prefix = ' ')
+    {
+        return $prefix . implode("\n$prefix", $lines) . "\n";
+    }
+
+    function _context($lines)
+    {
+        return $this->_lines($lines);
+    }
+
+    function _added($lines)
+    {
+        return $this->_lines($lines, '>');
+    }
+
+    function _deleted($lines)
+    {
+        return $this->_lines($lines, '<');
+    }
+
+    function _changed($orig, $final)
+    {
+        return $this->_deleted($orig) . "---\n" . $this->_added($final);
+    }
+
+}
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/include/constants.inc.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/include/constants.inc.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/include/constants.inc.php	(revision 405)
@@ -0,0 +1,18 @@
+<?php
+
+if( ! defined( 'TC_CONSTANTS_LOADED' ) ) {
+
+define('TC_CONSTANTS_LOADED',1);
+
+define('TC_REWRITE_DIR' , 'rewrite/');
+define('TC_REWRITE_FILENAME_FMT','tc_%s.html');
+
+define('TC_WRAPTYPE_NONE',0);
+define('TC_WRAPTYPE_NORMAL',1);
+define('TC_WRAPTYPE_CONTENTBASE',2);
+define('TC_WRAPTYPE_USEREWRITE',3);
+define('TC_WRAPTYPE_CHANGESRCHREF',4);
+
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/include/print.inc.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/include/print.inc.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/include/print.inc.php	(revision 405)
@@ -0,0 +1,89 @@
+<?php
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+// ------------------------------------------------------------------------- //
+// Hacker: GIJ=CHECKMATE (AKA GIJOE)                                         //
+// Site: http://www.peak.ne.jp/xoops/                                        //
+// ------------------------------------------------------------------------- //
+
+if( ! defined( 'XOOPS_ROOT_PATH' ) ) exit ;
+
+require_once( XOOPS_ROOT_PATH.'/class/template.php' ) ;
+
+// $myts
+$myts =& MyTextSanitizer::getInstance() ;
+
+extract( $result_array ) ;
+
+// header part
+header( 'Content-Type:text/html; charset='._CHARSET ) ;
+$tpl = new XoopsTpl();
+$tpl->xoops_setTemplateDir(XOOPS_ROOT_PATH.'/themes');
+$tpl->xoops_setCaching(2);
+$tpl->xoops_setCacheTime(0);
+
+$tpl->assign('charset', _CHARSET);
+$tpl->assign('sitename', $xoopsConfig['sitename']);
+$tpl->assign('site_url', XOOPS_URL);
+$tpl->assign('content_url', XOOPS_URL."/modules/$mydirname/index.php?id=$storyid");
+$tpl->assign('lang_comesfrom', sprintf(_TC_THISCOMESFROM, $xoopsConfig['sitename']));
+$tpl->assign('lang_contentfrom', _TC_URLFORSTORY);
+
+$myts =& MyTextSanitizer::getInstance() ;
+$tpl->assign( 'title' , $myts->makeTboxData4Show( $title ) ) ;
+
+$tpl->assign( 'modulename' , $xoopsModule->getVar('name') ) ;
+
+// getting "content"
+if( $link > 0 ) {
+
+	// external (=wrapped) content
+	$wrap_file = "$mymodpath/content/$address" ;
+	if( ! file_exists( $wrap_file ) ) {
+		redirect_header( XOOPS_URL , 2 , _TC_FILENOTFOUND ) ;
+		exit ;
+	}
+
+	ob_start() ;
+	include( $wrap_file ) ;
+	$content = tc_convert_wrap_to_ie( ob_get_contents() ) ;
+	if( $link == TC_WRAPTYPE_CHANGESRCHREF ) $content = tc_change_srchref( $content , XOOPS_URL . "/modules/$mydirname/content" ) ;
+	ob_end_clean() ;
+
+} else {
+
+	$content = tc_content_render( $text , $nohtml , $nosmiley , $nobreaks ,  $xoopsModuleConfig['tc_space2nbsp'] ) ;
+
+}
+
+// convert from {X_SITEURL} to XOOPS_URL
+$content = str_replace( '{X_SITEURL}' , XOOPS_URL , $content ) ;
+
+$tpl->assign( 'content' , $content ) ;
+
+$main_template = empty( $tinyd_singlecontent ) ? "db:tinycontent{$mydirnumber}_print.html" : "db:tinycontent{$mydirnumber}_index.html" ;
+
+$tpl->display( $main_template ) ;
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/include/.htaccess
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/include/.htaccess	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/include/.htaccess	(revision 405)
@@ -0,0 +1,2 @@
+order deny,allow
+deny from all
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/include/Text_Diff_Renderer_unified.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/include/Text_Diff_Renderer_unified.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/include/Text_Diff_Renderer_unified.php	(revision 405)
@@ -0,0 +1,49 @@
+<?php
+/**
+ * "Unified" diff renderer.
+ *
+ * This class renders the diff in classic "unified diff" format.
+ *
+ * $Horde: framework/Text_Diff/Diff/Renderer/unified.php,v 1.2 2004/01/09 21:46:30 chuck Exp $
+ *
+ * @package Text_Diff
+ */
+class Text_Diff_Renderer_unified extends Text_Diff_Renderer {
+
+    /**
+     * Number of leading context "lines" to preserve.
+     */
+    var $_leading_context_lines = 4;
+
+    /**
+     * Number of trailing context "lines" to preserve.
+     */
+    var $_trailing_context_lines = 4;
+
+    function _blockHeader($xbeg, $xlen, $ybeg, $ylen)
+    {
+        if ($xlen != 1) {
+            $xbeg .= ',' . $xlen;
+        }
+        if ($ylen != 1) {
+            $ybeg .= ',' . $ylen;
+        }
+        return "@@ -$xbeg +$ybeg @@";
+    }
+
+    function _added($lines)
+    {
+        return $this->_lines($lines, '+');
+    }
+
+    function _deleted($lines)
+    {
+        return $this->_lines($lines, '-');
+    }
+
+    function _changed($orig, $final)
+    {
+        return $this->_deleted($orig) . $this->_added($final);
+    }
+
+}
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/include/updateblock.inc.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/include/updateblock.inc.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/include/updateblock.inc.php	(revision 405)
@@ -0,0 +1,99 @@
+<?php
+// $Id$
+
+if( ! defined( 'XOOPS_ROOT_PATH' ) ) exit ;
+
+if( substr( XOOPS_VERSION , 6 , 3 ) < 2.1 ) {
+
+	// Keep Block option values when update (by nobunobu)
+	global $xoopsDB;
+	$query = "SELECT mid FROM ".$xoopsDB->prefix('modules')." WHERE dirname='".$modversion['dirname']."' ";
+	$result = $xoopsDB->query($query);
+	$record= $xoopsDB->fetcharray($result);
+	if ($record) {
+		$mid = $record['mid'];
+		$count = count($modversion['blocks']);
+		/* $sql = "SELECT * FROM ".$xoopsDB->prefix('newblocks')." WHERE mid=".$mid." AND block_type ='D'";
+		$fresult = $xoopsDB->query($sql);
+		$n_funcnum = $count;
+		while ($fblock = $xoopsDB->fetchArray($fresult)) {
+			$bnum = 0;
+			for ($i = 1 ; $i <= $count ; $i++) {
+				if (($modversion['blocks'][$i]['file'] == $fblock['func_file']) and ($modversion['blocks'][$i]['show_func'] == $fblock['show_func'])) {
+					$bnum = $i;
+					break;
+				}
+			}
+			if($bnum) {
+				$n_funcnum++;
+				$modversion['blocks'][$n_funcnum]['file'] = $fblock['func_file'];
+				$modversion['blocks'][$n_funcnum]['name'] = $fblock['name'];
+				$modversion['blocks'][$n_funcnum]['description'] = $fblock['name'];
+				$modversion['blocks'][$n_funcnum]['show_func'] = $fblock['show_func'];
+				$modversion['blocks'][$n_funcnum]['edit_func'] = $fblock['edit_func'];
+				$modversion['blocks'][$n_funcnum]['template'] = $fblock['template'];
+				if ($fblock['options']) {
+					$old_vals=explode("|",$fblock['options']);
+					$def_vals=explode("|",$modversion['blocks'][$bnum]['options']);
+					if (count($old_vals) == count($def_vals)) {
+						// the number of parameters is not changed
+						$modversion['blocks'][$n_funcnum]['options'] = $fblock['options'];
+						$local_msgs[] = "Option's values of the cloned block <b>".$fblock['name']."</b> will be kept. (value = <b>".$fblock['options']."</b>)";
+					} else if (count($old_vals) < count($def_vals)){
+						// the number of parameters is increased
+						for ($j=0; $j < count($old_vals); $j++) {
+							$def_vals[$j] = $old_vals[$j];
+						}
+						$modversion['blocks'][$n_funcnum]['options'] = implode("|",$def_vals);
+						$local_msgs[] = "Option's values of the cloned block <b>".$fblock['name']."</b> will be kept and new options are added. (value = <b>".$modversion['blocks'][$fblock['func_num']]['options']."</b>)";
+					} else {
+						$modversion['blocks'][$n_funcnum]['options'] = implode("|",$def_vals);
+						$local_msgs[] = "Option's values of the cloned block <b>".$fblock['name']."</b> will be reset to the default, because of some decrease of options. (value = <b>".$modversion['blocks'][$n_funcnum]['options']."</b>)";
+					}
+				}
+				$sql = "UPDATE ".$xoopsDB->prefix('newblocks')." SET func_num='$n_funcnum' WHERE mid=".$mid." AND bid='".$fblock['bid']."'";
+				$iret = $xoopsDB->query($sql);
+
+			}
+		} */
+		
+		$sql = "SELECT * FROM ".$xoopsDB->prefix('newblocks')." WHERE mid=".$mid." AND block_type <>'D' AND func_num > $count";
+		$fresult = $xoopsDB->query($sql);
+		while ($fblock = $xoopsDB->fetchArray($fresult)) {
+			$local_msgs[] = "Non Defined Block <b>".$fblock['name']."</b> will be deleted";
+			$sql = "DELETE FROM ".$xoopsDB->prefix('newblocks')." WHERE bid='".$fblock['bid']."'";
+			$iret = $xoopsDB->query($sql);
+		}
+		
+		for ($i = 1 ; $i <= $count ; $i++) {
+			$sql = "SELECT name,options FROM ".$xoopsDB->prefix('newblocks')." WHERE mid=".$mid." AND func_num=".$i." AND show_func='".addslashes($modversion['blocks'][$i]['show_func'])."' AND func_file='".addslashes($modversion['blocks'][$i]['file'])."'";
+			$fresult = $xoopsDB->query($sql);
+			$fblock = $xoopsDB->fetchArray($fresult);
+			if ( isset( $fblock['options'] ) ) {
+				$old_vals=explode("|",$fblock['options']);
+				$def_vals=explode("|",$modversion['blocks'][$i]['options']);
+				if (count($old_vals) == count($def_vals)) {
+					$modversion['blocks'][$i]['options'] = $fblock['options'];
+					$local_msgs[] = "Option's values of the block <b>".$fblock['name']."</b> will be kept. (value = <b>".$fblock['options']."</b>)";
+				} else if (count($old_vals) < count($def_vals)){
+					for ($j=0; $j < count($old_vals); $j++) {
+						$def_vals[$j] = $old_vals[$j];
+					}
+					$modversion['blocks'][$i]['options'] = implode("|",$def_vals);
+					$local_msgs[] = "Option's values of the block <b>".$fblock['name']."</b> will be kept and new option(s) are added. (value = <b>".$modversion['blocks'][$i]['options']."</b>)";
+				} else {
+					$local_msgs[] = "Option's values of the block <b>".$fblock['name']."</b> will be reset to the default, because of some decrease of options. (value = <b>".$modversion['blocks'][$i]['options']."</b>)";
+				}
+			}
+		}
+	}
+
+	global $msgs , $myblocksadmin_parsed_updateblock ;
+	if( ! empty( $msgs ) && empty( $myblocksadmin_parsed_updateblock ) ) {
+		$msgs = array_merge( $msgs , $local_msgs ) ;
+		$myblocksadmin_parsed_updateblock = true ;
+	}
+
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/include/onupdate.inc.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/include/onupdate.inc.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/include/onupdate.inc.php	(revision 405)
@@ -0,0 +1,34 @@
+<?php
+
+if( ! defined( 'XOOPS_ROOT_PATH' ) ) exit ;
+
+// referer check
+$ref = xoops_getenv('HTTP_REFERER');
+if( $ref == '' || strpos( $ref , XOOPS_URL.'/modules/system/admin.php' ) === 0 ) {
+	/* TinyD specific part */
+
+	// update D blocks's edit_func
+	global $xoopsDB ;
+	$query = "SELECT mid FROM ".$xoopsDB->prefix('modules')." WHERE dirname='".$modversion['dirname']."' ";
+	$result = $xoopsDB->query( "SELECT mid FROM ".$xoopsDB->prefix('modules')." WHERE dirname='{$modversion['dirname']}'" ) ;
+	list( $mid ) = $xoopsDB->fetchRow( $result ) ;
+	$xoopsDB->query( "UPDATE ".$xoopsDB->prefix("newblocks")." SET edit_func='b_tinycontent_content_edit' WHERE show_func='b_tinycontent_content_show' AND mid='$mid'" ) ;
+
+	// last_modified from TinyContent
+	if( $xoopsDB->query( "SELECT last_modified FROM ".$xoopsDB->prefix("tinycontent{$mydirnumber}") ) === false ) {
+		$xoopsDB->queryF( "ALTER TABLE ".$xoopsDB->prefix("tinycontent{$mydirnumber}")." ADD last_modified timestamp(14)" ) ;
+	}
+
+	// created & html_header from TinyD <= 2.0x
+	if( $xoopsDB->query( "SELECT created,html_header FROM ".$xoopsDB->prefix("tinycontent{$mydirnumber}") ) === false ) {
+		$xoopsDB->queryF( "ALTER TABLE ".$xoopsDB->prefix("tinycontent{$mydirnumber}")." ADD created datetime NOT NULL default '2001-1-1 00:00:00', ADD html_header text default NULL" ) ;
+	}
+
+	/* General part */
+
+	// Keep the values of block's options when module is updated (by nobunobu)
+	include dirname( __FILE__ ) . "/updateblock.inc.php" ;
+
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/CHANGELOG
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/CHANGELOG	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/CHANGELOG	(revision 405)
@@ -0,0 +1,431 @@
+[xlang:en]
+CHANGELOG:
+
+2006-08-09 2.25
+- fixed compatibility with Cube 2.1 (thx minahito)
+- modified templates of tinycontent*_index.html (thx jidaikobo)
+
+2006-07-14 2.24
+- changed the spec of "Text without BB" from $myts to htmlspecialchars()
+- remove <pre></pre> from "HTML without HTML"
+
+2006-06-27 2.23
+- fixed PHP contents displayed as is in search module (thx suin)
+- changed calling Text_Wiki with htmlspecialchars() (thx sunaoka)
+
+2006-04-22 2.22
+- fixed the compatibility among mod_rewrite and xoops comment (thx t_yamo)
+
+2006-04-11 2.21
+- added a feature of update wrapped contents for searching
+- modified invalid xhtml in some templates (thx kimono)
+- added mytplsadmin
+
+2006-02-13 2.20
+- updated mymenu (for the compatibility with XoopsCube 2.1)
+- modified the compatibility between "rewrite mode" and "fastest cache hack"
+- added portuguesebr language files (thx Izzy)
+
+2005-11-14 2.19
+- modified the compatibilities with PHP 5.0.5
+- remove CRs in some php files
+
+2005-8-27 2.18
+- modified a compatibility with XOOPS 2.1/2.2
+- updated myblocksadmin into 0.40
+- modified Render/Xhtml/Code.php in PEAR Text_Wiki
+
+2005-5-31 2.17
+- modified common's SPAW can use with Windows server
+- updated gtickets.php
+- fixed preview breaks editing mode
+- modified {X_SITEURL} in all of contents will be converted to XOOPS_URL
+- fixed WRAP2&3's URI to top in page navigation
+- modified common SPAW with myAlbum-P as attachment manager (2.17a)
+
+2005-5-11 2.16
+- added singlecontent.php for popup etc.
+- added common html header into preferences
+- fixed a bug in page navigation (thx kumakichi)
+- updated common's SPAW into nobunobu version based on 1.0.7 (special thx nobunobu!)
+- modified you can edit with WYSIWYG editor via Firefox
+
+2005-5-02 2.15
+- fixed XSS in common's SPAW (thx nobunobu!)
+
+2005-4-20 2.14
+- added submenu unit mode into page navigation
+
+2005-4-19 2.13
+- fixed heading in SPAW
+- added assigning 'xoops_default_comment_title' for "Comment Anywhere"
+
+2005-4-17 2.12
+- modified "modules/less" mode can use xoops comments
+- modified WRAP2 can use xoops comments
+
+2005-4-16 2.11
+- fixed "export" doesn't check if admin of the target module.
+- added the rule page of PEAR::Text_Wiki
+- updated PEAR::Text_Wiki into 1.0 stable
+
+2005-4-13 2.10
+- added a field for HTML headers (check $xoops_module_header in your theme.html)
+- added a field for created date
+- added "export" to other TinyDs
+- added "saveas/clone" in content's editor
+- fixed a typo in the interface to search module by suin
+- fixed a bug with treating homepage
+
+2005-3-4 2.07
+- added INDEXes into sql/tinycontent*.sql
+- modified the onupdate feature adding field of last_modified automatically
+- modified saving last_modified in batch update
+- added some samples -last modified or edit link- into tinycontent_index.html
+- updated myblocksadmin 0.27 & mymenu 0.12
+- modified english language files (thx Peter)
+
+2005-2-22 2.06
+- fixed notice with some httpd (thx karedokx)
+- updated myblocksadmin 0.26 & mymenu 0.11
+
+2005-2-19 2.05
+- added a mode collaborate with "tell a friend" by GIJOE
+- added a mode of "modules/less" experimentaly
+- fixed some bad links in blocks admin (thx karedokx)
+- modified search.inc.php can display bodies with "search module" by suin
+
+2005-2-11 2.04
+- fixed a bug comments is not usable with homepage (thx hodaka)
+- added a mode without BB code into HTML and Text
+
+2005-2-6 2.03
+- modified preview works with firefox etc.
+- added an assignment homepage_id
+- updated myblocksadmin 0.25 & mymenu 0.10
+
+2005-1-8 2.02
+- updated myblocksadmin 0.23
+
+2004-12-30 2.01
+- added link to full view in content block with [summary][/summary]
+- fixed a bug with specifying homepage (thx HODAKA)
+- added blank directory rewrite/ for mod_rewrite (thx uishii)
+- updated myblocksadmin 0.22 & mymenu 0.07
+
+2004-12-7  2.00
+- added ticket system for the security
+- modified the values of block's options will be kept when module is updated (thx nobunobu)
+- modified as DUPLICATABLE V2.1
+- modified PEAR & spaw separated
+- modified spaw can insert images from myAlbum-P's ImageManager Integration (thx nobunobu)
+- many bugs fixed
+- some security holes are fixed (special thx JM2!)
+
+2004-7-7  1.5mh014
+- fixed a bug about sanitize when magic_quotes_gpc is On (thx Ryuji)
+
+2004-6-25  1.5mh013
+- fixed a bug of redeclair rendering functions (thx Christoph)
+- applied some php environment is not defined 'PATH_SEPARATOR' (thx toshimitsu)
+- added sunday_Text_Wiki (commented out in default) (thx minahito!)
+
+2004-6-18  1.5mh012
+- added content block (this block is duplicatable !)
+-- if you want to use template, rename tinycontent_content_block.html.dist to tinycontent_content_block.html and edit it.
+- added class TinyDTextSanitizer extends MyTextSanitizer
+- added tag [siteimg]
+- added tag [summary][/summary] only text inside this tag will be displayed in content block
+- added WRAP4 mode (replace attribute of 'src' or 'href')
+- added "double space to space + & nbsp;" mode
+- fixed typo in page navigation (thx HODAKA)
+- fixed encoding problem with search (thx almhouse)
+- added swedish language files (thx Leif Madsen)
+
+2004-6-2   1.5mh011
+- added a config can select block of tc_nav's target
+- added a config whether it displays "printer friendly" icon or not
+- added a config whether it displays "tell a friend" icon or not
+- added page navigation
+- updated mymenu
+
+2004-5-6   1.5mh010
+- fixed the trouble which occurs in languages other than English
+- added temporary language files of danish, french, german, nederlands, spanish, tchinese (Better language files are appriciated.)
+
+2004-4-27  1.5mh009
+- Fixed enable to select spaw when making new content (2nd careless mistake)
+- Modified changeable the editor for textarea in editing part
+
+2004-4-25  1.5mh008
+- fixed careless mistake in xoops_version.php (thx DonXoop)
+
+2004-4-23  1.5mh007
+- added mod_rewrite for each page wrapping
+- added mod_rewrite for module entirely (SEO?)
+- modified that relative link in wrapped html can be displayed in XOOPS automatically by using mod_rewrite (special thx to minahito!)
+- added encoding translation in dislaying wrapped html
+- added PEAR Wiki mode (special thx to minahito!)
+- added PHP mode
+- added preview
+- added selectable switch to use or not to use SPAW according to the usage
+- modified that the size of textarea can be changed
+- united checkboxes into "enable comments". (not to use "disable comments")
+- modified the action when "homepage" can't be displayed
+- added field for timestamp. (you should "alter table" in list view)
+
+2004-4-10  1.5mh006
+- Base of page wrapping can be changed into the directory same as the page.
+- Chanegd wrapped contents is searchable
+- Templatized printing script
+- Renamed .htaccess into .htaccess.dist for some environment.
+-- (If you want more secure, rename it back as .htaccess manually)
+- Changed even homepage is displayed in Submenu.
+- Modification with "tell to a friend" in muti-byte environment.
+- Changed to use SPAW instance in tinycontent/admin/spaw from every tinycontent*. (another tinycontent*/admin/spaw can be deleted.)
+- Debugged with SPAW (eg. wrong virtual paths in dialogs)
+- Changed as selectable SPAW's language from tinycontent's language files.
+- Improved a variety of code and changed minor specifications.
+
+2004-3-10  1.5mh005
+- submenu's priority added (thx Tom_G3X)
+- myblocksadmin updated into 0.05
+
+2004-2-29  1.5mh004
+- myblocksadmin updated
+- modified to work fine under register_globals off
+- .htaccess added
+
+2004-2-26  1.5mh003
+- Templates of each modules was separated. If you used customized template, rebuild template please. (spcial thx toshimitsu)
+- A security hole of SPAW has fixed.
+- Another some fixes
+
+2004-2-23  1.5mh002
+- Fixed typo in tc_navigation.php (thx toshimitsu)
+- use eval() instead of function definition multiply (special thx minahito!)
+
+2004-2-18  1.5mh001
+- The first release version
+
+
+
+[/xlang:en]
+[xlang:ja]
+
+ÊÑ¹¹ÍúÎò:
+
+2006-08-09 2.25
+- Cube 2.1 ¤ÇÆ°¤«¤Ê¤«¤Ã¤¿¤Î¤ò½¤Àµ (thx minahito)
+- tinycontent*_index.html¤Î¥Æ¥ó¥×¥ì¡¼¥È¤ò²þÁ± (thx jidaikobo)
+
+2006-07-14 2.24
+- ¥Æ¥­¥¹¥È(BBÌµ¸ú)¤Î»ÅÍÍ¤òÊÑ¹¹ ¡Êhtmlspecialchars()¤ËÌá¤·¡¢²þ¹Ô½èÍý¤âÂÐ±þ¡Ë
+- HTML(BBÌµ¸ú)¤Ë¡¢¤Ê¤¼¤«<pre>¤¬¤Ä¤¤¤Æ¤·¤Þ¤Ã¤Æ¤¤¤ë¤Î¤ò½¤Àµ (thx gandalf)
+
+2006-06-27 2.23
+- XOOPS¸¡º÷¥â¥¸¥å¡¼¥ë¤Ç¡¢PHP¥³¥ó¥Æ¥ó¥Ä¤¬¥³¡¼¥É¤´¤ÈÉ½¼¨¤µ¤ì¤Æ¤·¤Þ¤¦¤Î¤ò½¤Àµ (thx suin)
+- Text_Wiki ¤Î¸Æ¤Ó½Ð¤·¤ÇËÜÍè¤¢¤ë¤Ù¤­¥¨¥ó¥Æ¥£¥Æ¥£²½¤¬·ç¤±¤Æ¤¤¤¿¤Î¤ò½¤Àµ (thx sunaoka)
+
+2006-04-22 2.22
+- rewrite¥â¡¼¥É¤ª¤è¤ÓWRAP3¤Ç¥³¥á¥ó¥È½èÍý¤¬¤ª¤«¤·¤«¤Ã¤¿¤Î¤ò½¤Àµ (thx t_yamo)
+
+2006-04-11 2.21
+- ¥é¥Ã¥×¥³¥ó¥Æ¥ó¥Ä¤Î¸¡º÷ÍÑËÜÊ¸¤ò¼êÆ°¤Ç°ì³ç¹¹¿·¤¹¤ëµ¡Ç½¤ò¤Ä¤±¤¿
+- ¥Æ¥ó¥×¥ì¡¼¥ÈÆâ¤Ë¤¤¤¯¤Ä¤«¤¢¤Ã¤¿¡¢xhtml invalid ¤ÊHTML¤ò½¤Àµ (thx kimono)
+- mytplsadminÆ³Æþ
+
+2006-02-13 2.20
+- mymenu¹¹¿· (XoopsCube 2.1¤È¤Î¸ß´¹À­)
+- rewrite¥â¡¼¥É¤Èfastest cache hack ¤È¤ÎÁêÀ­ÌäÂê²ò¾Ã
+- ¥Ý¥ë¥È¥¬¥ë¥Ö¥é¥¸¥ë¸ìÄÉ²Ã (thx Izzy)
+
+2005-11-14 2.19
+- PHP 5.0.5 ¤È¤ÎÁêÀ­ÌäÂê²þÁ±
+- ²þ¹Ô¥³¡¼¥É¤¬CR+LF ¤È¤Ê¤Ã¤Æ¤¤¤¿ÉôÊ¬¤òLF¤ËÅý°ì
+
+2005-8-27 2.18
+- XOOPS 2.1/2.2 ¤È¤Î¸ß´¹À­²þÁ± ¡ÊÆ°ºî³ÎÇ§)
+- myblocksadmin ¤ò 0.40 ¤Ë¾å¤²¤¿
+- PEAR Text_Wiki ¤Î code ½èÍý¤¬¤ª¤«¤·¤«¤Ã¤¿¤Î¤ò¾¡¼ê¤Ë½¤Àµ
+
+2005-5-31 2.17
+- Windows¥µ¡¼¥Ð¤ÇSPAW¤¬»È¤¨¤Ê¤«¤Ã¤¿¤Î¤ò½¤Àµ
+- gtickets.php ¤Î¹¹¿·
+- ¥×¥ì¥Ó¥å¡¼¤¹¤ë¤È¡¢SPAW¤äPLAIN¤Ê¤É¤Î¥â¡¼¥É¤¬ÇË²õ¤µ¤ì¤Æ¤¤¤¿¤Î¤ò½¤Àµ
+- XOOPS_URL¤Ë¶¯À©ÊÑ´¹¤µ¤ì¤ë {X_SITEURL} ¤È¤¤¤¦¥¿¥°¤ÎÆ³Æþ
+- WRAP2¤äWRAP3¤¬homepage¤Ç¤¢¤ë»þ¤Î¥Ú¡¼¥¸¥Ê¥Ó¥²¡¼¥·¥ç¥ó¤ò½¤Àµ
+- common SPAW¤ÇmyAlbum-P¤Î²èÁü°Ê³°¤Î¥Õ¥¡¥¤¥ë¤Ë¤âÂÐ±þ (2.17a)
+
+2005-5-11 2.16
+- ¥Ý¥Ã¥×¥¢¥Ã¥×ÍÑÅù¤Ë»È¤¨¤ë¥³¥ó¥È¥í¡¼¥ésinglecontent.phpÄÉ²Ã (WRAP2Ì¤ÂÐ±þ)
+- °ìÈÌÀßÄê¤Ë¥³¥ó¥Æ¥ó¥Ä¡¦¥Ú¡¼¥¸¥é¥Ã¥×¶¦ÄÌ¤ÎHTML¥Ø¥Ã¥À¹àÌÜÄÉ²Ã
+- ¥µ¥Ö¥á¥Ë¥å¡¼¤À¤±¤Î¥Ú¡¼¥¸¥Ê¥Ó¥²¡¼¥·¥ç¥ó¤Ë¤¢¤Ã¤¿¥Ð¥°¤ò½¤Àµ (thx kumakichi)
+- SPAW¤ò¤Î¤Ö¤Î¤Ö¤µ¤ó¤Î1.0.7¥Ù¡¼¥¹¤Î¤â¤Î¤Ë¥¢¥Ã¥×¥Ç¡¼¥È (special thx nobunobu!)
+- Firefox ¤Ç¤â WYSIWYG¤¬»È¤¨¤ë¤è¤¦¤Ë½¤Àµ
+
+2005-5-02 2.15
+- commonÆâ¤ÎSPAW¤Ë¸«¤Ä¤«¤Ã¤¿XSS¤Î½¤Àµ (thx nobunobu!)
+
+2005-4-20 2.14
+- ¥µ¥Ö¥á¥Ë¥å¡¼Ã±°Ì¤Ç¥Ú¡¼¥¸¥Ê¥Ó¥²¡¼¥·¥ç¥ó¤¹¤ë¥â¡¼¥É¤Î¿·Àß
+
+2005-4-19 2.13
+- SPAW ¤Î heading ¥É¥í¥Ã¥×¥À¥¦¥ó¤¬¸ú¤¤¤Æ¤¤¤Ê¤¤¥Ð¥°¤ò½¤Àµ
+- ¡Ö¤É¤³¤Ç¤âXOOPS¥³¥á¥ó¥È¡×ÍÑ¤Ë¡¢'xoops_default_comment_title' ¤ò¥¢¥µ¥¤¥ó¤·¤¿
+
+2005-4-17 2.12
+- modules¥ì¥¹¥â¡¼¥É¤Ç¥³¥á¥ó¥Èµ¡Ç½¤¬»È¤¨¤Ê¤«¤Ã¤¿¤Î¤ò²þÁ±¡Ê¡Ö¤É¤³¥³¥á¡×0.03¤Ï¡ß¡Ë
+- WRAP2¥â¡¼¥É¤Ç¤â¥³¥á¥ó¥Èµ¡Ç½¤¬»È¤¨¤ë¤è¤¦¤Ë¤·¤Æ¤ß¤¿¡Ê¡Ö¤É¤³¥³¥á¡×0.03¤Ï¡ß¡Ë
+
+2005-4-16 2.11
+- ¥â¥¸¥å¡¼¥ë´Ö¡Ö°ÜÆ°¡×¤Ç¡¢ÀèÊý¤Î´ÉÍý¼Ô¸¢¸Â¤ò¥Á¥§¥Ã¥¯¤·¤Æ¤¤¤Ê¤«¤Ã¤¿¤Î¤ò½¤Àµ
+- PEAR::Text_Wiki ¤Î¥ë¡¼¥ë¥Ú¡¼¥¸ÄÉ²Ã
+- commonÆâÆ±º­¤Î PEAR::Text_Wiki ¤ò 1.0 stable ¤Ë¾å¤²¤¿
+- Sunday_Wiki¤ò°ì»þÅª¤Ë¾Ã¤·¤¿ (minahito¤µ¤ó¡¢¤´¤á¤ó¤Ê¤µ¤¤)
+
+2005-4-13 2.10
+- ¸ÄÊÌHTML¥Ø¥Ã¥À½ÐÎÏµ¡Ç½¤ÎÄÉ²Ã (Í× ¥Æ¡¼¥ÞÆâ¤Î <{$xoops_module_header}>)
+- ºîÀ®Æü»þ¥Õ¥£¡¼¥ë¥É¤ÎÄÉ²Ã
+- Â¾¤ÎTinyD¤Ø¤Î¡Ö°ÜÆ°¡×¡Ê¥¨¥¯¥¹¥Ý¡¼¥È¡Ëµ¡Ç½¤ÎÄÉ²Ã
+- ÊÔ½¸²èÌÌ¤Ë¤ª¤±¤ë¡ÖÊÌ¥ì¥³¡¼¥É¤È¤·¤ÆÊÝÂ¸¡×¥Ü¥¿¥ó¤Î¿·Àß
+- XOOPS¥µ¡¼¥Á¥â¥¸¥å¡¼¥ë¤Î¿·ÈÇÂÐ±þ¤Ç¤Îtypo¤ò½¤Àµ
+- ¥Û¡¼¥à¥Ú¡¼¥¸¤¬³°¤ì¤Æ¤·¤Þ¤¦¥Ð¥°¤ò½¤Àµ
+
+2005-3-4 2.07
+- tinycontent*.sql¤Ç¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò¤¤¤í¤¤¤í¤Ä¤±¤ë¤è¤¦¤Ë¤·¤¿
+- last_modified ¤ò¥â¥¸¥å¡¼¥ë¥¢¥Ã¥×¥Ç¡¼¥È»þ¤Ë¥Á¥§¥Ã¥¯¤¹¤ë¤è¤¦¤Ë¤·¤¿
+- last_modified ¤¬½çÈÖÊÑ¹¹ÄøÅÙ¤Ç¤ÏÊÑ¤ï¤é¤Ê¤¤¤è¤¦¤Ë½¤Àµ¤·¤¿
+- ºÇ½ª¹¹¿·Æü»þ¤äÊÔ½¸¥ê¥ó¥¯¤Î¥µ¥ó¥×¥ë¤ò¥Æ¥ó¥×¥ì¡¼¥È¤ËÄÉ²Ã¤·¤¿
+- updated myblocksadmin 0.27 & mymenu 0.12
+- ±Ñ¸ì¥Õ¥¡¥¤¥ë¤ò½¤Àµ (thx Peter)
+
+2005-2-22 2.06
+- °ìÉô¤Îhttpd¤ÇNotice¤¬½Ð¤ë¤³¤È¤ËÂÐ±þ (thx karedokx)
+- myblocksadmin 0.26 & mymenu 0.11 ¤Ë¥¢¥Ã¥×¥Ç¡¼¥È
+
+2005-2-19 2.05
+- tell a friend¥â¥¸¥å¡¼¥ë¤ËÂÐ±þ
+- modules¥ì¥¹¥â¡¼¥É¤Î»î¸³Åª¼ÂÁõ
+- blocks admin ¤Ç²èÁü¥ê¥ó¥¯¤¬¤ª¤«¤·¤¯¤Ê¤Ã¤Æ¤¤¤¿¤Î¤ò½¤Àµ (thx karedokx)
+- search¥â¥¸¥å¡¼¥ë¤ÇËÜÊ¸É½¼¨ÂÐ±þ
+
+2005-2-11 2.04
+- ¥Û¡¼¥à¥Ú¡¼¥¸¤À¤È¡¢¥³¥á¥ó¥È¤¬»È¤¨¤Ê¤«¤Ã¤¿¤Î¤ò½¤Àµ (thx hodaka)
+- ¥Æ¥­¥¹¥È¤ª¤è¤ÓHTML¥³¥ó¥Æ¥ó¥Ä¤Ë¡¢BB code¥³¥ó¥Ð¡¼¥ÈÌµ¤·ÀßÄê¤âÄÉ²Ã
+
+2005-2-6 2.03
+- ¥×¥ì¥Ó¥å¡¼¤¬¥Ö¥é¥¦¥¶°ÍÂ¸¤È¤Ê¤Ã¤Æ¤¤¤¿¤³¤È¤ò½¤Àµ¤·¡¢¥»¥Ã¥·¥ç¥óÅÏ¤·¤Ë²þÁ±
+- ¥Û¡¼¥à¥Ú¡¼¥¸ID¤ò¡¢homepage_id ¤È¤·¤Æ¥¢¥µ¥¤¥ó
+- updated myblocksadmin 0.25 & mymenu 0.10
+
+2005-1-8 2.02
+- updated myblocksadmin 0.23
+
+2004-12-30 2.01
+- ¥³¥ó¥Æ¥ó¥È¥Ö¥í¥Ã¥¯¤Ç[summary][/summary]¤Ë¤Æ¾ÊÎ¬¤µ¤ì¤¿»þ¤Î¡Ö¤â¤Ã¤È...¡×ÄÉ²Ã
+- HP»ØÄê¤¬´ÊÃ±¤Ë¤Ï¤º¤ì¤Æ¤·¤Þ¤¦¥Ð¥°¤Î½¤Àµ (thx HODAKA)
+- mod_rewrite¥â¡¼¥É¤Î¤¿¤á¤Ë¡¢¶õ¤Î rewrite ¥Ç¥£¥ì¥¯¥È¥ê¤òÍÑ°Õ (thx uishii)
+- myblocksadmin 0.22 & mymenu 0.07 ¤½¤ì¤¾¤ì¹¹¿·
+
+2004-12-7  2.0
+- ¥Á¥±¥Ã¥È¥·¥¹¥Æ¥à¤ÎÁ´ÌÌÆ³Æþ
+- ¥â¥¸¥å¡¼¥ë¥¢¥Ã¥×¥Ç¡¼¥È»þ¤Î¥Ö¥í¥Ã¥¯¥ª¥×¥·¥ç¥óÃÍÊÝÂ¸ (thx nobunobu)
+- DUPLICATABLE V2.1 ¤ÎÆ³Æþ
+- PEAR ¤È spaw ¤ò XOOPS_ROOT_PATH/common/ ¤Ø¤ÈÊ¬Î¥
+- myAlbum-P¤Î¥¤¥á¡¼¥¸¥Þ¥Í¡¼¥¸¥ãÅý¹ç¤¬spaw¤Ç¤â»È¤¨¤ë¤è¤¦¤Ë¤·¤¿¡Ê¤¢¤Þ¤ê´üÂÔ¤µ¤ì¤Æ¤âº¤¤ê¤Þ¤¹¤¬¡¢¤¢¤¯¤Þ¤Ç»ÃÄêÅª¤Ê¼ÂÁõ¤Ç¤¹¡Ë (thx nobunobu)
+- ¿ô¤¨ÀÚ¤ì¤Ê¤¤¡Ê¡á»×¤¤½Ð¤»¤Ê¤¤¡Ë¤Û¤É¤Î¥Ð¥°Fix
+- ¥Õ¥¡¥¤¥ë»ØÄê´ØÏ¢¤Î¥»¥­¥å¥ê¥Æ¥£¥Û¡¼¥ë¤òÄÙ¤·¤¿ (special thx JM2!)
+
+2004-7-7  1.5mh014
+- magic_quotes_gpc On»þ¤Î¥µ¥Ë¥¿¥¤¥º½èÍý¥ß¥¹¤ò½¤Àµ (thx Ryuji)
+
+2004-6-25  1.5mh013
+- render_functions.php¤¬Æó½Å¤ËÆÉ¤ß¹þ¤Þ¤ì¤Æ¤·¤Þ¤¦¥Ð¥°¤Î½¤Àµ (thx Christoph)
+- PATH_SEPARATOR Ì¤ÄêµÁ´Ä¶­¤Ø¤ÎÂÐ±þ (thx toshimitsu)
+- sunday_Text_Wiki ¤ò¤³¤Ã¤½¤êÆþ¤ì¤¿ (¥³¥á¥ó¥È¥¢¥¦¥È¤·¤Æ¤¢¤ê¤Þ¤¹) (thx minahito!)
+
+2004-6-18  1.5mh012
+- ¥³¥ó¥Æ¥ó¥ÄËÜÂÎÉ½¼¨¥Ö¥í¥Ã¥¯¤òÄÉ²Ã¤·¤¿ ¡Ê¤³¤Î¥Ö¥í¥Ã¥¯¤ÏÊ£À½²ÄÇ½¤Ç¤¹¡ª¡Ë
+-- Ê£À½²ÄÇ½¤ò¼Â¸½¤¹¤ë¤¿¤á¤Ë¡¢XOOPS¥Æ¥ó¥×¥ì¡¼¥È¥·¥¹¥Æ¥à¤Ï»È¤¨¤Þ¤»¤ó¤Ç¤·¤¿¡£¥Æ¥ó¥×¥ì¡¼¥È¤ò¤´ÍøÍÑ¤Ë¤Ê¤ê¤¿¤¤Êý¤Ï¡¢templates/blocks/tinycontent_content_block.html.dist ¤È¤¤¤¦¥Õ¥¡¥¤¥ë¤ò¡¢tinycontent_content_block.html ¤È¥ê¥Í¡¼¥à¤·¤Æ¡¢¤³¤ì¤òÊÔ½¸¤·¤Æ¤¯¤À¤µ¤¤¡£
+- MyTextSanitizer ¤ò³ÈÄ¥¤·¤¿ TinyDTextSanitizer¤ò»È¤¦¤è¤¦¤Ë¤·¤¿
+- [siteimg] ¥¿¥°¤ÎÄÉ²Ã¡£
+--[url]¤ËÂÐ¤¹¤ë[siteurl]¤ËÁêÅö¤¹¤ë¤â¤Î¤Ç¡¢ÅÓÃæ¤ÇXOOPS_URL¤¬½ñ¤­ÊÑ¤ï¤ë¤è¤¦¤ÊÍÑÅÓ¤Ë¸þ¤¤¤Æ¤¤¤Þ¤¹¡£myAlbum-P¤Î¥¤¥á¡¼¥¸¥Þ¥Í¡¼¥¸¥ãÅý¹ç¤Ç¤ÎÂÐ±þ¤Ï¤â¤¦¾¯¤·¤ªÂÔ¤Á²¼¤µ¤¤¡£
+- [summary][/summary] ¥Ö¥í¥Ã¥¯¥¿¥°¤ÎÄÉ²Ã
+-- [summary]¥Ö¥í¥Ã¥¯¤¬¤¢¤ë¾ì¹ç¡¢¤³¤ÎÆâÂ¦¤À¤±¤¬¡¢¥³¥ó¥Æ¥ó¥ÄËÜÂÎ¥Ö¥í¥Ã¥¯¤ËÉ½¼¨¤µ¤ì¤Þ¤¹
+- ¥Ú¡¼¥¸¥é¥Ã¥×¥â¡¼¥É4 ¤ÎÄÉ²Ã¡ÊHTML¥¿¥°¤Î'src'¤ª¤è¤Ó'href'Â°À­¤òÄ´¤Ù¤Æ¡¢ÁêÂÐ¥ê¥ó¥¯¤È¤ª¤Ü¤·¤­¤â¤Î¤¬¤¢¤Ã¤¿¤éXOOPS_URL¤ò¥Ù¡¼¥¹¤È¤·¤¿ÀäÂÐ¥ê¥ó¥¯¤Ë½ñ¤­´¹¤¨¤ë¼êË¡¡Ë
+- Ï¢Â³¤·¤¿¥¹¥Ú¡¼¥¹¤ò¡¢ÆþÎÏ¤·¤¿ÄÌ¤ê¤Î¤Þ¤Þ¤ËÉ½¼¨¤¹¤ë¥â¡¼¥É¤ÎÄÉ²Ã¡Ê¤¿¤À¤·¡¢¼«Æ°²þ¹Ô¤òÍ­¸ú¤È¤·¤¿¥¢¡¼¥Æ¥£¥¯¥ë¤Ë¤Ä¤¤¤Æ¤Î¤ß¡Ë
+- ¥Ú¡¼¥¸¥Ê¥Ó¥²¡¼¥·¥ç¥ó¤Ç¥ê¥ó¥¯¤¬¤ª¤«¤·¤¤¥Ð¥°¤Î½¤Àµ (thx HODAKA)
+- ¥Ú¡¼¥¸¥é¥Ã¥×¤·¤¿¥³¥ó¥Æ¥ó¥Ä¤¬Ê¸»ú¥³¡¼¥É¤ÎÌäÂê¤Ç¸¡º÷¤Ë¤Ò¤Ã¤«¤«¤é¤Ê¤¤¥Ð¥°¤Î½¤Àµ (thx sarah)
+- ¥¹¥¨¡¼¥Ç¥ó¸ì¤ÎÄÉ²Ã (thx Leif Madsen)
+
+2004-6-2   1.5mh011
+- ¥Ö¥í¥Ã¥¯¤Ç¤ÎÉ½¼¨ÂÐ¾Ý¤ò¡¢Á´¤Æ¤«¥µ¥Ö¥á¥Ë¥å¡¼ÂÐ¾Ý¤«¤Î¤¤¤º¤ì¤«¤Ë¹Ê¤ì¤ë¤è¤¦¤Ë¤·¤¿
+- ¥×¥ê¥ó¥ÈÍÑ¥¢¥¤¥³¥ó¡¦Í§Ã£¤Ë¾Ò²ð¥¢¥¤¥³¥ó¤Î¤¤¤º¤ì¤â¡¢°ìÈÌÀßÄê¤ÇON/OFF²ÄÇ½¤È¤·¤¿
+- Ï¢Â³¤·¤¿ÆâÍÆ¤òÊ¬³äÉ½¼¨¤¹¤ë¤¿¤á¤ÎÁ°¸å¥Ú¡¼¥¸¤Ø¤Î¥Ê¥Ó¥²¡¼¥·¥ç¥ó¤òÄÉ²Ã¤·¤¿
+- mymenu ¤ò¹¹¿·
+
+2004-5-6   1.5mh010
+- °ì»þÅª¤Ë¡¢Á´¸À¸ì¥Õ¥¡¥¤¥ë¤òºîÀ®¤·¤¿
+-- (danish, french, german, nederlands, spanish, tchinese)
+
+2004-4-27  1.5mh009
+- ¿·µ¬¥³¥ó¥Æ¥ó¥ÄºîÀ®¤ÇÄ¾ÀÜSPAW¤òÁªÂò¤Ç¤­¤Ê¤«¤Ã¤¿¤Î¤ò½¤Àµ¡Ê¤³¤ì¤â¥Ý¥«¥ß¥¹¡Ë
+- ÊÔ½¸²èÌÌÆâ¤Ç¡¢¥Æ¥­¥¹¥È¥¨¥ê¥¢¤Î¥¨¥Ç¥£¥¿¤òÊÑ¹¹¤Ç¤­¤ë¤è¤¦¤Ë½¤Àµ
+
+2004-4-25  1.5mh008
+- xoops_version.php ¤Îµ­½Ò¥ß¥¹¤Ç¡¢¥â¥¸¥å¡¼¥ë´ÉÍý²èÌÌ¤Ç¥¨¥é¡¼¤¬½Ð¤ë¤Î¤ò½¤Àµ (thx DonXoop)
+
+2004-4-23  1.5mh007
+- ¥Ú¡¼¥¸¥é¥Ã¥×¤Îmod_rewrite¥â¡¼¥É¼ÂÁõ (¸ÄÊÌ»ØÄê¡Ë
+- ¥â¥¸¥å¡¼¥ëÁ´ÂÎ¤Îmod_rewrite¥â¡¼¥É¼ÂÁõ (SEOÂÐºö?)
+- ÀÅÅªHTML¤ò¥¢¥Ã¥×¤¹¤ë¤À¤±¤Ç¤â¡¢mod_rewrite¤Ë¤è¤Ã¤ÆXOOPS¤Ë¤È¤ê¤³¤Þ¤ì¤ë¤è¤¦¤Ë¤·¤¿  (special thx to minahito!)
+- ¥Ú¡¼¥¸¥é¥Ã¥×¤Î¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°ÊÑ´¹ÄÉ²Ã¡Ê¤½¤¦¤¤¤¨¤Ð¤¹¤Ã¤«¤êËº¤ì¤Æ¤Þ¤·¤¿¡Ë
+- PEAR Wiki ¥³¥ó¥Æ¥ó¥Ä¥â¡¼¥É¼ÂÁõ (special thx to minahito!)
+- PHP¥³¡¼¥É¥â¡¼¥É¼ÂÁõ ( eval()¤ò»È¤Ã¤Æ¤¤¤ë¤À¤±¤Ê¤Î¤Ç¡¢Ãí°Õ»ö¹à¤Ï¥«¥¹¥¿¥àPHP¥Ö¥í¥Ã¥¯¤ÈÆ±¤¸¤Ç¤¹¡£<? ?> ¤Ç¤¯¤¯¤é¤Ê¤¤¤È¤«¡¢XOOPSÊÑ¿ô¤Ë¤ÏglobalÀë¸À¤¬Í×¤ë¤È¤«)
+- ¥×¥ì¥Ó¥å¡¼¼ÂÁõ
+- SPAW¤Î»ÈÍÑ¤ò¸ÄÊÌ¤ËON/OFF¤Ç¤­¤ë¤è¤¦¤Ë¤·¤¿
+- ¥Æ¥­¥¹¥È¥¨¥ê¥¢¤Î¥µ¥¤¥º»ØÄê¤ò¤Ç¤­¤ë¤è¤¦¤Ë¤·¤¿
+- °ìÍ÷²èÌÌ¤ÈÊÔ½¸²èÌÌ¤Ç¡¢¥³¥á¥ó¥È¤Î²Ä¡¦ÉÔ²Ä¤¬º®Æ±¤·¤Æ¤¤¤¿¤Î¤òÅý°ì¤·¤¿
+- ¥Û¡¼¥à¥Ú¡¼¥¸»ØÄê¤¬¤Ê¤¤¾ì¹ç¡¢¤Þ¤¿¤Ï»ØÄê¤µ¤ì¤¿¥Ú¡¼¥¸¤¬É½¼¨ÉÔ²Ä¤Î¾ì¹ç¤Ë¤Ï¡¢Í¥Àè½ç°Ì¤Î°ìÈÖ¹â¤¤É½¼¨²ÄÇ½¥Ú¡¼¥¸¤Ø¥ê¥À¥¤¥ì¥¯¥È¤¹¤ë¤è¤¦¤Ë¤·¤¿
+- ¹¹¿·Æü»þ¤òµ­Ï¿¤¹¤ë¤è¤¦¤Ë¤·¤¿¡Ê¥Æ¡¼¥Ö¥ë¹½Â¤¤ÎÊÑ¹¹¤òÈ¼¤¦¤Î¤Ç¡¢°ìÍ÷²èÌÌ¤«¤é¹¹¿·¤·¤Æ¤¤¤¿¤À¤¤¤¿Êý¤¬ÎÉ¤¤¤Ç¤¹¤¬¡¢¤·¤Ê¤¯¤Æ¤âÅöÌÌÌäÂê¤¢¤ê¤Þ¤»¤ó¡£¡Ë
+
+2004-4-13  1.5mh006
+- ¥Ú¡¼¥¸¥é¥Ã¥×¤Î´ðÅÀ¤òcontent¥Ç¥£¥ì¥¯¥È¥ê¤ËÊÑ¹¹¤Ç¤­¤ë¤è¤¦¤Ë¤·¤¿
+- ¥Ú¡¼¥¸¥é¥Ã¥×¤â¸¡º÷¤Ë¤«¤«¤ë¤è¤¦¤Ë¤·¤¿
+- ¥×¥ê¥ó¥È²èÌÌ¤Î¥Æ¥ó¥×¥ì¡¼¥È²½
+- ¥â¥¸¥å¡¼¥ë¥ë¡¼¥È¤Ë¤¢¤ë .htaccess ¤ò .htaccess.dist ¤ËÊÑ¹¹¤·¤¿
+ ¡Ê½ÐÍè¤ì¤Ð¡¢¥»¥­¥å¥ê¥Æ¥£¤ò¹â¤á¤ë¤¿¤á¤Ë¡¢.htaccess ¤ËÌ¾Á°ÊÑ¹¹¤·¤Æ²¼¤µ¤¤¡Ë
+- HP»ØÄê¤¬¤¢¤Ã¤Æ¤â¡¢¥µ¥Ö¥á¥Ë¥å¡¼¤ÎÉ½¼¨¤ò²ÄÇ½¤È¤·¤¿
+- ¡ÖÍ§Ã£¤Ë¾Ò²ð¡×¤ò¥Þ¥ë¥Á¥Ð¥¤¥È¸À¸ì¤Ç¤â²½¤±¤Ê¤¤¤è¤¦¤Ë¤·¤Æ¤ß¤¿
+ ¡Êmb´Ø¿ô¤ò»È¤ï¤Ê¤¤¡¢¤È¤¤¤¦¾ò·ï²¼¤Ç¡¢½ÐÍè¤ë¸Â¤ê²½¤±¤Ê¤¤¤è¤¦¤Ê¹©É×¡Ë
+- SPAW¤Î¼ÂÂÎ¤ò¾ï¤Ë tinycontent/admin/spaw ¤ò»È¤¦¤è¤¦¤Ë¤·¤¿ (Â¾¤Îtinycontent*¤Ë¤Ä¤¤¤Æ¤Ï¡¢spaw¤ò¥Õ¥©¥ë¥À¤´¤È¾Ã¤·¤Æ¤â¹½¤¤¤Þ¤»¤ó¡Ë
+- SPAW¤Î¥Ð¥°¼è¤ê¡Ê¥À¥¤¥¢¥í¥°¤Î²èÁü¥ê¥ó¥¯ÀÚ¤ì½¤ÀµÅù¡Ë
+- SPAW¤Î¸À¸ì¤òÁªÂò²ÄÇ½¤È¤·¤¿
+- SPAW¤Ë¸À¸ìjp¤òÄÉ²Ã (thx to author of tinycontent-v1.5jp.patch)
+- ¤½¤ÎÂ¾ÍÍ¡¹¤Ê¥³¡¼¥É²þÎÉ¡¦ºÙ¤«¤Ê»ÅÍÍÊÑ¹¹
+
+2004-3-10  1.5mh005
+- ¥µ¥Ö¥á¥Ë¥å¡¼¤ÎÉ½¼¨½ç¤òÈ¿±Ç¤·¤¿ (thx Tom_G3X)
+- myblocksadmin ¤ò0.05¤Ë¹¹¿·¤·¤¿
+
+2004-2-29  1.5mh004
+- myblocksadmin ¤ò0.04¤Ë¹¹¿·¤·¤¿
+- register_globals On °ÍÂ¸¤À¤Ã¤¿ÉôÊ¬¤ò½¤Àµ¤·¤¿¡Ê¤½¤ì¤â¤Ê¤ë¤Ù¤¯ÃúÇ«¤Ë¡Ë
+- .htaccess ¤òºÇ½é¤«¤éÃÖ¤¯¤è¤¦¤Ë¤·¤¿
+
+2004-2-26  1.5mh003
+- ¥Æ¥ó¥×¥ì¡¼¥È¤ò¸ÄÊÌ¤Ë»ØÄê¤Ç¤­¤ë¤è¤¦¤Ë¤·¤¿ (toshimitsu¤µ¤ó¡¢Å¬ÀÚ¤Ê¥¢¥É¥Ð¥¤¥¹¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡Ë¤Ê¤ª¡¢¥Æ¥ó¥×¥ì¡¼¥È¹½Â¤¤¬ÂçÉý¤ËÊÑ¤ï¤Ã¤¿¤Î¤Ç¡¢¥«¥¹¥¿¥à¥Æ¥ó¥×¥ì¡¼¥È¤ò»È¤Ã¤Æ¤¤¤ëÊý¤Ïºî¤êÄ¾¤¹É¬Í×¤¬¤¢¤ê¤Þ¤¹¡£¤Þ¤¿¡¢¥Ö¥í¥Ã¥¯¤Î¥Æ¥ó¥×¥ì¡¼¥È¤òºÆÇ§¼±¤µ¤»¤ë¤¿¤á¤Ë¡¢¥Ö¥í¥Ã¥¯½èÍý¥Õ¥¡¥¤¥ëÌ¾¤òÊÑ¹¹¤·¤¿¤¿¤á¡¢°ã¤¦¥Ö¥í¥Ã¥¯¤È¤·¤ÆÇ§¼±¤µ¤ì¤Æ¤·¤Þ¤¤¤Þ¤¹¡£ºÆÅÙ¡¢¥Ö¥í¥Ã¥¯¤Î¥¢¥¯¥»¥¹¸¢¸Â¤äÉ½¼¨Í­Ìµ¤òÀßÄê¤·¤Æ¤¯¤À¤µ¤¤¡£¤ª¼ê¿ô¤ò¤ª¤«¤±¤·¤Æ¤¹¤ß¤Þ¤»¤ó¡£
+- SPAW¤Î¥»¥­¥å¥ê¥Æ¥£¥Û¡¼¥ë¤ò¥Ñ¥Ã¥Á¤·¤¿
+- ¤½¤ÎÂ¾SPAW¤¬¤é¤ß¤Î½¤Àµ¡Ê¤Þ¤À¤Þ¤À²ø¤·¤¤¤È¤³¤í¤Ï¤¢¤ë¤ó¤Ç¤¹¤±¤É¡Ä¡Ë
+
+2004-2-23  1.5mh002
+- tc_navigation.php Æâ¤ÎTypo¤òFix (thx toshimitsu)
+- ¸¡º÷¤È¥Ö¥í¥Ã¥¯¤Ç¡¢´Ø¿ô¤òÊ£À½²ÄÇ½¿ô¤À¤±ÄêµÁ¤·¤Æ¤¤¤¿ÉôÊ¬¤ò¡¢eval()¤ò»È¤¦¥³¡¼¥É¤ËÊÑ¹¹¤·¤¿¡£(ËÜÅö¤ËÁÇÀ²¤é¤·¤¤¤Ç¤¹¡£minahito¤µ¤ó¡¢¤¢¤ê¤¬¤È¤¦!)
+
+2004-2-18  1.5mh001
+- ºÇ½é¤ÎÈÇ
+
+
+
+[/xlang:ja]
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/admin/myblocksadmin.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/admin/myblocksadmin.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/admin/myblocksadmin.php	(revision 405)
@@ -0,0 +1,325 @@
+<?php
+// ------------------------------------------------------------------------- //
+//                            myblocksadmin.php                              //
+//                - XOOPS block admin for each modules -                     //
+//                          GIJOE <http://www.peak.ne.jp/>                   //
+// ------------------------------------------------------------------------- //
+
+include_once( '../../../include/cp_header.php' ) ;
+
+if( substr( XOOPS_VERSION , 6 , 3 ) > 2.0 ) {
+	include 'myblocksadmin2.php' ;
+	exit ;
+}
+
+include_once( 'mygrouppermform.php' ) ;
+include_once( XOOPS_ROOT_PATH.'/class/xoopsblock.php' ) ;
+include_once "../include/gtickets.php" ;// GIJ
+
+
+$xoops_system_path = XOOPS_ROOT_PATH . '/modules/system' ;
+
+// language files
+$language = $xoopsConfig['language'] ;
+if( ! file_exists( "$xoops_system_path/language/$language/admin/blocksadmin.php") ) $language = 'english' ;
+
+// to prevent from notice that constants already defined
+$error_reporting_level = error_reporting( 0 ) ;
+include_once( "$xoops_system_path/constants.php" ) ;
+include_once( "$xoops_system_path/language/$language/admin.php" ) ;
+include_once( "$xoops_system_path/language/$language/admin/blocksadmin.php" ) ;
+error_reporting( $error_reporting_level ) ;
+
+$group_defs = file( "$xoops_system_path/language/$language/admin/groups.php" ) ;
+foreach( $group_defs as $def ) {
+	if( strstr( $def , '_AM_ACCESSRIGHTS' ) || strstr( $def , '_AM_ACTIVERIGHTS' ) ) eval( $def ) ;
+}
+
+
+// check $xoopsModule
+if( ! is_object( $xoopsModule ) ) redirect_header( XOOPS_URL.'/user.php' , 1 , _NOPERM ) ;
+
+// set target_module if specified by $_GET['dirname'] && this is 'blocksadmin'
+$module_handler =& xoops_gethandler('module');
+if( $xoopsModule->getVar('dirname') == 'blocksadmin' && ! empty( $_GET['dirname'] ) ) {
+	$target_module =& $module_handler->getByDirname($_GET['dirname']);
+}
+
+if( ! empty( $target_module ) && is_object( $target_module ) ) {
+	// specified by dirname
+	$target_mid = $target_module->getVar( 'mid' ) ;
+	$target_mname = $target_module->getVar( 'name' ) . "&nbsp;" . sprintf( "(%2.2f)" , $target_module->getVar('version') / 100.0 ) ;
+	$target_dirname = $target_module->getVar( 'dirname' ) ;
+} else if( $xoopsModule->getVar('dirname') == 'blocksadmin' ) {
+	$target_mid = 0 ;
+	$target_mname = '' ;
+	$target_dirname = '__CustomBlocks__' ;
+} else {
+	$target_mid = $xoopsModule->getVar( 'mid' ) ;
+	$target_mname = $xoopsModule->getVar( 'name' ) ;
+	$target_dirname = '' ;
+}
+
+// check access right (needs system_admin of BLOCK)
+$sysperm_handler =& xoops_gethandler('groupperm');
+if (!$sysperm_handler->checkRight('system_admin', XOOPS_SYSTEM_BLOCK, $xoopsUser->getGroups())) redirect_header( XOOPS_URL.'/user.php' , 1 , _NOPERM ) ;
+
+// get blocks owned by the module (Imported from xoopsblock.php then modified)
+//$block_arr =& XoopsBlock::getByModule( $target_mid ) ;
+$db =& Database::getInstance();
+$sql = "SELECT * FROM ".$db->prefix("newblocks")." WHERE mid='$target_mid' ORDER BY visible DESC,side,weight";
+$result = $db->query($sql);
+$block_arr = array();
+while( $myrow = $db->fetchArray($result) ) {
+	$block_arr[] = new XoopsBlock($myrow);
+}
+
+function list_blocks()
+{
+	global $target_dirname , $block_arr , $xoopsGTicket ;
+
+	// cachetime options
+	$cachetimes = array('0' => _NOCACHE, '30' => sprintf(_SECONDS, 30), '60' => _MINUTE, '300' => sprintf(_MINUTES, 5), '1800' => sprintf(_MINUTES, 30), '3600' => _HOUR, '18000' => sprintf(_HOURS, 5), '86400' => _DAY, '259200' => sprintf(_DAYS, 3), '604800' => _WEEK, '2592000' => _MONTH);
+
+	// displaying TH
+	echo "
+	<form action='admin.php?dirname=$target_dirname' name='blockadmin' method='post'>
+		<table width='95%' class='outer' cellpadding='4' cellspacing='1'>
+		<tr valign='middle'>
+			<th>"._AM_TITLE."</th>
+			<th align='center' nowrap='nowrap'>"._AM_SIDE."</th>
+			<th align='center'>"._AM_WEIGHT."</th>
+			<th align='center'>"._AM_VISIBLEIN."</th>
+			<th align='center'>"._AM_BCACHETIME."</th>
+			<th align='right'>"._AM_ACTION."</th>
+		</tr>\n" ;
+
+	// blocks displaying loop
+	$class = 'even' ;
+	$block_configs = get_block_configs() ;
+	foreach( array_keys( $block_arr ) as $i ) {
+		$sseln = $ssel0 = $ssel1 = $ssel2 = $ssel3 = $ssel4 = "";
+		$scoln = $scol0 = $scol1 = $scol2 = $scol3 = $scol4 = "#FFFFFF";
+
+		$weight = $block_arr[$i]->getVar("weight") ;
+		$title = $block_arr[$i]->getVar("title") ;
+		$name = $block_arr[$i]->getVar("name") ;
+		$bcachetime = $block_arr[$i]->getVar("bcachetime") ;
+		$bid = $block_arr[$i]->getVar("bid") ;
+
+		// visible and side
+		if ( $block_arr[$i]->getVar("visible") != 1 ) {
+			$sseln = " checked='checked'";
+			$scoln = "#FF0000";
+		} else switch( $block_arr[$i]->getVar("side") ) {
+			default :
+			case XOOPS_SIDEBLOCK_LEFT :
+				$ssel0 = " checked='checked'";
+				$scol0 = "#00FF00";
+				break ;
+			case XOOPS_SIDEBLOCK_RIGHT :
+				$ssel1 = " checked='checked'";
+				$scol1 = "#00FF00";
+				break ;
+			case XOOPS_CENTERBLOCK_LEFT :
+				$ssel2 = " checked='checked'";
+				$scol2 = "#00FF00";
+				break ;
+			case XOOPS_CENTERBLOCK_RIGHT :
+				$ssel4 = " checked='checked'";
+				$scol4 = "#00FF00";
+				break ;
+			case XOOPS_CENTERBLOCK_CENTER :
+				$ssel3 = " checked='checked'";
+				$scol3 = "#00FF00";
+				break ;
+		}
+
+		// bcachetime
+		$cachetime_options = '' ;
+		foreach( $cachetimes as $cachetime => $cachetime_name ) {
+			if( $bcachetime == $cachetime ) {
+				$cachetime_options .= "<option value='$cachetime' selected='selected'>$cachetime_name</option>\n" ;
+			} else {
+				$cachetime_options .= "<option value='$cachetime'>$cachetime_name</option>\n" ;
+			}
+		}
+
+		// target modules
+		$db =& Database::getInstance();
+		$result = $db->query( "SELECT module_id FROM ".$db->prefix('block_module_link')." WHERE block_id='$bid'" ) ;
+		$selected_mids = array();
+		while ( list( $selected_mid ) = $db->fetchRow( $result ) ) {
+			$selected_mids[] = intval( $selected_mid ) ;
+		}
+		$module_handler =& xoops_gethandler('module');
+		$criteria = new CriteriaCompo(new Criteria('hasmain', 1));
+		$criteria->add(new Criteria('isactive', 1));
+		$module_list =& $module_handler->getList($criteria);
+		$module_list[-1] = _AM_TOPPAGE;
+		$module_list[0] = _AM_ALLPAGES;
+		ksort($module_list);
+		$module_options = '' ;
+		foreach( $module_list as $mid => $mname ) {
+			if( in_array( $mid , $selected_mids ) ) {
+				$module_options .= "<option value='$mid' selected='selected'>$mname</option>\n" ;
+			} else {
+				$module_options .= "<option value='$mid'>$mname</option>\n" ;
+			}
+		}
+
+		// delete link if it is cloned block
+		if( $block_arr[$i]->getVar("block_type") == 'D' || $block_arr[$i]->getVar("block_type") == 'C' ) {
+			$delete_link = "<br /><a href='admin.php?fct=blocksadmin&amp;op=delete&amp;bid=$bid&amp;dirname=$target_dirname'>"._DELETE."</a>" ;
+		} else {
+			$delete_link = '' ;
+		}
+
+		// clone link if it is marked as cloneable block
+		// $modversion['blocks'][n]['can_clone']
+		if( $block_arr[$i]->getVar("block_type") == 'D' || $block_arr[$i]->getVar("block_type") == 'C' ) {
+			$can_clone = true ;
+		} else {
+			$can_clone = false ;
+			foreach( $block_configs as $bconf ) {
+				if( $block_arr[$i]->getVar("show_func") == $bconf['show_func'] && $block_arr[$i]->getVar("func_file") == $bconf['file'] && ( empty( $bconf['template'] ) || $block_arr[$i]->getVar("template") == $bconf['template'] ) ) {
+					if( ! empty( $bconf['can_clone'] ) ) $can_clone = true ;
+				}
+			}
+		}
+		if( $can_clone ) {
+			$clone_link = "<br /><a href='admin.php?fct=blocksadmin&amp;op=clone&amp;bid=$bid&amp;dirname=$target_dirname'>"._CLONE."</a>" ;
+		} else {
+			$clone_link = '' ;
+		}
+
+		// displaying part
+		echo "
+		<tr valign='middle'>
+			<td class='$class'>
+				$name
+				<br />
+				<input type='text' name='title[$bid]' value='$title' size='20' />
+			</td>
+			<td class='$class' align='center' nowrap='nowrap' width='125px'>
+				<div style='float:left;background-color:$scol0;'>
+					<input type='radio' name='side[$bid]' value='".XOOPS_SIDEBLOCK_LEFT."' style='background-color:$scol0;' $ssel0 />
+				</div>
+				<div style='float:left;'>-</div>
+				<div style='float:left;background-color:$scol2;'>
+					<input type='radio' name='side[$bid]' value='".XOOPS_CENTERBLOCK_LEFT."' style='background-color:$scol2;' $ssel2 />
+				</div>
+				<div style='float:left;background-color:$scol3;'>
+					<input type='radio' name='side[$bid]' value='".XOOPS_CENTERBLOCK_CENTER."' style='background-color:$scol3;' $ssel3 />
+				</div>
+				<div style='float:left;background-color:$scol4;'>
+					<input type='radio' name='side[$bid]' value='".XOOPS_CENTERBLOCK_RIGHT."' style='background-color:$scol4;' $ssel4 />
+				</div>
+				<div style='float:left;'>-</div>
+				<div style='float:left;background-color:$scol1;'>
+					<input type='radio' name='side[$bid]' value='".XOOPS_SIDEBLOCK_RIGHT."' style='background-color:$scol1;' $ssel1 />
+				</div>
+				<br />
+				<br />
+				<div style='float:left;width:40px;'>&nbsp;</div>
+				<div style='float:left;background-color:$scoln;'>
+					<input type='radio' name='side[$bid]' value='-1' style='background-color:$scoln;' $sseln />
+				</div>
+				<div style='float:left;'>"._NONE."</div>
+			</td>
+			<td class='$class' align='center'>
+				<input type='text' name=weight[$bid] value='$weight' size='3' maxlength='5' style='text-align:right;' />
+			</td>
+			<td class='$class' align='center'>
+				<select name='bmodule[$bid][]' size='5' multiple='multiple'>
+					$module_options
+				</select>
+			</td>
+			<td class='$class' align='center'>
+				<select name='bcachetime[$bid]' size='1'>
+					$cachetime_options
+				</select>
+			</td>
+			<td class='$class' align='right'>
+				<a href='admin.php?fct=blocksadmin&amp;op=edit&amp;bid=$bid&amp;dirname=$target_dirname'>"._EDIT."</a>{$delete_link}{$clone_link}
+				<input type='hidden' name='bid[$bid]' value='$bid' />
+			</td>
+		</tr>\n" ;
+
+		$class = ( $class == 'even' ) ? 'odd' : 'even' ;
+	}
+
+	echo "
+		<tr>
+			<td class='foot' align='center' colspan='6'>
+				<input type='hidden' name='fct' value='blocksadmin' />
+				<input type='hidden' name='op' value='order' />
+				".$xoopsGTicket->getTicketHtml( __LINE__ , 1800 , 'myblocksadmin' )."
+				<input type='submit' name='submit' value='"._SUBMIT."' />
+			</td>
+		</tr>
+		</table>
+	</form>\n" ;
+}
+
+
+function get_block_configs()
+{
+	$error_reporting_level = error_reporting( 0 ) ;
+	if( preg_match( '/^[.0-9a-zA-Z_-]+$/' , @$_GET['dirname'] ) ) {
+		include dirname(dirname(dirname(__FILE__))).'/'.$_GET['dirname'].'/xoops_version.php' ;
+	} else {
+		include '../xoops_version.php' ;
+	}
+	error_reporting( $error_reporting_level ) ;
+	if( empty( $modversion['blocks'] ) ) return array() ;
+	else return $modversion['blocks'] ;
+}
+
+
+function list_groups()
+{
+	global $target_mid , $target_mname , $block_arr ;
+
+	$item_list = array() ;
+	foreach( array_keys( $block_arr ) as $i ) {
+		$item_list[ $block_arr[$i]->getVar("bid") ] = $block_arr[$i]->getVar("title") ;
+	}
+
+	$form = new MyXoopsGroupPermForm( _MD_AM_ADGS , 1 , 'block_read' , '' ) ;
+	if( $target_mid > 1 ) {
+		$form->addAppendix( 'module_admin' , $target_mid , $target_mname . ' ' . _AM_ACTIVERIGHTS ) ;
+		$form->addAppendix( 'module_read' , $target_mid , $target_mname .' ' . _AM_ACCESSRIGHTS ) ;
+	}
+	foreach( $item_list as $item_id => $item_name) {
+			$form->addItem( $item_id , $item_name ) ;
+	}
+	echo $form->render() ;
+}
+
+
+
+if( ! empty( $_POST['submit'] ) ) {
+	if ( ! $xoopsGTicket->check( true , 'myblocksadmin' ) ) {
+		redirect_header(XOOPS_URL.'/',3,$xoopsGTicket->getErrors());
+	}
+
+	include( "mygroupperm.php" ) ;
+	redirect_header( XOOPS_URL."/modules/".$xoopsModule->dirname()."/admin/myblocksadmin.php?dirname=$target_dirname" , 1 , _MD_AM_DBUPDATED );
+}
+
+xoops_cp_header() ;
+if( file_exists( './mymenu.php' ) ) include( './mymenu.php' ) ;
+
+echo "<h3 style='text-align:left;'>$target_mname</h3>\n" ;
+
+if( ! empty( $block_arr ) ) {
+	echo "<h4 style='text-align:left;'>"._AM_BADMIN."</h4>\n" ;
+	list_blocks() ;
+}
+
+list_groups() ;
+xoops_cp_footer() ;
+
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/admin/mytplsform.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/admin/mytplsform.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/admin/mytplsform.php	(revision 405)
@@ -0,0 +1,151 @@
+<?php
+// ------------------------------------------------------------------------- //
+//                              mytplsform.php                               //
+//               - XOOPS templates admin for each modules -                  //
+//                          GIJOE <http://www.peak.ne.jp/>                   //
+// ------------------------------------------------------------------------- //
+
+include_once( '../../../include/cp_header.php' ) ;
+include_once "../include/gtickets.php" ;
+include_once XOOPS_ROOT_PATH.'/class/template.php';
+
+include_once dirname(dirname(__FILE__)).'/include/Text_Diff.php' ;
+include_once dirname(dirname(__FILE__)).'/include/Text_Diff_Renderer.php' ;
+include_once dirname(dirname(__FILE__)).'/include/Text_Diff_Renderer_unified.php' ;
+
+$xoops_system_path = XOOPS_ROOT_PATH . '/modules/system' ;
+
+// initials
+$db =& Database::getInstance();
+$myts =& MyTextSanitizer::getInstance() ;
+
+// determine language
+$language = $xoopsConfig['language'] ;
+if( ! file_exists( "$xoops_system_path/language/$language/admin/tplsets.php") ) $language = 'english' ;
+
+// load language constants
+// to prevent from notice that constants already defined
+$error_reporting_level = error_reporting( 0 ) ;
+include_once( "$xoops_system_path/constants.php" ) ;
+include_once( "$xoops_system_path/language/$language/admin.php" ) ;
+include_once( "$xoops_system_path/language/$language/admin/tplsets.php" ) ;
+error_reporting( $error_reporting_level ) ;
+
+// check $xoopsModule
+if( ! is_object( $xoopsModule ) ) redirect_header( XOOPS_URL.'/user.php' , 1 , _NOPERM ) ;
+
+// check access right (needs system_admin of tplset)
+$sysperm_handler =& xoops_gethandler('groupperm');
+if (!$sysperm_handler->checkRight('system_admin', XOOPS_SYSTEM_TPLSET, $xoopsUser->getGroups())) redirect_header( XOOPS_URL.'/user.php' , 1 , _NOPERM ) ;
+
+// tpl_file from $_GET
+$tpl_file = $myts->stripSlashesGPC( @$_GET['tpl_file'] ) ;
+$tpl_file = str_replace( 'db:' , '' , $tpl_file ) ;
+$tpl_file4sql = addslashes( $tpl_file ) ;
+
+// tpl_file from $_GET
+$tpl_tplset = $myts->stripSlashesGPC( @$_GET['tpl_tplset'] ) ;
+if( ! $tpl_tplset ) $tpl_tplset = $xoopsConfig['template_set'] ;
+$tpl_tplset4sql = addslashes( $tpl_tplset ) ;
+
+// get information from tplfile table
+$sql = "SELECT * FROM ".$db->prefix("tplfile")." f NATURAL LEFT JOIN ".$db->prefix("tplsource")." s WHERE f.tpl_file='$tpl_file4sql' ORDER BY f.tpl_tplset='$tpl_tplset4sql' DESC,f.tpl_tplset='default' DESC" ;
+$tpl = $db->fetchArray( $db->query( $sql ) ) ;
+
+// error in specifying tpl_file
+if( empty( $tpl ) ) {
+	if( strncmp( $tpl_file , 'file:' , 5 ) === 0 ) {
+		die( 'Not DB template' ) ;
+	} else {
+		die( 'Invalid tpl_file.' ) ;
+	}
+}
+
+//************//
+// POST stage //
+//************//
+if( ! empty( $_POST['do_modify'] ) ) {
+	// Ticket Check
+	if ( ! $xoopsGTicket->check() ) {
+		redirect_header(XOOPS_URL.'/',3,$xoopsGTicket->getErrors());
+	}
+
+	$result = $db->query( "SELECT tpl_id FROM ".$db->prefix("tplfile")." WHERE tpl_file='$tpl_file4sql' AND tpl_tplset='".addslashes($tpl['tpl_tplset'])."'" ) ;
+	while( list( $tpl_id ) = $db->fetchRow( $result ) ) {
+		$sql = "UPDATE ".$db->prefix("tplsource")." SET tpl_source='".addslashes($myts->stripSlashesGPC($_POST['tpl_source']))."' WHERE tpl_id=$tpl_id" ;
+		if( ! $db->query( $sql ) ) die( 'SQL Error' ) ;
+		$db->query( "UPDATE ".$db->prefix("tplfile")." SET tpl_lastmodified=UNIX_TIMESTAMP() WHERE tpl_id=$tpl_id" ) ;
+		xoops_template_touch( $tpl_id ) ;
+	}
+	redirect_header( 'mytplsadmin.php?dirname='.$tpl['tpl_module'] , 1 , _MD_AM_DBUPDATED ) ;
+	exit ;
+}
+
+
+
+
+xoops_cp_header() ;
+$mymenu_fake_uri = "/admin/mytplsadmin.php?dirname={$tpl['tpl_module']}" ;
+if( file_exists( './mymenu.php' ) ) include( './mymenu.php' ) ;
+
+echo "<h3 style='text-align:left;'>"._MD_AM_TPLSETS." : ".htmlspecialchars($tpl['tpl_type'],ENT_QUOTES)." : ".htmlspecialchars($tpl['tpl_file'],ENT_QUOTES)." (".htmlspecialchars($tpl['tpl_tplset'],ENT_QUOTES).")</h3>\n" ;
+
+
+// diff from file to selected DB template
+$basefilepath = XOOPS_ROOT_PATH.'/modules/'.$tpl['tpl_module'].'/templates/'.($tpl['tpl_type']=='block'?'blocks/':'').$tpl['tpl_file'] ;
+$diff_from_file4disp = '' ;
+if( file_exists( $basefilepath ) ) {
+	$diff =& new Text_Diff( file( $basefilepath ) , explode("\n",$tpl['tpl_source']) ) ;
+	$renderer =& new Text_Diff_Renderer_unified();
+	$diff_str = htmlspecialchars( $renderer->render( $diff ) , ENT_QUOTES ) ;
+	foreach( explode( "\n" , $diff_str ) as $line ) {
+		if( ord( $line ) == 0x2d ) {
+			$diff_from_file4disp .= "<span style='color:red;'>".$line."</span>\n" ;
+		} else if( ord( $line ) == 0x2b ) {
+			$diff_from_file4disp .= "<span style='color:blue;'>".$line."</span>\n" ;
+		} else {
+			$diff_from_file4disp .= $line."\n" ;
+		}
+	}
+}
+
+// diff from DB-default to selected DB template
+$diff_from_default4disp = '' ;
+if( $tpl['tpl_tplset'] != 'default' ) {
+	list( $default_source ) = $db->fetchRow( $db->query( "SELECT tpl_source FROM ".$db->prefix("tplfile")." NATURAL LEFT JOIN ".$db->prefix("tplsource")." WHERE tpl_tplset='default' AND tpl_file='".addslashes($tpl['tpl_file'])."' AND tpl_module='".addslashes($tpl['tpl_module'])."'" ) ) ;
+	$diff =& new Text_Diff( explode("\n",$default_source) , explode("\n",$tpl['tpl_source']) ) ;
+	$renderer =& new Text_Diff_Renderer_unified();
+	$diff_str = htmlspecialchars( $renderer->render( $diff ) , ENT_QUOTES ) ;
+	foreach( explode( "\n" , $diff_str ) as $line ) {
+		if( ord( $line ) == 0x2d ) {
+			$diff_from_default4disp .= "<span style='color:red;'>".$line."</span>\n" ;
+		} else if( ord( $line ) == 0x2b ) {
+			$diff_from_default4disp .= "<span style='color:blue;'>".$line."</span>\n" ;
+		} else {
+			$diff_from_default4disp .= $line."\n" ;
+		}
+	}
+}
+
+
+echo "
+	<form name='diff_form' id='diff_form' action='' method='get'>
+	<input type='checkbox' name='display_diff2file' value='1' onClick=\"if(this.checked){document.getElementById('diff2file').style.display='block'}else{document.getElementById('diff2file').style.display='none'};\" id='display_diff2file' checked='checked' />&nbsp;<label for='display_diff2file'>diff from file</label>
+	<pre id='diff2file' style='display:block;border:1px solid black;'>$diff_from_file4disp</pre>
+	<input type='checkbox' name='display_diff2default' value='1' onClick=\"if(this.checked){document.getElementById('diff2default').style.display='block'}else{document.getElementById('diff2default').style.display='none'};\" id='display_diff2default' />&nbsp;<label for='display_diff2default'>diff from default</label>
+	<pre id='diff2default' style='display:none;border:1px solid black;'>$diff_from_default4disp</pre>
+	</form>\n" ;
+
+
+echo "
+<form name='MainForm' action='?tpl_file=".htmlspecialchars($tpl['tpl_file'],ENT_QUOTES)."&amp;tpl_tplset=".htmlspecialchars($tpl['tpl_tplset'],ENT_QUOTES)."' method='post'>
+	".$xoopsGTicket->getTicketHtml( __LINE__ )."
+	<textarea name='tpl_source' wrap='off' style='width:600px;height:400px;'>".htmlspecialchars($tpl['tpl_source'],ENT_QUOTES)."</textarea>
+	<br />
+	<input type='submit' name='do_modify' value='"._SUBMIT."' />
+	<input type='reset' name='reset' value='reset' />
+</form>\n" ;
+
+xoops_cp_footer() ;
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/admin/blockform.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/admin/blockform.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/admin/blockform.php	(revision 405)
@@ -0,0 +1,88 @@
+<?php
+// $Id: blockform.php,v 1.8 2003/03/10 13:32:05 okazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+include_once XOOPS_ROOT_PATH."/class/xoopsformloader.php";
+$form = new XoopsThemeForm($block['form_title'], 'blockform', 'admin.php');
+if (isset($block['name'])) {
+	$form->addElement(new XoopsFormLabel(_AM_NAME, $block['name']));
+}
+$side_select = new XoopsFormSelect(_AM_BLKTYPE, "bside", $block['side']);
+$side_select->addOptionArray(array(0 => _AM_SBLEFT, 1 => _AM_SBRIGHT, 3 => _AM_CBLEFT, 4 => _AM_CBRIGHT, 5 => _AM_CBCENTER, ));
+$form->addElement($side_select);
+$form->addElement(new XoopsFormText(_AM_WEIGHT, "bweight", 2, 5, $block['weight']));
+$form->addElement(new XoopsFormRadioYN(_AM_VISIBLE, 'bvisible', $block['visible']));
+$mod_select = new XoopsFormSelect(_AM_VISIBLEIN, "bmodule", $block['modules'], 5, true);
+$module_handler =& xoops_gethandler('module');
+$criteria = new CriteriaCompo(new Criteria('hasmain', 1));
+$criteria->add(new Criteria('isactive', 1));
+$module_list =& $module_handler->getList($criteria);
+$module_list[-1] = _AM_TOPPAGE;
+$module_list[0] = _AM_ALLPAGES;
+ksort($module_list);
+$mod_select->addOptionArray($module_list);
+$form->addElement($mod_select);
+$form->addElement(new XoopsFormText(_AM_TITLE, 'btitle', 50, 255, $block['title']), false);
+if ( $block['is_custom'] ) {
+	$textarea = new XoopsFormDhtmlTextArea(_AM_CONTENT, 'bcontent', $block['content'], 15, 70);
+	$textarea->setDescription('<span style="font-size:x-small;font-weight:bold;">'._AM_USEFULTAGS.'</span><br /><span style="font-size:x-small;font-weight:normal;">'.sprintf(_AM_BLOCKTAG1, '{X_SITEURL}', XOOPS_URL.'/').'</span>');
+	$form->addElement($textarea, true);
+	$ctype_select = new XoopsFormSelect(_AM_CTYPE, 'bctype', $block['ctype']);
+	$ctype_select->addOptionArray(array('H' => _AM_HTML, 'P' => _AM_PHP, 'S' => _AM_AFWSMILE, 'T' => _AM_AFNOSMILE));
+	$form->addElement($ctype_select);
+} else {
+	if ($block['template'] != '') {
+		$tplfile_handler =& xoops_gethandler('tplfile');
+		$btemplate =& $tplfile_handler->find($GLOBALS['xoopsConfig']['template_set'], 'block', $block['bid']);
+		if (count($btemplate) > 0) {
+			$form->addElement(new XoopsFormLabel(_AM_CONTENT, '<a href="'.XOOPS_URL.'/modules/system/admin.php?fct=tplsets&op=edittpl&id='.$btemplate[0]->getVar('tpl_id').'">'._AM_EDITTPL.'</a>'));
+		} else {
+			$btemplate2 =& $tplfile_handler->find('default', 'block', $block['bid']);
+			if (count($btemplate2) > 0) {
+				$form->addElement(new XoopsFormLabel(_AM_CONTENT, '<a href="'.XOOPS_URL.'/modules/system/admin.php?fct=tplsets&op=edittpl&id='.$btemplate2[0]->getVar('tpl_id').'" target="_blank">'._AM_EDITTPL.'</a>'));
+			}
+		}
+	}
+	if ($block['edit_form'] != false) {
+		$form->addElement(new XoopsFormLabel(_AM_OPTIONS, $block['edit_form']));
+	}
+}
+$cache_select = new XoopsFormSelect(_AM_BCACHETIME, 'bcachetime', $block['cachetime']);
+$cache_select->addOptionArray(array('0' => _NOCACHE, '30' => sprintf(_SECONDS, 30), '60' => _MINUTE, '300' => sprintf(_MINUTES, 5), '1800' => sprintf(_MINUTES, 30), '3600' => _HOUR, '18000' => sprintf(_HOURS, 5), '86400' => _DAY, '259200' => sprintf(_DAYS, 3), '604800' => _WEEK, '2592000' => _MONTH));
+$form->addElement($cache_select);
+if (isset($block['bid'])) {
+	$form->addElement(new XoopsFormHidden('bid', $block['bid']));
+}
+// $form->addElement(new XoopsFormHidden('options', $block['options']));
+$form->addElement(new XoopsFormHidden('op', $block['op']));
+$form->addElement(new XoopsFormHidden('fct', 'blocksadmin'));
+$button_tray = new XoopsFormElementTray('', '&nbsp;');
+/* if ($block['is_custom']) {
+	$button_tray->addElement(new XoopsFormButton('', 'previewblock', _PREVIEW, "submit"));
+} */
+$button_tray->addElement(new XoopsFormButton('', 'submitblock', $block['submit_button'], "submit"));
+$form->addElement($button_tray);
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/admin/myblocksadmin2.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/admin/myblocksadmin2.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/admin/myblocksadmin2.php	(revision 405)
@@ -0,0 +1,344 @@
+<?php
+// ------------------------------------------------------------------------- //
+//                     myblocksadmin_for_2.2.php                             //
+//                - XOOPS block admin for each modules -                     //
+//                          GIJOE <http://www.peak.ne.jp/>                   //
+// ------------------------------------------------------------------------- //
+
+if( ! defined( 'XOOPS_ROOT_PATH' ) ) exit ;
+
+include_once( '../../../include/cp_header.php' ) ;
+
+include_once( 'mygrouppermform.php' ) ;
+include_once( XOOPS_ROOT_PATH.'/class/xoopsblock.php' ) ;
+include_once "../include/gtickets.php" ;
+
+$xoops_system_path = XOOPS_ROOT_PATH . '/modules/system' ;
+
+// language files
+$language = $xoopsConfig['language'] ;
+if( ! file_exists( "$xoops_system_path/language/$language/admin/blocksadmin.php") ) $language = 'english' ;
+
+// to prevent from notice that constants already defined
+$error_reporting_level = error_reporting( 0 ) ;
+include_once( "$xoops_system_path/constants.php" ) ;
+include_once( "$xoops_system_path/language/$language/admin.php" ) ;
+include_once( "$xoops_system_path/language/$language/admin/blocksadmin.php" ) ;
+error_reporting( $error_reporting_level ) ;
+
+$group_defs = file( "$xoops_system_path/language/$language/admin/groups.php" ) ;
+foreach( $group_defs as $def ) {
+	if( strstr( $def , '_AM_ACCESSRIGHTS' ) || strstr( $def , '_AM_ACTIVERIGHTS' ) ) eval( $def ) ;
+}
+
+
+// check $xoopsModule
+if( ! is_object( $xoopsModule ) ) redirect_header( XOOPS_URL.'/user.php' , 1 , _NOPERM ) ;
+
+// set target_module if specified by $_GET['dirname'] && this is 'blocksadmin'
+$module_handler =& xoops_gethandler('module');
+if( $xoopsModule->getVar('dirname') == 'blocksadmin' && ! empty( $_GET['dirname'] ) ) {
+	$target_module =& $module_handler->getByDirname($_GET['dirname']);
+}
+
+if( ! empty( $target_module ) && is_object( $target_module ) ) {
+	// specified by dirname
+	$target_mid = $target_module->getVar( 'mid' ) ;
+	$target_mname = $target_module->getVar( 'name' ) . "&nbsp;" . sprintf( "(%2.2f)" , $target_module->getVar('version') / 100.0 ) ;
+	$target_dirname = $target_module->getVar( 'dirname' ) ;
+} else if( $xoopsModule->getVar('dirname') == 'blocksadmin' ) {
+	$target_mid = 0 ;
+	$target_mname = '' ;
+	$target_dirname = '' ;
+} else {
+	$target_mid = $xoopsModule->getVar( 'mid' ) ;
+	$target_mname = $xoopsModule->getVar( 'name' ) ;
+	$target_dirname = '' ;
+}
+
+// check access right (needs system_admin of BLOCK)
+$sysperm_handler =& xoops_gethandler('groupperm');
+if (!$sysperm_handler->checkRight('system_admin', XOOPS_SYSTEM_BLOCK, $xoopsUser->getGroups())) redirect_header( XOOPS_URL.'/user.php' , 1 , _NOPERM ) ;
+
+// get blocks owned by the module (Imported from xoopsblock.php then modified)
+$db =& Database::getInstance();
+$sql = "SELECT bid,name,show_func,func_file,template FROM ".$db->prefix("newblocks")." WHERE mid='$target_mid'";
+$result = $db->query($sql);
+$block_arr = array();
+while( list( $bid , $bname , $show_func , $func_file , $template ) = $db->fetchRow( $result ) ) {
+	$block_arr[$bid] = array(
+		'name' => $bname ,
+		'show_func' => $show_func ,
+		'func_file' => $func_file ,
+		'template' => $template
+	) ;
+}
+
+
+// for 2.2
+function list_blockinstances()
+{
+	global $target_dirname , $block_arr , $xoopsGTicket ;
+
+	$myts =& MyTextSanitizer::getInstance() ;
+
+	// cachetime options
+	$cachetimes = array('0' => _NOCACHE, '30' => sprintf(_SECONDS, 30), '60' => _MINUTE, '300' => sprintf(_MINUTES, 5), '1800' => sprintf(_MINUTES, 30), '3600' => _HOUR, '18000' => sprintf(_HOURS, 5), '86400' => _DAY, '259200' => sprintf(_DAYS, 3), '604800' => _WEEK, '2592000' => _MONTH);
+
+	// displaying TH
+	echo "
+	<form action='admin.php' name='blockadmin' method='post'>
+		<table width='95%' class='outer' cellpadding='4' cellspacing='1'>
+		<tr valign='middle'>
+			<th>"._AM_TITLE."</th>
+			<th align='center' nowrap='nowrap'>"._AM_SIDE."</th>
+			<th align='center'>"._AM_WEIGHT."</th>
+			<th align='center'>"._AM_VISIBLEIN."</th>
+			<th align='center'>"._AM_BCACHETIME."</th>
+			<th align='right'>"._AM_ACTION."</th>
+		</tr>\n" ;
+
+	// get block instances
+	$crit = new Criteria("bid", "(".implode(",",array_keys($block_arr)).")", "IN");
+	$criteria = new CriteriaCompo($crit);
+	$criteria->setSort('visible DESC, side ASC, weight');
+	$instance_handler =& xoops_gethandler('blockinstance');
+	$instances =& $instance_handler->getObjects($criteria, true, true);
+
+	//Get modules and pages for visible in
+	$module_list[_AM_SYSTEMLEVEL]["0-2"] = _AM_ADMINBLOCK;
+	$module_list[_AM_SYSTEMLEVEL]["0-1"] = _AM_TOPPAGE;
+	$module_list[_AM_SYSTEMLEVEL]["0-0"] = _AM_ALLPAGES;
+	$criteria = new CriteriaCompo(new Criteria('hasmain', 1));
+	$criteria->add(new Criteria('isactive', 1));
+	$module_handler =& xoops_gethandler('module');
+	$module_main =& $module_handler->getObjects($criteria, true, true);
+	if (count($module_main) > 0) {
+		foreach (array_keys($module_main) as $mid) {
+			$module_list[$module_main[$mid]->getVar('name')][$mid."-0"] = _AM_ALLMODULEPAGES;
+			$pages = $module_main[$mid]->getInfo("pages");
+			if ($pages == false) {
+				$pages = $module_main[$mid]->getInfo("sub");
+			}
+			if (is_array($pages) && $pages != array()) {
+				foreach ($pages as $id => $pageinfo) {
+					$module_list[$module_main[$mid]->getVar('name')][$mid."-".$id] = $pageinfo['name'];
+				}
+			}
+		}
+	}
+
+	// blocks displaying loop
+	$class = 'even' ;
+	$block_configs = get_block_configs() ;
+	foreach( array_keys( $instances ) as $i ) {
+		$sseln = $ssel0 = $ssel1 = $ssel2 = $ssel3 = $ssel4 = "";
+		$scoln = $scol0 = $scol1 = $scol2 = $scol3 = $scol4 = "#FFFFFF";
+
+		$weight = $instances[$i]->getVar("weight") ;
+		$title = $instances[$i]->getVar("title") ;
+		$bcachetime = $instances[$i]->getVar("bcachetime") ;
+		$bid = $instances[$i]->getVar("bid") ;
+		$name = $myts->makeTboxData4Edit( $block_arr[$bid]['name'] ) ;
+
+		$visiblein = $instances[$i]->getVisibleIn();
+
+		// visible and side
+		if ( $instances[$i]->getVar("visible") != 1 ) {
+			$sseln = " checked='checked'";
+			$scoln = "#FF0000";
+		} else switch( $instances[$i]->getVar("side") ) {
+			default :
+			case XOOPS_SIDEBLOCK_LEFT :
+				$ssel0 = " checked='checked'";
+				$scol0 = "#00FF00";
+				break ;
+			case XOOPS_SIDEBLOCK_RIGHT :
+				$ssel1 = " checked='checked'";
+				$scol1 = "#00FF00";
+				break ;
+			case XOOPS_CENTERBLOCK_LEFT :
+				$ssel2 = " checked='checked'";
+				$scol2 = "#00FF00";
+				break ;
+			case XOOPS_CENTERBLOCK_RIGHT :
+				$ssel4 = " checked='checked'";
+				$scol4 = "#00FF00";
+				break ;
+			case XOOPS_CENTERBLOCK_CENTER :
+				$ssel3 = " checked='checked'";
+				$scol3 = "#00FF00";
+				break ;
+		}
+
+		// bcachetime
+		$cachetime_options = '' ;
+		foreach( $cachetimes as $cachetime => $cachetime_name ) {
+			if( $bcachetime == $cachetime ) {
+				$cachetime_options .= "<option value='$cachetime' selected='selected'>$cachetime_name</option>\n" ;
+			} else {
+				$cachetime_options .= "<option value='$cachetime'>$cachetime_name</option>\n" ;
+			}
+		}
+
+		$module_options = '' ;
+		foreach( $module_list as $mname => $module ) {
+			$module_options .= "<optgroup label='$mname'>\n" ;
+			foreach( $module as $mkey => $mval ) {
+				if( in_array( $mkey , $visiblein ) ) {
+					$module_options .= "<option value='$mkey' selected='selected'>$mval</option>\n" ;
+				} else {
+					$module_options .= "<option label='$mval' value='$mkey'>$mval</option>\n" ;
+				}
+			}
+			$module_options .= "</optgroup>\n" ;
+		}
+
+		// delete link if it is cloned block
+		$delete_link = "<br /><a href='".XOOPS_URL."/modules/system/admin.php?fct=blocksadmin&amp;op=delete&amp;id=$i&amp;selmod=$mid&amp;dirname=$target_dirname'>"._DELETE."</a>" ;
+
+		// displaying part
+		echo "
+		<tr valign='middle'>
+			<td class='$class'>
+				$name
+				<br />
+				<input type='text' name='title[$i]' value='$title' size='20' />
+			</td>
+			<td class='$class' align='center' nowrap='nowrap' width='125px'>
+				<div style='float:left;background-color:$scol0;'>
+					<input type='radio' name='side[$i]' value='".XOOPS_SIDEBLOCK_LEFT."' style='background-color:$scol0;' $ssel0 />
+				</div>
+				<div style='float:left;'>-</div>
+				<div style='float:left;background-color:$scol2;'>
+					<input type='radio' name='side[$i]' value='".XOOPS_CENTERBLOCK_LEFT."' style='background-color:$scol2;' $ssel2 />
+				</div>
+				<div style='float:left;background-color:$scol3;'>
+					<input type='radio' name='side[$i]' value='".XOOPS_CENTERBLOCK_CENTER."' style='background-color:$scol3;' $ssel3 />
+				</div>
+				<div style='float:left;background-color:$scol4;'>
+					<input type='radio' name='side[$i]' value='".XOOPS_CENTERBLOCK_RIGHT."' style='background-color:$scol4;' $ssel4 />
+				</div>
+				<div style='float:left;'>-</div>
+				<div style='float:left;background-color:$scol1;'>
+					<input type='radio' name='side[$i]' value='".XOOPS_SIDEBLOCK_RIGHT."' style='background-color:$scol1;' $ssel1 />
+				</div>
+				<br />
+				<br />
+				<div style='float:left;width:40px;'>&nbsp;</div>
+				<div style='float:left;background-color:$scoln;'>
+					<input type='radio' name='side[$i]' value='-1' style='background-color:$scoln;' $sseln />
+				</div>
+				<div style='float:left;'>"._NONE."</div>
+			</td>
+			<td class='$class' align='center'>
+				<input type='text' name=weight[$i] value='$weight' size='3' maxlength='5' style='text-align:right;' />
+			</td>
+			<td class='$class' align='center'>
+				<select name='bmodule[$i][]' size='5' multiple='multiple'>
+					$module_options
+				</select>
+			</td>
+			<td class='$class' align='center'>
+				<select name='bcachetime[$i]' size='1'>
+					$cachetime_options
+				</select>
+			</td>
+			<td class='$class' align='right'>
+				<a href='".XOOPS_URL."/modules/system/admin.php?fct=blocksadmin&amp;op=edit&amp;id=$i&amp;dirname=$target_dirname'>"._EDIT."</a>{$delete_link}
+				<input type='hidden' name='id[$i]' value='$i' />
+			</td>
+		</tr>\n" ;
+
+		$class = ( $class == 'even' ) ? 'odd' : 'even' ;
+	}
+
+	// list block classes for add (not instances)
+	foreach( $block_arr as $bid => $block ) {
+
+		$description4show = '' ;
+		foreach( $block_configs as $bconf ) {
+			if( $block['show_func'] == $bconf['show_func'] && $block['func_file'] == $bconf['file'] && ( empty( $bconf['template'] ) || $block['template'] == $bconf['template'] ) ) {
+				if( ! empty( $bconf['description'] ) ) $description4show = $myts->makeTboxData4Show( $bconf['description'] ) ;
+			}
+		}
+
+		echo "
+		<tr>
+			<td class='$class' align='left'>
+				".$myts->makeTboxData4Edit($block['name'])."
+			</td>
+			<td class='$class' align='left' colspan='4'>
+				$description4show
+			</td>
+			<td class='$class' align='center'>
+				<input type='submit' name='addblock[$bid]' value='"._ADD."' />
+			</td>
+		</tr>
+		\n" ;
+		$class = ( $class == 'even' ) ? 'odd' : 'even' ;
+	}
+
+	echo "
+		<tr>
+			<td class='foot' align='center' colspan='6'>
+				<input type='hidden' name='fct' value='blocksadmin' />
+				<input type='hidden' name='op' value='order2' />
+				".$xoopsGTicket->getTicketHtml( __LINE__ , 1800 , 'myblocksadmin' )."
+				<input type='submit' name='submit' value='"._SUBMIT."' />
+			</td>
+		</tr>
+		</table>
+	</form>\n" ;
+}
+
+
+// for 2.2
+function list_groups2()
+{
+	global $target_mid , $target_mname , $xoopsDB ;
+
+	$result = $xoopsDB->query( "SELECT i.instanceid,i.title FROM ".$xoopsDB->prefix("block_instance")." i LEFT JOIN ".$xoopsDB->prefix("newblocks")." b ON i.bid=b.bid WHERE b.mid='$target_mid'" ) ;
+
+	$item_list = array() ;
+	while( list( $iid , $title ) = $xoopsDB->fetchRow( $result ) ) {
+		$item_list[ $iid ] = $title ;
+	}
+
+	$form = new MyXoopsGroupPermForm( _MD_AM_ADGS , 1 , 'block_read' , '' ) ;
+	if( $target_mid > 1 ) {
+		$form->addAppendix( 'module_admin' , $target_mid , $target_mname . ' ' . _AM_ACTIVERIGHTS ) ;
+		$form->addAppendix( 'module_read' , $target_mid , $target_mname .' ' . _AM_ACCESSRIGHTS ) ;
+	}
+	foreach( $item_list as $item_id => $item_name) {
+			$form->addItem( $item_id , $item_name ) ;
+	}
+	echo $form->render() ;
+}
+
+
+
+if( ! empty( $_POST['submit'] ) ) {
+	if ( ! $xoopsGTicket->check( true , 'myblocksadmin' ) ) {
+		redirect_header(XOOPS_URL.'/',3,$xoopsGTicket->getErrors());
+	}
+
+	include( "mygroupperm.php" ) ;
+	redirect_header( XOOPS_URL."/modules/".$xoopsModule->dirname()."/admin/myblocksadmin.php?dirname=$target_dirname" , 1 , _MD_AM_DBUPDATED );
+}
+
+xoops_cp_header() ;
+if( file_exists( './mymenu.php' ) ) include( './mymenu.php' ) ;
+
+echo "<h3 style='text-align:left;'>$target_mname</h3>\n" ;
+
+if( ! empty( $block_arr ) ) {
+	echo "<h4 style='text-align:left;'>"._AM_BADMIN."</h4>\n" ;
+	list_blockinstances() ;
+}
+
+list_groups2() ;
+xoops_cp_footer() ;
+
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/admin/mytplsadmin.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/admin/mytplsadmin.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/admin/mytplsadmin.php	(revision 405)
@@ -0,0 +1,413 @@
+<?php
+// ------------------------------------------------------------------------- //
+//                              mytplsadmin.php                              //
+//               - XOOPS templates admin for each modules -                  //
+//                          GIJOE <http://www.peak.ne.jp/>                   //
+// ------------------------------------------------------------------------- //
+
+include_once( '../../../include/cp_header.php' ) ;
+
+include_once "../include/gtickets.php" ;
+include_once XOOPS_ROOT_PATH.'/class/template.php';
+
+// searching a language file "mytplsadmin.php"
+// (in the module)->(in tplsadmin module)->(fallbacked english)
+if( file_exists( dirname(dirname(__FILE__)).'/language/'.$xoopsConfig['language'].'/mytplsadmin.php' ) ) {
+	include_once dirname(dirname(__FILE__)).'/language/'.$xoopsConfig['language'].'/mytplsadmin.php' ;
+} else if( file_exists( XOOPS_ROOT_PATH.'/modules/tplsadmin/language/'.$xoopsConfig['language'].'/mytplsadmin.php' ) ) {
+	include_once XOOPS_ROOT_PATH.'/modules/tplsadmin/language/'.$xoopsConfig['language'].'/mytplsadmin.php' ;
+} else {
+	// fallbacked english
+	define( '_MYTPLSADMIN_CREATE_NEW_TPLSET' , 'Create a new set' ) ;
+	define( '_MYTPLSADMIN_CAPTION_BASE' , 'Base' ) ;
+	define( '_MYTPLSADMIN_CAPTION_SETNAME' , 'name' ) ;
+	define( '_MYTPLSADMIN_OPT_BLANKSET' , '(blank)' ) ;
+	define( '_MYTPLSADMIN_CAPTION_COPYTO' , 'to' ) ;
+	define( '_MYTPLSADMIN_BTN_COPY' , 'COPY' ) ;
+	define( '_MYTPLSADMIN_TITLE_CHECKALL' , 'Turn on/off all of checkboxes in this row' ) ;
+	define( '_MYTPLSADMIN_CNF_DELETE_SELECTED_TEMPLATES' , 'All of checked templates in the set(row) will be removed. Are you OK?' ) ;
+	define( '_MYTPLSADMIN_CNF_COPY_SELECTED_TEMPLATES' , 'All of checked templates in the set(row) will be copied/overwritten into the selected set. Are you OK?' ) ;
+	define( '_MYTPLSADMIN_TH_TYPE' , 'type' ) ;
+	define( '_MYTPLSADMIN_TH_FILE' , 'base file' ) ;
+	define( '_MYTPLSADMIN_ERR_NOTPLFILE' , "No template is checked." ) ;
+	define( '_MYTPLSADMIN_ERR_INVALIDTPLSET' , "Destination set is same as source set, or no valid tplset is specified." ) ;
+	define( '_MYTPLSADMIN_ERR_CANTREMOVEDEFAULT' , "You can't remove 'default' template." ) ;
+	define( '_MYTPLSADMIN_ERR_DUPLICATEDSETNAME' , "The set name already exists." ) ;
+	define( '_MYTPLSADMIN_ERR_INVALIDSETNAME' , "a wrong set name is specified." ) ;
+}
+
+
+// initials
+$xoops_system_path = XOOPS_ROOT_PATH . '/modules/system' ;
+$db =& Database::getInstance();
+$myts =& MyTextSanitizer::getInstance() ;
+
+
+// determine language
+$language = $xoopsConfig['language'] ;
+if( ! file_exists( "$xoops_system_path/language/$language/admin/tplsets.php") ) $language = 'english' ;
+
+// load language constants
+// to prevent from notice that constants already defined
+$error_reporting_level = error_reporting( 0 ) ;
+include_once( "$xoops_system_path/constants.php" ) ;
+include_once( "$xoops_system_path/language/$language/admin.php" ) ;
+include_once( "$xoops_system_path/language/$language/admin/tplsets.php" ) ;
+error_reporting( $error_reporting_level ) ;
+
+// check $xoopsModule
+if( ! is_object( $xoopsModule ) ) redirect_header( XOOPS_URL.'/user.php' , 1 , _NOPERM ) ;
+
+// set target_module if specified by $_GET['dirname']
+$module_handler =& xoops_gethandler('module');
+if( ! empty( $_GET['dirname'] ) ) {
+	$target_module =& $module_handler->getByDirname($_GET['dirname']);
+}
+
+if( ! empty( $target_module ) && is_object( $target_module ) ) {
+	// specified by dirname (for tplsadmin as an independent module)
+	$target_mid = $target_module->getVar( 'mid' ) ;
+	$target_dirname = $target_module->getVar( 'dirname' ) ;
+	$target_dirname4sql = addslashes( $target_dirname ) ;
+	$target_mname = $target_module->getVar( 'name' ) . "&nbsp;" . sprintf( "(%2.2f)" , $target_module->getVar('version') / 100.0 ) ;
+	$query4redirect = '?dirname='.urlencode(strip_tags($_GET['dirname'])) ;
+} else {
+	// not specified by dirname (for 3rd party modules as mytplsadmin)
+	$target_mid = $xoopsModule->getVar( 'mid' ) ;
+	$target_dirname = $xoopsModule->getVar( 'dirname' ) ;
+	$target_dirname4sql = addslashes( $target_dirname ) ;
+	$target_mname = $xoopsModule->getVar( 'name' ) ;
+	$query4redirect = '' ;
+}
+
+// check access right (needs system_admin of tplset)
+$sysperm_handler =& xoops_gethandler('groupperm');
+if (!$sysperm_handler->checkRight('system_admin', XOOPS_SYSTEM_TPLSET, $xoopsUser->getGroups())) redirect_header( XOOPS_URL.'/user.php' , 1 , _NOPERM ) ;
+
+
+//**************//
+// POST stages  //
+//**************//
+
+// Create new template set (blank or clone)
+if( ! empty( $_POST['clone_tplset_do'] ) && ! empty( $_POST['clone_tplset_from'] ) && ! empty( $_POST['clone_tplset_to'] ) ) {
+	// Ticket Check
+	if ( ! $xoopsGTicket->check() ) {
+		redirect_header(XOOPS_URL.'/',3,$xoopsGTicket->getErrors());
+	}
+
+	$tplset_from = $myts->stripSlashesGPC( $_POST['clone_tplset_from'] ) ;
+	$tplset_to = $myts->stripSlashesGPC( $_POST['clone_tplset_to'] ) ;
+	// check tplset_name "from" and "to"
+	if( ! preg_match( '/^[0-9A-Za-z_-]{1,16}$/' , $_POST['clone_tplset_from'] ) ) die( _MYTPLSADMIN_ERR_INVALIDSETNAME ) ;
+	if( ! preg_match( '/^[0-9A-Za-z_-]{1,16}$/' , $_POST['clone_tplset_to'] ) ) die( _MYTPLSADMIN_ERR_INVALIDSETNAME ) ;
+	list( $is_exist ) = $db->fetchRow( $db->query( "SELECT COUNT(*) FROM ".$db->prefix("tplfile")." WHERE tpl_tplset='".addslashes($tplset_to)."'" ) ) ;
+	if( $is_exist ) die( _MYTPLSADMIN_ERR_DUPLICATEDSETNAME ) ;
+	list( $is_exist ) = $db->fetchRow( $db->query( "SELECT COUNT(*) FROM ".$db->prefix("tplset")." WHERE tplset_name='".addslashes($tplset_to)."'" ) ) ;
+	if( $is_exist ) die( _MYTPLSADMIN_ERR_DUPLICATEDSETNAME ) ;
+	// insert tplset table
+	$db->query( "INSERT INTO ".$db->prefix("tplset")." SET tplset_name='".addslashes($tplset_to)."', tplset_desc='Created by tplsadmin', tplset_created=UNIX_TIMESTAMP()" ) ;
+	copy_templates_db2db( $tplset_from , $tplset_to , "tpl_module='$target_dirname4sql'" ) ;
+	redirect_header( 'mytplsadmin.php?dirname='.$target_dirname , 1 , _MD_AM_DBUPDATED ) ;
+	exit ;
+}
+
+// DB to DB template copy (checked templates)
+if( is_array( @$_POST['copy_do'] ) ) foreach( $_POST['copy_do'] as $tplset_from_tmp => $val ) if( ! empty( $val ) ) {
+	// Ticket Check
+	if ( ! $xoopsGTicket->check() ) {
+		redirect_header(XOOPS_URL.'/',3,$xoopsGTicket->getErrors());
+	}
+
+	$tplset_from = $myts->stripSlashesGPC( $tplset_from_tmp ) ;
+	if( empty( $_POST['copy_to'][$tplset_from] ) || $_POST['copy_to'][$tplset_from] == $tplset_from ) die( _MYTPLSADMIN_ERR_INVALIDTPLSET ) ;
+	if( empty( $_POST["{$tplset_from}_check"] ) ) die( _MYTPLSADMIN_ERR_NOTPLFILE ) ;
+	$tplset_to = $myts->stripSlashesGPC( $_POST['copy_to'][$tplset_from] ) ;
+	foreach( $_POST["{$tplset_from}_check"] as $tplfile_tmp => $val ) {
+		if( empty( $val ) ) continue ;
+		$tplfile = $myts->stripSlashesGPC( $tplfile_tmp ) ;
+		copy_templates_db2db( $tplset_from , $tplset_to , "tpl_file='".addslashes($tplfile)."'" ) ;
+	}
+	redirect_header( 'mytplsadmin.php?dirname='.$target_dirname , 1 , _MD_AM_DBUPDATED ) ;
+	exit ;
+}
+
+// File to DB template copy (checked templates)
+if( ! empty( $_POST['copyf2db_do'] ) ) {
+	// Ticket Check
+	if ( ! $xoopsGTicket->check() ) {
+		redirect_header(XOOPS_URL.'/',3,$xoopsGTicket->getErrors());
+	}
+
+	if( empty( $_POST['copyf2db_to'] ) ) die( _MYTPLSADMIN_ERR_INVALIDTPLSET ) ;
+	if( empty( $_POST['basecheck'] ) ) die( _MYTPLSADMIN_ERR_NOTPLFILE ) ;
+	$tplset_to = $myts->stripSlashesGPC( $_POST['copyf2db_to'] ) ;
+	foreach( $_POST['basecheck'] as $tplfile_tmp => $val ) {
+		if( empty( $val ) ) continue ;
+		$tplfile = $myts->stripSlashesGPC( $tplfile_tmp ) ;
+		copy_templates_f2db( $tplset_to , "tpl_file='".addslashes($tplfile)."'" ) ;
+	}
+	redirect_header( 'mytplsadmin.php?dirname='.$target_dirname , 1 , _MD_AM_DBUPDATED ) ;
+	exit ;
+}
+
+// DB template remove (checked templates)
+if( is_array( @$_POST['del_do'] ) ) foreach( $_POST['del_do'] as $tplset_from_tmp => $val ) if( ! empty( $val ) ) {
+	// Ticket Check
+	if ( ! $xoopsGTicket->check() ) {
+		redirect_header(XOOPS_URL.'/',3,$xoopsGTicket->getErrors());
+	}
+
+	$tplset_from = $myts->stripSlashesGPC( $tplset_from_tmp ) ;
+	if( $tplset_from == 'default' ) die( _MYTPLSADMIN_ERR_CANTREMOVEDEFAULT ) ;
+	if( empty( $_POST["{$tplset_from}_check"] ) ) die( _MYTPLSADMIN_ERR_NOTPLFILE ) ;
+
+	$tpl = new XoopsTpl();
+	$tpl->force_compile = true;
+
+	foreach( $_POST["{$tplset_from}_check"] as $tplfile_tmp => $val ) {
+		if( empty( $val ) ) continue ;
+		$tplfile = $myts->stripSlashesGPC( $tplfile_tmp ) ;
+		$result = $db->query( "SELECT tpl_id FROM ".$db->prefix("tplfile")." WHERE tpl_tplset='".addslashes($tplset_from)."' AND tpl_file='".addslashes($tplfile)."'" ) ;
+		while( list( $tpl_id ) = $db->fetchRow( $result ) ) {
+			$tpl_id = intval( $tpl_id ) ;
+			$db->query( "DELETE FROM ".$db->prefix("tplfile")." WHERE tpl_id=$tpl_id" ) ;
+			$db->query( "DELETE FROM ".$db->prefix("tplsource")." WHERE tpl_id=$tpl_id" ) ;
+		}
+		// remove templates_c
+		$tpl->clear_cache('db:'.$tplfile);
+		$tpl->clear_compiled_tpl('db:'.$tplfile);
+	}
+	redirect_header( 'mytplsadmin.php?dirname='.$target_dirname , 1 , _MD_AM_DBUPDATED ) ;
+	exit ;
+}
+
+
+
+//************//
+// GET stage  //
+//************//
+
+// get tplsets
+$tplset_handler =& xoops_gethandler( 'tplset' ) ;
+$tplsets = array_keys( $tplset_handler->getList() ) ;
+$sql = "SELECT distinct tpl_tplset FROM ".$db->prefix("tplfile")." ORDER BY tpl_tplset='default' DESC,tpl_tplset" ;
+$srs = $db->query($sql);
+while( list( $tplset ) = $db->fetchRow( $srs ) ) {
+	if( ! in_array( $tplset , $tplsets ) ) $tplsets[] = $tplset ;
+}
+
+$tplsets_th4disp = '' ;
+$tplset_options = "<option value=''>----</option>\n" ;
+foreach( $tplsets as $tplset ) {
+	$tplset4disp = htmlspecialchars( $tplset , ENT_QUOTES ) ;
+	$th_style = $tplset == $xoopsConfig['template_set'] ? "style='color:yellow;'" : "" ;
+	$tplsets_th4disp .= "<th $th_style><input type='checkbox' title='"._MYTPLSADMIN_TITLE_CHECKALL."' onclick=\"with(document.MainForm){for(i=0;i<length;i++){if(elements[i].type=='checkbox'&&elements[i].name.indexOf('{$tplset4disp}_check')>=0){elements[i].checked=this.checked;}}}\" />DB-{$tplset4disp}</th>" ;
+	$tplset_options .= "<option value='$tplset4disp'>$tplset4disp</option>\n" ;
+}
+
+// get tpl_file owned by the module
+$sql = "SELECT tpl_file,tpl_desc,tpl_type,COUNT(tpl_id) FROM ".$db->prefix("tplfile")." WHERE tpl_module='$target_dirname4sql' GROUP BY tpl_file ORDER BY tpl_type, tpl_file" ;
+$frs = $db->query($sql);
+
+xoops_cp_header() ;
+if( file_exists( './mymenu.php' ) ) include( './mymenu.php' ) ;
+
+echo "<h3 style='text-align:left;'>"._MD_AM_TPLSETS." : $target_mname</h3>\n" ;
+
+
+// beggining of table & form
+echo "
+	<form name='MainForm' action='?dirname=".htmlspecialchars($target_dirname,ENT_QUOTES)."' method='post'>
+	".$xoopsGTicket->getTicketHtml( __LINE__ )."
+	<table class='outer'>
+		<tr>
+			<th>"._MD_FILENAME."</th>
+			<th>"._MYTPLSADMIN_TH_TYPE."</th>
+			<th><input type='checkbox' title="._MYTPLSADMIN_TITLE_CHECKALL." onclick=\"with(document.MainForm){for(i=0;i<length;i++){if(elements[i].type=='checkbox'&&elements[i].name.indexOf('basecheck')>=0){elements[i].checked=this.checked;}}}\" />"._MYTPLSADMIN_TH_FILE."</th>
+			$tplsets_th4disp
+		</tr>\n" ;
+
+// STYLE for distinguishing fingerprints
+$fingerprint_styles = array( '' , 'background-color:#00FF00' , 'background-color:#00CC88' , 'background-color:#00FFFF' , 'background-color:#0088FF' , 'background-color:#FF8800' , 'background-color:#0000FF' , 'background-color:#FFFFFF' ) ;
+
+// template ROWS
+while( list( $tpl_file , $tpl_desc , $type , $count ) = $db->fetchRow( $frs ) ) {
+
+	$evenodd = @$evenodd == 'even' ? 'odd' : 'even' ;
+	$fingerprint_style_count = 0 ;
+
+	// information about the template
+	echo "
+		<tr>
+			<td class='$evenodd'>
+				<dl>
+					<dt>".htmlspecialchars($tpl_file,ENT_QUOTES)."</dt>
+					<dd>".htmlspecialchars($tpl_desc,ENT_QUOTES)."</dd>
+				</dl>
+			</td>
+			<td class='$evenodd'>".$type."<br />(".$count.")</td>\n" ;
+
+	// the base file template column
+	$basefilepath = XOOPS_ROOT_PATH.'/modules/'.$target_dirname.'/templates/'.($type=='block'?'blocks/':'').$tpl_file ;
+	if( file_exists( $basefilepath ) ) {
+		$fingerprint = get_fingerprint( file( $basefilepath ) ) ;
+		$fingerprints[ $fingerprint ] = 1 ;
+		echo "<td class='$evenodd'>".formatTimestamp(filemtime($basefilepath),'m').'<br />'.substr($fingerprint,0,16)."<br /><input type='checkbox' name='basecheck[$tpl_file]' value='1' /></td>\n" ;
+	} else {
+		echo "<td class='$evenodd'><br /></td>" ;
+	}
+
+	// db template columns
+	foreach( $tplsets as $tplset ) {
+		$tplset4disp = htmlspecialchars( $tplset , ENT_QUOTES ) ;
+
+		// query for templates in db
+		$drs = $db->query( "SELECT * FROM ".$db->prefix("tplfile")." f NATURAL LEFT JOIN ".$db->prefix("tplsource")." s WHERE tpl_file='".addslashes($tpl_file)."' AND tpl_tplset='".addslashes($tplset)."'" ) ;
+		$numrows = $db->getRowsNum( $drs ) ;
+		$tpl = $db->fetchArray( $drs ) ;
+		if( empty( $tpl['tpl_id'] ) ) {
+			echo "<td class='$evenodd'>($numrows)</td>\n" ;
+		} else {
+			$fingerprint = get_fingerprint( explode( "\n" , $tpl['tpl_source'] ) ) ;
+			if( isset( $fingerprints[ $fingerprint ] ) ) {
+				$style = $fingerprints[ $fingerprint ] ;
+			} else {
+				$fingerprint_style_count ++ ;
+				$style = $fingerprint_styles[$fingerprint_style_count] ;
+				$fingerprints[ $fingerprint ] = $style ;
+			}
+			echo "<td class='$evenodd' style='$style'>".formatTimestamp($tpl['tpl_lastmodified'],'m').'<br />'.substr($fingerprint,0,16)."<br /><input type='checkbox' name='{$tplset4disp}_check[{$tpl_file}]' value='1' /> &nbsp; <a href='mytplsform.php?tpl_file=".htmlspecialchars($tpl['tpl_file'],ENT_QUOTES)."&amp;tpl_tplset=".htmlspecialchars($tpl['tpl_tplset'],ENT_QUOTES)."'>"._EDIT."</a> ($numrows)</td>\n" ;
+		}
+	}
+
+	echo "</tr>\n" ;
+}
+
+// command submit ROW
+echo "
+	<tr>
+		<td class='head'>
+			"._MYTPLSADMIN_CREATE_NEW_TPLSET.": <br />
+			"._MYTPLSADMIN_CAPTION_BASE.":
+			<select name='clone_tplset_from'>
+				$tplset_options
+				<option value='_blank_'>"._MYTPLSADMIN_OPT_BLANKSET."</option>
+			</select>
+			<br />
+			"._MYTPLSADMIN_CAPTION_SETNAME.": <input type='text' name='clone_tplset_to' size='8' maxlength='16' /> <input type='submit' name='clone_tplset_do' value='"._MD_GENERATE."' />
+		</td>
+		<td class='head'></td>
+		<td class='head'>
+			"._MYTPLSADMIN_CAPTION_COPYTO.":
+			<select name='copyf2db_to'>
+				$tplset_options
+			</select>
+			<br />
+			<input name='copyf2db_do' type='submit' value='"._MYTPLSADMIN_BTN_COPY."' onclick='return confirm(\""._MYTPLSADMIN_CNF_COPY_SELECTED_TEMPLATES."\");' />
+		</td>\n" ;
+
+	foreach( $tplsets as $tplset ) {
+		$tplset4disp = htmlspecialchars( $tplset , ENT_QUOTES ) ;
+		echo "\t\t<td class='head'>
+			".($tplset=='default'?"":"<input name='del_do[{$tplset4disp}]' type='submit' value='"._DELETE."' onclick='return confirm(\""._MYTPLSADMIN_CNF_DELETE_SELECTED_TEMPLATES."\");' /><br /><br />")."
+			"._MYTPLSADMIN_CAPTION_COPYTO.":
+			<select name='copy_to[{$tplset4disp}]'>
+				$tplset_options
+			</select>
+			<input name='copy_do[{$tplset4disp}]' type='submit' value='"._MYTPLSADMIN_BTN_COPY."' onclick='return confirm(\""._MYTPLSADMIN_CNF_COPY_SELECTED_TEMPLATES."\");' />
+		</td>\n" ;
+	}
+
+echo "	</tr>\n" ;
+
+
+echo "</table></form>" ;
+// end of table & form
+
+xoops_cp_footer() ;
+
+
+
+
+function get_fingerprint( $lines )
+{
+	$str = '' ;
+	foreach( $lines as $line ) {
+		if( trim( $line ) ) {
+			$str .= md5( trim( $line ) ) ;
+		}
+	}
+	return md5( $str ) ;
+}
+
+function copy_templates_db2db( $tplset_from , $tplset_to , $whr_append = '1' )
+{
+	global $db ;
+
+	// get tplfile and tplsource
+	$result = $db->query( "SELECT tpl_refid,tpl_module,'".addslashes($tplset_to)."',tpl_file,tpl_desc,tpl_lastmodified,tpl_lastimported,tpl_type,tpl_source FROM ".$db->prefix("tplfile")." NATURAL LEFT JOIN ".$db->prefix("tplsource")." WHERE tpl_tplset='".addslashes($tplset_from)."' AND ($whr_append)" ) ;
+
+	while( $row = $db->fetchArray( $result ) ) {
+		$tpl_source = array_pop( $row ) ;
+
+		$drs = $db->query( "SELECT tpl_id FROM ".$db->prefix("tplfile")." WHERE tpl_tplset='".addslashes($tplset_to)."' AND ($whr_append) AND tpl_file='".addslashes($row['tpl_file'])."' AND tpl_refid='".addslashes($row['tpl_refid'])."'" ) ;
+
+		if( ! $db->getRowsNum( $drs ) ) {
+			// INSERT mode
+			$sql = "INSERT INTO ".$db->prefix("tplfile")." (tpl_refid,tpl_module,tpl_tplset,tpl_file,tpl_desc,tpl_lastmodified,tpl_lastimported,tpl_type) VALUES (" ;
+			foreach( $row as $colval ) {
+				$sql .= "'".addslashes($colval)."'," ;
+			}
+			$db->query( substr( $sql , 0 , -1 ) . ')' ) ;
+			$tpl_id = $db->getInsertId() ;
+			$db->query( "INSERT INTO ".$db->prefix("tplsource")." SET tpl_id='$tpl_id', tpl_source='".addslashes($tpl_source)."'" ) ;
+			xoops_template_touch( $tpl_id ) ;
+		} else {
+			while( list( $tpl_id ) = $db->fetchRow( $drs ) ) {
+				// UPDATE mode
+				$db->query( "UPDATE ".$db->prefix("tplfile")." SET tpl_refid='".addslashes($row['tpl_refid'])."',tpl_desc='".addslashes($row['tpl_desc'])."',tpl_lastmodified='".addslashes($row['tpl_lastmodified'])."',tpl_lastimported='".addslashes($row['tpl_lastimported'])."',tpl_type='".addslashes($row['tpl_type'])."' WHERE tpl_id='$tpl_id'" ) ;
+				$db->query( "UPDATE ".$db->prefix("tplsource")." SET tpl_source='".addslashes($tpl_source)."' WHERE tpl_id='$tpl_id'" ) ;
+				xoops_template_touch( $tpl_id ) ;
+			}
+		}
+	}
+}
+
+
+function copy_templates_f2db( $tplset_to , $whr_append = '1' )
+{
+	global $db ;
+
+	// get tplsource
+	$result = $db->query( "SELECT * FROM ".$db->prefix("tplfile")."  WHERE tpl_tplset='default' AND ($whr_append)" ) ;
+
+	while( $row = $db->fetchArray( $result ) ) {
+
+		$basefilepath = XOOPS_ROOT_PATH.'/modules/'.$row['tpl_module'].'/templates/'.($row['tpl_type']=='block'?'blocks/':'').$row['tpl_file'] ;
+
+		$tpl_source = rtrim( implode( "" , file( $basefilepath ) ) ) ;
+		$lastmodified = filemtime( $basefilepath ) ;
+
+		$drs = $db->query( "SELECT tpl_id FROM ".$db->prefix("tplfile")." WHERE tpl_tplset='".addslashes($tplset_to)."' AND ($whr_append) AND tpl_file='".addslashes($row['tpl_file'])."' AND tpl_refid='".addslashes($row['tpl_refid'])."'" ) ;
+
+		if( ! $db->getRowsNum( $drs ) ) {
+			// INSERT mode
+			$sql = "INSERT INTO ".$db->prefix("tplfile")." SET tpl_refid='".addslashes($row['tpl_refid'])."',tpl_desc='".addslashes($row['tpl_desc'])."',tpl_lastmodified='".addslashes($lastmodified)."',tpl_type='".addslashes($row['tpl_type'])."',tpl_tplset='".addslashes($tplset_to)."',tpl_file='".addslashes($row['tpl_file'])."',tpl_module='".addslashes($row['tpl_module'])."'" ;
+			$db->query( $sql ) ;
+			$tpl_id = $db->getInsertId() ;
+			$db->query( "INSERT INTO ".$db->prefix("tplsource")." SET tpl_id='$tpl_id', tpl_source='".addslashes($tpl_source)."'" ) ;
+			xoops_template_touch( $tpl_id ) ;
+		} else {
+			while( list( $tpl_id ) = $db->fetchRow( $drs ) ) {
+				// UPDATE mode
+				$db->query( "UPDATE ".$db->prefix("tplfile")." SET tpl_lastmodified='".addslashes($lastmodified)."' WHERE tpl_id='$tpl_id'" ) ;
+				$db->query( "UPDATE ".$db->prefix("tplsource")." SET tpl_source='".addslashes($tpl_source)."' WHERE tpl_id='$tpl_id'" ) ;
+				xoops_template_touch( $tpl_id ) ;
+			}
+		}
+	}
+}
+
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/admin/menu.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/admin/menu.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/admin/menu.php	(revision 405)
@@ -0,0 +1,42 @@
+<?php
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Tobias Liegl (AKA CHAPI)                                          //
+// Site: http://www.chapi.de                                                 //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+$adminmenu[1]['title'] = _TC_MD_ADMENU3;
+$adminmenu[1]['link']  = "admin/index.php?op=show";
+$adminmenu[2]['title'] = _TC_MD_ADMENU1;
+$adminmenu[2]['link']  = "admin/index.php?op=submit";
+$adminmenu[3]['title'] = _TC_MD_ADMENU2;
+$adminmenu[3]['link']  = "admin/index.php?op=nlink";
+$adminmenu[4]['title'] = _TC_MD_ADMENU_MYBLOCKSADMIN;
+$adminmenu[4]['link']  = "admin/myblocksadmin.php";
+$adminmenu[] = array(
+	'title' => _TC_MD_ADMENU_MYTPLSADMIN ,
+	'link' => "admin/mytplsadmin.php" ) ;
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/admin/myblockform.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/admin/myblockform.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/admin/myblockform.php	(revision 405)
@@ -0,0 +1,139 @@
+<?php
+// $Id: myblockform.php,v 1.8 2003/03/10 13:32:05 okazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+if( ! defined( 'XOOPS_ROOT_PATH' ) ) exit ;
+
+$usespaw = empty( $_GET['usespaw'] ) ? 0 : 1 ;
+
+require_once XOOPS_ROOT_PATH."/class/xoopsformloader.php";
+//$form = new XoopsThemeForm($block['form_title'], 'blockform', XOOPS_URL."/modules/blocksadmin/admin/admin.php" ) ;
+$form = new XoopsThemeForm($block['form_title'], 'blockform', "admin.php?dirname=".preg_replace('[^a-zA-Z0-9_.-]','',@$_GET['dirname'])) ;
+if (isset($block['name'])) {
+	$form->addElement(new XoopsFormLabel(_AM_NAME, $block['name']));
+}
+$side_select = new XoopsFormSelect(_AM_BLKTYPE, "bside", $block['side']);
+$side_select->addOptionArray(array(0 => _AM_SBLEFT, 1 => _AM_SBRIGHT, 3 => _AM_CBLEFT, 4 => _AM_CBRIGHT, 5 => _AM_CBCENTER, ));
+$form->addElement($side_select);
+$form->addElement(new XoopsFormText(_AM_WEIGHT, "bweight", 2, 5, $block['weight']));
+$form->addElement(new XoopsFormRadioYN(_AM_VISIBLE, 'bvisible', $block['visible']));
+$mod_select = new XoopsFormSelect(_AM_VISIBLEIN, "bmodule", $block['modules'], 5, true);
+$module_handler =& xoops_gethandler('module');
+$criteria = new CriteriaCompo(new Criteria('hasmain', 1));
+$criteria->add(new Criteria('isactive', 1));
+$module_list =& $module_handler->getList($criteria);
+$module_list[-1] = _AM_TOPPAGE;
+$module_list[0] = _AM_ALLPAGES;
+ksort($module_list);
+$mod_select->addOptionArray($module_list);
+$form->addElement($mod_select);
+$form->addElement(new XoopsFormText(_AM_TITLE, 'btitle', 50, 255, $block['title']), false);
+
+if ( $block['is_custom'] ) {
+
+	// Custom Block's textarea
+	$notice_for_tags = '<span style="font-size:x-small;font-weight:bold;">'._AM_USEFULTAGS.'</span><br /><span style="font-size:x-small;font-weight:normal;">'.sprintf(_AM_BLOCKTAG1, '{X_SITEURL}', XOOPS_URL.'/').'</span>' ;
+	$current_op = @$_GET['op'] == 'clone' ? 'clone' : 'edit' ;
+	$uri_to_myself = XOOPS_URL . "/modules/blocksadmin/admin/admin.php?fct=blocksadmin&amp;op=$current_op&amp;bid={$block['bid']}" ;
+	// $can_use_spaw = check_browser_can_use_spaw() ;
+	$can_use_spaw = true ;
+	if( $usespaw && $can_use_spaw ) {
+		// SPAW Config
+		include XOOPS_ROOT_PATH.'/common/spaw/spaw_control.class.php' ;
+		ob_start() ;
+		$sw = new SPAW_Wysiwyg( 'bcontent' , $block['content'] ) ;
+		$sw->show() ;
+		$textarea = new XoopsFormLabel( _AM_CONTENT , ob_get_contents() ) ;
+		$textarea->setDescription( $notice_for_tags . "<br /><br /><a href='$uri_to_myself&amp;usespaw=0'>NORMAL</a>" ) ;
+		ob_end_clean() ;
+	} else {
+		$myts =& MyTextSanitizer::getInstance();
+		$textarea = new XoopsFormDhtmlTextArea(_AM_CONTENT, 'bcontent', $myts->htmlSpecialChars( $block['content'] ) , 15, 70);
+		if( $can_use_spaw ) {
+			$textarea->setDescription( $notice_for_tags . "<br /><br /><a href='$uri_to_myself&amp;usespaw=1'>SPAW</a>" ) ;
+		} else {
+			$textarea->setDescription( $notice_for_tags ) ;
+		}
+	}
+	$form->addElement($textarea, true);
+
+	$ctype_select = new XoopsFormSelect(_AM_CTYPE, 'bctype', $block['ctype']);
+	$ctype_select->addOptionArray(array('H' => _AM_HTML, 'P' => _AM_PHP, 'S' => _AM_AFWSMILE, 'T' => _AM_AFNOSMILE));
+	$form->addElement($ctype_select);
+} else {
+	if ($block['template'] != '' && ! defined('XOOPS_ORETEKI') ) {
+		$tplfile_handler =& xoops_gethandler('tplfile');
+		$btemplate =& $tplfile_handler->find($GLOBALS['xoopsConfig']['template_set'], 'block', $block['bid']);
+		if (count($btemplate) > 0) {
+			$form->addElement(new XoopsFormLabel(_AM_CONTENT, '<a href="mytplsform.php?tpl_file='.$btemplate[0]->getVar('tpl_file').'&amp;tpl_tplset='.htmlspecialchars($GLOBALS['xoopsConfig']['template_set'],ENT_QUOTES).'">'._AM_EDITTPL.'</a>'));
+		} else {
+			$btemplate2 =& $tplfile_handler->find('default', 'block', $block['bid']);
+			if (count($btemplate2) > 0) {
+				$form->addElement(new XoopsFormLabel(_AM_CONTENT, '<a href="mytplsform.php?tpl_file='.$btemplate2[0]->getVar('tpl_file').'&amp;tpl_tplset=default">'._AM_EDITTPL.'</a>'));
+			}
+		}
+	}
+	if ($block['edit_form'] != false) {
+		$form->addElement(new XoopsFormLabel(_AM_OPTIONS, $block['edit_form']));
+	}
+}
+$cache_select = new XoopsFormSelect(_AM_BCACHETIME, 'bcachetime', $block['cachetime']);
+$cache_select->addOptionArray(array('0' => _NOCACHE, '30' => sprintf(_SECONDS, 30), '60' => _MINUTE, '300' => sprintf(_MINUTES, 5), '1800' => sprintf(_MINUTES, 30), '3600' => _HOUR, '18000' => sprintf(_HOURS, 5), '86400' => _DAY, '259200' => sprintf(_DAYS, 3), '604800' => _WEEK, '2592000' => _MONTH));
+$form->addElement($cache_select);
+if (isset($block['bid'])) {
+	$form->addElement(new XoopsFormHidden('bid', $block['bid']));
+}
+// $form->addElement(new XoopsFormHidden('options', $block['options']));
+$form->addElement(new XoopsFormHidden('op', $block['op']));
+$form->addElement(new XoopsFormHidden('fct', 'blocksadmin'));
+$button_tray = new XoopsFormElementTray('', '&nbsp;');
+if ($block['is_custom']) {
+	$button_tray->addElement(new XoopsFormButton('', 'previewblock', _PREVIEW, "submit"));
+}
+$button_tray->addElement(new XoopsFormButton('', 'submitblock', $block['submit_button'], "submit"));
+$form->addElement($button_tray);
+
+
+// checks browser compatibility with the control
+function check_browser_can_use_spaw() {
+	$browser = $_SERVER['HTTP_USER_AGENT'] ;
+	// check if msie
+	if( eregi( "MSIE[^;]*" , $browser , $msie ) ) {
+		// get version 
+		if( eregi( "[0-9]+\.[0-9]+" , $msie[0] , $version ) ) {
+			// check version
+			if( (float)$version[0] >= 5.5 ) {
+				// finally check if it's not opera impersonating ie
+				if( ! eregi( "opera" , $browser ) ) {
+					return true ;
+				}
+			}
+		}
+	}
+	return false ;
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/admin/mygroupperm.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/admin/mygroupperm.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/admin/mygroupperm.php	(revision 405)
@@ -0,0 +1,95 @@
+<?php
+
+if( ! defined( 'XOOPS_ROOT_PATH' ) ) exit ;
+
+function myDeleteByModule($DB, $gperm_modid, $gperm_name = null, $gperm_itemid = null)
+{
+	$criteria = new CriteriaCompo(new Criteria('gperm_modid', intval($gperm_modid)));
+	if (isset($gperm_name)) {
+		$criteria->add(new Criteria('gperm_name', $gperm_name));
+		if (isset($gperm_itemid)) {
+			$criteria->add(new Criteria('gperm_itemid', intval($gperm_itemid)));
+		}
+	}
+	$sql = "DELETE FROM ".$DB->prefix('group_permission').' '.$criteria->renderWhere();
+	if (!$result = $DB->query($sql)) {
+		return false;
+	}
+	return true;
+}
+
+
+
+// include '../../../include/cp_header.php'; GIJ
+$modid = isset($_POST['modid']) ? intval($_POST['modid']) : 1;
+// we dont want system module permissions to be changed here ( 1 -> 0 GIJ)
+if ($modid <= 0 || !is_object($xoopsUser) || !$xoopsUser->isAdmin($modid)) {
+	redirect_header(XOOPS_URL.'/user.php', 1, _NOPERM);
+	exit();
+}
+$module_handler =& xoops_gethandler('module');
+$module =& $module_handler->get($modid);
+if (!is_object($module) || !$module->getVar('isactive')) {
+	redirect_header(XOOPS_URL.'/admin.php', 1, _MODULENOEXIST);
+	exit();
+}
+$member_handler =& xoops_gethandler('member');
+$group_list = $member_handler->getGroupList();
+if (is_array($_POST['perms']) && !empty($_POST['perms'])) {
+	$gperm_handler = xoops_gethandler('groupperm');
+	foreach ($_POST['perms'] as $perm_name => $perm_data) {
+		foreach( $perm_data['itemname' ] as $item_id => $item_name ) {
+			// checking code
+			// echo "<pre>" ;
+			// var_dump( $_POST['perms'] ) ;
+			// exit ;
+			if (false != myDeleteByModule($gperm_handler->db,$modid,$perm_name,$item_id)) {
+				if( empty( $perm_data['groups'] ) ) continue ;
+				foreach ($perm_data['groups'] as $group_id => $item_ids) {
+	//				foreach ($item_ids as $item_id => $selected) {
+					$selected = isset( $item_ids[ $item_id ] ) ? $item_ids[ $item_id ] : 0 ;
+					if ($selected == 1) {
+						// make sure that all parent ids are selected as well
+						if ($perm_data['parents'][$item_id] != '') {
+							$parent_ids = explode(':', $perm_data['parents'][$item_id]);
+							foreach ($parent_ids as $pid) {
+								if ($pid != 0 && !in_array($pid, array_keys($item_ids))) {
+									// one of the parent items were not selected, so skip this item
+									$msg[] = sprintf(_MD_AM_PERMADDNG, '<b>'.$perm_name.'</b>', '<b>'.$perm_data['itemname'][$item_id].'</b>', '<b>'.$group_list[$group_id].'</b>').' ('._MD_AM_PERMADDNGP.')';
+									continue 2;
+								}
+							}
+						}
+						$gperm =& $gperm_handler->create();
+						$gperm->setVar('gperm_groupid', $group_id);
+						$gperm->setVar('gperm_name', $perm_name);
+						$gperm->setVar('gperm_modid', $modid);
+						$gperm->setVar('gperm_itemid', $item_id);
+						if (!$gperm_handler->insert($gperm)) {
+							$msg[] = sprintf(_MD_AM_PERMADDNG, '<b>'.$perm_name.'</b>', '<b>'.$perm_data['itemname'][$item_id].'</b>', '<b>'.$group_list[$group_id].'</b>');
+						} else {
+							$msg[] = sprintf(_MD_AM_PERMADDOK, '<b>'.$perm_name.'</b>', '<b>'.$perm_data['itemname'][$item_id].'</b>', '<b>'.$group_list[$group_id].'</b>');
+						}
+						unset($gperm);
+					}
+				}
+			} else {
+				$msg[] = sprintf(_MD_AM_PERMRESETNG, $module->getVar('name'));
+			}
+		}
+	}
+}
+/*
+$backlink = XOOPS_URL.'/admin.php';
+if ($module->getVar('hasadmin')) {
+	$adminindex = $module->getInfo('adminindex');
+	if ($adminindex) {
+		$backlink = XOOPS_URL.'/modules/'.$module->getVar('dirname').'/'.$adminindex;
+	}
+}
+
+$msg[] = '<br /><br /><a href="'.$backlink.'">'._BACK.'</a>';
+xoops_cp_header();
+xoops_result($msg);
+xoops_cp_footer();  GIJ */
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/admin/index.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/admin/index.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/admin/index.php	(revision 405)
@@ -0,0 +1,992 @@
+<?php
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Tobias Liegl (AKA CHAPI)                                          //
+// Site: http://www.chapi.de                                                 //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+// Hacker: GIJ=CHECKMATE (AKA GIJOE)                                         //
+// Site: http://www.peak.ne.jp/xoops/                                        //
+// ------------------------------------------------------------------------- //
+
+// for Duplicatable V2.1
+$mydirname = basename( dirname( dirname( __FILE__ ) ) ) ;
+if( ! preg_match( '/^(\D+)(\d*)$/' , $mydirname , $regs ) ) echo ( "invalid dirname: " . htmlspecialchars( $mydirname ) ) ;
+$mydirnumber = $regs[2] === '' ? '' : intval( $regs[2] ) ;
+
+// includes
+include '../../../include/cp_header.php';
+include_once "../include/constants.inc.php";
+include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
+include_once '../class/tinyd.textsanitizer.php';
+include_once '../include/gtickets.php';
+
+// page wrap search
+$page_wrap_search_allowed_exts = array( 'html','htm','phtml','php','php3','php4','txt' ) ;
+
+// also reading language files of modinfo & main
+if ( file_exists( "../language/{$xoopsConfig['language']}/modinfo.php" ) ) {
+	include( "../language/{$xoopsConfig['language']}/modinfo.php" ) ;
+	include( "../language/{$xoopsConfig['language']}/main.php" ) ;
+} else {
+	include( "../language/english/modinfo.php" ) ;
+	include( "../language/english/main.php" ) ;
+}
+
+// emulates mb functions
+if( ! function_exists( 'mb_convert_encoding' ) ) {
+	function mb_convert_encoding( $str ) { return $str ; }
+}
+if( ! function_exists( 'mb_internal_encoding' ) ) {
+	function mb_internal_encoding( $str ) { return "UTF-8" ; }
+}
+
+
+// these initializing code is provisional. they will be removed
+$globals = array(
+	'op' => '' ,
+	'id' => 0
+) ;
+foreach( $globals as $global => $default ) {
+	if( isset( $_GET[ $global ] ) ) $$global = $_GET[ $global ] ;
+	else if( isset( $_POST[ $global ] ) ) $$global = $_POST[ $global ] ;
+	else $$global = $default ;
+}
+$id = intval( $id ) ;
+// end of initialization
+
+// submit redirection
+if( ! empty( $_POST['preview'] ) && $op == 'add' ) $op = 'submit' ;
+if( ! empty( $_POST['preview'] ) && $op == 'editit' ) $op = 'edit' ;
+if( ! empty( $_POST['moveto'] ) && $op == 'update' ) $op = 'moveto' ;
+if( ! empty( $_POST['cancel'] ) ) {
+	redirect_header( 'index.php?op=show' , 0 , _CANCEL ) ;
+	exit ;
+}
+
+// utility variables
+$mymodpath = XOOPS_ROOT_PATH."/modules/$mydirname" ;
+$mymodurl = XOOPS_URL."/modules/$mydirname" ;
+$wrap_path = XOOPS_ROOT_PATH."/modules/$mydirname/content" ;
+$mytablename = $xoopsDB->prefix( "tinycontent{$mydirnumber}" ) ;
+$myts =& TinyDTextSanitizer::getInstance() ;
+
+
+// ------------------------------------------------------------------------- //
+// Switch Statement for the different operations                             //
+// ------------------------------------------------------------------------- //
+$xoopsDB =& Database::getInstance();
+switch( $op ) {
+
+// ------------------------------------------------------------------------- //
+// Show Content Page -> Overview                                             //
+// ------------------------------------------------------------------------- //
+default :
+	$mymenu_fake_uri = $_SERVER['REQUEST_URI'] . '?op=show' ;
+case "show":
+	xoops_cp_header();
+	include( dirname(__FILE__).'/mymenu.php' ) ;
+
+	if( check_browser_can_use_spaw() ) {
+		$can_use_spaw = true ;
+		$submitlink_with_spaw = "(<a href='index.php?op=submit&amp;usespaw=1' style='font-size:xx-small;'>SPAW</a>)" ;
+	} else {
+		$can_use_spaw = false ;
+		$submitlink_with_spaw = '' ;
+	}
+
+	// get all instances of TinyD using newblocks table
+	$rs = $xoopsDB->query( "SELECT mid FROM ".$xoopsDB->prefix("newblocks")." WHERE func_file='tinycontent_navigation.php'" ) ;
+	$whr_mid = 'mid IN (' ;
+	while( list( $mid ) = $xoopsDB->fetchRow( $rs ) ) {
+		$whr_mid .= intval( $mid ) . ',' ;
+	}
+	$whr_mid .= "0)" ;
+	$rs = $xoopsDB->query( "SELECT mid,dirname,name FROM ".$xoopsDB->prefix("modules")." WHERE $whr_mid ORDER BY weight,mid" ) ;
+	$dest_tinyd_options = "<option value=''>--</option>\n" ;
+	while( list( $mid , $dirname , $name ) = $xoopsDB->fetchRow( $rs ) ) {
+		if( $dirname == $mydirname ) continue ;
+		if( ! $xoopsUser->isAdmin( $mid ) ) continue ;
+		$name4disp = htmlspecialchars( $name , ENT_QUOTES ) ;
+		$dest_tinyd_options .= "<option value='$mid'>$name4disp</option>\n" ;
+	}
+
+	echo "
+		<h4>".$xoopsModule->getVar('name')."</h4>
+		<div align='right' width='95%'>
+			<b>"._TC_TH_VISIBLE."</b>:"._TC_VISIBLE." &nbsp; 
+			<b>"._TC_TH_SUBMENU."</b>:"._TC_SUBMENU." &nbsp; 
+			<b>"._TC_TH_ENABLECOM."</b>:"._TC_ENABLECOM."
+		</div>
+		<form action='index.php' name='MainForm' method='post'>
+		".$xoopsGTicket->getTicketHtml( __LINE__ )."
+		<table border='0' cellpadding='0' cellspacing='1' width='95%' class='outer'>
+		<tr>
+			<th>"._TC_STORYID."</th>
+			<th>"._TC_HOMEPAGE."</th>
+			<th>"._TC_LINKNAME."</th>
+			<th>"._TC_LINKID."</th>
+			<th>"._TC_TH_VISIBLE."</th>
+			<th>"._TC_TH_SUBMENU."</th>
+			<th>"._TC_TH_ENABLECOM."</th>
+			<th>"._TC_CONTENTTYPE."</th>
+			<th style='text-align:right;'>"._TC_ACTION."</th>
+		</tr>\n";
+
+	$result = $xoopsDB->query("SELECT storyid,blockid,title,visible,homepage,link,submenu,nocomments,nohtml,UNIX_TIMESTAMP(last_modified) FROM $mytablename ORDER BY blockid");
+
+	while( list( $id , $weight , $title , $visible , $homepage , $link , $submenu , $nocomments , $nohtml , $last_modified ) = $xoopsDB->fetchRow( $result ) ) {
+		$title4show = $myts->makeTboxData4Show( $title ) ;
+
+		$visible_checked = $visible ? "checked='checked'" : "" ;
+		$submenu_checked = $submenu ? "checked='checked'" : "" ;
+		$comments_checked = $nocomments ? "" : "checked='checked'" ;
+
+		if( $link > 0 ) {
+			// page wrap
+			$line_class = 'even' ;
+			$op_for_edit = 'elink' ;
+			$opname_for_edit = _TC_ELINK ;
+			$opname_for_delete = _TC_DELLINK ;
+			$link_to_spaw = '' ;
+			$content_type = "WRAP$link"  ;
+			$extended_link = '' ;
+		} else {
+			// db content
+			$line_class = 'odd' ;
+			$op_for_edit = 'edit' ;
+			$opname_for_edit = _TC_EDIT ;
+			$opname_for_delete = _TC_DELETE ;
+			if( $can_use_spaw ) $link_to_spaw = "(<a href='?op=edit&amp;id=$id&amp;usespaw=1' style='font-size:xx-small;'>SPAW</a>)" ;
+			else $link_to_spaw = '' ;
+			switch( $nohtml ) {
+				case '18' :
+					$content_type = "Text_Wiki (+bb)" ;
+					$extended_link = "(<a href='?op=edit&amp;id=$id&amp;useplain=1' style='font-size:xx-small;'>PLAIN</a>)" ;
+					break ;
+				case '16' :
+					$content_type = "Text_Wiki" ;
+					$extended_link = "(<a href='?op=edit&amp;id=$id&amp;useplain=1' style='font-size:xx-small;'>PLAIN</a>)" ;
+					break ;
+				case '10' :
+					$content_type = "PHP (+bb)" ;
+					$extended_link = "(<a href='?op=edit&amp;id=$id&amp;useplain=1' style='font-size:xx-small;'>PLAIN</a>)" ;
+					break ;
+				case '8' :
+					$content_type = "PHP" ;
+					$extended_link = "(<a href='?op=edit&amp;id=$id&amp;useplain=1' style='font-size:xx-small;'>PLAIN</a>)" ;
+					break ;
+				case '3' :
+					$content_type = "TEXT (-bb)" ;
+					$extended_link = '' ;
+					break ;
+				case '2' :
+					$content_type = "HTML (-bb)" ;
+					$extended_link = $link_to_spaw ;
+					break ;
+				case '1' :
+					$content_type = "TEXT (+bb)" ;
+					$extended_link = '' ;
+					break ;
+				case '0' :
+					$content_type = "HTML (+bb)" ;
+					$extended_link = $link_to_spaw ;
+					break ;
+				default :
+					$content_type = "unknown" ;
+					$extended_link = '' ;
+			}
+		}
+
+		echo "
+		<tr class='$line_class'>
+			<td align='right'>$id<input type='hidden' name='id[]' value='$id' /></td>
+			<td align='center'><input type='radio' name='homepage' value='$id' ".($homepage?"checked='checked'":"")." /></td>
+			<td><a href='../index.php?id=$id'>$title4show</a></td>
+			<td align='center'><input type='text' name='blockid[$id]' size='3' maxlength='8' value='$weight' style='text-align:right;' /></td>
+			<td align='center'><input type='checkbox' name='visible[$id]' $visible_checked /></td>
+			<td align='center'><input type='checkbox' name='submenu[$id]' $submenu_checked /></td>
+			<td align='center'><input type='checkbox' name='comments[$id]' $comments_checked /></td>
+			<td>$content_type</td>
+			<td align='right'><a href='index.php?op=$op_for_edit&amp;id=$id'>$opname_for_edit</a> $extended_link | <a href='index.php?op=delete&amp;id=$id'>$opname_for_delete</a> | <input type='checkbox' name='checked_ids[$id]' /><br />".formatTimestamp($last_modified,"m")."</td>
+		</tr>\n" ;
+
+	}
+
+	echo "
+		<tr>
+			<th colspan='9' style='text-align:right;'>
+				"._TC_CHECKED_ITEMS_ARE."
+				<input type='submit' name='moveto' value="._TC_BUTTON_MOVETO." disabled='disabled' />
+				<select name='dest_tinyd' onchange='document.MainForm.moveto.disabled=false;'>
+					$dest_tinyd_options
+				</select>
+			</th>
+		</tr>
+	</table>
+	<br />
+	<div align='center'>
+		<input type='hidden' name='op' value='update' />
+		<input type='submit' name='submit' value="._SUBMIT." />
+		<input type='reset' />
+	</div>
+	</form>
+	<table border='0' cellpadding='0' cellspacing='5'><tr>
+	<td>
+		<table border='0' cellpadding='0' cellspacing='1' class='outer'>
+		<tr>
+			<td class='odd'><a href='?op=submit'>"._TC_ADDCONTENT."</a> $submitlink_with_spaw</td>
+		</tr>
+		</table>
+	</td>
+	<td>
+		<table border='0' cellpadding='0' cellspacing='1' class='outer'>
+		<tr>
+			<td class='even'><a href='?op=nlink'>"._TC_ADDLINK."</a></td>
+		</tr>
+		</table>
+	</td>
+	<td>
+		<table border='0' cellpadding='0' cellspacing='1' class='outer'>
+		<tr>
+			<td class='odd'><a href='?op=update_wrap_contents'>"._TC_UPDATE_WRAP_CONTENTS."</a></td>
+		</tr>
+		</table>
+	</td>\n" ;
+
+	echo "
+		</table>
+	</td>
+	</tr></table>\n";
+
+	xoops_cp_footer();
+	break;
+
+// ------------------------------------------------------------------------- //
+// Update Content -> Show Content Page                                       //
+// ------------------------------------------------------------------------- //
+case "update":
+
+	// Ticket Check
+	if ( ! $xoopsGTicket->check() ) {
+		redirect_header(XOOPS_URL.'/',3,$xoopsGTicket->getErrors());
+	}
+
+	if( ! is_array( $_POST['id'] ) ) break ;
+	$homepage = empty( $_POST['homepage'] ) ? 0 : intval( $_POST['homepage'] ) ;
+	foreach( $_POST['id'] as $storyid ) {
+		$storyid = intval( $storyid ) ;
+		if( $homepage == 0 ) {
+			$hp_flag = 1 ;
+			$homepage = $storyid ;
+		} else {
+			$hp_flag = $storyid == $homepage ? 1 : 0 ;
+		}
+		$blockid = empty( $_POST['blockid'][ $storyid ] ) ? 0 : intval( $_POST['blockid'][ $storyid ] ) ;
+		$visible = empty( $_POST['visible'][ $storyid ] ) ? 0 : 1 ;
+		$nocomments = empty( $_POST['comments'][ $storyid ] ) ? 1 : 0 ;
+		$submenu = empty( $_POST['submenu'][ $storyid ] ) ? 0 : 1 ;
+
+		$sql = "UPDATE $mytablename SET blockid='$blockid',visible='$visible',homepage='$hp_flag',nocomments='$nocomments',submenu='$submenu',last_modified=last_modified WHERE storyid='$storyid'" ;
+		$xoopsDB->query( $sql ) or die( _TC_ERRORINSERT ) ;
+	}
+	redirect_header( "index.php?op=show" , 1 , _TC_DBUPDATED ) ;
+	exit ;
+	break ;
+
+// ------------------------------------------------------------------------- //
+// Show add or edit content Page                                             //
+// ------------------------------------------------------------------------- //
+case "submit" :
+case "edit" :
+
+	xoops_cp_header() ;
+	include( dirname(__FILE__).'/mymenu.php' ) ;
+
+	// initialization
+	if( ! empty( $_POST['preview'] ) ) {
+
+		$globals = array(
+			'id' => 0 ,
+			'title' => '' ,
+			'message' => '' ,
+			'visible' => 0 ,
+			'nohtml' => 0 ,
+			'nosmiley' => 0 ,
+			'nobreaks' => 0 ,
+			'nocomments' => 0 ,
+			'submenu' => 0 ,
+			'last_modified' => 0 ,
+			'created' => 0 ,
+			'html_header' => ''
+		) ;
+		foreach( $globals as $global => $default ) {
+			if( isset( $_POST[ $global ] ) ) $$global = $myts->stripSlashesGPC( $_POST[ $global ] ) ;
+			else $$global = $default ;
+		}
+		$storyid = intval( $id ) ;
+
+		// write posted data into sesion
+		$_SESSION['tinyd_preview_post'] = array(
+			'message' => $message ,
+			'nohtml' => intval( $nohtml ) ,
+			'nosmiley' => intval( $nosmiley ) ,
+			'nobreaks' => intval( $nobreaks )
+		) ;
+		/* $content_cache = "{$mydirname}_preview_" . time() ;
+		$fp = fopen( XOOPS_CACHE_PATH . '/' . $content_cache , 'w' ) ;
+		if( $fp === false ) {
+			unset( $_POST['preview'] ) ;
+		} else {
+			fwrite( $fp , $message , 65536 ) ;
+			fclose( $fp ) ;
+		}*/
+
+	} else if( $op == 'edit' ) {
+
+		$result = $xoopsDB->query( "SELECT storyid,title,text,visible,nohtml,nosmiley,nobreaks,nocomments,submenu,UNIX_TIMESTAMP(last_modified),UNIX_TIMESTAMP(created),html_header FROM $mytablename WHERE storyid='$id'" ) ;
+		list($storyid,$title,$message,$visible,$nohtml,$nosmiley,$nobreaks,$nocomments,$submenu,$last_modified,$created,$html_header) = $xoopsDB->fetchRow( $result ) ;
+
+	} else {
+
+		list($storyid,$title,$message,$visible,$nohtml,$nosmiley,$nobreaks,$nocomments,$submenu,$last_modified,$created,$html_header) = array(0,'','',1,0,0,1,0,1,0,0,'');
+
+	}
+
+	if( $op == 'edit' ) {
+		$form_title = _TC_EDITCONTENT ;
+		$next_op = "editit" ;
+	} else {
+		$form_title = _TC_ADDCONTENT ;
+		$next_op = "add" ;
+	}
+
+	// get configs
+	$tarea_width = empty( $xoopsModuleConfig['tc_tarea_width'] ) ? 35 : intval( $xoopsModuleConfig['tc_tarea_width'] ) ;
+	$header_tarea_height = empty( $xoopsModuleConfig['tc_header_tarea_height'] ) ? 0 : intval( $xoopsModuleConfig['tc_header_tarea_height'] ) ;
+	$body_tarea_height = empty( $xoopsModuleConfig['tc_tarea_height'] ) ? 37 : intval( $xoopsModuleConfig['tc_tarea_height'] ) ;
+
+	// title and textarea selection
+	$js_confirm = 'if(MainForm.message.value!="") return confirm("'._TC_JS_CONFIRMDISCARD.'");' ;
+	echo "
+		<div width='100%'>
+			<span style='font-size:normal; font-weight: bold;'>
+				".$xoopsModule->getVar('name')."
+			</span>
+			 &nbsp; 
+			<span style='font-size:xx-small'>
+				<a href='?op=$op&amp;id=$id' onclick='$js_confirm'>BB</a> &nbsp;
+				<a href='?op=$op&amp;id=$id&amp;usespaw=1' onclick='$js_confirm'>SPAW</a> &nbsp;
+				<a href='?op=$op&amp;id=$id&amp;useplain=1' onclick='$js_confirm'>PLAIN</a>
+			</span>
+		</div>\n" ;
+
+	// Form target
+	if( ! empty( $_GET['usespaw'] ) ) {
+		$form_target = 'index.php?usespaw=1' ;
+	} else if( ! empty( $_GET['useplain'] ) ) {
+		$form_target = 'index.php?useplain=1' ;
+	} else {
+		$form_target = 'index.php' ;
+	}
+
+	// beggining of xoopsForm
+	$form = new XoopsThemeForm( $form_title , "MainForm" , $form_target ) ;
+
+	// title
+	$form->addElement( new XoopsFormText( _TC_LINKNAME , "title" , 50 , 255 , htmlspecialchars( $title , ENT_QUOTES ) ) ) ;
+
+	// html header
+	if( $header_tarea_height > 0 ) {
+		$h_area = new XoopsFormTextArea( _TC_HTML_HEADER , 'html_header' , htmlspecialchars( $html_header , ENT_QUOTES ) , $header_tarea_height , $tarea_width ) ;
+		$h_area->setExtra( "style='width: {$tarea_width}em;'" ) ;
+		$form->addElement( $h_area ) ;
+	} else {
+		$form->addElement( new XoopsFormHidden( 'html_header' , htmlspecialchars( $html_header , ENT_QUOTES ) ) ) ;
+	}
+
+	// content body
+	$spaw_flag = false ;
+	if( ! empty( $_GET['usespaw'] ) ) {
+		// SPAW Config
+		include XOOPS_ROOT_PATH.'/common/spaw/spaw_control.class.php' ;
+		if( check_browser_can_use_spaw() ) {
+			ob_start() ;
+			$sw = new SPAW_Wysiwyg( 'message' , $message ) ;
+			$sw->show() ;
+			$form->addElement( new XoopsFormLabel( _TC_CONTENT , ob_get_contents() ) ) ;
+			ob_end_clean() ;
+			$spaw_flag = true ;
+		}
+	}
+	if( ! $spaw_flag ) {
+		if( empty( $_GET['useplain'] ) ) {
+			$t_area = new XoopsFormDhtmlTextArea( _TC_CONTENT , 'message' , htmlspecialchars( $message , ENT_QUOTES ) , $body_tarea_height , $tarea_width ) ;
+		} else {
+			$t_area = new XoopsFormTextArea( _TC_CONTENT . "<br /><br /><br /><br /><a href='$mymodurl/admin/text_wiki_sample.php?lang={$xoopsConfig['language']}' target='_blak'>Text_Wiki Sample</a>" , 'message' , htmlspecialchars( $message , ENT_QUOTES ) , $body_tarea_height , $tarea_width ) ;
+		}
+		$t_area->setExtra( "style='width: {$tarea_width}em;'" ) ;
+		$form->addElement( $t_area ) ;
+	}
+
+	// options
+	$option_tray = new XoopsFormElementTray( _OPTIONS , '<br />' ) ;
+	// smiley
+	$smiley_checkbox = new XoopsFormCheckBox( '' , 'nosmiley', $nosmiley ) ;
+	$smiley_checkbox->addOption( 1 , _DISABLESMILEY ) ;
+	$option_tray->addElement( $smiley_checkbox ) ;
+	// nobreaks
+	if( $spaw_flag ) {
+		$form->addElement( new XoopsFormHidden( 'nobreaks' , 1 ) ) ;
+	} else {
+		$breaks_checkbox = new XoopsFormCheckBox( '' , 'nobreaks' , $nobreaks ) ;
+		$breaks_checkbox->addOption( 1 , _TC_DISABLEBREAKS ) ;
+		$option_tray->addElement( $breaks_checkbox ) ;
+	}
+	// visible
+	$visible_checkbox = new XoopsFormCheckBox( '' , 'visible' , $visible ) ;
+	$visible_checkbox->addOption( 1 , _TC_VISIBLE ) ;
+	$option_tray->addElement( $visible_checkbox ) ;
+	// submenu
+	$submenu_checkbox = new XoopsFormCheckBox( '' , 'submenu', $submenu ) ;
+	$submenu_checkbox->addOption( 1 , _TC_SUBMENU ) ;
+	$option_tray->addElement( $submenu_checkbox ) ;
+	// comments
+	$comments_checkbox = new XoopsFormCheckBox( '' , 'comments' , ! $nocomments ) ;
+	$comments_checkbox->addOption( 1 , _TC_ENABLECOM ) ;
+	$option_tray->addElement( $comments_checkbox ) ;
+	$form->addElement( $option_tray ) ;
+	// end of options
+
+	// content type
+	$htmltype_select = new XoopsFormSelect( _TC_CONTENT_TYPE , 'nohtml' , $nohtml ) ;
+	$htmltype_select->addOption( 0 , _TC_TYPE_HTML ) ;
+	$htmltype_select->addOption( 2 , _TC_TYPE_HTMLNOBB ) ;
+	$htmltype_select->addOption( 1 , _TC_TYPE_TEXTWITHBB ) ;
+	$htmltype_select->addOption( 3 , _TC_TYPE_TEXTNOBB ) ;
+	$htmltype_select->addOption( 8 , _TC_TYPE_PHPHTML ) ;
+	$htmltype_select->addOption( 10 , _TC_TYPE_PHPWITHBB ) ;
+	$htmltype_select->addOption( 16 , _TC_TYPE_PEARWIKI ) ;
+	$htmltype_select->addOption( 18 , _TC_TYPE_PEARWIKIWITHBB ) ;
+	$form->addElement( $htmltype_select ) ;
+
+	// last_modified
+	$lm_tray = new XoopsFormElementTray( _TC_LASTMODIFIED , '&nbsp;' ) ;
+	$lm_tray->addElement( new XoopsFormLabel( '' , formatTimestamp( $last_modified ) ) ) ;
+	$lm_checkbox = new XoopsFormCheckBox( '' , 'dont_update_last_modified' , 0 ) ;
+	$lm_checkbox->addOption( 1 , _TC_DONTUPDATELASTMODIFIED ) ;
+	$lm_tray->addElement( $lm_checkbox ) ;
+	$form->addElement( $lm_tray ) ;
+
+	// created
+	$form->addElement( new XoopsFormLabel( _TC_CREATED , formatTimestamp( $created ) ) ) ;
+
+	// buttons
+	$submit_tray = new XoopsFormElementTray( '' , ' &nbsp; &nbsp; ' ) ;
+	$submit_tray->addElement( new XoopsFormButton( "" , "preview" , _PREVIEW , "submit" ) );
+	$submit_tray->addElement( new XoopsFormButton( "" , "submit" , _SUBMIT , "submit" ) );
+	if( $op == 'edit' ) $submit_tray->addElement( new XoopsFormButton( "" , "saveas" , _TC_SAVEAS , "submit" ) ) ;
+	$submit_tray->addElement( new XoopsFormButton( "" , "cancel" , _CANCEL , "submit" ) );
+	$form->addElement( $submit_tray ) ;
+
+	// hiddens
+	$form->addElement( new XoopsFormHidden( 'op' , $next_op ) ) ;
+	$form->addElement( new XoopsFormHidden( 'id' , $storyid ) ) ;
+	$form->addElement( new XoopsFormHidden( 'last_modified' , $last_modified ) ) ;
+	// Ticket
+	$GLOBALS['xoopsGTicket']->addTicketXoopsFormElement( $form , __LINE__ ) ;
+
+/*	echo '
+<!-- tinyMCE -->
+<script language="javascript" type="text/javascript" src="/common/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
+<script language="javascript" type="text/javascript">
+  tinyMCE.init({
+     mode : "textareas"
+  });
+</script>
+<!-- /tinyMCE -->' ;*/
+
+	// end of xoopsForm
+	$form->display() ;
+
+	xoops_cp_footer() ;
+
+	// preview popup
+	if( ! empty( $_POST['preview'] ) ) {
+		// Ticket Check
+		if ( ! $xoopsGTicket->check() ) {
+			redirect_header(XOOPS_URL.'/',3,$xoopsGTicket->getErrors());
+		}
+
+		echo '
+		<script type="text/javascript">
+		<!--//
+		preview_window = openWithSelfMain( "'.$mymodurl.'/preview.php" , "popup" , 680 , 450 ) ;
+		//-->
+		</script>';
+	}
+
+	break ;
+
+// ------------------------------------------------------------------------- //
+// INSERT or UPDATE content to database                                      //
+// ------------------------------------------------------------------------- //
+case "add" :
+case "editit":
+
+	// Ticket Check
+	if ( ! $xoopsGTicket->check() ) {
+		redirect_header(XOOPS_URL.'/',3,$xoopsGTicket->getErrors());
+	}
+
+	$title4save = $myts->addSlashes( $_POST['title'] ) ;
+	$html_header4save = $myts->addSlashes( $_POST['html_header'] ) ;
+	$text4save = $myts->addSlashes( $_POST['message'] ) ;
+	$visible = empty( $_POST['visible'] ) ? 0 : 1 ;
+	$nohtml = empty( $_POST['nohtml'] ) ? 0 : intval( $_POST['nohtml'] ) ;
+	$nosmiley = empty( $_POST['nosmiley'] ) ? 0 : 1 ;
+	$nobreaks = empty( $_POST['nobreaks'] ) ? 0 : 1 ;
+	$nocomments = empty( $_POST['comments'] ) ? 1 : 0 ;
+	$submenu = empty( $_POST['submenu'] ) ? 0 : 1 ;
+
+	// hp flag is set if there are no records which has flag of homepage
+	$result = $xoopsDB->query( "SELECT COUNT(*) FROM $mytablename WHERE homepage>0" ) ;
+	list( $count_home ) = $xoopsDB->fetchRow( $result ) ;
+	$hp_flag = $count_home > 0 ? 0 : 1 ;
+
+	$sql_set = "SET title='$title4save',text='$text4save',visible='$visible',nohtml='$nohtml',nosmiley='$nosmiley',nobreaks='$nobreaks',nocomments='$nocomments',link='0',submenu='$submenu',html_header='$html_header4save'" ;
+
+	if( $op == 'add' || ! empty( $_POST['saveas'] ) ) {
+		$sql = "INSERT INTO $mytablename $sql_set,created=NOW(),homepage='$hp_flag'" ;
+	} else {
+		// not to update last_modified
+		if( ! empty( $_POST['dont_update_last_modified'] ) ) $sql_set .= ",last_modified=last_modified" ;
+
+		// change homepage only when it should be turned on
+		if( $hp_flag ) $sql_set .= ",homepage='$hp_flag'" ;
+
+		$id = empty( $_POST['id'] ) ? 0 : intval( $_POST['id'] ) ;
+		$sql = "UPDATE $mytablename $sql_set WHERE storyid='$id'" ;
+	}
+
+	$result = $xoopsDB->query( $sql ) or die ( _TC_ERRORINSERT ) ;
+	redirect_header( "index.php?op=show" , 1 , _TC_DBUPDATED ) ;
+	exit ;
+	break ;
+
+// ------------------------------------------------------------------------- //
+// Show new link & edit link Page                                            //
+// ------------------------------------------------------------------------- //
+case "nlink" :
+case "elink" :
+
+	xoops_cp_header();
+	include( dirname(__FILE__).'/mymenu.php' ) ;
+
+	echo "<h4>".$xoopsModule->getVar('name')."</h4>";
+
+	if( is_writable( $wrap_path ) ) {
+
+		// Upload File
+		echo "<form name='form_name2' id='form_name2' action='index.php' method='post' enctype='multipart/form-data'>";
+		echo "<table cellspacing='1' width='100%' class='outer'>";
+		echo "<tr><th colspan='2'>"._TC_ULFILE."</th></tr>";
+		echo "<tr valign='top' align='left'><td class='head' width='30%'>"._TC_SFILE."</td><td class='even'><input type='file' name='fileupload' id='fileupload' size='50' /></td></tr>";
+		echo "<tr valign='top' align='left'><td class='head'><input type='hidden' name='MAX_FILE_SIZE' id='op' value='500000' /><input type='hidden' name='op' id='op' value='upload' /></td><td class='even'><input type='submit' name='submit' value='"._TC_UPLOAD."' /></td></tr>";
+		echo "</table>";
+		printf( _TC_FMT_WRAPPATHPERMON , $wrap_path ) ;
+		echo $xoopsGTicket->getTicketHtml( __LINE__ ) ;
+		echo "</form>";
+
+		// Delete File
+		$form = new XoopsThemeForm( _TC_DELFILE , "DelForm" , "index.php" ) ;
+
+		$address_select = new XoopsFormSelect( _TC_URL , "address" ) ;
+		$dir_handle = dir( $wrap_path ) ;
+		while( $file = $dir_handle->read() ) {
+			if( is_file( "$wrap_path/$file" ) && $file != 'index.php' ) {
+				$address_select->addOption( $file , htmlspecialchars( $file , ENT_QUOTES ) ) ;
+			}
+		}
+		$dir_handle->close() ;
+		$form->addElement( $address_select ) ;
+
+		$form->addElement( new XoopsFormHidden( 'op' , 'delfile' ) ) ;
+		$form->addElement( new XoopsFormButton( '' , "submit" , _TC_DELETE , 'submit' ) ) ;
+
+		$form->display();
+	} else {
+		echo "<p>" . sprintf( _TC_FMT_WRAPPATHPERMOFF , $wrap_path ) . "</p>" ;
+	}
+
+
+	// initialization
+	if( $op == 'elink' ) {
+		$result = $xoopsDB->query( "SELECT storyid,title,visible,nocomments,address,submenu,link,UNIX_TIMESTAMP(last_modified) FROM $mytablename WHERE storyid='$id'" ) ;
+		list($storyid,$title,$visible,$nocomments,$address,$submenu,$link,$last_modified) = $xoopsDB->fetchRow( $result ) ;
+		$form_name = _TC_EDITLINK ;
+		$next_op = 'linkeditit' ;
+	} else {
+		list($storyid,$title,$visible,$nocomments,$address,$submenu,$link,$last_modified) = array(0,'',1,0,'',1,1,0) ;
+		$form_name = _TC_ADDLINK ;
+		$next_op = 'addlink' ;
+	}
+
+	// beggining of xoopsForm for PageWrapping
+	$form = new XoopsThemeForm( $form_name , "MainForm" , "index.php" ) ;
+
+	// title
+	$form->addElement( new XoopsFormText( _TC_LINKNAME , "title" , 50 , 255 , htmlspecialchars( $title , ENT_QUOTES ) ) ) ;
+
+	// a file should be wrapped
+	$address_select = new XoopsFormSelect( _TC_URL , "address" , $address ) ;
+	$dir_handle = dir( $wrap_path ) ;
+	while( $file = $dir_handle->read() ) {
+		if( is_file( "$wrap_path/$file" ) && $file != 'index.php' ) {
+			$address_select->addOption( $file , htmlspecialchars( $file , ENT_QUOTES ) ) ;
+		}
+	}
+	$dir_handle->close();
+	$form->addElement( $address_select ) ;
+
+	// base path for wrapping
+	$wraproot_radio = new XoopsFormRadio( _TC_WRAPROOT , 'wraproot', $link ) ;
+	$wraproot_radio->addOption( TC_WRAPTYPE_NORMAL , sprintf( _TC_FMT_WRAPROOTTC , $mymodpath ) ) ;
+	$wraproot_radio->addOption( TC_WRAPTYPE_CONTENTBASE , sprintf( _TC_FMT_WRAPROOTPAGE , $wrap_path ) ) ;
+	$wraproot_radio->addOption( TC_WRAPTYPE_USEREWRITE , sprintf( _TC_FMT_WRAPBYREWRITE , $wrap_path ) ) ;
+	$wraproot_radio->addOption( TC_WRAPTYPE_CHANGESRCHREF , sprintf( _TC_FMT_WRAPCHANGESRCHREF , $wrap_path ) ) ;
+	$form->addElement( $wraproot_radio ) ;
+
+	// options
+	$option_tray = new XoopsFormElementTray( _OPTIONS , '<br />' ) ;
+	// visible
+	$visible_checkbox = new XoopsFormCheckBox( '' , 'visible' , $visible ) ;
+	$visible_checkbox->addOption( 1 , _TC_VISIBLE ) ;
+	$option_tray->addElement( $visible_checkbox ) ;
+	// submenu
+	$submenu_checkbox = new XoopsFormCheckBox( '' , 'submenu', $submenu ) ;
+	$submenu_checkbox->addOption( 1 , _TC_SUBMENU ) ;
+	$option_tray->addElement( $submenu_checkbox ) ;
+	// comments
+	$comments_checkbox = new XoopsFormCheckBox( '' , 'comments' , ! $nocomments ) ;
+	$comments_checkbox->addOption( 1 , _TC_ENABLECOM ) ;
+	$option_tray->addElement( $comments_checkbox ) ;
+	$form->addElement( $option_tray ) ;
+	// end of options
+
+	// last_modified
+	$lm_tray = new XoopsFormElementTray( _TC_LASTMODIFIED , '&nbsp;' ) ;
+	$lm_tray->addElement( new XoopsFormLabel( '' , formatTimestamp( $last_modified ) ) ) ;
+	$lm_checkbox = new XoopsFormCheckBox( '' , 'dont_update_last_modified' , 0 ) ;
+	$lm_checkbox->addOption( 1 , _TC_DONTUPDATELASTMODIFIED ) ;
+	$lm_tray->addElement( $lm_checkbox ) ;
+	$form->addElement( $lm_tray ) ;
+
+	// buttons
+	$submit_tray = new XoopsFormElementTray( '' , ' &nbsp; &nbsp; ' ) ;
+	$submit_tray->addElement( new XoopsFormButton( "" , "submit" , _SUBMIT , "submit" ) );
+	$submit_tray->addElement( new XoopsFormButton( "" , "cancel" , _CANCEL , "submit" ) );
+	$form->addElement( $submit_tray ) ;
+
+	// hiddens
+	$form->addElement( new XoopsFormHidden( 'op' , $next_op ) ) ;
+	$form->addElement( new XoopsFormHidden( 'id' , $storyid ) ) ;
+	$form->addElement( new XoopsFormHidden( 'last_modified' , $last_modified ) ) ;
+	// Ticket
+	$GLOBALS['xoopsGTicket']->addTicketXoopsFormElement( $form , __LINE__ ) ;
+
+	// end of xoopsForm
+	$form->display() ;
+
+	xoops_cp_footer() ;
+
+	break ;
+
+// ------------------------------------------------------------------------- //
+// INSERT or UPDATE a PageWrap to database                                   //
+// ------------------------------------------------------------------------- //
+case "addlink" :
+case "linkeditit" :
+
+	// Ticket Check
+	if ( ! $xoopsGTicket->check() ) {
+		redirect_header(XOOPS_URL.'/',3,$xoopsGTicket->getErrors());
+	}
+
+	// security fix (thx JM2)
+	$_POST['address'] = str_replace( '..' , '' , $_POST['address'] ) ;
+
+	$title4save = $myts->addSlashes( $_POST['title'] ) ;
+	$address4save = $myts->addSlashes( $_POST['address'] ) ;
+	$visible = empty( $_POST['visible'] ) ? 0 : 1 ;
+	$nocomments = empty( $_POST['comments'] ) ? 1 : 0 ;
+	$submenu = empty( $_POST['submenu'] ) ? 0 : 1 ;
+	$link = empty( $_POST['wraproot'] ) ? 1 : intval( $_POST['wraproot'] ) ;
+
+	// hp flag is set if there are no records which has flag of homepage
+	$result = $xoopsDB->query( "SELECT COUNT(*) FROM $mytablename WHERE homepage>0" ) ;
+	list( $count_home ) = $xoopsDB->fetchRow( $result ) ;
+	$hp_flag = $count_home > 0 ? 0 : 1 ;
+
+	// fetch text for search from wrapped page
+	$wrapped_file = "$wrap_path/{$_POST['address']}" ;
+	$ext = strtolower( substr( strrchr( $wrapped_file , '.' ) , 1 ) ) ;
+	if( in_array( $ext , $page_wrap_search_allowed_exts ) ) {
+		$fp = fopen( $wrapped_file , 'r' ) ;
+		if( ! $fp ) {
+			redirect_header( "index.php?op=nlink" , 2 , _TC_FILENOTFOUND ) ;
+			exit ;
+		}
+		$text = addslashes( tc_convert_wrap_to_ie( strip_tags( fread( $fp , 65536 * 2 ) ) ) ) ;
+		fclose( $fp ) ;
+	} else {
+		$text = '' ;
+	}
+
+	$sql_set = "SET title='$title4save',address='$address4save',visible='$visible',nocomments='$nocomments',submenu='$submenu',link='$link',text='$text',nohtml='0',nosmiley='0',nobreaks='0'" ;
+
+	if( $op == 'addlink' ) {
+		$sql = "INSERT INTO $mytablename $sql_set,created=NOW(),homepage='$hp_flag'" ;
+	} else {
+		// not to update last_modified
+		if( ! empty( $_POST['dont_update_last_modified'] ) ) $sql_set .= ",last_modified=last_modified" ;
+
+		// change homepage only when it should be turned on
+		if( $hp_flag ) $sql_set .= ",homepage='$hp_flag'" ;
+
+		$id = empty( $_POST['id'] ) ? 0 : intval( $_POST['id'] ) ;
+		$sql = "UPDATE $mytablename $sql_set WHERE storyid='$id'" ;
+	}
+
+	$result = $xoopsDB->query( $sql ) or die ( _TC_ERRORINSERT ) ;
+	redirect_header( "index.php?op=show" , 2 , _TC_DBUPDATED ) ;
+	exit ;
+	break;
+
+// ------------------------------------------------------------------------- //
+// Upload File                                                //
+// ------------------------------------------------------------------------- //
+case "update_wrap_contents" :
+
+	$result = $xoopsDB->query( "SELECT storyid,link,address FROM $mytablename WHERE link>0" ) ;
+	while( list( $id , $link , $address ) = $xoopsDB->fetchRow( $result ) ) {
+		if( stristr( $address , '..' ) ) exit ;
+		$wrapped_file = $wrap_path.'/'.$address ;
+		$ext = strtolower( substr( strrchr( $wrapped_file , '.' ) , 1 ) ) ;
+		if( in_array( $ext , $page_wrap_search_allowed_exts ) ) {
+			$fp = fopen( $wrapped_file , 'r' ) ;
+			if( ! $fp ) {
+				continue ;
+			}
+			$text4sql = addslashes( tc_convert_wrap_to_ie( strip_tags( fread( $fp , 65536 * 2 ) ) ) ) ;
+			fclose( $fp ) ;
+		} else {
+			$text4sql = '' ;
+		}
+		$xoopsDB->queryF( "UPDATE $mytablename SET text='$text4sql' WHERE storyid=".intval($id) ) ;
+	}
+
+	redirect_header( "index.php?op=show" , 2 , _TC_DBUPDATED ) ;
+	exit ;
+	break ;
+
+// ------------------------------------------------------------------------- //
+// Upload File                                                //
+// ------------------------------------------------------------------------- //
+case "upload" :
+
+	// Ticket Check
+	if ( ! $xoopsGTicket->check() ) {
+		redirect_header(XOOPS_URL.'/',3,$xoopsGTicket->getErrors());
+	}
+
+	$source = $_FILES['fileupload']['tmp_name'] ;
+	$fileupload_name = $_FILES['fileupload']['name'] ;
+	if( $source != 'none' && $source != '' ) {
+		$dest = "$wrap_path/$fileupload_name" ;
+		if( file_exists( $dest ) ) {
+			redirect_header( "index.php?op=nlink" , 5 , _TC_ERROREXIST ) ;
+			exit ;
+		} else {
+			if( copy( $source , $dest ) ) {
+				redirect_header( "index.php?op=nlink" , 2 , _TC_UPLOADED ) ;
+				exit ;
+			} else {
+				redirect_header( "index.php?op=nlink" , 5 , _TC_ERRORUPL ) ;
+				exit ;
+			}
+			unlink( $source ) ;
+		}
+	}
+
+	break;
+
+// ------------------------------------------------------------------------- //
+// Delete File - Confirmation Question                                    //
+// ------------------------------------------------------------------------- //
+case "delfile" :
+	xoops_cp_header() ;
+	include( dirname(__FILE__).'/mymenu.php' ) ;
+
+	// security fix (thx JM2)
+	$_POST['address'] = str_replace( '..' , '' , $_POST['address'] ) ;
+
+	xoops_confirm( array( 'address' => $_POST['address'] , 'op' => 'delfileok' ) + $xoopsGTicket->getTicketArray( __LINE__ ) , 'index.php' , _TC_RUSUREDELF , _YES ) ;
+	xoops_cp_footer() ;
+	break ;
+
+// ------------------------------------------------------------------------- //
+// Delete it definitely                                                      //
+// ------------------------------------------------------------------------- //
+case "delfileok" :
+
+	// Ticket Check
+	if ( ! $xoopsGTicket->check() ) {
+		redirect_header(XOOPS_URL.'/',3,$xoopsGTicket->getErrors());
+	}
+
+	// security fix (thx JM2)
+	$_POST['address'] = str_replace( '..' , '' , $_POST['address'] ) ;
+
+	unlink( "$wrap_path/{$_POST['address']}" ) ;
+	redirect_header( "index.php?op=nlink" , 2 , _TC_FDELETED ) ;
+	exit ;
+	break ;
+
+// ------------------------------------------------------------------------- //
+// Delete Content - Confirmation Question                                    //
+// ------------------------------------------------------------------------- //
+case "delete" :
+	xoops_cp_header() ;
+	include( dirname(__FILE__).'/mymenu.php' ) ;
+	xoops_confirm( array( 'id' => intval( $_GET['id'] ) , 'op' => 'deleteit' ) + $xoopsGTicket->getTicketArray( __LINE__ ) , 'index.php' , _TC_RUSUREDEL , _YES ) ;
+	xoops_cp_footer() ;
+	break ;
+
+// ------------------------------------------------------------------------- //
+// Delete it definitely                                                      //
+// ------------------------------------------------------------------------- //
+case "deleteit" :
+	// Ticket Check
+	if ( ! $xoopsGTicket->check() ) {
+		redirect_header(XOOPS_URL.'/',3,$xoopsGTicket->getErrors());
+	}
+
+	$id = empty( $_POST['id'] ) ? 0 : intval( $_POST['id'] ) ;
+	$result = $xoopsDB->query( "DELETE FROM $mytablename WHERE storyid='$id'" ) ;
+	xoops_comment_delete( $xoopsModule->getVar( 'mid' ) , $id ) ;
+	redirect_header( "index.php?op=show" , 1 , _TC_DBUPDATED ) ;
+	exit ;
+	break ;
+
+// ------------------------------------------------------------------------- //
+// Export to the other TinyD
+// ------------------------------------------------------------------------- //
+case "moveto" :
+	// Ticket Check
+	if ( ! $xoopsGTicket->check() ) {
+		redirect_header(XOOPS_URL.'/',3,$xoopsGTicket->getErrors());
+	}
+
+	$destModule = $module_handler->get( intval( $_POST['dest_tinyd'] ) ) ;
+
+	// error check
+	if( empty( $_POST['checked_ids'] ) || ! is_object( $destModule ) ) {
+		redirect_header( "index.php?op=show" , 1 , _TC_DBUPDATED ) ;
+		exit ;
+	}
+
+	$dest_dirname = $destModule->getVar( 'dirname' ) ;
+	if( ! preg_match( '/^(\D+)(\d*)$/' , $dest_dirname , $regs ) ) echo ( "invalid dirname: " . htmlspecialchars( $dest_dirname ) ) ;
+	$dest_dirnumber = $regs[2] === '' ? '' : intval( $regs[2] ) ;
+	$dest_tablename = $xoopsDB->prefix( "tinycontent{$dest_dirnumber}" ) ;
+
+	$src_mid = $xoopsModule->getVar( 'mid' ) ;
+	$dest_mid = $destModule->getVar( 'mid' ) ;
+
+	// authority check
+	if( ! $xoopsUser->isAdmin( $dest_mid ) ) {
+		redirect_header( XOOPS_URL.'/' , 1 , _NOPERM ) ;
+		exit ;
+	}
+
+	foreach( $_POST['checked_ids'] as $src_id => $val ) {
+		if( ! $val ) continue ;
+		$rs = $xoopsDB->query( "SELECT * FROM $mytablename WHERE storyid='".intval($src_id)."'" ) ;
+		if( ! ( $rows = $xoopsDB->fetchArray( $rs ) ) ) continue ;
+		$set_sql = '' ;
+		foreach( $rows as $colname => $colval ) {
+			if( $colname == 'storyid' || $colname == 'homepage' ) continue ;
+			$set_sql .= "$colname='".addslashes($colval)."'," ;
+		}
+		$set_sql = substr( $set_sql , 0 , -1 ) ;
+		$ins_rs = $xoopsDB->query( "INSERT INTO $dest_tablename SET $set_sql" ) ;
+		$dest_id = $xoopsDB->getInsertId() ;
+		if( ! $ins_rs || $dest_id <= 0 ) {
+			redirect_header( "index.php?op=show" , 5 , 'The target module should be updated' ) ;
+			exit ;
+		}
+
+		// delete the record
+		$del_rs = $xoopsDB->query( "DELETE FROM $mytablename WHERE storyid='".intval($src_id)."'" ) ;
+		// moving comments
+		$sql = "UPDATE ".$xoopsDB->prefix('xoopscomments')." SET com_modid='$dest_mid',com_itemid='$dest_id' WHERE com_modid='$src_mid' AND com_itemid='$src_id'" ;
+		$xoopsDB->query( $sql ) ;
+	}
+
+	redirect_header( "index.php?op=show" , 1 , _TC_DBUPDATED ) ;
+	exit ;
+	break ;
+
+}
+
+
+
+// checks browser compatibility with the control
+function check_browser_can_use_spaw() {
+
+	return true ;	// for nobunobu's spaw 2005-5-10
+
+	$browser = $_SERVER['HTTP_USER_AGENT'] ;
+	// check if msie
+	if( eregi( "MSIE[^;]*" , $browser , $msie ) ) {
+		// get version 
+		if( eregi( "[0-9]+\.[0-9]+" , $msie[0] , $version ) ) {
+			// check version
+			if( (float)$version[0] >= 5.5 ) {
+				// finally check if it's not opera impersonating ie
+				if( ! eregi( "opera" , $browser ) ) {
+					return true ;
+				}
+			}
+		}
+	}
+	return false ;
+}
+
+
+
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/admin/admin.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/admin/admin.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/admin/admin.php	(revision 405)
@@ -0,0 +1,160 @@
+<?php
+// $Id: admin.php,v 1.7 2003/04/11 13:00:53 okazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+$admin_mydirname = basename( dirname( dirname( __FILE__ ) ) ) ;
+
+$fct = empty( $_POST['fct'] ) ? '' : trim( $_POST['fct'] ) ;
+$fct = empty( $_GET['fct'] ) ? $fct : trim( $_GET['fct'] ) ;
+if( empty( $fct ) ) $fct = 'preferences' ;
+//if (isset($fct) && $fct == "users") {
+//	$xoopsOption['pagetype'] = "user";
+//}
+include "../../../mainfile.php";
+// include "../../mainfile.php"; GIJ
+include XOOPS_ROOT_PATH."/include/cp_functions.php";
+
+include_once XOOPS_ROOT_PATH."/class/xoopsmodule.php";
+include_once "../include/gtickets.php" ;// GIJ
+
+$admintest = 0;
+
+if (is_object($xoopsUser)) {
+	$xoopsModule =& XoopsModule::getByDirname("system");
+	if ( !$xoopsUser->isAdmin($xoopsModule->mid()) ) {
+		redirect_header(XOOPS_URL.'/user.php',3,_NOPERM);
+		exit();
+	}
+	$admintest=1;
+} else {
+	redirect_header(XOOPS_URL.'/user.php',3,_NOPERM);
+	exit();
+}
+
+// include system category definitions
+include_once XOOPS_ROOT_PATH."/modules/system/constants.php";
+$error = false;
+if ($admintest != 0) {
+	if (isset($fct) && $fct != '') {
+		if (file_exists(XOOPS_ROOT_PATH."/modules/system/admin/".$fct."/xoops_version.php")) {
+
+			if ( file_exists(XOOPS_ROOT_PATH."/modules/system/language/".$xoopsConfig['language']."/admin.php") ) {
+				include XOOPS_ROOT_PATH."/modules/system/language/".$xoopsConfig['language']."/admin.php";
+			} else {
+				include XOOPS_ROOT_PATH."/modules/system/language/english/admin.php";
+			}
+
+			if (file_exists(XOOPS_ROOT_PATH."/modules/system/language/".$xoopsConfig['language']."/admin/".$fct.".php")) {
+				include XOOPS_ROOT_PATH."/modules/system/language/".$xoopsConfig['language']."/admin/".$fct.".php";
+			} elseif (file_exists(XOOPS_ROOT_PATH."/modules/system/language/english/admin/".$fct.".php")) {
+				include XOOPS_ROOT_PATH."/modules/system/language/english/admin/".$fct.".php";
+			}
+			include XOOPS_ROOT_PATH."/modules/system/admin/".$fct."/xoops_version.php";
+			$sysperm_handler =& xoops_gethandler('groupperm');
+			$category = !empty($modversion['category']) ? intval($modversion['category']) : 0;
+			unset($modversion);
+			if ($category > 0) {
+				$groups = $xoopsUser->getGroups();
+				if (in_array(XOOPS_GROUP_ADMIN, $groups) || false != $sysperm_handler->checkRight('system_admin', $category, $groups, $xoopsModule->getVar('mid'))){
+//					if (file_exists(XOOPS_ROOT_PATH."/modules/system/admin/".$fct."/main.php")) {
+//						include_once XOOPS_ROOT_PATH."/modules/system/admin/".$fct."/main.php"; GIJ
+					if (file_exists("../include/{$fct}.inc.php")) {
+						include_once "../include/{$fct}.inc.php" ;
+					} else {
+						$error = true;
+					}
+				} else {
+					$error = true;
+				}
+			} elseif ($fct == 'version') {
+				if (file_exists(XOOPS_ROOT_PATH."/modules/system/admin/version/main.php")) {
+					include_once XOOPS_ROOT_PATH."/modules/system/admin/version/main.php";
+				} else {
+					$error = true;
+				}
+			} else {
+				$error = true;
+			}
+		} else {
+			$error = true;
+		}
+	} else {
+		$error = true;
+	}
+}
+
+if (false != $error) {
+	xoops_cp_header();
+	echo "<h4>System Configuration</h4>";
+	echo '<table class="outer" cellpadding="4" cellspacing="1">';
+	echo '<tr>';
+	$groups = $xoopsUser->getGroups();
+	$all_ok = false;
+	if (!in_array(XOOPS_GROUP_ADMIN, $groups)) {
+		$sysperm_handler =& xoops_gethandler('groupperm');
+		$ok_syscats = $sysperm_handler->getItemIds('system_admin', $groups);
+	} else {
+		$all_ok = true;
+	}
+	$admin_dir = XOOPS_ROOT_PATH."/modules/system/admin";
+	$handle = opendir($admin_dir);
+	$counter = 0;
+	$class = 'even';
+	while ($file = readdir($handle)) {
+		if (strtolower($file) != 'cvs' && !preg_match("/[.]/", $file) && is_dir($admin_dir.'/'.$file)) {
+			include $admin_dir.'/'.$file.'/xoops_version.php';
+			if ($modversion['hasAdmin']) {
+				$category = isset($modversion['category']) ? intval($modversion['category']) : 0;
+				if (false != $all_ok || in_array($modversion['category'], $ok_syscats)) {
+					echo "<td class='$class' align='center' valign='bottom' width='19%'>";
+					echo "<a href='".XOOPS_URL."/modules/system/admin.php?fct=".$file."'><b>" .trim($modversion['name'])."</b></a>\n";
+					echo "</td>";
+					$counter++;
+					$class = ($class == 'even') ? 'odd' : 'even';
+				}
+				if ( $counter > 4 ) {
+					$counter = 0;
+					echo "</tr>";
+					echo "<tr>";
+				}
+			}
+			unset($modversion);
+		}
+	}
+	while ($counter < 5) {
+		echo '<td class="'.$class.'">&nbsp;</td>';
+		$class = ($class == 'even') ? 'odd' : 'even';
+		$counter++;
+	}
+	echo '</tr></table>';
+    xoops_cp_footer();
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/admin/text_wiki_sample.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/admin/text_wiki_sample.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/admin/text_wiki_sample.php	(revision 405)
@@ -0,0 +1,240 @@
+<?php
+
+//	$xoopsOption['nocommon'] = true ;
+//	require '../../../mainfile.php' ;
+
+	$lang = empty( $_GET['lang'] ) ? '' : str_replace( '..' , '' , $_GET['lang'] ) ;
+
+	if( file_exists( "../language/$lang/text_wiki_sample.wiki" ) ) {
+		$fp = fopen( "../language/$lang/text_wiki_sample.wiki" , 'r' ) ;
+	} else {
+		$fp = fopen( "../language/english/text_wiki_sample.wiki" , 'r' ) ;
+	}
+	$wiki_source = fread( $fp , 65536 ) ;
+	fclose( $fp ) ;
+
+	if( ! defined( 'PATH_SEPARATOR' ) ) define( 'PATH_SEPARATOR' , DIRECTORY_SEPARATOR == '/' ? ':' : ';' ) ;
+	ini_set( 'include_path' , ini_get('include_path') . PATH_SEPARATOR . dirname(dirname(dirname(dirname(__FILE__)))) . '/common/PEAR' ) ;
+	include_once "Text/Wiki.php";
+	// include_once "Text/sunday_Wiki.php";
+	$wiki = new Text_Wiki(); // create instance
+
+	// Configuration
+	$wiki->deleteRule( 'Wikilink' ); // remove a rule for auto-linking
+	$wiki->setFormatConf( 'Xhtml' , 'translate' , false ) ; // remove HTML_ENTITIES
+
+	// $wiki = new sunday_Text_Wiki(); // create instance
+	//$text = str_replace ( "\r\n", "\n", $text );
+	//$text = str_replace ( "~\n", "[br]", $text );
+	//$text = $wiki->transform($text);
+	//$content = str_replace ( "[br]", "<br/>", $text );
+	// special thx to minahito! you are great!!
+	$wiki_body = $wiki->transform( $wiki_source ) ;
+	
+	echo '
+	<html>
+	<head>
+		<title>PEAR::Text_Wiki Sample</title>
+		<style>
+		body, p, br, td, th {
+			font-family: "Lucida Grande", Verdana, Arial, Geneva;
+			font-size: 9pt;
+			color: black;
+			line-spacing: 120%;
+		}
+		
+		table {
+			border-spacing: 0px;
+			border: 1px solid gray;
+		}
+		
+		th , td {
+			margin: 1px;
+			border: 1px solid silver;
+			padding: 4px;
+		}
+		
+		h1 { font-size: 24pt;}
+		h2 { font-size: 18pt; border-bottom: 1px solid gray; clear: both;}
+		h3 { font-size: 14pt;}
+		h4 { font-size: 12pt;}
+		h5 { font-size: 10pt;}
+		h6 { font-size: 9pt;}
+		
+	
+		blockquote {
+			border: 1px solid silver;
+			background: #eee;
+			margin: 4px;
+			padding: 4px 12px;
+		}
+		
+		table.admin {
+			border: 2px solid #039;
+			border-spacing: 0px;
+			padding: 0px;
+		}
+		
+		th.admin {
+			padding: 4px;
+			background: #039;
+			color: white;
+			font-weight: bold;
+			vertical-align: bottom;
+		}
+		
+		td.admin {
+			border: 1px solid white;
+			padding: 4px;
+			background: #eee;
+			vertical-align: top;
+		}
+		
+		
+		a:link, a:active, a:visited {
+			color: blue;
+			text-decoration: none;
+			border-bottom: 1px solid blue;
+		}
+		
+		a:hover {
+			color: blue;
+			text-decoration: none;
+			border-bottom: 1px dotted blue;
+		}
+		
+	
+		li {
+			margin-top: 3pt;
+			margin-bottom: 3pt;
+		}
+		
+		pre {
+			border: 1px dashed #036;
+			background: #eee;
+			padding: 6pt;
+			font-family: ProFont, Monaco, Courier, "Andale Mono", monotype;
+			font-size: 9pt;
+		}
+		
+		input[type="text"], input[type="password"], textarea {
+			font-family: ProFont, Monaco, Courier, "Andale Mono", monotype;
+			font-size: 9pt;
+		}
+		
+		table.nav_table {
+			width: 100%;
+		}
+		
+		td.tabs_marginal {
+			background: white;
+			border-bottom: 1px solid black;
+		}
+		
+		td.tabs_unselect {
+			background: #aaa;
+			border-top: 1px solid black;
+			border-left: 1px solid black;
+			border-right: 1px solid black;
+			border-bottom: 1px solid black;
+			text-align: center;
+		}
+		
+		td.tabs_selected {
+			background: #ddd;
+			border-top: 1px solid black;
+			border-left: 1px solid black;
+			border-right: 1px solid black;
+			border-bottom: none;
+			text-align: center;
+			font-weight: bold;
+		}
+		
+		td.wide_marginal {
+			background: #ddd;
+			border-bottom: 1px solid black;
+		}
+		
+		td.wide_unselect {
+			background: #ddd;
+			border-bottom: 1px solid black;
+			text-align: center;
+		}
+		
+		td.wide_selected {
+			background: #ddd;
+			border-bottom: 1px solid black;
+			text-align: center;
+			font-weight: bold;
+		}
+		
+		td.tall_unselect {
+			font-weight: normal;
+		}
+		
+		td.tall_selected {
+			font-weight: normal;
+		}
+		
+		table.yawiki {
+			border-spacing: 0px;
+			border: 1px solid gray;
+		}
+		
+		tr.yawiki {
+		}
+		
+		th.yawiki {
+			margin: 1px;
+			border: 1px solid silver;
+			padding: 4px;
+			font-weight: bold;
+		}
+		
+		td.yawiki {
+			margin: 1px;
+			border: 1px solid silver;
+			padding: 4px;
+		}
+		
+		th.yawiki-form {
+			text-align: right;
+			padding: 4px;
+		}
+		
+		td.yawiki-form {
+			text-align: left;
+			padding: 4px;
+		}
+		
+		legend.yawiki-form {
+			font-size: 120%;
+		}
+		
+		label.yawiki-form {
+			font-weight: bold;
+		}
+		
+		div.toc_list {
+			border: 1px solid #ccc;
+			background-color: #eee;
+			padding: 1em;
+			margin-bottom: 2em;
+			float: left;
+			clear: both;
+		}
+		
+		div.toc_item {
+			font-size: 90%;
+			margin-top: 0.5em;
+		}
+		
+	</style>
+	</head>
+	<body>
+	'.$wiki_body.'
+	</body>
+	</html>
+	' ;
+	
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/admin/mygrouppermform.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/admin/mygrouppermform.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/admin/mygrouppermform.php	(revision 405)
@@ -0,0 +1,378 @@
+<?php
+// $Id: grouppermform.php,v 1.4 2003/09/29 18:25:27 okazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000-2003 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+if( ! defined( 'XOOPS_ROOT_PATH' ) ) exit ;
+
+require_once XOOPS_ROOT_PATH.'/class/xoopsform/formelement.php';
+require_once XOOPS_ROOT_PATH.'/class/xoopsform/formhidden.php';
+require_once XOOPS_ROOT_PATH.'/class/xoopsform/formbutton.php';
+require_once XOOPS_ROOT_PATH.'/class/xoopsform/formelementtray.php';
+require_once XOOPS_ROOT_PATH.'/class/xoopsform/form.php';
+
+/**
+ * Renders a form for setting module specific group permissions
+ * 
+ * @author	Kazumi Ono	<onokazu@myweb.ne.jp>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ * 
+ * @package     kernel
+ * @subpackage  form
+ */
+class MyXoopsGroupPermForm extends XoopsForm
+{
+
+	/**
+	 * Module ID
+	 * @var int
+	 */
+	var $_modid;
+	/**
+	 * Tree structure of items
+	 * @var array
+	 */
+	var $_itemTree = array() ;
+	/**
+	 * Name of permission
+	 * @var string
+	 */
+	var $_permName;
+	/**
+	 * Description of permission
+	 * @var string
+	 */
+	var $_permDesc;
+	/**
+	 * Appendix
+	 * @var array ('permname'=>,'itemid'=>,'itemname'=>,'selected'=>)
+	 */
+	var $_appendix = array() ;
+
+	/**
+	 * Constructor
+	 */
+	function MyXoopsGroupPermForm($title, $modid, $permname, $permdesc)
+	{
+//		$this->XoopsForm($title, 'groupperm_form', XOOPS_URL.'/modules/system/admin/groupperm.php', 'post'); GIJ
+		$this->XoopsForm($title, 'groupperm_form', '' , 'post');
+		$this->_modid = intval($modid);
+		$this->_permName = $permname;
+		$this->_permDesc = $permdesc;
+		$this->addElement(new XoopsFormHidden('modid', $this->_modid));
+	}
+
+	/**
+	 * Adds an item to which permission will be assigned
+	 *
+	 * @param string $itemName
+	 * @param int $itemId
+	 * @param int $itemParent
+	 * @access public
+	 */
+	function addItem($itemId, $itemName, $itemParent = 0)
+	{
+		$this->_itemTree[$itemParent]['children'][] = $itemId;
+		$this->_itemTree[$itemId]['parent'] = $itemParent;
+		$this->_itemTree[$itemId]['name'] = $itemName;
+		$this->_itemTree[$itemId]['id'] = $itemId;
+	}
+
+	/**
+	 * Add appendix
+	 *
+	 * @access public
+	 */
+	function addAppendix($permName,$itemId,$itemName)
+	{
+		$this->_appendix[] = array('permname'=>$permName,'itemid'=>$itemId,'itemname'=>$itemName,'selected'=>false);
+	}
+
+	/**
+	 * Loads all child ids for an item to be used in javascript
+	 *
+	 * @param int $itemId
+	 * @param array $childIds
+	 * @access private
+	 */
+	function _loadAllChildItemIds($itemId, &$childIds)
+	{
+		if (!empty($this->_itemTree[$itemId]['children'])) {
+			$first_child = $this->_itemTree[$itemId]['children'];
+			foreach ($first_child as $fcid) {
+				array_push($childIds, $fcid);
+				if (!empty($this->_itemTree[$fcid]['children'])) {
+					foreach ($this->_itemTree[$fcid]['children'] as $_fcid) {
+						array_push($childIds, $_fcid);
+						$this->_loadAllChildItemIds($_fcid, $childIds);
+					}
+				}
+			}
+		}
+	}
+
+	/**
+	 * Renders the form
+	 *
+	 * @return string
+	 * @access public
+	 */
+	function render()
+	{
+		global $xoopsGTicket ;
+	
+		// load all child ids for javascript codes
+		foreach (array_keys($this->_itemTree) as $item_id) {
+			$this->_itemTree[$item_id]['allchild'] = array();
+			$this->_loadAllChildItemIds($item_id, $this->_itemTree[$item_id]['allchild']);
+		}
+		$gperm_handler =& xoops_gethandler('groupperm');
+		$member_handler =& xoops_gethandler('member');
+		$glist = $member_handler->getGroupList();
+		foreach (array_keys($glist) as $i) {
+			// get selected item id(s) for each group
+			$selected = $gperm_handler->getItemIds($this->_permName, $i, $this->_modid);
+			$ele = new MyXoopsGroupFormCheckBox($glist[$i], 'perms['.$this->_permName.']', $i, $selected);
+			$ele->setOptionTree($this->_itemTree);
+
+			foreach( $this->_appendix as $key => $append ) {
+				$this->_appendix[$key]['selected'] = $gperm_handler->checkRight($append['permname'], $append['itemid'], $i, $this->_modid ) ;
+			}
+			$ele->setAppendix($this->_appendix);
+			$this->addElement($ele);
+			unset($ele);
+		}
+
+		// GIJ start
+		$jstray = new XoopsFormElementTray(' &nbsp; ');
+		$jsuncheckbutton = new XoopsFormButton('', 'none', _NONE, 'button');
+		$jsuncheckbutton->setExtra( "onclick=\"with(document.groupperm_form){for(i=0;i<length;i++){if(elements[i].type=='checkbox'){elements[i].checked=false;}}}\"" ) ;
+		$jscheckbutton = new XoopsFormButton('', 'all', _ALL, 'button');
+		$jscheckbutton->setExtra( "onclick=\"with(document.groupperm_form){for(i=0;i<length;i++){if(elements[i].type=='checkbox' && (elements[i].name.indexOf('module_admin')<0 || elements[i].name.indexOf('[groups][1]')>=0)){elements[i].checked=true;}}}\"" ) ;
+		$jstray->addElement( $jsuncheckbutton ) ;
+		$jstray->addElement( $jscheckbutton ) ;
+		$this->addElement($jstray);
+		// GIJ end
+
+		$tray = new XoopsFormElementTray('');
+		$tray->addElement(new XoopsFormButton('', 'reset', _CANCEL, 'reset'));
+		$tray->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
+		$this->addElement($tray);
+
+		$ret = '<h4>'.$this->getTitle().'</h4>'.$this->_permDesc.'<br />';
+		$ret .= "<form name='".$this->getName()."' id='".$this->getName()."' action='".$this->getAction()."' method='".$this->getMethod()."'".$this->getExtra().">\n<table width='100%' class='outer' cellspacing='1'>\n";
+		$elements =& $this->getElements();
+		foreach(array_keys($elements) as $i) {
+			if (!is_object($elements[$i])) {
+				$ret .= $elements[$i];
+			} elseif (!$elements[$i]->isHidden()) {
+				$ret .= "<tr valign='top' align='left'><td class='head'>".$elements[$i]->getCaption();
+				if ($elements[$i]->getDescription() != '') {
+					$ret .= '<br /><br /><span style="font-weight: normal;">'.$elements[$i]->getDescription().'</span>';
+				}
+				$ret .= "</td>\n<td class='even'>\n".$elements[$i]->render()."\n</td></tr>\n";
+			} else {
+				$ret .= $elements[$i]->render();
+			}
+		}
+		$ret .= "</table>".$xoopsGTicket->getTicketHtml(__LINE__ , 1800 , 'myblocksadmin' )."</form>";
+		return $ret;
+	}
+}
+
+/**
+ * Renders checkbox options for a group permission form
+ * 
+ * @author	Kazumi Ono	<onokazu@myweb.ne.jp>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ * 
+ * @package     kernel
+ * @subpackage  form
+ */
+class MyXoopsGroupFormCheckBox extends XoopsFormElement
+{
+
+	/**
+	 * Pre-selected value(s)
+	 * @var array;
+	 */
+	var $_value;
+	/**
+	 * Group ID
+	 * @var int
+	 */
+	var $_groupId;
+	/**
+	 * Option tree
+	 * @var array
+	 */
+	var $_optionTree;
+	/**
+	 * Appendix
+	 * @var array ('permname'=>,'itemid'=>,'itemname'=>,'selected'=>)
+	 */
+	var $_appendix = array() ;
+
+	/**
+	 * Constructor
+	 */
+	function MyXoopsGroupFormCheckBox($caption, $name, $groupId, $values = null)
+	{
+		$this->setCaption($caption);
+		$this->setName($name);
+		if (isset($values)) {
+			$this->setValue($values);
+		}
+		$this->_groupId = $groupId;
+	}
+
+	/**
+	 * Sets pre-selected values
+	 *
+	 * @param mixed $value A group ID or an array of group IDs
+	 * @access public
+	 */
+	function setValue($value)
+	{
+		if (is_array($value)) {
+			foreach ($value as $v) {
+				$this->setValue($v);
+			}
+		} else {
+			$this->_value[] = $value;
+		}
+	}
+
+	/**
+	 * Sets the tree structure of items
+	 *
+	 * @param array $optionTree
+	 * @access public
+	 */
+	function setOptionTree(&$optionTree)
+	{
+		$this->_optionTree =& $optionTree;
+	}
+
+	/**
+	 * Sets appendix of checkboxes
+	 *
+	 * @access public
+	 */
+	function setAppendix($appendix)
+	{
+		$this->_appendix = $appendix ;
+	}
+
+	/**
+	 * Renders checkbox options for this group
+	 *
+	 * @return string
+	 * @access public
+	 */
+	function render()
+	{
+		$ret = '' ;
+
+		if( sizeof( $this->_appendix ) > 0 ) {
+			$ret .= '<table class="outer"><tr>';
+			$cols = 1;
+			foreach ($this->_appendix as $append) {
+				if ($cols > 4) {
+					$ret .= '</tr><tr>';
+					$cols = 1;
+				}
+				$checked = $append['selected'] ? 'checked="checked"' : '' ;
+				$name = 'perms['.$append['permname'].']' ;
+				$itemid = $append['itemid'] ;
+				$itemid = $append['itemid'] ;
+				$ret .= "<td class=\"odd\"><input type=\"checkbox\" name=\"{$name}[groups][$this->_groupId][$itemid]\" id=\"{$name}[groups][$this->_groupId][$itemid]\" value=\"1\" $checked />{$append['itemname']}<input type=\"hidden\" name=\"{$name}[parents][$itemid]\" value=\"\" /><input type=\"hidden\" name=\"{$name}[itemname][$itemid]\" value=\"{$append['itemname']}\" /><br /></td>" ;
+				$cols++;
+			}
+			$ret .= '</tr></table>';
+		}
+
+		$ret .= '<table class="outer"><tr>';
+		$cols = 1;
+		if( ! empty( $this->_optionTree[0]['children'] ) ) {
+			foreach ($this->_optionTree[0]['children'] as $topitem) {
+				if ($cols > 4) {
+					$ret .= '</tr><tr>';
+					$cols = 1;
+				}
+				$tree = '<td class="odd">';
+				$prefix = '';
+				$this->_renderOptionTree($tree, $this->_optionTree[$topitem], $prefix);
+				$ret .= $tree.'</td>';
+				$cols++;
+			}
+		}
+		$ret .= '</tr></table>';
+		return $ret;
+	}
+
+	/**
+	 * Renders checkbox options for an item tree
+	 *
+	 * @param string $tree
+	 * @param array $option
+	 * @param string $prefix
+	 * @param array $parentIds
+	 * @access private
+	 */
+	function _renderOptionTree(&$tree, $option, $prefix, $parentIds = array())
+	{
+		$tree .= $prefix."<input type=\"checkbox\" name=\"".$this->getName()."[groups][".$this->_groupId."][".$option['id']."]\" id=\"".$this->getName()."[groups][".$this->_groupId."][".$option['id']."]\" onclick=\"";
+		// If there are parent elements, add javascript that will
+		// make them selecteded when this element is checked to make
+		// sure permissions to parent items are added as well.
+		foreach ($parentIds as $pid) {
+			$parent_ele = $this->getName().'[groups]['.$this->_groupId.']['.$pid.']';
+			$tree .= "var ele = xoopsGetElementById('".$parent_ele."'); if(ele.checked != true) {ele.checked = this.checked;}";
+		}
+		// If there are child elements, add javascript that will
+		// make them unchecked when this element is unchecked to make
+		// sure permissions to child items are not added when there
+		// is no permission to this item.
+		foreach ($option['allchild'] as $cid) {
+			$child_ele = $this->getName().'[groups]['.$this->_groupId.']['.$cid.']';
+			$tree .= "var ele = xoopsGetElementById('".$child_ele."'); if(this.checked != true) {ele.checked = false;}";
+		}
+		$tree .= '" value="1"';
+		if ( isset( $this->_value ) && in_array($option['id'], $this->_value)) {
+			$tree .= ' checked="checked"';
+		}
+		$tree .= " />".$option['name']."<input type=\"hidden\" name=\"".$this->getName()."[parents][".$option['id']."]\" value=\"".implode(':', $parentIds)."\" /><input type=\"hidden\" name=\"".$this->getName()."[itemname][".$option['id']."]\" value=\"".htmlspecialchars($option['name'])."\" /><br />\n";
+		if( isset( $option['children'] ) ) foreach ($option['children'] as $child) {
+			array_push($parentIds, $option['id']);
+			$this->_renderOptionTree($tree, $this->_optionTree[$child], $prefix.'&nbsp;-', $parentIds);
+		}
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/admin/mymenu.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/admin/mymenu.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/admin/mymenu.php	(revision 405)
@@ -0,0 +1,66 @@
+<?php
+
+if( ! defined( 'XOOPS_ROOT_PATH' ) ) exit ;
+
+if( ! defined( 'XOOPS_ORETEKI' ) ) {
+	// Skip for ORETEKI XOOPS
+
+	if( ! isset( $module ) || ! is_object( $module ) ) $module = $xoopsModule ;
+	else if( ! is_object( $xoopsModule ) ) die( '$xoopsModule is not set' )  ;
+
+	if( file_exists("../language/".$xoopsConfig['language']."/modinfo.php") ) {
+		include_once("../language/".$xoopsConfig['language']."/modinfo.php");
+	} else {
+		include_once("../language/english/modinfo.php");
+	}
+
+	include( './menu.php' ) ;
+
+//	array_push( $adminmenu , array( 'title' => _PREFERENCES , 'link' => '../system/admin.php?fct=preferences&op=showmod&mod=' . $module->getvar('mid') ) ) ;
+	$menuitem_dirname = $module->getvar('dirname') ;
+	if( $module->getvar('hasconfig') ) array_push( $adminmenu , array( 'title' => _PREFERENCES , 'link' => 'admin/admin.php?fct=preferences&op=showmod&mod=' . $module->getvar('mid') ) ) ;
+
+	$menuitem_count = 0 ;
+	$mymenu_uri = empty( $mymenu_fake_uri ) ? $_SERVER['REQUEST_URI'] : $mymenu_fake_uri ;
+	$mymenu_link = substr( strstr( $mymenu_uri , '/admin/' ) , 1 ) ;
+
+	// hilight
+	foreach( array_keys( $adminmenu ) as $i ) {
+		if( $mymenu_link == $adminmenu[$i]['link'] ) {
+			$adminmenu[$i]['color'] = '#FFCCCC' ;
+			$adminmenu_hilighted = true ;
+		} else {
+			$adminmenu[$i]['color'] = '#DDDDDD' ;
+		}
+	}
+	if( empty( $adminmenu_hilighted ) ) {
+		foreach( array_keys( $adminmenu ) as $i ) {
+			if( stristr( $mymenu_uri , $adminmenu[$i]['link'] ) ) {
+				$adminmenu[$i]['color'] = '#FFCCCC' ;
+			}
+		}
+	}
+
+
+
+/*	// display
+	foreach( $adminmenu as $menuitem ) {
+		echo "<a href='".XOOPS_URL."/modules/$menuitem_dirname/{$menuitem['link']}' style='background-color:{$menuitem['color']};font:normal normal bold 9pt/12pt;'>{$menuitem['title']}</a> &nbsp; \n" ;
+
+		if( ++ $menuitem_count >= 4 ) {
+			echo "</div>\n<div width='95%' align='center'>\n" ;
+			$menuitem_count = 0 ;
+		}
+	}
+	echo "</div>\n" ;
+*/
+	// display
+	echo "<div style='text-align:left;width:98%;'>" ;
+	foreach( $adminmenu as $menuitem ) {
+		echo "<div style='float:left;height:1.5em;'><nobr><a href='".XOOPS_URL."/modules/$menuitem_dirname/{$menuitem['link']}' style='background-color:{$menuitem['color']};font:normal normal bold 9pt/12pt;'>{$menuitem['title']}</a> | </nobr></div>\n" ;
+	}
+	echo "</div>\n<hr style='clear:left;display:block;' />\n" ;
+
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/.htaccess.rewrite
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/.htaccess.rewrite	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/.htaccess.rewrite	(revision 405)
@@ -0,0 +1,11 @@
+RewriteEngine on
+
+RewriteRule ^rewrite/tc_(.*).html$ index.php?id=$1 [L]
+RewriteRule ^rewrite/(.*.html?)$ rewrite.php?wrap=$1 [L]
+RewriteRule ^rewrite/index.php(.*)$ index.php$1 [L]
+RewriteRule ^rewrite/comment_new.php(.*)$ comment_new.php$1 [L]
+RewriteRule ^rewrite/comment_post.php(.*)$ comment_post.php$1 [L]
+RewriteRule ^rewrite/comment_reply.php(.*)$ comment_reply.php$1 [L]
+RewriteRule ^rewrite/comment_edit.php(.*)$ comment_edit.php$1 [L]
+RewriteRule ^rewrite/comment_delete.php(.*)$ comment_delete.php$1 [L]
+RewriteRule ^rewrite/(.*)$ content/$1 [L]
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/README
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/README	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/README	(revision 405)
@@ -0,0 +1,146 @@
+[mlimg][xlang:en]
+TinyD is a forked module based on Tiny Content made by chapi.
+
+Tiny Content is simple and light content module.
+Since I think that simpleness and lightness is the most important factor for content module, I love this module.
+
+I want to clone this module but it is not so easy.
+Thus, I experimented to make a module which can be easily cloned.
+Though it has not understood whether this experiment succeeded yet, I distribute this funny hacked module.
+
+I thanks to the author -Tobias Liegl (AKA CHAPI)-.
+
+
+HOW TO USE:
+
+If you are new user of TinyD or TinyContent, upload modules/tinyd0 and install it. (It's quite normal way as a Module for Xoops)
+
+If you want to use features of PEAR Wiki or SPAW editor, upload common/PEAR and common/spaw into your XOOPS_ROOT_PATH.
+
+If you already a user of CHAPI's TinyContent, rename tinyd0 to tinycontent and overwrite tinycontent/. After this, update the module in module's admin.
+
+If you already a user of TinyD, reneme tinyd0 to tinycontent* as you like.
+Of course, updating module is necessary.
+
+
+You can clone this module easily. only copy them.
+And the rule of directory's name is quite simple.
+
+This module judges its number by tale of directory's name.
+
+modules/tinyd0 - treated as No.0 module of TinyD
+modules/tinycontent1 - treated as No.1 moudle of TinyD
+modules/c2    - treated as No.2 module of TinyD
+modules/tinycontent - treated as unnumbered module of TinyD
+
+The numbers of TinyD have to be unique.
+Also, unnumbered module have to be unique.
+
+You can install or upgrade TinyD as modules/tinycontent/ for compatibility of URI.
+
+Moreover, this module demonstrates more abilities with mod_rewrite when you wrap many pages.
+If you can use mod_rewrite, rename .htaccess.rewrite into .htaccess .
+
+
+APPENDIX:
+
+This project has already exceeded the experimentation phase and reached practical stage.
+I modified almost files and has been changed far from original spec.
+I recommend this hacked module with confidence.
+
+After mh012, you can also duplicate blocks.
+It is useful as replacement as custom blocks or summary of contents.
+
+If you want to use this block as summary, use [summary][/summary] tag.
+In content block, you can see inside of this tags on the other hand you can see whole of contents in main part.
+
+And you also want to add a link for full view, copy templates/blocks/tinycontent_content_block.html.dist to templates/blocks/tinycontent_content_block.html and edit it as you like.
+
+
+APPENDIX2:
+
+If you want to use SPAW integrated with myAlbum-P, set the path for
+phtos/thumbnails like this:
+
+/uploads/photos(number)/
+/uploads/thumbs(number)/
+
+
+[/xlang:en]
+[xlang:ja]
+
+¤³¤ì¤Ï¡¢CHAPI¤µ¤ó¡ÊËÜÌ¾ Tobias Liegl¡Ë¤Îºî¤Ã¤¿¥³¥ó¥Æ¥ó¥Ä¥â¥¸¥å¡¼¥ë
+Tiny Content ¤ò¥Ù¡¼¥¹¤ËÂç²þÂ¤¤·¤¿¥â¥¸¥å¡¼¥ë¤Ç¤¹¡£
+
+Åö½é¤Ï¡¢¥·¥ó¥×¥ë¤ÊHackÈÇ¤Ç¤·¤¿¤¬¡¢äþÍ¾¶ÊÀÞ¤¢¤Ã¤Æ¡¢º£¤ä´°Á´¥ª¥ê¥¸¥Ê¥ë¥â¥¸¥å¡¼¥ë¤È¸Æ¤ó¤Ç¤âº¹¤·»Ù¤¨¤Ê¤¤¥ì¥Ù¥ë¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤È¼«Éé¤·¤Æ¤¤¤Þ¤¹¡£
+
+
+»È¤¤Êý:
+
+¿·µ¬¥¤¥ó¥¹¥È¡¼¥ë¤Ç¤¢¤ì¤Ð¡¢¥¢¡¼¥«¥¤¥Ö¤òÅ¸³«¤·¤¿Ãæ¤Ë¤¢¤ë modules/tinyd0 ¤òÉáÄÌ¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤·¤Æ¤¯¤À¤µ¤¤¡£
+
+PEAR Wikiµ¡Ç½¤ä¡¢spawÊÔ½¸µ¡Ç½¤¬É¬Í×¤Ç¤¢¤ì¤Ð¡¢XOOPS¥¤¥ó¥¹¥È¡¼¥ë¥Ç¥£¥ì¥¯¥È¥ê¤Ë¡¢¤³¤Î¥¢¡¼¥«¥¤¥ÖÆâ¤Îcommon¥Ç¥£¥ì¥¯¥È¥ê¤ò´Ý¤´¤È¥³¥Ô¡¼¤·¤Æ¤¯¤À¤µ¤¤¡£
+
+ÍÑÅÓ¤Ë¤è¤Ã¤Æ¤Ï¡¢content ¥Õ¥©¥ë¥À¤ò½ñ¹þ²ÄÇ½¤Ë¤¹¤ë(chmod 777Åù)É¬Í×¤¬¤¢¤ê¤Þ¤¹¤¬¡¢¤½¤¦¤¤¤¦»È¤¤Êý¤Ï¤¢¤Þ¤ê¤ª¾©¤á¤·¤Þ¤»¤ó¡£
+
+¤¹¤Ç¤Ëchapi¤µ¤ó¤ÎTiny Content ¤ò»È¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢modules/tinyd0 ¤ò¡¢modules/tinycontent ¤È¥ê¥Í¡¼¥à¤·¤Æ¾å½ñ¤­¤·¡¢¤½¤Î¸å¡¢¥â¥¸¥å¡¼¥ë¥¢¥Ã¥×¥Ç¡¼¥È¤ò¹Ô¤Ã¤Æ²¼¤µ¤¤¡£
+
+²áµî¤ÎTinyD¤ò»È¤Ã¤Æ¤¤¤ë¾ì¹ç¤âÆ±ÍÍ¤Ë¡¢tinycontent0 Åù¤È¥ê¥Í¡¼¥à¤·¤Æ¥â¥¸¥å¡¼¥ë¥¢¥Ã¥×¥Ç¡¼¥È¤ò¹Ô¤Ã¤Æ²¼¤µ¤¤¡£
+
+¤¹¤Ù¤Æ¤ÎTinyD¤Ë¤Ä¤¤¤Æ¡¢¾å½ñ¤­&¥¢¥Ã¥×¥Ç¡¼¥È¤ò¹Ô¤¦É¬Í×¤¬¤¢¤ê¤Þ¤¹¡£
+
+
+¤³¤Î¤³¤È¤«¤é¤â¤ªÈ½¤ê¤¤¤¿¤À¤±¤ë¤È»×¤¤¤Þ¤¹¤¬¡¢TinyD2 ¤Ï¡¢¤«¤Ê¤ê¼«Í³¤Ë¥Ç¥£¥ì¥¯¥È¥êÌ¾¤ò·è¤á¤é¤ì¤Þ¤¹¡£
+¤¿¤À¤·¡¢¤Á¤ç¤Ã¤È¤·¤¿¥ë¡¼¥ë¤¬¤¢¤ë¤Î¤Ç¡¢¤½¤ì¤À¤±¤Ï¼é¤é¤Ê¤¯¤Æ¤Ï¤¤¤±¤Þ¤»¤ó¡£
+(¿ô»ú°Ê³°¤¬£±»ú°Ê¾å)+(¿ô»ú¤¬£±»ú°Ê¾å)
+¤È¤¤¤¦Ì¾Á°¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£
+
+¥Ç¥Õ¥©¥ë¥È¤Î 'tinyd0' ¤Ï¡¢¤â¤Á¤í¤óOK¤Ç¤¹¡£
+¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ËÃÖ¤«¤ì¤¿¥â¥¸¥å¡¼¥ë¤Ï¡¢TinyD¤Î0ÈÖÌÜ¤È¤·¤Æ°·¤ï¤ì¤Þ¤¹¡£
+
+¤³¤Î¥â¥¸¥å¡¼¥ë¤ò¥³¥Ô¡¼¤·¤Æ¡¢'test1' ¤È¤·¤ÆÃÖ¤±¤Ð¡¢TinyD¤Î1ÈÖÌÜ¤Î¤Ç¤­¤¢¤¬¤ê¡£
+'test00003' ¤È¤«¤·¤Æ¤âÎÉ¤¤¤Ç¤¹¤¬¡¢¤³¤ì¤Ï3ÈÖÌÜ¤Ë¤Ê¤ê¤Þ¤¹¡£
+
+¤È¤ê¤¢¤¨¤º¡¢ÈÖ¹æÌµ¤·,0,1,2,3...9 ¤È£¹¤Ä¤À¤±ÍÑ°Õ¤·¤Æ¤¢¤ê¤Þ¤¹¡£
+¥Æ¥ó¥×¥ì¡¼¥È¤Èsql¥Õ¥¡¥¤¥ë¤òÍÑ°Õ¤·¤µ¤¨¤¹¤ì¤Ð¡¢¤¤¤¯¤Ä¤Ç¤âÊ£À½²ÄÇ½¤Ç¤¹¡£
+
+ÈÖ¹æ¤Ê¤·¤Îdirname¤Ï£±¤Ä¤À¤±²ÄÇ½¤Ç¤¹¡£tinycontent¤È¤¹¤ë¤³¤È¤Ç¡¢URI¸ß´¹¤òÊÝ¤Æ¤Þ¤¹¡£
+
+
+¤Þ¤¿¡¢¤³¤Î¥â¥¸¥å¡¼¥ë¤Ï¡¢Ê£¿ô¥Ú¡¼¥¸¤Î¥é¥Ã¥Ô¥ó¥°¤ò¹Ô¤¦»þ¤Ê¤É¡¢mod_rewrite ¤òÍøÍÑ¤¹¤ë¤³¤È¤Ç¡¢¤è¤ê¼ÂÎÏ¤òÈ¯´ø¤·¤Þ¤¹¡£
+¤â¤·¡¢¤ª»È¤¤¤Î¥µ¡¼¥Ð¤¬mod_rewrite¤ò»È¤¨¤ë¤è¤¦¤Ç¤·¤¿¤é¡¢¥â¥¸¥å¡¼¥ë¥Ç¥£¥ì¥¯¥È¥êÄ¾²¼¤Ë¤¢¤ë¡¢.htaccess.rewrite ¤ò .htaccess ¤È¥ê¥Í¡¼¥à¤·¤Æ¤ª»È¤¤²¼¤µ¤¤¡£tinycontentÆâ¤Î¤¹¤Ù¤Æ¤Î¥Ú¡¼¥¸¤ò¡¢ÀÅÅª¥Ú¡¼¥¸¤Ë¸«¤»¤«¤±¤ë¡¢¤Ê¤ó¤Æ¤³¤È¤â²ÄÇ½¤È¤Ê¤ê¤Þ¤¹¡£(SEOÂÐºö¤È¤Ê¤ë¤«¤É¤¦¤«¤ÏÃÎ¤ê¤Þ¤»¤ó¡£¤È¤¤¤¦¤«¡¢¾¯¤Ê¤¯¤È¤â»ä¤Ï¶½Ì£¤¢¤ê¤Þ¤»¤ó¡Ë
+
+
+mh012 ¤«¤é¡¢¥Ö¥í¥Ã¥¯¤âÊ£À½²ÄÇ½¤È¤Ê¤ê¤Þ¤·¤¿¡£Ê£À½²ÄÇ½¥â¥¸¥å¡¼¥ëÆâ¤Ë¡¢Ê£À½²ÄÇ½¤Î¥Ö¥í¥Ã¥¯¤¬¤¢¤ë¡£¤â¤Ï¤ä²¿¤¬¤Ê¤ó¤À¤«¡¢¤È¤¤¤¦¾õ¶·¤Ç¤¹¤¬¡¢¥«¥¹¥¿¥à¥Ö¥í¥Ã¥¯¤ÎÃÖ¤­´¹¤¨¤È¤·¤Æ¤â¡¢¥³¥ó¥Æ¥ó¥Ä¤ÎÍ×Ìó¤È¤·¤Æ¤â¡¢¤½¤ì¤Ê¤ê¤Ë»È¤¤¾¡¼ê¤ÏÎÉ¤¤¤À¤í¤¦¤È»×¤Ã¤Æ¤¤¤Þ¤¹¡£
+
+¤Ê¤ª¡¢Í×Ìó¤È¤·¤ÆÍøÍÑ¤¹¤ë¾ì¹ç¤Ï¡¢Í×ÌóÉôÊ¬¤ò[summary][/summary]¤Ç¶´¤ó¤Ç¤¯¤À¤µ¤¤¡£¥Ö¥í¥Ã¥¯¤Ë¤Ï¤³¤ÎÆâÂ¦¤À¤±¤¬É½¼¨¤µ¤ì¡¢¥á¥¤¥óÉôÊ¬¤Ë¤ÏÁ´ÂÎ¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£
+
+¤µ¤é¤Ë¡¢Í×Ìó¤ÇÉ½¼¨¤µ¤ì¤¿¥Ö¥í¥Ã¥¯¤«¤é¸µµ­»ö¤Ø¥ê¥ó¥¯¤¹¤ë¤Ë¤Ï¡¢templates/blocks/tinycontent_content_block.html.dist ¤È¤¤¤¦¥Õ¥¡¥¤¥ë¤ò tinycontent_content_block.html ¤È¤¤¤¦Ì¾Á°¤Ç¥³¥Ô¡¼¤·¡¢Å¬µ¹½ñ¤­´¹¤¨¤Æ¤¯¤À¤µ¤¤
+
+
+
+
+¼ØÂ­:
+
+ºÇ½é¤Ï¡¢¤¢¤¯¤Þ¤Ç¼Â¸³¤Î¤Ä¤â¤ê¤À¤Ã¤¿¤Î¤Ç¤¹¤¬¡¢¡ÖÊ£À½²ÄÇ½¡×¤È¤¤¤¦¥¹¥Ú¥Ã¥¯¤¬ÁÛÁü°Ê¾å¤Ë»È¤¤¤ä¤¹¤¯¡¢Â¾¤ÎÍøÍÑ¼Ô¤«¤é¤â¹¥É¾¤À¤Ã¤¿¤Î¤Ç¡¢º£¤ÏCHAPI¤µ¤ó¤Î¥ª¥ê¥¸¥Ê¥ë¥³¡¼¥É¤â´Þ¤á¡¢¤«¤Ê¤ê¼ê¤òÆþ¤ì¤Æ¤¤¤Þ¤¹¡£¡Ä¡Ä¤È¤¤¤¦¤«¡¢¤«¤Ê¤ê¹¥¤­¾¡¼ê¤ËÆÍ¤ÃÁö¤Ã¤Æ¤Þ¤¹¡Ê¾Ð¡Ë¡£
+
+¤½¤í¤½¤í¡¢¥ª¥ê¥¸¥Ê¥ë¤È¶èÊÌ¤¹¤ë¤¿¤á¤Ë¤â¡¢ÊÌ¤Î¸Æ¤ÓÊý¤ò¤·¤¿Êý¤¬ÎÉ¤¤¤À¤í¤¦¡¢¤È»×¤Ã¤Æ¤¤¤¿º¢¤Ë¤¿¤Þ¤¿¤ÞÌÜ¤Ë¤·¤¿ paopao¤µ¤ó¤Î¸Æ¤ÓÊý "TinyD" ¤¬µ¤¤ËÆþ¤Ã¤¿¤Î¤Ç¡¢¤³¤Á¤é¤ò¸ø¼°Ì¾¤È¤·¤Æ¤¤¤Þ¤¹¡£
+
+¥Ð¡¼¥¸¥ç¥ó¤âÆÈÎ©¤·¤Æ¡¢2.0¤È¤·¤Æ¤¤¤Þ¤¹¡£1.5 mh014 ¤È¤¤¤¦É½¸½¤¬¤¢¤Þ¤ê¤Ë¤âÈ½¤ê¤Å¤é¤«¤Ã¤¿¤¿¤á¤Ç¤¹¡£
+
+ºÇ¸å¤Ë¤Ê¤ê¤Þ¤·¤¿¤¬¡¢TinyConent¤È¤¤¤¦ÁÇÀ²¤é¤·¤¯¡¢²þÂ¤¤·¤ä¤¹¤¤¥â¥¸¥å¡¼¥ë¤ò¸ø³«¤·¤Æ¤¯¤ì¤¿CHAPI¤µ¤ó¤Ë´¶¼Õ¤·¤Þ¤¹¡£
+
+
+¼ØÂ­2:
+
+¤â¤·¡¢common SPAW ¤ò myAlbum-P ¤È¶¨Ä´Åª¤Ë»È¤¦¤¿¤á¤Ë¤Ï¡¢myAlbum-PÂ¦¤Î
+²èÁü/¥µ¥à¥Í¥¤¥ë¥Ç¥£¥ì¥¯¥È¥ê¤ò¼¡¤Î¤è¤¦¤Ë¤¹¤ëÉ¬Í×¤¬¤¢¤ê¤Þ¤¹¡£
+
+/uploads/photos(number)/
+/uploads/thumbs(number)/
+
+Â¾¤Î¥Ñ¥¹¤Ë¤¢¤Ã¤Æ¤âSPAW¤Î²èÁüÁªÂò¥À¥¤¥¢¥í¥°¤ÏÇ§¼±¤·¤Þ¤»¤ó¤Î¤Ç¡¢¤´Ãí°Õ
+¤¯¤À¤µ¤¤¡£
+
+
+[/xlang:ja]
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/comment_edit.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/comment_edit.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/comment_edit.php	(revision 405)
@@ -0,0 +1,29 @@
+<?php
+// $Id: comment_edit.php,v 1.5 2003/02/12 11:36:35 okazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+include '../../mainfile.php';
+include XOOPS_ROOT_PATH.'/include/comment_edit.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/comment_post.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/comment_post.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/comment_post.php	(revision 405)
@@ -0,0 +1,29 @@
+<?php
+// $Id: comment_post.php,v 1.5 2003/02/12 11:36:35 okazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+include '../../mainfile.php';
+include XOOPS_ROOT_PATH.'/include/comment_post.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/index.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/index.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/index.php	(revision 405)
@@ -0,0 +1,91 @@
+<?php
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+// ------------------------------------------------------------------------- //
+// Author: Tobias Liegl (AKA CHAPI)                                          //
+// Site: http://www.chapi.de                                                 //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+// Hacker: GIJ=CHECKMATE (AKA GIJOE)                                         //
+// Site: http://www.peak.ne.jp/xoops/                                        //
+// ------------------------------------------------------------------------- //
+
+// check modulesless rewrite
+if( ! empty( $_SERVER['REQUEST_URI'] ) && ! stristr( $_SERVER['REQUEST_URI'] , 'modules' ) ) {
+	$tinyd_vmod_dir = $_SERVER['REQUEST_URI'] ;
+	$_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'] . '?' . $_SERVER['QUERY_STRING'] ;
+}
+
+/* echo "<pre>" ;
+var_dump( $_SERVER ) ;
+exit ; */
+
+include( '../../mainfile.php' ) ;
+include_once( 'class/tinyd.textsanitizer.php' ) ;
+include_once( 'include/render_function.inc.php' ) ;
+include_once( 'include/constants.inc.php' ) ;
+
+// for "Duplicatable"
+$mydirname = basename( dirname( __FILE__ ) ) ;
+if( ! preg_match( '/^(\D+)(\d*)$/' , $mydirname , $regs ) ) echo ( "invalid dirname: " . htmlspecialchars( $mydirname ) ) ;
+$mydirnumber = $regs[2] === '' ? '' : intval( $regs[2] ) ;
+
+// utility variables
+$mymodpath = XOOPS_ROOT_PATH."/modules/$mydirname" ;
+$mytablename = $xoopsDB->prefix( "tinycontent{$mydirnumber}" ) ;
+
+// get id of homepage
+$result = $xoopsDB->query( "SELECT storyid,link FROM $mytablename WHERE visible='1' ORDER BY homepage DESC, blockid" ) ;
+if( $xoopsDB->getRowsNum( $result ) < 1 ) {
+	redirect_header( XOOPS_URL , 2 , _TC_FILENOTFOUND ) ;
+	exit ;
+}
+list( $homepage_id , $homepage_link_type ) = $xoopsDB->fetchRow( $result ) ;
+
+// check if $_GET['id'] is specified
+$id = empty( $_GET['id'] ) ? 0 : intval( $_GET['id'] ) ;
+if( $id <= 0 )  {
+	$_REQUEST['id'] = $_GET['id'] = $id = $homepage_id ;
+}
+
+// main query
+$result = $xoopsDB->query( "SELECT storyid,title,text,visible,nohtml,nosmiley,nobreaks,nocomments,link,address,UNIX_TIMESTAMP(last_modified) AS last_modified,html_header FROM $mytablename WHERE storyid='$id' AND visible" ) ;
+if( ( $result_array = $xoopsDB->fetchArray( $result ) ) == false ) {
+	redirect_header( XOOPS_URL , 2 , _TC_FILENOTFOUND ) ;
+	exit ;
+}
+
+// redirect if its base of wrapping is wrap_path (content)
+if( ! $xoopsModuleConfig['tc_force_mod_rewrite'] && $result_array['link'] == TC_WRAPTYPE_CONTENTBASE ) {
+	if( headers_sent() ) {
+		redirect_header( XOOPS_URL . "/modules/$mydirname/content/index.php?id={$result_array['storyid']}" , 0 , '&nbsp;' ) ;
+	} else {
+		header( "Location: content/index.php?id={$result_array['storyid']}" ) ;
+	}
+	exit ;
+}
+
+include( "include/display.inc.php" ) ;
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/blocks/tinycontent8_nav_block.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/blocks/tinycontent8_nav_block.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/blocks/tinycontent8_nav_block.html	(revision 405)
@@ -0,0 +1,9 @@
+<table cellspacing="0">
+  <tr>
+    <td id="mainmenu">
+  <{foreach item=link from=$block.links}>
+    <a class="menuMain" href="<{$block.mod_url}>/<{$link.href}>"><{$link.title}><{* <{$link.date|ryus_date:"new"}> *}></a>
+  <{/foreach}>
+    </td>
+  </tr>
+</table>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/blocks/tinycontent_content_block.html.dist
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/blocks/tinycontent_content_block.html.dist	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/blocks/tinycontent_content_block.html.dist	(revision 405)
@@ -0,0 +1,5 @@
+<{$content}>
+<{if $is_summary}>
+  <br />
+  <a href="<{$mymoddir}>/index.php?id=<{$storyid}>"><{$lang_more}></a>
+<{/if}>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/blocks/tinycontent9_nav_block.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/blocks/tinycontent9_nav_block.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/blocks/tinycontent9_nav_block.html	(revision 405)
@@ -0,0 +1,9 @@
+<table cellspacing="0">
+  <tr>
+    <td id="mainmenu">
+  <{foreach item=link from=$block.links}>
+    <a class="menuMain" href="<{$block.mod_url}>/<{$link.href}>"><{$link.title}><{* <{$link.date|ryus_date:"new"}> *}></a>
+  <{/foreach}>
+    </td>
+  </tr>
+</table>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/blocks/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/blocks/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/blocks/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/blocks/tinycontent0_nav_block.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/blocks/tinycontent0_nav_block.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/blocks/tinycontent0_nav_block.html	(revision 405)
@@ -0,0 +1,9 @@
+<table cellspacing="0">
+  <tr>
+    <td id="mainmenu">
+  <{foreach item=link from=$block.links}>
+    <a class="menuMain" href="<{$block.mod_url}>/<{$link.href}>"><{$link.title}><{* <{$link.date|ryus_date:"new"}> *}></a>
+  <{/foreach}>
+    </td>
+  </tr>
+</table>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/blocks/tinycontent_nav_block.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/blocks/tinycontent_nav_block.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/blocks/tinycontent_nav_block.html	(revision 405)
@@ -0,0 +1,9 @@
+<table cellspacing="0">
+  <tr>
+    <td id="mainmenu">
+  <{foreach item=link from=$block.links}>
+    <a class="menuMain" href="<{$block.mod_url}>/<{$link.href}>"><{$link.title}><{* <{$link.date|ryus_date:"new"}> *}></a>
+  <{/foreach}>
+    </td>
+  </tr>
+</table>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/blocks/tinycontent1_nav_block.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/blocks/tinycontent1_nav_block.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/blocks/tinycontent1_nav_block.html	(revision 405)
@@ -0,0 +1,9 @@
+<table cellspacing="0">
+  <tr>
+    <td id="mainmenu">
+  <{foreach item=link from=$block.links}>
+    <a class="menuMain" href="<{$block.mod_url}>/<{$link.href}>"><{$link.title}><{* <{$link.date|ryus_date:"new"}> *}></a>
+  <{/foreach}>
+    </td>
+  </tr>
+</table>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/blocks/tinycontent2_nav_block.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/blocks/tinycontent2_nav_block.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/blocks/tinycontent2_nav_block.html	(revision 405)
@@ -0,0 +1,9 @@
+<table cellspacing="0">
+  <tr>
+    <td id="mainmenu">
+  <{foreach item=link from=$block.links}>
+    <a class="menuMain" href="<{$block.mod_url}>/<{$link.href}>"><{$link.title}><{* <{$link.date|ryus_date:"new"}> *}></a>
+  <{/foreach}>
+    </td>
+  </tr>
+</table>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/blocks/tinycontent3_nav_block.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/blocks/tinycontent3_nav_block.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/blocks/tinycontent3_nav_block.html	(revision 405)
@@ -0,0 +1,9 @@
+<table cellspacing="0">
+  <tr>
+    <td id="mainmenu">
+  <{foreach item=link from=$block.links}>
+    <a class="menuMain" href="<{$block.mod_url}>/<{$link.href}>"><{$link.title}><{* <{$link.date|ryus_date:"new"}> *}></a>
+  <{/foreach}>
+    </td>
+  </tr>
+</table>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/blocks/tinycontent4_nav_block.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/blocks/tinycontent4_nav_block.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/blocks/tinycontent4_nav_block.html	(revision 405)
@@ -0,0 +1,9 @@
+<table cellspacing="0">
+  <tr>
+    <td id="mainmenu">
+  <{foreach item=link from=$block.links}>
+    <a class="menuMain" href="<{$block.mod_url}>/<{$link.href}>"><{$link.title}><{* <{$link.date|ryus_date:"new"}> *}></a>
+  <{/foreach}>
+    </td>
+  </tr>
+</table>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/blocks/tinycontent5_nav_block.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/blocks/tinycontent5_nav_block.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/blocks/tinycontent5_nav_block.html	(revision 405)
@@ -0,0 +1,9 @@
+<table cellspacing="0">
+  <tr>
+    <td id="mainmenu">
+  <{foreach item=link from=$block.links}>
+    <a class="menuMain" href="<{$block.mod_url}>/<{$link.href}>"><{$link.title}><{* <{$link.date|ryus_date:"new"}> *}></a>
+  <{/foreach}>
+    </td>
+  </tr>
+</table>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/blocks/tinycontent6_nav_block.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/blocks/tinycontent6_nav_block.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/blocks/tinycontent6_nav_block.html	(revision 405)
@@ -0,0 +1,9 @@
+<table cellspacing="0">
+  <tr>
+    <td id="mainmenu">
+  <{foreach item=link from=$block.links}>
+    <a class="menuMain" href="<{$block.mod_url}>/<{$link.href}>"><{$link.title}><{* <{$link.date|ryus_date:"new"}> *}></a>
+  <{/foreach}>
+    </td>
+  </tr>
+</table>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/blocks/tinycontent7_nav_block.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/blocks/tinycontent7_nav_block.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/blocks/tinycontent7_nav_block.html	(revision 405)
@@ -0,0 +1,9 @@
+<table cellspacing="0">
+  <tr>
+    <td id="mainmenu">
+  <{foreach item=link from=$block.links}>
+    <a class="menuMain" href="<{$block.mod_url}>/<{$link.href}>"><{$link.title}><{* <{$link.date|ryus_date:"new"}> *}></a>
+  <{/foreach}>
+    </td>
+  </tr>
+</table>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent0_print.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent0_print.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent0_print.html	(revision 405)
@@ -0,0 +1,54 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=<{$charset}>" />
+    <title><{$sitename}></title>
+    <meta name="COPYRIGHT" content="Copyright (c) 2004 by <{$sitename}>" />
+    <meta name="GENERATOR" content="TinyContent-Duplicatable with XOOPS" />
+    <style><!--
+	table.outer {
+		border-collapse: collapse; border: 1px solid black;
+	}
+	.head {
+		padding: 3px; border: 1px black solid;
+	}
+	.even {
+		padding: 3px; border: 1px black solid;
+	}
+	.odd {
+		padding: 3px; border: 1px black solid;
+	}
+	table td {
+		vertical-align: top;
+	}
+	a {
+		text-decoration: none;
+	}
+    --></style>
+  </head>
+  <body bgcolor="#ffffff" text="#000000" onload="window.print()">
+    <table border="0" style="font: 12px;"><tr><td>
+      <table border="0" width="640" cellpadding="0" cellspacing="1" bgcolor="#000000"><tr><td>
+        <table border="0" width="640" cellpadding="20" cellspacing="1" bgcolor="#ffffff">
+          <tr>
+            <td align="center">
+              <img src="<{$xoops_url}>/images/logo.gif" border="0" alt="" /><br />
+              <h3><{$title}></h3>
+            </td>
+          </tr>
+          <tr valign="top">
+            <td>
+              <{$content}>
+            </td>
+          </tr>
+        </table>
+      </td></tr></table>
+      <br />
+      <br />
+      <hr />
+      <br />
+      <{$lang_comesfrom}> &nbsp; <a href="<{$site_url}>/"><{$site_url}></a><br />
+      <{$lang_contentfrom}> &nbsp; <a href="<{$content_url}>"><{$content_url}></a>
+    </td></tr></table>
+  </body>
+</html>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent1_print.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent1_print.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent1_print.html	(revision 405)
@@ -0,0 +1,54 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=<{$charset}>" />
+    <title><{$sitename}></title>
+    <meta name="COPYRIGHT" content="Copyright (c) 2004 by <{$sitename}>" />
+    <meta name="GENERATOR" content="TinyContent-Duplicatable with XOOPS" />
+    <style><!--
+	table.outer {
+		border-collapse: collapse; border: 1px solid black;
+	}
+	.head {
+		padding: 3px; border: 1px black solid;
+	}
+	.even {
+		padding: 3px; border: 1px black solid;
+	}
+	.odd {
+		padding: 3px; border: 1px black solid;
+	}
+	table td {
+		vertical-align: top;
+	}
+	a {
+		text-decoration: none;
+	}
+    --></style>
+  </head>
+  <body bgcolor="#ffffff" text="#000000" onload="window.print()">
+    <table border="0" style="font: 12px;"><tr><td>
+      <table border="0" width="640" cellpadding="0" cellspacing="1" bgcolor="#000000"><tr><td>
+        <table border="0" width="640" cellpadding="20" cellspacing="1" bgcolor="#ffffff">
+          <tr>
+            <td align="center">
+              <img src="<{$xoops_url}>/images/logo.gif" border="0" alt="" /><br />
+              <h3><{$title}></h3>
+            </td>
+          </tr>
+          <tr valign="top">
+            <td>
+              <{$content}>
+            </td>
+          </tr>
+        </table>
+      </td></tr></table>
+      <br />
+      <br />
+      <hr />
+      <br />
+      <{$lang_comesfrom}> &nbsp; <a href="<{$site_url}>/"><{$site_url}></a><br />
+      <{$lang_contentfrom}> &nbsp; <a href="<{$content_url}>"><{$content_url}></a>
+    </td></tr></table>
+  </body>
+</html>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent2_print.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent2_print.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent2_print.html	(revision 405)
@@ -0,0 +1,54 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=<{$charset}>" />
+    <title><{$sitename}></title>
+    <meta name="COPYRIGHT" content="Copyright (c) 2004 by <{$sitename}>" />
+    <meta name="GENERATOR" content="TinyContent-Duplicatable with XOOPS" />
+    <style><!--
+	table.outer {
+		border-collapse: collapse; border: 1px solid black;
+	}
+	.head {
+		padding: 3px; border: 1px black solid;
+	}
+	.even {
+		padding: 3px; border: 1px black solid;
+	}
+	.odd {
+		padding: 3px; border: 1px black solid;
+	}
+	table td {
+		vertical-align: top;
+	}
+	a {
+		text-decoration: none;
+	}
+    --></style>
+  </head>
+  <body bgcolor="#ffffff" text="#000000" onload="window.print()">
+    <table border="0" style="font: 12px;"><tr><td>
+      <table border="0" width="640" cellpadding="0" cellspacing="1" bgcolor="#000000"><tr><td>
+        <table border="0" width="640" cellpadding="20" cellspacing="1" bgcolor="#ffffff">
+          <tr>
+            <td align="center">
+              <img src="<{$xoops_url}>/images/logo.gif" border="0" alt="" /><br />
+              <h3><{$title}></h3>
+            </td>
+          </tr>
+          <tr valign="top">
+            <td>
+              <{$content}>
+            </td>
+          </tr>
+        </table>
+      </td></tr></table>
+      <br />
+      <br />
+      <hr />
+      <br />
+      <{$lang_comesfrom}> &nbsp; <a href="<{$site_url}>/"><{$site_url}></a><br />
+      <{$lang_contentfrom}> &nbsp; <a href="<{$content_url}>"><{$content_url}></a>
+    </td></tr></table>
+  </body>
+</html>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent3_print.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent3_print.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent3_print.html	(revision 405)
@@ -0,0 +1,54 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=<{$charset}>" />
+    <title><{$sitename}></title>
+    <meta name="COPYRIGHT" content="Copyright (c) 2004 by <{$sitename}>" />
+    <meta name="GENERATOR" content="TinyContent-Duplicatable with XOOPS" />
+    <style><!--
+	table.outer {
+		border-collapse: collapse; border: 1px solid black;
+	}
+	.head {
+		padding: 3px; border: 1px black solid;
+	}
+	.even {
+		padding: 3px; border: 1px black solid;
+	}
+	.odd {
+		padding: 3px; border: 1px black solid;
+	}
+	table td {
+		vertical-align: top;
+	}
+	a {
+		text-decoration: none;
+	}
+    --></style>
+  </head>
+  <body bgcolor="#ffffff" text="#000000" onload="window.print()">
+    <table border="0" style="font: 12px;"><tr><td>
+      <table border="0" width="640" cellpadding="0" cellspacing="1" bgcolor="#000000"><tr><td>
+        <table border="0" width="640" cellpadding="20" cellspacing="1" bgcolor="#ffffff">
+          <tr>
+            <td align="center">
+              <img src="<{$xoops_url}>/images/logo.gif" border="0" alt="" /><br />
+              <h3><{$title}></h3>
+            </td>
+          </tr>
+          <tr valign="top">
+            <td>
+              <{$content}>
+            </td>
+          </tr>
+        </table>
+      </td></tr></table>
+      <br />
+      <br />
+      <hr />
+      <br />
+      <{$lang_comesfrom}> &nbsp; <a href="<{$site_url}>/"><{$site_url}></a><br />
+      <{$lang_contentfrom}> &nbsp; <a href="<{$content_url}>"><{$content_url}></a>
+    </td></tr></table>
+  </body>
+</html>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent4_print.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent4_print.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent4_print.html	(revision 405)
@@ -0,0 +1,54 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=<{$charset}>" />
+    <title><{$sitename}></title>
+    <meta name="COPYRIGHT" content="Copyright (c) 2004 by <{$sitename}>" />
+    <meta name="GENERATOR" content="TinyContent-Duplicatable with XOOPS" />
+    <style><!--
+	table.outer {
+		border-collapse: collapse; border: 1px solid black;
+	}
+	.head {
+		padding: 3px; border: 1px black solid;
+	}
+	.even {
+		padding: 3px; border: 1px black solid;
+	}
+	.odd {
+		padding: 3px; border: 1px black solid;
+	}
+	table td {
+		vertical-align: top;
+	}
+	a {
+		text-decoration: none;
+	}
+    --></style>
+  </head>
+  <body bgcolor="#ffffff" text="#000000" onload="window.print()">
+    <table border="0" style="font: 12px;"><tr><td>
+      <table border="0" width="640" cellpadding="0" cellspacing="1" bgcolor="#000000"><tr><td>
+        <table border="0" width="640" cellpadding="20" cellspacing="1" bgcolor="#ffffff">
+          <tr>
+            <td align="center">
+              <img src="<{$xoops_url}>/images/logo.gif" border="0" alt="" /><br />
+              <h3><{$title}></h3>
+            </td>
+          </tr>
+          <tr valign="top">
+            <td>
+              <{$content}>
+            </td>
+          </tr>
+        </table>
+      </td></tr></table>
+      <br />
+      <br />
+      <hr />
+      <br />
+      <{$lang_comesfrom}> &nbsp; <a href="<{$site_url}>/"><{$site_url}></a><br />
+      <{$lang_contentfrom}> &nbsp; <a href="<{$content_url}>"><{$content_url}></a>
+    </td></tr></table>
+  </body>
+</html>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent5_print.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent5_print.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent5_print.html	(revision 405)
@@ -0,0 +1,54 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=<{$charset}>" />
+    <title><{$sitename}></title>
+    <meta name="COPYRIGHT" content="Copyright (c) 2004 by <{$sitename}>" />
+    <meta name="GENERATOR" content="TinyContent-Duplicatable with XOOPS" />
+    <style><!--
+	table.outer {
+		border-collapse: collapse; border: 1px solid black;
+	}
+	.head {
+		padding: 3px; border: 1px black solid;
+	}
+	.even {
+		padding: 3px; border: 1px black solid;
+	}
+	.odd {
+		padding: 3px; border: 1px black solid;
+	}
+	table td {
+		vertical-align: top;
+	}
+	a {
+		text-decoration: none;
+	}
+    --></style>
+  </head>
+  <body bgcolor="#ffffff" text="#000000" onload="window.print()">
+    <table border="0" style="font: 12px;"><tr><td>
+      <table border="0" width="640" cellpadding="0" cellspacing="1" bgcolor="#000000"><tr><td>
+        <table border="0" width="640" cellpadding="20" cellspacing="1" bgcolor="#ffffff">
+          <tr>
+            <td align="center">
+              <img src="<{$xoops_url}>/images/logo.gif" border="0" alt="" /><br />
+              <h3><{$title}></h3>
+            </td>
+          </tr>
+          <tr valign="top">
+            <td>
+              <{$content}>
+            </td>
+          </tr>
+        </table>
+      </td></tr></table>
+      <br />
+      <br />
+      <hr />
+      <br />
+      <{$lang_comesfrom}> &nbsp; <a href="<{$site_url}>/"><{$site_url}></a><br />
+      <{$lang_contentfrom}> &nbsp; <a href="<{$content_url}>"><{$content_url}></a>
+    </td></tr></table>
+  </body>
+</html>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent6_print.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent6_print.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent6_print.html	(revision 405)
@@ -0,0 +1,54 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=<{$charset}>" />
+    <title><{$sitename}></title>
+    <meta name="COPYRIGHT" content="Copyright (c) 2004 by <{$sitename}>" />
+    <meta name="GENERATOR" content="TinyContent-Duplicatable with XOOPS" />
+    <style><!--
+	table.outer {
+		border-collapse: collapse; border: 1px solid black;
+	}
+	.head {
+		padding: 3px; border: 1px black solid;
+	}
+	.even {
+		padding: 3px; border: 1px black solid;
+	}
+	.odd {
+		padding: 3px; border: 1px black solid;
+	}
+	table td {
+		vertical-align: top;
+	}
+	a {
+		text-decoration: none;
+	}
+    --></style>
+  </head>
+  <body bgcolor="#ffffff" text="#000000" onload="window.print()">
+    <table border="0" style="font: 12px;"><tr><td>
+      <table border="0" width="640" cellpadding="0" cellspacing="1" bgcolor="#000000"><tr><td>
+        <table border="0" width="640" cellpadding="20" cellspacing="1" bgcolor="#ffffff">
+          <tr>
+            <td align="center">
+              <img src="<{$xoops_url}>/images/logo.gif" border="0" alt="" /><br />
+              <h3><{$title}></h3>
+            </td>
+          </tr>
+          <tr valign="top">
+            <td>
+              <{$content}>
+            </td>
+          </tr>
+        </table>
+      </td></tr></table>
+      <br />
+      <br />
+      <hr />
+      <br />
+      <{$lang_comesfrom}> &nbsp; <a href="<{$site_url}>/"><{$site_url}></a><br />
+      <{$lang_contentfrom}> &nbsp; <a href="<{$content_url}>"><{$content_url}></a>
+    </td></tr></table>
+  </body>
+</html>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent7_print.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent7_print.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent7_print.html	(revision 405)
@@ -0,0 +1,54 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=<{$charset}>" />
+    <title><{$sitename}></title>
+    <meta name="COPYRIGHT" content="Copyright (c) 2004 by <{$sitename}>" />
+    <meta name="GENERATOR" content="TinyContent-Duplicatable with XOOPS" />
+    <style><!--
+	table.outer {
+		border-collapse: collapse; border: 1px solid black;
+	}
+	.head {
+		padding: 3px; border: 1px black solid;
+	}
+	.even {
+		padding: 3px; border: 1px black solid;
+	}
+	.odd {
+		padding: 3px; border: 1px black solid;
+	}
+	table td {
+		vertical-align: top;
+	}
+	a {
+		text-decoration: none;
+	}
+    --></style>
+  </head>
+  <body bgcolor="#ffffff" text="#000000" onload="window.print()">
+    <table border="0" style="font: 12px;"><tr><td>
+      <table border="0" width="640" cellpadding="0" cellspacing="1" bgcolor="#000000"><tr><td>
+        <table border="0" width="640" cellpadding="20" cellspacing="1" bgcolor="#ffffff">
+          <tr>
+            <td align="center">
+              <img src="<{$xoops_url}>/images/logo.gif" border="0" alt="" /><br />
+              <h3><{$title}></h3>
+            </td>
+          </tr>
+          <tr valign="top">
+            <td>
+              <{$content}>
+            </td>
+          </tr>
+        </table>
+      </td></tr></table>
+      <br />
+      <br />
+      <hr />
+      <br />
+      <{$lang_comesfrom}> &nbsp; <a href="<{$site_url}>/"><{$site_url}></a><br />
+      <{$lang_contentfrom}> &nbsp; <a href="<{$content_url}>"><{$content_url}></a>
+    </td></tr></table>
+  </body>
+</html>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent8_print.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent8_print.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent8_print.html	(revision 405)
@@ -0,0 +1,54 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=<{$charset}>" />
+    <title><{$sitename}></title>
+    <meta name="COPYRIGHT" content="Copyright (c) 2004 by <{$sitename}>" />
+    <meta name="GENERATOR" content="TinyContent-Duplicatable with XOOPS" />
+    <style><!--
+	table.outer {
+		border-collapse: collapse; border: 1px solid black;
+	}
+	.head {
+		padding: 3px; border: 1px black solid;
+	}
+	.even {
+		padding: 3px; border: 1px black solid;
+	}
+	.odd {
+		padding: 3px; border: 1px black solid;
+	}
+	table td {
+		vertical-align: top;
+	}
+	a {
+		text-decoration: none;
+	}
+    --></style>
+  </head>
+  <body bgcolor="#ffffff" text="#000000" onload="window.print()">
+    <table border="0" style="font: 12px;"><tr><td>
+      <table border="0" width="640" cellpadding="0" cellspacing="1" bgcolor="#000000"><tr><td>
+        <table border="0" width="640" cellpadding="20" cellspacing="1" bgcolor="#ffffff">
+          <tr>
+            <td align="center">
+              <img src="<{$xoops_url}>/images/logo.gif" border="0" alt="" /><br />
+              <h3><{$title}></h3>
+            </td>
+          </tr>
+          <tr valign="top">
+            <td>
+              <{$content}>
+            </td>
+          </tr>
+        </table>
+      </td></tr></table>
+      <br />
+      <br />
+      <hr />
+      <br />
+      <{$lang_comesfrom}> &nbsp; <a href="<{$site_url}>/"><{$site_url}></a><br />
+      <{$lang_contentfrom}> &nbsp; <a href="<{$content_url}>"><{$content_url}></a>
+    </td></tr></table>
+  </body>
+</html>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent9_print.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent9_print.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent9_print.html	(revision 405)
@@ -0,0 +1,54 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=<{$charset}>" />
+    <title><{$sitename}></title>
+    <meta name="COPYRIGHT" content="Copyright (c) 2004 by <{$sitename}>" />
+    <meta name="GENERATOR" content="TinyContent-Duplicatable with XOOPS" />
+    <style><!--
+	table.outer {
+		border-collapse: collapse; border: 1px solid black;
+	}
+	.head {
+		padding: 3px; border: 1px black solid;
+	}
+	.even {
+		padding: 3px; border: 1px black solid;
+	}
+	.odd {
+		padding: 3px; border: 1px black solid;
+	}
+	table td {
+		vertical-align: top;
+	}
+	a {
+		text-decoration: none;
+	}
+    --></style>
+  </head>
+  <body bgcolor="#ffffff" text="#000000" onload="window.print()">
+    <table border="0" style="font: 12px;"><tr><td>
+      <table border="0" width="640" cellpadding="0" cellspacing="1" bgcolor="#000000"><tr><td>
+        <table border="0" width="640" cellpadding="20" cellspacing="1" bgcolor="#ffffff">
+          <tr>
+            <td align="center">
+              <img src="<{$xoops_url}>/images/logo.gif" border="0" alt="" /><br />
+              <h3><{$title}></h3>
+            </td>
+          </tr>
+          <tr valign="top">
+            <td>
+              <{$content}>
+            </td>
+          </tr>
+        </table>
+      </td></tr></table>
+      <br />
+      <br />
+      <hr />
+      <br />
+      <{$lang_comesfrom}> &nbsp; <a href="<{$site_url}>/"><{$site_url}></a><br />
+      <{$lang_contentfrom}> &nbsp; <a href="<{$content_url}>"><{$content_url}></a>
+    </td></tr></table>
+  </body>
+</html>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent0_index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent0_index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent0_index.html	(revision 405)
@@ -0,0 +1,60 @@
+<{$content}>
+
+<{* A sample displaying Last Modified *}>
+<{* Last Modified:<{$last_modified|date_format:"%Y-%m-%d"}> *}>
+
+<{* A sample displaying Edit link only for system admin *}>
+<{* <{if $xoops_isadmin == 1 }><a href="<{$mod_url}>/admin/index.php?op=edit&amp;id=<{$id}>">[Edit]</a><{/if}> *}>
+<{* If you turn this on, disable this module's cache *}>
+
+<{if $is_display_print_icon }>
+	<div style="float:right;width:40px;height:40px;"><a href="<{$mod_url}>/print.php?id=<{$id}>"><img src="<{$mod_url}>/images/print.gif" border="0" alt="<{$lang_printerpage}>" /></a></div>
+<{/if}>
+<{if $is_display_friend_icon }>
+	<div style="float:right;width:40px;height:40px;"><a href="<{$mail_link}>" target="_top"><img src="<{$mod_url}>/images/friend.gif" border="0" alt="<{$lang_sendstory}>" /></a></div>
+<{/if}>
+
+<{if $is_display_pagenav }>
+<hr style="clear:right;" />
+
+<table width="100%" border="0" cellpadding="0" cellspacing="0">
+<tr>
+	<td width="33%" align="left" valign="top">
+	<{if $prev_link }>
+		<a href="<{$vmod_url}>/<{$prev_link}>" accesskey="P"><{$lang_prevpage}></a><br />
+	<{$prev_title}>
+	<{/if}>
+	</td>
+	<td width="34%" align="center" valign="top">
+		<a href="<{$vmod_url}>/<{$top_link}>" accesskey="H"><{$lang_topofcontents}></a>
+	</td>
+	<td width="33%" align="right" valign="top">
+	<{if $next_link }>
+		<a href="<{$vmod_url}>/<{$next_link}>" accesskey="N"><{$lang_nextpage}></a><br />
+	<{$next_title}>
+	<{/if}>
+	</td>
+</tr>
+</table>
+<{/if}>
+
+
+<{if $nocomments == 0}>
+<br /><br />
+<div style="text-align: center; padding: 3px; margin: 3px;">
+  <{$commentsnav}>
+  <{$lang_notice}>
+</div>
+
+<div style="margin: 3px; padding: 3px;">
+<!-- start comments loop -->
+<{if $comment_mode == "flat"}>
+  <{include file="db:system_comments_flat.html"}>
+<{elseif $comment_mode == "thread"}>
+  <{include file="db:system_comments_thread.html"}>
+<{elseif $comment_mode == "nest"}>
+  <{include file="db:system_comments_nest.html"}>
+<{/if}>
+<!-- end comments loop -->
+</div>
+<{/if}>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent1_index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent1_index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent1_index.html	(revision 405)
@@ -0,0 +1,60 @@
+<{$content}>
+
+<{* A sample displaying Last Modified *}>
+<{* Last Modified:<{$last_modified|date_format:"%Y-%m-%d"}> *}>
+
+<{* A sample displaying Edit link only for system admin *}>
+<{* <{if $xoops_isadmin == 1 }><a href="<{$mod_url}>/admin/index.php?op=edit&amp;id=<{$id}>">[Edit]</a><{/if}> *}>
+<{* If you turn this on, disable this module's cache *}>
+
+<{if $is_display_print_icon }>
+	<div style="float:right;width:40px;height:40px;"><a href="<{$mod_url}>/print.php?id=<{$id}>"><img src="<{$mod_url}>/images/print.gif" border="0" alt="<{$lang_printerpage}>" /></a></div>
+<{/if}>
+<{if $is_display_friend_icon }>
+	<div style="float:right;width:40px;height:40px;"><a href="<{$mail_link}>" target="_top"><img src="<{$mod_url}>/images/friend.gif" border="0" alt="<{$lang_sendstory}>" /></a></div>
+<{/if}>
+
+<{if $is_display_pagenav }>
+<hr style="clear:right;" />
+
+<table width="100%" border="0" cellpadding="0" cellspacing="0">
+<tr>
+	<td width="33%" align="left" valign="top">
+	<{if $prev_link }>
+		<a href="<{$vmod_url}>/<{$prev_link}>" accesskey="P"><{$lang_prevpage}></a><br />
+	<{$prev_title}>
+	<{/if}>
+	</td>
+	<td width="34%" align="center" valign="top">
+		<a href="<{$vmod_url}>/<{$top_link}>" accesskey="H"><{$lang_topofcontents}></a>
+	</td>
+	<td width="33%" align="right" valign="top">
+	<{if $next_link }>
+		<a href="<{$vmod_url}>/<{$next_link}>" accesskey="N"><{$lang_nextpage}></a><br />
+	<{$next_title}>
+	<{/if}>
+	</td>
+</tr>
+</table>
+<{/if}>
+
+
+<{if $nocomments == 0}>
+<br /><br />
+<div style="text-align: center; padding: 3px; margin: 3px;">
+  <{$commentsnav}>
+  <{$lang_notice}>
+</div>
+
+<div style="margin: 3px; padding: 3px;">
+<!-- start comments loop -->
+<{if $comment_mode == "flat"}>
+  <{include file="db:system_comments_flat.html"}>
+<{elseif $comment_mode == "thread"}>
+  <{include file="db:system_comments_thread.html"}>
+<{elseif $comment_mode == "nest"}>
+  <{include file="db:system_comments_nest.html"}>
+<{/if}>
+<!-- end comments loop -->
+</div>
+<{/if}>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent2_index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent2_index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent2_index.html	(revision 405)
@@ -0,0 +1,60 @@
+<{$content}>
+
+<{* A sample displaying Last Modified *}>
+<{* Last Modified:<{$last_modified|date_format:"%Y-%m-%d"}> *}>
+
+<{* A sample displaying Edit link only for system admin *}>
+<{* <{if $xoops_isadmin == 1 }><a href="<{$mod_url}>/admin/index.php?op=edit&amp;id=<{$id}>">[Edit]</a><{/if}> *}>
+<{* If you turn this on, disable this module's cache *}>
+
+<{if $is_display_print_icon }>
+	<div style="float:right;width:40px;height:40px;"><a href="<{$mod_url}>/print.php?id=<{$id}>"><img src="<{$mod_url}>/images/print.gif" border="0" alt="<{$lang_printerpage}>" /></a></div>
+<{/if}>
+<{if $is_display_friend_icon }>
+	<div style="float:right;width:40px;height:40px;"><a href="<{$mail_link}>" target="_top"><img src="<{$mod_url}>/images/friend.gif" border="0" alt="<{$lang_sendstory}>" /></a></div>
+<{/if}>
+
+<{if $is_display_pagenav }>
+<hr style="clear:right;" />
+
+<table width="100%" border="0" cellpadding="0" cellspacing="0">
+<tr>
+	<td width="33%" align="left" valign="top">
+	<{if $prev_link }>
+		<a href="<{$vmod_url}>/<{$prev_link}>" accesskey="P"><{$lang_prevpage}></a><br />
+	<{$prev_title}>
+	<{/if}>
+	</td>
+	<td width="34%" align="center" valign="top">
+		<a href="<{$vmod_url}>/<{$top_link}>" accesskey="H"><{$lang_topofcontents}></a>
+	</td>
+	<td width="33%" align="right" valign="top">
+	<{if $next_link }>
+		<a href="<{$vmod_url}>/<{$next_link}>" accesskey="N"><{$lang_nextpage}></a><br />
+	<{$next_title}>
+	<{/if}>
+	</td>
+</tr>
+</table>
+<{/if}>
+
+
+<{if $nocomments == 0}>
+<br /><br />
+<div style="text-align: center; padding: 3px; margin: 3px;">
+  <{$commentsnav}>
+  <{$lang_notice}>
+</div>
+
+<div style="margin: 3px; padding: 3px;">
+<!-- start comments loop -->
+<{if $comment_mode == "flat"}>
+  <{include file="db:system_comments_flat.html"}>
+<{elseif $comment_mode == "thread"}>
+  <{include file="db:system_comments_thread.html"}>
+<{elseif $comment_mode == "nest"}>
+  <{include file="db:system_comments_nest.html"}>
+<{/if}>
+<!-- end comments loop -->
+</div>
+<{/if}>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent3_index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent3_index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent3_index.html	(revision 405)
@@ -0,0 +1,60 @@
+<{$content}>
+
+<{* A sample displaying Last Modified *}>
+<{* Last Modified:<{$last_modified|date_format:"%Y-%m-%d"}> *}>
+
+<{* A sample displaying Edit link only for system admin *}>
+<{* <{if $xoops_isadmin == 1 }><a href="<{$mod_url}>/admin/index.php?op=edit&amp;id=<{$id}>">[Edit]</a><{/if}> *}>
+<{* If you turn this on, disable this module's cache *}>
+
+<{if $is_display_print_icon }>
+	<div style="float:right;width:40px;height:40px;"><a href="<{$mod_url}>/print.php?id=<{$id}>"><img src="<{$mod_url}>/images/print.gif" border="0" alt="<{$lang_printerpage}>" /></a></div>
+<{/if}>
+<{if $is_display_friend_icon }>
+	<div style="float:right;width:40px;height:40px;"><a href="<{$mail_link}>" target="_top"><img src="<{$mod_url}>/images/friend.gif" border="0" alt="<{$lang_sendstory}>" /></a></div>
+<{/if}>
+
+<{if $is_display_pagenav }>
+<hr style="clear:right;" />
+
+<table width="100%" border="0" cellpadding="0" cellspacing="0">
+<tr>
+	<td width="33%" align="left" valign="top">
+	<{if $prev_link }>
+		<a href="<{$vmod_url}>/<{$prev_link}>" accesskey="P"><{$lang_prevpage}></a><br />
+	<{$prev_title}>
+	<{/if}>
+	</td>
+	<td width="34%" align="center" valign="top">
+		<a href="<{$vmod_url}>/<{$top_link}>" accesskey="H"><{$lang_topofcontents}></a>
+	</td>
+	<td width="33%" align="right" valign="top">
+	<{if $next_link }>
+		<a href="<{$vmod_url}>/<{$next_link}>" accesskey="N"><{$lang_nextpage}></a><br />
+	<{$next_title}>
+	<{/if}>
+	</td>
+</tr>
+</table>
+<{/if}>
+
+
+<{if $nocomments == 0}>
+<br /><br />
+<div style="text-align: center; padding: 3px; margin: 3px;">
+  <{$commentsnav}>
+  <{$lang_notice}>
+</div>
+
+<div style="margin: 3px; padding: 3px;">
+<!-- start comments loop -->
+<{if $comment_mode == "flat"}>
+  <{include file="db:system_comments_flat.html"}>
+<{elseif $comment_mode == "thread"}>
+  <{include file="db:system_comments_thread.html"}>
+<{elseif $comment_mode == "nest"}>
+  <{include file="db:system_comments_nest.html"}>
+<{/if}>
+<!-- end comments loop -->
+</div>
+<{/if}>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent4_index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent4_index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent4_index.html	(revision 405)
@@ -0,0 +1,60 @@
+<{$content}>
+
+<{* A sample displaying Last Modified *}>
+<{* Last Modified:<{$last_modified|date_format:"%Y-%m-%d"}> *}>
+
+<{* A sample displaying Edit link only for system admin *}>
+<{* <{if $xoops_isadmin == 1 }><a href="<{$mod_url}>/admin/index.php?op=edit&amp;id=<{$id}>">[Edit]</a><{/if}> *}>
+<{* If you turn this on, disable this module's cache *}>
+
+<{if $is_display_print_icon }>
+	<div style="float:right;width:40px;height:40px;"><a href="<{$mod_url}>/print.php?id=<{$id}>"><img src="<{$mod_url}>/images/print.gif" border="0" alt="<{$lang_printerpage}>" /></a></div>
+<{/if}>
+<{if $is_display_friend_icon }>
+	<div style="float:right;width:40px;height:40px;"><a href="<{$mail_link}>" target="_top"><img src="<{$mod_url}>/images/friend.gif" border="0" alt="<{$lang_sendstory}>" /></a></div>
+<{/if}>
+
+<{if $is_display_pagenav }>
+<hr style="clear:right;" />
+
+<table width="100%" border="0" cellpadding="0" cellspacing="0">
+<tr>
+	<td width="33%" align="left" valign="top">
+	<{if $prev_link }>
+		<a href="<{$vmod_url}>/<{$prev_link}>" accesskey="P"><{$lang_prevpage}></a><br />
+	<{$prev_title}>
+	<{/if}>
+	</td>
+	<td width="34%" align="center" valign="top">
+		<a href="<{$vmod_url}>/<{$top_link}>" accesskey="H"><{$lang_topofcontents}></a>
+	</td>
+	<td width="33%" align="right" valign="top">
+	<{if $next_link }>
+		<a href="<{$vmod_url}>/<{$next_link}>" accesskey="N"><{$lang_nextpage}></a><br />
+	<{$next_title}>
+	<{/if}>
+	</td>
+</tr>
+</table>
+<{/if}>
+
+
+<{if $nocomments == 0}>
+<br /><br />
+<div style="text-align: center; padding: 3px; margin: 3px;">
+  <{$commentsnav}>
+  <{$lang_notice}>
+</div>
+
+<div style="margin: 3px; padding: 3px;">
+<!-- start comments loop -->
+<{if $comment_mode == "flat"}>
+  <{include file="db:system_comments_flat.html"}>
+<{elseif $comment_mode == "thread"}>
+  <{include file="db:system_comments_thread.html"}>
+<{elseif $comment_mode == "nest"}>
+  <{include file="db:system_comments_nest.html"}>
+<{/if}>
+<!-- end comments loop -->
+</div>
+<{/if}>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent_print.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent_print.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent_print.html	(revision 405)
@@ -0,0 +1,54 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=<{$charset}>" />
+    <title><{$sitename}></title>
+    <meta name="COPYRIGHT" content="Copyright (c) 2004 by <{$sitename}>" />
+    <meta name="GENERATOR" content="TinyContent-Duplicatable with XOOPS" />
+    <style><!--
+	table.outer {
+		border-collapse: collapse; border: 1px solid black;
+	}
+	.head {
+		padding: 3px; border: 1px black solid;
+	}
+	.even {
+		padding: 3px; border: 1px black solid;
+	}
+	.odd {
+		padding: 3px; border: 1px black solid;
+	}
+	table td {
+		vertical-align: top;
+	}
+	a {
+		text-decoration: none;
+	}
+    --></style>
+  </head>
+  <body bgcolor="#ffffff" text="#000000" onload="window.print()">
+    <table border="0" style="font: 12px;"><tr><td>
+      <table border="0" width="640" cellpadding="0" cellspacing="1" bgcolor="#000000"><tr><td>
+        <table border="0" width="640" cellpadding="20" cellspacing="1" bgcolor="#ffffff">
+          <tr>
+            <td align="center">
+              <img src="<{$xoops_url}>/images/logo.gif" border="0" alt="" /><br />
+              <h3><{$title}></h3>
+            </td>
+          </tr>
+          <tr valign="top">
+            <td>
+              <{$content}>
+            </td>
+          </tr>
+        </table>
+      </td></tr></table>
+      <br />
+      <br />
+      <hr />
+      <br />
+      <{$lang_comesfrom}> &nbsp; <a href="<{$site_url}>/"><{$site_url}></a><br />
+      <{$lang_contentfrom}> &nbsp; <a href="<{$content_url}>"><{$content_url}></a>
+    </td></tr></table>
+  </body>
+</html>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent5_index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent5_index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent5_index.html	(revision 405)
@@ -0,0 +1,60 @@
+<{$content}>
+
+<{* A sample displaying Last Modified *}>
+<{* Last Modified:<{$last_modified|date_format:"%Y-%m-%d"}> *}>
+
+<{* A sample displaying Edit link only for system admin *}>
+<{* <{if $xoops_isadmin == 1 }><a href="<{$mod_url}>/admin/index.php?op=edit&amp;id=<{$id}>">[Edit]</a><{/if}> *}>
+<{* If you turn this on, disable this module's cache *}>
+
+<{if $is_display_print_icon }>
+	<div style="float:right;width:40px;height:40px;"><a href="<{$mod_url}>/print.php?id=<{$id}>"><img src="<{$mod_url}>/images/print.gif" border="0" alt="<{$lang_printerpage}>" /></a></div>
+<{/if}>
+<{if $is_display_friend_icon }>
+	<div style="float:right;width:40px;height:40px;"><a href="<{$mail_link}>" target="_top"><img src="<{$mod_url}>/images/friend.gif" border="0" alt="<{$lang_sendstory}>" /></a></div>
+<{/if}>
+
+<{if $is_display_pagenav }>
+<hr style="clear:right;" />
+
+<table width="100%" border="0" cellpadding="0" cellspacing="0">
+<tr>
+	<td width="33%" align="left" valign="top">
+	<{if $prev_link }>
+		<a href="<{$vmod_url}>/<{$prev_link}>" accesskey="P"><{$lang_prevpage}></a><br />
+	<{$prev_title}>
+	<{/if}>
+	</td>
+	<td width="34%" align="center" valign="top">
+		<a href="<{$vmod_url}>/<{$top_link}>" accesskey="H"><{$lang_topofcontents}></a>
+	</td>
+	<td width="33%" align="right" valign="top">
+	<{if $next_link }>
+		<a href="<{$vmod_url}>/<{$next_link}>" accesskey="N"><{$lang_nextpage}></a><br />
+	<{$next_title}>
+	<{/if}>
+	</td>
+</tr>
+</table>
+<{/if}>
+
+
+<{if $nocomments == 0}>
+<br /><br />
+<div style="text-align: center; padding: 3px; margin: 3px;">
+  <{$commentsnav}>
+  <{$lang_notice}>
+</div>
+
+<div style="margin: 3px; padding: 3px;">
+<!-- start comments loop -->
+<{if $comment_mode == "flat"}>
+  <{include file="db:system_comments_flat.html"}>
+<{elseif $comment_mode == "thread"}>
+  <{include file="db:system_comments_thread.html"}>
+<{elseif $comment_mode == "nest"}>
+  <{include file="db:system_comments_nest.html"}>
+<{/if}>
+<!-- end comments loop -->
+</div>
+<{/if}>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent6_index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent6_index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent6_index.html	(revision 405)
@@ -0,0 +1,60 @@
+<{$content}>
+
+<{* A sample displaying Last Modified *}>
+<{* Last Modified:<{$last_modified|date_format:"%Y-%m-%d"}> *}>
+
+<{* A sample displaying Edit link only for system admin *}>
+<{* <{if $xoops_isadmin == 1 }><a href="<{$mod_url}>/admin/index.php?op=edit&amp;id=<{$id}>">[Edit]</a><{/if}> *}>
+<{* If you turn this on, disable this module's cache *}>
+
+<{if $is_display_print_icon }>
+	<div style="float:right;width:40px;height:40px;"><a href="<{$mod_url}>/print.php?id=<{$id}>"><img src="<{$mod_url}>/images/print.gif" border="0" alt="<{$lang_printerpage}>" /></a></div>
+<{/if}>
+<{if $is_display_friend_icon }>
+	<div style="float:right;width:40px;height:40px;"><a href="<{$mail_link}>" target="_top"><img src="<{$mod_url}>/images/friend.gif" border="0" alt="<{$lang_sendstory}>" /></a></div>
+<{/if}>
+
+<{if $is_display_pagenav }>
+<hr style="clear:right;" />
+
+<table width="100%" border="0" cellpadding="0" cellspacing="0">
+<tr>
+	<td width="33%" align="left" valign="top">
+	<{if $prev_link }>
+		<a href="<{$vmod_url}>/<{$prev_link}>" accesskey="P"><{$lang_prevpage}></a><br />
+	<{$prev_title}>
+	<{/if}>
+	</td>
+	<td width="34%" align="center" valign="top">
+		<a href="<{$vmod_url}>/<{$top_link}>" accesskey="H"><{$lang_topofcontents}></a>
+	</td>
+	<td width="33%" align="right" valign="top">
+	<{if $next_link }>
+		<a href="<{$vmod_url}>/<{$next_link}>" accesskey="N"><{$lang_nextpage}></a><br />
+	<{$next_title}>
+	<{/if}>
+	</td>
+</tr>
+</table>
+<{/if}>
+
+
+<{if $nocomments == 0}>
+<br /><br />
+<div style="text-align: center; padding: 3px; margin: 3px;">
+  <{$commentsnav}>
+  <{$lang_notice}>
+</div>
+
+<div style="margin: 3px; padding: 3px;">
+<!-- start comments loop -->
+<{if $comment_mode == "flat"}>
+  <{include file="db:system_comments_flat.html"}>
+<{elseif $comment_mode == "thread"}>
+  <{include file="db:system_comments_thread.html"}>
+<{elseif $comment_mode == "nest"}>
+  <{include file="db:system_comments_nest.html"}>
+<{/if}>
+<!-- end comments loop -->
+</div>
+<{/if}>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/mk_templates.sh
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/mk_templates.sh	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/mk_templates.sh	(revision 405)
@@ -0,0 +1,4 @@
+#!/bin/sh
+for file in tinycontent[0-9]_index.html; do cp -a tinycontent_index.html $file; done
+for file in tinycontent[0-9]_print.html; do cp -a tinycontent_print.html $file; done
+for file in blocks/tinycontent[0-9]_nav_block.html; do cp -a blocks/tinycontent_nav_block.html $file; done
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent7_index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent7_index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent7_index.html	(revision 405)
@@ -0,0 +1,60 @@
+<{$content}>
+
+<{* A sample displaying Last Modified *}>
+<{* Last Modified:<{$last_modified|date_format:"%Y-%m-%d"}> *}>
+
+<{* A sample displaying Edit link only for system admin *}>
+<{* <{if $xoops_isadmin == 1 }><a href="<{$mod_url}>/admin/index.php?op=edit&amp;id=<{$id}>">[Edit]</a><{/if}> *}>
+<{* If you turn this on, disable this module's cache *}>
+
+<{if $is_display_print_icon }>
+	<div style="float:right;width:40px;height:40px;"><a href="<{$mod_url}>/print.php?id=<{$id}>"><img src="<{$mod_url}>/images/print.gif" border="0" alt="<{$lang_printerpage}>" /></a></div>
+<{/if}>
+<{if $is_display_friend_icon }>
+	<div style="float:right;width:40px;height:40px;"><a href="<{$mail_link}>" target="_top"><img src="<{$mod_url}>/images/friend.gif" border="0" alt="<{$lang_sendstory}>" /></a></div>
+<{/if}>
+
+<{if $is_display_pagenav }>
+<hr style="clear:right;" />
+
+<table width="100%" border="0" cellpadding="0" cellspacing="0">
+<tr>
+	<td width="33%" align="left" valign="top">
+	<{if $prev_link }>
+		<a href="<{$vmod_url}>/<{$prev_link}>" accesskey="P"><{$lang_prevpage}></a><br />
+	<{$prev_title}>
+	<{/if}>
+	</td>
+	<td width="34%" align="center" valign="top">
+		<a href="<{$vmod_url}>/<{$top_link}>" accesskey="H"><{$lang_topofcontents}></a>
+	</td>
+	<td width="33%" align="right" valign="top">
+	<{if $next_link }>
+		<a href="<{$vmod_url}>/<{$next_link}>" accesskey="N"><{$lang_nextpage}></a><br />
+	<{$next_title}>
+	<{/if}>
+	</td>
+</tr>
+</table>
+<{/if}>
+
+
+<{if $nocomments == 0}>
+<br /><br />
+<div style="text-align: center; padding: 3px; margin: 3px;">
+  <{$commentsnav}>
+  <{$lang_notice}>
+</div>
+
+<div style="margin: 3px; padding: 3px;">
+<!-- start comments loop -->
+<{if $comment_mode == "flat"}>
+  <{include file="db:system_comments_flat.html"}>
+<{elseif $comment_mode == "thread"}>
+  <{include file="db:system_comments_thread.html"}>
+<{elseif $comment_mode == "nest"}>
+  <{include file="db:system_comments_nest.html"}>
+<{/if}>
+<!-- end comments loop -->
+</div>
+<{/if}>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent8_index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent8_index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent8_index.html	(revision 405)
@@ -0,0 +1,60 @@
+<{$content}>
+
+<{* A sample displaying Last Modified *}>
+<{* Last Modified:<{$last_modified|date_format:"%Y-%m-%d"}> *}>
+
+<{* A sample displaying Edit link only for system admin *}>
+<{* <{if $xoops_isadmin == 1 }><a href="<{$mod_url}>/admin/index.php?op=edit&amp;id=<{$id}>">[Edit]</a><{/if}> *}>
+<{* If you turn this on, disable this module's cache *}>
+
+<{if $is_display_print_icon }>
+	<div style="float:right;width:40px;height:40px;"><a href="<{$mod_url}>/print.php?id=<{$id}>"><img src="<{$mod_url}>/images/print.gif" border="0" alt="<{$lang_printerpage}>" /></a></div>
+<{/if}>
+<{if $is_display_friend_icon }>
+	<div style="float:right;width:40px;height:40px;"><a href="<{$mail_link}>" target="_top"><img src="<{$mod_url}>/images/friend.gif" border="0" alt="<{$lang_sendstory}>" /></a></div>
+<{/if}>
+
+<{if $is_display_pagenav }>
+<hr style="clear:right;" />
+
+<table width="100%" border="0" cellpadding="0" cellspacing="0">
+<tr>
+	<td width="33%" align="left" valign="top">
+	<{if $prev_link }>
+		<a href="<{$vmod_url}>/<{$prev_link}>" accesskey="P"><{$lang_prevpage}></a><br />
+	<{$prev_title}>
+	<{/if}>
+	</td>
+	<td width="34%" align="center" valign="top">
+		<a href="<{$vmod_url}>/<{$top_link}>" accesskey="H"><{$lang_topofcontents}></a>
+	</td>
+	<td width="33%" align="right" valign="top">
+	<{if $next_link }>
+		<a href="<{$vmod_url}>/<{$next_link}>" accesskey="N"><{$lang_nextpage}></a><br />
+	<{$next_title}>
+	<{/if}>
+	</td>
+</tr>
+</table>
+<{/if}>
+
+
+<{if $nocomments == 0}>
+<br /><br />
+<div style="text-align: center; padding: 3px; margin: 3px;">
+  <{$commentsnav}>
+  <{$lang_notice}>
+</div>
+
+<div style="margin: 3px; padding: 3px;">
+<!-- start comments loop -->
+<{if $comment_mode == "flat"}>
+  <{include file="db:system_comments_flat.html"}>
+<{elseif $comment_mode == "thread"}>
+  <{include file="db:system_comments_thread.html"}>
+<{elseif $comment_mode == "nest"}>
+  <{include file="db:system_comments_nest.html"}>
+<{/if}>
+<!-- end comments loop -->
+</div>
+<{/if}>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent9_index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent9_index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent9_index.html	(revision 405)
@@ -0,0 +1,60 @@
+<{$content}>
+
+<{* A sample displaying Last Modified *}>
+<{* Last Modified:<{$last_modified|date_format:"%Y-%m-%d"}> *}>
+
+<{* A sample displaying Edit link only for system admin *}>
+<{* <{if $xoops_isadmin == 1 }><a href="<{$mod_url}>/admin/index.php?op=edit&amp;id=<{$id}>">[Edit]</a><{/if}> *}>
+<{* If you turn this on, disable this module's cache *}>
+
+<{if $is_display_print_icon }>
+	<div style="float:right;width:40px;height:40px;"><a href="<{$mod_url}>/print.php?id=<{$id}>"><img src="<{$mod_url}>/images/print.gif" border="0" alt="<{$lang_printerpage}>" /></a></div>
+<{/if}>
+<{if $is_display_friend_icon }>
+	<div style="float:right;width:40px;height:40px;"><a href="<{$mail_link}>" target="_top"><img src="<{$mod_url}>/images/friend.gif" border="0" alt="<{$lang_sendstory}>" /></a></div>
+<{/if}>
+
+<{if $is_display_pagenav }>
+<hr style="clear:right;" />
+
+<table width="100%" border="0" cellpadding="0" cellspacing="0">
+<tr>
+	<td width="33%" align="left" valign="top">
+	<{if $prev_link }>
+		<a href="<{$vmod_url}>/<{$prev_link}>" accesskey="P"><{$lang_prevpage}></a><br />
+	<{$prev_title}>
+	<{/if}>
+	</td>
+	<td width="34%" align="center" valign="top">
+		<a href="<{$vmod_url}>/<{$top_link}>" accesskey="H"><{$lang_topofcontents}></a>
+	</td>
+	<td width="33%" align="right" valign="top">
+	<{if $next_link }>
+		<a href="<{$vmod_url}>/<{$next_link}>" accesskey="N"><{$lang_nextpage}></a><br />
+	<{$next_title}>
+	<{/if}>
+	</td>
+</tr>
+</table>
+<{/if}>
+
+
+<{if $nocomments == 0}>
+<br /><br />
+<div style="text-align: center; padding: 3px; margin: 3px;">
+  <{$commentsnav}>
+  <{$lang_notice}>
+</div>
+
+<div style="margin: 3px; padding: 3px;">
+<!-- start comments loop -->
+<{if $comment_mode == "flat"}>
+  <{include file="db:system_comments_flat.html"}>
+<{elseif $comment_mode == "thread"}>
+  <{include file="db:system_comments_thread.html"}>
+<{elseif $comment_mode == "nest"}>
+  <{include file="db:system_comments_nest.html"}>
+<{/if}>
+<!-- end comments loop -->
+</div>
+<{/if}>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent_index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent_index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/tinycontent_index.html	(revision 405)
@@ -0,0 +1,60 @@
+<{$content}>
+
+<{* A sample displaying Last Modified *}>
+<{* Last Modified:<{$last_modified|date_format:"%Y-%m-%d"}> *}>
+
+<{* A sample displaying Edit link only for system admin *}>
+<{* <{if $xoops_isadmin == 1 }><a href="<{$mod_url}>/admin/index.php?op=edit&amp;id=<{$id}>">[Edit]</a><{/if}> *}>
+<{* If you turn this on, disable this module's cache *}>
+
+<{if $is_display_print_icon }>
+	<div style="float:right;width:40px;height:40px;"><a href="<{$mod_url}>/print.php?id=<{$id}>"><img src="<{$mod_url}>/images/print.gif" border="0" alt="<{$lang_printerpage}>" /></a></div>
+<{/if}>
+<{if $is_display_friend_icon }>
+	<div style="float:right;width:40px;height:40px;"><a href="<{$mail_link}>" target="_top"><img src="<{$mod_url}>/images/friend.gif" border="0" alt="<{$lang_sendstory}>" /></a></div>
+<{/if}>
+
+<{if $is_display_pagenav }>
+<hr style="clear:right;" />
+
+<table width="100%" border="0" cellpadding="0" cellspacing="0">
+<tr>
+	<td width="33%" align="left" valign="top">
+	<{if $prev_link }>
+		<a href="<{$vmod_url}>/<{$prev_link}>" accesskey="P"><{$lang_prevpage}></a><br />
+	<{$prev_title}>
+	<{/if}>
+	</td>
+	<td width="34%" align="center" valign="top">
+		<a href="<{$vmod_url}>/<{$top_link}>" accesskey="H"><{$lang_topofcontents}></a>
+	</td>
+	<td width="33%" align="right" valign="top">
+	<{if $next_link }>
+		<a href="<{$vmod_url}>/<{$next_link}>" accesskey="N"><{$lang_nextpage}></a><br />
+	<{$next_title}>
+	<{/if}>
+	</td>
+</tr>
+</table>
+<{/if}>
+
+
+<{if $nocomments == 0}>
+<br /><br />
+<div style="text-align: center; padding: 3px; margin: 3px;">
+  <{$commentsnav}>
+  <{$lang_notice}>
+</div>
+
+<div style="margin: 3px; padding: 3px;">
+<!-- start comments loop -->
+<{if $comment_mode == "flat"}>
+  <{include file="db:system_comments_flat.html"}>
+<{elseif $comment_mode == "thread"}>
+  <{include file="db:system_comments_thread.html"}>
+<{elseif $comment_mode == "nest"}>
+  <{include file="db:system_comments_nest.html"}>
+<{/if}>
+<!-- end comments loop -->
+</div>
+<{/if}>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/.htaccess
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/.htaccess	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/templates/.htaccess	(revision 405)
@@ -0,0 +1,2 @@
+order deny,allow
+deny from all
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/sql/tinycontent3.sql
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/sql/tinycontent3.sql	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/sql/tinycontent3.sql	(revision 405)
@@ -0,0 +1,36 @@
+#
+# Table structure for table `tinycontent`
+#
+
+CREATE TABLE tinycontent3 (
+  storyid int(8) NOT NULL auto_increment,
+  blockid int(8) unsigned NOT NULL default '0',
+  title varchar(255) NOT NULL default '',
+  text text default NULL,
+  visible tinyint(1) NOT NULL default '0',
+  homepage tinyint(1) NOT NULL default '0',
+  nohtml tinyint(1) NOT NULL default '0',
+  nosmiley tinyint(1) NOT NULL default '0',
+  nobreaks tinyint(1) NOT NULL default '0',
+  nocomments tinyint(1) NOT NULL default '0',
+  link tinyint(1) NOT NULL default '0',
+  address varchar(255) default NULL,
+  submenu tinyint(1) NOT NULL default '0',
+  last_modified timestamp(14),
+  created datetime NOT NULL default '2001-1-1 00:00:00',
+  html_header text default NULL,
+
+  KEY (title),
+  KEY (blockid),
+  KEY (visible),
+  KEY (homepage),
+  KEY (nohtml),
+  KEY (nosmiley),
+  KEY (nobreaks),
+  KEY (nocomments),
+  KEY (link),
+  KEY (address),
+  KEY (submenu),
+  KEY (last_modified),
+  PRIMARY KEY (storyid)
+) TYPE=MyISAM;
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/sql/tinycontent4.sql
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/sql/tinycontent4.sql	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/sql/tinycontent4.sql	(revision 405)
@@ -0,0 +1,36 @@
+#
+# Table structure for table `tinycontent`
+#
+
+CREATE TABLE tinycontent4 (
+  storyid int(8) NOT NULL auto_increment,
+  blockid int(8) unsigned NOT NULL default '0',
+  title varchar(255) NOT NULL default '',
+  text text default NULL,
+  visible tinyint(1) NOT NULL default '0',
+  homepage tinyint(1) NOT NULL default '0',
+  nohtml tinyint(1) NOT NULL default '0',
+  nosmiley tinyint(1) NOT NULL default '0',
+  nobreaks tinyint(1) NOT NULL default '0',
+  nocomments tinyint(1) NOT NULL default '0',
+  link tinyint(1) NOT NULL default '0',
+  address varchar(255) default NULL,
+  submenu tinyint(1) NOT NULL default '0',
+  last_modified timestamp(14),
+  created datetime NOT NULL default '2001-1-1 00:00:00',
+  html_header text default NULL,
+
+  KEY (title),
+  KEY (blockid),
+  KEY (visible),
+  KEY (homepage),
+  KEY (nohtml),
+  KEY (nosmiley),
+  KEY (nobreaks),
+  KEY (nocomments),
+  KEY (link),
+  KEY (address),
+  KEY (submenu),
+  KEY (last_modified),
+  PRIMARY KEY (storyid)
+) TYPE=MyISAM;
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/sql/tinycontent5.sql
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/sql/tinycontent5.sql	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/sql/tinycontent5.sql	(revision 405)
@@ -0,0 +1,36 @@
+#
+# Table structure for table `tinycontent`
+#
+
+CREATE TABLE tinycontent5 (
+  storyid int(8) NOT NULL auto_increment,
+  blockid int(8) unsigned NOT NULL default '0',
+  title varchar(255) NOT NULL default '',
+  text text default NULL,
+  visible tinyint(1) NOT NULL default '0',
+  homepage tinyint(1) NOT NULL default '0',
+  nohtml tinyint(1) NOT NULL default '0',
+  nosmiley tinyint(1) NOT NULL default '0',
+  nobreaks tinyint(1) NOT NULL default '0',
+  nocomments tinyint(1) NOT NULL default '0',
+  link tinyint(1) NOT NULL default '0',
+  address varchar(255) default NULL,
+  submenu tinyint(1) NOT NULL default '0',
+  last_modified timestamp(14),
+  created datetime NOT NULL default '2001-1-1 00:00:00',
+  html_header text default NULL,
+
+  KEY (title),
+  KEY (blockid),
+  KEY (visible),
+  KEY (homepage),
+  KEY (nohtml),
+  KEY (nosmiley),
+  KEY (nobreaks),
+  KEY (nocomments),
+  KEY (link),
+  KEY (address),
+  KEY (submenu),
+  KEY (last_modified),
+  PRIMARY KEY (storyid)
+) TYPE=MyISAM;
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/sql/tinycontent6.sql
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/sql/tinycontent6.sql	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/sql/tinycontent6.sql	(revision 405)
@@ -0,0 +1,36 @@
+#
+# Table structure for table `tinycontent`
+#
+
+CREATE TABLE tinycontent6 (
+  storyid int(8) NOT NULL auto_increment,
+  blockid int(8) unsigned NOT NULL default '0',
+  title varchar(255) NOT NULL default '',
+  text text default NULL,
+  visible tinyint(1) NOT NULL default '0',
+  homepage tinyint(1) NOT NULL default '0',
+  nohtml tinyint(1) NOT NULL default '0',
+  nosmiley tinyint(1) NOT NULL default '0',
+  nobreaks tinyint(1) NOT NULL default '0',
+  nocomments tinyint(1) NOT NULL default '0',
+  link tinyint(1) NOT NULL default '0',
+  address varchar(255) default NULL,
+  submenu tinyint(1) NOT NULL default '0',
+  last_modified timestamp(14),
+  created datetime NOT NULL default '2001-1-1 00:00:00',
+  html_header text default NULL,
+
+  KEY (title),
+  KEY (blockid),
+  KEY (visible),
+  KEY (homepage),
+  KEY (nohtml),
+  KEY (nosmiley),
+  KEY (nobreaks),
+  KEY (nocomments),
+  KEY (link),
+  KEY (address),
+  KEY (submenu),
+  KEY (last_modified),
+  PRIMARY KEY (storyid)
+) TYPE=MyISAM;
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/sql/tinycontent7.sql
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/sql/tinycontent7.sql	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/sql/tinycontent7.sql	(revision 405)
@@ -0,0 +1,36 @@
+#
+# Table structure for table `tinycontent`
+#
+
+CREATE TABLE tinycontent7 (
+  storyid int(8) NOT NULL auto_increment,
+  blockid int(8) unsigned NOT NULL default '0',
+  title varchar(255) NOT NULL default '',
+  text text default NULL,
+  visible tinyint(1) NOT NULL default '0',
+  homepage tinyint(1) NOT NULL default '0',
+  nohtml tinyint(1) NOT NULL default '0',
+  nosmiley tinyint(1) NOT NULL default '0',
+  nobreaks tinyint(1) NOT NULL default '0',
+  nocomments tinyint(1) NOT NULL default '0',
+  link tinyint(1) NOT NULL default '0',
+  address varchar(255) default NULL,
+  submenu tinyint(1) NOT NULL default '0',
+  last_modified timestamp(14),
+  created datetime NOT NULL default '2001-1-1 00:00:00',
+  html_header text default NULL,
+
+  KEY (title),
+  KEY (blockid),
+  KEY (visible),
+  KEY (homepage),
+  KEY (nohtml),
+  KEY (nosmiley),
+  KEY (nobreaks),
+  KEY (nocomments),
+  KEY (link),
+  KEY (address),
+  KEY (submenu),
+  KEY (last_modified),
+  PRIMARY KEY (storyid)
+) TYPE=MyISAM;
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/sql/tinycontent8.sql
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/sql/tinycontent8.sql	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/sql/tinycontent8.sql	(revision 405)
@@ -0,0 +1,36 @@
+#
+# Table structure for table `tinycontent`
+#
+
+CREATE TABLE tinycontent8 (
+  storyid int(8) NOT NULL auto_increment,
+  blockid int(8) unsigned NOT NULL default '0',
+  title varchar(255) NOT NULL default '',
+  text text default NULL,
+  visible tinyint(1) NOT NULL default '0',
+  homepage tinyint(1) NOT NULL default '0',
+  nohtml tinyint(1) NOT NULL default '0',
+  nosmiley tinyint(1) NOT NULL default '0',
+  nobreaks tinyint(1) NOT NULL default '0',
+  nocomments tinyint(1) NOT NULL default '0',
+  link tinyint(1) NOT NULL default '0',
+  address varchar(255) default NULL,
+  submenu tinyint(1) NOT NULL default '0',
+  last_modified timestamp(14),
+  created datetime NOT NULL default '2001-1-1 00:00:00',
+  html_header text default NULL,
+
+  KEY (title),
+  KEY (blockid),
+  KEY (visible),
+  KEY (homepage),
+  KEY (nohtml),
+  KEY (nosmiley),
+  KEY (nobreaks),
+  KEY (nocomments),
+  KEY (link),
+  KEY (address),
+  KEY (submenu),
+  KEY (last_modified),
+  PRIMARY KEY (storyid)
+) TYPE=MyISAM;
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/sql/tinycontent9.sql
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/sql/tinycontent9.sql	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/sql/tinycontent9.sql	(revision 405)
@@ -0,0 +1,36 @@
+#
+# Table structure for table `tinycontent`
+#
+
+CREATE TABLE tinycontent9 (
+  storyid int(8) NOT NULL auto_increment,
+  blockid int(8) unsigned NOT NULL default '0',
+  title varchar(255) NOT NULL default '',
+  text text default NULL,
+  visible tinyint(1) NOT NULL default '0',
+  homepage tinyint(1) NOT NULL default '0',
+  nohtml tinyint(1) NOT NULL default '0',
+  nosmiley tinyint(1) NOT NULL default '0',
+  nobreaks tinyint(1) NOT NULL default '0',
+  nocomments tinyint(1) NOT NULL default '0',
+  link tinyint(1) NOT NULL default '0',
+  address varchar(255) default NULL,
+  submenu tinyint(1) NOT NULL default '0',
+  last_modified timestamp(14),
+  created datetime NOT NULL default '2001-1-1 00:00:00',
+  html_header text default NULL,
+
+  KEY (title),
+  KEY (blockid),
+  KEY (visible),
+  KEY (homepage),
+  KEY (nohtml),
+  KEY (nosmiley),
+  KEY (nobreaks),
+  KEY (nocomments),
+  KEY (link),
+  KEY (address),
+  KEY (submenu),
+  KEY (last_modified),
+  PRIMARY KEY (storyid)
+) TYPE=MyISAM;
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/sql/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/sql/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/sql/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/sql/.htaccess
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/sql/.htaccess	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/sql/.htaccess	(revision 405)
@@ -0,0 +1,2 @@
+order deny,allow
+deny from all
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/sql/tinycontent.sql
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/sql/tinycontent.sql	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/sql/tinycontent.sql	(revision 405)
@@ -0,0 +1,36 @@
+#
+# Table structure for table `tinycontent`
+#
+
+CREATE TABLE tinycontent (
+  storyid int(8) NOT NULL auto_increment,
+  blockid int(8) unsigned NOT NULL default '0',
+  title varchar(255) NOT NULL default '',
+  text text default NULL,
+  visible tinyint(1) NOT NULL default '0',
+  homepage tinyint(1) NOT NULL default '0',
+  nohtml tinyint(1) NOT NULL default '0',
+  nosmiley tinyint(1) NOT NULL default '0',
+  nobreaks tinyint(1) NOT NULL default '0',
+  nocomments tinyint(1) NOT NULL default '0',
+  link tinyint(1) NOT NULL default '0',
+  address varchar(255) default NULL,
+  submenu tinyint(1) NOT NULL default '0',
+  last_modified timestamp(14),
+  created datetime NOT NULL default '2001-1-1 00:00:00',
+  html_header text default NULL,
+
+  KEY (title),
+  KEY (blockid),
+  KEY (visible),
+  KEY (homepage),
+  KEY (nohtml),
+  KEY (nosmiley),
+  KEY (nobreaks),
+  KEY (nocomments),
+  KEY (link),
+  KEY (address),
+  KEY (submenu),
+  KEY (last_modified),
+  PRIMARY KEY (storyid)
+) TYPE=MyISAM;
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/sql/tinycontent0.sql
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/sql/tinycontent0.sql	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/sql/tinycontent0.sql	(revision 405)
@@ -0,0 +1,36 @@
+#
+# Table structure for table `tinycontent`
+#
+
+CREATE TABLE tinycontent0 (
+  storyid int(8) NOT NULL auto_increment,
+  blockid int(8) unsigned NOT NULL default '0',
+  title varchar(255) NOT NULL default '',
+  text text default NULL,
+  visible tinyint(1) NOT NULL default '0',
+  homepage tinyint(1) NOT NULL default '0',
+  nohtml tinyint(1) NOT NULL default '0',
+  nosmiley tinyint(1) NOT NULL default '0',
+  nobreaks tinyint(1) NOT NULL default '0',
+  nocomments tinyint(1) NOT NULL default '0',
+  link tinyint(1) NOT NULL default '0',
+  address varchar(255) default NULL,
+  submenu tinyint(1) NOT NULL default '0',
+  last_modified timestamp(14),
+  created datetime NOT NULL default '2001-1-1 00:00:00',
+  html_header text default NULL,
+
+  KEY (title),
+  KEY (blockid),
+  KEY (visible),
+  KEY (homepage),
+  KEY (nohtml),
+  KEY (nosmiley),
+  KEY (nobreaks),
+  KEY (nocomments),
+  KEY (link),
+  KEY (address),
+  KEY (submenu),
+  KEY (last_modified),
+  PRIMARY KEY (storyid)
+) TYPE=MyISAM;
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/sql/tinycontent1.sql
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/sql/tinycontent1.sql	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/sql/tinycontent1.sql	(revision 405)
@@ -0,0 +1,36 @@
+#
+# Table structure for table `tinycontent`
+#
+
+CREATE TABLE tinycontent1 (
+  storyid int(8) NOT NULL auto_increment,
+  blockid int(8) unsigned NOT NULL default '0',
+  title varchar(255) NOT NULL default '',
+  text text default NULL,
+  visible tinyint(1) NOT NULL default '0',
+  homepage tinyint(1) NOT NULL default '0',
+  nohtml tinyint(1) NOT NULL default '0',
+  nosmiley tinyint(1) NOT NULL default '0',
+  nobreaks tinyint(1) NOT NULL default '0',
+  nocomments tinyint(1) NOT NULL default '0',
+  link tinyint(1) NOT NULL default '0',
+  address varchar(255) default NULL,
+  submenu tinyint(1) NOT NULL default '0',
+  last_modified timestamp(14),
+  created datetime NOT NULL default '2001-1-1 00:00:00',
+  html_header text default NULL,
+
+  KEY (title),
+  KEY (blockid),
+  KEY (visible),
+  KEY (homepage),
+  KEY (nohtml),
+  KEY (nosmiley),
+  KEY (nobreaks),
+  KEY (nocomments),
+  KEY (link),
+  KEY (address),
+  KEY (submenu),
+  KEY (last_modified),
+  PRIMARY KEY (storyid)
+) TYPE=MyISAM;
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/sql/tinycontent2.sql
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/sql/tinycontent2.sql	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/sql/tinycontent2.sql	(revision 405)
@@ -0,0 +1,36 @@
+#
+# Table structure for table `tinycontent`
+#
+
+CREATE TABLE tinycontent2 (
+  storyid int(8) NOT NULL auto_increment,
+  blockid int(8) unsigned NOT NULL default '0',
+  title varchar(255) NOT NULL default '',
+  text text default NULL,
+  visible tinyint(1) NOT NULL default '0',
+  homepage tinyint(1) NOT NULL default '0',
+  nohtml tinyint(1) NOT NULL default '0',
+  nosmiley tinyint(1) NOT NULL default '0',
+  nobreaks tinyint(1) NOT NULL default '0',
+  nocomments tinyint(1) NOT NULL default '0',
+  link tinyint(1) NOT NULL default '0',
+  address varchar(255) default NULL,
+  submenu tinyint(1) NOT NULL default '0',
+  last_modified timestamp(14),
+  created datetime NOT NULL default '2001-1-1 00:00:00',
+  html_header text default NULL,
+
+  KEY (title),
+  KEY (blockid),
+  KEY (visible),
+  KEY (homepage),
+  KEY (nohtml),
+  KEY (nosmiley),
+  KEY (nobreaks),
+  KEY (nocomments),
+  KEY (link),
+  KEY (address),
+  KEY (submenu),
+  KEY (last_modified),
+  PRIMARY KEY (storyid)
+) TYPE=MyISAM;
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/comment_new.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/comment_new.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/comment_new.php	(revision 405)
@@ -0,0 +1,49 @@
+<?php
+// $Id: comment_new.php,v 1.6 2003/03/25 11:08:21 buennagel Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Tobias Liegl (AKA CHAPI)                                          //
+// Site: http://www.chapi.de                                                 //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+// Hacker: GIJ=CHECKMATE (AKA GIJOE)                                         //
+// Site: http://www.peak.ne.jp/xoops/                                        //
+// ------------------------------------------------------------------------- //
+
+include '../../mainfile.php';
+$mydirname = basename( dirname( __FILE__ ) ) ;
+if( ! preg_match( '/^(\D+)(\d*)$/' , $mydirname , $regs ) ) echo ( "invalid dirname: " . htmlspecialchars( $mydirname ) ) ;
+$mydirnumber = $regs[2] === '' ? '' : intval( $regs[2] ) ;
+
+$com_itemid = isset($_GET['com_itemid']) ? intval($_GET['com_itemid']) : 0;
+if ($com_itemid > 0) {
+	// Get link title
+	$sql = "SELECT title FROM " . $xoopsDB->prefix( "tinycontent{$mydirnumber}" ) . " WHERE storyid=" . $com_itemid . "";
+	$result = $xoopsDB->query($sql);
+	$row = $xoopsDB->fetchArray($result);
+    $com_replytitle = $row['title'];
+    include XOOPS_ROOT_PATH.'/include/comment_new.php';
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/singlecontent.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/singlecontent.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/singlecontent.php	(revision 405)
@@ -0,0 +1,92 @@
+<?php
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+// ------------------------------------------------------------------------- //
+// Author: Tobias Liegl (AKA CHAPI)                                          //
+// Site: http://www.chapi.de                                                 //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+// Hacker: GIJ=CHECKMATE (AKA GIJOE)                                         //
+// Site: http://www.peak.ne.jp/xoops/                                        //
+// ------------------------------------------------------------------------- //
+
+// check modulesless rewrite
+if( ! empty( $_SERVER['REQUEST_URI'] ) && ! stristr( $_SERVER['REQUEST_URI'] , 'modules' ) ) {
+	$tinyd_vmod_dir = $_SERVER['REQUEST_URI'] ;
+	$_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'] ;
+}
+
+/* echo "<pre>" ;
+var_dump( $_SERVER ) ;
+exit ; */
+
+include( '../../mainfile.php' ) ;
+include_once( 'class/tinyd.textsanitizer.php' ) ;
+include_once( 'include/render_function.inc.php' ) ;
+include_once( 'include/constants.inc.php' ) ;
+
+// for "Duplicatable"
+$mydirname = basename( dirname( __FILE__ ) ) ;
+if( ! preg_match( '/^(\D+)(\d*)$/' , $mydirname , $regs ) ) echo ( "invalid dirname: " . htmlspecialchars( $mydirname ) ) ;
+$mydirnumber = $regs[2] === '' ? '' : intval( $regs[2] ) ;
+
+// utility variables
+$mymodpath = XOOPS_ROOT_PATH."/modules/$mydirname" ;
+$mytablename = $xoopsDB->prefix( "tinycontent{$mydirnumber}" ) ;
+
+// get id of homepage
+$result = $xoopsDB->query( "SELECT storyid FROM $mytablename WHERE visible='1' ORDER BY homepage DESC, blockid" ) ;
+if( $xoopsDB->getRowsNum( $result ) < 1 ) {
+	redirect_header( XOOPS_URL , 2 , _TC_FILENOTFOUND ) ;
+	exit ;
+}
+list( $homepage_id ) = $xoopsDB->fetchRow( $result ) ;
+
+// check if $_GET['id'] is specified
+$id = empty( $_GET['id'] ) ? 0 : intval( $_GET['id'] ) ;
+if( $id <= 0 )  {
+	$_REQUEST['id'] = $_GET['id'] = $id = $homepage_id ;
+}
+
+// main query
+$result = $xoopsDB->query( "SELECT storyid,title,text,visible,nohtml,nosmiley,nobreaks,nocomments,link,address,UNIX_TIMESTAMP(last_modified) AS last_modified,html_header FROM $mytablename WHERE storyid='$id' AND visible" ) ;
+if( ( $result_array = $xoopsDB->fetchArray( $result ) ) == false ) {
+	redirect_header( XOOPS_URL , 2 , _TC_FILENOTFOUND ) ;
+	exit ;
+}
+
+// redirect if its base of wrapping is wrap_path (content)
+/* if( ! $xoopsModuleConfig['tc_force_mod_rewrite'] && $result_array['link'] == TC_WRAPTYPE_CONTENTBASE ) {
+	if( headers_sent() ) {
+		redirect_header( XOOPS_URL . "/modules/$mydirname/content/index.php?id={$result_array['storyid']}" , 0 , '&nbsp;' ) ;
+	} else {
+		header( "Location: content/index.php?id={$result_array['storyid']}" ) ;
+	}
+	exit ;
+} TODO */
+
+$tinyd_singlecontent = true ;
+include( "include/print.inc.php" ) ;
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/comment_reply.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/comment_reply.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/comment_reply.php	(revision 405)
@@ -0,0 +1,29 @@
+<?php
+// $Id: comment_reply.php,v 1.5 2003/02/12 11:36:35 okazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+include '../../mainfile.php';
+include XOOPS_ROOT_PATH.'/include/comment_reply.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/tinyd0/xoops_version.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/tinyd0/xoops_version.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/tinyd0/xoops_version.php	(revision 405)
@@ -0,0 +1,258 @@
+<?php
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+// ------------------------------------------------------------------------- //
+// Author: Tobias Liegl (AKA CHAPI)                                          //
+// Site: http://www.chapi.de                                                 //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+if( ! defined( 'XOOPS_ROOT_PATH' ) ) exit ;
+$mydirname = basename( dirname( __FILE__ ) ) ;
+if( ! preg_match( '/^(\D+)(\d*)$/' , $mydirname , $regs ) ) echo ( "invalid dirname: " . htmlspecialchars( $mydirname ) ) ;
+$mydirnumber = $regs[2] === '' ? '' : intval( $regs[2] ) ;
+
+include_once( XOOPS_ROOT_PATH . "/modules/$mydirname/include/constants.inc.php" ) ;
+
+$modversion['name']		    = _MI_TINYCONTENT_NAME . $mydirnumber ;
+$modversion['version']		= 2.25;
+$modversion['author']       = 'Tobias Liegl (AKA CHAPI)';
+$modversion['description']	= _MI_TINYCONTENT_DESC;
+$modversion['credits']		= "The XOOPS Project";
+$modversion['license']		= "GPL see LICENSE";
+$modversion['help']		    = "";
+$modversion['official']		= 0;
+$modversion['image']		= "images/tinycontent{$mydirnumber}.png";
+$modversion['dirname']		= $mydirname;
+//$modversion['dirname']		= _MI_DIR_NAME;
+
+// All tables should not have any prefix!
+$modversion['sqlfile']['mysql'] = "sql/tinycontent{$mydirnumber}.sql";
+
+// Tables created by sql file (without prefix!)
+//$modversion['tables'][0]	= _MI_DIR_NAME;
+$modversion['tables'][0]	= "tinycontent{$mydirnumber}" ;
+
+// Admin things
+$modversion['hasAdmin']		= 1;
+$modversion['adminindex']	= "admin/index.php";
+$modversion['adminmenu']	= "admin/menu.php";
+
+// Search
+$modversion['hasSearch'] = 1;
+$modversion['search']['file'] = "include/search.inc.php";
+$modversion['search']['func'] = "tinycontent{$mydirnumber}_search";
+
+// Menu
+$modversion['hasMain'] = 1;
+
+// get my config
+$module_handler =& xoops_gethandler('module');
+$module =& $module_handler->getByDirname($mydirname);
+if( is_object( $module ) ) {
+	$config_handler =& xoops_gethandler('config');
+	$config =& $config_handler->getConfigsByCat(0, $module->getVar('mid'));
+	$myts =& MyTextSanitizer::getInstance();
+	$db =& Database::getInstance() ;
+
+	// Submenu Items
+	$result = $db->query("SELECT storyid,title,link FROM ".$db->prefix( "tinycontent{$mydirnumber}" )." WHERE submenu='1' AND visible ORDER BY blockid" ) ;
+	$i = 1 ;
+	while( list( $storyid , $title , $link ) = $db->fetchRow( $result ) )
+	{
+		$modversion['sub'][$i]['name'] = $myts->makeTboxData4Show( $title ) ;
+	
+		if( ! empty( $config['tc_force_mod_rewrite'] ) || $link == TC_WRAPTYPE_USEREWRITE ) {
+			if( empty( $config['tc_modulesless_dir'] ) ) { 
+				$wraproot = TC_REWRITE_DIR ;
+				$modversion['sub'][$i]['url'] = TC_REWRITE_DIR . sprintf( TC_REWRITE_FILENAME_FMT , $storyid ) ;
+			} else {
+				$wraproot = '' ;
+				$modversion['sub'][$i]['url'] = '../../'.$config['tc_modulesless_dir'].'/'.sprintf( TC_REWRITE_FILENAME_FMT , $storyid ) ;
+			}
+		} else {
+			$wraproot = $link == TC_WRAPTYPE_CONTENTBASE ? "content/" : '' ;
+			$modversion['sub'][$i]['url'] = "{$wraproot}index.php?id=$storyid" ;
+		}
+		$i++ ;
+	}
+}
+
+// Templates
+$modversion['templates'][1]['file'] = "tinycontent{$mydirnumber}_index.html";
+$modversion['templates'][1]['description'] = "Layout for Monitor";
+$modversion['templates'][2]['file'] = "tinycontent{$mydirnumber}_print.html";
+$modversion['templates'][2]['description'] = "Layout for Printer";
+
+// Blocks
+$modversion['blocks'][1]['file'] = "tinycontent_navigation.php";
+$modversion['blocks'][1]['name'] = sprintf( _MI_TC_BNAME1 , $mydirnumber ) ;
+$modversion['blocks'][1]['description'] = _MI_TC_BDESC1 ;
+$modversion['blocks'][1]['show_func'] = "tinycontent{$mydirnumber}_block_nav";
+$modversion['blocks'][1]['template'] = "tinycontent{$mydirnumber}_nav_block.html";
+$modversion['blocks'][1]['can_clone'] = false ;
+$modversion['blocks'][1]['options'] = "{$mydirname}";
+
+
+$modversion['blocks'][2]['file'] = "tinycontent_content.php";
+$modversion['blocks'][2]['name'] = sprintf( _MI_TC_BNAME2 , $mydirnumber ) ;
+$modversion['blocks'][2]['description'] = _MI_TC_BDESC2 ;
+$modversion['blocks'][2]['show_func'] = "b_tinycontent_content_show";
+$modversion['blocks'][2]['edit_func'] = "b_tinycontent_content_edit";
+$modversion['blocks'][2]['template'] = "";
+$modversion['blocks'][2]['can_clone'] = true ;
+$modversion['blocks'][2]['options'] = "{$mydirname}|1";
+
+// Comments
+$modversion['hasComments'] = 1;
+$modversion['comments']['itemName'] = 'id';
+$modversion['comments']['pageName'] = 'index.php';
+
+// Configs
+$modversion['config'][1] = array(
+	'name' => 'tc_common_htmlheader',
+	'title' => '_MI_COMMON_HTMLHEADER',
+	'description' => '_MI_COMMON_HTMLHEADER_DESC',
+	'formtype' => 'textarea',
+	'valuetype' => 'text',
+	'default' => ''
+) ;
+
+$modversion['config'][] = array(
+	'name' => 'tc_tarea_width',
+	'title' => '_MI_TAREA_WIDTH',
+	'description' => '_MI_TAREA_WIDTH_DESC',
+	'formtype' => 'text',
+	'valuetype' => 'int',
+	'default' => 35
+) ;
+
+$modversion['config'][] = array(
+	'name' => 'tc_header_tarea_height',
+	'title' => '_MI_HEADER_TAREA_HEIGHT',
+	'description' => '_MI_HEADER_TAREA_HEIGHT_DESC',
+	'formtype' => 'text',
+	'valuetype' => 'int',
+	'default' => 3
+) ;
+
+$modversion['config'][] = array(
+	'name' => 'tc_tarea_height',
+	'title' => '_MI_TAREA_HEIGHT',
+	'description' => '_MI_TAREA_HEIGHT_DESC',
+	'formtype' => 'text',
+	'valuetype' => 'int',
+	'default' => 37
+) ;
+
+$modversion['config'][] = array(
+	'name' => 'tc_force_mod_rewrite',
+	'title' => '_MI_FORCE_MOD_REWRITE',
+	'description' => '_MI_FORCE_MOD_REWRITE_DESC',
+	'formtype' => 'yesno',
+	'valuetype' => 'int',
+	'default' => 0
+) ;
+
+$modversion['config'][] = array(
+	'name' => 'tc_modulesless_dir',
+	'title' => '_MI_MODULESLESS_DIR',
+	'description' => '_MI_MODULESLESS_DIR_DESC',
+	'formtype' => 'text',
+	'valuetype' => 'text',
+	'default' => ''
+) ;
+
+$modversion['config'][] = array(
+	'name' => 'tc_space2nbsp',
+	'title' => '_MI_SPACE2NBSP',
+	'description' => '',
+	'formtype' => 'yesno',
+	'valuetype' => 'int',
+	'default' => 0
+) ;
+
+$modversion['config'][] = array(
+	'name' => 'tc_display_print_icon',
+	'title' => '_MI_DISPLAY_PRINT_ICON',
+	'description' => '',
+	'formtype' => 'yesno',
+	'valuetype' => 'int',
+	'default' => 1
+) ;
+
+$modversion['config'][] = array(
+	'name' => 'tc_display_friend_icon',
+	'title' => '_MI_DISPLAY_FRIEND_ICON',
+	'description' => '' ,
+	'formtype' => 'yesno',
+	'valuetype' => 'int',
+	'default' => 1
+) ;
+
+$modversion['config'][] = array(
+	'name' => 'tc_use_taf_module',
+	'title' => '_MI_USE_TAF_MODULE',
+	'description' => '' ,
+	'formtype' => 'yesno',
+	'valuetype' => 'int',
+	'default' => 0
+) ;
+
+$modversion['config'][] = array(
+	'name' => 'tc_display_pagenav',
+	'title' => '_MI_DISPLAY_PAGENAV',
+	'description' => '' ,
+	'formtype' => 'select',
+	'valuetype' => 'int',
+	'default' => 0,
+	'options' => array(
+		'_MI_DISPLAY_PAGENAV_NONE' => 0 , 
+		'_MI_DISPLAY_PAGENAV_DISP' => 1 , 
+		'_MI_DISPLAY_PAGENAV_SUB' => 2 , 
+		'_MI_DISPLAY_PAGENAV_PERSUB' => 3 )
+) ;
+
+$modversion['config'][] = array(
+	'name' => 'tc_navblock_target',
+	'title' => '_MI_NAVBLOCK_TARGET',
+	'description' => '' ,
+	'formtype' => 'select',
+	'valuetype' => 'int',
+	'default' => 1,
+	'options' => array(
+		'_MI_NAVBLOCK_TARGET_DISP' => 1 , 
+		'_MI_NAVBLOCK_TARGET_SUB' => 2 )
+) ;
+
+
+// Notification
+$modversion['hasNotification'] = 0;
+
+// onUpdate
+if( ! empty( $_POST['fct'] ) && ! empty( $_POST['op'] ) && $_POST['fct'] == 'modulesadmin' && $_POST['op'] == 'update_ok' && $_POST['dirname'] == $modversion['dirname'] ) {
+	include dirname( __FILE__ ) . "/include/onupdate.inc.php" ;
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/class/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/class/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/class/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/class/partners.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/class/partners.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/class/partners.php	(revision 405)
@@ -0,0 +1,100 @@
+<?php
+// $Id: partners.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Raul Recio (AKA UNFOR)                                            //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+include_once XOOPS_ROOT_PATH."/class/xoopsobject.php";
+
+class PartnerSystem extends XoopsObject
+{
+	var $db;
+
+    // constructor
+	function PartnerSystem($id=null)
+	{
+		$this->db =& Database::getInstance();
+		$this->initVar("id", XOBJ_DTYPE_INT, null, false);
+		$this->initVar("weight", XOBJ_DTYPE_INT, null, false, 10);
+		$this->initVar("hits", XOBJ_DTYPE_INT, null, true, 10);
+		$this->initVar("url", XOBJ_DTYPE_TXTBOX, null, true);
+		$this->initVar("image", XOBJ_DTYPE_TXTBOX, null, true);
+		$this->initVar("title", XOBJ_DTYPE_TXTBOX, null, false);
+		$this->initVar("description", XOBJ_DTYPE_TXTBOX, null, true);
+		if ( !empty($id) ) {
+			if ( is_array($id) ) {
+				$this->assignVars($id);
+			} else {
+				$this->load(intval($id));
+			}
+		}
+	}
+
+	function load($id)
+	{
+		$sql = "SELECT * FROM ".$this->db->prefix("partners")." WHERE id=$id and status=1";
+		$myrow = $this->db->fetchArray($this->db->query($sql));
+		$this->assignVars($myrow);
+	}
+
+	function getAllPartners($criteria=array(), $asobject=false, $sort="hits", $order="DESC", $limit=0, $start=0)
+	{
+		$db =& Database::getInstance();
+		$ret = array();
+		$where_query = "";
+		if ( is_array($criteria) && count($criteria) > 0 ) {
+			$where_query = " WHERE";
+			foreach ( $criteria as $c ) {
+				$where_query .= " $c AND";
+			}
+			$where_query = substr($where_query, 0, -4);
+		} elseif ( !is_array($criteria) ) {
+			$where_query = " WHERE ".$criteria;
+		}
+		if ( !$asobject ) {
+			$sql = "SELECT id FROM ".$db->prefix("partners")."$where_query ORDER BY $sort $order";
+			$result = $db->query($sql,$limit,$start);
+			while ( $myrow = $db->fetchArray($result) ) {
+				$ret[] = $myrow['id'];
+			}
+		} else {
+			$sql = "SELECT * FROM ".$db->prefix("partners")."".$where_query." ORDER BY $sort $order";
+			$result = $db->query($sql,$limit,$start);
+			while ( $myrow = $db->fetchArray($result) ) {
+				$ret[] = new PartnerSystem($myrow);
+			}
+		}
+		return $ret;
+	}
+
+	function setHits($id)
+	{
+		$db =& Database::getInstance();
+		$db->queryF("UPDATE ".$db->prefix("partners")." SET hits=hits+1 WHERE id=$id");
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/images/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/images/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/images/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/join.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/join.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/join.php	(revision 405)
@@ -0,0 +1,141 @@
+<?php
+// $Id: join.php,v 1.5 2005/09/04 20:46:12 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+// ------------------------------------------------------------------------- //
+// Author: Raul Recio (AKA UNFOR)                                            //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+include "header.php";
+$xoopsOption['template_main'] = 'xoopspartners_join.html';
+include XOOPS_ROOT_PATH."/header.php";
+$myts =& MyTextSanitizer::getInstance();
+if ( $xoopsUser ){
+    if ( !empty($_POST['op']) && $_POST['op'] == "sendMail" ) {
+        include XOOPS_ROOT_PATH."/class/xoopsmailer.php";
+        if ( empty($_POST['title']) or empty($_POST['url']) or empty($_POST['description']) or $_POST['url'] == "http://" ) {
+            $xoopsTpl->assign(array(
+            "content4join"         => _MD_ERROR1,
+            "lang_main_partner"    => _MD_PARTNERS,
+            "sitename"             => htmlspecialchars($xoopsConfig['sitename'])
+            ));
+            $xoopsContentsTpl = 'partnerjoin.html';
+            include_once XOOPS_ROOT_PATH.'/footer.php';
+            exit();
+        }
+        $url          = formatURL($myts->makeTboxData4Show($_POST['url']));
+        $image        = formatURL($myts->makeTboxData4Show($_POST['image']));
+        $title        = $myts->makeTboxData4Show($_POST['title']);
+        $description  = $myts->makeTboxData4Show($_POST['description']);
+        $imageInfo    = @getimagesize($image);
+        $imageWidth   = $imageInfo[0];
+        $imageHeight  = $imageInfo[1];
+        $type = $imageInfo[2];
+        if ($type == 0) {
+            $xoopsTpl->assign(array(
+            "content4join"         => _MD_ERROR3,
+            "lang_main_partner"    => _MD_PARTNERS,
+            "sitename"             => htmlspecialchars($xoopsConfig['sitename'])
+            ));
+            $xoopsContentsTpl = 'partnerjoin.html';
+            include_once XOOPS_ROOT_PATH.'/footer.php';
+            exit();
+        }
+        if ( $imageWidth >= 110 or $imageHeight >=50 ) {
+            $xoopsTpl->assign(array(
+            "content4join"         => _MD_ERROR2,
+            "lang_main_partner"    => _MD_PARTNERS,
+            "sitename"             => htmlspecialchars($xoopsConfig['sitename'])
+            ));
+            $xoopsContentsTpl = 'partnerjoin.html';
+            include_once XOOPS_ROOT_PATH.'/footer.php';
+            exit();
+        }
+        if( $image == "http://" ) {
+            $image = "";
+        }
+        $xoopsMailer =& getMailer();
+        $xoopsMailer->useMail();
+        $xoopsMailer->setTemplateDir(XOOPS_ROOT_PATH.'/modules/xoopspartners/language/'.$xoopsConfig['language'].'/');
+        $xoopsMailer->setTemplate("join.tpl");
+        $xoopsMailer->assign("SITENAME", $xoopsConfig['sitename']);
+        $xoopsMailer->assign("SITEURL", XOOPS_URL."/");
+        $xoopsMailer->assign("IP", $_SERVER['REMOTE_ADDR']);
+        $xoopsMailer->assign("URL", $url);
+        $xoopsMailer->assign("IMAGE", $image);
+        $xoopsMailer->assign("TITLE", $title);
+        $xoopsMailer->assign("DESCRIPTION", $description);
+        $xoopsMailer->assign("USER", $xoopsUser->getVar("uname"));
+        $xoopsMailer->setToEmails($xoopsConfig['adminmail']);
+        $xoopsMailer->setFromEmail($xoopsUser->getVar("email"));
+        $xoopsMailer->setFromName($xoopsUser->getVar("uname"));
+        $xoopsMailer->setSubject(sprintf(_MD_NEWPARTNER,$xoopsConfig['sitename']));
+        if ( !$xoopsMailer->send() ) {
+            $xoopsTpl->assign(array(
+            "content4join"         => "<br />".$xoopsMailer->getErrors()._MD_GOBACK,
+            "lang_main_partner"    => _MD_PARTNERS,
+            "lang_join"            => _MD_JOIN,
+            "sitename"             => htmlspecialchars($xoopsConfig['sitename'])
+            ));
+        } else {
+            $xoopsTpl->assign(array(
+            "content4join"         => "<br />"._MD_SENDMAIL,
+            "lang_main_partner"    => _MD_PARTNERS,
+            "lang_join"            => _MD_JOIN,
+            "sitename"             => htmlspecialchars($xoopsConfig['sitename'])
+                ));
+        }
+        $xoopsContentsTpl = 'partnerjoin.html';
+    } else {
+        include XOOPS_ROOT_PATH."/class/xoopsformloader.php";
+        $form = new XoopsThemeForm("", "joinform", "join.php");
+        $titlePartern = new XoopsFormText(_MD_TITLE, "title", 30, 50);
+        $imagePartern = new XoopsFormText(_MD_IMAGE, "image", 30, 150, "http://");
+        $urlPartern = new XoopsFormText(_MD_URL, "url", 30, 150, "http://");
+        $descriptionPartern = new XoopsFormTextArea(_MD_DESCRIPTION, "description","", 7, 50);
+        $op_hidden = new XoopsFormHidden("op", "sendMail");
+        $submit_button = new XoopsFormButton("", "dbsubmit", _MD_SEND, "submit");
+        $form->addElement($titlePartern);
+        $form->addElement($imagePartern);
+        $form->addElement($urlPartern);
+        $form->addElement($descriptionPartern);
+        $form->addElement($op_hidden);
+        $form->addElement($submit_button);
+        $form->setRequired($titlePartern);
+        $form->setRequired($urlPartern);
+        $form->setRequired($descriptionPartern);
+        $content = $form->render();
+        $xoopsTpl->assign(array(
+        "content4join"         => $content,
+        "lang_main_partner"    => _MD_PARTNERS,
+        "lang_join"            => _MD_JOIN,
+        "sitename"             => htmlspecialchars($xoopsConfig['sitename'])
+        ));
+    }
+} else { // else -- if ( $xoopsUser )
+    redirect_header("index.php",2,_NOPERM);
+}
+include_once XOOPS_ROOT_PATH.'/footer.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/vpartner.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/vpartner.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/vpartner.php	(revision 405)
@@ -0,0 +1,48 @@
+<?php
+// $Id: vpartner.php,v 1.3 2005/09/04 20:46:12 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+// ------------------------------------------------------------------------- //
+// Author: Raul Recio (AKA UNFOR)                                            //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+include "header.php";
+$part = new PartnerSystem();
+$id = $_GET['id'];
+if ( empty($id) || !is_numeric($id) ) {
+	redirect_header("index.php", 1, _XP_NOPART);
+	exit();
+}
+$partners = $part->load($id);
+if ( $part->getVar("url") ) {
+	if ( !isset($_COOKIE['partners'][$id]) ) {
+		setcookie("partners[$id]", $id, $xoopsModuleConfig['cookietime']);
+		$part->setHits($id);
+	}
+	echo "<html><head><meta http-equiv='Refresh' content='0; URL=".$part->getVar("url")."'></head><body></body></html>";
+} else {
+	redirect_header("index.php", 1, _XP_NOPART);
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/admin/index.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/admin/index.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/admin/index.php	(revision 405)
@@ -0,0 +1,280 @@
+<?php
+// $Id: index.php,v 1.4 2005/08/03 12:40:02 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Raul Recio (AKA UNFOR)                                            //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+include '../../../include/cp_header.php';
+
+function partnersAdmin()
+{
+    $xoopsDB =& Database::getInstance();
+    $myts =& MyTextSanitizer::getInstance();
+    xoops_cp_header();
+    echo "<h4>"._MD_PARTNERADMIN."</h4>
+    <form action='index.php' method='post' name='reorderform'>
+    <table width='100%' border='0' cellspacing='1' cellpadding='0' class='outer'><tr>
+    <th width='10%' align='center'>" ._MD_TITLE."</th>
+    <th width='3%' align='center'>" ._MD_IMAGE."</th>
+    <th>" ._MD_DESCRIPTION."</th>
+    <th width='3%' align='center'>" ._MD_ACTIVE."</th>
+    <th width='3%' align='center'>" ._MD_WEIGHT."</th>
+    <th width='3%' align='center'>" ._MD_HITS."</th>
+    <th>&nbsp;</th></tr>";
+    $result = $xoopsDB->query("SELECT id, hits, url, weight, image, title, description, status FROM ".$xoopsDB->prefix("partners")." ORDER BY status DESC, weight ASC, title DESC");
+    $class = 'even';
+    while (list($id, $hits, $url, $weight, $image, $title, $description, $status) = $xoopsDB->fetchrow($result)) {
+        $url          = formatURL($myts->makeTboxData4Show($url));
+        $image        = formatURL($myts->makeTboxData4Show($image));
+        $title        = $myts->makeTboxData4Show($title);
+        $description  = $myts->makeTboxData4Show($description);
+        $imageInfo    = @getimagesize($image);
+        $imageWidth   = $imageInfo[0];
+        $imageHeight  = $imageInfo[1];
+        $check1 = "";
+        $check2 = "";
+        if( $status == 1){ $check1 = "selected='selected'"; }else{ $check2 = "selected='selected'"; }
+        if( $imageWidth >= 110 or $imageHeight >= 50 ){
+            $errorMsg = "<br />"._MD_IMAGE_ERROR;
+        } else {
+            $errorMsg = "";
+        }
+        echo "<tr>
+        <td class='$class' width='10%' align='center' valign='middle'><a href='".$url."' target='_blank'>".$title."</a></td>
+        <td class='$class' width='3%' align='center'>";
+        if ( !empty($image) ) {
+            echo "<img src='".$image."' alt='".$title."' width='102' height='47' />".$errorMsg;
+        }
+        echo "</td><td class='$class'>".$description."</td>
+        <td class='$class' width='3%' align='center'>
+        <select size='1' name='status[$id]'> <option value='1' ".$check1.">"._MD_YES."</option><option value='0' ".$check2.">"._MD_NO."</option></select>
+        <td class='$class' width='3%' align='center'>";
+        echo "<input type='text' name='weight[$id]' value='$weight' size='3' maxlength='3' style='text-align: center;' />";
+        echo "</td><td class='$class' width='3%' align='center'>".$hits."</td>
+        <td class='$class' width='3%' align='center'>
+        <a href='index.php?op=editPartner&amp;id=".$id."'>"._MD_EDIT."</a><br />--<br /><a href='index.php?op=delPartner&amp;id=".$id."'>"._MD_DELETE."</a>
+        </td></tr>";
+        $class = ($class == 'odd') ? 'even' : 'odd';
+    }
+    echo "<tr><td class='foot' colspan='7' align='right'>
+    <input type='hidden' name='op' value='reorderPartners' />
+    <input type='button' name='button' onclick=\"location='index.php?op=partnersAdminAdd'\" value='"._MD_PARTNERS_ADD."' />
+    <input type='button' name='button' onclick=\"location='index.php?op=reorderAutoPartners'\" value='"._MD_AUTOMATIC_SORT."' />
+    <input type='submit' name='submit' value='"._MD_REORDER."' />
+    </td></tr></table></form>";
+    xoops_cp_footer();
+}
+
+function reorderAutoPartners()
+{
+    $xoopsDB =& Database::getInstance();
+    $weight = 0;
+    $result = $xoopsDB->query("SELECT id FROM ".$xoopsDB->prefix("partners")." ORDER BY weight ASC");
+    while (list($id) = $xoopsDB->fetchrow($result)) {
+        $weight++;
+        $xoopsDB->queryF("UPDATE ".$xoopsDB->prefix("partners")." SET weight='$weight' WHERE id=$id");
+    }
+    redirect_header("./index.php", 1, _MD_UPDATED);
+    exit();
+}
+
+function partnersAdminAdd()
+{
+    $xoopsDB =& Database::getInstance();
+    $myts =& MyTextSanitizer::getInstance();
+    xoops_cp_header();
+    echo "<h4>"._MD_PARTNERADMIN."</h4>";
+    include XOOPS_ROOT_PATH."/class/xoopsformloader.php";
+    $form       = new XoopsThemeForm(_MD_ADDPARTNER, "addform", "index.php");
+    $formweight = new XoopsFormText(_MD_WEIGHT, "weight", 3, 10, 0);
+    $formimage  = new XoopsFormText(_MD_IMAGE, "image", 50, 150, 'http://');
+    $formurl    = new XoopsFormText(_MD_URL, "url", 50, 150, 'http://');
+    $formtitle  = new XoopsFormText(_MD_TITLE, "title", 50, 50);
+    $formdesc   = new XoopsFormTextArea(_MD_DESCRIPTION, "description","", 10, "60");
+    $formstat   = new XoopsFormSelect(_MD_STATUS, "status");
+    $formstat->addOption("1", _MD_ACTIVE);
+    $formstat->addOption("0", _MD_INACTIVE);
+    $op_hidden  = new XoopsFormHidden("op", "addPartner");
+    $submit_button = new XoopsFormButton("", "submir", _MD_ADDPARTNER, "submit");
+    $form->addElement($formweight);
+    $form->addElement($formimage);
+    $form->addElement($formurl, true);
+    $form->addElement($formtitle, true);
+    $form->addElement($formdesc, true);
+    $form->addElement($formstat);
+    $form->addElement($op_hidden);
+    $form->addElement($submit_button);
+    $form->display();
+    xoops_cp_footer();
+}
+
+function editPartner($id)
+{
+    $xoopsDB =& Database::getInstance();
+    $myts =& MyTextSanitizer::getInstance();
+    xoops_cp_header();
+    echo "<h4>"._MD_PARTNERADMIN."</h4>";
+    $result = $xoopsDB->query("SELECT weight, hits, url, image, title, description, status FROM ".$xoopsDB->prefix("partners")." WHERE id=$id");
+    list($weight, $hits, $url, $image, $title, $description, $status) = $xoopsDB->fetchrow($result);
+    $url          = $myts->makeTboxData4Edit($url);
+    $image        = $myts->makeTboxData4Edit($image);
+    $title        = $myts->makeTboxData4Edit($title);
+    $description  = $myts->makeTboxData4Edit($description);
+    include XOOPS_ROOT_PATH."/class/xoopsformloader.php";
+    $form         = new XoopsThemeForm(_MD_EDITPARTNER, "editform", "index.php");
+    $formweight   = new XoopsFormText(_MD_WEIGHT, "weight", 3, 10, $weight);
+    $formhits     = new XoopsFormText(_MD_HITS, "hits", 3, 10, $hits);
+    $formimage    = new XoopsFormText(_MD_IMAGE, "image", 50, 150, $image);
+    $formurl      = new XoopsFormText(_MD_URL, "url", 50, 150, $url);
+    $formtitle    = new XoopsFormText(_MD_TITLE, "title", 50, 50, $title);
+    $formdesc     = new XoopsFormTextArea(_MD_DESCRIPTION, "description", $description, 10, "100%");
+    $formstat     = new XoopsFormSelect(_MD_STATUS, "status", $status);
+    $formstat->addOption("1", _MD_ACTIVE);
+    $formstat->addOption("0", _MD_INACTIVE);
+    $id_hidden    = new XoopsFormHidden("id", $id);
+    $op_hidden    = new XoopsFormHidden("op", "updatePartner");
+    $submit_button = new XoopsFormButton("", "submit", _MD_EDITPARTNER, "submit");
+    $form->addElement($formweight);
+    $form->addElement($formhits);
+    $form->addElement($formimage);
+    $form->addElement($formurl, true);
+    $form->addElement($formtitle, true);
+    $form->addElement($formdesc, true);
+    $form->addElement($formstat);
+    $form->addElement($id_hidden);
+    $form->addElement($op_hidden);
+    $form->addElement($submit_button);
+    $form->display();
+    xoops_cp_footer();
+}
+
+$op = '';
+
+if (!empty($_GET['op'])) {
+    $op = $_GET['op'];
+    if (isset($_GET['id'])) {
+        $id = intval($_GET['id']);
+    }
+} elseif (!empty($_POST['op'])) {
+    $op = $_POST['op'];
+}
+switch ($op) {
+
+case "partnersAdminAdd":
+    partnersAdminAdd();
+    break;
+
+case "updatePartner":
+    $xoopsDB =& Database::getInstance();
+    $myts =& MyTextSanitizer::getInstance();
+    $title = isset($_POST['title']) ? trim($_POST['title']) : '';
+    $image = isset($_POST['image']) ? trim($_POST['image']) : '';
+    $url = isset($_POST['url']) ? trim($_POST['url']) : '';
+    $description = isset($_POST['description']) ? trim($_POST['description']) : '';
+    $id = intval($_POST['id']);
+    $status  = isset($_POST['status']) ? intval($_POST['status']) : 0;
+    if ($title == '' || $url == '' || empty($id) || $description == '') {
+        redirect_header("index.php?op=edit_partner&amp;id=$id", 1, _MD_BESURE);
+        exit();
+    }
+    $url          = $myts->makeTboxData4Save(formatURL($url));
+    $image        = $myts->makeTboxData4Save(formatURL($image));
+    $title        = $myts->makeTboxData4Save($title);
+    $description  = $myts->makeTboxData4Save($description);
+    if ($xoopsDB->query("UPDATE ".$xoopsDB->prefix("partners")." SET hits=".intval($_POST['hits']).", weight=".intval($_POST['weight']).", url='$url', image='$image', title='$title', description='$description', status=$status WHERE id=$id")) {
+        redirect_header("index.php", 1, _MD_UPDATED);
+    } else {
+        redirect_header("index.php", 1, _MD_NOTUPDATED);
+    }
+    break;
+
+case "addPartner":
+    $myts =& MyTextSanitizer::getInstance();
+    $title = isset($_POST['title']) ? trim($_POST['title']) : '';
+    $image = isset($_POST['image']) ? trim($_POST['image']) : '';
+    $url = isset($_POST['url']) ? trim($_POST['url']) : '';
+    $description = isset($_POST['description']) ? trim($_POST['description']) : '';
+    if ($title == '' || $url == '' || $description == '') {
+        redirect_header("index.php", 1, _MD_BESURE);
+        exit();
+    }
+    $url          = $myts->makeTboxData4Save(formatURL($url));
+    $image        = $myts->makeTboxData4Save(formatURL($image));
+    $title        = $myts->makeTboxData4Save($title);
+    $description  = $myts->makeTboxData4Save($description);
+    $status  = isset($_POST['status']) ? intval($_POST['status']) : 0;
+    $sql = "INSERT INTO ".$xoopsDB->prefix("partners")." VALUES (NULL, ".intval($_POST['weight']).", 0, '$url', '$image', '$title', '$description', $status)";
+    if ($xoopsDB->query($sql)) {
+        redirect_header("index.php", 1, _MD_UPDATED);
+    } else {
+        redirect_header("index.php", 1, _MD_NOTUPDATED);
+    }
+    exit();
+    break;
+
+case "delPartner":
+    xoops_cp_header();
+    echo "<h4>"._MD_PARTNERADMIN."</h4>";
+    xoops_confirm(array('op' => 'delPartnerOk', 'id' => $id), 'index.php', _MD_SUREDELETE);
+    xoops_cp_footer();
+    break;
+
+case "delPartnerOk":
+    $xoopsDB =& Database::getInstance();
+    $sql = sprintf("DELETE FROM %s WHERE id = %u", $xoopsDB->prefix("partners"), $_POST['id']);
+    if ( $xoopsDB->query($sql) ) {
+        redirect_header("index.php", 1, _MD_UPDATED);
+    } else {
+        redirect_header("index.php", 1, _MD_NOTUPDATED);
+    }
+    break;
+
+case "editPartner":
+    editPartner($id);
+    break;
+
+case "reorderPartners":
+    $xoopsDB =& Database::getInstance();
+    foreach ($_POST['weight'] as $id=>$order) {
+        if ( isset($id) && is_numeric($id) && isset($order) ) {
+        if ( !is_numeric($order) or empty($order)) { $order = 0; }
+            $xoopsDB->query("UPDATE ".$xoopsDB->prefix("partners")." SET weight='$order', status='".$_POST['status'][$id]."' WHERE id=$id");
+        }
+    }
+    redirect_header("./index.php", 1, _MD_UPDATED);
+    exit();
+    break;
+
+case "reorderAutoPartners":
+    reorderAutoPartners();
+    break;
+
+default:
+    partnersAdmin();
+    break;
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/admin/menu.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/admin/menu.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/admin/menu.php	(revision 405)
@@ -0,0 +1,35 @@
+<?php
+// $Id: menu.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Raul Recio (AKA UNFOR)                                            //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+$adminmenu[1]['title'] = _MI_PARTNERS_ADMIN_ADD;
+$adminmenu[1]['link']  = "admin/index.php?op=partnersAdminAdd";
+$adminmenu[2]['title'] = _MI_PARTNERS_ADMIN;
+$adminmenu[2]['link']  = "admin/index.php";
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/blocks/partners.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/blocks/partners.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/blocks/partners.php	(revision 405)
@@ -0,0 +1,195 @@
+<?php
+// $Id: partners.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+// ------------------------------------------------------------------------- //
+// Author: Raul Recio (AKA UNFOR)                                            //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+function b_xoopsPartners_show($options)
+{
+	global $xoopsDB;
+	$myts =& MyTextSanitizer::getInstance();
+	$block = array();
+	$arrayIds = array();
+	if ( !empty($options[2]) ) {
+		$arrayIds = xoopspartners_random($options[3]);
+	} else {
+		$arrayIds = xoopspartners_random($options[3],false,$options[5],$options[6]);
+	}
+	foreach ( $arrayIds as $id ) {
+		$result = $xoopsDB->query("SELECT id, url, image, title FROM ".$xoopsDB->prefix("partners")." WHERE id=$id");
+		list($id, $url, $image, $title) = $xoopsDB->fetchrow($result);
+		$url   = $myts->makeTboxData4Show($url);
+		$origtitle = $title;
+		$title = $myts->makeTboxData4Show($title);
+		$image = $myts->makeTboxData4Show($image);
+			if ( strlen($origtitle) > 19 ) {$title = $myts->makeTboxData4Show(substr($origtitle, 0,	19))."..";
+		}
+		$partners['id'] = $id;
+		$partners['url'] = $url;
+		if ( !empty($image) && ($options[4] == 1 || $options[4] == 3) ) {
+			$partners['image'] = $image;
+		}
+		if ( empty($image) || $options[4] == 2 || $options[4] == 3 ) {
+			$partners['title'] = $title;
+		} else {
+			$partners['title'] = '';
+		}
+		$block['partners'][] = $partners;
+	}
+	if ($options[0] == 1) {
+		$block['insertBr'] = true;
+	}
+	if( $options[1] == 1 ){
+		$block['fadeImage'] = 'style="filter:alpha(opacity=20);" onmouseover="nereidFade(this,100,30,5)" onmouseout="nereidFade(this,50,30,5)"';
+	}
+	return $block;
+}
+
+function xoopspartners_random($NumberPartners,$random=true,$orden="",$desc="")
+{
+	global $xoopsDB;
+	$PartnersId = array();
+	$ArrayReturn = array();
+	if ( $random ) {
+		$result = $xoopsDB->query("SELECT id FROM " .$xoopsDB->prefix("partners"). " WHERE status = 1");
+		$numrows = $xoopsDB->getRowsNum($result);
+	} else {
+		$result = $xoopsDB->query("SELECT id FROM " .$xoopsDB->prefix("partners"). " Where status = 1 ORDER BY ".$orden." ".$desc,$NumberPartners);
+	}
+	while ( $ret = $xoopsDB->fetchArray($result) ) {
+		$PartnersId[]= $ret['id'];
+	}
+	if (($numrows <= $NumberPartners) or (!$random) ) {
+		return $PartnersId;
+		exit();
+	}
+	$NumberTotal = 0;
+	$TotalPartner = count($PartnersId) - 1;
+	while ($NumberPartners > $NumberTotal) {
+		$RandomPart = mt_rand (0, $TotalPartner);
+		if  ( !in_array($PartnersId[$RandomPart],$ArrayReturn) ) {
+			$ArrayReturn[] = $PartnersId[$RandomPart];
+			$NumberTotal++;
+		}
+	}
+	return $ArrayReturn;
+}
+
+function b_xoopsPartners_edit($options)
+{
+	$form  = "<table border='0'>";
+	$form .= "<tr><td>"._MB_PARTNERS_PSPACE."</td><td>";
+	$chk   = "";
+	if ($options[0] == 0) {
+		$chk = " checked='checked'";
+	}
+	$form .= "<input type='radio' name='options[0]' value='0'".$chk." />"._NO."";
+	$chk   = "";
+	if ($options[0] == 1) {
+		$chk = " checked='checked'";
+	}
+	$form .= "<input type='radio' name='options[0]' value='1'".$chk." />"._YES."</td></tr>";
+	$form .= "<tr><td>"._MB_FADE."</td><td>";
+	$chk   = "";
+	if ( $options[1] == 0 ) {
+		$chk = " checked='checked'";
+	}
+	$form .= "<input type='radio' name='options[1]' value='0'".$chk." />"._NO."";
+	$chk   = "";
+	if ( $options[1] == 1 ) {
+		$chk = " checked='checked'";
+	}
+	$form .= "<input type='radio' name='options[1]' value='1'".$chk." />"._YES."</td></tr>";
+	$form .= "<tr><td>"._MB_BRAND."</td><td>";
+	$chk   = "";
+	if ( $options[2] == 0 ) {
+		$chk = " checked='checked'";
+	}
+	$form .= "<input type='radio' name='options[2]' value='0'".$chk." />"._NO."";
+	$chk   = "";
+	if ($options[2] == 1) {
+		$chk = " checked='checked'";
+	}
+	$form .= "<input type='radio' name='options[2]' value='1'".$chk." />"._YES."</td></tr>";
+	$form .= "<tr><td>"._MB_BLIMIT."</td><td>";
+	$form .= "<input type='text' name='options[3]' size='16' value='".$options[3]."' /></td></tr>";
+	$form .= "<tr><td>"._MB_BSHOW."</td><td>";
+	$form .= "<select size='1' name='options[4]'>";
+	$sel = "";
+	if ( $options[4] == 1 ) {
+		$sel = " selected='selected'";
+	}
+	$form .= "<option value='1' ".$sel.">"._MB_IMAGES."</option>";
+	$sel = "";
+	if ( $options[4] == 2 ) {
+		$sel = " selected='selected'";
+	}
+	$form .= "<option value='2' ".$sel.">"._MB_TEXT."</option>";
+	$sel = "";
+	if ( $options[4] == 3 ) {
+		$sel = " selected='selected'";
+	}
+	$form .= "<option value='3' ".$sel.">"._MB_BOTH."</option>";
+	$form .= "</select></td></tr>";
+	$form .= "<tr><td>"._MB_BORDER."</td><td>";
+	$form .= "<select size='1' name='options[5]'>";
+	$sel = "";
+	if ( $options[5] == "id" ) {
+		$sel = " selected='selected'";
+	}
+	$form .= "<option value='id' ".$sel.">"._MB_ID."</option>";
+	$sel = "";
+	if ( $options[5] == "hits" ) {
+		$sel = " selected='selected'";
+	}
+	$form .= "<option value='hits' ".$sel.">"._MB_HITS."</option>";
+	$sel = "";
+	if ( $options[5] == "title" ) {
+		$sel = " selected='selected'";
+	}
+	$form .= "<option value='title' ".$sel.">"._MB_TITLE."</option>";
+	if ( $options[5] == "weight" ) {
+		$sel = " selected='selected'";
+	}
+	$form .= "<option value='weight' ".$sel.">"._MB_WEIGHT."</option>";
+	$form .= "</select> ";
+	$form .= "<select size='1' name='options[6]'>";
+	$sel = "";
+	if ( $options[6] == "ASC" ) {
+		$sel = " selected='selected'";
+	}
+	$form .= "<option value='ASC' ".$sel.">"._MB_ASC."</option>";
+	$sel = "";
+	if ( $options[6] == "DESC" ) {
+		$sel = " selected='selected'";
+	}
+	$form .= "<option value='DESC' ".$sel.">"._MB_DESC."</option>";
+	$form .= "</select></td></tr>";
+	$form .= "</table>";
+	return $form;
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/blocks/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/blocks/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/blocks/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/index.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/index.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/index.php	(revision 405)
@@ -0,0 +1,96 @@
+<?php
+// $Id: index.php,v 1.4 2005/08/03 12:40:02 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+// ------------------------------------------------------------------------- //
+// Author: Raul Recio (AKA UNFOR)                                            //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+include "header.php";
+$xoopsOption['template_main'] = 'xoopspartners_index.html';
+include XOOPS_ROOT_PATH."/header.php";
+$part = new PartnerSystem();
+$start = isset($_GET['start']) ? intval($_GET['start']) : 0;
+
+$admin = 0;
+if ($xoopsUser) {
+    $xoopsTpl->assign("partner_join" ,"<a href='join.php'><b>"._MD_JOIN."</b></a>");
+}
+$query = $xoopsDB->query("SELECT COUNT(*) FROM ".$xoopsDB->prefix("partners")." WHERE status=1");
+list($numrows) = $xoopsDB->fetchrow($query);
+if( $xoopsModuleConfig['modlimit'] != 0 ) {
+    $partners = $part->getAllPartners("status = 1",true,$xoopsModuleConfig['modorder'],$xoopsModuleConfig['modorderd'],$xoopsModuleConfig['modlimit'],$start);
+}else{
+    $partners = $part->getAllPartners("status = 1",true,$xoopsModuleConfig['modorder'],$xoopsModuleConfig['modorderd']);
+}
+foreach ( $partners as $part_obj ) {
+    $array_partners[] = array(
+            "id"                  =>  $part_obj->getVar("id"),
+            "hits"                =>  $part_obj->getVar("hits"),
+            "url"                 =>  $part_obj->getVar("url"),
+            "image"               =>  $part_obj->getVar("image"),
+            "title"               =>  $part_obj->getVar("title"),
+            "description"         =>  $part_obj->getVar("description")
+            );
+}
+$partner_count = count($array_partners);
+for ( $i = 0; $i < $partner_count; $i++ ) {
+    $ImagePartner = "<a href='vpartner.php?id=".$array_partners[$i]["id"]."' target='_blank'>";
+    if ( !empty($array_partners[$i]["image"]) && ($xoopsModuleConfig['modshow'] == 1 || $xoopsModuleConfig['modshow'] == 3) ) {
+        $ImagePartner .= "<img src='".$array_partners[$i]["image"]."' alt='".$array_partners[$i]["url"]."' width='102' height='47' border='0' />";
+    }
+    if ( $xoopsModuleConfig['modshow'] == 3 ) {
+        $ImagePartner .= "<br />";
+    }
+    if ( empty($array_partners[$i]["image"]) || $xoopsModuleConfig['modshow'] == 2 || $xoopsModuleConfig['modshow'] == 3 ) {
+        $ImagePartner .= $array_partners[$i]["title"];
+    }
+    $ImagePartner .= "</a>";
+    $partner[$i]['id']           = $array_partners[$i]['id'];
+    $partner[$i]['hits']         = $array_partners[$i]['hits'];
+    $partner[$i]['url']          = $array_partners[$i]['url'];
+    $partner[$i]['image']        = $ImagePartner;
+    $partner[$i]['title']        = $array_partners[$i]['title'];
+    $partner[$i]['description']  = $array_partners[$i]['description'];
+    if ($xoopsUserIsAdmin) {
+        $partner[$i]['admin_option']  = "<br />[<a href='admin/index.php?op=editPartner&amp;id=".$array_partners[$i]["id"]."'>"._MD_EDIT."</a>] [<a href='admin/index.php?op=delPartner&amp;id=".$array_partners[$i]["id"]."'>"._MD_DELETE."</a>]";
+    }
+    $xoopsTpl->append("partners", $partner[$i]);
+}
+if ( $xoopsModuleConfig['modlimit'] != 0 ) {
+    $nav = new XoopsPageNav($numrows,$xoopsModuleConfig['modlimit'],$start);
+    $pagenav = $nav->renderImageNav();
+}
+$xoopsTpl->assign(array(
+        "lang_partner"         => _MD_PARTNER,
+        "lang_desc"            => _MD_DESCRIPTION,
+        "lang_hits"            => _MD_HITS,
+        "lang_no_partners"     => _MD_NOPART,
+        "lang_main_partner"    => _MD_PARTNERS,
+        "sitename"             => htmlspecialchars($xoopsConfig['sitename']),
+        "pagenav"              => $pagenav
+        ));
+include_once XOOPS_ROOT_PATH.'/footer.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/header.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/header.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/header.php	(revision 405)
@@ -0,0 +1,34 @@
+<?php
+// $Id: header.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Raul Recio (AKA UNFOR)                                            //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+include "../../mainfile.php";
+include XOOPS_ROOT_PATH.'/modules/xoopspartners/class/partners.php';
+include XOOPS_ROOT_PATH."/class/pagenav.php";
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/templates/xoopspartners_join.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/templates/xoopspartners_join.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/templates/xoopspartners_join.html	(revision 405)
@@ -0,0 +1,15 @@
+<h3><a href="index.php"><{$sitename}> <{$lang_main_partner}></a></h3>
+<br />
+<div align="center">
+<table border="0" cellpadding="0" cellspacing="0" valign="top" width="98%" class="info">
+  <tr>
+    <td>
+      <table width="100%" border="0" cellpadding="4" cellspacing="1">
+        <tr>
+          <td width="100%" align="left"><b><{$lang_join}></b><{$content4join}></td>
+        </tr>
+      </table>
+    </td>
+  </tr>
+</table>
+</div>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/templates/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/templates/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/templates/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/templates/blocks/xoopspartners_block_site.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/templates/blocks/xoopspartners_block_site.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/templates/blocks/xoopspartners_block_site.html	(revision 405)
@@ -0,0 +1,51 @@
+<table cellspacing="0">
+  <tr>
+    <td>
+    <{if $block.fadeImage != ""}>
+    <{literal}>
+    <script type="text/javascript">
+    <!--
+    nereidFadeObjects = new Object();
+    nereidFadeTimers = new Object();
+    function nereidFade(object, destOp, rate, delta){
+        if (!document.all) {
+            return;
+        }
+        if (object != '[object]'){
+            setTimeout('nereidFade('+object+','+destOp+','+rate+','+delta+')',0);
+            return;
+        }
+        clearTimeout(nereidFadeTimers[object.sourceIndex]);
+        diff = destOp-object.filters.alpha.opacity;
+        direction = 1;
+        if (object.filters.alpha.opacity > destOp){
+            direction = -1;
+        }
+        delta = Math.min(direction*diff,delta);
+        object.filters.alpha.opacity+=direction*delta;
+
+        if (object.filters.alpha.opacity != destOp){
+            nereidFadeObjects[object.sourceIndex]=object;
+            nereidFadeTimers[object.sourceIndex]=setTimeout('nereidFade(nereidFadeObjects['+object.sourceIndex+'],'+destOp+','+rate+','+delta+')',rate);
+        }
+    }
+    //-->
+    </script>
+    <{/literal}>
+    <{/if}>
+      <br />
+      <{foreach item=partner from=$block.partners}>
+      <a href="<{$xoops_url}>/modules/xoopspartners/vpartner.php?id=<{$partner.id}>" target="_blank">
+      <{if $partner.image != ""}>
+      <img src="<{$partner.image}>" width="102" height="47" border="0" alt="<{$partner.url}>" <{$block.fadeImage}> /><br />
+      <{/if}>
+      <{$partner.title}>
+      </a>
+      <{if $block.insertBr != ""}>
+      <br />
+      <{/if}>
+      <br />
+      <{/foreach}>
+    </td>
+  </tr>
+</table>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/templates/blocks/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/templates/blocks/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/templates/blocks/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/templates/xoopspartners_index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/templates/xoopspartners_index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/templates/xoopspartners_index.html	(revision 405)
@@ -0,0 +1,37 @@
+<h4><{$sitename}> <{$lang_main_partner}></h4>
+
+<table cellspacing='0' border='0' width='98%'>
+  <tr>
+    <td width='50%' align='left'><{$partner_join}></td>
+    <td width='50%' align='left'><{$pagenav}></td>
+  </tr>
+</table>
+
+<table class='outer' cellspacing='1' width='98%'>
+  <tr>
+    <th width='5%' align='left' nowrap='nowrap'><{$lang_partner}></th>
+    <th align='left'><{$lang_desc}></th>
+    <th width='1%' align='left' nowrap='nowrap'><{$lang_hits}></th>
+  </tr>
+
+<{section name=partner loop=$partners}>
+  <tr>
+    <td class='even' width='5%' valign='middle' align='center'><{$partners[partner].image}></td>
+    <td class='odd' align='left' valign='top'><b><{$partners[partner].title}></b> <br /><{$partners[partner].description}><{$partners[partner].admin_option}></td>
+    <td width='1%' valign='middle' align='center' class='even'><{$partners[partner].hits}></td>
+  </tr>
+<{sectionelse}>
+
+  <tr>
+    <td class='even' valign='middle' align='center' colspan='3'><{$lang_no_partners}></td>
+  </tr>
+<{/section}>
+
+</table>
+
+<table cellspacing='0' border='0' width='98%'>
+  <tr>
+    <td width='50%' align='left'><{$partner_join}></td>
+    <td width='50%' align='left'><{$pagenav}></td>
+  </tr>
+</table>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/sql/mysql.sql
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/sql/mysql.sql	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/sql/mysql.sql	(revision 405)
@@ -0,0 +1,26 @@
+# phpMyAdmin MySQL-Dump
+# version 2.3.2
+# http://www.phpmyadmin.net/ (download page)
+#
+# servidor: localhost
+# Tiempo de generacióî: 26-10-2002 a las 21:07:06
+# Versióî del servidor: 3.23.32
+# Versióî de PHP: 4.2.2
+# --------------------------------------------------------
+
+#
+# Estructura de tabla para la tabla `xoops_partners`
+#
+
+CREATE TABLE partners (
+  id int(10) NOT NULL auto_increment,
+  weight int(10) NOT NULL default '0',
+  hits int(10) NOT NULL default '0',
+  url varchar(150) NOT NULL default '',
+  image varchar(150) NOT NULL default '',
+  title varchar(50) NOT NULL default '',
+  description varchar(255) default NULL,
+  status tinyint(1) NOT NULL default '1',
+  PRIMARY KEY (id),
+  KEY status(status)
+) TYPE=MyISAM;
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/sql/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/sql/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/sql/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/language/japanese/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/language/japanese/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/language/japanese/index.html	(revision 405)
@@ -0,0 +1,1 @@
+<script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/language/japanese/main.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/language/japanese/main.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/language/japanese/main.php	(revision 405)
@@ -0,0 +1,51 @@
+<?php
+// $Id: main.php,v 1.2 2005/03/18 13:00:59 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+define("_MD_EDIT", "ÊÔ½¸");
+define("_MD_DELETE", "ºï½ü");
+define("_MD_JOIN", "¥Ñ¡¼¥È¥Ê¡¼¥µ¥¤¥ÈÅÐÏ¿¤ò¿½¹þ¤à"); 
+define("_MD_PARTNERS", "¥Ñ¡¼¥È¥Ê¡¼");
+define("_MD_PARTNER", "¥Ñ¡¼¥È¥Ê¡¼");
+define("_MD_DESCRIPTION", "ÀâÌÀ");
+define("_MD_HITS", "¥Ò¥Ã¥È¿ô");
+define("_MD_NOPART", "¥Ñ¡¼¥È¥Ê¡¼¤¬¤ß¤Ä¤«¤ê¤Þ¤»¤ó");
+//file join.php
+define("_MD_IMAGE", "²èÁü:");
+define("_MD_TITLE", "¥¿¥¤¥È¥ë:");
+define("_MD_URL", "¥µ¥¤¥ÈURL:");
+define("_MD_SEND", "EmailÁ÷¿®");
+define("_MD_ERROR1", "<center>ERROR: ¥¨¥é¡¼¤¬È¯À¸¤·¤Þ¤·¤¿¡£ ÆþÎÏÆâÍÆ¤ò³ÎÇ§¤·¤Æ<a href='javascript:history.back(1)'>ºÆÅÙ¼Â¹Ô¤·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤</a></center>");
+define("_MD_ERROR2", "<center>²èÁü¥µ¥¤¥º¤¬ 110x50 ¤ò±Û¤¨¤Æ¤¤¤Þ¤¹¡£ <a href='javascript:history.back(1)'>Â¾¤Î¥¤¥á¡¼¥¸¤ÇºÆÅÙ¼Â¹Ô¤·¤Æ¤¯¤À¤µ¤¤</a></center>");
+define("_MD_ERROR3", "<center>²èÁü¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Þ¤»¤ó¡£ <a href='javascript:history.back(1)'>³ÎÇ§¤·¤ÆºÆÅÙ¼Â¹Ô¤·¤Æ¤¯¤À¤µ¤¤¡£</a></center>");
+define("_MD_GOBACK", "<a href='javascript:history.back(1)'>Ìá¤ë</a>");
+define("_MD_NEWPARTNER", "%s¤ËÂÐ¤¹¤ë¥Ñ¡¼¥È¥Ê¡¼¥µ¥¤¥ÈÅÐÏ¿´õË¾¤Î¿½¹þ¤ß");
+define("_MD_SENDMAIL", "¥µ¥¤¥È´ÉÍý¿Í¤Ø¤ÈÅÐÏ¿´õË¾¤Î¥á¡¼¥ë¤òÁ÷¿®¤·¤Þ¤·¤¿¡£<br /><a href='index.php'>Ìá¤ë</a>");
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/language/japanese/join.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/language/japanese/join.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/language/japanese/join.tpl	(revision 405)
@@ -0,0 +1,12 @@
+{USER}¤µ¤ó¡ÊIP¥¢¥É¥ì¥¹¡§{IP}¡Ë¤è¤ê¡Ö{SITENAME}¡×¤Ç¤Î¥Ñ¡¼¥È¥Ê¡¼¥µ¥¤¥ÈÅÐÏ¿´õË¾¤Î¥ê¥¯¥¨¥¹¥È¤¬¤¢¤ê¤Þ¤·¤¿¡£
+
+¥µ¥¤¥ÈÌ¾¡§¡¡{TITLE}
+URL¡§¡¡{URL}
+²èÁü¡§¡¡{IMAGE}
+ÀâÌÀ¡§¡¡{DESCRIPTION}
+
+¤³¤Î¥µ¥¤¥È¤ò¥Ñ¡¼¥È¥Ê¡¼¤È¤·¤ÆÅÐÏ¿¤¹¤ë¤Ë¤Ï²¼µ­¥ê¥ó¥¯¤ò¥¯¥ê¥Ã¥¯¤·¤Æ¤¯¤À¤µ¤¤¡§
+{SITEURL}modules/xoopspartners/admin/index.php?op=partners_manage_add
+
+-----------
+{SITENAME} ({SITEURL}) 
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/language/japanese/admin.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/language/japanese/admin.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/language/japanese/admin.php	(revision 405)
@@ -0,0 +1,57 @@
+<?php
+// $Id: admin.php,v 1.2 2005/03/18 13:00:59 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+define('_MD_PARTNERADMIN', '¥Ñ¡¼¥È¥Ê¡¼´ÉÍý');
+define('_MD_URL', 'URL');
+define('_MD_HITS', '¥Ò¥Ã¥È¿ô');
+define('_MD_IMAGE', '²èÁü');
+define('_MD_TITLE', '¥¿¥¤¥È¥ë');
+define('_MD_WEIGHT', 'É½¼¨½ç');
+define('_MD_DESCRIPTION', 'ÀâÌÀ');
+define('_MD_STATUS', '¾õÂÖ');
+define('_MD_ACTIVE', '¥¢¥¯¥Æ¥£¥Ö');
+define('_MD_INACTIVE', 'Èó¥¢¥¯¥Æ¥£¥Ö');
+define('_MD_REORDER', 'ÊÂÂØ¤¨');
+define('_MD_UPDATED', 'ÀßÄê¤ò¹¹¿·¤·¤Þ¤·¤¿');
+define('_MD_NOTUPDATED', 'ÀßÄê¤ò¹¹¿·¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿');
+define('_MD_BESURE', '¥¿¥¤¥È¥ë¡¢URL¡¢ÀâÌÀ¤òÆþÎÏ¤¹¤ëÉ¬Í×¤¬¤¢¤ê¤Þ¤¹');
+define('_MD_NOEXITS', '²èÁü¥Õ¥¡¥¤¥ë¤¬¤ß¤Ä¤«¤ê¤Þ¤»¤ó');
+define('_MD_ADDPARTNER', 'ÄÉ²Ã');
+define('_MD_EDITPARTNER', '¹¹¿·');
+define('_MD_EDIT', 'ÊÔ½¸');
+define('_MD_DELETE', 'ºï½ü');
+define('_MD_SUREDELETE', 'ËÜÅö¤Ë¤³¤Î¥µ¥¤¥È¤òºï½ü¤·¤Æ¤â¤è¤í¤·¤¤¤Ç¤¹¤«¡©');
+define('_MD_YES', '¤Ï¤¤');
+define('_MD_NO', '¤¤¤¤¤¨');
+define('_MD_IMAGE_ERROR', '²èÁü¥µ¥¤¥º¤¬ 110x50 ¤ò±Û¤¨¤Æ¤¤¤Þ¤¹');
+define('_MD_PARTNERS_ADD','¥Ñ¡¼¥È¥Ê¡¼¤ÎÄÉ²Ã');
+define('_MD_AUTOMATIC_SORT', '¼«Æ°ºÎÈÖÊÂÂØ¤¨');
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/language/japanese/modinfo.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/language/japanese/modinfo.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/language/japanese/modinfo.php	(revision 405)
@@ -0,0 +1,48 @@
+<?php
+// $Id: modinfo.php,v 1.2 2005/03/18 13:00:59 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+define('_MI_PARTNERS_NAME', '¥Ñ¡¼¥È¥Ê¡¼¥µ¥¤¥È');
+define('_MI_PARTNERS_DESC', '¥Ñ¡¼¥È¥Ê¡¼¥µ¥¤¥È¤Î¾ðÊó¤ò¥Ö¥í¥Ã¥¯¤ä¥â¥¸¥å¡¼¥ë¤È¤·¤ÆÉ½¼¨¤·¤Þ¤¹');
+define('_MI_PARTNERS_ADMIN', '¥Ñ¡¼¥È¥Ê¡¼¤ÎÊÔ½¸');
+define('_MI_PARTNERS_ADMIN_ADD', '¥Ñ¡¼¥È¥Ê¡¼¤ÎÄÉ²Ã');
+define('_MI_ID', 'ID');
+define('_MI_HITS', '¥Ò¥Ã¥È¿ô');
+define('_MI_TITLE', '¥¿¥¤¥È¥ë');
+define('_MI_WEIGHT', 'ÀßÄê¤µ¤ì¤¿É½¼¨½ç');
+define('_MI_RECLICK', 'ºÆ¥¯¥ê¥Ã¥¯¤Î»þ´Ö:');
+define('_MI_IMAGES', '²èÁü');
+define('_MI_TEXT', 'Ê¸»ú');
+define('_MI_BOTH', '²èÁü¤ÈÊ¸»ú');
+define('_MI_MLIMIT', '£±¥Ú¡¼¥¸¤ËÉ½¼¨¤¹¤ë·ï¿ô: (0=ÌµÀ©¸Â)');
+define('_MI_MSHOW', '¥Ú¡¼¥¸¤ËÉ½¼¨¤¹¤ëÆâÍÆ');
+define('_MI_MORDER', 'É½¼¨¤Î¥½¡¼¥ÈÊýË¡:');
+define('_MI_HOUR', '1»þ´Ö');
+define('_MI_3HOURS', '3»þ´Ö');
+define('_MI_5HOURS', '5»þ´Ö');
+define('_MI_10HOURS', '10»þ´Ö');
+define('_MI_DAY', '1Æü');
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/language/japanese/blocks.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/language/japanese/blocks.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/language/japanese/blocks.php	(revision 405)
@@ -0,0 +1,48 @@
+<?php
+// $Id: blocks.php,v 1.2 2005/03/18 13:00:59 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+//define('_MB_PARTNERS_TITLE', '¥Ñ¡¼¥È¥Ê¡¼');
+define('_MB_PARTNERS_PSPACE', '¥Ñ¡¼¥È¥Ê¡¼¤È¥Ñ¡¼¥È¥Ê¡¼¤Î´Ö¤Ë¥¹¥Ú¡¼¥¹¤ò¤¢¤±¤ë');
+define('_MB_BRAND', '¥Ö¥í¥Ã¥¯¤ËÉ½¼¨¤¹¤ë¥Ñ¡¼¥È¥Ê¡¼¤ò¥é¥ó¥À¥à¤Ë·è¤á¤ë');
+define('_MB_BLIMIT', '¥Ú¡¼¥¸¤ËÉ½¼¨¤¹¤ë·ï¿ô: (0=ÌµÀ©¸Â)');
+define('_MB_BSHOW', '¥Ö¥í¥Ã¥¯¤ËÉ½¼¨¤¹¤ëÆâÍÆ');
+define('_MB_BORDER', 'É½¼¨¤Î¥½¡¼¥È½ç');
+define('_MB_ID', 'ID');
+define('_MB_HITS', '¥Ò¥Ã¥È¿ô');
+define('_MB_TITLE', '¥¿¥¤¥È¥ë');
+define('_MB_WEIGHT', 'ÊÂ¤Ó½ç');
+define('_MB_ASC', '¾º½ç');
+define('_MB_DESC', '¹ß½ç');
+define('_MB_IMAGES', '²èÁü');
+define('_MB_TEXT', 'Ê¸»ú');
+define('_MB_BOTH', '²èÁü¤ÈÊ¸»ú');
+define('_MB_FADE', '²èÁü¤Î¥Õ¥§¡¼¥É¥¤¥ó/¥¢¥¦¥È');
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/language/english/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/language/english/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/language/english/index.html	(revision 405)
@@ -0,0 +1,1 @@
+<script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/language/english/main.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/language/english/main.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/language/english/main.php	(revision 405)
@@ -0,0 +1,47 @@
+<?php
+// $Id: main.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+define("_MD_EDIT", "Edit");
+define("_MD_DELETE", "Delete");
+define("_MD_JOIN", "Become a Partner");
+define("_MD_PARTNERS", "Partners");
+define("_MD_PARTNER", "Partner");
+define("_MD_DESCRIPTION", "Description");
+define("_MD_HITS", "Hits");
+define("_MD_NOPART", "No such partner.");
+//file join.php
+define("_MD_IMAGE", "Image:");
+define("_MD_TITLE", "Title:");
+define("_MD_URL", "URL:");
+define("_MD_SEND", "Send Email");
+define("_MD_ERROR1", "<center>ERROR: There was an error. <a href='javascript:history.back(1)'>Try again</a></center>");
+define("_MD_ERROR2", "<center>Image size is larger than 110x50. <a href='javascript:history.back(1)'>Try with another image</a></center>");
+define("_MD_ERROR3", "<center>The image file doesn't exist. <a href='javascript:history.back(1)'>Try with another image</a></center>");
+define("_MD_GOBACK", "<a href='javascript:history.back(1)'>Back</a>");
+define("_MD_NEWPARTNER", "%s Partners Request");
+define("_MD_SENDMAIL", "Request mail sent to the administrator.<br /><a href='index.php'>Return to index</a>");
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/language/english/join.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/language/english/join.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/language/english/join.tpl	(revision 405)
@@ -0,0 +1,17 @@
+Hello.
+
+You have received one request to become partner of your site {SITENAME} 
+The request was sent by the user {USER} from the IP {IP} 
+The information you provide us in the join form was:  
+
+Títle: {TITLE}
+URL:    {URL}
+Image: {IMAGE}
+Description:
+{DESCRIPTION}
+
+Can add this request from this url:
+{SITEURL}modules/xoopspartners/admin/index.php?op=partners_manage_add
+
+-----------
+{SITENAME} ({SITEURL}) 
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/language/english/admin.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/language/english/admin.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/language/english/admin.php	(revision 405)
@@ -0,0 +1,53 @@
+<?php
+// $Id: admin.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+define('_MD_PARTNERADMIN', 'Partners Administration');
+define('_MD_URL', 'URL');
+define('_MD_HITS', 'Hits');
+define('_MD_IMAGE', 'Image');
+define('_MD_TITLE', 'Title');
+define('_MD_WEIGHT', 'Weight');
+define('_MD_DESCRIPTION', 'Description');
+define('_MD_STATUS', 'Status');
+define('_MD_ACTIVE', 'Active');
+define('_MD_INACTIVE', 'Inactive');
+define('_MD_REORDER', 'Sort');
+define('_MD_UPDATED', 'Settings Updated!');
+define('_MD_NOTUPDATED', 'Could not update settings!');
+define('_MD_BESURE', 'Be sure to enter at least a title, a URL and a description.');
+define('_MD_NOEXITS', "Image file doesn't exist");
+define('_MD_ADDPARTNER', 'Add');
+define('_MD_EDITPARTNER', 'Edit');
+define('_MD_EDIT', 'Edit');
+define('_MD_DELETE', 'Delete');
+define('_MD_SUREDELETE', 'Are you sure you want to delete this site?');
+define('_MD_YES', 'Yes');
+define('_MD_NO', 'No');
+define('_MD_IMAGE_ERROR', 'Image size is larger than 110x50!');
+define('_MD_PARTNERS_ADD','Add Partner');
+define('_MD_AUTOMATIC_SORT', 'Automatic sort');
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/language/english/modinfo.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/language/english/modinfo.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/language/english/modinfo.php	(revision 405)
@@ -0,0 +1,48 @@
+<?php
+// $Id: modinfo.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+define('_MI_PARTNERS_NAME', 'Partners');
+define('_MI_PARTNERS_DESC', 'Shows partner sites in a block and in a module');
+define('_MI_PARTNERS_ADMIN', 'Manage Partners');
+define('_MI_PARTNERS_ADMIN_ADD', 'Add Partner');
+define('_MI_ID', 'ID');
+define('_MI_HITS', 'Hits');
+define('_MI_TITLE', 'Title');
+define('_MI_WEIGHT', 'Weight');
+define('_MI_RECLICK', 'Reclick Time:');
+define('_MI_IMAGES', 'Images');
+define('_MI_TEXT', 'Text Links');
+define('_MI_BOTH', 'Both');
+define('_MI_MLIMIT', 'Limit main page to xx entries: (0 = no limit)');
+define('_MI_MSHOW', 'On main page show:');
+define('_MI_MORDER', 'Order main page content by:');
+define('_MI_HOUR', '1 hour');
+define('_MI_3HOURS', '3 hours');
+define('_MI_5HOURS', '5 hours');
+define('_MI_10HOURS', '10 hours');
+define('_MI_DAY', '1 day');
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/language/english/blocks.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/language/english/blocks.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/language/english/blocks.php	(revision 405)
@@ -0,0 +1,43 @@
+<?php
+// $Id: blocks.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+define('_MB_PARTNERS_PSPACE', 'Put spaces between partners?');
+define('_MB_BRAND', 'Randomize partners in blocks?');
+define('_MB_BLIMIT', 'Limit blocks to xx entries: (0 = no limit)');
+define('_MB_BSHOW', 'In blocks show:');
+define('_MB_BORDER', 'Order block content by:');
+define('_MB_ID', 'ID');
+define('_MB_HITS', 'Hits');
+define('_MB_TITLE', 'Title');
+define('_MB_WEIGHT', 'Weight');
+define('_MB_ASC', 'Ascending');
+define('_MB_DESC', 'Descending');
+define('_MB_IMAGES', 'Images');
+define('_MB_TEXT', 'Text Links');
+define('_MB_BOTH', 'Both');
+define('_MB_FADE', 'Fade Image');
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/language/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/language/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/language/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/xoops_version.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/xoops_version.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspartners/xoops_version.php	(revision 405)
@@ -0,0 +1,123 @@
+<?php
+// $Id: xoops_version.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+// ------------------------------------------------------------------------- //
+// Author: Raul Recio (AKA UNFOR)                                            //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+$modversion['name']		= _MI_PARTNERS_NAME;
+$modversion['version']		= 1.1;
+$modversion['author'] = 'Raul Recio (AKA UNFOR)';
+$modversion['description']	= _MI_PARTNERS_DESC;
+$modversion['credits']		= "The XOOPS Project";
+$modversion['license']		= "GPL see LICENSE";
+$modversion['help']		= "xoopspartners.html";
+$modversion['official']		= 1;
+$modversion['image']		= "images/logo.png";
+$modversion['dirname']		= "xoopspartners";
+
+// All tables should not have any prefix!
+$modversion['sqlfile']['mysql'] = "sql/mysql.sql";
+// Tables created by sql file (without prefix!)
+$modversion['tables'][0]	= "partners";
+
+// Admin things
+$modversion['hasAdmin']		= 1;
+$modversion['adminindex']	= "admin/index.php";
+$modversion['adminmenu']	= "admin/menu.php";
+
+// Blocks
+$modversion['blocks'][1]['file']	= "partners.php";
+$modversion['blocks'][1]['name']	= _MI_PARTNERS_NAME;
+$modversion['blocks'][1]['description']	= _MI_PARTNERS_DESC;
+$modversion['blocks'][1]['show_func']	= "b_xoopsPartners_show";
+$modversion['blocks'][1]['edit_func']	= "b_xoopsPartners_edit";
+$modversion['blocks'][1]['options']	= "1|1|1|1|1|hits|DESC";
+$modversion['blocks'][1]['template']	= 'xoopspartners_block_site.html';
+
+// Menu
+$modversion['hasMain']		= 1;
+
+// Templates
+$modversion['templates'][1]['file']	= 'xoopspartners_index.html';
+$modversion['templates'][1]['description'] = 'Partners main Screen';
+$modversion['templates'][2]['file']	= 'xoopspartners_join.html';
+$modversion['templates'][2]['description'] = 'Shows Join to the partners Form';
+
+// Config Settings (only for modules that need config settings generated automatically)
+
+// name of config option for accessing its specified value. i.e. $xoopsModuleConfig['storyhome']
+$modversion['config'][1]['name']	= 'cookietime';
+
+// title of this config option displayed in config settings form
+$modversion['config'][1]['title']	= '_MI_RECLICK';
+$modversion['config'][1]['description']	= '';
+
+// form element type used in config form for this option. can be one of either textbox, textarea, select, select_multi, yesno, group, group_multi
+$modversion['config'][1]['formtype']	= 'select';
+
+// value type of this config option. can be one of either int, text, float, array, or other
+// form type of 'group_multi', 'select_multi' must always be 'array'
+// form type of 'yesno', 'group' must be always be 'int'
+$modversion['config'][1]['valuetype']	= 'int';
+
+// the default value for this option
+// ignore it if no default
+// 'yesno' formtype must be either 0(no) or 1(yes)
+$modversion['config'][1]['default']	= 86400;
+$modversion['config'][1]['options']	= array('_MI_HOUR' => '3600','_MI_3HOURS' => '10800','_MI_5HOURS' =>  '18000','_MI_10HOURS'  =>  '36000','_MI_DAY' => '86400');
+
+$modversion['config'][2]['name']	= 'modlimit';
+$modversion['config'][2]['title']	= '_MI_MLIMIT';
+$modversion['config'][2]['description']	= '_MI_MLIMITDSC';
+$modversion['config'][2]['formtype']	= 'textbox';
+$modversion['config'][2]['valuetype']	= 'int';
+$modversion['config'][2]['default']	= 5;
+
+$modversion['config'][3]['name']	= 'modshow';
+$modversion['config'][3]['title']	= '_MI_MSHOW';
+$modversion['config'][3]['description']	= '_MI_MSHOWDSC';
+$modversion['config'][3]['formtype']	= 'select';
+$modversion['config'][3]['valuetype']	= 'int';
+$modversion['config'][3]['default']	= 1;
+$modversion['config'][3]['options']	= array('_MI_IMAGES' => 1, '_MI_TEXT' => 2, '_MI_BOTH' => 3);
+
+$modversion['config'][4]['name']	= 'modorder';
+$modversion['config'][4]['title']	= '_MI_MORDER';
+$modversion['config'][4]['description']	= '_MI_MORDERDSC';
+$modversion['config'][4]['formtype']	= 'select';
+$modversion['config'][4]['valuetype']	= 'text';
+$modversion['config'][4]['default']	= 'hits';
+$modversion['config'][4]['options']	= array('_MI_ID' => 'id', '_MI_HITS' => 'hits', '_MI_TITLE' => 'title', '_MI_WEIGHT' => 'weight');
+
+$modversion['config'][5]['name']	= 'modorderd';
+$modversion['config'][5]['title']	= '_MI_MORDER';
+$modversion['config'][5]['description']	= '_MI_MORDERDSC';
+$modversion['config'][5]['formtype']	= 'select';
+$modversion['config'][5]['valuetype']	= 'text';
+$modversion['config'][5]['default']	= 'DESC';
+$modversion['config'][5]['options']	= array('_ASCENDING' => 'ASC', '_DESCENDING' => 'DESC');
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/contact/index.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/contact/index.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/contact/index.php	(revision 405)
@@ -0,0 +1,113 @@
+<?php
+// $Id: index.php,v 1.6 2005/10/24 11:44:17 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+// ------------------------------------------------------------------------- //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+include "header.php";
+if ( empty($_POST['submit']) ) {
+    $xoopsOption['template_main'] = 'contact_contactusform.html';
+    include XOOPS_ROOT_PATH."/header.php";
+    include_once XOOPS_ROOT_PATH."/class/xoopsformloader.php";
+    $company_v = "";
+    $name_v = !empty($xoopsUser) ? $xoopsUser->getVar("uname", "E") : "";
+    $email_v = !empty($xoopsUser) ? $xoopsUser->getVar("email", "E") : "";
+    $url_v = !empty($xoopsUser) ? $xoopsUser->getVar("url", "E") : "";
+    $icq_v = !empty($xoopsUser) ? $xoopsUser->getVar("user_icq", "E") : "";
+    $location_v = !empty($xoopsUser) ? $xoopsUser->getVar("user_from", "E") : "";
+    $comment_v = "";
+    include "contactform.php";
+    $contact_form->assign($xoopsTpl);
+    include XOOPS_ROOT_PATH."/footer.php";
+} else {
+    $myts =& MyTextSanitizer::getInstance();
+    $usersEmail = $myts->stripSlashesGPC($_POST['usersEmail']);
+	if(!checkEmail($usersEmail)) {
+		// ToDo: use message catalog
+		redirect_header(XOOPS_URL."/modules/".$xoopsModule->getVar('dirname')."/index.php",2,"EMAIL ERROR");
+		exit();
+	}
+
+    $usersCompanyName = $myts->stripSlashesGPC($_POST['usersCompanyName']);
+    $usersCompanyLocation = $myts->stripSlashesGPC($_POST['usersCompanyLocation']);
+    $usersComments = $myts->stripSlashesGPC($_POST['usersComments']);
+    $usersName = $myts->stripSlashesGPC($_POST['usersName']);
+
+    $adminMessage = sprintf(_CT_SUBMITTED,$usersName);
+    $adminMessage .= "\n";
+    $adminMessage .= ""._CT_EMAIL." $usersEmail\n";
+    if ( !empty($_POST['usersSite']) ) {
+        $adminMessage .= _CT_URL." ".$myts->stripSlashesGPC($_POST['usersSite'])."\n";
+    }
+    if ( !empty($_POST['usersICQ']) ) {
+        $adminMessage .= _CT_ICQ." ".$myts->stripSlashesGPC($_POST['usersICQ'])."\n";
+    }
+    if ( !empty($usersCompanyName) ) {
+        $adminMessage .= _CT_COMPANY. " $usersCompanyName\n";
+    }
+    if ( !empty($usersCompanyLocation) ) {
+        $adminMessage .= _CT_LOCATION." $usersCompanyLocation\n";
+    }
+    $adminMessage .= _CT_COMMENTS."\n";
+    $adminMessage .= "\n$usersComments\n";
+    $adminMessage .= "\n".$_SERVER['HTTP_USER_AGENT']."\n";
+    $subject = $xoopsConfig['sitename']." - "._CT_CONTACTFORM;
+    $xoopsMailer =& getMailer();
+    $xoopsMailer->useMail();
+    $xoopsMailer->setToEmails($xoopsConfig['adminmail']);
+    $xoopsMailer->setFromEmail($usersEmail);
+    $xoopsMailer->setFromName($xoopsConfig['sitename']);
+    $xoopsMailer->setSubject($subject);
+    $xoopsMailer->setBody($adminMessage);
+    $xoopsMailer->send();
+    $messagesent = sprintf(_CT_MESSAGESENT,$xoopsConfig['sitename'])."<br />"._CT_THANKYOU."";
+
+    // uncomment the following lines if you want to send confirmation mail to the user
+    /*
+    $conf_subject = _CT_THANKYOU;
+    $userMessage = sprintf(_CT_HELLO,$usersName);
+    $userMessage .= "\n\n";
+    $userMessage .= sprintf(_CT_THANKYOUCOMMENTS,$xoopsConfig['sitename']);
+    $userMessage .= "\n";
+    $userMessage .= sprintf(_CT_SENTTOWEBMASTER,$xoopsConfig['sitename']);
+    $userMessage .= "\n";
+    $userMessage .= _CT_YOURMESSAGE."\n";
+    $userMessage .= "\n$usersComments\n\n";
+    $userMessage .= "--------------\n";
+    $userMessage .= "".$xoopsConfig['sitename']." "._CT_WEBMASTER."\n";
+    $userMessage .= "".$xoopsConfig['adminmail']."";
+    $xoopsMailer =& getMailer();
+    $xoopsMailer->useMail();
+    $xoopsMailer->setToEmails($usersEmail);
+    $xoopsMailer->setFromEmail($usersEmail);
+    $xoopsMailer->setFromName($xoopsConfig['sitename']);
+    $xoopsMailer->setSubject($conf_subject);
+    $xoopsMailer->setBody($userMessage);
+    $xoopsMailer->send();
+    $messagesent .= sprintf(_CT_SENTASCONFIRM,$usersEmail);
+    */
+
+    redirect_header(XOOPS_URL."/index.php",2,$messagesent);
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/contact/header.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/contact/header.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/contact/header.php	(revision 405)
@@ -0,0 +1,29 @@
+<?php
+// $Id: header.php,v 1.2 2005/03/18 12:52:14 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+include "../../mainfile.php";
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/contact/templates/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/contact/templates/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/contact/templates/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/contact/templates/contact_contactusform.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/contact/templates/contact_contactusform.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/contact/templates/contact_contactusform.html	(revision 405)
@@ -0,0 +1,20 @@
+<{$contactform.javascript}>
+<form name="<{$contactform.name}>" action="<{$contactform.action}>" method="<{$contactform.method}>" <{$contactform.extra}>>
+  <table class="outer" cellspacing="1">
+    <tr>
+    <th colspan="2"><{$contactform.title}></th>
+    </tr>
+    <!-- start of form elements loop -->
+    <{foreach item=element from=$contactform.elements}>
+      <{if $element.hidden != true}>
+      <tr>
+        <td class="head"><{$element.caption}></td>
+        <td class="<{cycle values="even,odd"}>"><{$element.body}></td>
+      </tr>
+      <{else}>
+      <{$element.body}>
+      <{/if}>
+    <{/foreach}>
+    <!-- end of form elements loop -->
+  </table>
+</form>
Index: /temp/test-xoops.ec-cube.net/html/modules/contact/language/japanese/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/contact/language/japanese/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/contact/language/japanese/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/contact/language/japanese/main.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/contact/language/japanese/main.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/contact/language/japanese/main.php	(revision 405)
@@ -0,0 +1,23 @@
+<?php
+//%%%%%%		File Name contact.php 		%%%%%
+define("_CT_CONTACTFORM","¤ªÌä¤¤¹ç¤ï¤»");
+define("_CT_THANKYOU","¥Õ¥©¡¼¥à¤òÁ÷¿®¤·¤Þ¤·¤¿¡£¥µ¥¤¥È´ÉÍý¼Ô¤«¤é¤Î²óÅú¤ò¤ªÂÔ¤Á¤¯¤À¤µ¤¤¡£");
+define("_CT_NAME","Ì¾Á°¡§");
+define("_CT_EMAIL","¥á¡¼¥ë¥¢¥É¥ì¥¹¡§");
+define("_CT_URL","¥Û¡¼¥à¥Ú¡¼¥¸¡§");
+define("_CT_ICQ","ICQ¡§");
+define("_CT_COMPANY","²ñ¼ÒÌ¾¡§");
+define("_CT_LOCATION","¤ª½»¤Þ¤¤¡§");
+define("_CT_COMMENTS","ËÜÊ¸¡§");
+define("_CT_SUBMIT","Á÷¿®");
+define("_CT_YOURMESSAGE","Á÷¿®Ê¸¡§");
+define("_CT_WEBMASTER","¥µ¥¤¥È´ÉÍý¿Í");
+define("_CT_HELLO","%s¤µ¤ó¡¢¤³¤ó¤Ë¤Á¤Ï");
+define("_CT_THANKYOUCOMMENTS","%s¤Ø¤ªÌä¤¤¹ç¤ï¤»Äº¤­¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£");
+define("_CT_SENTTOWEBMASTER","¥á¥Ã¥»¡¼¥¸¤ÏÌµ»ö¤Ë%s¤Î´ÉÍý¼Ô°¸¤ËÁ÷¿®¤µ¤ì¤Þ¤·¤¿¡£");
+define("_CT_SUBMITTED","%s ¤µ¤ó¤«¤é¤Î¤ªÌä¤¤¹ç¤ï¤»¡§");
+define("_CT_MESSAGESENT","%s ¤Ø¤ÎÁ÷¿®¤ò´°Î»¤·¤Þ¤·¤¿");
+define("_CT_SENTASCONFIRM","Ç°¤Î¤¿¤á¡¢%s°¸¤Ë³ÎÇ§¥á¡¼¥ë¤òÁ÷¿®¤·¤Þ¤·¤¿¡£");
+//define("_CT_","");
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/contact/language/japanese/modinfo.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/contact/language/japanese/modinfo.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/contact/language/japanese/modinfo.php	(revision 405)
@@ -0,0 +1,9 @@
+<?php
+// Module Info
+
+// The name of this module
+define("_MI_CONTACT_NAME","¤ªÌä¤¤¹ç¤ï¤»");
+// A brief description of this module
+define("_MI_CONTACT_DESC","¥µ¥¤¥È´ÉÍý¿Í°¸¤Ë¥á¥Ã¥»¡¼¥¸¤òÁ÷¿®¤·¤Þ¤¹");
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/contact/language/english/modinfo.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/contact/language/english/modinfo.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/contact/language/english/modinfo.php	(revision 405)
@@ -0,0 +1,9 @@
+<?php
+// $Id: modinfo.php,v 1.2 2005/03/18 12:52:14 onokazu Exp $
+// Module Info
+
+// The name of this module
+define("_MI_CONTACT_NAME","Contact Us");
+// A brief description of this module
+define("_MI_CONTACT_DESC","For sending messages to the webmaster");
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/contact/language/english/main.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/contact/language/english/main.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/contact/language/english/main.php	(revision 405)
@@ -0,0 +1,22 @@
+<?php
+// $Id: main.php,v 1.2 2005/03/18 12:52:14 onokazu Exp $
+//%%%%%%		File Name contact.php 		%%%%%
+define("_CT_CONTACTFORM","Contact Us Form");
+define("_CT_THANKYOU","Thank you for your interest in our site!");
+define("_CT_NAME","Name");
+define("_CT_EMAIL","Email");
+define("_CT_URL","URL");
+define("_CT_ICQ","ICQ");
+define("_CT_COMPANY","Company");
+define("_CT_LOCATION","Location");
+define("_CT_COMMENTS","Comments");
+define("_CT_SUBMIT","Submit");
+define("_CT_YOURMESSAGE","Your Message:");
+define("_CT_WEBMASTER","Webmaster");
+define("_CT_HELLO","Hello %s,");
+define("_CT_THANKYOUCOMMENTS","Thank you for your comments about %s.");
+define("_CT_SENTTOWEBMASTER","Your message has been sent to the webmaster(s) of %s.");
+define("_CT_SUBMITTED","%s submitted the following Information:");
+define("_CT_MESSAGESENT","Message to %s Sent");
+define("_CT_SENTASCONFIRM","Your comments have been sent to: %s as a confirmation email.");
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/contact/language/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/contact/language/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/contact/language/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/contact/xoops_version.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/contact/xoops_version.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/contact/xoops_version.php	(revision 405)
@@ -0,0 +1,49 @@
+<?php
+// $Id: xoops_version.php,v 1.2 2005/03/18 12:52:14 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+$modversion['name'] = _MI_CONTACT_NAME;
+$modversion['version'] = 1.00;
+$modversion['description'] = _MI_CONTACT_DESC;
+$modversion['credits'] = "";
+$modversion['author'] = "";
+$modversion['help'] = "top.html";
+$modversion['license'] = "GPL see LICENSE";
+$modversion['official'] = 1;
+$modversion['image'] = "contact_slogo.png";
+$modversion['dirname'] = "contact";
+
+//Admin things
+$modversion['hasAdmin'] = 0;
+$modversion['adminmenu'] = "";
+
+// Menu
+$modversion['hasMain'] = 1;
+
+// Templates
+$modversion['templates'][1]['file'] = 'contact_contactusform.html';
+$modversion['templates'][1]['description'] = 'Contact Us Form';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/contact/contactform.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/contact/contactform.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/contact/contactform.php	(revision 405)
@@ -0,0 +1,48 @@
+<?php
+// $Id: contactform.php,v 1.4 2005/09/04 20:46:09 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+if (!defined('XOOPS_ROOT_PATH')) {
+    exit();
+}
+$name_text = new XoopsFormText(_CT_NAME, "usersName", 50, 100, $name_v);
+$email_text = new XoopsFormText(_CT_EMAIL, "usersEmail", 50, 100, $email_v);
+$url_text = new XoopsFormText(_CT_URL, "usersSite", 50, 100, $url_v);
+$icq_text = new XoopsFormText(_CT_ICQ, "usersICQ", 50, 100, $icq_v);
+$company_text = new XoopsFormText(_CT_COMPANY, "usersCompanyName", 50, 100, $company_v);
+$location_text = new XoopsFormText(_CT_LOCATION, "usersCompanyLocation", 50, 100, $location_v);
+$comment_textarea = new XoopsFormTextArea(_CT_COMMENTS, "usersComments", $comment_v);
+$submit_button = new XoopsFormButton("", "submit", _CT_SUBMIT, "submit");
+$contact_form = new XoopsThemeForm(_CT_CONTACTFORM, "contactform", "index.php");
+$contact_form->addElement($name_text, true);
+$contact_form->addElement($email_text, true);
+$contact_form->addElement($url_text);
+$contact_form->addElement($icq_text);
+$contact_form->addElement($company_text);
+$contact_form->addElement($location_text);
+$contact_form->addElement($comment_textarea, true);
+$contact_form->addElement($submit_button);
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/news/archive.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/archive.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/archive.php	(revision 405)
@@ -0,0 +1,131 @@
+<?php
+// $Id: archive.php,v 1.3 2005/09/04 20:46:11 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+// ------------------------------------------------------------------------- //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+######################################################################
+# Original version:
+# [11-may-2001] Kenneth Lee - http://www.nexgear.com/
+######################################################################
+
+include '../../mainfile.php';
+$xoopsOption['template_main'] = 'news_archive.html';
+include XOOPS_ROOT_PATH.'/header.php';
+include_once './class/class.newsstory.php';
+include_once XOOPS_ROOT_PATH.'/language/'.$xoopsConfig['language'].'/calendar.php';
+//error_reporting(E_ALL);
+$lastyear = 0;
+$lastmonth = 0;
+
+$months_arr = array(1 => _CAL_JANUARY, 2 => _CAL_FEBRUARY, 3 => _CAL_MARCH, 4 => _CAL_APRIL, 5 => _CAL_MAY, 6 => _CAL_JUNE, 7 => _CAL_JULY, 8 => _CAL_AUGUST, 9 => _CAL_SEPTEMBER, 10 => _CAL_OCTOBER, 11 => _CAL_NOVEMBER, 12 => _CAL_DECEMBER);
+
+$fromyear = (isset($_GET['year'])) ? intval ($_GET['year']): 0;
+$frommonth = (isset($_GET['month'])) ? intval($_GET['month']) : 0;
+
+$useroffset = "";
+if($xoopsUser){
+	$timezone = $xoopsUser->timezone();
+	if(isset($timezone)){
+		$useroffset = $xoopsUser->timezone();
+	}else{
+		$useroffset = $xoopsConfig['default_TZ'];
+	}
+}
+$result = $xoopsDB->query("SELECT published FROM ".$xoopsDB->prefix("stories")." WHERE published>0 AND published<=".time()." AND expired <= ".time()." ORDER BY published DESC");
+if (!$result) {
+	exit();
+
+} else {
+	$years = array();
+	$months = array();
+	$i = 0;
+	while (list($time) = $xoopsDB->fetchRow($result)) {
+		$time = formatTimestamp($time, "mysql", $useroffset);
+			if (preg_match("/([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})/", $time, $datetime)) {
+				$this_year  = intval($datetime[1]);
+				$this_month = intval($datetime[2]);
+			if (empty($lastyear)) {
+				$lastyear = $this_year;
+			}
+			if ($lastmonth == 0) {
+				$lastmonth = $this_month;
+				$months[$lastmonth]['string'] = $months_arr[$lastmonth];
+				$months[$lastmonth]['number'] = $lastmonth;
+			}
+			if ($lastyear != $this_year) {
+				$years[$i]['number'] = $lastyear;
+				$years[$i]['months'] = $months;
+				$months = array();
+				$lastmonth = 0;
+				$lastyear = $this_year;
+				$i++;
+			}
+			if ($lastmonth != $this_month) {
+				$lastmonth = $this_month;
+				$months[$lastmonth]['string'] = $months_arr[$lastmonth];
+				$months[$lastmonth]['number'] = $lastmonth;
+			}
+		}
+	}
+	$years[$i]['number'] = $this_year;
+	$years[$i]['months'] = $months;	$xoopsTpl->assign('years', $years);
+}
+
+if ($fromyear != 0 && $frommonth != 0) {
+	$xoopsTpl->assign('show_articles', true);
+	$xoopsTpl->assign('lang_articles', _NW_ARTICLES);
+	$xoopsTpl->assign('currentmonth', $months_arr[$frommonth]);
+	$xoopsTpl->assign('currentyear', $fromyear);
+	$xoopsTpl->assign('lang_actions', _NW_ACTIONS);
+	$xoopsTpl->assign('lang_date', _NW_DATE);
+	$xoopsTpl->assign('lang_views', _NW_VIEWS);
+
+	// must adjust the selected time to server timestamp
+	$timeoffset = $useroffset - $xoopsConfig['server_TZ'];
+	$monthstart = mktime(0 - $timeoffset, 0, 0, $frommonth, 1, $fromyear);
+	$monthend = mktime(23 - $timeoffset, 59, 59, $frommonth + 1, 0, $fromyear);
+	$monthend = ($monthend > time()) ? time() : $monthend;
+	$sql = "SELECT * FROM ".$xoopsDB->prefix("stories")." WHERE published > $monthstart and published < $monthend ORDER by published DESC";
+    	$result = $xoopsDB->query($sql);
+	$count = 0;
+    	while ($myrow = $xoopsDB->fetchArray($result)) {
+		$article = new NewsStory($myrow);
+		$story = array();
+	    	$story['title'] = "<a href='index.php?storytopic=".$article->topicid()."'>".$article->topic_title()."</a>: <a href='article.php?storyid=".$article->storyid()."'>".$article->title()."</a>";
+		$story['counter'] = $article->counter();
+		$story['date'] = formatTimestamp($article->published(),"m",$useroffset);
+		$story['print_link'] = 'print.php?storyid='.$article->storyid();
+		$story['mail_link'] = 'mailto:?subject='.sprintf(_NW_INTARTICLE, $xoopsConfig['sitename']).'&amp;body='.sprintf(_NW_INTARTFOUND, $xoopsConfig['sitename']).':  '.XOOPS_URL.'/modules/'.$xoopsModule->dirname().'/article.php?storyid='.$article->storyid();
+		$xoopsTpl->append('stories', $story);
+		$count++;
+	}
+	$xoopsTpl->assign('lang_printer', _NW_PRINTERFRIENDLY);
+	$xoopsTpl->assign('lang_sendstory', _NW_SENDSTORY);
+	$xoopsTpl->assign('lang_storytotal', sprintf(_NW_THEREAREINTOTAL, $count));
+} else {
+	$xoopsTpl->assign('show_articles', false);
+}
+$xoopsTpl->assign('lang_newsarchives', _NW_NEWSARCHIVES);
+include XOOPS_ROOT_PATH."/footer.php";
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/news/article.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/article.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/article.php	(revision 405)
@@ -0,0 +1,116 @@
+<?php
+// $Id: article.php,v 1.4 2005/08/03 12:39:14 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+include "../../mainfile.php";
+include_once "class/class.newsstory.php";
+
+$storyid = (isset($_GET['storyid'])) ? intval($_GET['storyid']) : 0;
+if (empty($storyid)) {
+    redirect_header("index.php",2,_NW_NOSTORY);
+    exit();
+}
+
+$xoopsOption['template_main'] = 'news_article.html';
+
+include_once XOOPS_ROOT_PATH.'/header.php';
+$myts =& MyTextSanitizer::getInstance();
+// set comment mode if not set
+
+
+$article = new NewsStory($storyid);
+if ( $article->published() == 0 || $article->published() > time() ) {
+    redirect_header('index.php', 2, _NW_NOSTORY);
+    exit();
+}
+$storypage = isset($_GET['page']) ? intval($_GET['page']) : 0;
+// update counter only when viewing top page
+if (empty($_GET['com_id']) && $storypage == 0) {
+    $article->updateCounter();
+}
+$story['id'] = $storyid;
+$story['posttime'] = formatTimestamp($article->published());
+$story['title'] = $article->textlink()."&nbsp;:&nbsp;".$article->title();
+$story['text'] = $article->hometext();
+$bodytext = $article->bodytext();
+
+if ( trim($bodytext) != '' ) {
+    $articletext = explode("[pagebreak]", $bodytext);
+    $story_pages = count($articletext);
+
+    if ($story_pages > 1) {
+        include_once XOOPS_ROOT_PATH.'/class/pagenav.php';
+        $pagenav = new XoopsPageNav($story_pages, 1, $storypage, 'page', 'storyid='.$storyid);
+        $xoopsTpl->assign('pagenav', $pagenav->renderNav());
+        //$xoopsTpl->assign('pagenav', $pagenav->renderImageNav());
+
+        if ($storypage == 0) {
+            $story['text'] = $story['text'].'<br /><br />'.$articletext[$storypage];
+        } else {
+            $story['text'] = $articletext[$storypage];
+        }
+    } else {
+        $story['text'] = $story['text'].'<br /><br />'.$bodytext;
+    }
+}
+
+$story['poster'] = $article->uname();
+if ( $story['poster'] ) {
+    $story['posterid'] = $article->uid();
+    $story['poster'] = '<a href="'.XOOPS_URL.'/userinfo.php?uid='.$story['posterid'].'">'.$story['poster'].'</a>';
+} else {
+    $story['poster'] = '';
+    $story['posterid'] = 0;
+    $story['poster'] = $xoopsConfig['anonymous'];
+}
+$story['morelink'] = '';
+$story['adminlink'] = '';
+unset($isadmin);
+if ( $xoopsUser && $xoopsUser->isAdmin($xoopsModule->getVar('mid')) ) {
+    $isadmin = true;
+    $story['adminlink'] = $article->adminlink();
+}
+$story['topicid'] = $article->topicid();
+$story['imglink'] = '';
+$story['align'] = '';
+if ( $article->topicdisplay() ) {
+    $story['imglink'] = $article->imglink();
+    $story['align'] = $article->topicalign();
+}
+$story['hits'] = $article->counter();
+$story['mail_link'] = 'mailto:?subject='.sprintf(_NW_INTARTICLE,$xoopsConfig['sitename']).'&amp;body='.sprintf(_NW_INTARTFOUND, $xoopsConfig['sitename']).':  '.XOOPS_URL.'/modules/news/article.php?storyid='.$article->storyid();
+$xoopsTpl->assign('story', $story);
+$xoopsTpl->assign('lang_printerpage', _NW_PRINTERFRIENDLY);
+$xoopsTpl->assign('lang_sendstory', _NW_SENDSTORY);
+$xoopsTpl->assign('lang_on', _ON);
+$xoopsTpl->assign('lang_postedby', _POSTEDBY);
+$xoopsTpl->assign('lang_reads', _READS);
+$xoopsTpl->assign('mail_link', 'mailto:?subject='.sprintf(_NW_INTARTICLE,$xoopsConfig['sitename']).'&amp;body='.sprintf(_NW_INTARTFOUND, $xoopsConfig['sitename']).':  '.XOOPS_URL.'/modules/news/article.php?storyid='.$article->storyid());
+
+include XOOPS_ROOT_PATH.'/include/comment_view.php';
+
+include XOOPS_ROOT_PATH.'/footer.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/news/comment_delete.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/comment_delete.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/comment_delete.php	(revision 405)
@@ -0,0 +1,29 @@
+<?php
+// $Id: comment_delete.php,v 1.2 2005/03/18 12:52:25 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+include '../../mainfile.php';
+include XOOPS_ROOT_PATH.'/include/comment_delete.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/news/blocks/news_topics.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/blocks/news_topics.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/blocks/news_topics.php	(revision 405)
@@ -0,0 +1,41 @@
+<?php
+// $Id: news_topics.php,v 1.2 2005/03/18 12:52:38 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+// ------------------------------------------------------------------------- //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+function b_news_topics_show() {
+	global $xoopsDB, $storytopic;
+	$block = array();
+	include_once XOOPS_ROOT_PATH."/class/xoopstopic.php";
+	$xt = new XoopsTopic($xoopsDB->prefix("topics"));
+	$jump = XOOPS_URL."/modules/news/index.php?storytopic=";
+	$storytopic = !empty($storytopic) ? intval($storytopic) : 0;
+	ob_start();
+	$xt->makeTopicSelBox(1, $storytopic,"storytopic","location=\"".$jump."\"+this.options[this.selectedIndex].value");
+	$block['selectbox'] = ob_get_contents();
+	ob_end_clean();
+	return $block;
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/news/blocks/news_bigstory.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/blocks/news_bigstory.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/blocks/news_bigstory.php	(revision 405)
@@ -0,0 +1,44 @@
+<?php
+// $Id: news_bigstory.php,v 1.2 2005/03/18 12:52:38 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+// ------------------------------------------------------------------------- //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+function b_news_bigstory_show() {
+	global $xoopsDB;
+	$myts =& MyTextSanitizer::getInstance();
+	$block = array();
+	$tdate = mktime(0,0,0,date("n"),date("j"),date("Y"));
+	$result = $xoopsDB->query("SELECT storyid, title FROM ".$xoopsDB->prefix("stories")." WHERE published > ".$tdate." AND published < ".time()." AND (expired > ".time()." OR expired = 0) ORDER BY counter DESC",1,0);
+	list($fsid, $ftitle) = $xoopsDB->fetchRow($result);
+	if ( !$fsid && !$ftitle ) {
+		$block['message'] = _MB_NEWS_NOTYET;
+	} else {
+		$block['message'] = _MB_NEWS_TMRSI;
+		$block['story_title'] = $myts->makeTboxData4Show($ftitle);
+		$block['story_id'] = $fsid;
+	}
+	return $block;
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/news/blocks/news_top.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/blocks/news_top.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/blocks/news_top.php	(revision 405)
@@ -0,0 +1,73 @@
+<?php
+// $Id: news_top.php,v 1.4 2005/08/03 12:39:14 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+// ------------------------------------------------------------------------- //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+function b_news_top_show($options) {
+	global $xoopsDB;
+	$myts =& MyTextSanitizer::getInstance();
+	$block = array();
+	$sql = "SELECT storyid, title, published, expired, counter FROM ".$xoopsDB->prefix("stories")." WHERE published < ".time()." AND published > 0 AND (expired = 0 OR expired > ".time().") ORDER BY ".$options[0]." DESC";
+	$result = $xoopsDB->query($sql,$options[1],0);
+	while ( $myrow = $xoopsDB->fetchArray($result) ) {
+		$news = array();
+		$title = $myts->makeTboxData4Show($myrow["title"]);
+		if ( !XOOPS_USE_MULTIBYTES ) {
+			if (strlen($myrow['title']) >= $options[2]) {
+				$title = $myts->makeTboxData4Show(substr($myrow['title'],0,($options[2] -1)))."...";
+			}
+		}
+		$news['title'] = $title;
+		$news['id'] = $myrow['storyid'];
+		if ( $options[0] == "published" ) {
+			$news['date'] = formatTimestamp($myrow['published'],"s");
+		} elseif ( $options[0] == "counter" ) {
+			$news['hits'] = $myrow['counter'];
+		}
+		$block['stories'][] = $news;
+	}
+	return $block;
+}
+
+function b_news_top_edit($options) {
+	$form = ""._MB_NEWS_ORDER."&nbsp;<select name='options[]'>";
+	$form .= "<option value='published'";
+	if ( $options[0] == "published" ) {
+		$form .= " selected='selected'";
+	}
+	$form .= ">"._MB_NEWS_DATE."</option>\n";
+	$form .= "<option value='counter'";
+	if($options[0] == "counter"){
+		$form .= " selected='selected'";
+	}
+	$form .= ">"._MB_NEWS_HITS."</option>\n";
+	$form .= "</select>\n";
+	$form .= "&nbsp;"._MB_NEWS_DISP."&nbsp;<input type='text' name='options[]' value='".$options[1]."' />&nbsp;"._MB_NEWS_ARTCLS."";
+	$form .= "&nbsp;<br />"._MB_NEWS_CHARS."&nbsp;<input type='text' name='options[]' value='".$options[2]."' />&nbsp;"._MB_NEWS_LENGTH."";
+
+
+	return $form;
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/news/blocks/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/blocks/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/blocks/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/news/header.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/header.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/header.php	(revision 405)
@@ -0,0 +1,28 @@
+<?php
+// $Id: header.php,v 1.2 2005/03/18 12:52:25 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+include '../../mainfile.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/news/notification_update.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/notification_update.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/notification_update.php	(revision 405)
@@ -0,0 +1,4 @@
+<?php
+include '../../mainfile.php';
+include XOOPS_ROOT_PATH.'/include/notification_update.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/news/print.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/print.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/print.php	(revision 405)
@@ -0,0 +1,73 @@
+<?php
+// $Id: print.php,v 1.5 2005/09/04 20:46:11 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+// ------------------------------------------------------------------------- //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+include '../../mainfile.php';
+
+$storyid = isset($_GET['storyid']) ? intval($_GET['storyid']) : 0;
+if ( empty($storyid) ) {
+    redirect_header("index.php");
+}
+include_once XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->dirname().'/class/class.newsstory.php';
+
+function PrintPage($storyid)
+{
+    global $xoopsConfig, $xoopsModule;
+    $story = new NewsStory($storyid);
+    $datetime = formatTimestamp($story->published());
+    echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">';
+    echo '<html><head>';
+    echo '<meta http-equiv="Content-Type" content="text/html; charset='._CHARSET.'" />';
+    echo '<title>'.htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES).'</title>';
+    echo '<meta name="AUTHOR" content="'.htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES).'" />';
+    echo '<meta name="COPYRIGHT" content="Copyright (c) 2005 by '.htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES).'" />';
+    echo '<meta name="DESCRIPTION" content="'.$xoopsConfig['slogan'].'" />';
+    echo '<meta name="GENERATOR" content="'.XOOPS_VERSION.'" />';
+    echo '<body bgcolor="#ffffff" text="#000000" onload="window.print()">
+        <table border="0"><tr><td align="center">
+        <table border="0" width="640" cellpadding="0" cellspacing="1" bgcolor="#000000"><tr><td>
+        <table border="0" width="640" cellpadding="20" cellspacing="1" bgcolor="#ffffff"><tr><td align="center">
+        <img src="'.XOOPS_URL.'/images/logo.gif" border="0" alt="" /><br /><br />
+        <h3>'.$story->title().'</h3>
+        <small><b>'._NW_DATE.'</b>&nbsp;'.$datetime.' | <b>'._NW_TOPICC.'</b>&nbsp;'.$story->topic_title().'</small><br /><br /></td></tr>';
+    echo '<tr valign="top" style="font:12px;"><td>'.$story->hometext().'<br />';
+    $bodytext = $story->bodytext();
+    $bodytext = str_replace("[pagebreak]","<br style=\"page-break-after:always;\">",$bodytext);
+    if ( $bodytext != '' ){
+            echo $bodytext.'<br /><br />';
+    }
+    echo '</td></tr></table></td></tr></table>
+    <br /><br />';
+    printf(_NW_THISCOMESFROM,htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES));
+    echo '<br /><a href="'.XOOPS_URL.'/">'.XOOPS_URL.'</a><br /><br />
+        '._NW_URLFORSTORY.' <!-- Tag below can be used to display Permalink image --><!--img src="'.XOOPS_URL.'/modules/'.$xoopsModule->dirname().'/images/x.gif" /--><br />
+        <a href="'.XOOPS_URL.'/modules/'.$xoopsModule->dirname().'/article.php?storyid='.$story->storyid().'">'.XOOPS_URL.'/article.php?storyid='.$story->storyid().'</a>
+        </td></tr></table>
+        </body>
+        </html>
+        ';
+}
+PrintPage($storyid);
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/news/language/english/modinfo.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/language/english/modinfo.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/language/english/modinfo.php	(revision 405)
@@ -0,0 +1,66 @@
+<?php
+// $Id: modinfo.php,v 1.2 2005/03/18 12:52:38 onokazu Exp $
+// Module Info
+
+// The name of this module
+define('_MI_NEWS_NAME','News');
+
+// A brief description of this module
+define('_MI_NEWS_DESC','Creates a Slashdot-like news section, where users can post news/comments.');
+
+// Names of blocks for this module (Not all module has blocks)
+define('_MI_NEWS_BNAME1','News Topics');
+define('_MI_NEWS_BNAME3','Big Story');
+define('_MI_NEWS_BNAME4','Top News');
+define('_MI_NEWS_BNAME5','Recent News');
+
+// Sub menus in main menu block
+define('_MI_NEWS_SMNAME1','Submit News');
+define('_MI_NEWS_SMNAME2','Archive');
+
+// Names of admin menu items
+define('_MI_NEWS_ADMENU2', 'Topics Manager');
+define('_MI_NEWS_ADMENU3', 'Post/Edit News');
+
+// Title of config items
+define('_MI_STORYHOME', 'Select the number of news items to display on top page');
+define('_MI_NOTIFYSUBMIT', 'Select yes to send notification message to webmaster upon new submission');
+define('_MI_DISPLAYNAV', 'Select yes to display navigation box at the top of each news page');
+define('_MI_ANONPOST','Allow anonymous users to post news articles?');
+define('_MI_AUTOAPPROVE','Auto approve news stories without admin intervention?');
+
+// Description of each config items
+define('_MI_STORYHOMEDSC', '');
+define('_MI_NOTIFYSUBMITDSC', '');
+define('_MI_DISPLAYNAVDSC', '');
+define('_MI_AUTOAPPROVEDSC', '');
+
+// Text for notifications
+
+define('_MI_NEWS_GLOBAL_NOTIFY', 'Global');
+define('_MI_NEWS_GLOBAL_NOTIFYDSC', 'Global news notification options.');
+
+define('_MI_NEWS_STORY_NOTIFY', 'Story');
+define('_MI_NEWS_STORY_NOTIFYDSC', 'Notification options that apply to the current story.');
+
+define('_MI_NEWS_GLOBAL_NEWCATEGORY_NOTIFY', 'New Topic');
+define('_MI_NEWS_GLOBAL_NEWCATEGORY_NOTIFYCAP', 'Notify me when a new topic is created.');
+define('_MI_NEWS_GLOBAL_NEWCATEGORY_NOTIFYDSC', 'Receive notification when a new topic is created.');
+define('_MI_NEWS_GLOBAL_NEWCATEGORY_NOTIFYSBJ', '[{X_SITENAME}] {X_MODULE} auto-notify : New news topic');
+
+define('_MI_NEWS_GLOBAL_STORYSUBMIT_NOTIFY', 'New Story Submitted');       
+define('_MI_NEWS_GLOBAL_STORYSUBMIT_NOTIFYCAP', 'Notify me when any new story is submitted (awaiting approval).');                           
+define('_MI_NEWS_GLOBAL_STORYSUBMIT_NOTIFYDSC', 'Receive notification when any new story is submitted (awaiting approval).');                
+define('_MI_NEWS_GLOBAL_STORYSUBMIT_NOTIFYSBJ', '[{X_SITENAME}] {X_MODULE} auto-notify : New news story submitted');                              
+
+define('_MI_NEWS_GLOBAL_NEWSTORY_NOTIFY', 'New Story');       
+define('_MI_NEWS_GLOBAL_NEWSTORY_NOTIFYCAP', 'Notify me when any new story is posted.');
+define('_MI_NEWS_GLOBAL_NEWSTORY_NOTIFYDSC', 'Receive notification when any new story is posted.');
+define('_MI_NEWS_GLOBAL_NEWSTORY_NOTIFYSBJ', '[{X_SITENAME}] {X_MODULE} auto-notify : New news story');                              
+
+define('_MI_NEWS_STORY_APPROVE_NOTIFY', 'Story Approved');
+define('_MI_NEWS_STORY_APPROVE_NOTIFYCAP', 'Notify me when this story is approved.');
+define('_MI_NEWS_STORY_APPROVE_NOTIFYDSC', 'Receive notification when this story is approved.');
+define('_MI_NEWS_STORY_APPROVE_NOTIFYSBJ', '[{X_SITENAME}] {X_MODULE} auto-notify : Story approved');
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/news/language/english/blocks.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/language/english/blocks.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/language/english/blocks.php	(revision 405)
@@ -0,0 +1,12 @@
+<?php
+// $Id: blocks.php,v 1.2 2005/03/18 12:52:38 onokazu Exp $
+define("_MB_NEWS_NOTYET","There isn't a Biggest Story for Today, yet.");
+define("_MB_NEWS_TMRSI","Today's most read Story is:");
+define("_MB_NEWS_ORDER","Order");
+define("_MB_NEWS_DATE","Published Date");
+define("_MB_NEWS_HITS","Number of Hits");
+define("_MB_NEWS_DISP","Display");
+define("_MB_NEWS_ARTCLS","articles");
+define("_MB_NEWS_CHARS","Length of the title");
+define("_MB_NEWS_LENGTH"," characters");
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/news/language/english/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/language/english/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/language/english/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/news/language/english/main.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/language/english/main.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/language/english/main.php	(revision 405)
@@ -0,0 +1,59 @@
+<?php
+// $Id: main.php,v 1.3 2005/08/03 12:39:15 onokazu Exp $
+//%%%%%%        File Name index.php         %%%%%
+define("_NW_PRINTER","Printer Friendly Page");
+define("_NW_SENDSTORY","Send this Story to a Friend");
+define("_NW_READMORE","Read More...");
+define("_NW_COMMENTS","Comments?");
+define("_NW_ONECOMMENT","1 comment");
+define("_NW_BYTESMORE","%s bytes more");
+define("_NW_NUMCOMMENTS","%s comments");
+
+
+//%%%%%%        File Name submit.php        %%%%%
+define("_NW_SUBMITNEWS","Submit News");
+define("_NW_TITLE","Title");
+define("_NW_TOPIC","Topic");
+define("_NW_THESCOOP","The Scoop");
+define("_NW_NOTIFYPUBLISH","Notify by mail when published");
+define("_NW_POST","Post");
+define("_NW_GO","Go!");
+define("_NW_THANKS","Thanks for your submission."); //submission of news article
+// Added 2.0.11jp
+define("_NW_THANKS_AUTOAPPROVE", "Thanks for your submission.");
+
+define("_NW_NOTIFYSBJCT","NEWS for my site"); // Notification mail subject
+define("_NW_NOTIFYMSG","Hey! You got a new submission for your site."); // Notification mail message
+
+//%%%%%%        File Name archive.php       %%%%%
+define("_NW_NEWSARCHIVES","News Archives");
+define("_NW_ARTICLES","Articles");
+define("_NW_VIEWS","Views");
+define("_NW_DATE","Date");
+define("_NW_ACTIONS","Actions");
+define("_NW_PRINTERFRIENDLY","Printer Friendly Page");
+
+define("_NW_THEREAREINTOTAL","There are %s article(s) in total");
+
+// %s is your site name
+define("_NW_INTARTICLE","Interesting Article at %s");
+define("_NW_INTARTFOUND","Here is an interesting article I have found at %s");
+
+define("_NW_TOPICC","Topic:");
+define("_NW_URL","URL:");
+define("_NW_NOSTORY","Sorry, the selected story does not exist.");
+
+//%%%%%%    File Name print.php     %%%%%
+
+define("_NW_URLFORSTORY","The URL for this story is:");
+
+// %s represents your site name
+define("_NW_THISCOMESFROM","This article comes from %s");
+
+// Added language definitions for news expiry date
+define("_AM_EXPARTS","Expired Articles");
+define("_AM_EXPIRED","Expired");
+define("_AM_CHANGEEXPDATETIME","Change the date/time of expiration");
+define("_AM_SETEXPDATETIME","Set the date/time of expiration");
+define("_AM_NOWSETEXPTIME","It is now set at: %s");
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/news/language/english/mail_template/global_storysubmit_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/language/english/mail_template/global_storysubmit_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/language/english/mail_template/global_storysubmit_notify.tpl	(revision 405)
@@ -0,0 +1,21 @@
+Hello {X_UNAME},
+
+A new story "{STORY_NAME}" has been submitted at {X_SITENAME} and is awaiting approval.
+
+You can view this story submission here:
+{WAITINGSTORIES_URL}
+
+-----------
+
+You are receiving this message because you selected to be notified when new stories are submitted to our site.
+
+If this is an error or you wish not to receive further such notifications, please update your subscriptions by visiting the link below:
+{X_UNSUBSCRIBE_URL}
+
+Please do not reply to this message.
+
+-----------
+
+{X_SITENAME} ({X_SITEURL}) 
+webmaster
+{X_ADMINMAIL}
Index: /temp/test-xoops.ec-cube.net/html/modules/news/language/english/mail_template/global_newcategory_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/language/english/mail_template/global_newcategory_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/language/english/mail_template/global_newcategory_notify.tpl	(revision 405)
@@ -0,0 +1,21 @@
+Hello {X_UNAME},
+
+A new news topic "{TOPIC_NAME}" has been created at {X_SITENAME}.
+
+Follow this link to view the news index page:
+{X_MODULE_URL}
+
+-----------
+
+You are receiving this message because you selected to be notified when new news topics are added to our site.
+
+If this is an error or you wish not to receive further such notifications, please update your subscriptions by visiting the link below:
+{X_UNSUBSCRIBE_URL}
+
+Please do not reply to this message.
+
+-----------
+
+{X_SITENAME} ({X_SITEURL}) 
+webmaster
+{X_ADMINMAIL}
Index: /temp/test-xoops.ec-cube.net/html/modules/news/language/english/mail_template/global_newstory_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/language/english/mail_template/global_newstory_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/language/english/mail_template/global_newstory_notify.tpl	(revision 405)
@@ -0,0 +1,21 @@
+Hello {X_UNAME},
+
+A new story "{STORY_NAME}" has been added at {X_SITENAME}.
+
+You can view this story here:
+{STORY_URL}
+
+-----------
+
+You are receiving this message because you selected to be notified when new stories are added to our site.
+
+If this is an error or you wish not to receive further such notifications, please update your subscriptions by visiting the link below:
+{X_UNSUBSCRIBE_URL}
+
+Please do not reply to this message.
+
+-----------
+
+{X_SITENAME} ({X_SITEURL}) 
+webmaster
+{X_ADMINMAIL}
Index: /temp/test-xoops.ec-cube.net/html/modules/news/language/english/mail_template/story_approve_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/language/english/mail_template/story_approve_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/language/english/mail_template/story_approve_notify.tpl	(revision 405)
@@ -0,0 +1,21 @@
+Hello {X_UNAME},
+
+Your submitted story "{STORY_NAME}" has been approved at {X_SITENAME}.
+
+You can view this link here:
+{STORY_URL}
+
+-----------
+
+You are receiving this message because you selected to be notified when this story was approved.
+
+If this is an error or you wish not to receive further such notifications, please update your subscriptions by visiting the link below:
+{X_UNSUBSCRIBE_URL}
+
+Please do not reply to this message.
+
+-----------
+
+{X_SITENAME} ({X_SITEURL}) 
+webmaster
+{X_ADMINMAIL}
Index: /temp/test-xoops.ec-cube.net/html/modules/news/language/english/admin.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/language/english/admin.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/language/english/admin.php	(revision 405)
@@ -0,0 +1,90 @@
+<?php
+// $Id: admin.php,v 1.2 2005/03/18 12:52:38 onokazu Exp $
+//%%%%%%	Admin Module Name  Articles 	%%%%%
+define("_AM_DBUPDATED","Database Updated Successfully!");
+define("_AM_CONFIG","News Configuration");
+define("_AM_AUTOARTICLES","Automated Articles");
+define("_AM_STORYID","Story ID");
+define("_AM_TITLE","Title");
+define("_AM_TOPIC","Topic");
+define("_AM_POSTER","Poster");
+define("_AM_PROGRAMMED","Programmed Date/Time");
+define("_AM_ACTION","Action");
+define("_AM_EDIT","Edit");
+define("_AM_DELETE","Delete");
+define("_AM_LAST10ARTS","Last 10 Articles");
+define("_AM_PUBLISHED","Published"); // Published Date
+define("_AM_GO","Go!");
+define("_AM_EDITARTICLE","Edit Article");
+define("_AM_POSTNEWARTICLE","Post New Article");
+define("_AM_ARTPUBLISHED","Your article has been published!");
+define("_AM_HELLO","Hello %s,");
+define("_AM_YOURARTPUB","Your article submitted to our site has been published.");
+define("_AM_TITLEC","Title: ");
+define("_AM_URLC","URL: ");
+define("_AM_PUBLISHEDC","Published: ");
+define("_AM_RUSUREDEL","Are you sure you want to delete this article and all its comments?");
+define("_AM_YES","Yes");
+define("_AM_NO","No");
+define("_AM_INTROTEXT","Intro Text");
+define("_AM_EXTEXT","Extended Text");
+define("_AM_ALLOWEDHTML","Allowed HTML:");
+define("_AM_DISAMILEY","Disable Smiley");
+define("_AM_DISHTML","Disable HTML");
+define("_AM_APPROVE","Approve");
+define("_AM_MOVETOTOP","Move this story to top");
+define("_AM_CHANGEDATETIME","Change the date/time of publication");
+define("_AM_NOWSETTIME","It is now set at: %s"); // %s is datetime of publish
+define("_AM_CURRENTTIME","Current time is: %s");  // %s is the current datetime
+define("_AM_SETDATETIME","Set the date/time of publish");
+define("_AM_MONTHC","Month:");
+define("_AM_DAYC","Day:");
+define("_AM_YEARC","Year:");
+define("_AM_TIMEC","Time:");
+define("_AM_PREVIEW","Preview");
+define("_AM_SAVE","Save");
+define("_AM_PUBINHOME","Publish in Home?");
+define("_AM_ADD","Add");
+
+//%%%%%%	Admin Module Name  Topics 	%%%%%
+
+define("_AM_ADDMTOPIC","Add a MAIN Topic");
+define("_AM_TOPICNAME","Topic Name");
+define("_AM_MAX40CHAR","(max: 40 characters)");
+define("_AM_TOPICIMG","Topic Image");
+define("_AM_IMGNAEXLOC","image name + extension located in %s");
+define("_AM_FEXAMPLE","for example: games.gif");
+define("_AM_ADDSUBTOPIC","Add a SUB-Topic");
+define("_AM_IN","in");
+define("_AM_MODIFYTOPIC","Modify Topic");
+define("_AM_MODIFY","Modify");
+define("_AM_PARENTTOPIC","Parent Topic");
+define("_AM_SAVECHANGE","Save Changes");
+define("_AM_DEL","Delete");
+define("_AM_CANCEL","Cancel");
+define("_AM_WAYSYWTDTTAL","WARNING: Are you sure you want to delete this Topic and ALL its Stories and Comments?");
+
+
+// Added in Beta6
+define("_AM_TOPICSMNGR","Topics Manager");
+define("_AM_PEARTICLES","Post/Edit Articles");
+define("_AM_NEWSUB","New Submissions");
+define("_AM_POSTED","Posted");
+define("_AM_GENERALCONF","General Configuration");
+
+// Added in RC2
+define("_AM_TOPICDISPLAY","Display Topic Image?");
+define("_AM_TOPICALIGN","Position");
+define("_AM_RIGHT","Right");
+define("_AM_LEFT","Left");
+
+define("_AM_EXPARTS","Expired Articles");
+define("_AM_EXPIRED","Expired");
+define("_AM_CHANGEEXPDATETIME","Change the date/time of expiration");
+define("_AM_SETEXPDATETIME","Set the date/time of expiration");
+define("_AM_NOWSETEXPTIME","It is now set at: %s");
+
+// Added in RC3
+define("_AM_ERRORTOPICNAME", "You must enter a topic name!");
+define("_AM_EMPTYNODELETE", "Nothing to delete!");
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/news/language/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/language/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/language/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/news/language/japanese/mail_template/global_storysubmit_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/language/japanese/mail_template/global_storysubmit_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/language/japanese/mail_template/global_storysubmit_notify.tpl	(revision 405)
@@ -0,0 +1,18 @@
+{X_UNAME}¤µ¤ó¡¢¤³¤ó¤Ë¤Á¤Ï
+
+{X_SITENAME}¤Ë¤Æ¿·µ¬¥Ë¥å¡¼¥¹µ­»ö¤ÎÅê¹Æ¤¬¤¢¤ê¤Þ¤·¤¿¡£
+
+µ­»ö¥¿¥¤¥È¥ë¡§¡¡{STORY_NAME}
+
+-----------
+
+¤³¤Î¥á¡¼¥ë¤ÏXOOPS¤Î¼«Æ°ÄÌÃÎµ¡Ç½¤Ë¤è¤Ã¤ÆÁ÷¿®¤µ¤ì¤Æ¤¤¤Þ¤¹
+
+¼«Æ°ÄÌÃÎ¤òÄä»ß¤·¤¿¤¤¾ì¹ç¤Ï²¼µ­¤ÎURL¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡§
+{X_UNSUBSCRIBE_URL}
+
+-----------
+{X_SITENAME} ({X_SITEURL}) 
+´ÉÍý¿Í
+{X_ADMINMAIL}
+-----------
Index: /temp/test-xoops.ec-cube.net/html/modules/news/language/japanese/mail_template/global_newcategory_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/language/japanese/mail_template/global_newcategory_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/language/japanese/mail_template/global_newcategory_notify.tpl	(revision 405)
@@ -0,0 +1,18 @@
+{X_UNAME}¤µ¤ó¡¢¤³¤ó¤Ë¤Á¤Ï
+
+{X_SITENAME}¤Ë¤Æ¿·µ¬¥È¥Ô¥Ã¥¯¤¬ºîÀ®¤µ¤ì¤Þ¤·¤¿¡£
+
+¥È¥Ô¥Ã¥¯Ì¾¡§¡¡{TOPIC_NAME}
+
+-----------
+
+¤³¤Î¥á¡¼¥ë¤ÏXOOPS¤Î¼«Æ°ÄÌÃÎµ¡Ç½¤Ë¤è¤Ã¤ÆÁ÷¿®¤µ¤ì¤Æ¤¤¤Þ¤¹
+
+¼«Æ°ÄÌÃÎ¤òÄä»ß¤·¤¿¤¤¾ì¹ç¤Ï²¼µ­¤ÎURL¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡§
+{X_UNSUBSCRIBE_URL}
+
+-----------
+{X_SITENAME} ({X_SITEURL}) 
+´ÉÍý¿Í
+{X_ADMINMAIL}
+-----------
Index: /temp/test-xoops.ec-cube.net/html/modules/news/language/japanese/mail_template/global_newstory_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/language/japanese/mail_template/global_newstory_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/language/japanese/mail_template/global_newstory_notify.tpl	(revision 405)
@@ -0,0 +1,21 @@
+{X_UNAME}¤µ¤ó¡¢¤³¤ó¤Ë¤Á¤Ï
+
+{X_SITENAME}¤Ë¤Æ¿·µ¬¥Ë¥å¡¼¥¹µ­»ö¤¬·ÇºÜ¤µ¤ì¤Þ¤·¤¿¡£
+
+µ­»ö¥¿¥¤¥È¥ë¡§¡¡{STORY_NAME}
+
+¤³¤Î¥Ë¥å¡¼¥¹µ­»ö¤ò¸«¤ë¤Ë¤Ï²¼µ­URL¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡§
+{STORY_URL}
+
+-----------
+
+¤³¤Î¥á¡¼¥ë¤ÏXOOPS¤Î¼«Æ°ÄÌÃÎµ¡Ç½¤Ë¤è¤Ã¤ÆÁ÷¿®¤µ¤ì¤Æ¤¤¤Þ¤¹
+
+¼«Æ°ÄÌÃÎ¤òÄä»ß¤·¤¿¤¤¾ì¹ç¤Ï²¼µ­¤ÎURL¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡§
+{X_UNSUBSCRIBE_URL}
+
+-----------
+{X_SITENAME} ({X_SITEURL}) 
+´ÉÍý¿Í
+{X_ADMINMAIL}
+-----------
Index: /temp/test-xoops.ec-cube.net/html/modules/news/language/japanese/mail_template/story_approve_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/language/japanese/mail_template/story_approve_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/language/japanese/mail_template/story_approve_notify.tpl	(revision 405)
@@ -0,0 +1,21 @@
+{X_UNAME}¤µ¤ó¡¢¤³¤ó¤Ë¤Á¤Ï
+
+{X_SITENAME}¤Ë¤Æ²¼µ­¥Ë¥å¡¼¥¹µ­»ö¤¬¾µÇ§¤µ¤ì¤Þ¤·¤¿¡£
+
+µ­»ö¥¿¥¤¥È¥ë¡§¡¡{STORY_NAME}
+
+¤³¤Î¥Ë¥å¡¼¥¹µ­»ö¤òÆÉ¤à¤Ë¤Ï²¼µ­URL¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡§
+{STORY_URL}
+
+-----------
+
+¤³¤Î¥á¡¼¥ë¤ÏXOOPS¤Î¼«Æ°ÄÌÃÎµ¡Ç½¤Ë¤è¤Ã¤ÆÁ÷¿®¤µ¤ì¤Æ¤¤¤Þ¤¹
+
+¼«Æ°ÄÌÃÎ¤òÄä»ß¤·¤¿¤¤¾ì¹ç¤Ï²¼µ­¤ÎURL¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡§
+{X_UNSUBSCRIBE_URL}
+
+-----------
+{X_SITENAME} ({X_SITEURL}) 
+´ÉÍý¿Í
+{X_ADMINMAIL}
+-----------
Index: /temp/test-xoops.ec-cube.net/html/modules/news/language/japanese/admin.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/language/japanese/admin.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/language/japanese/admin.php	(revision 405)
@@ -0,0 +1,89 @@
+<?php
+//%%%%%%	Admin Module Name  Articles 	%%%%%
+define("_AM_DBUPDATED","¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò¹¹¿·¤·¤Þ¤·¤¿");
+define("_AM_CONFIG","¥Ë¥å¡¼¥¹ ÀßÄê");
+
+define("_AM_AUTOARTICLES","·ÇºÜÍ½Äê¤Îµ­»ö");
+define("_AM_STORYID","¥Ë¥å¡¼¥¹µ­»öID");
+define("_AM_TITLE","É½Âê");
+define("_AM_TOPIC","¥È¥Ô¥Ã¥¯");
+define("_AM_POSTER","Åê¹Æ¼Ô");
+define("_AM_PROGRAMMED","·ÇºÜÍ½ÄêÆü»þ");
+define("_AM_ACTION","´ÉÍý");
+define("_AM_EDIT","ÊÔ½¸");
+define("_AM_DELETE","ºï½ü");
+define("_AM_LAST10ARTS","ºÇ¿·10¥Ë¥å¡¼¥¹µ­»ö");
+define("_AM_PUBLISHED","·ÇºÜÆü»þ"); // Published Date
+define("_AM_GO","Á÷¿®");
+define("_AM_EDITARTICLE","¥Ë¥å¡¼¥¹µ­»ö¤òÊÔ½¸");
+define("_AM_POSTNEWARTICLE","¿·µ¬¥Ë¥å¡¼¥¹µ­»öºîÀ®");
+define("_AM_ARTPUBLISHED","¥Ë¥å¡¼¥¹µ­»ö¤¬·ÇºÜ¤µ¤ì¤Þ¤·¤¿");
+define("_AM_HELLO","%s¤µ¤ó¡¢¤³¤ó¤Ë¤Á¤Ï");
+define("_AM_YOURARTPUB","¤¢¤Ê¤¿¤¬Åê¹Æ¤·¤¿¥Ë¥å¡¼¥¹µ­»ö¤¬¡¢Åö¥µ¥¤¥È¤Ë¤ÆÀµ¼°·ÇºÜ¤µ¤ì¤Þ¤·¤¿¡£");
+define("_AM_TITLEC","É½Âê¡§");
+define("_AM_URLC","URL¡§");
+define("_AM_PUBLISHEDC","·ÇºÜÆü»þ¡§");
+define("_AM_RUSUREDEL","¤³¤Î¥Ë¥å¡¼¥¹µ­»ö¤ª¤è¤Óµ­»ö¤ËÂÐ¤¹¤ë¥³¥á¥ó¥È¤òÁ´¤Æºï½ü¤·¤Æ¤â¤¤¤¤¤Ç¤¹¤«¡©");
+define("_AM_YES","¤Ï¤¤");
+define("_AM_NO","¤¤¤¤¤¨");
+define("_AM_INTROTEXT","ËÜÊ¸");
+define("_AM_EXTEXT","ËÜÊ¸£²");
+define("_AM_ALLOWEDHTML","»ÈÍÑ²ÄÇ½¤ÊHTML¥¿¥°¡§");
+define("_AM_DISAMILEY","´é¥¢¥¤¥³¥ó¤òÌµ¸ú¤Ë¤¹¤ë");
+define("_AM_DISHTML","HTML¥¿¥°¤òÌµ¸ú¤Ë¤¹¤ë");
+define("_AM_APPROVE","¾µÇ§");
+define("_AM_MOVETOTOP","¤³¤Îµ­»ö¤ò¥È¥Ã¥×¥Ú¡¼¥¸ºÇ¾åÉô¤Ë°ÜÆ°¤¹¤ë");
+define("_AM_CHANGEDATETIME","·ÇºÜÆü»þ¤òÊÑ¹¹¤¹¤ë");
+define("_AM_NOWSETTIME","¸½ºß¤Î·ÇºÜÍ½ÄêÆü»þ¡§ %s"); // %s is datetime of publish
+define("_AM_CURRENTTIME","¸½ºß»þ´Ö¡§ %s");  // %s is the current datetime
+define("_AM_SETDATETIME","·ÇºÜÆü»þ¤òÀßÄê¤¹¤ë");
+define("_AM_MONTHC","·î¡§");
+define("_AM_DAYC","Æü¡§");
+define("_AM_YEARC","Ç¯¡§");
+define("_AM_TIMEC","»þ´Ö¡§");
+define("_AM_PREVIEW","¥×¥ì¥Ó¥å¡¼");
+define("_AM_SAVE","ÊÝÂ¸");
+define("_AM_PUBINHOME","¥È¥Ã¥×¥Ú¡¼¥¸¤Ë·ÇºÜ¤¹¤ë");
+define("_AM_ADD","ÄÉ²Ã");
+
+//%%%%%%	Admin Module Name  Topics 	%%%%%
+
+define("_AM_ADDMTOPIC","¥á¥¤¥ó¥È¥Ô¥Ã¥¯¤ÎºîÀ®");
+define("_AM_TOPICNAME","¥È¥Ô¥Ã¥¯Ì¾");
+define("_AM_MAX40CHAR","¡ÊºÇÂç20Ê¸»ú¡ÊÁ´³Ñ¡Ë¡Ë");
+define("_AM_TOPICIMG","¥È¥Ô¥Ã¥¯²èÁü");
+define("_AM_IMGNAEXLOC","%s ²¼¤Ë¤¢¤ë²èÁü¥Õ¥¡¥¤¥ëÌ¾");
+define("_AM_FEXAMPLE","Îã¡§ games.gif");
+define("_AM_ADDSUBTOPIC","¥µ¥Ö¥È¥Ô¥Ã¥¯¤ÎºîÀ®");
+define("_AM_IN","¿Æ¥È¥Ô¥Ã¥¯¡§");
+define("_AM_MODIFYTOPIC","¥È¥Ô¥Ã¥¯¤ÎÊÔ½¸");
+define("_AM_MODIFY","Á÷¿®");
+define("_AM_PARENTTOPIC","¿Æ¥È¥Ô¥Ã¥¯");
+define("_AM_SAVECHANGE","ÊÑ¹¹¤òÊÝÂ¸");
+define("_AM_DEL","ºï½ü");
+define("_AM_CANCEL","¥­¥ã¥ó¥»¥ë");
+define("_AM_WAYSYWTDTTAL","¤³¤Î¥È¥Ô¥Ã¥¯¤ª¤è¤Ó¤³¤Î¥È¥Ô¥Ã¥¯Æâ¤ÎÁ´¤Æ¤Î¥Ë¥å¡¼¥¹µ­»ö¤ª¤è¤Ó¥³¥á¥ó¥È¤òºï½ü¤·¤Æ¤â¤¤¤¤¤Ç¤¹¤«¡©");
+
+// Added in Beta6
+define("_AM_TOPICSMNGR","¥È¥Ô¥Ã¥¯´ÉÍý¥á¥Ë¥å¡¼");
+define("_AM_PEARTICLES","¥Ë¥å¡¼¥¹µ­»ö¤ÎÅê¹Æ¡¿ÊÔ½¸");
+define("_AM_NEWSUB","¿·µ¬Åê¹Æ¥Ë¥å¡¼¥¹");
+define("_AM_POSTED","Åê¹ÆÆü»þ");
+define("_AM_GENERALCONF","°ìÈÌÀßÄê");
+
+// Added in RC2
+define("_AM_TOPICDISPLAY","¥È¥Ô¥Ã¥¯²èÁü¤òÉ½¼¨");
+define("_AM_TOPICALIGN","°ÌÃÖ");
+define("_AM_RIGHT","±¦Â¦");
+define("_AM_LEFT","º¸Â¦");
+
+define("_AM_EXPARTS","´ü¸ÂÀÚ¤ìµ­»ö");
+define("_AM_EXPIRED","´ü¸ÂÀÚ¤ì");
+define("_AM_CHANGEEXPDATETIME","Í­¸ú´ü¸Â¤òÊÑ¹¹¤¹¤ë");
+define("_AM_SETEXPDATETIME","Í­¸ú´ü¸Â¤òÀßÄê¤¹¤ë");
+define("_AM_NOWSETEXPTIME","¸½ºßÀßÄê¤µ¤ì¤Æ¤¤¤ë´ü¸Â¡§ %s");
+
+define("_AM_ERRORTOPICNAME", "¥È¥Ô¥Ã¥¯Ì¾¤¬µ­Æþ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
+define("_AM_EMPTYNODELETE", "ºï½ü¤Ç¤­¤Þ¤»¤ó");
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/news/language/japanese/modinfo.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/language/japanese/modinfo.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/language/japanese/modinfo.php	(revision 405)
@@ -0,0 +1,65 @@
+<?php
+// Module Info
+
+// The name of this module
+define("_MI_NEWS_NAME","¥Ë¥å¡¼¥¹");
+
+// A brief description of this module
+define("_MI_NEWS_DESC","¥æ¡¼¥¶¤¬¼«Í³¤Ë¥³¥á¥ó¥È¤Ç¤­¤ë¡¢¥¹¥é¥Ã¥·¥å¥É¥Ã¥ÈÉ÷¤Î¥Ë¥å¡¼¥¹µ­»ö¥·¥¹¥Æ¥à¤ò¹½ÃÛ¤·¤Þ¤¹");
+
+// Names of blocks for this module (Not all module has blocks)
+define("_MI_NEWS_BNAME1","¥Ë¥å¡¼¥¹¥È¥Ô¥Ã¥¯¥Ö¥í¥Ã¥¯");
+define("_MI_NEWS_BNAME3","ËÜÆü¤Î¥È¥Ã¥×¥Ë¥å¡¼¥¹¥Ö¥í¥Ã¥¯");
+define("_MI_NEWS_BNAME4","¥È¥Ã¥×¥Ë¥å¡¼¥¹¥Ö¥í¥Ã¥¯");
+define("_MI_NEWS_BNAME5","ºÇ¿·¥Ë¥å¡¼¥¹¥Ö¥í¥Ã¥¯");
+
+define("_MI_NEWS_SMNAME1","¥Ë¥å¡¼¥¹Åê¹Æ");
+define("_MI_NEWS_SMNAME2","¥¢¡¼¥«¥¤¥Ö");
+
+//define("_MI_NEWS_ADMENU1","°ìÈÌÀßÄê");
+define("_MI_NEWS_ADMENU2","¥È¥Ô¥Ã¥¯´ÉÍý");
+define("_MI_NEWS_ADMENU3","¥Ë¥å¡¼¥¹µ­»ö¤ÎÅê¹Æ / ÊÔ½¸");
+
+// Title of config items
+define("_MI_STORYHOME", "¥È¥Ã¥×¥Ú¡¼¥¸¤Ë·ÇºÜ¤¹¤ëµ­»ö¿ô");
+define("_MI_NOTIFYSUBMIT", "¿·µ¬Åê¹Æ¤ÎºÝ¤Ë¥á¡¼¥ë¤ÇÃÎ¤é¤»¤ë");
+define("_MI_DISPLAYNAV", "¥Ê¥Ó¥²¡¼¥·¥ç¥ó¥Ü¥Ã¥¯¥¹¤òÉ½¼¨¤¹¤ë");
+define('_MI_ANONPOST','Æ¿Ì¾¥æ¡¼¥¶¤Ë¤è¤ë¥Ë¥å¡¼¥¹µ­»ö¤ÎÅê¹Æ¤òµö²Ä¤¹¤ë');
+define('_MI_AUTOAPPROVE','´ÉÍý¼Ô¤Î²ðºß¤·¤Ê¤¤¿·µ¬¥Ë¥å¡¼¥¹µ­»ö¤Î¼«Æ°¾µÇ§');
+
+// Description of each config items
+define("_MI_STORYHOMEDSC", "¥È¥Ã¥×¥Ú¡¼¥¸¤ËÉ½¼¨¤¹¤ëµ­»ö¤Î¿ô¤ò»ØÄê¤·¤Æ¤¯¤À¤µ¤¤¡£");
+define("_MI_NOTIFYSUBMITDSC", "¿·µ¬Åê¹Æ¤¬¤¢¤Ã¤¿»þ¤Ë¤ªÃÎ¤é¤»¥á¡¼¥ë¤ò¥¦¥§¥Ö¥Þ¥¹¥¿¡¼¤ËÁ÷¿®¤¹¤ë¤Ë¤Ï¡Ö¤Ï¤¤¡×¤òÁªÂò¤·¤Æ¤¯¤À¤µ¤¤¡£");
+define("_MI_DISPLAYNAVDSC", "¥«¥Æ¥´¥ê¤òÁªÂò¤¹¤ë¥Ê¥Ó¥²¡¼¥·¥ç¥ó¥Ü¥Ã¥¯¥¹¤òµ­»ö¤Î¾åÉô¤ËÉ½¼¨¤¹¤ë¤Ë¤Ï¡Ö¤Ï¤¤¡×¤òÁªÂò¤·¤Æ¤¯¤À¤µ¤¤¡£");
+define('_MI_AUTOAPPROVEDSC', '´ÉÍý¼Ô¤Î¾µÇ§Áàºî¤Ê¤·¤Ë¿·µ¬¥Ë¥å¡¼¥¹µ­»ö¤Î¾µÇ§¤ò¹Ô¤¦¾ì¹ç¤Ï¡Ö¤Ï¤¤¡×¤òÁªÂò¤·¤Æ¤¯¤À¤µ¤¤¡£');
+
+// Text for notifications
+
+define('_MI_NEWS_GLOBAL_NOTIFY', '¥â¥¸¥å¡¼¥ëÁ´ÂÎ');
+define('_MI_NEWS_GLOBAL_NOTIFYDSC', '¥Ë¥å¡¼¥¹¥â¥¸¥å¡¼¥ëÁ´ÂÎ¤Ë¤ª¤±¤ëÄÌÃÎ¥ª¥×¥·¥ç¥ó');
+
+define('_MI_NEWS_STORY_NOTIFY', 'É½¼¨Ãæ¤Î¥Ë¥å¡¼¥¹µ­»ö');
+define('_MI_NEWS_STORY_NOTIFYDSC', 'É½¼¨Ãæ¤Î¥Ë¥å¡¼¥¹µ­»ö¤ËÂÐ¤¹¤ëÄÌÃÎ¥ª¥×¥·¥ç¥ó');
+
+define('_MI_NEWS_GLOBAL_NEWCATEGORY_NOTIFY', '¿·µ¬¥È¥Ô¥Ã¥¯');
+define('_MI_NEWS_GLOBAL_NEWCATEGORY_NOTIFYCAP', '¿·µ¬¥È¥Ô¥Ã¥¯¤¬ºîÀ®¤µ¤ì¤¿¾ì¹ç¤ËÄÌÃÎ¤¹¤ë');
+define('_MI_NEWS_GLOBAL_NEWCATEGORY_NOTIFYDSC', '¿·µ¬¥È¥Ô¥Ã¥¯¤¬ºîÀ®¤µ¤ì¤¿¾ì¹ç¤ËÄÌÃÎ¤¹¤ë');
+define('_MI_NEWS_GLOBAL_NEWCATEGORY_NOTIFYSBJ', '[{X_SITENAME}] {X_MODULE}: ¿·µ¬¥È¥Ô¥Ã¥¯¤¬ºîÀ®¤µ¤ì¤Þ¤·¤¿');
+
+define('_MI_NEWS_GLOBAL_STORYSUBMIT_NOTIFY', '¿·µ¬¥Ë¥å¡¼¥¹µ­»öÅê¹Æ');       
+define('_MI_NEWS_GLOBAL_STORYSUBMIT_NOTIFYCAP', '¿·µ¬¥Ë¥å¡¼¥¹¤ÎÅê¹Æ¤¬¤¢¤Ã¤¿¾ì¹ç¤ËÄÌÃÎ¤¹¤ë');                           
+define('_MI_NEWS_GLOBAL_STORYSUBMIT_NOTIFYDSC', '¿·µ¬¥Ë¥å¡¼¥¹¤ÎÅê¹Æ¤¬¤¢¤Ã¤¿¾ì¹ç¤ËÄÌÃÎ¤¹¤ë');                
+define('_MI_NEWS_GLOBAL_STORYSUBMIT_NOTIFYSBJ', '[{X_SITENAME}] {X_MODULE}: ¿·µ¬¥Ë¥å¡¼¥¹¤ÎÅê¹Æ¤¬¤¢¤ê¤Þ¤·¤¿');                              
+
+define('_MI_NEWS_GLOBAL_NEWSTORY_NOTIFY', '¿·µ¬¥Ë¥å¡¼¥¹µ­»ö·ÇºÜ');       
+define('_MI_NEWS_GLOBAL_NEWSTORY_NOTIFYCAP', '¿·µ¬¥Ë¥å¡¼¥¹µ­»ö¤¬·ÇºÜ¤µ¤ì¤¿¾ì¹ç¤ËÄÌÃÎ¤¹¤ë');
+define('_MI_NEWS_GLOBAL_NEWSTORY_NOTIFYDSC', '¿·µ¬¥Ë¥å¡¼¥¹µ­»ö¤¬·ÇºÜ¤µ¤ì¤¿¾ì¹ç¤ËÄÌÃÎ¤¹¤ë');
+define('_MI_NEWS_GLOBAL_NEWSTORY_NOTIFYSBJ', '[{X_SITENAME}] {X_MODULE}: ¿·µ¬¥Ë¥å¡¼¥¹¤¬·ÇºÜ¤µ¤ì¤Þ¤·¤¿');                              
+
+define('_MI_NEWS_STORY_APPROVE_NOTIFY', '¥Ë¥å¡¼¥¹µ­»ö¤Î¾µÇ§');
+define('_MI_NEWS_STORY_APPROVE_NOTIFYCAP', '¤³¤Î¥Ë¥å¡¼¥¹µ­»ö¤¬¾µÇ§¤µ¤ì¤¿¾ì¹ç¤ËÄÌÃÎ¤¹¤ë');
+define('_MI_NEWS_STORY_APPROVE_NOTIFYDSC', '¤³¤Î¥Ë¥å¡¼¥¹µ­»ö¤¬¾µÇ§¤µ¤ì¤¿¾ì¹ç¤ËÄÌÃÎ¤¹¤ë');
+define('_MI_NEWS_STORY_APPROVE_NOTIFYSBJ', '[{X_SITENAME}] {X_MODULE}: ¥Ë¥å¡¼¥¹µ­»ö¤¬¾µÇ§¤µ¤ì¤Þ¤·¤¿');
+
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/news/language/japanese/blocks.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/language/japanese/blocks.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/language/japanese/blocks.php	(revision 405)
@@ -0,0 +1,12 @@
+<?php
+// Blocks
+define("_MB_NEWS_NOTYET","ËÜÆü¤Î¥È¥Ã¥×¥Ë¥å¡¼¥¹¤Ï¤¢¤ê¤Þ¤»¤ó");
+define("_MB_NEWS_TMRSI","ËÜÆüºÇ¤âÆÉ¤Þ¤ì¤¿¥Ë¥å¡¼¥¹µ­»ö¤Ï¡§");
+define("_MB_NEWS_ORDER","ÊÂ¤Ó½ç");
+define("_MB_NEWS_DATE","·ÇºÜÆü»þ");
+define("_MB_NEWS_HITS","¥Ò¥Ã¥È¿ô");
+define("_MB_NEWS_DISP","É½¼¨·ï¿ô¡§");
+define("_MB_NEWS_ARTCLS","·ï");
+define("_MB_NEWS_CHARS","É½¼¨·ïÌ¾¤ÎÄ¹¤µ");
+define("_MB_NEWS_LENGTH"," ¥Ð¥¤¥È");
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/news/language/japanese/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/language/japanese/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/language/japanese/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/news/language/japanese/main.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/language/japanese/main.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/language/japanese/main.php	(revision 405)
@@ -0,0 +1,56 @@
+<?php
+//%%%%%%		File Name index.php 		%%%%%
+define("_NW_PRINTER","°õºþÍÑ¥Ú¡¼¥¸");
+define("_NW_SENDSTORY","¤³¤Î¥Ë¥å¡¼¥¹¤òÍ§Ã£¤ËÁ÷¤ë");
+define("_NW_READMORE","Â³¤­...");
+define("_NW_COMMENTS","¥³¥á¥ó¥È¤¹¤ë");
+define("_NW_ONECOMMENT","1¥³¥á¥ó¥È");
+define("_NW_BYTESMORE","»Ä¤ê%s¥Ð¥¤¥È");
+define("_NW_NUMCOMMENTS","%s¥³¥á¥ó¥È");
+
+//%%%%%%		File Name submit.php		%%%%%
+define("_NW_SUBMITNEWS","¥Ë¥å¡¼¥¹Åê¹Æ");
+define("_NW_TITLE","É½Âê");
+define("_NW_TOPIC","¥È¥Ô¥Ã¥¯");
+define("_NW_THESCOOP","¥á¥Ã¥»¡¼¥¸ËÜÊ¸");
+define("_NW_NOTIFYPUBLISH","¥Ë¥å¡¼¥¹¤¬¾µÇ§¤µ¤ì¤¿»Ý¤ò¥á¡¼¥ë¤Ç¼õ¤±¼è¤ë");
+define("_NW_POST","Åê¹Æ¤¹¤ë");
+define("_NW_GO","Á÷¿®");
+define("_NW_THANKS","Åê¹Æ¤ò¼õÉÕ¤±¤Þ¤·¤¿¡£Åö¥µ¥¤¥È¥¹¥¿¥Ã¥Õ¤Ë¤è¤ë¾µÇ§¤ò·Ð¤¿¸å¤ËÀµ¼°·ÇºÜ¤È¤Ê¤ë¤³¤È¤ò¤´Î»¾µ¤¯¤À¤µ¤¤¡£"); //submission of news article
+// Added 2.0.11jp
+define("_NW_THANKS_AUTOAPPROVE", "Åê¹Æ¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£");
+
+define("_NW_NOTIFYSBJCT","NEWS for my site"); // Notification mail subject
+define("_NW_NOTIFYMSG","¿·µ¬¥Ë¥å¡¼¥¹¤ÎÅê¹Æ¤¬¤¢¤ê¤Þ¤·¤¿¡£"); // Notification mail message
+
+//%%%%%%		File Name archive.php		%%%%%
+define("_NW_NEWSARCHIVES","¥Ë¥å¡¼¥¹¥¢¡¼¥«¥¤¥Ö");
+define("_NW_ARTICLES","¥Ë¥å¡¼¥¹");
+define("_NW_VIEWS","¥Ò¥Ã¥È");
+define("_NW_DATE","Åê¹ÆÆü»þ");
+define("_NW_ACTIONS","");
+define("_NW_PRINTERFRIENDLY","°õºþÍÑ¥Ú¡¼¥¸");
+define("_NW_THEREAREINTOTAL","·× %s·ï¤Î¥Ë¥å¡¼¥¹µ­»ö¤¬¤¢¤ê¤Þ¤¹");
+
+// %s is your site name
+define("_NW_INTARTICLE","%s¤Ç¸«¤Ä¤±¤¿¶½Ì£¿¼¤¤¥Ë¥å¡¼¥¹");
+define("_NW_INTARTFOUND","°Ê²¼¤Ï%s¤Ç¸«¤Ä¤±¤¿Èó¾ï¤Ë¶½Ì£¿¼¤¤¥Ë¥å¡¼¥¹µ­»ö¤Ç¤¹¡§");
+
+define("_NW_TOPICC","¥È¥Ô¥Ã¥¯¡§");
+define("_NW_URL","URL¡§");
+define("_NW_NOSTORY","ÁªÂò¤µ¤ì¤¿¥Ë¥å¡¼¥¹µ­»ö¤ÏÂ¸ºß¤·¤Þ¤»¤ó");
+
+//%%%%%%	File Name print.php 	%%%%%
+
+define("_NW_URLFORSTORY","¤³¤Î¥Ë¥å¡¼¥¹µ­»ö¤¬·ÇºÜ¤µ¤ì¤Æ¤¤¤ëURL¡§");
+
+// %s represents your site name
+define("_NW_THISCOMESFROM","%s¤Ë¤Æ¹¹¤ËÂ¿¤¯¤Î¥Ë¥å¡¼¥¹µ­»ö¤ò¤è¤à¤³¤È¤¬¤Ç¤­¤Þ¤¹");
+
+// Added language definitions for news expiry date
+define("_AM_EXPARTS","É½¼¨´ü¸Â¤¬²á¤®¤¿µ­»ö");
+define("_AM_EXPIRED","´ü¸ÂÀÚ¤ì");
+define("_AM_CHANGEEXPDATETIME","É½¼¨´ü¸Â(ÆüÉÕ/»þ¹ï)¤òÊÑ¹¹");
+define("_AM_SETEXPDATETIME","É½¼¨´ü¸Â(ÆüÉÕ/»þ¹ï)¤òÀßÄê");
+define("_AM_NOWSETEXPTIME","ÀßÄêºÑ¤ÎÉ½¼¨´ü¸Â: %s");
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/news/include/comment_functions.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/include/comment_functions.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/include/comment_functions.php	(revision 405)
@@ -0,0 +1,42 @@
+<?php
+// $Id: comment_functions.php,v 1.2 2005/03/18 12:52:38 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+// comment callback functions
+
+include_once XOOPS_ROOT_PATH.'/modules/news/class/class.newsstory.php';
+function news_com_update($story_id, $total_num){
+	$article = new NewsStory($story_id);
+	if (!$article->updateComments($total_num)) {
+		return false;
+	}
+	return true;
+}
+
+function news_com_approve(&$comment){
+	// notification mail here
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/news/include/storyform.inc.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/include/storyform.inc.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/include/storyform.inc.php	(revision 405)
@@ -0,0 +1,66 @@
+<?php
+// $Id: storyform.inc.php,v 1.7 2005/09/04 20:46:11 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+if (!defined('XOOPS_ROOT_PATH')) {
+    exit();
+}
+include XOOPS_ROOT_PATH."/class/xoopsformloader.php";
+$sform = new XoopsThemeForm(_NW_SUBMITNEWS, "storyform", xoops_getenv('PHP_SELF'));
+$sform->addElement(new XoopsFormToken(XoopsMultiTokenHandler::quickCreate('news_submit')));
+$sform->addElement(new XoopsFormText(_NW_TITLE, 'subject', 50, 80, $subject), true);
+ob_start();
+$xt->makeTopicSelBox(0);
+$sform->addElement(new XoopsFormLabel(_NW_TOPIC, ob_get_contents()));
+ob_end_clean();
+$sform->addElement($topic_select);
+$sform->addElement(new XoopsFormDhtmlTextArea(_NW_THESCOOP, 'message', $message, 15, 60), true);
+$option_tray = new XoopsFormElementTray(_OPTIONS,'<br />');
+if ($xoopsUser) {
+    if ($xoopsModuleConfig['anonpost'] == 1) {
+        $noname_checkbox = new XoopsFormCheckBox('', 'noname', $noname);
+        $noname_checkbox->addOption(1, _POSTANON);
+        $option_tray->addElement($noname_checkbox);
+    }
+    $notify_checkbox = new XoopsFormCheckBox('', 'notifypub', $notifypub);
+    $notify_checkbox->addOption(1, _NW_NOTIFYPUBLISH);
+    $option_tray->addElement($notify_checkbox);
+    if ($xoopsUser->isAdmin($xoopsModule->getVar('mid'))) {
+        $nohtml_checkbox = new XoopsFormCheckBox('', 'nohtml', $nohtml);
+        $nohtml_checkbox->addOption(1, _DISABLEHTML);
+        $option_tray->addElement($nohtml_checkbox);
+    }
+}
+$smiley_checkbox = new XoopsFormCheckBox('', 'nosmiley', $nosmiley);
+$smiley_checkbox->addOption(1, _DISABLESMILEY);
+$option_tray->addElement($smiley_checkbox);
+$sform->addElement($option_tray);
+$button_tray = new XoopsFormElementTray('' ,'');
+$button_tray->addElement(new XoopsFormButton('', 'preview', _PREVIEW, 'submit'));
+$button_tray->addElement(new XoopsFormButton('', 'post', _NW_POST, 'submit'));
+$sform->addElement($button_tray);
+$sform->display();
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/news/include/search.inc.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/include/search.inc.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/include/search.inc.php	(revision 405)
@@ -0,0 +1,58 @@
+<?php
+// $Id: search.inc.php,v 1.2 2005/03/18 12:52:38 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+function news_search($queryarray, $andor, $limit, $offset, $userid){
+	global $xoopsDB;
+	$sql = "SELECT storyid,uid,title,created FROM ".$xoopsDB->prefix("stories")." WHERE published>0 AND published<=".time()."";
+	if ( $userid != 0 ) {
+		$sql .= " AND uid=".$userid." ";
+	}
+	// because count() returns 1 even if a supplied variable
+	// is not an array, we must check if $querryarray is really an array
+	if ( is_array($queryarray) && $count = count($queryarray) ) {
+		$sql .= " AND ((hometext LIKE '%$queryarray[0]%' OR bodytext LIKE '%$queryarray[0]%' OR title LIKE '%$queryarray[0]%')";
+		for($i=1;$i<$count;$i++){
+			$sql .= " $andor ";
+			$sql .= "(hometext LIKE '%$queryarray[$i]%' OR bodytext LIKE '%$queryarray[$i]%' OR title LIKE '%$queryarray[$i]%')";
+		}
+		$sql .= ") ";
+	}
+	$sql .= "ORDER BY created DESC";
+	$result = $xoopsDB->query($sql,$limit,$offset);
+	$ret = array();
+	$i = 0;
+ 	while($myrow = $xoopsDB->fetchArray($result)){
+		$ret[$i]['image'] = "images/forum.gif";
+		$ret[$i]['link'] = "article.php?storyid=".$myrow['storyid']."";
+		$ret[$i]['title'] = $myrow['title'];
+		$ret[$i]['time'] = $myrow['created'];
+		$ret[$i]['uid'] = $myrow['uid'];
+		$i++;
+	}
+	return $ret;
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/news/include/notification.inc.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/include/notification.inc.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/include/notification.inc.php	(revision 405)
@@ -0,0 +1,60 @@
+<?php
+// $Id: notification.inc.php,v 1.2 2005/03/18 12:52:38 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+function news_notify_iteminfo($category, $item_id)
+{
+	global $xoopsModule, $xoopsModuleConfig, $xoopsConfig;
+
+	if (empty($xoopsModule) || $xoopsModule->getVar('dirname') != 'news') {	
+		$module_handler =& xoops_gethandler('module');
+		$module =& $module_handler->getByDirname('news');
+		$config_handler =& xoops_gethandler('config');
+		$config =& $config_handler->getConfigsByCat(0,$module->getVar('mid'));
+	} else {
+		$module =& $xoopsModule;
+		$config =& $xoopsModuleConfig;
+	}
+
+	if ($category=='global') {
+		$item['name'] = '';
+		$item['url'] = '';
+		return $item;
+	}
+
+	global $xoopsDB;
+
+	if ($category=='story') {
+		// Assume we have a valid story id
+		$sql = 'SELECT title FROM '.$xoopsDB->prefix('stories') . ' WHERE storyid = ' . $item_id;
+		$result = $xoopsDB->query($sql); // TODO: error check
+		$result_array = $xoopsDB->fetchArray($result);
+		$item['name'] = $result_array['title'];
+		$item['url'] = XOOPS_URL . '/modules/' . $module->getVar('dirname') . '/article.php?storyid=' . $item_id;
+		return $item;
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/news/include/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/include/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/include/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/news/admin/index.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/admin/index.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/admin/index.php	(revision 405)
@@ -0,0 +1,686 @@
+<?php
+// $Id: index.php,v 1.4 2005/08/03 12:39:14 onokazu Exp $
+// ------------------------------------------------------------------------ //
+// XOOPS - PHP Content Management System                      //
+// Copyright (c) 2000 XOOPS.org                           //
+// <http://www.xoops.org/>                             //
+// ------------------------------------------------------------------------ //
+// 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.                                      //
+// //
+// You may not change or alter any portion of this comment or credits       //
+// of supporting developers from this source code or any supporting         //
+// source code which is considered copyrighted (c) material of the          //
+// original comment or credit authors.                                      //
+// //
+// 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 //
+// ------------------------------------------------------------------------ //
+include '../../../include/cp_header.php';
+include_once XOOPS_ROOT_PATH . "/class/xoopstopic.php";
+include_once XOOPS_ROOT_PATH . "/class/xoopslists.php";
+include_once XOOPS_ROOT_PATH . "/modules/news/class/class.newsstory.php";
+$op = 'default';
+
+if (isset($_GET['op'])) {
+    $op = $_GET['op'];
+    $storyid = !empty($_GET['storyid']) ? intval($_GET['storyid']) : 0;
+} elseif (!empty($_POST['op'])) {
+    $op = $_POST['op'];
+    $storyid = !empty($_POST['storyid']) ? intval($_POST['storyid']) : 0;
+}
+
+if ($op == 'preview' || $op == 'save') {
+    if (!XoopsMultiTokenHandler::quickValidate('news_admin_submit')) {
+        $op = 'newarticle';
+    }
+}
+
+/*
+ * Show new submissions
+ */
+function newSubmissions()
+{
+    global $xoopsConfig, $xoopsDB;
+    $storyarray = NewsStory :: getAllSubmitted();
+    if ( count( $storyarray ) > 0 )
+    {
+        echo"<table width='100%' border='0' cellspacing='1' class='outer'><tr><td class=\"odd\">";
+        echo "<div style='text-align: center;'><b>" . _AM_NEWSUB . "</b><br /><table width='100%' border='1'><tr class='bg2'><td align='center'>" . _AM_TITLE . "</td><td align='center'>" . _AM_POSTED . "</td><td align='center'>" . _AM_POSTER . "</td><td align='center'>" . _AM_ACTION . "</td></tr>\n";
+        foreach( $storyarray as $newstory )
+        {
+            echo "<tr><td>\n";
+            $title = $newstory -> title();
+            if ( !isset( $title ) || ( $title == "" ) )
+            {
+                echo "<a href='index.php?op=edit&amp;storyid=" . $newstory -> storyid() . "'>" . _AD_NOSUBJECT . "</a>\n";
+            }
+            else
+            {
+                echo "&nbsp;<a href='index.php?op=edit&amp;storyid=" . $newstory -> storyid() . "'>" . $title . "</a>\n";
+            }
+            echo "</td><td align='center' class='nw'>" . formatTimestamp( $newstory -> created() ) . "</td><td align='center'><a href='" . XOOPS_URL . "/userinfo.php?uid=" . $newstory -> uid() . "'>" . $newstory -> uname() . "</a></td><td align='right'><a href='index.php?op=delete&amp;storyid=" . $newstory -> storyid() . "'>" . _AM_DELETE . "</a></td></tr>\n";
+        }
+        echo "</table></div>\n";
+        echo"</td></tr></table>";
+        echo "<br />";
+    }
+}
+
+function RENDER_NEWS_TITLE(&$obj)
+{
+	global $xoopsModule;
+	$ret="";
+	if($obj->published()<time())
+		$ret = @sprintf("<a href='%s'>%s</a>",
+			XOOPS_URL."/modules/".$xoopsModule->dirname()."/article.php?storyid=".$obj->storyid(),
+			$obj->title() );
+	else
+		$ret = $obj->title();
+
+	return $ret;
+}
+
+/*
+ * Shows automated stories
+ */
+function autoStories()
+{
+    global $xoopsDB, $xoopsConfig, $xoopsModule;
+    $storyarray = NewsStory :: getAllAutoStory();
+    if ( count( $storyarray ) > 0 )
+    {
+        echo"<table width='100%' border='0' cellspacing='1' class='outer'><tr><td class=\"odd\">";
+        echo "<div style='text-align: center;'><b>" . _AM_AUTOARTICLES . "</b><br />\n";
+        echo "<table border='1' width='100%'><tr class='bg2'><td align='center'>" . _AM_STORYID . "</td><td align='center'>" . _AM_TITLE . "</td><td align='center'>" . _AM_TOPIC . "</td><td align='center'>" . _AM_POSTER . "</td><td align='center' class='nw'>" . _AM_PROGRAMMED . "</td><td align='center' class='nw'>" . _AM_EXPIRED . "</td><td align='center'>" . _AM_ACTION . "</td></tr>";
+        foreach( $storyarray as $autostory )
+        {
+            $topic = $autostory -> topic();
+            $expire = ( $autostory -> expired() > 0 ) ? formatTimestamp( $autostory -> expired() ) : '';
+
+            echo "
+                <tr><td align='center'><b>" . $autostory -> storyid() . "</b>
+                </td><td align='left'>" . RENDER_NEWS_TITLE($autostory) . 
+                "</td><td align='center'>" . $topic -> topic_title() . "
+                </td><td align='center'><a href='" . XOOPS_URL . "/userinfo.php?uid=" . $autostory -> uid() . "'>" . $autostory -> uname() . "</a></td><td align='center' class='nw'>" . formatTimestamp( $autostory -> published() ) . "</td><td align='center'>" . $expire . "</td><td align='center'><a href='index.php?op=edit&amp;storyid=" . $autostory -> storyid() . "'>" . _AM_EDIT . "</a>-<a href='index.php?op=delete&amp;storyid=" . $autostory -> storyid() . "'>" . _AM_DELETE . "</a>";
+            echo "</td></tr>\n";
+        }
+        echo "</table>";
+        echo "</div>";
+        echo"</td></tr></table>";
+        echo "<br />";
+    }
+}
+
+/*
+ * Shows last 10 published stories
+ */
+function lastStories()
+{
+    global $xoopsDB, $xoopsConfig, $xoopsModule;
+    echo"<table width='100%' border='0' cellspacing='1' class='outer'><tr><td class=\"odd\">";
+    echo "<div style='text-align: center;'><b>" . _AM_LAST10ARTS . "</b><br />";
+    $storyarray = NewsStory :: getAllPublished( 10, 0, 0, 1 );
+    echo "<table border='1' width='100%'><tr class='bg3'><td align='center'>" . _AM_STORYID . "</td><td align='center'>" . _AM_TITLE . "</td><td align='center'>" . _AM_TOPIC . "</td><td align='center'>" . _AM_POSTER . "</td><td align='center' class='nw'>" . _AM_PUBLISHED . "</td><td align='center' class='nw'>" . _AM_EXPIRED . "</td><td align='center'>" . _AM_ACTION . "</td></tr>";
+    foreach( $storyarray as $eachstory )
+    {
+        $published = formatTimestamp( $eachstory -> published() );
+        $expired = ( $eachstory -> expired() > 0 ) ? formatTimestamp( $eachstory -> expired() ) : '---';
+        $topic = $eachstory -> topic();
+        echo "
+            <tr><td align='center'><b>" . $eachstory -> storyid() . "</b>
+            </td><td align='left'>".RENDER_NEWS_TITLE($eachstory).
+            "</td><td align='center'>" . $topic -> topic_title() . "
+            </td><td align='center'><a href='" . XOOPS_URL . "/userinfo.php?uid=" . $eachstory -> uid() . "'>" . $eachstory -> uname() . "</a></td><td align='center' class='nw'>" . $published . "</td><td align='center'>" . $expired . "</td><td align='center'><a href='index.php?op=edit&amp;storyid=" . $eachstory -> storyid() . "'>" . _AM_EDIT . "</a>-<a href='index.php?op=delete&amp;storyid=" . $eachstory -> storyid() . "'>" . _AM_DELETE . "</a>";
+        echo "</td></tr>\n";
+    }
+    echo "</table><br />";
+    echo "<form action='index.php' method='post'>
+        " . _AM_STORYID . " <input type='text' name='storyid' size='10' />
+        <select name='op'>
+        <option value='edit' selected='selected'>" . _AM_EDIT . "</option>
+        <option value='delete'>" . _AM_DELETE . "</option>
+        </select>
+        <input type='submit' value='" . _AM_GO . "' />
+        </form>
+    </div>
+        ";
+    echo"</td></tr></table>";
+}
+// Added function to display expired stories
+function expStories()
+{
+    global $xoopsDB, $xoopsConfig, $xoopsModule;
+    echo"<table width='100%' border='0' cellspacing='1' class='outer'><tr><td class=\"odd\">";
+    echo "<div style='text-align: center;'><b>" . _AM_EXPARTS . "</b><br />";
+    $storyarray = NewsStory :: getAllExpired( 10, 0, 0, 1 );
+    echo "<table border='1' width='100%'><tr class='bg3'><td align='center'>" . _AM_STORYID . "</td><td align='center'>" . _AM_TITLE . "</td><td align='center'>" . _AM_TOPIC . "</td><td align='center'>" . _AM_POSTER . "</td><td align='center' class='nw'>" . _AM_PUBLISHED . "</td><td align='center' class='nw'>" . _AM_EXPIRED . "</td><td align='center'>" . _AM_ACTION . "</td></tr>";
+    foreach( $storyarray as $eachstory )
+    {
+        $published = formatTimestamp( $eachstory -> published() );
+        $expired = formatTimestamp( $eachstory -> expired() );
+        $topic = $eachstory -> topic();
+        // added exired value field to table
+        echo "
+            <tr><td align='center'><b>" . $eachstory -> storyid() . "</b>
+            </td><td align='left'>" . RENDER_NEWS_TITLE($eachstory) .
+            "</td><td align='center'>" . $topic -> topic_title() . "
+            </td><td align='center'><a href='" . XOOPS_URL . "/userinfo.php?uid=" . $eachstory -> uid() . "'>" . $eachstory -> uname() . "</a></td><td align='center' class='nw'>" . $published . "</td><td align='center' class='nw'>" . $expired . "</td><td align='center'><a href='index.php?op=edit&amp;storyid=" . $eachstory -> storyid() . "'>" . _AM_EDIT . "</a>-<a href='index.php?op=delete&amp;storyid=" . $eachstory -> storyid() . "'>" . _AM_DELETE . "</a>";
+        echo "</td></tr>\n";
+    }
+    echo "</table><br />";
+    echo "<form action='index.php' method='post'>
+        " . _AM_STORYID . " <input type='text' name='storyid' size='10' />
+        <select name='op'>
+        <option value='edit' selected='selected'>" . _AM_EDIT . "</option>
+        <option value='delete'>" . _AM_DELETE . "</option>
+        </select>
+        <input type='submit' value='" . _AM_GO . "' />
+        </form>
+    </div>
+        ";
+    echo"</td></tr></table>";
+}
+
+function topicsmanager()
+{
+    global $xoopsDB, $xoopsConfig, $xoopsModule;
+    xoops_cp_header();
+    echo "<h4>" . _AM_CONFIG . "</h4>";
+    $xt = new XoopsTopic( $xoopsDB -> prefix( "topics" ) );
+    $topics_array = XoopsLists :: getImgListAsArray( XOOPS_ROOT_PATH . "/modules/news/images/topics/" );
+    // $xoopsModule->printAdminMenu();
+    // echo "<br />";
+    // Add a New Main Topic
+    echo"<table width='100%' border='0' cellspacing='1' class='outer'><tr><td class=\"odd\">";
+    echo "<form method='post' action='index.php'>\n";
+    echo "<h4>" . _AM_ADDMTOPIC . "</h4><br />";
+    echo "<b>" . _AM_TOPICNAME . "</b> " . _AM_MAX40CHAR . "<br /><input type='text' name='topic_title' size='20' maxlength='20' /><br />";
+    echo "<b>" . _AM_TOPICIMG . "</b> (" . sprintf( _AM_IMGNAEXLOC, "modules/" . $xoopsModule -> dirname() . "/images/topics/" ) . ")<br />" . _AM_FEXAMPLE . "<br />";
+    echo "<select size='1' name='topic_imgurl'>";
+    echo "<option value=' '>------</option>";
+    foreach( $topics_array as $image )
+    {
+        echo "<option value='" . $image . "'>" . $image . "</option>";
+    }
+    echo "</select><br /><br />";
+    echo "<input type='hidden' name='topic_pid' value='0' />\n";
+    echo "<input type='hidden' name='op' value='addTopic' />";
+    echo "<input type='submit' value=" . _AM_ADD . " /><br /></form>";
+    echo"</td></tr></table>";
+    echo "<br />";
+    // Add a New Sub-Topic
+    $result = $xoopsDB -> query( "select count(*) from " . $xoopsDB -> prefix( "topics" ) . "" );
+    list( $numrows ) = $xoopsDB -> fetchRow( $result );
+    if ( $numrows > 0 )
+    {
+        echo"<table width='100%' border='0' cellspacing='1' class='outer'><tr><td class=\"odd\">";
+        echo "<form method='post' action='index.php'>";
+        echo "<h4>" . _AM_ADDSUBTOPIC . "</h4><br />";
+        echo "<b>" . _AM_TOPICNAME . "</b> " . _AM_MAX40CHAR . "<br /><input type='text' name='topic_title' size='20' maxlength='40' />&nbsp;" . _AM_IN . "&nbsp;";
+        $xt -> makeTopicSelBox( 0, 0, "topic_pid" );
+        echo "<br />";
+        echo "<b>" . _AM_TOPICIMG . "</b> (" . sprintf( _AM_IMGNAEXLOC, "modules/" . $xoopsModule -> dirname() . "/images/topics/" ) . ")<br />" . _AM_FEXAMPLE . "<br />";
+        echo "<select size='1' name='topic_imgurl'>";
+        echo "<option value=' '>------</option>";
+        foreach( $topics_array as $image )
+        {
+            echo "<option value='" . $image . "'>" . $image . "</option>";
+        }
+        echo "</select><br /><br />";
+        echo "<input type='hidden' name='op' value='addTopic' />";
+        echo "<input type='submit' value='" . _AM_ADD . "' /><br /></form>";
+        echo"</td></tr></table>";
+        echo "<br />";
+        // Modify Topic
+        echo"<table width='100%' border='0' cellspacing='1' class='outer'><tr><td class=\"odd\">";
+        echo "
+            <form method='post' action='index.php'>
+            <h4>" . _AM_MODIFYTOPIC . "</h4><br />";
+        echo "<b>" . _AM_TOPIC . "</b><br />";
+        $xt -> makeTopicSelBox();
+        echo "<br /><br />\n";
+        echo "<input type='hidden' name='op' value='modTopic' />\n";
+        echo "<input type='submit' value='" . _AM_MODIFY . "' />\n";
+        echo "</form>";
+        echo"</td></tr></table>";
+    }
+}
+
+function modTopic()
+{
+    global $xoopsDB, $xoopsConfig;
+    global $xoopsModule;
+    $xt = new XoopsTopic( $xoopsDB -> prefix( "topics" ), $_POST['topic_id'] );
+    $topics_array = XoopsLists :: getImgListAsArray( XOOPS_ROOT_PATH . "/modules/news/images/topics/" );
+    xoops_cp_header();
+    echo "<h4>" . _AM_CONFIG . "</h4>";
+    // $xoopsModule->printAdminMenu();
+    // echo "<br />";
+    echo "<table width='100%' border='0' cellspacing='1' class='outer'><tr><td class=\"odd\">";
+    echo "<h4>" . _AM_MODIFYTOPIC . "</h4><br />";
+    if ( $xt -> topic_imgurl() )
+    {
+        echo "<div style='text-align: right;'><img src='" . XOOPS_URL . "/modules/" . $xoopsModule -> dirname() . "/images/topics/" . $xt -> topic_imgurl() . "'></div>";
+    }
+    echo "<form action='index.php' method='post'>";
+    echo "<b>" . _AM_TOPICNAME . "</b>&nbsp;" . _AM_MAX40CHAR . "<br /><input type='text' name='topic_title' size='20' maxlength='40' value='" . $xt -> topic_title('E') . "' /><br />";
+    echo "<b>" . _AM_TOPICIMG . "</b>&nbsp;(" . sprintf( _AM_IMGNAEXLOC, "modules/" . $xoopsModule -> dirname() . "/images/topics/" ) . ")<br />" . _AM_FEXAMPLE . "<br />";
+    // echo "<input type='text' name='topic_imgurl' size='20' maxlength='20' value='".$xt->topic_imgurl()."' /><br />\n";
+    echo "<select size='1' name='topic_imgurl'>";
+    echo "<option value=' '>------</option>";
+    foreach( $topics_array as $image )
+    {
+        if ( $image == $xt -> topic_imgurl() )
+        {
+            $opt_selected = "selected='selected'";
+        }
+        else
+        {
+            $opt_selected = "";
+        }
+        echo "<option value='" . $image . "' $opt_selected>" . $image . "</option>";
+    }
+    echo "</select><br />";
+    echo "<b>" . _AM_PARENTTOPIC . "<b><br />\n";
+    $xt -> makeTopicSelBox( 1, $xt -> topic_pid(), "topic_pid" );
+    echo "\n<br /><br />";
+
+    echo "<input type='hidden' name='topic_id' value='" . $xt -> topic_id() . "' />\n";
+    echo "<input type='hidden' name='op' value='modTopicS' />";
+    echo "<input type='submit' value='" . _AM_SAVECHANGE . "' />&nbsp;<input type='button' value='" . _AM_DEL . "' onclick='location=\"index.php?topic_pid=" . $xt -> topic_pid() . "&amp;topic_id=" . $xt -> topic_id() . "&amp;op=delTopic\"' />\n";
+    echo "&nbsp;<input type='button' value='" . _AM_CANCEL . "' onclick='javascript:history.go(-1)' />\n";
+    echo "</form>";
+    echo"</td></tr></table>";
+}
+function modTopicS()
+{
+    global $xoopsDB;
+    $xt = new XoopsTopic( $xoopsDB -> prefix( "topics" ), $_POST['topic_id'] );
+    if ( $_POST['topic_pid'] == $_POST['topic_id'] )
+    {
+        echo "ERROR: Cannot select this topic for parent topic!";
+        exit();
+    }
+    $xt -> setTopicPid( $_POST['topic_pid'] );
+    if ( empty( $_POST['topic_title'] ) )
+    {
+        redirect_header( "index.php?op=topicsmanager", 2, _AM_ERRORTOPICNAME );
+    }
+    $xt -> setTopicTitle( $_POST['topic_title'] );
+    if ( isset( $_POST['topic_imgurl'] ) && $_POST['topic_imgurl'] != "" )
+    {
+        $xt -> setTopicImgurl( $_POST['topic_imgurl'] );
+    }
+    $xt -> store();
+    redirect_header( 'index.php?op=topicsmanager', 1, _AM_DBUPDATED );
+    exit();
+}
+function delTopic()
+{
+    global $xoopsDB, $xoopsConfig, $xoopsModule;
+    if ( empty($_POST['ok']) )
+    {
+        xoops_cp_header();
+        echo "<h4>" . _AM_CONFIG . "</h4>";
+        xoops_confirm( array( 'op' => 'delTopic', 'topic_id' => intval( $_GET['topic_id'] ), 'ok' => 1 ), 'index.php', _AM_WAYSYWTDTTAL );
+    }
+    else
+    {
+        $xt = new XoopsTopic( $xoopsDB -> prefix( "topics" ), $_POST['topic_id'] );
+        // get all subtopics under the specified topic
+        $topic_arr = $xt -> getAllChildTopics();
+        array_push( $topic_arr, $xt );
+        foreach( $topic_arr as $eachtopic )
+        {
+            // get all stories in each topic
+            $story_arr = NewsStory :: getByTopic( $eachtopic -> topic_id() );
+            foreach( $story_arr as $eachstory )
+            {
+                if ( false != $eachstory -> delete() )
+                {
+                    xoops_comment_delete( $xoopsModule -> getVar( 'mid' ), $eachstory -> storyid() );
+                    xoops_notification_deletebyitem( $xoopsModule -> getVar( 'mid' ), 'story', $eachstory -> storyid() );
+                }
+            }
+            // all stories for each topic is deleted, now delete the topic data
+            $eachtopic -> delete();
+            xoops_notification_deletebyitem( $xoopsModule -> getVar( 'mid' ), 'category', $eachtopic -> topic_id );
+        }
+        redirect_header( 'index.php?op=topicsmanager', 1, _AM_DBUPDATED );
+        exit();
+    }
+}
+
+function addTopic()
+{
+    global $xoopsDB, $_POST;
+    $xt = new XoopsTopic( $xoopsDB -> prefix( "topics" ) );
+    if ( !$xt -> topicExists( $_POST['topic_pid'], $_POST['topic_pid'] ) )
+    {
+        $xt -> setTopicPid( $_POST['topic_pid'] );
+        if ( empty( $_POST['topic_title'] ) )
+        {
+            redirect_header( "index.php?op=topicsmanager", 2, _AM_ERRORTOPICNAME );
+        }
+        $xt -> setTopicTitle( $_POST['topic_title'] );
+        if ( isset( $_POST['topic_imgurl'] ) && $_POST['topic_imgurl'] != "" )
+        {
+            $xt -> setTopicImgurl( $_POST['topic_imgurl'] );
+        }
+        $xt -> store();
+        $notification_handler = & xoops_gethandler( 'notification' );
+        $tags = array();
+        $tags['TOPIC_NAME'] = $_POST['topic_title'];
+        $notification_handler -> triggerEvent( 'global', 0, 'new_category', $tags );
+        redirect_header( 'index.php?op=topicsmanager', 1, _AM_DBUPDATED );
+    }
+    else
+    {
+        echo "Topic exists!";
+    }
+    exit();
+}
+
+switch ( $op )
+{
+    case "edit":
+        xoops_cp_header();
+        echo "<h4>" . _AM_CONFIG . "</h4>";
+        // $xoopsModule->printAdminMenu();
+        // echo "<br />";
+        echo"<table width='100%' border='0' cellspacing='1' class='outer'><tr><td class=\"odd\">";
+        echo "<h4>" . _AM_EDITARTICLE . "</h4>";
+        $story = new NewsStory( $storyid );
+        $title = $story -> title( "Edit" );
+        $hometext = $story -> hometext( "Edit" );
+        $bodytext = $story -> bodytext( "Edit" );
+        $nohtml = $story -> nohtml();
+        $nosmiley = $story -> nosmiley();
+        $ihome = $story -> ihome();
+        $topicid = $story -> topicid();
+        if ( $story -> published() != 0)
+        {
+            $published = $story -> published();
+        }
+        if ( $story -> expired() != 0)
+        {
+            $expired = $story -> expired();
+        }
+
+        // $notifypub = $story->notifypub();
+        $type = $story -> type();
+        $topicdisplay = $story -> topicdisplay();
+        $topicalign = $story -> topicalign( false );
+        $isedit = 1;
+        include "storyform.inc.php";
+        echo"</td></tr></table>";
+        break;
+
+    case "newarticle":
+        xoops_cp_header();
+        echo "<h4>" . _AM_CONFIG . "</h4>";
+        include_once XOOPS_ROOT_PATH . "/class/module.textsanitizer.php";
+        // $xoopsModule->printAdminMenu();
+        // echo "<br />";
+        newSubmissions();
+        autoStories();
+        lastStories();
+        expStories();
+        echo "<br />";
+        echo"<table width='100%' border='0' cellspacing='1' class='outer'><tr><td class=\"odd\">";
+        echo "<h4>" . _AM_POSTNEWARTICLE . "</h4>";
+        $type = "admin";
+        include "storyform.inc.php";
+        echo"</td></tr></table>";
+        break;
+
+    case "preview":
+        xoops_cp_header();
+        echo "<h4>" . _AM_CONFIG . "</h4>";
+        if ( isset( $storyid ) )
+        {
+            $story = new NewsStory( $storyid );
+            $published = $story -> published();
+            $expired = $story -> expired();
+        }
+        else
+        {
+            $story = new NewsStory();
+        }
+        $story -> setTitle( $_POST['title'] );
+        $story -> setHomeText( $_POST['hometext'] );
+        $story -> setBodyText( $_POST['bodytext'] );
+        if ( isset( $_POST['nohtml'] ) && ( $_POST['nohtml'] == 0 || $_POST['nohtml'] == 1 ) )
+        {
+            $story -> setNohtml( $_POST['nohtml'] );
+        }
+        if ( isset( $_POST['nosmiley'] ) && ( $_POST['nosmiley'] == 0 || $_POST['nosmiley'] == 1 ) )
+        {
+            $story -> setNosmiley( $_POST['nosmiley'] );
+        }
+
+        $xt = new XoopsTopic( $xoopsDB -> prefix( "topics" ) );
+        $p_title = $story -> title( "Preview" );
+        $p_hometext = $story -> hometext( "Preview" );
+        $p_bodytext = $story -> bodytext( "Preview" );
+        $title = $story -> title( "InForm" );
+        $hometext = $story -> hometext( "InForm" );
+        $bodytext = $story -> bodytext( "InForm" );
+        echo"<table width='100%' border='0' cellspacing='1' class='outer'><tr><td class=\"odd\">";
+        $timage = "";
+        $warning = "";
+        if ( $_POST['topicdisplay'] )
+        {
+            if ( $_POST['topicalign'] == "L" )
+            {
+                $align = "left";
+            }
+            else
+            {
+                $align = "right";
+            }
+            if ( empty( $_POST['topicid'] ) )
+            {
+                $warning = "<div style='text-align: center;'><blink><b>" . _AR_SELECTTOPIC . "</b></blink></div>";
+                $timage = "";
+            }
+            else
+            {
+                $xt = new XoopsTopic( $xoopsDB -> prefix( "topics" ), $_POST['topicid'] );
+                if ( $xt -> topic_imgurl() != '' && file_exists( XOOPS_ROOT_PATH . '/modules/news/images/topics/' . $xt -> topic_imgurl() ) )
+                {
+                    $timage = "<img src='" . XOOPS_URL . "/modules/news/images/topics/" . $xt -> topic_imgurl() . "' align='$align' border='0' hspace='10' vspace=10' />";
+                }
+            }
+        }
+        if ( isset( $p_bodytext ) && $p_bodytext != "" )
+        {
+            echo "<p><b>" . $p_title . "</b><br /><br />" . $timage . "" . $p_hometext . "<br /><br />" . $p_bodytext . "<br /><br /></p>";
+        }
+        else
+        {
+            echo "<p><b>" . $p_title . "</b><br /><br />" . $timage . "" . $p_hometext . "<br /><br /></p>";
+        }
+        echo $warning;
+        echo"</td></tr></table><br />";
+        echo"<table width='100%' border='0' cellspacing='1' class='outer'><tr><td class=\"odd\">";
+
+        foreach (array('autodate', 'autohour', 'automin', 'automonth', 'autoday', 'autoyear', 'autoexpdate', 'autoexphour', 'autoexpmin', 'autoexpmonth', 'autoexpday', 'autoexpyear', 'publiches', 'approve', 'nohtml', 'nosmiley', 'ihome', 'topicdisplay', 'topicid', 'movetotop', 'isedit') as $k) {
+            $$k = !empty($_POST[$k]) ? intval($_POST[$k]) : 0;
+        }
+        $type = $_POST['type'];
+        $topicalign = $_POST['topicalign'];
+
+        include "storyform.inc.php";
+        echo"</td></tr></table>";
+        break;
+
+    case "save":
+        if ( empty( $storyid ) )
+        {
+            $story = new NewsStory();
+            $story -> setUid( $xoopsUser -> uid() );
+            if ( !empty( $_POST['autodate'] ) )
+            {
+                $pubdate = mktime( $_POST['autohour'], $_POST['automin'], 0, $_POST['automonth'], $_POST['autoday'], $_POST['autoyear'] );
+                $offset = $xoopsUser -> timezone() - $xoopsConfig['server_TZ'];
+                $pubdate = $pubdate - ( $offset * 3600 );
+                $story -> setPublished( $pubdate );
+            }
+            else
+            {
+                $story -> setPublished( time() );
+            }
+            if ( !empty( $_POST['autoexpdate'] ) )
+            {
+                $expdate = mktime( $_POST['autoexphour'], $_POST['autoexpmin'], 0, $_POST['autoexpmonth'], $_POST['autoexpday'], $_POST['autoexpyear'] );
+                $offset = $xoopsUser -> timezone() - $xoopsConfig['server_TZ'];
+                $expdate = $expdate - ( $offset * 3600 );
+                $story -> setExpired( $expdate );
+            }
+            else
+            {
+                $story -> setExpired( 0 );
+            }
+            $story -> setType( $_POST['type'] );
+            $story -> setHostname( getenv( "REMOTE_ADDR" ) );
+            // $story->setNotifyPub($notifypub);
+        }
+        else
+        {
+            $story = new NewsStory( $storyid );
+            if ( !empty( $_POST['autodate'] ) )
+            {
+                $pubdate = mktime( $_POST['autohour'], $_POST['automin'], 0, $_POST['automonth'], $_POST['autoday'], $_POST['autoyear'] );
+                $offset = $xoopsUser -> timezone();
+                $offset = $offset - $xoopsConfig['server_TZ'];
+                $pubdate = $pubdate - ( $offset * 3600 );
+                $story -> setPublished( $pubdate );
+            } elseif ( ( $story -> published() == 0 ) && !empty($_POST['approve']) )
+            {
+                $story -> setPublished( time() );
+                $isnew = 1;
+            }
+            else
+            {
+                if ( !empty( $_POST['movetotop'] ) )
+                {
+                    $story -> setPublished( time() );
+                }
+            }
+            if ( !empty( $_POST['autoexpdate'] ) )
+            {
+                $expdate = mktime( $_POST['autoexphour'], $_POST['autoexpmin'], 0, $_POST['autoexpmonth'], $_POST['autoexpday'], $_POST['autoexpyear'] );
+            if ( !empty( $autoexpdate ) )
+                $offset = $xoopsUser -> timezone() - $xoopsConfig['server_TZ'];
+                $expdate = $expdate - ( $offset * 3600 );
+                $story -> setExpired( $expdate );
+            }
+        }
+        $story -> setApproved( $_POST['approve'] );
+        $story -> setTopicId( $_POST['topicid'] );
+        $story -> setTitle( $_POST['title'] );
+        $story -> setHometext( $_POST['hometext'] );
+        $story -> setBodytext( $_POST['bodytext'] );
+        $nohtml = ( empty( $_POST['nohtml'] ) ) ? 0 : 1;
+        $nosmiley = ( empty( $_POST['nosmiley'] ) ) ? 0 : 1;
+        $story -> setNohtml( $nohtml );
+        $story -> setNosmiley( $nosmiley );
+        $story -> setIhome( $_POST['ihome'] );
+        $story -> setTopicalign( $_POST['topicalign'] );
+        $story -> setTopicdisplay( $_POST['topicdisplay'] );
+        $story -> store();
+        $notification_handler = & xoops_gethandler( 'notification' );
+        $tags = array();
+        $tags['STORY_NAME'] = $story -> title();
+        $tags['STORY_URL'] = XOOPS_URL . '/modules/' . $xoopsModule -> getVar( 'dirname' ) . '/article.php?storyid=' . $story -> storyid();
+        if ( !empty( $isnew ) )
+        {
+            $notification_handler -> triggerEvent( 'story', $story -> storyid(), 'approve', $tags );
+        }
+        $notification_handler -> triggerEvent( 'global', 0, 'new_story', $tags );
+        /*
+            $poster = new XoopsUser($story->uid());
+            $subject = _AM_ARTPUBLISHED;
+            $message = sprintf(_AM_HELLO,$poster->uname());
+            $message .= "\n\n"._AM_YOURARTPUB."\n\n";
+            $message .= _AM_TITLEC.$story->title()."\n"._AM_URLC.XOOPS_URL."/modules/".$xoopsModule->dirname()."/article.php?storyid=".$story->storyid()."\n"._AM_PUBLISHEDC.formatTimestamp($story->published(),"m",0)."\n\n";
+            $message .= $xoopsConfig['sitename']."\n".XOOPS_URL."";
+            $xoopsMailer =& getMailer();
+            $xoopsMailer->useMail();
+            $xoopsMailer->setToEmails($poster->getVar("email"));
+            $xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
+            $xoopsMailer->setFromName($xoopsConfig['sitename']);
+            $xoopsMailer->setSubject($subject);
+            $xoopsMailer->setBody($message);
+            $xoopsMailer->send();
+        }
+        */
+        redirect_header( 'index.php?op=newarticle', 1, _AM_DBUPDATED );
+        exit();
+        break;
+
+    case "delete":
+        if ( !empty( $_POST['ok'] ) )
+        {
+            if ( empty( $storyid ) )
+            {
+                redirect_header( 'index.php?op=newarticle', 2, _AM_EMPTYNODELETE );
+                exit();
+            }
+            $story = new NewsStory( $storyid );
+            $story -> delete();
+            xoops_comment_delete( $xoopsModule -> getVar( 'mid' ), $storyid );
+            xoops_notification_deletebyitem( $xoopsModule -> getVar( 'mid' ), 'story', $storyid );
+            redirect_header( 'index.php?op=newarticle', 1, _AM_DBUPDATED );
+            exit();
+        }
+        else
+        {
+            xoops_cp_header();
+            echo "<h4>" . _AM_CONFIG . "</h4>";
+            xoops_confirm( array( 'op' => 'delete', 'storyid' => $storyid, 'ok' => 1 ), 'index.php', _AM_RUSUREDEL );
+        }
+        break;
+    case "topicsmanager":
+        topicsmanager();
+        break;
+
+    case "addTopic":
+        addTopic();
+        break;
+
+    case "delTopic":
+        delTopic();
+        break;
+    case "modTopic":
+        modTopic();
+        break;
+    case "modTopicS":
+        modTopicS();
+        break;
+    case "default":
+    default:
+        xoops_cp_header();
+        echo "<h4>" . _AM_CONFIG . "</h4>";
+        echo"<table width='100%' border='0' cellspacing='1' class='outer'><tr><td class=\"odd\">";
+        echo " - <b><a href='" . XOOPS_URL . '/modules/system/admin.php?fct=preferences&amp;op=showmod&amp;mod=' . $xoopsModule -> getVar( 'mid' ) . "'>" . _AM_GENERALCONF . "</a></b><br /><br />\n";
+        echo " - <b><a href='index.php?op=topicsmanager'>" . _AM_TOPICSMNGR . "</a></b>";
+        echo "<br /><br />\n";
+        echo " - <b><a href='index.php?op=newarticle'>" . _AM_PEARTICLES . "</a></b>\n";
+        echo"</td></tr></table>";
+        break;
+}
+
+xoops_cp_footer();
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/news/admin/storyform.inc.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/admin/storyform.inc.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/admin/storyform.inc.php	(revision 405)
@@ -0,0 +1,397 @@
+<?php
+// $Id: storyform.inc.php,v 1.5 2005/09/04 20:46:11 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+if ( !preg_match("/index.php/", $_SERVER['PHP_SELF']) ) {
+    exit("Access Denied");
+}
+include XOOPS_ROOT_PATH."/include/xoopscodes.php";
+if(!isset($submit_page)){
+    $submit_page = xoops_getenv('PHP_SELF');
+}
+
+$token=&XoopsMultiTokenHandler::quickCreate('news_admin_submit');
+
+?>
+<table><tr><td>
+<form action='<?php echo $submit_page;?>' method='post' name='coolsus'>
+<?php
+echo $token->getHtml();
+echo "<p><b>"._AM_TITLE."</b><br />";
+echo "<input type='text' name='title' id='title' value='";
+if(isset($title)){
+    echo $title;
+}
+echo "' size='70' maxlength='80' />";
+echo "</p><p>";
+
+echo "<b>"._AM_TOPIC."</b>&nbsp;";
+$xt = new XoopsTopic($xoopsDB->prefix("topics"));
+if(isset($topicid)){
+    $xt->makeTopicSelBox(0, $topicid, "topicid");
+}else{
+    $xt->makeTopicSelBox(0, 0, "topicid");
+}
+
+echo "<br /><b>"._AM_TOPICDISPLAY."</b>&nbsp;&nbsp;<input type='radio' name='topicdisplay' value='1'";
+$topicdisplay = !isset($topicdisplay) ? 1 : $topicdisplay;
+if ($topicdisplay == 1) {
+    echo " checked='checked'";
+}
+echo " />"._AM_YES."&nbsp;<input type='radio' name='topicdisplay' value='0'";
+if (empty($topicdisplay)) {
+    echo " checked='checked'";
+}
+echo " />"._AM_NO."&nbsp;&nbsp;&nbsp;";
+echo "<b>"._AM_TOPICALIGN."</b>&nbsp;<select name='topicalign'>\n";
+    if (isset($topicalign) && "L" == $topicalign) {
+            $sel = " selected='selected'";
+    } else {
+            $sel = "";
+    }
+echo "<option value='R'>"._AM_RIGHT."</option>\n";
+echo "<option value='L'".$sel.">"._AM_LEFT."</option>\n";
+echo "</select>\n";
+echo "<br />";
+
+if(isset($ihome)){
+    puthome($ihome);
+}else{
+    puthome();
+}
+
+echo "</p><p><b>"._AM_INTROTEXT."</b><br /><br />\n";
+xoopsCodeTarea("hometext", 60, 15);
+xoopsSmilies("hometext");
+echo "<br /></p><p><b>"._AM_EXTEXT."</b><br /><br />\n";
+xoopsCodeTarea("bodytext", 60, 15, 2);
+xoopsSmilies("bodytext");
+echo "</p>"._MULTIPAGE;
+if ( !empty($xoopsConfig['allow_html']) ) {
+    echo "<p>"._AM_ALLOWEDHTML."<br />";
+    //echo get_allowed_html();
+    echo "</p>";
+}
+echo "<p><input type='checkbox' name='nosmiley' value='1'";
+if(isset($nosmiley) && $nosmiley==1){
+    echo " checked='checked'";
+}
+echo " /> "._AM_DISAMILEY."<br />";
+echo "<input type='checkbox' name='nohtml' value='1'";
+if(isset($nohtml) && $nohtml==1){
+    echo " checked='checked'";
+}
+echo " /> "._AM_DISHTML."<br />";
+
+echo "<br /><input type='checkbox' name='autodate' value='1'";
+if(isset($autodate) && $autodate==1){
+    echo " checked='checked'";
+}
+echo "> ";
+$time = time();
+if(isset($isedit) && $isedit==1 && $published >$time){
+    echo _AM_CHANGEDATETIME."<br />";
+    printf(_AM_NOWSETTIME,formatTimestamp($published));
+    echo "<br />";
+    $published = xoops_getUserTimestamp($published);
+    printf(_AM_CURRENTTIME,formatTimestamp($time));
+    echo "<br />";
+    echo "<input type='hidden' name='isedit' value='1' />";
+}else{
+    echo _AM_SETDATETIME."<br />";
+    printf(_AM_CURRENTTIME,formatTimestamp($time));
+    echo "<br />";
+}
+
+echo "<br /> &nbsp; "._AM_MONTHC." <select name='automonth'>";
+if (isset($automonth)) {
+    $automonth = intval($automonth);
+} elseif (isset($published)) {
+    $automonth = date('m', $published);
+} else {
+    $automonth = date('m');
+}
+for ($xmonth=1; $xmonth<13; $xmonth++) {
+    if ($xmonth == $automonth) {
+        $sel = 'selected="selected"';
+    } else {
+        $sel = '';
+    }
+    echo "<option value='$xmonth' $sel>$xmonth</option>";
+}
+echo "</select>&nbsp;";
+
+echo _AM_DAYC." <select name='autoday'>";
+if (isset($autoday)) {
+    $autoday = intval($autoday);
+} elseif (isset($published)) {
+    $autoday = date('d', $published);
+} else {
+    $autoday = date('d');
+}
+
+for ($xday=1; $xday<32; $xday++) {
+    if ($xday == $autoday) {
+        $sel = 'selected="selected"';
+    } else {
+        $sel = '';
+    }
+    echo "<option value='$xday' $sel>$xday</option>";
+}
+echo "</select>&nbsp;";
+
+echo _AM_YEARC." <select name='autoyear'>";
+if (isset($autoyear)) {
+    $autoyear = intval($autoyear);
+} elseif (isset($published)) {
+    $autoyear = date('Y', $published);
+} else {
+    $autoyear = date('Y');
+}
+
+$cyear    = date('Y');
+for ($xyear=($autoyear-8); $xyear < ($cyear+2); $xyear++) {
+    if ($xyear == $autoyear) {
+        $sel = 'selected="selected"';
+    } else {
+        $sel = '';
+    }
+    echo "<option value='$xyear' $sel>$xyear</option>";
+}
+echo "</select>";
+
+echo "&nbsp;"._AM_TIMEC." <select name='autohour'>";
+if (isset($autohour)) {
+    $autohour = intval($autohour);
+} elseif (isset($published)) {
+    $autohour = date('H', $published);
+} else {
+    $autohour = date('H');
+}
+
+for ($xhour=0; $xhour<24; $xhour++) {
+    if ($xhour == $autohour) {
+        $sel = 'selected="selected"';
+    } else {
+        $sel = '';
+    }
+    echo "<option value='$xhour' $sel>$xhour</option>";
+}
+echo "</select>";
+
+echo " : <select name='automin'>";
+if (isset($automin)) {
+    $automin = intval($automin);
+} elseif (isset($published)) {
+    $automin = date('i', $published);
+} else {
+    $automin = date('i');
+}
+
+for ($xmin=0; $xmin<61; $xmin++) {
+    if ($xmin == $automin) {
+        $sel = 'selected="selected"';
+    } else {
+        $sel = '';
+    }
+    $xxmin = $xmin;
+    if ($xxmin < 10) {
+        $xxmin = "0$xmin";
+    }
+    echo "<option value='$xmin' $sel>$xxmin</option>";
+}
+echo "</select></br />";
+
+echo "<br /><input type='checkbox' name='autoexpdate' value='1'";
+if(isset($autoexpdate) && $autoexpdate==1){
+    echo " checked='checked'";
+}
+echo "> ";
+$time = time();
+if(isset($isedit) && $isedit == 1 && $expired > 0){
+    echo _AM_CHANGEEXPDATETIME."<br />";
+    printf(_AM_NOWSETEXPTIME,formatTimestamp($expired));
+    echo "<br />";
+    $expired = xoops_getUserTimestamp($expired);
+
+    printf(_AM_CURRENTTIME,formatTimestamp($time));
+    echo "<br />";
+    echo "<input type='hidden' name='isedit' value='1' />";
+}else{
+    echo _AM_SETEXPDATETIME."<br />";
+    printf(_AM_CURRENTTIME,formatTimestamp($time));
+    echo "<br />";
+}
+
+echo "<br /> &nbsp; "._AM_MONTHC." <select name='autoexpmonth'>";
+if (isset($autoexpmonth)) {
+    $autoexpmonth = intval($autoexpmonth);
+} elseif (isset($expired)) {
+    $autoexpmonth = date('m', $expired);
+} else {
+    $autoexpmonth = date('m');
+    $autoexpmonth = $autoexpmonth + 1;
+}
+for ($xmonth=1; $xmonth<13; $xmonth++) {
+    if ($xmonth == $autoexpmonth) {
+        $sel = 'selected="selected"';
+    } else {
+        $sel = '';
+    }
+    echo "<option value='$xmonth' $sel>$xmonth</option>";
+}
+echo "</select>&nbsp;";
+
+echo _AM_DAYC." <select name='autoexpday'>";
+if (isset($autoexpday)) {
+    $autoexpday = intval($autoexpday);
+} elseif (isset($expired)) {
+    $autoexpday = date('d', $expired);
+} else {
+    $autoexpday = date('d');
+}
+
+for ($xday=1; $xday<32; $xday++) {
+    if ($xday == $autoexpday) {
+        $sel = 'selected="selected"';
+    } else {
+        $sel = '';
+    }
+    echo "<option value='$xday' $sel>$xday</option>";
+}echo "</select>&nbsp;";
+
+echo _AM_YEARC." <select name='autoexpyear'>";
+if (isset($autoexpyear)) {
+    $autoyear = intval($autoexpyear);
+} elseif (isset($expired)) {
+    $autoexpyear = date('Y', $expired);
+} else {
+    $autoexpyear = date('Y');
+}
+
+$cyear = date('Y');
+for ($xyear=($autoexpyear-8); $xyear < ($cyear+2); $xyear++) {
+    if ($xyear == $autoexpyear) {
+        $sel = 'selected="selected"';
+    } else {
+        $sel = '';
+    }
+    echo "<option value='$xyear' $sel>$xyear</option>";
+}
+echo "</select>";
+
+echo "&nbsp;"._AM_TIMEC." <select name='autoexphour'>";
+if (isset($autoexphour)) {
+    $autoexphour = intval($autoexphour);
+} elseif (isset($expired)) {
+    $autoexphour = date('H', $expired);
+} else {
+    $autoexphour = date('H');
+}
+
+for ($xhour=0; $xhour<24; $xhour++) {
+    if ($xhour == $autoexphour) {
+        $sel = 'selected="selected"';
+    } else {
+        $sel = '';
+    }
+    echo "<option value='$xhour' $sel>$xhour</option>";
+}
+echo "</select>";
+
+echo " : <select name='autoexpmin'>";
+if (isset($autoexpmin)) {
+    $autoexpmin = intval($autoexpmin);
+} elseif (isset($expired)) {
+    $autoexpmin = date('i', $expired);
+} else {
+    $autoexpmin = date('i');
+}
+
+for ($xmin=0; $xmin<61; $xmin++) {
+    if ($xmin == $autoexpmin) {
+        $sel = 'selected="selected"';
+    } else {
+        $sel = '';
+    }
+    $xxmin = $xmin;
+    if ($xxmin < 10) {
+        $xxmin = "0$xmin";
+    }
+    echo "<option value='$xmin' $sel>$xxmin</option>";
+}
+echo "</select><br /><br />";
+
+if(isset($published) && $published == 0 && isset($type) && $type == "user"){
+    echo "<br /><input type='checkbox' name='approve' value='1'";
+    if(isset($approve) && $approve==1){
+        echo " checked='checked'";
+    }
+    echo " />&nbsp;<b>"._AM_APPROVE."</b><br />";
+} else {
+    if(isset($isedit) && $isedit==1){
+        echo "<br /><input type='checkbox' name='movetotop' value='1'";
+        if(isset($movetotop) && $movetotop==1){
+            echo " checked='checked'";
+        }
+        echo " />&nbsp;<b>"._AM_MOVETOTOP."</b><br />";
+        echo "<input type='hidden' name='isedit' value='1' />";
+    }
+    echo "<input type='hidden' name='approve' value='1' />";
+}
+echo "<select name='op'>\n";
+echo "<option value='preview' selected='selected'>"._AM_PREVIEW."</option>\n";
+echo "<option value='save'>"._AM_SAVE."</option>\n";
+if (!empty($storyid)) {
+    echo "<option value='delete'>"._AM_DELETE."</option>\n";
+}
+echo "</select>";
+if(isset($storyid)){
+    echo "<input type='hidden' name='storyid' value='".$storyid."' />\n";
+}
+echo "<input type='hidden' name='type' value='".$type."' />\n";
+echo "<input type='hidden' name='fct' value='articles' />\n";
+echo "<input type='submit' value='"._AM_GO."' />\n";
+echo "</p></form>";
+echo "</td></tr></table>";
+
+unset($submit_page);
+
+function puthome($ihome="") {
+        echo "<br /><b>"._AM_PUBINHOME."</b>&nbsp;&nbsp;";
+        if (($ihome == 0) OR ($ihome == "")) {
+        $sel1 = "checked='checked'";
+        $sel2 = "";
+        }
+        if ($ihome == 1) {
+        $sel1 = "";
+        $sel2 = "checked='checked'";
+        }
+        echo "<input type='radio' name='ihome' value='0' $sel1 />"._AM_YES."&nbsp;";
+        echo "<input type='radio' name='ihome' value='1' $sel2 />"._AM_NO."<br />";
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/news/admin/menu.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/admin/menu.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/admin/menu.php	(revision 405)
@@ -0,0 +1,32 @@
+<?php
+// $Id: menu.php,v 1.2 2005/03/18 12:52:25 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+$adminmenu[1]['title'] = _MI_NEWS_ADMENU2;
+$adminmenu[1]['link'] = "admin/index.php?op=topicsmanager";
+$adminmenu[2]['title'] = _MI_NEWS_ADMENU3;
+$adminmenu[2]['link'] = "admin/index.php?op=newarticle";
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/news/submit.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/submit.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/submit.php	(revision 405)
@@ -0,0 +1,172 @@
+<?php
+// $Id: submit.php,v 1.5 2005/08/03 12:39:14 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+include '../../mainfile.php';
+include_once 'class/class.newsstory.php';
+if (empty($xoopsModuleConfig['anonpost']) && !is_object($xoopsUser)) {
+    redirect_header("index.php", 0, _NOPERM);
+    exit();
+}
+error_reporting(E_ALL);
+$op = isset($_POST['op']) ? $_POST['op'] : 'form';
+
+if (!empty($_POST['preview'])) {
+    if (XoopsMultiTokenHandler::quickValidate('news_submit')) {
+        $op = 'preview';
+    }
+    else {
+	    $op = 'form';
+    }
+} elseif (!empty($_POST['post'])) {
+    if (XoopsMultiTokenHandler::quickValidate('news_submit')) {
+        $op = 'post';
+    }
+    else {
+	    $op = 'form';
+    }
+}
+
+$topic_id = isset($_POST['topic_id']) ? intval($_POST['topic_id']) : 0;
+$noname = isset($_POST['noname']) ? intval($_POST['noname']) : 0;
+$notifypub = isset($_POST['notifypub']) ? intval($_POST['notifypub']) : 0;
+$nosmiley = isset($_POST['nosmiley']) ? intval($_POST['nosmiley']) : 0;
+$myts =& MyTextSanitizer::getInstance();
+switch ($op) {
+case "preview":
+    $xt = new XoopsTopic($xoopsDB->prefix("topics"), $topic_id);
+    include  XOOPS_ROOT_PATH.'/header.php';
+    $p_subject = $myts->makeTboxData4Preview($_POST['subject']);
+    if ($xoopsUser && $xoopsUser->isAdmin($xoopsModule->getVar('mid'))) {
+        $nohtml = isset($_POST['nohtml']) ? intval($_POST['nohtml']) : 0;
+    } else {
+        $nohtml = 1;
+    }
+    $html = empty($nohtml) ? 1 : 0;
+    if ( isset($nosmiley) && intval($nosmiley) > 0 ) {
+        $nosmiley = 1;
+        $smiley = 0;
+    } else {
+        $nosmiley = 0;
+        $smiley = 1;
+    }
+    $p_message = $myts->makeTareaData4Preview($_POST['message'], $html, $smiley, 1);
+    $subject = $myts->makeTboxData4PreviewInForm($_POST['subject']);
+    $message = $myts->makeTareaData4PreviewInForm($_POST['message']);
+    $p_message = ($xt->topic_imgurl() != '') ? '<img src="images/topics/'.$xt->topic_imgurl().'" align="right" alt="" />'.$p_message : $p_message;
+    themecenterposts($p_subject, $p_message);
+    include 'include/storyform.inc.php';
+    include XOOPS_ROOT_PATH.'/footer.php';
+    break;
+case "post":
+    $nohtml_db = 1;
+    if ( $xoopsUser ) {
+        $uid = $xoopsUser->getVar('uid');
+        if ( $xoopsUser->isAdmin($xoopsModule->mid()) ) {
+            $nohtml_db = empty($_POST['nohtml']) ? 0 : 1;
+        }
+        if (( $xoopsModuleConfig['anonpost'] == 1 ) && $noname) {
+            $uid = 0;
+        }
+    } else {
+        if ( $xoopsModuleConfig['anonpost'] == 1 ) {
+            $uid = 0;
+        } else {
+            redirect_header("index.php",3,_NOPERM);
+            exit();
+        }
+    }
+    $story = new NewsStory();
+    $story->setTitle($_POST['subject']);
+    $story->setHometext($_POST['message']);
+    $story->setUid($uid);
+    $story->setTopicId($topic_id);
+    $story->setHostname(xoops_getenv('REMOTE_ADDR'));
+    $story->setNohtml($nohtml_db);
+    $story->setNosmiley($nosmiley);
+    $story->setNotifyPub($notifypub);
+    $story->setType('user');
+    if ( $xoopsModuleConfig['autoapprove'] == 1 ) {
+        $approve = 1;
+        $story->setApproved($approve);
+        $story->setPublished(time());
+        $story->setExpired(0);
+        $story->setTopicalign('R');
+    }
+    $result = $story->store();
+    if ($result) {
+        // Notification
+        $notification_handler =& xoops_gethandler('notification');
+        $tags = array();
+        $tags['STORY_NAME'] = $myts->stripSlashesGPC($_POST['subject']);
+        $tags['STORY_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/article.php?storyid=' . $story->storyid();
+        if ( $xoopsModuleConfig['autoapprove'] == 1) {
+            $notification_handler->triggerEvent('global', 0, 'new_story', $tags);
+        } else {
+            $tags['WAITINGSTORIES_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/admin/index.php?op=newarticle';
+            $notification_handler->triggerEvent('global', 0, 'story_submit', $tags);
+        }
+        // If notify checkbox is set, add subscription for approve
+        if ($notifypub) {
+            include_once XOOPS_ROOT_PATH . '/include/notification_constants.php';
+            $notification_handler->subscribe('story', $story->storyid(), 'approve', XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE);
+        }
+    /*
+        if ($xoopsModuleConfig['notifysubmit'] == 1 ) {
+            $xoopsMailer =& getMailer();
+            $xoopsMailer->useMail();
+            $xoopsMailer->setToEmails($xoopsConfig['adminmail']);
+            $xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
+            $xoopsMailer->setFromName($xoopsConfig['sitename']);
+            $xoopsMailer->setSubject(_NW_NOTIFYSBJCT);
+            $body = _NW_NOTIFYMSG;
+            $body .= "\n\n"._NW_TITLE.": ".$story->title();
+            $body .= "\n"._POSTEDBY.": ".XoopsUser::getUnameFromId($uid);
+            $body .= "\n"._DATE.": ".formatTimestamp(time(), 'm', $xoopsConfig['default_TZ']);
+            $body .= "\n\n".XOOPS_URL.'/modules/news/admin/index.php?op=edit&storyid='.$result;
+            $xoopsMailer->setBody($body);
+            $xoopsMailer->send();
+        }
+    */
+    } else {
+        echo 'error';
+    }
+    redirect_header("index.php",2,_NW_THANKS);
+    break;
+case 'form':
+default:
+    $xt = new XoopsTopic($xoopsDB->prefix("topics"));
+    include XOOPS_ROOT_PATH.'/header.php';
+    $subject = '';
+    $message = '';
+    $noname = 0;
+    $nohtml = 0;
+    $nosmiley = 0;
+    $notifypub = 1;
+    include 'include/storyform.inc.php';
+    include XOOPS_ROOT_PATH.'/footer.php';
+    break;
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/news/comment_edit.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/comment_edit.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/comment_edit.php	(revision 405)
@@ -0,0 +1,29 @@
+<?php
+// $Id: comment_edit.php,v 1.2 2005/03/18 12:52:25 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+include '../../mainfile.php';
+include XOOPS_ROOT_PATH.'/include/comment_edit.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/news/comment_post.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/comment_post.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/comment_post.php	(revision 405)
@@ -0,0 +1,29 @@
+<?php
+// $Id: comment_post.php,v 1.2 2005/03/18 12:52:25 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+include '../../mainfile.php';
+include XOOPS_ROOT_PATH.'/include/comment_post.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/news/index.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/index.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/index.php	(revision 405)
@@ -0,0 +1,157 @@
+<?php
+// $Id: index.php,v 1.3 2005/09/04 20:46:11 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+// ------------------------------------------------------------------------- //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+include '../../mainfile.php';
+$xoopsOption['template_main'] = 'news_index.html';
+include XOOPS_ROOT_PATH.'/header.php';
+include_once XOOPS_ROOT_PATH.'/modules/news/class/class.newsstory.php';
+
+if (isset($_GET['storytopic'])) {
+	$xoopsOption['storytopic'] = intval($_GET['storytopic']);
+} else {
+	$xoopsOption['storytopic'] = 0;
+}
+if ( isset($_GET['storynum']) ) {
+	$xoopsOption['storynum'] = intval($_GET['storynum']);
+	if ($xoopsOption['storynum'] > 30) {
+		$xoopsOption['storynum'] = $xoopsModuleConfig['storyhome'];
+	}
+} else {
+	$xoopsOption['storynum'] = $xoopsModuleConfig['storyhome'];
+}
+
+if ( isset($_GET['start']) ) {
+	$start = intval($_GET['start']);
+} else {
+	$start = 0;
+}
+if ( $xoopsModuleConfig['displaynav'] == 1 ) {
+	$xoopsTpl->assign('displaynav', true);
+	$xt = new XoopsTopic($xoopsDB->prefix('topics'));
+	ob_start();
+	$xt->makeTopicSelBox(1, $xoopsOption['storytopic'], 'storytopic');
+	$topic_select = ob_get_contents();
+	ob_end_clean();
+	$xoopsTpl->assign('topic_select', $topic_select);
+	$storynum_options = '';
+	for ( $i = 5; $i <= 30; $i = $i + 5 ) {
+		$sel = '';
+		if ($i == $xoopsOption['storynum']) {
+			$sel = ' selected="selected"';
+		}
+		$storynum_options .= '<option value="'.$i.'"'.$sel.'>'.$i.'</option>';
+	}
+	$xoopsTpl->assign('storynum_options', $storynum_options);
+} else {
+	$xoopsTpl->assign('displaynav', false);
+}
+
+$sarray = NewsStory::getAllPublished($xoopsOption['storynum'], $start, $xoopsOption['storytopic']);
+
+$scount = count($sarray);
+for ( $i = 0; $i < $scount; $i++ ) {
+	$story = array();
+	$story['id'] = $sarray[$i]->storyid();
+	$story['poster'] = $sarray[$i]->uname();
+	if ( $story['poster'] != false ) {
+		$story['poster'] = "<a href='".XOOPS_URL."/userinfo.php?uid=".$sarray[$i]->uid()."'>".$story['poster']."</a>";
+	} else {
+		$story['poster'] = $xoopsConfig['anonymous'];
+	}
+	$story['posttime'] = formatTimestamp($sarray[$i]->published());
+	$story['text'] = $sarray[$i]->hometext();
+	$introcount = strlen($story['text']);
+	$fullcount = strlen($sarray[$i]->bodytext());
+	$totalcount = $introcount + $fullcount;
+	$morelink = '';
+	if ( $fullcount > 1 ) {
+		$morelink .= '<a href="'.XOOPS_URL.'/modules/news/article.php?storyid='.$sarray[$i]->storyid().'';
+		$morelink .= '">'._NW_READMORE.'</a> | ';
+		$morelink .= sprintf(_NW_BYTESMORE,$totalcount);
+		$morelink .= ' | ';
+	}
+	$ccount = $sarray[$i]->comments();
+	$morelink .= '<a href="'.XOOPS_URL.'/modules/news/article.php?storyid='.$sarray[$i]->storyid().'';
+    $morelink2 = '<a href="'.XOOPS_URL.'/modules/news/article.php?storyid='.$sarray[$i]->storyid().'';
+	if ( $ccount == 0 ) {
+		$morelink .= '">'._NW_COMMENTS.'</a>';
+	} else {
+		if ( $fullcount < 1 ) {
+			if ( $ccount == 1 ) {
+				$morelink .= '">'._NW_READMORE.'</a> | '.$morelink2.'">'._NW_ONECOMMENT.'</a>';
+			} else {
+				$morelink .= '">'._NW_READMORE.'</a> | '.$morelink2.'">';
+				$morelink .= sprintf(_NW_NUMCOMMENTS, $ccount);
+				$morelink .= '</a>';
+			}
+		} else {
+			if ( $ccount == 1 ) {
+				$morelink .= '">'._NW_ONECOMMENT.'</a>';
+			} else {
+				$morelink .= '">';
+				$morelink .= sprintf(_NW_NUMCOMMENTS, $ccount);
+				$morelink .= '</a>';
+			}
+		}
+	}
+	$story['morelink'] = $morelink;
+	$story['adminlink'] = '';
+	if ( $xoopsUser && $xoopsUser->isAdmin($xoopsModule->mid()) ) {
+		$story['adminlink'] = $sarray[$i]->adminlink();
+	}
+    $story['mail_link'] = 'mailto:?subject='.sprintf(_NW_INTARTICLE,$xoopsConfig['sitename']).'&amp;body='.sprintf(_NW_INTARTFOUND, $xoopsConfig['sitename']).':  '.XOOPS_URL.'/modules/news/article.php?storyid='.$sarray[$i]->storyid();
+	$story['imglink'] = '';
+	$story['align'] = '';
+	if ( $sarray[$i]->topicdisplay() ) {
+		$story['imglink'] = $sarray[$i]->imglink();
+		$story['align'] = $sarray[$i]->topicalign();
+	}
+	$story['title'] = $sarray[$i]->textlink().'&nbsp;:&nbsp;'."<a href='".XOOPS_URL."/modules/news/article.php?storyid=".$sarray[$i]->storyid()."'>".$sarray[$i]->title()."</a>";
+	$story['hits'] = $sarray[$i]->counter();
+	// The line below can be used to display a Permanent Link image
+    // $story['title'] .= "&nbsp;&nbsp;<a href='".XOOPS_URL."/modules/news/article.php?storyid=".$sarray[$i]->storyid()."'><img src='".XOOPS_URL."/modules/news/images/x.gif' alt='Permanent Link' /></a>";
+
+	$xoopsTpl->append('stories', $story);
+	unset($story);
+}
+$totalcount = NewsStory::countPublishedByTopic($xoopsOption['storytopic']);
+if ( $totalcount > $scount ) {
+	include_once XOOPS_ROOT_PATH.'/class/pagenav.php';
+	$pagenav = new XoopsPageNav($totalcount, $xoopsOption['storynum'], $start, 'start', 'storytopic='.$xoopsOption['storytopic']);
+	$xoopsTpl->assign('pagenav', $pagenav->renderNav());
+	//$xoopsTpl->assign('pagenav', $pagenav->renderImageNav());
+
+} else {
+	$xoopsTpl->assign('pagenav', '');
+}
+$xoopsTpl->assign('lang_go', _GO);
+$xoopsTpl->assign('lang_on', _ON);
+$xoopsTpl->assign('lang_printerpage', _NW_PRINTERFRIENDLY);
+$xoopsTpl->assign('lang_sendstory', _NW_SENDSTORY);
+$xoopsTpl->assign('lang_postedby', _POSTEDBY);
+$xoopsTpl->assign('lang_reads', _READS);
+include_once XOOPS_ROOT_PATH.'/footer.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/news/templates/news_index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/templates/news_index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/templates/news_index.html	(revision 405)
@@ -0,0 +1,45 @@
+<{if $displaynav == true}>
+  <div style="text-align: center;">
+    <form name="form1" action="index.php" method="get">
+    <{$topic_select}> <select name="storynum"><{$storynum_options}></select> <input type="submit" value="<{$lang_go}>" /></form>
+  </div>
+<{/if}>
+
+<div style="padding: 15px 0;">
+	<table border="0" cellspacing="0" cellpadding="0">
+		<tr bgcolor="#2b8200">
+			<td><img src="http://test-xoops.ec-cube.net/themes/default/img/main/title_left_top.gif" width="17" height="12" alt="" border="0"></td>
+			<td style="width:100%;"></td>
+			<td align="left"><img src="http://test-xoops.ec-cube.net/themes/default/img/main/title_right_top.gif" width="17" height="12" alt="" border="0"></td>
+		</tr>
+		<tr>
+			<td bgcolor="#2b8200" colspan="3">
+			<table border="0" cellspacing="0" cellpadding="0">
+				<tr>
+					<td style="padding: 0 0 0 17px;"><img src="http://test-xoops.ec-cube.net/themes/default/img/main/title_news.gif" width="129" height="22" alt="¥Ë¥å¡¼¥¹°ìÍ÷" ></td>
+				</tr>
+			</table>
+			</td>
+		</tr>
+		<tr bgcolor="#2b8200">
+			<td><img src="http://test-xoops.ec-cube.net/themes/default/img/main/title_left_bottom.gif" width="17" height="12" alt="" border="0"></td>
+			<td style="width:100%;"></td>
+			<td align="left"><img src="http://test-xoops.ec-cube.net/themes/default/img/main/title_right_bottom.gif" width="17" height="12" alt="" border="0"></td>
+		</tr>
+	</table>
+	
+	<!-- start news item loop -->
+	<{section name=i loop=$stories}>
+	  <{include file="db:news_item.html" story=$stories[i]}>
+	  <br />
+	<{/section}>
+	<!-- end news item loop -->
+
+	<div style="clear: both;"></div> 
+</div>
+
+<!-- °Ê²¼¥¤¥Ù¥ó¥È½èÍý¤ÏÉ½¼¨¤·¤Ê¤¤ -->
+<{*
+<div style="text-align: right; margin: 10px;"><{$pagenav}></div>
+<{include file='db:system_notification_select.html'}>
+*}>
Index: /temp/test-xoops.ec-cube.net/html/modules/news/templates/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/templates/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/templates/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/news/templates/blocks/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/templates/blocks/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/templates/blocks/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/news/templates/blocks/news_block_topics.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/templates/blocks/news_block_topics.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/templates/blocks/news_block_topics.html	(revision 405)
@@ -0,0 +1,1 @@
+<div style="text-align: center;"><form name="newstopicform" action="<{$xoops_url}>/modules/news/index.php" method="get"><{$block.selectbox}></form></div>
Index: /temp/test-xoops.ec-cube.net/html/modules/news/templates/blocks/news_block_bigstory.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/templates/blocks/news_block_bigstory.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/templates/blocks/news_block_bigstory.html	(revision 405)
@@ -0,0 +1,5 @@
+<p><{$block.message}></p>
+
+<{if $block.story_id != ""}>
+  <p><a href="<{$xoops_url}>/modules/news/article.php?storyid=<{$block.story_id}>"><{$block.story_title}></a></p>
+<{/if}>
Index: /temp/test-xoops.ec-cube.net/html/modules/news/templates/blocks/news_block_top.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/templates/blocks/news_block_top.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/templates/blocks/news_block_top.html	(revision 405)
@@ -0,0 +1,5 @@
+<ul>
+  <{foreach item=news from=$block.stories}>
+    <li><a href="<{$xoops_url}>/modules/news/article.php?storyid=<{$news.id}>"><{$news.title}></a> (<{$news.hits}>)</li>
+  <{/foreach}>
+</ul>
Index: /temp/test-xoops.ec-cube.net/html/modules/news/templates/blocks/news_block_new.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/templates/blocks/news_block_new.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/templates/blocks/news_block_new.html	(revision 405)
@@ -0,0 +1,5 @@
+<ul>
+  <{foreach item=news from=$block.stories}>
+    <li><a href="<{$xoops_url}>/modules/news/article.php?storyid=<{$news.id}>"><{$news.title}></a> (<{$news.date}>)</li>
+  <{/foreach}>
+</ul>
Index: /temp/test-xoops.ec-cube.net/html/modules/news/templates/news_item.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/templates/news_item.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/templates/news_item.html	(revision 405)
@@ -0,0 +1,10 @@
+<div class="news">
+	<dl>
+		<dt><img src="<{$xoops_url}>/themes/default/img/top/arrow02.gif" width="2" height="5" alt=""><{$story.posttime}></dt>
+		<dd><{$story.text}></dd>
+	</dl>
+	<div style="clear: both;"></div>
+	<div class="itemFoot">
+	<span class="itemAdminLink"><{$story.adminlink}></span> <span class="itemPermaLink"><{*$story.morelink*}></span>
+	</div>
+</div>
Index: /temp/test-xoops.ec-cube.net/html/modules/news/templates/news_archive.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/templates/news_archive.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/templates/news_archive.html	(revision 405)
@@ -0,0 +1,39 @@
+<table>
+  <tr>
+    <th><{$lang_newsarchives}></th>
+  </tr>
+
+<{foreach item=year from=$years}>
+<{foreach item=month from=$year.months}>
+
+  <tr class="even">
+    <td><a href="./archive.php?year=<{$year.number}>&amp;month=<{$month.number}>"><{$month.string}> <{$year.number}></a></td>
+  </tr>
+
+<{/foreach}>
+<{/foreach}>
+
+</table>
+
+<{if $show_articles == true}>
+
+<table>
+  <tr>
+    <th><{$lang_articles}></th><th align="center"><{$lang_actions}></th><th align="center"><{$lang_views}></th><th align="center"><{$lang_date}></th>
+  </tr>
+
+  <{foreach item=story from=$stories}>
+
+  <tr class="<{cycle values="even,odd"}>">
+    <td><{$story.title}></td><td align="center"><a href="<{$story.print_link}>"><img src="images/print.gif" alt="<{$lang_printer}>" /></a> <a href="<{$story.mail_link}>" target="_top" /><img src="images/friend.gif" alt="<{$lang_sendstory}>" /></td><td align="center"><{$story.counter}></td><td align="center"><{$story.date}></td>
+  </tr>
+
+  <{/foreach}>
+
+</table>
+
+<div>
+<{$lang_storytotal}>
+</div>
+
+<{/if}>
Index: /temp/test-xoops.ec-cube.net/html/modules/news/templates/news_article.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/templates/news_article.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/templates/news_article.html	(revision 405)
@@ -0,0 +1,37 @@
+<div style="text-align: left; margin: 10px;"><{if
+$pagenav}>Page <{$pagenav}><{/if}></div>
+
+<div style="padding: 3px; margin-right:3px;">
+<{include file="db:news_item.html" story=$story}>
+</div>
+
+<div style="text-align: left; margin: 10px;"><{if
+$pagenav}>Page <{$pagenav}><{/if}></div>
+
+<div style="padding: 5px; text-align: right;
+margin-right:3px;">
+<a href="print.php?storyid=<{$story.id}>"><img
+src="images/print.gif" border="0"
+alt="<{$lang_printerpage}>" /></a> <a target="_top"
+href="<{$mail_link}>"><img src="images/friend.gif"
+border="0" alt="<{$lang_sendstory}>" /></a>
+</div>
+
+<div style="text-align: center; padding: 3px;
+margin:3px;">
+<{$commentsnav}>
+<{$lang_notice}>
+</div>
+
+<div style="margin:3px; padding: 3px;">
+<!-- start comments loop -->
+<{if $comment_mode == "flat"}>
+<{include file="db:system_comments_flat.html"}>
+<{elseif $comment_mode == "thread"}>
+<{include file="db:system_comments_thread.html"}>
+<{elseif $comment_mode == "nest"}>
+<{include file="db:system_comments_nest.html"}>
+<{/if}>
+<!-- end comments loop -->
+</div>
+<{include file='db:system_notification_select.html'}>
Index: /temp/test-xoops.ec-cube.net/html/modules/news/sql/mysql.sql
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/sql/mysql.sql	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/sql/mysql.sql	(revision 405)
@@ -0,0 +1,49 @@
+#
+# Table structure for table `stories`
+#
+
+CREATE TABLE stories (
+  storyid int(8) unsigned NOT NULL auto_increment,
+  uid int(5) unsigned NOT NULL default '0',
+  title varchar(255) NOT NULL default '',
+  created int(10) unsigned NOT NULL default '0',
+  published int(10) unsigned NOT NULL default '0',
+  expired int(10) UNSIGNED NOT NULL default '0',
+  hostname varchar(20) NOT NULL default '',
+  nohtml tinyint(1) NOT NULL default '0',
+  nosmiley tinyint(1) NOT NULL default '0',
+  hometext text NOT NULL,
+  bodytext text NOT NULL,
+  counter int(8) unsigned NOT NULL default '0',
+  topicid smallint(4) unsigned NOT NULL default '1',
+  ihome tinyint(1) NOT NULL default '0',
+  notifypub tinyint(1) NOT NULL default '0',
+  story_type varchar(5) NOT NULL default '',
+  topicdisplay tinyint(1) NOT NULL default '0',
+  topicalign char(1) NOT NULL default 'R',
+  comments smallint(5) unsigned NOT NULL default '0',
+  PRIMARY KEY  (storyid),
+  KEY idxstoriestopic (topicid),
+  KEY ihome (ihome),
+  KEY uid (uid),
+  KEY published_ihome (published,ihome),
+  KEY title (title(40)),
+  KEY created (created),
+  FULLTEXT KEY search (title,hometext,bodytext)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `topics`
+#
+
+CREATE TABLE topics (
+  topic_id smallint(4) unsigned NOT NULL auto_increment,
+  topic_pid smallint(4) unsigned NOT NULL default '0',
+  topic_imgurl varchar(20) NOT NULL default '',
+  topic_title varchar(50) NOT NULL default '',
+  PRIMARY KEY  (topic_id),
+  KEY pid (topic_pid)
+) TYPE=MyISAM;
+
+INSERT INTO topics VALUES (1,0,'xoops.gif','XOOPS');
Index: /temp/test-xoops.ec-cube.net/html/modules/news/sql/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/sql/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/sql/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/news/comment_new.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/comment_new.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/comment_new.php	(revision 405)
@@ -0,0 +1,40 @@
+<?php
+// $Id: comment_new.php,v 1.3 2005/09/04 20:46:11 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+include '../../mainfile.php';
+include_once XOOPS_ROOT_PATH.'/modules/news/class/class.newsstory.php';
+$com_itemid = isset($_GET['com_itemid']) ? intval($_GET['com_itemid']) : 0;
+if ($com_itemid > 0) {
+	$article = new NewsStory($com_itemid);
+	$com_replytext = _POSTEDBY.'&nbsp;<b>'.$article->uname().'</b>&nbsp;'._DATE.'&nbsp;<b>'.formatTimestamp($article->published()).'</b><br /><br />'.$article->hometext();
+	$bodytext = $article->bodytext();
+	if ($bodytext != '') {
+		$com_replytext .= '<br /><br />'.$bodytext.'';
+	}
+	$com_replytitle = $article->title();
+	include XOOPS_ROOT_PATH.'/include/comment_new.php';
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/news/xoops_version.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/xoops_version.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/xoops_version.php	(revision 405)
@@ -0,0 +1,221 @@
+<?php
+// $Id: xoops_version.php,v 1.2 2005/03/18 12:52:25 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+$modversion['name'] = _MI_NEWS_NAME;
+$modversion['version'] = 1.1;
+$modversion['description'] = _MI_NEWS_DESC;
+$modversion['credits'] = "The XOOPS Project";
+$modversion['help'] = "news.html";
+$modversion['license'] = "GPL see LICENSE";
+$modversion['official'] = 1;
+$modversion['image'] = "images/news_slogo.png";
+$modversion['dirname'] = "news";
+
+// Sql file (must contain sql generated by phpMyAdmin or phpPgAdmin)
+// All tables should not have any prefix!
+$modversion['sqlfile']['mysql'] = "sql/mysql.sql";
+//$modversion['sqlfile']['postgresql'] = "sql/pgsql.sql";
+
+// Tables created by sql file (without prefix!)
+$modversion['tables'][0] = "stories";
+$modversion['tables'][1] = "topics";
+
+// Admin things
+$modversion['hasAdmin'] = 1;
+$modversion['adminindex'] = "admin/index.php";
+$modversion['adminmenu'] = "admin/menu.php";
+
+// Templates
+$modversion['templates'][1]['file'] = 'news_archive.html';
+$modversion['templates'][1]['description'] = '';
+$modversion['templates'][2]['file'] = 'news_article.html';
+$modversion['templates'][2]['description'] = '';
+$modversion['templates'][3]['file'] = 'news_index.html';
+$modversion['templates'][3]['description'] = '';
+$modversion['templates'][4]['file'] = 'news_item.html';
+$modversion['templates'][4]['description'] = '';
+
+
+// Blocks
+$modversion['blocks'][1]['file'] = "news_topics.php";
+$modversion['blocks'][1]['name'] = _MI_NEWS_BNAME1;
+$modversion['blocks'][1]['description'] = "Shows news topics";
+$modversion['blocks'][1]['show_func'] = "b_news_topics_show";
+$modversion['blocks'][1]['template'] = 'news_block_topics.html';
+
+$modversion['blocks'][2]['file'] = "news_bigstory.php";
+$modversion['blocks'][2]['name'] = _MI_NEWS_BNAME3;
+$modversion['blocks'][2]['description'] = "Shows most read story of the day";
+$modversion['blocks'][2]['show_func'] = "b_news_bigstory_show";
+$modversion['blocks'][2]['template'] = 'news_block_bigstory.html';
+
+$modversion['blocks'][3]['file'] = "news_top.php";
+$modversion['blocks'][3]['name'] = _MI_NEWS_BNAME4;
+$modversion['blocks'][3]['description'] = "Shows top read news articles";
+$modversion['blocks'][3]['show_func'] = "b_news_top_show";
+$modversion['blocks'][3]['edit_func'] = "b_news_top_edit";
+$modversion['blocks'][3]['options'] = "counter|10|25";
+$modversion['blocks'][3]['template'] = 'news_block_top.html';
+
+$modversion['blocks'][4]['file'] = "news_top.php";
+$modversion['blocks'][4]['name'] = _MI_NEWS_BNAME5;
+$modversion['blocks'][4]['description'] = "Shows recent articles";
+$modversion['blocks'][4]['show_func'] = "b_news_top_show";
+$modversion['blocks'][4]['edit_func'] = "b_news_top_edit";
+$modversion['blocks'][4]['options'] = "published|10|25";
+$modversion['blocks'][4]['template'] = 'news_block_new.html';
+
+// Menu
+$modversion['hasMain'] = 1;
+$modversion['sub'][1]['name'] = _MI_NEWS_SMNAME1;
+$modversion['sub'][1]['url'] = "submit.php";
+$modversion['sub'][2]['name'] = _MI_NEWS_SMNAME2;
+$modversion['sub'][2]['url'] = "archive.php";
+
+// Search
+$modversion['hasSearch'] = 1;
+$modversion['search']['file'] = "include/search.inc.php";
+$modversion['search']['func'] = "news_search";
+
+// Comments
+$modversion['hasComments'] = 1;
+$modversion['comments']['pageName'] = 'article.php';
+$modversion['comments']['itemName'] = 'storyid';
+// Comment callback functions
+$modversion['comments']['callbackFile'] = 'include/comment_functions.php';
+$modversion['comments']['callback']['approve'] = 'news_com_approve';
+$modversion['comments']['callback']['update'] = 'news_com_update';
+
+// Config Settings (only for modules that need config settings generated automatically)
+
+// name of config option for accessing its specified value. i.e. $xoopsModuleConfig['storyhome']
+$modversion['config'][1]['name'] = 'storyhome';
+
+// title of this config option displayed in config settings form
+$modversion['config'][1]['title'] = '_MI_STORYHOME';
+
+// description of this config option displayed under title
+$modversion['config'][1]['description'] = '_MI_STORYHOMEDSC';
+
+// form element type used in config form for this option. can be one of either textbox, textarea, select, select_multi, yesno, group, group_multi
+$modversion['config'][1]['formtype'] = 'select';
+
+// value type of this config option. can be one of either int, text, float, array, or other
+// form type of group_multi, select_multi must always be value type of array
+$modversion['config'][1]['valuetype'] = 'int';
+
+// the default value for this option
+// ignore it if no default
+// 'yesno' formtype must be either 0(no) or 1(yes)
+$modversion['config'][1]['default'] = 5;
+
+// options to be displayed in selection box
+// required and valid for 'select' or 'select_multi' formtype option only
+// language constants can be used for array key, otherwise use integer
+$modversion['config'][1]['options'] = array('5' => 5, '10' => 10, '15' => 15, '20' => 20, '25' => 25, '30' => 30);
+
+/*
+$modversion['config'][2]['name'] = 'notifysubmit';
+$modversion['config'][2]['title'] = '_MI_NOTIFYSUBMIT';
+$modversion['config'][2]['description'] = '_MI_NOTIFYSUBMITDSC';
+$modversion['config'][2]['formtype'] = 'yesno';
+$modversion['config'][2]['valuetype'] = 'int';
+$modversion['config'][2]['default'] = 1;
+*/
+
+$modversion['config'][3]['name'] = 'displaynav';
+$modversion['config'][3]['title'] = '_MI_DISPLAYNAV';
+$modversion['config'][3]['description'] = '_MI_DISPLAYNAVDSC';
+$modversion['config'][3]['formtype'] = 'yesno';
+$modversion['config'][3]['valuetype'] = 'int';
+$modversion['config'][3]['default'] = 1;
+
+$modversion['config'][4]['name'] = 'anonpost';
+$modversion['config'][4]['title'] = '_MI_ANONPOST';
+$modversion['config'][4]['description'] = '';
+$modversion['config'][4]['formtype'] = 'yesno';
+$modversion['config'][4]['valuetype'] = 'int';
+$modversion['config'][4]['default'] = 0;
+
+$modversion['config'][5]['name'] = 'autoapprove';
+$modversion['config'][5]['title'] = '_MI_AUTOAPPROVE';
+$modversion['config'][5]['description'] = '_MI_AUTOAPPROVEDSC';
+$modversion['config'][5]['formtype'] = 'yesno';
+$modversion['config'][5]['valuetype'] = 'int';
+$modversion['config'][5]['default'] = 0;
+
+// Notification
+
+$modversion['hasNotification'] = 1;
+$modversion['notification']['lookup_file'] = 'include/notification.inc.php';
+$modversion['notification']['lookup_func'] = 'news_notify_iteminfo';
+
+$modversion['notification']['category'][1]['name'] = 'global';
+$modversion['notification']['category'][1]['title'] = _MI_NEWS_GLOBAL_NOTIFY;
+$modversion['notification']['category'][1]['description'] = _MI_NEWS_GLOBAL_NOTIFYDSC;
+$modversion['notification']['category'][1]['subscribe_from'] = array('index.php', 'article.php');
+
+$modversion['notification']['category'][2]['name'] = 'story';
+$modversion['notification']['category'][2]['title'] = _MI_NEWS_STORY_NOTIFY;
+$modversion['notification']['category'][2]['description'] = _MI_NEWS_STORY_NOTIFYDSC;
+$modversion['notification']['category'][2]['subscribe_from'] = array('article.php');
+$modversion['notification']['category'][2]['item_name'] = 'storyid';
+$modversion['notification']['category'][2]['allow_bookmark'] = 1;
+
+$modversion['notification']['event'][1]['name'] = 'new_category';
+$modversion['notification']['event'][1]['category'] = 'global';
+$modversion['notification']['event'][1]['title'] = _MI_NEWS_GLOBAL_NEWCATEGORY_NOTIFY;
+$modversion['notification']['event'][1]['caption'] = _MI_NEWS_GLOBAL_NEWCATEGORY_NOTIFYCAP;
+$modversion['notification']['event'][1]['description'] = _MI_NEWS_GLOBAL_NEWCATEGORY_NOTIFYDSC;
+$modversion['notification']['event'][1]['mail_template'] = 'global_newcategory_notify';
+$modversion['notification']['event'][1]['mail_subject'] = _MI_NEWS_GLOBAL_NEWCATEGORY_NOTIFYSBJ;
+
+$modversion['notification']['event'][2]['name'] = 'story_submit';
+$modversion['notification']['event'][2]['category'] = 'global';
+$modversion['notification']['event'][2]['admin_only'] = 1;
+$modversion['notification']['event'][2]['title'] = _MI_NEWS_GLOBAL_STORYSUBMIT_NOTIFY;
+$modversion['notification']['event'][2]['caption'] = _MI_NEWS_GLOBAL_STORYSUBMIT_NOTIFYCAP;
+$modversion['notification']['event'][2]['description'] = _MI_NEWS_GLOBAL_STORYSUBMIT_NOTIFYDSC;
+$modversion['notification']['event'][2]['mail_template'] = 'global_storysubmit_notify';
+$modversion['notification']['event'][2]['mail_subject'] = _MI_NEWS_GLOBAL_STORYSUBMIT_NOTIFYSBJ;
+
+$modversion['notification']['event'][3]['name'] = 'new_story';
+$modversion['notification']['event'][3]['category'] = 'global';
+$modversion['notification']['event'][3]['title'] = _MI_NEWS_GLOBAL_NEWSTORY_NOTIFY;
+$modversion['notification']['event'][3]['caption'] = _MI_NEWS_GLOBAL_NEWSTORY_NOTIFYCAP;
+$modversion['notification']['event'][3]['description'] = _MI_NEWS_GLOBAL_NEWSTORY_NOTIFYDSC;
+$modversion['notification']['event'][3]['mail_template'] = 'global_newstory_notify';
+$modversion['notification']['event'][3]['mail_subject'] = _MI_NEWS_GLOBAL_NEWSTORY_NOTIFYSBJ;
+
+$modversion['notification']['event'][4]['name'] = 'approve';
+$modversion['notification']['event'][4]['category'] = 'story';
+$modversion['notification']['event'][4]['invisible'] = 1;
+$modversion['notification']['event'][4]['title'] = _MI_NEWS_STORY_APPROVE_NOTIFY;
+$modversion['notification']['event'][4]['caption'] = _MI_NEWS_STORY_APPROVE_NOTIFYCAP;
+$modversion['notification']['event'][4]['description'] = _MI_NEWS_STORY_APPROVE_NOTIFYDSC;
+$modversion['notification']['event'][4]['mail_template'] = 'story_approve_notify';
+$modversion['notification']['event'][4]['mail_subject'] = _MI_NEWS_STORY_APPROVE_NOTIFYSBJ;
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/news/comment_reply.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/comment_reply.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/comment_reply.php	(revision 405)
@@ -0,0 +1,29 @@
+<?php
+// $Id: comment_reply.php,v 1.2 2005/03/18 12:52:25 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+include '../../mainfile.php';
+include XOOPS_ROOT_PATH.'/include/comment_reply.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/news/class/class.newsstory.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/class/class.newsstory.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/class/class.newsstory.php	(revision 405)
@@ -0,0 +1,204 @@
+<?php
+// $Id: class.newsstory.php,v 1.2 2005/03/18 12:52:38 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+// ------------------------------------------------------------------------- //
+
+include_once XOOPS_ROOT_PATH."/class/xoopsstory.php";
+
+class NewsStory extends XoopsStory
+{
+	var $newstopic;   // XoopsTopic object
+
+	function NewsStory($storyid=-1)
+	{
+		$this->db =& Database::getInstance();
+		$this->table = $this->db->prefix("stories");
+		$this->topicstable = $this->db->prefix("topics");
+		if (is_array($storyid)) {
+			$this->makeStory($storyid);
+			$this->newstopic = $this->topic();
+		} elseif($storyid != -1) {
+			$this->getStory(intval($storyid));
+			$this->newstopic = $this->topic();
+		}
+	}
+
+	function getAllPublished($limit=0, $start=0, $topic=0, $ihome=0, $asobject=true)
+	{
+		$db =& Database::getInstance();
+		$myts =& MyTextSanitizer::getInstance();
+		$ret = array();
+		$sql = "SELECT * FROM ".$db->prefix("stories")." WHERE published > 0 AND published <= ".time()." AND (expired = 0 OR expired > ".time().")";
+		if ( !empty($topic) ) {
+			$sql .= " AND topicid=".intval($topic)." AND (ihome=1 OR ihome=0)";
+		} else {
+			if ( $ihome == 0 ) {
+				$sql .= " AND ihome=0";
+			}
+		}
+		if (!empty($uid) && intval($uid) > 0) {
+			$sql .= ' AND uid='.$uid;
+		}
+ 		$sql .= " ORDER BY published DESC";
+		$result = $db->query($sql,intval($limit),intval($start));
+		while ( $myrow = $db->fetchArray($result) ) {
+			if ( $asobject ) {
+				$ret[] = new NewsStory($myrow);
+			} else {
+				$ret[$myrow['storyid']] = $myts->makeTboxData4Show($myrow['title']);
+			}
+		}
+		return $ret;
+	}
+
+	// added new function to get all expired stories
+	function getAllExpired($limit=0, $start=0, $topic=0, $ihome=0, $asobject=true)
+	{
+		$db =& Database::getInstance();
+		$myts =& MyTextSanitizer::getInstance();
+		$ret = array();
+		$sql = "SELECT * FROM ".$db->prefix("stories")." WHERE expired <= ".time()." AND expired > 0";
+		if ( !empty($topic) ) {
+			$sql .= " AND topicid=".intval($topic)." AND (ihome=1 OR ihome=0)";
+		} else {
+			if ( $ihome == 0 ) {
+				$sql .= " AND ihome=0";
+			}
+		}
+		if (!empty($uid) && intval($uid) > 0) {
+			$sql .= ' AND uid='.$uid;
+		}
+ 		$sql .= " ORDER BY expired DESC";
+		$result = $db->query($sql,intval($limit),intval($start));
+		while ( $myrow = $db->fetchArray($result) ) {
+			if ( $asobject ) {
+				$ret[] = new NewsStory($myrow);
+			} else {
+				$ret[$myrow['storyid']] = $myts->makeTboxData4Show($myrow['title']);
+			}
+		}
+		return $ret;
+	}
+
+	function getAllAutoStory($limit=0, $asobject=true)
+	{
+		$db =& Database::getInstance();
+		$myts =& MyTextSanitizer::getInstance();
+		$ret = array();
+		$sql = "SELECT * FROM ".$db->prefix("stories")." WHERE published > ".time()." ORDER BY published ASC";
+		$result = $db->query($sql,$limit,0);
+		while ( $myrow = $db->fetchArray($result) ) {
+			if ( $asobject ) {
+				$ret[] = new NewsStory($myrow);
+			} else {
+				$ret[$myrow['storyid']] = $myts->makeTboxData4Show($myrow['title']);
+			}
+		}
+		return $ret;
+	}
+
+	function getAllSubmitted($limit=0, $asobject=true)
+	{
+		$db =& Database::getInstance();
+		$myts =& MyTextSanitizer::getInstance();
+		$ret = array();
+		$sql = "SELECT * FROM ".$db->prefix("stories")." WHERE published=0 ORDER BY created DESC";
+		$result = $db->query($sql,$limit,0);
+		while ( $myrow = $db->fetchArray($result) ) {
+			if ( $asobject ) {
+				$ret[] = new NewsStory($myrow);
+			} else {
+				$ret[$myrow['storyid']] = $myts->makeTboxData4Show($myrow['title']);
+			}
+		}
+		return $ret;
+	}
+
+	function getByTopic($topicid)
+	{
+		$ret = array();
+		$db =& Database::getInstance();
+		$result = $db->query("SELECT * FROM ".$db->prefix("stories")." WHERE topicid=".intval($topicid)."");
+		while( $myrow = $db->fetchArray($result) ){
+			$ret[] = new NewsStory($myrow);
+		}
+		return $ret;
+	}
+
+	function countByTopic($topicid=0)
+	{
+		$db =& Database::getInstance();
+		$sql = "SELECT COUNT(*) FROM ".$db->prefix("stories")."
+		WHERE expired >= ".time()."";
+		if ( $topicid != 0 ) {
+			$sql .= " AND  topicid=".intval($topicid);
+		}
+		$result = $db->query($sql);
+		list($count) = $db->fetchRow($result);
+		return $count;
+	}
+
+	function countPublishedByTopic($topicid=0)
+	{
+		$db =& Database::getInstance();
+		$sql = "SELECT COUNT(*) FROM ".$db->prefix("stories")." WHERE published > 0 AND published <= ".time()." AND (expired = 0 OR expired > ".time().")";
+		if ( !empty($topicid) ) {
+			$sql .= " AND topicid=".intval($topicid);
+		} else {
+			$sql .= " AND ihome=0";
+		}
+		$result = $db->query($sql);
+		list($count) = $db->fetchRow($result);
+		return $count;
+	}
+
+
+	function topic_title()
+	{
+		return $this->newstopic->topic_title();
+	}
+
+	function adminlink()
+	{
+		$ret = "&nbsp;[ <a href='".XOOPS_URL."/modules/news/admin/index.php?op=edit&amp;storyid=".$this->storyid."'>"._EDIT."</a> | <a href='".XOOPS_URL."/modules/news/admin/index.php?op=delete&amp;storyid=".$this->storyid."'>"._DELETE."</a> ]&nbsp;";
+		return $ret;
+	}
+
+	function imglink()
+	{
+		$ret = '';
+		if ($this->newstopic->topic_imgurl() != '' && file_exists(XOOPS_ROOT_PATH."/modules/news/images/topics/".$this->newstopic->topic_imgurl())) {
+			$ret = "<a href='".XOOPS_URL."/modules/news/index.php?storytopic=".$this->topicid."'><img src='".XOOPS_URL."/modules/news/images/topics/".$this->newstopic->topic_imgurl()."' alt='".$this->newstopic->topic_title()."' hspace='10' vspace='10' align='".$this->topicalign()."' /></a>";
+		}
+		return $ret;
+	}
+
+	function textlink()
+	{
+		$ret = "<a href='".XOOPS_URL."/modules/news/index.php?storytopic=".$this->topicid()."'>".$this->newstopic->topic_title()."</a>";
+		return $ret;
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/news/class/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/class/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/class/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/news/images/topics/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/images/topics/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/images/topics/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/news/images/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/news/images/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/news/images/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/admin/menu.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/admin/menu.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/admin/menu.php	(revision 405)
@@ -0,0 +1,48 @@
+<?php
+// $Id: menu.php,v 1.2 2005/03/18 12:52:25 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+$adminmenu[0]['title'] = _MI_NEWBB_ADMENU1;
+$adminmenu[0]['link'] = "admin/admin_forums.php?mode=addforum";
+$adminmenu[1]['title'] = _MI_NEWBB_ADMENU2;
+$adminmenu[1]['link'] = "admin/admin_forums.php?mode=editforum";
+$adminmenu[2]['title'] = _MI_NEWBB_ADMENU3;
+$adminmenu[2]['link'] = "admin/admin_priv_forums.php?mode=editforum";
+$adminmenu[3]['title'] = _MI_NEWBB_ADMENU4;
+$adminmenu[3]['link'] = "admin/admin_forums.php?mode=sync";
+$adminmenu[4]['title'] = _MI_NEWBB_ADMENU5;
+$adminmenu[4]['link'] = "admin/admin_forums.php?mode=addcat";
+$adminmenu[5]['title'] = _MI_NEWBB_ADMENU6;
+$adminmenu[5]['link'] = "admin/admin_forums.php?mode=editcat";
+$adminmenu[6]['title'] = _MI_NEWBB_ADMENU7;
+$adminmenu[6]['link'] = "admin/admin_forums.php?mode=remcat";
+$adminmenu[7]['title'] = _MI_NEWBB_ADMENU8;
+$adminmenu[7]['link'] = "admin/admin_forums.php?mode=catorder";
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/admin/index.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/admin/index.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/admin/index.php	(revision 405)
@@ -0,0 +1,88 @@
+<?php
+// $Id: index.php,v 1.4 2005/08/03 12:39:13 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+include '../../../include/cp_header.php';
+include '../functions.php';
+include '../config.php';
+xoops_cp_header();
+echo"<table width='100%' border='0' cellspacing='1' class='outer'>"
+."<tr><td class=\"odd\">";
+echo "<a href='./index.php'><h4>"._MD_A_FORUMCONF."</h4></a>";
+if(isset($mode)) {
+
+}
+else {
+?>
+<table border="0" cellpadding="4" cellspacing="1" width="100%">
+
+<tr class='bg1' align="left">
+	<td><span class='fg2'><a href="<?php echo XOOPS_URL; ?>/modules/system/admin.php?fct=preferences&amp;op=showmod&amp;mod=<?php echo $xoopsModule->mid(); ?>"><?php echo _PREFERENCES; ?></a></span></td>
+	<td><span class='fg2'>&nbsp;</span></td>
+</tr>
+<tr class='bg1' align="left">
+	<td><span class='fg2'><a href="<?php echo $bbUrl['admin'];?>/admin_forums.php?mode=addforum"><?php echo _MD_A_ADDAFORUM;?></a></span></td>
+	<td><span class='fg2'><?php echo _MD_A_LINK2ADDFORUM;?></span></td>
+</tr>
+<tr class='bg1' align="left">
+	<td><span class='fg2'><a href='<?php echo $bbUrl['admin'];?>/admin_forums.php?mode=editforum'><?php echo _MD_A_EDITAFORUM;?></a></span></td>
+	<td><span class='fg2'><?php echo _MD_A_LINK2EDITFORUM;?></span></td>
+</tr>
+<tr class='bg1' align='left'>
+	<td><span class='fg2'><a href="<?php echo $bbUrl['admin']?>/admin_priv_forums.php?mode=editforum"><?php echo _MD_A_SETPRIVFORUM;?></a></span></td>
+	<td><span class='fg2'><?php echo _MD_A_LINK2SETPRIV;?></span></td>
+</tr>
+<tr class='bg1' align='left'>
+	<td><span class='fg2'><a href="<?php echo $bbUrl['admin'];?>/admin_forums.php?mode=sync"><?php echo _MD_A_SYNCFORUM;?></a></span></td>
+	<td><span class='fg2'><?php echo _MD_A_LINK2SYNC;?></span></td>
+</tr>
+<tr class='bg1' align='left'>
+	<td><span class='fg2'><a href="<?php echo $bbUrl['admin'];?>/admin_forums.php?mode=addcat"><?php echo _MD_A_ADDACAT;?></a></span></td>
+	<td><span class='fg2'><?php echo _MD_A_LINK2ADDCAT;?></span></td>
+</tr>
+<tr class='bg1' align='left'>
+	<td><span class='fg2'><a href="<?php echo $bbUrl['admin'];?>/admin_forums.php?mode=editcat"><?php echo _MD_A_EDITCATTTL;?></a></span></td>
+	<td><span class='fg2'><?php echo _MD_A_LINK2EDITCAT;?></span></td>
+</tr>
+<tr class='bg1' align='left'>
+     <td><span class='fg2'><a href="<?php echo $bbUrl['admin'];?>/admin_forums.php?mode=remcat"><?php echo _MD_A_RMVACAT;?></a></span></td>
+     <td><span class='fg2'><?php echo _MD_A_LINK2RMVCAT;?></span></td>
+</tr>
+<tr class='bg1' align='left'>
+     <td><span class='fg2'><a href="<?php echo $bbUrl['admin'];?>/admin_forums.php?mode=catorder"><?php echo _MD_A_REORDERCAT;?></a></span></td>
+     <td><span class='fg2'><?php echo _MD_A_LINK2ORDERCAT;?></span></td>
+</tr>
+
+</table>
+<?php
+}
+
+echo"</td></tr></table>";
+xoops_cp_footer();
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/admin/admin_forums.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/admin/admin_forums.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/admin/admin_forums.php	(revision 405)
@@ -0,0 +1,821 @@
+<?php
+/***************************************************************************
+                          admin_forums.php  -  description
+                             -------------------
+    begin                : Wed July 19 2000
+    copyright            : (C) 2001 The phpBB Group
+    email                : support@phpbb.com
+
+    $Id: admin_forums.php,v 1.5 2005/09/04 20:46:10 onokazu 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.
+ *
+ ***************************************************************************/
+
+include '../../../include/cp_header.php';
+include '../functions.php';
+include '../config.php';
+
+if (!empty($_GET['mode'])){
+    $mode = $_GET['mode'];
+} elseif (!empty($_POST['mode'])) {
+    $mode = $_POST['mode'];
+}
+
+switch (trim($mode)) {
+case 'editforum':
+    $myts =& MyTextSanitizer::getInstance();
+    if ( isset($_POST['save']) && $_POST['save'] != "" ) {
+        if ( empty($_POST['delete']) ) {
+            foreach (array('name', 'desc') as $k) {
+                $$k = !empty($_POST[$k]) ? trim($myts->stripSlashesGPC($_POST[$k])) : '';
+            }
+            foreach (array('type', 'cat', 'forum_access', 'html', 'sig', 'ppp', 'hot', 'tpp', 'forum') as $k) {
+                $$k = !empty($_POST[$k]) ? intval($_POST[$k]) : 0;
+            }
+            $sql = sprintf("UPDATE %s SET forum_name = %s, forum_desc = %s, forum_type = %s, cat_id = %u, forum_access = %u, allow_html = %s, allow_sig = %s, posts_per_page = %u, hot_threshold = %u, topics_per_page = %u WHERE forum_id = %u", $xoopsDB->prefix("bb_forums"), $xoopsDB->quoteString($name), $xoopsDB->quoteString($desc), $xoopsDB->quoteString($type), $cat, $forum_access, $xoopsDB->quoteString($html), $xoopsDB->quoteString($sig), $ppp, $hot, $tpp, $forum);
+
+            if ( !$r = $xoopsDB->query($sql) ) {
+                redirect_header("./index.php", 1);
+                exit();
+            }
+            $count = 0;
+            if ( isset($_POST["mods"]) ) {
+                while ( list($null, $mod) = each($_POST["mods"]) ) {
+                    $mod_data = new XoopsUser($mod);
+                    if ( $mod_data->isActive() ) {
+                        $sql = sprintf("INSERT INTO %s (forum_id, user_id) VALUES (%u, %u)", $xoopsDB->prefix("bb_forum_mods"), $forum, $mod);
+                        if ( !$xoopsDB->query($sql) ) {
+                            redirect_header("./index.php", 1);
+                            exit();
+                        }
+                    }
+                }
+            }
+            if (empty($_POST["mods"])) {
+                $current_mods = "SELECT count(*) AS total FROM ".$xoopsDB->prefix("bb_forum_mods")." WHERE forum_id = $forum";
+                $r = $xoopsDB->query($current_mods);
+                list($total) = $xoopsDB->fetchRow($r);
+            } else {
+                $total = count($_POST["mods"]) + 1;
+            }
+
+            if ( !empty($_POST["rem_mods"]) && $total > 1 ) {
+                while ( list($null, $mod) = each($_POST["rem_mods"]) ) {
+                    $sql = sprintf("DELETE FROM %s WHERE forum_id = %u AND user_id = %u", $xoopsDB->prefix("bb_forum_mods"), $forum, $mod);
+                    if ( !$xoopsDB->query($sql) ) {
+                        redirect_header("./index.php", 1);
+                        exit();
+                    }
+                }
+            } else {
+                if (!empty($_POST["rem_mods"])) {
+                    $mod_not_removed = 1;
+                }
+            }
+            if (!empty($mod_not_removed)) {
+                redirect_header("./index.php", 1, _MD_A_FORUMUPDATED."<br />"._MD_A_HTSMHNBRBITHBTWNLBAMOTF);
+            }else{
+                redirect_header("./index.php", 1, _MD_A_FORUMUPDATED);
+            }
+        } else {
+            $forum = !empty($_POST['forum']) ? intval($_POST['forum']) : 0;
+            $sql = "SELECT post_id FROM ".$xoopsDB->prefix("bb_posts")." WHERE forum_id = $forum";
+            if ( !$r = $xoopsDB->query($sql) ) {
+                redirect_header("./index.php", 1);
+                exit();
+            }
+            if ( $xoopsDB->getRowsNum($r) > 0 ) {
+                $sql = "DELETE FROM ".$xoopsDB->prefix("bb_posts_text")." WHERE ";
+                $looped = false;
+                while ( $ids = $xoopsDB->fetchArray($r) ) {
+                    if ( $looped == true ) {
+                        $sql .= " OR ";
+                    }
+                    $sql .= "post_id = ".$ids["post_id"]." ";
+                    $looped = true;
+                }
+                if ( !$r = $xoopsDB->query($sql) ) {
+                    redirect_header("./index.php", 1);
+                    exit();
+                }
+                $sql = sprintf("DELETE FROM %s WHERE forum_id = %u", $xoopsDB->prefix("bb_posts"), $forum);
+                if ( !$r = $xoopsDB->query($sql) ) {
+                    redirect_header("./index.php", 1);
+                    exit();
+                }
+            }
+            // RMV-NOTIFY
+            xoops_notification_deletebyitem ($xoopsModule->getVar('mid'), 'forum', $forum);
+            // Get list of all topics in forum, to delete them too
+            $sql = sprintf("SELECT topic_id FROM %s WHERE forum_id = %u", $xoopsDB->prefix("bb_topics"), $forum);
+            if ($r = $xoopsDB->query($sql)) {
+                while ($row = $xoopsDB->fetchArray($r)) {
+                    xoops_notification_deletebyitem ($xoopsModule->getVar('mid'), 'thread', $row['topic_id']);
+                }
+            }
+
+            $sql = sprintf("DELETE FROM %s WHERE forum_id = %u", $xoopsDB->prefix("bb_topics"), $forum);
+            if ( !$r = $xoopsDB->query($sql) ) {
+                redirect_header("./index.php", 1);
+                exit();
+            }
+            $sql = sprintf("DELETE FROM %s WHERE forum_id = %u", $xoopsDB->prefix("bb_forums"), $forum);
+            if ( !$r = $xoopsDB->query($sql) ) {
+                redirect_header("./index.php", 1);
+                exit();
+            }
+
+            $sql = sprintf("DELETE FROM %s WHERE forum_id = %u", $xoopsDB->prefix("bb_forum_mods"), $forum);
+            if ( !$r = $xoopsDB->query($sql) ) {
+                redirect_header("./index.php", 1);
+                exit();
+            }
+            redirect_header("./index.php", 1, _MD_A_FORUMREMOVED);
+        }
+    }
+    if ( isset($_POST['submit']) && !isset($_POST['save']) ) {
+        $forum = !empty($_POST['forum']) ? intval($_POST['forum']) : 0;
+        $sql = "SELECT * FROM ".$xoopsDB->prefix("bb_forums")." WHERE forum_id = $forum";
+        if ( !$result = $xoopsDB->query($sql) ) {
+            redirect_header("./index.php", 1);
+            exit();
+        }
+        if ( !$myrow = $xoopsDB->fetchArray($result) ) {
+             redirect_header("./index.php", 1, _MD_A_NOSUCHFORUM);
+        }
+        $name = $myts->makeTboxData4Edit($myrow['forum_name']);
+        $desc = $myts->makeTareaData4Edit($myrow['forum_desc']);
+        xoops_cp_header();
+        echo"<table width='100%' border='0' cellspacing='1' class='outer'>"
+        ."<tr><td class=\"odd\">";
+        echo "<a href='./index.php'><h4>"._MD_A_FORUMCONF."</h4></a>";
+        ?>
+        <form action="<?php echo xoops_getenv('PHP_SELF'); ?>" method='post'>
+        <table border="0" cellpadding="1" cellspacing="0" align='center' valign="top" width="95%"><tr><td class='bg2'>
+        <table border="0" cellpadding="1" cellspacing="1" width="100%">
+        <tr class='bg3' align='left'>
+        <td align='center' colspan="2"><span class='fg2'><b><?php echo _MD_A_EDITTHISFORUM;?></b></span></td>
+        </tr>
+        <tr class='bg1' align='left'>
+        <td colspan=2><input type="checkbox" name='delete' value="1" /><span class='fg2'> <?php echo _MD_A_DTFTWARAPITF;?></span></td>
+        </tr>
+        <tr class='bg1' align='left'>
+        <td><span class='fg2'><?php echo _MD_A_FORUMNAME;?></span></td>
+        <td><input type='text' name='name' size="40" maxlength="150" value="<?php echo $name?>" /></td>
+        </tr>
+        <tr class='bg1' align='left'>
+        <td><span class='fg2'><?php echo _MD_A_FORUMDESCRIPTION;?></span></td>
+        <td><textarea name='desc' rows="15" cols="45" wrap="virtual"><?php echo $desc?></textarea></td>
+        </tr>
+        <tr class='bg1' align='left'>
+        <td valign="top"><span class='fg2'><?php echo _MD_A_MODERATOR;?></span></td>
+        <td><b>Current:</b><br />
+        <?php
+        $sql = "SELECT u.uname, u.uid FROM ".$xoopsDB->prefix("users")." u, ".$xoopsDB->prefix("bb_forum_mods")." f WHERE f.forum_id = $forum AND u.uid = f.user_id";
+        if ( !$r = $xoopsDB->query($sql) ) {
+            echo"</td></tr></table></td></tr></table></form></td></tr></table>";
+            xoops_cp_footer();
+            exit();
+        }
+        $current_mods = array();
+        if ( $row = $xoopsDB->fetchArray($r) ) {
+            do {
+                echo $row['uname']." (<input type=\"checkbox\" name=\"rem_mods[]\" value=\"".$row['uid']."\" /> "._MD_A_REMOVE.")<br />";
+                $current_mods[] = $row['uid'];
+            } while ( $row = $xoopsDB->fetchArray($r) );
+            echo "<br />";
+        } else {
+            echo _MD_A_NOMODERATORASSIGNED."<br /><br />\n";
+        }
+
+        ?>
+        <b>Add:</b><br />
+        <select name='mods[]' size="5" multiple>
+        <?php
+        $sql = "SELECT uid, uname FROM ".$xoopsDB->prefix("users")." WHERE uid > 0 AND level > 0 ";
+        while ( list($null, $currMod) = each($current_mods) ) {
+            $sql .= "AND uid != $currMod ";
+        }
+        $sql .= "ORDER BY uname";
+        if ( !$r = $xoopsDB->query($sql) ) {
+            echo"</td></tr></table></td></tr></table></form></td></tr></table>";
+            xoops_cp_footer();
+            exit();
+        }
+        if ( $row = $xoopsDB->fetchArray($r) ) {
+            do {
+                $s = "";
+                if ( $row['uid'] == $myrow['forum_moderator'] ) {
+                    $s = " selected='selected'";
+                }
+                echo "<option value=\"".$row['uid']."\"$s>".$row['uname']."</option>\n";
+            } while ( $row = $xoopsDB->fetchArray($r) );
+        } else {
+            echo "<option value=\"0\">"._MD_A_NONE."</option>\n";
+        }
+        ?>
+        </select></td>
+        </tr>
+        <tr class='bg1' align='left'>
+        <td><span class='fg2'><?php echo _MD_A_CATEGORY;?></span></td>
+        <td><select name='cat'>
+        <?php
+        $sql = "SELECT * FROM ".$xoopsDB->prefix("bb_categories")."";
+        if ( !$r = $xoopsDB->query($sql) ) {
+            echo"</td></tr></table>";
+            xoops_cp_footer();
+            exit();
+        }
+        if ( $row = $xoopsDB->fetchArray($r) ) {
+            do {
+                $s = "";
+                if ( $row['cat_id'] == $myrow['cat_id'] ) {
+                    $s = " selected='selected'";
+                }
+                echo "<option value=\"".$row['cat_id']."\"$s>".$row['cat_title']."</option>\n";
+            } while ( $row = $xoopsDB->fetchArray($r) );
+        } else {
+            echo "<option value=\"0\">"._MD_A_NONE."</option>\n";
+        }
+        ?>
+        </select></td>
+        <?php
+        $access1 = $access2 = $access3 = '';
+        if ( $myrow['forum_access'] == 1 ) {
+            $access1 = " selected='selected'";
+        }
+        if ( $myrow['forum_access'] == 2 ) {
+            $access2 = " selected='selected'";
+        }
+        if ( $myrow['forum_access'] == 3 ) {
+            $access3 = " selected='selected'";
+        }
+        ?>
+        </tr>
+        <tr class='bg1' align='left'>
+        <td><span class='fg2'>Access Level:</span></td>
+        <td><select name='forum_access'>
+        <option value="2"<?php echo $access2?>><?php echo _MD_A_ANONYMOUSPOST;?></option>
+        <option value="1"<?php echo $access1?>><?php echo _MD_A_REGISTERUSERONLY;?></option>
+        <option value="3"<?php echo $access3?>><?php echo _MD_A_MODERATORANDADMINONLY;?></option>
+        </select>
+        </td>
+        </tr>
+        <tr class='bg1' align='left'>
+        <td><span class='fg2'><?php echo _MD_A_TYPE;?></span></td>
+        <td><select name='type'>
+        <?php
+        $pub = $priv = '';
+        if ( $myrow['forum_type'] == 1 ) {
+            $priv = " selected='selected'";
+        } else {
+            $pub = " selected='selected'";
+        }
+        ?>
+        <option value="0"<?php echo $pub?>><?php echo _MD_A_PUBLIC;?></option>
+        <option value="1"<?php echo $priv?>><?php echo _MD_A_PRIVATE;?></option>
+        </select>
+        </td>
+        </tr>
+        <?php
+        $html_yes = $html_no = $sig_yes = $sig_no = "";
+        if ( $myrow['allow_html'] == 1 ) {
+            $html_yes = " checked='checked'";
+        } else {
+            $html_no = " checked='checked'";
+        }
+        if ( $myrow['allow_sig'] == 1) {
+            $sig_yes = " checked='checked'";
+        } else {
+            $sig_no = " checked='checked'";
+        }
+        echo "<tr class='bg1' align='left'><td><span class='fg2'>". _MD_A_ALLOWHTML ."</span></td>          <td><input type='radio' name='html' value='1'".$html_yes." />"._MD_A_YES."<input type='radio' name='html' value='0'".$html_no." />"._MD_A_NO ."</td></tr>
+        <tr class='bg1' align='left'><td><span class='fg2'>". _MD_A_ALLOWSIGNATURES ."</span></td>
+        <td><input type='radio' name='sig' value='1'$sig_yes />". _MD_A_YES ."<input type='radio' name='sig' value='0'$sig_no />". _MD_A_NO ."</td></tr>
+        <tr class='bg1' align='left'><td><span class='fg2'>". _MD_A_HOTTOPICTHRESHOLD ."</span></td><td><input type='text' name='hot' size='3' maxlength='3' value='". $myrow['hot_threshold']."' /></td></tr>
+        <tr class='bg1' align='left'><td><span class='fg2'>". _MD_A_POSTPERPAGE ."</span><br /><span class='fg2'><i>". _MD_A_TITNOPPTTWBDPPOT ."</i></span></td>
+        <td><input type='text' name='ppp' size='3' maxlength='3' value='".$myrow['posts_per_page']."' /></td></tr>
+        <tr class='bg1' align='left'><td><span class='fg2'>". _MD_A_TOPICPERFORUM ."</span><br /><span class='fg2'><i>". _MD_A_TITNOTPFTWBDPPOAF ."</i></span></td><td><input type='text' name='tpp' size='3' maxlength='3' value='". $myrow['topics_per_page'] ."' /></td></tr>";
+        echo "<tr class='bg3' align='left'><td align='center' colspan='2'><input type='hidden' name='mode' value='editforum' /><input type='hidden' name='forum' value='$forum' /><input type='submit' name='save' value='". _MD_A_SAVECHANGES ."' />&nbsp;&nbsp;<input type='reset' value='". _MD_A_CLEAR ."' /></td></tr>";
+        echo "</table></td></tr></table></form>";
+    }
+    if ( !isset($_POST['submit']) && !isset($_POST['save']) ) {
+        xoops_cp_header();
+        echo"<table width='100%' border='0' cellspacing='1' class='outer'>"
+        ."<tr><td class=\"odd\">";
+        echo "<a href='./index.php'><h4>"._MD_A_FORUMCONF."</h4></a>";
+        ?>
+        <form action="<?php echo xoops_getenv('PHP_SELF'); ?>" method='post'>
+        <table border="0" cellpadding="1" cellspacing="0" align='center' valign="TOP" width="95%"><tr><td class='bg2'>
+        <table border="0" cellpadding="1" cellspacing="1" width="100%">
+        <tr class='bg3' align='left'>
+        <td align='center' colspan="2"><span class='fg2'><b><?php echo _MD_A_SELECTFORUMEDIT;?></b><span class='fg2'></td>
+        </tr>
+        <tr class='bg1' align='left'>
+        <td align='center' colspan="2"><select name='forum' size="0">
+        <?php
+        $sql = "SELECT forum_name, forum_id FROM ".$xoopsDB->prefix("bb_forums")." ORDER BY forum_id";
+        if ( $result = $xoopsDB->query($sql) ) {
+            if ( $myrow = $xoopsDB->fetchArray($result) ) {
+                do {
+                    $name = $myts->makeTboxData4Show($myrow['forum_name']);
+                    echo "<option value=\"".$myrow['forum_id']."\">$name</option>\n";
+                } while ( $myrow = $xoopsDB->fetchArray($result) );
+            } else {
+                echo "<option value=\"-1\">"._MD_A_NOFORUMINDATABASE."</option>\n";
+            }
+        } else {
+            echo "<option value=\"-1\">"._MD_A_DATABASEERROR."</option>\n";
+        }
+        ?>
+        </select></td>
+        </tr>
+        <tr class='bg3' align='left'>
+        <td align='center' colspan="2">
+        <input type="hidden" name='mode' value="editforum" />
+        <input type='submit' name='submit' value="<?php echo _MD_A_EDIT;?>" />&nbsp;&nbsp;
+        </td>
+        </tr>
+        </table></td></tr></table></form>
+        <?php
+    }
+    break;
+
+case 'editcat':
+    $myts =& MyTextSanitizer::getInstance();
+    if ( isset($_POST['submit']) && isset($_POST['save']) ) {
+        $new_title = $myts->stripSlashesGPC($_POST['new_title']);
+        $cat_id = !empty($_POST['cat_id']) ? intval($_POST['cat_id']) : 0;
+        $sql = "UPDATE ".$xoopsDB->prefix("bb_categories")." SET cat_title = ".$xoopsDB->quoteString($new_title)." WHERE cat_id = $cat_id";
+        if ( !$result = $xoopsDB->query($sql) ) {
+            redirect_header("./index.php", 1);
+            exit();
+        } else {
+            redirect_header("./index.php", 1, _MD_A_CATEGORYUPDATED);
+        }
+    } else if(isset($_POST['submit']) && $_POST['submit'] != "") {
+        $sql = "SELECT cat_title FROM ".$xoopsDB->prefix("bb_categories")." WHERE cat_id = ".intval($_POST['cat']);
+        if ( !$result = $xoopsDB->query($sql) ) {
+            redirect_header("./index.php", 1);
+            exit();
+        }
+        xoops_cp_header();
+        echo"<table width='100%' border='0' cellspacing='1' class='outer'>"
+        ."<tr><td class=\"odd\">";
+        echo "<a href='./index.php'><h4>"._MD_A_FORUMCONF."</h4></a>";
+        $cat_data = $xoopsDB->fetchArray($result);
+        $cat_title = $myts->makeTboxData4Edit($cat_data["cat_title"]);
+        ?>
+        <form action="<?php echo xoops_getenv('PHP_SELF'); ?>" method='post'>
+        <table border="0" cellpadding="1" cellspacing="0" align='center' valign="top" width="95%"><tr><td class='bg2'>
+        <table border="0" cellpadding="1" cellspacing="1" width="100%">
+        <tr class='bg3' align='left'>
+        <td align='center' colspan="2"><span class='fg2'><b><?php echo _MD_A_EDITCATEGORY;?> <?php echo $cat_title ?></b><span class='fg2'></td>
+        </tr>
+        <tr class='bg1' align='left'>
+        <td><?php echo _MD_A_CATEGORYTITLE;?></td>
+        <td><input type="text" name="new_title" value="<?php echo $cat_title ?>" size="45" maxlength="100" /></td>
+        </tr>
+        <tr class='bg3' align='left'>
+        <td align='center' colspan="2">
+        <input type="hidden" name='mode' value="editcat" />
+        <input type="hidden" name="save" value="true" />
+        <input type="hidden" name="cat_id" value="<?php echo intval($_POST['cat']);?>" />
+        <input type='submit' name='submit' value="<?php echo _MD_A_SAVECHANGES;?>" />
+        </td>
+        </tr>
+        </table></td></tr></table></form>
+        <?php
+    } else {
+        $sql = "SELECT cat_id, cat_title FROM ".$xoopsDB->prefix("bb_categories")." ORDER BY cat_order";
+        if ( !$result = $xoopsDB->query($sql) ) {
+            redirect_header("./index.php", 1);
+            exit();
+        }
+        xoops_cp_header();
+        echo"<table width='100%' border='0' cellspacing='1' class='outer'>"
+        ."<tr><td class=\"odd\">";
+        echo "<a href='./index.php'><h4>"._MD_A_FORUMCONF."</h4></a>";
+        ?>
+        <form action="<?php echo xoops_getenv('PHP_SELF'); ?>" method='post'>
+        <table border="0" cellpadding="1" cellspacing="0" align='center' valign="top" width="95%"><tr><td class='bg2'>
+        <table border="0" cellpadding="1" cellspacing="1" width="100%">
+        <tr class='bg3' align='left'>
+        <td align='center' colspan="2"><span class='fg2'><b><?php echo _MD_A_SELECTACATEGORYEDIT;?></b><span class='fg2'></td>
+        </tr>
+        <tr class='bg1' align='left'>
+        <td align='center' colspan="2"><select name='cat' size="0">
+        <?php
+        while ( $cat_data = $xoopsDB->fetchArray($result) ) {
+            echo "<option value=\"".$cat_data["cat_id"]."\">".$myts->makeTboxData4Show($cat_data["cat_title"])."</option>\n";
+        }
+        ?>
+        </select></td></tr>
+        <tr class='bg3' align='left'>
+        <td align='center' colspan="2">
+        <input type="hidden" name='mode' value="editcat" />
+        <input type='submit' name='submit' value="<?php echo _MD_A_EDIT;?>" />&nbsp;&nbsp;
+        </td>
+        </tr>
+        </table></td></tr></table></form>
+        <?php
+    }
+    break;
+case 'remcat':
+    $myts =& MyTextSanitizer::getInstance();
+    if ( isset($_POST['submit']) && $_POST['submit'] != "" ) {
+        $sql = sprintf("DELETE FROM %s WHERE cat_id = %u", $xoopsDB->prefix("bb_categories"), $_POST['cat']);
+        if ( !$r = $xoopsDB->query($sql) ) {
+            redirect_header("./index.php", 1);
+            exit();
+        }
+        redirect_header("./index.php", 1, _MD_A_CATEGORYDELETED);
+    } else {
+        xoops_cp_header();
+        echo"<table width='100%' border='0' cellspacing='1' class='outer'>"
+        ."<tr><td class=\"odd\">";
+        echo "<a href='./index.php'><h4>"._MD_A_FORUMCONF."</h4></a>";
+        ?>
+        <form action="<?php echo xoops_getenv('PHP_SELF'); ?>" method='post'>
+        <table border="0" cellpadding="1" cellspacing="0" align='center' width="95%"><tr><td class='bg2'>
+        <table border="0" cellpadding="1" cellspacing="1" width="100%">
+        <tr class='bg3' align='left'>
+        <td align='center' colspan="2"><span class='fg2'><b><?php echo _MD_A_RMVACAT;?></b></span></td>
+        </tr>
+        <tr class='bg3' align='left'>
+        <td align='center' colspan="2"><span class='fg2'><i><?php echo _MD_A_NTWNRTFUTCYMDTVTEFS;?></i></span></td>
+        </tr>
+        <tr class='bg1'>
+        <td align='center' colspan="2"><span class='fg2'>
+        <select name='cat'>
+        <?php
+        $sql = "SELECT * FROM ".$xoopsDB->prefix("bb_categories")." ORDER BY cat_title";
+        if ( !$r = $xoopsDB->query($sql) ) {
+            echo"</td></tr></table>";
+            xoops_cp_footer();
+            exit();
+        }
+        while (  $m = $xoopsDB->fetchArray($r) ) {
+            echo "<option value=\"".$m['cat_id']."\">".$myts->makeTboxData4Show($m['cat_title'])."</option>\n";
+        }
+        ?>
+        </select>
+        <input type='hidden' name='mode' value='<?php echo $mode ?>' /></td>
+        </tr>
+        <tr class='bg3'>
+        <td align='center' colspan="2"><span class='fg2'>
+        <input type="submit" name="submit" value="<?php echo _MD_A_REMOVECATEGORY;?>" /></td></tr>
+        </table></td></tr></table></form>
+        <?php
+    }
+    break;
+case 'addcat':
+    $myts =& MyTextSanitizer::getInstance();
+    if ( isset($_POST['submit']) && $_POST['submit'] != "" ) {
+        $nextid = $xoopsDB->genId($xoopsDB->prefix("bb_categories")."_cat_id_seq");
+        $sql = "SELECT max(cat_order) AS highest FROM ".$xoopsDB->prefix("bb_categories")."";
+        if ( !$r = $xoopsDB->query($sql) ) {
+            redirect_header("./index.php", 1);
+            exit();
+        }
+        list($highest) = $xoopsDB->fetchRow($r);
+        $highest++;
+        $title = $myts->stripSlashesGPC($_POST['title']);
+        $sql = sprintf("INSERT INTO %s (cat_id, cat_title, cat_order) VALUES (%u, %s, %u)", $xoopsDB->prefix("bb_categories"), $nextid, $xoopsDB->quoteString($title), $highest);
+        if ( !$result = $xoopsDB->query($sql) ) {
+            redirect_header("./index.php", 1);
+            exit();
+        }
+        redirect_header("./index.php", 1, _MD_A_CATEGORYCREATED);
+    } else {
+        xoops_cp_header();
+        echo"<table width='100%' border='0' cellspacing='1' class='outer'>"
+        ."<tr><td class=\"odd\">";
+        echo "<a href='./index.php'><h4>"._MD_A_FORUMCONF."</h4></a>";
+        ?>
+        <form action="<?php echo xoops_getenv('PHP_SELF'); ?>" method='post'>
+        <table border="0" cellpadding="1" cellspacing="0" align='center' valign="top" width="95%"><tr><td class='bg2'>
+        <table border="0" cellpadding="1" cellspacing="1" width="100%">
+        <tr class='bg3' align='left'>
+        <td align='center' colspan="2"><span class='fg2'><b><?php echo _MD_A_CREATENEWCATEGORY;?></b></span></td>
+        </tr>
+        <tr class='bg1' align='left'>
+        <td><span class='fg2'><?php echo _MD_A_CATEGORYTITLE;?></span></td>
+        <td><input type="text" name="title" size="40" maxlength="100" /></td>
+        </tr>
+        <tr class='bg3' align="left">
+        <td align='center' colspan="2">
+        <input type="hidden" name="mode" value="addcat" />
+        <input type="submit" name="submit" value="<?php echo _MD_A_CREATENEWCATEGORY;?>" />&nbsp;&nbsp;
+        <input type="reset" value="<?php echo _MD_A_CLEAR;?>" />
+        </td>
+        </tr>
+        </table></td></tr></table></form>
+        <?php
+    }
+    break;
+case 'addforum':
+    $myts =& MyTextSanitizer::getInstance();
+    if ( isset($_POST['submit']) && $_POST['submit'] != "" ) {
+        foreach (array('name', 'desc') as $k) {
+            $$k = !empty($_POST[$k]) ? trim($myts->stripSlashesGPC($_POST[$k])) : '';
+        }
+        foreach (array('type', 'cat', 'forum_access', 'html', 'sig', 'ppp', 'hot', 'tpp', 'forum') as $k) {
+            $$k = !empty($_POST[$k]) ? intval($_POST[$k]) : 0;
+        }
+        $mods = !empty($_POST['mods']) ? $_POST['mods'] : array();
+        if ( $name == '' || $desc == '' || empty($mods) ) {
+            xoops_cp_header();
+            echo"<table width='100%' border='0' cellspacing='1' class='outer'>"
+            ."<tr><td class=\"odd\">";
+            echo "<a href='./index.php'><h4>"._MD_A_FORUMCONF."</h4></a>";
+            echo _MD_A_YDNFOATPOTFDYAA;
+            echo"</td></tr></table>";
+            xoops_cp_footer();
+            exit();
+        }
+        $nextid = $xoopsDB->genId($xoopsDB->prefix("bb_forums")."_forum_id_seq");
+        $sql = "INSERT INTO ".$xoopsDB->prefix("bb_forums")." (forum_id, forum_name, forum_desc, forum_access, cat_id, forum_type, allow_html, allow_sig,posts_per_page,hot_threshold,topics_per_page) VALUES ($nextid, ".$xoopsDB->quoteString($name).", ".$xoopsDB->quoteString($desc).", $forum_access, $cat, $type, ".$xoopsDB->quoteString($html).", ".$xoopsDB->quoteString($sig).", $ppp, $hot, $tpp)";
+        if ( !$result = $xoopsDB->query($sql) ) {
+            redirect_header("./index.php", 1);
+            exit();
+        }
+        if ( $nextid == 0 ) {
+            $nextid = $xoopsDB->getInsertId();
+        }
+        // RMV-NOTIFY
+        $tags = array();
+        $tags['FORUM_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewforum.php?forum=' . $nextid;
+        $tags['FORUM_NAME'] = $name;
+        $tags['FORUM_DESCRIPTION'] = $desc;
+        $notification_handler =& xoops_gethandler('notification');
+        $notification_handler->triggerEvents('global', 0, 'new_forum', $tags);
+
+        $count = 0;
+        while ( list($mod_number, $mod) = each($mods) ) {
+            $mod = intval($mod);
+            $mod_data = new XoopsUser($mod);
+            if (is_object($mod_data) && $mod_data->isActive() && $mod_data->level() < 2 ) {
+                if ( !isset($user_query) ) {
+                    $user_query = "UPDATE ".$xoopsDB->prefix("users")." SET level = 2 WHERE ";
+                }
+                if ( $count > 0 ) {
+                    $user_query .= "OR ";
+                }
+                $user_query .= "uid = $mod ";
+                $count++;
+            }
+            $mod_query = "INSERT INTO ".$xoopsDB->prefix("bb_forum_mods")." (forum_id, user_id) VALUES ($nextid, $mod)";
+            if ( !$xoopsDB->query($mod_query) ) {
+                redirect_header("./index.php", 1);
+                exit();
+            }
+        }
+
+        if ( isset($user_query) ) {
+            if ( !$xoopsDB->query($user_query) ) {
+                redirect_header("./index.php", 1);
+                exit();
+            }
+        }
+        redirect_header("./index.php", 1, _MD_A_FORUMCREATED);
+    } else {
+        $sql = "SELECT count(*) AS total FROM ".$xoopsDB->prefix("bb_categories")."";
+        if ( !$r = $xoopsDB->query($sql) ) {
+            redirect_header("./index.php", 1);
+            exit();
+        }
+        xoops_cp_header();
+        echo"<table width='100%' border='0' cellspacing='1' class='outer'>"."<tr><td class=\"odd\">";
+        echo "<a href='./index.php'><h4>"._MD_A_FORUMCONF."</h4></a>";
+        list($total) = $xoopsDB->fetchRow($r);
+        if ( $total < 1 || !isset($total) ) {
+            echo _MD_A_EYMAACBYAF;
+            echo"</td></tr></table>";
+            xoops_cp_footer();
+            exit();
+        }
+        ?>
+        <form action="<?php echo xoops_getenv('PHP_SELF'); ?>" method='post'>
+        <table border="0" cellpadding="1" cellspacing="0" align='center' valign="top" width="95%"><tr><td class='bg2'>
+        <table border="0" cellpadding="1" cellspacing="1" width="100%">
+        <tr class='bg3' align='left'>
+        <td align='center' colspan="2"><span class='fg2'><b><?php echo _MD_A_CREATENEWFORUM;?></b></span></td>
+        </tr>
+        <tr class='bg1' align='left'>
+        <td><span class='fg2'><?php echo _MD_A_FORUMNAME;?></span></td>
+        <td><input type='text' name='name' size="40" maxlength="150" /></td>
+        </tr>
+        <tr class='bg1' align='left'>
+        <td><span class='fg2'><?php echo _MD_A_FORUMDESCRIPTION;?></span></td>
+        <td><textarea name='desc' rows="15" cols="45" wrap="virtual"></textarea></td>
+        </tr>
+        <tr class='bg1' align='left'>
+        <td><span class='fg2'><?php echo _MD_A_MODERATOR;?></span></td>
+        <td><select name='mods[]' size='5' multiple='multiple'>
+        <?php
+        $sql = "SELECT uid, uname FROM ".$xoopsDB->prefix("users")." WHERE uid > 0 AND level > 0 ORDER BY uname";
+        if ( !$result = $xoopsDB->query($sql) ) {
+            echo"</td></tr></table>";
+            xoops_cp_footer();
+            exit();
+        }
+        if ( $myrow = $xoopsDB->fetchArray($result) ) {
+            do {
+                echo "<option value=\"".$myrow['uid']."\">".$myrow['uname']."</option>\n";
+            } while ( $myrow = $xoopsDB->fetchArray($result) );
+        } else {
+            echo "<option value=\"0\">"._MD_A_NONE."</option>\n";
+        }
+        ?>
+        </select></td>
+        </tr>
+        <tr class='bg1' align='left'>
+        <td><span class='fg2'><?php echo _MD_A_CATEGORY;?></span></td>
+        <td><select name="cat">
+        <?php
+        $sql = "SELECT * FROM ".$xoopsDB->prefix("bb_categories")."";
+        if ( !$result = $xoopsDB->query($sql) ) {
+            echo"</td></tr></table>";
+            xoops_cp_footer();
+            exit();
+        }
+        if ( $myrow = $xoopsDB->fetchArray($result) ) {
+            do {
+                echo "<option value=\"".$myrow['cat_id']."\">".$myrow['cat_title']."</option>\n";
+            } while ( $myrow = $xoopsDB->fetchArray($result) );
+        } else {
+            echo "<option value=\"0\">"._MD_A_NONE."</option>\n";
+        }
+        ?>
+        </select></td>
+        </tr>
+        <tr class='bg1' align='left'>
+        <td><span class='fg2'><?php echo _MD_A_ACCESSLEVEL;?></span></td>
+        <td><select name="forum_access">
+        <option value="2"><?php echo _MD_A_ANONYMOUSPOST;?></option>
+        <option value="1"><?php echo _MD_A_REGISTERUSERONLY;?></option>
+        <option value="3"><?php echo _MD_A_MODERATORANDADMINONLY;?></option>
+        </select>
+        </td>
+        </tr>
+        <tr class='bg1' align='left'>
+        <td><span class='fg2'><?php echo _MD_A_TYPE;?></span></td>
+        <td><select name="type">
+        <option value="0"><?php echo _MD_A_PUBLIC;?></option>
+        <option value="1"><?php echo _MD_A_PRIVATE;?></option>
+        </select>
+        </td>
+        </tr>
+        <?php
+        echo "<tr class='bg1' align='left'><td><span class='fg2'>". _MD_A_ALLOWHTML ."</span></td>          <td><input type='radio' name='html' value='1' />"._MD_A_YES."<input type='radio' name='html' value='0' checked='checked'  />"._MD_A_NO ."</td></tr>
+        <tr class='bg1' align='left'><td><span class='fg2'>". _MD_A_ALLOWSIGNATURES ."</span></td>
+        <td><input type='radio' name='sig' value='1' checked='checked' />". _MD_A_YES ."<input type='radio' name='sig' value='0' />". _MD_A_NO ."</td></tr>
+        <tr class='bg1' align='left'><td><span class='fg2'>". _MD_A_HOTTOPICTHRESHOLD ."</span></td><td><input type='text' name='hot' size='3' maxlength='3' value='10' /></td></tr>
+        <tr class='bg1' align='left'><td><span class='fg2'>". _MD_A_POSTPERPAGE ."</span><br /><span class='fg2'><i>". _MD_A_TITNOPPTTWBDPPOT ."</i></span></td>
+        <td><input type='text' name='ppp' size='3' maxlength='3' value='10' /></td></tr>
+        <tr class='bg1' align='left'><td><span class='fg2'>". _MD_A_TOPICPERFORUM ."</span><br /><span class='fg2'><i>". _MD_A_TITNOTPFTWBDPPOAF ."</i></span></td><td><input type='text' name='tpp' size='3' maxlength='3' value='20' /></td></tr>";
+        ?>
+        <tr class='bg3' align='left'>
+        <td align='center' colspan="2">
+        <input type="hidden" name="mode" value="addforum" />
+        <input type="submit" name="submit" value="<?php echo _MD_A_CREATENEWFORUM;?>" />&nbsp;&nbsp;
+        <input type="reset" value="<?php echo _MD_A_CLEAR;?>" />
+        </td>
+        </tr>
+        </table></td></tr></table></form>
+        <?php
+    }
+    break;
+case 'catorder':
+    $myts =& MyTextSanitizer::getInstance();
+    xoops_cp_header();
+    echo"<table width='100%' border='0' cellspacing='1' class='outer'>"
+    ."<tr><td class=\"odd\">";
+    echo "<a href='./index.php'><h4>"._MD_A_FORUMCONF."</h4></a>";
+    $cat_id = !empty($_POST['cat_id']) ? intval($_POST['cat_id']) : 0;
+    $last_id = !empty($_POST['last_id']) ? intval($_POST['last_id']) : 0;
+    $current_order = !empty($_POST['current_order']) ? intval($_POST['current_order']) : 0;
+    if (!empty($_POST['up'])) {
+        if ( $current_order > 1 ) {
+            $order = $current_order - 1;
+            $sql1 = "UPDATE ".$xoopsDB->prefix("bb_categories")." SET cat_order = $order WHERE cat_id = $cat_id";
+            if ( !$r = $xoopsDB->query($sql1) ) {
+                echo"</td></tr></table>";
+                xoops_cp_footer();
+                exit();
+            }
+            $sql2 = "UPDATE ".$xoopsDB->prefix("bb_categories")." SET cat_order = $current_order WHERE cat_id = $last_id";
+            if ( !$r = $xoopsDB->query($sql2) ) {
+                echo"</td></tr></table>";
+                xoops_cp_footer();
+                exit();
+            }
+            echo "<div>"._MD_A_CATEGORYMOVEUP."</div><br />";
+        } else {
+            echo "<div>"._MD_A_TCIATHU."</div><br />";
+        }
+    } else if (!empty($_POST['down'])) {
+        $sql = "SELECT cat_order FROM ".$xoopsDB->prefix("bb_categories")." ORDER BY cat_order DESC";
+        if ( !$r  = $xoopsDB->query($sql,1,0) ) {
+            echo"</td></tr></table>";
+            xoops_cp_footer();
+            exit();
+        }
+        list($last_number) = $xoopsDB->fetchRow($r);
+        if ( $last_number != $current_order ) {
+            $order = $current_order + 1;
+            $sql = "UPDATE ".$xoopsDB->prefix("bb_categories")." SET cat_order = $current_order WHERE cat_order = $order";
+            if ( !$r  = $xoopsDB->query($sql) ) {
+                echo"</td></tr></table>";
+                xoops_cp_footer();
+                exit();
+            }
+            $sql = "UPDATE ".$xoopsDB->prefix("bb_categories")." SET cat_order = $order where cat_id = $cat_id";
+            if ( !$r  = $xoopsDB->query($sql) ) {
+                echo"</td></tr></table>";
+                xoops_cp_footer();
+                exit();
+            }
+            echo "<div>"._MD_A_CATEGORYMOVEDOWN."</div><br />";
+        } else {
+            echo "<div>"._MD_A_TCIATLD."</div><br />";
+        }
+    }
+    ?>
+    <form action="<?php echo xoops_getenv('PHP_SELF'); ?>" method='post'>
+    <table border="0" cellpadding="1" cellspacing="0" align='center' valign="top" width="95%"><tr><td class='bg2'>
+    <table border="0" cellpadding="1" cellspacing="1" width="100%">
+    <tr class='bg3' align='left'>
+    <td align='center' colspan="3"><span class='fg2'><b><?php echo _MD_A_SETCATEGORYORDER;?></b></span><br />
+    <?php echo _MD_A_TODHITOTCWDOTIP;?><br />
+    <?php echo _MD_A_ECWMTCPUODITO;?></td>
+    </tr>
+    <tr class='bg3' align='center'>
+    <td><?php echo _MD_A_CATEGORY1;?></td><td><?php echo _MD_A_MOVEUP;?></td><td><?php echo _MD_A_MOVEDOWN;?></td>
+    </tr>
+    <?php
+    $sql = "SELECT * FROM ".$xoopsDB->prefix("bb_categories")." ORDER BY cat_order";
+    if ( !$r = $xoopsDB->query($sql) ) {
+        exit();
+    }
+    while ( $m = $xoopsDB->fetchArray($r) ) {
+        echo "<!-- New Row -->\n";
+        echo "<form action=\"".xoops_getenv('PHP_SELF')."\" METHOD=\"POST\">\n";
+        echo "<tr class='bg1' align='center'>\n";
+        echo "<td>".$myts->makeTboxData4Show($m['cat_title'])."</td>\n";
+        echo "<td><input type=\"hidden\" name=\"mode\" value=\"$mode\" />\n";
+        echo "<input type=\"hidden\" name=\"cat_id\" value=\"".$m['cat_id']."\" />\n";
+        echo "<input type=\"hidden\" name=\"last_id\" value=\"";
+        if ( isset($last_id) ) {
+            echo $last_id;
+        }
+        echo "\" />\n";
+        echo "<input type=\"hidden\" name=\"current_order\" value=\"".$m['cat_order']."\" /><input type=\"submit\" name=\"up\" value=\""._MD_A_MOVEUP."\" /></td>\n";
+        echo "<td><input type=\"submit\" name=\"down\" value=\""._MD_A_MOVEDOWN."\" /></td></tr></form>\n<!-- End of Row -->\n";
+        $last_id = $m['cat_id'];
+    }
+    ?>
+    </table></td></tr></table></form>
+    <?php
+    break;
+case 'sync':
+    if ( !empty($_POST['submit']) ) {
+        flush();
+        sync(null, "all forums");
+        flush();
+        sync(null, "all topics");
+        redirect_header("./index.php", 1, _MD_A_SYNCHING);
+    } else {
+        xoops_cp_header();
+        echo"<table width='100%' border='0' cellspacing='1' class='outer'>"
+        ."<tr><td class=\"odd\">";
+        echo "<a href='./index.php'><h4>"._MD_A_FORUMCONF."</h4></a>";
+        ?>
+        <table border="0" cellpadding="1" cellspacing="0" align="center" width="95%"><tr><td class='bg2'>
+        <table border="0" cellpadding="1" cellspacing="1" width="100%">
+        <tr class='bg3' align='left'>
+        <td><?php echo _MD_A_CLICKBELOWSYNC;?></td>
+        </tr>
+        <tr class='bg1' align='center'>
+        <td><form action="<?php echo xoops_getenv('PHP_SELF'); ?>" method="post">
+        <input type="hidden" name="mode" value="<?php echo $mode?>" /><input type="submit" name="submit" value="<?php echo _MD_A_SYNCFORUM;?>" /></form></td>
+        </td>
+        </tr>
+        </table>
+        </td></tr></table>
+        <?php
+    }
+    break;
+}
+
+echo"</td></tr></table>";
+xoops_cp_footer();
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/admin/admin_priv_forums.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/admin/admin_priv_forums.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/admin/admin_priv_forums.php	(revision 405)
@@ -0,0 +1,327 @@
+<?php
+/***************************************************************************
+                          admin_priv_forums.php  -  description
+                             -------------------
+    begin                : Thu 12 Jan 2001
+    copyright            : (C) 2001 The phpBB Group
+    email                : support@phpbb.com
+
+    $Id: admin_priv_forums.php,v 1.5 2005/09/04 20:46:10 onokazu 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.
+ *
+ ***************************************************************************/
+include '../../../include/cp_header.php';
+include '../functions.php';
+include '../config.php';
+$myts =& MyTextSanitizer::getInstance();
+xoops_cp_header();
+echo"<table width='100%' border='0' cellspacing='1' class='outer'>"
+."<tr><td class=\"odd\">";
+echo "<a href='./index.php'><h4>"._MD_A_FORUMCONF."</h4></a>";
+$op = '';
+if (!empty($_POST['op'])) {
+    $op = $_POST['op'];
+} elseif (!empty($_GET['op'])) {
+    $op = $_GET['op'];
+}
+
+    if (empty($op))
+    {
+        // No opcode passed. Show list of private forums.
+?>
+
+    <form action="<?php echo xoops_getenv('PHP_SELF'); ?>" method="post">
+        <table border="0" cellpadding="1" cellspacing="0" align="center" width="95%">
+            <tr>
+                <td class='bg2'>
+                    <table border="0" cellpadding="1" cellspacing="1" width="100%">
+                        <tr class='bg3' align='left'>
+                            <td align="center" colspan="2">
+                                <span class='fg2'>
+                                    <b><?php _MD_A_SAFTE;?></b>
+                                </span>
+                            </td>
+                        </tr>
+                        <tr class='bg1' align='left'>
+                            <td align="center" colspan="2">
+                                <select name="forum" size="0">
+    <?php
+
+        $sql = "SELECT forum_name, forum_id FROM ".$xoopsDB->prefix("bb_forums")." WHERE forum_type = 1 ORDER BY forum_id";
+        if(!$result = $xoopsDB->query($sql))
+        {
+            echo"</td></tr></table>";
+            xoops_cp_footer();
+            exit();
+        }
+
+        if($myrow = $xoopsDB->fetchArray($result))
+        {
+            do
+            {
+                $name = $myts->makeTboxData4Show($myrow['forum_name']);
+                echo "<option value=\"".$myrow['forum_id']."\">$name</option>\n";
+            }
+            while($myrow = $xoopsDB->fetchArray($result));
+        }
+        else
+        {
+            echo "<option value=\"-1\">"._MD_A_NFID."</option>\n";
+        }
+
+?>
+                                </select>
+                            </td>
+                        </tr>
+                        <tr class='bg3' Align="left">
+                            <td align="center" colspan="2">
+                                <input type="hidden" name="op" value="showform" />
+                                <input type="submit" name="submit" value="<?php echo _MD_A_EDIT;?>" />&nbsp;&nbsp;
+                            </td>
+                        </tr>
+                    </table>
+                </td>
+            </tr>
+        </table>
+
+
+<?php
+
+    }
+    else
+    {
+        // Opcode exists. See what it is, do stuff.
+
+
+        if ($op == "adduser")
+        {
+            // Add user(s) to the list for this forum.
+            if (!empty($_POST['userids']))
+            {
+                while(list($null, $curr_userid) = each($_POST["userids"]))
+                {
+                    $sql = "INSERT INTO ".$xoopsDB->prefix("bb_forum_access")." (forum_id, user_id, can_post) VALUES (".intval($_POST['forum']).", ".intval($curr_userid).", 0)";
+                    if (!$result = $xoopsDB->query($sql))
+                    {
+                        echo"</td></tr></table>";
+                        xoops_cp_footer();
+                        exit();
+                    }
+                }
+            }
+            $op = "showform";
+
+        }
+        else if ($op == "deluser")
+        {
+            // Remove a user from the list for this forum.
+            $sql = sprintf("DELETE FROM %s WHERE forum_id = %u AND user_id = %u", $xoopsDB->prefix("bb_forum_access"), $_GET['forum'], $_GET['op_userid']);
+            if (!$result = $xoopsDB->query($sql))
+            {
+                echo"</td></tr></table>";
+                xoops_cp_footer();
+                exit();
+            }
+
+            $op = "showform";
+
+        }
+        else if ($op == "clearusers")
+        {
+            // Remove all users from the list for this forum.
+            $sql = sprintf("DELETE FROM %s WHERE forum_id = %u", $xoopsDB->prefix("bb_forum_access"), $_GET['forum']);
+            if (!$result = $xoopsDB->query($sql))
+            {
+                echo"</td></tr></table>";
+                xoops_cp_footer();
+                exit();
+            }
+
+            $op = "showform";
+        }
+        else if ($op == "grantuserpost")
+        {
+            // Add posting rights for this user in this forum.
+            $sql = sprintf("UPDATE %s SET can_post=1 WHERE forum_id = %u AND user_id = %u", $xoopsDB->prefix("bb_forum_access"), $_GET['forum'], $_GET['op_userid']);
+            if (!$result = $xoopsDB->query($sql))
+            {
+                echo"</td></tr></table>";
+                xoops_cp_footer();
+                exit();
+            }
+
+            $op = "showform";
+
+        }
+        else if ($op == "revokeuserpost")
+        {
+            // Revoke posting rights for this user in this forum.
+            $sql = sprintf("UPDATE %s SET can_post=0 WHERE forum_id = %u AND user_id = %u", $xoopsDB->prefix("bb_forum_access"), $_GET['forum'], $_GET['op_userid']);
+            if (!$result = $xoopsDB->query($sql))
+            {
+                echo"</td></tr></table>";
+                xoops_cp_footer();
+                exit();
+            }
+
+            $op = "showform";
+
+        }
+
+        // We want this one to be available even after one of the above blocks has executed.
+        // The above blocks will set $op to "showform" on success, so it goes right back to the form.
+        // Neato. This is really slick.
+        if ($op == "showform")
+        {
+            $forum = !empty($_REQUEST['forum']) ? intval($_REQUEST['forum']) : 0;
+            // Show the form for the given forum.
+
+            $sql = "SELECT forum_name FROM ".$xoopsDB->prefix("bb_forums")." WHERE forum_id = ".$forum;
+            if (!$result = $xoopsDB->query($sql) || $forum == -1)
+            {
+                echo"</td></tr></table>";
+                xoops_cp_footer();
+                exit();
+            }
+            $forum_name = "";
+            if ($row = $xoopsDB->fetchArray($result))
+            {
+                $forum_name = $myts->makeTboxData4Show($row['forum_name']);
+            }
+?>
+     <br />&nbsp;
+     <table border="0" cellpadding="1" cellspacing="1" align="center" width="95%">
+        <tr>
+            <td class='bg2'>
+                <table border="0" cellpadding="3" cellspacing="0" width="100%">
+                    <tr class='bg3' align="left">
+             <td colspan="3" align="center"><?php printf(_MD_A_EFPF,$forum_name);?></td>
+             </tr>
+             <tr>
+             <td class='bg3' align='center' width='40%'>
+            <form action="<?php echo xoops_getenv('PHP_SELF'); ?>" method="post">
+                 <b><?php echo _MD_A_UWOA;?></b>
+             </td>
+             <td class='bg3' align='center' width='20%'>
+                &nbsp;
+             </td>
+             <td class='bg3' align='center'>
+                <b><?php echo _MD_A_UWA;?></b>
+             </td>
+             </tr>
+
+             <tr>
+              <td valign="top" class='bg1' align='center' width='40%'>
+             <select name="userids[]" size="10" multiple='multiple' style="width: 100px;">
+<?php
+            $sql = "SELECT u.uid FROM ".$xoopsDB->prefix("users")." u, ".$xoopsDB->prefix("bb_forum_access")." f WHERE u.uid = f.user_id AND f.forum_id = $forum";
+            if (!$result = $xoopsDB->query($sql))
+            {
+                echo"</td></tr></table>";
+                xoops_cp_footer();
+                exit();
+            }
+
+            $current_users = Array();
+
+            while ($row = $xoopsDB->fetchArray($result))
+            {
+                $current_users[] = $row['uid'];
+            }
+
+            $sql = "SELECT uid, uname FROM ".$xoopsDB->prefix("users")." WHERE (uid > 0 AND level > 0)";
+            while(list($null, $curr_userid) = each($current_users))
+            {
+                $sql .= "AND (uid != $curr_userid) ";
+        }
+        $sql .= "ORDER BY uname ASC";
+
+        if (!$result = $xoopsDB->query($sql))
+        {
+        echo"</td></tr></table>";
+        xoops_cp_footer();
+        exit();
+        }
+        while ($row = $xoopsDB->fetchArray($result))
+        {
+?>
+         <option value="<?php echo $row['uid'] ?>"> <?php echo $row['uname'] ?> </option>
+<?php
+        }
+?>
+                            </select>
+                        </td>
+                        <td class='bg1' align='center' valign="top">
+
+                            <input type="hidden" name="op" value="adduser" />
+                            <input type="hidden" name="forum" value="<?php echo $forum ?>" />
+                            <input type="submit" name="submit" value="<?php echo _MD_A_ADDUSERS;?>" />
+                            </form><br />
+<?php
+                            $link = xoops_getenv('PHP_SELF')."?forum=".$forum."&amp;op=clearusers";
+                            echo myTextForm($link, _MD_A_CLEARALLUSERS);
+?>
+                        </td>
+                        <td valign="top" class='bg1' align='center'>
+<?php
+            $sql = "SELECT u.uname, u.uid, f.can_post FROM ".$xoopsDB->prefix("users")." u, ".$xoopsDB->prefix("bb_forum_access")." f WHERE u.uid = f.user_id AND f.forum_id = $forum ORDER BY u.uid ASC";
+            if (!$result = $xoopsDB->query($sql))
+            {
+                echo"</td></tr></table>";
+                xoops_cp_footer();
+                exit();
+            }
+?>
+                            <table border="0" cellpadding="10" cellspacing="0">
+
+<?php
+            while ($row = $xoopsDB->fetchArray($result))
+            {
+                $post_text = ($row['can_post']) ? "can" : "can't";
+                $post_text .= " post";
+                $post_toggle_link = XOOPS_URL."/modules/newbb/admin/admin_priv_forums.php?forum=$forum&amp;op_userid=".$row['uid']."&amp;op=";
+                if ($row['can_post'])
+                {
+                    $post_toggle_link .= "revokeuserpost";
+                    $post_toggle_link = myTextForm($post_toggle_link,_MD_A_REVOKEPOSTING);
+                }
+                else
+                {
+                    $post_toggle_link .= "grantuserpost";
+                    $post_toggle_link = myTextForm($post_toggle_link,_MD_A_GRANTPOSTING);
+                }
+                $remove_link = myTextForm(XOOPS_URL."/modules/newbb/admin/admin_priv_forums.php?forum=$forum&amp;op=deluser&amp;op_userid=".$row['uid'], _MD_A_REMOVE);
+?>
+                                <tr>
+                                <td><b><?php echo $row['uname']?></b>
+                                (<?php echo $post_text ?>)
+                                <?php echo $post_toggle_link ?>
+                                <?php echo $remove_link ?></td>
+                                </tr>
+<?php
+            }
+?>
+                            </table>
+                        </td>
+                    </tr>
+                </table>
+            </form>
+            </td></tr></table>
+<?php
+        } // end of big opcode if/else block.
+
+
+    }
+
+//}
+
+echo"</td></tr></table>";
+xoops_cp_footer();
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/delete.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/delete.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/delete.php	(revision 405)
@@ -0,0 +1,86 @@
+<?php
+// $Id: delete.php,v 1.5 2005/08/03 12:39:14 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+include 'header.php';
+
+$ok = 0;
+$forum = isset($_GET['forum']) ? intval($_GET['forum']) : 0;
+$post_id = isset($_GET['post_id']) ? intval($_GET['post_id']) : 0;
+$topic_id = isset($_GET['topic_id']) ? intval($_GET['topic_id']) : 0;
+$order = isset($_GET['order']) ? intval($_GET['order']) : 0;
+$viewmode = (isset($_GET['viewmode']) && $_GET['viewmode'] != 'flat') ? 'thread' : 'flat';
+$forum = isset($_POST['forum']) ? intval($_POST['forum']) : $forum;
+$post_id = isset($_POST['post_id']) ? intval($_POST['post_id']) : $post_id;
+$topic_id = isset($_POST['topic_id']) ? intval($_POST['topic_id']) : $topic_id;
+$order = isset($_POST['order']) ? intval($_POST['order']) : $order;
+$viewmode = (isset($_POST['viewmode']) && $_POST['viewmode'] != 'flat') ? 'thread' : $viewmode;
+if ( empty($forum) ) {
+    redirect_header("index.php", 2, _MD_ERRORFORUM);
+    exit();
+} elseif ( empty($post_id) ) {
+    redirect_header("viewforum.php?forum=$forum", 2, _MD_ERRORPOST);
+    exit();
+}
+
+if ( $xoopsUser ) {
+    if ( !$xoopsUser->isAdmin($xoopsModule->mid()) ) {
+        if ( !is_moderator($forum, $xoopsUser->uid()) ) {
+            redirect_header("viewtopic.php?topic_id=$topic_id&amp;order=$order&amp;viewmode=$viewmode&amp;pid=$pid&amp;forum=$forum", 2, _MD_DELNOTALLOWED);
+            exit();
+        }
+    }
+} else {
+    redirect_header("viewtopic.php?topic_id=$topic_id&amp;order=$order&amp;viewmode=$viewmode&amp;pid=$pid&amp;forum=$forum", 2, _MD_DELNOTALLOWED);
+    exit();
+}
+
+include_once 'class/class.forumposts.php';
+
+if ( !empty($_POST['ok']) ) {
+    if ( !empty($post_id) ) {
+        $post = new ForumPosts($post_id);
+        $post->delete();
+        sync($post->forum(), "forum");
+        sync($post->topic(), "topic");
+    }
+    if ( $post->istopic() ) {
+        redirect_header("viewforum.php?forum=$forum", 2, _MD_POSTSDELETED);
+        exit();
+    } else {
+        redirect_header("viewtopic.php?topic_id=$topic_id&amp;order=$order&amp;viewmode=$viewmode&amp;pid=$pid&amp;forum=$forum", 2, _MD_POSTSDELETED);
+        exit();
+    }
+} else {
+    include XOOPS_ROOT_PATH."/header.php";
+    xoops_confirm(array('post_id' => $post_id, 'viewmode' => $viewmode, 'order' => $order, 'forum' => $forum, 'topic_id' => $topic_id, 'ok' => 1), 'delete.php', _MD_AREUSUREDEL);
+}
+include XOOPS_ROOT_PATH.'/footer.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/config.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/config.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/config.php	(revision 405)
@@ -0,0 +1,102 @@
+<?php
+// $Id: config.php,v 1.3 2005/09/04 20:46:10 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+// You shouldn't have to change any of these
+$bbUrl['root'] = XOOPS_URL."/modules/newbb/";
+$bbUrl['admin'] = $bbUrl['root']."admin";
+$bbUrl['images'] = $bbUrl['root']."images";
+$bbUrl['smilies'] = $bbUrl['images']."smiles";
+
+/* -- Cookie settings (lastvisit) -- */
+// Most likely you can leave this be, however if you have problems
+// logging into the forum set this to your domain name, without
+// the http://
+// For example, if your forum is at http://www.mysite.com/phpBB then
+// set this value to
+// $bbCookie['domain'] = "www.mysite.com";
+$bbCookie['domain'] = "";
+
+// It should be safe to leave these alone as well.
+$bbCookie['path'] = htmlspecialchars(str_replace(basename($_SERVER['PHP_SELF']),"",$_SERVER['PHP_SELF']),ENT_QUOTES);
+$bbCookie['secure'] = false;
+/* -- You shouldn't have to change anything after this point */
+/* -- Images -- */
+$bbImage['post'] = $bbUrl['images']."/post.gif";
+$bbImage['newposts_forum'] = $bbUrl['images']."/folder_new_big.gif";
+$bbImage['folder_forum'] = $bbUrl['images']."/folder_big.gif";
+$bbImage['locked_forum'] = $bbUrl['images']."/folder_locked_big.gif";
+$bbImage['folder_topic'] = $bbUrl['images']."/folder.gif";
+$bbImage['hot_folder_topic'] = $bbUrl['images']."/hot_folder.gif";
+$bbImage['newposts_topic'] = $bbUrl['images']."/red_folder.gif";
+$bbImage['hot_newposts_topic'] = $bbUrl['images']."/hot_red_folder.gif";
+$bbImage['locked_topic'] = $bbUrl['images']."/lock.gif";
+$bbImage['locktopic'] = $bbUrl['images']."/lock_topic.gif";
+$bbImage['deltopic'] = $bbUrl['images']."/del_topic.gif";
+$bbImage['movetopic'] = $bbUrl['images']."/move_topic.gif";
+$bbImage['unlocktopic'] = $bbUrl['images']."/unlock_topic.gif";
+$bbImage['sticky'] = $bbUrl['images']."/sticky.gif";
+$bbImage['unsticky'] = $bbUrl['images']."/unsticky.gif";
+$bbImage['newtopic'] = $bbUrl['images']."/new_topic-dark.jpg";
+$bbImage['folder_sticky'] = $bbUrl['images']."/folder_sticky.gif";
+
+// set expire dates: one for a year, one for 10 minutes
+$expiredate1 = time() + 3600 * 24 * 365;
+$expiredate2 = time() + 600;
+
+// update LastVisit cookie. This cookie is updated each time auth.php runs
+setcookie("NewBBLastVisit", time(), $expiredate1,  $bbCookie['path'], $bbCookie['domain'], $bbCookie['secure']);
+
+// set LastVisitTemp cookie, which only gets the time from the LastVisit
+// cookie if it does not exist yet
+// otherwise, it gets the time from the LastVisitTemp cookie
+if (!isset($_COOKIE["NewBBLastVisitTemp"])) {
+	if(isset($_COOKIE["NewBBLastVisit"])){
+		$temptime = $_COOKIE["NewBBLastVisit"];
+	}else{
+		$temptime = time();
+	}
+}
+else {
+	$temptime = $_COOKIE["NewBBLastVisitTemp"];
+}
+
+// set cookie.
+setcookie("NewBBLastVisitTemp", $temptime ,$expiredate2, $bbCookie['path'], $bbCookie['domain'], $bbCookie['secure']);
+
+// set vars for all scripts
+$last_visit = $temptime;
+
+// ÂÐ±þ¾õ¶·
+$arrResponse = array(
+//	1=>"¡Ý¡Ý¡Ý"  // ²¿¤âÀßÄê¤µ¤ì¤Æ¤¤¤Ê¤¤¡ÊÊüÃÖ¤µ¤ì¤Æ¤¤¤ë¾õÂÖ¡Ë
+	2=>"³ÎÇ§Ãæ" // Ã¯¤«¤¬ºÆ¸½ÊýË¡¤Ê¤É³ÎÇ§¤·¤Æ¤¯¤ì¤Æ¤¤¤ë¡£
+	,3=>"³«È¯Ãæ" // Ã¯¤«¤¬³«È¯¤ÇÂÐ±þ¤·¤Æ¤¯¤ì¤Æ¤¤¤ë¡£
+	,4=>"ÊÝÎ±"   // ÊÝÎ±
+	,9=>"²ò·èºÑ" // ¼ÁÌä¤Ø¤Î²óÅú¤¬¤¢¤Ã¤¿¡£¤Þ¤¿¤Ï¡¢³«È¯¤Ç¤ÎÂÐ±þ¤¬¤¢¤Ã¤¿¡£	
+);
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/search.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/search.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/search.php	(revision 405)
@@ -0,0 +1,167 @@
+<?php
+// $Id: search.php,v 1.3 2005/09/04 20:46:10 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+include 'header.php';
+
+if ( !isset($_POST['submit']) ) {
+	$xoopsOption['template_main']= 'newbb_search.html';
+	include XOOPS_ROOT_PATH.'/header.php';
+	$xoopsTpl->assign("lang_keywords", _MD_KEYWORDS);
+	$xoopsTpl->assign("lang_searchany", _MD_SEARCHANY);
+	$xoopsTpl->assign("lang_searchall", _MD_SEARCHALL);
+	$xoopsTpl->assign("lang_forumc", _MD_FORUMC);
+	$xoopsTpl->assign("lang_searchallforums", _MD_SEARCHALLFORUMS);
+	$xoopsTpl->assign("lang_sortby", _MD_SORTBY);
+	$xoopsTpl->assign("lang_date", _MD_DATE);
+	$xoopsTpl->assign("lang_topic", _MD_TOPIC);
+	$xoopsTpl->assign("lang_forum", _MD_FORUM);
+	$xoopsTpl->assign("lang_username", _MD_USERNAME);
+	$xoopsTpl->assign("lang_searchin", _MD_SEARCHIN);
+	$xoopsTpl->assign("lang_subject", _MD_SUBJECT);
+	$xoopsTpl->assign("lang_body", _MD_BODY);
+
+	$query = 'SELECT forum_name,forum_id FROM '.$xoopsDB->prefix('bb_forums').' WHERE forum_type != 1';
+	if ( !$result = $xoopsDB->query($query) ) {
+		exit("<big>"._MD_ERROROCCURED."</big><hr />"._MD_COULDNOTQUERY);
+	}
+	$select = '<select name="forum">';
+	while ( $row = $xoopsDB->fetchArray($result) ) {
+		$select .= '<option value="'.$row['forum_id'].'">'.$row['forum_name'].'</option>
+		';
+	}
+	$select .= '</select>';
+	$xoopsTpl->assign("forum_selection_box", $select);
+
+} else {
+	$xoopsOption['template_main']= 'newbb_searchresults.html';
+	include XOOPS_ROOT_PATH."/header.php";
+	$forum = (isset($_POST['forum']) && $_POST['forum'] != 'all') ? intval($_POST['forum']) : 'all';
+	$xoopsTpl->assign("lang_keywords", _MD_KEYWORDS);
+	$xoopsTpl->assign("lang_searchany", _MD_SEARCHANY);
+	$xoopsTpl->assign("lang_searchall", _MD_SEARCHALL);
+	$addquery = '';
+	$subquery = '';
+	$query = 'SELECT u.uid,f.forum_id, p.topic_id, u.uname, p.post_time,t.topic_title,t.topic_views,t.topic_replies,f.forum_name FROM '.$xoopsDB->prefix('bb_posts').' p, '.$xoopsDB->prefix('bb_posts_text').' pt, '.$xoopsDB->prefix('users').' u, '.$xoopsDB->prefix('bb_forums').' f,'.$xoopsDB->prefix('bb_topics').' t';
+	$myts = MyTextSanitizer::getInstance();
+	if ( isset($_POST['term']) && trim($_POST['term']) != "" ) {
+		$terms = split(' ', $myts->oopsAddSlashes($_POST['term']));		// Get all the words into an array
+		if ( strlen($terms[0]) < 4 ) {
+
+		}
+		$addquery .= "(pt.post_text LIKE '%$terms[0]%'";
+		$subquery .= "(t.topic_title LIKE '%$terms[0]%'";
+		if ( $_POST['addterms'] == "any" ) {					// AND/OR relates to the ANY or ALL on Search Page
+			$andor = 'OR';
+		} else {
+			$andor = 'AND';
+		}
+		$size = count($terms);
+		for ( $i = 1; $i < $size; $i++ ) {
+			if ( strlen($terms[$i]) < 4 ) {
+
+			}
+			$addquery .= " $andor pt.post_text LIKE '%$terms[$i]%'";
+			$subquery .= " $andor t.topic_title LIKE '%$terms[$i]%'";
+		}
+		$addquery .= ')';
+		$subquery .= ')';
+	}
+	if ($forum !='all' ) {
+		if ( isset($addquery) ) {
+			$addquery .= ' AND ';
+			$subquery .= ' AND ';
+		}
+		$forum = intval($_POST['forum']);
+		$addquery .= ' p.forum_id='.$forum;
+		$subquery .= ' p.forum_id='.$forum;
+	}
+	if ( isset($_POST['search_username']) && trim($_POST['search_username']) != "" ) {
+		$search_username = $myts->oopsAddSlashes(trim($_POST['search_username']));
+		if ( !$result = $xoopsDB->query("SELECT uid FROM ".$xoopsDB->prefix("users")." WHERE uname='$search_username'") ) {
+			redirect_header('search.php',1,_MD_ERROROCCURED);
+			exit();
+		}
+		$row = $xoopsDB->fetchArray($result);
+		if ( !$row ) {
+			redirect_header('search.php',1,_MD_USERNOEXIST);
+			exit();
+		}
+		if ( isset($addquery) ) {
+			$addquery .= " AND p.uid=".$row['uid']." AND u.uname='$search_username'";
+			$subquery .= " AND p.uid=".$row['uid']." AND u.uname='$search_username'";
+		} else {
+			$addquery .= " p.uid=".$row['uid']." AND u.uname='$search_username'";
+			$subquery .= " p.uid=".$row['uid']." AND u.uname='$search_username'";
+		}
+	}
+	if ( isset($addquery) ) {
+		switch ( $_POST['searchboth'] ) {
+		case 'both':
+			$query .= " WHERE ( ($subquery) OR ($addquery) ) AND ";
+		    break;
+		case 'title':
+			$query .= " WHERE ( $subquery ) AND ";
+			break;
+		case 'text':
+		default:
+			$query .= " WHERE ( $addquery ) AND ";
+			break;
+		}
+	} else {
+		$query .= ' WHERE ';
+	}
+	$query .= ' p.post_id = pt.post_id AND p.topic_id = t.topic_id AND p.forum_id = f.forum_id AND p.uid = u.uid AND f.forum_type != 1';
+	$allowed = array("t.topic_title", "t.topic_views", "t.topic_replies", "f.forum_name", "u.uname");
+	$sortby = (!in_array($_POST['sortby'], $allowed)) ? "u.uid" : $_POST['sortby'];
+	$query .= ' ORDER BY '.$sortby;
+	if ( !$result = $xoopsDB->query($query,100,0) ) {
+		exit("<big>"._MD_ERROROCCURED."</big><hr />"._MD_COULDNOTQUERY);
+	}
+	if ( !$row = $xoopsDB->getRowsNum($result) ) {
+		$xoopsTpl->assign("lang_nomatch", _MD_NOMATCH);
+	} else {
+		while ( $row = $xoopsDB->fetchArray($result) ) {
+			$xoopsTpl->append('results', array('forum_name' => $myts->makeTboxData4Show($row['forum_name']), 'forum_id' => $row['forum_id'], 'topic_id' => $row['topic_id'], 'topic_title' => $myts->makeTboxData4Show($row['topic_title']), 'topic_replies' => $row['topic_replies'], 'topic_views' => $row['topic_views'], 'user_id' => $row['uid'], 'user_name' => $myts->makeTboxData4Show($row['uname']), 'post_time' => formatTimestamp($row['post_time'], "m")));
+		}
+	}
+}
+$xoopsTpl->assign("lang_forumindex", sprintf(_MD_FORUMINDEX,$xoopsConfig['sitename']));
+$xoopsTpl->assign("lang_search", _MD_SEARCH);
+$xoopsTpl->assign("lang_forum", _MD_FORUM);
+$xoopsTpl->assign("lang_topic", _MD_TOPIC);
+$xoopsTpl->assign("lang_author", _MD_AUTHOR);
+$xoopsTpl->assign('lang_replies', _MD_REPLIES);
+$xoopsTpl->assign('lang_views', _MD_VIEWS);
+$xoopsTpl->assign("lang_possttime", _MD_POSTTIME);
+$xoopsTpl->assign("lang_searchresults", _MD_SEARCHRESULTS);
+$xoopsTpl->assign("img_folder", $bbImage['folder_topic']);
+include XOOPS_ROOT_PATH.'/footer.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/index.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/index.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/index.php	(revision 405)
@@ -0,0 +1,143 @@
+<?php
+// $Id: index.php,v 1.8 2006/05/01 02:37:28 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+include "header.php";
+// this page uses smarty template
+// this must be set before including main header.php
+$xoopsOption['template_main']= 'newbb_index.html';
+include XOOPS_ROOT_PATH."/header.php";
+
+$myts =& MyTextSanitizer::getInstance();
+
+$sql = 'SELECT c.* FROM '.$xoopsDB->prefix('bb_categories').' c, '.$xoopsDB->prefix("bb_forums").' f WHERE f.cat_id=c.cat_id GROUP BY c.cat_id, c.cat_title, c.cat_order ORDER BY c.cat_order';
+if ( !$result = $xoopsDB->query($sql) ) {
+    redirect_header(XOOPS_URL.'/',1,_MD_ERROROCCURED);
+    exit();
+}
+
+$xoopsTpl->assign(array("lang_welcomemsg" => sprintf(_MD_WELCOME,htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES)), "lang_tostart" => _MD_TOSTART, "lang_totaltopics" => _MD_TOTALTOPICSC, "lang_totalposts" => _MD_TOTALPOSTSC, "total_topics" => get_total_topics(), "total_posts" => get_total_posts(0, 'all'), "lang_lastvisit" => sprintf(_MD_LASTVISIT,formatTimestamp($last_visit)), "lang_currenttime" => sprintf(_MD_TIMENOW,formatTimestamp(time(),"m")), "lang_forum" => _MD_FORUM, "lang_topics" => _MD_TOPICS, "lang_posts" => _MD_POSTS, "lang_lastpost" => _MD_LASTPOST, "lang_moderators" => _MD_MODERATOR));
+
+$viewcat = (!empty($_GET['cat'])) ? intval($_GET['cat']) : 0;
+$categories = array();
+while ( $cat_row = $xoopsDB->fetchArray($result) ) {
+    $categories[] = $cat_row;
+}
+
+$sql = 'SELECT f.*, u.uname, u.uid, p.topic_id, p.post_time, p.subject, p.icon FROM '.$xoopsDB->prefix('bb_forums').' f LEFT JOIN '.$xoopsDB->prefix('bb_posts').' p ON p.post_id = f.forum_last_post_id LEFT JOIN '.$xoopsDB->prefix('users').' u ON u.uid = p.uid';
+if ( $viewcat != 0 ) {
+    $sql .= ' WHERE f.cat_id = '.$viewcat;
+    $xoopsTpl->assign('forum_index_title', sprintf(_MD_FORUMINDEX,htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES)));
+} else {
+    $xoopsTpl->assign('forum_index_title', '');
+}
+$sql .= ' ORDER BY f.cat_id, f.forum_id desc';
+if ( !$result = $xoopsDB->query($sql) ) {
+    exit("Error");
+}
+$forums = array(); // RMV-FIX
+while ( $forum_data = $xoopsDB->fetchArray($result) ) {
+    $forums[] = $forum_data;
+}
+$cat_count = count($categories);
+if ($cat_count > 0) {
+    for ( $i = 0; $i < $cat_count; $i++ ) {
+        $categories[$i]['cat_title'] = $myts->makeTboxData4Show($categories[$i]['cat_title']);
+        if ( $viewcat != 0 && $categories[$i]['cat_id'] != $viewcat ) {
+            $xoopsTpl->append("categories", $categories[$i]);
+            continue;
+        }
+        $topic_lastread = newbb_get_topics_viewed();
+        foreach ( $forums as $forum_row ) {
+            unset($last_post);
+            if ( $forum_row['cat_id'] == $categories[$i]['cat_id'] ) {
+                if ($forum_row['post_time']) {
+                    //$forum_row['subject'] = $myts->makeTboxData4Show($forum_row['subject']);
+                    $categories[$i]['forums']['forum_lastpost_time'][] = formatTimestamp($forum_row['post_time']);
+                    $last_post_icon = '<a href="'.XOOPS_URL.'/modules/newbb/viewtopic.php?post_id='.$forum_row['forum_last_post_id'].'&amp;topic_id='.$forum_row['topic_id'].'&amp;forum='.$forum_row['forum_id'].'#forumpost'.$forum_row['forum_last_post_id'].'">';
+                    if ( $forum_row['icon'] ) {
+                        $last_post_icon .= '<img src="'.XOOPS_URL.'/images/subject/'.htmlspecialchars($forum_row['icon']).'" border="0" alt="" />';
+                    } else {
+                        $last_post_icon .= '<img src="'.XOOPS_URL.'/images/subject/icon1.gif" width="15" height="15" border="0" alt="" />';
+                    }
+                    $last_post_icon .= '</a>';
+                    $categories[$i]['forums']['forum_lastpost_icon'][] = $last_post_icon;
+                    if ( $forum_row['uid'] != 0 && $forum_row['uname'] ){
+                        $categories[$i]['forums']['forum_lastpost_user'][] = '<a href="'.XOOPS_URL.'/userinfo.php?uid='.$forum_row['uid'].'">' . $myts->makeTboxData4Show($forum_row['uname']).'</a>';
+                    } else {
+                        $categories[$i]['forums']['forum_lastpost_user'][] = $xoopsConfig['anonymous'];
+                    }
+                    $forum_lastread = !empty($topic_lastread[$forum_row['topic_id']]) ? $topic_lastread[$forum_row['topic_id']] : false;
+                    if ( $forum_row['forum_type'] == 1 ) {
+                        $categories[$i]['forums']['forum_folder'][] = $bbImage['locked_forum'];
+                    } elseif ( $forum_row['post_time'] > $forum_lastread && !empty($forum_row['topic_id'])) {
+                        $categories[$i]['forums']['forum_folder'][] = $bbImage['newposts_forum'];
+                    } else {
+                        $categories[$i]['forums']['forum_folder'][] = $bbImage['folder_forum'];
+                    }
+                } else {
+                    // no forums, so put empty values
+                    $categories[$i]['forums']['forum_lastpost_time'][] = "";
+                    $categories[$i]['forums']['forum_lastpost_icon'][] = "";
+                    $categories[$i]['forums']['forum_lastpost_user'][] = "";
+                    if ( $forum_row['forum_type'] == 1 ) {
+                        $categories[$i]['forums']['forum_folder'][] = $bbImage['locked_forum'];
+                    } else {
+                        $categories[$i]['forums']['forum_folder'][] = $bbImage['folder_forum'];
+                    }
+                }
+                $categories[$i]['forums']['forum_id'][] = $forum_row['forum_id'];
+                $categories[$i]['forums']['forum_name'][] = $myts->makeTboxData4Show($forum_row['forum_name']);
+                $categories[$i]['forums']['forum_desc'][] = $myts->makeTareaData4Show($forum_row['forum_desc']);
+                $categories[$i]['forums']['forum_topics'][] = $forum_row['forum_topics'];
+                $categories[$i]['forums']['forum_posts'][] = $forum_row['forum_posts'];
+                $all_moderators = get_moderators($forum_row['forum_id']);
+                $count = 0;
+                $forum_moderators = '';
+                foreach ( $all_moderators as $mods) {
+                    foreach ( $mods as $mod_id => $mod_name) {
+                        if ( $count > 0 ) {
+                            $forum_moderators .= ', ';
+                        }
+                        $forum_moderators .= '<a href="'.XOOPS_URL.'/userinfo.php?uid='.$mod_id.'">'.$myts->makeTboxData4Show($mod_name).'</a>';
+                        $count = 1;
+                    }
+                }
+                $categories[$i]['forums']['forum_moderators'][] = $forum_moderators;
+            }
+        }
+        $xoopsTpl->append("categories", $categories[$i]);
+    }
+} else {
+    $xoopsTpl->append("categories", array());
+}
+$xoopsTpl->assign(array("img_hotfolder" => $bbImage['newposts_forum'], "img_folder" => $bbImage['folder_forum'], "img_locked" => $bbImage['locked_forum'], "lang_newposts" => _MD_NEWPOSTS, "lang_private" => _MD_PRIVATEFORUM, "lang_nonewposts" => _MD_NONEWPOSTS, "lang_search" => _MD_SEARCH, "lang_advsearch" => _MD_ADVSEARCH));
+include_once XOOPS_ROOT_PATH.'/footer.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/functions.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/functions.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/functions.php	(revision 405)
@@ -0,0 +1,363 @@
+<?php
+/***************************************************************************
+                           functions.php  -  description
+                             -------------------
+    begin                : Sat June 17 2000
+    copyright            : (C) 2001 The phpBB Group
+    email                : support@phpbb.com
+
+    $Id: functions.php,v 1.2 2005/03/18 12:52:25 onokazu 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.
+ *
+ ***************************************************************************/
+
+
+/* ¥Ç¥Ð¥Ã¥°ÍÑ ------------------------------------------------------------------------------------------------*/
+function sfPrintR($obj) {
+	print("<div style='font-size: 12px;color: #00FF00;'>\n");
+	print("<strong>**¥Ç¥Ð¥Ã¥°Ãæ**</strong><br />\n");
+	print("<pre>\n");
+	print_r($obj);
+	print("</pre>\n");
+	print("<strong>**¥Ç¥Ð¥Ã¥°Ãæ**</strong></div>\n");
+}
+
+/*
+ * Gets the total number of topics in a form
+ */
+function get_total_topics($forum_id="")
+{
+	global $xoopsDB;
+	if ( $forum_id ) {
+		$sql = "SELECT COUNT(*) AS total FROM ".$xoopsDB->prefix("bb_topics")." WHERE forum_id = $forum_id";
+	} else {
+		$sql = "SELECT COUNT(*) AS total FROM ".$xoopsDB->prefix("bb_topics");
+	}
+	if ( !$result = $xoopsDB->query($sql) ) {
+		return _MD_ERROR;
+	}
+
+	if ( !$myrow = $xoopsDB->fetchArray($result) ) {
+		return _MD_ERROR;
+	}
+
+	return $myrow['total'];
+}
+
+/*
+ * Returns the total number of posts in the whole system, a forum, or a topic
+ * Also can return the number of users on the system.
+ */
+function get_total_posts($id, $type)
+{
+	global $xoopsDB;
+	switch ( $type ) {
+	case 'users':
+		$sql = "SELECT COUNT(*) AS total FROM ".$xoopsDB->prefix("users")." WHERE (uid > 0) AND ( level >0 )";
+	    break;
+	case 'all':
+		$sql = "SELECT COUNT(*) AS total FROM ".$xoopsDB->prefix("bb_posts");
+	    break;
+	case 'forum':
+		$sql = "SELECT COUNT(*) AS total FROM ".$xoopsDB->prefix("bb_posts")." WHERE forum_id = $id";
+	    break;
+	case 'topic':
+		$sql = "SELECT COUNT(*) AS total FROM ".$xoopsDB->prefix("bb_posts")." WHERE topic_id = $id";
+	    break;
+	// Old, we should never get this.
+	case 'user':
+		exit("Should be using the users.user_posts column for this.");
+	}
+	if ( !$result = $xoopsDB->query($sql) ) {
+		return "ERROR";
+	}
+	if ( !$myrow = $xoopsDB->fetchArray($result) ) {
+		return 0;
+	}
+	return $myrow['total'];
+}
+
+/*
+ * Returns the most recent post in a forum, or a topic
+ */
+function get_last_post($id, $type)
+{
+	global $xoopsDB;
+	switch ( $type ) {
+	case 'time_fix':
+		$sql = "SELECT post_time FROM ".$xoopsDB->prefix("bb_posts")." WHERE topic_id = $id ORDER BY post_time DESC";
+		break;
+	case 'forum':
+		$sql = "SELECT p.post_time, p.uid, u.uname FROM ".$xoopsDB->prefix("bb_posts")." p, ".$xoopsDB->prefix("users")." u WHERE p.forum_id = $id AND p.uid = u.uid ORDER BY post_time DESC";
+		break;
+	case 'topic':
+		$sql = "SELECT p.post_time, u.uname FROM ".$xoopsDB->prefix("bb_posts")." p, ".$xoopsDB->prefix("users")." u WHERE p.topic_id = $id AND p.uid = u.uid ORDER BY post_time DESC";
+		break;
+	case 'user':
+		$sql = "SELECT post_time FROM ".$xoopsDB->prefix("bb_posts")." WHERE uid = $id";
+	    break;
+	}
+	if ( !$result = $xoopsDB->query($sql,1,0) ) {
+		return _MD_ERROR;
+	}
+	if ( !$myrow = $xoopsDB->fetchArray($result) ) {
+		return _MD_NOPOSTS;
+	}
+	if ( ($type != 'user') && ($type != 'time_fix') ) {
+		$val = sprintf("%s <br /> %s %s", $myrow['post_time'], _MD_BY, $myrow['uname']);
+	} else {
+		$val = $myrow['post_time'];
+	}
+	return $val;
+}
+
+/*
+ * Returns an array of all the moderators of a forum
+ */
+function get_moderators($forum_id)
+{
+	global $xoopsDB;
+	$sql = "SELECT u.uid, u.uname FROM ".$xoopsDB->prefix("users")." u, ".$xoopsDB->prefix("bb_forum_mods")." f WHERE f.forum_id = $forum_id and f.user_id = u.uid";
+	//echo $sql;
+	if ( !$result = $xoopsDB->query($sql) ) {
+		return array();
+	}
+	if ( !$myrow = $xoopsDB->fetchArray($result) ) {
+		return array();
+	}
+	do {
+		$array[] = array($myrow['uid'] => $myrow['uname']);
+	} while ( $myrow = $xoopsDB->fetchArray($result) );
+	return $array;
+}
+
+/*
+ * Checks if a user (user_id) is a moderator of a perticular forum (forum_id)
+ * Retruns 1 if TRUE, 0 if FALSE or Error
+ */
+function is_moderator($forum_id, $user_id)
+{
+	global $xoopsDB;
+	$sql = "SELECT COUNT(*) FROM ".$xoopsDB->prefix("bb_forum_mods")." WHERE forum_id = $forum_id AND user_id = $user_id";
+	$ret = false;
+	if ( $result = $xoopsDB->query($sql) ) {
+		if ( $myrow = $xoopsDB->fetchRow($result) ) {
+			if ( $myrow[0] > 0 ) {
+				$ret = true;
+			}
+		}
+	}
+	return $ret;
+}
+
+/*
+ * Checks if a topic is locked
+ */
+function is_locked($topic)
+{
+	global $xoopsDB;
+	$ret = false;
+	$sql = "SELECT topic_status FROM ".$xoopsDB->prefix("bb_topics")." WHERE topic_id = $topic";
+	if ( $r = $xoopsDB->query($sql) ) {
+		if ( $m = $xoopsDB->fetchArray($r) ) {
+			if ( $m['topic_status'] == 1 ) {
+				$ret = true;
+			}
+		}
+	}
+	return $ret;
+}
+
+/**
+ * Checks if the given userid is allowed to log into the given (private) forumid.
+ * If the "is_posting" flag is true, checks if the user is allowed to post to that forum.
+ */
+function check_priv_forum_auth($userid, $forumid, $is_posting)
+{
+	global $xoopsDB;
+	$sql = "SELECT count(*) AS user_count FROM ".$xoopsDB->prefix("bb_forum_access")." WHERE (user_id = $userid) AND (forum_id = $forumid) ";
+
+	if ( $is_posting ) {
+		$sql .= "AND (can_post = 1)";
+	}
+
+	if ( !$result = $xoopsDB->query($sql) ) {
+		// no good..
+		return false;
+	}
+
+	if ( !$row = $xoopsDB->fetchArray($result) ) {
+		return false;
+	}
+
+  	if ( $row['user_count'] <= 0 ) {
+  		return false;
+  	}
+
+  	return true;
+}
+
+function make_jumpbox($selected=0)
+{
+	global $xoopsDB;
+	$myts = MyTextSanitizer::getInstance();
+	$box = '<form action="viewforum.php" method="get">
+	<select name="forum">
+	';
+	$sql = 'SELECT cat_id, cat_title FROM '.$xoopsDB->prefix('bb_categories').' ORDER BY cat_order';
+	if ( $result = $xoopsDB->query($sql) ) {
+		$myrow = $xoopsDB->fetchArray($result);
+		$myrow['cat_title'] = $myts->makeTboxData4Show($myrow['cat_title']);
+		do {
+			$box .= '<option value="-1">________________</option>';
+			$box .= '<option value="-1">'.$myrow['cat_title'].'</option>';
+			//$box .= "<option value=\"-1\">----------------</option>\n";
+			$sub_sql = "SELECT forum_id, forum_name FROM ".$xoopsDB->prefix("bb_forums")." WHERE cat_id ='".$myrow['cat_id']."' ORDER BY forum_id";
+			if ( $res = $xoopsDB->query($sub_sql) ) {
+				if ( $row = $xoopsDB->fetchArray($res) ) {
+					do {
+						$name = $myts->makeTboxData4Show($row['forum_name']);
+						$box .= "<option value='".$row['forum_id']."'";
+						if ( !empty($selected) && $row['forum_id'] == $selected ) {
+							$box .= ' selected="selected"';
+						}
+						$box .= ">&nbsp;&nbsp;- $name</option>\n";
+					} while ( $row = $xoopsDB->fetchArray($res) );
+				}
+			} else {
+				$box .= "<option value=\"0\">ERROR</option>\n";
+			}
+		} while ( $myrow = $xoopsDB->fetchArray($result) );
+	} else {
+		$box .= "<option value=\"-1\">ERROR</option>\n";
+	}
+	$box .= "</select>\n<input type=\"submit\" class=\"formButton\" value=\""._MD_GO."\" />\n</form>";
+	return $box;
+}
+
+function sync($id, $type)
+{
+	global $xoopsDB;
+	switch ( $type ) {
+	case 'forum':
+		$sql = "SELECT MAX(post_id) AS last_post FROM ".$xoopsDB->prefix("bb_posts")." WHERE forum_id = $id";
+   		if ( !$result = $xoopsDB->query($sql) ) {
+			exit("Could not get post ID");
+		}
+   		if ( $row = $xoopsDB->fetchArray($result) ) {
+			$last_post = $row['last_post'];
+   		}
+
+   		$sql = "SELECT COUNT(post_id) AS total FROM ".$xoopsDB->prefix("bb_posts")." WHERE forum_id = $id";
+   		if ( !$result = $xoopsDB->query($sql) ) {
+			exit("Could not get post count");
+   		}
+   		if ( $row = $xoopsDB->fetchArray($result) ) {
+			$total_posts = $row['total'];
+   		}
+
+   		$sql = "SELECT COUNT(topic_id) AS total FROM ".$xoopsDB->prefix("bb_topics")." WHERE forum_id = $id";
+   		if ( !$result = $xoopsDB->query($sql) ) {
+			exit("Could not get topic count");
+   		}
+   		if ( $row = $xoopsDB->fetchArray($result) ) {
+			$total_topics = $row['total'];
+   		}
+
+		$sql = sprintf("UPDATE %s SET forum_last_post_id = %u, forum_posts = %u, forum_topics = %u WHERE forum_id = %u", $xoopsDB->prefix("bb_forums"), $last_post, $total_posts, $total_topics, $id);
+   		if ( !$result = $xoopsDB->queryF($sql) ) {
+			exit("Could not update forum $id");
+   		}
+		break;
+	case 'topic':
+		$sql = "SELECT max(post_id) AS last_post FROM ".$xoopsDB->prefix("bb_posts")." WHERE topic_id = $id";
+   		if ( !$result = $xoopsDB->query($sql) ) {
+			exit("Could not get post ID");
+		}
+		if ( $row = $xoopsDB->fetchArray($result) ) {
+			$last_post = $row['last_post'];
+		}
+   		if ( $last_post > 0 ) {
+			$sql = "SELECT COUNT(post_id) AS total FROM ".$xoopsDB->prefix("bb_posts")." WHERE topic_id = $id";
+   			if ( !$result = $xoopsDB->query($sql) ) {
+				exit("Could not get post count");
+   			}
+   			if ( $row = $xoopsDB->fetchArray($result) ) {
+				$total_posts = $row['total'];
+   			}
+   			$total_posts -= 1;
+			$sql = sprintf("UPDATE %s SET topic_replies = %u, topic_last_post_id = %u WHERE topic_id = %u", $xoopsDB->prefix("bb_topics"), $total_posts, $last_post, $id);
+   			if ( !$result = $xoopsDB->queryF($sql) ) {
+				exit("Could not update topic $id");
+   			}
+		}
+		break;
+	case 'all forums':
+		$sql = "SELECT forum_id FROM ".$xoopsDB->prefix("bb_forums");
+   		if ( !$result = $xoopsDB->query($sql) ) {
+			exit("Could not get forum IDs");
+   		}
+   		while ( $row = $xoopsDB->fetchArray($result) ) {
+			$id = $row['forum_id'];
+			sync($id, "forum");
+		}
+		break;
+	case 'all topics':
+		$sql = "SELECT topic_id FROM ".$xoopsDB->prefix("bb_topics");
+	    if ( !$result = $xoopsDB->query($sql) ) {
+			exit("Could not get topic ID's");
+		}
+		while ( $row = $xoopsDB->fetchArray($result) ) {
+			$id = $row['topic_id'];
+   			sync($id, "topic");
+   		}
+		break;
+	}
+	return true;
+}
+
+// Functions for unserialize() vulnerability in < 4.3.10, 
+// based on the code provided by GIJOE
+// Servers with 4.3.10 or up can use the code with serialize/unserialize
+// functions, as commented out below
+function newbb_get_topics_viewed()
+{
+	if (empty($_COOKIE['newbb_topics_viewed'])) {
+		return array();
+	}
+	$topics_tmp = explode(',', $_COOKIE['newbb_topics_viewed']);
+	$topics = array();
+	foreach ($topics_tmp as $tmp) {
+ 		$idmin = explode('|', $tmp);
+ 		$id = empty($idmin[0]) ? 0 : intval($idmin[0]);
+ 		$min = empty($idmin[1]) ? 0 : intval($idmin[1]);
+ 		$topics[$id] = $min * 60 ;
+ 	}
+	//$topics = !empty($_COOKIE['newbb_topic_lastread']) ? unserialize($_COOKIE['newbb_topic_lastread']) : array();
+	return $topics;
+}
+
+function newbb_add_topics_viewed($topicsViewed, $topicId, $timeViewed, $cookiePath, $cookieDomain, $cookieSecure)
+{
+	$topicsViewed[$topicId] = time();
+	arsort($topicsViewed);
+	$counter = 300 ;
+	foreach (array_keys($topicsViewed) as $id) {
+		$tmp[] = intval($id) . '|' . intval(ceil($topicsViewed[$id] / 60));
+		if (--$counter < 0) {
+			break;
+		}
+	}
+	setcookie('newbb_topics_viewed', implode(',', $tmp), time()+365*24*3600, $cookiePath, $cookieDomain, $cookieSecure);
+	//$topicsViewed[$topicId] = time();
+	//setcookie('newbb_topic_lastread', serialize($topicsViewed), time()+365*24*3600, $cookiePath, $cookieDomain, $cookieSecure);
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/templates/newbb_viewtopic_flat.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/templates/newbb_viewtopic_flat.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/templates/newbb_viewtopic_flat.html	(revision 405)
@@ -0,0 +1,54 @@
+<!-- start module contents -->
+<table border="0" width="100%" cellpadding='5' align='center'>
+  <tr>
+    <td align='left'><img src='<{$xoops_url}>/modules/newbb/images/folder.gif' alt='' /> <a href='<{$xoops_url}>/modules/newbb/index.php'><{$lang_forum_index}></a><br />&nbsp;&nbsp;<img src='<{$xoops_url}>/modules/newbb/images/folder.gif' alt='' /> <a href='<{$xoops_url}>/modules/newbb/viewforum.php?forum=<{$forum_id}>'><{$forum_name}></a>
+<br />&nbsp;&nbsp;&nbsp;&nbsp;<img src='<{$xoops_url}>/modules/newbb/images/folder.gif' alt='' /> <b><{$topic_title}></b></td><td align='right'><{$forum_post_or_register}></td>
+  </tr>
+</table>
+
+<br />
+
+<!-- start topic thread -->
+<table cellpadding="4" width="100%">
+  <tr>
+    <td align="left"><a id="threadtop"></a><a href="viewtopic.php?viewmode=thread&amp;order=<{$order_current}>&amp;topic_id=<{$topic_id}>&amp;forum=<{$forum_id}>"><{$lang_threaded}></a> | <a href="viewtopic.php?viewmode=flat&amp;order=<{$order_other}>&amp;topic_id=<{$topic_id}>&amp;forum=<{$forum_id}>"><{$lang_order_other}></a></td>
+    <td align="right"><a href="viewtopic.php?viewmode=flat&amp;order=<{$order_current}>&amp;topic_id=<{$topic_id}>&amp;forum=<{$forum_id}>&amp;move=prev&amp;topic_time=<{$topic_time}>"><{$lang_prevtopic}></a> | <a href="viewtopic.php?viewmode=flat&amp;order=<{$order_current}>&amp;topic_id=<{$topic_id}>&amp;forum=<{$forum_id}>&amp;move=next&amp;topic_time=<{$topic_time}>"><{$lang_nexttopic}></a> | <a href="#threadbottom"><{$lang_bottom}></a></td>
+  </tr>
+</table>
+<table cellspacing="1" class="outer">
+  <tr align='left'>
+    <th width='20%'><{$lang_poster}></th>
+    <th><{$lang_thread}></th>
+  </tr>
+  <{foreach item=topic_post from=$topic_posts}>
+  <{include file="db:newbb_thread.html" topic_post=$topic_post}>
+  <{/foreach}>
+  <tr class="foot" align="left">
+    <td colspan="2" align="center"><{$forum_page_nav}> </td>
+  </tr>
+</table>
+<table cellpadding="4" width="100%">
+  <tr>
+    <td align="left"><a id="threadbottom"></a><a href="viewtopic.php?viewmode=thread&amp;order=<{$order_current}>&amp;topic_id=<{$topic_id}>&amp;forum=<{$forum_id}>"><{$lang_threaded}></a> | <a href="viewtopic.php?viewmode=flat&amp;order=<{$order_other}>&amp;topic_id=<{$topic_id}>&amp;forum=<{$forum_id}>"><{$lang_order_other}></a></td>
+    <td align="right"><a href="viewtopic.php?viewmode=flat&amp;order=<{$order_current}>&amp;topic_id=<{$topic_id}>&amp;forum=<{$forum_id}>&amp;move=prev&amp;topic_time=<{$topic_time}>"><{$lang_prevtopic}></a> | <a href="viewtopic.php?viewmode=flat&amp;order=<{$order_current}>&amp;topic_id=<{$topic_id}>&amp;forum=<{$forum_id}>&amp;move=next&amp;topic_time=<{$topic_time}>"><{$lang_nexttopic}></a> | <a href="#threadtop"><{$lang_top}></a></td>
+  </tr>
+</table>
+<!-- end topic thread -->
+
+<br />
+
+<table cellspacing="0" class="outer" width="100%">
+  <tr class='foot'>
+    <td align='left'> <{$forum_post_or_register}></td>
+    <td align='right'><{$forum_jumpbox}> </td>
+  </tr>
+  <tr class='foot' valign="bottom">
+    <{if $viewer_is_admin == true}>
+    <td colspan='2' align='center'>&nbsp;<{$topic_lock_image}>&nbsp;<{$topic_move_image}>&nbsp;<{$topic_delete_image}>&nbsp;<{$topic_sticky_image}>&nbsp;</td>
+    <{else}>
+    <td colspan='2'>&nbsp;</td>
+    <{/if}>
+  </tr>
+</table>
+<{include file='db:system_notification_select.html'}>
+<!-- end module contents -->
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/templates/newbb_viewtopic_thread.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/templates/newbb_viewtopic_thread.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/templates/newbb_viewtopic_thread.html	(revision 405)
@@ -0,0 +1,71 @@
+<!-- start module contents -->
+<table border="0" cellpadding='5' align='center'>
+  <tr>
+    <td align='left'><img src='<{$xoops_url}>/modules/newbb/images/folder.gif' alt='' /> <a href='<{$xoops_url}>/modules/newbb/index.php'><{$lang_forum_index}></a><br />&nbsp;&nbsp;<img src='<{$xoops_url}>/modules/newbb/images/folder.gif' alt='' /> <a href='<{$xoops_url}>/modules/newbb/viewforum.php?forum=<{$forum_id}>'><{$forum_name}></a>
+<br />&nbsp;&nbsp;&nbsp;&nbsp;<img src='<{$xoops_url}>/modules/newbb/images/folder.gif' alt='' /> <b><{$topic_title}></b></td><td align='right'><{$forum_post_or_register}></td>
+  </tr>
+</table>
+
+<img src="images/pixel.gif" height="5" alt="" /><br />
+
+<!-- start topic thread -->
+<table cellpadding="4" width="100%">
+  <tr>
+    <td align="left"><a href="viewtopic.php?viewmode=flat&amp;topic_id=<{$topic_id}>&amp;forum=<{$forum_id}>"><{$lang_flat}></a></td>
+    <td align="right"><a href="viewtopic.php?viewmode=thread&amp;topic_id=<{$topic_id}>&amp;forum=<{$forum_id}>&amp;move=prev&amp;topic_time=<{$topic_time}>"><{$lang_prevtopic}></a> | <a href="viewtopic.php?viewmode=thread&amp;topic_id=<{$topic_id}>&amp;forum=<{$forum_id}>&amp;move=next&amp;topic_time=<{$topic_time}>"><{$lang_nexttopic}></a></td>
+  </tr>
+</table>
+<table cellspacing="1" class="outer">
+  <tr>
+    <th width='20%'><{$lang_poster}></th>
+    <th><{$lang_thread}></th>
+  </tr>
+  <{foreach item=topic_post from=$topic_posts}>
+    <{include file="db:newbb_thread.html" topic_post=$topic_post}>
+  <{/foreach}>
+</table>
+
+<table cellpadding="4" width="100%">
+  <tr>
+    <td align="left"><a href="viewtopic.php?viewmode=flat&amp;order=<{$order_current}>&amp;topic_id=<{$topic_id}>&amp;forum=<{$forum_id}>"><{$lang_flat}></a></td>
+    <td align="right"><a href="viewtopic.php?viewmode=thread&amp;topic_id=<{$topic_id}>&amp;forum=<{$forum_id}>&amp;move=prev&amp;topic_time=<{$topic_time}>"><{$lang_prevtopic}></a> | <a href="viewtopic.php?viewmode=thread&amp;topic_id=<{$topic_id}>&amp;forum=<{$forum_id}>&amp;move=next&amp;topic_time=<{$topic_time}>"><{$lang_nexttopic}></a></td>
+  </tr>
+</table>
+
+<br />
+
+<!-- start topic tree -->
+<table class="outer" cellspacing='1'>
+  <tr align='left'>
+    <th width='50%'><{$lang_subject}></th>
+    <th width='20%'><{$lang_poster}></th>
+    <th><{$lang_date}></th>
+  </tr>
+  <{foreach item=topic_tree from=$topic_trees}>
+  <tr class="<{cycle values="even,odd"}>">
+    <td><{$topic_tree.post_prefix}> <{$topic_tree.post_image}> <{$topic_tree.post_title}></td>
+    <td><{$topic_tree.poster_uname}></td>
+    <td><{$topic_tree.post_date}></td>
+  </tr>
+  <{/foreach}>
+</table>
+<!-- end topic tree -->
+<!-- end topic thread -->
+
+<img src="images/pixel.gif" height="5" alt="" /><br />
+
+<table width="100%" class="outer" cellspacing="0">
+  <tr class='foot' valign="top">
+    <td align='left'> <{$forum_post_or_register}></td>
+    <td align='right'><{$forum_jumpbox}> </td>
+  </tr>
+  <tr class='foot' valign="bottom">
+    <{if $viewer_is_admin == true}>
+    <td colspan='2' align='center'>&nbsp;<{$topic_lock_image}>&nbsp;<{$topic_move_image}>&nbsp;<{$topic_delete_image}>&nbsp;<{$topic_sticky_image}>&nbsp;</td>
+    <{else}>
+    <td colspan='2'>&nbsp;</td>
+    <{/if}>
+  </tr>
+</table>
+<{include file='db:system_notification_select.html'}>
+<!-- end module contents -->
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/templates/newbb_viewforum.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/templates/newbb_viewforum.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/templates/newbb_viewforum.html	(revision 405)
@@ -0,0 +1,77 @@
+<!-- start module contents -->
+<table border="0" width="100%" cellpadding="5" align="center">
+  <tr>
+    <td align="left"><img src="<{$forum_image_folder}>" alt="/" />&nbsp;&nbsp;<a href="<{$xoops_url}>/modules/newbb/index.php"><{$forum_index_title}></a><br />&nbsp;&nbsp;&nbsp;<img src="<{$forum_image_folder}>" alt="/" />&nbsp;&nbsp;<b><{$forum_name}></b><br />(<{$lang_moderatedby}>:<{$forum_moderators}>)</td>
+    <td align="right"><{$forum_post_or_register}></td>
+  </tr>
+</table>
+<table align="center" border="0" width="100%">
+  <tr>
+    <td align="right"><{$forum_pagenav}></td>
+  </tr>
+</table>
+
+<!-- start forum main table -->
+<form action="viewforum.php" method="get">
+<input type="hidden" name="mode" value="">
+<input type="hidden" name="topic_id" value="">
+<input type="hidden" name="start" value="<{$smarty.get.start}>">
+
+<table class="outer" cellspacing="1">
+  <tr>
+    <th colspan="8"> <{$forum_name}></th>
+  </tr>
+  <tr class="head" align="left">
+    <td width="2%">&nbsp;</td>
+    <td width="2%">&nbsp;</td>
+    <td>&nbsp;<b><a href="<{$h_topic_link}>"><{$lang_topic}></a></b></td>
+	<td width="7%" align="center" nowrap="nowrap"><b><a href="<{$h_reply_response}>"><{$lang_response}></a></b></td>
+    <td width="5%" align="center" nowrap="nowrap"><b><a href="<{$h_reply_link}>"><{$lang_replies}></a></b></td>
+    <td width="15%" align="center" nowrap="nowrap"><b><a href="<{$h_poster_link}>"><{$lang_poster}></a></b></td>
+    <td width="8%" align="center" nowrap="nowrap"><b><a href="<{$h_views_link}>"><{$lang_views}></a></b></td>
+    <td width="15%" align="center" nowrap="nowrap"><b><a href="<{$h_date_link}>"><{$lang_date}></a></b></td>
+  </tr>
+  <!-- start forum topic -->
+  <{foreach item=topic from=$topics}>
+  <tr class="<{cycle values="even,odd"}>">
+    <td align="center"><img src="<{$topic.topic_folder}>" alt="/" /></td>
+    <td align="center"><{$topic.topic_icon}></td>
+    <td>&nbsp;[<{$topic.fix}>:<{$topic.topic_number}>]<a href="<{$topic.topic_link}>"><{$topic.topic_title}></a><{$topic.topic_page_jump}></td>
+    <td align="center" valign="middle">
+		<{ $arrResponse[$topic.topic_response]|default:'¡Ý¡Ý¡Ý' }>
+		<{if $arrResponse[$topic.topic_response] != ""}> (<{$topic.topic_response_user|default:'¥²¥¹¥È'}>) <{/if}>
+    <{*
+		<select name="response_<{$topic.topic_id}>" size="1">
+		<{ foreach from=$arrResponse key=key item=item }>
+		<option value="<{$key}>" <{if $topic.topic_response == $key}>selected="selected"<{/if}>><{$item}></option>
+		<{ /foreach }>
+		<input type="submit" value="¹¹¿·" onClick="mode.value='response'; topic_id.value=<{$topic.topic_id}>;">
+		</select><br/>
+		
+	*}>
+	
+    </td>
+    <td align="center" valign="middle"><{$topic.topic_replies}></td>
+	<td align="center" valign="middle"><{$topic.topic_poster}></td>
+    <td align="center" valign="middle"><{$topic.topic_views}></td>
+	<td align="right" valign="middle"><{$topic.topic_last_posttime}><br /><{$lang_by}> <{$topic.topic_last_poster}></td>
+  </tr>
+  <{/foreach}>
+  <!-- end forum topic -->
+  <tr class="foot">
+    <td colspan="8" align="center">
+    <b><{$lang_sortby}></b> <{$forum_selection_sort}> <{$forum_selection_order}> <{$forum_selection_since}> <input type="hidden" name="forum" value="<{$forum_id}>" /><input type="submit" name="refresh" value="<{$lang_go}>" />
+    </td>
+  </tr>
+</table>
+</form>
+<!-- end forum main table -->
+
+<table align="center" border="0" width="100%">
+  <tr>
+    <td valign="top"><img src="<{$img_newposts}>" alt="/" /> = <{$lang_newposts}> (<img src="<{$img_hotnewposts}>" alt="/" /> = <{$lang_hotnewposts}>)<br /><img src="<{$img_folder}>" alt="/" /> = <{$lang_nonewposts}> (<img src="<{$img_hotfolder}>" alt="/" /> = <{$lang_hotnonewposts}>)<br /><img src="<{$img_locked}>" alt="/" /> = <{$lang_topiclocked}><br /><img src="<{$img_sticky}>" alt="/" /> = <{$lang_topicsticky}></td>
+    <td align="right"><{$forum_pagenav}><br /><{$forum_jumpbox}></td>
+  </tr>
+</table>
+<{include file='db:system_notification_select.html'}>
+<!-- end module contents -->
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/templates/newbb_search.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/templates/newbb_search.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/templates/newbb_search.html	(revision 405)
@@ -0,0 +1,50 @@
+<!-- start module contents -->
+<table border="0" cellpadding="5" align="center">
+  <tr>
+    <td colspan="2" align="left"><img src="<{$img_folder}>" alt="" />&nbsp;&nbsp;<a href="<{$xoops_url}>/modules/newbb/index.php"><{$lang_forumindex}></a><br />&nbsp;&nbsp;&nbsp;<img src="<{$img_folder}>" alt="" />&nbsp;&nbsp;<{$lang_search}></td>
+  </tr>
+</table>
+
+<form name="Search" action="search.php" method="post">
+  <table class="outer" border="0" cellpadding="1" cellspacing="0" align="center" width="95%">
+    <tr>
+      <td>
+        <table border="0" cellpadding="1" cellspacing="1" width="100%" class="head">
+          <tr>
+            <td class="head" width="50%" align="right"><b><{$lang_keywords}></b>&nbsp;</td>
+            <td class="even" width="50%"><input type="text" name="term" /></td>
+          </tr>
+          <tr>
+            <td class="head" width="50%">&nbsp;</td>
+            <td class="even" width="50%"><input type="radio" name="addterms" value="any" checked="checked" /><{$lang_searchany}></td>
+          </tr>
+          <tr>
+            <td class="head" width="50%">&nbsp;</td>
+            <td class="even" width="50%"><input type="radio" name="addterms" value="all" /><{$lang_searchall}></td>
+          </tr>
+          <tr>
+            <td class="head" width="50%" align="right"><b><{$lang_forumc}></b>&nbsp;</td>
+            <td class="even" width="50%"><{$forum_selection_box}></td>
+          </tr>
+	  <tr>
+            <td class="head" width="50%" align="right"><b><{$lang_author}></b>&nbsp;</td>
+            <td class="even" width="50%"><input type="text" name="search_username" /></td>
+          </tr>
+          <tr>
+            <td class="head" width="50%" align="right"><b><{$lang_sortby}></b>&nbsp;</td>
+            <td class="even" width="50%"><input type="radio" name="sortby" value="p.post_time desc" checked="checked" /><{$lang_date}>&nbsp;&nbsp;<input type="radio" name="sortby" value="t.topic_title" /><{$lang_topic}>&nbsp;&nbsp;<input type="radio" name="sortby" value="f.forum_name" /><{$lang_forum}>&nbsp;&nbsp;<input type="radio" name="sortby" value="u.uname" /><{$lang_username}>&nbsp;&nbsp;</td>
+          </tr>
+          <tr>
+            <td class="head" width="50%" align="right"><b><{$lang_searchin}></b>&nbsp;</td>
+            <td class="even" width="50%"><input type="radio" name="searchboth" value="title" /><{$lang_subject}>&nbsp;&nbsp;<input type="radio" name="searchboth" value="text" checked="checked" /><{$lang_body}>&nbsp;&nbsp;<input type="radio" name="searchboth" value="both" /><{$lang_subject}> & <{$lang_body}>&nbsp;&nbsp;</td>
+          </tr>
+          <tr>
+            <td class="head" width="50%" align="right">&nbsp;</td>
+            <td class="even"><input type="submit" name="submit" value="<{$lang_search}>" /></td>
+          </tr>
+        </table>
+      </td>
+    </tr>
+  </table>
+</form>
+<!-- end module contents -->
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/templates/newbb_index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/templates/newbb_index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/templates/newbb_index.html	(revision 405)
@@ -0,0 +1,49 @@
+<!-- start module contents -->
+<table cellspacing="0" width="100%">
+  <tr>
+    <td colspan="2"><b><{$lang_welcomemsg}></b><br /><small><{$lang_tostart}></small><hr /></td>
+  </tr>
+  <tr valign="bottom">
+    <td><small><{$lang_totaltopics}><b><{$total_topics}></b> | <{$lang_totalposts}><b><{$total_posts}></b></small><br /><br /><a href="<{$xoops_url}>/modules/newbb/index.php"><{$forum_index_title}></a></td>
+    <td align="right"><small><{$lang_currenttime}><br /><{$lang_lastvisit}></small></td>
+  </tr>
+</table>
+<br />
+
+<!-- start forum categories -->
+<{section name=category loop=$categories}>
+<table cellspacing="1" class="outer">
+  <tr align="left" valign="top"><th colspan="5"> <a href="<{$xoops_url}>/modules/newbb/index.php?cat=<{$categories[category].cat_id}>" style="color:#FFFFFF"><{$categories[category].cat_title}></a></th></tr>
+  <tr class="head" align="center">
+    <td>&nbsp;</td>
+	<td nowrap="nowrap" align="left"><{$lang_forum}></td>
+	<td nowrap="nowrap"><{$lang_topics}></td>
+	<td nowrap="nowrap"><{$lang_posts}></td>
+	<td nowrap="nowrap"><{$lang_lastpost}></td>
+  </tr>
+  <!-- start forums -->
+  <{section name=forum loop=$categories[category].forums.forum_id}>
+  <tr>
+    <td class="even" align="center" valign="middle" width="5%"><img src="<{$categories[category].forums.forum_folder[forum]}>" alt="" /></td>
+    <td class="odd" onclick="window.location='<{$xoops_url}>/modules/newbb/viewforum.php?forum=<{$categories[category].forums.forum_id[forum]}>'"><a href="<{$xoops_url}>/modules/newbb/viewforum.php?forum=<{$categories[category].forums.forum_id[forum]}>"><b><{$categories[category].forums.forum_name[forum]}></b></a><br /><{$categories[category].forums.forum_desc[forum]}><br /><span style="font-size:smaller;"><b><{$lang_moderators}></b> <{$categories[category].forums.forum_moderators[forum]}></span></td>
+    <td class="even" width="5%" align="center" valign="middle"><{$categories[category].forums.forum_topics[forum]}></td>
+    <td class="odd" width="5%" align="center" valign="middle"><{$categories[category].forums.forum_posts[forum]}></td>
+    <td class="even" width="20%" align="center" valign="middle"><{$categories[category].forums.forum_lastpost_time[forum]}><br /><{$categories[category].forums.forum_lastpost_user[forum]}> <{$categories[category].forums.forum_lastpost_icon[forum]}></td>
+  </tr>
+  <{/section}>
+  <!-- end forums -->
+</table>
+<img src="images/pixel.gif" height="5" alt="" /><br />
+<{/section}>
+<!-- end forum categories -->
+
+<form name="search" action="search.php" method="post">
+  <table width="100%">
+    <tr>
+      <td valign="middle"><img src="<{$img_hotfolder}>" alt="" /> = <{$lang_newposts}><br /><img src="<{$img_folder}>" alt="" /> = <{$lang_nonewposts}><br />  <img src="<{$img_locked}>" alt="" /> = <{$lang_private}></td>
+      <td align="right" valign="bottom"><b><{$lang_search}></b>&nbsp;<input name="term" type="text" size="20" /><input type="hidden" name="forum" value="all" /><input type="hidden" name="sortby" value="p.post_time desc" /><input type="hidden" name="searchboth" value="both" /><input type="hidden" name="submit" value="<{$lang_search}>" /><br />[ <a href="<{$xoops_url}>/modules/newbb/search.php"><{$lang_advsearch}></a> ]</td>
+    </tr>
+  </table>
+</form>
+<{include file='db:system_notification_select.html'}>
+<!-- end module contents -->
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/templates/newbb_searchresults.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/templates/newbb_searchresults.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/templates/newbb_searchresults.html	(revision 405)
@@ -0,0 +1,69 @@
+<!-- start module contents -->
+<table border="0" cellpadding="5" align="center">
+  <tr>
+    <td colspan="2" align="left"><img src="<{$img_folder}>" alt="" />&nbsp;&nbsp;<a href="<{$xoops_url}>/modules/newbb/index.php"><{$lang_forumindex}></a><br />&nbsp;&nbsp;&nbsp;<img src="<{$img_folder}>" alt="" />&nbsp;&nbsp;<a href="search.php"><{$lang_search}></a><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp<img src="<{$img_folder}>" alt="" />&nbsp;&nbsp;<{$lang_searchresults}></td>
+  </tr>
+</table>
+
+<table class="outer" border="0" cellpadding="0" cellspacing="0" align="center" width="95%">
+  <tr>
+    <td>
+      <table border="0" cellpadding="4" cellspacing="1" width="100%">
+        <tr class="head" align="center">
+			<td><{$lang_forum}></td>
+			<td><{$lang_topic}></td>
+			<td><{$lang_author}></td>
+			<td><{$lang_replies}></td>
+			<td><{$lang_views}></td>
+			<td nowrap="nowrap"><{$lang_possttime}></td>
+        </tr>
+        <!-- start search results -->
+		<{section name=i loop=$results}>
+        <!-- start each result -->
+        <tr align="center">
+          <td class="even"><a href="viewforum.php?forum=<{$results[i].forum_id}>"><{$results[i].forum_name}></a></td>
+          <td class="odd"><a href="viewtopic.php?topic_id=<{$results[i].topic_id}>&amp;forum=<{$results[i].forum_id}>"><{$results[i].topic_title}></a></td>
+          <td class="even"><a href="<{$xoops_url}>/userinfo.php?uid=<{$results[i].user_id}>"><{$results[i].user_name}></a></td>
+          <td class="odd"><{$results[i].topic_replies}></td>
+          <td class="even"><{$results[i].topic_views}></td>
+          <td class="odd"><{$results[i].post_time}></td>
+        </tr>
+        <!-- end each result -->
+        <{/section}>
+        <!-- end search results -->
+      </table>
+    </td>
+  </tr>
+</table>
+<br />
+<form name="Search" action="search.php" method="post">
+  <table class="outer" border="0" cellpadding="1" cellspacing="0" align="center" width="95%">
+    <tr>
+      <td>
+        <table border="0" cellpadding="1" cellspacing="1" width="100%" class="head">
+          <tr>
+            <td class="head" width="50%" align="right"><b><{$lang_keywords}></b>&nbsp;</td>
+            <td class="even" width="50%"><input type="text" name="term" /></td>
+          </tr>
+          <tr>
+            <td class="head" width="50%">&nbsp;</td>
+            <td class="even" width="50%"><input type="radio" name="addterms" value="any" checked="checked" /><{$lang_searchany}></td>
+          </tr>
+          <tr>
+            <td class="head" width="50%">&nbsp;</td>
+            <td class="even" width="50%"><input type="radio" name="addterms" value="all" /><{$lang_searchall}></td>
+          </tr>
+          <tr>
+            <td class="head" width="50%" align="right"><b><{$lang_author}></b>&nbsp;</td>
+            <td class="even" width="50%"><input type="text" name="search_username" /></td>
+          </tr>
+          <tr>
+            <td class="head" width="50%" align="right">&nbsp;</td>
+            <td class="even"><input type="submit" name="submit" value="<{$lang_search}>" /></td>
+          </tr>
+        </table>
+      </td>
+    </tr>
+  </table>
+</form>
+<!-- end module contents -->
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/templates/newbb_thread.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/templates/newbb_thread.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/templates/newbb_thread.html	(revision 405)
@@ -0,0 +1,53 @@
+<!-- start comment post -->
+        <tr>
+          <td class="head"><a id="forumpost<{$topic_post.post_id}>"></a> <{$topic_post.poster_uname}></td>
+          <td class="head">
+          	<div class="comDate"><span class="comDateCaption"><{$lang_postedon}></span> <{$topic_post.post_date}></div>
+          	<div class="comResponse"><span class="comDateCaption"><{$lang_response}></span><{ $arrResponse[$topic_post.post_response]|default:'¡Ý¡Ý¡Ý' }></div>
+          </td>
+        </tr>
+        <tr>
+
+          <{if $topic_post.poster_uid != 0}>
+
+          <td class="odd"><div class="comUserRank"><div class="comUserRankText"><{$topic_post.poster_rank_title}></div><{$topic_post.poster_rank_image}></div><img class="comUserImg" src="<{$xoops_upload_url}>/<{$topic_post.poster_avatar}>" alt="" /><div class="comUserStat"><span class="comUserStatCaption"><{$lang_joined}>:</span> <{$topic_post.poster_regdate}></div><div class="comUserStat"><span class="comUserStatCaption"><{$lang_from}>:</span> <{$topic_post.poster_from}></div><div class="comUserStat"><span class="comUserStatCaption"><{$lang_posts}>:</span> <{$topic_post.poster_postnum}></div><div class="comUserStatus"><{$topic_post.poster_status}></div></td>
+
+          <{else}>
+
+          <td class="odd"> </td>
+
+          <{/if}>
+
+          <td class="odd">
+            <div class="comTitle"><{$topic_post.post_title}></div><div class="comText"><{$topic_post.post_text}></div>
+          </td>
+        </tr>
+        <tr>
+          <td class="even"></td>
+
+          <{if $viewer_is_admin == true}>
+
+          <td class="even" align="right">
+            <a href="edit.php?forum=<{$forum_id}>&amp;post_id=<{$topic_post.post_id}>&amp;topic_id=<{$topic_id}>&amp;viewmode=<{$topic_viewmode}>&amp;order=<{$topic_order}>"><img src="<{$xoops_url}>/images/icons/edit.gif" alt="<{$lang_edit}>" /></a><a href='delete.php?forum=<{$forum_id}>&amp;topic_id=<{$topic_id}>&amp;post_id=<{$topic_post.post_id}>&amp;viewmode=<{$topic_viewmode}>&amp;order=<{$topic_order}>'><img src="<{$xoops_url}>/images/icons/delete.gif" alt="<{$lang_delete}>" /></a><a href='reply.php?forum=<{$forum_id}>&amp;post_id=<{$topic_post.post_id}>&amp;topic_id=<{$topic_id}>&amp;viewmode=<{$topic_viewmode}>&amp;order=<{$topic_order}>'><img src="<{$xoops_url}>/images/icons/reply.gif" alt="<{$lang_reply}>" /></a>
+          </td>
+
+          <{elseif $xoops_isuser == true && $xoops_userid == $topic_post.poster_uid}>
+
+          <td class="even" align="right">
+            <a href="edit.php?forum=<{$forum_id}>&amp;post_id=<{$topic_post.post_id}>&amp;topic_id=<{$topic_id}>&amp;viewmode=<{$topic_viewmode}>&amp;order=<{$topic_order}>"><img src="<{$xoops_url}>/images/icons/edit.gif" alt="<{$lang_edit}>" /></a><a href='reply.php?forum=<{$forum_id}>&amp;post_id=<{$topic_post.post_id}>&amp;topic_id=<{$topic_id}>&amp;viewmode=<{$topic_viewmode}>&amp;order=<{$topic_order}>'><img src="<{$xoops_url}>/images/icons/reply.gif" alt="<{$lang_reply}>" /></a>
+          </td>
+
+          <{elseif $viewer_can_post == true}>
+
+          <td class="even" align="right">
+            <a href='reply.php?forum=<{$forum_id}>&amp;post_id=<{$topic_post.post_id}>&amp;topic_id=<{$topic_id}>&amp;viewmode=<{$topic_viewmode}>&amp;order=<{$topic_order}>'><img src="<{$xoops_url}>/images/icons/reply.gif" alt="<{$lang_reply}>" /></a>
+          </td>
+
+          <{else}>
+
+          <td class="even"> </td>
+
+          <{/if}>
+
+        </tr>
+<!-- end comment post -->
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/templates/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/templates/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/templates/index.html	(revision 405)
@@ -0,0 +1,1 @@
+<script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/templates/blocks/newbb_block_top.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/templates/blocks/newbb_block_top.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/templates/blocks/newbb_block_top.html	(revision 405)
@@ -0,0 +1,45 @@
+<table class="outer" cellspacing="1">
+
+  <{if $block.full_view == true}>
+
+  <tr>
+    <th><{$block.lang_forum}></th>
+    <th><{$block.lang_topic}></th>
+    <th align="center"><{$block.lang_replies}></th>
+    <th align="center"><{$block.lang_views}></th>
+    <th align="right"><{$block.lang_lastpost}></th>
+  </tr>
+
+  <{foreach item=topic from=$block.topics}>
+  <tr class="<{cycle values="even,odd"}>">
+    <td><a href="<{$xoops_url}>/modules/newbb/viewforum.php?forum=<{$topic.forum_id}>"><{$topic.forum_name}></a></td>
+    <td><a href="<{$xoops_url}>/modules/newbb/viewtopic.php?topic_id=<{$topic.id}>&amp;forum=<{$topic.forum_id}>&amp;post_id=<{$topic.post_id}>#forumpost<{$topic.post_id}>"><{$topic.title}></a></td>
+    <td align="center"><{$topic.replies}></td>
+    <td align="center"><{$topic.views}></td>
+    <td align="right"><{$topic.time}></td>
+  </tr>
+  <{/foreach}>
+
+  <{else}>
+
+  <tr>
+    <td class="head"><{$block.lang_topic}></td>
+    <td class="head" align="center"><{$block.lang_replies}></td>
+    <td class="head" align="right"><{$block.lang_lastpost}></td>
+  </tr>
+
+  <{foreach item=topic from=$block.topics}>
+  <tr class="<{cycle values="even,odd"}>">
+    <td><a href="<{$xoops_url}>/modules/newbb/viewtopic.php?topic_id=<{$topic.id}>&amp;forum=<{$topic.forum_id}>"><{$topic.title}></a></td>
+    <td align="center"><{$topic.views}></td>
+    <td align="right"><{$topic.time}></td>
+  </tr>
+  <{/foreach}>
+
+  <{/if}>
+
+</table>
+
+<div style="text-align:right; padding: 5px;">
+<a href="<{$xoops_url}>/modules/newbb/"><{$block.lang_visitforums}></a>
+</div>
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/templates/blocks/newbb_block_prv.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/templates/blocks/newbb_block_prv.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/templates/blocks/newbb_block_prv.html	(revision 405)
@@ -0,0 +1,44 @@
+<table class="outer" cellspacing="1">
+
+  <{if $block.full_view == true}>
+  <tr>
+    <th><{$block.lang_forum}></th>
+    <th><{$block.lang_topic}></th>
+    <th align="center"><{$block.lang_replies}></th>
+    <th align="center"><{$block.lang_views}></th>
+    <th align="right"><{$block.lang_lastpost}></th>
+  </tr>
+
+  <{foreach item=topic from=$block.topics}>
+  <tr class="<{cycle values="even,odd"}>">
+    <td><a href="<{$xoops_url}>/modules/newbb/viewforum.php?forum=<{$topic.forum_id}>"><{$topic.forum_name}></a></td>
+    <td><a href="<{$xoops_url}>/modules/newbb/viewtopic.php?topic_id=<{$topic.id}>&amp;forum=<{$topic.forum_id}>&amp;post_id=<{$topic.post_id}>#forumpost<{$topic.post_id}>"><{$topic.title}></a></td>
+    <td align="center"><{$topic.replies}></td>
+    <td align="center"><{$topic.views}></td>
+    <td align="right"><{$topic.time}></td>
+  </tr>
+  <{/foreach}>
+
+  <{else}>
+
+  <tr>
+    <td class="head"><{$block.lang_topic}></td>
+    <td class="head" align="center"><{$block.lang_replies}></td>
+    <td class="head" align="right"><{$block.lang_lastpost}></td>
+  </tr>
+
+  <{foreach item=topic from=$block.topics}>
+  <tr class="<{cycle values="even,odd"}>">
+    <td><a href="<{$xoops_url}>/modules/newbb/viewtopic.php?topic_id=<{$topic.id}>&amp;forum=<{$topic.forum_id}>"><{$topic.title}></a></td>
+    <td align="center"><{$topic.replies}></td>
+    <td align="right"><{$topic.time}></td>
+  </tr>
+  <{/foreach}>
+
+  <{/if}>
+
+</table>
+
+<div style="text-align:right; padding: 5px;">
+<a href="<{$xoops_url}>/modules/newbb/"><{$block.lang_visitforums}></a>
+</div>
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/templates/blocks/newbb_block_new.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/templates/blocks/newbb_block_new.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/templates/blocks/newbb_block_new.html	(revision 405)
@@ -0,0 +1,44 @@
+<table class="outer" cellspacing="1">
+
+  <{if $block.full_view == true}>
+  <tr>
+    <th><{$block.lang_forum}></th>
+    <th><{$block.lang_topic}></th>
+    <th align="center"><{$block.lang_replies}></th>
+    <th align="center"><{$block.lang_views}></th>
+    <th align="right"><{$block.lang_lastpost}></th>
+  </tr>
+
+  <{foreach item=topic from=$block.topics}>
+  <tr class="<{cycle values="even,odd"}>">
+    <td><a href="<{$xoops_url}>/modules/newbb/viewforum.php?forum=<{$topic.forum_id}>"><{$topic.forum_name}></a></td>
+    <td><a href="<{$xoops_url}>/modules/newbb/viewtopic.php?topic_id=<{$topic.id}>&amp;forum=<{$topic.forum_id}>&amp;post_id=<{$topic.post_id}>#forumpost<{$topic.post_id}>"><{$topic.title}></a></td>
+    <td align="center"><{$topic.replies}></td>
+    <td align="center"><{$topic.views}></td>
+    <td align="right"><{$topic.time}></td>
+  </tr>
+  <{/foreach}>
+
+  <{else}>
+
+  <tr>
+    <td class="head"><{$block.lang_topic}></td>
+    <td class="head" align="center"><{$block.lang_replies}></td>
+    <td class="head" align="right"><{$block.lang_lastpost}></td>
+  </tr>
+
+  <{foreach item=topic from=$block.topics}>
+  <tr class="<{cycle values="even,odd"}>">
+    <td><a href="<{$xoops_url}>/modules/newbb/viewtopic.php?topic_id=<{$topic.id}>&amp;forum=<{$topic.forum_id}>"><{$topic.title}></a></td>
+    <td align="center"><{$topic.replies}></td>
+    <td align="right"><{$topic.time}></td>
+  </tr>
+  <{/foreach}>
+
+  <{/if}>
+
+</table>
+
+<div style="text-align:right; padding: 5px;">
+<a href="<{$xoops_url}>/modules/newbb/"><{$block.lang_visitforums}></a>
+</div>
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/templates/blocks/newbb_block_active.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/templates/blocks/newbb_block_active.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/templates/blocks/newbb_block_active.html	(revision 405)
@@ -0,0 +1,44 @@
+<table class="outer" cellspacing="1">
+
+  <{if $block.full_view == true}>
+  <tr>
+    <th><{$block.lang_forum}></th>
+    <th><{$block.lang_topic}></th>
+    <th align="center"><{$block.lang_replies}></th>
+    <th align="center"><{$block.lang_views}></th>
+    <th align="right"><{$block.lang_lastpost}></th>
+  </tr>
+
+  <{foreach item=topic from=$block.topics}>
+  <tr class="<{cycle values="even,odd"}>">
+    <td><a href="<{$xoops_url}>/modules/newbb/viewforum.php?forum=<{$topic.forum_id}>"><{$topic.forum_name}></a></td>
+    <td><a href="<{$xoops_url}>/modules/newbb/viewtopic.php?topic_id=<{$topic.id}>&amp;forum=<{$topic.forum_id}>&amp;post_id=<{$topic.post_id}>#forumpost<{$topic.post_id}>"><{$topic.title}></a></td>
+    <td align="center"><{$topic.replies}></td>
+    <td align="center"><{$topic.views}></td>
+    <td align="right"><{$topic.time}></td>
+  </tr>
+  <{/foreach}>
+
+  <{else}>
+
+  <tr>
+    <td class="head"><{$block.lang_topic}></td>
+    <td class="head" align="center"><{$block.lang_replies}></td>
+    <td class="head" align="right"><{$block.lang_lastpost}></td>
+  </tr>
+
+  <{foreach item=topic from=$block.topics}>
+  <tr class="<{cycle values="even,odd"}>">
+    <td><a href="<{$xoops_url}>/modules/newbb/viewtopic.php?topic_id=<{$topic.id}>&amp;forum=<{$topic.forum_id}>"><{$topic.title}></a></td>
+    <td align="center"><{$topic.replies}></td>
+    <td align="right"><{$topic.time}></td>
+  </tr>
+  <{/foreach}>
+
+  <{/if}>
+
+</table>
+
+<div style="text-align:right; padding: 5px;">
+<a href="<{$xoops_url}>/modules/newbb/"><{$block.lang_visitforums}></a>
+</div>
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/templates/blocks/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/templates/blocks/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/templates/blocks/index.html	(revision 405)
@@ -0,0 +1,1 @@
+<script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/sql/mysql.sql
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/sql/mysql.sql	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/sql/mysql.sql	(revision 405)
@@ -0,0 +1,130 @@
+# phpMyAdmin MySQL-Dump
+# version 2.2.2
+# http://phpwizard.net/phpMyAdmin/
+# http://phpmyadmin.sourceforge.net/ (download page)
+#
+# --------------------------------------------------------
+
+#
+# Table structure for table `bb_categories`
+#
+
+CREATE TABLE bb_categories (
+  cat_id smallint(3) unsigned NOT NULL auto_increment,
+  cat_title varchar(100) NOT NULL default '',
+  cat_order varchar(10) default NULL,
+  PRIMARY KEY  (cat_id)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `bb_forum_access`
+#
+
+CREATE TABLE bb_forum_access (
+  forum_id int(4) unsigned NOT NULL default '0',
+  user_id int(5) unsigned NOT NULL default '0',
+  can_post tinyint(1) NOT NULL default '0',
+  PRIMARY KEY  (forum_id,user_id)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `bb_forum_mods`
+#
+
+CREATE TABLE bb_forum_mods (
+  forum_id int(4) unsigned NOT NULL default '0',
+  user_id int(5) unsigned NOT NULL default '0',
+  KEY forum_user_id (forum_id,user_id)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `bb_forums`
+#
+
+CREATE TABLE bb_forums (
+  forum_id int(4) unsigned NOT NULL auto_increment,
+  forum_name varchar(150) NOT NULL default '',
+  forum_desc text,
+  forum_access tinyint(2) NOT NULL default '1',
+  forum_moderator int(2) default NULL,
+  forum_topics int(8) NOT NULL default '0',
+  forum_posts int(8) NOT NULL default '0',
+  forum_last_post_id int(5) unsigned NOT NULL default '0',
+  cat_id int(2) NOT NULL default '0',
+  forum_type int(10) default '0',
+  allow_html ENUM('0','1') DEFAULT '0' NOT NULL,
+  allow_sig ENUM('0','1') DEFAULT '0' NOT NULL,
+  posts_per_page TINYINT(3) UNSIGNED DEFAULT '20' NOT NULL,
+  hot_threshold TINYINT(3) UNSIGNED DEFAULT '10' NOT NULL,
+  topics_per_page TINYINT(3) UNSIGNED DEFAULT '20' NOT NULL,
+  PRIMARY KEY  (forum_id),
+  KEY forum_last_post_id (forum_last_post_id),
+  KEY cat_id (cat_id)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `bb_posts`
+#
+
+CREATE TABLE bb_posts (
+  post_id int(8) unsigned NOT NULL auto_increment,
+  pid int(8) NOT NULL default '0',
+  topic_id int(8) NOT NULL default '0',
+  forum_id int(4) NOT NULL default '0',
+  post_time int(10) NOT NULL default '0',
+  uid int(5) unsigned NOT NULL default '0',
+  poster_ip varchar(15) NOT NULL default '',
+  subject varchar(255) NOT NULL default '',
+  nohtml tinyint(1) NOT NULL default '0',
+  nosmiley tinyint(1) NOT NULL default '0',
+  icon varchar(25) NOT NULL default '',
+  attachsig tinyint(1) NOT NULL default '0',
+  PRIMARY KEY  (post_id),
+  KEY uid (uid),
+  KEY pid (pid),
+  KEY subject (subject(40)),
+  KEY forumid_uid (forum_id, uid),
+  KEY topicid_uid (topic_id, uid),
+  KEY topicid_postid_pid (topic_id, post_id, pid),
+  FULLTEXT KEY search (subject)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `bb_posts_text`
+#
+
+CREATE TABLE bb_posts_text (
+  post_id int(8) unsigned NOT NULL auto_increment,
+  post_text text,
+  PRIMARY KEY  (post_id),
+  FULLTEXT KEY search (post_text)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `bb_topics`
+#
+
+CREATE TABLE bb_topics (
+  topic_id int(8) unsigned NOT NULL auto_increment,
+  topic_title varchar(255) default NULL,
+  topic_poster int(5) NOT NULL default '0',
+  topic_time int(10) NOT NULL default '0',
+  topic_views int(5) NOT NULL default '0',
+  topic_replies int(4) NOT NULL default '0',
+  topic_last_post_id int(8) unsigned NOT NULL default '0',
+  forum_id int(4) NOT NULL default '0',
+  topic_status tinyint(1) NOT NULL default '0',
+  topic_sticky tinyint(1) NOT NULL default '0',
+  PRIMARY KEY  (topic_id),
+  KEY forum_id (forum_id),
+  KEY topic_last_post_id (topic_last_post_id),
+  KEY topic_poster (topic_poster),
+  KEY topic_forum (topic_id,forum_id),
+  KEY topic_sticky (topic_sticky)
+) TYPE=MyISAM;
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/sql/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/sql/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/sql/index.html	(revision 405)
@@ -0,0 +1,1 @@
+<script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/topicmanager.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/topicmanager.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/topicmanager.php	(revision 405)
@@ -0,0 +1,236 @@
+<?php
+/***************************************************************************
+                            topicmanager.php  -  description
+                             -------------------
+    begin                : Sat June 17 2000
+    copyright            : (C) 2001 The phpBB Group
+    email                : support@phpbb.com
+
+    $Id: topicmanager.php,v 1.3 2005/09/04 20:46:10 onokazu 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.
+ *
+ ***************************************************************************/
+include "header.php";
+if ( $_POST['submit'] ) {
+	foreach (array('forum', 'topic_id', 'newforum') as $getint) {
+	    ${$getint} = isset($_POST[$getint]) ? intval($_POST[$getint]) : 0;
+    }
+} else {
+	foreach (array('forum', 'topic_id') as $getint) {
+		${$getint} = isset($_GET[$getint]) ? intval($_GET[$getint]) : 0;
+	}
+}
+$accesserror = 0;
+if ( $xoopsUser ) {
+	if ( !$xoopsUser->isAdmin($xoopsModule->mid()) ) {
+		if ( !is_moderator($forum, $xoopsUser->uid()) ) {
+			$accesserror = 1;
+		}
+	}
+} else {
+	$accesserror = 1;
+}
+if ( $accesserror == 1 ) {
+	redirect_header("viewtopic.php?topic_id=$topic_id&amp;post_id=$post_id&amp;order=$order&amp;viewmode=$viewmode&amp;pid=$pid&amp;forum=$forum",3,_MD_YANTMOTFTYCPTF);
+	exit();
+}
+
+include XOOPS_ROOT_PATH.'/header.php';
+OpenTable();
+if ( $_POST['submit'] ) {
+	switch ($_POST['mode']) {
+	case 'del':
+		// Update the users's post count, this might be slow on big topics but it makes other parts of the
+	    // forum faster so we win out in the long run.
+		$sql = "SELECT uid, post_id FROM ".$xoopsDB->prefix("bb_posts")." WHERE topic_id = $topic_id";
+		if ( !$r = $xoopsDB->query($sql) ) {
+			exit(_MD_COULDNOTQUERY);
+		}
+		while ( $row = $xoopsDB->fetchArray($r) ) {
+			if ( $row['uid'] != 0 ) {
+				$sql = sprintf("UPDATE %s SET posts = posts - 1 WHERE uid = %u", $xoopsDB->prefix("users"), $row['uid']);
+	    		$xoopsDB->query($sql);
+	 		}
+		}
+
+		// Get the post ID's we have to remove.
+		$sql = "SELECT post_id FROM ".$xoopsDB->prefix("bb_posts")." WHERE topic_id = $topic_id";
+		if ( !$r = $xoopsDB->query($sql) ) {
+			exit(_MD_COULDNOTQUERY);
+		}
+		while ( $row = $xoopsDB->fetchArray($r) ) {
+			$posts_to_remove[] = $row['post_id'];
+		}
+		
+		$sql = sprintf("DELETE FROM %s WHERE topic_id = %u", $xoopsDB->prefix("bb_posts"), $topic_id);
+		if ( !$result = $xoopsDB->query($sql) ) {
+			exit(_MD_COULDNOTREMOVE);
+		}
+		$sql= sprintf("DELETE FROM %s WHERE topic_id = %u", $xoopsDB->prefix("bb_topics"), $topic_id);
+		if ( !$result = $xoopsDB->query($sql) ) {
+			exit(_MD_COULDNOTQUERY);
+		}
+
+		$sql = "DELETE FROM ".$xoopsDB->prefix("bb_posts_text")." WHERE ";
+		for ( $x = 0; $x < count($posts_to_remove); $x++ ) {
+			if ( $set ) {
+				$sql .= " OR ";
+			}
+			$sql .= "post_id = ".$posts_to_remove[$x];
+			$set = true;
+		}
+
+		if ( !$xoopsDB->query($sql) ) {
+			exit(_MD_COULDNOTREMOVETXT);
+		}
+		sync($forum, 'forum');
+		// RMV-NOTIFY
+		xoops_notification_deletebyitem ($xoopsModule->getVar('mid'), 'thread', $topic_id);
+		echo _MD_TTHBRFTD."<p><a href='viewforum.php?forum=$forum'>"._MD_RETURNTOTHEFORUM."</a></p><p><a href='index.php'>"._MD_RTTFI."</a></p>";
+		break;
+	case 'move':
+		if ($newforum > 0) {
+			$sql = sprintf("UPDATE %s SET forum_id = %u WHERE topic_id = %u", $xoopsDB->prefix("bb_topics"), $newforum, $topic_id);
+	    	if ( !$r = $xoopsDB->query($sql) ) {
+				exit(_MD_EPGBATA);
+			}
+			$sql = sprintf("UPDATE %s SET forum_id = %u WHERE topic_id = %u", $xoopsDB->prefix("bb_posts"), $newforum, $topic_id);
+			if ( !$r = $xoopsDB->query($sql) ) {
+				exit(_MD_EPGBATA);
+			}
+			sync($newforum, 'forum');
+			sync($forum, 'forum');
+		}
+		echo _MD_TTHBM."<p><a href='viewtopic.php?topic_id=$topic_id&amp;forum=$newforum'>"._MD_VTUT."</a></p><p><a href='index.php'>"._MD_RTTFI."</a></p>";
+		break;
+	case 'lock':
+		$sql = sprintf("UPDATE %s SET topic_status = 1 WHERE topic_id = %u", $xoopsDB->prefix("bb_topics"), $topic_id);
+	    if ( !$r = $xoopsDB->query($sql) ) {
+			exit(_MD_EPGBATA);
+		}
+		echo _MD_TTHBL."<p><a href='viewtopic.php?topic_id=$topic_id&amp;forum=$forum'>"._MD_VIEWTHETOPIC."</a></p><p><a href='index.php'>"._MD_RTTFI."</a></p>";
+		break;
+	case 'unlock':
+		$sql = sprintf("UPDATE %s SET topic_status = 0 WHERE topic_id = %u", $xoopsDB->prefix("bb_topics"), $topic_id);
+	    if ( !$r = $xoopsDB->query($sql) ) {
+			exit("Error - Could not unlock the selected topic. Please go back and try again.");
+		}
+		echo _MD_TTHBU."<p><a href='viewtopic.php?topic_id=$topic_id&amp;forum=$forum'>"._MD_VIEWTHETOPIC."</a></p><p><a href='index.php'>"._MD_RTTFI."</a></p>";
+		break;
+	case 'sticky':
+		$sql = sprintf("UPDATE %s SET topic_sticky = 1 WHERE topic_id = %u", $xoopsDB->prefix("bb_topics"), $topic_id);
+	    if ( !$r = $xoopsDB->query($sql) ) {
+			exit("Error - Could not sticky the selected topic. Please go back and try again.");
+		}
+		echo _MD_TTHBS."<p><a href='viewtopic.php?topic_id=$topic_id&amp;forum=$forum'>"._MD_VIEWTHETOPIC."</a></p><p><a href='index.php'>"._MD_RTTFI."</a></p>";
+		break;
+	case 'unsticky':
+		$sql = sprintf("UPDATE %s SET topic_sticky = 0 WHERE topic_id = %u", $xoopsDB->prefix("bb_topics"), $topic_id);
+	    if ( !$r = $xoopsDB->query($sql) ) {
+			exit("Error - Could not unsticky the selected topic. Please go back and try again.");
+		}
+		echo _MD_TTHBUS."<p><a href='viewtopic.php?topic_id=$topic_id&amp;forum=$forum'>"._MD_VIEWTHETOPIC."</a></p><p><a href='index.php'>"._MD_RTTFI."</a></p>";
+		break;
+	}
+} else {  // No submit
+	$mode = $_GET['mode'];
+    echo "<form action='".xoops_getenv('PHP_SELF')."' method='post'>
+	<table border='0' cellpadding='1' cellspacing='0' align='center' width='95%'><tr><td class='bg2'>
+	<table border='0' cellpadding='1' cellspacing='1' width='100%'>
+	<tr class='bg3' align='left'>";
+	switch ( $mode ) {
+	case 'del':
+		echo '<td colspan="2">'. _MD_OYPTDBATBOTFTTY .'</td>';
+		break;
+	case 'move':
+		echo '<td colspan="2">'._MD_OYPTMBATBOTFTTY.'</td>';
+		break;
+	case 'lock':
+		echo '<td colspan="2">'._MD_OYPTLBATBOTFTTY.'</td>';
+		break;
+	case 'unlock':
+		echo '<td colspan="2">'._MD_OYPTUBATBOTFTTY.'</td>';
+		break;
+	case 'sticky':
+		echo '<td colspan="2">'._MD_OYPTSBATBOTFTTY.'</td>';
+		break;
+	case 'unsticky':
+		echo '<td colspan="2">'._MD_OYPTTBATBOTFTTY.'</td>';
+		break;
+	}
+	echo '</tr>';
+
+	if ( $mode == 'move' ) {
+		echo '<tr>
+		<td class="bg3">'._MD_MOVETOPICTO.'</td>
+		<td class="bg1"><select name="newforum" size="0">';
+		$sql = "SELECT forum_id, forum_name FROM ".$xoopsDB->prefix("bb_forums")." WHERE forum_id != $forum ORDER BY forum_id";
+		if ( $result = $xoopsDB->query($sql) ) {
+			if ( $myrow = $xoopsDB->fetchArray($result) ) {
+				do {
+					echo "<option value='".$myrow['forum_id']."'>".$myrow['forum_name']."</option>\n";
+				} while ( $myrow = $xoopsDB->fetchArray($result) );
+			} else {
+				echo "<option value='-1'>"._MD_NOFORUMINDB."</option>\n";
+			}
+		} else {
+			echo "<option value='-1'>"._MD_DATABASEERROR."</option>\n";
+		}
+		echo '</select></td></tr>';
+	}
+	echo '<tr class="bg3">
+	<td colspan="2" align="center">';
+
+	switch ( $mode ) {
+	case 'del':
+		echo '<input type="hidden" name="mode" value="del" />
+		<input type="hidden" name="topic_id" value="'.$topic_id.'" />
+		<input type="hidden" name="forum" value="'.$forum.'" />
+		<input type="submit" name="submit" value="'._MD_DELTOPIC.'" />';
+		break;
+	case 'move':
+		echo '<input type="hidden" name="mode" value="move" />
+		<input type="hidden" name="topic_id" value="'.$topic_id.'" />
+		<input type="hidden" name="forum" value="'.$forum.'" />
+		<input type="submit" name="submit" value="'._MD_MOVETOPIC.'" />';
+		break;
+	case 'lock':
+		echo '<input type="hidden" name="mode" value="lock" />
+		<input type="hidden" name="topic_id" value="'.$topic_id.'" />
+		<input type="hidden" name="forum" value="'.$forum.'" />
+		<input type="submit" name="submit" value="'._MD_LOCKTOPIC.'" />';
+		break;
+	case 'unlock':
+		echo '<input type="hidden" name="mode" value="unlock" />
+		<input type="hidden" name="topic_id" value="'.$topic_id.'" />
+		<input type="hidden" name="forum" value="'.$forum.'" />
+		<input type="submit" name="submit" value="'._MD_UNLOCKTOPIC.'" />';
+		break;
+	case 'sticky':
+		echo "<input type='hidden' name='mode' value='sticky' />
+		<input type='hidden' name='topic_id' value='$topic_id' />
+		<input type='hidden' name='forum' value='$forum' />
+		<input type='submit' name='submit' value='"._MD_STICKYTOPIC."' />";
+		break;
+	case 'unsticky':
+		echo "<input type='hidden' name='mode' value='unsticky' />
+		<input type='hidden' name='topic_id' value='$topic_id' />
+		<input type='hidden' name='forum' value='$forum' />
+		<input type='submit' name='submit' value='". _MD_UNSTICKYTOPIC."' />";
+		break;
+	}
+	echo '</td></tr>
+	</form>
+	</table></td></tr></table>';
+}
+CloseTable();
+include XOOPS_ROOT_PATH.'/footer.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/viewtopic.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/viewtopic.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/viewtopic.php	(revision 405)
@@ -0,0 +1,368 @@
+<?php
+// $Id: viewtopic.php,v 1.6 2006/05/01 02:37:28 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+include 'header.php';
+$forum = isset($_GET['forum']) ? intval($_GET['forum']) : 0;
+$topic_id = isset($_GET['topic_id']) ? intval($_GET['topic_id']) : 0;
+if ( empty($forum) ) {
+    redirect_header(XOOPS_URL."/modules/".$xoopsModule->getVar('dirname')."/index.php",2,_MD_ERRORFORUM);
+    exit();
+} elseif ( empty($topic_id) ) {
+    redirect_header('viewforum.php?forum='.$forum,2,_MD_ERRORTOPIC);
+    exit();
+}
+$topic_time = (isset($_GET['topic_time'])) ? intval($_GET['topic_time']) : 0;
+$post_id = !empty($_GET['post_id']) ? intval($_GET['post_id']) : 0;
+
+//use users preferences
+if (is_object($xoopsUser)) {
+    $viewmode = $xoopsUser->getVar('umode');
+    $order = ($xoopsUser->getVar('uorder') == 1) ? 'DESC' : 'ASC';
+} else {
+    $viewmode = 'flat';
+    $order = 'ASC';
+}
+
+// newbb does not have nested mode
+if ($viewmode == 'nest') {
+    $viewmode = 'thread';
+}
+
+// override mode/order if any requested
+if (isset($_GET['viewmode']) && ($_GET['viewmode'] == 'flat' || $_GET['viewmode'] == 'thread')) {
+    $viewmode = $_GET['viewmode'];
+}
+if (isset($_GET['order']) && ($_GET['order'] == 'ASC' || $_GET['order'] == 'DESC')) {
+    $order = $_GET['order'];
+}
+
+if ($viewmode != 'flat') {
+    $xoopsOption['template_main'] =  'newbb_viewtopic_thread.html';
+} else {
+    $xoopsOption['template_main'] =  'newbb_viewtopic_flat.html';
+}
+
+include XOOPS_ROOT_PATH.'/header.php';
+include_once 'class/class.forumposts.php';
+
+if ( isset($_GET['move']) && 'next' == $_GET['move'] ) {
+    $sql = 'SELECT p.response, t.topic_id, t.topic_title, t.topic_time, t.topic_status, t.topic_sticky, t.topic_last_post_id, f.forum_id, f.forum_name, f.forum_access, f.forum_type, f.allow_html, f.allow_sig, f.posts_per_page, f.hot_threshold, f.topics_per_page FROM '.$xoopsDB->prefix('bb_topics').' t LEFT JOIN '.$xoopsDB->prefix('bb_forums').' f ON f.forum_id = t.forum_id WHERE t.topic_time > '.$topic_time.' AND t.forum_id = '.$forum.' ORDER BY t.topic_time ASC LIMIT 1';
+} elseif ( isset($_GET['move']) && 'prev' == $_GET['move']) {
+    $sql = 'SELECT p.response, t.topic_id, t.topic_title, t.topic_time, t.topic_status, t.topic_sticky, t.topic_last_post_id, f.forum_id, f.forum_name, f.forum_access, f.forum_type, f.allow_html, f.allow_sig, f.posts_per_page, f.hot_threshold, f.topics_per_page FROM '.$xoopsDB->prefix('bb_topics').' t LEFT JOIN '.$xoopsDB->prefix('bb_forums').' f ON f.forum_id = t.forum_id WHERE t.topic_time < '.$topic_time.' AND t.forum_id = '.$forum.' ORDER BY t.topic_time DESC LIMIT 1';
+} else {
+    $sql = 'SELECT p.response, t.topic_id, p.post_id, p.forum_id, t.topic_title, t.topic_time, t.topic_status, t.topic_sticky, t.topic_last_post_id, f.forum_id, f.forum_name, f.forum_access, f.forum_type, f.allow_html, f.allow_sig, f.posts_per_page, f.hot_threshold, f.topics_per_page FROM '.$xoopsDB->prefix('bb_topics').' t LEFT JOIN '.$xoopsDB->prefix('bb_posts').' p ON p.post_id = t.topic_last_post_id LEFT JOIN '.$xoopsDB->prefix('bb_forums').' f ON f.forum_id = t.forum_id WHERE t.topic_id = '.$topic_id.' AND t.forum_id = '.$forum;
+}
+
+if ( !$result = $xoopsDB->query($sql) ) {
+    redirect_header('viewforum.php?forum='.$forum,2,_MD_ERROROCCURED);
+    exit();
+}
+
+if ( !$forumdata = $xoopsDB->fetchArray($result) ) {
+    redirect_header('viewforum.php?forum='.$forum,2,_MD_FORUMNOEXIST);
+    exit();
+}
+$xoopsTpl->assign('topic_id', $forumdata['topic_id']);
+$topic_id = $forumdata['topic_id'];
+$xoopsTpl->assign('forum_id', $forumdata['forum_id']);
+$forum = $forumdata['forum_id'];
+$can_post = 0;
+$show_reg = 0;
+if ( $forumdata['forum_type'] == 1 ) {
+    // this is a private forum.
+    $accesserror = 0;
+    if ( $xoopsUser ) {
+        if ( !$xoopsUser->isAdmin($xoopsModule->mid()) ) {
+            if ( !check_priv_forum_auth($xoopsUser->getVar('uid'), $forum, false) ) {
+                $accesserror = 1;
+            }
+        } else {
+            $isadminormod = 1;
+        }
+    } else {
+        $accesserror = 1;
+    }
+    if ( $accesserror == 1 ) {
+        redirect_header(XOOPS_URL."/modules/".$xoopsModule->getVar('dirname')."/index.php",2,_MD_NORIGHTTOACCESS);
+        exit();
+    }
+    $can_post = 1;
+    $show_reg = 1;
+} else {
+    // this is not a priv forum
+    if ( $forumdata['forum_access'] == 1 ) {
+        // this is a reg user only forum
+        if ( $xoopsUser ) {
+            $can_post = 1;
+        } else {
+            $show_reg = 1;
+        }
+    } elseif ( $forumdata['forum_access'] == 2 ) {
+        // this is an open forum
+        $can_post = 1;
+    } else {
+        // this is an admin/moderator only forum
+        if ( $xoopsUser ) {
+            if ( $xoopsUser->isAdmin($xoopsModule->mid()) || is_moderator($forum, $xoopsUser->getVar('uid')) ) {
+                $can_post = 1;
+                $isadminormod = 1;
+            }
+        }
+    }
+}
+include_once 'class/class.util.php';
+$fix = getFixName($forum);
+$myts =& MyTextSanitizer::getInstance();
+$forumdata['topic_title'] = $myts->makeTboxData4Show($forumdata['topic_title']);$forumdata['forum_name'] = $myts->makeTboxData4Show($forumdata['forum_name']);
+$xoopsTpl->assign(array('fix'=>$fix,'topic_title' => '<a href="'.$bbUrl['root'].'viewtopic.php?viewmode='.$viewmode.'&amp;topic_id='.$topic_id.'&amp;forum='.$forum.'">'.$forumdata['topic_title'].'</a>', 'forum_name' => $forumdata['forum_name'], 'topic_time' => $forumdata['topic_time'], 'lang_nexttopic' => _MD_NEXTTOPIC, 'lang_prevtopic' => _MD_PREVTOPIC));
+
+// add image links to admin page if the user viewing this page is a forum admin
+if ( $xoopsUser ) {
+    $xoopsTpl->assign('viewer_userid', $xoopsUser->getVar('uid'));
+    if ( !empty($isadminormod) || $xoopsUser->isAdmin($xoopsModule->mid()) || is_moderator( $forum, $xoopsUser->getVar('uid')) ) {
+        // yup, the user is admin
+        // the forum is locked?
+        if ( $forumdata['topic_status'] != 1 ) {
+            // nope
+            $xoopsTpl->assign('topic_lock_image', '<a href="'.$bbUrl['root'].'topicmanager.php?mode=lock&amp;topic_id='.$topic_id.'&amp;forum='.$forum.'"><img src="'.$bbImage['locktopic'].'" alt="'._MD_LOCKTOPIC.'" /></a>');
+        } else {
+            // yup, it is..
+            $xoopsTpl->assign('topic_lock_image', '<a href="'.$bbUrl['root'].'topicmanager.php?mode=unlock&amp;topic_id='.$topic_id.'&amp;forum='.$forum.'"><img src="'.$bbImage['unlocktopic'].'" alt="'._MD_UNLOCKTOPIC.'" /></a>');
+        }
+        $xoopsTpl->assign('topic_move_image', '<a href="'.$bbUrl['root'].'topicmanager.php?mode=move&amp;topic_id='.$topic_id.'&amp;forum='.$forum.'"><img src="'.$bbImage['movetopic'].'" alt="'._MD_MOVETOPIC.'" /></a>');
+        $xoopsTpl->assign('topic_delete_image', '<a href="'.$bbUrl['root'].'topicmanager.php?mode=del&amp;topic_id='.$topic_id.'&amp;forum='.$forum.'"><img src="'.$bbImage['deltopic'].'" alt="'._MD_DELETETOPIC.'" /></a>');
+        // is the topic sticky?
+        if ( $forumdata['topic_sticky'] != 1 ) {
+            // nope, not yet..
+            $xoopsTpl->assign('topic_sticky_image', '<a href="'.$bbUrl['root'].'topicmanager.php?mode=sticky&amp;topic_id='.$topic_id.'&amp;forum='.$forum.'"><img src="'.$bbImage['sticky'].'" alt="'._MD_STICKYTOPIC.'" /></a>');
+        } else {
+            // yup it is sticking..
+            $xoopsTpl->assign('topic_sticky_image', '<a href="'.$bbUrl['root'].'topicmanager.php?mode=unsticky&amp;topic_id='.$topic_id.'&amp;forum='.$forum.'"><img src="'.$bbImage['unsticky'].'" alt="'._MD_UNSTICKYTOPIC.'" /></a>');
+        }
+        // need to set this also
+        $xoopsTpl->assign('viewer_is_admin', true);
+    } else {
+        // nope, the user is not a forum admin..
+        $xoopsTpl->assign('viewer_is_admin', false);
+    }
+} else {
+    // nope, the user is not a forum admin, not even registered
+    $xoopsTpl->assign(array('viewer_is_admin' => false, 'viewer_userid' => 0));
+}
+
+function showTree(&$arr, $current=0, $key=0, $prefix='', $foundusers=array()){
+    global $xoopsConfig;
+    if ($key != 0) {
+        if ( 0 != $arr[$key]['obj']->uid() ) {
+            if (!isset($foundusers[$arr[$key]['obj']->uid()])) {
+                $eachposter = new XoopsUser($arr[$key]['obj']->uid());
+                $foundusers[$arr[$key]['obj']->uid()] =& $eachposter;
+            } else {
+                $eachposter =& $foundusers[$arr[$key]['obj']->uid()];
+            }
+            $poster_rank = $eachposter->rank();
+            if ( $poster_rank['image'] != '' ) {
+                $poster_rank['image'] = '<img src="'.XOOPS_UPLOAD_URL.'/'.$poster_rank['image'].'" alt="" />';
+            }
+            if ( $eachposter->isActive() ) {
+                $posterarr =  array('poster_uid' => $eachposter->getVar('uid'), 'poster_uname' => '<a href="'.XOOPS_URL.'/userinfo.php?uid='.$eachposter->getVar('uid').'">'.$eachposter->getVar('uname').'</a>');
+            } else {
+                $posterarr = array('poster_uid' =>0, 'poster_uname' => $xoopsConfig['anonymous']);
+            }
+        } else {
+            $posterarr = array('poster_uid' =>0, 'poster_uname' => $xoopsConfig['anonymous']);
+        }
+        $posticon = $arr[$key]['obj']->icon();
+        if ( isset($posticon) && $posticon != '' ) {
+            $post_image = '<img src="'.XOOPS_URL.'/images/subject/'.htmlspecialchars($posticon).'" alt="" />';
+        } else {
+            $post_image =  '<img src="'.XOOPS_URL.'/images/icons/no_posticon.gif" alt="" />';
+        }
+        if ($current != $key) {
+            $subject = '<a href="viewtopic.php?viewmode=thread&amp;topic_id='.$arr[$key]['obj']->topic().'&amp;forum='.$arr[$key]['obj']->forum().'&amp;post_id='.$arr[$key]['obj']->postid().'#forumpost'.$arr[$key]['obj']->postid().'">'.$arr[$key]['obj']->subject().'</a>';
+            $GLOBALS['xoopsTpl']->append("topic_trees", array_merge($posterarr, array("post_id" => $arr[$key]['obj']->postid(), "post_parent_id" => $arr[$key]['obj']->parent(), "post_date" => formatTimestamp($arr[$key]['obj']->posttime(), "m"), "post_image" => $post_image, "post_title" => $subject, "post_prefix" => $prefix)));
+        } else {
+            $subject = '<b>'.$arr[$key]['obj']->subject().'</b>';
+            $thisprefix = substr($prefix, 0, -6)."<b>&raquo;</b>";
+            $GLOBALS['xoopsTpl']->append("topic_trees", array_merge($posterarr, array("post_id" => $arr[$key]['obj']->postid(), "post_parent_id" => $arr[$key]['obj']->parent(), "post_date" => formatTimestamp($arr[$key]['obj']->posttime(), "m"), "post_image" => $post_image, "post_title" => $subject, "post_prefix" => $thisprefix)));
+        }
+    }
+    if ( isset($arr[$key]['replies']) && !empty($arr[$key]['replies']) ){
+        $prefix .= "&nbsp;&nbsp;";
+        foreach($arr[$key]['replies'] as $replykey) {
+            $current = ( $current == 0 ) ? $replykey : $current;
+            showTree($arr, $current, $replykey, $prefix, $foundusers);
+        }
+    }
+}
+
+if ($order == 'DESC') {
+    $xoopsTpl->assign(array('order_current' => 'DESC', 'order_other' => 'ASC', 'lang_order_other' => _OLDESTFIRST));
+} else {
+    $xoopsTpl->assign(array('order_current' => 'ASC', 'order_other' => 'DESC', 'lang_order_other' => _NEWESTFIRST));
+}
+
+// initialize the start number of select query
+$start = !empty($_GET['start']) ? intval($_GET['start']) : 0;
+
+$total_posts = get_total_posts($topic_id, 'topic');
+if ($total_posts > 50) {
+    $viewmode ="flat";
+    // hide link to theaded view
+    $xoopsTpl->assign('lang_threaded', "" );
+    $xoopsTpl->assign('lang_flat', _FLAT );
+} else {
+    $xoopsTpl->assign(array('lang_threaded' => _THREADED, 'lang_flat' => _FLAT));
+}
+
+if ( $can_post == 1 ) {
+    $xoopsTpl->assign(array('viewer_can_post' => true, 'forum_post_or_register' => "<a href=\"newtopic.php?forum=".$forum."\"><img src=\"".$bbImage['post']."\" alt=\""._MD_POSTNEW."\" /></a>"));
+} else {
+    $xoopsTpl->assign('viewer_can_post', false);
+    if ( $show_reg == 1 ) {
+        $xoopsTpl->assign('forum_post_or_register', '<a href="'.XOOPS_URL.'/user.php?xoops_redirect='.htmlspecialchars($xoopsRequestUri).'">'._MD_REGTOPOST.'</a>');
+    } else {
+        $xoopsTpl->assign('forum_post_or_register', '');
+    }
+}
+
+if ( $viewmode == "thread" ) {
+    $start = 0;
+    $postsArray = ForumPosts::getAllPosts($topic_id, "ASC", $total_posts, $start);
+    $xoopsTpl->assign('topic_viewmode', 'thread');
+
+    $newObjArr = array();
+    foreach ( $postsArray as $eachpost ) {
+        $key1 = $eachpost->postid();
+        if ( (!empty($post_id) && $post_id == $key1) || ( empty($post_id) && $eachpost->parent() == 0 ) ) {
+            $post_text = $eachpost->text();
+            if ( 0 != $eachpost->uid() ) {
+                $eachposter = new XoopsUser($eachpost->uid());
+                $poster_rank = $eachposter->rank();
+                if ( $poster_rank['image'] != "" ) {
+                    $poster_rank['image'] = "<img src='".XOOPS_UPLOAD_URL."/".$poster_rank['image']."' alt='' />";
+                }
+                if ( $eachposter->isActive() ) {
+                    $poster_status = $eachposter->isOnline() ? _MD_ONLINE : '';
+                    $posterarr =  array('poster_uid' => $eachposter->getVar('uid'), 'poster_uname' => '<a href="'.XOOPS_URL.'/userinfo.php?uid='.$eachposter->getVar('uid').'">'.$eachposter->getVar('uname').'</a>', 'poster_avatar' => $eachposter->getVar('user_avatar'), 'poster_from' => $eachposter->getVar('user_from'), 'poster_regdate' => formatTimestamp($eachposter->getVar('user_regdate'), 's'), 'poster_postnum' => $eachposter->getVar('posts'), 'poster_sendpmtext' => sprintf(_SENDPMTO,$eachposter->getVar('uname')), 'poster_rank_title' => $poster_rank['title'], 'poster_rank_image' => $poster_rank['image'], 'poster_status' => $poster_status);
+                    if ( 1 == $forumdata['allow_sig'] && $eachpost->attachsig() == 1 && $eachposter->attachsig() == 1 ) {
+                        $myts =& MytextSanitizer::getInstance();
+                        $post_text .= "<p><br />----------------<br />". $myts->makeTareaData4Show($eachposter->getVar("user_sig", "N"), 0, 1, 1)."</p>";
+                    }
+                } else {
+                    $posterarr = array('poster_uid' =>0, 'poster_uname' => $xoopsConfig['anonymous'], 'poster_avatar' => '', 'poster_from' => '', 'poster_regdate' => '', 'poster_postnum' => '', 'poster_sendpmtext' => '', 'poster_rank_title' => '', 'poster_rank_image' => '');
+                }
+            } else {
+                $posterarr = array('poster_uid' =>0, 'poster_uname' => $xoopsConfig['anonymous'], 'poster_avatar' => '', 'poster_from' => '', 'poster_regdate' => '', 'poster_postnum' => '', 'poster_sendpmtext' => '', 'poster_rank_title' => '', 'poster_rank_image' => '');
+            }
+            $posticon = $eachpost->icon();
+            if ( isset($posticon) && $posticon != '' ) {
+                $post_image = '<a name="'.$eachpost->postid().'"><img src="'.XOOPS_URL.'/images/subject/'.htmlspecialchars($eachpost->icon()).'" alt="" /></a>';
+            } else {
+                $post_image =  '<a name="'.$eachpost->postid().'"><img src="'.XOOPS_URL.'/images/icons/posticon.gif" alt="" /></a>';
+            }
+            $xoopsTpl->append('topic_posts', array_merge($posterarr, array('post_response' => $eachpost->response, 'post_id' => $eachpost->postid(), 'post_parent_id' => $eachpost->parent(), 'post_date' => formatTimestamp($eachpost->posttime(), 'm'), 'post_poster_ip'=> $eachpost->posterip(), 'post_image' => $post_image, 'post_title' => $eachpost->subject(), 'post_text' => $post_text)));
+        }
+        
+        $newObjArr[$key1]['obj'] = $eachpost;
+        $key2 = $eachpost->parent();
+        $newObjArr[$key2]['replies'][] = $key1;
+        $newObjArr[$key2]['leaf'] = $key1;
+    }
+    showTree($newObjArr, $post_id);
+    $xoopsTpl->assign(array('lang_subject' => _MD_SUBJECT, 'lang_date' => _MD_DATE));
+} else {
+    $xoopsTpl->assign(array('topic_viewmode' => 'flat', 'lang_top' => _MD_TOP, 'lang_subject' => _MD_SUBJECT, 'lang_bottom' => _MD_BOTTOM));
+    $postsArray = ForumPosts::getAllPosts($topic_id, $order, $forumdata['posts_per_page'], $start, $post_id);
+    $foundusers = array();
+    foreach ( $postsArray as $eachpost ) {
+        $post_text = $eachpost->text();
+        if ( 0 != $eachpost->uid() ) {
+            if (!isset($foundusers['user'.$eachpost->uid()])) {
+                $eachposter = new XoopsUser($eachpost->uid());
+                $foundusers['user'.$eachpost->uid()] =& $eachposter;
+            } else {
+                $eachposter =& $foundusers['user'.$eachpost->uid()];
+            }
+            $poster_rank = $eachposter->rank();
+            if ( $poster_rank['image'] != '' ) {
+                $poster_rank['image'] = '<img src="'.XOOPS_UPLOAD_URL.'/'.$poster_rank['image'].'" alt="" />';
+            }
+            if ( $eachposter->isActive() ) {
+                $poster_status = $eachposter->isOnline() ? _MD_ONLINE : '';
+                $posterarr =  array('poster_uid' => $eachposter->getVar('uid'), 'poster_uname' => '<a href="'.XOOPS_URL.'/userinfo.php?uid='.$eachposter->getVar('uid').'">'.$eachposter->getVar('uname').'</a>', 'poster_avatar' => $eachposter->getVar('user_avatar'), 'poster_from' => $eachposter->getVar('user_from'), 'poster_regdate' => formatTimestamp($eachposter->getVar('user_regdate'), 's'), 'poster_postnum' => $eachposter->getVar('posts'), 'poster_sendpmtext' => sprintf(_SENDPMTO,$eachposter->getVar('uname')), 'poster_rank_title' => $poster_rank['title'], 'poster_rank_image' => $poster_rank['image'], 'poster_status' => $poster_status);
+                if ( 1 == $forumdata['allow_sig'] && $eachpost->attachsig() == 1 && $eachposter->attachsig() == 1 ) {
+                    $myts =& MytextSanitizer::getInstance();
+                    $post_text .= '<p><br />----------------<br />'. $myts->makeTareaData4Show($eachposter->getVar('user_sig', 'N'), 0, 1, 1).'</p>';
+                }
+            } else {
+                $posterarr = array('poster_uid' =>0, 'poster_uname' => $xoopsConfig['anonymous'], 'poster_avatar' => '', 'poster_from' => '', 'poster_regdate' => '', 'poster_postnum' => '', 'poster_sendpmtext' => '', 'poster_rank_title' => '', 'poster_rank_image' => '');
+            }
+        } else {
+            $posterarr = array('poster_uid' =>0, 'poster_uname' => $xoopsConfig['anonymous'], 'poster_avatar' => '', 'poster_from' => '', 'poster_regdate' => '', 'poster_postnum' => '', 'poster_sendpmtext' => '', 'poster_rank_title' => '', 'poster_rank_image' => '');
+        }
+        $posticon = $eachpost->icon();
+        if ( isset($posticon) && $posticon != '' ) {
+            $post_image = '<a name="'.$eachpost->postid().'"><img src="'.XOOPS_URL.'/images/subject/'.htmlspecialchars($eachpost->icon()).'" alt="" /></a>';
+        } else {
+            $post_image =  '<a name="'.$eachpost->postid().'"><img src="'.XOOPS_URL.'/images/icons/no_posticon.gif" alt="" /></a>';
+        }
+
+        $xoopsTpl->append('topic_posts', array_merge($posterarr, array('post_response' => $eachpost->response, 'post_id' => $eachpost->postid(), 'post_parent_id' => $eachpost->parent(), 'post_date' => formatTimestamp($eachpost->posttime(), 'm'), 'post_poster_ip'=> $eachpost->posterip(), 'post_image' => $post_image, 'post_title' => $eachpost->subject(), 'post_text' => $post_text)));
+        unset($eachposter);
+    }
+    if ( $total_posts > $forumdata['posts_per_page'] ) {
+        include XOOPS_ROOT_PATH.'/class/pagenav.php';
+        $nav = new XoopsPageNav($total_posts, $forumdata['posts_per_page'], $start, "start", 'topic_id='.$topic_id.'&amp;forum='.$forum.'&amp;viewmode='.$viewmode.'&amp;order='.$order);
+        $xoopsTpl->assign('forum_page_nav', $nav->renderNav(4));
+    } else {
+        $xoopsTpl->assign('forum_page_nav', '');
+    }
+}
+
+// Îóµ
+$xoopsTpl->assign('arrResponse', $arrResponse);
+
+// create jump box
+$xoopsTpl->assign(array('forum_jumpbox' => make_jumpbox($forum), 'lang_forum_index' => sprintf(_MD_FORUMINDEX,$xoopsConfig['sitename']), 'lang_from' => _MD_FROM, 'lang_joined' => _MD_JOINED, 'lang_posts' => _MD_POSTS, 'lang_poster' => _MD_POSTER, 'lang_thread' => _MD_THREAD, 'lang_edit' => _EDIT, 'lang_delete' => _DELETE, 'lang_reply' => _REPLY, 'lang_postedon' => _MD_POSTEDON, 'lang_response' => _MD_RESPONSE . ": "));
+
+// Read in cookie of 'lastread' times
+$topic_lastread = newbb_get_topics_viewed();
+// if cookie is not set for this topic, update view count and set cookie
+if ( empty($topic_lastread[$topic_id]) ) {
+    $sql = 'UPDATE '.$xoopsDB->prefix('bb_topics').' SET topic_views = topic_views + 1 WHERE topic_id ='. $topic_id;
+    $xoopsDB->queryF($sql);
+}
+// Update cookie
+newbb_add_topics_viewed($topic_lastread, $topic_id, time(), $bbCookie['path'], $bbCookie['domain'], $bbCookie['secure']);
+include XOOPS_ROOT_PATH.'/footer.php';
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/xoops_version.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/xoops_version.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/xoops_version.php	(revision 405)
@@ -0,0 +1,203 @@
+<?php
+// $Id: xoops_version.php,v 1.2 2005/03/18 12:52:25 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+$modversion['name'] = _MI_NEWBB_NAME;
+$modversion['version'] = 1.00;
+$modversion['description'] = _MI_NEWBB_DESC;
+$modversion['credits'] = "Kazumi Ono<br />( http://www.myweb.ne.jp/ )";
+$modversion['author'] = "Original admin section (phpBB 1.4.4) by<br />The phpBB Group<br />( http://www.phpbb.com/ )<br />";
+$modversion['help'] = "newbb.html";
+$modversion['license'] = "GPL see LICENSE";
+$modversion['official'] = 1;
+$modversion['image'] = "images/xoopsbb_slogo.png";
+$modversion['dirname'] = "newbb";
+
+// Sql file (must contain sql generated by phpMyAdmin or phpPgAdmin)
+// All tables should not have any prefix!
+$modversion['sqlfile']['mysql'] = "sql/mysql.sql";
+//$modversion['sqlfile']['postgresql'] = "sql/pgsql.sql";
+
+// Tables created by sql file (without prefix!)
+$modversion['tables'][0] = "bb_categories";
+$modversion['tables'][1] = "bb_forum_access";
+$modversion['tables'][2] = "bb_forum_mods";
+$modversion['tables'][3] = "bb_forums";
+$modversion['tables'][4] = "bb_posts";
+$modversion['tables'][5] = "bb_posts_text";
+$modversion['tables'][6] = "bb_topics";
+
+
+// Admin things
+$modversion['hasAdmin'] = 1;
+$modversion['adminindex'] = "admin/index.php";
+$modversion['adminmenu'] = "admin/menu.php";
+
+// Menu
+$modversion['hasMain'] = 1;
+
+// Templates
+$modversion['templates'][1]['file'] = 'newbb_index.html';
+$modversion['templates'][1]['description'] = '';
+$modversion['templates'][2]['file'] = 'newbb_search.html';
+$modversion['templates'][2]['description'] = '';
+$modversion['templates'][3]['file'] = 'newbb_searchresults.html';
+$modversion['templates'][3]['description'] = '';
+$modversion['templates'][4]['file'] = 'newbb_thread.html';
+$modversion['templates'][4]['description'] = '';
+$modversion['templates'][5]['file'] = 'newbb_viewforum.html';
+$modversion['templates'][5]['description'] = '';
+$modversion['templates'][6]['file'] = 'newbb_viewtopic_flat.html';
+$modversion['templates'][6]['description'] = '';
+$modversion['templates'][7]['file'] = 'newbb_viewtopic_thread.html';
+$modversion['templates'][7]['description'] = '';
+
+// Blocks
+$modversion['blocks'][1]['file'] = "newbb_new.php";
+$modversion['blocks'][1]['name'] = _MI_NEWBB_BNAME1;
+$modversion['blocks'][1]['description'] = "Shows recent topics in the forums";
+$modversion['blocks'][1]['show_func'] = "b_newbb_new_show";
+$modversion['blocks'][1]['options'] = "10|1|time";
+$modversion['blocks'][1]['edit_func'] = "b_newbb_new_edit";
+$modversion['blocks'][1]['template'] = 'newbb_block_new.html';
+
+$modversion['blocks'][2]['file'] = "newbb_new.php";
+$modversion['blocks'][2]['name'] = _MI_NEWBB_BNAME2;
+$modversion['blocks'][2]['description'] = "Shows most viewed topics in the forums";
+$modversion['blocks'][2]['show_func'] = "b_newbb_new_show";
+$modversion['blocks'][2]['options'] = "10|1|views";
+$modversion['blocks'][2]['edit_func'] = "b_newbb_new_edit";
+$modversion['blocks'][2]['template'] = 'newbb_block_top.html';
+
+$modversion['blocks'][3]['file'] = "newbb_new.php";
+$modversion['blocks'][3]['name'] = _MI_NEWBB_BNAME3;
+$modversion['blocks'][3]['description'] = "Shows most active topics in the forums";
+$modversion['blocks'][3]['show_func'] = "b_newbb_new_show";
+$modversion['blocks'][3]['options'] = "10|1|replies";
+$modversion['blocks'][3]['edit_func'] = "b_newbb_new_edit";
+$modversion['blocks'][3]['template'] = 'newbb_block_active.html';
+
+$modversion['blocks'][4]['file'] = "newbb_new.php";
+$modversion['blocks'][4]['name'] = _MI_NEWBB_BNAME4;
+$modversion['blocks'][4]['description'] = "Shows recent and private topics in the forums";
+$modversion['blocks'][4]['show_func'] = "b_newbb_new_private_show";
+$modversion['blocks'][4]['options'] = "10|1|time";
+$modversion['blocks'][4]['edit_func'] = "b_newbb_new_edit";
+$modversion['blocks'][4]['template'] = 'newbb_block_prv.html';
+
+// Search
+$modversion['hasSearch'] = 1;
+$modversion['search']['file'] = "include/search.inc.php";
+$modversion['search']['func'] = "newbb_search";
+
+// Smarty
+$modversion['use_smarty'] = 1;
+
+// Notification
+
+$modversion['hasNotification'] = 1;
+$modversion['notification']['lookup_file'] = 'include/notification.inc.php';
+$modversion['notification']['lookup_func'] = 'newbb_notify_iteminfo';
+
+$modversion['notification']['category'][1]['name'] = 'thread';
+$modversion['notification']['category'][1]['title'] = _MI_NEWBB_THREAD_NOTIFY;
+$modversion['notification']['category'][1]['description'] = _MI_NEWBB_THREAD_NOTIFYDSC;
+$modversion['notification']['category'][1]['subscribe_from'] = 'viewtopic.php';
+$modversion['notification']['category'][1]['item_name'] = 'topic_id';
+$modversion['notification']['category'][1]['allow_bookmark'] = 1;
+
+$modversion['notification']['category'][2]['name'] = 'forum';
+$modversion['notification']['category'][2]['title'] = _MI_NEWBB_FORUM_NOTIFY;
+$modversion['notification']['category'][2]['description'] = _MI_NEWBB_FORUM_NOTIFYDSC;
+$modversion['notification']['category'][2]['subscribe_from'] = array('viewtopic.php', 'viewforum.php');
+$modversion['notification']['category'][2]['item_name'] = 'forum';
+$modversion['notification']['category'][2]['allow_bookmark'] = 1;
+
+$modversion['notification']['category'][3]['name'] = 'global';
+$modversion['notification']['category'][3]['title'] = _MI_NEWBB_GLOBAL_NOTIFY;
+$modversion['notification']['category'][3]['description'] = _MI_NEWBB_GLOBAL_NOTIFYDSC;
+$modversion['notification']['category'][3]['subscribe_from'] = array('index.php', 'viewtopic.php', 'viewforum.php');
+
+$modversion['notification']['event'][1]['name'] = 'new_post';
+$modversion['notification']['event'][1]['category'] = 'thread';
+$modversion['notification']['event'][1]['title'] = _MI_NEWBB_THREAD_NEWPOST_NOTIFY;
+$modversion['notification']['event'][1]['caption'] = _MI_NEWBB_THREAD_NEWPOST_NOTIFYCAP;
+$modversion['notification']['event'][1]['description'] = _MI_NEWBB_THREAD_NEWPOST_NOTIFYDSC;
+$modversion['notification']['event'][1]['mail_template'] = 'thread_newpost_notify';
+$modversion['notification']['event'][1]['mail_subject'] = _MI_NEWBB_THREAD_NEWPOST_NOTIFYSBJ;
+
+$modversion['notification']['event'][2]['name'] = 'new_thread';
+$modversion['notification']['event'][2]['category'] = 'forum';
+$modversion['notification']['event'][2]['title'] = _MI_NEWBB_FORUM_NEWTHREAD_NOTIFY;
+$modversion['notification']['event'][2]['caption'] = _MI_NEWBB_FORUM_NEWTHREAD_NOTIFYCAP;
+$modversion['notification']['event'][2]['description'] = _MI_NEWBB_FORUM_NEWTHREAD_NOTIFYDSC;
+$modversion['notification']['event'][2]['mail_template'] = 'forum_newthread_notify';
+$modversion['notification']['event'][2]['mail_subject'] = _MI_NEWBB_FORUM_NEWTHREAD_NOTIFYSBJ;
+
+$modversion['notification']['event'][3]['name'] = 'new_forum';
+$modversion['notification']['event'][3]['category'] = 'global';
+$modversion['notification']['event'][3]['title'] = _MI_NEWBB_GLOBAL_NEWFORUM_NOTIFY;
+$modversion['notification']['event'][3]['caption'] = _MI_NEWBB_GLOBAL_NEWFORUM_NOTIFYCAP;
+$modversion['notification']['event'][3]['description'] = _MI_NEWBB_GLOBAL_NEWFORUM_NOTIFYDSC;
+$modversion['notification']['event'][3]['mail_template'] = 'global_newforum_notify';
+$modversion['notification']['event'][3]['mail_subject'] = _MI_NEWBB_GLOBAL_NEWFORUM_NOTIFYSBJ;
+
+$modversion['notification']['event'][4]['name'] = 'new_post';
+$modversion['notification']['event'][4]['category'] = 'global';
+$modversion['notification']['event'][4]['title'] = _MI_NEWBB_GLOBAL_NEWPOST_NOTIFY;
+$modversion['notification']['event'][4]['caption'] = _MI_NEWBB_GLOBAL_NEWPOST_NOTIFYCAP;
+$modversion['notification']['event'][4]['description'] = _MI_NEWBB_GLOBAL_NEWPOST_NOTIFYDSC;
+$modversion['notification']['event'][4]['mail_template'] = 'global_newpost_notify';
+$modversion['notification']['event'][4]['mail_subject'] = _MI_NEWBB_GLOBAL_NEWPOST_NOTIFYSBJ;
+
+$modversion['notification']['event'][5]['name'] = 'new_post';
+$modversion['notification']['event'][5]['category'] = 'forum';
+$modversion['notification']['event'][5]['title'] = _MI_NEWBB_FORUM_NEWPOST_NOTIFY;
+$modversion['notification']['event'][5]['caption'] = _MI_NEWBB_FORUM_NEWPOST_NOTIFYCAP;
+$modversion['notification']['event'][5]['description'] = _MI_NEWBB_FORUM_NEWPOST_NOTIFYDSC;
+$modversion['notification']['event'][5]['mail_template'] = 'forum_newpost_notify';
+$modversion['notification']['event'][5]['mail_subject'] = _MI_NEWBB_FORUM_NEWPOST_NOTIFYSBJ;
+
+$modversion['notification']['event'][6]['name'] = 'new_fullpost';
+$modversion['notification']['event'][6]['category'] = 'global';
+//$modversion['notification']['event'][6]['admin_only'] = 1;
+$modversion['notification']['event'][6]['title'] = _MI_NEWBB_GLOBAL_NEWFULLPOST_NOTIFY;
+$modversion['notification']['event'][6]['caption'] = _MI_NEWBB_GLOBAL_NEWFULLPOST_NOTIFYCAP;
+$modversion['notification']['event'][6]['description'] = _MI_NEWBB_GLOBAL_NEWFULLPOST_NOTIFYDSC;
+$modversion['notification']['event'][6]['mail_template'] = 'global_newfullpost_notify';
+$modversion['notification']['event'][6]['mail_subject'] = _MI_NEWBB_GLOBAL_NEWFULLPOST_NOTIFYSBJ;
+
+// mod uehara 2006/10/24
+/*$modversion['notification']['event'][7]['name'] = 'new_fullpost';
+$modversion['notification']['event'][7]['category'] = 'forum';
+$modversion['notification']['event'][7]['admin_only'] = 0;
+$modversion['notification']['event'][7]['title'] = _MI_XHNEWBB_FORUM_NEWFULLPOST_NOTIFY;
+$modversion['notification']['event'][7]['caption'] = _MI_XHNEWBB_FORUM_NEWFULLPOST_NOTIFYCAP;
+$modversion['notification']['event'][7]['description'] = _MI_XHNEWBB_FORUM_NEWFULLPOST_NOTIFYDSC;
+$modversion['notification']['event'][7]['mail_template'] = 'xh_forum_newfullpost_notify';
+$modversion['notification']['event'][7]['mail_subject'] = _MI_XHNEWBB_FORUM_NEWFULLPOST_NOTIFYSBJ;
+*/
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/class/class.util.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/class/class.util.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/class/class.util.php	(revision 405)
@@ -0,0 +1,54 @@
+<?php
+function getFixName($topic) {
+	$fix = "";
+	switch($topic) {
+		case '1':
+			$fix = "bug/etc";
+			break;
+		case '2':
+			$fix = "faq/etc";
+			break;
+		case '3':
+			$fix = "req/etc";
+			break;
+		case '4':
+			$fix = "etc";
+			break;
+		case '5':
+			$fix = "cus/fro";
+			break;
+		case '6':
+			$fix = "req/fro";
+			break;
+		case '7':
+			$fix = "req/adm";
+			break;
+		case '8':
+			$fix = "bug/fro";
+			break;
+		case '9':
+			$fix = "bug/adm";
+			break;
+		case '10':
+			$fix = "req/fro";
+			break;
+		case '11':
+			$fix = "req/adm";
+			break;
+		case '12':
+			$fix = "cus/adm";
+			break;
+		case '13':
+			$fix = "cus/des";
+			break;
+		case '14':
+			$fix = "cus/etc";
+			break;
+		default:
+			break;
+	}
+	
+	return $fix;
+}	
+	
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/class/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/class/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/class/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/class/class.forumposts.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/class/class.forumposts.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/class/class.forumposts.php	(revision 405)
@@ -0,0 +1,470 @@
+<?php
+// $Id: class.forumposts.php,v 1.4 2005/08/03 12:39:13 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+include_once XOOPS_ROOT_PATH."/class/xoopstree.php";
+
+class ForumPosts
+{
+    var $post_id;
+    var $topic_id;
+    var $forum_id;
+    var $post_time;
+    var $poster_ip;
+    var $order;
+    var $subject;
+    var $post_text;
+    var $pid;
+    var $nohtml = 0;
+    var $nosmiley = 0;
+    var $uid;
+    var $icon;
+    var $attachsig;
+    var $prefix;
+    var $db;
+    var $istopic = false;
+    var $islocked = false;
+    var $response;				//ÂÐ±þ¾õ¶·
+
+    function ForumPosts($id=null)
+    {
+        $this->db =& Database::getInstance();
+        if ( is_array($id) ) {
+            $this->makePost($id);
+        } elseif ( isset($id) ) {
+            $this->getPost(intval($id));
+        }
+    }
+
+    function setTopicId($value){
+        $this->topic_id = $value;
+    }
+
+    function getTopicId() {
+        return isset($this->topic_id) ? $this->topic_id : 0;
+    }
+
+    function setOrder($value){
+        $this->order = $value;
+    }
+
+    // 2004-1-12 GIJOE <gij@peak.ne.jp> Added routine to move to the correct
+    // starting position within a topic thread
+    function &getAllPosts($topic_id, $order="ASC", $perpage=0, &$start, $post_id=0){
+        $db =& Database::getInstance();
+        if( $order == "DESC" ) {
+            $operator_for_position = '>' ;
+        } else {
+            $order = "ASC" ;
+            $operator_for_position = '<' ;
+        }
+        if ($perpage <= 0) {
+             $perpage = 10;
+        }
+        if (empty($start)) {
+            $start = 0;
+        }
+        if (!empty($post_id)) {
+            $result = $db->query("SELECT COUNT(post_id) FROM ".$db->prefix('bb_posts')." WHERE topic_id=$topic_id AND post_id $operator_for_position $post_id");
+            list($position) = $db->fetchRow($result);
+            $start = intval($position / $perpage) * $perpage;
+        }
+        $sql = 'SELECT p.*, t.post_text FROM '.$db->prefix('bb_posts').' p, '.$db->prefix('bb_posts_text')." t WHERE p.topic_id=$topic_id AND p.post_id = t.post_id ORDER BY p.post_id $order";
+        $result = $db->query($sql,$perpage,$start);
+        $ret = array();
+        while ($myrow = $db->fetchArray($result)) {
+            $ret[] = new ForumPosts($myrow);
+        }
+        return $ret;
+    }
+
+    function setParent($value){
+        $this->pid=$value;
+    }
+
+    function setSubject($value){
+        $this->subject=$value;
+    }
+
+    function setText($value){
+        $this->post_text=$value;
+    }
+
+    function setUid($value){
+        $this->uid=$value;
+    }
+
+    function setForum($value){
+        $this->forum_id=$value;
+    }
+
+    function setIp($value){
+        $this->poster_ip=$value;
+    }
+
+    function setNohtml($value=0){
+        $this->nohtml=$value;
+    }
+
+    function setNosmiley($value=0){
+        $this->nosmiley=$value;
+    }
+
+    function setIcon($value){
+        $this->icon=$value;
+    }
+
+    function setAttachsig($value){
+        $this->attachsig=$value;
+    }
+    
+    // ÂÐ±þ¾õ¶·¤ò¥»¥Ã¥È
+    function setResponse($value){
+        $this->response=$value;
+    }
+
+    function store() {
+        $myts =& MyTextSanitizer::getInstance();
+        $subject =$myts->censorString($this->subject);
+        $post_text =$myts->censorString($this->post_text);
+        $subject = $myts->makeTboxData4Save($subject);
+        $post_text = $myts->makeTareaData4Save($post_text);
+        if ( empty($this->post_id) ) {
+            if ( empty($this->topic_id) ) {
+                $this->topic_id = $this->db->genId($this->db->prefix("bb_topics")."_topic_id_seq");
+                $datetime = time();
+                $sql = "INSERT INTO ".$this->db->prefix("bb_topics")." (topic_id, topic_title, topic_poster, forum_id, topic_time) VALUES (".$this->topic_id.",'$subject', ".$this->uid.", ".$this->forum_id.", $datetime)";
+                if ( !$result = $this->db->query($sql) ) {
+                    return false;
+                }
+                if ( $this->topic_id == 0 ) {
+                    $this->topic_id = $this->db->getInsertId();
+                }
+            }
+            if ( !isset($this->nohtml) || $this->nohtml != 1 ) {
+                $this->nohtml = 0;
+            }
+            if ( !isset($this->nosmiley) || $this->nosmiley != 1 ) {
+                $this->nosmiley = 0;
+            }
+            if ( !isset($this->attachsig) || $this->attachsig != 1 ) {
+                $this->attachsig = 0;
+            }
+            $this->post_id = $this->db->genId($this->db->prefix("bb_posts")."_post_id_seq");
+            $datetime = time();
+            $sql = sprintf("INSERT INTO %s (post_id, pid, topic_id, forum_id, post_time, uid, poster_ip, subject, nohtml, nosmiley, icon, attachsig ", $this->db->prefix("bb_posts"));
+            
+			// ÂÐ±þ¾õ¶·¤â¹¹¿·
+			if($this->response() != ""){
+	            $sql .= sprintf(" ,response) VALUES (%u, %u, %u, %u, %u, %u, '%s', '%s', %u, %u, '%s', %u, %u)", $this->post_id, $this->pid, $this->topic_id, $this->forum_id, $datetime, $this->uid, $this->poster_ip, $subject, $this->nohtml, $this->nosmiley, $this->icon, $this->attachsig, $this->response);
+			}else{
+	            $sql .= sprintf(") VALUES (%u, %u, %u, %u, %u, %u, '%s', '%s', %u, %u, '%s', %u)", $this->post_id, $this->pid, $this->topic_id, $this->forum_id, $datetime, $this->uid, $this->poster_ip, $subject, $this->nohtml, $this->nosmiley, $this->icon, $this->attachsig);
+			}
+            
+            if ( !$result = $this->db->query($sql) ) {
+                return false;
+            } else {
+            	
+                if ( $this->post_id == 0 ) {
+                    $this->post_id = $this->db->getInsertId();
+                }
+            	
+				// ÂÐ±þ¾õ¶·¤â¹¹¿·
+				if($this->response() != ""){
+					$sql = 'UPDATE '.$this->db->prefix("bb_topics").' SET topic_response = '.$this->response();
+					if($this->uid() != ""){
+						$sql .= ', topic_response_uid = '.$this->uid();
+					}else{
+						$sql .= ', topic_response_uid = NULL';
+					}
+					$sql .= ' WHERE topic_id = '.$this->topic_id;
+					
+					if ( !$this->db->query($sql)) {
+					    redirect_header('index.php',2,_MD_ERROROCCURED);
+					    exit();
+					}
+				}
+                
+                $sql = sprintf("INSERT INTO %s (post_id, post_text) VALUES (%u, '%s')", $this->db->prefix("bb_posts_text"), $this->post_id, $post_text);
+                if ( !$result = $this->db->query($sql) ) {
+                    $sql = sprintf("DELETE FROM %s WHERE post_id = %u", $this->db->prefix("bb_posts"), $this->post_id);
+                    $this->db->query($sql);
+                    return false;
+                }
+            }
+            if ( $this->pid == 0 ) {
+                $sql = sprintf("UPDATE %s SET topic_last_post_id = %u, topic_time = %u WHERE topic_id = %u", $this->db->prefix("bb_topics"), $this->post_id, $datetime, $this->topic_id);
+                if ( !$result = $this->db->query($sql) ) {
+                }
+                $sql = sprintf("UPDATE %s SET forum_posts = forum_posts+1, forum_topics = forum_topics+1, forum_last_post_id = %u WHERE forum_id = %u", $this->db->prefix("bb_forums"), $this->post_id, $this->forum_id);
+                $result = $this->db->query($sql);
+                if ( !$result ) {
+                }
+            } else {
+                $sql = "UPDATE ".$this->db->prefix("bb_topics")." SET topic_replies=topic_replies+1, topic_last_post_id = ".$this->post_id.", topic_time = $datetime WHERE topic_id =".$this->topic_id."";
+                if ( !$result = $this->db->query($sql) ) {
+                }
+                $sql = "UPDATE ".$this->db->prefix("bb_forums")." SET forum_posts = forum_posts+1, forum_last_post_id = ".$this->post_id." WHERE forum_id = ".$this->forum_id."";
+                $result = $this->db->query($sql);
+                if ( !$result ) {
+                }
+            }
+        }else{
+            if ( $this->istopic() ) {
+                $sql = "UPDATE ".$this->db->prefix("bb_topics")." SET topic_title = '$subject' WHERE topic_id = ".$this->topic_id."";
+                if ( !$result = $this->db->query($sql) ) {
+                    return false;
+                }
+            }
+            if ( !isset($this->nohtml) || $this->nohtml != 1 ) {
+                $this->nohtml = 0;
+            }
+            if ( !isset($this->nosmiley) || $this->nosmiley != 1 ) {
+                $this->nosmiley = 0;
+            }
+            if ( !isset($this->attachsig) || $this->attachsig != 1 ) {
+                $this->attachsig = 0;
+            }
+            $sql = "UPDATE ".$this->db->prefix("bb_posts")." SET subject='".$subject."', nohtml=".$this->nohtml.", nosmiley=".$this->nosmiley.", icon='".$this->icon."', attachsig=".$this->attachsig." WHERE post_id=".$this->post_id."";
+            $result = $this->db->query($sql);
+            if ( !$result ) {
+                return false;
+            } else {
+                $sql = "UPDATE ".$this->db->prefix("bb_posts_text")." SET post_text = '".$post_text."' WHERE post_id =".$this->post_id."";
+                $result = $this->db->query($sql);
+                if ( !$result ) {
+                    return false;
+                }
+            }
+        }
+        return $this->post_id;
+    }
+
+    function getPost($id) {
+        $sql = 'SELECT p.*, t.post_text, tp.topic_status FROM '.$this->db->prefix('bb_posts').' p LEFT JOIN '.$this->db->prefix('bb_posts_text').' t ON p.post_id=t.post_id LEFT JOIN '.$this->db->prefix('bb_topics').' tp ON tp.topic_id=p.topic_id WHERE p.post_id='.$id;
+        $array = $this->db->fetchArray($this->db->query($sql));
+        $this->post_id = $array['post_id'];
+        $this->pid = $array['pid'];
+        $this->topic_id = $array['topic_id'];
+        $this->forum_id = $array['forum_id'];
+        $this->post_time = $array['post_time'];
+        $this->uid = $array['uid'];
+        $this->poster_ip = $array['poster_ip'];
+        $this->subject = $array['subject'];
+        $this->nohtml = $array['nohtml'];
+        $this->nosmiley = $array['nosmiley'];
+        $this->icon = $array['icon'];
+        $this->attachsig = $array['attachsig'];
+        $this->post_text = $array['post_text'];
+        if ($array['pid'] == 0) {
+            $this->istopic = true;
+        }
+        if ($array['topic_status'] == 1) {
+            $this->islocked = true;
+        }
+    }
+
+    function makePost($array){
+        foreach($array as $key=>$value){
+            $this->$key = $value;
+        }
+    }
+
+    function delete() {
+        $sql = sprintf("DELETE FROM %s WHERE post_id = %u", $this->db->prefix("bb_posts"), $this->post_id);
+        if ( !$result = $this->db->query($sql) ) {
+            return false;
+        }
+        $sql = sprintf("DELETE FROM %s WHERE post_id = %u", $this->db->prefix("bb_posts_text"), $this->post_id);
+        if ( !$result = $this->db->query($sql) ) {
+            echo "Could not remove posts text for Post ID:".$this->post_id.".<br />";
+        }
+        if ( !empty($this->uid) ) {
+            $sql = sprintf("UPDATE %s SET posts=posts-1 WHERE uid = %u", $this->db->prefix("users"), $this->uid);
+            if ( !$result = $this->db->query($sql) ) {
+            //  echo "Could not update user posts.";
+            }
+        }
+        if ($this->istopic()) {
+            $sql = sprintf("DELETE FROM %s WHERE topic_id = %u", $this->db->prefix("bb_topics"), $this->topic_id);
+            if ( !$result = $this->db->query($sql) ) {
+                echo "Could not delete topic.";
+            }
+        }
+        $mytree = new XoopsTree($this->db->prefix("bb_posts"), "post_id", "pid");
+        $arr = $mytree->getAllChild($this->post_id);
+        $size = count($arr);
+        if ( $size > 0 ) {
+            for ( $i = 0; $i < $size; $i++ ) {
+                $sql = sprintf("DELETE FROM %s WHERE post_id = %u", $this->db->prefix("bb_posts"), $arr[$i]['post_id']);
+                if ( !$result = $this->db->query($sql) ) {
+                    echo "Could not delete post ".$arr[$i]['post_id']."";
+                }
+                $sql = sprintf("DELETE FROM %s WHERE post_id = %u", $this->db->prefix("bb_posts_text"), $arr[$i]['post_id']);
+                if ( !$result = $this->db->query($sql) ) {
+                    echo "Could not delete post text ".$arr[$i]['post_id']."";
+                }
+                if ( !empty($arr[$i]['uid']) ) {
+                    $sql = "UPDATE ".$this->db->prefix("users")." SET posts=posts-1 WHERE uid=".$arr[$i]['uid']."";
+                    if ( !$result = $this->db->query($sql) ) {
+                    //  echo "Could not update user posts.";
+                    }
+                }
+            }
+        }
+    }
+
+    function subject($format="Show") {
+        $myts =& MyTextSanitizer::getInstance();
+        $smiley = 1;
+        if ( $this->nosmiley() ) {
+            $smiley = 0;
+        }
+        switch ( $format ) {
+            case "Show":
+                $subject= $myts->makeTboxData4Show($this->subject,$smiley);
+                break;
+            case "Edit":
+                $subject = $myts->makeTboxData4Edit($this->subject);
+                break;
+            case "Preview":
+                $subject = $myts->makeTboxData4Preview($this->subject,$smiley);
+                break;
+            case "InForm":
+                $subject = $myts->makeTboxData4PreviewInForm($this->subject);
+                break;
+        }
+        return $subject;
+    }
+
+    function text($format="Show"){
+        $myts =& MyTextSanitizer::getInstance();
+        $smiley = 1;
+        $html = 1;
+        $bbcodes = 1;
+        if ( $this->nohtml() ) {
+            $html = 0;
+        }
+        if ( $this->nosmiley() ) {
+            $smiley = 0;
+        }
+        switch ( $format ) {
+            case "Show":
+                $text = $myts->makeTareaData4Show($this->post_text,$html,$smiley,$bbcodes);
+                break;
+            case "Edit":
+                $text = $myts->makeTareaData4Edit($this->post_text);
+                break;
+            case "Preview":
+                $text = $myts->makeTareaData4Preview($this->post_text,$html,$smiley,$bbcodes);
+                break;
+            case "InForm":
+                $text = $myts->makeTareaData4PreviewInForm($this->post_text);
+                break;
+            case "Quotes":
+                $text = $myts->makeTareaData4InsideQuotes($this->post_text);
+                break;
+        }
+        return $text;
+    }
+
+    function postid() {
+        return $this->post_id;
+    }
+
+    function posttime(){
+        return $this->post_time;
+    }
+
+    function uid(){
+        return $this->uid;
+    }
+
+    function uname(){
+        return XoopsUser::getUnameFromId($this->uid);
+    }
+
+    function posterip(){
+        return $this->poster_ip;
+    }
+
+    function parent(){
+        return $this->pid;
+    }
+
+    function topic(){
+        return $this->topic_id;
+    }
+
+    function nohtml(){
+        return $this->nohtml;
+    }
+
+    function nosmiley(){
+        return $this->nosmiley;
+    }
+
+    function icon(){
+        return $this->icon;
+    }
+
+    function forum(){
+        return $this->forum_id;
+    }
+
+    function attachsig(){
+        return $this->attachsig;
+    }
+
+    function prefix(){
+        return $this->prefix;
+    }
+    
+    // ÂÐ±þ¾õ¶·
+    function response(){
+        return $this->response;
+    }
+
+    function istopic() {
+        if ($this->istopic) {
+            return true;
+        }
+        return false;
+    }
+
+    function islocked() {
+        if ($this->islocked) {
+            return true;
+        }
+        return false;
+    }
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/images/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/images/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/images/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/viewforum.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/viewforum.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/viewforum.php	(revision 405)
@@ -0,0 +1,341 @@
+<?php
+// $Id: viewforum.php,v 1.7 2006/05/01 02:37:28 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+include "header.php";
+
+$forum = intval($_GET['forum']);
+if ( $forum < 1 ) {
+    redirect_header("index.php", 2, _MD_ERRORFORUM);
+    exit();
+}
+$sql = 'SELECT forum_type, forum_name, forum_access, allow_html, allow_sig, posts_per_page, hot_threshold, topics_per_page FROM '.$xoopsDB->prefix('bb_forums').' WHERE forum_id = '.$forum;
+if ( !$result = $xoopsDB->query($sql) ) {
+    redirect_header("index.php", 2, _MD_ERRORCONNECT);
+    exit();
+}
+if ( !$forumdata = $xoopsDB->fetchArray($result) ) {
+    redirect_header("index.php", 2, _MD_ERROREXIST);
+    exit();
+}
+// this page uses smarty template
+// this must be set before including main header.php
+$xoopsOption['template_main'] = 'newbb_viewforum.html';
+include XOOPS_ROOT_PATH."/header.php";
+$can_post = 0;
+$show_reg = 0;
+if ( $forumdata['forum_type'] == 1 ) {
+    // this is a private forum.
+    $xoopsTpl->assign('is_private_forum', true);
+    $accesserror = 0;
+    if ( $xoopsUser ) {
+        if ( !$xoopsUser->isAdmin($xoopsModule->mid()) ) {
+            if ( !check_priv_forum_auth($xoopsUser->getVar("uid"), $forum, false) ) {
+                $accesserror = 1;
+            }
+        }
+    } else {
+        $accesserror = 1;
+    }
+    if ( $accesserror == 1 ) {
+        redirect_header("index.php",2,_MD_NORIGHTTOACCESS);
+        exit();
+    }
+    $can_post = 1;
+    $show_reg = 1;
+} else {
+    // this is not a priv forum
+    $xoopsTpl->assign('is_private_forum', false);
+    if ( $forumdata['forum_access'] == 1 ) {
+        // this is a reg user only forum
+        if ( $xoopsUser ) {
+            $can_post = 1;
+        } else {
+            $show_reg = 1;
+        }
+    } elseif ( $forumdata['forum_access'] == 2 ) {
+        // this is an open forum
+        $can_post = 1;
+    } else {
+        // this is an admin/moderator only forum
+        if ( $xoopsUser ) {
+            if ( $xoopsUserIsAdmin || is_moderator($forum, $xoopsUser->uid()) ) {
+                $can_post = 1;
+            }
+        }
+    }
+}
+
+$xoopsTpl->assign("forum_id", $forum);
+
+if ( $can_post == 1 ) {
+    $xoopsTpl->assign('viewer_can_post', true);
+    $xoopsTpl->assign('forum_post_or_register', "<a href=\"newtopic.php?forum=".$forum."\"><img src=\"".$bbImage['post']."\" alt=\""._MD_POSTNEW."\" /></a>");
+} else {
+    $xoopsTpl->assign('viewer_can_post', false);
+    if ( $show_reg == 1 ) {
+        $xoopsTpl->assign('forum_post_or_register', '<a href="'.XOOPS_URL.'/user.php?xoops_redirect='.htmlspecialchars($xoopsRequestUri).'">'._MD_REGTOPOST.'</a>');
+    } else {
+        $xoopsTpl->assign('forum_post_or_register', "");
+    }
+}
+$xoopsTpl->assign('forum_index_title', sprintf(_MD_FORUMINDEX,$xoopsConfig['sitename']));
+$xoopsTpl->assign('forum_image_folder', $bbImage['folder_topic']);
+$myts =& MyTextSanitizer::getInstance();
+$xoopsTpl->assign('forum_name', $myts->makeTboxData4Show($forumdata['forum_name']));
+$xoopsTpl->assign('lang_moderatedby', _MD_MODERATEDBY);
+
+$forum_moderators = "";
+$count = 0;
+$moderators = get_moderators($forum);
+foreach ( $moderators as $mods ) {
+    foreach ( $mods as $mod_id => $mod_name ) {
+        if ( $count > 0 ) {
+            $forum_moderators .= ", ";
+        }
+        $forum_moderators .=  '<a href="'.XOOPS_URL.'/userinfo.php?uid='.$mod_id.'">'.$myts->makeTboxData4Show($mod_name).'</a>';
+        $count = 1;
+    }
+}
+$xoopsTpl->assign('forum_moderators', $forum_moderators);
+
+
+$sel_sort_array = array("t.topic_response"=>_MD_RESPONSE, "t.topic_title"=>_MD_TOPICTITLE, "t.topic_replies"=>_MD_NUMBERREPLIES, "u.uname"=>_MD_TOPICPOSTER, "t.topic_views"=>_MD_VIEWS, "p.post_time"=>_MD_LASTPOSTTIME);
+if ( !isset($_GET['sortname']) || !in_array($_GET['sortname'], array_keys($sel_sort_array)) ) {
+    $sortname = "p.post_time";
+} else {
+    $sortname = $_GET['sortname'];
+}
+
+$xoopsTpl->assign('lang_sortby', _MD_SORTEDBY);
+
+$forum_selection_sort = '<select name="sortname">';
+foreach ( $sel_sort_array as $sort_k => $sort_v ) {
+    $forum_selection_sort .= '<option value="'.$sort_k.'"'.(($sortname == $sort_k) ? ' selected="selected"' : '').'>'.$sort_v.'</option>';
+}
+$forum_selection_sort .= '</select>';
+
+// assign to template
+$xoopsTpl->assign('forum_selection_sort', $forum_selection_sort);
+
+$sortorder = (!isset($_GET['sortorder']) || $_GET['sortorder'] != "ASC") ? "DESC" : "ASC";
+$forum_selection_order = '<select name="sortorder">';
+$forum_selection_order .= '<option value="ASC"'.(($sortorder == "ASC") ? ' selected="selected"' : '').'>'._MD_ASCENDING.'</option>';
+$forum_selection_order .= '<option value="DESC"'.(($sortorder == "DESC") ? ' selected="selected"' : '').'>'._MD_DESCENDING.'</option>';
+$forum_selection_order .= '</select>';
+
+// assign to template
+$xoopsTpl->assign('forum_selection_order', $forum_selection_order);
+
+$sortsince = !empty($_GET['sortsince']) ? intval($_GET['sortsince']) : 100;
+$sel_since_array = array(1, 2, 5, 10, 20, 30, 40, 60, 75, 100);
+$forum_selection_since = '<select name="sortsince">';
+foreach ($sel_since_array as $sort_since_v) {
+    $forum_selection_since .= '<option value="'.$sort_since_v.'"'.(($sortsince == $sort_since_v) ? ' selected="selected"' : '').'>'.sprintf(_MD_FROMLASTDAYS,$sort_since_v).'</option>';
+}
+$forum_selection_since .= '<option value="365"'.(($sortsince == 365) ? ' selected="selected"' : '').'>'.sprintf(_MD_THELASTYEAR,365).'</option>';
+$forum_selection_since .= '<option value="1000"'.(($sortsince == 1000) ? ' selected="selected"' : '').'>'.sprintf(_MD_BEGINNING,1000).'</option>';
+$forum_selection_since .= '</select>';
+
+// assign to template
+$xoopsTpl->assign('forum_selection_since', $forum_selection_since);
+$xoopsTpl->assign('lang_go', _MD_GO);
+
+$xoopsTpl->assign('h_topic_link', "viewforum.php?forum=$forum&amp;sortname=t.topic_title&amp;sortsince=$sortsince&amp;sortorder=". (($sortname == "t.topic_title" && $sortorder == "DESC") ? "ASC" : "DESC"));
+$xoopsTpl->assign('lang_topic', _MD_TOPIC);
+
+// ÂÐ±þ¾õ¶·
+$xoopsTpl->assign('h_reply_response', "viewforum.php?forum=$forum&amp;sortname=t.topic_response&amp;sortsince=$sortsince&amp;sortorder=". (($sortname == "t.topic_response" && $sortorder == "DESC") ? "ASC" : "DESC"));
+$xoopsTpl->assign('lang_response', _MD_RESPONSE);
+
+$xoopsTpl->assign('h_reply_link', "viewforum.php?forum=$forum&amp;sortname=t.topic_replies&amp;sortsince=$sortsince&amp;sortorder=". (($sortname == "t.topic_replies" && $sortorder == "DESC") ? "ASC" : "DESC"));
+$xoopsTpl->assign('lang_replies', _MD_REPLIES);
+
+$xoopsTpl->assign('h_poster_link', "viewforum.php?forum=$forum&amp;sortname=u.uname&amp;sortsince=$sortsince&amp;sortorder=". (($sortname == "u.uname" && $sortorder == "DESC") ? "ASC" : "DESC"));
+$xoopsTpl->assign('lang_poster', _MD_POSTER);
+
+$xoopsTpl->assign('h_views_link', "viewforum.php?forum=$forum&amp;sortname=t.topic_views&amp;sortsince=$sortsince&amp;sortorder=". (($sortname == "t.topic_views" && $sortorder == "DESC") ? "ASC" : "DESC"));
+$xoopsTpl->assign('lang_views', _MD_VIEWS);
+
+$xoopsTpl->assign('h_date_link', "viewforum.php?forum=$forum&amp;sortname=p.post_time&amp;sortsince=$sortsince&amp;sortorder=". (($sortname == "p.post_time" && $sortorder == "DESC") ? "ASC" : "DESC"));
+$xoopsTpl->assign('lang_date', _MD_DATE);
+
+$startdate = time() - (86400* $sortsince);
+$start = !empty($_GET['start']) ? intval($_GET['start']) : 0;
+
+$sql = 'SELECT t.*, p.post_id, p.forum_id, u.uname, u2.uname as last_poster, p.post_time as last_post_time, p.icon FROM '.$xoopsDB->prefix("bb_topics").' t LEFT JOIN '.$xoopsDB->prefix('users').' u ON u.uid = t.topic_poster LEFT JOIN '.$xoopsDB->prefix('bb_posts').' p ON p.post_id = t.topic_last_post_id LEFT JOIN '.$xoopsDB->prefix('users').' u2 ON  u2.uid = p.uid WHERE t.forum_id = '.$forum.' AND (p.post_time > '.$startdate.' OR t.topic_sticky=1) ORDER BY topic_sticky DESC, '.$sortname.' '.$sortorder;
+if ( !$result = $xoopsDB->query($sql,$forumdata['topics_per_page'],$start) ) {
+    redirect_header('index.php',2,_MD_ERROROCCURED);
+    exit();
+}
+
+// Read topic 'lastread' times from cookie, if exists
+$topic_lastread = newbb_get_topics_viewed();
+while ( $myrow = $xoopsDB->fetchArray($result) ) {
+	
+	$sql_user = "SELECT uname FROM " .$xoopsDB->prefix('users'). " WHERE uid = " . $myrow['topic_response_uid'];
+	$result_user = $xoopsDB->query($sql_user);
+	$myrow_user = $xoopsDB->fetchArray($result_user);
+	
+	$sql_tmp = "SELECT p.post_id FROM ".$xoopsDB->prefix('bb_posts')." p WHERE p.pid = 0 AND p.topic_id = ".$myrow['topic_id'];
+	$result_tmp = $xoopsDB->query($sql_tmp);
+	$myrow_tmp = $xoopsDB->fetchArray($result_tmp);
+	$myrow['post_id'] = $myrow_tmp['post_id'];
+	
+    if ( empty($myrow['last_poster']) ) {
+        $myrow['last_poster'] = $xoopsConfig['anonymous'];
+    }
+    if ( $myrow['topic_sticky'] == 1 ) {
+        $image = $bbImage['folder_sticky'];
+    } elseif ( $myrow['topic_status'] == 1 ) {
+        $image = $bbImage['locked_topic'];
+    } else {
+        if ( $myrow['topic_replies'] >= $forumdata['hot_threshold'] ) {
+            if ( empty($topic_lastread[$myrow['topic_id']]) || ($topic_lastread[$myrow['topic_id']] < $myrow['last_post_time'] )) {
+                $image = $bbImage['hot_newposts_topic'];
+            } else {
+                $image = $bbImage['hot_folder_topic'];
+            }
+        } else {
+            if ( empty($topic_lastread[$myrow['topic_id']]) || ($topic_lastread[$myrow['topic_id']] < $myrow['last_post_time'] )) {
+                $image = $bbImage['newposts_topic'];
+            } else {
+                $image = $bbImage['folder_topic'];
+            }
+        }
+    }
+    $pagination = '';
+    $addlink = '';
+    $topiclink = 'viewtopic.php?topic_id='.$myrow['topic_id'].'&amp;forum='.$forum;
+    $totalpages = ceil(($myrow['topic_replies'] + 1) / $forumdata['posts_per_page']);
+    if ( $totalpages > 1 ) {
+        $pagination .= '&nbsp;&nbsp;&nbsp;<img src="'.XOOPS_URL.'/images/icons/posticon.gif" /> ';
+        for ( $i = 1; $i <= $totalpages; $i++ ) {
+
+            if ( $i > 3 && $i < $totalpages ) {
+                $pagination .= "...";
+            } else {
+                $addlink = '&amp;start='.(($i - 1) * $forumdata['posts_per_page']);
+                $pagination .= '[<a href="'.$topiclink.$addlink.'">'.$i.'</a>]';
+            }
+        }
+    }
+    if ( $myrow['icon'] ) {
+        $topic_icon = '<img src="'.XOOPS_URL.'/images/subject/'.htmlspecialchars($myrow['icon']).'" alt="" />';
+    } else {
+        $topic_icon = '<img src="'.XOOPS_URL.'/images/icons/no_posticon.gif" alt="" />';
+    }
+    if ( $myrow['topic_poster'] != 0 && $myrow['uname'] ) {
+        $topic_poster = '<a href="'.XOOPS_URL.'/userinfo.php?uid='.$myrow['topic_poster'].'">'.$myrow['uname'].'</a>';
+    } else {
+        $topic_poster = $xoopsConfig['anonymous'];
+    }
+    include_once 'class/class.util.php';
+    $fix = getFixName($myrow['forum_id']);
+    
+	$xoopsTpl->append('topics', array('topic_response_user'=>$myrow_user['uname'], 'topic_id'=>$myrow['topic_id'], 'topic_response'=>$myrow['topic_response'], 'topic_response_uname'=>$myrow['topic_response_uname'], 'fix'=>$fix, 'topic_number'=>$myrow['post_id'], 'topic_icon'=>$topic_icon, 'topic_folder'=>$image, 'topic_title'=>$myts->makeTboxData4Show($myrow['topic_title']), 'topic_link'=>$topiclink, 'topic_page_jump'=>$pagination, 'topic_replies'=>$myrow['topic_replies'], 'topic_poster'=>$topic_poster, 'topic_views'=>$myrow['topic_views'], 'topic_last_posttime'=>formatTimestamp($myrow['last_post_time']), 'topic_last_poster'=>$myts->makeTboxData4Show($myrow['last_poster'])));
+}
+
+// ÂÐ±þ¾õ¶·
+$xoopsTpl->assign('arrResponse', $arrResponse);
+
+/*
+// ¥æ¡¼¥¶¡¼¾ðÊó¼èÆÀ
+$member_handler =& xoops_gethandler('member');
+$xoopsUserIsAdmin = false;
+$user_id = "";
+$user_name = "";
+if (!empty($_SESSION['xoopsUserId'])) {
+	 $xoopsUser =& $member_handler->getUser($_SESSION['xoopsUserId']);
+	if (is_object($xoopsUser)) {
+		$xoopsUserIsAdmin = $xoopsUser->isAdmin();
+	}
+	$user_id = $_SESSION['xoopsUserId'];
+	$user_name = $xoopsUser->uname();
+}
+
+//sfprintr($xoopsUser->uname());
+
+// ÂÐ±þ¾õ¶·¹¹¿·¤¹¤ë
+//if($_GET['mode'] == 'response' and $xoopsUserIsAdmin and is_numeric($_GET['topic_id'])){
+if($_GET['mode'] == 'response' and is_numeric($_GET['topic_id'])){
+	$sql = 'UPDATE '.$xoopsDB->prefix("bb_topics").' SET topic_response = '.$_GET["response_".$_GET['topic_id']];
+	if($user_id != ""){
+		$sql .= ', topic_response_uid = '.$user_id;
+	}else{
+		$sql .= ', topic_response_uid = NULL';
+	}
+	$sql .= ' WHERE topic_id = '.$_GET['topic_id'];
+
+	if ( !$xoopsDB->queryF($sql)) {
+	    redirect_header('index.php',2,_MD_ERROROCCURED);
+	    exit();
+	}
+	// ¥ê¥í¡¼¥É
+	header("Location: " . $_SERVER['PHP_SELF'] . "?forum=" . $_GET['forum'] . "&sortname=p.post_time&sortorder=DESC&sortsince=" . $_GET['sortsince'] . "&start=" . $_GET['start']);
+}
+
+$xoopsTpl->assign('xoopsUserIsAdmin', $xoopsUserIsAdmin);
+*/
+
+$xoopsTpl->assign('lang_by', _MD_BY);
+
+$xoopsTpl->assign('img_newposts', $bbImage['newposts_topic']);
+$xoopsTpl->assign('img_hotnewposts', $bbImage['hot_newposts_topic']);
+$xoopsTpl->assign('img_folder', $bbImage['folder_topic']);
+$xoopsTpl->assign('img_hotfolder', $bbImage['hot_folder_topic']);
+$xoopsTpl->assign('img_locked', $bbImage['locked_topic']);
+$xoopsTpl->assign('img_sticky', $bbImage['folder_sticky']);
+$xoopsTpl->assign('lang_newposts', _MD_NEWPOSTS);
+$xoopsTpl->assign('lang_hotnewposts', _MD_MORETHAN);
+$xoopsTpl->assign('lang_hotnonewposts', _MD_MORETHAN2);
+$xoopsTpl->assign('lang_nonewposts', _MD_NONEWPOSTS);
+$xoopsTpl->assign('lang_legend', _MD_LEGEND);
+$xoopsTpl->assign('lang_topiclocked', _MD_TOPICLOCKED);
+$xoopsTpl->assign('lang_topicsticky', _MD_TOPICSTICKY);
+$xoopsTpl->assign("lang_search", _MD_SEARCH);
+$xoopsTpl->assign("lang_advsearch", _MD_ADVSEARCH);
+
+$sql = 'SELECT COUNT(*) FROM '.$xoopsDB->prefix('bb_topics').' WHERE forum_id = '.$forum.' AND (topic_time > '.$startdate.' OR topic_sticky = 1)';
+if ( !$r = $xoopsDB->query($sql) ) {
+    //redirect_header('index.php',2,_MD_ERROROCCURED);
+    //exit();
+}
+list($all_topics) = $xoopsDB->fetchRow($r);
+if ( $all_topics > $forumdata['topics_per_page'] ) {
+    include XOOPS_ROOT_PATH.'/class/pagenav.php';
+    $nav = new XoopsPageNav($all_topics, $forumdata['topics_per_page'], $start, "start", 'forum='.$forum.'&amp;sortname='.$sortname.'&amp;sortorder='.$sortorder.'&amp;sortsince='.$sortsince);
+    $xoopsTpl->assign('forum_pagenav', $nav->renderNav(4));
+} else {
+    $xoopsTpl->assign('forum_pagenav', '');
+}
+$xoopsTpl->assign('forum_jumpbox', make_jumpbox($forum));
+include XOOPS_ROOT_PATH."/footer.php";
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/edit.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/edit.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/edit.php	(revision 405)
@@ -0,0 +1,122 @@
+<?php
+// $Id: edit.php,v 1.4 2005/09/04 20:46:10 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+include 'header.php';
+foreach (array('forum', 'topic_id', 'post_id', 'order', 'pid') as $getint) {
+	${$getint} = isset($_GET[$getint]) ? intval($_GET[$getint]) : 0;
+}
+$viewmode = (isset($_GET['viewmode']) && $_GET['viewmode'] != 'flat') ? 'thread' : 'flat';
+if ( empty($forum) ) {
+	redirect_header("index.php", 2, _MD_ERRORFORUM);
+	exit();
+} elseif ( empty($post_id) ) {
+	redirect_header("viewforum.php?forum=$forum", 2, _MD_ERRORPOST);
+	exit();
+} else {
+	$sql = sprintf("SELECT forum_type, forum_name, forum_access, allow_html, allow_sig, posts_per_page, hot_threshold, topics_per_page FROM %s WHERE forum_id = %u", $xoopsDB->prefix("bb_forums"), $forum);
+	if ( !$result = $xoopsDB->query($sql) ) {
+		redirect_header('index.php',2,_MD_ERROROCCURED);
+		exit();
+	}
+	$forumdata = $xoopsDB->fetchArray($result);
+	$myts =& MyTextSanitizer::getInstance();
+	if ( $forumdata['forum_type'] == 1 ) {
+		// To get here, we have a logged-in user. So, check whether that user is allowed to post in
+		// this private forum.
+		$accesserror = 0; //initialize
+		if ( $xoopsUser ) {
+			if ( !$xoopsUser->isAdmin($xoopsModule->mid()) ) {
+				if ( !check_priv_forum_auth($xoopsUser->uid(), $forum, true) ) {
+					$accesserror = 1;
+				}
+			}
+		} else {
+			$accesserror = 1;
+		}
+		if ( $accesserror == 1 ) {
+			redirect_header("viewtopic.php?topic_id=$topic_id&amp;post_id=$post_id&amp;order=$order&amp;viewmode=$viewmode&amp;pid=$pid&amp;forum=$forum",2,_MD_NORIGHTTOPOST);
+			exit();
+		}
+	} else {
+		$accesserror = 0;
+		if ( $forumdata['forum_access'] == 3 ) {
+			if ( $xoopsUser ) {
+				if ( !$xoopsUser->isAdmin($xoopsModule->mid()) ) {
+					if ( !is_moderator($forum, $xoopsUser->uid()) ) {
+						$accesserror = 1;
+					}
+				}
+			} else {
+				$accesserror = 1;
+			}
+		} elseif ( $forumdata['forum_access'] == 1 && !$xoopsUser ) {
+			$accesserror = 1;
+		}
+		if ( $accesserror == 1 ) {
+			redirect_header("viewtopic.php?topic_id=$topic_id&amp;post_id=$post_id&amp;order=$order&amp;viewmode=$viewmode&amp;pid=$pid&amp;forum=$forum",2,_MD_NORIGHTTOPOST);
+			exit();
+		}
+    }
+	include XOOPS_ROOT_PATH."/header.php";
+	include_once 'class/class.forumposts.php';
+	$forumpost = new ForumPosts($post_id);
+	$editerror = false;
+	if ( $forumpost->islocked() ) {
+		if ( $xoopsUser ) {
+			if (!$xoopsUser->isAdmin($xoopsModule->mid()) || !is_moderator($forum, $xoopsUser->uid())) {
+				$editerror = true;
+			}
+		} else {
+			$editerror = true;
+		}
+	}
+	if ( $editerror ) {
+		redirect_header("viewtopic.php?topic_id=$topic_id&amp;post_id=$post_id&amp;order=$order&amp;viewmode=$viewmode&amp;pid=$pid&amp;forum=$forum",2,_MD_NORIGHTTOPOST);
+		exit();
+	}
+	$nohtml = $forumpost->nohtml();
+	$nosmiley = $forumpost->nosmiley();
+	$icon = $forumpost->icon();
+	$attachsig = $forumpost->attachsig();
+	$topic_id=$forumpost->topic();
+	if ( $forumpost->istopic() ) {
+		$istopic = 1;
+	} else {
+		$istopic = 0;
+	}
+	$subject=$forumpost->subject("Edit");
+	$message=$forumpost->text("Edit");
+	$hidden = "";
+	$myts =& MyTextSanitizer::getInstance();
+	$viewmode = $myts->htmlspecialchars($viewmode);
+	include 'include/forumform.inc.php';
+	include XOOPS_ROOT_PATH.'/footer.php';
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/post.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/post.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/post.php	(revision 405)
@@ -0,0 +1,238 @@
+<?php
+// $Id: post.php,v 1.5 2005/09/04 20:46:10 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+include 'header.php';
+foreach (array('forum', 'topic_id', 'post_id', 'order', 'pid') as $getint) {
+    ${$getint} = isset($_POST[$getint]) ? intval($_POST[$getint]) : 0;
+}
+$viewmode = (isset($_POST['viewmode']) && $_POST['viewmode'] != 'flat') ? 'thread' : 'flat';
+if ( empty($forum) ) {
+    redirect_header("index.php", 2, _MD_ERRORFORUM);
+    exit();
+} else {
+    if (!XoopsMultiTokenHandler::quickValidate('newbb_post')) {
+        redirect_header('index.php', 2, _MD_ERROROCCURED);
+        exit();
+    }
+    $sql = "SELECT forum_type, forum_name, forum_access, allow_html, allow_sig, posts_per_page, hot_threshold, topics_per_page FROM ".$xoopsDB->prefix("bb_forums")." WHERE forum_id = ".$forum;
+    if ( !$result = $xoopsDB->query($sql) ) {
+        redirect_header('index.php',2,_MD_ERROROCCURED);
+        exit();
+    }
+    $forumdata = $xoopsDB->fetchArray($result);
+    if (empty($forumdata['allow_html'])) {
+         $_POST['nohtml'] = 1;
+    }
+    if ( $forumdata['forum_type'] == 1 ) {
+    // To get here, we have a logged-in user. So, check whether that user is allowed to view
+    // this private forum.
+        $accesserror = 0;
+        if ( $xoopsUser ) {
+            if ( !$xoopsUser->isAdmin($xoopsModule->mid()) ) {
+                if ( !check_priv_forum_auth($xoopsUser->uid(), $_POST['forum'], true) ) {
+                    $accesserror = 1;
+                }
+            }
+        } else {
+            $accesserror = 1;
+        }
+
+        if ( $accesserror == 1 ) {
+            redirect_header("viewforum.php?order=".$order."&amp;viewmode=".$viewmode."&amp;forum=".$forum,2,_MD_NORIGHTTOPOST);
+            exit();
+        }
+    } else {
+        $accesserror = 0;
+        if ( $forumdata['forum_access'] == 3 ) {
+            if ( $xoopsUser ) {
+                if ( !$xoopsUser->isAdmin($xoopsModule->mid()) ) {
+                    if ( !is_moderator($forum, $xoopsUser->uid()) ) {
+                        $accesserror = 1;
+                    }
+                }
+            } else {
+                $accesserror = 1;
+            }
+        } elseif ( $forumdata['forum_access'] == 1 && !$xoopsUser ) {
+            $accesserror = 1;
+        }
+        if ( $accesserror == 1 ) {
+            redirect_header("viewforum.php?order=".$order."&amp;viewmode=".$viewmode."&amp;forum=".$forum,2,_MD_NORIGHTTOPOST);
+            exit();
+        }
+    }
+    if ( !empty($_POST['contents_preview']) ) {
+        include XOOPS_ROOT_PATH."/header.php";
+        echo"<table width='100%' border='0' cellspacing='1' class='outer'><tr><td>";
+        $myts =& MyTextSanitizer::getInstance();
+        $p_subject = $myts->makeTboxData4Preview($_POST['subject']);
+        $dosmiley = empty($_POST['nosmiley']) ? 1 : 0;
+        $dohtml = empty($_POST['nohtml']) ? 1 : 0;
+        $p_message = $myts->makeTareaData4Preview($_POST['message'], $dohtml, $dosmiley, 1);
+
+        themecenterposts($p_subject,$p_message);
+        echo "<br />";
+        $subject = $myts->makeTboxData4PreviewInForm($_POST['subject']);
+        $message = $myts->makeTareaData4PreviewInForm($_POST['message']);
+        $hidden = $myts->makeTboxData4PreviewInForm($_POST['hidden']);
+        $notify = !empty($_POST['notify']) ? 1 : 0;
+        $attachsig = !empty($_POST['attachsig']) ? 1 : 0;
+        include 'include/forumform.inc.php';
+        echo"</td></tr></table>";
+    } else {
+        include_once 'class/class.forumposts.php';
+        if ( !empty($post_id) ) {
+            $editerror = 0;
+            $forumpost = new ForumPosts($post_id);
+            if ( $xoopsUser ) {
+                if ( !$xoopsUser->isAdmin($xoopsModule->mid()) ) {
+                    if ($forumpost->islocked() || ($forumpost->uid() != $xoopsUser->getVar("uid") && !is_moderator($forum, $xoopsUser->getVar("uid")))) {
+                        $editerror = 1;
+                    }
+                }
+            } else {
+                $editerror = 1;
+            }
+            if ( $editerror == 1 ) {
+                redirect_header("viewtopic.php?topic_id=".$topic_id."&amp;post_id=".$post_id."&amp;order=".$order."&amp;viewmode=".$viewmode."&amp;pid=".$pid."&amp;forum=".$forum,2,_MD_EDITNOTALLOWED);
+                exit();
+            }
+            $editor = $xoopsUser->getVar("uname");
+            $on_date .= _MD_ON." ".formatTimestamp(time());
+            //$message .= "\n\n<small>[ "._MD_EDITEDBY." ".$editor." ".$on_date." ]</small>";
+        } else {
+            $isreply = 0;
+            $isnew = 1;
+            if ( $xoopsUser && empty($_POST['noname']) ) {
+                $uid = $xoopsUser->getVar("uid");
+            } else {
+                if ( $forumdata['forum_access'] == 2 ) {
+                    $uid = 0;
+                } else {
+                    if ( !empty($topic_id) ) {
+                        redirect_header("viewtopic.php?topic_id=".$topic_id."&amp;order=".$order."&amp;viewmode=".$viewmode."&amp;pid=".$pid."&amp;forum=".$forum,2,_MD_ANONNOTALLOWED);
+                    } else {
+                        redirect_header("viewforum.php?forum=".$forum,2,_MD_ANONNOTALLOWED);
+                    }
+                    exit();
+                }
+            }
+            $forumpost = new ForumPosts();
+            $forumpost->setForum($forum);
+            if (isset($pid) && $pid != "") {
+                $forumpost->setParent($pid);
+            }
+            if (!empty($topic_id)) {
+                $forumpost->setTopicId($topic_id);
+                $isreply = 1;
+            }
+            $forumpost->setIp($_SERVER['REMOTE_ADDR']);
+            $forumpost->setUid($uid);
+        }
+        $subject = xoops_trim($_POST['subject']);
+        $subject = ($subject == '') ? _NOTITLE : $subject;
+        $forumpost->setSubject($subject);
+        $forumpost->setText($_POST['message']);
+        $forumpost->setNohtml($_POST['nohtml']);
+        $forumpost->setNosmiley($_POST['nosmiley']);
+        $forumpost->setIcon($_POST['icon']);
+        $forumpost->setAttachsig($_POST['attachsig']);
+        $forumpost->setResponse($_POST['response']);
+
+        if (!$postid = $forumpost->store()) {
+            include_once(XOOPS_ROOT_PATH.'/header.php');
+            xoops_error('Could not insert forum post');
+            include_once(XOOPS_ROOT_PATH.'/footer.php');
+            exit();
+        }
+        if (is_object($xoopsUser) && !empty($isnew)) {
+            $xoopsUser->incrementPost();
+        }
+        // RMV-NOTIFY
+        // Define tags for notification message
+        $tags = array();
+        $tags['THREAD_NAME'] = $_POST['subject'];
+        $tags['THREAD_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/viewtopic.php?forum=' . $forum . '&amp;post_id='.$postid.'&amp;topic_id=' . $forumpost->topic();
+        $tags['POST_URL'] = $tags['THREAD_URL'] . '#forumpost' . $postid;
+        include_once 'include/notification.inc.php';
+        $forum_info = newbb_notify_iteminfo ('forum', $forum);
+        $tags['FORUM_NAME'] = $forum_info['name'];
+        $tags['FORUM_URL'] = $forum_info['url'];
+        
+        $sql_tmp = "SELECT u.uname FROM xoops_bb_posts p, xoops_users u WHERE p.uid = u.uid AND p.post_id = ".$postid ;
+    	if ( $result_tmp = $xoopsDB->query($sql_tmp) ) {
+			$data = $xoopsDB->fetchArray($result_tmp);
+			if($data['uname'] == "") {
+				$tags['USER_NAME'] = "¥²¥¹¥ÈÍÍ";
+			} else {
+        		$tags['USER_NAME'] = $data['uname']."ÍÍ";
+        	}
+        }
+        $notification_handler =& xoops_gethandler('notification');
+        if (!empty($isnew)) {
+            if (empty($isreply)) {
+                // Notify of new thread
+                $notification_handler->triggerEvent('forum', $forum, 'new_thread', $tags);
+            } else {
+                // Notify of new post
+                $notification_handler->triggerEvent('thread', $topic_id, 'new_post', $tags);
+            }
+            $notification_handler->triggerEvent('global', 0, 'new_post', $tags);
+            $notification_handler->triggerEvent('forum', $forum, 'new_post', $tags);
+            $myts =& MyTextSanitizer::getInstance();
+            $tags['POST_CONTENT'] = $myts->stripSlashesGPC($_POST['message']);
+            $tags['POST_NAME'] = $myts->stripSlashesGPC($_POST['subject']);
+            $notification_handler->triggerEvent('global', 0, 'new_fullpost', $tags);
+        }
+
+        // If user checked notification box, subscribe them to the
+        // appropriate event; if unchecked, then unsubscribe
+
+        if (!empty($xoopsUser) && !empty($xoopsModuleConfig['notification_enabled'])) {
+            if (!empty($_POST['notify'])) {
+                $notification_handler->subscribe('thread', $forumpost->getTopicId(), 'new_post');
+            } else {
+                $notification_handler->unsubscribe('thread', $forumpost->getTopicId(), 'new_post');
+            }
+        }
+
+        if ( $_POST['viewmode'] == "flat" ) {
+            redirect_header("viewtopic.php?topic_id=".$forumpost->topic()."&amp;post_id=".$postid."&amp;order=".$order."&amp;viewmode=flat&amp;pid=".$pid."&amp;forum=".$forum."#forumpost".$postid."",2,_MD_THANKSSUBMIT);
+            exit();
+        } else {
+            $post_id = $forumpost->postid();
+            redirect_header("viewtopic.php?topic_id=".$forumpost->topic()."&amp;post_id=".$postid."&amp;order=".$order."&amp;viewmode=thread&amp;pid=".$pid."&amp;forum=".$forum."#forumpost".$postid."",2,_MD_THANKSSUBMIT);
+            exit();
+        }
+    }
+    include XOOPS_ROOT_PATH.'/footer.php';
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/blocks/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/blocks/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/blocks/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/blocks/newbb_new.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/blocks/newbb_new.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/blocks/newbb_new.php	(revision 405)
@@ -0,0 +1,156 @@
+<?php
+// $Id: newbb_new.php,v 1.4 2005/08/03 12:39:13 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+// Recent private forums block (Bloc Forum privé©                            //
+// Author: L'éñuipe de TheNetSpace ( http://www.thenetspace.com )            //
+// ------------------------------------------------------------------------- //
+
+function b_newbb_new_show($options) {
+    $db =& Database::getInstance();
+    $myts =& MyTextSanitizer::getInstance();
+    $block = array();
+    switch($options[2]) {
+    case 'views':
+        $order = 't.topic_views';
+        break;
+    case 'replies':
+        $order = 't.topic_replies';
+        break;
+    case 'time':
+    default:
+        $order = 't.topic_time';
+        break;
+    }
+    $query='SELECT t.topic_id, t.topic_title, t.topic_last_post_id, t.topic_time, t.topic_views, t.topic_replies, t.forum_id, f.forum_name FROM '.$db->prefix('bb_topics').' t, '.$db->prefix('bb_forums').' f WHERE f.forum_id=t.forum_id AND f.forum_type <> 1 ORDER BY '.$order.' DESC';
+    if (!$result = $db->query($query,$options[0],0)) {
+        return false;
+    }
+    if ( $options[1] != 0 ) {
+        $block['full_view'] = true;
+    } else {
+        $block['full_view'] = false;
+    }
+    $block['lang_forum'] = _MB_NEWBB_FORUM;
+    $block['lang_topic'] = _MB_NEWBB_TOPIC;
+    $block['lang_replies'] = _MB_NEWBB_RPLS;
+    $block['lang_views'] = _MB_NEWBB_VIEWS;
+    $block['lang_lastpost'] = _MB_NEWBB_LPOST;
+    $block['lang_visitforums'] = _MB_NEWBB_VSTFRMS;
+    while ($arr = $db->fetchArray($result)) {
+        $topic['forum_id'] = $arr['forum_id'];
+        $topic['forum_name'] = $myts->makeTboxData4Show($arr['forum_name']);
+        $topic['id'] = $arr['topic_id'];
+        $topic['title'] = $myts->makeTboxData4Show($arr['topic_title']);
+        $topic['replies'] = $arr['topic_replies'];
+        $topic['views'] = $arr['topic_views'];
+        $topic['post_id'] = $arr['topic_last_post_id'];
+        $lastpostername = $db->query("SELECT post_id, uid FROM ".$db->prefix("bb_posts")." WHERE post_id = ".$topic['post_id']);
+        while ($tmpdb=$db->fetchArray($lastpostername)) {
+            $tmpuser = XoopsUser::getUnameFromId($tmpdb['uid']);
+            //if ( $options[1] != 0 ) {
+                $topic['time'] = formatTimestamp($arr['topic_time'],'m')." $tmpuser";
+            //}
+        }
+        $block['topics'][] =& $topic;
+        unset($topic);
+    }
+    return $block;
+}
+
+function b_newbb_new_private_show($options) {
+    $db =& Database::getInstance();
+    $myts =& MyTextSanitizer::getInstance();
+    $block = array();
+    switch($options[2]) {
+    case 'views':
+        $order = 't.topic_views';
+        break;
+    case 'replies':
+        $order = 't.topic_replies';
+        break;
+    case 'time':
+    default:
+        $order = 't.topic_time';
+        break;
+    }
+    $query='SELECT t.topic_id, t.topic_title, t.topic_last_post_id, t.topic_time, t.topic_views, t.topic_replies, t.forum_id, f.forum_name FROM '.$db->prefix('bb_topics').' t, '.$db->prefix('bb_forums').' f WHERE f.forum_id=t.forum_id AND f.forum_type = 1 ORDER BY '.$order.' DESC';
+
+    if (!$result = $db->query($query,$options[0],0)) {
+        return false;
+    }
+    if ( $options[1] != 0 ) {
+        $block['full_view'] = true;
+    } else {
+        $block['full_view'] = false;
+    }
+    $block['lang_forum'] = _MB_NEWBB_FORUM;
+    $block['lang_topic'] = _MB_NEWBB_TOPIC;
+    $block['lang_replies'] = _MB_NEWBB_RPLS;
+    $block['lang_views'] = _MB_NEWBB_VIEWS;
+    $block['lang_lastpost'] = _MB_NEWBB_LPOST;
+    $block['lang_visitforums'] = _MB_NEWBB_VSTFRMS;
+    while ($arr = $db->fetchArray($result)) {
+        $topic['forum_id'] = $arr['forum_id'];
+        $topic['forum_name'] = $myts->makeTboxData4Show($arr['forum_name']);
+        $topic['id'] = $arr['topic_id'];
+        $topic['title'] = $myts->makeTboxData4Show($arr['topic_title']);
+        $topic['replies'] = $arr['topic_replies'];
+        $topic['views'] = $arr['topic_views'];
+        $tmpuser2 = $arr['topic_last_post_id'];
+        $lastpostername = $db->query("SELECT post_id, uid FROM ".$db->prefix("bb_posts")." WHERE post_id = $tmpuser2");
+        while ($tmpdb=$db->fetchArray($lastpostername)) {
+            $tmpuser = XoopsUser::getUnameFromId($tmpdb['uid']);
+            if ( $options[1] != 0 ) {
+                $topic['time'] = formatTimestamp($arr['topic_time'],'m')." $tmpuser";
+            }
+        }
+        $block['topics'][] =& $topic;
+        unset($topic);
+    }
+    return $block;
+}
+
+function b_newbb_new_edit($options) {
+    $inputtag = "<input type='text' name='options[0]' value='".$options[0]."' />";
+    $form = sprintf(_MB_NEWBB_DISPLAY,$inputtag);
+    $form .= "<br />"._MB_NEWBB_DISPLAYF."&nbsp;<input type='radio' name='options[1]' value='1'";
+    if ( $options[1] == 1 ) {
+        $form .= " checked='checked'";
+    }
+    $form .= " />&nbsp;"._YES."<input type='radio' name='options[1]' value='0'";
+    if ( $options[1] == 0 ) {
+        $form .= " checked='checked'";
+    }
+    $form .= " />&nbsp;"._NO;
+    $form .= '<input type="hidden" name="options[2]" value="'.$options[2].'" />';
+    return $form;
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/header.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/header.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/header.php	(revision 405)
@@ -0,0 +1,31 @@
+<?php
+// $Id: header.php,v 1.2 2005/03/18 12:52:25 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+include '../../mainfile.php';
+include XOOPS_ROOT_PATH.'/modules/newbb/functions.php';
+include XOOPS_ROOT_PATH.'/modules/newbb/config.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/newtopic.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/newtopic.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/newtopic.php	(revision 405)
@@ -0,0 +1,99 @@
+<?php
+// $Id: newtopic.php,v 1.4 2005/09/04 20:46:10 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+include 'header.php';
+foreach (array('forum', 'order') as $getint) {
+	${$getint} = isset($_GET[$getint]) ? intval($_GET[$getint]) : 0;
+}
+$viewmode = (isset($_GET['viewmode']) && $_GET['viewmode'] != 'flat') ? 'thread' : 'flat';
+if ( empty($forum) ) {
+	redirect_header("index.php", 2, _MD_ERRORFORUM);
+	exit();
+} else {
+	$sql = "SELECT forum_type, forum_name, forum_access, allow_html, allow_sig, posts_per_page, hot_threshold, topics_per_page FROM ".$xoopsDB->prefix("bb_forums")." WHERE forum_id = $forum";
+	if ( !$result = $xoopsDB->query($sql) ) {
+		redirect_header('index.php',2,_MD_ERROROCCURED);
+		exit();
+	}
+	$forumdata = $xoopsDB->fetchArray($result);
+	if ( $forumdata['forum_type'] == 1 ) {
+		// To get here, we have a logged-in user. So, check whether that user is allowed to post in
+		// this private forum.
+		$accesserror = 0; //initialize
+		if ( $xoopsUser ) {
+			//check if the user has forum admin right
+			if ( !$xoopsUser->isAdmin($xoopsModule->mid()) ) {
+				if ( !check_priv_forum_auth($xoopsUser->uid(), $forum, true) ) {
+					$accesserror = 1;
+				}
+			}
+		} else {
+			$accesserror = 1;
+		}
+		if ( $accesserror == 1 ) {
+			redirect_header("viewforum.php?order=$order&amp;viewmode=$viewmode&amp;forum=$forum",2,_MD_NORIGHTTOPOST);
+			exit();
+		}
+		// Ok, looks like we're good.
+	} else {
+		$accesserror = 0;
+		if ( $forumdata['forum_access'] == 3 ) {
+			if ( $xoopsUser ) {
+				if ( !$xoopsUser->isAdmin($xoopsModule->mid()) ) {
+					if ( !is_moderator($forum, $xoopsUser->uid()) ) {
+						$accesserror = 1;
+					}
+				}
+			} else {
+				$accesserror = 1;
+			}
+		} elseif ( $forumdata['forum_access'] == 1 && !$xoopsUser ) {
+			$accesserror = 1;
+		}
+		if ( $accesserror == 1 ) {
+			redirect_header("viewforum.php?order=$order&amp;viewmode=$viewmode&amp;forum=$forum",2,_MD_NORIGHTTOPOST);
+			exit();
+		}
+    }
+	include XOOPS_ROOT_PATH.'/header.php';
+	$istopic = 1;
+	$pid=0;
+	$subject = "";
+	$message = "";
+	$myts =& MyTextSanitizer::getInstance();
+	$hidden = "";
+	unset($post_id);
+	unset($topic_id);
+
+	include 'include/forumform.inc.php';
+	include XOOPS_ROOT_PATH.'/footer.php';
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/notification_update.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/notification_update.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/notification_update.php	(revision 405)
@@ -0,0 +1,4 @@
+<?php
+include '../../mainfile.php';
+include XOOPS_ROOT_PATH.'/include/notification_update.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/reply.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/reply.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/reply.php	(revision 405)
@@ -0,0 +1,125 @@
+<?php
+// $Id: reply.php,v 1.4 2005/09/04 20:46:10 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+include 'header.php';
+foreach (array('forum', 'topic_id', 'post_id', 'order', 'pid') as $getint) {
+	${$getint} = isset($_GET[$getint]) ? intval($_GET[$getint]) : 0;
+}
+$viewmode = (isset($_GET['viewmode']) && $_GET['viewmode'] != 'flat') ? 'thread' : 'flat';
+if ( empty($forum) ) {
+	redirect_header("index.php", 2, _MD_ERRORFORUM);
+	exit();
+} elseif ( empty($topic_id) ) {
+	redirect_header("viewforum.php?forum=$forum", 2, _MD_ERRORTOPIC);
+	exit();
+} elseif ( empty($post_id) ) {
+	redirect_header("viewtopic.php?topic_id=$topic_id&amp;order=$order&amp;viewmode=$viewmode&amp;pid=$pid&amp;forum=$forum", 2, _MD_ERRORPOST);
+	exit();
+} else {
+	if ( is_locked($topic_id) ) {
+		redirect_header("viewtopic.php?topic_id=$topic_id&amp;order=$order&amp;viewmode=$viewmode&amp;pid=$pid&amp;forum=$forum", 2, _MD_TOPICLOCKED);
+		exit();
+	}
+	$sql = "SELECT forum_type, forum_name, forum_access, allow_html, allow_sig, posts_per_page, hot_threshold, topics_per_page FROM ".$xoopsDB->prefix("bb_forums")." WHERE forum_id = $forum";
+	if ( !$result = $xoopsDB->query($sql) ) {
+		redirect_header('index.php',1,_MD_ERROROCCURED);
+		exit();
+	}
+	$forumdata = $xoopsDB->fetchArray($result);
+	$myts =& MyTextSanitizer::getInstance();
+	if ( $forumdata['forum_type'] == 1 ) {
+		// To get here, we have a logged-in user. So, check whether that user is allowed to post in
+		// this private forum.
+		$accesserror = 0; //initialize
+		if ( $xoopsUser ) {
+			if ( !$xoopsUser->isAdmin($xoopsModule->mid()) ) {
+				if ( !check_priv_forum_auth($xoopsUser->uid(), $forum, true) ) {
+					$accesserror = 1;
+				}
+			}
+		} else {
+			$accesserror = 1;
+		}
+		if ( $accesserror == 1 ) {
+			redirect_header("viewtopic.php?topic_id=$topic_id&amp;post_id=$post_id&amp;order=$order&amp;viewmode=$viewmode&amp;pid=$pid&amp;forum=$forum",2,_MD_NORIGHTTOPOST);
+			exit();
+		}
+		// Ok, looks like we're good.
+	} else {
+		$accesserror = 0;
+		if ( $forumdata['forum_access'] == 3 ) {
+			if ( $xoopsUser ) {
+				if ( !$xoopsUser->isAdmin($xoopsModule->mid()) ) {
+					if ( !is_moderator($forum, $xoopsUser->uid()) ) {
+						$accesserror = 1;
+					}
+				}
+			} else {
+				$accesserror = 1;
+			}
+		} elseif ( $forumdata['forum_access'] == 1 && !$xoopsUser ) {
+			$accesserror = 1;
+		}
+		if ( $accesserror == 1 ) {
+			redirect_header("viewtopic.php?topic_id=$topic_id&amp;post_id=$post_id&amp;order=$order&amp;viewmode=$viewmode&amp;pid=$pid&amp;forum=$forum",2,_MD_NORIGHTTOPOST);
+			exit();
+		}
+    }
+	include XOOPS_ROOT_PATH.'/header.php';
+	include_once 'class/class.forumposts.php';
+	$forumpost = new ForumPosts($post_id);
+	$r_message = $forumpost->text();
+	$r_date = formatTimestamp($forumpost->posttime());
+	$r_name = ($forumpost->uid() != 0) ? XoopsUser::getUnameFromId($forumpost->uid()) : $xoopsConfig['anonymous'];
+	$r_content = _MD_BY." ".$r_name." "._MD_ON." ".$r_date."<br /><br />";
+	$r_content .= $r_message;
+	$r_subject=$forumpost->subject();
+	if (!preg_match("/^Re:/i",$r_subject)) {
+		$subject = 'Re: '.$myts->htmlSpecialChars($r_subject);
+	} else {
+		$subject = $myts->htmlSpecialChars($r_subject);
+	}
+	$q_message = $forumpost->text("Quotes");
+	$hidden = "[quote]\n";
+	$hidden .= sprintf(_MD_USERWROTE,$r_name);
+	$hidden .= "\n".$q_message."[/quote]";
+	$message = "";
+	themecenterposts($r_subject,$r_content);
+	echo "<br />";
+	$pid=$post_id;
+	unset($post_id);
+	$topic_id=$forumpost->topic();
+	$forum=$forumpost->forum();
+	$isreply =1;
+	$istopic = 0;
+	include 'include/forumform.inc.php';
+	include XOOPS_ROOT_PATH.'/footer.php';
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/include/search.inc.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/include/search.inc.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/include/search.inc.php	(revision 405)
@@ -0,0 +1,61 @@
+<?php
+// $Id: search.inc.php,v 1.4 2005/08/03 12:39:14 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+function newbb_search($queryarray, $andor, $limit, $offset, $userid){
+    global $xoopsDB;
+    $sql = "SELECT p.post_id,p.topic_id,p.forum_id,p.post_time,p.uid,p.subject FROM ".$xoopsDB->prefix("bb_posts")." p LEFT JOIN ".$xoopsDB->prefix("bb_posts_text")." t ON t.post_id=p.post_id LEFT JOIN ".$xoopsDB->prefix("bb_forums")." f ON f.forum_id=p.forum_id WHERE f.forum_type=0";
+    if ( $userid != 0 ) {
+        $sql .= " AND p.uid=".$userid." ";
+    }
+    // because count() returns 1 even if a supplied variable
+    // is not an array, we must check if $querryarray is really an array
+    if ( is_array($queryarray) && $count = count($queryarray) ) {
+        $sql .= " AND ((p.subject LIKE '%$queryarray[0]%' OR t.post_text LIKE '%$queryarray[0]%')";
+        for($i=1;$i<$count;$i++){
+            $sql .= " $andor ";
+            $sql .= "(p.subject LIKE '%$queryarray[$i]%' OR t.post_text LIKE '%$queryarray[$i]%')";
+        }
+        $sql .= ") ";
+    }
+    $sql .= "ORDER BY p.post_time DESC";
+    $result = $xoopsDB->query($sql,$limit,$offset);
+    $ret = array();
+    $i = 0;
+    while($myrow = $xoopsDB->fetchArray($result)){
+        $ret[$i]['link'] = "viewtopic.php?topic_id=".$myrow['topic_id']."&amp;forum=".$myrow['forum_id']."&amp;post_id=".$myrow['post_id']."#forumpost".$myrow['post_id'];
+        $ret[$i]['title'] = $myrow['subject'];
+        $ret[$i]['time'] = $myrow['post_time'];
+        $ret[$i]['uid'] = $myrow['uid'];
+        $i++;
+    }
+    return $ret;
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/include/notification.inc.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/include/notification.inc.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/include/notification.inc.php	(revision 405)
@@ -0,0 +1,72 @@
+<?php
+// $Id: notification.inc.php,v 1.3 2005/08/03 12:39:14 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+function newbb_notify_iteminfo($category, $item_id)
+{
+	$module_handler =& xoops_gethandler('module');
+	$module =& $module_handler->getByDirname('newbb');
+
+	if ($category=='global') {
+		$item['name'] = '';
+		$item['url'] = '';
+		return $item;
+	}
+
+	global $xoopsDB;
+	if ($category=='forum') {
+		// Assume we have a valid forum id
+		$sql = 'SELECT forum_name FROM ' . $xoopsDB->prefix('bb_forums') . ' WHERE forum_id = '.$item_id;
+		$result = $xoopsDB->query($sql); // TODO: error check
+		$result_array = $xoopsDB->fetchArray($result);
+		$item['name'] = $result_array['forum_name'];
+		$item['url'] = XOOPS_URL . '/modules/' . $module->getVar('dirname') . '/viewforum.php?forum=' . $item_id;
+		$item['uname'] = "uehara";
+		return $item;
+	}
+
+	if ($category=='thread') {
+		// Assume we have a valid topid id
+		$sql = 'SELECT t.topic_title,f.forum_id,f.forum_name, u.uname FROM '.$xoopsDB->prefix('bb_topics') . ' t, ' . $xoopsDB->prefix('bb_forums') . ' f, '.$xoopsDB->prefix('users').' u ,' .$xoopsDB->prefix('bb_posts').' p WHERE t.forum_id = f.forum_id AND t.topic_id = '. $item_id . ' AND t.topic_id = p.topic_id AND p.uid = u.uid limit 1';
+		$result = $xoopsDB->query($sql); // TODO: error check
+		$result_array = $xoopsDB->fetchArray($result);
+		$item['name'] = $result_array['topic_title'];
+		$item['url'] = XOOPS_URL . '/modules/' . $module->getVar('dirname') . '/viewtopic.php?forum=' . $result_array['forum_id'] . '&amp;topic_id=' . $item_id;
+		$item['uname'] = $result_array['uname'];
+		return $item;
+	}
+
+	if ($category=='post') {
+		// Assume we have a valid post id
+		$sql = 'SELECT subject,topic_id,forum_id FROM ' . $xoopsDB->prefix('bb_posts') . ' WHERE post_id = ' . $item_id . ' LIMIT 1';
+		$result = $xoopsDB->query($sql);
+		$result_array = $xoopsDB->fetchArray($result);
+		$item['name'] = $result_array['subject'];
+		$item['url'] = XOOPS_URL . '/modules/' . $module->getVar('dirname') . '/viewtopic.php?forum= ' . $result_array['forum_id'] . '&amp;topic_id=' . $result_array['topic_id'] . '#forumpost' . $item_id;
+		return $item;
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/include/forumform.inc.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/include/forumform.inc.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/include/forumform.inc.php	(revision 405)
@@ -0,0 +1,206 @@
+<?php
+// $Id: forumform.inc.php,v 1.5 2005/09/04 20:46:10 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+if (!defined('XOOPS_ROOT_PATH')) {
+    exit();
+}
+include_once XOOPS_ROOT_PATH."/class/xoopslists.php";
+include_once XOOPS_ROOT_PATH."/include/xoopscodes.php";
+
+$token=&XoopsMultiTokenHandler::quickCreate('newbb_post');
+
+echo "<form action='post.php' method='post' name='forumform' id='forumform' onsubmit='return xoopsValidate(\"subject\", \"message\", \"contents_submit\", \"".htmlspecialchars(_PLZCOMPLETE, ENT_QUOTES)."\", \"".htmlspecialchars(_MESSAGETOOLONG, ENT_QUOTES)."\", \"".htmlspecialchars(_ALLOWEDCHAR, ENT_QUOTES)."\", \"".htmlspecialchars(_CURRCHAR, ENT_QUOTES)."\");'><table cellspacing='1' class='outer' width='100%'><tr><td class='head' width='25%' valign='top'>". _MD_ABOUTPOST .":</td>";
+echo $token->getHtml();
+
+if ( $forumdata['forum_type'] == 1 ) {
+    echo "<td class='even'>". _MD_PRIVATE ."</td>";
+} elseif ( $forumdata['forum_access'] == 1 ) {
+    echo "<td class='even'>". _MD_REGCANPOST ."</td>";
+} elseif ( $forumdata['forum_access'] == 2 ) {
+    echo "<td class='even'>". _MD_ANONCANPOST ."</td>";
+} elseif ( $forumdata['forum_access'] == 3 ) {
+    echo "<td class='even'>". _MD_MODSCANPOST ."</td>";
+}
+
+echo "</tr>
+<tr>
+<td class='head' valign='top' nowrap='nowrap'>". _MD_SUBJECTC ."</td>
+<td class='odd'>";
+
+echo "<input type='text' id='subject' name='subject' size='60' maxlength='100' value='$subject' /></td></tr>
+<tr>
+<td class='head' valign='top' nowrap='nowrap'>". _MD_RESPONSE ."</td>
+<td class='even'>
+";
+
+// ÂÐ±þ¾õ¶·
+echo " <select name='response'>";
+echo "<option value=''>ÁªÂò¤Ê¤·</option>";
+foreach ($arrResponse as $key => $val){
+	echo "<option value='" . $key . "' >" . $val . "</option>";
+}
+
+echo "</select></td></tr>
+<tr>
+<td class='head' valign='top' nowrap='nowrap'>". _MD_MESSAGEICON ."</td>
+<td class='odd'>
+";
+
+
+$lists = new XoopsLists;
+$filelist = $lists->getSubjectsList();
+$count = 1;
+while ( list($key, $file) = each($filelist) ) {
+    $checked = "";
+    if ( isset($icon) && $file==$icon ) {
+        $checked = " checked='checked'";
+    }
+    echo "<input type='radio' value='$file' name='icon'$checked />&nbsp;";
+    echo "<img src='".XOOPS_URL."/images/subject/$file' alt='' />&nbsp;";
+    if ( $count == 8 ) {
+        echo "<br />";
+        $count = 0;
+    }
+    $count++;
+}
+
+echo "</td></tr>
+<tr align='left'>
+<td class='head' valign='top' nowrap='nowrap'>". _MD_MESSAGEC ."
+</td>
+<td class='even'>";
+xoopsCodeTarea("message");
+
+if ( !empty($isreply) && isset($hidden) && $hidden != "" ) {
+    echo "<input type='hidden' name='isreply' value='1' />";
+    echo "<input type='hidden' name='hidden' id='hidden' value='$hidden' />
+    <input type='button' name='quote' class='formButton' value='"._MD_QUOTE."' onclick='xoopsGetElementById(\"message\").value=xoopsGetElementById(\"message\").value + xoopsGetElementById(\"hidden\").value; xoopsGetElementById(\"hidden\").value=\"\";' /><br />";
+}
+xoopsSmilies("message");
+
+echo "</td></tr>
+<tr>";
+echo "<td class='head' valign='top' nowrap='nowrap'>"._MD_OPTIONS."</td>\n";
+echo "<td class='odd'>";
+
+if ( $xoopsUser && $forumdata['forum_access'] == 2 && !empty($post_id) ) {
+    echo "<input type='checkbox' name='noname' value='1'";
+    if ( isset($noname) && $noname ) {
+        echo " checked='checked'";
+    }
+    echo " />&nbsp;"._MD_POSTANONLY."<br />\n";
+}
+
+echo "<input type='checkbox' name='nosmiley' value='1'";
+if ( isset($nosmiley) && $nosmiley ) {
+    echo " checked='checked'";
+}
+echo " />&nbsp;"._MD_DISABLESMILEY."<br />\n";
+
+if ( $forumdata['allow_html'] ) {
+    echo "<input type='checkbox' name='nohtml' value='1'";
+    if ( $nohtml ) {
+        echo " checked='checked'";
+    }
+    echo " />&nbsp;"._MD_DISABLEHTML."<br />\n";
+} else {
+    echo "<input type='hidden' name='nohtml' value='1' />";
+}
+
+if ( $forumdata['allow_sig'] && $xoopsUser ) {
+    echo "<input type='checkbox' name='attachsig' value='1'";
+    if (isset($_POST['contents_preview'])) {
+        if ( $attachsig ) {
+            echo " checked='checked' />&nbsp;";
+        } else {
+            echo " />&nbsp;";
+        }
+    } else {
+        if ($xoopsUser->getVar('attachsig') || !empty($attachsig)) {
+            echo " checked='checked' />&nbsp;";
+        } else {
+            echo "/>&nbsp;";
+        }
+    }
+
+    echo _MD_ATTACHSIG."<br />\n";
+}
+
+if (!empty($xoopsUser) && !empty($xoopsModuleConfig['notification_enabled'])) {
+    echo "<input type='hidden' name='istopic' value='1' />";
+    echo "<input type='checkbox' name='notify' value='1'";
+    if (!empty($notify)) {
+        // If 'notify' set, use that value (e.g. preview)
+        echo ' checked="checked"';
+    } else {
+        // Otherwise, check previous subscribed status...
+        $notification_handler =& xoops_gethandler('notification');
+        if (!empty($topic_id) && $notification_handler->isSubscribed('thread', $topic_id, 'new_post', $xoopsModule->getVar('mid'), $xoopsUser->getVar('uid'))) {
+            echo ' checked="checked"';
+        }
+    }
+    echo " />&nbsp;"._MD_NEWPOSTNOTIFY."<br />\n";
+}
+echo "</td></tr>";
+echo "<tr><td class='head' valign='top' nowrap='nowrap'>";
+echo "Åê¹Æ»þ¤Î¤´Ãí°Õ¡§";
+echo "</td><td class='even' height=\"90\"><div class=\"box\">";
+echo "¤³¤Î¥µ¥¤¥È¤Ï£Å£Ã¥ª¡¼¥×¥ó¥½¡¼¥¹¥½¥Õ¥È¥¦¥§¥¢¤Ç¤¢¤ë¡Ö£Å£Ã¡Ý£Ã£Õ£Â£Å¡×¤Î³«È¯¥³¥ß¥å¥Ë¥Æ¥£¤Ç¤¹¡£¤¢¤Ê¤¿¤¬Åê¹Æ¤·¤Æ¤¤¤¿¤À¤¤¤¿ÆâÍÆ¤Ï¡¢ÉÔ¶ñ¹çÊó¹ð¡¢°Õ¸«¡¢¥¢¥¤¥Ç¥£¥¢¡¢¥×¥í¥°¥é¥à¥³¡¼¥É¤½¤ÎÂ¾ÆâÍÆ¤ÎÇ¡²¿¤òÌä¤ï¤º¡¢¡Ö£Å£Ã¡Ý£Ã£Õ£Â£Å¡×¤Î³«È¯¤ËÍøÍÑ¤µ¤ì¡¢<a href=\"http://www.fsf.org/licenses/\" target=\"_blank\">£Ç£Ð£Ì¥é¥¤¥»¥ó¥¹¢¨</a>¤Î²¼¤ÇÈÒÉÛ¤µ¤ì¤ë³«È¯À®²ÌÊª¤Ë¼è¤ê¹þ¤Þ¤ì¤ë¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£<br />
+¥×¥í¥°¥é¥à¥³¡¼¥É¤ä¥Ç¥¶¥¤¥óÅù¤ÎÅê¹Æ¤â´¿·Þ¤¤¤¿¤·¤Æ¤ª¤ê¤Þ¤¹¤¬¡¢Åê¹Æ¤ËºÝ¤·¤Æ¤Ï¡¢¤¢¤Ê¤¿¤¬ÁÏºî¤·¡¢Âè»°¼Ô¤¬¸¢Íø¤òÊÝ»ý¤·¤Æ¤¤¤Ê¤¤¤â¤Î¤Î¤ß¤òÅê¹Æ¤·¤Æ¤¯¤À¤µ¤¤¡£Âè»°¼Ô¤¬Ãøºî¸¢¤ä¤½¤ÎÂ¾¤ÎÃÎÅªºâ»º¸¢¤òÍ­¤·¤Æ¤¤¤ë¤â¤Î¤òÅê¹Æ¤µ¤ì¤Þ¤¹¤È¡¢¤½¤ÎÊý¤Î¸¢Íø¤¬¿¯³²¤µ¤ì¡¢¤¢¤Ê¤¿¤¬Ë¡Åª¤ËÇå½þÀÕÇ¤¤òÉé¤¦¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£<br />
+¤Þ¤¿¡Ö£Å£Ã¡Ý£Ã£Õ£Â£Å¡×¤Ï¥Ç¥å¥¢¥ë¥é¥¤¥»¥ó¥¹Êý¼°¤òºÎÍÑ¤·¤Æ¤ª¤ê¡¢£Ç£Ð£Ì¥é¥¤¥»¥ó¥¹¤Ç¤Ï¤Ê¤¯¡¢³ô¼°²ñ¼Ò¥í¥Ã¥¯¥ª¥ó¤¬ÆÈ¼«¤ËÀßÄê¤¹¤ë¥¯¥í¡¼¥º¥É¥½¡¼¥¹¥é¥¤¥»¥ó¥¹¤Î²¼¤ÇÈÒÉÛ¤µ¤ì¤ë¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£¤³¤ì¤ò²ÄÇ½¤È¤¹¤ë¤¿¤á¡¢¤¢¤Ê¤¿¤ÎÅê¹ÆÆâÍÆ¤¬Ãøºî¸¢Ë¡¾å¤ÎÃøºîÊª¤Ç¤¢¤ë¾ì¹ç¤Ë¤Ï¡¢Åê¹Æ¤ÈÆ±»þ¤Ë¡¢¤¢¤Ê¤¿¤ÎÃøºî¸¢ºâ»º¸¢¤ò³ô¼°²ñ¼Ò¥í¥Ã¥¯¥ª¥ó¤Ë°ÜÅ¾¤·¡¢Ãøºî¼Ô¿Í³Ê¸¢¤ò¹Ô»È¤·¤Ê¤¤¤³¤È¤Ë¤´Æ±°Õ¤¤¤¿¤À¤¯¤³¤È¤È¤Ê¤ê¤Þ¤¹¡£<br /><br />
+
+°Ê¾å¤ÎÃí°Õ»ö¹à¤ËÆ±°Õ¤¤¤¿¤À¤¤¤¿¾ì¹ç¤Î¤ßÅê¹Æ¥Ü¥¿¥ó¤ò²¡¤·¤Æ¤¯¤À¤µ¤¤¡£<br /><br />
+
+¢¨GPL¤Ï¡¢±Ñ¸ì¤Ç½ñ¤«¤ì¤¿¤â¤Î¤¬Ë¡Åª¤Ê¹´Â«ÎÏ¤ò¤â¤ÄÍ£°ì¤ÎÀµÊ¸¤Ç¤¹¤¬¡¢Èó¸ø¼°¤Ê<a href=\"http://www.opensource.jp/gpl/gpl.ja.html\" target=\"_blank\">ÆüËÜ¸ìÌõ¤Ï¤³¤Á¤é</a>¤ò¤´»²¾È¤¯¤À¤µ¤¤¡£
+";
+
+$post_id = isset($post_id) ? intval($post_id) : '';
+$topic_id = isset($topic_id) ? intval($topic_id) : '';
+$order = isset($order) ? intval($order) : '';
+$pid = isset($pid) ? intval($pid) : 0;
+echo "</div></td></tr>
+<tr><td class='head'></td><td class='odd'>
+<input type='hidden' name='pid' value='".intval($pid)."' />
+<input type='hidden' name='post_id' value='".$post_id."' />
+<input type='hidden' name='topic_id' value='".$topic_id."' />
+<input type='hidden' name='forum' value='".intval($forum)."' />
+<input type='hidden' name='viewmode' value='$viewmode' />
+<input type='hidden' name='order' value='".$order."' />
+<input type='submit' name='contents_preview' class='formButton' value='"._PREVIEW."' />&nbsp;<input type='submit' name='contents_submit' class='formButton' id='contents_submit' value='"._MD_POST."' />
+<input type='button' onclick='location=\"";
+if ( isset($topic_id) && $topic_id != "" ) {
+    echo "viewtopic.php?topic_id=".intval($topic_id)."&amp;forum=".intval($forum)."\"'";
+} else {
+    echo "viewforum.php?forum=".intval($forum)."\"'";
+}
+echo " class='formButton' value='"._MD_CANCELPOST."' />";
+echo "</td></tr></table></form>\n";
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/include/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/include/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/include/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/language/japanese/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/language/japanese/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/language/japanese/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/language/japanese/main.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/language/japanese/main.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/language/japanese/main.php	(revision 405)
@@ -0,0 +1,187 @@
+<?php
+
+//%%%%%%		Module Name phpBB  		%%%%%
+//functions.php
+define("_MD_ERROR","¥¨¥é¡¼");
+define("_MD_NOPOSTS","Åê¹Æ¤Ï¤¢¤ê¤Þ¤»¤ó");
+define("_MD_GO","Åê¹Æ");
+
+//index.php
+define("_MD_FORUM","¥Õ¥©¡¼¥é¥à");
+define("_MD_WELCOME","%s ¥Õ¥©¡¼¥é¥à¤Ø¤è¤¦¤³¤½");
+define("_MD_TOPICS","¥¹¥ì¥Ã¥É");
+define("_MD_POSTS","Åê¹Æ");
+define("_MD_LASTPOST","ºÇ½ªÅê¹Æ");
+define("_MD_MODERATOR","¥â¥Ç¥ì¡¼¥¿");
+define("_MD_NEWPOSTS","ºÇ½ªË¬ÌäÆü°Ê¹ß¤Î¿·¤·¤¤Åê¹Æ¤¬¤¢¤ê¤Þ¤¹");
+define("_MD_NONEWPOSTS","ºÇ½ªË¬ÌäÆü°Ê¹ß¤Î¿·¤·¤¤Åê¹Æ¤Ï¤¢¤ê¤Þ¤»¤ó");
+define("_MD_PRIVATEFORUM","¥×¥é¥¤¥Ù¡¼¥È¡¦¥Õ¥©¡¼¥é¥à");
+define("_MD_BY","Åê¹Æ¼Ô¡§"); // Posted by
+define("_MD_TOSTART","¶½Ì£¤Î¤¢¤ë¥Õ¥©¡¼¥é¥à¤Ø¤¼¤Ò¤´»²²Ã¤¯¤À¤µ¤¤¡£");
+define("_MD_TOTALTOPICSC","Áí¥¹¥ì¥Ã¥É¿ô: ");
+define("_MD_TOTALPOSTSC","ÁíÅê¹Æ¿ô: ");
+define("_MD_TIMENOW","¸½ºß¤Î»þ¹ï: %s");
+define("_MD_LASTVISIT","ºÇ½ªË¬ÌäÆü»þ: %s");
+define("_MD_ADVSEARCH","¾ò·ï¸¡º÷");
+define("_MD_POSTEDON","Åê¹ÆÆü»þ: ");
+define("_MD_SUBJECT","ÂêÌ¾");
+
+//page_header.php
+define("_MD_MODERATEDBY","¥â¥Ç¥ì¡¼¥¿ ");
+define("_MD_SEARCH","¸¡º÷");
+define("_MD_SEARCHRESULTS","¸¡º÷·ë²Ì");
+define("_MD_FORUMINDEX","¥á¥¤¥ó");
+define("_MD_POSTNEW","¿·µ¬¥¹¥ì¥Ã¥ÉºîÀ®²èÌÌ¤Ø");
+define("_MD_REGTOPOST","Åê¹Æ¤¹¤ë¤Ë¤Ï¤Þ¤ºÅÐÏ¿¤ò");
+
+//search.php
+define("_MD_KEYWORDS","¥­¡¼¥ï¡¼¥É:");
+define("_MD_SEARCHANY","»ØÄê¤·¤¿¤¤¤¯¤Ä¤«¤Î¾ò·ï¤Ç¸¡º÷¡Ê¥Ç¥Õ¥©¥ë¥È¡Ë");
+define("_MD_SEARCHALL","»ØÄê¤·¤¿Á´¤Æ¤Î¾ò·ï¤Ç¸¡º÷");
+define("_MD_SEARCHALLFORUMS","Á´¤Æ¤Î¥Õ¥©¡¼¥é¥à¤ò¸¡º÷");
+define("_MD_FORUMC","¥Õ¥©¡¼¥é¥à¡§");
+define("_MD_AUTHORC","Åê¹Æ¼Ô¡§");
+define("_MD_SORTBY","¥½¡¼¥È½ç:");
+define("_MD_DATE","Æü»þ");
+define("_MD_TOPIC","¥¹¥ì¥Ã¥É");
+define("_MD_USERNAME","¥æ¡¼¥¶Ì¾");
+define("_MD_SEARCHIN","¸¡º÷ÂÐ¾Ý¡§");
+define("_MD_BODY","ËÜÊ¸");
+define("_MD_NOMATCH","¸¡º÷¾ò·ï¤Ë°ìÃ×¤¹¤ë¥Ç¡¼¥¿¤Ï¸«¤Ä¤«¤ê¤Þ¤»¤ó¤Ç¤·¤¿");
+define("_MD_POSTTIME","Åê¹ÆÆü»þ");
+
+//viewforum.php
+define("_MD_REPLIES","ÊÖ¿®");
+define("_MD_POSTER","Åê¹Æ¼Ô");
+define("_MD_VIEWS","±ÜÍ÷");
+define("_MD_MORETHAN","¿Íµ¤¥¹¥ì¥Ã¥É¡ª");//New posts [ Popular ]
+define("_MD_MORETHAN2","¿Íµ¤¥¹¥ì¥Ã¥É¡ª");
+define("_MD_TOPICLOCKED","¥í¥Ã¥¯¤µ¤ì¤¿¥¹¥ì¥Ã¥É");
+define("_MD_LEGEND","Legend"); //[MADA]
+define("_MD_NEXTPAGE","¼¡¤Î¥Ú¡¼¥¸");
+define("_MD_SORTEDBY","¥½¡¼¥È½ç:");
+define("_MD_TOPICTITLE","¥¹¥ì¥Ã¥É¥¿¥¤¥È¥ë");
+define("_MD_NUMBERREPLIES","ÊÖ¿®");
+define("_MD_TOPICPOSTER","Åê¹Æ¼Ô");
+define("_MD_LASTPOSTTIME","Åê¹ÆÆü»þ");
+define("_MD_ASCENDING","¾º½ç");
+define("_MD_DESCENDING","¹ß½ç");
+define("_MD_FROMLASTDAYS","²áµî%sÆüÊ¬");
+define("_MD_THELASTYEAR","²áµî1Ç¯Ê¬");
+define("_MD_BEGINNING","Á´¤Æ");
+define("_MD_RESPONSE","ÂÐ±þ¾õ¶·");
+
+//viewtopic.php
+define("_MD_AUTHOR","Åê¹Æ¼Ô");
+define("_MD_LOCKTOPIC","¤³¤Î¥¹¥ì¥Ã¥É¤ò¥í¥Ã¥¯");
+define("_MD_UNLOCKTOPIC","¤³¤Î¥¹¥ì¥Ã¥É¤Î¥í¥Ã¥¯¤ò²ò½ü");
+
+define("_MD_MOVETOPIC","¤³¤Î¥¹¥ì¥Ã¥É¤ò°ÜÆ°");
+define("_MD_DELETETOPIC","¤³¤Î¥¹¥ì¥Ã¥É¤òºï½ü");
+define("_MD_TOP","¥È¥Ã¥×");
+define("_MD_PARENT","¿Æ¥¹¥ì¥Ã¥É");
+define("_MD_PREVTOPIC","Á°¤Î¥È¥Ô¥Ã¥¯");
+define("_MD_NEXTTOPIC","¼¡¤Î¥È¥Ô¥Ã¥¯");
+
+//forumform.inc
+define("_MD_ABOUTPOST","Åê¹Æ¤Ë´Ø¤·¤Æ");
+define("_MD_ANONCANPOST","¤³¤Î¥Õ¥©¡¼¥é¥à¤Ç¤ÏÁ´¤Æ¤ÎË¬Ìä¼Ô¤ÎÊý¤Ë¤è¤ëÅê¹Æ¤¬µö²Ä¤µ¤ì¤Æ¤¤¤Þ¤¹¡£");
+define("_MD_PRIVATE","<b>¥×¥é¥¤¥Ù¡¼¥È¡¦¥Õ¥©¡¼¥é¥à</b>.<br />¥¢¥¯¥»¥¹µö²Ä¤µ¤ì¤¿¥æ¡¼¥¶¤Î¤ßÅê¹Æ¤¬²ÄÇ½¤Ç¤¹¡£");
+define("_MD_REGCANPOST","¤³¤Î¥Õ¥©¡¼¥é¥à¤ÇÅê¹Æ¤¬¹Ô¤¨¤ë¤Î¤Ï¥á¥ó¥Ð¡¼ÅÐÏ¿¼Ô¤ÎÊý¤Î¤ß¤Ç¤¹¡£");
+define("_MD_MODSCANPOST","¤³¤Î¥Õ¥©¡¼¥é¥à¤ÇÅê¹Æ¤¬¹Ô¤¨¤ë¤Î¤Ï´ÉÍý¼Ô¡¿¥â¥Ç¥ì¡¼¥¿¤Î¤ß¤Ç¤¹¡£");
+define("_MD_PREVPAGE","Á°¤Î¥Ú¡¼¥¸");
+define("_MD_QUOTE","°úÍÑ");
+
+// ERROR messages
+define("_MD_ERRORFORUM","¥¨¥é¡¼: ¥Õ¥©¡¼¥é¥à¤¬ÁªÂò¤µ¤ì¤Æ¤¤¤Þ¤»¤ó");
+define("_MD_ERRORPOST","¥¨¥é¡¼: Åê¹Æ¤¬ÁªÂò¤µ¤ì¤Æ¤¤¤Þ¤»¤ó");
+define("_MD_NORIGHTTOPOST","¤³¤Î¥Õ¥©¡¼¥é¥à¤ËÅê¹Æ¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£");
+define("_MD_NORIGHTTOACCESS","¤³¤Î¥Õ¥©¡¼¥é¥à¤Ø¥¢¥¯¥»¥¹¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£");
+define("_MD_ERRORTOPIC","¥¨¥é¡¼: ¥¹¥ì¥Ã¥É¤¬ÁªÂò¤µ¤ì¤Æ¤¤¤Þ¤»¤ó");
+define("_MD_ERRORCONNECT","¥¨¥é¡¼: ¥Õ¥©¡¼¥é¥à¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë¥¢¥¯¥»¥¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£");
+define("_MD_ERROREXIST","¥¨¥é¡¼: ÁªÂò¤µ¤ì¤¿¥Õ¥©¡¼¥é¥à¤Ï¸«¤Ä¤«¤ê¤Þ¤»¤ó¤Ç¤·¤¿¡£¤â¤¦°ìÅÙ¤ä¤êÄ¾¤·¤Æ¤¯¤À¤µ¤¤¡£");
+define("_MD_ERROROCCURED","¥¨¥é¡¼¤¬È¯À¸¤·¤Þ¤·¤¿¡£");
+define("_MD_COULDNOTQUERY","¥Õ¥©¡¼¥é¥à¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÌä¤¤¹ç¤ï¤»¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£");
+define("_MD_FORUMNOEXIST","¥¨¥é¡¼¡§ÁªÂò¤µ¤ì¤¿¥Õ¥©¡¼¥é¥à¡¿¥¹¥ì¥Ã¥É¤¬¸«¤Ä¤«¤ê¤Þ¤»¤ó¤Ç¤·¤¿¡£¤â¤¦°ìÅÙ¤ä¤êÄ¾¤·¤Æ¤¯¤À¤µ¤¤¡£");
+define("_MD_USERNOEXIST","¸¡º÷¤µ¤ì¤¿¥á¥ó¥Ð¡¼¤Ï¸«¤Ä¤«¤ê¤Þ¤»¤ó¤Ç¤·¤¿¡£");
+define("_MD_COULDNOTREMOVE","¥¨¥é¡¼¡§¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤éÅê¹ÆÊ¸¤òºï½ü¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£");
+define("_MD_COULDNOTREMOVETXT","¥¨¥é¡¼¡§Åê¹ÆÊ¸¤òºï½ü¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£");
+
+//reply.php
+define("_MD_ON","Åê¹ÆÆü»þ¡§"); //Posted on
+define("_MD_USERWROTE","%s¤µ¤ó¤Ï½ñ¤­¤Þ¤·¤¿¡§"); // %s is username
+
+//post.php
+define("_MD_EDITNOTALLOWED","Åê¹ÆÊ¸¤òÊÔ½¸¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£");
+define("_MD_EDITEDBY","ÊÔ½¸¥í¥°¡§");
+define("_MD_ANONNOTALLOWED","¥²¥¹¥ÈË¬Ìä¼Ô¤ÎÊý¤Ë¤è¤ëÅê¹Æ¤Ïµö²Ä¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£<br />Åê¹Æ¤ò¤´´õË¾¤ÎÊý¤Ï¥á¥ó¥Ð¡¼ÅÐÏ¿¤ò¤·¤Æ²¼¤µ¤¤¡£");
+define("_MD_THANKSSUBMIT","Åê¹Æ¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£");
+define("_MD_REPLYPOSTED","ÊÖ¿®¤¬Åê¹Æ¤µ¤ì¤Þ¤·¤¿¡£");
+define("_MD_HELLO","¤³¤ó¤Ë¤Á¤Ï %s ¤µ¤ó¡¢");
+define("_MD_URRECEIVING","%s ¥Õ¥©¡¼¥é¥à¤ØÅê¹Æ¤·¤¿¥á¥Ã¥»¡¼¥¸¤ËÂÐ¤·ÊÖ¿®¤¬¤¢¤ê¤Þ¤·¤¿¤Î¤Ç¤ªÃÎ¤é¤»¤·¤Þ¤¹¡£"); // %s ¤Ï¤¢¤Ê¤¿¤Î¥µ¥¤¥ÈÌ¾
+//¡ö¡¡¾åµ­¤ÎÏÂÌõÊ¸¤Ïmail¤Ç»ÈÍÑ¤¹¤ë°Ù¡¢Ê¸»ú²½¤±ÂÐºö¤ò¤·¤Æ¤¤¤Ê¤¤¾ì¹ç¤ÏÊ¸»ú²½¤±¤·¤Þ¤¹¡£
+define("_MD_CLICKBELOW","Åê¹Æ¤ò¸«¤ë¤Ë¤Ï²¼µ­¥ê¥ó¥¯¤ò¥¯¥ê¥Ã¥¯¤·¤Æ¤¯¤À¤µ¤¤¡£");
+
+//forumform.inc
+define("_MD_YOURNAME","¥æ¡¼¥¶Ì¾:");
+define("_MD_LOGOUT","¥í¥°¥¢¥¦¥È");
+define("_MD_REGISTER","ÅÐÏ¿");
+define("_MD_SUBJECTC","ÂêÌ¾¡§");
+define("_MD_MESSAGEICON","¥á¥Ã¥»¡¼¥¸¥¢¥¤¥³¥ó:");
+define("_MD_MESSAGEC","¥á¥Ã¥»¡¼¥¸:");
+define("_MD_ALLOWEDHTML","»ÈÍÑ²ÄÇ½¤ÊHTML¥¿¥° :");
+define("_MD_OPTIONS","¥ª¥×¥·¥ç¥ó:");
+define("_MD_POSTANONLY","Æ¿Ì¾¤ÇÅê¹Æ¤¹¤ë");
+define("_MD_DISABLESMILEY","´é¥¢¥¤¥³¥ó¤òÌµ¸ú¤Ë¤¹¤ë");
+define("_MD_DISABLEHTML","HTML¥¿¥°¤òÌµ¸ú¤Ë¤¹¤ë");
+define("_MD_NEWPOSTNOTIFY", "¤³¤Î¥¹¥ì¥Ã¥É¤Ë¤ª¤¤¤Æ¿·µ¬Åê¹Æ¤¬¤¢¤Ã¤¿¾ì¹ç¤ËÄÌÃÎ¤¹¤ë");
+define("_MD_ATTACHSIG","½ðÌ¾¤òÉÕ¤±¤ë");
+define("_MD_POST","Ãí°Õ»ö¹à¤ËÆ±°Õ¤·¤¿¾å¤ÇÅê¹Æ¤¹¤ë");
+define("_MD_SUBMIT","³ÎÄê");
+define("_MD_CANCELPOST","Åê¹ÆÃæ»ß");
+
+// forumuserpost.php
+define("_MD_ADD","ÄÉ²Ã");
+define("_MD_REPLY","¤³¤ÎÅê¹Æ¤ËÊÖ¿®¤¹¤ë");
+
+// topicmanager.php
+define("_MD_YANTMOTFTYCPTF","¤³¤Îµ¡Ç½¤ò»ÈÍÑ¤Ç¤­¤ë¤Î¤Ï¥â¥Ç¥ì¡¼¥¿¡¿´ÉÍý¼Ô¤Î¤ß¤Ç¤¹¡£");
+define("_MD_TTHBRFTD","¥¹¥ì¥Ã¥É¤ò¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤éºï½ü¤·¤Þ¤·¤¿¡£");
+define("_MD_RETURNTOTHEFORUM","¥Õ¥©¡¼¥é¥à¤ØÌá¤ë");
+define("_MD_RTTFI","¥Õ¥©¡¼¥é¥à¥á¥¤¥ó¤ØÌá¤ë");
+define("_MD_EPGBATA","¥¨¥é¡¼ ¡§ ¤â¤¦°ìÅÙ¤ä¤êÄ¾¤·¤Æ¤¯¤À¤µ¤¤¡£");
+define("_MD_TTHBM","¥¹¥ì¥Ã¥É¤ò°ÜÆ°¤·¤Þ¤·¤¿¡£");
+define("_MD_VTUT","¥¹¥ì¥Ã¥É¤ò¸«¤ë");
+define("_MD_TTHBL","¥¹¥ì¥Ã¥É¤ò¥í¥Ã¥¯¤·¤Þ¤·¤¿¡£");
+
+define("_MD_VIEWTHETOPIC","¥¹¥ì¥Ã¥É¤ò¸«¤ë");
+define("_MD_TTHBU","¥¹¥ì¥Ã¥É¤Î¥í¥Ã¥¯¤ò²ò½ü¤·¤Þ¤·¤¿¡£");
+define("_MD_OYPTDBATBOTFTTY","ºï½ü¥Ü¥¿¥ó¤ò²¡¤¹¤È¡¢ÁªÂò¤·¤¿¥¹¥ì¥Ã¥É¤ª¤è¤Ó¤½¤Î¥¹¥ì¥Ã¥É¤Ë´ØÏ¢¤¹¤ëÅê¹ÆÊ¸¤òºï½ü¤¹¤Þ¤¹¡£");
+define("_MD_OYPTMBATBOTFTTY","°ÜÆ°¥Ü¥¿¥ó¤ò²¡¤¹¤È¡¢ÁªÂò¤·¤¿¥¹¥ì¥Ã¥É¤ª¤è¤Ó¤½¤Î¥¹¥ì¥Ã¥É¤Ë´ØÏ¢¤¹¤ëÅê¹ÆÊ¸¤òÁªÂò¤·¤¿¥Õ¥©¡¼¥é¥à¤Ø°ÜÆ°¤·¤Þ¤¹¡£");
+define("_MD_OYPTLBATBOTFTTY","¥í¥Ã¥¯¥Ü¥¿¥ó¤ò²¡¤¹¤È¡¢ÁªÂò¤·¤¿¥¹¥ì¥Ã¥É¤ò¥í¥Ã¥¯¤·¤Þ¤¹¡Ê¥¹¥ì¥Ã¥ÉÆâ¤Ç¤Î¿·µ¬Åê¹Æ¤ò¼õ¤±ÉÕ¤±¤Ê¤¤¡Ë¡£¥¹¥ì¥Ã¥É¤Î¥í¥Ã¥¯¤Ï¤¤¤Ä¤Ç¤â²ò½ü¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£");
+define("_MD_OYPTUBATBOTFTTY","¥í¥Ã¥¯¥Ü¥¿¥ó¤ò²¡¤¹¤È¡¢ÁªÂò¤·¤¿¥¹¥ì¥Ã¥É¤Î¥í¥Ã¥¯¤ò²ò½ü¤·¤Þ¤¹¡£");
+define("_MD_MOVETOPICTO","°ÜÆ°¤¹¤ë¥¹¥ì¥Ã¥É:");
+define("_MD_NOFORUMINDB","¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë¥Õ¥©¡¼¥é¥à¤Ï¤¢¤ê¤Þ¤»¤ó");
+define("_MD_DATABASEERROR","¥Ç¡¼¥¿¥Ù¡¼¥¹¥¨¥é¡¼");
+define("_MD_DELTOPIC","¥¹¥ì¥Ã¥É¤òºï½ü¤¹¤ë");
+define("_MD_TOPICSTICKY","¤³¤Î¥¹¥ì¥Ã¥É¤Ï¸ÇÄê¤µ¤ì¤Æ¤¤¤Þ¤¹");
+define("_MD_STICKYTOPIC","¤³¤Î¥¹¥ì¥Ã¥É¤ò¸ÇÄê¤¹¤ë");
+define("_MD_UNSTICKYTOPIC","¤³¤Î¥¹¥ì¥Ã¥É¤Î¸ÇÄê¤ò²ò½ü¤¹¤ë");
+define("_MD_TTHBS","¥¹¥ì¥Ã¥É¤ò¸ÇÄê¤·¤Þ¤·¤¿");
+define("_MD_TTHBUS","¥¹¥ì¥Ã¥É¤Î¸ÇÄê¤ò²ò½ü¤·¤Þ¤·¤¿");
+define("_MD_OYPTSBATBOTFTTY","¥¹¥ì¥Ã¥É¸ÇÄê¥Ü¥¿¥ó¤ò²¡¤¹¤È¡¢ÁªÂò¤·¤¿¥¹¥ì¥Ã¥É¤ò¸ÇÄê¤·¤Þ¤¹¡Ê¾ï¤Ë¥Õ¥©¡¼¥é¥àºÇ¾åÉô¤ËÉ½¼¨¡Ë¡£¥¹¥ì¥Ã¥É¤Î¸ÇÄê¤Ï¤¤¤Ä¤Ç¤â²ò½ü¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£");
+define("_MD_OYPTTBATBOTFTTY","¥¹¥ì¥Ã¥É¸ÇÄê¥Ü¥¿¥ó¤ò²¡¤¹¤È¡¢ÁªÂò¤·¤¿¥¹¥ì¥Ã¥É¤Î¸ÇÄê¤ò²ò½ü¤·¤Þ¤¹¡£¥¹¥ì¥Ã¥É¤Ï¤¤¤Ä¤Ç¤âºÆÅÙ¸ÇÄê¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£");
+
+// delete.php
+define("_MD_DELNOTALLOWED","¤³¤ÎÅê¹Æ¤òºï½ü¤¹¤ë¸¢¸Â¤¬¤¢¤ê¤Þ¤»¤ó¡£");
+define("_MD_AREUSUREDEL","¤³¤ÎÅê¹Æ¤ª¤è¤Ó¤³¤ÎÅê¹Æ¤ËÂÐ¤¹¤ëÊÖ¿®¤òÁ´¤Æºï½ü¤·¤Æ¤â¤¤¤¤¤Ç¤¹¤«¡©");
+define("_MD_POSTSDELETED","ÁªÂò¤·¤¿Åê¹Æ¤òºï½ü¤·¤Þ¤·¤¿¡£");
+
+// definitions moved from global.
+define("_MD_THREAD","¥¹¥ì¥Ã¥É");
+define("_MD_FROM","µï½»ÃÏ");
+define("_MD_JOINED","ÅÐÏ¿Æü");
+define("_MD_ONLINE","¥ª¥ó¥é¥¤¥ó");
+define("_MD_BOTTOM","²¼¤Ø");
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/language/japanese/mail_template/global_newforum_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/language/japanese/mail_template/global_newforum_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/language/japanese/mail_template/global_newforum_notify.tpl	(revision 405)
@@ -0,0 +1,19 @@
+{X_UNAME}¤µ¤ó¡¢¤³¤ó¤Ë¤Á¤Ï
+
+¡Ö{X_SITENAME}¡×¤Ë¤ª¤¤¤Æ¿·µ¬¥Õ¥©¡¼¥é¥à¡Ö{FORUM_NAME}¡×¤¬³«Àß¤µ¤ì¤Þ¤·¤¿¡£
+
+¥Õ¥©¡¼¥é¥à¤Î³µÍ×¡§{FORUM_DESCRIPTION}
+¥Õ¥©¡¼¥é¥à¤ÎURL¡§{FORUM_URL}
+
+-----------
+
+¤³¤Î¥á¡¼¥ë¤ÏXOOPS¤Î¼«Æ°ÄÌÃÎµ¡Ç½¤Ë¤è¤Ã¤ÆÁ÷¿®¤µ¤ì¤Æ¤¤¤Þ¤¹
+
+¼«Æ°ÄÌÃÎ¤òÄä»ß¤·¤¿¤¤¾ì¹ç¤Ï²¼µ­¤ÎURL¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡§
+{X_UNSUBSCRIBE_URL}
+
+-----------
+{X_SITENAME} ({X_SITEURL}) 
+´ÉÍý¿Í
+{X_ADMINMAIL}
+-----------
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/language/japanese/mail_template/global_newfullpost_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/language/japanese/mail_template/global_newfullpost_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/language/japanese/mail_template/global_newfullpost_notify.tpl	(revision 405)
@@ -0,0 +1,32 @@
+{X_UNAME}¤µ¤ó¡¢¤³¤ó¤Ë¤Á¤Ï
+
+EC-CUBE¥³¥ß¥å¥Ë¥Æ¥£¥µ¥¤¥È¤Ë¤ª¤¤¤Æ¿·µ¬Åê¹Æ¤¬¤¢¤ê¤Þ¤·¤¿¡£
+
+¤³¤ÎÅê¹Æ¤ò¸«¤ë¤Ë¤Ï²¼µ­URL¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡§
+{POST_URL}
+
+¢§---¥Õ¥©¡¼¥é¥à¾ðÊó--------------------------------------------
+
+Åê¹Æ¼ÔÌ¾¡¡¡¡¡§¡¡{USER_NAME}
+¥Õ¥©¡¼¥é¥àÌ¾¡§¡¡{FORUM_NAME}
+¥¹¥ì¥Ã¥ÉÌ¾¡¡¡§¡¡{THREAD_NAME}
+¥¿¥¤¥È¥ë¡¡¡¡¡§{POST_NAME}
+
+
+¢§---Åê¹ÆÆâÍÆ-------------------------------------------------
+
+{POST_CONTENT}
+
+
+¨®¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¯
+¡¡¢¨¤³¤Î¥á¡¼¥ë¤ÏXOOPS¤Î¼«Æ°ÄÌÃÎµ¡Ç½¤Ë¤è¤Ã¤ÆÁ÷¿®¤µ¤ì¤Æ¤¤¤Þ¤¹
+
+¡¡¼«Æ°ÄÌÃÎ¤òÄä»ß¤·¤¿¤¤¾ì¹ç¤Ï²¼µ­¤ÎURL¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡§
+¡¡{X_UNSUBSCRIBE_URL}
+¨±¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨°
+
+------------------------------------------------------------
+{X_SITENAME} ({X_SITEURL}) 
+´ÉÍý¿Í
+{X_ADMINMAIL}
+------------------------------------------------------------
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/language/japanese/mail_template/thread_newpost_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/language/japanese/mail_template/thread_newpost_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/language/japanese/mail_template/thread_newpost_notify.tpl	(revision 405)
@@ -0,0 +1,21 @@
+{X_UNAME}¤µ¤ó¡¢¤³¤ó¤Ë¤Á¤Ï
+
+EC-CUBE¥³¥ß¥å¥Ë¥Æ¥£¥µ¥¤¥È¤Ë¤ª¤¤¤Æ¿·µ¬Åê¹Æ¤¬¤¢¤ê¤Þ¤·¤¿¡£
+
+¢§---¥Õ¥©¡¼¥é¥à¾ðÊó--------------------------------------------
+
+¿·µ¬Åê¹Æ¤ÎURL¡§{POST_URL}
+¥¹¥ì¥Ã¥ÉURL¡§{THREAD_URL}
+
+¨®¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¯
+¡¡¢¨¤³¤Î¥á¡¼¥ë¤ÏXOOPS¤Î¼«Æ°ÄÌÃÎµ¡Ç½¤Ë¤è¤Ã¤ÆÁ÷¿®¤µ¤ì¤Æ¤¤¤Þ¤¹
+
+¡¡¼«Æ°ÄÌÃÎ¤òÄä»ß¤·¤¿¤¤¾ì¹ç¤Ï²¼µ­¤ÎURL¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡§
+¡¡{X_UNSUBSCRIBE_URL}
+¨±¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨°
+
+------------------------------------------------------------
+{X_SITENAME} ({X_SITEURL}) 
+´ÉÍý¿Í
+{X_ADMINMAIL}
+------------------------------------------------------------
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/language/japanese/mail_template/forum_newpost_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/language/japanese/mail_template/forum_newpost_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/language/japanese/mail_template/forum_newpost_notify.tpl	(revision 405)
@@ -0,0 +1,23 @@
+{X_UNAME}¤µ¤ó¡¢¤³¤ó¤Ë¤Á¤Ï
+
+EC-CUBE¥³¥ß¥å¥Ë¥Æ¥£¥µ¥¤¥È¤Ë¤ª¤¤¤Æ¿·µ¬Åê¹Æ¤¬¤¢¤ê¤Þ¤·¤¿¡£
+
+¤³¤ÎÅê¹Æ¤ò¸«¤ë¤Ë¤Ï²¼µ­URL¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡§
+{POST_URL}
+
+¢§---¥Õ¥©¡¼¥é¥à¾ðÊó--------------------------------------------
+
+¥Õ¥©¡¼¥é¥àÌ¾¡§¡¡{FORUM_NAME}
+
+¨®¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¯
+¡¡¢¨¤³¤Î¥á¡¼¥ë¤ÏXOOPS¤Î¼«Æ°ÄÌÃÎµ¡Ç½¤Ë¤è¤Ã¤ÆÁ÷¿®¤µ¤ì¤Æ¤¤¤Þ¤¹
+
+¡¡¼«Æ°ÄÌÃÎ¤òÄä»ß¤·¤¿¤¤¾ì¹ç¤Ï²¼µ­¤ÎURL¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡§
+¡¡{X_UNSUBSCRIBE_URL}
+¨±¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨°
+
+------------------------------------------------------------
+{X_SITENAME} ({X_SITEURL}) 
+´ÉÍý¿Í
+{X_ADMINMAIL}
+------------------------------------------------------------
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/language/japanese/mail_template/forum_newthread_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/language/japanese/mail_template/forum_newthread_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/language/japanese/mail_template/forum_newthread_notify.tpl	(revision 405)
@@ -0,0 +1,31 @@
+{X_UNAME}¤µ¤ó¡¢¤³¤ó¤Ë¤Á¤Ï
+
+EC-CUBE¥³¥ß¥å¥Ë¥Æ¥£¥µ¥¤¥È¤Ë¤ª¤¤¤Æ¿·µ¬Åê¹Æ¤¬¤¢¤ê¤Þ¤·¤¿¡£
+
+¤³¤ÎÅê¹Æ¤ò¸«¤ë¤Ë¤Ï²¼µ­URL¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡§
+{POST_URL}
+
+¢§---¥Õ¥©¡¼¥é¥à¾ðÊó--------------------------------------------
+
+¥¹¥ì¥Ã¥ÉÌ¾¡¡ ¡§{THREAD_NAME}
+¥¹¥ì¥Ã¥ÉURL¡¡¡§{THREAD_URL}
+¥Õ¥©¡¼¥é¥àURL¡§{FORUM_URL}
+
+
+¢§---Åê¹ÆÆâÍÆ-------------------------------------------------
+
+{POST_CONTENT}
+
+
+¨®¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¯
+¡¡¢¨¤³¤Î¥á¡¼¥ë¤ÏXOOPS¤Î¼«Æ°ÄÌÃÎµ¡Ç½¤Ë¤è¤Ã¤ÆÁ÷¿®¤µ¤ì¤Æ¤¤¤Þ¤¹
+
+¡¡¼«Æ°ÄÌÃÎ¤òÄä»ß¤·¤¿¤¤¾ì¹ç¤Ï²¼µ­¤ÎURL¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡§
+¡¡{X_UNSUBSCRIBE_URL}
+¨±¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨°
+
+------------------------------------------------------------
+{X_SITENAME} ({X_SITEURL}) 
+´ÉÍý¿Í
+{X_ADMINMAIL}
+------------------------------------------------------------
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/language/japanese/mail_template/global_newpost_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/language/japanese/mail_template/global_newpost_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/language/japanese/mail_template/global_newpost_notify.tpl	(revision 405)
@@ -0,0 +1,19 @@
+{X_UNAME}¤µ¤ó¡¢¤³¤ó¤Ë¤Á¤Ï
+
+EC-CUBE¥³¥ß¥å¥Ë¥Æ¥£¥µ¥¤¥È¤Ë¤ª¤¤¤Æ¿·µ¬Åê¹Æ¤¬¤¢¤ê¤Þ¤·¤¿¡£
+
+¤³¤ÎÅê¹Æ¤ò¸«¤ë¤Ë¤Ï²¼µ­URL¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡§
+{POST_URL}
+
+¨®¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¯
+¡¡¢¨¤³¤Î¥á¡¼¥ë¤ÏXOOPS¤Î¼«Æ°ÄÌÃÎµ¡Ç½¤Ë¤è¤Ã¤ÆÁ÷¿®¤µ¤ì¤Æ¤¤¤Þ¤¹
+
+¡¡¼«Æ°ÄÌÃÎ¤òÄä»ß¤·¤¿¤¤¾ì¹ç¤Ï²¼µ­¤ÎURL¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡§
+¡¡{X_UNSUBSCRIBE_URL}
+¨±¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨¬¨°
+
+------------------------------------------------------------
+{X_SITENAME} ({X_SITEURL}) 
+´ÉÍý¿Í
+{X_ADMINMAIL}
+------------------------------------------------------------
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/language/japanese/admin.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/language/japanese/admin.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/language/japanese/admin.php	(revision 405)
@@ -0,0 +1,106 @@
+<?php
+//%%%%%%	File Name  index.php   	%%%%%
+define("_MD_A_FORUMCONF","¥Õ¥©¡¼¥é¥à ÀßÄê");
+
+define("_MD_A_ADDAFORUM","¥Õ¥©¡¼¥é¥à¤ÎÄÉ²Ã");
+define("_MD_A_LINK2ADDFORUM","¿·µ¬¤Ë¥Õ¥©¡¼¥é¥à¤òÄÉ²Ã¤·¤Þ¤¹¡£");
+define("_MD_A_EDITAFORUM","¥Õ¥©¡¼¥é¥à¤ÎÊÔ½¸");
+define("_MD_A_LINK2EDITFORUM","¥Õ¥©¡¼¥é¥à¾ðÊó¤òÊÔ½¸¤·¤Þ¤¹¡£");
+define("_MD_A_SETPRIVFORUM","¥×¥é¥¤¥Ù¡¼¥È¥Õ¥©¡¼¥é¥à¤ÎÀßÄê");
+define("_MD_A_LINK2SETPRIV","¥×¥é¥¤¥Ù¡¼¥È¥Õ¥©¡¼¥é¥à¤ÎÀßÄê¤ª¤è¤ÓÊÑ¹¹¤ò¹Ô¤¤¤Þ¤¹¡£");
+define("_MD_A_SYNCFORUM","¥¹¥ì¥Ã¥ÉÅê¹Æ¿ô¤ÎºÆ½¸·×");
+define("_MD_A_LINK2SYNC","¥Õ¥©¡¼¥é¥à¤Ë¤ª¤±¤ëÅê¹Æ¿ô¤òÀµ¤·¤¤¿ô»ú¤Ø¤ÈºÆ½¸·×¤·¤Þ¤¹¡£");
+define("_MD_A_ADDACAT","¥«¥Æ¥´¥ê¤ÎÄÉ²Ã");
+define("_MD_A_LINK2ADDCAT","¥Õ¥©¡¼¥é¥à¤Î¥«¥Æ¥´¥ê¤ò¿·µ¬¤ËÄÉ²Ã¤·¤Þ¤¹¡£");
+define("_MD_A_EDITCATTTL","¥«¥Æ¥´¥ê¤ÎÊÔ½¸");
+define("_MD_A_LINK2EDITCAT","¥Õ¥©¡¼¥é¥à¤Î¥«¥Æ¥´¥êÌ¾¤òÊÔ½¸¤·¤Þ¤¹¡£");
+define("_MD_A_RMVACAT","¥«¥Æ¥´¥ê¤Îºï½ü");
+define("_MD_A_LINK2RMVCAT","¥Õ¥©¡¼¥é¥à¤Î¥«¥Æ¥´¥ê¤òºï½ü¤·¤Þ¤¹¡£");
+define("_MD_A_REORDERCAT","¥«¥Æ¥´¥ê¤ÎÇÛÃÖÊÑ¹¹");
+define("_MD_A_LINK2ORDERCAT","¥Õ¥©¡¼¥é¥à¥«¥Æ¥´¥ê¤ÎÉ½¼¨½ç½ø¤òÊÑ¹¹¤·¤Þ¤¹¡£");
+
+//%%%%%%	File Name  admin_forums.php   	%%%%%
+define("_MD_A_FORUMUPDATED","¥Õ¥©¡¼¥é¥à¤ò¹¹¿·¤·¤Þ¤·¤¿¡£");
+define("_MD_A_HTSMHNBRBITHBTWNLBAMOTF","¥â¥Ç¥ì¡¼¥¿¤òºï½ü¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£¥Õ¥©¡¼¥é¥àÆâ¤Ë¤ÏÉ¬¤º°ì¿Í°Ê¾å¤Î¥â¥Ç¥ì¡¼¥¿¤¬É¬Í×¤Ç¤¹¡£");
+define("_MD_A_FORUMREMOVED","¥Õ¥©¡¼¥é¥à¤òºï½ü¤·¤Þ¤·¤¿¡£");
+define("_MD_A_FRFDAWAIP","¥Õ¥©¡¼¥é¥à¤Ë¤ª¤±¤ëÁ´¤Æ¤ÎÅê¹Æ¤ò¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤éºï½ü¤·¤Þ¤·¤¿¡£");
+define("_MD_A_NOSUCHFORUM","³ºÅö¤¹¤ë¥Õ¥©¡¼¥é¥à¤¬¤¢¤ê¤Þ¤»¤ó¡£");
+define("_MD_A_EDITTHISFORUM","¥Õ¥©¡¼¥é¥à¤ÎÊÔ½¸");
+define("_MD_A_DTFTWARAPITF","¥Õ¥©¡¼¥é¥à¤Îºï½ü (Ãí°Õ¡§¥Õ¥©¡¼¥é¥à¤Ë¤ª¤±¤ëÁ´¤Æ¤ÎÅê¹Æ¤âºï½ü¤µ¤ì¤Þ¤¹)");
+define("_MD_A_FORUMNAME","¥Õ¥©¡¼¥é¥àÌ¾¡§");
+define("_MD_A_FORUMDESCRIPTION","¥Õ¥©¡¼¥é¥à¤ÎÀâÌÀ¡§");
+define("_MD_A_MODERATOR","¥â¥Ç¥ì¡¼¥¿¡§");
+define("_MD_A_REMOVE","ºï½ü");
+define("_MD_A_NOMODERATORASSIGNED","¥â¥Ç¥ì¡¼¥¿¤¬ÁªÂò¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
+define("_MD_A_NONE","¤Ê¤·");
+define("_MD_A_CATEGORY","¥«¥Æ¥´¥ê¡§");
+define("_MD_A_ANONYMOUSPOST","Á´¤Æ¤ÎË¬Ìä¼Ô");
+define("_MD_A_REGISTERUSERONLY","ÅÐÏ¿¥æ¡¼¥¶¤Î¤ß");
+define("_MD_A_MODERATORANDADMINONLY","´ÉÍý¼Ô¡¿¥â¥Ç¥ì¡¼¥¿¤Î¤ß ");
+define("_MD_A_TYPE","¥¿¥¤¥×¡§");
+define("_MD_A_PUBLIC","¸ø³«");
+define("_MD_A_PRIVATE","¥×¥é¥¤¥Ù¡¼¥È");
+define("_MD_A_SELECTFORUMEDIT","ÊÔ½¸¤¹¤ë¥Õ¥©¡¼¥é¥à¤òÁªÂò");
+define("_MD_A_NOFORUMINDATABASE","¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë¥Õ¥©¡¼¥é¥à¤¬¤¢¤ê¤Þ¤»¤ó¡£");
+define("_MD_A_DATABASEERROR","¥Ç¡¼¥¿¥Ù¡¼¥¹");
+define("_MD_A_EDIT","ÊÔ½¸");
+define("_MD_A_CATEGORYUPDATED","¥«¥Æ¥´¥ê¡¼¤ò¹¹¿·¤·¤Þ¤·¤¿¡£");
+define("_MD_A_EDITCATEGORY","ÊÔ½¸¤¹¤ë¥«¥Æ¥´¥ê¡§");
+define("_MD_A_CATEGORYTITLE","¥«¥Æ¥´¥êÌ¾¡§");
+define("_MD_A_SELECTACATEGORYEDIT","ÊÔ½¸¤¹¤ë¥«¥Æ¥´¥ê¤òÁªÂò");
+define("_MD_A_CATEGORYCREATED","¿·µ¬¥«¥Æ¥´¥ê¤òºîÀ®¤·¤Þ¤·¤¿¡£");
+define("_MD_A_NTWNRTFUTCYMDTVTEFS","Ãí°Õ: ¥«¥Æ¥´¥ê²¼¤Î¥Õ¥©¡¼¥é¥à¤Ïºï½ü¤µ¤ì¤Þ¤»¤ó¡£¥Õ¥©¡¼¥é¥à¤Îºï½ü¤Ï¸ÄÊÌ¤Ë¹Ô¤Ã¤Æ²¼¤µ¤¤¡£");
+define("_MD_A_REMOVECATEGORY","¥«¥Æ¥´¥ê¤òºï½ü");
+define("_MD_A_CREATENEWCATEGORY","¿·µ¬¥«¥Æ¥´¥ê¤ÎºîÀ®");
+define("_MD_A_YDNFOATPOTFDYAA","ÆþÎÏ¥Õ¥©¡¼¥à¤ËÁ´¤Æ¤Î¥Ç¡¼¥¿¤òµ­Æþ¤·¤Æ²¼¤µ¤¤¡£<br />ºÇÄã1¿Í¤Î¥â¥Ç¥ì¡¼¥¿¤ò»ØÄê¤¹¤ëÉ¬Í×¤¬¤¢¤ê¤Þ¤¹¡£ ");
+define("_MD_A_FORUMCREATED","¥Õ¥©¡¼¥é¥à¤òºîÀ®¤·¤Þ¤·¤¿¡£");
+define("_MD_A_VTFYJC","ºîÀ®¤·¤¿¥Õ¥©¡¼¥é¥à¤ò¸«¤ë");
+define("_MD_A_EYMAACBYAF","¥¨¥é¡¼: ¥Õ¥©¡¼¥é¥à¤òÄÉ²Ã¤¹¤ëÁ°¤Ë¥«¥Æ¥´¥ê¡¼¤òÄÉ²Ã¤¹¤ëÉ¬Í×¤¬¤¢¤ê¤Þ¤¹¡£");
+define("_MD_A_CREATENEWFORUM","¿·µ¬¥Õ¥©¡¼¥é¥à¤ÎºîÀ®");
+define("_MD_A_ACCESSLEVEL","¥¢¥¯¥»¥¹¥ì¥Ù¥ë¡§");
+define("_MD_A_CATEGORYMOVEUP","¥«¥Æ¥´¥ê¤ò°ÜÆ°¤·¤Þ¤·¤¿");
+define("_MD_A_TCIATHU","ÁªÂò¤µ¤ì¤¿¥«¥Æ¥´¥ê¤Ï´û¤Ë°ìÈÖ¾å¤ËÇÛÃÖ¤µ¤ì¤Æ¤¤¤Þ¤¹");
+define("_MD_A_CATEGORYMOVEDOWN","¥«¥Æ¥´¥ê¤ò°ÜÆ°¤·¤Þ¤·¤¿");
+define("_MD_A_TCIATLD","ÁªÂò¤µ¤ì¤¿¥«¥Æ¥´¥ê¡¼¤Ï´û¤Ë°ìÈÖ²¼¤ËÇÛÃÖ¤µ¤ì¤Æ¤¤¤Þ¤¹");
+define("_MD_A_SETCATEGORYORDER","¥«¥Æ¥´¥êÉ½¼¨°ÌÃÖ¤ÎÀßÄê");
+define("_MD_A_TODHITOTCWDOTIP","<br />¥Õ¥©¡¼¥é¥à¤Î¥È¥Ã¥×¥Ú¡¼¥¸¤Ë¤ª¤±¤ë¥«¥Æ¥´¥ê¤ÎÉ½¼¨°ÌÃÖ¤ÎÀßÄê¤ò¹Ô¤¤¤Þ¤¹¡£¥«¥Æ¥´¥ê¤Î°ÌÃÖ¤ò¾å¤Ë°ÜÆ°¤¹¤ë¾ì¹ç¤Ï¡Ö¾å¤Ë°ÜÆ°¡×¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¡¢²¼¤²¤ë¾ì¹ç¤Ï¡Ö²¼¤Ë°ÜÆ°¡×¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤Æ²¼¤µ¤¤¡£");
+define("_MD_A_ECWMTCPUODITO","£±²ó¥¯¥ê¥Ã¥¯¤¹¤ëÅÙ¤Ë°ÌÃÖ¤¬1¤Ä°ÜÆ°¤·¤Þ¤¹¡£");
+define("_MD_A_CATEGORY1","¥«¥Æ¥´¥ê");
+define("_MD_A_MOVEUP","¾å¤Ë°ÜÆ°");
+define("_MD_A_MOVEDOWN","²¼¤Ë°ÜÆ°");
+
+
+
+//%%%%%%	File Name  admin_board.php   	%%%%%
+
+define("_MD_A_FORUMUPDATE","¥Õ¥©¡¼¥é¥à¤ÎÀßÄê¤ò¹¹¿·¤·¤Þ¤·¤¿¡£");
+define("_MD_A_RETURNTOADMINPANEL","´ÉÍý²èÌÌ¤ØÌá¤ë");
+define("_MD_A_RETURNTOFORUMINDEX","¥Õ¥©¡¼¥é¥à¤Î¥á¥¤¥ó¥Ú¡¼¥¸¤ØÌá¤ë");
+define("_MD_A_ALLOWHTML","HTML¥¿¥°¤ò»ÈÍÑ²ÄÇ½¤Ë¤¹¤ë¡§");
+define("_MD_A_YES","¤Ï¤¤");
+define("_MD_A_NO","¤¤¤¤¤¨");
+define("_MD_A_ALLOWSIGNATURES","½ðÌ¾¤ÎÄÉ²Ã¤ò²ÄÇ½¤Ë¤¹¤ë¡§");
+define("_MD_A_HOTTOPICTHRESHOLD","¿Íµ¤¥¹¥ì¥Ã¥É¤ËÉ¬Í×¤ÊºÇÄãÅê¹Æ¿ô¡§");
+define("_MD_A_POSTPERPAGE","1¥Ú¡¼¥¸Ëè¤ËÉ½¼¨¤¹¤ëÅê¹Æ¿ô¡§");
+define("_MD_A_TITNOPPTTWBDPPOT","(1¥Ú¡¼¥¸Ëè¤ËÉ½¼¨¤¹¤ëÅê¹Æ¿ô¤ò»ØÄê¤·¤Æ¤¯¤À¤µ¤¤)");
+define("_MD_A_TOPICPERFORUM","£±²èÌÌ¤ËÉ½¼¨¤¹¤ë¥¹¥ì¥Ã¥É¿ô¡§");
+define("_MD_A_TITNOTPFTWBDPPOAF","(¥¹¥ì¥Ã¥É°ìÍ÷¤Ç£±¥Ú¡¼¥¸Ëè¤ËÉ½¼¨¤¹¤ëÉ½¼¨¤¹¤ë¥¹¥ì¥Ã¥É¤Î·ï¿ô¤ò»ØÄê¤·¤Æ¤¯¤À¤µ¤¤)");
+define("_MD_A_SAVECHANGES","ÊÑ¹¹¤òÊÝÂ¸");
+define("_MD_A_CLEAR","¥¯¥ê¥¢");
+define("_MD_A_CLICKBELOWSYNC","¥Õ¥©¡¼¥é¥à¤Ë¤ª¤±¤ëÅê¹Æ¿ô¤ÎºÆ½¸·×¤ò¹Ô¤¤¤Þ¤¹¡£Åê¹Æ¿ô¤¬Àµ¤·¤¤¿ô»ú¤òÉ½¤·¤Æ¤¤¤Ê¤¤¤È»×¤ï¤ì¤ë¾ì¹ç¤Ë»ÈÍÑ¤·¤Æ¤¯¤À¤µ¤¤¡£");
+define("_MD_A_SYNCHING","½¸·×¼Â¸úÃæ");
+define("_MD_A_DONESYNC","½¸·×¤ò´°Î»¤·¤Þ¤·¤¿¡£");
+define("_MD_A_CATEGORYDELETED","¥«¥Æ¥´¥ê¤òºï½ü¤·¤Þ¤·¤¿¡£");
+
+//%%%%%%	File Name  admin_priv_forums.php   	%%%%%
+
+define("_MD_A_SAFTE","ÊÔ½¸¤¹¤ë¥Õ¥©¡¼¥é¥à¤òÁªÂò");
+define("_MD_A_NFID","¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë¥Õ¥©¡¼¥é¥à¤¬¤¢¤ê¤Þ¤»¤ó¡£");
+define("_MD_A_EFPF","ÊÔ½¸¤¹¤ë¥×¥é¥¤¥Ù¡¼¥È¥Õ¥©¡¼¥é¥à¡§<b>%s</b>");
+define("_MD_A_UWA","¥¢¥¯¥»¥¹¤òµö²Ä¤µ¤ì¤¿¥æ¡¼¥¶¡§");
+define("_MD_A_UWOA","¥¢¥¯¥»¥¹ÉÔ²Ä¥æ¡¼¥¶¡§");
+define("_MD_A_ADDUSERS","ÄÉ²Ã -->");
+define("_MD_A_CLEARALLUSERS","¥¯¥ê¥¢");
+define("_MD_A_REVOKEPOSTING","Åê¹Æ¤òµö²Ä¤·¤Ê¤¤");
+define("_MD_A_GRANTPOSTING","Åê¹Æ¤òµö²Ä¤¹¤ë");
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/language/japanese/modinfo.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/language/japanese/modinfo.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/language/japanese/modinfo.php	(revision 405)
@@ -0,0 +1,66 @@
+<?php
+// Module Info
+
+// The name of this module
+define("_MI_NEWBB_NAME","¥Õ¥©¡¼¥é¥à");
+
+// A brief description of this module
+define("_MI_NEWBB_DESC","XOOPS¥Õ¥©¡¼¥é¥à¥â¥¸¥å¡¼¥ë");
+
+// Names of blocks for this module (Not all module has blocks)
+define("_MI_NEWBB_BNAME1","¥Õ¥©¡¼¥é¥à¤Ç¤ÎºÇ¶á¤ÎÅê¹Æ");
+define("_MI_NEWBB_BNAME2","¥Õ¥©¡¼¥é¥à¤Ç¤Î»²¾È¿ô¤ÎÂ¿¤¤ÏÃÂê");
+define("_MI_NEWBB_BNAME3","¥Õ¥©¡¼¥é¥à¤Ç¤ÎÈ¯¸À¿ô¤ÎÂ¿¤¤ÏÃÂê");
+define("_MI_NEWBB_BNAME4","¥×¥é¥¤¥Ù¡¼¥È¥Õ¥©¡¼¥é¥à¤Ç¤ÎÅê¹Æ");
+
+define("_MI_NEWBB_ADMENU1","¥Õ¥©¡¼¥é¥à¤ÎÄÉ²Ã");
+define("_MI_NEWBB_ADMENU2","¥Õ¥©¡¼¥é¥à¤ÎÊÔ½¸");
+define("_MI_NEWBB_ADMENU3","¥×¥é¥¤¥Ù¡¼¥È¥Õ¥©¡¼¥é¥à¤ÎÀßÄê");
+define("_MI_NEWBB_ADMENU4","¥¹¥ì¥Ã¥ÉÅê¹Æ¿ô¤ÎºÆ½¸·×");
+define("_MI_NEWBB_ADMENU5","¥«¥Æ¥´¥ê¤ÎÄÉ²Ã");
+define("_MI_NEWBB_ADMENU6","¥«¥Æ¥´¥ê¤ÎÊÔ½¸");
+define("_MI_NEWBB_ADMENU7","¥«¥Æ¥´¥ê¡¼¤Îºï½ü");
+define("_MI_NEWBB_ADMENU8","¥«¥Æ¥´¥ê¤ÎÇÛÃÖÊÑ¹¹");
+
+// RMV-NOTIFY
+// Notification event descriptions and mail templates
+
+define ('_MI_NEWBB_THREAD_NOTIFY', 'É½¼¨Ãæ¤Î¥¹¥ì¥Ã¥É'); 
+define ('_MI_NEWBB_THREAD_NOTIFYDSC', 'É½¼¨Ãæ¤Î¥¹¥ì¥Ã¥É¤ËÂÐ¤¹¤ëÄÌÃÎ¥ª¥×¥·¥ç¥ó');
+
+define ('_MI_NEWBB_FORUM_NOTIFY', 'É½¼¨Ãæ¤Î¥Õ¥©¡¼¥é¥à'); 
+define ('_MI_NEWBB_FORUM_NOTIFYDSC', 'É½¼¨Ãæ¤Î¥Õ¥©¡¼¥é¥à¤ËÂÐ¤¹¤ëÄÌÃÎ¥ª¥×¥·¥ç¥ó');
+
+define ('_MI_NEWBB_GLOBAL_NOTIFY', '¥â¥¸¥å¡¼¥ëÁ´ÂÎ');
+define ('_MI_NEWBB_GLOBAL_NOTIFYDSC', '¥Õ¥©¡¼¥é¥à¥â¥¸¥å¡¼¥ëÁ´ÂÎ¤Ë¤ª¤±¤ëÄÌÃÎ¥ª¥×¥·¥ç¥ó');
+
+define ('_MI_NEWBB_THREAD_NEWPOST_NOTIFY', 'ÊÖ¿®¤ÎÅê¹Æ');
+define ('_MI_NEWBB_THREAD_NEWPOST_NOTIFYCAP', '¤³¤Î¥¹¥ì¥Ã¥É¤Ë¤ª¤¤¤ÆÊÖ¿®¤¬Åê¹Æ¤µ¤ì¤¿¾ì¹ç¤ËÄÌÃÎ¤¹¤ë');
+define ('_MI_NEWBB_THREAD_NEWPOST_NOTIFYDSC', '¤³¤Î¥¹¥ì¥Ã¥É¤Ë¤ª¤¤¤ÆÊÖ¿®¤¬Åê¹Æ¤µ¤ì¤¿¾ì¹ç¤ËÄÌÃÎ¤¹¤ë');
+define ('_MI_NEWBB_THREAD_NEWPOST_NOTIFYSBJ', '[{X_SITENAME}] {X_MODULE}: ¥¹¥ì¥Ã¥ÉÆâ¤ËÊÖ¿®¤¬Åê¹Æ¤µ¤ì¤Þ¤·¤¿');
+
+define ('_MI_NEWBB_FORUM_NEWTHREAD_NOTIFY', '¿·µ¬¥¹¥ì¥Ã¥É');
+define ('_MI_NEWBB_FORUM_NEWTHREAD_NOTIFYCAP', '¤³¤Î¥Õ¥©¡¼¥é¥à¤Ë¤ª¤¤¤Æ¿·µ¬¥¹¥ì¥Ã¥É¤ÎÅê¹Æ¤¬¤¢¤Ã¤¿¾ì¹ç¤ËÄÌÃÎ¤¹¤ë');
+define ('_MI_NEWBB_FORUM_NEWTHREAD_NOTIFYDSC', '¤³¤Î¥Õ¥©¡¼¥é¥à¤Ë¤ª¤¤¤Æ¿·µ¬¥¹¥ì¥Ã¥É¤ÎÅê¹Æ¤¬¤¢¤Ã¤¿¾ì¹ç¤ËÄÌÃÎ¤¹¤ë');
+define ('_MI_NEWBB_FORUM_NEWTHREAD_NOTIFYSBJ', '[{X_SITENAME}] {X_MODULE}: ¿·µ¬¥¹¥ì¥Ã¥É¤¬Åê¹Æ¤µ¤ì¤Þ¤·¤¿');
+
+define ('_MI_NEWBB_GLOBAL_NEWFORUM_NOTIFY', '¿·µ¬¥Õ¥©¡¼¥é¥à');
+define ('_MI_NEWBB_GLOBAL_NEWFORUM_NOTIFYCAP', '¿·µ¬¥Õ¥©¡¼¥é¥à¤¬ºîÀ®¤µ¤ì¤¿¾ì¹ç¤ËÄÌÃÎ¤¹¤ë');
+define ('_MI_NEWBB_GLOBAL_NEWFORUM_NOTIFYDSC', '¿·µ¬¥Õ¥©¡¼¥é¥à¤¬ºîÀ®¤µ¤ì¤¿¾ì¹ç¤ËÄÌÃÎ¤¹¤ë');
+define ('_MI_NEWBB_GLOBAL_NEWFORUM_NOTIFYSBJ', '[{X_SITENAME}] {X_MODULE}: ¿·µ¬¥Õ¥©¡¼¥é¥à¤¬ºîÀ®¤µ¤ì¤Þ¤·¤¿');
+
+define ('_MI_NEWBB_GLOBAL_NEWPOST_NOTIFY', '¿·µ¬Åê¹Æ');
+define ('_MI_NEWBB_GLOBAL_NEWPOST_NOTIFYCAP', '¿·µ¬¥¹¥ì¥Ã¥É¤Þ¤¿¤ÏÊÖ¿®¤ÎÅê¹Æ¤¬¤¢¤Ã¤¿¾ì¹ç¤ËÄÌÃÎ¤¹¤ë');
+define ('_MI_NEWBB_GLOBAL_NEWPOST_NOTIFYDSC', '¿·µ¬¥¹¥ì¥Ã¥É¤Þ¤¿¤ÏÊÖ¿®¤ÎÅê¹Æ¤¬¤¢¤Ã¤¿¾ì¹ç¤ËÄÌÃÎ¤¹¤ë');
+define ('_MI_NEWBB_GLOBAL_NEWPOST_NOTIFYSBJ', '[{X_SITENAME}] {X_MODULE}: ¿·µ¬Åê¹Æ¤¬¤¢¤ê¤Þ¤·¤¿');
+
+define ('_MI_NEWBB_FORUM_NEWPOST_NOTIFY', '¿·µ¬Åê¹Æ');
+define ('_MI_NEWBB_FORUM_NEWPOST_NOTIFYCAP', '¤³¤Î¥Õ¥©¡¼¥é¥à¤Ë¤ª¤¤¤Æ¿·µ¬Åê¹Æ¤¬¤¢¤Ã¤¿¾ì¹ç¤ËÄÌÃÎ¤¹¤ë');
+define ('_MI_NEWBB_FORUM_NEWPOST_NOTIFYDSC', '¤³¤Î¥Õ¥©¡¼¥é¥à¤Ë¤ª¤¤¤Æ¿·µ¬Åê¹Æ¤¬¤¢¤Ã¤¿¾ì¹ç¤ËÄÌÃÎ¤¹¤ë');
+define ('_MI_NEWBB_FORUM_NEWPOST_NOTIFYSBJ', '[{X_SITENAME}] {X_MODULE}: ¥Õ¥©¡¼¥é¥à¤Ë¤Æ¿·µ¬Åê¹Æ¤¬¤¢¤ê¤Þ¤·¤¿');
+
+define ('_MI_NEWBB_GLOBAL_NEWFULLPOST_NOTIFY', '¿·µ¬Åê¹Æ¡ÊÅê¹ÆÊ¸´Þ¤à¡Ë');
+define ('_MI_NEWBB_GLOBAL_NEWFULLPOST_NOTIFYCAP', '¿·µ¬¥¹¥ì¥Ã¥É¤Þ¤¿¤ÏÊÖ¿®¤ÎÅê¹Æ¤¬¤¢¤Ã¤¿¾ì¹ç¤ËÄÌÃÎ¤¹¤ë¡ÊÅê¹ÆÊ¸ÉÕ¤­¡Ë');
+define ('_MI_NEWBB_GLOBAL_NEWFULLPOST_NOTIFYDSC', '¿·µ¬¥¹¥ì¥Ã¥É¤Þ¤¿¤ÏÊÖ¿®¤ÎÅê¹Æ¤¬¤¢¤Ã¤¿¾ì¹ç¤ËÄÌÃÎ¤¹¤ë¡ÊÅê¹ÆÊ¸ÉÕ¤­¡Ë');
+define ('_MI_NEWBB_GLOBAL_NEWFULLPOST_NOTIFYSBJ', '[{X_SITENAME}] {X_MODULE}: ¿·µ¬Åê¹Æ¡ÊÅê¹ÆÊ¸ÉÕ¤­¡Ë');
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/language/japanese/blocks.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/language/japanese/blocks.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/language/japanese/blocks.php	(revision 405)
@@ -0,0 +1,11 @@
+<?php
+// Blocks
+define("_MB_NEWBB_FORUM","¥Õ¥©¡¼¥é¥à");
+define("_MB_NEWBB_TOPIC","¥¹¥ì¥Ã¥É");
+define("_MB_NEWBB_RPLS","ÊÖ¿®");
+define("_MB_NEWBB_VIEWS","±ÜÍ÷");
+define("_MB_NEWBB_LPOST","ºÇ½ªÅê¹Æ");
+define("_MB_NEWBB_VSTFRMS","¥Õ¥©¡¼¥é¥à°ìÍ÷¤Ø");
+define("_MB_NEWBB_DISPLAY","É½¼¨·ï¿ô %s ·ï");
+define("_MB_NEWBB_DISPLAYF","¥Õ¥ë¥µ¥¤¥ºÉ½¼¨¤¹¤ë"); 
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/language/english/modinfo.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/language/english/modinfo.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/language/english/modinfo.php	(revision 405)
@@ -0,0 +1,69 @@
+<?php
+// $Id: modinfo.php,v 1.2 2005/03/18 12:52:25 onokazu Exp $
+// Module Info
+
+// The name of this module
+define("_MI_NEWBB_NAME","Forum");
+
+// A brief description of this module
+define("_MI_NEWBB_DESC","Forums module for XOOPS");
+
+// Names of blocks for this module (Not all module has blocks)
+define("_MI_NEWBB_BNAME1","Recent Topics");
+define("_MI_NEWBB_BNAME2","Most Viewed Topics");
+define("_MI_NEWBB_BNAME3","Most Active Topics");
+define("_MI_NEWBB_BNAME4","Recent Private Topics");
+
+// Names of admin menu items
+define("_MI_NEWBB_ADMENU1","Add Forum");
+define("_MI_NEWBB_ADMENU2","Edit Forum");
+define("_MI_NEWBB_ADMENU3","Edit Priv. Forum");
+define("_MI_NEWBB_ADMENU4","Sync forums/topics");
+define("_MI_NEWBB_ADMENU5","Add Category");
+define("_MI_NEWBB_ADMENU6","Edit Category");
+define("_MI_NEWBB_ADMENU7","Delete Category");
+define("_MI_NEWBB_ADMENU8","Re-order Category");
+
+// RMV-NOTIFY
+// Notification event descriptions and mail templates
+
+define ('_MI_NEWBB_THREAD_NOTIFY', 'Thread');
+define ('_MI_NEWBB_THREAD_NOTIFYDSC', 'Notification options that apply to the current thread.');
+
+define ('_MI_NEWBB_FORUM_NOTIFY', 'Forum');
+define ('_MI_NEWBB_FORUM_NOTIFYDSC', 'Notification options that apply to the current forum.');
+
+define ('_MI_NEWBB_GLOBAL_NOTIFY', 'Global');
+define ('_MI_NEWBB_GLOBAL_NOTIFYDSC', 'Global forum notification options.');
+
+define ('_MI_NEWBB_THREAD_NEWPOST_NOTIFY', 'New Post');
+define ('_MI_NEWBB_THREAD_NEWPOST_NOTIFYCAP', 'Notify me of new posts in the current thread.');
+define ('_MI_NEWBB_THREAD_NEWPOST_NOTIFYDSC', 'Receive notification when a new message is posted to the current thread.');
+define ('_MI_NEWBB_THREAD_NEWPOST_NOTIFYSBJ', '[{X_SITENAME}] {X_MODULE} auto-notify : New post in thread');
+
+define ('_MI_NEWBB_FORUM_NEWTHREAD_NOTIFY', 'New Thread');
+define ('_MI_NEWBB_FORUM_NEWTHREAD_NOTIFYCAP', 'Notify me of new topics in the current forum.');
+define ('_MI_NEWBB_FORUM_NEWTHREAD_NOTIFYDSC', 'Receive notification when a new thread is started in the current forum.');
+define ('_MI_NEWBB_FORUM_NEWTHREAD_NOTIFYSBJ', '[{X_SITENAME}] {X_MODULE} auto-notify : New thread in forum');
+
+define ('_MI_NEWBB_GLOBAL_NEWFORUM_NOTIFY', 'New Forum');
+define ('_MI_NEWBB_GLOBAL_NEWFORUM_NOTIFYCAP', 'Notify me when a new forum is created.');
+define ('_MI_NEWBB_GLOBAL_NEWFORUM_NOTIFYDSC', 'Receive notification when a new forum is created.');
+define ('_MI_NEWBB_GLOBAL_NEWFORUM_NOTIFYSBJ', '[{X_SITENAME}] {X_MODULE} auto-notify : New forum');
+
+define ('_MI_NEWBB_GLOBAL_NEWPOST_NOTIFY', 'New Post');
+define ('_MI_NEWBB_GLOBAL_NEWPOST_NOTIFYCAP', 'Notify me of any new posts.');
+define ('_MI_NEWBB_GLOBAL_NEWPOST_NOTIFYDSC', 'Receive notification when any new message is posted.');
+define ('_MI_NEWBB_GLOBAL_NEWPOST_NOTIFYSBJ', '[{X_SITENAME}] {X_MODULE} auto-notify : New post');
+
+define ('_MI_NEWBB_FORUM_NEWPOST_NOTIFY', 'New Post');
+define ('_MI_NEWBB_FORUM_NEWPOST_NOTIFYCAP', 'Notify me of any new posts in the current forum.');
+define ('_MI_NEWBB_FORUM_NEWPOST_NOTIFYDSC', 'Receive notification when any new message is posted in the current forum.');
+define ('_MI_NEWBB_FORUM_NEWPOST_NOTIFYSBJ', '[{X_SITENAME}] {X_MODULE} auto-notify : New post in forum');
+
+define ('_MI_NEWBB_GLOBAL_NEWFULLPOST_NOTIFY', 'New Post (Full Text)');
+define ('_MI_NEWBB_GLOBAL_NEWFULLPOST_NOTIFYCAP', 'Notify me of any new posts (include full text in message).');
+define ('_MI_NEWBB_GLOBAL_NEWFULLPOST_NOTIFYDSC', 'Receive full text notification when any new message is posted.');
+define ('_MI_NEWBB_GLOBAL_NEWFULLPOST_NOTIFYSBJ', '[{X_SITENAME}] {X_MODULE} auto-notify : New post (full text)');
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/language/english/blocks.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/language/english/blocks.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/language/english/blocks.php	(revision 405)
@@ -0,0 +1,12 @@
+<?php
+// $Id: blocks.php,v 1.2 2005/03/18 12:52:25 onokazu Exp $
+// Blocks
+define("_MB_NEWBB_FORUM","Forum");
+define("_MB_NEWBB_TOPIC","Topic");
+define("_MB_NEWBB_RPLS","Replies");
+define("_MB_NEWBB_VIEWS","Views");
+define("_MB_NEWBB_LPOST","Last Post");
+define("_MB_NEWBB_VSTFRMS"," Visit Forums");
+define("_MB_NEWBB_DISPLAY","Display %s posts");
+define("_MB_NEWBB_DISPLAYF","Display in full size");
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/language/english/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/language/english/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/language/english/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/language/english/main.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/language/english/main.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/language/english/main.php	(revision 405)
@@ -0,0 +1,180 @@
+<?php
+// $Id: main.php,v 1.4 2005/08/03 12:39:14 onokazu Exp $
+//%%%%%%		Module Name phpBB  		%%%%%
+//functions.php
+define("_MD_ERROR","Error");
+define("_MD_NOPOSTS","No Posts");
+define("_MD_GO","Go");
+
+//index.php
+define("_MD_FORUM","Forum");
+define("_MD_WELCOME","Welcome to %s Forum.");
+define("_MD_TOPICS","Topics");
+define("_MD_POSTS","Posts");
+define("_MD_LASTPOST","Last Post");
+define("_MD_MODERATOR","Moderator");
+define("_MD_NEWPOSTS","New posts");
+define("_MD_NONEWPOSTS","No new posts");
+define("_MD_PRIVATEFORUM","Private forum");
+define("_MD_BY","by"); // Posted by
+define("_MD_TOSTART","To start viewing messages, select the forum that you want to visit from the selection below.");
+define("_MD_TOTALTOPICSC","Total Topics: ");
+define("_MD_TOTALPOSTSC","Total Posts: ");
+define("_MD_TIMENOW","The time now is %s");
+define("_MD_LASTVISIT","You last visited: %s");
+define("_MD_ADVSEARCH","Advanced Search");
+define("_MD_POSTEDON","Posted on: ");
+define("_MD_SUBJECT","Subject");
+
+//page_header.php
+define("_MD_MODERATEDBY","Moderated by");
+define("_MD_SEARCH","Search");
+define("_MD_SEARCHRESULTS","Search Results");
+define("_MD_FORUMINDEX","%s Forum Index");
+define("_MD_POSTNEW","Post New Message");
+define("_MD_REGTOPOST","Register To Post");
+
+//search.php
+define("_MD_KEYWORDS","Keywords:");
+define("_MD_SEARCHANY","Search for ANY of the terms (Default)");
+define("_MD_SEARCHALL","Search for ALL of the terms");
+define("_MD_SEARCHALLFORUMS","Search All Forums");
+define("_MD_FORUMC","Forum");
+define("_MD_SORTBY","Sort by");
+define("_MD_DATE","Date");
+define("_MD_TOPIC","Topic");
+define("_MD_USERNAME","Username");
+define("_MD_SEARCHIN","Search in");
+define("_MD_BODY","Body");
+define("_MD_NOMATCH","No records match that query. Please broaden your search.");
+define("_MD_POSTTIME","Post Time");
+
+//viewforum.php
+define("_MD_REPLIES","Replies");
+define("_MD_POSTER","Poster");
+define("_MD_VIEWS","Views");
+define("_MD_MORETHAN","New posts [ Popular ]");
+define("_MD_MORETHAN2","No New posts [ Popular ]");
+define("_MD_TOPICSTICKY","Topic is Sticky");
+define("_MD_TOPICLOCKED","Topic is Locked");
+define("_MD_LEGEND","Legend");
+define("_MD_NEXTPAGE","Next Page");
+define("_MD_SORTEDBY","Sorted by");
+define("_MD_TOPICTITLE","topic title");
+define("_MD_NUMBERREPLIES","number of replies");
+define("_MD_TOPICPOSTER","topic poster");
+define("_MD_LASTPOSTTIME","last post time");
+define("_MD_ASCENDING","Ascending order");
+define("_MD_DESCENDING","Descending order");
+define("_MD_FROMLASTDAYS","From last %s days");
+define("_MD_THELASTYEAR","From the last year");
+define("_MD_BEGINNING","From the beginning");
+
+//viewtopic.php
+define("_MD_AUTHOR","Author");
+define("_MD_LOCKTOPIC","Lock this topic");
+define("_MD_UNLOCKTOPIC","Unlock this topic");
+define("_MD_STICKYTOPIC","Make this topic Sticky");
+define("_MD_UNSTICKYTOPIC","Make this topic UnSticky");
+define("_MD_MOVETOPIC","Move this topic");
+define("_MD_DELETETOPIC","Delete this topic");
+define("_MD_TOP","Top");
+define("_MD_PARENT","Parent");
+define("_MD_PREVTOPIC","Previous Topic");
+define("_MD_NEXTTOPIC","Next Topic");
+
+//forumform.inc
+define("_MD_ABOUTPOST","About Posting");
+define("_MD_ANONCANPOST","<b>Anonymous</b> users can post new topics and replies to this forum");
+define("_MD_PRIVATE","This is a <b>Private</b> forum.<br />Only users with special access can post new topics and replies to this forum");define("_MD_REGCANPOST","All <b>Registered</b> users can post new topics and replies to this forum");
+define("_MD_MODSCANPOST","Only <B>Moderators and Administrators</b> can post new topics and replies to this forum");
+define("_MD_PREVPAGE","Previous Page");
+define("_MD_QUOTE","Quote");
+
+// ERROR messages
+define("_MD_ERRORFORUM","ERROR: Forum not selected!");
+define("_MD_ERRORPOST","ERROR: Post not selected!");
+define("_MD_NORIGHTTOPOST","You don't have the right to post in this forum.");
+define("_MD_NORIGHTTOACCESS","You don't have the right to access this forum.");
+define("_MD_ERRORTOPIC","ERROR: Topic not selected!");
+define("_MD_ERRORCONNECT","ERROR: Could not connect to the forums database.");
+define("_MD_ERROREXIST","ERROR: The forum you selected does not exist. Please go back and try again.");
+define("_MD_ERROROCCURED","An Error Occured");
+define("_MD_COULDNOTQUERY","Could not query the forums database.");
+define("_MD_FORUMNOEXIST","Error - The forum/topic you selected does not exist. Please go back and try again.");
+define("_MD_USERNOEXIST","That user does not exist.  Please go back and search again.");
+define("_MD_COULDNOTREMOVE","Error - Could not remove posts from the database!");
+define("_MD_COULDNOTREMOVETXT","Error - Could not remove post texts!");
+
+//reply.php
+define("_MD_ON","on"); //Posted on
+define("_MD_USERWROTE","%s wrote:"); // %s is username
+
+//post.php
+define("_MD_EDITNOTALLOWED","You're not allowed to edit this post!");
+define("_MD_EDITEDBY","Edited by");
+define("_MD_ANONNOTALLOWED","Anonymous user not allowed to post.<br />Please register.");
+define("_MD_THANKSSUBMIT","Thanks for your submission!");
+define("_MD_REPLYPOSTED","A reply to your topic has been posted.");
+define("_MD_HELLO","Hello %s,");
+define("_MD_URRECEIVING","You are receiving this email because a message you posted on %s forums has been replied to."); // %s is your site name
+define("_MD_CLICKBELOW","Click on the link below to view the thread:");
+
+//forumform.inc
+define("_MD_YOURNAME","Your Name:");
+define("_MD_LOGOUT","Logout");
+define("_MD_REGISTER","Register");
+define("_MD_SUBJECTC","Subject:");
+define("_MD_MESSAGEICON","Message Icon:");
+define("_MD_MESSAGEC","Message:");
+define("_MD_ALLOWEDHTML","Allowed HTML:");
+define("_MD_OPTIONS","Options:");
+define("_MD_POSTANONLY","Post Anonymously");
+define("_MD_DISABLESMILEY","Disable Smiley");
+define("_MD_DISABLEHTML","Disable html");
+define("_MD_NEWPOSTNOTIFY", "Notify me of new posts in this thread");
+define("_MD_ATTACHSIG","Attach Signature");
+define("_MD_POST","Post");
+define("_MD_SUBMIT","Submit");
+define("_MD_CANCELPOST","Cancel Post");
+
+// forumuserpost.php
+define("_MD_ADD","Add");
+define("_MD_REPLY","Reply");
+
+// topicmanager.php
+define("_MD_YANTMOTFTYCPTF","You are not the moderator of this forum therefore you cannot perform this function.");
+define("_MD_TTHBRFTD","The topic has been removed from the database.");
+define("_MD_RETURNTOTHEFORUM","Return to the forum");
+define("_MD_RTTFI","Return to the forum index");
+define("_MD_EPGBATA","Error - Please go back and try again.");
+define("_MD_TTHBM","The topic has been moved.");
+define("_MD_VTUT","View the updated topic");
+define("_MD_TTHBL","The topic has been locked.");
+define("_MD_TTHBS","The topic has been Stickyed.");
+define("_MD_TTHBUS","The topic has been unStickyed.");
+define("_MD_VIEWTHETOPIC","View the topic");
+define("_MD_TTHBU","The topic has been unlocked.");
+define("_MD_OYPTDBATBOTFTTY","Once you press the delete button at the bottom of this form the topic you have selected, and all its related posts, will be <b>permanently</b> removed.");
+define("_MD_OYPTMBATBOTFTTY","Once you press the move button at the bottom of this form the topic you have selected, and its related posts, will be moved to the forum you have selected.");
+define("_MD_OYPTLBATBOTFTTY","Once you press the lock button at the bottom of this form the topic you have selected will be locked. You may unlock it at a later time if you like.");
+define("_MD_OYPTUBATBOTFTTY","Once you press the unlock button at the bottom of this form the topic you have selected will be unlocked. You may lock it again at a later time if you like.");
+define("_MD_OYPTSBATBOTFTTY","Once you press the Sticky button at the bottom of this form the topic you have selected will be Stickyed. You may unSticky it again at a later time if you like.");
+define("_MD_OYPTTBATBOTFTTY","Once you press the unSticky button at the bottom of this form the topic you have selected will be unStickyed. You may Sticky it again at a later time if you like.");
+define("_MD_MOVETOPICTO","Move Topic To:");
+define("_MD_NOFORUMINDB","No Forums in DB");
+define("_MD_DATABASEERROR","Database Error");
+define("_MD_DELTOPIC","Delete Topic");
+
+// delete.php
+define("_MD_DELNOTALLOWED","Sorry, but you're not allowed to delete this post.");
+define("_MD_AREUSUREDEL","Are you sure you want to delete this post and all its child posts?");
+define("_MD_POSTSDELETED","Selected post and all its child posts deleted.");
+
+// definitions moved from global.
+define("_MD_THREAD","Thread");
+define("_MD_FROM","From");
+define("_MD_JOINED","Joined");
+define("_MD_ONLINE","Online");
+define("_MD_BOTTOM","Bottom");
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/language/english/mail_template/thread_newpost_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/language/english/mail_template/thread_newpost_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/language/english/mail_template/thread_newpost_notify.tpl	(revision 405)
@@ -0,0 +1,23 @@
+Hello {X_UNAME},
+
+A new post has been added to the topic "{THREAD_NAME}".
+
+Follow this link to view the post:
+{POST_URL}
+
+Follow this link to view the thread:
+{THREAD_URL}
+
+-----------
+
+You are receiving this message because you selected to be notified when new posts are added to this topic.
+
+If this is an error or you wish not to receive further such notifications, pleas
+e update your subscriptions by visiting the link below: 
+{X_UNSUBSCRIBE_URL}
+
+-----------
+
+{X_SITENAME} ({X_SITEURL}) 
+webmaster
+{X_ADMINMAIL}
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/language/english/mail_template/forum_newpost_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/language/english/mail_template/forum_newpost_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/language/english/mail_template/forum_newpost_notify.tpl	(revision 405)
@@ -0,0 +1,20 @@
+Hello {X_UNAME},
+
+A new post has been added to the forum "{FORUM_NAME}".
+
+Follow this link to view the post:
+{POST_URL}
+
+-----------
+
+You are receiving this message because you selected to be notified when new posts are added to this forum.
+
+If this is an error or you wish not to receive further such notifications, pleas
+e update your subscriptions by visiting the link below: 
+{X_UNSUBSCRIBE_URL}
+
+-----------
+
+{X_SITENAME} ({X_SITEURL}) 
+webmaster
+{X_ADMINMAIL}
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/language/english/mail_template/forum_newthread_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/language/english/mail_template/forum_newthread_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/language/english/mail_template/forum_newthread_notify.tpl	(revision 405)
@@ -0,0 +1,23 @@
+Hello {X_UNAME},
+
+A new topic "{THREAD_NAME}" has been started in the forum "{FORUM_NAME}".
+
+Follow this link to view this thread:
+{THREAD_URL}
+
+Follow this link to view the forum:
+{FORUM_URL}
+
+-----------
+
+You are receiving this message because you selected to be notified when new topics are started in this forum.
+
+If this is an error or you wish not to receive further such notifications, pleas
+e update your subscriptions by visiting the link below: 
+{X_UNSUBSCRIBE_URL}
+
+-----------
+
+{X_SITENAME} ({X_SITEURL}) 
+webmaster
+{X_ADMINMAIL}
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/language/english/mail_template/global_newpost_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/language/english/mail_template/global_newpost_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/language/english/mail_template/global_newpost_notify.tpl	(revision 405)
@@ -0,0 +1,20 @@
+Hello {X_UNAME},
+
+A new post has been added in the {X_MODULE} module at our site.
+
+Follow this link to view the post:
+{POST_URL}
+
+-----------
+
+You are receiving this message because you selected to be notified of all new posts.
+
+If this is an error or you wish not to receive further such notifications, pleas
+e update your subscriptions by visiting the link below: 
+{X_UNSUBSCRIBE_URL}
+
+-----------
+
+{X_SITENAME} ({X_SITEURL}) 
+webmaster
+{X_ADMINMAIL}
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/language/english/mail_template/global_newforum_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/language/english/mail_template/global_newforum_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/language/english/mail_template/global_newforum_notify.tpl	(revision 405)
@@ -0,0 +1,25 @@
+Hello {X_UNAME},
+
+A new forum "{FORUM_NAME}" has been created at {X_SITENAME}.
+
+Forum description:
+{FORUM_DESCRIPTION}
+
+Follow this link to view this forum:
+{FORUM_URL}
+
+Follow this link to view the forum index:
+{X_MODULE_URL}
+
+-----------
+
+You are receiving this message because you selected to be notified when new forums are added to our site.
+
+If this is an error or you wish not to receive further such notifications, please update your subscriptions by visiting the link below:
+{X_UNSUBSCRIBE_URL}
+
+-----------
+
+{X_SITENAME} ({X_SITEURL}) 
+webmaster
+{X_ADMINMAIL}
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/language/english/mail_template/global_newfullpost_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/language/english/mail_template/global_newfullpost_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/language/english/mail_template/global_newfullpost_notify.tpl	(revision 405)
@@ -0,0 +1,24 @@
+Hello {X_UNAME},
+
+A new post has been added in the {X_MODULE} module at our site.  It was posted in the thread "{THREAD_NAME}" in the forum "{FORUM_NAME}".
+
+Follow this link to view the post in the forums (where you can reply):
+{POST_URL}
+
+-----------
+{POST_NAME}
+
+{POST_CONTENT}
+-----------
+
+You are receiving this message because you selected to be notified of all new posts.
+
+If this is an error or you wish not to receive further such notifications, pleas
+e update your subscriptions by visiting the link below: 
+{X_UNSUBSCRIBE_URL}
+
+-----------
+
+{X_SITENAME} ({X_SITEURL}) 
+webmaster
+{X_ADMINMAIL}
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/language/english/admin.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/language/english/admin.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/language/english/admin.php	(revision 405)
@@ -0,0 +1,103 @@
+<?php
+// $Id: admin.php,v 1.4 2005/08/03 12:39:14 onokazu Exp $
+//%%%%%%	File Name  index.php   	%%%%%
+define("_MD_A_FORUMCONF","Forum Configuration");
+define("_MD_A_ADDAFORUM","Add a Forum");
+define("_MD_A_LINK2ADDFORUM","This Link will take you to a page where you can add a forum to the database.");
+define("_MD_A_EDITAFORUM","Edit a Forum");
+define("_MD_A_LINK2EDITFORUM","This link will allow you to edit an existing forum.");
+define("_MD_A_SETPRIVFORUM","Set Private Forum Permissions");
+define("_MD_A_LINK2SETPRIV","This link will allow you to set the access to an existing private forum.");
+define("_MD_A_SYNCFORUM","Sync forum/topic index");
+define("_MD_A_LINK2SYNC","This link will allow you to sync up the forum and topic indexes to fix any discrepancies that might arise");
+define("_MD_A_ADDACAT","Add a Category");
+define("_MD_A_LINK2ADDCAT","This link will allow you to add a new category to put forums into.");
+define("_MD_A_EDITCATTTL","Edit a Category Title");
+define("_MD_A_LINK2EDITCAT","This link will allow you edit the title of a category.");
+define("_MD_A_RMVACAT","Remove a Category");
+define("_MD_A_LINK2RMVCAT","This link allows you to remove any categories from the database");
+define("_MD_A_REORDERCAT","Re-Order Categories");
+define("_MD_A_LINK2ORDERCAT","This link will allow you to change the order in which your categories display on the index page");
+
+//%%%%%%	File Name  admin_forums.php   	%%%%%
+define("_MD_A_FORUMUPDATED","Forum Updated");
+define("_MD_A_HTSMHNBRBITHBTWNLBAMOTF","However the selected moderator(s) have not be removed because if they had been there would no longer be any moderators on this forum.");
+define("_MD_A_FORUMREMOVED","Forum Removed.");
+define("_MD_A_FRFDAWAIP","Forum removed from database along with all its posts.");
+define("_MD_A_NOSUCHFORUM","No such forum");
+define("_MD_A_EDITTHISFORUM","Edit This Forum");
+define("_MD_A_DTFTWARAPITF","Delete this forum (This will also remove all posts in this forum!)");
+define("_MD_A_FORUMNAME","Forum Name:");
+define("_MD_A_FORUMDESCRIPTION","Forum Description:");
+define("_MD_A_MODERATOR","Moderator(s):");
+define("_MD_A_REMOVE","Remove");
+define("_MD_A_NOMODERATORASSIGNED","No Moderators Assigned");
+define("_MD_A_NONE","None");
+define("_MD_A_CATEGORY","Category:");
+define("_MD_A_ANONYMOUSPOST","Anonymous Posting");
+define("_MD_A_REGISTERUSERONLY","Registered users only");
+define("_MD_A_MODERATORANDADMINONLY","Moderators/Administrators only");
+define("_MD_A_TYPE","Type:");
+define("_MD_A_PUBLIC","Public");
+define("_MD_A_PRIVATE","Private");
+define("_MD_A_SELECTFORUMEDIT","Select a Forum to Edit");
+define("_MD_A_NOFORUMINDATABASE","No Forums in Database");
+define("_MD_A_DATABASEERROR","Database Error");
+define("_MD_A_EDIT","Edit");
+define("_MD_A_CATEGORYUPDATED","Category Updated.");
+define("_MD_A_EDITCATEGORY","Editing Category:");
+define("_MD_A_CATEGORYTITLE","Category Title:");
+define("_MD_A_SELECTACATEGORYEDIT","Select a Category to Edit");
+define("_MD_A_CATEGORYCREATED","Category Created.");
+define("_MD_A_NTWNRTFUTCYMDTVTEFS","Note: This will NOT remove the forums under the category, you must do that via the Edit Forum section.");
+define("_MD_A_REMOVECATEGORY","Remove Category");
+define("_MD_A_CREATENEWCATEGORY","Create a New Category");
+define("_MD_A_YDNFOATPOTFDYAA","You did not fill out all the parts of the form.<br />Did you assign at least one moderator? Please go back and correct the form.");
+define("_MD_A_FORUMCREATED","Forum Created.");
+define("_MD_A_VTFYJC","View the forum  you just created.");
+define("_MD_A_EYMAACBYAF","Error, you must add a category before you add forums");
+define("_MD_A_CREATENEWFORUM","Create a New Forum");
+define("_MD_A_ACCESSLEVEL","Access Level:");
+define("_MD_A_CATEGORYMOVEUP","Category Moved Up");
+define("_MD_A_TCIATHU","This is already the highest category.");
+define("_MD_A_CATEGORYMOVEDOWN","Category Moved Down");
+define("_MD_A_TCIATLD","This is already the lowest category.");
+define("_MD_A_SETCATEGORYORDER","Set Category Ordering");
+define("_MD_A_TODHITOTCWDOTIP","The order displayed here is the order the categories will display on the index page. To move a category up in the ordering click Move Up to move it down click Move Down.");
+define("_MD_A_ECWMTCPUODITO","Each click will move the category 1 place up or down in the ordering.");
+define("_MD_A_CATEGORY1","Category");
+define("_MD_A_MOVEUP","Move Up");
+define("_MD_A_MOVEDOWN","Move Down");
+
+
+define("_MD_A_FORUMUPDATE","Forum Settings Updated");
+define("_MD_A_RETURNTOADMINPANEL","Return to the Administration Panel.");
+define("_MD_A_RETURNTOFORUMINDEX","Return to the forum index");
+define("_MD_A_ALLOWHTML","Allow HTML:");
+define("_MD_A_YES","Yes");
+define("_MD_A_NO","No");
+define("_MD_A_ALLOWSIGNATURES","Allow Signatures:");
+define("_MD_A_HOTTOPICTHRESHOLD","Hot Topic Threshold:");
+define("_MD_A_POSTPERPAGE","Posts per Page:");
+define("_MD_A_TITNOPPTTWBDPPOT","(This is the number of posts per topic that will be displayed per page of a topic)");
+define("_MD_A_TOPICPERFORUM","Topics per Forum:");
+define("_MD_A_TITNOTPFTWBDPPOAF","(This is the number of topics per forum that will be displayed per page of a forum)");
+define("_MD_A_SAVECHANGES","Save Changes");
+define("_MD_A_CLEAR","Clear");
+define("_MD_A_CLICKBELOWSYNC","Clicking the button below will sync up your forums and topics pages with the correct data from the database. Use this section whenever you notice flaws in the topics and forums lists.");
+define("_MD_A_SYNCHING","Synchronizing forum index and topics (This may take a while)");
+define("_MD_A_DONESYNC","Done!");
+define("_MD_A_CATEGORYDELETED","Category deleted.");
+
+//%%%%%%	File Name  admin_priv_forums.php   	%%%%%
+
+define("_MD_A_SAFTE","Select a Forum to Edit");
+define("_MD_A_NFID","No Forums in Database");
+define("_MD_A_EFPF","Editing Forum Permissions for: <b>%s</b>");
+define("_MD_A_UWA","Users With Access:");
+define("_MD_A_UWOA","Users Without Access:");
+define("_MD_A_ADDUSERS","Add Users -->");
+define("_MD_A_CLEARALLUSERS","Clear all users");
+define("_MD_A_REVOKEPOSTING","revoke posting");
+define("_MD_A_GRANTPOSTING","grant posting");
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/newbb/language/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/newbb/language/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/newbb/language/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/include/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/include/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/include/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/include/constants.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/include/constants.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/include/constants.php	(revision 405)
@@ -0,0 +1,29 @@
+<?php
+// $Id: constants.php,v 1.2 2005/03/18 12:53:09 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+define("POLL_NOTMAILED", 0);
+define("POLL_MAILED", 1);
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/language/japanese/blocks.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/language/japanese/blocks.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/language/japanese/blocks.php	(revision 405)
@@ -0,0 +1,4 @@
+<?php
+// Blocks
+//define("_MB_POLLS_TITLE1","ÅêÉ¼");
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/language/japanese/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/language/japanese/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/language/japanese/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/language/japanese/main.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/language/japanese/main.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/language/japanese/main.php	(revision 405)
@@ -0,0 +1,27 @@
+<?php
+
+//%%%%%%	File Name pollresults.php 	%%%%%
+define("_PL_TOTALVOTES","ÅêÉ¼¿ô¡§ %s");
+define("_PL_TOTALVOTERS","ÅêÉ¼¼Ô¿ô¡§ %s");
+
+//%%%%%%	File Name index.php 	%%%%%
+define("_PL_POLLSLIST","ÅêÉ¼°ìÍ÷");
+define("_PL_ALREADYVOTED", "Ê£¿ô²ó¤ÎÅêÉ¼¤Ï¹Ô¤¨¤Þ¤»¤ó¡£");
+define("_PL_THANKSFORVOTE","ÅêÉ¼¤ò¼õ¤±ÉÕ¤±¤Þ¤·¤¿¡£¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£");
+define("_PL_SORRYEXPIRED", "¤³¤ÎÅêÉ¼¤Ï´û¤Ë½ªÎ»¤·¤Æ¤¤¤Þ¤¹¡£");
+define("_PL_YOURPOLLAT", "%s¤µ¤ó¡¢%s¤Ç¤ÎÅêÉ¼¤¬½ªÎ»¤·¤Þ¤·¤¿"); // 1st %s is user name, 2nd %s is site name
+define("_PL_PREV", "Á°¥Ú¡¼¥¸");
+define("_PL_NEXT", "¼¡¥Ú¡¼¥¸");
+define("_PL_POLLQUESTION", "¼ÁÌä");
+define("_PL_VOTERS", "ÅêÉ¼¼Ô¿ô");
+define("_PL_VOTES", "ÅêÉ¼¿ô");
+define("_PL_EXPIRATION", "½ªÎ»Æü»þ");
+define("_PL_EXPIRED", "½ªÎ»");
+
+//%%%%%%	File Name xoopspollrenderer.php 	%%%%%
+// %s represents date
+define("_PL_ENDSAT","%s¤Ë½ªÎ»¤·¤Þ¤¹");
+define("_PL_ENDEDAT","%s¤Ë½ªÎ»¤·¤Þ¤·¤¿");
+define("_PL_VOTE","ÅêÉ¼");
+define("_PL_RESULTS","·ë²Ì");
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/language/japanese/mail_template/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/language/japanese/mail_template/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/language/japanese/mail_template/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/language/japanese/mail_template/mail_results.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/language/japanese/mail_template/mail_results.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/language/japanese/mail_template/mail_results.tpl	(revision 405)
@@ -0,0 +1,13 @@
+{X_UNAME}¤µ¤ó¡¢¤³¤ó¤Ë¤Á¤Ï
+
+¤¢¤Ê¤¿¤¬ÀßÄê¤·¤¿ÅêÉ¼¡Ö{POLL_QUESTION}¡×¤¬½ªÎ»¤·¤Þ¤·¤¿¡£
+¤³¤ÎÅêÉ¼¤Ï{POLL_START}¤Ë³«»Ï¤·¡¢{POLL_END}¤Ë½ªÎ»¤·¤Þ¤·¤¿¡£
+¹ç·×{POLL_VOTERS}¿Í¤Ë¤è¤ëÅêÉ¼¤¬¤¢¤ê¡¢Í­¸úÅêÉ¼¿ô¤Ï{POLL_VOTES}É¼¤Ç¤¹¡£
+
+²¼µ­¤ÎURL¤Ë¤ÆÅêÉ¼·ë²Ì¤ò¤´Í÷¤Ë¤Ê¤ì¤Þ¤¹¡§
+{SITEURL}modules/xoopspoll/pollresults.php?poll_id={POLL_ID}
+
+-----------
+{SITENAME} ({SITEURL}) 
+webmaster
+{ADMINMAIL}
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/language/japanese/admin.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/language/japanese/admin.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/language/japanese/admin.php	(revision 405)
@@ -0,0 +1,31 @@
+<?php
+//%%%%%%	Admin Module Name  Polls 	%%%%%
+define("_AM_DBUPDATED","¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò¹¹¿·¤·¤Þ¤·¤¿");
+define("_AM_POLLCONF","ÅêÉ¼¤ÎÀßÄê");
+
+define("_AM_POLLSLIST", "ÅêÉ¼°ìÍ÷");
+define("_AM_AUTHOR", "ÅêÉ¼¤Îºî¼Ô");
+define("_AM_DISPLAYBLOCK", "¥Ö¥í¥Ã¥¯¤ËÉ½¼¨¤¹¤ë");
+define("_AM_POLLQUESTION", "¼ÁÌä");
+define("_AM_VOTERS", "ÅêÉ¼¼Ô¿ô");
+define("_AM_VOTES", "ÅêÉ¼¿ô");
+define("_AM_EXPIRATION", "´ü¸Â");
+define("_AM_EXPIRED", "½ªÎ»");
+define("_AM_VIEWLOG","¥í¥°±ÜÍ÷");
+define("_AM_CREATNEWPOLL", "¿·µ¬ÅêÉ¼¤ÎºîÀ®");
+define("_AM_POLLDESC", "ÀâÌÀ");
+define("_AM_DISPLAYORDER", "É½¼¨½ç");
+define("_AM_ALLOWMULTI", "Ê£¿ôÁªÂò¤ò²ÄÇ½¤Ë¤¹¤ë");
+define("_AM_NOTIFY", "ÅêÉ¼½ªÎ»»þ¤Ëºî¼Ô¤ËÄÌÃÎ¥á¡¼¥ë¤òÁ÷¿®¤¹¤ë");
+define("_AM_POLLOPTIONS", "ÁªÂò»è");
+define("_AM_EDITPOLL", "ÅêÉ¼¤ÎÊÔ½¸");
+define("_AM_FORMAT", "¥Õ¥©¡¼¥Þ¥Ã¥È¡§ yyyy-mm-dd hh:mm:ss");
+define("_AM_CURRENTTIME", "¸½ºß¤Î»þ´Ö¡§%s");
+define("_AM_EXPIREDAT", "%s¤Ë½ªÎ»");
+define("_AM_RESTART", "¤³¤ÎÅêÉ¼¤òºÆ³«¤¹¤ë");
+define("_AM_ADDMORE", "ÁªÂò»è¤òÄÉ²Ã¤¹¤ë");
+define("_AM_RUSUREDEL", "¤³¤ÎÅêÉ¼¤ª¤è¤Ó¥³¥á¥ó¥È¤òÁ´¤Æºï½ü¤·¤Æ¤â¤¤¤¤¤Ç¤¹¤«¡©");
+define("_AM_RESTARTPOLL", "ÅêÉ¼¤òºÆ³«¤¹¤ë");
+define("_AM_RESET", "ÅêÉ¼¥í¥°¥Ç¡¼¥¿¤ò¥ê¥»¥Ã¥È¤¹¤ë");
+define("_AM_ADDPOLL","ÅêÉ¼¤ÎÄÉ²Ã");
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/language/japanese/modinfo.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/language/japanese/modinfo.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/language/japanese/modinfo.php	(revision 405)
@@ -0,0 +1,15 @@
+<?php
+// Module Info
+
+// The name of this module
+define("_MI_POLLS_NAME","ÅêÉ¼");
+
+// A brief description of this module
+define("_MI_POLLS_DESC","ÅêÉ¼ÍÑ¥Ö¥í¥Ã¥¯¤òÉ½¼¨");
+
+// Names of blocks for this module (Not all module has blocks)
+define("_MI_POLLS_BNAME1","ÅêÉ¼¥Ö¥í¥Ã¥¯");
+
+define("_MI_POLLS_ADMENU1","ÅêÉ¼°ìÍ÷");
+define("_MI_POLLS_ADMENU2","ÅêÉ¼¤ÎºîÀ®");
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/language/english/modinfo.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/language/english/modinfo.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/language/english/modinfo.php	(revision 405)
@@ -0,0 +1,17 @@
+<?php
+// $Id: modinfo.php,v 1.2 2005/03/18 12:53:09 onokazu Exp $
+// Module Info
+
+// The name of this module
+define("_MI_POLLS_NAME","Polls");
+
+// A brief description of this module
+define("_MI_POLLS_DESC","Shows a poll/survey block");
+
+// Names of blocks for this module (Not all module has blocks)
+define("_MI_POLLS_BNAME1","Polls");
+
+// Names of admin menu items
+define("_MI_POLLS_ADMENU1","List Polls");
+define("_MI_POLLS_ADMENU2","Add Poll");
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/language/english/blocks.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/language/english/blocks.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/language/english/blocks.php	(revision 405)
@@ -0,0 +1,4 @@
+<?php
+// $Id: blocks.php,v 1.2 2005/03/18 12:53:09 onokazu Exp $
+// Blocks
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/language/english/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/language/english/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/language/english/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/language/english/main.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/language/english/main.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/language/english/main.php	(revision 405)
@@ -0,0 +1,28 @@
+<?php
+// $Id: main.php,v 1.2 2005/03/18 12:53:09 onokazu Exp $
+//%%%%%%	File Name pollresults.php 	%%%%%
+define("_PL_TOTALVOTES","Total Votes: %s");
+define("_PL_TOTALVOTERS","Total Voters: %s");
+
+//%%%%%%	File Name index.php 	%%%%%
+define("_PL_POLLSLIST","Polls List");
+define("_PL_ALREADYVOTED", "Sorry, you have already voted once.");
+define("_PL_THANKSFORVOTE","Thanks for your vote!");
+define("_PL_SORRYEXPIRED", "Sorry, but the poll has expired.");
+define("_PL_YOURPOLLAT", "%s, your poll at %s"); // 1st %s is user name, 2nd %s is site name
+define("_PL_PREV", "Previous");
+define("_PL_NEXT", "Next");
+define("_PL_POLLQUESTION", "Poll Question");
+define("_PL_VOTERS", "Total voters");
+define("_PL_VOTES", "Total votes");
+define("_PL_EXPIRATION", "Expiration");
+define("_PL_EXPIRED", "Expired");
+
+//%%%%%%	File Name xoopspollrenderer.php 	%%%%%
+// %s represents date
+define("_PL_ENDSAT","Ends at %s");
+define("_PL_ENDEDAT","Ended at %s");
+define("_PL_VOTE","Vote!");
+define("_PL_RESULTS","Results");
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/language/english/mail_template/mail_results.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/language/english/mail_template/mail_results.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/language/english/mail_template/mail_results.tpl	(revision 405)
@@ -0,0 +1,13 @@
+Hello {X_UNAME},
+
+Your poll "{POLL_QUESTION}" has expired.
+The poll started at {POLL_START} and ended at {POLL_END}.
+There were {POLL_VOTERS} voters and {POLL_VOTES} votes in total.
+
+You can view the results at the following URL:
+{SITEURL}modules/xoopspoll/pollresults.php?poll_id={POLL_ID}
+
+-----------
+{SITENAME} ({SITEURL}) 
+webmaster
+{ADMINMAIL}
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/language/english/admin.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/language/english/admin.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/language/english/admin.php	(revision 405)
@@ -0,0 +1,31 @@
+<?php
+// $Id: admin.php,v 1.2 2005/03/18 12:53:09 onokazu Exp $
+//%%%%%%	Admin Module Name  Polls 	%%%%%
+define("_AM_DBUPDATED","Database Updated Successfully!");
+define("_AM_POLLCONF","Polls Configuration");
+define("_AM_POLLSLIST", "Polls List");
+define("_AM_AUTHOR", "Author of this poll");
+define("_AM_DISPLAYBLOCK", "Display in block?");
+define("_AM_POLLQUESTION", "Poll Question");
+define("_AM_VOTERS", "Total voters");
+define("_AM_VOTES", "Total votes");
+define("_AM_EXPIRATION", "Expiration");
+define("_AM_EXPIRED", "Expired");
+define("_AM_VIEWLOG","View log");
+define("_AM_CREATNEWPOLL", "Create new poll");
+define("_AM_POLLDESC", "Poll description");
+define("_AM_DISPLAYORDER", "Display order");
+define("_AM_ALLOWMULTI", "Allow multiple selection?");
+define("_AM_NOTIFY", "Notify the poll author when expired?");
+define("_AM_POLLOPTIONS", "Options");
+define("_AM_EDITPOLL", "Edit poll");
+define("_AM_FORMAT", "Format: yyyy-mm-dd hh:mm:ss");
+define("_AM_CURRENTTIME", "Current time is %s");
+define("_AM_EXPIREDAT", "Expired at %s");
+define("_AM_RESTART", "Restart this poll");
+define("_AM_ADDMORE", "Add more options");
+define("_AM_RUSUREDEL", "Are you sure you want to delete this poll and all its comments?");
+define("_AM_RESTARTPOLL", "Restart poll");
+define("_AM_RESET", "Reset all logs for this poll?");
+define("_AM_ADDPOLL","Add Poll");
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/language/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/language/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/language/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/admin/menu.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/admin/menu.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/admin/menu.php	(revision 405)
@@ -0,0 +1,31 @@
+<?php
+// $Id: menu.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+$adminmenu[0]['title'] = _MI_POLLS_ADMENU1;
+$adminmenu[0]['link'] = "admin/index.php";
+$adminmenu[1]['title'] = _MI_POLLS_ADMENU2;
+$adminmenu[1]['link'] = "admin/index.php?op=add";
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/admin/index.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/admin/index.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/admin/index.php	(revision 405)
@@ -0,0 +1,445 @@
+<?php
+// $Id: index.php,v 1.4 2005/08/03 12:40:02 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+include '../../../include/cp_header.php';
+include XOOPS_ROOT_PATH."/modules/xoopspoll/include/constants.php";
+include_once XOOPS_ROOT_PATH."/class/xoopsformloader.php";
+include_once XOOPS_ROOT_PATH."/class/xoopslists.php";
+include_once XOOPS_ROOT_PATH."/class/xoopsblock.php";
+include_once XOOPS_ROOT_PATH."/modules/xoopspoll/class/xoopspoll.php";
+include_once XOOPS_ROOT_PATH."/modules/xoopspoll/class/xoopspolloption.php";
+include_once XOOPS_ROOT_PATH."/modules/xoopspoll/class/xoopspolllog.php";
+include_once XOOPS_ROOT_PATH."/modules/xoopspoll/class/xoopspollrenderer.php";
+
+$op = "list";
+
+if (!empty($_GET['op'])) {
+    $op = $_GET['op'];
+} elseif (!empty($_POST['op'])) {
+    $op = $_POST['op'];
+}
+
+if ( $op == "list" ) {
+    $limit = (!empty($_GET['limit'])) ? $_GET['limit'] : 30;
+    $start = (!empty($_GET['start'])) ? $_GET['start'] : 0;
+    $polls_arr =& XoopsPoll::getAll(array(), true, "weight ASC, end_time DESC", $limit+1, $start);
+    xoops_cp_header();
+    echo "<h4>"._AM_POLLCONF."</h4>";
+    echo "<h4 style='text-align:left;'>"._AM_POLLSLIST."</h4>";
+    $polls_count = count($polls_arr);
+    if ( is_array($polls_arr) && $polls_count > 0) {
+        echo "<form action='index.php' method='post'><table border='0' cellpadding='0' cellspacing='0' width='100%'><tr><td class='bg2'>
+        <table width='100%' border='0' cellpadding='4' cellspacing='1'>
+        <tr class='bg3'><td>"._AM_DISPLAYBLOCK."</td><td>"._AM_DISPLAYORDER."</td><td>"._AM_POLLQUESTION."</td><td>"._AM_VOTERS."</td><td>"._AM_VOTES."</td><td>"._AM_EXPIRATION."</td><td>&nbsp;</td></tr>";
+        $max = ( $polls_count > $limit ) ? $limit : $polls_count;
+        for ( $i = 0; $i < $max; $i++ ) {
+            $checked = "";
+            if ( 1 == $polls_arr[$i]->getVar("display") ) {
+                $checked = " checked='checked'";
+            }
+            if ( $polls_arr[$i]->getVar("end_time") > time() ) {
+                $end = formatTimestamp($polls_arr[$i]->getVar("end_time"),"m");
+            } else {
+                $end = "<span style='color:#ff0000;'>"._AM_EXPIRED."</span><br /><a href='index.php?op=restart&amp;poll_id=".$polls_arr[$i]->getVar("poll_id")."'>"._AM_RESTART."</a>";
+            }
+            echo "<tr class='bg1'><td align='center'><input type='hidden' name='poll_id[$i]' value='".$polls_arr[$i]->getVar("poll_id")."' /><input type='hidden' name='old_display[$i]' value='".$polls_arr[$i]->getVar("display")."' /><input type='checkbox' name='display[$i]' value='1'".$checked." /></td><td><input type='hidden' name='old_weight[$i]' value='".$polls_arr[$i]->getVar("weight")."' /><input type='text' name='weight[$i]' value='".$polls_arr[$i]->getVar("weight")."' size='6' maxlength='5' /></td><td>".$polls_arr[$i]->getVar("question")."</td><td align='center'>".$polls_arr[$i]->getVar("voters")."</td><td align='center'>".$polls_arr[$i]->getVar("votes")."</td><td>".$end."</td><td align='right'><a href='index.php?op=edit&amp;poll_id=".$polls_arr[$i]->getVar("poll_id")."'>"._EDIT."</a><br /><a href='index.php?op=delete&amp;poll_id=".$polls_arr[$i]->getVar("poll_id")."'>"._DELETE."</a><br /><a href='index.php?op=log&amp;poll_id=".$polls_arr[$i]->getVar("poll_id")."'>"._AM_VIEWLOG."</a></td></tr>";
+        }
+        echo "<tr align='right' class='bg3'><td colspan='7'><input type='button' name='button' onclick=\"location='index.php?op=add'\" value='"._AM_ADDPOLL."' /> <input type='submit' value='"._SUBMIT."' /><input type='hidden' name='op' value='quickupdate' /></td></tr></table></td></tr></table></form>";
+        echo "<table width='100%'><tr><td align='left'>";
+        if ( $start > 0 ) {
+            $prev_start = ($start - $limit > 0) ? $start - $limit : 0;
+            echo "<a href='index.php?start=".$prev_start."&amp;limit=".$limit."'>"._PL_PREV."</a>";
+        } else {
+            echo "&nbsp;";
+        }
+        echo "</td><td align='right'>";
+        if ( $polls_count > $limit ) {
+            echo "<a href='index.php?start=".($start+$limit)."&amp;limit=".$limit."'>"._PL_NEXT."</a>";
+        }
+        echo "</td></tr></table>";
+    }
+    xoops_cp_footer();
+    exit();
+}
+
+if ( $op == "add" ) {
+    $poll_form = new XoopsThemeForm(_AM_CREATNEWPOLL, "poll_form", "index.php");
+    $question_text = new XoopsFormText(_AM_POLLQUESTION, "question", 50, 255);
+    $poll_form->addElement($question_text);
+    $desc_tarea = new XoopsFormTextarea(_AM_POLLDESC, "description");
+    $poll_form->addElement($desc_tarea);
+    $currenttime = formatTimestamp(time(), "Y-m-d H:i:s");
+    $endtime = formatTimestamp(time()+604800, "Y-m-d H:i:s");
+    $expire_text = new XoopsFormText(_AM_EXPIRATION."<br /><small>"._AM_FORMAT."<br />".sprintf(_AM_CURRENTTIME, $currenttime)."</small>", "end_time", 30, 19, $endtime);
+    $poll_form->addElement($expire_text);
+    $disp_yn = new XoopsFormRadioYN(_AM_DISPLAYBLOCK, "display", 1);
+    $poll_form->addElement($disp_yn);
+    $weight_text = new XoopsFormText(_AM_DISPLAYORDER, "weight", 6, 5, 0);
+    $poll_form->addElement($weight_text);
+    $multi_yn = new XoopsFormRadioYN(_AM_ALLOWMULTI, "multiple", 0);
+    $poll_form->addElement($multi_yn);
+    $notify_yn = new XoopsFormRadioYN(_AM_NOTIFY, "notify", 1);
+    $poll_form->addElement($notify_yn);
+    $option_tray = new XoopsFormElementTray(_AM_POLLOPTIONS, "");
+    $barcolor_array = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH."/modules/xoopspoll/images/colorbars/");
+    for($i = 0; $i < 10; $i++){
+        $current_bar = (current($barcolor_array) != "blank.gif") ? current($barcolor_array) : next($barcolor_array);
+        $option_text = new XoopsFormText("", "option_text[]", 50, 255);
+        $option_tray->addElement($option_text);
+        $color_select = new XoopsFormSelect("", "option_color[".$i."]", $current_bar);
+        $color_select->addOptionArray($barcolor_array);
+        $color_select->setExtra("onchange='showImgSelected(\"option_color_image[".$i."]\", \"option_color[".$i."]\", \"modules/xoopspoll/images/colorbars\", \"\", \"".XOOPS_URL."\")'");
+        $color_label = new XoopsFormLabel("", "<img src='".XOOPS_URL."/modules/xoopspoll/images/colorbars/".$current_bar."' name='option_color_image[".$i."]' id='option_color_image[".$i."]' width='30' align='bottom' height='15' alt='' /><br />");
+        $option_tray->addElement($color_select);
+        $option_tray->addElement($color_label);
+        if ( !next($barcolor_array) ) {
+            reset($barcolor_array);
+        }
+        unset($color_select, $color_label);
+    }
+    $poll_form->addElement($option_tray);
+    $submit_button = new XoopsFormButton("", "poll_submit", _SUBMIT, "submit");
+    $poll_form->addElement($submit_button);
+    $op_hidden = new XoopsFormHidden("op", "save");
+    $poll_form->addElement($op_hidden);
+    xoops_cp_header();
+    echo "<h4>"._AM_POLLCONF."</h4>";
+    $poll_form->display();
+    xoops_cp_footer();
+    exit();
+}
+
+if ( $op == "save" ) {
+    $poll = new XoopsPoll();
+    $poll->setVar("question", $_POST['question']);
+    $poll->setVar("description", $_POST['description']);
+    if ( !empty($_POST['end_time']) ) {
+        $poll->setVar("end_time", userTimeToServerTime(strtotime($_POST['end_time']), $xoopsUser->timezone()));
+    } else {
+        // if expiration date is not set, set it to 10 days from now
+        $poll->setVar("end_time", time() + (86400 * 10));
+    }
+    $poll->setVar("display", $_POST['display']);
+    $poll->setVar("weight", $_POST['weight']);
+    $poll->setVar("multiple", $_POST['multiple']);
+    if ( $_POST['notify'] == 1 ) {
+        // if notify, set mail status to "not mailed"
+        $poll->setVar("mail_status", POLL_NOTMAILED);
+    } else {
+        // if not notify, set mail status to already "mailed"
+        $poll->setVar("mail_status", POLL_MAILED);
+    }
+    $poll->setVar("user_id", $xoopsUser->getVar("uid"));
+    $new_poll_id = $poll->store();
+    if ( !empty($new_poll_id) ) {
+        $i = 0;
+        foreach ( $_POST['option_text'] as $optxt ) {
+            $optxt = trim($optxt);
+            if ( $optxt != "" ) {
+                $option = new XoopsPollOption();
+                $option->setVar("option_text", $optxt);
+                $option->setVar("option_color", $_POST['option_color'][$i]);
+                $option->setVar("poll_id", $new_poll_id);
+                $option->store();
+            }
+            $i++;
+        }
+        include_once XOOPS_ROOT_PATH.'/class/template.php';
+        xoops_template_clear_module_cache($xoopsModule->getVar('mid'));
+    } else {
+        echo $poll->getHtmlErrors();
+        exit();
+    }
+    redirect_header("index.php",1,_AM_DBUPDATED);
+    exit();
+}
+
+if ( $op == "edit" ) {
+    $poll = new XoopsPoll($_GET['poll_id']);
+    $poll_form = new XoopsThemeForm(_AM_EDITPOLL, "poll_form", "index.php");
+    $author_label = new XoopsFormLabel(_AM_AUTHOR, "<a href='".XOOPS_URL."/userinfo.php?uid=".$poll->getVar("user_id")."'>".XoopsUser::getUnameFromId($poll->getVar("user_id"))."</a>");
+    $poll_form->addElement($author_label);
+    $question_text = new XoopsFormText(_AM_POLLQUESTION, "question", 50, 255, $poll->getVar("question", "E"));
+    $poll_form->addElement($question_text);
+    $desc_tarea = new XoopsFormTextarea(_AM_POLLDESC, "description", $poll->getVar("description", "E"));
+    $poll_form->addElement($desc_tarea);
+    $date = formatTimestamp($poll->getVar("end_time"), "Y-m-d H:i:s");
+    if ( !$poll->hasExpired() ) {
+        $expire_text = new XoopsFormText(_AM_EXPIRATION."<br /><small>"._AM_FORMAT."<br />".sprintf(_AM_CURRENTTIME, formatTimestamp(time(), "Y-m-d H:i:s"))."</small>", "end_time", 20, 19, $date);
+        $poll_form->addElement($expire_text);
+    } else {
+        $restart_label = new XoopsFormLabel(_AM_EXPIRATION, sprintf(_AM_EXPIREDAT, $date)."<br /><a href='index.php?op=restart&amp;poll_id=".$poll->getVar("poll_id")."'>"._AM_RESTART."</a>");
+        $poll_form->addElement($restart_label);
+    }
+    $disp_yn = new XoopsFormRadioYN(_AM_DISPLAYBLOCK, "display", $poll->getVar("display"));
+    $poll_form->addElement($disp_yn);
+    $weight_text = new XoopsFormText(_AM_DISPLAYORDER, "weight", 6, 5, $poll->getVar("weight"));
+    $poll_form->addElement($weight_text);
+    $multi_yn = new XoopsFormRadioYN(_AM_ALLOWMULTI, "multiple", $poll->getVar("multiple"));
+    $poll_form->addElement($multi_yn);
+    $options_arr =& XoopsPollOption::getAllByPollId($poll->getVar("poll_id"));
+    $notify_value = 1;
+    if ( $poll->getVar("mail_status") != 0 ) {
+        $notify_value = 0;
+    }
+    $notify_yn = new XoopsFormRadioYN(_AM_NOTIFY, "notify", $notify_value);
+    $poll_form->addElement($notify_yn);
+    $option_tray = new XoopsFormElementTray(_AM_POLLOPTIONS, "");
+    $barcolor_array =& XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH."/modules/xoopspoll/images/colorbars/");
+    $i = 0;
+    foreach($options_arr as $option){
+        $option_text = new XoopsFormText("", "option_text[]", 50, 255, $option->getVar("option_text"));
+        $option_tray->addElement($option_text);
+        $option_id_hidden = new XoopsFormHidden("option_id[]", $option->getVar("option_id"));
+        $option_tray->addElement($option_id_hidden);
+        $color_select = new XoopsFormSelect("", "option_color[".$i."]", $option->getVar("option_color"));
+        $color_select->addOptionArray($barcolor_array);
+        $color_select->setExtra("onchange='showImgSelected(\"option_color_image[".$i."]\", \"option_color[".$i."]\", \"modules/xoopspoll/images/colorbars\", \"\", \"".XOOPS_URL."\")'");
+        $color_label = new XoopsFormLabel("", "<img src='".XOOPS_URL."/modules/xoopspoll/images/colorbars/".$option->getVar("option_color", "E")."' name='option_color_image[".$i."]' id='option_color_image[".$i."]' width='30' align='bottom' height='15' alt='' /><br />");
+        $option_tray->addElement($color_select);
+        $option_tray->addElement($color_label);
+        unset($color_select, $color_label, $option_id_hidden, $option_text);
+        $i++;
+    }
+    $more_label = new XoopsFormLabel("", "<br /><a href='index.php?op=addmore&amp;poll_id=".$poll->getVar("poll_id")."'>"._AM_ADDMORE."</a>");
+    $option_tray->addElement($more_label);
+    $poll_form->addElement($option_tray);
+    $op_hidden = new XoopsFormHidden("op", "update");
+    $poll_form->addElement($op_hidden);
+    $poll_id_hidden = new XoopsFormHidden("poll_id", $poll->getVar("poll_id"));
+    $poll_form->addElement($poll_id_hidden);
+    $submit_button = new XoopsFormButton("", "poll_submit", _SUBMIT, "submit");
+    $poll_form->addElement($submit_button);
+    xoops_cp_header();
+    echo "<h4>"._AM_POLLCONF."</h4>";
+    $poll_form->display();
+    xoops_cp_footer();
+    exit();
+}
+
+if ( $op == "update" ) {
+    $poll = new XoopsPoll($_POST['poll_id']);
+    $poll->setVar("question", $_POST['question']);
+    $poll->setVar("description", $_POST['description']);
+    if ( !empty($_POST['end_time']) ) {
+        $end_time = userTimeToServerTime(strtotime($_POST['end_time']), $xoopsUser->timezone());
+        $poll->setVar("end_time", $end_time);
+    }
+    $poll->setVar("display", $_POST['display']);
+    $poll->setVar("weight", $_POST['weight']);
+    $poll->setVar("multiple", $_POST['multiple']);
+    if ( $_POST['notify'] == 1 && $end_time > time() ) {
+        // if notify, set mail status to "not mailed"
+        $poll->setVar("mail_status", POLL_NOTMAILED);
+    } else {
+        // if not notify, set mail status to already "mailed"
+        $poll->setVar("mail_status", POLL_MAILED);
+    }
+    if ( !$poll->store() ) {
+        echo $poll->getHtmlErrors();
+        exit();
+    }
+    $i = 0;
+    foreach ( $_POST['option_id'] as $opid ) {
+        $option = new XoopsPollOption($opid);
+        $option_text[$i] = trim ($_POST['option_text'][$i]);
+        if ( $option_text[$i] != "" ) {
+            $option->setVar("option_text", $option_text[$i]);
+            $option->setVar("option_color", $_POST['option_color'][$i]);
+            $option->store();
+        } else {
+            if ( $option->delete() != false ) {
+                XoopsPollLog::deleteByOptionId($option->getVar("option_id"));
+            }
+        }
+        $i++;
+    }
+    $poll->updateCount();
+    include_once XOOPS_ROOT_PATH.'/class/template.php';
+    xoops_template_clear_module_cache($xoopsModule->getVar('mid'));
+    redirect_header("index.php",1,_AM_DBUPDATED);
+    exit();
+}
+
+if ( $op == "addmore" ) {
+    $poll = new XoopsPoll($_GET['poll_id']);
+    $poll_form = new XoopsThemeForm(_AM_ADDMORE, "poll_form", "index.php");
+    $question_label = new XoopsFormLabel(_AM_POLLQUESTION, $poll->getVar("question"));
+    $poll_form->addElement($question_label);
+    $option_tray = new XoopsFormElementTray(_AM_POLLOPTIONS, "");
+    $barcolor_array =& XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH."/modules/xoopspoll/images/colorbars/");
+    for($i = 0; $i < 10; $i++){
+        $current_bar = (current($barcolor_array) != "blank.gif") ? current($barcolor_array) : next($barcolor_array);
+        $option_text = new XoopsFormText("", "option_text[]", 50, 255);
+        $option_tray->addElement($option_text);
+        $color_select = new XoopsFormSelect("", "option_color[".$i."]", $current_bar);
+        $color_select->addOptionArray($barcolor_array);
+        $color_select->setExtra("onchange='showImgSelected(\"option_color_image[".$i."]\", \"option_color[".$i."]\", \"modules/xoopspoll/images/colorbars\", \"\", \"".XOOPS_URL."\")'");
+        $color_label = new XoopsFormLabel("", "<img src='".XOOPS_URL."/modules/xoopspoll/images/colorbars/".$current_bar."' name='option_color_image[".$i."]' id='option_color_image[".$i."]' width='30' align='bottom' height='15' alt='' /><br />");
+        $option_tray->addElement($color_select);
+        $option_tray->addElement($color_label);
+        unset($color_select, $color_label, $option_text);
+        if ( !next($barcolor_array) ) {
+            reset($barcolor_array);
+        }
+    }
+    $poll_form->addElement($option_tray);
+    $submit_button = new XoopsFormButton("", "poll_submit", _SUBMIT, "submit");
+    $poll_form->addElement($submit_button);
+    $op_hidden = new XoopsFormHidden("op", "savemore");
+    $poll_form->addElement($op_hidden);
+    $poll_id_hidden = new XoopsFormHidden("poll_id", $poll->getVar("poll_id"));
+    $poll_form->addElement($poll_id_hidden);
+    xoops_cp_header();
+    echo "<h4>"._AM_POLLCONF."</h4>";
+    $poll_form->display();
+    xoops_cp_footer();
+    exit();
+}
+
+if ( $op == "savemore" ) {
+    $poll = new XoopsPoll($_POST['poll_id']);
+    $i = 0;
+    foreach ( $_POST['option_text'] as $optxt ) {
+        $optxt = trim($optxt);
+        if ( $optxt != "" ) {
+            $option = new XoopsPollOption();
+            $option->setVar("option_text", $optxt);
+            $option->setVar("poll_id", $poll->getVar("poll_id"));
+            $option->setVar("option_color", $_POST['option_color'][$i]);
+            $option->store();
+        }
+        $i++;
+    }
+    include_once XOOPS_ROOT_PATH.'/class/template.php';
+    xoops_template_clear_module_cache($xoopsModule->getVar('mid'));
+    redirect_header("index.php",1,_AM_DBUPDATED);
+    exit();
+}
+
+if ( $op == "delete" ) {
+    xoops_cp_header();
+    echo "<h4>"._AM_POLLCONF."</h4>";
+    $poll = new XoopsPoll($_GET['poll_id']);
+    xoops_confirm(array('op' => 'delete_ok', 'poll_id' => $poll->getVar('poll_id')), 'index.php', sprintf(_AM_RUSUREDEL,$poll->getVar("question")));
+    xoops_cp_footer();
+    exit();
+}
+
+if ( $op == "delete_ok" ) {
+    $poll = new XoopsPoll($_POST['poll_id']);
+    if ( $poll->delete() != false ) {
+        XoopsPollOption::deleteByPollId($poll->getVar("poll_id"));
+        XoopsPollLog::deleteByPollId($poll->getVar("poll_id"));
+        include_once XOOPS_ROOT_PATH.'/class/template.php';
+        xoops_template_clear_module_cache($xoopsModule->getVar('mid'));
+        // delete comments for this poll
+        xoops_comment_delete($xoopsModule->getVar('mid'), $poll->getVar('poll_id'));
+
+    }
+    redirect_header("index.php",1,_AM_DBUPDATED);
+    exit();
+}
+
+if ( $op == "restart" ) {
+    $poll = new XoopsPoll($_GET['poll_id']);
+    $poll_form = new XoopsThemeForm(_AM_RESTARTPOLL, "poll_form", "index.php");
+    $expire_text = new XoopsFormText(_AM_EXPIRATION."<br /><small>"._AM_FORMAT."<br />".sprintf(_AM_CURRENTTIME, formatTimestamp(time(), "Y-m-d H:i:s"))."</small>", "end_time", 20, 19, formatTimestamp(time()+604800, "Y-m-d H:i:s"));
+    $poll_form->addElement($expire_text);
+    $notify_yn = new XoopsFormRadioYN(_AM_NOTIFY, "notify", 1);
+    $poll_form->addElement($notify_yn);
+    $reset_yn = new XoopsFormRadioYN(_AM_RESET, "reset", 0);
+    $poll_form->addElement($reset_yn);
+    $op_hidden = new XoopsFormHidden("op", "restart_ok");
+    $poll_form->addElement($op_hidden);
+    $poll_id_hidden = new XoopsFormHidden("poll_id", $poll->getVar("poll_id"));
+    $poll_form->addElement($poll_id_hidden);
+    $submit_button = new XoopsFormButton("", "poll_submit", _AM_RESTART, "submit");
+    $poll_form->addElement($submit_button);
+    xoops_cp_header();
+    echo "<h4>"._AM_POLLCONF."</h4>";
+    $poll_form->display();
+    xoops_cp_footer();
+    exit();
+}
+
+if ( $op == "restart_ok" ) {
+    $poll = new XoopsPoll($_POST['poll_id']);
+    if ( !empty($_POST['end_time']) ) {
+        $end_time = userTimeToServerTime(strtotime($_POST['end_time']), $xoopsUser->timezone());
+        $poll->setVar("end_time", $end_time);
+    } else {
+        $poll->setVar("end_time", time() + (86400 * 10));
+    }
+    if ( $_POST['notify'] == 1 && $end_time > time() ) {
+        // if notify, set mail status to "not mailed"
+        $poll->setVar("mail_status", POLL_NOTMAILED);
+    } else {
+        // if not notify, set mail status to already "mailed"
+        $poll->setVar("mail_status", POLL_MAILED);
+    }
+    if ( $_POST['reset'] == 1 ) {
+        // reset all logs
+        XoopsPollLog::deleteByPollId($poll->getVar("poll_id"));
+        XoopsPollOption::resetCountByPollId($poll->getVar("poll_id"));
+    }
+    if (!$poll->store()) {
+        echo $poll->getHtmlErrors();
+        exit();
+    }
+    $poll->updateCount();
+    include_once XOOPS_ROOT_PATH.'/class/template.php';
+    xoops_template_clear_module_cache($xoopsModule->getVar('mid'));
+    redirect_header("index.php",1,_AM_DBUPDATED);
+    exit();
+}
+
+if ( $op == "log" ) {
+    xoops_cp_header();
+    echo "<h4>"._AM_POLLCONF."</h4>";
+    echo "<br />View Log<br /> Sorry, not yet. ;-)";
+    xoops_cp_footer();
+    exit();
+}
+
+if ( $op == "quickupdate" ) {
+    $count = count($_POST['poll_id']);
+    for ( $i = 0; $i < $count; $i++ ) {
+        $display[$i] = empty($_POST['display'][$i]) ? 0 : 1;
+        $weight[$i] = empty($_POST['weight'][$i]) ? 0 : intval($_POST['weight'][$i]);
+        if ( $display[$i] != $_POST['old_display'][$i] || $weight[$i] != $_POST['old_weight'][$i] ) {
+            $poll = new XoopsPoll($_POST['poll_id'][$i]);
+            $poll->setVar("display", $display[$i]);
+            $poll->setVar("weight", $weight[$i]);
+            $poll->store();
+        }
+    }
+    include_once XOOPS_ROOT_PATH.'/class/template.php';
+    xoops_template_clear_module_cache($xoopsModule->getVar('mid'));
+    redirect_header("index.php",1,_AM_DBUPDATED);
+    exit();
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/comment_edit.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/comment_edit.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/comment_edit.php	(revision 405)
@@ -0,0 +1,29 @@
+<?php
+// $Id: comment_edit.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+include '../../mainfile.php';
+include XOOPS_ROOT_PATH.'/include/comment_edit.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/comment_post.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/comment_post.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/comment_post.php	(revision 405)
@@ -0,0 +1,29 @@
+<?php
+// $Id: comment_post.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+include '../../mainfile.php';
+include XOOPS_ROOT_PATH.'/include/comment_post.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/index.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/index.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/index.php	(revision 405)
@@ -0,0 +1,140 @@
+<?php
+// $Id: index.php,v 1.3 2005/09/04 20:46:12 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+// ------------------------------------------------------------------------- //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+include "../../mainfile.php";
+include XOOPS_ROOT_PATH."/modules/xoopspoll/include/constants.php";
+include_once XOOPS_ROOT_PATH."/modules/xoopspoll/class/xoopspoll.php";
+include_once XOOPS_ROOT_PATH."/modules/xoopspoll/class/xoopspolloption.php";
+include_once XOOPS_ROOT_PATH."/modules/xoopspoll/class/xoopspolllog.php";
+include_once XOOPS_ROOT_PATH."/modules/xoopspoll/class/xoopspollrenderer.php";
+if ( !empty($_POST['poll_id']) ) {
+	$poll_id = intval($_POST['poll_id']);
+} elseif (!empty($_GET['poll_id'])) {
+	$poll_id = intval($_GET['poll_id']);
+}
+
+if ( empty($poll_id) ) {
+	$xoopsOption['template_main'] = 'xoopspoll_index.html';
+	include XOOPS_ROOT_PATH."/header.php";
+	$limit = (!empty($_GET['limit'])) ? intval($_GET['limit']) : 50;
+	$start = (!empty($_GET['start'])) ? intval($_GET['start']) : 0;
+    $xoopsTpl->assign('lang_pollslist', _PL_POLLSLIST);
+    $xoopsTpl->assign('lang_pollquestion' , _PL_POLLQUESTION);
+    $xoopsTpl->assign('lang_pollvoters', _PL_VOTERS);
+    $xoopsTpl->assign('lang_votes', _PL_VOTES);
+    $xoopsTpl->assign('lang_expiration', _PL_EXPIRATION);
+    $xoopsTpl->assign('lang_results', _PL_RESULTS);
+	// add 1 to $limit to know whether there are more polls
+	$polls_arr =& XoopsPoll::getAll(array(), true, "weight ASC, end_time DESC", $limit+1, $start);
+	$polls_count = count($polls_arr);
+	$max = ( $polls_count > $limit ) ? $limit : $polls_count;
+	for ( $i = 0; $i < $max; $i++ ) {
+	$polls = array();
+    $polls['pollId'] = $polls_arr[$i]->getVar("poll_id");
+		if ( $polls_arr[$i]->getVar("end_time") > time() ) {
+            $polls['pollEnd'] = formatTimestamp($polls_arr[$i]->getVar("end_time"),"m");
+			$polls['pollQuestion'] = "<a href='index.php?poll_id=".$polls_arr[$i]->getVar("poll_id")."'>".$polls_arr[$i]->getVar("question")."</a>";
+		} else {
+			$polls['pollEnd'] = "<span style='color:#ff0000;'>"._PL_EXPIRED."</span>";
+			$polls['pollQuestion'] = $polls_arr[$i]->getVar("question");
+		}
+	$polls['pollVoters'] = $polls_arr[$i]->getVar("voters");
+    $polls['pollVotes'] = $polls_arr[$i]->getVar("votes");
+	$xoopsTpl->append('polls', $polls);
+	unset($polls);
+	}
+	include XOOPS_ROOT_PATH."/footer.php";
+} elseif ( !empty($_POST['option_id']) ) {
+	$voted_polls = (!empty($_COOKIE['voted_polls'])) ? $_COOKIE['voted_polls'] : array();
+	$mail_author = false;
+	$poll = new XoopsPoll($poll_id);
+	if ( !$poll->hasExpired() ) {
+		if ( empty($voted_polls[$poll_id]) ) {
+			if ( $xoopsUser ) {
+				if ( XoopsPollLog::hasVoted($poll_id, xoops_getenv('REMOTE_ADDR'), $xoopsUser->getVar("uid")) ) {
+					setcookie("voted_polls[$poll_id]", 1, 0);
+					$msg = _PL_ALREADYVOTED;
+				} else {
+					$poll->vote($_POST['option_id'], xoops_getenv('REMOTE_ADDR'), $xoopsUser->getVar("uid"));
+					$poll->updateCount();
+					setcookie("voted_polls[$poll_id]", 1, 0);
+					$msg = _PL_THANKSFORVOTE;
+				}
+			} else {
+				if ( XoopsPollLog::hasVoted($poll_id, xoops_getenv('REMOTE_ADDR')) ) {
+					setcookie("voted_polls[$poll_id]", 1, 0);
+					$msg = _PL_ALREADYVOTED;
+				} else {
+					$poll->vote($_POST['option_id'], xoops_getenv('REMOTE_ADDR'));
+					$poll->updateCount();
+					setcookie("voted_polls[$poll_id]", 1, 0);
+					$msg = _PL_THANKSFORVOTE;
+				}
+			}
+		} else {
+			$msg = _PL_ALREADYVOTED;
+		}
+	} else {
+		$msg = _PL_SORRYEXPIRED;
+		if ( $poll->getVar("mail_status") != POLL_MAILED ) {
+			$xoopsMailer =& getMailer();
+			$xoopsMailer->useMail();
+			$xoopsMailer->setTemplateDir(XOOPS_ROOT_PATH."/modules/xoopspoll/language/".$xoopsConfig['language']."/mail_template/");
+			$xoopsMailer->setTemplate("mail_results.tpl");
+			$author = new XoopsUser($poll->getVar("user_id"));
+			$xoopsMailer->setToUsers($author);
+			$xoopsMailer->assign("POLL_QUESTION", $poll->getVar("question"));
+			$xoopsMailer->assign("POLL_START", formatTimestamp($poll->getVar("start_time"), "l", $author->timezone()));
+			$xoopsMailer->assign("POLL_END", formatTimestamp($poll->getVar("end_time"), "l", $author->timezone()));
+			$xoopsMailer->assign("POLL_VOTES", $poll->getVar("votes"));
+			$xoopsMailer->assign("POLL_VOTERS", $poll->getVar("voters"));
+			$xoopsMailer->assign("POLL_ID", $poll->getVar("poll_id"));
+			$xoopsMailer->assign("SITENAME", $xoopsConfig['sitename']);
+			$xoopsMailer->assign("ADMINMAIL", $xoopsConfig['adminmail']);
+			$xoopsMailer->assign("SITEURL", $xoopsConfig['xoops_url']."/");
+
+			$xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
+			$xoopsMailer->setFromName($xoopsConfig['sitename']);
+			$xoopsMailer->setSubject(sprintf(_PL_YOURPOLLAT,$author->uname(),$xoopsConfig['sitename']));
+			if ( $xoopsMailer->send() != false ) {
+				$poll->setVar("mail_status", POLL_MAILED);
+				$poll->store();
+			}
+		}
+	}
+	redirect_header(XOOPS_URL."/modules/xoopspoll/pollresults.php?poll_id=$poll_id", 1, $msg);
+	exit();
+} elseif ( !empty($poll_id) ) {
+	$xoopsOption['template_main'] = 'xoopspoll_view.html';
+	include XOOPS_ROOT_PATH."/header.php";
+	$poll = new XoopsPoll($poll_id);
+	$renderer = new XoopsPollRenderer($poll);
+    $renderer->assignForm($xoopsTpl);
+    $xoopsTpl->assign('lang_vote' , _PL_VOTE);
+    $xoopsTpl->assign('lang_results' , _PL_RESULTS);
+	include XOOPS_ROOT_PATH."/footer.php";
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/templates/xoopspoll_results.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/templates/xoopspoll_results.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/templates/xoopspoll_results.html	(revision 405)
@@ -0,0 +1,46 @@
+<div style='text-align: center; margin: 3px;'>
+<table width="60%" class="outer" cellspacing="1">
+  <tr>
+    <th colspan="2"><{$poll.question}></th>
+  </tr>
+  <tr>
+    <td class="head" align="right" colspan="2">
+    <{$poll.end_text}>
+    </td>
+  </tr>
+
+  <{foreach item=option from=$poll.options}>
+  <tr>
+    <td class="even" width="30%" align="left">
+    <{$option.text}>
+    </td>
+    <td class="odd" width="70%" align="left">
+    <{$option.image}> <{$option.percent}>
+    </td>
+  </tr>
+  <{/foreach}>
+  <tr>
+    <td class="foot" colspan="2" align="center">
+      <{$poll.totalVotes}><br /><{$poll.totalVoters}><br /><{$poll.vote}>
+    </td>
+  </tr>
+</table>
+</div>
+<br />
+
+<div style="text-align:center; padding: 3px; margin:3px;">
+  <{$commentsnav}>
+  <{$lang_notice}>
+</div>
+
+<div style="margin:3px; padding: 3px;">
+<!-- start comments loop -->
+<{if $comment_mode == "flat"}>
+  <{include file="db:system_comments_flat.html"}>
+<{elseif $comment_mode == "thread"}>
+  <{include file="db:system_comments_thread.html"}>
+<{elseif $comment_mode == "nest"}>
+  <{include file="db:system_comments_nest.html"}>
+<{/if}>
+<!-- end comments loop -->
+</div>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/templates/xoopspoll_index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/templates/xoopspoll_index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/templates/xoopspoll_index.html	(revision 405)
@@ -0,0 +1,24 @@
+<h4><{$lang_pollslist}></h4>
+
+<table width="100%" class="outer" cellspacing='1'>
+  <tr>
+    <th><{$lang_pollquestion}></th>
+    <th align='center'><{$lang_pollvoters}></th>
+    <th align='center'><{$lang_votes}></th>
+    <th align='center'><{$lang_expiration}></th>
+    <th>&nbsp;</th>
+  </tr>
+
+<!-- start polls item loop -->
+<{section name=i loop=$polls}>
+  <tr>
+    <td class="even"><{$polls[i].pollQuestion}></td>
+    <td align="center" class="odd"><{$polls[i].pollVoters}></td>
+    <td align="center" class="even"><{$polls[i].pollVotes}></td>
+    <td align="center" class="odd"><{$polls[i].pollEnd}></td>
+    <td align="right" class="even"><a href="pollresults.php?poll_id=<{$polls[i].pollId}>"><{$lang_results}></a></td>
+  </tr>
+<{/section}>
+<!-- end polls item loop -->
+
+</table>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/templates/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/templates/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/templates/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/templates/xoopspoll_view.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/templates/xoopspoll_view.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/templates/xoopspoll_view.html	(revision 405)
@@ -0,0 +1,18 @@
+<form action="<{$poll.action}>" method="post">
+  <table width="100%" class="outer" cellspacing="1">
+    <tr>
+      <th align="center" colspan="2"><input type="hidden" name="poll_id" value="<{$poll.pollId}>" /><{$poll.question}></th>
+    </tr>
+
+    <{foreach item=option from=$poll.options}>
+	<tr>
+      <td class="even" align="left" width="2%"><{$option.input}></td>
+      <td class="odd" align="left" width="98%"><{$option.text}></td>
+    </tr>
+    <{/foreach}>
+
+	<tr>
+      <td align="center" colspan="2" class="foot"><input type="submit" value="<{$lang_vote}>" />&nbsp;<input type="button" value="<{$lang_results}>" onclick="location='<{$poll.viewresults}>'" /></td>
+    </tr>
+  </table>
+</form>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/templates/blocks/xoopspoll_block_poll.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/templates/blocks/xoopspoll_block_poll.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/templates/blocks/xoopspoll_block_poll.html	(revision 405)
@@ -0,0 +1,20 @@
+<{foreach item=poll from=$block.polls}>
+<form style="margin-top: 1px;" action="<{$xoops_url}>/modules/xoopspoll/index.php" method="post">
+<table class="outer" cellspacing="1">
+  <tr>
+    <th align="center" colspan="2"><input type="hidden" name="poll_id" value="<{$poll.id}>" /><{$poll.question}></th>
+  </tr>
+
+  <{foreach item=option from=$poll.options}>
+  <tr class="<{cycle values="even,odd"}>">
+    <td align="center"><input type="<{$poll.option_type}>" name="<{$poll.option_name}>" value="<{$option.id}>" /></td>
+    <td align="left"><{$option.text}></td>
+  </tr>
+  <{/foreach}>
+
+  <tr>
+    <td class="foot" align="center" colspan="2"><input type="submit" value="<{$block.lang_vote}>" /> <input type="button" value="<{$block.lang_results}>" onclick="location='<{$xoops_url}>/modules/xoopspoll/pollresults.php?poll_id=<{$poll.id}>'" /></td>
+  </tr>
+</table>
+</form>
+<{/foreach}>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/templates/blocks/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/templates/blocks/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/templates/blocks/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/sql/mysql.sql
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/sql/mysql.sql	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/sql/mysql.sql	(revision 405)
@@ -0,0 +1,68 @@
+# phpMyAdmin MySQL-Dump
+# version 2.2.2
+# http://phpwizard.net/phpMyAdmin/
+# http://phpmyadmin.sourceforge.net/ (download page)
+#
+# --------------------------------------------------------
+
+#
+# Table structure for table `poll_data`
+#
+
+CREATE TABLE xoopspoll_option (
+  option_id int(10) unsigned NOT NULL auto_increment,
+  poll_id mediumint(8) unsigned NOT NULL default '0',
+  option_text varchar(255) NOT NULL default '',
+  option_count smallint(5) unsigned NOT NULL default '0',
+  option_color varchar(25) NOT NULL default '',
+  PRIMARY KEY  (option_id),
+  KEY poll_id (poll_id)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `mpn_poll_desc`
+#
+
+CREATE TABLE xoopspoll_desc (
+  poll_id mediumint(8) unsigned NOT NULL auto_increment,
+  question varchar(255) NOT NULL default '',
+  description tinytext NOT NULL default '',
+  user_id int(5) unsigned NOT NULL default '0',
+  start_time int(10) unsigned NOT NULL default '0',
+  end_time int(10) unsigned NOT NULL default '0',
+  votes smallint(5) unsigned NOT NULL default '0',
+  voters smallint(5) unsigned NOT NULL default '0',
+  multiple tinyint(1) unsigned NOT NULL default '0',
+  display tinyint(1) unsigned NOT NULL default '0',
+  weight smallint(5) unsigned NOT NULL default '0',
+  mail_status tinyint(1) unsigned NOT NULL default '0',
+  PRIMARY KEY  (poll_id),
+  KEY end_time (end_time),
+  KEY display (display)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `poll_log`
+#
+
+CREATE TABLE xoopspoll_log (
+  log_id int(10) unsigned NOT NULL auto_increment,
+  poll_id mediumint(8) unsigned NOT NULL default '0',
+  option_id int(10) unsigned NOT NULL default '0',
+  ip char(15) NOT NULL default '',
+  user_id int(5) unsigned NOT NULL default '0',
+  time int(10) unsigned NOT NULL default '0',
+  PRIMARY KEY  (log_id),
+  KEY poll_id_user_id (poll_id, user_id),
+  KEY poll_id_ip (poll_id, ip)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+
+INSERT INTO xoopspoll_desc VALUES (1, 'What do you think about XOOPS?', 'A simple survey about the content management script used on this site.', 1, 1020447898, 1051983686, 0, 0, 0, 1, 0, 0);
+INSERT INTO xoopspoll_option VALUES (1, 1, 'Excellent!', 0, 'aqua.gif');
+INSERT INTO xoopspoll_option VALUES (2, 1, 'Cool', 0, 'blue.gif');
+INSERT INTO xoopspoll_option VALUES (3, 1, 'Hmm..not bad', 0, 'brown.gif');
+INSERT INTO xoopspoll_option VALUES (4, 1, 'What the hell is this?', 0, 'darkgreen.gif');
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/sql/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/sql/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/sql/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/comment_new.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/comment_new.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/comment_new.php	(revision 405)
@@ -0,0 +1,29 @@
+<?php
+// $Id: comment_new.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+include '../../mainfile.php';
+include XOOPS_ROOT_PATH.'/include/comment_new.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/comment_reply.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/comment_reply.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/comment_reply.php	(revision 405)
@@ -0,0 +1,29 @@
+<?php
+// $Id: comment_reply.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+include '../../mainfile.php';
+include XOOPS_ROOT_PATH.'/include/comment_reply.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/xoops_version.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/xoops_version.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/xoops_version.php	(revision 405)
@@ -0,0 +1,75 @@
+<?php
+// $Id: xoops_version.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+$modversion['name'] = _MI_POLLS_NAME;
+$modversion['version'] = 1.00;
+$modversion['description'] = _MI_POLLS_DESC;
+$modversion['author'] = "Kazumi Ono<br />( http://www.myweb.ne.jp/ )";
+$modversion['credits'] = "The XOOPS Project";
+$modversion['help'] = "xoopspoll.html";
+$modversion['license'] = "GPL see LICENSE";
+$modversion['official'] = 1;
+$modversion['image'] = "images/xoopspoll_slogo.png";
+$modversion['dirname'] = "xoopspoll";
+
+// Sql file (must contain sql generated by phpMyAdmin or phpPgAdmin)
+// All tables should not have any prefix!
+$modversion['sqlfile']['mysql'] = "sql/mysql.sql";
+//$modversion['sqlfile']['postgresql'] = "sql/pgsql.sql";
+
+// Tables created by sql file (without prefix!)
+$modversion['tables'][0] = "xoopspoll_option";
+$modversion['tables'][1] = "xoopspoll_desc";
+$modversion['tables'][2] = "xoopspoll_log";
+
+// Admin things
+$modversion['hasAdmin'] = 1;
+$modversion['adminindex'] = "admin/index.php";
+$modversion['adminmenu'] = "admin/menu.php";
+
+$modversion['templates'][1]['file'] = 'xoopspoll_index.html';
+$modversion['templates'][1]['description'] = '';
+$modversion['templates'][2]['file'] = 'xoopspoll_view.html';
+$modversion['templates'][2]['description'] = '';
+$modversion['templates'][3]['file'] = 'xoopspoll_results.html';
+$modversion['templates'][3]['description'] = '';
+
+//Blocks
+$modversion['blocks'][1]['file'] = "xoopspoll.php";
+$modversion['blocks'][1]['name'] = _MI_POLLS_BNAME1;
+$modversion['blocks'][1]['description'] = "Shows unlimited number of polls/surveys";
+$modversion['blocks'][1]['show_func'] = "b_xoopspoll_show";
+$modversion['blocks'][1]['template'] = 'xoopspoll_block_poll.html';
+
+// Menu
+$modversion['hasMain'] = 1;
+
+// Comments
+$modversion['hasComments'] = 1;
+$modversion['comments']['pageName'] = 'pollresults.php';
+$modversion['comments']['itemName'] = 'poll_id';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/class/xoopspolloption.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/class/xoopspolloption.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/class/xoopspolloption.php	(revision 405)
@@ -0,0 +1,143 @@
+<?php
+// $Id: xoopspolloption.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+include_once XOOPS_ROOT_PATH."/class/xoopsobject.php";
+
+class XoopsPollOption extends XoopsObject
+{
+	var $db;
+
+	// constructor
+	function XoopsPollOption($id=null)
+	{
+		$this->db =& Database::getInstance();
+		$this->initVar("option_id", XOBJ_DTYPE_INT, null, false);
+		$this->initVar("poll_id", XOBJ_DTYPE_INT, null, false);
+		$this->initVar("option_text", XOBJ_DTYPE_TXTBOX, null, true, 255);
+		$this->initVar("option_count", XOBJ_DTYPE_INT, 0, false);
+		$this->initVar("option_color", XOBJ_DTYPE_OTHER, null, false);
+		if ( !empty($id) ) {
+			if ( is_array($id) ) {
+				$this->assignVars($id);
+			} else {
+				$this->load(intval($id));
+			}
+		}
+	}
+
+	// public
+	function store()
+	{
+		if ( !$this->cleanVars() ) {
+			return false;
+		}
+		foreach ( $this->cleanVars as $k=>$v ) {
+			$$k = $v;
+		}
+		if ( empty($option_id) ) {
+			$option_id = $this->db->genId($this->db->prefix("xoopspoll_option")."_option_id_seq");
+			$sql = "INSERT INTO ".$this->db->prefix("xoopspoll_option")." (option_id, poll_id, option_text, option_count, option_color) VALUES ($option_id, $poll_id, ".$this->db->quoteString($option_text).", $option_count, ".$this->db->quoteString($option_color).")";
+		} else {
+			$sql = "UPDATE ".$this->db->prefix("xoopspoll_option")." SET option_text=".$this->db->quoteString($option_text).", option_count=$option_count, option_color=".$this->db->quoteString($option_color)."  WHERE option_id=".$option_id."";
+		}
+		//echo $sql;
+		if ( !$result = $this->db->query($sql) ) {
+			$this->setErrors("Could not store data in the database.");
+			return false;
+		}
+		if ( empty($option_id) ) {
+			return $this->db->getInsertId();
+		}
+		return $option_id;
+	}
+
+	// private
+	function load($id)
+	{
+		$sql = "SELECT * FROM ".$this->db->prefix("xoopspoll_option")." WHERE option_id=".$id."";
+		$myrow = $this->db->fetchArray($this->db->query($sql));
+		$this->assignVars($myrow);
+	}
+
+	// public
+	function delete()
+	{
+		$sql = sprintf("DELETE FROM %s WHERE option_id = %u", $this->db->prefix("xoopspoll_option"), $this->getVar("option_id"));
+        	if ( !$this->db->query($sql) ) {
+			return false;
+		}
+		return true;
+	}
+
+	// public
+	function updateCount()
+	{
+		$votes = XoopsPollLog::getTotalVotesByOptionId($this->getVar("option_id"));
+		$sql ="UPDATE ".$this->db->prefix("xoopspoll_option")." SET option_count=$votes WHERE option_id=".$this->getVar("option_id")."";
+		$this->db->query($sql);
+	}
+
+	// public static
+	function &getAllByPollId($poll_id)
+	{
+		$db =& Database::getInstance();
+		$ret = array();
+		$sql = "SELECT * FROM ".$db->prefix("xoopspoll_option")." WHERE poll_id=".intval($poll_id)." ORDER BY option_id";
+		$result = $db->query($sql);
+		while ( $myrow = $db->fetchArray($result) ) {
+			$ret[] = new XoopsPollOption($myrow);
+		}
+		//echo $sql;
+		return $ret;
+	}
+
+	// public static
+	function deleteByPollId($poll_id)
+	{
+		$db =& Database::getInstance();
+		$sql = sprintf("DELETE FROM %s WHERE poll_id = %u", $db->prefix("xoopspoll_option"), intval($poll_id));
+        	if ( !$db->query($sql) ) {
+			return false;
+		}
+		return true;
+	}
+
+	// public static
+	function resetCountByPollId($poll_id)
+	{
+		$db =& Database::getInstance();
+		$sql = "UPDATE ".$db->prefix("xoopspoll_option")." SET option_count=0 WHERE poll_id=".intval($poll_id);
+        	if ( !$db->query($sql) ) {
+			return false;
+		}
+		return true;
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/class/xoopspoll.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/class/xoopspoll.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/class/xoopspoll.php	(revision 405)
@@ -0,0 +1,199 @@
+<?php
+// $Id: xoopspoll.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+include_once XOOPS_ROOT_PATH."/class/xoopsobject.php";
+
+class XoopsPoll extends XoopsObject
+{
+	var $db;
+
+	//constructor
+	function XoopsPoll($id=null)
+	{
+		$this->db =& Database::getInstance();
+		$this->initVar("poll_id", XOBJ_DTYPE_INT, null, false);
+		$this->initVar("question", XOBJ_DTYPE_TXTBOX, null, true, 255);
+		$this->initVar("description", XOBJ_DTYPE_TXTBOX, null, false, 255);
+		$this->initVar("user_id", XOBJ_DTYPE_INT, null, false);
+		$this->initVar("start_time", XOBJ_DTYPE_INT, null, false);
+		$this->initVar("end_time", XOBJ_DTYPE_INT, null, true);
+		$this->initVar("votes", XOBJ_DTYPE_INT, 0, false);
+		$this->initVar("voters", XOBJ_DTYPE_INT, 0, false);
+		$this->initVar("display", XOBJ_DTYPE_INT, 1, false);
+		$this->initVar("weight", XOBJ_DTYPE_INT, 0, false);
+		$this->initVar("multiple", XOBJ_DTYPE_INT, 0, false);
+		$this->initVar("mail_status", XOBJ_DTYPE_INT, 1, false);
+		if ( !empty($id) ) {
+			if ( is_array($id) ) {
+				$this->assignVars($id);
+			} else {
+				$this->load(intval($id));
+			}
+		}
+	}
+
+	// public
+	function store()
+	{
+		if ( !$this->cleanVars() ) {
+			return false;
+		}
+		foreach ( $this->cleanVars as $k=>$v ) {
+			$$k = $v;
+		}
+		$start_time = empty($start_time) ? time() : $start_time;
+		if ( $end_time <= $start_time ) {
+			$this->setErrors("End time must be set to future");
+			return false;
+		}
+		if ( empty($poll_id) ) {
+			$poll_id = $this->db->genId($this->db->prefix("xoopspoll_desc")."_poll_id_seq");
+			$sql = "INSERT INTO ".$this->db->prefix("xoopspoll_desc")." (poll_id, question, description, user_id, start_time, end_time, votes, voters, display, weight, multiple, mail_status) VALUES ($poll_id, ".$this->db->quoteString($question).", ".$this->db->quoteString($description).", $user_id, $start_time, $end_time, 0, 0, $display, $weight, $multiple, $mail_status)";
+		} else {
+			$sql ="UPDATE ".$this->db->prefix("xoopspoll_desc")." SET question=".$this->db->quoteString($question).", description=".$this->db->quoteString($description).", start_time=$start_time, end_time=$end_time, display=$display, weight=$weight, multiple=$multiple, mail_status=$mail_status WHERE poll_id=$poll_id";
+		}
+		//echo $sql;
+		if ( !$result = $this->db->query($sql) ) {
+			$this->setErrors("Could not store data in the database.");
+			return false;
+		}
+		if ( empty($poll_id) ) {
+			return $this->db->getInsertId();
+		}
+		return $poll_id;
+	}
+
+	// private
+	function load($id)
+	{
+		$sql = "SELECT * FROM ".$this->db->prefix("xoopspoll_desc")." WHERE poll_id=".$id."";
+		$myrow = $this->db->fetchArray($this->db->query($sql));
+		$this->assignVars($myrow);
+	}
+
+	// public
+	function hasExpired()
+	{
+		if ( $this->getVar("end_time") > time() ) {
+			return false;
+		}
+		return true;
+	}
+
+	// public
+	function delete()
+	{
+		$sql = sprintf("DELETE FROM %s WHERE poll_id = %u", $this->db->prefix("xoopspoll_desc"), $this->getVar("poll_id"));
+        	if ( !$this->db->query($sql) ) {
+			return false;
+		}
+		return true;
+	}
+
+	// private, static
+	function &getAll($criteria=array(), $asobject=true, $orderby="end_time DESC", $limit=0, $start=0)
+	{
+		$db =& Database::getInstance();
+		$ret = array();
+		$where_query = "";
+		if ( is_array($criteria) && count($criteria) > 0 ) {
+			$where_query = " WHERE";
+			foreach ( $criteria as $c ) {
+				$where_query .= " $c AND";
+			}
+			$where_query = substr($where_query, 0, -4);
+		}
+		if ( !$asobject ) {
+			$sql = "SELECT poll_id FROM ".$db->prefix("xoopspoll_desc")."$where_query ORDER BY $orderby";
+			$result = $db->query($sql,intval($limit),intval($start));
+			while ( $myrow = $db->fetchArray($result) ) {
+				$ret[] = $myrow['poll_id'];
+			}
+		} else {
+			$sql = "SELECT * FROM ".$db->prefix("xoopspoll_desc")."".$where_query." ORDER BY $orderby";
+			$result = $db->query($sql,$limit,$start);
+			while ( $myrow = $db->fetchArray($result) ) {
+				$ret[] = new XoopsPoll($myrow);
+			}
+		}
+		//echo $sql;
+		return $ret;
+	}
+
+	// public
+	function vote($option_id, $ip, $user_id=null)
+	{
+		if (!empty($option_id)) {
+			if (is_array($option_id)) {
+				foreach ($option_id as $vote) {
+					$option = new XoopsPollOption($vote);
+					if ( $this->getVar("poll_id") == $option->getVar("poll_id") ) {
+						$log = new XoopsPollLog();
+						$log->setVar("poll_id", $this->getVar("poll_id"));
+						$log->setVar("option_id", $vote);
+						$log->setVar("ip", $ip);
+						if ( isset($user_id) ) {
+							$log->setVar("user_id", $user_id);
+						}
+						if(!$log->store()) {
+						} else {
+							$option->updateCount();
+						}
+					}
+				}
+			} else {
+				$option = new XoopsPollOption($option_id);
+				if ( $this->getVar("poll_id") == $option->getVar("poll_id") ) {
+					$log = new XoopsPollLog();
+					$log->setVar("poll_id", $this->getVar("poll_id"));
+					$log->setVar("option_id", $option_id);
+					$log->setVar("ip", $ip);
+					if ( isset($user_id) ) {
+						$log->setVar("user_id", $user_id);
+					}
+					$log->store();
+					$option->updateCount();
+				}
+			}
+			return true;
+		}
+		return false;
+	}
+
+	// public
+	function updateCount()
+	{
+		$votes = XoopsPollLog::getTotalVotesByPollId($this->getVar("poll_id"));
+		$voters = XoopsPollLog::getTotalVotersByPollId($this->getVar("poll_id"));
+		$sql ="UPDATE ".$this->db->prefix("xoopspoll_desc")." SET votes=$votes, voters=$voters WHERE poll_id=".$this->getVar("poll_id")."";
+		$this->db->query($sql);
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/class/xoopspolllog.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/class/xoopspolllog.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/class/xoopspolllog.php	(revision 405)
@@ -0,0 +1,175 @@
+<?php
+// $Id: xoopspolllog.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+include_once XOOPS_ROOT_PATH."/class/xoopsobject.php";
+
+class XoopsPollLog extends XoopsObject
+{
+	var $db;
+
+	// constructor
+	function XoopsPollLog($id=null)
+	{
+		$this->db =& Database::getInstance();
+		$this->initVar("log_id", XOBJ_DTYPE_INT, 0);
+		$this->initVar("poll_id", XOBJ_DTYPE_INT, null, true);
+		$this->initVar("option_id", XOBJ_DTYPE_INT, null, true);
+		$this->initVar("ip", XOBJ_DTYPE_OTHER, null);
+		$this->initVar("user_id", XOBJ_DTYPE_INT, 0);
+		$this->initVar("time", XOBJ_DTYPE_INT, null);
+		if ( !empty($id) ) {
+			if ( is_array($id) ) {
+				$this->assignVars($id);
+			} else {
+				$this->load(intval($id));
+			}
+		}
+	}
+
+	// public
+	function store()
+	{
+		if ( !$this->cleanVars() ) {
+			return false;
+		}
+		foreach ( $this->cleanVars as $k=>$v ) {
+			$$k = $v;
+		}
+		$log_id = $this->db->genId($this->db->prefix("xoopspoll_log")."_log_id_seq");
+		$sql = "INSERT INTO ".$this->db->prefix("xoopspoll_log")." (log_id, poll_id, option_id, ip, user_id, time) VALUES ($log_id, $poll_id, $option_id, ".$this->db->quoteString($ip).", $user_id, ".time().")";
+		$result = $this->db->query($sql);
+		if (!$result) {
+			$this->setErrors("Could not store log data in the database.");
+			return false;
+		}
+		return $option_id;
+	}
+
+	// private
+	function load($id)
+	{
+		$sql = "SELECT * FROM ".$this->db->prefix("xoopspoll_log")." WHERE log_id=".$id."";
+		$myrow = $this->db->fetchArray($this->db->query($sql));
+		$this->assignVars($myrow);
+	}
+
+	// public
+	function delete()
+	{
+		$sql = sprintf("DELETE FROM %s WHERE log_id = %u", $this->db->prefix("xoopspoll_log"), $this->getVar("log_id"));
+        	if ( !$this->db->query($sql) ) {
+			return false;
+		}
+		return true;
+	}
+
+	// public static
+	function &getAllByPollId($poll_id, $orderby="time ASC")
+	{
+		$db =& Database::getInstance();
+		$ret = array();
+		$sql = "SELECT * FROM ".$db->prefix("xoopspoll_log")." WHERE poll_id=".intval($poll_id)." ORDER BY $orderby";
+		$result = $db->query($sql);
+		while ( $myrow = $db->fetchArray($result) ) {
+			$ret[] = new XoopsPollLog($myrow);
+		}
+		//echo $sql;
+		return $ret;
+	}
+
+	// public static
+	function hasVoted($poll_id, $ip, $user_id=null)
+	{
+		$db =& Database::getInstance();
+		$sql = "SELECT COUNT(*) FROM ".$db->prefix("xoopspoll_log")." WHERE poll_id=".intval($poll_id)." AND";
+		if ( !empty($user_id) ) {
+			$sql .= " user_id=".intval($user_id);
+		} else {
+			$sql .= " ip='".$ip."'";
+		}
+		list($count) = $db->fetchRow($db->query($sql));
+		if ( $count > 0 ) {
+			return true;
+		}
+		return false;
+	}
+
+	// public static
+	function deleteByPollId($poll_id)
+	{
+		$db =& Database::getInstance();
+		$sql = sprintf("DELETE FROM %s WHERE poll_id = %u", $db->prefix("xoopspoll_log"), intval($poll_id));
+        	if ( !$db->query($sql) ) {
+			return false;
+		}
+		return true;
+	}
+
+	// public static
+	function deleteByOptionId($option_id)
+	{
+		$db =& Database::getInstance();
+		$sql = sprintf("DELETE FROM %s WHERE option_id = %u", $db->prefix("xoopspoll_log"), intval($option_id));
+        	if ( !$db->query($sql) ) {
+			return false;
+		}
+		return true;
+	}
+
+	// public static
+	function getTotalVotersByPollId($poll_id)
+	{
+		$db =& Database::getInstance();
+		$sql = "SELECT DISTINCT user_id FROM ".$db->prefix("xoopspoll_log")." WHERE poll_id=".intval($poll_id)." AND user_id > 0";
+		$users = $db->getRowsNum($db->query($sql));
+		$sql = "SELECT DISTINCT ip FROM ".$db->prefix("xoopspoll_log")." WHERE poll_id=".intval($poll_id)." AND user_id=0";
+		$anons = $db->getRowsNum($db->query($sql));
+		return $users+$anons;
+	}
+
+	// public static
+	function getTotalVotesByPollId($poll_id)
+	{
+		$db =& Database::getInstance();
+		$sql = "SELECT COUNT(*) FROM ".$db->prefix("xoopspoll_log")." WHERE poll_id = ".intval($poll_id);
+		list($votes) = $db->fetchRow($db->query($sql));
+		return $votes;
+	}
+
+	// public static
+	function getTotalVotesByOptionId($option_id)
+	{
+		$db =& Database::getInstance();
+		$sql = "SELECT COUNT(*) FROM ".$db->prefix("xoopspoll_log")." WHERE option_id = ".intval($option_id);
+		list($votes) = $db->fetchRow($db->query($sql));
+		return $votes;
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/class/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/class/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/class/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/class/xoopspollrenderer.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/class/xoopspollrenderer.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/class/xoopspollrenderer.php	(revision 405)
@@ -0,0 +1,151 @@
+<?php
+// $Id: xoopspollrenderer.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+include_once XOOPS_ROOT_PATH."/modules/xoopspoll/language/".$xoopsConfig['language']."/main.php";
+
+class XoopsPollRenderer
+{
+	// private
+	// XoopsPoll class object
+	var $poll;
+
+	// constructor
+	function XoopsPollRenderer(&$poll)
+	{
+		$this->poll =& $poll;
+	}
+
+	// public
+	function renderForm()
+	{
+		$content = "<form action='".XOOPS_URL."/modules/xoopspoll/index.php' method='post'>";
+		$content .= "<table width='100%' border='0' cellpadding='4' cellspacing='1'>\n";
+		$content .= "<tr class='bg3'><td align='center' colspan='2'><input type='hidden' name='poll_id' value='".$this->poll->getVar("poll_id")."' />\n";
+		$content .= "<b>".$this->poll->getVar("question")."</b></td></tr>\n";
+		$options_arr =& XoopsPollOption::getAllByPollId($this->poll->getVar("poll_id"));
+		$option_type = "radio";
+		$option_name = "option_id";
+		if ( $this->poll->getVar("multiple") == 1 ) {
+			$option_type = "checkbox";
+			$option_name .= "[]";
+		}
+		foreach ( $options_arr as $option ) {
+			$content .= "<tr class='bg1'><td align='center'><input type='$option_type' name='$option_name' value='".$option->getVar("option_id")."' /></td><td align='left'>".$option->getVar("option_text"). "</td></tr>\n";
+		}
+        	$content .= "<tr class='bg3'><td align='center' colspan='2'><input type='submit' value='"._PL_VOTE."' />&nbsp;";
+        	$content .= "<input type='button' value='"._PL_RESULTS."' class='button' onclick='location=\"".XOOPS_URL."/modules/xoopspoll/pollresults.php?poll_id=".$this->poll->getVar("poll_id")."\"' />";
+        	$content .= "</td></tr></table></form>\n";
+		return $content;
+	}
+
+    function assignForm(&$tpl)
+    {
+		$options_arr =& XoopsPollOption::getAllByPollId($this->poll->getVar("poll_id"));
+		$option_type = "radio";
+		$option_name = "option_id";
+		if ( $this->poll->getVar("multiple") == 1 ) {
+			$option_type = "checkbox";
+			$option_name .= "[]";
+		}
+        $i = 0;
+		foreach ( $options_arr as $option ) {
+			$options[$i]['input'] = "<input type='$option_type' name='$option_name' value='".$option->getVar("option_id")."' />";
+            $options[$i]['text']  = $option->getVar("option_text");
+            $i++;
+		}
+		$tpl->assign('poll', array('question' => $this->poll->getVar("question"), 'pollId' => $this->poll->getVar("poll_id"), 'viewresults' => XOOPS_URL."/modules/xoopspoll/pollresults.php?poll_id=".$this->poll->getVar("poll_id"), 'action' => XOOPS_URL."/modules/xoopspoll/index.php", 'options' => $options));
+    }
+
+	// public
+	function renderResults()
+	{
+		if ( !$this->poll->hasExpired() ) {
+			$end_text = sprintf(_PL_ENDSAT, formatTimestamp($this->poll->getVar("end_time"), "m"));
+		} else {
+			$end_text = sprintf(_PL_ENDEDAT, formatTimestamp($this->poll->getVar("end_time"), "m"));
+		}
+		echo "<div style='text-align:center'><table width='60%' border='0' cellpadding='4' cellspacing='0'><tr class='bg3'><td><span style='font-weight:bold;'>".$this->poll->getVar("question")."</span></td></tr><tr class='bg1'><td align='right'>$end_text</td></tr></table>";
+
+		echo "<table width='60%' border='0' cellpadding='4' cellspacing='0'>";
+		$options_arr =& XoopsPollOption::getAllByPollId($this->poll->getVar("poll_id"));
+		$total = $this->poll->getVar("votes");
+		foreach ( $options_arr as $option ) {
+			if ( $total > 0 ) {
+				$percent = 100 * $option->getVar("option_count") / $total;
+			} else {
+				$percent = 0;
+			}
+			echo "<tr class='bg1'><td width='30%' align='left'>".$option->getVar("option_text")."</td><td width='70%' align='left'>";
+			if ( $percent > 0 ) {
+				$width = intval($percent)*2;
+				echo "<img src='".XOOPS_URL."/modules/xoopspoll/images/colorbars/".$option->getVar("option_color", "E")."' height='14' width='".$width."' align='middle' alt='".intval($percent)." %' />";
+			}
+			printf(" %d %% (%d)", $percent, $option->getVar("option_count"));
+			echo "</td></tr>";
+		}
+		echo "<tr class='bg1'><td colspan='2' align='center'><br /><b>".sprintf(_PL_TOTALVOTES, $total)."<br />".sprintf(_PL_TOTALVOTERS, $this->poll->getVar("voters"))."</b>";
+		if ( !$this->poll->hasExpired() ) {
+			echo "<br />[<a href='".XOOPS_URL."/modules/xoopspoll/index.php?poll_id=".$this->poll->getVar("poll_id")."'>"._PL_VOTE."</a>]";
+		}
+		echo "</td></tr></table></div><br />";
+	}
+
+    function assignResults(&$tpl)
+    {
+		if ( !$this->poll->hasExpired() ) {
+			$end_text = sprintf(_PL_ENDSAT, formatTimestamp($this->poll->getVar("end_time"), "m"));
+		} else {
+			$end_text = sprintf(_PL_ENDEDAT, formatTimestamp($this->poll->getVar("end_time"), "m"));
+		}
+		$options_arr =& XoopsPollOption::getAllByPollId($this->poll->getVar("poll_id"));
+		$total = $this->poll->getVar("votes");
+        $i = 0;
+		foreach ( $options_arr as $option ) {
+			if ( $total > 0 ) {
+				$percent = 100 * $option->getVar("option_count") / $total;
+			} else {
+				$percent = 0;
+			}
+			$options[$i]['text'] = $option->getVar("option_text");
+			if ( $percent > 0 ) {
+				$width = intval($percent)*2;
+				$options[$i]['image'] = "<img src='".XOOPS_URL."/modules/xoopspoll/images/colorbars/".$option->getVar("option_color", "E")."' height='14' width='".$width."' align='middle' alt='".intval($percent)." %' />";
+			}
+			$options[$i]['percent'] = sprintf(" %d %% (%d)", $percent, $option->getVar("option_count"));
+			$options[$i]['total'] = $option->getVar("option_count");
+			$i++;
+		}
+		if ( !$this->poll->hasExpired() ) {
+			$vote = "<a href='".XOOPS_URL."/modules/xoopspoll/index.php?poll_id=".$this->poll->getVar("poll_id")."'>"._PL_VOTE."</a>";
+		}
+		$tpl->assign('poll', array('question' => $this->poll->getVar("question"),'end_text' => $end_text,'totalVotes' => sprintf(_PL_TOTALVOTES, $total), 'totalVoters' => sprintf(_PL_TOTALVOTERS, $this->poll->getVar("voters")),'vote' => $vote, 'options' => $options));
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/images/colorbars/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/images/colorbars/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/images/colorbars/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/images/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/images/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/images/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/comment_delete.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/comment_delete.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/comment_delete.php	(revision 405)
@@ -0,0 +1,29 @@
+<?php
+// $Id: comment_delete.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+include '../../mainfile.php';
+include XOOPS_ROOT_PATH.'/include/comment_delete.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/blocks/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/blocks/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/blocks/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/blocks/xoopspoll.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/blocks/xoopspoll.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/blocks/xoopspoll.php	(revision 405)
@@ -0,0 +1,56 @@
+<?php
+// $Id: xoopspoll.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+include_once XOOPS_ROOT_PATH.'/modules/xoopspoll/class/xoopspoll.php';
+include_once XOOPS_ROOT_PATH.'/modules/xoopspoll/class/xoopspolloption.php';
+include_once XOOPS_ROOT_PATH.'/modules/xoopspoll/language/'.$xoopsConfig['language'].'/main.php';
+
+function b_xoopspoll_show()
+{
+	$block = array();
+	$polls =& XoopsPoll::getAll(array('display=1'), true, 'weight ASC, end_time DESC');
+	$count = count($polls);
+	$block['lang_vote'] = _PL_VOTE;
+	$block['lang_results'] = _PL_RESULTS;
+	for ($i = 0; $i < $count; $i++) {
+		$options_arr =& XoopsPollOption::getAllByPollId($polls[$i]->getVar('poll_id'));
+		$option_type = 'radio';
+		$option_name = 'option_id';
+		if ($polls[$i]->getVar('multiple') == 1) {
+			$option_type = 'checkbox';
+			$option_name .= '[]';
+		}
+		foreach ($options_arr as $option) {
+			$options[] = array('id' => $option->getVar('option_id'), 'text' => $option->getVar('option_text'));
+		}
+		$poll = array('id' => $polls[$i]->getVar('poll_id'), 'question' => $polls[$i]->getVar('question'), 'option_type' => $option_type, 'option_name' => $option_name, 'options' => $options);
+		$block['polls'][] =& $poll;
+		unset($options);
+		unset($poll);
+	}
+    return $block;
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/pollresults.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/pollresults.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopspoll/pollresults.php	(revision 405)
@@ -0,0 +1,52 @@
+<?php
+// $Id: pollresults.php,v 1.3 2005/09/04 20:46:12 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+include "../../mainfile.php";
+include XOOPS_ROOT_PATH."/modules/xoopspoll/include/constants.php";
+include_once XOOPS_ROOT_PATH."/modules/xoopspoll/class/xoopspoll.php";
+include_once XOOPS_ROOT_PATH."/modules/xoopspoll/class/xoopspolloption.php";
+include_once XOOPS_ROOT_PATH."/modules/xoopspoll/class/xoopspolllog.php";
+include_once XOOPS_ROOT_PATH."/modules/xoopspoll/class/xoopspollrenderer.php";
+
+$poll_id = $_GET['poll_id'];
+
+$poll_id = (!empty($poll_id)) ? intval($poll_id) : 0;
+if (empty($poll_id)) {
+	redirect_header("index.php",0);
+	exit();
+}
+$xoopsOption['template_main'] = 'xoopspoll_results.html';
+include XOOPS_ROOT_PATH."/header.php";
+
+$poll = new XoopsPoll($poll_id);
+$renderer = new XoopsPollRenderer($poll);
+$renderer->assignResults($xoopsTpl);
+
+include XOOPS_ROOT_PATH.'/include/comment_view.php';
+
+include XOOPS_ROOT_PATH."/footer.php";
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/include/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/include/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/include/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/include/functions.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/include/functions.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/include/functions.php	(revision 405)
@@ -0,0 +1,162 @@
+<?php
+// $Id: functions.php,v 1.1 2004/09/09 05:15:10 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+function mainheader($mainlink=1) {
+		echo "<br /><br /><p><a href=\"".XOOPS_URL."/modules/mydownloads/index.php\"><img src=\"".XOOPS_URL."/modules/mydownloads/images/logo-en.gif\" border=\"0\" alt\"\" /></a></p><br /><br />";
+}
+
+function newdownloadgraphic($time, $status) {
+	$count = 7;
+	$new = '';
+	$startdate = (time()-(86400 * $count));
+		if ($startdate < $time) {
+		if($status==1){
+			$new = "&nbsp;<img src=\"".XOOPS_URL."/modules/mydownloads/images/newred.gif\" alt=\""._MD_NEWTHISWEEK."\" />";
+		}elseif($status==2){
+			$new = "&nbsp;<img src=\"".XOOPS_URL."/modules/mydownloads/images/update.gif\" alt=\""._MD_UPTHISWEEK."\" />";
+		}
+	}
+	return $new;
+}
+
+function popgraphic($hits) {
+	global $xoopsModuleConfig;
+	if ($hits >= $xoopsModuleConfig['popular']) {
+		return "&nbsp;<img src =\"".XOOPS_URL."/modules/mydownloads/images/pop.gif\" alt=\""._MD_POPULAR."\" />";
+	}
+	return '';
+}
+//Reusable Link Sorting Functions
+function convertorderbyin($orderby) {
+	switch (trim($orderby)) {
+	case "titleA":
+		$orderby = "title ASC";
+		break;
+	case "dateA":
+		$orderby = "date ASC";
+		break;
+	case "hitsA":
+		$orderby = "hits ASC";
+		break;
+	case "ratingA":
+		$orderby = "rating ASC";
+		break;
+	case "titleD":
+		$orderby = "title DESC";
+		break;
+	case "hitsD":
+		$orderby = "hits DESC";
+		break;
+	case "ratingD":
+		$orderby = "rating DESC";
+		break;
+	case"dateD":
+	default:
+		$orderby = "date DESC";
+		break;
+	}
+	return $orderby;
+}
+function convertorderbytrans($orderby) {
+	if ($orderby == "hits ASC")   $orderbyTrans = _MD_POPULARITYLTOM;
+	if ($orderby == "hits DESC")    $orderbyTrans = _MD_POPULARITYMTOL;
+	if ($orderby == "title ASC")    $orderbyTrans = _MD_TITLEATOZ;
+	if ($orderby == "title DESC")   $orderbyTrans = _MD_TITLEZTOA;
+	if ($orderby == "date ASC") $orderbyTrans = _MD_DATEOLD;
+	if ($orderby == "date DESC")   $orderbyTrans = _MD_DATENEW;
+	if ($orderby == "rating ASC")  $orderbyTrans = _MD_RATINGLTOH;
+	if ($orderby == "rating DESC") $orderbyTrans = _MD_RATINGHTOL;
+	return $orderbyTrans;
+}
+function convertorderbyout($orderby) {
+	if ($orderby == "title ASC")            $orderby = "titleA";
+	if ($orderby == "date ASC")            $orderby = "dateA";
+	if ($orderby == "hits ASC")          $orderby = "hitsA";
+	if ($orderby == "rating ASC")        $orderby = "ratingA";
+	if ($orderby == "title DESC")              $orderby = "titleD";
+	if ($orderby == "date DESC")            $orderby = "dateD";
+	if ($orderby == "hits DESC")          $orderby = "hitsD";
+	if ($orderby == "rating DESC")        $orderby = "ratingD";
+	return $orderby;
+}
+
+function PrettySize($size) {
+	$mb = 1024*1024;
+	if ( $size > $mb ) {
+		$mysize = sprintf ("%01.2f",$size/$mb) . " MB";
+	}
+	elseif ( $size >= 1024 ) {
+		$mysize = sprintf ("%01.2f",$size/1024) . " KB";
+	}
+	else {
+	    $mysize = sprintf(_MD_NUMBYTES,$size);
+	}
+	return $mysize;
+}
+
+//updates rating data in itemtable for a given item
+function updaterating($sel_id){
+	global $xoopsDB;
+	$query = "select rating FROM ".$xoopsDB->prefix("mydownloads_votedata")." WHERE lid = ".$sel_id."";
+	$voteresult = $xoopsDB->query($query);
+		$votesDB = $xoopsDB->getRowsNum($voteresult);
+	$totalrating = 0;
+		while(list($rating)=$xoopsDB->fetchRow($voteresult)){
+		$totalrating += $rating;
+	}
+	$finalrating = $totalrating/$votesDB;
+	$finalrating = number_format($finalrating, 4);
+	$sql = sprintf("UPDATE %s SET rating = %u, votes = %u WHERE lid = %u", $xoopsDB->prefix("mydownloads_downloads"), $finalrating, $votesDB, $sel_id);
+	$xoopsDB->query($sql);
+}
+
+//returns the total number of items in items table that are accociated with a given table $table id
+function getTotalItems($sel_id, $status=""){
+	global $xoopsDB, $mytree;
+	$count = 0;
+	$arr = array();
+	$query = "select count(*) from ".$xoopsDB->prefix("mydownloads_downloads")." where cid=".$sel_id."";
+	if($status!=""){
+		$query .= " and status>=$status";
+	}
+	$result = $xoopsDB->query($query);
+	list($thing) = $xoopsDB->fetchRow($result);
+	$count = $thing;
+	$arr = $mytree->getAllChildId($sel_id);
+	$size = count($arr);
+	for($i=0;$i<$size;$i++){
+		$query2 = "select count(*) from ".$xoopsDB->prefix("mydownloads_downloads")." where cid=".$arr[$i]."";
+		if($status!=""){
+			$query2 .= " and status>=$status";
+		}
+		$result2 = $xoopsDB->query($query2);
+		list($thing) = $xoopsDB->fetchRow($result2);
+		$count += $thing;
+	}
+	return $count;
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/include/comment_functions.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/include/comment_functions.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/include/comment_functions.php	(revision 405)
@@ -0,0 +1,39 @@
+<?php
+// $Id: comment_functions.php,v 1.1 2004/09/09 05:15:10 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+// comment callback functions
+
+function mydownloads_com_update($download_id, $total_num){
+	$db =& Database::getInstance();
+	$sql = 'UPDATE '.$db->prefix('mydownloads_downloads').' SET comments = '.$total_num.' WHERE lid = '.$download_id;
+	$db->query($sql);
+}
+
+function mydownloads_com_approve(&$comment){
+	// notification mail here
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/include/search.inc.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/include/search.inc.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/include/search.inc.php	(revision 405)
@@ -0,0 +1,58 @@
+<?php
+// $Id: search.inc.php,v 1.1 2004/09/09 05:15:10 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+function mydownloads_search($queryarray, $andor, $limit, $offset, $userid){
+	global $xoopsDB;
+	$sql = "SELECT d.lid,d.cid,d.title,d.submitter,d.date,t.description FROM ".$xoopsDB->prefix("mydownloads_downloads")." d LEFT JOIN ".$xoopsDB->prefix("mydownloads_text")." t ON t.lid=d.lid WHERE status>0";
+	if ( $userid != 0 ) {
+		$sql .= " AND d.submitter=".$userid." ";
+	}
+	// because count() returns 1 even if a supplied variable
+	// is not an array, we must check if $querryarray is really an array
+	if ( is_array($queryarray) && $count = count($queryarray) ) {
+		$sql .= " AND ((d.title LIKE '%$queryarray[0]%' OR t.description LIKE '%$queryarray[0]%')";
+		for($i=1;$i<$count;$i++){
+			$sql .= " $andor ";
+			$sql .= "(d.title LIKE '%$queryarray[$i]%' OR t.description LIKE '%$queryarray[$i]%')";
+		}
+		$sql .= ") ";
+	}
+	$sql .= "ORDER BY d.date DESC";
+	$result = $xoopsDB->query($sql,$limit,$offset);
+	$ret = array();
+	$i = 0;
+ 	while($myrow = $xoopsDB->fetchArray($result)){
+		$ret[$i]['image'] = "images/size2.gif";
+		$ret[$i]['link'] = "singlefile.php?cid=".$myrow['cid']."&amp;lid=".$myrow['lid']."";
+		$ret[$i]['title'] = $myrow['title'];
+		$ret[$i]['time'] = $myrow['date'];
+		$ret[$i]['uid'] = $myrow['submitter'];
+		$i++;
+	}
+	return $ret;
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/include/notification.inc.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/include/notification.inc.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/include/notification.inc.php	(revision 405)
@@ -0,0 +1,69 @@
+<?php
+// $Id: notification.inc.php,v 1.1 2004/09/09 05:15:10 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+function mydownloads_notify_iteminfo($category, $item_id)
+{
+	global $xoopsModule, $xoopsModuleConfig, $xoopsConfig;
+
+	if (empty($xoopsModule) || $xoopsModule->getVar('dirname') != 'mydownloads') {	
+		$module_handler =& xoops_gethandler('module');
+		$module =& $module_handler->getByDirname('mydownloads');
+		$config_handler =& xoops_gethandler('config');
+		$config =& $config_handler->getConfigsByCat(0,$module->getVar('mid'));
+	} else {
+		$module =& $xoopsModule;
+		$config =& $xoopsModuleConfig;
+	}
+
+	if ($category=='global') {
+		$item['name'] = '';
+		$item['url'] = '';
+		return $item;
+	}
+
+	global $xoopsDB;
+	if ($category=='category') {
+		// Assume we have a valid category id
+		$sql = 'SELECT title FROM ' . $xoopsDB->prefix('mydownloads_cat') . ' WHERE cid = '.$item_id;
+		$result = $xoopsDB->query($sql); // TODO: error check
+		$result_array = $xoopsDB->fetchArray($result);
+		$item['name'] = $result_array['title'];
+		$item['url'] = XOOPS_URL . '/modules/' . $module->getVar('dirname') . '/viewcat.php?cid=' . $item_id;
+		return $item;
+	}
+
+	if ($category=='file') {
+		// Assume we have a valid file id
+		$sql = 'SELECT cid,title FROM '.$xoopsDB->prefix('mydownloads_downloads') . ' WHERE lid = ' . $item_id;
+		$result = $xoopsDB->query($sql); // TODO: error check
+		$result_array = $xoopsDB->fetchArray($result);
+		$item['name'] = $result_array['title'];
+		$item['url'] = XOOPS_URL . '/modules/' . $module->getVar('dirname') . '/singlefile.php?cid=' . $result_array['cid'] . '&amp;lid=' . $item_id;
+		return $item;
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/japanese/blocks.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/japanese/blocks.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/japanese/blocks.php	(revision 405)
@@ -0,0 +1,7 @@
+<?php
+// Blocks
+define("_MB_MYDOWNLOADS_DISP","É½¼¨·ï¿ô");
+define("_MB_MYDOWNLOADS_FILES","·ï");
+define("_MB_MYDOWNLOADS_CHARS","·ïÌ¾¤ÎÄ¹¤µ");
+define("_MB_MYDOWNLOADS_LENGTH"," ¥Ð¥¤¥È");
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/japanese/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/japanese/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/japanese/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/japanese/main.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/japanese/main.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/japanese/main.php	(revision 405)
@@ -0,0 +1,187 @@
+<?php
+
+//%%%%%%		Module Name 'MyDownloads'		%%%%%
+
+define("_MD_THANKSFORINFO","Åê¹Æ¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£Åö¥µ¥¤¥È¥¹¥¿¥Ã¥Õ¤¬³ÎÇ§¤·¤¿¸å¤Î·ÇºÜ¤È¤Ê¤ë¤³¤È¤ò¤´Î»¾µ¤¯¤À¤µ¤¤¡£");
+define("_MD_THANKSFORHELP","¾ðÊó¤ò¤ª´ó¤»Äº¤­¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£¸åÄøÅö¥µ¥¤¥È¥¹¥¿¥Ã¥Õ¤¬³ÎÇ§¤¤¤¿¤·¤Þ¤¹¡£");
+define("_MD_FORSECURITY","¥»¥­¥å¥ê¥Æ¥£¤ò´Õ¤ß¡¢IP¤ª¤è¤Ó¥æ¡¼¥¶Ì¾¤òµ­Ï¿¤·¤Æ¤¤¤ë¤³¤È¤ò¤´Î»¾µ¤¯¤À¤µ¤¤¡£");
+define("_MD_NOPERMISETOLINK",  "¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¤¢¤Ê¤¿¤¬¥¢¥¯¥»¥¹¤·¤¿¥µ¥¤¥ÈÆâ¤Ë¤¢¤ë¤â¤Î¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£<br /><br />¤½¤Î¥µ¥¤¥È¤Î´ÉÍý¼Ô¤ËÄ¾¥ê¥ó¥¯¤òÄ¥¤é¤Ê¤¤¤è¤¦¤ËÏ¢Íí¤·¤Æ¤¢¤²¤Æ²¼¤µ¤¤¡£ <br /><br />Ä¾¥ê¥ó¥¯¤È¤Ï: Â¾¿Í¤Î¥Õ¥¡¥¤¥ë¤ò¤¢¤¿¤«¤â¼«Ê¬¤Î¤â¤Î¤Î¤è¤¦¤Ë¥µ¥¤¥ÈÆâ¤Ë¥ê¥ó¥¯¤¹¤ë»ö¤ò¸À¤¤¤Þ¤¹¡£IP¥¢¥É¥ì¥¹¤Ïµ­Ï¿¤µ¤ì¤Þ¤·¤¿¡£");
+
+define("_MD_ALL","¤¹¤Ù¤Æ");
+define("_MD_DESCRIPTION","ÀâÌÀ");
+define("_MD_SEARCH","¸¡º÷");
+define("_MD_SUBMITCATHEAD","¥À¥¦¥ó¥í¡¼¥É¥Õ¥©¡¼¥à¤òÅÐÏ¿");
+
+define("_MD_MAIN","¥á¥¤¥ó");
+define("_MD_POPULAR","¥Ò¥Ã¥È¿ô");
+
+define("_MD_NEWTHISWEEK","1½µ´Ö°ÊÆâ¤ËÅÐÏ¿");
+define("_MD_UPTHISWEEK","1½µ´Ö°ÊÆâ¤Ë¹¹¿·");
+
+define("_MD_POPULARITYLTOM","¥Ò¥Ã¥È¿ô(¾¯¤Ê¤¤¤â¤Î¤«¤é)");
+define("_MD_POPULARITYMTOL","¥Ò¥Ã¥È¿ô(Â¿¤¤¤â¤Î¤«¤é)");
+define("_MD_TITLEATOZ","¥¿¥¤¥È¥ë(A¢ªZ)");
+define("_MD_TITLEZTOA","¥¿¥¤¥È¥ë(Z¢ªA)");
+define("_MD_DATEOLD","Æü»þ(¸Å¤¤¤â¤Î¤«¤é)");
+define("_MD_DATENEW","Æü»þ(¿·¤·¤¤¤â¤Î¤«¤é)");
+define("_MD_RATINGLTOH","É¾²Á(É¾²Á¤ÎÄã¤¤¤â¤Î¤«¤é)");
+define("_MD_RATINGHTOL","É¾²Á(É¾²Á¤Î¹â¤¤¤â¤Î¤«¤é)");
+
+define("_MD_NOSHOTS","¥¹¥¯¥ê¡¼¥ó¥·¥ç¥Ã¥È¤Ï¤¢¤ê¤Þ¤»¤ó");
+define("_MD_EDITTHISDL","¤³¤Î¥À¥¦¥ó¥í¡¼¥É¾ðÊó¤òÊÔ½¸¤¹¤ë");
+
+define("_MD_DESCRIPTIONC","ÀâÌÀ¡§");
+define("_MD_EMAILC","¥á¡¼¥ë¥¢¥É¥ì¥¹¡§");
+define("_MD_CATEGORYC","¥«¥Æ¥´¥ê¡§");
+define("_MD_LASTUPDATEC","ºÇ½ª¹¹¿·Æü»þ¡§");
+define("_MD_DLNOW","º£¤¹¤°¥À¥¦¥ó¥í¡¼¥É¡ª");
+define("_MD_VERSION","¥Ð¡¼¥¸¥ç¥ó");
+define("_MD_SUBMITDATE","·ÇºÜÆü");
+define("_MD_DLTIMES","%s ²ó¤Î¥À¥¦¥ó¥í¡¼¥É");
+define("_MD_FILESIZE","¥Õ¥¡¥¤¥ë¥µ¥¤¥º");
+define("_MD_SUPPORTEDPLAT","ÍøÍÑ²ÄÇ½¤Ê£Ï£Ó¡¿¥½¥Õ¥ÈÅù");
+define("_MD_HOMEPAGE","¥Û¡¼¥à¥Ú¡¼¥¸");
+define("_MD_HITSC","¥À¥¦¥ó¥í¡¼¥É¿ô¡§");
+define("_MD_RATINGC","É¾²Á¡§");
+define("_MD_ONEVOTE","1 É¼");
+define("_MD_NUMVOTES","%s É¼");
+define("_MD_RATETHISFILE","¤³¤Î¥À¥¦¥ó¥í¡¼¥É¤òÉ¾²Á¤¹¤ë");
+define("_MD_MODIFY","Åê¹Æ");
+define("_MD_REPORTBROKEN","¥Õ¥¡¥¤¥ëÇËÂ»¡¿¥ê¥ó¥¯ÀÚ¤ì¤òÊó¹ð");
+define("_MD_TELLAFRIEND","Í§Ã£¤Ë¶µ¤¨¤ë");
+define("_MD_EDIT","ÊÔ½¸");
+
+define("_MD_THEREARE","Åö¥µ¥¤¥È¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë¤Ï·×%s·ï¤Î¥Õ¥¡¥¤¥ë¤¬¤¢¤ê¤Þ¤¹");
+define("_MD_LATESTLIST","¿·Ãå¥À¥¦¥ó¥í¡¼¥É");
+
+define("_MD_REQUESTMOD","¥À¥¦¥ó¥í¡¼¥É¤Î½¤Àµ¤òÅê¹Æ¤¹¤ë");
+define("_MD_FILEID","¥Õ¥¡¥¤¥ëID¡§");
+define("_MD_FILETITLE","¥À¥¦¥ó¥í¡¼¥É¥¿¥¤¥È¥ë¡§");
+define("_MD_DLURL","¥À¥¦¥ó¥í¡¼¥ÉURL¡§");
+define("_MD_HOMEPAGEC","¥Û¡¼¥à¥Ú¡¼¥¸¡§");
+define("_MD_VERSIONC","¥Ð¡¼¥¸¥ç¥ó¡§");
+define("_MD_FILESIZEC","¥Õ¥¡¥¤¥ë¥µ¥¤¥º¡§");
+define("_MD_NUMBYTES","%s¥Ð¥¤¥È");
+define("_MD_PLATFORMC","ÍøÍÑ²ÄÇ½¤Ê£Ï£Ó¡¿¥½¥Õ¥ÈÅù¡§");
+define("_MD_SHOTIMAGE","¥¹¥¯¥ê¡¼¥ó¥·¥ç¥Ã¥È²èÁü¡§");
+define("_MD_SENDREQUEST","Á÷¿®");
+define("_MD_UPLOAD", "ÅºÉÕ¥Õ¥¡¥¤¥ë¡§");		//	add by bluemooninc.biz
+
+define("_MD_OPTIONS", '¥ª¥×¥·¥ç¥ó¡§');
+define("_MD_NOTIFYAPPROVE", '¤³¤Î¥Õ¥¡¥¤¥ë¤¬¾µÇ§¤µ¤ì¤¿¾ì¹ç¤ËÄÌÃÎ¤¹¤ë');
+
+define("_MD_VOTEAPPRE","ÅêÉ¼¤ò¼õÉÕ¤±¤Þ¤·¤¿¡£");
+define("_MD_THANKYOU","%s¤Ë¤´¶¨ÎÏ¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£"); // %s is your site name
+define("_MD_VOTEONCE","Æ±°ì¥À¥¦¥ó¥í¡¼¥É¾ðÊó¤ËÂÐ¤·¤ÆÅêÉ¼¤Ç¤­¤ë¤Î¤Ï£±²ó¸Â¤ê¤È¤µ¤»¤Æ¤¤¤¿¤À¤­¤Þ¤¹¡£");
+define("_MD_RATINGSCALE","É¾²Á¤ò1¡Á10¤Î´Ö¤«¤é¤ªÁª¤Ó¤¯¤À¤µ¤¤¡£¿ô»ú¤¬Âç¤­¤¤¤Û¤ÉÉ¾²Á¤¬¹â¤¤¤³¤È¤ò¼¨¤·¤Þ¤¹¡£");
+define("_MD_BEOBJECTIVE","¸øÀµ¤ÊÈ½ÃÇ¤Ë¤è¤ëÅêÉ¼¤ò¤ª´ê¤¤Ã×¤·¤Þ¤¹¡£");
+define("_MD_DONOTVOTE","¼«Ê¬¼«¿È¤Î¥À¥¦¥ó¥í¡¼¥É¾ðÊó¤ËÂÐ¤·¤Æ¤ÏÅêÉ¼¤Ç¤­¤Þ¤»¤ó¡£");
+define("_MD_RATEIT","É¾²Á¤¹¤ë");
+
+define("_MD_INTFILEFOUND","%s¤Ë¤ÆÈó¾ï¤ËÍ­ÍÑ¤Ê¥À¥¦¥ó¥í¡¼¥ÉÍÑ¥Õ¥¡¥¤¥ë¤ò¸«¤Ä¤±¤Þ¤·¤¿¡£"); // %s is your site name
+
+define("_MD_RECEIVED","¥À¥¦¥ó¥í¡¼¥É¾ðÊó¤ò¼õÉÕ¤±¤Þ¤·¤¿¡£¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£");
+define("_MD_WHENAPPROVED","¤³¤Î¥À¥¦¥ó¥í¡¼¥É¾ðÊó¤¬Àµ¼°¤Ë¾µÇ§¤µ¤ì¤¿ºÝ¤Ë¤Ï¥á¡¼¥ë¤Ë¤Æ¤½¤Î»Ý¤ò¤ªÅÁ¤¨¤·¤Þ¤¹¡£");
+define("_MD_SUBMITONCE","Æ±¤¸¥Õ¥¡¥¤¥ë¡¿¥¹¥¯¥ê¥×¥È¤Î¥À¥¦¥ó¥í¡¼¥É¾ðÊó¤òÅê¹Æ¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£");
+define("_MD_ALLPENDING","¥À¥¦¥ó¥í¡¼¥É¾ðÊó¤Ï¡¢Åö¥µ¥¤¥È¥¹¥¿¥Ã¥Õ¤Ë¤è¤ë¾µÇ§¸å¤ËÀµ¼°·ÇºÜ¤È¤Ê¤ê¤Þ¤¹¡£");
+define("_MD_DONTABUSE","¥æ¡¼¥¶Ì¾¤ª¤è¤ÓIP¥¢¥É¥ì¥¹¤òµ­Ï¿¤·¤Æ¤Þ¤¹¡£¤¤¤¿¤º¤éÌÜÅª¤ÎÅê¹Æ¤Ï¤·¤Ê¤¤¤è¤¦¤Ë¤ª´ê¤¤Ã×¤·¤Þ¤¹¡£");
+define("_MD_TAKEDAYS","¥À¥¦¥ó¥í¡¼¥É¾ðÊó¤¬Àµ¼°·ÇºÜ¤È¤Ê¤ë¤Þ¤Ç¤Ë¿ôÆü¤òÍ×¤¹¤ë¾ì¹ç¤¬¤¢¤ë¤³¤È¤ò¤´Î»¾µ¤¯¤À¤µ¤¤¡£");
+
+define("_MD_RANK","½ç°Ì");
+define("_MD_CATEGORY","¥«¥Æ¥´¥ê");
+define("_MD_HITS","¥À¥¦¥ó¥í¡¼¥É¿ô");
+define("_MD_RATING","É¾²Á");
+define("_MD_VOTE","ÅêÉ¼¿ô");
+
+define("_MD_SORTBY","¥½¡¼¥È½ç¡§");
+define("_MD_TITLE","¥¿¥¤¥È¥ë");
+define("_MD_DATE","ÆüÉÕ");
+define("_MD_POPULARITY","¥À¥¦¥ó¥í¡¼¥É¿ô");
+define("_MD_CURSORTBY","¸½ºß¤Î¥½¡¼¥È½ç¡§ %s");
+define("_MD_PREVIOUS","Á°¤Î¥Ú¡¼¥¸");
+define("_MD_NEXT","¼¡¤Î¥Ú¡¼¥¸");
+define("_MD_NOMATCH","³ºÅö¤¹¤ë¤â¤Î¤Ï¸«¤Ä¤«¤ê¤Þ¤»¤ó¤Ç¤·¤¿");
+
+define("_MD_TOP10","%s ¥È¥Ã¥×10"); // %s is a downloads category name
+
+define("_MD_SUBMIT","Á÷¿®");
+define("_MD_CANCEL","¥­¥ã¥ó¥»¥ë");
+
+define("_MD_BYTES","¥Ð¥¤¥È");
+define("_MD_ALREADYREPORTED","¾ðÊó¤ò¤ª´ó¤»Äº¤­¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£¸åÄøÅö¥µ¥¤¥È¥¹¥¿¥Ã¥Õ¤¬³ÎÇ§¤¤¤¿¤·¤Þ¤¹¡£");
+define("_MD_MUSTREGFIRST","¥À¥¦¥ó¥í¡¼¥É¾ðÊó¤òÅê¹Æ¤¹¤ë¤Ë¤ÏÀè¤Ë¥æ¡¼¥¶ÅÐÏ¿¤ò¤¹¤ëÉ¬Í×¤¬¤¢¤ê¤Þ¤¹¡£");
+define("_MD_NORATING","É¾²Á¤¬ÁªÂò¤µ¤ì¤Æ¤¤¤Þ¤»¤ó");
+define("_MD_CANTVOTEOWN","¼«Ê¬¼«¿È¤Î¥À¥¦¥ó¥í¡¼¥É¾ðÊó¤ËÂÐ¤·¤Æ¤ÎÉ¾²Á¤Ï¹Ô¤¨¤Þ¤»¤ó¡£");
+
+//%%%%%%	Module Name 'MyDownloads' (Admin)	  %%%%%
+
+define("_MD_DLCONF","¥À¥¦¥ó¥í¡¼¥É¾ðÊó´ÉÍý");
+define("_MD_GENERALSET","°ìÈÌÀßÄê");
+define("_MD_ADDMODDELETE","¥«¥Æ¥´¥ê¤ª¤è¤Ó¥À¥¦¥ó¥í¡¼¥É¾ðÊó¤ÎÄÉ²Ã¡¿½¤Àµ¡¿ºï½ü");
+define("_MD_DLSWAITING","¾µÇ§ÂÔ¤Á¥À¥¦¥ó¥í¡¼¥É¾ðÊó");
+define("_MD_BROKENREPORTS","¥Õ¥¡¥¤¥ëÇËÂ»¡¿¥ê¥ó¥¯ÀÚ¤ìÊó¹ð");
+define("_MD_MODREQUESTS","¥À¥¦¥ó¥í¡¼¥É¾ðÊó½¤Àµ¤Î¥ê¥¯¥¨¥¹¥È");
+define("_MD_SUBMITTER","Åê¹Æ¼Ô¡§");
+define("_MD_DOWNLOAD","¥À¥¦¥ó¥í¡¼¥É");
+define("_MD_APPROVE","¾µÇ§");
+define("_MD_DELETE","ºï½ü");
+define("_MD_NOSUBMITTED","¿·µ¬Åê¹Æ¤Ï¤¢¤ê¤Þ¤»¤ó");
+define("_MD_ADDMAIN","¥á¥¤¥ó¥«¥Æ¥´¥ê¤ÎºîÀ®");
+define("_MD_TITLEC","¥¿¥¤¥È¥ë¡§");
+define("_MD_IMGURL","¥«¥Æ¥´¥ê²èÁüURL¡Ê¥ª¥×¥·¥ç¥ó¤Ç¤¹¡£²èÁü¥Õ¥¡¥¤¥ë¤Î¹â¤µ¤Ï¼«Æ°Åª¤Ë50¥Ô¥¯¥»¥ë¤ËÄ´À°¤µ¤ì¤Þ¤¹¡£¡Ë¡§");
+define("_MD_ADD","ÄÉ²Ã");
+define("_MD_ADDSUB","¥µ¥Ö¥«¥Æ¥´¥ê¤ÎºîÀ®");
+define("_MD_IN","¿Æ¥«¥Æ¥´¥ê¡§");
+define("_MD_ADDNEWFILE","¿·µ¬¥À¥¦¥ó¥í¡¼¥É¾ðÊó");
+define("_MD_MODCAT","¥«¥Æ¥´¥ê¤ÎÊÔ½¸");
+define("_MD_MODDL","¥À¥¦¥ó¥í¡¼¥É¾ðÊó¤ÎÊÔ½¸");
+define("_MD_USER","¥æ¡¼¥¶");
+define("_MD_IP","IP¥¢¥É¥ì¥¹");
+define("_MD_USERAVG","¥æ¡¼¥¶¤ÎÊ¿¶ÑÉ¾²ÁÅÀ");
+define("_MD_TOTALRATE","ÁíÉ¾²Á¿ô");
+define("_MD_NOREGVOTES","ÅÐÏ¿¥æ¡¼¥¶¤Ë¤è¤ëÉ¾²Á¤Ï¤¢¤ê¤Þ¤»¤ó");
+define("_MD_NOUNREGVOTES","Ì¤ÅÐÏ¿¥æ¡¼¥¶¤Ë¤è¤ëÉ¾²Á¤Ï¤¢¤ê¤Þ¤»¤ó");
+define("_MD_VOTEDELETED","É¾²Á¥Ç¡¼¥¿¤òºï½ü¤·¤Þ¤·¤¿");
+define("_MD_NOBROKEN","¥Õ¥¡¥¤¥ëÇËÂ»¡¿¥ê¥ó¥¯ÀÚ¤ìÊó¹ð¤Ï¤¢¤ê¤Þ¤»¤ó");
+define("_MD_IGNOREDESC","Ìµ»ë (¥Õ¥¡¥¤¥ëÇËÂ»¡¿¥ê¥ó¥¯ÀÚ¤ìÊó¹ð¤òÌµ»ë¤·¡¢<b>¤³¤ÎÊó¹ð¤Î¤ß</b>¤òºï½ü¤·¤Þ¤¹¡£)");
+define("_MD_DELETEDESC","ºï½ü¡Ê¥Õ¥¡¥¤¥ëÇËÂ»¡¿¥ê¥ó¥¯ÀÚ¤ìÊó¹ð¤ª¤è¤Ó¥À¥¦¥ó¥í¡¼¥É¾ðÊó¤Î<b>Î¾Êý</b>¤òºï½ü¤·¤Þ¤¹¡£¡Ë");
+define("_MD_REPORTER","Á÷¿®¼Ô¡§");
+define("_MD_FILESUBMITTER","¥À¥¦¥ó¥í¡¼¥É¾ðÊóÄó¶¡¼Ô¡§");
+define("_MD_IGNORE","Ìµ»ë");
+define("_MD_FILEDELETED","¥À¥¦¥ó¥í¡¼¥É¾ðÊó¤òºï½ü¤·¤Þ¤·¤¿¡£");
+define("_MD_BROKENDELETED","¥Õ¥¡¥¤¥ëÇËÂ»¡¿¥ê¥ó¥¯ÀÚ¤ìÊó¹ð¤òºï½ü¤·¤Þ¤·¤¿¡£");
+define("_MD_USERMODREQ","¥À¥¦¥ó¥í¡¼¥É¾ðÊó½¤Àµ¤Î¥ê¥¯¥¨¥¹¥È");
+define("_MD_ORIGINAL","½¤ÀµÁ°");
+define("_MD_PROPOSED","½¤Àµ¸å");
+define("_MD_OWNER","¥À¥¦¥ó¥í¡¼¥É¾ðÊóÄó¶¡¼Ô¡§");
+define("_MD_NOMODREQ","¥À¥¦¥ó¥í¡¼¥É¾ðÊó½¤Àµ¤Î¥ê¥¯¥¨¥¹¥È¤Ï¤¢¤ê¤Þ¤»¤ó¡£");
+define("_MD_DBUPDATED","¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò¹¹¿·¤·¤Þ¤·¤¿¡£");
+define("_MD_MODREQDELETED","¥À¥¦¥ó¥í¡¼¥É¾ðÊó½¤Àµ¤Î¥ê¥¯¥¨¥¹¥È¤òºï½ü¤·¤Þ¤·¤¿¡£");
+define("_MD_IMGURLMAIN","¥«¥Æ¥´¥ê²èÁüURL¡Ê¥ª¥×¥·¥ç¥ó¤Ç¤¹¡£²èÁü¥Õ¥¡¥¤¥ë¤Î¹â¤µ¤Ï¼«Æ°Åª¤Ë50¥Ô¥¯¥»¥ë¤ËÄ´À°¤µ¤ì¤Þ¤¹¡£¥á¥¤¥ó¥«¥Æ¥´¥êÍÑ¡Ë¡§");
+define("_MD_PARENT","¿Æ¥«¥Æ¥´¥ê¡§");
+define("_MD_SAVE","ÊÑ¹¹¤òÊÝÂ¸");
+define("_MD_CATDELETED","¥«¥Æ¥´¥ê¤òºï½ü¤·¤Þ¤·¤¿¡£");
+define("_MD_WARNING","ËÜÅö¤Ë¤³¤Î¥«¥Æ¥´¥ê¤ª¤è¤Ó¥«¥Æ¥´¥êÆâ¤Î¥À¥¦¥ó¥í¡¼¥É¾ðÊó¤òÁ´¤Æºï½ü¤·¤Æ¤â¤è¤í¤·¤¤¤Ç¤¹¤«¡©");
+define("_MD_YES","¤Ï¤¤");
+define("_MD_NO","¤¤¤¤¤¨");
+define("_MD_NEWCATADDED","¥«¥Æ¥´¥ê¤òÄÉ²Ã¤·¤Þ¤·¤¿¡£");
+define("_MD_ERROREXIST","Åê¹Æ¤µ¤ì¤¿¥À¥¦¥ó¥í¡¼¥É¾ðÊó¤Ï´û¤ËÂ¸ºß¤·¤Þ¤¹¡£");
+define("_MD_ERRORTITLE","¥¿¥¤¥È¥ë¤òÆþÎÏ¤·¤Æ¤¯¤À¤µ¤¤¡£");
+define("_MD_ERRORDESC","ÀâÌÀ¤òÆþÎÏ¤·¤Æ¤¯¤À¤µ¤¤¡£");
+define("_MD_NEWDLADDED","¿·µ¬¥À¥¦¥ó¥í¡¼¥É¾ðÊó¤òÄÉ²Ã¤·¤Þ¤·¤¿¡£");
+define("_MD_WEAPPROVED","¤¢¤Ê¤¿¤¬Åê¹Æ¤·¤¿¥À¥¦¥ó¥í¡¼¥É¾ðÊó¤¬Åö¥µ¥¤¥È¥¹¥¿¥Ã¥Õ¤Ë¤è¤ê¾µÇ§¤µ¤ì¤Þ¤·¤¿¡£");
+define("_MD_HELLO","%s¤µ¤ó¡¢¤³¤ó¤Ë¤Á¤Ï");
+define("_MD_THANKSSUBMIT","Åê¹Æ¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£");
+
+define("_MD_MUSTBEVALID","¥¹¥¯¥ê¡¼¥ó¥·¥ç¥Ã¥È²èÁü¤Ë¤Ï%s¥Ç¥£¥ì¥¯¥È¥ê²¼¤Ë¤¢¤ë¥Õ¥¡¥¤¥ë¤ò»ÈÍÑ¤·¤Æ¤¯¤À¤µ¤¤¡ÊÎã shot.gif¡Ë¡£²èÁü¤¬¤Ê¤¤¾ì¹ç¤Ï²¿¤âµ­Æþ¤·¤Ê¤¤¤Ç²¼¤µ¤¤¡£");
+
+define("_MD_REGUSERVOTES","ÅÐÏ¿¥æ¡¼¥¶¤Ë¤è¤ëÉ¾²Á¡ÊÅêÉ¼¿ô¡§%s¡Ë");
+define("_MD_ANONUSERVOTES","Ì¤ÅÐÏ¿¥æ¡¼¥¶¤Ë¤è¤ëÉ¾²Á¡ÊÅêÉ¼¿ô¡§%s¡Ë");
+
+define("_MD_YOURFILEAT","Your file submitted at %s"); // this is an approved mail subject. %s is your site name
+
+define("_MD_VISITAT","%s¤Î¥À¥¦¥ó¥í¡¼¥É¥»¥¯¥·¥ç¥ó¤Ë¤ÆÍÍ¡¹¤Ê¥¹¥¯¥ê¥×¥È¡¿¥Õ¥¡¥¤¥ë¤Î¥À¥¦¥ó¥í¡¼¥É¾ðÊó¤ò¤´Í÷¤Ë¤Ê¤ì¤Þ¤¹¡£");
+
+define("_MD_DLRATINGS","Áí¹çÉ¾²Á¡ÊÅêÉ¼¿ô¡§%s¡Ë");
+define("_MD_ISAPPROVED","¤¢¤Ê¤¿¤«¤é¤Î¥À¥¦¥ó¥í¡¼¥ÉÅÐÏ¿¿½ÀÁ¤Ï¾µÇ§¤µ¤ì¤Þ¤·¤¿¡£");
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/japanese/mail_template/global_filesubmit_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/japanese/mail_template/global_filesubmit_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/japanese/mail_template/global_filesubmit_notify.tpl	(revision 405)
@@ -0,0 +1,20 @@
+{X_UNAME}¤µ¤ó¡¢¤³¤ó¤Ë¤Á¤Ï
+
+{X_SITENAME}¤Ë¤Æ¿·µ¬¥Õ¥¡¥¤¥ë¤ÎÅê¹Æ¤¬¤¢¤ê¤Þ¤·¤¿¡£
+¥Õ¥¡¥¤¥ëÌ¾¡§¡¡{FILE_NAME}
+
+¤³¤Î¥Õ¥¡¥¤¥ë¤Î¾ÜºÙ¤ò¸«¤ë¤Ë¤Ï²¼µ­¤ÎURL¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡§
+{WAITINGFILES_URL}
+
+-----------
+
+¤³¤Î¥á¡¼¥ë¤ÏXOOPS¤Î¼«Æ°ÄÌÃÎµ¡Ç½¤Ë¤è¤Ã¤ÆÁ÷¿®¤µ¤ì¤Æ¤¤¤Þ¤¹
+
+¼«Æ°ÄÌÃÎ¤òÄä»ß¤·¤¿¤¤¾ì¹ç¤Ï²¼µ­¤ÎURL¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡§
+{X_UNSUBSCRIBE_URL}
+
+-----------
+{X_SITENAME} ({X_SITEURL}) 
+´ÉÍý¿Í
+{X_ADMINMAIL}
+-----------
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/japanese/mail_template/category_newfile_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/japanese/mail_template/category_newfile_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/japanese/mail_template/category_newfile_notify.tpl	(revision 405)
@@ -0,0 +1,22 @@
+{X_UNAME}¤µ¤ó¡¢¤³¤ó¤Ë¤Á¤Ï
+
+{X_SITENAME}¤Ë¤Æ¡Ö{CATEGORY_NAME}¡×¥«¥Æ¥´¥ê²¼¤Ë¿·µ¬¥Õ¥¡¥¤¥ë¡Ö{FILE_NAME}¡×¤¬ÄÉ²Ã¤µ¤ì¤Þ¤·¤¿¡£
+
+²¼µ­URL¤Ë¤Æ¤³¤Î¥Õ¥¡¥¤¥ë¤ò¸«¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡§
+{FILE_URL}
+
+¤³¤Î¥Õ¥¡¥¤¥ë¤¬ÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¥«¥Æ¥´¥ê¤ò¸«¤ë¤Ë¤Ï°Ê²¼¤ÎURL¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡§
+{CATEGORY_URL}
+
+-----------
+
+¤³¤Î¥á¡¼¥ë¤ÏXOOPS¤Î¼«Æ°ÄÌÃÎµ¡Ç½¤Ë¤è¤Ã¤ÆÁ÷¿®¤µ¤ì¤Æ¤¤¤Þ¤¹
+
+¼«Æ°ÄÌÃÎ¤òÄä»ß¤·¤¿¤¤¾ì¹ç¤Ï²¼µ­¤ÎURL¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡§
+{X_UNSUBSCRIBE_URL}
+
+-----------
+{X_SITENAME} ({X_SITEURL}) 
+´ÉÍý¿Í
+{X_ADMINMAIL}
+-----------
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/japanese/mail_template/global_filemodify_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/japanese/mail_template/global_filemodify_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/japanese/mail_template/global_filemodify_notify.tpl	(revision 405)
@@ -0,0 +1,19 @@
+{X_UNAME}¤µ¤ó¡¢¤³¤ó¤Ë¤Á¤Ï
+
+¥Õ¥¡¥¤¥ë½¤Àµ¤Î¥ê¥¯¥¨¥¹¥È¤¬Åê¹Æ¤µ¤ì¤Þ¤·¤¿¡£
+
+¤³¤Î¥ê¥¯¥¨¥¹¥È¤Î¾ÜºÙ¤ò¸«¤ë¤Ë¤Ï²¼µ­¤ÎURL¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡§
+{MODIFYREPORTS_URL}
+
+-----------
+
+¤³¤Î¥á¡¼¥ë¤ÏXOOPS¤Î¼«Æ°ÄÌÃÎµ¡Ç½¤Ë¤è¤Ã¤ÆÁ÷¿®¤µ¤ì¤Æ¤¤¤Þ¤¹
+
+¼«Æ°ÄÌÃÎ¤òÄä»ß¤·¤¿¤¤¾ì¹ç¤Ï²¼µ­¤ÎURL¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡§
+{X_UNSUBSCRIBE_URL}
+
+-----------
+{X_SITENAME} ({X_SITEURL}) 
+´ÉÍý¿Í
+{X_ADMINMAIL}
+-----------
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/japanese/mail_template/global_newcategory_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/japanese/mail_template/global_newcategory_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/japanese/mail_template/global_newcategory_notify.tpl	(revision 405)
@@ -0,0 +1,21 @@
+{X_UNAME}¤µ¤ó¡¢¤³¤ó¤Ë¤Á¤Ï
+
+{X_SITENAME}¤Ë¤Æ¥À¥¦¥ó¥í¡¼¥É½¸¤Ë¿·µ¬¥«¥Æ¥´¥ê¤¬ºîÀ®¤µ¤ì¤Þ¤·¤¿¡£
+
+¥«¥Æ¥´¥êÌ¾¡§¡¡{CATEGORY_NAME}
+
+¤³¤Î¥«¥Æ¥´¥ê¤Î¾ÜºÙ¤ò¸«¤ë¤Ë¤Ï²¼µ­¤ÎURL¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡§
+{CATEGORY_URL}
+
+-----------
+
+¤³¤Î¥á¡¼¥ë¤ÏXOOPS¤Î¼«Æ°ÄÌÃÎµ¡Ç½¤Ë¤è¤Ã¤ÆÁ÷¿®¤µ¤ì¤Æ¤¤¤Þ¤¹
+
+¼«Æ°ÄÌÃÎ¤òÄä»ß¤·¤¿¤¤¾ì¹ç¤Ï²¼µ­¤ÎURL¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡§
+{X_UNSUBSCRIBE_URL}
+
+-----------
+{X_SITENAME} ({X_SITEURL}) 
+´ÉÍý¿Í
+{X_ADMINMAIL}
+-----------
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/japanese/mail_template/global_newfile_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/japanese/mail_template/global_newfile_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/japanese/mail_template/global_newfile_notify.tpl	(revision 405)
@@ -0,0 +1,21 @@
+{X_UNAME}¤µ¤ó¡¢¤³¤ó¤Ë¤Á¤Ï
+
+{X_SITENAME}¤Ë¤Æ¿·µ¬¥Õ¥¡¥¤¥ë¤¬ÅÐÏ¿¤µ¤ì¤Þ¤·¤¿¡£
+
+¥Õ¥¡¥¤¥ëÌ¾¡§¡¡{FILE_NAME}
+
+¤³¤Î¥Õ¥¡¥¤¥ë¤Î¾ÜºÙ¤ò¸«¤ë¤Ë¤Ï²¼µ­¤ÎURL¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡§
+{FILE_URL}
+
+-----------
+
+¤³¤Î¥á¡¼¥ë¤ÏXOOPS¤Î¼«Æ°ÄÌÃÎµ¡Ç½¤Ë¤è¤Ã¤ÆÁ÷¿®¤µ¤ì¤Æ¤¤¤Þ¤¹
+
+¼«Æ°ÄÌÃÎ¤òÄä»ß¤·¤¿¤¤¾ì¹ç¤Ï²¼µ­¤ÎURL¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡§
+{X_UNSUBSCRIBE_URL}
+
+-----------
+{X_SITENAME} ({X_SITEURL}) 
+´ÉÍý¿Í
+{X_ADMINMAIL}
+-----------
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/japanese/mail_template/file_approve_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/japanese/mail_template/file_approve_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/japanese/mail_template/file_approve_notify.tpl	(revision 405)
@@ -0,0 +1,19 @@
+{X_UNAME}¤µ¤ó¡¢¤³¤ó¤Ë¤Á¤Ï
+
+{X_SITENAME}¤Ë¤Æ¡Ö{FILE_NAME}¡×¤¬¾µÇ§¤µ¤ì¤Þ¤·¤¿¡£
+
+¤³¤Î¥Õ¥¡¥¤¥ë¤ò¸«¤ë¤Ë¤Ï²¼µ­¤ÎURL¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡§
+{FILE_URL}
+
+-----------
+
+¤³¤Î¥á¡¼¥ë¤ÏXOOPS¤Î¼«Æ°ÄÌÃÎµ¡Ç½¤Ë¤è¤Ã¤ÆÁ÷¿®¤µ¤ì¤Æ¤¤¤Þ¤¹
+
+¼«Æ°ÄÌÃÎ¤òÄä»ß¤·¤¿¤¤¾ì¹ç¤Ï²¼µ­¤ÎURL¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡§
+{X_UNSUBSCRIBE_URL}
+
+-----------
+{X_SITENAME} ({X_SITEURL}) 
+´ÉÍý¿Í
+{X_ADMINMAIL}
+-----------
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/japanese/mail_template/category_filesubmit_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/japanese/mail_template/category_filesubmit_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/japanese/mail_template/category_filesubmit_notify.tpl	(revision 405)
@@ -0,0 +1,19 @@
+{X_UNAME}¤µ¤ó¡¢¤³¤ó¤Ë¤Á¤Ï
+
+{X_SITENAME}¤Ë¤ª¤±¤ë¥À¥¦¥ó¥í¡¼¥É¥â¥¸¥å¡¼¥ë¤Î¡Ö{CATEGORY_NAME}¡×¥«¥Æ¥´¥ê²¼¤Ë¤Æ¡Ö{FILE_NAME}¡×¤ÎÅê¹Æ¤¬¤¢¤ê¤Þ¤·¤¿¡£
+
+¤³¤ÎÅê¹Æ¤ò¾µÇ§¤¹¤ë¤Ë¤Ï²¼µ­¤ÎURL¤Ø¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡£
+{WAITINGFILES_URL}
+
+-----------
+
+¤³¤Î¥á¡¼¥ë¤ÏXOOPS¤Î¼«Æ°ÄÌÃÎµ¡Ç½¤Ë¤è¤Ã¤ÆÁ÷¿®¤µ¤ì¤Æ¤¤¤Þ¤¹
+
+¼«Æ°ÄÌÃÎ¤òÄä»ß¤·¤¿¤¤¾ì¹ç¤Ï²¼µ­¤ÎURL¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡§
+{X_UNSUBSCRIBE_URL}
+
+-----------
+{X_SITENAME} ({X_SITEURL}) 
+´ÉÍý¿Í
+{X_ADMINMAIL}
+-----------
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/japanese/mail_template/global_filebroken_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/japanese/mail_template/global_filebroken_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/japanese/mail_template/global_filebroken_notify.tpl	(revision 405)
@@ -0,0 +1,19 @@
+{X_UNAME}¤µ¤ó¡¢¤³¤ó¤Ë¤Á¤Ï
+
+¥Õ¥¡¥¤¥ëÇËÂ»Êó¹ð¤ÎÅê¹Æ¤¬¤¢¤ê¤Þ¤·¤¿¡£
+
+¤³¤ÎÊó¹ð¤Î¾ÜºÙ¤ò¸«¤ë¤Ë¤Ï²¼µ­¤ÎURL¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡§
+{BROKENREPORTS_URL}
+
+-----------
+
+¤³¤Î¥á¡¼¥ë¤ÏXOOPS¤Î¼«Æ°ÄÌÃÎµ¡Ç½¤Ë¤è¤Ã¤ÆÁ÷¿®¤µ¤ì¤Æ¤¤¤Þ¤¹
+
+¼«Æ°ÄÌÃÎ¤òÄä»ß¤·¤¿¤¤¾ì¹ç¤Ï²¼µ­¤ÎURL¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡§
+{X_UNSUBSCRIBE_URL}
+
+-----------
+{X_SITENAME} ({X_SITEURL}) 
+´ÉÍý¿Í
+{X_ADMINMAIL}
+-----------
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/japanese/modinfo.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/japanese/modinfo.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/japanese/modinfo.php	(revision 405)
@@ -0,0 +1,95 @@
+<?php
+// Module Info
+
+// The name of this module
+define("_MI_MYDOWNLOADS_NAME","¥À¥¦¥ó¥í¡¼¥É");
+
+// A brief description of this module
+define("_MI_MYDOWNLOADS_DESC","¥æ¡¼¥¶¤¬¼«Í³¤Ë¥À¥¦¥ó¥í¡¼¥É¾ðÊó¤ÎÅÐÏ¿¡¿É¾²Á¤ò¹Ô¤¨¤ë¥»¥¯¥·¥ç¥ó¤òºîÀ®¤·¤Þ¤¹¡£");
+
+// Names of blocks for this module (Not all module has blocks)
+define("_MI_MYDOWNLOADS_BNAME1","¿·Ãå¥À¥¦¥ó¥í¡¼¥É");
+define("_MI_MYDOWNLOADS_BNAME2","¥È¥Ã¥×¥À¥¦¥ó¥í¡¼¥É");
+
+// Sub menu titles
+define("_MI_MYDOWNLOADS_SMNAME1","ÅÐÏ¿¤¹¤ë");
+define("_MI_MYDOWNLOADS_SMNAME2","¿Íµ¤¥À¥¦¥ó¥í¡¼¥É");
+define("_MI_MYDOWNLOADS_SMNAME3","¹âÉ¾²Á¥À¥¦¥ó¥í¡¼¥É");
+
+define("_MI_MYDOWNLOADS_ADMENU2","¥À¥¦¥ó¥í¡¼¥É¾ðÊó¤ÎÄÉ²Ã / ÊÔ½¸");
+define("_MI_MYDOWNLOADS_ADMENU3","¿·µ¬Åê¹Æ¥À¥¦¥ó¥í¡¼¥É¾ðÊó");
+define("_MI_MYDOWNLOADS_ADMENU4","¥Õ¥¡¥¤¥ëÇËÂ»Êó¹ð");
+define("_MI_MYDOWNLOADS_ADMENU5","½¤Àµ¥À¥¦¥ó¥í¡¼¥É¾ðÊó");
+
+// Title of config items
+define('_MI_MYDOWNLOADS_POPULAR','¡Ö¿Íµ¤¥À¥¦¥ó¥í¡¼¥É¡×¤Ë¤Ê¤ë¤¿¤á¤Î¥À¥¦¥ó¥í¡¼¥É¿ô');
+define('_MI_MYDOWNLOADS_NEWDLS','¥È¥Ã¥×¥Ú¡¼¥¸¤Î¡Ö¿·Ãå¥À¥¦¥ó¥í¡¼¥É¡×¤ËÉ½¼¨¤¹¤ë·ï¿ô');
+define('_MI_MYDOWNLOADS_PERPAGE','£±¥Ú¡¼¥¸Ëè¤ËÉ½¼¨¤¹¤ë¥À¥¦¥ó¥í¡¼¥É¾ðÊó¤Î·ï¿ô');
+define('_MI_MYDOWNLOADS_USESHOTS','¥¹¥¯¥ê¡¼¥ó¥·¥ç¥Ã¥È¤ò»ÈÍÑ¤¹¤ë');
+define('_MI_MYDOWNLOADS_SHOTWIDTH','¥¹¥¯¥ê¡¼¥ó¥·¥ç¥Ã¥È¤Î²èÁüÉý');
+define('_MI_MYDOWNLOADS_CHECKHOST','¥À¥¤¥ì¥¯¥È¥ê¥ó¥¯¤Î¶Ø»ß(leeching)');
+define('_MI_MYDOWNLOADS_REFERERS','¤³¤ì¤é¤Î¥µ¥¤¥È¤Ï¥Õ¥¡¥¤¥ë¤Ø¤Î¥À¥¤¥ì¥¯¥È¥ê¥ó¥¯¤¬²ÄÇ½<br />³Æ¥µ¥¤¥È¤Ï | ¤ÇÊ¬³ä');
+define('_MI_MYDOWNLOADS_ANONPOST','Æ¿Ì¾¥æ¡¼¥¶¤Ë¤è¤ë¥À¥¦¥ó¥í¡¼¥É¹àÌÜ¤ÎÅê¹Æ¤òµö²Ä¤¹¤ë');
+define('_MI_MYDOWNLOADS_AUTOAPPROVE','´ÉÍý¼Ô¤Î²ðºß¤·¤Ê¤¤¿·µ¬¥À¥¦¥ó¥í¡¼¥É¤Î¼«Æ°¾µÇ§');
+
+// Description of each config items
+define('_MI_MYDOWNLOADS_POPULARDSC', '¡Ö¿Íµ¤¡ª¡×¥¢¥¤¥³¥ó¤¬É½¼¨¤µ¤ì¤ë¤¿¤á¤Î¥À¥¦¥ó¥í¡¼¥É·ï¿ô¤ò»ØÄê¤·¤Æ¤¯¤À¤µ¤¤¡£');
+define('_MI_MYDOWNLOADS_NEWDLSDSC', '¥È¥Ã¥×¥Ú¡¼¥¸¤Î¡Ö¿·Ãå¥À¥¦¥ó¥í¡¼¥É¡×¥Ö¥í¥Ã¥¯¤ËÉ½¼¨¤¹¤ëºÇÂç·ï¿ô¤ò»ØÄê¤·¤Æ¤¯¤À¤µ¤¤¡£');
+define('_MI_MYDOWNLOADS_PERPAGEDSC', '¥À¥¦¥ó¥í¡¼¥É°ìÍ÷É½¼¨¤Ç£±¥Ú¡¼¥¸¤¢¤¿¤ê¤ËÉ½¼¨¤¹¤ëºÇÂç·ï¿ô¤ò»ØÄê¤·¤Æ¤¯¤À¤µ¤¤¡£');
+define('_MI_MYDOWNLOADS_USESHOTSDSC', '¥À¥¦¥ó¥í¡¼¥É¾ðÊó¤Ë¥¹¥¯¥ê¡¼¥ó¥·¥ç¥Ã¥È²èÁü¤òÉ½¼¨¤¹¤ë¾ì¹ç¤Ï ¡Ö¤Ï¤¤¡× ¤òÁªÂò¤·¤Æ¤¯¤À¤µ¤¤¡£');
+define('_MI_MYDOWNLOADS_SHOTWIDTHDSC', '¥¹¥¯¥ê¡¼¥ó¥·¥ç¥Ã¥È²èÁü¤Î²£Éý¤ÎºÇÂçÃÍ¤ò»ØÄê¤·¤Æ¤¯¤À¤µ¤¤¡£');
+define('_MI_MYDOWNLOADS_REFERERSDSC', '¥Õ¥¡¥¤¥ë¤Ø¤Î¥À¥¤¥ì¥¯¥È¥ê¥ó¥¯¤òµö²Ä¤¹¤ë³°Éô¥µ¥¤¥È¤òÎóµó¤·¤Æ¤¯¤À¤µ¤¤¡£');
+define('_MI_MYDOWNLOADS_AUTOAPPROVEDSC', '´ÉÍý¼Ô¤Î¾µÇ§Áàºî¤Ê¤·¤Ë¿·µ¬¥À¥¦¥ó¥í¡¼¥ÉÅÐÏ¿¤Î¾µÇ§¤ò¹Ô¤¦¾ì¹ç¤Ï¡Ö¤Ï¤¤¡×¤òÁªÂò¤·¤Æ¤¯¤À¤µ¤¤¡£');
+
+// Text for notifications
+
+define('_MI_MYDOWNLOADS_GLOBAL_NOTIFY', '¥â¥¸¥å¡¼¥ëÁ´ÂÎ');
+define('_MI_MYDOWNLOADS_GLOBAL_NOTIFYDSC', '¥À¥¦¥ó¥í¡¼¥É¥â¥¸¥å¡¼¥ëÁ´ÂÎ¤Ë¤ª¤±¤ëÄÌÃÎ¥ª¥×¥·¥ç¥ó');
+
+define('_MI_MYDOWNLOADS_CATEGORY_NOTIFY', 'É½¼¨Ãæ¤Î¥«¥Æ¥´¥ê');
+define('_MI_MYDOWNLOADS_CATEGORY_NOTIFYDSC', 'É½¼¨Ãæ¤Î¥«¥Æ¥´¥ê¤ËÂÐ¤¹¤ëÄÌÃÎ¥ª¥×¥·¥ç¥ó');
+
+define('_MI_MYDOWNLOADS_FILE_NOTIFY', 'É½¼¨Ãæ¤Î¥Õ¥¡¥¤¥ë¾ðÊó');
+define('_MI_MYDOWNLOADS_FILE_NOTIFYDSC', 'É½¼¨Ãæ¤Î¥À¥¦¥ó¥í¡¼¥É¾ðÊó¤ËÂÐ¤¹¤ëÄÌÃÎ¥ª¥×¥·¥ç¥ó');
+
+define('_MI_MYDOWNLOADS_GLOBAL_NEWCATEGORY_NOTIFY', '¿·µ¬¥«¥Æ¥´¥ê');
+define('_MI_MYDOWNLOADS_GLOBAL_NEWCATEGORY_NOTIFYCAP', '¿·µ¬¥«¥Æ¥´¥ê¤¬ºîÀ®¤µ¤ì¤¿¾ì¹ç¤ËÄÌÃÎ¤¹¤ë');
+define('_MI_MYDOWNLOADS_GLOBAL_NEWCATEGORY_NOTIFYDSC', '¿·µ¬¥«¥Æ¥´¥ê¤¬ºîÀ®¤µ¤ì¤¿¾ì¹ç¤ËÄÌÃÎ¤¹¤ë');
+define('_MI_MYDOWNLOADS_GLOBAL_NEWCATEGORY_NOTIFYSBJ', '[{X_SITENAME}] {X_MODULE}: ¿·µ¬¥«¥Æ¥´¥ê¤¬ºîÀ®¤µ¤ì¤Þ¤·¤¿¡Ê¥À¥¦¥ó¥í¡¼¥É½¸¡Ë');
+
+define('_MI_MYDOWNLOADS_GLOBAL_FILEMODIFY_NOTIFY', '¥Õ¥¡¥¤¥ë½¤Àµ¤Î¥ê¥¯¥¨¥¹¥È');
+define('_MI_MYDOWNLOADS_GLOBAL_FILEMODIFY_NOTIFYCAP', '¥Õ¥¡¥¤¥ë½¤Àµ¤Î¥ê¥¯¥¨¥¹¥È¤¬¤¢¤Ã¤¿¾ì¹ç¤ËÄÌÃÎ¤¹¤ë');
+define('_MI_MYDOWNLOADS_GLOBAL_FILEMODIFY_NOTIFYDSC', '¥Õ¥¡¥¤¥ë½¤Àµ¤Î¥ê¥¯¥¨¥¹¥È¤¬¤¢¤Ã¤¿¾ì¹ç¤ËÄÌÃÎ¤¹¤ë');
+define('_MI_MYDOWNLOADS_GLOBAL_FILEMODIFY_NOTIFYSBJ', '[{X_SITENAME}] {X_MODULE}: ¥Õ¥¡¥¤¥ë½¤Àµ¤Î¥ê¥¯¥¨¥¹¥È¤¬¤¢¤ê¤Þ¤·¤¿');
+
+define('_MI_MYDOWNLOADS_GLOBAL_FILEBROKEN_NOTIFY', '¥Õ¥¡¥¤¥ëÇËÂ»Êó¹ð');
+define('_MI_MYDOWNLOADS_GLOBAL_FILEBROKEN_NOTIFYCAP', '¥Õ¥¡¥¤¥ëÇËÂ»¤ÎÊó¹ð¤¬¤¢¤Ã¤¿¾ì¹ç¤ËÄÌÃÎ¤¹¤ë');
+define('_MI_MYDOWNLOADS_GLOBAL_FILEBROKEN_NOTIFYDSC', '¥Õ¥¡¥¤¥ëÇËÂ»¤ÎÊó¹ð¤¬¤¢¤Ã¤¿¾ì¹ç¤ËÄÌÃÎ¤¹¤ë');
+define('_MI_MYDOWNLOADS_GLOBAL_FILEBROKEN_NOTIFYSBJ', '[{X_SITENAME}] {X_MODULE}: ¥Õ¥¡¥¤¥ëÇËÂ»¤ÎÊó¹ð¤¬¤¢¤ê¤Þ¤·¤¿');
+
+define('_MI_MYDOWNLOADS_GLOBAL_FILESUBMIT_NOTIFY', '¿·µ¬¥Õ¥¡¥¤¥ëÅê¹Æ');
+define('_MI_MYDOWNLOADS_GLOBAL_FILESUBMIT_NOTIFYCAP', '¿·µ¬¥Õ¥¡¥¤¥ë¤ÎÅê¹Æ¤¬¤¢¤Ã¤¿¾ì¹ç¤ËÄÌÃÎ¤¹¤ë');
+define('_MI_MYDOWNLOADS_GLOBAL_FILESUBMIT_NOTIFYDSC', '¿·µ¬¥Õ¥¡¥¤¥ë¤ÎÅê¹Æ¤¬¤¢¤Ã¤¿¾ì¹ç¤ËÄÌÃÎ¤¹¤ë');
+define('_MI_MYDOWNLOADS_GLOBAL_FILESUBMIT_NOTIFYSBJ', '[{X_SITENAME}] {X_MODULE}: ¿·µ¬¥Õ¥¡¥¤¥ë¤ÎÅê¹Æ¤¬¤¢¤ê¤Þ¤·¤¿');
+
+define('_MI_MYDOWNLOADS_GLOBAL_NEWFILE_NOTIFY', '¿·µ¬¥Õ¥¡¥¤¥ë·ÇºÜ');
+define('_MI_MYDOWNLOADS_GLOBAL_NEWFILE_NOTIFYCAP', '¿·µ¬¥Õ¥¡¥¤¥ë¤¬·ÇºÜ¤µ¤ì¤¿¾ì¹ç¤ËÄÌÃÎ¤¹¤ë');
+define('_MI_MYDOWNLOADS_GLOBAL_NEWFILE_NOTIFYDSC', '¿·µ¬¥Õ¥¡¥¤¥ë¤¬·ÇºÜ¤µ¤ì¤¿¾ì¹ç¤ËÄÌÃÎ¤¹¤ë');
+define('_MI_MYDOWNLOADS_GLOBAL_NEWFILE_NOTIFYSBJ', '[{X_SITENAME}] {X_MODULE}: ¿·µ¬¥Õ¥¡¥¤¥ë¤ÎÅê¹Æ¤¬¤¢¤ê¤Þ¤·¤¿');
+
+define('_MI_MYDOWNLOADS_CATEGORY_FILESUBMIT_NOTIFY', '¿·µ¬¥Õ¥¡¥¤¥ëÅê¹Æ¡ÊÆÃÄê¥«¥Æ¥´¥ê¡Ë');
+define('_MI_MYDOWNLOADS_CATEGORY_FILESUBMIT_NOTIFYCAP', '¤³¤Î¥«¥Æ¥´¥ê¤Ë¤ª¤¤¤Æ¿·µ¬¥Õ¥¡¥¤¥ë¤ÎÅê¹Æ¤¬¤¢¤Ã¤¿¾ì¹ç¤ËÄÌÃÎ¤¹¤ë');   
+define('_MI_MYDOWNLOADS_CATEGORY_FILESUBMIT_NOTIFYDSC', '¤³¤Î¥«¥Æ¥´¥ê¤Ë¤ª¤¤¤Æ¿·µ¬¥Õ¥¡¥¤¥ë¤ÎÅê¹Æ¤¬¤¢¤Ã¤¿¾ì¹ç¤ËÄÌÃÎ¤¹¤ë');      
+define('_MI_MYDOWNLOADS_CATEGORY_FILESUBMIT_NOTIFYSBJ', '[{X_SITENAME}] {X_MODULE}: ¿·µ¬¥Õ¥¡¥¤¥ë¤ÎÅê¹Æ¤¬¤¢¤ê¤Þ¤·¤¿'); 
+
+define('_MI_MYDOWNLOADS_CATEGORY_NEWFILE_NOTIFY', '¿·µ¬¥Õ¥¡¥¤¥ë·ÇºÜ¡ÊÆÃÄê¥«¥Æ¥´¥ê¡Ë');
+define('_MI_MYDOWNLOADS_CATEGORY_NEWFILE_NOTIFYCAP', '¤³¤Î¥«¥Æ¥´¥ê¤Ë¤ª¤¤¤Æ¿·µ¬¥Õ¥¡¥¤¥ë¤¬·ÇºÜ¤µ¤ì¤¿¾ì¹ç¤ËÄÌÃÎ¤¹¤ë');   
+define('_MI_MYDOWNLOADS_CATEGORY_NEWFILE_NOTIFYDSC', '¤³¤Î¥«¥Æ¥´¥ê¤Ë¤ª¤¤¤Æ¿·µ¬¥Õ¥¡¥¤¥ë¤¬·ÇºÜ¤µ¤ì¤¿¾ì¹ç¤ËÄÌÃÎ¤¹¤ë');      
+define('_MI_MYDOWNLOADS_CATEGORY_NEWFILE_NOTIFYSBJ', '[{X_SITENAME}] {X_MODULE}: ¿·µ¬¥Õ¥¡¥¤¥ë¤¬·ÇºÜ¤µ¤ì¤Þ¤·¤¿'); 
+
+define('_MI_MYDOWNLOADS_FILE_APPROVE_NOTIFY', '¥Õ¥¡¥¤¥ë¾µÇ§');
+define('_MI_MYDOWNLOADS_FILE_APPROVE_NOTIFYCAP', '¤³¤Î¥Õ¥¡¥¤¥ë¤¬¾µÇ§¤µ¤ì¤¿¾ì¹ç¤ËÄÌÃÎ¤¹¤ë');
+define('_MI_MYDOWNLOADS_FILE_APPROVE_NOTIFYDSC', '¤³¤Î¥Õ¥¡¥¤¥ë¤¬¾µÇ§¤µ¤ì¤¿¾ì¹ç¤ËÄÌÃÎ¤¹¤ë');
+define('_MI_MYDOWNLOADS_FILE_APPROVE_NOTIFYSBJ', '[{X_SITENAME}] {X_MODULE}: ¥Õ¥¡¥¤¥ë¤¬¾µÇ§¤µ¤ì¤Þ¤·¤¿');
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/english/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/english/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/english/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/english/main.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/english/main.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/english/main.php	(revision 405)
@@ -0,0 +1,184 @@
+<?php
+// $Id: main.php,v 1.1 2004/01/29 14:45:12 buennagel Exp $
+//%%%%%%		Module Name 'MyDownloads'		%%%%%
+
+define("_MD_THANKSFORINFO","Thanks for the information. We'll look into your request shortly.");
+define("_MD_THANKSFORHELP","Thank you for helping to maintain this directory's integrity.");
+define("_MD_FORSECURITY","For security reasons your user name and IP address will also be temporarily recorded.");
+define("_MD_NOPERMISETOLINK", "This file doesn't belong to the site you came from <br /><br />Please e-mail the webmaster of the site you came from and tell him:   <br /><b>NOT TO LEECH OTHER SITES LINKS!!</b> <br /><br /><b>Definition of a Leecher:</b> One who is to lazy to link from his own server or steals other peoples hard work and makes it look like his own <br /><br />  Your IP address <b>has been logged</b>.");
+define("_MD_ALL","ALL");
+define("_MD_DESCRIPTION","Description");
+define("_MD_SEARCH","Search");
+define("_MD_SUBMITCATHEAD","Submit download Form");
+
+define("_MD_MAIN","Main");
+define("_MD_POPULAR","Popular");
+define("_MD_NEWTHISWEEK","New this week");
+define("_MD_UPTHISWEEK","Updated this week");
+
+define("_MD_POPULARITYLTOM","Popularity (Least to Most Hits)");
+define("_MD_POPULARITYMTOL","Popularity (Most to Least Hits)");
+define("_MD_TITLEATOZ","Title (A to Z)");
+define("_MD_TITLEZTOA","Title (Z to A)");
+define("_MD_DATEOLD","Date (Old Files Listed First)");
+define("_MD_DATENEW","Date (New Files Listed First)");
+define("_MD_RATINGLTOH","Rating (Lowest Score to Highest Score)");
+define("_MD_RATINGHTOL","Rating (Highest Score to Lowest Score)");
+
+define("_MD_NOSHOTS","No Screenshots Available");
+define("_MD_EDITTHISDL","Edit This Download");
+
+define("_MD_DESCRIPTIONC","Description: ");
+define("_MD_EMAILC","Email: ");
+define("_MD_CATEGORYC","Category: ");
+define("_MD_LASTUPDATEC","Last Update: ");
+define("_MD_DLNOW","Download Now!");
+define("_MD_VERSION","Version");
+define("_MD_SUBMITDATE","Submitted Date");
+define("_MD_DLTIMES","Downloaded %s times");
+define("_MD_FILESIZE","File Size");
+define("_MD_SUPPORTEDPLAT","Supported Platforms");
+define("_MD_HOMEPAGE","Home Page");
+define("_MD_HITSC","Hits: ");
+define("_MD_RATINGC","Rating: ");
+define("_MD_ONEVOTE","1 vote");
+define("_MD_NUMVOTES","%s votes");
+define("_MD_RATETHISFILE","Rate this File");
+define("_MD_MODIFY","Modify");
+define("_MD_REPORTBROKEN","Report Broken File");
+define("_MD_TELLAFRIEND","Tell a Friend");
+define("_MD_EDIT","Edit");
+
+define("_MD_THEREARE","There are <b>%s</b> files in our database");
+define("_MD_LATESTLIST","Latest Listings");
+
+define("_MD_REQUESTMOD","Request Download Modification");
+define("_MD_FILEID","File ID: ");
+define("_MD_FILETITLE","Download Title: ");
+define("_MD_DLURL","Download URL: ");
+define("_MD_HOMEPAGEC","Home Page: ");
+define("_MD_VERSIONC","Version: ");
+define("_MD_FILESIZEC","File Size: ");
+define("_MD_NUMBYTES","%s bytes");
+define("_MD_PLATFORMC","Platform: ");
+define("_MD_SHOTIMAGE","Screenshot Img: ");
+define("_MD_SENDREQUEST","Send Request");
+define("_MD_UPLOAD", "Upload: ");		//	add by bluemooninc.biz
+define("_MD_OPTIONS", 'Options: ');
+define("_MD_NOTIFYAPPROVE", 'Notify me when this file is approved');
+
+define("_MD_VOTEAPPRE","Your vote is appreciated.");
+define("_MD_THANKYOU","Thank you for taking the time to vote here at %s"); // %s is your site name
+define("_MD_VOTEONCE","Please do not vote for the same resource more than once.");
+define("_MD_RATINGSCALE","The scale is 1 - 10, with 1 being poor and 10 being excellent.");
+define("_MD_BEOBJECTIVE","Please be objective, if everyone receives a 1 or a 10, the ratings aren't very useful.");
+define("_MD_DONOTVOTE","Do not vote for your own resource.");
+define("_MD_RATEIT","Rate It!");
+
+define("_MD_INTFILEFOUND","Here is a good file to download at %s"); // %s is your site name
+
+define("_MD_RECEIVED","We received your download information. Thanks!");
+define("_MD_WHENAPPROVED","You'll receive an E-mail when it's approved.");
+define("_MD_SUBMITONCE","Submit your file/script only once.");
+define("_MD_ALLPENDING","All file/script information are posted pending verification.");
+define("_MD_DONTABUSE","Username and IP are recorded, so please don't abuse the system.");
+define("_MD_TAKEDAYS","It may take several days for your file/script to be added to our database.");
+
+define("_MD_RANK","Rank");
+define("_MD_CATEGORY","Category");
+define("_MD_HITS","Hits");
+define("_MD_RATING","Rating");
+define("_MD_VOTE","Vote");
+
+define("_MD_SORTBY","Sort by:");
+define("_MD_TITLE","Title");
+define("_MD_DATE","Date");
+define("_MD_POPULARITY","Popularity");
+define("_MD_CURSORTBY","Files currently sorted by: %s");
+define("_MD_PREVIOUS","Previous");
+define("_MD_NEXT","Next");
+define("_MD_NOMATCH","No matches found to your query");
+
+define("_MD_TOP10","%s Top 10"); // %s is a downloads category name
+
+define("_MD_SUBMIT","Submit");
+define("_MD_CANCEL","Cancel");
+
+define("_MD_BYTES","Bytes");
+define("_MD_ALREADYREPORTED","You have already submitted a broken report for this resource.");
+define("_MD_MUSTREGFIRST","Sorry, you don't have the permission to perform this action.<br />Please register or login first!");
+define("_MD_NORATING","No rating selected.");
+define("_MD_CANTVOTEOWN","You cannot vote on the resource you submitted.<br />All votes are logged and reviewed.");
+
+//%%%%%%	Module Name 'MyDownloads' (Admin)	  %%%%%
+
+define("_MD_DLCONF","Downloads Configuration");
+define("_MD_GENERALSET","My Downloads General Settings");
+define("_MD_ADDMODDELETE","Add, Modify, and Delete Categories/Files");
+define("_MD_DLSWAITING","Downloads Waiting for Validation");
+define("_MD_BROKENREPORTS","Broken File Reports");
+define("_MD_MODREQUESTS","Download Info Modification Requests");
+define("_MD_SUBMITTER","Submitter: ");
+define("_MD_DOWNLOAD","Download");
+define("_MD_APPROVE","Approve");
+define("_MD_DELETE","Delete");
+define("_MD_NOSUBMITTED","No New Submitted Downloads.");
+define("_MD_ADDMAIN","Add a MAIN Category");
+define("_MD_TITLEC","Title: ");
+define("_MD_IMGURL","Image URL (OPTIONAL Image height will be resized to 50): ");
+define("_MD_ADD","Add");
+define("_MD_ADDSUB","Add a SUB-Category");
+define("_MD_IN","in");
+define("_MD_ADDNEWFILE","Add a New File");
+define("_MD_MODCAT","Modify Category");
+define("_MD_MODDL","Modify Download Info");
+define("_MD_USER","User");
+define("_MD_IP","IP Address");
+define("_MD_USERAVG","Average User Rating");
+define("_MD_TOTALRATE","Total Ratings");
+define("_MD_NOREGVOTES","No Registered User Votes");
+define("_MD_NOUNREGVOTES","No Unregistered User Votes");
+define("_MD_VOTEDELETED","Vote data deleted.");
+define("_MD_NOBROKEN","No reported broken files.");
+define("_MD_IGNOREDESC","Ignore (Ignores the report and only deletes the <b>broken file report</b>)");
+define("_MD_DELETEDESC","Delete (Deletes <b>the reported download data</b> and <b>broken file reports</b> for the file.)");
+define("_MD_REPORTER","Report Sender");
+define("_MD_FILESUBMITTER","File Submitter");
+define("_MD_IGNORE","Ignore");
+define("_MD_FILEDELETED","File Deleted.");
+define("_MD_BROKENDELETED","Broken file report deleted.");
+define("_MD_USERMODREQ","User Download Info Modification Requests");
+define("_MD_ORIGINAL","Original");
+define("_MD_PROPOSED","Proposed");
+define("_MD_OWNER","Owner: ");
+define("_MD_NOMODREQ","No Download Modification Request.");
+define("_MD_DBUPDATED","Database Updated Successfully!");
+define("_MD_MODREQDELETED","Modification Request Deleted.");
+define("_MD_IMGURLMAIN","Image URL (OPTIONAL and Only valid for main categories. Image height will be resized to 50): ");
+define("_MD_PARENT","Parent Category:");
+define("_MD_SAVE","Save Changes");
+define("_MD_CATDELETED","Category Deleted.");
+define("_MD_WARNING","WARNING: Are you sure you want to delete this Category and ALL its Files and Comments?");
+define("_MD_YES","Yes");
+define("_MD_NO","No");
+define("_MD_NEWCATADDED","New Category Added Successfully!");
+define("_MD_ERROREXIST","ERROR: The download info you provided is already in the database!");
+define("_MD_ERRORTITLE","ERROR: You need to enter a TITLE!");
+define("_MD_ERRORDESC","ERROR: You need to enter a DESCRIPTION!");
+define("_MD_NEWDLADDED","New download added to the database.");
+define("_MD_HELLO","Hello %s");
+define("_MD_WEAPPROVED","We approved your download submission to our downloads section.");
+define("_MD_THANKSSUBMIT","Thanks for your submission!");
+
+define("_MD_MUSTBEVALID","Screenshot image must be a valid image file under %s directory (ex. shot.gif). Leave it blank if there is no image file.");
+
+define("_MD_REGUSERVOTES","Registered User Votes (total votes: %s)");
+define("_MD_ANONUSERVOTES","Anonymous User Votes (total votes: %s)");
+
+define("_MD_YOURFILEAT","Your file submitted at %s"); // this is an approved mail subject. %s is your site name
+
+define("_MD_VISITAT","Visit our downloads section at %s");
+
+define("_MD_DLRATINGS","Download Rating (total votes: %s)");
+define("_MD_ISAPPROVED","We approved your download submission");
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/english/mail_template/file_approve_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/english/mail_template/file_approve_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/english/mail_template/file_approve_notify.tpl	(revision 405)
@@ -0,0 +1,21 @@
+Hello {X_UNAME},
+
+The submitted file "{FILE_NAME}" has been approved at {X_SITENAME}.
+
+You can view this file here:
+{FILE_URL}
+
+-----------
+
+You are receiving this message because you selected to be notified when this file was approved.
+
+If this is an error or you wish not to receive further such notifications, please update your subscriptions by visiting the link below:
+{X_UNSUBSCRIBE_URL}
+
+Please do not reply to this message.
+
+-----------
+
+{X_SITENAME} ({X_SITEURL}) 
+webmaster
+{X_ADMINMAIL}
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/english/mail_template/category_filesubmit_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/english/mail_template/category_filesubmit_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/english/mail_template/category_filesubmit_notify.tpl	(revision 405)
@@ -0,0 +1,21 @@
+Hello {X_UNAME},
+
+A new file "{FILE_NAME}" has been submitted in the category "{CATEGORY_NAME}" at {X_SITENAME} and is awaiting approval.
+
+You can view this file submission here (note this page shows waiting files in ALL categories):
+{WAITINGFILES_URL}
+
+-----------
+
+You are receiving this message because you selected to be notified when new files are submitted in this category.
+
+If this is an error or you wish not to receive further such notifications, please update your subscriptions by visiting the link below:
+{X_UNSUBSCRIBE_URL}
+
+Please do not reply to this message.
+
+-----------
+
+{X_SITENAME} ({X_SITEURL}) 
+webmaster
+{X_ADMINMAIL}
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/english/mail_template/global_filebroken_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/english/mail_template/global_filebroken_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/english/mail_template/global_filebroken_notify.tpl	(revision 405)
@@ -0,0 +1,21 @@
+Hello {X_UNAME},
+
+A broken file report has been submitted and is awaiting approval.
+
+You can view this request here:
+{BROKENREPORTS_URL}
+
+-----------
+
+You are receiving this message because you selected to be notified when broken file reports are submitted.
+
+If this is an error or you wish not to receive further such notifications, please update your subscriptions by visiting the link below:
+{X_UNSUBSCRIBE_URL}
+
+Please do not reply to this message.
+
+-----------
+
+{X_SITENAME} ({X_SITEURL}) 
+webmaster
+{X_ADMINMAIL}
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/english/mail_template/global_filesubmit_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/english/mail_template/global_filesubmit_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/english/mail_template/global_filesubmit_notify.tpl	(revision 405)
@@ -0,0 +1,21 @@
+Hello {X_UNAME},
+
+A new file "{FILE_NAME}" has been submitted at {X_SITENAME} and is awaiting approval.
+
+You can view this link submission here:
+{WAITINGFILES_URL}
+
+-----------
+
+You are receiving this message because you selected to be notified when new files are submitted to our site.
+
+If this is an error or you wish not to receive further such notifications, please update your subscriptions by visiting the link below:
+{X_UNSUBSCRIBE_URL}
+
+Please do not reply to this message.
+
+-----------
+
+{X_SITENAME} ({X_SITEURL}) 
+webmaster
+{X_ADMINMAIL}
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/english/mail_template/category_newfile_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/english/mail_template/category_newfile_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/english/mail_template/category_newfile_notify.tpl	(revision 405)
@@ -0,0 +1,24 @@
+Hello {X_UNAME},
+
+A new file "{FILE_NAME}" has been added in category "{CATEGORY_NAME}" at {X_SITENAME}.
+
+You can view this file here:
+{FILE_URL}
+
+You can view the whole category here:
+{CATEGORY_URL}
+
+-----------
+
+You are receiving this message because you selected to be notified when new files are added in this category.
+
+If this is an error or you wish not to receive further such notifications, please update your subscriptions by visiting the link below:
+{X_UNSUBSCRIBE_URL}
+
+Please do not reply to this message.
+
+-----------
+
+{X_SITENAME} ({X_SITEURL}) 
+webmaster
+{X_ADMINMAIL}
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/english/mail_template/global_filemodify_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/english/mail_template/global_filemodify_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/english/mail_template/global_filemodify_notify.tpl	(revision 405)
@@ -0,0 +1,21 @@
+Hello {X_UNAME},
+
+A file modification request has been submitted and is awaiting approval.
+
+You can view this request here:
+{MODIFYREPORTS_URL}
+
+-----------
+
+You are receiving this message because you selected to be notified when new file modification requests are submitted.
+
+If this is an error or you wish not to receive further such notifications, please update your subscriptions by visiting the link below:
+{X_UNSUBSCRIBE_URL}
+
+Please do not reply to this message.
+
+-----------
+
+{X_SITENAME} ({X_SITEURL}) 
+webmaster
+{X_ADMINMAIL}
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/english/mail_template/global_newcategory_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/english/mail_template/global_newcategory_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/english/mail_template/global_newcategory_notify.tpl	(revision 405)
@@ -0,0 +1,24 @@
+Hello {X_UNAME},
+
+A new file category "{CATEGORY_NAME}" has been created at {X_SITENAME}.
+
+Follow this link to view this file category:
+{CATEGORY_URL}
+
+Follow this link to view the category index:
+{X_MODULE_URL}
+
+-----------
+
+You are receiving this message because you selected to be notified when new file categories are added to our site.
+
+If this is an error or you wish not to receive further such notifications, please update your subscriptions by visiting the link below:
+{X_UNSUBSCRIBE_URL}
+
+Please do not reply to this message.
+
+-----------
+
+{X_SITENAME} ({X_SITEURL}) 
+webmaster
+{X_ADMINMAIL}
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/english/mail_template/global_newfile_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/english/mail_template/global_newfile_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/english/mail_template/global_newfile_notify.tpl	(revision 405)
@@ -0,0 +1,21 @@
+Hello {X_UNAME},
+
+A new file "{FILE_NAME}" has been added at {X_SITENAME}.
+
+You can view this file here:
+{FILE_URL}
+
+-----------
+
+You are receiving this message because you selected to be notified when new files are added to our site.
+
+If this is an error or you wish not to receive further such notifications, please update your subscriptions by visiting the link below:
+{X_UNSUBSCRIBE_URL}
+
+Please do not reply to this message.
+
+-----------
+
+{X_SITENAME} ({X_SITEURL}) 
+webmaster
+{X_ADMINMAIL}
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/english/modinfo.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/english/modinfo.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/english/modinfo.php	(revision 405)
@@ -0,0 +1,97 @@
+<?php
+// $Id: modinfo.php,v 1.1 2004/09/09 05:15:10 onokazu Exp $
+// Module Info
+
+// The name of this module
+define("_MI_MYDOWNLOADS_NAME","Downloads");
+
+// A brief description of this module
+define("_MI_MYDOWNLOADS_DESC","Creates a downloads section where users can download/submit/rate various files.");
+
+// Names of blocks for this module (Not all module has blocks)
+define("_MI_MYDOWNLOADS_BNAME1","Recent Downloads");
+define("_MI_MYDOWNLOADS_BNAME2","Top Downloads");
+
+// Sub menu titles
+define("_MI_MYDOWNLOADS_SMNAME1","Submit");
+define("_MI_MYDOWNLOADS_SMNAME2","Popular");
+define("_MI_MYDOWNLOADS_SMNAME3","Top Rated");
+
+// Names of admin menu items
+define("_MI_MYDOWNLOADS_ADMENU2","Add/Edit Downloads");
+define("_MI_MYDOWNLOADS_ADMENU3","Submitted Downloads");
+define("_MI_MYDOWNLOADS_ADMENU4","Broken Downloads");
+define("_MI_MYDOWNLOADS_ADMENU5","Modified Downloads");
+
+// Title of config items
+define('_MI_MYDOWNLOADS_POPULAR', 'Number of hits for downloadable items to be marked as popular');
+define('_MI_MYDOWNLOADS_NEWDLS', 'Maximum number of new download items displayed on top page');
+define('_MI_MYDOWNLOADS_PERPAGE', 'Maximum number of download items displayed on each page');
+define('_MI_MYDOWNLOADS_USESHOTS', 'Select yes to display screenshot images for each download item');
+define('_MI_MYDOWNLOADS_SHOTWIDTH', 'Type in the maximum width of screenshot images');
+define('_MI_MYDOWNLOADS_CHECKHOST', 'Disallow direct download linking? (leeching)');
+define('_MI_MYDOWNLOADS_REFERERS', 'This Sites can directly link you files <br />Separate each one with | ');
+define("_MI_MYDOWNLOADS_ANONPOST","Allow anonymous users to post download items?");
+define('_MI_MYDOWNLOADS_AUTOAPPROVE','Auto approve new downloads without admin intervention?');
+
+// Description of each config items
+define('_MI_MYDOWNLOADS_POPULARDSC', '');
+define('_MI_MYDOWNLOADS_NEWDLSDSC', '');
+define('_MI_MYDOWNLOADS_PERPAGEDSC', '');
+define('_MI_MYDOWNLOADS_USESHOTSDSC', '');
+define('_MI_MYDOWNLOADS_SHOTWIDTHDSC', '');
+define('_MI_MYDOWNLOADS_REFERERSDSC', '');
+define('_MI_MYDOWNLOADS_AUTOAPPROVEDSC', '');
+
+// Text for notifications
+
+define('_MI_MYDOWNLOADS_GLOBAL_NOTIFY', 'Global');
+define('_MI_MYDOWNLOADS_GLOBAL_NOTIFYDSC', 'Global downloads notification options.');
+
+define('_MI_MYDOWNLOADS_CATEGORY_NOTIFY', 'Category');
+define('_MI_MYDOWNLOADS_CATEGORY_NOTIFYDSC', 'Notification options that apply to the current file category.');
+
+define('_MI_MYDOWNLOADS_FILE_NOTIFY', 'File');
+define('_MI_MYDOWNLOADS_FILE_NOTIFYDSC', 'Notification options that apply to the current file.');
+
+define('_MI_MYDOWNLOADS_GLOBAL_NEWCATEGORY_NOTIFY', 'New Category');
+define('_MI_MYDOWNLOADS_GLOBAL_NEWCATEGORY_NOTIFYCAP', 'Notify me when a new file category is created.');
+define('_MI_MYDOWNLOADS_GLOBAL_NEWCATEGORY_NOTIFYDSC', 'Receive notification when a new file category is created.');
+define('_MI_MYDOWNLOADS_GLOBAL_NEWCATEGORY_NOTIFYSBJ', '[{X_SITENAME}] {X_MODULE} auto-notify : New file category');                              
+
+define('_MI_MYDOWNLOADS_GLOBAL_FILEMODIFY_NOTIFY', 'Modify File Requested');
+define('_MI_MYDOWNLOADS_GLOBAL_FILEMODIFY_NOTIFYCAP', 'Notify me of any file modification request.');
+define('_MI_MYDOWNLOADS_GLOBAL_FILEMODIFY_NOTIFYDSC', 'Receive notification when any file modification request is submitted.');
+define('_MI_MYDOWNLOADS_GLOBAL_FILEMODIFY_NOTIFYSBJ', '[{X_SITENAME}] {X_MODULE} auto-notify : File Modification Requested');
+
+define('_MI_MYDOWNLOADS_GLOBAL_FILEBROKEN_NOTIFY', 'Broken File Submitted');
+define('_MI_MYDOWNLOADS_GLOBAL_FILEBROKEN_NOTIFYCAP', 'Notify me of any broken file report.');
+define('_MI_MYDOWNLOADS_GLOBAL_FILEBROKEN_NOTIFYDSC', 'Receive notification when any broken file report is submitted.');
+define('_MI_MYDOWNLOADS_GLOBAL_FILEBROKEN_NOTIFYSBJ', '[{X_SITENAME}] {X_MODULE} auto-notify : Broken File Reported');
+
+define('_MI_MYDOWNLOADS_GLOBAL_FILESUBMIT_NOTIFY', 'File Submitted');
+define('_MI_MYDOWNLOADS_GLOBAL_FILESUBMIT_NOTIFYCAP', 'Notify me when any new file is submitted (awaiting approval).');
+define('_MI_MYDOWNLOADS_GLOBAL_FILESUBMIT_NOTIFYDSC', 'Receive notification when any new file is submitted (awaiting approval).');
+define('_MI_MYDOWNLOADS_GLOBAL_FILESUBMIT_NOTIFYSBJ', '[{X_SITENAME}] {X_MODULE} auto-notify : New file submitted');
+
+define('_MI_MYDOWNLOADS_GLOBAL_NEWFILE_NOTIFY', 'New File');
+define('_MI_MYDOWNLOADS_GLOBAL_NEWFILE_NOTIFYCAP', 'Notify me when any new file is posted.');
+define('_MI_MYDOWNLOADS_GLOBAL_NEWFILE_NOTIFYDSC', 'Receive notification when any new file is posted.');
+define('_MI_MYDOWNLOADS_GLOBAL_NEWFILE_NOTIFYSBJ', '[{X_SITENAME}] {X_MODULE} auto-notify : New file');
+
+define('_MI_MYDOWNLOADS_CATEGORY_FILESUBMIT_NOTIFY', 'File Submitted');
+define('_MI_MYDOWNLOADS_CATEGORY_FILESUBMIT_NOTIFYCAP', 'Notify me when a new file is submitted (awaiting approval) to the current category.');   
+define('_MI_MYDOWNLOADS_CATEGORY_FILESUBMIT_NOTIFYDSC', 'Receive notification when a new file is submitted (awaiting approval) to the current category.');      
+define('_MI_MYDOWNLOADS_CATEGORY_FILESUBMIT_NOTIFYSBJ', '[{X_SITENAME}] {X_MODULE} auto-notify : New file submitted in category'); 
+
+define('_MI_MYDOWNLOADS_CATEGORY_NEWFILE_NOTIFY', 'New File');
+define('_MI_MYDOWNLOADS_CATEGORY_NEWFILE_NOTIFYCAP', 'Notify me when a new file is posted to the current category.');   
+define('_MI_MYDOWNLOADS_CATEGORY_NEWFILE_NOTIFYDSC', 'Receive notification when a new file is posted to the current category.');      
+define('_MI_MYDOWNLOADS_CATEGORY_NEWFILE_NOTIFYSBJ', '[{X_SITENAME}] {X_MODULE} auto-notify : New file in category'); 
+
+define('_MI_MYDOWNLOADS_FILE_APPROVE_NOTIFY', 'File Approved');
+define('_MI_MYDOWNLOADS_FILE_APPROVE_NOTIFYCAP', 'Notify me when this file is approved.');
+define('_MI_MYDOWNLOADS_FILE_APPROVE_NOTIFYDSC', 'Receive notification when this file is approved.');
+define('_MI_MYDOWNLOADS_FILE_APPROVE_NOTIFYSBJ', '[{X_SITENAME}] {X_MODULE} auto-notify : File Approved');
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/english/blocks.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/english/blocks.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/language/english/blocks.php	(revision 405)
@@ -0,0 +1,8 @@
+<?php
+// $Id: blocks.php,v 1.1 2004/09/09 05:15:10 onokazu Exp $
+// Blocks
+define("_MB_MYDOWNLOADS_DISP","Display");
+define("_MB_MYDOWNLOADS_FILES","Files");
+define("_MB_MYDOWNLOADS_CHARS","Length of the title");
+define("_MB_MYDOWNLOADS_LENGTH"," characters");
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/visit.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/visit.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/visit.php	(revision 405)
@@ -0,0 +1,56 @@
+<?php
+// $Id: visit.php,v 1.1 2004/09/09 05:15:10 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+include "../../mainfile.php";
+$myts =& MyTextSanitizer::getInstance(); // MyTextSanitizer object
+$lid = intval($HTTP_GET_VARS['lid']);
+$cid = intval($HTTP_GET_VARS['cid']);
+if ( $xoopsModuleConfig['check_host'] ) {
+	$goodhost      = 0;
+	$referer       = parse_url(xoops_getenv('HTTP_REFERER'));
+	$referer_host  = $referer['host'];
+	foreach ( $xoopsModuleConfig['referers'] as $ref ) {
+		if ( !empty($ref) && preg_match("/".$ref."/i", $referer_host) ) {
+			$goodhost = "1";
+			break;
+		}
+	}
+	if (!$goodhost) {
+		redirect_header(XOOPS_URL . "/modules/mydownloads/singlefile.php?cid=$cid&amp;lid=$lid", 20, _MD_NOPERMISETOLINK);
+		exit();
+	}
+}
+$sql = sprintf("UPDATE %s SET hits = hits+1 WHERE lid = %u AND status > 0", $xoopsDB->prefix("mydownloads_downloads"), $lid);
+$xoopsDB->queryF($sql);
+$result = $xoopsDB->query("SELECT url FROM ".$xoopsDB->prefix("mydownloads_downloads")." WHERE lid=$lid AND status>0");
+list($url) = $xoopsDB->fetchRow($result);
+if (!preg_match("/^ed2k*:\/\//i", $url)) {
+	Header("Location: $url");
+}
+echo "<html><head><meta http-equiv=\"Refresh\" content=\"0; URL=".$myts->oopsHtmlSpecialChars($url)."\"></meta></head><body></body></html>";
+exit();
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/footer.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/footer.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/footer.php	(revision 405)
@@ -0,0 +1,29 @@
+<?php
+// $Id: footer.php,v 1.1 2004/09/09 05:15:10 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+include_once "../../footer.php";
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/mydl_fileup.txt
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/mydl_fileup.txt	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/mydl_fileup.txt	(revision 405)
@@ -0,0 +1,30 @@
+/***************************************************************************
+                           mydl_fileup.zip  -  description
+                           ------------------------------
+    begin                : Mon Jul 05 2004
+    copyleft             : (C) 2004 Bluemoon inc.
+    home page            : http://www.bluemooninc.biz/
+    auther               : Yoshi.Sakai
+    email                : webmaster@bluemooninc.biz
+***************************************************************************/
+
+/***************************************************************************
+ *
+ *   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.
+ *
+ ***************************************************************************/
+
+Usage:
+
+Just overwrite to XOOPS 2 original mydownloads v1.10 module.
+
+You can upload automatically and it is not necessary to input into URL and 
+file size information any longer.
+
+v1.01 2005/04/11 - Support multibyte strings in filename.
+v1.02 2005/07/17 - Accept anonymous upload with allow anonymous option by preference.
+v1.03 2005/10/22 - Comment out for URL check. Brush up for modify template,MIME.
+v1.04 2005/10/29 - Security update for image file upload vulnerability.
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/fileup.ini.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/fileup.ini.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/fileup.ini.php	(revision 405)
@@ -0,0 +1,50 @@
+<?php
+/***************************************************************************
+                           fileup.ini.php  -  description
+                           ------------------------------
+    begin                : Mon Jul 05 2004
+    copyleft             : (C) 2004 Bluemoon inc.
+    home page            : http://www.bluemooninc.biz/xoops/
+    auther               : Yoshi.S
+    email                : webmaster@bluemooninc.biz
+
+    // $Id: fileup.ini.php,v 1.0.0 2004/07/05 12:26:00 Y.Sakai 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.
+ *
+ ***************************************************************************/
+	//
+	// Upload File section
+	//
+	define( 'UPLOADS' , '/uploads/' );	// XOOPS_URL. plus upload folder name 
+	//
+	// In case of multi-byte filename
+	//
+	define( 'SAVE_AS_MBSTR' , 'UTF-8' );		//  UTF-8, SJIS, EUC-JP, etc...
+	//define( 'SAVE_AS_MBSTR' , 'SJIS' );			// for Japanese Windows
+
+	// Max upload file size
+	// If you want set upper 2M, You must change php.ini
+	//   memory_limit = 8M (default)
+	//   post_max_size = 8M (default)
+	//   upload_max_filesize =2M (default)
+	$maxfilesize = 2000000;			// default 2MB
+
+	// Acceptable MIME Content-Type
+	$subtype = "gif|jpe?g|png|bmp|zip|lzh|pdf|msword|excel|powerpoint|octet-stream|x-pmd|x-mld|x-mid|x-smd|x-smaf|x-mpeg|x-pn-realaudio";
+
+	// embedding image MIME Content-Type
+	$imgtype = "gif|jpe?g|png|bmp|x-pmd|x-mld|x-mid|x-smd|x-smaf|x-mpeg";
+
+	// Reject Ext. name
+	$viri = "cgi|php|jsp|pl|htm";
+
+////////////////// end ///////////////////
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/admin/menu.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/admin/menu.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/admin/menu.php	(revision 405)
@@ -0,0 +1,36 @@
+<?php
+// $Id: menu.php,v 1.1 2004/09/09 05:15:10 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+$adminmenu[1]['title'] = _MI_MYDOWNLOADS_ADMENU2;
+$adminmenu[1]['link'] = "admin/index.php?op=downloadsConfigMenu";
+$adminmenu[2]['title'] = _MI_MYDOWNLOADS_ADMENU3;
+$adminmenu[2]['link'] = "admin/index.php?op=listNewDownloads";
+$adminmenu[3]['title'] = _MI_MYDOWNLOADS_ADMENU4;
+$adminmenu[3]['link'] = "admin/index.php?op=listBrokenDownloads";
+$adminmenu[4]['title'] = _MI_MYDOWNLOADS_ADMENU5;
+$adminmenu[4]['link'] = "admin/index.php?op=listModReq";
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/admin/index.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/admin/index.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/admin/index.php	(revision 405)
@@ -0,0 +1,1023 @@
+<?php
+// $Id: index.php,v 1.17.2.2 2004/12/14 10:49:25 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+// ------------------------------------------------------------------------- //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+include '../../../include/cp_header.php';
+if ( file_exists("../language/".$xoopsConfig['language']."/main.php") ) {
+	include "../language/".$xoopsConfig['language']."/main.php";
+} else {
+	include "../language/english/main.php";
+}
+include "../include/functions.php";
+include_once XOOPS_ROOT_PATH."/class/xoopstree.php";
+include_once XOOPS_ROOT_PATH."/class/xoopslists.php";
+include_once XOOPS_ROOT_PATH."/include/xoopscodes.php";
+include_once XOOPS_ROOT_PATH."/class/module.errorhandler.php";
+$myts =& MyTextSanitizer::getInstance();
+$eh = new ErrorHandler;
+$mytree = new XoopsTree($xoopsDB->prefix("mydownloads_cat"),"cid","pid");
+
+function mydownloads()
+{
+	global $xoopsDB, $xoopsModule;
+	xoops_cp_header();
+	echo "<h4>"._MD_DLCONF."</h4>";
+	echo"<table width='100%' border='0' cellspacing='1' class='outer'>"
+	."<tr class=\"odd\"><td>";
+	// Temporarily 'homeless' downloads (to be revised in index.php breakup)
+	$result = $xoopsDB->query("SELECT COUNT(*) FROM ".$xoopsDB->prefix("mydownloads_broken")."");
+	list($totalbrokendownloads) = $xoopsDB->fetchRow($result);
+	if($totalbrokendownloads>0){
+		$totalbrokendownloads = "<span style='color: #ff0000; font-weight: bold'>$totalbrokendownloads</span>";
+	}
+	$result2 = $xoopsDB->query("SELECT COUNT(*) FROM ".$xoopsDB->prefix("mydownloads_mod")."");
+	list($totalmodrequests) = $xoopsDB->fetchRow($result2);
+	if($totalmodrequests>0){
+		$totalmodrequests = "<span style='color: #ff0000; font-weight: bold'>$totalmodrequests</span>";
+	}
+	$result3 = $xoopsDB->query("SELECT COUNT(*) FROM ".$xoopsDB->prefix("mydownloads_downloads")." WHERE status=0");
+	list($totalnewdownloads) = $xoopsDB->fetchRow($result3);
+	if($totalnewdownloads>0){
+		$totalnewdownloads = "<span style='color: #ff0000; font-weight: bold'>$totalnewdownloads</span>";
+	}
+	echo " - <a href='".XOOPS_URL."/modules/system/admin.php?fct=preferences&amp;op=showmod&amp;mod=".$xoopsModule->getVar('mid')."'>"._MD_GENERALSET."</a>";
+	echo "<br /><br />";
+	echo " - <a href=index.php?op=downloadsConfigMenu>"._MD_ADDMODDELETE."</a>";
+	echo "<br /><br />";
+	echo " - <a href=index.php?op=listNewDownloads>"._MD_DLSWAITING." ($totalnewdownloads)</a>";
+	echo "<br /><br />";
+	echo " - <a href=index.php?op=listBrokenDownloads>"._MD_BROKENREPORTS." ($totalbrokendownloads)</a>";
+	echo "<br /><br />";
+	echo " - <a href=index.php?op=listModReq>"._MD_MODREQUESTS." ($totalmodrequests)</a>";
+	$result=$xoopsDB->query("SELECT COUNT(*) FROM ".$xoopsDB->prefix("mydownloads_downloads")." WHERE status>0");
+	list($numrows) = $xoopsDB->fetchRow($result);
+	echo "<br /><br /><div>";
+	printf(_MD_THEREARE,$numrows);	echo "</div>";
+	echo"</td></tr></table>";
+	xoops_cp_footer();
+}
+
+function listNewDownloads()
+{
+	global $xoopsDB, $myts, $eh, $mytree;
+	// List downloads waiting for validation
+	$downimg_array = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH."/modules/mydownloads/images/shots/");
+	$result = $xoopsDB->query("SELECT lid, cid, title, url, homepage, version, size, platform, logourl, submitter FROM ".$xoopsDB->prefix("mydownloads_downloads")." where status=0 ORDER BY date DESC");
+	$numrows = $xoopsDB->getRowsNum($result);
+	xoops_cp_header();
+	echo "<h4>"._MD_DLCONF."</h4>";
+        echo"<table width='100%' border='0' cellspacing='1' class='outer'>"
+           ."<tr class=\"odd\"><td>";
+	echo "<h4>"._MD_DLSWAITING."&nbsp;($numrows)</h4><br />";
+	if ($numrows>0) {
+		while(list($lid, $cid, $title, $url, $homepage, $version, $size, $platform, $logourl, $uid) = $xoopsDB->fetchRow($result)) {
+			$result2 = $xoopsDB->query("SELECT description FROM ".$xoopsDB->prefix("mydownloads_text")." WHERE lid=$lid");
+			list($description) = $xoopsDB->fetchRow($result2);
+			$title = $myts->makeTboxData4Edit($title);
+			$url = $myts->makeTboxData4Edit($url);
+			$homepage = $myts->makeTboxData4Edit($homepage);
+			$version = $myts->makeTboxData4Edit($version);
+			$size = $myts->makeTboxData4Edit($size);
+			$platform = $myts->makeTboxData4Edit($platform);
+			$description = $myts->makeTareaData4Edit($description);
+			$submitter = XoopsUser::getUnameFromId($uid);
+			echo "<form action=\"index.php\" method=post>\n";
+			echo "<table width=\"80%\">";
+			echo "<tr><td align=\"right\" nowrap>"._MD_SUBMITTER."</td><td>\n";
+			echo "<a href=\"".XOOPS_URL."/userinfo.php?uid=".$uid."\">$submitter</a>";
+			echo "</td></tr>\n";
+			echo "<tr><td align=\"right\" nowrap>"._MD_FILETITLE."</td><td>";
+			echo "<input type=\"text\" name=\"title\" size=\"50\" maxlength=\"100\" value=\"$title\">";
+			echo "</td></tr><tr><td align=\"right\" nowrap>"._MD_DLURL."</td><td>";
+			echo "<input type=\"text\" name=\"url\" size=\"50\" maxlength=\"250\" value=\"$url\">";
+			echo "&nbsp;[&nbsp;<a href=\"$url\">"._MD_DOWNLOAD."</a>&nbsp;]";
+			echo "</td></tr>";
+			echo "<tr><td align=\"right\" nowrap>"._MD_CATEGORYC."</td><td>";
+			$mytree->makeMySelBox("title", "title", $cid);
+			echo "</td></tr>\n";
+			echo "<tr><td align=\"right\" nowrap>"._MD_HOMEPAGEC."</td><td>\n";
+			echo "<input type=\"text\" name=\"homepage\" size=\"50\" maxlength=\"100\" value=\"$homepage\"></td></tr>\n";
+			echo "<tr><td align=\"right\">"._MD_VERSIONC."</td><td>\n";
+			echo "<input type=\"text\" name=\"version\" size=\"10\" maxlength=\"10\" value=\"$version\"></td></tr>\n";
+			echo "<tr><td align=\"right\">"._MD_FILESIZEC."</td><td>\n";
+			echo "<input type=\"text\" name=\"size\" size=\"10\" maxlength=\"8\" value=\"$size\">"._MD_BYTES."</td></tr>\n";
+			echo "<tr><td align=\"right\">"._MD_PLATFORMC."</td><td>\n";
+			echo "<input type=\"text\" name=\"platform\" size=\"45\" maxlength=\"50\" value=\"$platform\"></td></tr>\n";
+			echo "<tr><td align=\"right\" valign=\"top\" nowrap>"._MD_DESCRIPTIONC."</td><td>\n";
+			echo "<textarea name=description cols=\"60\" rows=\"5\">$description</textarea>\n";
+			echo "</td></tr>\n";
+			echo "<tr><td align=\"right\" nowrap>"._MD_SHOTIMAGE."</td><td>\n";
+			//echo "<input type=\"text\" name=\"logourl\" size=\"50\" maxlength=\"60\">\n";
+			echo "<select size='1' name='logourl'>";
+			echo "<option value=' '>------</option>";
+			foreach($downimg_array as $image){
+				echo "<option value='".$image."'>".$image."</option>";
+			}
+			echo "</select>";
+			echo "</td></tr><tr><td></td><td>";
+			$directory = XOOPS_URL."/modules/mydownloads/images/shots/";
+			printf(_MD_MUSTBEVALID,$directory);
+
+			echo "</table>\n";
+			echo "<br /><input type=\"hidden\" name=\"op\" value=\"approve\"></input>";
+			echo "<input type=\"hidden\" name=\"lid\" value=\"$lid\"></input>";
+			echo "<input type=\"submit\" value=\""._MD_APPROVE."\"></form>\n";
+			echo myTextForm("index.php?op=delNewDownload&lid=$lid",_MD_DELETE);
+			echo "<br /><br />";
+		}
+	}else{
+		echo _MD_NOSUBMITTED;
+	}
+	echo"</td></tr></table>";
+	xoops_cp_footer();
+}
+
+
+function downloadsConfigMenu()
+{
+	global $xoopsDB, $myts, $eh, $mytree;
+	// Add a New Main Category
+	xoops_cp_header();
+	$downimg_array = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH."/modules/mydownloads/images/shots/");
+	echo "<h4>"._MD_DLCONF."</h4>";
+        echo"<table width='100%' border='0' cellspacing='1' class='outer'>"
+           ."<tr class=\"odd\"><td>";
+	echo "<form method=post action=index.php>\n";
+	echo "<h4>"._MD_ADDMAIN."</h4><br />"._MD_TITLEC."<input type=text name=title size=30 maxlength=50><br />";
+	echo _MD_IMGURL."<br /><input type=\"text\" name=\"imgurl\" size=\"100\" maxlength=\"150\" value=\"http://\"><br /><br />";
+	echo "<input type=hidden name=cid value=0>\n";
+	echo "<input type=hidden name=op value=addCat>";
+	echo "<input type=submit value="._MD_ADD."><br /></form>";
+	echo"</td></tr></table>";
+	echo "<br />";
+	// Add a New Sub-Category
+	$result=$xoopsDB->query("SELECT COUNT(*) FROM ".$xoopsDB->prefix("mydownloads_cat")."");
+	list($numrows)=$xoopsDB->fetchRow($result);
+	if($numrows>0) {
+                echo"<table width='100%' border='0' cellspacing='1' class='outer'>"
+                   ."<tr class=\"odd\"><td>";
+		echo "<form method=post action=index.php>";
+		echo "<h4>"._MD_ADDSUB."</h4><br />"._MD_TITLEC."<input type=text name=title size=30 maxlength=50>&nbsp;"._MD_IN."&nbsp;";
+		$mytree->makeMySelBox("title", "title");
+		#               echo "<br />"._MD_IMGURL."<br /><input type=\"text\" name=\"imgurl\" size=\"100\" maxlength=\"150\">\n";
+		echo "<input type=hidden name=op value=addCat><br /><br />";
+		echo "<input type=submit value="._MD_ADD."><br /></form>";
+      	        echo"</td></tr></table>";
+		echo "<br />";
+		// If there is a category, add a New Download
+
+                echo"<table width='100%' border='0' cellspacing='1' class='outer'>"
+                   ."<tr class=\"odd\"><td>";
+		echo "<form method=post action=index.php>\n";
+		echo "<h4>"._MD_ADDNEWFILE."</h4><br />\n";
+		echo "<table width=\"80%\"><tr>\n";
+		echo "<td align=\"right\">"._MD_FILETITLE."</td><td>";
+		echo "<input type=text name=title size=50 maxlength=100>";
+		echo "</td></tr><tr><td align=\"right\" nowrap>"._MD_DLURL."</td><td>";
+		echo "<input type=text name=url size=50 maxlength=250 value=\"http://\">";
+		echo "</td></tr>";
+		echo "<tr><td align=\"right\" nowrap>"._MD_CATEGORYC."</td><td>";
+		$mytree->makeMySelBox("title", "title");
+		echo "</td></tr><tr><td></td><td></td></tr>\n";
+		echo "<tr><td align=\"right\" nowrap>"._MD_HOMEPAGEC."</td><td>\n";
+		echo "<input type=text name=homepage size=50 maxlength=100 value=\"http://\" /></td></tr>\n";
+		echo "<tr><td align=\"right\">"._MD_VERSIONC."</td><td>\n";
+		echo "<input type=text name=version size=10 maxlength=10></td></tr>\n";
+		echo "<tr><td align=\"right\">"._MD_FILESIZEC."</td><td>\n";
+		echo "<input type=text name=size size=10 maxlength=100>"._MD_BYTES."</td></tr>\n";
+		echo "<tr><td align=\"right\">"._MD_PLATFORMC."</td><td>\n";
+		echo "<input type=text name=platform size=45 maxlength=60></td></tr>\n";
+		echo "<tr><td align=\"right\" valign=\"top\" nowrap>"._MD_DESCRIPTIONC."</td><td>\n";
+		xoopsCodeTarea("description",60,8);
+		xoopsSmilies("description");
+		//echo "<textarea name=description cols=60 rows=5></textarea>\n";
+		echo "</td></tr>\n";
+		echo "<tr><td align=\"right\"nowrap>"._MD_SHOTIMAGE."</td><td>\n";
+		echo "<select size='1' name='logourl'>";
+		echo "<option value=' '>------</option>";
+		foreach($downimg_array as $image){
+			echo "<option value='".$image."'>".$image."</option>";
+		}
+		echo "</select>";
+		//echo "<input type=\"text\" name=\"logourl\" size=\"50\" maxlength=\"60\">";
+
+		echo "</td></tr>\n";
+		echo "<tr><td align=\"right\"></td><td>";
+		$directory = XOOPS_URL."/modules/mydownloads/images/shots/";
+		printf(_MD_MUSTBEVALID,$directory);
+		echo "</td></tr>\n";
+		echo "</table>\n<br />";
+		echo  "<input type=\"hidden\" name=\"op\" value=\"addDownload\"></input>";
+		echo "<input type=\"submit\" class=\"button\" value=\""._MD_ADD."\"></input>\n";
+		echo "</form>";
+		echo"</td></tr></table>";
+		echo "<br />";
+
+		// Modify Category
+                echo"<table width='100%' border='0' cellspacing='1' class='outer'>"
+                   ."<tr class=\"odd\"><td>";
+		echo "<form method=post action=index.php><h4>"._MD_MODCAT."</h4><br />";
+		echo _MD_CATEGORYC;
+		$mytree->makeMySelBox("title", "title");
+		echo "<br /><br />\n";
+		echo "<input type=hidden name=op value=modCat>\n";
+		echo "<input type=submit value="._MD_MODIFY.">\n";
+		echo "</form>";
+		echo"</td></tr></table>";
+		echo "<br />";
+	}
+	// Modify Download
+	$result2 = $xoopsDB->query("SELECT COUNT(*) FROM ".$xoopsDB->prefix("mydownloads_downloads")."");
+	list($numrows2) = $xoopsDB->fetchRow($result2);
+	if ($numrows2>0) {
+                echo"<table width='100%' border='0' cellspacing='1' class='outer'>"
+                   ."<tr class=\"odd\"><td>";
+		echo "<form method=get action=\"index.php\">\n";
+		echo "<h4>"._MD_MODDL."</h4><br />\n";
+		echo _MD_FILEID."<input type=text name=lid size=12 maxlength=11>\n";
+		echo "<input type=hidden name=fct value=mydownloads>\n";
+		echo "<input type=hidden name=op value=modDownload><br /><br />\n";
+		echo "<input type=submit value="._MD_MODIFY."></form>\n";
+		echo"</td></tr></table>";
+	}
+	xoops_cp_footer();
+}
+
+function modDownload()
+{
+	global $xoopsDB, $HTTP_GET_VARS, $myts, $eh, $mytree;
+	$downimg_array = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH."/modules/mydownloads/images/shots/");
+	$lid = $HTTP_GET_VARS['lid'];
+	xoops_cp_header();
+	echo "<h4>"._MD_DLCONF."</h4>";
+        echo"<table width='100%' border='0' cellspacing='1' class='outer'>"
+           ."<tr class=\"odd\"><td>";
+	$result = $xoopsDB->query("SELECT cid, title, url, homepage, version, size, platform, logourl FROM ".$xoopsDB->prefix("mydownloads_downloads")." WHERE lid=$lid") or $eh->show("0013");
+	echo "<h4>"._MD_MODDL."</h4><br />";
+	list($cid, $title, $url, $homepage, $version, $size, $platform, $logourl) = $xoopsDB->fetchRow($result);
+	$title = $myts->makeTboxData4Edit($title);
+	$url = $myts->makeTboxData4Edit($url);
+	$homepage = $myts->makeTboxData4Edit($homepage);
+	$version = $myts->makeTboxData4Edit($version);
+	$size = $myts->makeTboxData4Edit($size);
+	$platform = $myts->makeTboxData4Edit($platform);
+	$logourl = $myts->makeTboxData4Edit($logourl);
+	$result2 = $xoopsDB->query("SELECT description FROM ".$xoopsDB->prefix("mydownloads_text")." WHERE lid=$lid");
+	list($description)=$xoopsDB->fetchRow($result2);
+	$GLOBALS['description'] = $myts->makeTareaData4Edit($description);
+	echo "<table>";
+	echo "<form method=post action=index.php>";
+	echo "<tr><td>"._MD_FILEID."</td><td><b>$lid</b></td></tr>";
+	echo "<tr><td>"._MD_FILETITLE."</td><td><input type=text name=title value=\"$title\" size=50 maxlength=100></input></td></tr>\n";
+	echo "<tr><td>"._MD_DLURL."</td><td><input type=text name=url value=\"$url\" size=50 maxlength=250></input></td></tr>\n";
+	echo "<tr><td>"._MD_HOMEPAGEC."</td><td><input type=text name=homepage value=\"$homepage\" size=50 maxlength=100></input></td></tr>\n";
+	echo "<tr><td>"._MD_VERSIONC."</td><td><input type=text name=version value=\"$version\" size=10 maxlength=10></input></td></tr>\n";
+	echo "<tr><td>"._MD_FILESIZEC."</td><td><input type=text name=size value=\"$size\" size=10 maxlength=100></input>"._MD_BYTES."</td></tr>\n";
+	echo "<tr><td>"._MD_PLATFORMC."</td><td><input type=text name=platform value=\"$platform\" size=45 maxlength=60></input></td></tr>\n";
+	echo "<tr><td valign=\"top\">"._MD_DESCRIPTIONC."</td><td>";
+	xoopsCodeTarea("description",60,8);
+	xoopsSmilies("description");
+	//echo "<textarea name=description cols=60 rows=5>$description</textarea>";
+	echo "</td></tr>";
+	echo "<tr><td>"._MD_CATEGORYC."</td><td>";
+	$mytree->makeMySelBox("title", "title", $cid);
+	echo "</td></tr>\n";
+	echo "<tr><td>"._MD_SHOTIMAGE."</td><td>";
+	//echo "<input type=text name=logourl value=\"$logourl\" size=\"50\" maxlength=\"60\"></input>";
+	echo "<select size='1' name='logourl'>";
+	echo "<option value=' '>------</option>";
+	foreach($downimg_array as $image){
+		if ( $image == $logourl ) {
+			$opt_selected = "selected='selected'";
+		}else{
+			$opt_selected = "";
+		}
+		echo "<option value='".$image."' $opt_selected>".$image."</option>";
+	}
+	echo "</select>";
+	echo "</td></tr>\n";
+	echo "<tr><td></td><td>";
+	$directory = XOOPS_URL."/modules/mydownloads/images/shots/";
+	printf(_MD_MUSTBEVALID,$directory);
+	echo "</td></tr>\n";
+	echo "</table>";
+	echo "<br /><br /><input type=hidden name=lid value=$lid></input>\n";
+	echo "<input type=hidden name=op value=modDownloadS><input type=submit value="._MD_SUBMIT.">";
+	echo "</form>\n";
+	echo "<table><tr><td>\n";
+	echo myTextForm("index.php?op=delDownload&lid=".$lid , _MD_DELETE);
+	echo "</td><td>\n";
+	echo myTextForm("index.php?op=downloadsConfigMenu", _MD_CANCEL);
+	echo "</td></tr></table>\n";
+	echo "<hr>";
+
+	$result5=$xoopsDB->query("SELECT COUNT(*) FROM ".$xoopsDB->prefix("mydownloads_votedata")."");
+	list($totalvotes) = $xoopsDB->getRowsNum($result5);
+	echo "<table width=100%>\n";
+	echo "<tr><td colspan=7><b>";
+	printf(_MD_DLRATINGS,$totalvotes);
+	echo "</b><br /><br /></td></tr>\n";
+	// Show Registered Users Votes
+	$result5=$xoopsDB->query("SELECT ratingid, ratinguser, rating, ratinghostname, ratingtimestamp FROM ".$xoopsDB->prefix("mydownloads_votedata")." WHERE lid = $lid AND ratinguser != 0 ORDER BY ratingtimestamp DESC");
+	$votes = $xoopsDB->getRowsNum($result5);
+	echo "<tr><td colspan=7><br /><br /><b>";
+	printf(_MD_REGUSERVOTES,$votes);
+	echo "</b><br /><br /></td></tr>\n";
+	echo "<tr><td><b>" ._MD_USER."  </b></td><td><b>" ._MD_IP."  </b></td><td><b>" ._MD_RATING."  </b></td><td><b>" ._MD_USERAVG."  </b></td><td><b>" ._MD_TOTALRATE."  </b></td><td><b>" ._MD_DATE."  </b></td><td align=\"center\"><b>" ._MD_DELETE."</b></td></tr>\n";
+	if ($votes == 0){
+		echo "<tr><td align=\"center\" colspan=\"7\">" ._MD_NOREGVOTES."<br /></td></tr>\n";
+	}
+	$x=0;
+	$colorswitch="dddddd";
+	while(list($ratingid, $ratinguser, $rating, $ratinghostname, $ratingtimestamp)=$xoopsDB->fetchRow($result5)) {
+		$formatted_date = formatTimestamp($ratingtimestamp);
+		//Individual user information
+		$result2=$xoopsDB->query("SELECT rating FROM ".$xoopsDB->prefix("mydownloads_votedata")." WHERE ratinguser = $ratinguser");
+		$uservotes = $xoopsDB->getRowsNum($result2);
+		$useravgrating = 0;
+		while(list($rating2) = $xoopsDB->fetchRow($result2)){
+			$useravgrating = $useravgrating + $rating2;
+		}
+		$useravgrating = $useravgrating / $uservotes;
+		$useravgrating = number_format($useravgrating, 1);
+		$ratinguname = XoopsUser::getUnameFromId($ratinguser);
+		// echo "<tr><td bgcolor=\"$colorswitch\">$ratinguname</td><td bgcolor=\"$colorswitch\">$ratinghostname</td><td bgcolor=\"$colorswitch\">$rating</td><td bgcolor=\"$colorswitch\">$useravgrating</td><td bgcolor=\"$colorswitch\">$uservotes</td><td bgcolor=\"$colorswitch\">$formatted_date</td><td bgcolor=\"$colorswitch\" align=\"center\"><b><a href=index.php?op=delVote&lid=$lid&rid=$ratingid>X</a></b></td></tr>\n";
+		// echo "<tr><td bgcolor=\"$colorswitch\">$ratinguname</td><td bgcolor=\"$colorswitch\">$ratinghostname</td><td bgcolor=\"$colorswitch\">$rating</td><td bgcolor=\"$colorswitch\">$useravgrating</td><td bgcolor=\"$colorswitch\">$uservotes</td><td bgcolor=\"$colorswitch\">$formatted_date</td><td bgcolor=\"$colorswitch\" align=\"center\">";
+		echo "<tr><td bgcolor=\"$colorswitch\">$ratinguname</td><td bgcolor=\"$colorswitch\">$ratinghostname</td><td bgcolor=\"$colorswitch\">$rating</td><td bgcolor=\"$colorswitch\">$useravgrating</td><td bgcolor=\"$colorswitch\">$uservotes</td><td bgcolor=\"$colorswitch\">$formatted_date</td><td bgcolor=\"$colorswitch\" align=\"center\">";
+		//echo "<table><tr><td>\n";
+		echo myTextForm("index.php?op=delVote&lid=$lid&rid=$ratingid" , "X");
+		// echo "</td></tr></table>\n";
+		echo "</td></tr>\n";
+
+		$x++;
+		if ($colorswitch=="dddddd"){
+			$colorswitch="ffffff";
+		} else {
+			$colorswitch="dddddd";
+		}
+	}
+
+	// Show Unregistered Users Votes
+	$result5=$xoopsDB->query("SELECT ratingid, rating, ratinghostname, ratingtimestamp FROM ".$xoopsDB->prefix("mydownloads_votedata")." WHERE lid = $lid AND ratinguser = 0 ORDER BY ratingtimestamp DESC");
+	$votes = $xoopsDB->getRowsNum($result5);
+	echo "<tr><td colspan=7><b><br /><br />";
+	printf(_MD_ANONUSERVOTES,$votes);
+	echo "</b><br /><br /></td></tr>\n";
+	echo "<tr><td colspan=2><b>" ._MD_IP."  </b></td><td colspan=3><b>" ._MD_RATING."  </b></td><td><b>" ._MD_DATE."  </b></b></td><td align=\"center\"><b>" ._MD_DELETE."</b></td><br /></tr>";
+	if ($votes == 0) {
+		echo "<tr><td colspan=\"7\" align=\"center\">" ._MD_NOUNREGVOTES."<br /></td></tr>";
+	}
+	$x=0;
+	$colorswitch="dddddd";
+	while(list($ratingid, $rating, $ratinghostname, $ratingtimestamp)=$xoopsDB->fetchRow($result5)) {
+		$formatted_date = formatTimestamp($ratingtimestamp);
+		// echo "<td colspan=\"2\" bgcolor=\"$colorswitch\">$ratinghostname</td><td colspan=\"3\" bgcolor=\"$colorswitch\">$rating</td><td bgcolor=\"$colorswitch\">$formatted_date</td><td bgcolor=\"$colorswitch\" aling=\"center\"><b><a href=index.php?op=delVote&lid=$lid&rid=$ratingid>X</a></b></td></tr>";
+		echo "<td colspan=\"2\" bgcolor=\"$colorswitch\">$ratinghostname</td><td colspan=\"3\" bgcolor=\"$colorswitch\">$rating</td><td bgcolor=\"$colorswitch\">$formatted_date</td><td bgcolor=\"$colorswitch\" align=\"center\">";
+		//echo "<table><tr><td>\n";
+		//align=\"center\"
+		echo myTextForm("index.php?op=delVote&lid=$lid&rid=$ratingid" , "X");
+		//echo "</td></tr></table>\n";
+
+		echo "</td></tr>";
+
+		$x++;
+		if ($colorswitch=="dddddd") {
+			$colorswitch="ffffff";
+		} else {
+			$colorswitch="dddddd";
+		}
+	}
+	echo "<tr><td colspan=\"6\">&nbsp;<br /></td></tr>\n";
+	echo "</table>\n";
+	echo"</td></tr></table>";
+	xoops_cp_footer();
+}
+
+function delVote()
+{
+	global $xoopsDB, $HTTP_GET_VARS, $eh;
+	$rid = $HTTP_GET_VARS['rid'];
+	$lid = $HTTP_GET_VARS['lid'];
+	$sql = sprintf("DELETE FROM %s WHERE ratingid = %u", $xoopsDB->prefix("mydownloads_votedata"), $rid);
+	$xoopsDB->query($sql) or $eh->show("0013");
+	updaterating($lid);
+	redirect_header("index.php",1,_MD_VOTEDELETED);
+}
+
+function listBrokenDownloads()
+{
+	global $xoopsDB, $eh;
+	$result = $xoopsDB->query("SELECT * FROM ".$xoopsDB->prefix("mydownloads_broken")." ORDER BY reportid");
+	$totalbrokendownloads = $xoopsDB->getRowsNum($result);
+	xoops_cp_header();
+	echo "<h4>"._MD_DLCONF."</h4>";
+        echo"<table width='100%' border='0' cellspacing='1' class='outer'>"
+           ."<tr class=\"odd\"><td>";
+	echo "<h4>"._MD_BROKENREPORTS." ($totalbrokendownloads)</h4><br />";
+
+	if ($totalbrokendownloads==0) {
+		echo _MD_NOBROKEN;
+	} else {
+		echo "<center>"._MD_IGNOREDESC."<br />"._MD_DELETEDESC."</center><br /><br /><br />";
+		$colorswitch="#dddddd";
+		echo "<table align=\"center\" width=\"90%\">";
+		echo "
+		<tr>
+			<td><b>"._MD_FILETITLE."</b></td>
+			<td><b>" ._MD_REPORTER."</b></td>
+			<td><b>" ._MD_FILESUBMITTER."</b></td>
+			<td><b>" ._MD_IGNORE."</b></td>
+			<td><b>" ._EDIT."</b></td>
+			<td><b>" ._MD_DELETE."</b></td>
+		</tr>";
+		while(list($reportid, $lid, $sender, $ip)=$xoopsDB->fetchRow($result)){
+			$result2 = $xoopsDB->query("SELECT title, url, submitter FROM ".$xoopsDB->prefix("mydownloads_downloads")." WHERE lid=$lid");
+			if ($sender != 0) {
+				$result3 = $xoopsDB->query("SELECT uname, email FROM ".$xoopsDB->prefix("users")." WHERE uid=".$sender."");
+				list($sendername, $email)=$xoopsDB->fetchRow($result3);
+			}
+			list($title, $url, $owner)=$xoopsDB->fetchRow($result2);
+			$result4 = $xoopsDB->query("SELECT uname, email FROM ".$xoopsDB->prefix("users")." WHERE uid=".$owner."");
+			list($ownername, $owneremail)=$xoopsDB->fetchRow($result4);
+			echo "<tr><td bgcolor=$colorswitch><a href=$url target='_blank'>$title</a></td>";
+			if ($email=="") {
+				echo "<td bgcolor=$colorswitch>$sendername ($ip)";
+			} else {
+				echo "<td bgcolor=$colorswitch><a href=mailto:$email>$sendername</a> ($ip)";
+			}
+			echo "</td>";
+			if ($owneremail=='') {
+				echo "<td bgcolor=$colorswitch>$ownername";
+			} else {
+				echo "<td bgcolor=$colorswitch><a href=mailto:$owneremail>$ownername</a>";
+			}
+			echo "</td><td bgcolor='$colorswitch' align='center'>\n";
+			echo myTextForm("index.php?op=ignoreBrokenDownloads&lid=$lid" , "X");
+			echo "</td><td bgcolor='$colorswitch' align='center'>\n";
+			echo myTextForm("index.php?op=modDownload&lid=$lid" , "X");
+			echo "</td><td bgcolor='$colorswitch' align='center'>\n";
+			echo myTextForm("index.php?op=delBrokenDownloads&lid=$lid" , "X");
+			echo "</td></tr>\n";
+			if ($colorswitch=="#dddddd") {
+				$colorswitch="#ffffff";
+			} else {
+				$colorswitch="#dddddd";
+			}
+		}
+                echo "</table>";
+	}
+	echo"</td></tr></table>";
+	xoops_cp_footer();
+}
+
+function delBrokenDownloads()
+{
+	global $xoopsDB, $HTTP_GET_VARS, $eh;
+	$lid = $HTTP_GET_VARS['lid'];
+	$sql = sprintf("DELETE FROM %s WHERE lid = %u", $xoopsDB->prefix("mydownloads_broken"), $lid);
+	$xoopsDB->query($sql) or $eh->show("0013");
+	$sql = sprintf("DELETE FROM %s WHERE lid = %u", $xoopsDB->prefix("mydownloads_downloads"), $lid);
+	$xoopsDB->query($sql) or $eh->show("0013");
+	redirect_header("index.php",1,_MD_FILEDELETED);
+}
+
+function ignoreBrokenDownloads()
+{
+	global $xoopsDB, $HTTP_GET_VARS, $eh;
+	$sql = sprintf("DELETE FROM %s WHERE lid = %u", $xoopsDB->prefix("mydownloads_broken"), $HTTP_GET_VARS['lid']);
+	$xoopsDB->query($sql) or $eh->show("0013");
+	redirect_header("index.php",1,_MD_BROKENDELETED);
+}
+
+function listModReq()
+{
+	global $xoopsDB, $myts, $eh, $mytree, $xoopsModuleConfig;
+	$result = $xoopsDB->query("SELECT * FROM ".$xoopsDB->prefix("mydownloads_mod")." ORDER BY requestid");
+	$totalmodrequests = $xoopsDB->getRowsNum($result);
+	xoops_cp_header();
+	echo "<h4>"._MD_DLCONF."</h4>";
+        echo"<table width='100%' border='0' cellspacing='1' class='outer'>"
+           ."<tr class=\"odd\"><td>";
+	echo "<h4>"._MD_USERMODREQ." ($totalmodrequests)</h4><br />";
+	if($totalmodrequests>0){
+		echo "<table width=95%><tr><td>";
+		$lookup_lid = array();
+		while(list($requestid, $lid, $cid, $title, $url, $homepage, $version, $size, $platform, $logourl, $description, $modifysubmitter)=$xoopsDB->fetchRow($result)) {
+			$lookup_lid[$requestid] = $lid;
+			$result2 = $xoopsDB->query("SELECT cid, title, url, homepage, version, size, platform, logourl, submitter FROM ".$xoopsDB->prefix("mydownloads_downloads")." WHERE lid=$lid");
+			list($origcid, $origtitle, $origurl, $orighomepage, $origversion, $origsize, $origplatform, $origlogourl, $owner)=$xoopsDB->fetchRow($result2);
+			$result2 = $xoopsDB->query("SELECT description FROM ".$xoopsDB->prefix("mydownloads_text")." WHERE lid=$lid");
+			list($origdescription) = $xoopsDB->fetchRow($result2);
+			$result7 = $xoopsDB->query("SELECT uname, email FROM ".$xoopsDB->prefix("users")." WHERE uid=$modifysubmitter");
+			$result8 = $xoopsDB->query("SELECT uname, email FROM ".$xoopsDB->prefix("users")." WHERE uid=$owner");
+			$cidtitle=$mytree->getPathFromId($cid, "title");
+			$origcidtitle=$mytree->getPathFromId($origcid, "title");
+			list($submittername, $submitteremail)=$xoopsDB->fetchRow($result7);
+			list($ownername, $owneremail)=$xoopsDB->fetchRow($result8);
+			$title = $myts->makeTboxData4Show($title);
+			$url = $myts->makeTboxData4Show($url);
+			$homepage = $myts->makeTboxData4Show($homepage);
+			$version = $myts->makeTboxData4Show($version);
+			$size = $myts->makeTboxData4Show($size);
+			$platform = $myts->makeTboxData4Show($platform);
+
+			// use original image file to prevent users from changing screen shots file
+			$origlogourl = $myts->makeTboxData4Edit($origlogourl);
+			$logourl = $origlogourl;
+			$description = $myts->makeTareaData4Show($description, 0);
+			$origurl = $myts->makeTboxData4Show($origurl);
+			$orighomepage = $myts->makeTboxData4Show($orighomepage);
+			$origversion = $myts->makeTboxData4Show($origversion);
+			$origsize = $myts->makeTboxData4Show($origsize);
+			$origplatform = $myts->makeTboxData4Show($origplatform);
+			$origdescription = $myts->makeTareaData4Show($origdescription, 0);
+			if (empty($ownername)) {
+				$ownername = "administration";
+			}
+			echo "<table border=1 bordercolor=black cellpadding=5 cellspacing=0 align=center width=450><tr><td>
+				<table width=100% bgcolor=dddddd>
+				<tr>
+				<td valign=top width=45%><b>"._MD_ORIGINAL."</b></td>
+				<td rowspan=14 valign=top align=left><br />"._MD_DESCRIPTIONC."<br />$origdescription</td>
+				</tr>
+				<tr><td valign=top width=45%><small>"._MD_FILETITLE." ".$origtitle."</small></td></tr>
+				<tr><td valign=top width=45%><small>"._MD_DLURL." ".$origurl."</small></td></tr>
+				<tr><td valign=top width=45%><small>"._MD_CATEGORYC." ".$origcidtitle."</small></td></tr>
+				<tr><td valign=top width=45%><small>"._MD_HOMEPAGEC." ".$orighomepage."</small></td></tr>
+				<tr><td valign=top width=45%><small>"._MD_VERSIONC." ".$origversion."</small></td></tr>
+				<tr><td valign=top width=45%><small>"._MD_FILESIZEC." ".$origsize."</small></td></tr>
+				<tr><td valign=top width=45%><small>"._MD_PLATFORMC." ".$origplatform."</small></td></tr>
+                                <tr><td valign=top width=45%><small>"._MD_SHOTIMAGE."</small> ";
+			if ( $xoopsModuleConfig['useshots'] && !empty($origlogourl) ){
+				echo "<img src=\"".XOOPS_URL."/modules/mydownloads/images/shots/".$origlogourl."\" width=\"".$xoopsModuleConfig['shotwidth']."\">";
+			}else{
+				echo "&nbsp;";
+			}
+			echo "</td></tr>
+				</table></td></tr><tr><td>
+				<table width=100%>
+					<tr>
+					<td valign=top width=45%><b>"._MD_PROPOSED."</b></td>
+					<td rowspan=14 valign=top align=left><br />"._MD_DESCRIPTIONC."<br />$description</td>
+					</tr>
+					<tr><td valign=top width=45%><small>"._MD_FILETITLE." ".$title."</small></td></tr>
+					<tr><td valign=top width=45%><small>"._MD_DLURL." ".$url."</small></td></tr>
+					<tr><td valign=top width=45%><small>"._MD_CATEGORYC." ".$cidtitle."</small></td></tr>
+					<tr><td valign=top width=45%><small>"._MD_HOMEPAGEC." ".$homepage."</small></td></tr>
+					<tr><td valign=top width=45%><small>"._MD_VERSIONC." ".$version."</small></td></tr>
+					<tr><td valign=top width=45%><small>"._MD_FILESIZEC." ".$size."</small></td></tr>
+					<tr><td valign=top width=45%><small>"._MD_PLATFORMC." ".$platform."</small></td></tr>
+					<tr><td valign=top width=45%><small>"._MD_SHOTIMAGE."</small> ";
+			if ( $xoopsModuleConfig['useshots'] && !empty($logourl) ){
+				echo "<img src=\"".XOOPS_URL."/modules/mydownloads/images/shots/".$logourl."\" width=\"".$xoopsModuleConfig['shotwidth']."\">";
+			} else {
+				echo "&nbsp;";
+			}
+			echo "</td></tr>
+				</table></td></tr></table>
+				<table align=center width=450>
+				<tr>";
+			if ( $submitteremail=="" ) {
+				echo "<td align=left><small>"._MD_SUBMITTER." $submittername</small></td>";
+			} else {
+				echo "<td align=left><small>"._MD_SUBMITTER." <a href=mailto:$submitteremail>$submittername</a></small></td>";
+			}
+			if ($owneremail=="") {
+				echo "<td align=center><small>"._MD_OWNER." $ownername</small></td>";
+			} else {
+				echo "<td align=center><small>"._MD_OWNER." <a href=mailto:$owneremail>$ownername</a></small></td>";
+			}
+			echo "<td align=right><small>\n";
+			echo "<table><tr><td>\n";
+			echo myTextForm("index.php?op=changeModReq&requestid=$requestid" , _MD_APPROVE);
+			echo "</td><td>\n";
+			echo myTextForm("index.php?op=modDownload&lid=$lookup_lid[$requestid]", _EDIT);
+			echo "</td><td>\n";
+			echo myTextForm("index.php?op=ignoreModReq&requestid=$requestid", _MD_IGNORE);
+			echo "</td></tr></table>\n";
+			echo "</small></td></tr>\n";
+			echo "</table><br /><br />";
+		}
+		echo "</td></tr></table>";
+	}else {
+		echo _MD_NOMODREQ;
+	}
+	echo"</td></tr></table>";
+	xoops_cp_footer();
+}
+
+function changeModReq()
+{
+	global $xoopsDB, $HTTP_GET_VARS, $eh, $myts;
+	$requestid = $HTTP_GET_VARS['requestid'];
+	$query = "SELECT lid, cid, title, url, homepage, version, size, platform, logourl, description FROM ".$xoopsDB->prefix("mydownloads_mod")." WHERE requestid=$requestid";
+	$result = $xoopsDB->query($query);
+	while(list($lid, $cid, $title, $url, $homepage, $version, $size, $platform, $logourl, $description)=$xoopsDB->fetchRow($result)) {
+		if (get_magic_quotes_runtime()) {
+			$title = stripslashes($title);
+			$url = stripslashes($url);
+			$homepage = stripslashes($homepage);
+			$logourl = stripslashes($logourl);
+			$description = stripslashes($description);
+		}
+		$title = addslashes($title);
+		$url = addslashes($url);
+		$homepage = addslashes($homepage);
+		$logourl = addslashes($logourl);
+		$description = addslashes($description);
+		$sql = sprintf("UPDATE %s SET cid = %u,title = '%s', url = '%s', homepage = '%s', version = '%s', size = %u, platform = '%s', logourl = '%s', status = %u, date = %u WHERE lid = %u", $xoopsDB->prefix("mydownloads_downloads"), $cid, $title, $url, $homepage, $version, $size, $platform, $logourl, 2, time(), $lid);
+		$xoopsDB->query($sql) or $eh->show("0013");
+		$sql = sprintf("UPDATE %s SET description = '%s' WHERE lid = %u", $xoopsDB->prefix("mydownloads_text"), $description, $lid);
+		$xoopsDB->query($sql) or $eh->show("0013");
+		$sql = sprintf("DELETE FROM %s WHERE requestid = %u", $xoopsDB->prefix("mydownloads_mod"), $requestid);
+		$xoopsDB->query($sql) or $eh->show("0013");
+	}
+	redirect_header("index.php",1,_MD_DBUPDATED);
+}
+
+function ignoreModReq()
+{
+	global $xoopsDB, $HTTP_GET_VARS, $eh;
+	$sql = sprintf("DELETE FROM %s WHERE requestid = %u", $xoopsDB->prefix("mydownloads_mod"), $HTTP_GET_VARS['requestid']);
+	$xoopsDB->query($sql) or $eh->show("0013");
+	redirect_header("index.php",1,_MD_MODREQDELETED);
+}
+
+function modDownloadS()
+{
+	global $xoopsDB, $HTTP_POST_VARS, $myts, $eh;
+	$cid = $HTTP_POST_VARS["cid"];
+	if (($HTTP_POST_VARS["url"]) || ($HTTP_POST_VARS["url"]!="")) {
+		$url = $myts->makeTboxData4Save($HTTP_POST_VARS["url"]);
+	}
+	$logourl = $myts->makeTboxData4Save($HTTP_POST_VARS["logourl"]);
+	$title = $myts->makeTboxData4Save($HTTP_POST_VARS["title"]);
+	$homepage = $myts->makeTboxData4Save($HTTP_POST_VARS["homepage"]);
+	$version = $myts->makeTboxData4Save($HTTP_POST_VARS["version"]);
+	$size = $myts->makeTboxData4Save($HTTP_POST_VARS["size"]);
+	$platform = $myts->makeTboxData4Save($HTTP_POST_VARS["platform"]);
+	$description = $myts->makeTareaData4Save($HTTP_POST_VARS["description"]);
+	$sql = sprintf("UPDATE %s SET cid = %u, title = '%s', url = '%s', homepage = '%s', version = '%s', size = %u, platform = '%s', logourl = '%s', status = %u, date = %u WHERE lid = %u", $xoopsDB->prefix("mydownloads_downloads"), $cid, $title, $url, $homepage, $version, $size, $platform, $logourl, 2, time(), $HTTP_POST_VARS['lid']);
+	$xoopsDB->query($sql)  or $eh->show("0013");
+	$sql = sprintf("UPDATE %s SET description = '%s' WHERE lid = %u", $xoopsDB->prefix("mydownloads_text"), $description, $HTTP_POST_VARS['lid']);
+	$xoopsDB->query($sql)  or $eh->show("0013");
+	redirect_header("index.php",1,_MD_DBUPDATED);
+}
+
+function delDownload()
+{
+	global $xoopsDB, $HTTP_GET_VARS, $eh, $xoopsModule;
+	$sql = sprintf("DELETE FROM %s WHERE lid = %u", $xoopsDB->prefix("mydownloads_downloads"), $HTTP_GET_VARS['lid']);
+	$xoopsDB->query($sql) or $eh->show("0013");
+	$sql = sprintf("DELETE FROM %s WHERE lid = %u", $xoopsDB->prefix("mydownloads_text"), $HTTP_GET_VARS['lid']);
+	$xoopsDB->query($sql) or $eh->show("0013");
+	$sql = sprintf("DELETE FROM %s WHERE lid = %u", $xoopsDB->prefix("mydownloads_votedata"), $HTTP_GET_VARS['lid']);
+	$xoopsDB->query($sql) or $eh->show("0013");
+	// delete comments
+	xoops_comment_delete($xoopsModule->getVar('mid'), $HTTP_GET_VARS['lid']);
+	redirect_header("index.php",1,_MD_FILEDELETED);
+}
+
+function modCat()
+{
+	global $xoopsDB, $HTTP_POST_VARS, $myts, $eh, $mytree;
+	$cid = $HTTP_POST_VARS["cid"];
+	xoops_cp_header();
+	echo "<h4>"._MD_DLCONF."</h4>";
+        echo"<table width='100%' border='0' cellspacing='1' class='outer'>"
+           ."<tr class=\"odd\"><td>";
+	echo "<h4>"._MD_MODCAT."</h4><br />";
+	$result=$xoopsDB->query("SELECT pid, title, imgurl FROM ".$xoopsDB->prefix("mydownloads_cat")." WHERE cid=$cid");
+	list($pid,$title,$imgurl) = $xoopsDB->fetchRow($result);
+	$title = $myts->makeTboxData4Edit($title);
+	$imgurl = $myts->makeTboxData4Edit($imgurl);
+	echo "<form action=index.php method=post>"._MD_TITLEC."<input type=text name=title value=\"$title\" size=51 maxlength=50><br /><br />"._MD_IMGURLMAIN."<br /><input type=text name=imgurl value=\"$imgurl\" size=100 maxlength=150><br />
+	<br />"._MD_PARENT."&nbsp;";
+	$mytree->makeMySelBox("title", "title", $pid, 1, "pid");
+	echo "<input type='hidden' name='cid' value='$cid'>
+	<input type=hidden name=op value=modCatS><br />
+	<input type=submit value=\""._MD_SAVE."\">
+	<input type=button value="._MD_DELETE." onClick=\"location='index.php?pid=$pid&amp;cid=$cid&amp;op=delCat'\">";
+	echo "&nbsp;<input type=button value="._MD_CANCEL." onclick=\"javascript:history.go(-1)\" />";
+	echo "</form>";
+	echo"</td></tr></table>";
+	xoops_cp_footer();
+}
+
+function modCatS()
+{
+	global $xoopsDB, $HTTP_POST_VARS, $myts, $eh;
+	$cid =  $HTTP_POST_VARS['cid'];
+	$sid =  $HTTP_POST_VARS['pid'];
+	$title =  $myts->makeTboxData4Save($HTTP_POST_VARS['title']);
+	if (empty($title)) {
+		redirect_header("index.php", 2, _MD_ERRORTITLE);
+		exit();
+	}
+	if (($HTTP_POST_VARS["imgurl"]) || ($HTTP_POST_VARS["imgurl"]!="")) {
+		$imgurl = $myts->makeTboxData4Save($HTTP_POST_VARS["imgurl"]);
+	}
+	$sql = sprintf("UPDATE %s SET title = '%s', imgurl = '%s', pid = %u WHERE cid = %u", $xoopsDB->prefix("mydownloads_cat"), $title, $imgurl, $sid, $cid);
+	$xoopsDB->query($sql) or $eh->show("0013");
+	redirect_header("index.php",1,_MD_DBUPDATED);
+}
+
+function delCat()
+{
+	global $xoopsDB, $HTTP_GET_VARS, $HTTP_POST_VARS, $eh, $mytree, $xoopsModule;
+	$cid =  isset($HTTP_POST_VARS['cid']) ? intval($HTTP_POST_VARS['cid']) : intval($HTTP_GET_VARS['cid']);
+	$ok =  isset($HTTP_POST_VARS['ok']) ? intval($HTTP_POST_VARS['ok']) : 0;
+	if ($ok == 1) {
+		//get all subcategories under the specified category
+		$arr=$mytree->getAllChildId($cid);
+		$lcount = count($arr);
+		for ($i = 0; $i < $lcount; $i++) {
+			//get all downloads in each subcategory
+			$result=$xoopsDB->query("SELECT lid FROM ".$xoopsDB->prefix("mydownloads_downloads")." WHERE cid=".$arr[$i]."") or $eh->show("0013");
+			//now for each download, delete the text data and vote ata associated with the download
+			while ( list($lid)=$xoopsDB->fetchRow($result) ) {
+				$sql = sprintf("DELETE FROM %s WHERE lid = %u", $xoopsDB->prefix("mydownloads_text"), $lid);
+				$xoopsDB->query($sql) or $eh->show("0013");
+				$sql = sprintf("DELETE FROM %s WHERE lid = %u", $xoopsDB->prefix("mydownloads_votedata"), $lid);
+				$xoopsDB->query($sql) or $eh->show("0013");
+				$sql = sprintf("DELETE FROM %s WHERE lid = %u", $xoopsDB->prefix("mydownloads_downloads"), $lid);
+				$xoopsDB->query($sql) or $eh->show("0013");
+				// delete comments
+				xoops_comment_delete($xoopsModule->getVar('mid'), $lid);
+			}
+
+			//all downloads for each subcategory is deleted, now delete the subcategory data
+			$sql = sprintf("DELETE FROM %s WHERE cid = %u", $xoopsDB->prefix("mydownloads_cat"), $arr[$i]);
+			$xoopsDB->query($sql) or $eh->show("0013");
+		}
+		//all subcategory and associated data are deleted, now delete category data and its associated data
+		$result=$xoopsDB->query("SELECT lid FROM ".$xoopsDB->prefix("mydownloads_downloads")." WHERE cid=".$cid."") or $eh->show("0013");
+		while(list($lid)=$xoopsDB->fetchRow($result)){
+			$sql = sprintf("DELETE FROM %s WHERE lid = %u", $xoopsDB->prefix("mydownloads_downloads"), $lid);
+			$xoopsDB->query($sql) or $eh->show("0013");
+			$sql = sprintf("DELETE FROM %s WHERE lid = %u", $xoopsDB->prefix("mydownloads_text"), $lid);
+			$xoopsDB->query($sql) or $eh->show("0013");
+			// delete comments
+			xoops_comment_delete($xoopsModule->getVar('mid'), $lid);
+			$sql = sprintf("DELETE FROM %s WHERE lid = %u", $xoopsDB->prefix("mydownloads_votedata"), $lid);
+			$xoopsDB->query($sql) or $eh->show("0013");
+		}
+		$sql = sprintf("DELETE FROM %s WHERE cid = %u", $xoopsDB->prefix("mydownloads_cat"), $cid);
+		$xoopsDB->query($sql) or $eh->show("0013");
+		redirect_header("index.php",1,_MD_CATDELETED);
+		exit();
+	} else {
+		xoops_cp_header();
+		echo "<h4>"._MD_DLCONF."</h4>";
+		xoops_confirm(array('op' => 'delCat', 'cid' => $cid, 'ok' => 1), 'index.php', _MD_WARNING);
+		xoops_cp_footer();
+	}
+}
+
+function delNewDownload()
+{
+	global $xoopsDB, $HTTP_GET_VARS, $eh, $xoopsModule;
+	$sql = sprintf("DELETE FROM %s WHERE lid = %u", $xoopsDB->prefix("mydownloads_downloads"), $HTTP_GET_VARS['lid']);
+	$xoopsDB->query($sql) or $eh->show("0013");
+	$sql = sprintf("DELETE FROM %s WHERE lid = %u", $xoopsDB->prefix("mydownloads_text"), $HTTP_GET_VARS['lid']);
+	$xoopsDB->query($sql) or $eh->show("0013");
+	// delete comments
+	xoops_comment_delete($xoopsModule->getVar('mid'), $HTTP_GET_VARS['lid']);
+	redirect_header("index.php",1,_MD_FILEDELETED);
+}
+
+function addCat()
+{
+	global $xoopsDB, $HTTP_POST_VARS, $myts, $eh;
+	$pid = $HTTP_POST_VARS["cid"];
+	$title = $myts->makeTboxData4Save($HTTP_POST_VARS["title"]);
+	if (empty($title)) {
+		redirect_header("index.php", 2, _MD_ERRORTITLE);
+	}
+	if (($HTTP_POST_VARS["imgurl"]) || ($HTTP_POST_VARS["imgurl"]!="")) {
+		$imgurl = $myts->makeTboxData4Save($HTTP_POST_VARS["imgurl"]);
+	}
+	$newid = $xoopsDB->genId($xoopsDB->prefix("mydownloads_cat")."_cid_seq");
+	$sql = sprintf("INSERT INTO %s (cid, pid, title, imgurl) VALUES (%u, %u, '%s', '%s')", $xoopsDB->prefix("mydownloads_cat"), $newid, $pid, $title, $imgurl);
+	$xoopsDB->query($sql) or $eh->show("0013");
+	if ($newid == 0) {
+		$newid = $xoopsDB->getInsertId();
+	}
+	// Notify of new category
+	global $xoopsModule;
+	$tags = array();
+	$tags['CATEGORY_NAME'] = $title;
+	$tags['CATEGORY_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewcat.php?cid=' . $newid;
+	$notification_handler =& xoops_gethandler('notification');
+	$notification_handler->triggerEvent('global', 0, 'new_category', $tags);
+	redirect_header("index.php",1,_MD_NEWCATADDED);
+}
+
+function addDownload()
+{
+	global $xoopsDB, $xoopsUser, $xoopsModule, $HTTP_POST_VARS, $myts, $eh;
+	$url = $myts->makeTboxData4Save(formatURL($HTTP_POST_VARS["url"]));
+	$logourl = $myts->makeTboxData4Save($HTTP_POST_VARS["logourl"]);
+	$title = $myts->makeTboxData4Save($HTTP_POST_VARS["title"]);
+	$homepage = $myts->makeTboxData4Save(formatURL($HTTP_POST_VARS["homepage"]));
+	$version = $myts->makeTboxData4Save($HTTP_POST_VARS["version"]);
+	$size = $myts->makeTboxData4Save($HTTP_POST_VARS["size"]);
+	$platform = $myts->makeTboxData4Save($HTTP_POST_VARS["platform"]);
+	$description = $myts->makeTareaData4Save($HTTP_POST_VARS["description"]);
+	$submitter = $xoopsUser->uid();
+	$result = $xoopsDB->query("SELECT COUNT(*) FROM ".$xoopsDB->prefix("mydownloads_downloads")." WHERE url='$url'");
+	list($numrows) = $xoopsDB->fetchRow($result);
+	$error = 0;
+	$errormsg = "";
+	if ($numrows>0) {
+		$errormsg .= "<h4 style='color: #ff0000'>";
+		$errormsg .= _MD_ERROREXIST."</h4><br />";
+		$error = 1;
+	}
+	// Check if Title exist
+	if ($title=="") {
+		$errormsg .= "<h4 style='color: #ff0000'>";
+		$errormsg .= _MD_ERRORTITLE."</h4><br />";
+		$error =1;
+	}
+	if( empty($size) || !is_numeric($size) ){
+		$size = 0;
+	}
+	// Check if Description exist
+	if ($description=="") {
+		$errormsg .= "<h4 style='color: #ff0000'>";
+		$errormsg .= _MD_ERRORDESC."</h4><br />";
+		$error =1;
+	}
+	if($error == 1) {
+		xoops_cp_header();
+		echo $errormsg;
+		xoops_cp_footer();
+		exit();
+	}
+	if ( !empty($HTTP_POST_VARS['cid']) ) {
+		$cid = $HTTP_POST_VARS['cid'];
+	} else {
+		$cid = 0;
+	}
+	$newid = $xoopsDB->genId($xoopsDB->prefix("mydownloads_downloads")."_lid_seq");
+
+	$sql = sprintf("INSERT INTO %s (lid, cid, title, url, homepage, version, size, platform, logourl, submitter, status, date, hits, rating, votes, comments) VALUES (%u, %u, '%s', '%s', '%s', '%s', %u, '%s', '%s', %u, %u, %u, %u, %u, %u, %u)", $xoopsDB->prefix("mydownloads_downloads"), $newid, $cid, $title, $url, $homepage, $version, $size, $platform, $logourl, $submitter, 1, time(), 0, 0, 0, 0);
+	$xoopsDB->query($sql) or $eh->show("0013");
+	if( $newid == 0 ) {
+		$newid = $xoopsDB->getInsertId();
+	}
+	$sql = sprintf("INSERT INTO %s (lid, description) VALUES (%u, '%s')", $xoopsDB->prefix("mydownloads_text"), $newid, $description);
+	$xoopsDB->query($sql) or $eh->show("0013");
+	$tags = array();
+	$tags['FILE_NAME'] = $title;
+	$tags['FILE_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/singlefile.php?cid=' . $cid . '&amp;lid=' . $newid;
+	$sql = "SELECT title FROM " . $xoopsDB->prefix("mydownloads_cat") . " WHERE cid=" . $cid;
+	$result = $xoopsDB->query($sql);
+	$row = $xoopsDB->fetchArray($result);
+	$tags['CATEGORY_NAME'] = $row['title'];
+	$tags['CATEGORY_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewcat.php?cid=' . $cid;
+	$notification_handler =& xoops_gethandler('notification');
+	$notification_handler->triggerEvent('global', 0, 'new_file', $tags);
+	$notification_handler->triggerEvent('category', $cid, 'new_file', $tags);
+	redirect_header("index.php?op=downloadsConfigMenu",1,_MD_NEWDLADDED);
+}
+
+function approve()
+{
+	global $xoopsConfig, $xoopsDB, $HTTP_POST_VARS, $myts, $eh;
+	$lid = $HTTP_POST_VARS['lid'];
+	$title = $HTTP_POST_VARS['title'];
+	$cid = $HTTP_POST_VARS['cid'];
+	if ( empty($cid) ) {
+		$cid = 0;
+	}
+	$homepage = $HTTP_POST_VARS['homepage'];
+	$version = $HTTP_POST_VARS['version'];
+	$size = $HTTP_POST_VARS['size'];
+	$platform = $HTTP_POST_VARS['platform'];
+	$description = $HTTP_POST_VARS['description'];
+	if (($HTTP_POST_VARS["url"]) || ($HTTP_POST_VARS["url"]!="")) {
+		$url = $myts->makeTboxData4Save($HTTP_POST_VARS["url"]);
+	}
+	$logourl = $myts->makeTboxData4Save($HTTP_POST_VARS["logourl"]);
+	$title = $myts->makeTboxData4Save($title);
+	$homepage = $myts->makeTboxData4Save($homepage);
+	$version = $myts->makeTboxData4Save($HTTP_POST_VARS["version"]);
+	$size = $myts->makeTboxData4Save($HTTP_POST_VARS["size"]);
+	$platform = $myts->makeTboxData4Save($HTTP_POST_VARS["platform"]);
+	$description = $myts->makeTareaData4Save($description);
+	$sql = sprintf("UPDATE %s SET cid = %u, title = '%s', url = '%s', homepage = '%s', version = '%s', size = %u, platform = '%s', logourl = '%s', status = %u, date = %u WHERE lid = %u", $xoopsDB->prefix("mydownloads_downloads"), $cid, $title, $url, $homepage, $version, $size, $platform, $logourl, 1, time(), $lid);
+	$xoopsDB->query($sql) or $eh->show("0013");
+	$sql = sprintf("UPDATE %s SET description = '%s' WHERE lid = %u", $xoopsDB->prefix("mydownloads_text"), $description, $lid);
+	$xoopsDB->query($sql) or $eh->show("0013");
+	global $xoopsModule;
+	$tags = array();
+	$tags['FILE_NAME'] = $title;
+	$tags['FILE_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/singlefile.php?cid=' . $cid . '&amp;lid=' . $lid;
+	$sql = "SELECT title FROM " . $xoopsDB->prefix('mydownloads_cat') . " WHERE cid=" . $cid;
+	$result = $xoopsDB->query($sql);
+	$row = $xoopsDB->fetchArray($result);
+	$tags['CATEGORY_NAME'] = $row['title'];
+	$tags['CATEGORY_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewcat.php?cid=' . $cid;
+	$notification_handler =& xoops_gethandler('notification');
+	$notification_handler->triggerEvent('global', 0, 'new_file', $tags);
+	$notification_handler->triggerEvent('category', $cid, 'new_file', $tags);
+	$notification_handler->triggerEvent('file', $lid, 'approve', $tags);
+	redirect_header("index.php",1,_MD_NEWDLADDED);
+}
+if(!isset($HTTP_POST_VARS['op'])) {
+	$op = isset($HTTP_GET_VARS['op']) ? $HTTP_GET_VARS['op'] : 'main';
+} else {
+	$op = $HTTP_POST_VARS['op'];
+}
+switch ($op) {
+case "delNewDownload":
+	delNewDownload();
+	break;
+case "approve":
+	approve();
+	break;
+case "addCat":
+	addCat();
+	break;
+case "addSubCat":
+	addSubCat();
+	break;
+case "addDownload":
+	addDownload();
+	break;
+case "listBrokenDownloads":
+	listBrokenDownloads();
+	break;
+case "delBrokenDownloads":
+	delBrokenDownloads();
+	break;
+case "ignoreBrokenDownloads":
+	ignoreBrokenDownloads();
+	break;
+case "listModReq":
+	listModReq();
+	break;
+case "changeModReq":
+	changeModReq();
+	break;
+case "ignoreModReq":
+	ignoreModReq();
+	break;
+case "delCat":
+	delCat();
+	break;
+case "modCat":
+	modCat();
+	break;
+case "modCatS":
+	modCatS();
+	break;
+case "modDownload":
+	modDownload();
+	break;
+case "modDownloadS":
+	modDownloadS();
+	break;
+case "delDownload":
+	delDownload();
+	break;
+case "delVote":
+	delVote();
+	break;
+case "downloadsConfigMenu":
+	downloadsConfigMenu();
+	break;
+case "listNewDownloads":
+	listNewDownloads();
+	break;
+case 'main':
+default:
+	mydownloads();
+	break;
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/viewcat.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/viewcat.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/viewcat.php	(revision 405)
@@ -0,0 +1,190 @@
+<?php
+// $Id: viewcat.php,v 1.1 2004/09/09 05:15:10 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+// ------------------------------------------------------------------------- //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+include "header.php";
+include_once XOOPS_ROOT_PATH."/class/xoopstree.php";
+$xoopsOption['template_main'] = 'mydownloads_viewcat.html';
+$myts =& MyTextSanitizer::getInstance();// MyTextSanitizer object
+$mytree = new XoopsTree($xoopsDB->prefix("mydownloads_cat"),"cid","pid");
+
+$cid = intval($HTTP_GET_VARS['cid']);
+include XOOPS_ROOT_PATH."/header.php";
+
+if (isset($HTTP_GET_VARS['show']) && $HTTP_GET_VARS['show']!="") {
+	$show = intval($HTTP_GET_VARS['show']);
+} else {
+	$show = $xoopsModuleConfig['perpage'];
+}
+$min = isset($HTTP_GET_VARS['min']) ? intval($HTTP_GET_VARS['min']) : 0;
+if (!isset($max)) {
+	$max = $min + $show;
+}
+if(isset($HTTP_GET_VARS['orderby'])) {
+	$orderby = convertorderbyin($HTTP_GET_VARS['orderby']);
+} else {
+	$orderby = "title ASC";
+}
+
+
+$pathstring = "<a href='index.php'>"._MD_MAIN."</a>&nbsp;:&nbsp;";
+$pathstring .= $mytree->getNicePathFromId($cid, "title", "viewcat.php?op=");
+$xoopsTpl->assign('category_path', $pathstring);
+$xoopsTpl->assign('category_id', $cid);
+// get child category objects
+$arr=array();
+$arr=$mytree->getFirstChild($cid, "title");
+if ( count($arr) > 0 ) {
+	$scount = 1;
+	foreach($arr as $ele){
+		$sub_arr=array();
+		$sub_arr=$mytree->getFirstChild($ele['cid'], "title");
+		$space = 0;
+		$chcount = 0;
+		$infercategories = "";
+		foreach($sub_arr as $sub_ele){
+			$chtitle=$myts->makeTboxData4Show($sub_ele['title']);
+			if ($chcount>5){
+				$infercategories .= "...";
+				break;
+			}
+			if ($space>0) {
+				$infercategories .= ", ";
+			}
+			$infercategories .= "<a href=\"".XOOPS_URL."/modules/mydownloads/viewcat.php?cid=".$sub_ele['cid']."\">".$chtitle."</a>";
+			$space++;
+			$chcount++;
+		}
+		$xoopsTpl->append('subcategories', array('title' => $myts->makeTboxData4Show($ele['title']), 'id' => $ele['cid'], 'infercategories' => $infercategories, 'totallinks' => getTotalItems($ele['cid'], 1), 'count' => $scount));
+		$scount++;
+	}
+}
+
+if ($xoopsModuleConfig['useshots'] == 1) {
+	$xoopsTpl->assign('shotwidth', $xoopsModuleConfig['shotwidth']);
+	$xoopsTpl->assign('tablewidth', $xoopsModuleConfig['shotwidth'] + 10);
+	$xoopsTpl->assign('show_screenshot', true);
+	$xoopsTpl->assign('lang_noscreenshot', _MD_NOSHOTS);
+}
+
+if (!empty($xoopsUser) && $xoopsUser->isAdmin($xoopsModule->mid())) {
+	$isadmin = true;
+} else {
+	$isadmin = false;
+}
+$fullcountresult=$xoopsDB->query("SELECT COUNT(*) FROM ".$xoopsDB->prefix("mydownloads_downloads")." WHERE cid=$cid AND status>0");
+list($numrows) = $xoopsDB->fetchRow($fullcountresult);
+$page_nav = '';
+if($numrows>0){
+	$xoopsTpl->assign('lang_description', _MD_DESCRIPTIONC);
+	$xoopsTpl->assign('lang_lastupdate', _MD_LASTUPDATEC);
+	$xoopsTpl->assign('lang_hits', _MD_HITSC);
+	$xoopsTpl->assign('lang_ratingc', _MD_RATINGC);
+	$xoopsTpl->assign('lang_email', _MD_EMAILC);
+	$xoopsTpl->assign('lang_ratethissite', _MD_RATETHISFILE);
+	$xoopsTpl->assign('lang_reportbroken', _MD_REPORTBROKEN);
+	$xoopsTpl->assign('lang_tellafriend', _MD_TELLAFRIEND);
+	$xoopsTpl->assign('lang_modify', _MD_MODIFY);
+	$xoopsTpl->assign('lang_version' , _MD_VERSION);
+	$xoopsTpl->assign('lang_subdate' , _MD_SUBMITDATE);
+	$xoopsTpl->assign('lang_dlnow' , _MD_DLNOW);
+	$xoopsTpl->assign('lang_category' , _MD_CATEGORYC);
+	$xoopsTpl->assign('lang_size' , _MD_FILESIZE);
+	$xoopsTpl->assign('lang_platform' , _MD_SUPPORTEDPLAT);
+	$xoopsTpl->assign('lang_homepage' , _MD_HOMEPAGE);
+	$xoopsTpl->assign('lang_comments' , _COMMENTS);
+	$xoopsTpl->assign('show_links', true);
+	$q = "SELECT d.lid, d.title, d.url, d.homepage, d.version, d.size, d.platform, d.logourl, d.status, d.date, d.hits, d.rating, d.votes, d.comments, t.description FROM ".$xoopsDB->prefix("mydownloads_downloads")." d, ".$xoopsDB->prefix("mydownloads_text")." t WHERE cid=".$cid." AND d.status>0 AND d.lid=t.lid ORDER BY ".$orderby."";
+	$result = $xoopsDB->query($q,$show,$min);
+
+//if 2 or more items in result, show the sort menu
+	if($numrows>1){
+		$xoopsTpl->assign('show_nav', true);
+		$orderbyTrans = convertorderbytrans($orderby);
+		$xoopsTpl->assign('lang_sortby', _MD_SORTBY);
+		$xoopsTpl->assign('lang_title', _MD_TITLE);
+		$xoopsTpl->assign('lang_date', _MD_DATE);
+		$xoopsTpl->assign('lang_rating', _MD_RATING);
+		$xoopsTpl->assign('lang_popularity', _MD_POPULARITY);
+		$xoopsTpl->assign('lang_cursortedby', sprintf(_MD_CURSORTBY, convertorderbytrans($orderby)));
+	}
+	while(list($lid, $dtitle, $url, $homepage, $version, $size, $platform, $logourl, $status, $time, $hits, $rating, $votes, $comments, $description)=$xoopsDB->fetchRow($result)) {
+		$path = $mytree->getPathFromId($cid, "title");
+		$path = substr($path, 1);
+		$path = str_replace("/"," <img src='".XOOPS_URL."/modules/mydownloads/images/arrow.gif' board='0' alt=''> ",$path);
+		$rating = number_format($rating, 2);
+		$dtitle = $myts->makeTboxData4Show($dtitle);
+		$url = $myts->makeTboxData4Show($url);
+		$homepage = $myts->makeTboxData4Show($homepage);
+		$version = $myts->makeTboxData4Show($version);
+		$size = PrettySize($myts->makeTboxData4Show($size));
+		$platform = $myts->makeTboxData4Show($platform);
+		$logourl = $myts->makeTboxData4Show($logourl);
+		$datetime = formatTimestamp($time,"s");
+		$description = $myts->makeTareaData4Show($description,0); //no html
+		$new = newdownloadgraphic($time, $status);
+		$pop = popgraphic($hits);
+		if ($isadmin) {
+			$adminlink = '<a href="'.XOOPS_URL.'/modules/mydownloads/admin/index.php?lid='.$lid.'&amp;fct=mydownloads&amp;op=modDownload"><img src="'.XOOPS_URL.'/modules/mydownloads/images/editicon.gif" border="0" alt="'._MD_EDITTHISDL.'" /></a>';
+		} else {
+			$adminlink = '';
+		}
+		if ($votes == 1) {
+			$votestring = _MD_ONEVOTE;
+		} else {
+			$votestring = sprintf(_MD_NUMVOTES,$votes);
+		}
+		$xoopsTpl->append('file', array('id' => $lid, 'cid' => $cid, 'rating' => $rating,'title' => $dtitle.$new.$pop,'logourl' => $logourl,'updated' => $datetime,'description' => $description,'adminlink' => $adminlink,'hits' => $hits,'votes' => $votestring, 'comments' => $comments, 'platform' => $platform,'size'  => $size,'homepage' => $homepage,'version'  => $version,'category'  => $path,'lang_dltimes' => sprintf(_MD_DLTIMES,$hits),'mail_subject' => rawurlencode(sprintf(_MD_INTFILEFOUND,$xoopsConfig['sitename'])),'mail_body' => rawurlencode(sprintf(_MD_INTFILEFOUND,$xoopsConfig['sitename']).':  '.XOOPS_URL.'/modules/mydownloads/singlefile.php?cid='.$cid.'&amp;lid='.$lid)));
+	}
+	$orderby = convertorderbyout($orderby);
+//Calculates how many pages exist.  Which page one should be on, etc...
+	$downpages = ceil($numrows / $show);
+//Page Numbering
+	if ($downpages!=1 && $downpages!=0) {
+		$prev = $min - $show;
+		if ($prev>=0) {
+			$page_nav .= "<a href='viewcat.php?cid=$cid&amp;min=$prev&amp;orderby=$orderby&amp;show=$show'><b><u>&laquo</u></b></a>&nbsp;";
+		}
+		$counter = 1;
+		$currentpage = ($max / $show);
+		while ( $counter<=$downpages ) {
+			$mintemp = ($show * $counter) - $show;
+			if ($counter == $currentpage) {
+			$page_nav .= "<b>($counter)</b>&nbsp;";
+			} else {
+				$page_nav .= "<a href='viewcat.php?cid=$cid&amp;min=$mintemp&amp;orderby=$orderby&amp;show=$show'>$counter</a>&nbsp;";
+			}
+				$counter++;
+		}
+		if ( $numrows>$max ) {
+			$page_nav .= "<a href='viewcat.php?cid=$cid&amp;min=$max&amp;orderby=$orderby&amp;show=$show'>";
+				$page_nav .= "<b><u>&raquo;</u></b></a>";
+		}
+	}
+}
+$xoopsTpl->assign('page_nav', $page_nav);
+include XOOPS_ROOT_PATH."/modules/mydownloads/footer.php";
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/submit.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/submit.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/submit.php	(revision 405)
@@ -0,0 +1,212 @@
+<?php
+// $Id: submit.php,v 1.1.1 2005/07/17 12:52:12 yoshis Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+// ------------------------------------------------------------------------- //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+include "header.php";
+include_once XOOPS_ROOT_PATH."/class/xoopstree.php";
+include_once XOOPS_ROOT_PATH."/class/module.errorhandler.php";
+include_once XOOPS_ROOT_PATH."/include/xoopscodes.php";
+include "fileup.ini.php";
+$myts =& MyTextSanitizer::getInstance(); // MyTextSanitizer object
+$eh = new ErrorHandler; //ErrorHandler object
+$mytree = new XoopsTree($xoopsDB->prefix("mydownloads_cat"),"cid","pid");
+
+if (empty($xoopsUser) && !$xoopsModuleConfig['anonpost']) {
+	redirect_header(XOOPS_URL."/user.php",2,_MD_MUSTREGFIRST);
+	exit();
+}
+
+if (!empty($HTTP_POST_VARS['submit'])) {
+
+	$submitter = !empty($xoopsUser) ? $xoopsUser->getVar('uid') : 0;
+
+	// Check if Title exist
+	if ($HTTP_POST_VARS["title"]=="") {
+		$eh->show("1001");
+	}
+	// Check if URL exist
+	if (($HTTP_POST_VARS["url"]) || ($HTTP_POST_VARS["url"]!="")) {
+		$url = $HTTP_POST_VARS["url"];
+	}
+	// Add start by yoshis @ bluemooninc.biz
+    $upfile      = $_FILES['upfile'];				//upload file object 
+    $upfile_tmp  = $_FILES['upfile']['tmp_name'];   //tmp file name 
+    $upfile_name = $_FILES['upfile']['name'];    	//Local File Name 
+    $upfile_size = $_FILES['upfile']['size'];       //File Size
+    $upfile_type = $_FILES['upfile']['type'];       //File MIME Content-Type
+	//if ($upfile_tmp != "" && ( is_object($xoopsUser) || GUEST_UPLOAD==1) ){
+	if ($upfile_tmp){
+		$deny=0; 
+		if (eregi($subtype, $upfile_type)){
+			if (eregi($imgtype, $upfile_type)){
+				$size = getimagesize($upfile_tmp);
+				if ( !$size || !strcmp($size['type'],$upfile_type) ) $deny=1;
+			}
+		} else {
+			$deny=1;
+		}
+		$ext = strtolower(end(explode(".",$upfile_name))); 
+		if (eregi($viri, $ext)) $deny = 1;
+		if ($deny==0) {
+			$upfile_localname = cnv_mbstr($upfile_name);		// convert for mbstrings
+			$upfile_url=XOOPS_URL.UPLOADS.rawurlencode($upfile_localname);	// XOOPS_UPLOAD_URL.
+    	    move_uploaded_file($upfile_tmp,XOOPS_ROOT_PATH.UPLOADS.$upfile_localname);
+			$url = $upfile_url;
+		} else {
+			$url = "";
+		}
+    }
+	// Add end
+	if ($url=="") {
+		$eh->show("1016");
+	}
+	// Check if HomePage exist
+	/*if ($HTTP_POST_VARS["homepage"]=="") {
+		$eh->show("1017");
+	}*/
+	// Check if Description exist
+	if ($HTTP_POST_VARS['message']=="") {
+		$eh->show("1008");
+	}
+
+	$notify = !empty($HTTP_POST_VARS['notify']) ? 1 : 0;
+
+	if ( !empty($HTTP_POST_VARS['cid']) ) {
+		$cid = intval($HTTP_POST_VARS['cid']);
+	} else {
+		$cid = 0;
+	}
+	$url = $myts->makeTboxData4Save(formatURL($url));
+	$title = $myts->makeTboxData4Save($HTTP_POST_VARS["title"]);
+	$homepage = $myts->makeTboxData4Save($HTTP_POST_VARS["homepage"]);
+	$version = $myts->makeTboxData4Save($HTTP_POST_VARS["version"]);
+	$size = intval($HTTP_POST_VARS["size"]);
+	if ($upfile_size>0) $size = $upfile_size; // By Bluemooninc.biz
+	$platform = $myts->makeTboxData4Save($HTTP_POST_VARS["platform"]);
+	$description = $myts->makeTareaData4Save($HTTP_POST_VARS["message"]);
+	$date = time();
+	$newid = $xoopsDB->genId($xoopsDB->prefix("mydownloads_downloads")."_lid_seq");
+
+	if ( $xoopsModuleConfig['autoapprove'] == 1 ) {
+		$status = $xoopsModuleConfig['autoapprove'];
+	} else {
+		$status = 0;
+	}
+	$sql = sprintf("INSERT INTO %s (lid, cid, title, url, homepage, version, size, platform, logourl, submitter, status, date, hits, rating, votes, comments) VALUES (%u, %u, '%s', '%s', '%s', '%s', %u, '%s', '%s', %u, %u, %u, %u, %u, %u, %u)", $xoopsDB->prefix("mydownloads_downloads"), $newid, $cid, $title, $url, $homepage, $version, $size, $platform, '', $submitter, $status, $date, 0, 0, 0, 0);
+	$xoopsDB->query($sql) or $eh->show("0013");
+	if($newid == 0){
+		$newid = $xoopsDB->getInsertId();
+	}
+	$sql = sprintf("INSERT INTO %s (lid, description) VALUES (%u, '%s')", $xoopsDB->prefix("mydownloads_text"), $newid, $description);
+	$xoopsDB->query($sql) or $eh->show("0013");
+	// Notify of new link (anywhere) and new link in category
+	$notification_handler =& xoops_gethandler('notification');
+	$tags = array();
+	$tags['FILE_NAME'] = $title;
+	$tags['FILE_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/singlefile.php?cid=' . $cid . '&lid=' . $newid;
+	$sql = "SELECT title FROM " . $xoopsDB->prefix("mydownloads_cat") . " WHERE cid=" . $cid;
+	$result = $xoopsDB->query($sql);
+	$row = $xoopsDB->fetchArray($result);
+	$tags['CATEGORY_NAME'] = $row['title'];
+	$tags['CATEGORY_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewcat.php?cid=' . $cid;
+	if ( $xoopsModuleConfig['autoapprove'] == 1 ) {
+		$notification_handler->triggerEvent('global', 0, 'new_file', $tags);
+		$notification_handler->triggerEvent('category', $cid, 'new_file', $tags);
+		redirect_header("index.php",2,_MD_RECEIVED."<br />"._MD_ISAPPROVED."");
+	}else{
+		$tags['WAITINGFILES_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/admin/index.php?op=listNewDownloads';
+		$notification_handler->triggerEvent('global', 0, 'file_submit', $tags);
+		$notification_handler->triggerEvent('category', $cid, 'file_submit', $tags);
+		if ($notify) {
+			include_once XOOPS_ROOT_PATH . '/include/notification_constants.php';
+			$notification_handler->subscribe('file', $newid, 'approve', XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE);
+		}
+		redirect_header("index.php",2,_MD_RECEIVED);
+	}
+	exit();
+
+} else {
+
+	$xoopsOption['template_main'] = 'mydownloads_submit.html';
+	include XOOPS_ROOT_PATH."/header.php";
+	ob_start();
+	xoopsCodeTarea("message",37,8);
+	$xoopsTpl->assign('xoops_codes', ob_get_contents());
+	ob_end_clean();
+	ob_start();
+	xoopsSmilies("message");
+	$xoopsTpl->assign('xoops_smilies', ob_get_contents());
+	ob_end_clean();
+	$xoopsTpl->assign('notify_show', !empty($xoopsUser) && !$xoopsModuleConfig['autoapprove'] ? 1 : 0);
+	$xoopsTpl->assign('lang_submitonce', _MD_SUBMITONCE);
+	$xoopsTpl->assign('lang_submitcath', _MD_SUBMITCATHEAD);
+	$xoopsTpl->assign('lang_allpending', _MD_ALLPENDING);
+	$xoopsTpl->assign('lang_dontabuse', _MD_DONTABUSE);
+	$xoopsTpl->assign('lang_wetakeshot', _MD_TAKEDAYS);
+	$xoopsTpl->assign('lang_category', _MD_CATEGORYC);
+	$xoopsTpl->assign('lang_sitetitle', _MD_FILETITLE);
+	$xoopsTpl->assign('lang_siteurl', _MD_DLURL);
+	$xoopsTpl->assign('lang_category', _MD_CATEGORYC);
+	$xoopsTpl->assign('lang_homepage', _MD_HOMEPAGEC);
+	$xoopsTpl->assign('lang_version', _MD_VERSIONC);
+	$xoopsTpl->assign('lang_size', _MD_FILESIZEC);
+	$xoopsTpl->assign('lang_bytes', _MD_BYTES);
+	$xoopsTpl->assign('lang_platform', _MD_PLATFORMC);
+	// Add Start by bluemooninc.biz
+	$xoopsTpl->assign('lang_upload', _MD_UPLOAD);
+	$xoopsTpl->assign('maxbyte',$maxfilesize);
+	if ($maxfilesize>=1000000){
+		$maxbyte_str=sprintf("%d M",$maxfilesize/1000000);
+	} elseif ($maxfilesize>=1000){
+		$maxbyte_str=sprintf("%d K",$maxfilesize/1000);
+	} else {
+		$maxbyte_str=sprintf("%d ",$maxfilesize);
+	}
+	$xoopsTpl->assign('maxbyte_str',$maxbyte_str);
+	// Add End
+	$xoopsTpl->assign('lang_options', _MD_OPTIONS);
+	$xoopsTpl->assign('lang_notify', _MD_NOTIFYAPPROVE);
+	$xoopsTpl->assign('lang_description', _MD_DESCRIPTION);
+	$xoopsTpl->assign('lang_submit', _SUBMIT);
+	$xoopsTpl->assign('lang_cancel', _CANCEL);
+	ob_start();
+	$mytree->makeMySelBox("title", "title",0,1);
+	$selbox = ob_get_contents();
+	ob_end_clean();
+	$xoopsTpl->assign('category_selbox', $selbox);
+	include XOOPS_ROOT_PATH.'/footer.php';
+
+}
+// Support for Multi-byte filename.
+//   By bluemooninc.biz  2004/4/11
+function cnv_mbstr($str) {
+	if (extension_loaded('mbstring')){
+		return  mb_convert_encoding($str,SAVE_AS_MBSTR,"auto");
+	} else {
+		return $str;
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/index.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/index.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/index.php	(revision 405)
@@ -0,0 +1,133 @@
+<?php
+// $Id: index.php,v 1.1 2004/09/09 05:15:10 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+// ------------------------------------------------------------------------- //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+include "header.php";
+include_once XOOPS_ROOT_PATH."/class/xoopstree.php";
+
+$myts =& MyTextSanitizer::getInstance(); // MyTextSanitizer object
+$mytree = new XoopsTree($xoopsDB->prefix("mydownloads_cat"),"cid","pid");
+$xoopsOption['template_main'] = 'mydownloads_index.html';
+include XOOPS_ROOT_PATH."/header.php";
+
+$sql = "SELECT cid, title, imgurl FROM ".$xoopsDB->prefix("mydownloads_cat")." WHERE pid = 0 ORDER BY title";
+$result=$xoopsDB->query($sql);
+
+$count = 1;
+while($myrow = $xoopsDB->fetchArray($result)) {
+	$title = $myts->makeTboxData4Show($myrow['title']);
+	if ($myrow['imgurl'] && $myrow['imgurl'] != "http://"){
+		$imgurl = $myts->makeTboxData4Edit($myrow['imgurl']);
+	} else {
+		$imgurl = '';
+	}
+	$totaldownload = getTotalItems($myrow['cid'], 1);
+
+	// get child category objects
+	$arr=array();
+	$arr=$mytree->getFirstChild($myrow['cid'], "title");
+	$space = 0;
+	$chcount = 0;
+	$subcategories = "";
+	foreach($arr as $ele){
+		$chtitle=$myts->makeTboxData4Show($ele['title']);
+		if ($chcount>5){
+			$subcategories .= "...";
+			break;
+		}
+		if ($space>0) {
+			$subcategories .= ", ";
+		}
+		$subcategories .= "<a href=\"".XOOPS_URL."/modules/mydownloads/viewcat.php?cid=".$ele['cid']."\">".$chtitle."</a>";
+		$space++;
+		$chcount++;
+	}	
+	$xoopsTpl->append('categories', array('image' => $imgurl, 'id' => $myrow['cid'], 'title' => $myts->makeTboxData4Show($myrow['title']), 'subcategories' => $subcategories, 'totaldownloads' => $totaldownload, 'count' => $count));
+	$count++;	
+}
+list($numrows)=$xoopsDB->fetchRow($xoopsDB->query("SELECT COUNT(*) FROM ".$xoopsDB->prefix("mydownloads_downloads")." WHERE status>0"));
+$xoopsTpl->assign('lang_thereare', sprintf(_MD_THEREARE,$numrows));
+if ($xoopsModuleConfig['useshots'] == 1) {
+	$xoopsTpl->assign('shotwidth', $xoopsModuleConfig['shotwidth']);
+	$xoopsTpl->assign('tablewidth', $xoopsModuleConfig['shotwidth'] + 10);
+	$xoopsTpl->assign('show_screenshot', true);
+	$xoopsTpl->assign('lang_noscreenshot', _MD_NOSHOTS);
+}
+if ($xoopsUser && $xoopsUser->isAdmin($xoopsModule->mid())) {
+	$isadmin = true;
+} else {
+	$isadmin = false;
+}
+$xoopsTpl->assign('lang_description', _MD_DESCRIPTIONC);
+$xoopsTpl->assign('lang_lastupdate', _MD_LASTUPDATEC);
+$xoopsTpl->assign('lang_hits', _MD_HITSC);
+$xoopsTpl->assign('lang_ratingc', _MD_RATINGC);
+$xoopsTpl->assign('lang_email', _MD_EMAILC);
+$xoopsTpl->assign('lang_ratethissite', _MD_RATETHISFILE);
+$xoopsTpl->assign('lang_reportbroken', _MD_REPORTBROKEN);
+$xoopsTpl->assign('lang_tellafriend', _MD_TELLAFRIEND);
+$xoopsTpl->assign('lang_modify', _MD_MODIFY);
+$xoopsTpl->assign('lang_version' , _MD_VERSION);
+$xoopsTpl->assign('lang_subdate' , _MD_SUBMITDATE);
+$xoopsTpl->assign('lang_dlnow' , _MD_DLNOW);
+$xoopsTpl->assign('lang_category' , _MD_CATEGORYC);
+$xoopsTpl->assign('lang_size' , _MD_FILESIZE);
+$xoopsTpl->assign('lang_platform' , _MD_SUPPORTEDPLAT);
+$xoopsTpl->assign('lang_homepage' , _MD_HOMEPAGE);
+$xoopsTpl->assign('lang_latestlistings' , _MD_LATESTLIST);
+$xoopsTpl->assign('lang_comments' , _COMMENTS);
+$result = $xoopsDB->query("SELECT d.lid, d.cid, d.title, d.url, d.homepage, d.version, d.size, d.platform, d.logourl, d.status, d.date, d.hits, d.rating, d.votes, d.comments, t.description FROM ".$xoopsDB->prefix("mydownloads_downloads")." d, ".$xoopsDB->prefix("mydownloads_text")." t WHERE d.status>0 AND d.lid=t.lid ORDER BY date DESC", $xoopsModuleConfig['newdownloads'], 0);
+while(list($lid, $cid, $dtitle, $url, $homepage, $version, $size, $platform, $logourl, $status, $time, $hits, $rating, $votes, $comments, $description)=$xoopsDB->fetchRow($result)) {
+	$path = $mytree->getPathFromId($cid, "title");
+	$path = substr($path, 1);
+	$path = str_replace("/"," <img src='".XOOPS_URL."/modules/mydownloads/images/arrow.gif' board='0' alt=''> ",$path);
+	$rating = number_format($rating, 2);
+	$dtitle = $myts->makeTboxData4Show($dtitle);
+	$url = $myts->makeTboxData4Show($url);
+	$homepage = $myts->makeTboxData4Show($homepage);
+	$version = $myts->makeTboxData4Show($version);
+	$size = PrettySize($myts->makeTboxData4Show($size));
+	$platform = $myts->makeTboxData4Show($platform);
+	$logourl = $myts->makeTboxData4Show($logourl);
+	$datetime = formatTimestamp($time,"s");
+	$description = $myts->makeTareaData4Show($description,0); //no html
+	$new = newdownloadgraphic($time, $status);
+	$pop = popgraphic($hits);
+	if ($isadmin) {
+		$adminlink = '<a href="'.XOOPS_URL.'/modules/mydownloads/admin/index.php?lid='.$lid.'&fct=mydownloads&op=modDownload"><img src="'.XOOPS_URL.'/modules/mydownloads/images/editicon.gif" border="0" alt="'._MD_EDITTHISDL.'" /></a>';
+	} else {
+		$adminlink = '';
+	}
+	if ($votes == 1) {
+		$votestring = _MD_ONEVOTE;
+	} else {
+		$votestring = sprintf(_MD_NUMVOTES,$votes);
+	}
+		$xoopsTpl->append('file', array('id' => $lid,'cid'=>$cid,'rating' => $rating,'title' => $dtitle.$new.$pop,'logourl' => $logourl,'updated' => $datetime,'description' => $description,'adminlink' => $adminlink,'hits' => $hits,'votes' => $votestring, 'comments' => $comments, 'platform' => $platform,'size'  => $size,'homepage' => $homepage,'version'  => $version,'category'  => $path,'lang_dltimes' => sprintf(_MD_DLTIMES,$hits),'mail_subject' => rawurlencode(sprintf(_MD_INTFILEFOUND,$xoopsConfig['sitename'])),'mail_body' => rawurlencode(sprintf(_MD_INTFILEFOUND,$xoopsConfig['sitename']).':  '.XOOPS_URL.'/modules/mydownloads/singlefile.php?cid='.$cid.'&amp;lid='.$lid)));
+}
+
+include XOOPS_ROOT_PATH."/modules/mydownloads/footer.php";
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/comment_post.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/comment_post.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/comment_post.php	(revision 405)
@@ -0,0 +1,29 @@
+<?php
+// $Id: comment_post.php,v 1.1 2004/09/09 05:15:10 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+include '../../mainfile.php';
+include XOOPS_ROOT_PATH.'/include/comment_post.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/comment_edit.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/comment_edit.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/comment_edit.php	(revision 405)
@@ -0,0 +1,29 @@
+<?php
+// $Id: comment_edit.php,v 1.1 2004/09/09 05:15:10 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+include '../../mainfile.php';
+include XOOPS_ROOT_PATH.'/include/comment_edit.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/templates/mydownloads_topten.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/templates/mydownloads_topten.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/templates/mydownloads_topten.html	(revision 405)
@@ -0,0 +1,41 @@
+<br /><br />
+
+<p align="center">
+    <a href="<{$xoops_url}>/modules/mydownloads/index.php"><img src="<{$xoops_url}>/modules/mydownloads/images/logo-en.gif" alt="" /></a>
+</p>
+
+<br /><br /><br />
+<!-- Start ranking loop -->
+<{foreach item=ranking from=$rankings}>
+<table class="outer">
+  <tr>
+    <th colspan="6" align="center"><{$ranking.title}> (<{$lang_sortby}>)</th>
+  </tr>
+  <tr>
+    <td width='7%' class="head"><{$lang_rank}></td>
+    <td width='28%' class="head"><{$lang_title}></td>
+    <td width='40%' class="head"><{$lang_category}></td>
+    <td width='8%' class="head" align='center'><{$lang_hits}></td>
+    <td width='9%' class="head" align='center'><{$lang_rating}></td>
+    <td width='8%' class="head" align='right'><{$lang_vote}></td>
+  </tr>
+
+  <!-- Start files loop -->
+  <{foreach item=file from=$ranking.file}>
+
+  <tr>
+    <td class="even"><{$file.rank}></td>
+    <td class="odd"><a href='singlefile.php?cid=<{$file.cid}>&amp;lid=<{$file.id}>'><{$file.title}></a></td>
+    <td class="even"><{$file.category}></td>
+    <td class="odd" align='center'><{$file.hits}></td>
+    <td class="even" align='center'><{$file.rating}></td>
+    <td align='right'><{$file.votes}></td>
+  </tr>
+
+  <{/foreach}>
+  <!-- End links loop-->
+
+</table>
+<br />
+<{/foreach}>
+<!-- End ranking loop -->
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/templates/blocks/mydownloads_block_new.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/templates/blocks/mydownloads_block_new.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/templates/blocks/mydownloads_block_new.html	(revision 405)
@@ -0,0 +1,5 @@
+<ul>
+  <{foreach item=download from=$block.downloads}>
+    <li><a href="<{$xoops_url}>/modules/mydownloads/singlefile.php?cid=<{$download.cid}>&amp;lid=<{$download.id}>"><{$download.title}></a> (<{$download.date}>)</li>
+  <{/foreach}>
+</ul>
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/templates/blocks/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/templates/blocks/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/templates/blocks/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/templates/blocks/mydownloads_block_top.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/templates/blocks/mydownloads_block_top.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/templates/blocks/mydownloads_block_top.html	(revision 405)
@@ -0,0 +1,5 @@
+<ul>
+  <{foreach item=download from=$block.downloads}>
+    <li><a href="<{$xoops_url}>/modules/mydownloads/singlefile.php?cid=<{$download.cid}>&amp;lid=<{$download.id}>"><{$download.title}></a> (<{$download.hits}>)</li>
+  <{/foreach}>
+</ul>
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/templates/mydownloads_ratefile.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/templates/mydownloads_ratefile.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/templates/mydownloads_ratefile.html	(revision 405)
@@ -0,0 +1,32 @@
+<br /><br />
+
+<p align="center">
+    <a href="<{$xoops_url}>/modules/mydownloads/index.php"><img src="<{$xoops_url}>/modules/mydownloads/images/logo-en.gif" alt="" /></a>
+</p>
+
+<br /><br /><br />
+
+<hr size=1 noshade>
+<table border=0 cellpadding=1 cellspacing=0 width="80%" align="center">
+  <tr>
+    <td>
+      <h4><{$file.title}></h4>
+      <ul>
+             <li><{$lang_voteonce}>
+             <li><{$lang_ratingscale}>
+             <li><{$lang_beobjective}>
+             <li><{$lang_donotvote}>
+      </ul>
+    </td>
+  </tr>
+  <tr>
+    <td align="center">
+      <form method="post" action="ratefile.php">
+        <input type="hidden" name="lid" value="<{$file.id}>">
+        <input type="hidden" name="cid" value="<{$file.cid}>">
+             <select name="rating"><option>--</option><option>10</option><option>9</option><option>8</option><option>7</option><option>6</option><option>5</option><option>4</option><option>3</option><option>2</option><option>1</option></select>&nbsp;&nbsp;
+        <input type="submit" name="submit" value="<{$lang_rateit}>" /> <input type=button value="<{$lang_cancel}>" onclick="location='<{$xoops_url}>/modules/mydownloads/singlefile.php?cid=<{$file.cid}>&amp;lid=<{$file.id}>'" />
+      </form>
+    </td>
+  </tr>
+</table></div>
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/templates/mydownloads_modfile.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/templates/mydownloads_modfile.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/templates/mydownloads_modfile.html	(revision 405)
@@ -0,0 +1,54 @@
+<br /><br />
+
+<p align="center">
+    <a href="<{$xoops_url}>/modules/mydownloads/index.php"><img src="<{$xoops_url}>/modules/mydownloads/images/logo-en.gif" alt="" /></a>
+</p>
+
+<br /><br /><br />
+<h4><{$lang_requestmod}></h4>
+<form action="modfile.php" method="post">
+<table width="80%">
+  <tr>
+    <td align="right"><{$lang_fileid}></td>
+    <td><b><{$file.id}></b></td>
+  </tr>
+  <tr>
+    <td align="right"><{$lang_sitetitle}></td>
+    <td><input type="text" name="title" size="50" maxlength="100" value="<{$file.title}>"></td>
+  </tr>
+  <tr>
+    <td align="right"><{$lang_siteurl}></td>
+    <td><input type="text" name="url" size="50" maxlength="100" value="<{$file.url}>"></td>
+  </tr>
+  <tr>
+    <td align="right"><{$lang_category}></td>
+    <td><{$category_selbox}></td>
+  </tr>
+  <tr>
+    <td></td><td></td>
+  </tr>
+  <tr>
+    <td align="right"><{$lang_homepage}></td>
+    <td><input type="text" name="homepage" size="50" maxlength="100" value="<{$file.homepage}>"></td>
+  </tr>
+  <tr>
+    <td align="right"><{$lang_version}></td>
+    <td><input type="text" name="version" size="10" maxlength="20" value="<{$file.version}>"></td>
+  </tr>
+  <tr>
+    <td align="right"><{$lang_size}></td>
+    <td><input type="text" name="size" size="10" maxlength="20" value="<{$file.size}>"> <{$lang_bytes}></td>
+  </tr>
+  <tr>
+    <td align="right"><{$lang_platform}></td>
+    <td><input type="text" name="platform" size="50" maxlength="50" value="<{$file.plataform}>"></td>
+  </tr>
+  <tr>
+    <td align="right" valign="top"><{$lang_description}></td>
+    <td><textarea name=description cols=60 rows=5><{$file.description}></textarea></td>
+  </tr>
+  <tr>
+    <td colspan="2" align="center"><br /><input type="hidden" name="logourl" value="<{$file.logourl}>"></input><input type="hidden" name="lid" value="<{$file.id}>"></input><input type="submit" name="submit" value="<{$lang_sendrequest}>"></input>&nbsp;<input type=button value="<{$lang_cancel}>" onclick="javascript:history.go(-1)"></input></td>
+  </tr>
+</table>
+</form>
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/templates/mydownloads_brokenfile.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/templates/mydownloads_brokenfile.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/templates/mydownloads_brokenfile.html	(revision 405)
@@ -0,0 +1,15 @@
+<br /><br />
+
+<p align="center">
+    <a href="<{$xoops_url}>/modules/mydownloads/index.php"><img src="<{$xoops_url}>/modules/mydownloads/images/logo-en.gif" alt="" /></a>
+</p>
+<br /><br /><br />
+
+<div align='center'>
+  <h4><{$lang_reportbroken}></h4>
+  <form action="brokenfile.php" method="POST">
+    <input type="hidden" name="lid" value="<{$file_id}>" /><{$lang_thanksforhelp}><br /><{$lang_forsecurity}><br /><br /><input type="submit" name="submit" value="<{$lang_reportbroken}>" />&nbsp;<input type=button value="<{$lang_cancel}>" onclick="javascript:history.go(-1)" />
+  </form>
+</div>
+
+<br />
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/templates/mydownloads_singlefile.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/templates/mydownloads_singlefile.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/templates/mydownloads_singlefile.html	(revision 405)
@@ -0,0 +1,40 @@
+<br /><br />
+
+<p align="center">
+    <a href="<{$xoops_url}>/modules/mydownloads/index.php"><img src="<{$xoops_url}>/modules/mydownloads/images/logo-en.gif" alt="" /></a>
+</p>
+
+<br /><br /><br />
+<div>
+<table width="97%" cellspacing="2" cellpadding="2" border="0">
+  <tr>
+    <td class="newstitle"><{$category_path}></td>
+  </tr>
+</table>
+</div>
+<br />
+<table width="100%" cellspacing="0" cellpadding="10" border="0">
+  <tr>
+    <td width="100%" align="center" valign="top">
+    <{include file="db:mydownloads_download.html" down=$file}>   
+    </td>
+  </tr>
+</table>
+
+<div style="text-align: center; padding: 3px; margin:3px;">
+  <{$commentsnav}>
+  <{$lang_notice}>
+</div>
+
+<div style="margin:3px; padding: 3px;">
+<!-- start comments loop -->
+<{if $comment_mode == "flat"}>
+  <{include file="db:system_comments_flat.html"}>
+<{elseif $comment_mode == "thread"}>
+  <{include file="db:system_comments_thread.html"}>
+<{elseif $comment_mode == "nest"}>
+  <{include file="db:system_comments_nest.html"}>
+<{/if}>
+<!-- end comments loop -->
+</div>
+<{include file="db:system_notification_select.html"}>
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/templates/mydownloads_viewcat.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/templates/mydownloads_viewcat.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/templates/mydownloads_viewcat.html	(revision 405)
@@ -0,0 +1,62 @@
+<br /><br />
+
+<p align="center">
+    <a href="<{$xoops_url}>/modules/mydownloads/index.php"><img src="<{$xoops_url}>/modules/mydownloads/images/logo-en.gif" alt="" /></a>
+</p>
+
+<br /><br /><br />
+<div>
+<table width="97%" cellspacing="0" cellpadding="0" border="0">
+  <tr>
+    <td align="left">
+      <table width="100%" cellspacing="1" cellpadding="2" border="0">
+        <tr>
+          <td class="newstitle" height="18"><b><{$category_path}></b></td>
+        </tr>
+      </table>
+    </td>
+  </tr>
+  <tr>
+    <td align="center">
+      <table width="90%">
+        <tr><br />
+          <{foreach item=subcat from=$subcategories}>
+            <td align="left"><b><a href="viewcat.php?cid=<{$subcat.id}>"><{$subcat.title}></a></b>&nbsp;(<{$subcat.totallinks}>)<br /><font class="subcategories"><{$subcat.infercategories}></font></td>
+            <{if $subcat.count is div by 4}>
+            </tr><tr>
+            <{/if}>
+          <{/foreach}>
+        </tr>
+      </table>
+      <br />
+      <hr />
+
+      <{if $show_links == true}>
+
+      <{if $show_nav == true}>
+      <div><{$lang_sortby}>&nbsp;&nbsp;<{$lang_title}> (<a href="viewcat.php?cid=<{$category_id}>&amp;orderby=titleA"><img src="images/up.gif" border="0" align="middle" alt="" /></a><a href="viewcat.php?cid=<{$category_id}>&amp;orderby=titleD"><img src="images/down.gif" border="0" align="middle" alt="" /></a>)&nbsp;<{$lang_date}> (<a href="viewcat.php?cid=<{$category_id}>&amp;orderby=dateA"><img src="images/up.gif" border="0" align="middle" alt="" /></a><a href="viewcat.php?cid=<{$category_id}>&amp;orderby=dateD"><img src="images/down.gif" border="0" align="middle" alt="" /></a>)&nbsp;<{$lang_rating}> (<a href="viewcat.php?cid=<{$category_id}>&amp;orderby=ratingA"><img src="images/up.gif" border="0" align="middle" alt="" /></a><a href="viewcat.php?cid=<{$category_id}>&amp;orderby=ratingD"><img src="images/down.gif" border="0" align="middle" alt="" /></a>)&nbsp;<{$lang_popularity}> (<a href="viewcat.php?cid=<{$category_id}>&amp;orderby=hitsA"><img src="images/up.gif" border="0" align="middle" alt="" /></a><a href="viewcat.php?cid=<{$category_id}>&amp;orderby=hitsD"><img src="images/down.gif" border="0" align="middle" alt="" /></a>)
+      <br /><b><{$lang_cursortedby}></b>
+      </div>
+      <hr />
+      <{/if}>
+
+    </td>
+  </tr>
+</table>
+<table width="100%" cellspacing="0" cellpadding="10" border="0">
+<tr>
+<td width="100%" align="center" valign="top">
+  <!-- Start link loop -->
+  <{section name=i loop=$file}>
+    <{include file="db:mydownloads_download.html" down=$file[i]}>
+  <{/section}>
+  <!-- End link loop -->
+</td></tr>
+</table>
+<{$page_nav}>
+<{else}>
+    </td>
+  </tr>
+</table>
+<{/if}>
+<{include file="db:system_notification_select.html"}>
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/templates/mydownloads_submit.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/templates/mydownloads_submit.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/templates/mydownloads_submit.html	(revision 405)
@@ -0,0 +1,84 @@
+<br /><br />
+
+<p align="center">
+    <a href="<{$xoops_url}>/modules/mydownloads/index.php"><img src="<{$xoops_url}>/modules/mydownloads/images/logo-en.gif" alt="" /></a>
+</p>
+
+<br />
+
+<table width="100%" cellspacing="1" cellpadding="4" border="0">
+  <tr>
+    <td>
+    <form action="submit.php" method="post" enctype="multipart/form-data">
+        
+
+        <table class ="outer" width="80%">
+          <tr> 
+            <td class="itemHead" align="left" nowrap colspan="2"><b><{$lang_submitcath}></b> 
+            </td>
+          </tr>
+          <tr> 
+            <td class="head" align="left" nowrap><b><{$lang_sitetitle}></b></td>
+            <td class="even"> 
+              <input type="text" name="title" size="50" maxlength="100" />
+            </td>
+          </tr>
+          <tr>
+            <td class="head"><b><{$lang_upload}></b></td>
+            <td class="even"><INPUT TYPE='hidden' NAME='MAX_FILE_SIZE' VALUE='<{$maxbyte}>'>
+              <INPUT type='file' size='50' name='upfile' /> Max <{$maxbyte_str}>Byte.
+            </td>
+          </tr>
+          <tr> 
+            <td class="head" align="left" nowrap><b><{$lang_siteurl}></b></td>
+            <td class="odd" > 
+              <input type="text" name="url" size="50" maxlength="250" value="http://" />
+            </td>
+          </tr>
+          <tr> 
+            <td class="head" align="left" nowrap><b><{$lang_category}></b></td>
+            <td class="even"><{$category_selbox}></td>
+          </tr>
+          <tr> 
+            <td class="head" align="left"><b><{$lang_homepage}></b></td>
+            <td class="odd" > 
+              <input type="text" name="homepage" size="50" maxlength="100" value="<{$file.homepage}>">
+            </td>
+          </tr>
+          <tr> 
+            <td class="head" align="left"><b><{$lang_version}></b></td>
+            <td class="even"> 
+              <input type="text" name="version" size="10" maxlength="20" value="<{$file.version}>">
+            </td>
+          </tr>
+          <tr> 
+            <td class="head" align="left"><b><{$lang_size}></b></td>
+            <td class="odd"> 
+              <input type="text" name="size" size="10" maxlength="20" value="<{$file.size}>">
+              <{$lang_bytes}></td>
+          </tr>
+          <tr> 
+            <td class="head" align="left"><b><{$lang_platform}></b></td>
+            <td class="even"> 
+              <input type="text" name="platform" size="50" maxlength="50" value="<{$file.plataform}>">
+            </td>
+          </tr>
+          <tr> 
+            <td class="head" align="left" valign="top" nowrap><b><{$lang_description}></b></td>
+            <td class="odd"><{$xoops_codes}><{$xoops_smilies}></td>
+          </tr>
+          <tr>
+            <td class="head"><b><{$lang_options}></b></td>
+            <td class="odd">
+            <{if $notify_show}>
+              <input type="checkbox" name="notify" value="1"><{$lang_notify}></input>
+            <{/if}>
+            </td>
+          </tr>
+        </table>
+      <br />
+      <div style="text-align: center;"><input type="submit" name="submit" class="button" value="<{$lang_submit}>" />&nbsp;<input type="button" value="<{$lang_cancel}>" onclick="javascript:history.go(-1)" /></div>
+    </form>
+  </td>
+</tr>
+</table>
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/templates/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/templates/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/templates/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/templates/mydownloads_download.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/templates/mydownloads_download.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/templates/mydownloads_download.html	(revision 405)
@@ -0,0 +1,30 @@
+<table width='100%' cellspacing='0' class='outer'>
+  <tr>
+    <td class="head" colspan='2' align='left' height="18"><{$lang_category}> <{$down.category}></td>
+  </tr>
+  <tr>
+    <td class='even' width='65%' align='left' valign="bottom"><a href='visit.php?cid=<{$down.cid}>&amp;lid=<{$down.id}>' target='_blank'><img src='images/download.gif' border='0' alt='<{$lang_dlnow}>' /><b><{$down.title}></b></a></td>
+    <td class='even' align='right' width='35%'><b><{$lang_version}>:</b>&nbsp;<{$down.version}><br /><b><{$lang_subdate}>:</b>&nbsp;&nbsp;<{$down.updated}></td>
+  </tr>
+  <tr>
+    <td colspan='2' class='odd' align='left'><{$down.adminlink}><b><{$lang_description}></b><br />
+
+<{if $down.logourl != ""}>
+   <a href="<{$xoops_url}>/modules/mydownloads/visit.php?cid=<{$down.cid}>&amp;lid=<{$down.id}>" target="_blank"><img src="<{$xoops_url}>/modules/mydownloads/images/shots/<{$down.logourl}>" width="<{$shotwidth}>" alt=""  align="right" vspace="3" hspace="7"/></a>
+<{/if}>
+
+<div style="text-align: justify"><{$down.description}></div><br /></td>
+  </tr>
+  <tr>
+    <td colspan='2' class='even' align='left'><img src='images/counter.gif' border='0' align='absmiddle' alt='<{$down.lang_dltimes}>' />
+&nbsp;<{$down.hits}>&nbsp;&nbsp;<img src='images/size.gif' border='0' align='absmiddle' alt='<{$lang_size}>' />&nbsp;<{$down.size}>&nbsp;&nbsp;<img src='images/platform.gif' border='0' align='absmiddle' alt='<{$lang_platform}>' />&nbsp;<{$down.platform}>&nbsp;&nbsp;<img src='images/home.gif' border='0' align='absmiddle' alt='<{$lang_homepage}>' />&nbsp;<a href="<{$down.homepage}>" target="_BLANK"><{$down.homepage}></a></td>
+  </tr>
+  <tr>
+    <td colspan='2' class='foot' align='center'>
+    <div><b><{$lang_ratingc}></b> <{$down.rating}> (<{$down.votes}>)</div>
+    <a href="<{$xoops_url}>/modules/mydownloads/ratefile.php?cid=<{$down.cid}>&amp;lid=<{$down.id}>"><{$lang_ratethissite}></a> | <a href="<{$xoops_url}>/modules/mydownloads/modfile.php?lid=<{$down.id}>"><{$lang_modify}></a> | <a href="<{$xoops_url}>/modules/mydownloads/brokenfile.php?lid=<{$down.id}>"><{$lang_reportbroken}></a> | <a target="_top" href="mailto:?subject=<{$down.mail_subject}>&amp;body=<{$down.mail_body}>"><{$lang_tellafriend}></a> | <a href="<{$xoops_url}>/modules/mydownloads/singlefile.php?cid=<{$down.cid}>&amp;lid=<{$down.id}>"><{$lang_comments}> (<{$down.comments}>)</a>
+    </td>
+  </tr>
+</table>
+<br /><br />
+
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/templates/mydownloads_index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/templates/mydownloads_index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/templates/mydownloads_index.html	(revision 405)
@@ -0,0 +1,51 @@
+<br /><br />
+
+<p align="center">
+    <a href="<{$xoops_url}>/modules/mydownloads/index.php"><img src="<{$xoops_url}>/modules/mydownloads/images/logo-en.gif" alt="" /></a>
+</p>
+
+<br /><br /><br />
+<a href="<{$xoops_url}>/modules/mydownloads/submit.php">¿·µ¬¥Õ¥¡¥¤¥ëÅÐÏ¿</a></li>
+<br />
+<{if count($categories) gt 0}>
+<hr noshade color=#000000">
+<table border='0' cellspacing='5' cellpadding='0' align="center">
+  <tr>
+  <!-- Start category loop -->
+  <{foreach item=category from=$categories}>
+
+    <td valign="top" >
+    <{if $category.image != ""}>
+    <a href="<{$xoops_url}>/modules/mydownloads/viewcat.php?cid=<{$category.id}>"><img src="<{$category.image}>" height="50" border="0" alt="" /></a>
+    <{/if}>
+    </td>
+    <td valign="top" width="40%"><a href="<{$xoops_url}>/modules/mydownloads/viewcat.php?cid=<{$category.id}>"><b><{$category.title}></b></a>&nbsp;(<{$category.totaldownloads}>)<br /><{$category.subcategories}></td>
+    <{if $category.count is div by 3}>
+    </tr><tr>
+    <{/if}>
+
+  <{/foreach}>
+  <!-- End category loop -->
+  </tr>
+</table>
+<br /><br />
+
+<div><{$lang_thereare}></div>
+<hr noshade color=#000000">
+
+  <{/if}>
+
+<{if $file != ""}>
+<h4><{$lang_latestlistings}></h4>
+<table width="100%" cellspacing="0" cellpadding="10" border="0">
+<tr>
+<td width="100%" align="center" valign="top">
+  <!-- Start new link loop -->
+  <{section name=i loop=$file}>
+    <{include file="db:mydownloads_download.html" down=$file[i]}>
+  <{/section}>
+  <!-- End new link loop -->
+</td></tr>
+  </table>
+<{/if}>
+<{include file="db:system_notification_select.html"}>
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/sql/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/sql/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/sql/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/sql/mysql.sql
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/sql/mysql.sql	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/sql/mysql.sql	(revision 405)
@@ -0,0 +1,113 @@
+# phpMyAdmin MySQL-Dump
+# version 2.2.2
+# http://phpwizard.net/phpMyAdmin/
+# http://phpmyadmin.sourceforge.net/ (download page)
+#
+# --------------------------------------------------------
+
+#
+# Table structure for table `mydownloads_broken`
+#
+
+CREATE TABLE mydownloads_broken (
+  reportid int(5) NOT NULL auto_increment,
+  lid int(11) NOT NULL default '0',
+  sender int(11) NOT NULL default '0',
+  ip varchar(20) NOT NULL default '',
+  PRIMARY KEY  (reportid),
+  KEY lid (lid),
+  KEY sender (sender),
+  KEY ip (ip)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `mydownloads_cat`
+#
+
+CREATE TABLE mydownloads_cat (
+  cid int(5) unsigned NOT NULL auto_increment,
+  pid int(5) unsigned NOT NULL default '0',
+  title varchar(50) NOT NULL default '',
+  imgurl varchar(150) NOT NULL default '',
+  PRIMARY KEY  (cid),
+  KEY pid (pid)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `mydownloads_downloads`
+#
+
+CREATE TABLE mydownloads_downloads (
+  lid int(11) unsigned NOT NULL auto_increment,
+  cid int(5) unsigned NOT NULL default '0',
+  title varchar(100) NOT NULL default '',
+  url varchar(250) NOT NULL default '',
+  homepage varchar(100) NOT NULL default '',
+  version varchar(10) NOT NULL default '',
+  size int(8) NOT NULL default '0',
+  platform varchar(50) NOT NULL default '',
+  logourl varchar(60) NOT NULL default '',
+  submitter int(11) NOT NULL default '0',
+  status tinyint(2) NOT NULL default '0',
+  date int(10) NOT NULL default '0',
+  hits int(11) unsigned NOT NULL default '0',
+  rating double(6,4) NOT NULL default '0.0000',
+  votes int(11) unsigned NOT NULL default '0',
+  comments int(11) unsigned NOT NULL default '0',
+  PRIMARY KEY  (lid),
+  KEY cid (cid),
+  KEY status (status),
+  KEY title (title(40))
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `mydownloads_mod`
+#
+
+CREATE TABLE mydownloads_mod (
+  requestid int(11) unsigned NOT NULL auto_increment,
+  lid int(11) unsigned NOT NULL default '0',
+  cid int(5) unsigned NOT NULL default '0',
+  title varchar(100) NOT NULL default '',
+  url varchar(250) NOT NULL default '',
+  homepage varchar(100) NOT NULL default '',
+  version varchar(10) NOT NULL default '',
+  size int(8) NOT NULL default '0',
+  platform varchar(50) NOT NULL default '',
+  logourl varchar(60) NOT NULL default '',
+  description text NOT NULL,
+  modifysubmitter int(11) NOT NULL default '0',
+  PRIMARY KEY  (requestid)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `mydownloads_text`
+#
+
+CREATE TABLE mydownloads_text (
+  lid int(11) unsigned NOT NULL default '0',
+  description text NOT NULL,
+  KEY lid (lid)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `mydownloads_votedata`
+#
+
+CREATE TABLE mydownloads_votedata (
+  ratingid int(11) unsigned NOT NULL auto_increment,
+  lid int(11) unsigned NOT NULL default '0',
+  ratinguser int(11) NOT NULL default '0',
+  rating tinyint(3) unsigned NOT NULL default '0',
+  ratinghostname varchar(60) NOT NULL default '',
+  ratingtimestamp int(10) NOT NULL default '0',
+  PRIMARY KEY  (ratingid),
+  KEY ratinguser (ratinguser),
+  KEY ratinghostname (ratinghostname),
+  KEY lid (lid)
+) TYPE=MyISAM;
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/topten.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/topten.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/topten.php	(revision 405)
@@ -0,0 +1,81 @@
+<?php
+// $Id: topten.php,v 1.9.2.2 2004/11/23 07:12:29 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+// ------------------------------------------------------------------------- //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+include "header.php";
+include_once XOOPS_ROOT_PATH."/class/xoopstree.php";
+
+$myts =& MyTextSanitizer::getInstance(); // MyTextSanitizer object
+$mytree = new XoopsTree($xoopsDB->prefix("mydownloads_cat"),"cid","pid");
+$xoopsOption['template_main'] = 'mydownloads_topten.html';
+include XOOPS_ROOT_PATH."/header.php";
+//generates top 10 charts by rating and hits for each main category
+if(!empty($_GET['rate'])){
+	$sort = _MD_RATING;
+	$sortDB = "rating";
+}else{
+	$sort = _MD_HITS;
+	$sortDB = "hits";
+}
+$xoopsTpl->assign('lang_sortby' ,$sort);
+$xoopsTpl->assign('lang_rank' , _MD_RANK);
+$xoopsTpl->assign('lang_title' , _MD_TITLE);
+$xoopsTpl->assign('lang_category' , _MD_CATEGORY);
+$xoopsTpl->assign('lang_hits' , _MD_HITS);
+$xoopsTpl->assign('lang_rating' , _MD_RATING);
+$xoopsTpl->assign('lang_vote' , _MD_VOTE);
+$arr=array();
+$result=$xoopsDB->query("SELECT cid, title FROM ".$xoopsDB->prefix("mydownloads_cat")." WHERE pid=0");
+$e = 0;
+$rankings = array();
+while(list($cid,$ctitle)=$xoopsDB->fetchRow($result)){
+	$rankings[$e]['title'] = sprintf(_MD_TOP10, $myts->htmlSpecialChars($ctitle));
+	$query = "SELECT lid, cid, title, hits, rating, votes FROM ".$xoopsDB->prefix("mydownloads_downloads")." WHERE status>0 AND (cid=$cid";
+// get all child cat ids for a given cat id
+	$arr=$mytree->getAllChildId($cid);
+	$size = count($arr);
+	for($i=0;$i<$size;$i++){
+		$query .= " or cid=".$arr[$i]."";
+	}
+	$query .= ") order by ".$sortDB." DESC";
+	$result2 = $xoopsDB->query($query,10,0);
+	$rank = 1;
+	while(list($did,$dcid,$dtitle,$hits,$rating,$votes)=$xoopsDB->fetchRow($result2)){
+		$catpath = $mytree->getPathFromId($dcid, "title");
+		$catpath= substr($catpath, 1);
+		$catpath = str_replace("/"," <span class='fg2'>&raquo;&raquo;</span> ",$catpath);
+		$dtitle = $myts->makeTboxData4Show($dtitle);
+		$rankings[$e]['file'][] = array('id' => $did, 'cid' => $dcid, 'rank' => $rank, 'title' => $dtitle, 'category' => $catpath, 'hits' => $hits, 'rating' => number_format($rating, 2), 'votes' => $votes);
+		$rank++;
+	}
+	$e++;
+}
+$xoopsTpl->assign('rankings', $rankings);
+include XOOPS_ROOT_PATH.'/footer.php';
+
+include "footer.php";
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/comment_new.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/comment_new.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/comment_new.php	(revision 405)
@@ -0,0 +1,38 @@
+<?php
+// $Id: comment_new.php,v 1.1 2004/09/09 05:15:10 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+include '../../mainfile.php';
+$com_itemid = isset($HTTP_GET_VARS['com_itemid']) ? intval($HTTP_GET_VARS['com_itemid']) : 0;
+if ($com_itemid > 0) {
+    // Get file title
+    $sql = "SELECT title FROM " . $xoopsDB->prefix('mydownloads_downloads') . " WHERE lid=" . $com_itemid . "";
+    $result = $xoopsDB->query($sql);
+    $row = $xoopsDB->fetchArray($result);
+    $com_replytitle = $row['title'];
+    include XOOPS_ROOT_PATH.'/include/comment_new.php';
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/xoops_version.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/xoops_version.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/xoops_version.php	(revision 405)
@@ -0,0 +1,301 @@
+<?php
+// $Id: xoops_version.php,v 1.1 2004/09/09 05:15:10 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+$modversion['name'] = _MI_MYDOWNLOADS_NAME;
+$modversion['version'] = 1.04;
+$modversion['description'] = _MI_MYDOWNLOADS_DESC;
+$modversion['author'] = "Hacked by Yoshi Sakai http://www.bluemooninc.biz/";
+$modversion['credits'] = "mydl_fileup is tweak from mydownloads v1.10";
+$modversion['help'] = "mydownloads.html";
+$modversion['license'] = "GPL see LICENSE";
+$modversion['official'] = 0;
+$modversion['image'] = "images/mydl_slogo.png";
+$modversion['dirname'] = "mydownloads";
+
+// Sql file (must contain sql generated by phpMyAdmin or phpPgAdmin)
+// All tables should not have any prefix!
+$modversion['sqlfile']['mysql'] = "sql/mysql.sql";
+//$modversion['sqlfile']['postgresql'] = "sql/pgsql.sql";
+
+// Tables created by sql file (without prefix!)
+$modversion['tables'][0] = "mydownloads_broken";
+$modversion['tables'][1] = "mydownloads_cat";
+$modversion['tables'][2] = "mydownloads_downloads";
+$modversion['tables'][3] = "mydownloads_mod";
+$modversion['tables'][4] = "mydownloads_text";
+$modversion['tables'][5] = "mydownloads_votedata";
+
+// Admin things
+$modversion['hasAdmin'] = 1;
+$modversion['adminindex'] = "admin/index.php";
+$modversion['adminmenu'] = "admin/menu.php";
+
+// Blocks
+$modversion['blocks'][1]['file'] = "mydownloads_top.php";
+$modversion['blocks'][1]['name'] = _MI_MYDOWNLOADS_BNAME1;
+$modversion['blocks'][1]['description'] = "Shows recently added donwload files";
+$modversion['blocks'][1]['show_func'] = "b_mydownloads_top_show";
+$modversion['blocks'][1]['edit_func'] = "b_mydownloads_top_edit";
+$modversion['blocks'][1]['options'] = "date|10|19";
+$modversion['blocks'][1]['template'] = 'mydownloads_block_new.html';
+
+$modversion['blocks'][2]['file'] = "mydownloads_top.php";
+$modversion['blocks'][2]['name'] = _MI_MYDOWNLOADS_BNAME2;
+$modversion['blocks'][2]['description'] = "Shows most downloaded files";
+$modversion['blocks'][2]['show_func'] = "b_mydownloads_top_show";
+$modversion['blocks'][2]['edit_func'] = "b_mydownloads_top_edit";
+$modversion['blocks'][2]['options'] = "hits|10|19";
+$modversion['blocks'][2]['template'] = 'mydownloads_block_top.html';
+
+// Menu
+$modversion['hasMain'] = 1;
+$modversion['sub'][1]['name'] = _MI_MYDOWNLOADS_SMNAME1;
+$modversion['sub'][1]['url'] = "submit.php";
+$modversion['sub'][2]['name'] = _MI_MYDOWNLOADS_SMNAME2;
+$modversion['sub'][2]['url'] = "topten.php?hit=1";
+$modversion['sub'][3]['name'] = _MI_MYDOWNLOADS_SMNAME3;
+$modversion['sub'][3]['url'] = "topten.php?rate=1";
+
+// Search
+$modversion['hasSearch'] = 1;
+$modversion['search']['file'] = "include/search.inc.php";
+$modversion['search']['func'] = "mydownloads_search";
+
+// Comments
+$modversion['hasComments'] = 1;
+$modversion['comments']['itemName'] = 'lid';
+$modversion['comments']['pageName'] = 'singlefile.php';
+$modversion['comments']['extraParams'] = array('cid');
+// Comment callback functions
+$modversion['comments']['callbackFile'] = 'include/comment_functions.php';
+$modversion['comments']['callback']['approve'] = 'mydownloads_com_approve';
+$modversion['comments']['callback']['update'] = 'mydownloads_com_update';
+
+// Templates
+$modversion['templates'][1]['file'] = 'mydownloads_brokenfile.html';
+$modversion['templates'][1]['description'] = '';
+$modversion['templates'][2]['file'] = 'mydownloads_download.html';
+$modversion['templates'][2]['description'] = '';
+$modversion['templates'][3]['file'] = 'mydownloads_index.html';
+$modversion['templates'][3]['description'] = '';
+$modversion['templates'][4]['file'] = 'mydownloads_modfile.html';
+$modversion['templates'][4]['description'] = '';
+$modversion['templates'][5]['file'] = 'mydownloads_ratefile.html';
+$modversion['templates'][5]['description'] = '';
+$modversion['templates'][6]['file'] = 'mydownloads_singlefile.html';
+$modversion['templates'][6]['description'] = '';
+$modversion['templates'][7]['file'] = 'mydownloads_submit.html';
+$modversion['templates'][7]['description'] = '';
+$modversion['templates'][8]['file'] = 'mydownloads_topten.html';
+$modversion['templates'][8]['description'] = '';
+$modversion['templates'][9]['file'] = 'mydownloads_viewcat.html';
+$modversion['templates'][9]['description'] = '';
+
+// Config Settings (only for modules that need config settings generated automatically)
+
+// name of config option for accessing its specified value. i.e. $xoopsModuleConfig['storyhome']
+$modversion['config'][1]['name'] = 'popular';
+
+// title of this config option displayed in config settings form
+$modversion['config'][1]['title'] = '_MI_MYDOWNLOADS_POPULAR';
+
+// description of this config option displayed under title
+$modversion['config'][1]['description'] = '_MI_MYDOWNLOADS_POPULARDSC';
+
+// form element type used in config form for this option. can be one of either textbox, textarea, select, select_multi, yesno, group, group_multi
+$modversion['config'][1]['formtype'] = 'select';
+
+// value type of this config option. can be one of either int, text, float, array, or other
+// form type of 'group_multi', 'select_multi' must always be 'array'
+// form type of 'yesno', 'group' must be always be 'int'
+$modversion['config'][1]['valuetype'] = 'int';
+
+// the default value for this option
+// ignore it if no default
+// 'yesno' formtype must be either 0(no) or 1(yes)
+$modversion['config'][1]['default'] = 100;
+
+// options to be displayed in selection box
+// required and valid for 'select' or 'select_multi' formtype option only
+// language constants can be used for both array keys and values
+$modversion['config'][1]['options'] = array('5' => 5, '10' => 10, '50' => 50, '100' => 100, '200' => 200, '500' => 500, '1000' => 1000);
+
+
+$modversion['config'][2]['name'] = 'newdownloads';
+$modversion['config'][2]['title'] = '_MI_MYDOWNLOADS_NEWDLS';
+$modversion['config'][2]['description'] = '_MI_MYDOWNLOADS_NEWDLSDSC';
+$modversion['config'][2]['formtype'] = 'select';
+$modversion['config'][2]['valuetype'] = 'int';
+$modversion['config'][2]['default'] = 10;
+$modversion['config'][2]['options'] = array('5' => 5, '10' => 10, '15' => 15, '20' => 20, '25' => 25, '30' => 30, '50' => 50);
+
+$modversion['config'][3]['name'] = 'perpage';
+$modversion['config'][3]['title'] = '_MI_MYDOWNLOADS_PERPAGE';
+$modversion['config'][3]['description'] = '_MI_MYDOWNLOADS_PERPAGEDSC';
+$modversion['config'][3]['formtype'] = 'select';
+$modversion['config'][3]['valuetype'] = 'int';
+$modversion['config'][3]['default'] = 10;
+$modversion['config'][3]['options'] = array('5' => 5, '10' => 10, '15' => 15, '20' => 20, '25' => 25, '30' => 30, '50' => 50);
+
+$modversion['config'][4]['name'] = 'anonpost';
+$modversion['config'][4]['title'] = '_MI_MYDOWNLOADS_ANONPOST';
+$modversion['config'][4]['description'] = '';
+$modversion['config'][4]['formtype'] = 'yesno';
+$modversion['config'][4]['valuetype'] = 'int';
+$modversion['config'][4]['default'] = 0;
+
+$modversion['config'][5]['name'] = 'autoapprove';
+$modversion['config'][5]['title'] = '_MI_MYDOWNLOADS_AUTOAPPROVE';
+$modversion['config'][5]['description'] = '_MI_MYDOWNLOADS_AUTOAPPROVEDSC';
+$modversion['config'][5]['formtype'] = 'yesno';
+$modversion['config'][5]['valuetype'] = 'int';
+$modversion['config'][5]['default'] = 0;
+
+$modversion['config'][6]['name'] = 'useshots';
+$modversion['config'][6]['title'] = '_MI_MYDOWNLOADS_USESHOTS';
+$modversion['config'][6]['description'] = '_MI_MYDOWNLOADS_USESHOTSDSC';
+$modversion['config'][6]['formtype'] = 'yesno';
+$modversion['config'][6]['valuetype'] = 'int';
+$modversion['config'][6]['default'] = 0;
+
+$modversion['config'][7]['name'] = 'shotwidth';
+$modversion['config'][7]['title'] = '_MI_MYDOWNLOADS_SHOTWIDTH';
+$modversion['config'][7]['description'] = '_MI_MYDOWNLOADS_SHOTWIDTHDSC';
+$modversion['config'][7]['formtype'] = 'textbox';
+$modversion['config'][7]['valuetype'] = 'int';
+$modversion['config'][7]['default'] = 140;
+
+$modversion['config'][8]['name'] = 'check_host';
+$modversion['config'][8]['title'] = '_MI_MYDOWNLOADS_CHECKHOST';
+$modversion['config'][8]['description'] = '';
+$modversion['config'][8]['formtype'] = 'yesno';
+$modversion['config'][8]['valuetype'] = 'int';
+$modversion['config'][8]['default'] = 0;
+
+$xoops_url = parse_url(XOOPS_URL);
+$modversion['config'][9]['name'] = 'referers';
+$modversion['config'][9]['title'] = '_MI_MYDOWNLOADS_REFERERS';
+$modversion['config'][9]['description'] = '_MI_MYDOWNLOADS_REFERERSDSC';
+$modversion['config'][9]['formtype'] = 'textarea';
+$modversion['config'][9]['valuetype'] = 'array';
+$modversion['config'][9]['default'] = array($xoops_url['host']);
+
+// Notification
+
+$modversion['hasNotification'] = 1;
+$modversion['notification']['lookup_file'] = 'include/notification.inc.php';
+$modversion['notification']['lookup_func'] = 'mydownloads_notify_iteminfo';
+
+$modversion['notification']['category'][1]['name'] = 'global';
+$modversion['notification']['category'][1]['title'] = _MI_MYDOWNLOADS_GLOBAL_NOTIFY;
+$modversion['notification']['category'][1]['description'] = _MI_MYDOWNLOADS_GLOBAL_NOTIFYDSC;                                                     
+$modversion['notification']['category'][1]['subscribe_from'] = array('index.php','viewcat.php','singlefile.php');
+                                                              
+$modversion['notification']['category'][2]['name'] = 'category';
+$modversion['notification']['category'][2]['title'] = _MI_MYDOWNLOADS_CATEGORY_NOTIFY;
+$modversion['notification']['category'][2]['description'] = _MI_MYDOWNLOADS_CATEGORY_NOTIFYDSC;
+$modversion['notification']['category'][2]['subscribe_from'] = array('viewcat.php', 'singlefile.php');
+$modversion['notification']['category'][2]['item_name'] = 'cid';
+$modversion['notification']['category'][2]['allow_bookmark'] = 1;
+
+$modversion['notification']['category'][3]['name'] = 'file';
+$modversion['notification']['category'][3]['title'] = _MI_MYDOWNLOADS_FILE_NOTIFY;
+$modversion['notification']['category'][3]['description'] = _MI_MYDOWNLOADS_FILE_NOTIFYDSC;
+$modversion['notification']['category'][3]['subscribe_from'] = 'singlefile.php';
+$modversion['notification']['category'][3]['item_name'] = 'lid';
+$modversion['notification']['category'][3]['allow_bookmark'] = 1;
+
+$modversion['notification']['event'][1]['name'] = 'new_category';
+$modversion['notification']['event'][1]['category'] = 'global';
+$modversion['notification']['event'][1]['title'] = _MI_MYDOWNLOADS_GLOBAL_NEWCATEGORY_NOTIFY;
+$modversion['notification']['event'][1]['caption'] = _MI_MYDOWNLOADS_GLOBAL_NEWCATEGORY_NOTIFYCAP;
+$modversion['notification']['event'][1]['description'] = _MI_MYDOWNLOADS_GLOBAL_NEWCATEGORY_NOTIFYDSC;
+$modversion['notification']['event'][1]['mail_template'] = 'global_newcategory_notify';
+$modversion['notification']['event'][1]['mail_subject'] = _MI_MYDOWNLOADS_GLOBAL_NEWCATEGORY_NOTIFYSBJ;
+
+$modversion['notification']['event'][2]['name'] = 'file_modify';
+$modversion['notification']['event'][2]['category'] = 'global';
+$modversion['notification']['event'][2]['admin_only'] = 1;
+$modversion['notification']['event'][2]['title'] = _MI_MYDOWNLOADS_GLOBAL_FILEMODIFY_NOTIFY;
+$modversion['notification']['event'][2]['caption'] = _MI_MYDOWNLOADS_GLOBAL_FILEMODIFY_NOTIFYCAP;
+$modversion['notification']['event'][2]['description'] = _MI_MYDOWNLOADS_GLOBAL_FILEMODIFY_NOTIFYDSC;
+$modversion['notification']['event'][2]['mail_template'] = 'global_filemodify_notify';
+$modversion['notification']['event'][2]['mail_subject'] = _MI_MYDOWNLOADS_GLOBAL_FILEMODIFY_NOTIFYSBJ;
+
+$modversion['notification']['event'][3]['name'] = 'file_broken';
+$modversion['notification']['event'][3]['category'] = 'global';
+$modversion['notification']['event'][3]['admin_only'] = 1;
+$modversion['notification']['event'][3]['title'] = _MI_MYDOWNLOADS_GLOBAL_FILEBROKEN_NOTIFY;
+$modversion['notification']['event'][3]['caption'] = _MI_MYDOWNLOADS_GLOBAL_FILEBROKEN_NOTIFYCAP;
+$modversion['notification']['event'][3]['description'] = _MI_MYDOWNLOADS_GLOBAL_FILEBROKEN_NOTIFYDSC;
+$modversion['notification']['event'][3]['mail_template'] = 'global_filebroken_notify';
+$modversion['notification']['event'][3]['mail_subject'] = _MI_MYDOWNLOADS_GLOBAL_FILEBROKEN_NOTIFYSBJ;
+
+$modversion['notification']['event'][4]['name'] = 'file_submit';
+$modversion['notification']['event'][4]['category'] = 'global';
+$modversion['notification']['event'][4]['admin_only'] = 1;
+$modversion['notification']['event'][4]['title'] = _MI_MYDOWNLOADS_GLOBAL_FILESUBMIT_NOTIFY;
+$modversion['notification']['event'][4]['caption'] = _MI_MYDOWNLOADS_GLOBAL_FILESUBMIT_NOTIFYCAP;
+$modversion['notification']['event'][4]['description'] = _MI_MYDOWNLOADS_GLOBAL_FILESUBMIT_NOTIFYDSC;
+$modversion['notification']['event'][4]['mail_template'] = 'global_filesubmit_notify';
+$modversion['notification']['event'][4]['mail_subject'] = _MI_MYDOWNLOADS_GLOBAL_FILESUBMIT_NOTIFYSBJ;
+
+$modversion['notification']['event'][5]['name'] = 'new_file';
+$modversion['notification']['event'][5]['category'] = 'global';
+$modversion['notification']['event'][5]['title'] = _MI_MYDOWNLOADS_GLOBAL_NEWFILE_NOTIFY;
+$modversion['notification']['event'][5]['caption'] = _MI_MYDOWNLOADS_GLOBAL_NEWFILE_NOTIFYCAP;
+$modversion['notification']['event'][5]['description'] = _MI_MYDOWNLOADS_GLOBAL_NEWFILE_NOTIFYDSC;
+$modversion['notification']['event'][5]['mail_template'] = 'global_newfile_notify';
+$modversion['notification']['event'][5]['mail_subject'] = _MI_MYDOWNLOADS_GLOBAL_NEWFILE_NOTIFYSBJ;
+
+$modversion['notification']['event'][6]['name'] = 'file_submit';
+$modversion['notification']['event'][6]['category'] = 'category';
+$modversion['notification']['event'][6]['admin_only'] = 1;
+$modversion['notification']['event'][6]['title'] = _MI_MYDOWNLOADS_CATEGORY_FILESUBMIT_NOTIFY;
+$modversion['notification']['event'][6]['caption'] = _MI_MYDOWNLOADS_CATEGORY_FILESUBMIT_NOTIFYCAP;
+$modversion['notification']['event'][6]['description'] = _MI_MYDOWNLOADS_CATEGORY_FILESUBMIT_NOTIFYDSC;
+$modversion['notification']['event'][6]['mail_template'] = 'category_filesubmit_notify';
+$modversion['notification']['event'][6]['mail_subject'] = _MI_MYDOWNLOADS_CATEGORY_FILESUBMIT_NOTIFYSBJ;
+
+$modversion['notification']['event'][7]['name'] = 'new_file';
+$modversion['notification']['event'][7]['category'] = 'category';
+$modversion['notification']['event'][7]['title'] = _MI_MYDOWNLOADS_CATEGORY_NEWFILE_NOTIFY;
+$modversion['notification']['event'][7]['caption'] = _MI_MYDOWNLOADS_CATEGORY_NEWFILE_NOTIFYCAP;
+$modversion['notification']['event'][7]['description'] = _MI_MYDOWNLOADS_CATEGORY_NEWFILE_NOTIFYDSC;
+$modversion['notification']['event'][7]['mail_template'] = 'category_newfile_notify';
+$modversion['notification']['event'][7]['mail_subject'] = _MI_MYDOWNLOADS_CATEGORY_NEWFILE_NOTIFYSBJ;
+
+$modversion['notification']['event'][8]['name'] = 'approve';
+$modversion['notification']['event'][8]['category'] = 'file';
+$modversion['notification']['event'][8]['invisible'] = 1;
+$modversion['notification']['event'][8]['title'] = _MI_MYDOWNLOADS_FILE_APPROVE_NOTIFY;
+$modversion['notification']['event'][8]['caption'] = _MI_MYDOWNLOADS_FILE_APPROVE_NOTIFYCAP;
+$modversion['notification']['event'][8]['description'] = _MI_MYDOWNLOADS_FILE_APPROVE_NOTIFYDSC;
+$modversion['notification']['event'][8]['mail_template'] = 'file_approve_notify';
+$modversion['notification']['event'][8]['mail_subject'] = _MI_MYDOWNLOADS_FILE_APPROVE_NOTIFYSBJ;                                                 
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/comment_reply.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/comment_reply.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/comment_reply.php	(revision 405)
@@ -0,0 +1,29 @@
+<?php
+// $Id: comment_reply.php,v 1.1 2004/09/09 05:15:10 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+include '../../mainfile.php';
+include XOOPS_ROOT_PATH.'/include/comment_reply.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/images/shots/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/images/shots/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/images/shots/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/images/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/images/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/images/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/modfile.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/modfile.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/modfile.php	(revision 405)
@@ -0,0 +1,127 @@
+<?php
+// $Id: modfile.php,v 1.1 2004/09/09 05:15:10 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+// ------------------------------------------------------------------------- //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+include "header.php";
+include_once XOOPS_ROOT_PATH."/class/xoopstree.php";
+include_once XOOPS_ROOT_PATH."/class/module.errorhandler.php";
+$myts =& MyTextSanitizer::getInstance(); // MyTextSanitizer object
+$mytree = new XoopsTree($xoopsDB->prefix("mydownloads_cat"),"cid","pid");
+
+if($HTTP_POST_VARS['submit']) {
+	$eh = new ErrorHandler; //ErrorHandler object
+	if(empty($xoopsUser)){
+		redirect_header(XOOPS_URL."/user.php",2,_MD_MUSTREGFIRST);
+		exit();
+	} else {
+		$ratinguser = $xoopsUser->getVar('uid');
+	}
+	$submit_vars = array('lid', 'title', 'url', 'homepage', 'description', 'logourl', 'cid', 'version', 'size', 'platform');
+	foreach($submit_vars as $submit_key) {
+		$$submit_key = $HTTP_POST_VARS[$submit_key];
+	}
+	$lid = intval($lid);
+
+	// Check if Title exist
+	if (trim($title)=="") {
+		$eh->show("1001");
+	}
+	// Check if URL exist
+	if (trim($url)=="") {
+		$eh->show("1016");
+	}
+	// Check if HOMEPAGE exist
+	if (trim($homepage)=="") {
+		$eh->show("1016");
+	}
+	// Check if Description exist
+	if (trim($description)=="") {
+		$eh->show("1008");
+	}
+
+	$url = $myts->makeTboxData4Save($url);
+	$logourl = $myts->makeTboxData4Save($logourl);
+	$cid = intval($cid);
+	$title = $myts->makeTboxData4Save($title);
+	$homepage = $myts->makeTboxData4Save($homepage);
+	$version = $myts->makeTboxData4Save($version);
+	$size = $myts->makeTboxData4Save($size);
+	$platform = $myts->makeTboxData4Save($platform);
+	$description = $myts->makeTareaData4Save($description);
+	$newid = $xoopsDB->genId($xoopsDB->prefix("mydownloads_mod")."_requestid_seq");
+
+	$sql = sprintf("INSERT INTO %s (requestid, lid, cid, title, url, homepage, version, size, platform, logourl, description, modifysubmitter) VALUES (%u, %u, %u, '%s', '%s', '%s', '%s', %u, '%s', '%s', '%s', %u)", $xoopsDB->prefix("mydownloads_mod"), $newid, $lid, $cid, $title, $url, $homepage, $version, $size, $platform, $logourl, $description, $ratinguser);
+	$xoopsDB->query($sql) or $eh->show("0013");
+	$tags = array();
+	$tags['MODIFYREPORTS_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/admin/index.php?op=listModReq';
+	$notification_handler =& xoops_gethandler('notification');
+	$notification_handler->triggerEvent('global', 0, 'file_modify', $tags);
+	redirect_header("index.php",2,_MD_THANKSFORINFO);
+	exit();
+
+} else {
+	$lid = intval($HTTP_GET_VARS['lid']);
+	if(empty($xoopsUser)){
+		redirect_header(XOOPS_URL."/user.php",2,_MD_MUSTREGFIRST);
+		exit();
+	}
+	$xoopsOption['template_main'] = 'mydownloads_modfile.html';
+	include XOOPS_ROOT_PATH."/header.php";
+	$result = $xoopsDB->query("SELECT cid, title, url, homepage, version, size, platform, logourl FROM ".$xoopsDB->prefix("mydownloads_downloads")." WHERE lid=".$lid." AND status>0");
+	$xoopsTpl->assign('lang_requestmod', _MD_REQUESTMOD);
+	list($cid, $title, $url, $homepage, $version, $size, $platform, $logourl) = $xoopsDB->fetchRow($result);
+	$title = $myts->makeTboxData4Edit($title);
+	$url = $myts->makeTboxData4Edit($url);
+	$homepage = $myts->makeTboxData4Edit($homepage);
+	$version = $myts->makeTboxData4Edit($version);
+	$size = $myts->makeTboxData4Edit($size);
+	$platform = $myts->makeTboxData4Edit($platform);
+	$logourl = $myts->makeTboxData4Edit($logourl);
+	$result2 = $xoopsDB->query("SELECT description FROM ".$xoopsDB->prefix("mydownloads_text")." WHERE lid=$lid");
+	list($description)=$xoopsDB->fetchRow($result2);
+	$description = $myts->makeTareaData4Edit($description);
+	$xoopsTpl->assign('file', array('id' => $lid, 'rating' => number_format($rating, 2), 'title' => $title, 'url' => $url, 'logourl' => $logourl, 'updated' => formatTimestamp($time,"m"), 'description' => $description, 'hits' => $hits, 'votes' => $votestring,'plataform' => $platform,'size'  => $size,'homepage' => $homepage,'version'  => $version,));
+	$xoopsTpl->assign('lang_fileid', _MD_FILEID);
+	$xoopsTpl->assign('lang_sitetitle', _MD_FILETITLE);
+	$xoopsTpl->assign('lang_siteurl', _MD_DLURL);
+	$xoopsTpl->assign('lang_category', _MD_CATEGORYC);
+	$xoopsTpl->assign('lang_homepage', _MD_HOMEPAGEC);
+	$xoopsTpl->assign('lang_version', _MD_VERSIONC);
+	$xoopsTpl->assign('lang_size', _MD_FILESIZEC);
+	$xoopsTpl->assign('lang_bytes', _MD_BYTES);
+	$xoopsTpl->assign('lang_platform', _MD_PLATFORMC);
+	ob_start();
+	$mytree->makeMySelBox("title", "title", $cid);
+	$selbox = ob_get_contents();
+	ob_end_clean();
+	$xoopsTpl->assign('category_selbox', $selbox);
+	$xoopsTpl->assign('lang_description', _MD_DESCRIPTIONC);
+	$xoopsTpl->assign('modifysubmitter', $xoopsUser->getVar('uid'));
+	$xoopsTpl->assign('lang_sendrequest', _MD_SENDREQUEST);
+	$xoopsTpl->assign('lang_cancel', _CANCEL);
+	include XOOPS_ROOT_PATH.'/footer.php';
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/brokenfile.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/brokenfile.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/brokenfile.php	(revision 405)
@@ -0,0 +1,75 @@
+<?php
+// $Id: brokenfile.php,v 1.1 2004/09/09 05:15:10 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+// ------------------------------------------------------------------------- //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+include "header.php";
+$myts =& MyTextSanitizer::getInstance(); // MyTextSanitizer object
+
+if (!empty($HTTP_POST_VARS['submit'])) {
+	if (empty($xoopsUser)) {
+		$sender = 0;
+	} else {
+		$sender = $xoopsUser->getVar('uid');
+	}
+	$ip = getenv("REMOTE_ADDR");
+	$lid = intval($HTTP_POST_VARS['lid']);
+	if ( $sender != 0 ) {
+		// Check if REG user is trying to report twice.
+		$result=$xoopsDB->query("SELECT COUNT(*) FROM ".$xoopsDB->prefix("mydownloads_broken")." WHERE lid=$lid AND sender=$sender");
+		list ($count)=$xoopsDB->fetchRow($result);
+		if ( $count > 0 ) {
+			redirect_header("index.php",2,_MD_ALREADYREPORTED);
+			exit();
+		}
+	} else {
+		// Check if the sender is trying to vote more than once.
+		$result=$xoopsDB->query("SELECT COUNT(*) FROM ".$xoopsDB->prefix("mydownloads_broken")." WHERE lid=$lid AND ip = '$ip'");
+		list ($count)=$xoopsDB->fetchRow($result);
+		if ( $count > 0 ) {
+			redirect_header("index.php",2,_MD_ALREADYREPORTED);
+			exit();
+		}
+	}
+	$newid = $xoopsDB->genId($xoopsDB->prefix("mydownloads_broken")."_reportid_seq");
+    $sql = sprintf("INSERT INTO %s (reportid, lid, sender, ip) VALUES (%u, %u, %u, '%s')", $xoopsDB->prefix("mydownloads_broken"), $newid, $lid, $sender, $ip);
+	$xoopsDB->query($sql) or exit();
+	$tags = array();
+	$tags['BROKENREPORTS_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/admin/index.php?op=listBrokenDownloads';
+	$notification_handler =& xoops_gethandler('notification');
+	$notification_handler->triggerEvent('global', 0, 'file_broken', $tags);
+	redirect_header("index.php",2,_MD_THANKSFORINFO);
+	exit();
+} else {
+	$xoopsOption['template_main'] = 'mydownloads_brokenfile.html';
+	include XOOPS_ROOT_PATH.'/header.php';
+	$xoopsTpl->assign('lang_reportbroken', _MD_REPORTBROKEN);
+	$xoopsTpl->assign('file_id', intval($HTTP_GET_VARS['lid']));
+	$xoopsTpl->assign('lang_thanksforhelp', _MD_THANKSFORHELP);
+	$xoopsTpl->assign('lang_forsecurity', _MD_FORSECURITY);
+	$xoopsTpl->assign('lang_cancel', _MD_CANCEL);
+	include_once XOOPS_ROOT_PATH.'/footer.php';
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/singlefile.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/singlefile.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/singlefile.php	(revision 405)
@@ -0,0 +1,97 @@
+<?php
+// $Id: singlefile.php,v 1.1 2004/09/09 05:15:10 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+// ------------------------------------------------------------------------- //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+include "header.php";
+include_once XOOPS_ROOT_PATH."/class/xoopstree.php";
+$myts =& MyTextSanitizer::getInstance(); // MyTextSanitizer object
+$mytree = new XoopsTree($xoopsDB->prefix("mydownloads_cat"),"cid","pid");
+
+// Used to view just a single DL file information. Called from the rating pages
+
+$lid = intval($HTTP_GET_VARS['lid']);
+$cid = intval($HTTP_GET_VARS['cid']);
+$xoopsOption['template_main'] = 'mydownloads_singlefile.html';
+include XOOPS_ROOT_PATH."/header.php";
+$q = "SELECT d.lid, d.cid, d.title, d.url, d.homepage, d.version, d.size, d.platform, d.logourl, d.status, d.date, d.hits, d.rating, d.votes, d.comments, t.description FROM ".$xoopsDB->prefix("mydownloads_downloads")." d, ".$xoopsDB->prefix("mydownloads_text")." t WHERE d.lid=$lid AND d.lid=t.lid AND status>0";
+$result=$xoopsDB->query($q);
+list($lid, $cid, $title, $url, $homepage, $version, $size, $platform, $logourl, $status, $time, $hits, $rating, $votes, $comments, $description)=$xoopsDB->fetchRow($result);
+$pathstring = "<a href='index.php'>"._MD_MAIN."</a>&nbsp;:&nbsp;";
+$pathstring .= $mytree->getNicePathFromId($cid, "title", "viewcat.php?op=");
+$xoopsTpl->assign('category_path', $pathstring);
+$path = $mytree->getPathFromId($cid, "title");
+$path = substr($path, 1);
+$path = str_replace("/"," <img src='".XOOPS_URL."/modules/mydownloads/images/arrow.gif' board='0' alt=''> ",$path);
+$rating = number_format($rating, 2);
+$dtitle = $myts->makeTboxData4Show($title);
+$url = $myts->makeTboxData4Show($url);
+$homepage = $myts->makeTboxData4Show($homepage);
+$version = $myts->makeTboxData4Show($version);
+$size = PrettySize($myts->makeTboxData4Show($size));
+$platform = $myts->makeTboxData4Show($platform);
+$logourl = $myts->makeTboxData4Show($logourl);
+$datetime = formatTimestamp($time,"s");
+$description = $myts->makeTareaData4Show($description,0); //no html
+$new = newdownloadgraphic($time, $status);
+$pop = popgraphic($hits);
+if ($xoopsUser && $xoopsUser->isAdmin($xoopsModule->mid())) {
+	$adminlink = '<a href="'.XOOPS_URL.'/modules/mydownloads/admin/index.php?lid='.$lid.'&fct=mydownloads&op=modDownload"><img src="'.XOOPS_URL.'/modules/mydownloads/images/editicon.gif" border="0" alt="'._MD_EDITTHISDL.'" /></a>';
+} else {
+	$adminlink = '';
+}
+if ($votes == 1) {
+	$votestring = _MD_ONEVOTE;
+} else {
+	$votestring = sprintf(_MD_NUMVOTES,$votes);
+}
+if ($xoopsModuleConfig['useshots'] == 1) {
+	$xoopsTpl->assign('shotwidth', $xoopsModuleConfig['shotwidth']);
+	$xoopsTpl->assign('tablewidth', $xoopsModuleConfig['shotwidth'] + 10);
+	$xoopsTpl->assign('show_screenshot', true);
+	$xoopsTpl->assign('lang_noscreenshot', _MD_NOSHOTS);
+}
+$xoopsTpl->assign('file', array('id' => $lid, 'cid' => $cid,'rating' => $rating,'title' => $dtitle.$new.$pop,'logourl' => $logourl,'updated' => $datetime,'description' => $description,'adminlink' => $adminlink,'hits' => $hits,'votes' => $votestring, 'platform' => $platform, 'comments' => $comments, 'size'  => $size,'homepage' => $homepage,'version'  => $version,'category'  => $path,'lang_dltimes' => sprintf(_MD_DLTIMES,$hits),'mail_subject' => rawurlencode(sprintf(_MD_INTFILEFOUND,$xoopsConfig['sitename'])),'mail_body' => rawurlencode(sprintf(_MD_INTFILEFOUND,$xoopsConfig['sitename']).':  '.XOOPS_URL.'/modules/mydownloads/singlefile.php?cid='.$cid.'&amp;lid='.$lid)));
+$xoopsTpl->assign('lang_description', _MD_DESCRIPTIONC);
+$xoopsTpl->assign('lang_lastupdate', _MD_LASTUPDATEC);
+$xoopsTpl->assign('lang_hits', _MD_HITSC);
+$xoopsTpl->assign('lang_ratingc', _MD_RATINGC);
+$xoopsTpl->assign('lang_email', _MD_EMAILC);
+$xoopsTpl->assign('lang_ratethissite', _MD_RATETHISFILE);
+$xoopsTpl->assign('lang_reportbroken', _MD_REPORTBROKEN);
+$xoopsTpl->assign('lang_tellafriend', _MD_TELLAFRIEND);
+$xoopsTpl->assign('lang_modify', _MD_MODIFY);
+$xoopsTpl->assign('lang_version' , _MD_VERSION);
+$xoopsTpl->assign('lang_subdate' , _MD_SUBMITDATE);
+$xoopsTpl->assign('lang_hits', _MD_HITSC);
+$xoopsTpl->assign('lang_dlnow' , _MD_DLNOW);
+$xoopsTpl->assign('lang_category' , _MD_CATEGORYC);
+$xoopsTpl->assign('lang_size' , _MD_FILESIZE);
+$xoopsTpl->assign('lang_platform' , _MD_SUPPORTEDPLAT);
+$xoopsTpl->assign('lang_homepage' , _MD_HOMEPAGE);
+$xoopsTpl->assign('lang_comments' , _COMMENTS);
+include XOOPS_ROOT_PATH.'/include/comment_view.php';
+include XOOPS_ROOT_PATH.'/footer.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/comment_delete.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/comment_delete.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/comment_delete.php	(revision 405)
@@ -0,0 +1,29 @@
+<?php
+// $Id: comment_delete.php,v 1.1 2004/09/09 05:15:10 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+include '../../mainfile.php';
+include XOOPS_ROOT_PATH.'/include/comment_delete.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/blocks/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/blocks/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/blocks/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/blocks/mydownloads_top.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/blocks/mydownloads_top.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/blocks/mydownloads_top.php	(revision 405)
@@ -0,0 +1,77 @@
+<?php
+// $Id: mydownloads_top.php,v 1.1 2004/09/09 05:15:10 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+/******************************************************************************
+ * Function: b_mydownloads_top_show
+ * Input   : $options[0] = date for the most recent downloads
+ *                    hits for the most popular downloads
+ *           $block['content'] = The optional above content
+ *           $options[1]   = How many downloads are displayes
+ * Output  : Returns the most recent or most popular downloads
+ ******************************************************************************/
+function b_mydownloads_top_show($options) {
+	global $xoopsDB;
+	$block = array();
+	$myts =& MyTextSanitizer::getInstance();
+	//$order = date for most recent reviews
+	//$order = hits for most popular reviews
+	$result = $xoopsDB->query("SELECT lid, cid, title, date, hits FROM ".$xoopsDB->prefix("mydownloads_downloads")." WHERE status>0 ORDER BY ".$options[0]." DESC",$options[1],0);
+	while($myrow=$xoopsDB->fetchArray($result)){
+		$download = array();
+		$title = $myts->makeTboxData4Show($myrow["title"]);
+		if ( !XOOPS_USE_MULTIBYTES ) {
+			if (strlen($myrow['title']) >= $options[2]) {
+				$title = $myts->makeTboxData4Show(substr($myrow['title'],0,($options[2] -1)))."...";
+			}
+		}
+		$download['id'] = $myrow['lid'];
+		$download['cid'] = $myrow['cid'];
+		$download['title'] = $title;
+		if($options[0] == "date"){
+			$download['date'] = formatTimestamp($myrow['date'],"s");
+		}elseif($options[0] == "hits"){
+			$download['hits'] = $myrow['hits'];
+		}
+		$block['downloads'][] = $download;
+	}
+	return $block;
+}
+
+function b_mydownloads_top_edit($options) {
+	$form = ""._MB_MYDOWNLOADS_DISP."&nbsp;";
+	$form .= "<input type=\"hidden\" name=\"options[]\" value=\"";
+	if($options[0] == "date"){
+		$form .= "date\"";
+	}else {
+		$form .= "hits\"";
+	}
+	$form .= " />";
+	$form .= "<input type=\"text\" name=\"options[]\" value=\"".$options[1]."\" />&nbsp;"._MB_MYDOWNLOADS_FILES."";
+	$form .= "&nbsp;<br>"._MB_MYDOWNLOADS_CHARS."&nbsp;<input type='text' name='options[]' value='".$options[2]."' />&nbsp;"._MB_MYDOWNLOADS_LENGTH."";
+	return $form;
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/notification_update.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/notification_update.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/notification_update.php	(revision 405)
@@ -0,0 +1,4 @@
+<?php
+include '../../mainfile.php';
+include XOOPS_ROOT_PATH.'/include/notification_update.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/header.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/header.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/header.php	(revision 405)
@@ -0,0 +1,30 @@
+<?php
+// $Id: header.php,v 1.1 2004/09/09 05:15:10 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+include "../../mainfile.php";
+include XOOPS_ROOT_PATH."/modules/mydownloads/include/functions.php";
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/mydownloads/ratefile.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/mydownloads/ratefile.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/mydownloads/ratefile.php	(revision 405)
@@ -0,0 +1,115 @@
+<?php
+// $Id: ratefile.php,v 1.1 2004/09/09 05:15:10 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+// ------------------------------------------------------------------------- //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+include "header.php";
+include_once XOOPS_ROOT_PATH."/class/module.errorhandler.php";
+$myts =& MyTextSanitizer::getInstance(); // MyTextSanitizer object
+
+if(!empty($HTTP_POST_VARS['submit'])) {
+	$eh = new ErrorHandler; //ErrorHandler object
+	if(empty($xoopsUser)){
+		$ratinguser = 0;
+	}else{
+		$ratinguser = $xoopsUser->getVar('uid');
+	}
+
+	//Make sure only 1 anonymous from an IP in a single day.
+	$anonwaitdays = 1;
+	$ip = getenv("REMOTE_ADDR");
+	$lid = intval($HTTP_POST_VARS['lid']);
+	$cid = intval($HTTP_POST_VARS['cid']);
+	$rating = intval($HTTP_POST_VARS['rating']);
+
+	// Check if Rating is Null
+	if ($rating=="--") {
+		redirect_header("ratefile.php?cid=".$cid."&amp;lid=".$lid."",4,_MD_NORATING);
+		exit();
+	}
+
+	// Check if Download POSTER is voting (UNLESS Anonymous users allowed to post)
+	if ($ratinguser != 0) {
+		$result=$xoopsDB->query("SELECT submitter FROM ".$xoopsDB->prefix("mydownloads_downloads")." WHERE lid=$lid");
+		while(list($ratinguserDB)=$xoopsDB->fetchRow($result)) {
+			if ($ratinguserDB==$ratinguser) {
+				redirect_header("index.php",4,_MD_CANTVOTEOWN);
+				exit();
+			}
+		}
+
+		// Check if REG user is trying to vote twice.
+		$result=$xoopsDB->query("SELECT ratinguser FROM ".$xoopsDB->prefix("mydownloads_votedata")." WHERE lid=$lid");
+		while(list($ratinguserDB)=$xoopsDB->fetchRow($result)) {
+			if ($ratinguserDB==$ratinguser) {
+				redirect_header("index.php",4,_MD_VOTEONCE);
+				exit();
+			}
+		}
+
+	} else {
+
+		// Check if ANONYMOUS user is trying to vote more than once per day.
+		$yesterday = (time()-(86400 * $anonwaitdays));
+		$result=$xoopsDB->query("SELECT COUNT(*) FROM ".$xoopsDB->prefix("mydownloads_votedata")." WHERE lid=$lid AND ratinguser=0 AND ratinghostname = '$ip'  AND ratingtimestamp > $yesterday");
+		list($anonvotecount) = $xoopsDB->fetchRow($result);
+		if ($anonvotecount >= 1) {
+			redirect_header("index.php",4,_MD_VOTEONCE);
+			exit();
+		}
+	}
+
+	//All is well.  Add to Line Item Rate to DB.
+	$newid = $xoopsDB->genId($xoopsDB->prefix("mydownloads_votedata")."_ratingid_seq");
+	$datetime = time();
+	$sql = sprintf("INSERT INTO %s (ratingid, lid, ratinguser, rating, ratinghostname, ratingtimestamp) VALUES (%u, %u, %u, %u, '%s', %u)", $xoopsDB->prefix("mydownloads_votedata"), $newid, $lid, $ratinguser, $rating, $ip, $datetime);
+	$xoopsDB->query($sql) or $eh("0013");
+
+	//All is well.  Calculate Score & Add to Summary (for quick retrieval & sorting) to DB.
+	updaterating($lid);
+	$ratemessage = _MD_VOTEAPPRE."<br />".sprintf(_MD_THANKYOU,$xoopsConfig[sitename]);
+	redirect_header("index.php",4,$ratemessage);
+	exit();
+
+} else {
+
+	$xoopsOption['template_main'] = 'mydownloads_ratefile.html';
+    include XOOPS_ROOT_PATH."/header.php";
+    $lid = intval($HTTP_GET_VARS['lid']);
+    $result=$xoopsDB->query("SELECT title FROM ".$xoopsDB->prefix("mydownloads_downloads")." WHERE lid=$lid");
+    list($title) = $xoopsDB->fetchRow($result);
+    $title = $myts->makeTboxData4Show($title);
+    $xoopsTpl->assign('file', array('id' => $lid, 'cid' => $cid, 'title' => $myts->htmlSpecialChars($title)));
+    $xoopsTpl->assign('lang_voteonce', _MD_VOTEONCE);
+    $xoopsTpl->assign('lang_ratingscale', _MD_RATINGSCALE);
+    $xoopsTpl->assign('lang_beobjective', _MD_BEOBJECTIVE);
+    $xoopsTpl->assign('lang_donotvote', _MD_DONOTVOTE);
+    $xoopsTpl->assign('lang_rateit', _MD_RATEIT);
+    $xoopsTpl->assign('lang_cancel', _CANCEL);
+    include XOOPS_ROOT_PATH.'/footer.php';
+
+}
+include "footer.php";
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/comment_edit.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/comment_edit.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/comment_edit.php	(revision 405)
@@ -0,0 +1,29 @@
+<?php
+// $Id: comment_edit.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+include '../../mainfile.php';
+include XOOPS_ROOT_PATH.'/include/comment_edit.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/comment_post.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/comment_post.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/comment_post.php	(revision 405)
@@ -0,0 +1,29 @@
+<?php
+// $Id: comment_post.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+include '../../mainfile.php';
+include XOOPS_ROOT_PATH.'/include/comment_post.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/index.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/index.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/index.php	(revision 405)
@@ -0,0 +1,81 @@
+<?php
+// $Id: index.php,v 1.3 2005/09/04 20:46:12 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+include 'header.php';
+$myts =& MyTextSanitizer::getInstance();
+$cat_id = isset($_GET['cat_id']) ? intval($_GET['cat_id']) : 0;
+if ($cat_id < 1) {
+	// this page uses smarty template
+	// this must be set before including main header.php
+	$xoopsOption['template_main'] = 'xoopsfaq_index.html';
+	include XOOPS_ROOT_PATH.'/header.php';
+	$xoopsTpl->assign('lang_faq', _XD_DOCS);
+	$xoopsTpl->assign('lang_categories', _XD_CATEGORIES);
+	$result = $xoopsDB->query('SELECT category_id, category_title FROM '.$xoopsDB->prefix('xoopsfaq_categories').' ORDER BY category_order ASC');
+	while (list($id, $name) = $xoopsDB->fetchRow($result)) {
+		$category = array();
+		$category['name'] = $myts->makeTboxData4Show($name);
+		$category['id'] = $id;
+		$sql = 'SELECT contents_id, contents_title FROM '.$xoopsDB->prefix('xoopsfaq_contents').' WHERE contents_visible=1 AND category_id='.$id.' ORDER BY contents_order ASC';
+		$result2 = $xoopsDB->query($sql);
+		while ($myrow = $xoopsDB->fetchArray($result2)) {
+			$category['questions'][] = array('id' => $myrow['contents_id'], 'title' => $myts->makeTboxData4Show($myrow['contents_title']));
+		}
+		$xoopsTpl->append_by_ref('categories', $category);
+		unset($category);
+	}
+} else {
+	// this page uses smarty template
+	// this must be set before including main header.php
+	$xoopsOption['template_main'] = 'xoopsfaq_category.html';
+	include XOOPS_ROOT_PATH.'/header.php';
+	$xoopsTpl->assign('lang_faq', _XD_DOCS);
+	$xoopsTpl->assign('lang_toc', _XD_TOC);
+	$xoopsTpl->assign('lang_main', _XD_MAIN);
+	$xoopsTpl->assign('lang_backtotop', _XD_BACKTOTOP);
+	$xoopsTpl->assign('lang_backtoindex', _XD_BACKTOINDEX);
+	$result = $xoopsDB->query('SELECT category_title FROM '.$xoopsDB->prefix('xoopsfaq_categories').' WHERE category_id='.$cat_id);
+	list($name) = $xoopsDB->fetchRow($result);
+	$xoopsTpl->assign('category_name', $myts->makeTboxData4Show($name));
+
+	$result = $xoopsDB->query('SELECT contents_id, category_id, contents_title, contents_contents, contents_time, contents_nohtml, contents_nosmiley, contents_noxcode FROM '.$xoopsDB->prefix('xoopsfaq_contents').' WHERE contents_visible=1 AND category_id='.$cat_id.' ORDER BY contents_order ASC');
+	$question = array();
+	while (list($id, $cat_id, $title, $contents, $time, $nohtml, $nosmiley, $noxcode) = $xoopsDB->fetchRow($result)) {
+		$title = $myts->makeTboxData4Show($title);
+		$question['title'] = $title;
+		$question['id'] = $id;
+		$html = !empty($nohtml) ? 0 :1;
+		$smiley = !empty($nosmiley) ? 0 :1;
+		$xcode = !empty($noxcode) ? 0 :1;
+		$question['answer'] = $myts->makeTareaData4Show($contents, $html, $smiley, $xcode);
+		$xoopsTpl->append('questions', $question);
+	}
+	include XOOPS_ROOT_PATH.'/include/comment_view.php';
+}
+
+include XOOPS_ROOT_PATH.'/footer.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/header.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/header.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/header.php	(revision 405)
@@ -0,0 +1,29 @@
+<?php
+// $Id: header.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+include "../../mainfile.php";
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/templates/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/templates/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/templates/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/templates/xoopsfaq_index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/templates/xoopsfaq_index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/templates/xoopsfaq_index.html	(revision 405)
@@ -0,0 +1,30 @@
+<h4 style="text-align:left;"><{$lang_faq}></h4>
+<table width="100%" cellspacing="1" class="outer">
+  <tr>
+    <th><{$lang_categories}></th>
+  </tr>
+  <tr>
+    <td class="even">
+
+      <!-- start category loop -->
+      <{foreach item=category from=$categories}>
+
+        &nbsp;&nbsp;<img src="<{$xoops_url}>/modules/xoopsfaq/images/folder.gif" width="14" height="14" border="0" alt="" />&nbsp;<a href="index.php?cat_id=<{$category.id}>"><{$category.name}></a>
+        <ul style="list-style-image:url(images/question.gif);">
+
+        <!-- start question loop -->
+        <{foreach item=question from=$category.questions}>
+
+          <li>&nbsp;<a href="index.php?cat_id=<{$category.id}>#q<{$question.id}>"><{$question.title}></a></li>
+
+        <{/foreach}>
+        <!-- end question loop -->
+
+        </ul>
+
+      <{/foreach}>
+      <!-- end category loop -->
+
+    </td>
+  </tr>
+</table>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/templates/xoopsfaq_category.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/templates/xoopsfaq_category.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/templates/xoopsfaq_category.html	(revision 405)
@@ -0,0 +1,58 @@
+<h4 style="text-align:left;"><{$lang_faq}></h4>
+<a id="top" name="top"></a><a href="index.php"><{$lang_main}></a>&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;<b><{$category_name}></b><br /><br />
+<table width="100%" class="outer" cellspacing="1">
+  <tr>
+    <th colspan="2"><{$lang_toc}></th>
+  </tr>
+  <tr>
+    <td colspan="2" class="even">
+      <ul style="list-style-image:url(images/question.gif);">
+
+      <!-- start question loop -->
+      <{foreach item=question from=$questions}>
+
+        <li>&nbsp;<a href="#q<{$question.id}>"><{$question.title}></a></li>
+
+      <{/foreach}>
+      <!-- end question loop -->
+
+      </ul>
+    </td>
+  </tr>
+</table>
+<br /><br />
+<table width="100%" class="outer" cellspacing="1">
+
+<!-- start question and answer loop -->
+<{foreach item=question from=$questions}>
+
+  <tr>
+    <th><a id="q<{$question.id}>" name="q<{$question.id}>"></a><{$question.title}></th>
+  </tr>
+  <tr>
+    <td class="even"><{$question.answer}><div style="text-align: right"><a href="#top"><{$lang_backtotop}></a></div></td>
+  </tr>
+
+<{/foreach}>
+<!-- end question and answer loop -->
+
+</table>
+<br /><br />
+<div style="text-align:center;"><b>[ <a href="index.php"><{$lang_backtoindex}></a> ]</b></div>
+
+<div style="text-align:center; padding: 3px; margin:3px;">
+  <{$commentsnav}>
+  <{$lang_notice}>
+</div>
+
+<div style="margin:3px; padding: 3px;">
+<!-- start comments loop -->
+<{if $comment_mode == "flat"}>
+  <{include file="db:system_comments_flat.html"}>
+<{elseif $comment_mode == "thread"}>
+  <{include file="db:system_comments_thread.html"}>
+<{elseif $comment_mode == "nest"}>
+  <{include file="db:system_comments_nest.html"}>
+<{/if}>
+<!-- end comments loop -->
+</div>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/sql/mysql.sql
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/sql/mysql.sql	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/sql/mysql.sql	(revision 405)
@@ -0,0 +1,31 @@
+#
+# Table structure for table `xoopsfaq_categories`
+#
+
+CREATE TABLE xoopsfaq_categories (
+  category_id tinyint(3) unsigned NOT NULL auto_increment,
+  category_title varchar(255) NOT NULL default '',
+  category_order tinyint(3) unsigned NOT NULL default '0',
+  PRIMARY KEY  (category_id)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `xoopsfaq_contents`
+#
+
+CREATE TABLE xoopsfaq_contents (
+  contents_id smallint(5) unsigned NOT NULL auto_increment,
+  category_id tinyint(3) unsigned NOT NULL default '0',
+  contents_title varchar(255) NOT NULL default '',
+  contents_contents text NOT NULL,
+  contents_time int(10) unsigned NOT NULL default '0',
+  contents_order smallint(5) unsigned NOT NULL default '0',
+  contents_visible tinyint(1) unsigned NOT NULL default '1',
+  contents_nohtml tinyint(1) unsigned NOT NULL default '0',
+  contents_nosmiley tinyint(1) unsigned NOT NULL default '0',
+  contents_noxcode tinyint(1) unsigned NOT NULL default '0',
+  PRIMARY KEY  (contents_id),
+  KEY contents_title (contents_title(40)),
+  KEY contents_visible_category_id (contents_visible,category_id)
+) TYPE=MyISAM;
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/sql/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/sql/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/sql/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/comment_new.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/comment_new.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/comment_new.php	(revision 405)
@@ -0,0 +1,29 @@
+<?php
+// $Id: comment_new.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+include '../../mainfile.php';
+include XOOPS_ROOT_PATH.'/include/comment_new.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/comment_reply.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/comment_reply.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/comment_reply.php	(revision 405)
@@ -0,0 +1,29 @@
+<?php
+// $Id: comment_reply.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+include '../../mainfile.php';
+include XOOPS_ROOT_PATH.'/include/comment_reply.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/include/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/include/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/include/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/include/search.inc.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/include/search.inc.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/include/search.inc.php	(revision 405)
@@ -0,0 +1,60 @@
+<?php
+// $Id: search.inc.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+function xoopsfaq_search($queryarray, $andor, $limit, $offset, $userid)
+{
+	global $xoopsDB;
+	$ret = array();
+	if ( $userid != 0 ) {
+		return $ret;
+	}
+	$sql = "SELECT contents_id, category_id, contents_title, contents_contents, contents_time FROM ".$xoopsDB->prefix("xoopsfaq_contents")." WHERE contents_visible=1 ";
+	// because count() returns 1 even if a supplied variable
+	// is not an array, we must check if $querryarray is really an array
+	$count = count($queryarray);
+	if ( $count > 0 && is_array($queryarray) ) {
+		$sql .= "AND ((contents_title LIKE '%$queryarray[0]%' OR contents_contents LIKE '%$queryarray[0]%')";
+		for ( $i = 1; $i < $count; $i++ ) {
+			$sql .= " $andor ";
+			$sql .= "(contents_title LIKE '%$queryarray[$i]%' OR contents_contents LIKE '%$queryarray[$i]%')";
+		}
+		$sql .= ") ";
+	}
+	$sql .= "ORDER BY contents_id DESC";
+	$result = $xoopsDB->query($sql,$limit,$offset);
+	$i = 0;
+ 	while ( $myrow = $xoopsDB->fetchArray($result) ) {
+		$ret[$i]['image'] = "images/question2.gif";
+		$ret[$i]['link'] = "index.php?cat_id=".$myrow['category_id']."#".$myrow['contents_id'];
+		$ret[$i]['title'] = $myrow['contents_title'];
+		$ret[$i]['time'] = $myrow['contents_time'];
+		//$ret[$i]['uid'] = $myrow['contents_uid'];
+		$i++;
+	}
+	return $ret;
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/language/japanese/modinfo.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/language/japanese/modinfo.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/language/japanese/modinfo.php	(revision 405)
@@ -0,0 +1,16 @@
+<?php
+// $Id: modinfo.php,v 1.2 2005/03/18 13:00:59 onokazu Exp $
+// Module Info
+// The name of this module
+define("_MI_XOOPSFAQ_NAME","FAQ");
+
+// A brief description of this module
+define("_MI_XOOPSFAQ_DESC","FAQ¤òºîÀ®¤¹¤ë¤¿¤á¤Î¥â¥¸¥å¡¼¥ë");
+
+// Names of admin menu items
+define("_MI_XOOPSFAQ_ADMENU1", "FAQ°ìÍ÷");
+
+// Names of blocks for this module (Not all module has blocks)
+//define("_MI_","");
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/language/japanese/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/language/japanese/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/language/japanese/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/language/japanese/main.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/language/japanese/main.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/language/japanese/main.php	(revision 405)
@@ -0,0 +1,25 @@
+<?php
+// $Id: main.php,v 1.2 2005/03/18 13:00:59 onokazu Exp $
+//%%%%%%	Module Name 'XOOPS FAQ'		  %%%%%
+define("_XD_DOCS","FAQ¡Ê¤è¤¯¤¢¤ë¼ÁÌä¤È²óÅú¡Ë");
+define("_XD_CATEGORY","¥«¥Æ¥´¥ê");
+define("_XD_MAIN","¥á¥¤¥ó¥Ú¡¼¥¸");
+define("_XD_TOC","ÌÜ¼¡");
+define("_XD_TITLE","¥¿¥¤¥È¥ë");
+define("_XD_CONTENTS","¼ÁÌä/²óÅú");
+define("_XD_ANSWER","²óÅú");
+define("_XD_QUESTION","¼ÁÌä");
+define("_XD_BACKTOTOP","¥È¥Ã¥×¤ËÌá¤ë");
+define("_XD_BACKTOINDEX","¥á¥¤¥ó¥Ú¡¼¥¸");
+define("_XD_CATEGORIES","¥«¥Æ¥´¥ê");
+define("_XD_ORDER","É½¼¨½ç");
+define("_XD_DISPLAY","É½¼¨¤¹¤ë");
+define("_XD_ADDCAT","¥«¥Æ¥´¥ê¤ÎÄÉ²Ã");
+define("_XD_ADDCONTENTS","¼ÁÌä/²óÅú¤ÎÄÉ²Ã");
+define("_XD_NOHTML","HTML¥¿¥°¤òÌµ¸ú¤Ë¤¹¤ë");
+define("_XD_NOSMILEY","´é¥¢¥¤¥³¥ó¤òÌµ¸ú¤Ë¤¹¤ë");
+define("_XD_NOXCODE","XOOPS¥³¡¼¥É¤òÌµ¸ú¤Ë¤¹¤ë");
+define("_XD_EDITCONTENTS","¼ÁÌä/²óÅú¤ÎÊÔ½¸");
+define("_XD_RUSURECAT","¤³¤Î¥«¥Æ¥´¥ê¤ª¤è¤Ó¥«¥Æ¥´¥ê¤Ë´Þ¤Þ¤ì¤ë¼ÁÌä/²óÅú¤òÁ´¤Æºï½ü¤·¤Æ¤âÎÉ¤¤¤Ç¤¹¤«¡©");
+define("_XD_DBSUCCESS","¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò¹¹¿·¤·¤Þ¤·¤¿");
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/language/english/modinfo.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/language/english/modinfo.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/language/english/modinfo.php	(revision 405)
@@ -0,0 +1,16 @@
+<?php
+// $Id: modinfo.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+// Module Info
+// The name of this module
+define("_MI_XOOPSFAQ_NAME","FAQ");
+
+// A brief description of this module
+define("_MI_XOOPSFAQ_DESC","FAQ Manager");
+
+// Names of admin menu items
+define("_MI_XOOPSFAQ_ADMENU1", "List FAQ");
+
+// Names of blocks for this module (Not all module has blocks)
+//define("_MI_","");
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/language/english/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/language/english/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/language/english/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/language/english/main.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/language/english/main.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/language/english/main.php	(revision 405)
@@ -0,0 +1,25 @@
+<?php
+// $Id: main.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+//%%%%%%	Module Name 'XOOPS FAQ'		  %%%%%
+define("_XD_DOCS","FAQ");
+define("_XD_CATEGORY","Category");
+define("_XD_MAIN","Main");
+define("_XD_TOC","Table of Contents");
+define("_XD_TITLE","Title");
+define("_XD_ANSWER","Answer");
+define("_XD_QUESTION","Question");
+define("_XD_CONTENTS","Question & Answer");
+define("_XD_BACKTOTOP","Back to Top");
+define("_XD_BACKTOINDEX","Back to Index");
+define("_XD_CATEGORIES","Categories");
+define("_XD_ORDER","Order");
+define("_XD_DISPLAY","Display");
+define("_XD_ADDCAT","Add Category");
+define("_XD_ADDCONTENTS","Add FAQ");
+define("_XD_NOHTML","Disable HTML tags");
+define("_XD_NOSMILEY","Disable Smiley icons");
+define("_XD_NOXCODE","Disable XOOPS codes");
+define("_XD_EDITCONTENTS","Edit Contents");
+define("_XD_RUSURECAT","Are you sure you want to delete this category and all of its FAQ?");
+define("_XD_DBSUCCESS","Database Updated Successfully!");
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/language/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/language/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/language/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/xoops_version.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/xoops_version.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/xoops_version.php	(revision 405)
@@ -0,0 +1,71 @@
+<?php
+// $Id: xoops_version.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+$modversion['name'] = _MI_XOOPSFAQ_NAME;
+$modversion['version'] = 1.10;
+$modversion['description'] = _MI_XOOPSFAQ_DESC;
+$modversion['credits'] = "The XOOPS Project";
+$modversion['author'] = "Kazumi Ono http://www.myweb.ne.jp/";
+$modversion['help'] = "xoopsfaq.html";
+$modversion['license'] = "GPL see LICENSE";
+$modversion['official'] = 1;
+$modversion['image'] = "images/slogo.png";
+$modversion['dirname'] = "xoopsfaq";
+
+// Sql file (must contain sql generated by phpMyAdmin or phpPgAdmin)
+// All tables should not have any prefix!
+$modversion['sqlfile']['mysql'] = "sql/mysql.sql";
+//$modversion['sqlfile']['postgresql'] = "sql/pgsql.sql";
+
+// Tables created by sql file (without prefix!)
+$modversion['tables'][0] = "xoopsfaq_contents";
+$modversion['tables'][1] = "xoopsfaq_categories";
+
+// Admin things
+$modversion['hasAdmin'] = 1;
+$modversion['adminindex'] = "admin/index.php";
+$modversion['adminmenu'] = "admin/menu.php";
+
+// Main contents
+$modversion['hasMain'] = 1;
+
+// Search
+$modversion['hasSearch'] = 1;
+$modversion['search']['file'] = "include/search.inc.php";
+$modversion['search']['func'] = "xoopsfaq_search";
+
+// Templates
+$modversion['templates'][1]['file'] = 'xoopsfaq_index.html';
+$modversion['templates'][1]['description'] = '';
+$modversion['templates'][2]['file'] = 'xoopsfaq_category.html';
+$modversion['templates'][2]['description'] = '';
+
+// Comments
+$modversion['hasComments'] = 1;
+$modversion['comments']['pageName'] = 'index.php';
+$modversion['comments']['itemName'] = 'cat_id';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/images/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/images/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/images/index.html	(revision 405)
@@ -0,0 +1,1 @@
+<script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/admin/contentsform.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/admin/contentsform.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/admin/contentsform.php	(revision 405)
@@ -0,0 +1,56 @@
+<?php
+// $Id: contentsform.php,v 1.3 2005/08/03 12:40:01 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+echo "<form action='index.php' method='post'>
+<table border='0' cellpadding='0' cellspacing='0' width='100%'><tr><td class='bg2'>
+<table width='100%' border='0' cellpadding='4' cellspacing='1'>
+<tr><td nowrap='nowrap' class='bg3'>"._XD_QUESTION." </td><td class='bg1'><input type='text' name='contents_title' value='$contents_title' size='31' maxlength='255' /></td></tr>
+<tr><td nowrap='nowrap' class='bg3'>"._XD_ORDER." </td><td class='bg1'><input type='text' name='contents_order' value='".$contents_order."' size='4' maxlength='3' /></td></tr>";
+
+$checked = ($contents_visible == 1) ? " checked='checked'" : "";
+
+echo "<tr><td nowrap='nowrap' class='bg3'>"._XD_DISPLAY." </td><td class='bg1'><input type='checkbox' name='contents_visible' value='1'$checked /></td></tr>
+<tr><td nowrap='nowrap' class='bg3'>"._XD_ANSWER." </td><td class='bg1'>";
+
+include_once XOOPS_ROOT_PATH."/include/xoopscodes.php";
+
+xoopsCodeTarea("contents_contents", 60, 20);
+xoopsSmilies("contents_contents");
+
+$checked = ($contents_nohtml == 1) ? " checked='checked'" : "";
+echo "<br /><input type='checkbox' name='contents_nohtml' value='1'$checked />"._XD_NOHTML."<br />";
+
+$checked = ($contents_nosmiley == 1) ? " checked='checked'" : "";
+echo "<input type='checkbox' name='contents_nosmiley' value='1'$checked />"._XD_NOSMILEY."<br />";
+
+$checked = ($contents_noxcode == 1) ? " checked='checked'" : "";
+echo "<input type='checkbox' name='contents_noxcode' value='1'$checked />"._XD_NOXCODE."</td></tr>
+<tr><td nowrap='nowrap' class='bg3'>&nbsp;</td><td class='bg1'><input type='hidden' name='category_id' value='".$category_id."' /><input type='hidden' name='contents_id' value='".$contents_id."' /><input type='hidden' name='op' value='$op' /><input type='submit' name='contents_preview' value='"._PREVIEW."' />&nbsp;<input type='submit' name='contents_submit' value='"._SUBMIT."' /></td></tr>
+</table></td></tr></table>
+</form>";
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/admin/menu.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/admin/menu.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/admin/menu.php	(revision 405)
@@ -0,0 +1,30 @@
+<?php
+// $Id: menu.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+$adminmenu[0]['title'] = _MI_XOOPSFAQ_ADMENU1;
+$adminmenu[0]['link'] = "admin/index.php";
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/admin/index.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/admin/index.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/admin/index.php	(revision 405)
@@ -0,0 +1,323 @@
+<?php
+// $Id: index.php,v 1.4 2005/08/03 12:40:01 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+include '../../../include/cp_header.php';
+if ( file_exists("../language/".$xoopsConfig['language']."/main.php") ) {
+    include "../language/".$xoopsConfig['language']."/main.php";
+} else {
+    include "../language/english/main.php";
+}
+$op = "listcat";
+
+if (!empty($_GET['op'])) {
+    $cat_id = !empty($_GET['cat_id']) ? intval($_GET['cat_id']) : 0;
+    $op = $_GET['op'];
+} elseif (!empty($_POST['op'])) {
+    $op = $_POST['op'];
+}
+
+if ( !empty($_POST['contents_preview']) ) {
+    $myts =& MyTextSanitizer::getInstance();
+    xoops_cp_header();
+
+    $contents_nohtml = !empty($_POST['contents_nohtml']) ? 1 : 0;
+    $contents_nosmiley = !empty($_POST['contents_nosmiley']) ? 1 : 0;
+    $contents_noxcode = !empty($_POST['contents_noxcode']) ? 1 : 0;
+    $html = empty($contents_nohtml) ? 1 : 0;
+    $smiley = empty($contents_nosmiley) ? 1 : 0;
+    $xcode = empty($contents_noxcode) ? 1 : 0;
+    $contents_visible = !empty($_POST['contents_visible']) ? 1 : 0;
+    $contents_order = !empty($_POST['contents_order']) ? intval($_POST['contents_order']) : 0;
+    $contents_id = !empty($_POST['contents_id']) ? intval($_POST['contents_id']) : 0;
+    $category_id = !empty($_POST['category_id']) ? intval($_POST['category_id']) : 0;
+    $p_title = $myts->makeTboxData4Preview($_POST['contents_title']);
+    $p_contents = $myts->makeTareaData4Preview($_POST['contents_contents'], $contents_nohtml, $contents_nosmiley, $contents_noxcode);
+    echo"<table border='0' cellpadding='0' cellspacing='0' width='100%'><tr><td class='bg2'>
+    <table width='100%' border='0' cellpadding='4' cellspacing='1'>
+    <tr class='bg3' align='center'><td align='left'>$p_title</td></tr><tr class='bg1'><td>$p_contents</td></tr></table></td></tr></table><br />";
+    $contents_title = $myts->makeTboxData4PreviewInForm($_POST['contents_title']);
+    $contents_contents = $myts->makeTareaData4PreviewInForm($_POST['contents_contents']);
+    include "contentsform.php";
+
+    xoops_cp_footer();
+    exit();
+}
+
+if ($op == "listcat") {
+    $myts =& MyTextSanitizer::getInstance();
+    xoops_cp_header();
+
+    echo "
+    <h4 style='text-align:left;'>"._XD_DOCS."</h4>
+    <form action='index.php' method='post'>
+    <table border='0' cellpadding='0' cellspacing='0' width='100%'><tr><td class='bg2'>
+    <table width='100%' border='0' cellpadding='4' cellspacing='1'>
+    <tr class='bg3' align='center'><td align='left'>"._XD_CATEGORY."</td><td>"._XD_ORDER."</td><td>"._XD_CONTENTS."</td><td>&nbsp;</td></tr>";
+    $result = $xoopsDB->query("SELECT c.category_id, c.category_title, c.category_order, COUNT(f.category_id) FROM ".$xoopsDB->prefix("xoopsfaq_categories")." c LEFT JOIN ".$xoopsDB->prefix("xoopsfaq_contents")." f ON f.category_id=c.category_id GROUP BY c.category_id ORDER BY c.category_order ASC");
+    $count = 0;
+    while ( list($cat_id, $category, $category_order, $faq_count) = $xoopsDB->fetchRow($result) ) {
+        $category=$myts->makeTboxData4Edit($category);
+        echo "<tr class='bg1'><td align='left'><input type='hidden' value='$cat_id' name='cat_id[]' /><input type='hidden' value='$category' name='oldcategory[]' /><input type='text' value='$category' name='newcategory[]' maxlength='255' size='20' /></td>
+        <td align='center'><input type='hidden' value='$category_order' name='oldorder[]' /><input type='text' value='$category_order' name='neworder[]' maxlength='3' size='4' /></td>
+        <td align='center'>$faq_count</td>
+        <td align='right'><a href='index.php?op=listcontents&amp;cat_id=".$cat_id."'>" ._XD_CONTENTS."</a> | <a href='index.php?op=delcat&amp;cat_id=".$cat_id."&amp;ok=0'>"._DELETE."</a></td></tr>";
+        $count++;
+    }
+    if ($count > 0) {
+        echo "<tr align='center' class='bg3'><td colspan='4'><input type='submit' value='"._SUBMIT."' /><input type='hidden' name='op' value='editcatgo' /></td></tr>";
+    }
+    echo "</table></td></tr></table></form>
+    <br /><br />
+    <h4 style='text-align:left;'>"._XD_ADDCAT."</h4>
+    <form action='index.php' method='post'>
+    <table border='0' cellpadding='0' cellspacing='0' width='100%'><tr><td class='bg2'><table width='100%' border='0' cellpadding='4' cellspacing='1'><tr nowrap='nowrap'><td class='bg3'>"._XD_TITLE." </td><td class='bg1'><input type='text' name='category' size='30' maxlength='255' /></td></tr>
+    <tr nowrap='nowrap'><td class='bg3'>"._XD_ORDER." </td><td class='bg1'><input type='text' name='order' size='4' maxlength='3' /></td></tr>
+    <tr><td class='bg3'>&nbsp;</td><td class='bg1'><input type='hidden' name='op' value='addcatgo' /><input type='submit' value='"._SUBMIT."' /></td></tr>
+    </table></td></tr></table></form>";
+
+    xoops_cp_footer();
+    exit();
+}
+
+if ($op == "addcatgo") {
+    $myts =& MyTextSanitizer::getInstance();
+    $category = $myts->stripSlashesGPC($_POST['category']);
+    $newid = $xoopsDB->genId($xoopsDB->prefix("xoopsfaq_categories")."_category_id_seq");
+    $sql = "INSERT INTO ".$xoopsDB->prefix("xoopsfaq_categories")." (category_id, category_title, category_order) VALUES ($newid, ".$xoopsDB->quoteString($category).", ".intval($_POST['order']).")";
+    if (!$xoopsDB->query($sql)) {
+        xoops_cp_header();
+        echo "Could not add category";
+        xoops_cp_footer();
+    } else {
+        redirect_header("index.php?op=listcat",1,_XD_DBSUCCESS);
+    }
+    exit();
+}
+
+if ($op == "editcatgo") {
+    $myts =& MyTextSanitizer::getInstance();
+    $count = count($_POST['newcategory']);
+    for ($i = 0; $i < $count; $i++) {
+        if ( $_POST['newcategory'][$i] != $_POST['oldcategory'][$i] || $_POST['neworder'][$i] != $_POST['oldorder'][$i] ) {
+            $category = $myts->stripSlashesGPC($_POST['newcategory'][$i]);
+            $sql = "UPDATE ".$xoopsDB->prefix("xoopsfaq_categories")." SET category_title=".$xoopsDB->quoteString($category).", category_order=".intval($_POST['neworder'][$i])." WHERE category_id=".intval($_POST['cat_id'][$i]);
+            $xoopsDB->query($sql);
+        }
+    }
+    redirect_header("index.php?op=listcat",1,_XD_DBSUCCESS);
+    exit();
+}
+
+if ($op == "listcontents") {
+    $myts =& MyTextSanitizer::getInstance();
+    xoops_cp_header();
+    $sql = "SELECT category_title FROM ".$xoopsDB->prefix("xoopsfaq_categories")." WHERE category_id=".$cat_id;
+    $result = $xoopsDB->query($sql);
+    list($category) = $xoopsDB->fetchRow($result);
+    $category = $myts->makeTboxData4Show($category);
+
+    echo "<a href='index.php'>" ._XD_MAIN."</a>&nbsp;<span style='font-weight:bold;'>&raquo;&raquo;</span>&nbsp;".$category."<br /><br />
+    <h4 style='text-align:left;'>"._XD_CONTENTS."</h4>
+    <form action='index.php' method='post'>
+    <table border='0' cellpadding='0' cellspacing='0' width='100%'><tr><td class='bg2'>
+    <table width='100%' border='0' cellpadding='4' cellspacing='1'>
+    <tr class='bg3'><td>"._XD_TITLE."</td><td align='center'>"._XD_ORDER."</td><td align='center'>"._XD_DISPLAY."</td><td>&nbsp;</td></tr>";
+    $result = $xoopsDB->query("SELECT contents_id, contents_title, contents_time, contents_order, contents_visible FROM ".$xoopsDB->prefix("xoopsfaq_contents")." WHERE category_id=".$cat_id." ORDER BY contents_order");
+    $count = 0;
+    while(list($id, $title, $time, $order, $visible) = $xoopsDB->fetchRow($result)) {
+        $title = $myts->makeTboxData4Show($title);
+        echo "<tr class='bg1'><td><input type='hidden' value='$id' name='id[]' />".$title."</td>
+        <td align='center'><input type='hidden' value='$order' name='oldorder[$id]' /><input type='text' value='$order' name='neworder[$id]' maxlength='3' size='4' /></td>";
+        $checked = ($visible == 1) ? " checked='checked'" : "";
+        echo "<td align='center'><input type='hidden' value='$visible' name='oldvisible[$id]' /><input type='checkbox' value='1' name='newvisible[$id]'".$checked." /></td>
+        <td align='right'><a href='index.php?op=editcontents&amp;id=".$id."&amp;cat_id=".$cat_id."'>"._EDIT."</a> | <a href='index.php?op=delcontents&amp;id=".$id."&amp;ok=0&amp;cat_id=".$cat_id."'>"._DELETE."</a></td></tr>";
+        $count++;
+    }
+    if ($count > 0) {
+        echo "<tr align='center' class='bg3'><td colspan='4'><input type='submit' value='"._SUBMIT."' /><input type='hidden' name='op' value='quickeditcontents' /><input type='hidden' name='cat_id' value='".$cat_id."' /></td></tr>";
+    }
+    echo "</table></td></tr></table></form>
+    <br /><br />
+    <h4 style='text-align:left;'>"._XD_ADDCONTENTS."</h4>";
+    $contents_title = "";
+    $contents_contents = "";
+    $contents_order = 0;
+    $contents_visible = 1;
+    $contents_nohtml = 0;
+    $contents_nosmiley = 0;
+    $contents_noxcode = 0;
+    $contents_id = 0;
+    $category_id = $cat_id;
+    $op = "addcontentsgo";
+    include "contentsform.php";
+
+    xoops_cp_footer();
+    exit();
+}
+
+if ($op == "quickeditcontents") {
+    $myts =& MyTextSanitizer::getInstance();
+    $cat_id = !empty($_POST['cat_id']) ? intval($_POST['cat_id']) : 0;
+    $count = count($_POST['id']);
+    for ($i = 0; $i < $count; $i++) {
+        $index = intval($_POST['id'][$i]);
+        if ( $_POST['neworder'][$index] != $_POST['oldorder'][$index] || $_POST['newvisible'][$index] != $_POST['oldvisible'][$index] ) {
+            $xoopsDB->query("UPDATE ".$xoopsDB->prefix("xoopsfaq_contents")." SET contents_order=".intval($_POST['neworder'][$index]).", contents_visible=".intval($_POST['newvisible'][$index])." WHERE contents_id=".$index);
+        }
+    }
+    redirect_header("index.php?op=listcontents&amp;cat_id=$cat_id",1,_XD_DBSUCCESS);
+    exit();
+}
+
+if ($op == "addcontentsgo") {
+    $category_id = !empty($_POST['category_id']) ? intval($_POST['category_id']) : 0;
+    if ($category_id > 0) {
+        $contents_nohtml = !empty($_POST['contents_nohtml']) ? 1 : 0;
+        $contents_nosmiley = !empty($_POST['contents_nosmiley']) ? 1 : 0;
+        $contents_noxcode = !empty($_POST['contents_noxcode']) ? 1 : 0;
+        $contents_visible = !empty($_POST['contents_visible']) ? 1 : 0;
+        $contents_order = !empty($_POST['contents_order']) ? intval($_POST['contents_order']) : 0;
+        $myts =& MyTextSanitizer::getInstance();
+        $title = $myts->stripSlashesGPC($_POST['contents_title']);
+        $contents = $myts->makeTareaData4Save($_POST['contents_contents']);
+        $newid = $xoopsDB->genId($xoopsDB->prefix("xoopsfaq_contents")."_contents_id_seq");
+        $sql = "INSERT INTO ".$xoopsDB->prefix("xoopsfaq_contents")." (contents_id, category_id, contents_title, contents_contents, contents_time, contents_order, contents_visible, contents_nohtml, contents_nosmiley, contents_noxcode) VALUES ($newid, $category_id, ".$xoopsDB->quoteString($title).", ".$xoopsDB->quoteString($contents).", ".time().", ".$contents_order.", ".$contents_visible.", ".$contents_nohtml.", ".$contents_nosmiley.", ".$contents_noxcode.")";
+        if (!$xoopsDB->query($sql)) {
+            xoops_cp_header();
+            echo "Could not add contents";
+            xoops_cp_footer();
+        } else {
+            redirect_header("index.php?op=listcontents&amp;cat_id=$category_id",1,_XD_DBSUCCESS);
+        }
+    }
+    exit();
+}
+
+if ($op == "editcontents") {
+    $id = !empty($_GET['id']) ? intval($_GET['id']) : 0;
+    if ($id <= 0 || $cat_id <= 0) {
+        exit();
+    }
+    $myts =& MyTextSanitizer::getInstance();
+    xoops_cp_header();
+    $sql = "SELECT category_title FROM ".$xoopsDB->prefix("xoopsfaq_categories")." WHERE category_id=".$cat_id;
+    $result = $xoopsDB->query($sql);
+    list($category) = $xoopsDB->fetchRow($result);
+    $category = $myts->makeTboxData4Show($category);
+    $result = $xoopsDB->query("SELECT * FROM ".$xoopsDB->prefix("xoopsfaq_contents")." WHERE contents_id=$id");
+    $myrow = $xoopsDB->fetchArray($result);
+    $contents_title = $myts->makeTboxData4Edit($myrow['contents_title']);
+    $contents_contents = $myts->makeTareaData4Edit($myrow['contents_contents']);
+    $contents_order = $myrow['contents_order'];
+    $contents_visible = $myrow['contents_visible'];
+    $contents_nohtml = $myrow['contents_nohtml'];
+    $contents_nosmiley = $myrow['contents_nosmiley'];
+    $contents_noxcode = $myrow['contents_noxcode'];
+    $contents_id = $myrow['contents_id'];
+    $category_id = $myrow['category_id'];
+    $op = "editcontentsgo";
+
+    echo "<a href='index.php'>" ._XD_MAIN."</a>&nbsp;<span style='font-weight:bold;'>&raquo;&raquo;</span>&nbsp;<a href='index.php?op=listcontents&amp;cat_id=$cat_id'>".$category."</a>&nbsp;<span style='font-weight:bold;'>&raquo;&raquo;</span>&nbsp;"._XD_EDITCONTENTS."<br /><br />
+    <h4 style='text-align:left;'>"._XD_EDITCONTENTS."</h4>";
+    include "contentsform.php";
+
+    xoops_cp_footer();
+    exit();
+}
+
+if ($op == "editcontentsgo") {
+    $contents_id = !empty($_POST['contents_id']) ? intval($_POST['contents_id']) : 0;
+    $myts =& MyTextSanitizer::getInstance();
+    $title = !empty($_POST['contents_title']) ? $myts->stripSlashesGPC($_POST['contents_title']) : '';
+    $contents = !empty($_POST['contents_contents']) ? $myts->stripSlashesGPC($_POST['contents_contents']) : '';
+    $contents_nohtml = empty($_POST['contents_nohtml']) ? 0 : 1;
+    $contents_nosmiley = empty($_POST['contents_nosmiley']) ? 0 : 1;
+    $contents_noxcode = empty($_POST['contents_noxcode']) ? 0 : 1;
+    $contents_visible = !empty($_POST['contents_visible']) ? 1 : 0;
+    $contents_order = !empty($_POST['contents_order']) ? intval($_POST['contents_order']) : 0;
+    $sql = "UPDATE ".$xoopsDB->prefix("xoopsfaq_contents")." set contents_title=".$xoopsDB->quoteSTring($title).", contents_contents=".$xoopsDB->quoteSTring($contents).", contents_time=".time().", contents_order=".$contents_order.", contents_visible=".$contents_visible.", contents_nohtml=".$contents_nohtml.", contents_nosmiley=".$contents_nosmiley.", contents_noxcode=".$contents_noxcode." WHERE contents_id=".$contents_id;
+    if (!$xoopsDB->query($sql)) {
+        xoops_cp_header();
+        echo "Could not update contents";
+        xoops_cp_footer();
+    } else {
+        redirect_header("index.php?op=listcontents&amp;cat_id=".intval($_POST['category_id']),1,_XD_DBSUCCESS);
+    }
+    exit();
+}
+
+if ($op == "delcatgo") {
+    $cat_id = !empty($_POST['cat_id']) ? intval($_POST['cat_id']) : 0;
+    if ($cat_id <= 0) {
+        exit();
+    }
+    $sql = sprintf("DELETE FROM %s WHERE category_id = %u", $xoopsDB->prefix("xoopsfaq_categories"), $cat_id);
+    if (!$xoopsDB->query($sql)) {
+        xoops_cp_header();
+        echo "Could not delete category";
+        xoops_cp_footer();
+    } else {
+        $sql = sprintf("DELETE FROM %s WHERE category_id = %u", $xoopsDB->prefix("xoopsfaq_contents"), $cat_id);
+        $xoopsDB->query($sql);
+        // delete comments
+        xoops_comment_delete($xoopsModule->getVar('mid'), $cat_id);
+        redirect_header("index.php?op=listcat",1,_XD_DBSUCCESS);
+    }
+    exit();
+}
+
+if ($op == 'delcat') {
+    xoops_cp_header();
+    xoops_confirm(array('op' => 'delcatgo', 'cat_id' => $cat_id), 'index.php', _XD_RUSURECAT);
+    xoops_cp_footer();
+    exit();
+}
+
+if ($op == "delcontentsgo") {
+    $id = !empty($_POST['id']) ? intval($_POST['id']) : 0;
+    if ($id <= 0) {
+        exit();
+    }
+    $sql = sprintf("DELETE FROM %s WHERE contents_id = %u", $xoopsDB->prefix("xoopsfaq_contents"), $id);
+    if (!$xoopsDB->query($sql)) {
+        xoops_cp_header();
+        echo "Could not delete contents";
+        xoops_cp_footer();
+    } else {
+        redirect_header("index.php?op=listcontents&amp;cat_id=".intval($_POST['cat_id']),1,_XD_DBSUCCESS);
+    }
+    exit();
+}
+
+if ($op == "delcontents") {
+    $id = !empty($_GET['id']) ? intval($_GET['id']) : 0;
+    xoops_cp_header();
+    xoops_confirm(array('op' => 'delcontentsgo', 'id' => $id, 'cat_id' => $cat_id), 'index.php', _XD_RUSURECAT);
+    xoops_cp_footer();
+    exit();
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/comment_delete.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/comment_delete.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsfaq/comment_delete.php	(revision 405)
@@ -0,0 +1,29 @@
+<?php
+// $Id: comment_delete.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+include '../../mainfile.php';
+include XOOPS_ROOT_PATH.'/include/comment_delete.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/rssj/sql/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/rssj/sql/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/rssj/sql/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/rssj/sql/mysql.sql
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/rssj/sql/mysql.sql	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/rssj/sql/mysql.sql	(revision 405)
@@ -0,0 +1,30 @@
+#
+# Table structure for table `rssfitJ_misc`
+#
+CREATE TABLE `rssfitJ_misc` (
+  `misc_id` smallint(5) unsigned NOT NULL auto_increment,
+  `misc_category` varchar(15) NOT NULL default '',
+  `misc_title` varchar(255) NOT NULL default '',
+  `misc_content` text NOT NULL,
+  PRIMARY KEY  (`misc_id`)
+) TYPE=MyISAM ;
+
+#
+# Dumping data for table `rssfitJ_misc`
+#
+INSERT INTO `rssfitJ_misc` VALUES (1, 'intro', 'Syndicate this site', '<a href="rss.php"><img src="images/rss.gif" alt="RSS feed" /></a> <a href="rss.php"> <img src="images/xml.gif" alt="RSS feed" /></a>\n\nAt {SITENAME} we provide our XML <a href="rss.php">RSS feed</a> that you can quickly find the latest updates and short descriptions with an RSS reader.\n\nIf you are unfamiliar with RSS, it is a <a href="http://blogs.law.harvard.edu/tech/rss">web standard</a> for publishing news headlines. You can read the RSS feed with special software and easily embed them into blogs and other web content.\n\nFor the RSS reader software, we recommend <a href="http://ranchero.com/netnewswire/#lite">NetNewsWire Lite</a> (Mac OS X), <a href="http://sourceforge.net/projects/feedreader">Feedreader</a> (Windows) and <a href="http://www.disobey.com/amphetadesk/">AmphetaDesk</a> (cross platform), or you may search for an <a href="http://www.google.com/search?ie=UTF-8&oe=UTF-8&q=RSS+reader">RSS reader</a> in Google.\n\nBy the way, the RSS feed of this site is generated by <a href="http://gyakubiki.kir.jp/">RSSFitJ</a>.');
+
+#
+# Table structure for table `rssfitJ_plugins`
+#
+CREATE TABLE `rssfitJ_plugins` (
+  `rssfj_conf_id` int(5) unsigned NOT NULL auto_increment,
+  `rssfj_filename` varchar(50) NOT NULL default '',
+  `rssfj_activated` tinyint(1) NOT NULL default '0',
+  `rssfj_grab` tinyint(2) NOT NULL default '0',
+  `rssfj_order` tinyint(2) NOT NULL default '0',
+  `rssfj_param` text NOT NULL default '',
+  PRIMARY KEY  (`rssfj_conf_id`),
+  KEY `rssfj_activated` (`rssfj_activated`),
+  KEY `rssfj_order` (`rssfj_order`)
+) TYPE=MyISAM ;
Index: /temp/test-xoops.ec-cube.net/html/modules/rssj/plugins/rssfitj.mydownloads.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/rssj/plugins/rssfitj.mydownloads.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/rssj/plugins/rssfitj.mydownloads.php	(revision 405)
@@ -0,0 +1,153 @@
+<?php
+###############################################################################
+##                RSSFit - Extendable XML news feed generator                ##
+##                   Copyright (c) 2004 NS Tai (aka tuff)                    ##
+##                       <http://www.brandycoke.com/>                        ##
+##                      Modified By 2005 CACHE RSSfitJ                       ##
+##                       <http://gyakubiki.kir.jp/>                          ##
+###############################################################################
+##                    XOOPS - PHP Content Management System                  ##
+##                       Copyright (c) 2000 XOOPS.org                        ##
+##                          <http://www.xoops.org/>                          ##
+###############################################################################
+##  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.                                      ##
+##                                                                           ##
+##  You may not change or alter any portion of this comment or credits       ##
+##  of supporting developers from this source code or any supporting         ##
+##  source code which is considered copyrighted (c) material of the          ##
+##  original comment or credit authors.                                      ##
+##                                                                           ##
+##  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 ##
+###############################################################################
+##  Author of this file: CACHE                                               ##
+##  URL: http://gyakubiki.kir.jp/                                            ##
+##  Project: RSSFitJ                                                         ##
+###############################################################################
+/*
+* Step 0: Stop here if you are not sure what you are doing, it's no fun at all
+* Step 1: Clone this file and rename as rssfitj.[mod_dir].php
+* Step 2: Replace the text "RssfitjSample" with "Rssfitj[mod_dir]" at line 47 and line 55, i.e. "RssfitjNews" for the module "News"
+* Step 3: Modify the word in line 48 from 'sample' to [mod_dir]
+* Step 4: Modify the function "grabEntries" to satisfy your needs
+* Step 5: Move the new plug-in file to the plugins folder, i.e.  your-xoops-root/modules/rss/plugins
+* Step 6: Install your plug-in by pointing your browser to your-xoops-url/modules/rss/admin/index.php
+* [mod_dir]: Name of the driectory of your module, i.e. 'news'
+*/
+
+class RssfitjMydownloads extends XoopsObject{
+	var $dirname = 'mydownloads';
+	var $modname;
+
+	/*
+    * private
+	* Nothing here so far
+	*/
+	function RssfitjMydownloads(){
+	}
+	
+	function loadModule(){
+		global $module_handler;
+		$mod = $module_handler->getByDirname($this->dirname);
+		if( !$mod || !$mod->getVar('isactive') ){
+			return false;
+		}
+		$this->modname = $mod->getVar('name');
+		return $mod;
+	}
+
+	/*
+    * public
+	* return module name 
+	*/
+	function getDirName(){
+		return $this->dirname;
+	}
+
+	function grabEntries(&$obj){
+		global $xoopsDB;
+		$myts =& MyTextSanitizer::getInstance();
+		$ret = array();
+		$i = 0;
+
+		if ($obj->getVar('rssfj_param')) {
+			$rcdId=explode(',',$obj->getVar('rssfj_param'));
+			$tarray=array();
+			$Tarray=array();
+			$carray=array();
+			$Carray=array();
+			foreach ($rcdId as $eachId) {
+				if (substr($eachId,0,1)=='T')
+					array_push($Tarray,substr($eachId,1,strlen($eachId)-1));
+				if (substr($eachId,0,1)=='N' || substr($eachId,0,1)=='t')
+					array_push($tarray,substr($eachId,1,strlen($eachId)-1));
+				if (substr($eachId,0,1)=='C')
+					array_push($Carray,substr($eachId,1,strlen($eachId)-1));
+				if (substr($eachId,0,1)=='c')
+					array_push($carray,substr($eachId,1,strlen($eachId)-1));
+			}
+			$add_sql="";
+			if (count($Tarray)) {
+				$add_sql.=" AND (";
+				foreach($Tarray as $TopicId) {
+					$add_sql .= "l.lid=".$TopicId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+			if (count($tarray)) {
+				$add_sql.=" AND NOT(";
+				foreach($tarray as $TopicId) {
+					$add_sql .= "l.lid=".$TopicId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+			if (count($Carray)) {
+				$add_sql.=" AND (";
+				foreach($Carray as $CatId) {
+					$add_sql .= "l.cid=".$CatId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+			if (count($carray)) {
+				$add_sql.=" AND NOT(";
+				foreach($carray as $CatId) {
+					$add_sql .= "l.cid=".$CatId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+		} else {
+			$add_sql="";
+		}
+
+		$sql = "SELECT l.lid, l.cid, l.title, l.date, t.description, c.title as ctitle FROM ".$xoopsDB->prefix("mydownloads_downloads")." l, ".$xoopsDB->prefix("mydownloads_text")." t, ".$xoopsDB->prefix("mydownloads_cat")." c WHERE l.status>0 AND l.lid=t.lid AND l.cid=c.cid".$add_sql." ORDER BY l.date DESC";
+		$result = $xoopsDB->query($sql, $obj->getVar('rssfj_grab'), 0);
+		while( $row = $xoopsDB->fetchArray($result) ){
+		//	required
+			$desc=$this->modname." : ".$row['ctitle']." >> ".$row['title'];
+			$ret[$i]['title'] = $myts->makeTareaData4Show($desc);
+			$link = XOOPS_URL.'/modules/'.$this->dirname.'/singlefile.php?cid='.$row['cid'].'&amp;lid='.$row['lid'];
+			$ret[$i]['link'] = $ret[$i]['guid'] = $link;
+			$ret[$i]['timestamp'] = $row['date'];
+			$ret[$i]['description'] = $myts->makeTareaData4Show($row['description']);
+		//	optional
+			$ret[$i]['category'] = $this->modname;
+			$ret[$i]['domain'] = XOOPS_URL.'/modules/'.$this->dirname.'/';
+			$i++;
+		}
+		return $ret;
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/rssj/plugins/rssfitj.xoopsfaq.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/rssj/plugins/rssfitj.xoopsfaq.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/rssj/plugins/rssfitj.xoopsfaq.php	(revision 405)
@@ -0,0 +1,169 @@
+<?php
+###############################################################################
+##                RSSFit - Extendable XML news feed generator                ##
+##                   Copyright (c) 2004 NS Tai (aka tuff)                    ##
+##                       <http://www.brandycoke.com/>                        ##
+##                      Modified By 2005 CACHE RSSfitJ                       ##
+##                       <http://gyakubiki.kir.jp/>                          ##
+###############################################################################
+##                    XOOPS - PHP Content Management System                  ##
+##                       Copyright (c) 2000 XOOPS.org                        ##
+##                          <http://www.xoops.org/>                          ##
+###############################################################################
+##  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.                                      ##
+##                                                                           ##
+##  You may not change or alter any portion of this comment or credits       ##
+##  of supporting developers from this source code or any supporting         ##
+##  source code which is considered copyrighted (c) material of the          ##
+##  original comment or credit authors.                                      ##
+##                                                                           ##
+##  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 ##
+###############################################################################
+##  Author of this file: CACHE                                               ##
+##  URL: http://gyakubiki.kir.jp/                                            ##
+##  Project: RSSFitJ                                                         ##
+###############################################################################
+/*
+* Step 0: Stop here if you are not sure what you are doing, it's no fun at all
+* Step 1: Clone this file and rename as rssfitj.[mod_dir].php
+* Step 2: Replace the text "RssfitjSample" with "Rssfitj[mod_dir]" at line 47 and line 55, i.e. "RssfitjNews" for the module "News"
+* Step 3: Modify the word in line 48 from 'sample' to [mod_dir]
+* Step 4: Modify the function "grabEntries" to satisfy your needs
+* Step 5: Move the new plug-in file to the plugins folder, i.e.  your-xoops-root/modules/rss/plugins
+* Step 6: Install your plug-in by pointing your browser to your-xoops-url/modules/rss/admin/index.php
+* [mod_dir]: Name of the driectory of your module, i.e. 'news'
+*/
+
+class RssfitjXoopsfaq{
+	var $dirname = 'xoopsfaq';
+	var $modname;
+	
+	/*
+    * private
+	* Nothing here so far
+	*/
+	function RssfitjXoopsfaq(){
+	}
+
+	/*
+    * public
+	* return module name 
+	*/
+	function getDirName(){
+		return $this->dirname;
+	}
+
+	/*
+    * private
+	* Load the module
+	*/
+	function loadModule(){
+		global $module_handler;
+		$mod = $module_handler->getByDirname($this->dirname);
+		if( !$mod || !$mod->getVar('isactive') ){
+			return false;
+		}
+		$this->modname = $mod->getVar('name');
+		return $mod;
+	}
+	
+	/*
+    * public
+	* Grab the entries of your module here
+	*/
+	function grabEntries(&$obj){
+		global $xoopsDB;
+		$myts =& MyTextSanitizer::getInstance();
+		$ret = array();
+		$i = 0;
+
+		if ($obj->getVar('rssfj_param')) {
+			$rcdId=explode(',',$obj->getVar('rssfj_param'));
+			$Tarray=array();
+			$tarray=array();
+			$Carray=array();
+			$carray=array();
+			foreach ($rcdId as $eachId) {
+				if (substr($eachId,0,1)=='T')
+					array_push($Tarray,substr($eachId,1,strlen($eachId)-1));
+				if (substr($eachId,0,1)=='N' || substr($eachId,0,1)=='t')
+					array_push($tarray,substr($eachId,1,strlen($eachId)-1));
+				if (substr($eachId,0,1)=='C')
+					array_push($Carray,substr($eachId,1,strlen($eachId)-1));
+				if (substr($eachId,0,1)=='c')
+					array_push($carray,substr($eachId,1,strlen($eachId)-1));
+			}
+			$add_sql="";
+			if (count($Tarray)) {
+				$add_sql.=" AND (";
+				foreach($Tarray as $TopicId) {
+					$add_sql .= "l.contents_id=".$TopicId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+			if (count($tarray)) {
+				$add_sql.=" AND NOT(";
+				foreach($tarray as $TopicId) {
+					$add_sql .= "l.contents_id=".$TopicId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+			if (count($Carray)) {
+				$add_sql.=" AND (";
+				foreach($Carray as $CatId) {
+					$add_sql .= "l.category_id=".$CatId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+			if (count($carray)) {
+				$add_sql.=" AND NOT(";
+				foreach($carray as $CatId) {
+					$add_sql .= "l.category_id=".$CatId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+		} else {
+			$add_sql="";
+		}
+
+	//	The following example code grabs the latest entries from the module MyLinks
+		$sql = "SELECT l.contents_id, l.contents_order, l.category_id, l.contents_title, l.contents_contents, l.contents_time, c.category_id, c.category_title FROM ".$xoopsDB->prefix("xoopsfaq_contents")." l, ".$xoopsDB->prefix("xoopsfaq_categories")." c WHERE l.category_id=c.category_id".$add_sql." ORDER BY l.contents_time DESC";
+
+		$result = $xoopsDB->query($sql, $obj->getVar('rssfj_grab'), 0);
+		while( $row = $xoopsDB->fetchArray($result) ){
+		//	required items
+			$link = XOOPS_URL.'/modules/'.$this->dirname.'/index.php?cat_id='.$row['category_id'].'#q'.$row['contents_id'];
+													// The title of the item
+			$desc=$this->modname." : ".$row['category_title'].">>".$row['contents_title'];
+			$ret[$i]['title'] = $myts->makeTareaData4Show($desc);
+			$ret[$i]['link'] = $link;				// The URL of the item
+			$ret[$i]['guid'] = $link;				// Unique identifier, usually url
+			$ret[$i]['timestamp'] = $row['contents_time'];	// Item modification date,
+													// must be in Unix time format
+			$desc = $row['contents_contents'];			// The item synopsis, or 
+													// description, whatever
+			$ret[$i]['description'] = $myts->makeTareaData4Show($desc);
+		//	optional items
+			$ret[$i]['category'] = $this->modname;
+			$ret[$i]['domain'] = XOOPS_URL.'/modules/'.$this->dirname.'/';
+			
+			$i++;
+		}
+		return $ret;
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/rssj/plugins/rssfitj.wfsection.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/rssj/plugins/rssfitj.wfsection.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/rssj/plugins/rssfitj.wfsection.php	(revision 405)
@@ -0,0 +1,167 @@
+<?php
+###############################################################################
+##                RSSFit - Extendable XML news feed generator                ##
+##                   Copyright (c) 2004 NS Tai (aka tuff)                    ##
+##                       <http://www.brandycoke.com/>                        ##
+##                      Modified By 2005 CACHE RSSfitJ                       ##
+##                       <http://gyakubiki.kir.jp/>                          ##
+###############################################################################
+##                    XOOPS - PHP Content Management System                  ##
+##                       Copyright (c) 2000 XOOPS.org                        ##
+##                          <http://www.xoops.org/>                          ##
+###############################################################################
+##  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.                                      ##
+##                                                                           ##
+##  You may not change or alter any portion of this comment or credits       ##
+##  of supporting developers from this source code or any supporting         ##
+##  source code which is considered copyrighted (c) material of the          ##
+##  original comment or credit authors.                                      ##
+##                                                                           ##
+##  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 ##
+###############################################################################
+##  Author of this file: CACHE                                               ##
+##  URL: http://gyakubiki.kir.jp/                                            ##
+##  Project: RSSFitJ                                                         ##
+###############################################################################
+/*
+* Step 0: Stop here if you are not sure what you are doing, it's no fun at all
+* Step 1: Clone this file and rename as rssfitj.[mod_dir].php
+* Step 2: Replace the text "RssfitjSample" with "Rssfitj[mod_dir]" at line 48 and line 56, i.e. "RssfitjNews" for the module "News"
+* Step 3: Modify the word in line 49 from 'sample' to [mod_dir]
+* Step 4: Modify the function "grabEntries" to satisfy your needs
+* Step 5: Move the new plug-in file to the plugins folder, i.e.  your-xoops-root/modules/rss/plugins
+* Step 6: Install your plug-in by pointing your browser to your-xoops-url/modules/rss/admin/index.php
+* [mod_dir]: Name of the driectory of your module, i.e. 'news'
+*/
+if (file_exists(XOOPS_ROOT_PATH.'/modules/wfsection/include/groupaccess.php'))
+	include_once XOOPS_ROOT_PATH.'/modules/wfsection/include/groupaccess.php';
+class RssfitjWfsection{
+	var $dirname = 'wfsection';
+	var $modname;
+	
+	/*
+    * private
+	* Nothing here so far
+	*/
+	function RssfitjWfsection(){
+	}
+
+	/*
+    * public
+	* return module name 
+	*/
+	function getDirName(){
+		return $this->dirname;
+	}
+
+	/*
+    * private, do not modify
+	* Load the module
+	*/
+	function loadModule(){
+		global $module_handler;
+		$mod = $module_handler->getByDirname($this->dirname);
+		if( !$mod || !$mod->getVar('isactive') ){
+			return false;
+		}
+		$this->modname = $mod->getVar('name');
+		return $mod;
+	}
+	
+	/*
+    * public
+	* Grab the entries of your module here
+	*/
+	function grabEntries(&$obj){
+		global $xoopsDB;
+		$myts =& MyTextSanitizer::getInstance();
+		$ret = array();
+		$i = 0;
+
+		if ($obj->getVar('rssfj_param')) {
+			$rcdId=explode(',',$obj->getVar('rssfj_param'));
+			$tarray=array();
+			$Tarray=array();
+			$Carray=array();
+			$carray=array();
+			foreach ($rcdId as $eachId) {
+				if (substr($eachId,0,1)=='T')
+					array_push($Tarray,substr($eachId,1,strlen($eachId)-1));
+				if (substr($eachId,0,1)=='N' || substr($eachId,0,1)=='t')
+					array_push($tarray,substr($eachId,1,strlen($eachId)-1));
+				if (substr($eachId,0,1)=='C')
+					array_push($Carray,substr($eachId,1,strlen($eachId)-1));
+				if (substr($eachId,0,1)=='c')
+					array_push($carray,substr($eachId,1,strlen($eachId)-1));
+			}
+			$add_sql="";
+			if (count($Tarray)) {
+				$add_sql.=" AND (";
+				foreach($Tarray as $TopicId) {
+					$add_sql .= "a.articleid=".$TopicId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+			if (count($tarray)) {
+				$add_sql.=" AND NOT(";
+				foreach($tarray as $TopicId) {
+					$add_sql .= "a.articleid=".$TopicId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+			if (count($Carray)) {
+				$add_sql.=" AND (";
+				foreach($Carray as $CatId) {
+					$add_sql .= "a.categoryid=".$CatId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+			if (count($carray)) {
+				$add_sql.=" AND NOT(";
+				foreach($carray as $CatId) {
+					$add_sql .= "a.categoryid=".$CatId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+		} else {
+			$add_sql="";
+		}
+
+		$sql = "SELECT a.articleid, a.categoryid, a.title as atitle, a.published, a.expired, a.counter, a.groupid, a.maintext, a.summary, b.title as btitle FROM ".$xoopsDB->prefix("wfs_article")." a, ".$xoopsDB->prefix("wfs_category")." b WHERE a.published < ".time()." AND a.published > 0 AND (a.expired = 0 OR a.expired > ".time().") AND a.noshowart = 0 AND a.offline = 0 AND a.categoryid = b.id".$add_sql." ORDER BY published DESC";
+
+		$result = $xoopsDB->query($sql, $obj->getVar('rssfj_grab'), 0);
+		while( $row = $xoopsDB->fetchArray($result) ){
+			if(checkAccess($row["groupid"])){
+				$link = XOOPS_URL.'/modules/'.$this->dirname.'/article.php?articleid='.$row['articleid'];
+			//	required items
+				$desc=$this->modname." : ".$row['btitle'].">>".$row['atitle'];
+				$ret[$i]['title'] = $myts->makeTareaData4Show($desc);
+				$ret[$i]['link'] = $link;
+				$ret[$i]['guid'] = $link;
+				$ret[$i]['timestamp'] = $row['published'];
+				$desc = !empty($row['summary']) ? $row['summary'] : $row['maintext'];
+				$ret[$i]['description'] = $myts->makeTareaData4Show($desc);
+			//	optional items
+				$ret[$i]['category'] = $this->modname;
+				$ret[$i]['domain'] = XOOPS_URL.'/modules/'.$this->dirname.'/';
+				$i++;
+			}
+		}
+		return $ret;
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/rssj/plugins/rssfitj.xfsection.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/rssj/plugins/rssfitj.xfsection.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/rssj/plugins/rssfitj.xfsection.php	(revision 405)
@@ -0,0 +1,168 @@
+<?php
+###############################################################################
+##                RSSFit - Extendable XML news feed generator                ##
+##                   Copyright (c) 2004 NS Tai (aka tuff)                    ##
+##                       <http://www.brandycoke.com/>                        ##
+##                      Modified By 2005 CACHE RSSfitJ                       ##
+##                       <http://gyakubiki.kir.jp/>                          ##
+###############################################################################
+##                    XOOPS - PHP Content Management System                  ##
+##                       Copyright (c) 2000 XOOPS.org                        ##
+##                          <http://www.xoops.org/>                          ##
+###############################################################################
+##  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.                                      ##
+##                                                                           ##
+##  You may not change or alter any portion of this comment or credits       ##
+##  of supporting developers from this source code or any supporting         ##
+##  source code which is considered copyrighted (c) material of the          ##
+##  original comment or credit authors.                                      ##
+##                                                                           ##
+##  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 ##
+###############################################################################
+##  Author of this file: CACHE                                               ##
+##  URL: http://gyakubiki.kir.jp/                                            ##
+##  Project: RSSFitJ                                                         ##
+###############################################################################
+/*
+* Step 0: Stop here if you are not sure what you are doing, it's no fun at all
+* Step 1: Clone this file and rename as rssfitj.[mod_dir].php
+* Step 2: Replace the text "RssfitjSample" with "Rssfitj[mod_dir]" at line 48 and line 56, i.e. "RssfitjNews" for the module "News"
+* Step 3: Modify the word in line 49 from 'sample' to [mod_dir]
+* Step 4: Modify the function "grabEntries" to satisfy your needs
+* Step 5: Move the new plug-in file to the plugins folder, i.e.  your-xoops-root/modules/rss/plugins
+* Step 6: Install your plug-in by pointing your browser to your-xoops-url/modules/rss/admin/index.php
+* [mod_dir]: Name of the driectory of your module, i.e. 'news'
+*/
+if (file_exists(XOOPS_ROOT_PATH.'/modules/xfsection/include/groupaccess.php'))
+	include_once XOOPS_ROOT_PATH.'/modules/xfsection/include/groupaccess.php';
+class RssfitjXfsection{
+	var $dirname = 'xfsection';
+	var $modname;
+	
+	/*
+    * private
+	* Nothing here so far
+	*/
+	function RssfitjXfsection(){
+	}
+
+	/*
+    * public
+	* return module name 
+	*/
+	function getDirName(){
+		return $this->dirname;
+	}
+
+	/*
+    * private, do not modify
+	* Load the module
+	*/
+	function loadModule(){
+		global $module_handler;
+		$mod = $module_handler->getByDirname($this->dirname);
+		if( !$mod || !$mod->getVar('isactive') ){
+			return false;
+		}
+		$this->modname = $mod->getVar('name');
+		return $mod;
+	}
+	
+	/*
+    * public
+	* Grab the entries of your module here
+	*/
+	function grabEntries(&$obj){
+		global $xoopsDB;
+		$myts =& MyTextSanitizer::getInstance();
+		$ret = array();
+		$i = 0;
+
+		if ($obj->getVar('rssfj_param')) {
+			$rcdId=explode(',',$obj->getVar('rssfj_param'));
+			$tarray=array();
+			$Tarray=array();
+			$Carray=array();
+			$carray=array();
+			foreach ($rcdId as $eachId) {
+				if (substr($eachId,0,1)=='T')
+					array_push($Tarray,substr($eachId,1,strlen($eachId)-1));
+				if (substr($eachId,0,1)=='N' || substr($eachId,0,1)=='t')
+					array_push($tarray,substr($eachId,1,strlen($eachId)-1));
+				if (substr($eachId,0,1)=='C')
+					array_push($Carray,substr($eachId,1,strlen($eachId)-1));
+				if (substr($eachId,0,1)=='c')
+					array_push($carray,substr($eachId,1,strlen($eachId)-1));
+			}
+			$add_sql="";
+			if (count($Tarray)) {
+				$add_sql.=" AND (";
+				foreach($Tarray as $TopicId) {
+					$add_sql .= "a.articleid=".$TopicId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+			if (count($tarray)) {
+				$add_sql.=" AND NOT(";
+				foreach($tarray as $TopicId) {
+					$add_sql .= "a.articleid=".$TopicId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+			if (count($Carray)) {
+				$add_sql.=" AND (";
+				foreach($Carray as $CatId) {
+					$add_sql .= "a.categoryid=".$CatId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+			if (count($carray)) {
+				$add_sql.=" AND NOT(";
+				foreach($carray as $CatId) {
+					$add_sql .= "a.categoryid=".$CatId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+		} else {
+			$add_sql="";
+		}
+
+		$sql = "SELECT a.articleid, a.categoryid, a.title as atitle, a.published, a.expired, a.counter, a.groupid, a.maintext, a.summary, b.title as btitle FROM ".$xoopsDB->prefix("xfs_article")." a, ".$xoopsDB->prefix("xfs_category")." b WHERE a.published < ".time()." AND a.published > 0 AND (a.expired = 0 OR a.expired > ".time().") AND a.noshowart = 0 AND a.offline = 0 AND a.categoryid = b.id".$add_sql." ORDER BY published DESC";
+
+		$result = $xoopsDB->query($sql, $obj->getVar('rssfj_grab'), 0);
+		while( $row = $xoopsDB->fetchArray($result) ){
+			if(checkAccess($row["groupid"])){
+				$link = XOOPS_URL.'/modules/'.$this->dirname.'/article.php?articleid='.$row['articleid'];
+			//	required items
+				$desc=$this->modname." : ".$row['btitle'].">>".$row['atitle'];
+				$ret[$i]['title'] = $myts->makeTareaData4Show($desc);
+				$ret[$i]['link'] = $link;
+				$ret[$i]['guid'] = $link;
+				$ret[$i]['timestamp'] = $row['published'];
+//				$desc = !empty($row['summary']) ? $row['summary'] : $row['maintext'];
+				$desc = $row['summary']."::". $row['maintext'];
+				$ret[$i]['description'] = $myts->makeTareaData4Show($desc);
+			//	optional items
+				$ret[$i]['category'] = $this->modname;
+				$ret[$i]['domain'] = XOOPS_URL.'/modules/'.$this->dirname.'/';
+				$i++;
+			}
+		}
+		return $ret;
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/rssj/plugins/rssfitj.myalbum.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/rssj/plugins/rssfitj.myalbum.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/rssj/plugins/rssfitj.myalbum.php	(revision 405)
@@ -0,0 +1,205 @@
+<?php
+###############################################################################
+##                RSSFit - Extendable XML news feed generator                ##
+##                   Copyright (c) 2004 NS Tai (aka tuff)                    ##
+##                       <http://www.brandycoke.com/>                        ##
+##                      Modified By 2005 CACHE RSSfitJ                       ##
+##                       <http://gyakubiki.kir.jp/>                          ##
+###############################################################################
+##                    XOOPS - PHP Content Management System                  ##
+##                       Copyright (c) 2000 XOOPS.org                        ##
+##                          <http://www.xoops.org/>                          ##
+###############################################################################
+##  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.                                      ##
+##                                                                           ##
+##  You may not change or alter any portion of this comment or credits       ##
+##  of supporting developers from this source code or any supporting         ##
+##  source code which is considered copyrighted (c) material of the          ##
+##  original comment or credit authors.                                      ##
+##                                                                           ##
+##  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 ##
+###############################################################################
+##  Author of this file: CACHE                                               ##
+##  URL: http://gyakubiki.kir.jp/                                            ##
+##  Project: RSSFitJ                                                         ##
+###############################################################################
+/*
+* Step 0: Stop here if you are not sure what you are doing, it's no fun at all
+* Step 1: Clone this file and rename as rssfitj.[mod_dir].php
+* Step 2: Replace the text "RssfitjSample" with "Rssfitj[mod_dir]" at line 47 and line 55, i.e. "RssfitjNews" for the module "News"
+* Step 3: Modify the word in line 48 from 'sample' to [mod_dir]
+* Step 4: Modify the function "grabEntries" to satisfy your needs
+* Step 5: Move the new plug-in file to the plugins folder, i.e.  your-xoops-root/modules/rss/plugins
+* Step 6: Install your plug-in by pointing your browser to your-xoops-url/modules/rss/admin/index.php
+* [mod_dir]: Name of the driectory of your module, i.e. 'news'
+*/
+
+class RssfitjMyalbum{
+	var $dirname = 'myalbum';
+	var $modname;
+	
+	/*
+    * private
+	* Nothing here so far
+	*/
+	function RssfitjMyalbum(){
+	}
+	
+	/*
+    * private
+	* Load the module
+	*/
+	function loadModule(){
+		global $module_handler;
+		$mod = $module_handler->getByDirname($this->dirname);
+		if( !$mod || !$mod->getVar('isactive') ){
+			return false;
+		}
+		$this->modname = $mod->getVar('name');
+		return $mod;
+	}
+	
+	/*
+    * public
+	* return module name 
+	*/
+	function getDirName(){
+		return $this->dirname;
+	}
+
+	/*
+    * public
+	* Grab the entries of your module here
+	*/
+	function grabEntries(&$obj){
+		global $xoopsDB,$module_handler;
+		$myts =& MyTextSanitizer::getInstance();
+		$ret = array();
+		$i = 0;
+
+		if ($obj->getVar('rssfj_param')) {
+			$rcdId=explode(',',$obj->getVar('rssfj_param'));
+			$Carray=array();
+			$carray=array();
+			$Tarray=array();
+			$tarray=array();
+			foreach ($rcdId as $eachId) {
+				if (strpos($eachId,':')!==False) {
+					$words=explode(':',$eachId);
+					$word_cnt=0;
+					foreach($words as $word) {
+						if ($word_cnt > 0) {
+							if (strpos($word,'C')!==False)
+								$Carray[$words[0]][]=substr($word,1,strlen($word)-1);
+							if (strpos($word,'c')!==False) {
+								if (!isset($Carray[$words[0]]))
+									$Carray[$words[0]]="";
+								$carray[$words[0]][]=substr($word,1,strlen($word)-1);
+							}
+							if (strpos($word,'T')!==False) {
+								if (!isset($Carray[$words[0]]))
+									$Carray[$words[0]]="";
+								$Tarray[$words[0]][]=substr($word,1,strlen($word)-1);
+							}
+							if (strpos($word,'N')!==False) {
+								if (!isset($Carray[$words[0]]))
+									$Carray[$words[0]]="";
+								$tarray[$words[0]][]=substr($word,1,strlen($word)-1);
+							}
+							if (strpos($word,'t')!==False) {
+								if (!isset($Carray[$words[0]]))
+									$Carray[$words[0]]="";
+								$tarray[$words[0]][]=substr($word,1,strlen($word)-1);
+							}
+						}
+						$word_cnt++;
+					}
+				} else {
+					if (!in_array($eachId,array_keys($Carray)))
+						$Carray[$eachId]="";
+				}
+			}
+			if (count($Carray)==0)
+				$Carray['myalbum']="";
+		} else {
+			$Carray['myalbum']="";
+		}
+
+	//	The following example code grabs the latest entries from the module MyLinks
+	foreach ($Carray as $key=>$val) {
+		$add_sql="";
+		if (is_array($Carray[$key])) {
+			$add_sql.=" AND (";
+			foreach($Carray[$key] as $eachId) {
+				$add_sql .= "p.cid=".$eachId." OR ";
+			}
+			$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+			$add_sql .= ")";
+		}
+		if (isset($carray[$key])) {
+			$add_sql.=" AND NOT(";
+			foreach($carray[$key] as $eachId) {
+				$add_sql .= "p.cid=".$eachId." OR ";
+			}
+			$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+			$add_sql .= ")";
+		}
+		if (isset($Tarray[$key])) {
+			$add_sql.=" AND (";
+			foreach($Tarray[$key] as $eachId) {
+				$add_sql .= "p.lid=".$eachId." OR ";
+			}
+			$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+			$add_sql .= ")";
+		}
+		if (isset($tarray[$key])) {
+			$add_sql.=" AND NOT(";
+			foreach($tarray[$key] as $eachId) {
+				$add_sql .= "p.lid=".$eachId." OR ";
+			}
+			$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+			$add_sql .= ")";
+		}
+		$sql = "SELECT p.lid, p.cid, p.title, p.date, t.description, t.lid, c.cid, c.title as ctitle FROM ".$xoopsDB->prefix($key."_photos")." p, ".$xoopsDB->prefix($key."_text")." t, ".$xoopsDB->prefix($key."_cat")." c WHERE p.lid=t.lid AND p.cid=c.cid".$add_sql." ORDER BY p.date DESC";
+
+		$result = $xoopsDB->query($sql, $obj->getVar('rssfj_grab'), 0);
+		while( $row = $xoopsDB->fetchArray($result) ){
+		//	required items
+			$mod = $module_handler->getByDirname($key);
+			if( !$mod || !$mod->getVar('isactive') ){
+				return $ret;
+			}
+			$modname = $mod->getVar('name');
+
+			$link = XOOPS_URL.'/modules/'.$key.'/photo.php?lid='.$row['lid'];
+													// The title of the item
+			$desc=$modname." : ".$row['ctitle'].">>".$row['title'];
+			$ret[$i]['title'] = $myts->makeTareaData4Show($desc);
+			$ret[$i]['link'] = $link;				// The URL of the item
+			$ret[$i]['guid'] = $link;				// Unique identifier, usually url
+			$ret[$i]['timestamp'] = $row['date'];	// Item modification date,
+													// must be in Unix time format
+			$desc = $row['description'];			// The item synopsis, or 
+													// description, whatever
+			$ret[$i]['description'] = $myts->makeTareaData4Show($desc);
+		//	optional items
+			$ret[$i]['category'] = $modname;
+			$ret[$i]['domain'] = XOOPS_URL.'/modules/'.$key.'/';
+			
+			$i++;
+		}
+	}
+		return $ret;
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/rssj/plugins/rssfitj.news.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/rssj/plugins/rssfitj.news.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/rssj/plugins/rssfitj.news.php	(revision 405)
@@ -0,0 +1,162 @@
+<?php
+###############################################################################
+##                RSSFit - Extendable XML news feed generator                ##
+##                   Copyright (c) 2004 NS Tai (aka tuff)                    ##
+##                       <http://www.brandycoke.com/>                        ##
+##                      Modified By 2005 CACHE RSSfitJ                       ##
+##                       <http://gyakubiki.kir.jp/>                          ##
+###############################################################################
+##                    XOOPS - PHP Content Management System                  ##
+##                       Copyright (c) 2000 XOOPS.org                        ##
+##                          <http://www.xoops.org/>                          ##
+###############################################################################
+##  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.                                      ##
+##                                                                           ##
+##  You may not change or alter any portion of this comment or credits       ##
+##  of supporting developers from this source code or any supporting         ##
+##  source code which is considered copyrighted (c) material of the          ##
+##  original comment or credit authors.                                      ##
+##                                                                           ##
+##  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 ##
+###############################################################################
+##  Author of this file: CACHE                                               ##
+##  URL: http://gyakubiki.kir.jp/                                            ##
+##  Project: RSSFitJ                                                         ##
+###############################################################################
+/*
+* Step 0: Stop here if you are not sure what you are doing, it's no fun at all
+* Step 1: Clone this file and rename as rssfitj.[mod_dir].php
+* Step 2: Replace the text "RssfitjSample" with "Rssfitj[mod_dir]" at line 47 and line 55, i.e. "RssfitjNews" for the module "News"
+* Step 3: Modify the word in line 48 from 'sample' to [mod_dir]
+* Step 4: Modify the function "grabEntries" to satisfy your needs
+* Step 5: Move the new plug-in file to the plugins folder, i.e.  your-xoops-root/modules/rss/plugins
+* Step 6: Install your plug-in by pointing your browser to your-xoops-url/modules/rss/admin/index.php
+* [mod_dir]: Name of the driectory of your module, i.e. 'news'
+*/
+
+class RssfitjNews{
+	var $dirname = 'news';
+	var $modname;
+	
+	/*
+    * private
+	* Nothing here so far
+	*/
+	function RssfitjNews(){
+	}
+	
+	function loadModule(){
+		global $module_handler;
+		$mod = $module_handler->getByDirname($this->dirname);
+		if( !$mod || !$mod->getVar('isactive') ){
+			return false;
+		}
+		$this->modname = $mod->getVar('name');
+		return $mod;
+	}
+
+	/*
+    * public
+	* return module name 
+	*/
+	function getDirName(){
+		return $this->dirname;
+	}
+
+	function grabEntries(&$obj){
+		global $xoopsDB;
+		$myts =& MyTextSanitizer::getInstance();
+		$ret = array();
+		$i = 0;
+
+		if ($obj->getVar('rssfj_param')) {
+			$rcdId=explode(',',$obj->getVar('rssfj_param'));
+			$tarray=array();
+			$Tarray=array();
+			$Carray=array();
+			$carray=array();
+			foreach ($rcdId as $eachId) {
+				if (substr($eachId,0,1)=='T')
+					array_push($Tarray,substr($eachId,1,strlen($eachId)-1));
+				if (substr($eachId,0,1)=='t' || substr($eachId,0,1)=='N')
+					array_push($tarray,substr($eachId,1,strlen($eachId)-1));
+				if (substr($eachId,0,1)=='C')
+					array_push($Carray,substr($eachId,1,strlen($eachId)-1));
+				if (substr($eachId,0,1)=='c')
+					array_push($carray,substr($eachId,1,strlen($eachId)-1));
+			}
+			$add_sql="";
+			if (count($Tarray)) {
+				$add_sql.=" AND (";
+				foreach($Tarray as $TopicId) {
+					$add_sql .= "l.storyid=".$TopicId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+			if (count($tarray)) {
+				$add_sql.=" AND NOT(";
+				foreach($tarray as $TopicId) {
+					$add_sql .= "l.storyid=".$TopicId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+			if (count($Carray)) {
+				$add_sql.=" AND (";
+				foreach($Carray as $CatId) {
+					$add_sql .= "l.topicid=".$CatId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+			if (count($carray)) {
+				$add_sql.=" AND NOT(";
+				foreach($carray as $CatId) {
+					$add_sql .= "l.topicid=".$CatId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+		} else {
+			$add_sql="";
+		}
+
+	//	The following example code grabs the latest entries from the module MyLinks
+		$sql = "SELECT l.storyid, l.title, l.hometext, l.comments, l.published,  c.topic_title  FROM ".$xoopsDB->prefix("stories")." l, ".$xoopsDB->prefix("topics")." c WHERE l.topicid=c.topic_id AND l.published > 0 AND l.published <= ".time()." AND (l.expired = 0 OR l.expired > ".time().") AND l.ihome=0".$add_sql." ORDER BY l.published DESC";
+
+		$result = $xoopsDB->query($sql, $obj->getVar('rssfj_grab'), 0);
+		while( $row = $xoopsDB->fetchArray($result) ){
+		//	required items
+			$link = XOOPS_URL.'/modules/news/article.php?storyid='.$row['storyid'];
+													// The title of the item
+			$desc=$this->modname." : ".$row['topic_title'].">>".$row['title'];
+			$ret[$i]['title'] = $myts->makeTareaData4Show($desc);
+			$ret[$i]['link'] = $link;				// The URL of the item
+			$ret[$i]['guid'] = $link;				// Unique identifier, usually url
+			$ret[$i]['timestamp'] = $row['published'];	// Item modification date,
+													// must be in Unix time format
+			$desc = $row['hometext'];				// The item synopsis, or 
+													// description, whatever
+			$ret[$i]['description'] = $myts->makeTareaData4Show($desc);
+		//	optional items
+			$ret[$i]['category'] = $this->modname;
+			$ret[$i]['domain'] = XOOPS_URL.'/modules/'.$this->dirname.'/';
+			
+			$i++;
+		}
+		return $ret;
+	}
+	
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/rssj/plugins/rssfitj.bluesbb.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/rssj/plugins/rssfitj.bluesbb.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/rssj/plugins/rssfitj.bluesbb.php	(revision 405)
@@ -0,0 +1,198 @@
+<?php
+###############################################################################
+##                RSSFit - Extendable XML news feed generator                ##
+##                   Copyright (c) 2004 NS Tai (aka tuff)                    ##
+##                       <http://www.brandycoke.com/>                        ##
+##                      Modified By 2005 CACHE RSSfitJ                       ##
+##                       <http://gyakubiki.kir.jp/>                          ##
+###############################################################################
+##                    XOOPS - PHP Content Management System                  ##
+##                       Copyright (c) 2000 XOOPS.org                        ##
+##                          <http://www.xoops.org/>                          ##
+###############################################################################
+##  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.                                      ##
+##                                                                           ##
+##  You may not change or alter any portion of this comment or credits       ##
+##  of supporting developers from this source code or any supporting         ##
+##  source code which is considered copyrighted (c) material of the          ##
+##  original comment or credit authors.                                      ##
+##                                                                           ##
+##  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 ##
+###############################################################################
+##  Author of this file: CACHE                                               ##
+##  URL: http://gyakubiki.kir.jp/                                            ##
+##  Project: RSSFitJ                                                         ##
+###############################################################################
+/*
+* Step 0: Stop here if you are not sure what you are doing, it's no fun at all
+* Step 1: Clone this file and rename as rssfitj.[mod_dir].php
+* Step 2: Replace the text "RssfitjSample" with "Rssfitj[mod_dir]" at line 47 and line 55, i.e. "RssfitjNews" for the module "News"
+* Step 3: Modify the word in line 48 from 'sample' to [mod_dir]
+* Step 4: Modify the function "grabEntries" to satisfy your needs
+* Step 5: Move the new plug-in file to the plugins folder, i.e.  your-xoops-root/modules/rss/plugins
+* Step 6: Install your plug-in by pointing your browser to your-xoops-url/modules/rss/admin/index.php
+* [mod_dir]: Name of the driectory of your module, i.e. 'news'
+*/
+
+class RssfitjBluesbb{
+	var $dirname = 'bluesbb';
+	var $modname;
+	
+	/*
+    * private
+	* Nothing here so far
+	*/
+	function RssfitjBluesbb(){
+	}
+	
+	function loadModule(){
+		global $module_handler;
+		$mod = $module_handler->getByDirname($this->dirname);
+		if( !$mod || !$mod->getVar('isactive') ){
+			return false;
+		}
+		$this->modname = $mod->getVar('name');
+		return $mod;
+	}
+
+	/*
+    * public
+	* return module name 
+	*/
+	function getDirName(){
+		return $this->dirname;
+	}
+
+	function grabEntries(&$obj){
+		global $xoopsDB;
+
+		$myts =& MyTextSanitizer::getInstance();
+		$ret = array();
+		$i = 0;
+
+		if ($obj->getVar('rssfj_param')) {
+			$rcdId=explode(',',$obj->getVar('rssfj_param'));
+			$Farray=array();
+			$farray=array();
+			$Tarray=array();
+			$tarray=array();
+			$Carray=array();
+			$carray=array();
+			$Garray=array();
+			$garray=array();
+			foreach ($rcdId as $eachId) {
+				if (substr($eachId,0,1)=='F')
+					array_push($Farray,substr($eachId,1,strlen($eachId)-1));
+				if (substr($eachId,0,1)=='f')
+					array_push($farray,substr($eachId,1,strlen($eachId)-1));
+				if (substr($eachId,0,1)=='T')
+					array_push($Tarray,substr($eachId,1,strlen($eachId)-1));
+				if (substr($eachId,0,1)=='N' || substr($eachId,0,1)=='t')
+					array_push($tarray,substr($eachId,1,strlen($eachId)-1));
+				if (substr($eachId,0,1)=='C')
+					array_push($Carray,substr($eachId,1,strlen($eachId)-1));
+				if (substr($eachId,0,1)=='c')
+					array_push($carray,substr($eachId,1,strlen($eachId)-1));
+				if (substr($eachId,0,1)=='G')
+					array_push($Garray,substr($eachId,1,strlen($eachId)-1));
+				if (substr($eachId,0,1)=='g')
+					array_push($garray,substr($eachId,1,strlen($eachId)-1));
+			}
+			$add_sql="";
+			if (count($Tarray)) {
+				$add_sql.=" AND (";
+				foreach($Tarray as $TopicId) {
+					$add_sql .= "t.sread_id=".$TopicId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+			if (count($tarray)) {
+				$add_sql.=" AND NOT(";
+				foreach($tarray as $TopicId) {
+					$add_sql .= "t.sread_id=".$TopicId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+			if (count($Farray)) {
+				$add_sql.=" AND (";
+				foreach($Farray as $forumId) {
+					$add_sql .= "t.topic_id=".$forumId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+			if (count($farray)) {
+				$add_sql.=" AND NOT(";
+				foreach($farray as $forumId) {
+					$add_sql .= "t.topic_id=".$forumId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+			if (count($Carray)) {
+				$add_sql.=" AND (";
+				foreach($Carray as $CatId) {
+					$add_sql .= "f.cat_id=".$CatId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+			if (count($carray)) {
+				$add_sql.=" AND NOT(";
+				foreach($carray as $CatId) {
+					$add_sql .= "f.cat_id=".$CatId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+			$add_sql2="";
+			if (count($Garray)) {
+				foreach($Garray as $GroupId) {
+					$add_sql2 .= " OR (f.topic_access=6 AND f.topic_group=".$GroupId.")";
+				}
+			}
+			if (count($garray)) {
+				foreach($garray as $GroupId) {
+					$add_sql2 .= " OR (f.topic_access=6 AND f.topic_group<>".$GroupId.")";
+				}
+			}
+		} else {
+			$add_sql="";
+			$add_sql2="";
+		}
+
+		$sql = 'SELECT t.post_id, t.topic_id, t.sread_id, t.res_id, t.title, t.message, t.post_time, f.topic_name, c.cat_title FROM '.$xoopsDB->prefix('bluesbb').' t, '.$xoopsDB->prefix('bluesbb_topic').' f, '.$xoopsDB->prefix('bluesbb_categories').' c WHERE f.topic_id = t.topic_id AND f.cat_id = c.cat_id'.$add_sql.' AND (f.topic_access <= 2 OR f.topic_access=5'.$add_sql2.') ORDER BY t.post_time DESC';
+		if( !$result = $xoopsDB->query($sql, $obj->getVar('rssfj_grab'), 0) ){
+			return false;
+		}
+
+		while( $row = $xoopsDB->fetchArray($result) ){
+			$desc = $myts->makeTareaData4Show($row['message']);
+			$link = XOOPS_URL.'/modules/'.$this->dirname.'/viewsread.php?topic='.$row['topic_id'].'&amp;sread_id='.$row['sread_id'].'&amp;number=l50';
+		//	required
+			$desc2=$this->modname." : ".$row['cat_title']." : ".$row['topic_name']." : ".$row['title'];
+			$ret[$i]['title'] = $myts->makeTareaData4Show($desc2);
+			$ret[$i]['link'] = $ret[$i]['guid'] = $link;
+			$ret[$i]['timestamp'] = $row['post_time'];
+			$ret[$i]['description'] = $desc;
+		//	optional
+			$ret[$i]['category'] = $this->modname;
+			$ret[$i]['domain'] = XOOPS_URL.'/modules/'.$this->dirname.'/';			$i++;
+		}
+		return $ret;
+	}
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/rssj/plugins/rssfitj.weblog.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/rssj/plugins/rssfitj.weblog.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/rssj/plugins/rssfitj.weblog.php	(revision 405)
@@ -0,0 +1,168 @@
+<?php
+###############################################################################
+##                RSSFit - Extendable XML news feed generator                ##
+##                   Copyright (c) 2004 NS Tai (aka tuff)                    ##
+##                       <http://www.brandycoke.com/>                        ##
+##                      Modified By 2005 CACHE RSSfitJ                       ##
+##                       <http://gyakubiki.kir.jp/>                          ##
+###############################################################################
+##                    XOOPS - PHP Content Management System                  ##
+##                       Copyright (c) 2000 XOOPS.org                        ##
+##                          <http://www.xoops.org/>                          ##
+###############################################################################
+##  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.                                      ##
+##                                                                           ##
+##  You may not change or alter any portion of this comment or credits       ##
+##  of supporting developers from this source code or any supporting         ##
+##  source code which is considered copyrighted (c) material of the          ##
+##  original comment or credit authors.                                      ##
+##                                                                           ##
+##  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 ##
+###############################################################################
+##  Author of this file: CACHE                                               ##
+##  URL: http://gyakubiki.kir.jp/                                            ##
+##  Project: RSSFitJ                                                         ##
+###############################################################################
+/*
+* Step 0: Stop here if you are not sure what you are doing, it's no fun at all
+* Step 1: Clone this file and rename as rssfitj.[mod_dir].php
+* Step 2: Replace the text "RssfitjSample" with "Rssfitj[mod_dir]" at line 47 and line 55, i.e. "RssfitjNews" for the module "News"
+* Step 3: Modify the word in line 48 from 'sample' to [mod_dir]
+* Step 4: Modify the function "grabEntries" to satisfy your needs
+* Step 5: Move the new plug-in file to the plugins folder, i.e.  your-xoops-root/modules/rss/plugins
+* Step 6: Install your plug-in by pointing your browser to your-xoops-url/modules/rss/admin/index.php
+* [mod_dir]: Name of the driectory of your module, i.e. 'news'
+*/
+
+class RssfitjWeblog{
+	var $dirname = 'weblog';
+	var $modname;
+	
+	/*
+    * private
+	* Nothing here so far
+	*/
+	function RssfitjWeblog(){
+	}
+
+	/*
+    * public
+	* return module name 
+	*/
+	function getDirName(){
+		return $this->dirname;
+	}
+
+	/*
+    * private
+	* Load the module
+	*/
+	function loadModule(){
+		global $module_handler;
+		$mod = $module_handler->getByDirname($this->dirname);
+		if( !$mod || !$mod->getVar('isactive') ){
+			return false;
+		}
+		$this->modname = $mod->getVar('name');
+		return $mod;
+	}
+	
+	/*
+    * public
+	* Grab the entries of your module here
+	*/
+	function grabEntries(&$obj){
+		global $xoopsDB;
+		$myts =& MyTextSanitizer::getInstance();
+		$ret = array();
+		$i = 0;
+
+		if ($obj->getVar('rssfj_param')) {
+			$rcdId=explode(',',$obj->getVar('rssfj_param'));
+			$Tarray=array();
+			$tarray=array();
+			$Carray=array();
+			$carray=array();
+			foreach ($rcdId as $eachId) {
+				if (substr($eachId,0,1)=='T')
+					array_push($Tarray,substr($eachId,1,strlen($eachId)-1));
+				if (substr($eachId,0,1)=='N' || substr($eachId,0,1)=='t')
+					array_push($tarray,substr($eachId,1,strlen($eachId)-1));
+				if (substr($eachId,0,1)=='C')
+					array_push($Carray,substr($eachId,1,strlen($eachId)-1));
+				if (substr($eachId,0,1)=='c')
+					array_push($carray,substr($eachId,1,strlen($eachId)-1));
+			}
+			$add_sql="";
+			if (count($Tarray)) {
+				$add_sql.=" AND (";
+				foreach($Tarray as $TopicId) {
+					$add_sql .= "l.blog_id=".$TopicId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+			if (count($tarray)) {
+				$add_sql.=" AND NOT(";
+				foreach($tarray as $TopicId) {
+					$add_sql .= "l.blog_id=".$TopicId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+			if (count($Carray)) {
+				$add_sql.=" AND (";
+				foreach($Carray as $CatId) {
+					$add_sql .= "l.cat_id=".$CatId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+			if (count($carray)) {
+				$add_sql.=" AND NOT(";
+				foreach($carray as $CatId) {
+					$add_sql .= "l.cat_id=".$CatId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+		} else {
+			$add_sql="";
+		}
+
+	//	The following example code grabs the latest entries from the module MyLinks
+		$sql = "SELECT l.user_id, l.cat_id, l.blog_id, l.title, l.created, l.contents, c.cat_id, c.cat_title  FROM ".$xoopsDB->prefix("weblog")." l, ".$xoopsDB->prefix("weblog_category")." c WHERE l.cat_id=c.cat_id".$add_sql." ORDER BY l.created DESC";
+		$result = $xoopsDB->query($sql, $obj->getVar('rssfj_grab'), 0);
+		while( $row = $xoopsDB->fetchArray($result) ){
+		//	required items
+			$link = XOOPS_URL.'/modules/'.$this->dirname.'/details.php?blog_id='.$row['blog_id'];
+													// The title of the item
+			$desc=$this->modname." : ".$row['cat_title'].">>".$row['title'];
+			$ret[$i]['title'] = $myts->makeTareaData4Show($desc);
+			$ret[$i]['link'] = $link;				// The URL of the item
+			$ret[$i]['guid'] = $link;				// Unique identifier, usually url
+			$ret[$i]['timestamp'] = $row['created'];	// Item modification date,
+													// must be in Unix time format
+			$desc = $row['contents'];				// The item synopsis, or 
+													// description, whatever
+			$ret[$i]['description'] = $myts->makeTareaData4Show($desc);
+		//	optional items
+			$ret[$i]['category'] = $this->modname;
+			$ret[$i]['domain'] = XOOPS_URL.'/modules/'.$this->dirname.'/';
+			
+			$i++;
+		}
+		return $ret;
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/rssj/plugins/rssfitj.popnupblog.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/rssj/plugins/rssfitj.popnupblog.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/rssj/plugins/rssfitj.popnupblog.php	(revision 405)
@@ -0,0 +1,210 @@
+<?php
+###############################################################################
+##                RSSFit - Extendable XML news feed generator                ##
+##                   Copyright (c) 2004 NS Tai (aka tuff)                    ##
+##                       <http://www.brandycoke.com/>                        ##
+##                      Modified By 2005 CACHE RSSfitJ                       ##
+##                       <http://gyakubiki.kir.jp/>                          ##
+###############################################################################
+##                    XOOPS - PHP Content Management System                  ##
+##                       Copyright (c) 2000 XOOPS.org                        ##
+##                          <http://www.xoops.org/>                          ##
+###############################################################################
+##  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.                                      ##
+##                                                                           ##
+##  You may not change or alter any portion of this comment or credits       ##
+##  of supporting developers from this source code or any supporting         ##
+##  source code which is considered copyrighted (c) material of the          ##
+##  original comment or credit authors.                                      ##
+##                                                                           ##
+##  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 ##
+###############################################################################
+##  Author of this file: CACHE                                               ##
+##  URL: http://gyakubiki.kir.jp/                                            ##
+##  Project: RSSFitJ                                                         ##
+###############################################################################
+/*
+* Step 0: Stop here if you are not sure what you are doing, it's no fun at all
+* Step 1: Clone this file and rename as rssfitj.[mod_dir].php
+* Step 2: Replace the text "RssfitjSample" with "Rssfitj[mod_dir]" at line 47 and line 55, i.e. "RssfitjNews" for the module "News"
+* Step 3: Modify the word in line 48 from 'sample' to [mod_dir]
+* Step 4: Modify the function "grabEntries" to satisfy your needs
+* Step 5: Move the new plug-in file to the plugins folder, i.e.  your-xoops-root/modules/rss/plugins
+* Step 6: Install your plug-in by pointing your browser to your-xoops-url/modules/rss/admin/index.php
+* [mod_dir]: Name of the driectory of your module, i.e. 'news'
+*/
+
+class Rssfitjpopnupblog{
+	var $dirname = 'popnupblog';
+	var $modname;
+	
+	/*
+    * private
+	* Nothing here so far
+	*/
+	function Rssfitjpopnupblog(){
+	}
+	
+	function loadModule(){
+		global $module_handler;
+		$mod = $module_handler->getByDirname($this->dirname);
+		if( !$mod || !$mod->getVar('isactive') ){
+			return false;
+		}
+		$this->modname = $mod->getVar('name');
+		return $mod;
+	}
+
+	/*
+    * public
+	* return module name 
+	*/
+	function getDirName(){
+		return $this->dirname;
+	}
+
+	function grabEntries(&$obj){
+		global $xoopsDB;
+		$myts =& MyTextSanitizer::getInstance();
+		$ret = array();
+		$i = 0;
+
+		if ($obj->getVar('rssfj_param')) {
+			$rcdId=explode(',',$obj->getVar('rssfj_param'));
+			$tarray=array();
+			$Tarray=array();
+			$farray=array();
+			$Farray=array();
+			$Carray=array();
+			$carray=array();
+			foreach ($rcdId as $eachId) {
+				if (substr($eachId,0,1)=='T')
+					array_push($Tarray,substr($eachId,1,strlen($eachId)-1));
+				if (substr($eachId,0,1)=='N' || substr($eachId,0,1)=='t')
+					array_push($tarray,substr($eachId,1,strlen($eachId)-1));
+				if (substr($eachId,0,1)=='F')
+					array_push($Farray,substr($eachId,1,strlen($eachId)-1));
+				if (substr($eachId,0,1)=='f')
+					array_push($farray,substr($eachId,1,strlen($eachId)-1));
+				if (substr($eachId,0,1)=='C')
+					array_push($Carray,substr($eachId,1,strlen($eachId)-1));
+				if (substr($eachId,0,1)=='c')
+					array_push($carray,substr($eachId,1,strlen($eachId)-1));
+			}
+			$add_sql="";
+			if (count($Tarray)) {
+				$work_sql="";
+				foreach($Tarray as $TopicId) {
+					switch(strlen($TopicId)) {
+						case 8:
+							$startTime="'".substr($TopicId,0,4)."-".substr($TopicId,4,2)."-".substr($TopicId,6,2)." 00:00:00'";
+							$endTime="'".substr($TopicId,0,4)."-".substr($TopicId,4,2)."-".substr($TopicId,6,2)." 23:59:59'";
+							$work_sql .= "(l.blog_date>=".$startTime." AND l.blog_date<=".$endTime.") OR ";
+						break;
+						case 14 :
+							$justTime="'".substr($TopicId,0,4)."-".substr($TopicId,4,2)."-".substr($TopicId,6,2)." ".substr($TopicId,8,2).":".substr($TopicId,10,2).":".substr($TopicId,12,2)."'";
+							$work_sql .= "l.blog_date=".$justTime." OR ";
+						break;
+						default : break;
+					}
+				}
+				if ($work_sql)
+					$add_sql .= " AND (".substr($work_sql,0,strlen($work_sql)-4).")";
+			}
+			if (count($tarray)) {
+				$work_sql="";
+				foreach($tarray as $TopicId) {
+					switch(strlen($TopicId)) {
+						case 8:
+							$startTime="'".substr($TopicId,0,4)."-".substr($TopicId,4,2)."-".substr($TopicId,6,2)." 00:00:00'";
+							$endTime="'".substr($TopicId,0,4)."-".substr($TopicId,4,2)."-".substr($TopicId,6,2)." 23:59:59'";
+							$work_sql .= "(l.blog_date>=".$startTime." AND l.blog_date<=".$endTime.") OR ";
+						break;
+						case 14 :
+							$justTime="'".substr($TopicId,0,4)."-".substr($TopicId,4,2)."-".substr($TopicId,6,2)." ".substr($TopicId,8,2).":".substr($TopicId,10,2).":".substr($TopicId,12,2)."'";
+							$work_sql .= "l.blog_date=".$justTime." OR ";
+						break;
+						default : break;
+					}
+				}
+				if ($work_sql)
+					$add_sql .= " AND NOT(".substr($work_sql,0,strlen($work_sql)-4).")";
+			}
+			if (count($Farray)) {
+				$add_sql.=" AND (";
+				foreach($Farray as $ForumId) {
+					$add_sql .= "m.blogid=".$ForumId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+			if (count($farray)) {
+				$add_sql.=" AND NOT(";
+				foreach($farray as $ForumId) {
+					$add_sql .= "m.blogid=".$ForumId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+			if (count($Carray)) {
+				$add_sql.=" AND (";
+				foreach($Carray as $CatId) {
+					$add_sql .= "m.cat_id=".$CatId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+			if (count($carray)) {
+				$add_sql.=" AND NOT(";
+				foreach($carray as $CatId) {
+					$add_sql .= "m.cat_id=".$CatId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+		} else {
+			$add_sql="";
+		}
+
+		//	The following example code grabs the latest entries from the module MyLinks
+		$sql = "SELECT m.uid, m.cat_id, m.blogid, m.title as mtitle, l.title as ltitle, l.blog_date, l.post_text, c.cat_title FROM "
+			.$xoopsDB->prefix("popnupblog_info")." m, ".$xoopsDB->prefix("popnupblog")." l, ".$xoopsDB->prefix("popnupblog_categories")
+			." c  WHERE (m.blog_permission & 0x07)=0 and m.blogid=l.blogid and c.cat_id=m.cat_id".$add_sql." ORDER BY l.blog_date DESC";
+		//echo $sql;
+
+		$result = $xoopsDB->query($sql, $obj->getVar('rssfj_grab'), 0);
+		while( $row = $xoopsDB->fetchArray($result) ){
+		//	required items
+			$link = XOOPS_URL.'/modules/'.$this->dirname.'/index.php?param='.$row['blogid']."-".preg_replace("(-| |:)","",$row['blog_date']);
+												// The title of the item
+			$desc=$this->modname." : ".$row['cat_title'].">>".$row['mtitle'].">>".$row['ltitle'];
+			$ret[$i]['title'] = $myts->makeTareaData4Show($desc);
+			$ret[$i]['link'] = $link;			// The URL of the item
+			$ret[$i]['guid'] = $link;			// Unique identifier, usually url
+												// Item modification date,
+			$ret[$i]['timestamp'] = mktime(substr($row['blog_date'],11,2),substr($row['blog_date'],14,2),substr($row['blog_date'],17,2),substr($row['blog_date'],5,2),substr($row['blog_date'],8,2),substr($row['blog_date'],0,4));
+												// must be in Unix time format
+			$desc = $row['post_text'];			// The item synopsis, or 
+												// description, whatever
+			$ret[$i]['description'] = $myts->makeTareaData4Show($desc);
+		//	optional items
+			$ret[$i]['category'] = $this->modname;
+			$ret[$i]['domain'] = XOOPS_URL.'/modules/'.$this->dirname.'/';
+			
+			$i++;
+		}
+		return $ret;
+	}
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/rssj/plugins/rssfitj.mylinks.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/rssj/plugins/rssfitj.mylinks.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/rssj/plugins/rssfitj.mylinks.php	(revision 405)
@@ -0,0 +1,154 @@
+<?php
+###############################################################################
+##                RSSFit - Extendable XML news feed generator                ##
+##                   Copyright (c) 2004 NS Tai (aka tuff)                    ##
+##                       <http://www.brandycoke.com/>                        ##
+##                      Modified By 2005 CACHE RSSfitJ                       ##
+##                       <http://gyakubiki.kir.jp/>                          ##
+###############################################################################
+##                    XOOPS - PHP Content Management System                  ##
+##                       Copyright (c) 2000 XOOPS.org                        ##
+##                          <http://www.xoops.org/>                          ##
+###############################################################################
+##  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.                                      ##
+##                                                                           ##
+##  You may not change or alter any portion of this comment or credits       ##
+##  of supporting developers from this source code or any supporting         ##
+##  source code which is considered copyrighted (c) material of the          ##
+##  original comment or credit authors.                                      ##
+##                                                                           ##
+##  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 ##
+###############################################################################
+##  Author of this file: CACHE                                               ##
+##  URL: http://gyakubiki.kir.jp/                                            ##
+##  Project: RSSFitJ                                                         ##
+###############################################################################
+/*
+* Step 0: Stop here if you are not sure what you are doing, it's no fun at all
+* Step 1: Clone this file and rename as rssfitj.[mod_dir].php
+* Step 2: Replace the text "RssfitjSample" with "Rssfitj[mod_dir]" at line 47 and line 55, i.e. "RssfitjNews" for the module "News"
+* Step 3: Modify the word in line 48 from 'sample' to [mod_dir]
+* Step 4: Modify the function "grabEntries" to satisfy your needs
+* Step 5: Move the new plug-in file to the plugins folder, i.e.  your-xoops-root/modules/rss/plugins
+* Step 6: Install your plug-in by pointing your browser to your-xoops-url/modules/rss/admin/index.php
+* [mod_dir]: Name of the driectory of your module, i.e. 'news'
+*/
+
+class RssfitjMylinks{
+	var $dirname = 'mylinks';
+	var $modname;
+	
+	/*
+    * private
+	* Nothing here so far
+	*/
+	function RssfitjMylinks(){
+	}
+	
+	function loadModule(){
+		global $module_handler;
+		$mod = $module_handler->getByDirname($this->dirname);
+		if( !$mod || !$mod->getVar('isactive') ){
+			return false;
+		}
+		$this->modname = $mod->getVar('name');
+		return $mod;
+	}
+
+	/*
+    * public
+	* return module name 
+	*/
+	function getDirName(){
+		return $this->dirname;
+	}
+
+	function grabEntries(&$obj){
+		global $xoopsDB;
+		$myts =& MyTextSanitizer::getInstance();
+		$ret = array();
+		$i = 0;
+
+		if ($obj->getVar('rssfj_param')) {
+			$rcdId=explode(',',$obj->getVar('rssfj_param'));
+			$tarray=array();
+			$Tarray=array();
+			$carray=array();
+			$Carray=array();
+			foreach ($rcdId as $eachId) {
+				if (substr($eachId,0,1)=='T')
+					array_push($Tarray,substr($eachId,1,strlen($eachId)-1));
+				if (substr($eachId,0,1)=='N' || substr($eachId,0,1)=='t')
+					array_push($tarray,substr($eachId,1,strlen($eachId)-1));
+				if (substr($eachId,0,1)=='C')
+					array_push($Carray,substr($eachId,1,strlen($eachId)-1));
+				if (substr($eachId,0,1)=='c')
+					array_push($carray,substr($eachId,1,strlen($eachId)-1));
+			}
+			$add_sql="";
+			if (count($Tarray)) {
+				$add_sql.=" AND (";
+				foreach($Tarray as $TopicId) {
+					$add_sql .= "l.lid=".$TopicId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+			if (count($tarray)) {
+				$add_sql.=" AND NOT(";
+				foreach($tarray as $TopicId) {
+					$add_sql .= "l.lid=".$TopicId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+			if (count($Carray)) {
+				$add_sql.=" AND (";
+				foreach($Carray as $CatId) {
+					$add_sql .= "l.cid=".$CatId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+			if (count($carray)) {
+				$add_sql.=" AND NOT(";
+				foreach($carray as $CatId) {
+					$add_sql .= "l.cid=".$CatId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+		} else {
+			$add_sql="";
+		}
+
+		$sql = "SELECT l.lid, l.cid, l.title, l.date, t.description, c.title as ctitle  FROM ".$xoopsDB->prefix("mylinks_links")." l, ".$xoopsDB->prefix("mylinks_text")." t, ".$xoopsDB->prefix("mylinks_cat")." c WHERE l.status>0 AND l.lid=t.lid AND l.cid=c.cid".$add_sql." ORDER BY l.date DESC";
+
+		$result = $xoopsDB->query($sql, $obj->getVar('rssfj_grab'), 0);
+		while( $row = $xoopsDB->fetchArray($result) ){
+		//	required
+			$desc=$this->modname." : ".$row['ctitle']." >> ".$row['title'];
+			$ret[$i]['title'] = $myts->makeTareaData4Show($desc);
+			$link = XOOPS_URL.'/modules/'.$this->dirname.'/singlelink.php?cid='.$row['cid'].'&amp;lid='.$row['lid'];
+			$ret[$i]['link'] = $ret[$i]['guid'] = $link;
+			$ret[$i]['timestamp'] = $row['date'];
+			$ret[$i]['description'] = $myts->makeTareaData4Show($row['description']);
+		//	optional
+			$ret[$i]['category'] = $this->modname;
+			$ret[$i]['domain'] = XOOPS_URL.'/modules/'.$this->dirname.'/';
+			$i++;
+		}
+		return $ret;
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/rssj/plugins/rssfitj.xwords.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/rssj/plugins/rssfitj.xwords.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/rssj/plugins/rssfitj.xwords.php	(revision 405)
@@ -0,0 +1,169 @@
+<?php
+###############################################################################
+##                RSSFit - Extendable XML news feed generator                ##
+##                   Copyright (c) 2004 NS Tai (aka tuff)                    ##
+##                       <http://www.brandycoke.com/>                        ##
+##                      Modified By 2005 CACHE RSSfitJ                       ##
+##                       <http://gyakubiki.kir.jp/>                          ##
+###############################################################################
+##                    XOOPS - PHP Content Management System                  ##
+##                       Copyright (c) 2000 XOOPS.org                        ##
+##                          <http://www.xoops.org/>                          ##
+###############################################################################
+##  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.                                      ##
+##                                                                           ##
+##  You may not change or alter any portion of this comment or credits       ##
+##  of supporting developers from this source code or any supporting         ##
+##  source code which is considered copyrighted (c) material of the          ##
+##  original comment or credit authors.                                      ##
+##                                                                           ##
+##  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 ##
+###############################################################################
+##  Author of this file: CACHE                                               ##
+##  URL: http://gyakubiki.kir.jp/                                            ##
+##  Project: RSSFitJ                                                         ##
+###############################################################################
+/*
+* Step 0: Stop here if you are not sure what you are doing, it's no fun at all
+* Step 1: Clone this file and rename as rssfitj.[mod_dir].php
+* Step 2: Replace the text "RssfitjSample" with "Rssfitj[mod_dir]" at line 47 and line 55, i.e. "RssfitjNews" for the module "News"
+* Step 3: Modify the word in line 48 from 'sample' to [mod_dir]
+* Step 4: Modify the function "grabEntries" to satisfy your needs
+* Step 5: Move the new plug-in file to the plugins folder, i.e.  your-xoops-root/modules/rss/plugins
+* Step 6: Install your plug-in by pointing your browser to your-xoops-url/modules/rss/admin/index.php
+* [mod_dir]: Name of the driectory of your module, i.e. 'news'
+*/
+
+class RssfitjXwords{
+	var $dirname = 'xwords';
+	var $modname;
+	
+	/*
+    * private
+	* Nothing here so far
+	*/
+	function RssfitjXwords(){
+	}
+
+	/*
+    * public
+	* return module name 
+	*/
+	function getDirName(){
+		return $this->dirname;
+	}
+
+	/*
+    * private
+	* Load the module
+	*/
+	function loadModule(){
+		global $module_handler;
+		$mod = $module_handler->getByDirname($this->dirname);
+		if( !$mod || !$mod->getVar('isactive') ){
+			return false;
+		}
+		$this->modname = $mod->getVar('name');
+		return $mod;
+	}
+	
+	/*
+    * public
+	* Grab the entries of your module here
+	*/
+	function grabEntries(&$obj){
+		global $xoopsDB;
+		$myts =& MyTextSanitizer::getInstance();
+		$ret = array();
+		$i = 0;
+
+		if ($obj->getVar('rssfj_param')) {
+			$rcdId=explode(',',$obj->getVar('rssfj_param'));
+			$tarray=array();
+			$Tarray=array();
+			$Carray=array();
+			$carray=array();
+			foreach ($rcdId as $eachId) {
+				if (substr($eachId,0,1)=='T')
+					array_push($Tarray,substr($eachId,1,strlen($eachId)-1));
+				if (substr($eachId,0,1)=='N' || substr($eachId,0,1)=='t')
+					array_push($tarray,substr($eachId,1,strlen($eachId)-1));
+				if (substr($eachId,0,1)=='C')
+					array_push($Carray,substr($eachId,1,strlen($eachId)-1));
+				if (substr($eachId,0,1)=='c')
+					array_push($carray,substr($eachId,1,strlen($eachId)-1));
+			}
+			$add_sql="";
+			if (count($Tarray)) {
+				$add_sql.=" AND (";
+				foreach($Tarray as $TopicId) {
+					$add_sql .= "l.entryID=".$TopicId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+			if (count($tarray)) {
+				$add_sql.=" AND NOT(";
+				foreach($tarray as $TopicId) {
+					$add_sql .= "l.entryID=".$TopicId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+			if (count($Carray)) {
+				$add_sql.=" AND (";
+				foreach($Carray as $CatId) {
+					$add_sql .= "l.categoryID=".$CatId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+			if (count($carray)) {
+				$add_sql.=" AND NOT(";
+				foreach($carray as $CatId) {
+					$add_sql .= "l.categoryID=".$CatId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+		} else {
+			$add_sql="";
+		}
+
+	//	The following example code grabs the latest entries from the module MyLinks
+		$sql = "SELECT l.entryID, l.categoryID, l.term, l.datesub, l.definition, c.categoryID, c.name FROM ".$xoopsDB->prefix("xwords_ent")." l, ".$xoopsDB->prefix("xwords_cat")." c WHERE l.categoryID=c.categoryID".$add_sql." ORDER BY l.datesub DESC";
+
+		$result = $xoopsDB->query($sql, $obj->getVar('rssfj_grab'), 0);
+		while( $row = $xoopsDB->fetchArray($result) ){
+		//	required items
+			$link = XOOPS_URL.'/modules/'.$this->dirname.'/entry.php?entryID='.$row['entryID'];
+													// The title of the item
+			$desc=$this->modname." : ".$row['name'].">>".$row['term'];
+			$ret[$i]['title'] = $myts->makeTareaData4Show($desc);
+			$ret[$i]['link'] = $link;				// The URL of the item
+			$ret[$i]['guid'] = $link;				// Unique identifier, usually url
+			$ret[$i]['timestamp'] = $row['datesub'];	// Item modification date,
+													// must be in Unix time format
+			$desc = $row['definition'];			// The item synopsis, or 
+													// description, whatever
+			$ret[$i]['description'] = $myts->makeTareaData4Show($desc);
+		//	optional items
+			$ret[$i]['category'] = $this->modname;
+			$ret[$i]['domain'] = XOOPS_URL.'/modules/'.$this->dirname.'/';
+			
+			$i++;
+		}
+		return $ret;
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/rssj/plugins/rssfitj.sections.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/rssj/plugins/rssfitj.sections.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/rssj/plugins/rssfitj.sections.php	(revision 405)
@@ -0,0 +1,169 @@
+<?php
+###############################################################################
+##                RSSFit - Extendable XML news feed generator                ##
+##                   Copyright (c) 2004 NS Tai (aka tuff)                    ##
+##                       <http://www.brandycoke.com/>                        ##
+##                      Modified By 2005 CACHE RSSfitJ                       ##
+##                       <http://gyakubiki.kir.jp/>                          ##
+###############################################################################
+##                    XOOPS - PHP Content Management System                  ##
+##                       Copyright (c) 2000 XOOPS.org                        ##
+##                          <http://www.xoops.org/>                          ##
+###############################################################################
+##  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.                                      ##
+##                                                                           ##
+##  You may not change or alter any portion of this comment or credits       ##
+##  of supporting developers from this source code or any supporting         ##
+##  source code which is considered copyrighted (c) material of the          ##
+##  original comment or credit authors.                                      ##
+##                                                                           ##
+##  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 ##
+###############################################################################
+##  Author of this file: CACHE                                               ##
+##  URL: http://gyakubiki.kir.jp/                                            ##
+##  Project: RSSFitJ                                                         ##
+###############################################################################
+/*
+* Step 0: Stop here if you are not sure what you are doing, it's no fun at all
+* Step 1: Clone this file and rename as rssfitj.[mod_dir].php
+* Step 2: Replace the text "RssfitjSample" with "Rssfitj[mod_dir]" at line 47 and line 55, i.e. "RssfitjNews" for the module "News"
+* Step 3: Modify the word in line 48 from 'sample' to [mod_dir]
+* Step 4: Modify the function "grabEntries" to satisfy your needs
+* Step 5: Move the new plug-in file to the plugins folder, i.e.  your-xoops-root/modules/rss/plugins
+* Step 6: Install your plug-in by pointing your browser to your-xoops-url/modules/rss/admin/index.php
+* [mod_dir]: Name of the driectory of your module, i.e. 'news'
+*/
+
+class RssfitjSections{
+	var $dirname = 'sections';
+	var $modname;
+	
+	/*
+    * private
+	* Nothing here so far
+	*/
+	function RssfitjSections(){
+	}
+
+	/*
+    * public
+	* return module name 
+	*/
+	function getDirName(){
+		return $this->dirname;
+	}
+
+	/*
+    * private
+	* Load the module
+	*/
+	function loadModule(){
+		global $module_handler;
+		$mod = $module_handler->getByDirname($this->dirname);
+		if( !$mod || !$mod->getVar('isactive') ){
+			return false;
+		}
+		$this->modname = $mod->getVar('name');
+		return $mod;
+	}
+	
+	/*
+    * public
+	* Grab the entries of your module here
+	*/
+	function grabEntries(&$obj){
+		global $xoopsDB;
+		$myts =& MyTextSanitizer::getInstance();
+		$ret = array();
+		$i = 0;
+
+		if ($obj->getVar('rssfj_param')) {
+			$rcdId=explode(',',$obj->getVar('rssfj_param'));
+			$Tarray=array();
+			$tarray=array();
+			$Carray=array();
+			$carray=array();
+			foreach ($rcdId as $eachId) {
+				if (substr($eachId,0,1)=='T')
+					array_push($Tarray,substr($eachId,1,strlen($eachId)-1));
+				if (substr($eachId,0,1)=='N' || substr($eachId,0,1)=='t')
+					array_push($tarray,substr($eachId,1,strlen($eachId)-1));
+				if (substr($eachId,0,1)=='C')
+					array_push($Carray,substr($eachId,1,strlen($eachId)-1));
+				if (substr($eachId,0,1)=='c')
+					array_push($carray,substr($eachId,1,strlen($eachId)-1));
+			}
+			$add_sql="";
+			if (count($Tarray)) {
+				$add_sql.=" AND (";
+				foreach($Tarray as $TopicId) {
+					$add_sql .= "l.artid=".$TopicId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+			if (count($tarray)) {
+				$add_sql.=" AND NOT(";
+				foreach($tarray as $TopicId) {
+					$add_sql .= "l.artid=".$TopicId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+			if (count($Carray)) {
+				$add_sql.=" AND (";
+				foreach($Carray as $CatId) {
+					$add_sql .= "l.secid=".$CatId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+			if (count($carray)) {
+				$add_sql.=" AND NOT(";
+				foreach($carray as $CatId) {
+					$add_sql .= "l.secid=".$CatId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+		} else {
+			$add_sql="";
+		}
+
+	//	The following example code grabs the latest entries from the module MyLinks
+		$sql = "SELECT l.artid, l.secid, l.title, l.content, c.secid, c.secname FROM ".$xoopsDB->prefix("seccont")." l, ".$xoopsDB->prefix("sections")." c WHERE l.secid=c.secid".$add_sql." ORDER BY l.artid DESC";
+
+		$result = $xoopsDB->query($sql, $obj->getVar('rssfj_grab'), 0);
+		while( $row = $xoopsDB->fetchArray($result) ){
+		//	required items
+			$link = XOOPS_URL.'/modules/'.$this->dirname.'/index.php?op=viewarticle&amp;artid='.$row['artid'];
+													// The title of the item
+			$desc=$this->modname." : ".$row['secname'].">>".$row['title'];
+			$ret[$i]['title'] = $myts->makeTareaData4Show($desc);
+			$ret[$i]['link'] = $link;				// The URL of the item
+			$ret[$i]['guid'] = $link;				// Unique identifier, usually url
+			$ret[$i]['timestamp'] = 0;				// Item modification date,
+													// must be in Unix time format
+			$desc = $row['content'];				// The item synopsis, or 
+													// description, whatever
+			$ret[$i]['description'] = $myts->makeTareaData4Show($desc);
+		//	optional items
+			$ret[$i]['category'] = $this->modname;
+			$ret[$i]['domain'] = XOOPS_URL.'/modules/'.$this->dirname.'/';
+			
+			$i++;
+		}
+		return $ret;
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/rssj/plugins/rssfitj.wordpress.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/rssj/plugins/rssfitj.wordpress.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/rssj/plugins/rssfitj.wordpress.php	(revision 405)
@@ -0,0 +1,212 @@
+<?php
+###############################################################################
+##                RSSFit - Extendable XML news feed generator                ##
+##                   Copyright (c) 2004 NS Tai (aka tuff)                    ##
+##                       <http://www.brandycoke.com/>                        ##
+##                      Modified By 2005 CACHE RSSfitJ                       ##
+##                       <http://gyakubiki.kir.jp/>                          ##
+###############################################################################
+##                    XOOPS - PHP Content Management System                  ##
+##                       Copyright (c) 2000 XOOPS.org                        ##
+##                          <http://www.xoops.org/>                          ##
+###############################################################################
+##  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.                                      ##
+##                                                                           ##
+##  You may not change or alter any portion of this comment or credits       ##
+##  of supporting developers from this source code or any supporting         ##
+##  source code which is considered copyrighted (c) material of the          ##
+##  original comment or credit authors.                                      ##
+##                                                                           ##
+##  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 ##
+###############################################################################
+##  Author of this file: CACHE                                               ##
+##  URL: http://gyakubiki.kir.jp/                                            ##
+##  Project: RSSFitJ                                                         ##
+###############################################################################
+/*
+* Step 0: Stop here if you are not sure what you are doing, it's no fun at all
+* Step 1: Clone this file and rename as rssfitj.[mod_dir].php
+* Step 2: Replace the text "RssfitjSample" with "Rssfitj[mod_dir]" at line 47 and line 55, i.e. "RssfitjNews" for the module "News"
+* Step 3: Modify the word in line 48 from 'sample' to [mod_dir]
+* Step 4: Modify the function "grabEntries" to satisfy your needs
+* Step 5: Move the new plug-in file to the plugins folder, i.e.  your-xoops-root/modules/rss/plugins
+* Step 6: Install your plug-in by pointing your browser to your-xoops-url/modules/rss/admin/index.php
+* [mod_dir]: Name of the driectory of your module, i.e. 'news'
+*/
+
+class RssfitjWordpress{
+	var $dirname = 'wordpress';
+	var $modname;
+	
+	/*
+    * private
+	* Nothing here so far
+	*/
+	function RssfitjWordpress(){
+	}
+	
+	/*
+    * private
+	* Load the module
+	*/
+	function loadModule(){
+		global $module_handler;
+		$mod = $module_handler->getByDirname($this->dirname);
+		if( !$mod || !$mod->getVar('isactive') ){
+			return false;
+		}
+		$this->modname = $mod->getVar('name');
+		return $mod;
+	}
+	
+	/*
+    * public
+	* return module name 
+	*/
+	function getDirName(){
+		return $this->dirname;
+	}
+
+	/*
+    * public
+	* Grab the entries of your module here
+	*/
+	function grabEntries(&$obj){
+		global $xoopsDB,$module_handler;
+		$myts =& MyTextSanitizer::getInstance();
+		$ret = array();
+		$i = 0;
+
+		if ($obj->getVar('rssfj_param')) {
+			$rcdId=explode(',',$obj->getVar('rssfj_param'));
+			$Carray=array();
+			$carray=array();
+			$Tarray=array();
+			$tarray=array();
+			foreach ($rcdId as $eachId) {
+				if (strpos($eachId,':')!==False) {
+					$words=explode(':',$eachId);
+					$word_cnt=0;
+					foreach($words as $word) {
+						if ($word_cnt > 0) {
+							if (strpos($word,'C')!==False)
+								$Carray[$words[0]][]=substr($word,1,strlen($word)-1);
+							if (strpos($word,'c')!==False) {
+								if (!isset($Carray[$words[0]]))
+									$Carray[$words[0]]="";
+								$carray[$words[0]][]=substr($word,1,strlen($word)-1);
+							}
+							if (strpos($word,'T')!==False) {
+								if (!isset($Carray[$words[0]]))
+									$Carray[$words[0]]="";
+								$Tarray[$words[0]][]=substr($word,1,strlen($word)-1);
+							}
+							if (strpos($word,'N')!==False) {
+								if (!isset($Carray[$words[0]]))
+									$Carray[$words[0]]="";
+								$tarray[$words[0]][]=substr($word,1,strlen($word)-1);
+							}
+							if (strpos($word,'t')!==False) {
+								if (!isset($Carray[$words[0]]))
+									$Carray[$words[0]]="";
+								$tarray[$words[0]][]=substr($word,1,strlen($word)-1);
+							}
+						}
+						$word_cnt++;
+					}
+				} else {
+					if (!in_array($eachId,array_keys($Carray)))
+						$Carray[$eachId]="";
+				}
+			}
+			if (count($Carray)==0)
+				$Carray['wordpress']="";
+		} else {
+			$Carray['wordpress']="";
+		}
+
+	//	The following example code grabs the latest entries from the module MyLinks
+	foreach ($Carray as $key=>$val) {
+		$add_sql="";
+		if (is_array($Carray[$key])) {
+			$add_sql.=" AND (";
+			foreach($Carray[$key] as $eachId) {
+				$add_sql .= "c.cat_ID=".$eachId." OR ";
+			}
+			$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+			$add_sql .= ")";
+		}
+		if (isset($carray[$key])) {
+			$add_sql.=" AND NOT(";
+			foreach($carray[$key] as $eachId) {
+				$add_sql .= "c.cat_ID=".$eachId." OR ";
+			}
+			$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+			$add_sql .= ")";
+		}
+		if (isset($Tarray[$key])) {
+			$add_sql.=" AND (";
+			foreach($Tarray[$key] as $eachId) {
+				$add_sql .= "p.ID=".$eachId." OR ";
+			}
+			$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+			$add_sql .= ")";
+		}
+		if (isset($tarray[$key])) {
+			$add_sql.=" AND NOT(";
+			foreach($tarray[$key] as $eachId) {
+				$add_sql .= "p.ID=".$eachId." OR ";
+			}
+			$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+			$add_sql .= ")";
+		}
+		if ($key=='wordpress') {
+			$sql = "SELECT p.ID, p.post_content, p.post_title, p.post_date, p.post_category, c.cat_name FROM ".$xoopsDB->prefix("wp_posts")." p, ".$xoopsDB->prefix("wp_categories")." c, ".$xoopsDB->prefix("wp_post2cat")." r WHERE p.ID=r.post_id AND r.category_id=c.cat_ID AND post_status='publish'".$add_sql." ORDER BY p.post_date DESC";
+		} else {
+			$sql = "SELECT p.ID, p.post_content, p.post_title, p.post_date, p.post_category, c.cat_name FROM ".$xoopsDB->prefix("wp".substr($key,-1,1)."_posts")." p, ".$xoopsDB->prefix("wp".substr($key,-1,1)."_categories")." c, ".$xoopsDB->prefix("wp".substr($key,-1,1)."_post2cat")." r WHERE p.ID=r.post_id AND r.category_id=c.cat_ID AND post_status='publish'".$add_sql." ORDER BY p.post_date DESC";
+		}
+		$result = $xoopsDB->query($sql, $obj->getVar('rssfj_grab'), 0);
+		while( $row = $xoopsDB->fetchArray($result) ){
+		//	required items
+			$mod = $module_handler->getByDirname($key);
+			if( !$mod || !$mod->getVar('isactive') ){
+				return $ret;
+			}
+			$modname = $mod->getVar('name');
+
+			$link = XOOPS_URL.'/modules/'.$key.'/index.php?p='.$row['ID'];
+													// The title of the item
+			$desc=$modname." : ".$row['cat_name'].">>".$row['post_title'];
+			$ret[$i]['title'] = $myts->makeTareaData4Show($desc);
+			$ret[$i]['link'] = $link;				// The URL of the item
+			$ret[$i]['guid'] = $link;				// Unique identifier, usually url
+													// Item modification date
+			$date_sep=explode(' ',$row['post_date']);
+			$date_ymd=explode('-',$date_sep[0]);
+			$date_tms=explode(':',$date_sep[1]);
+			$ret[$i]['timestamp'] = mktime($date_tms[0],$date_tms[1],$date_tms[2],$date_ymd[1],$date_ymd[2],$date_ymd[0]);
+													// must be in Unix time format
+			$desc = $row['post_content'];			// The item synopsis, or 
+													// description, whatever
+			$ret[$i]['description'] = $myts->makeTareaData4Show($desc);
+		//	optional items
+			$ret[$i]['category'] = $modname;
+			$ret[$i]['domain'] = XOOPS_URL.'/modules/'.$key.'/';
+			
+			$i++;
+		}
+	}
+		return $ret;
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/rssj/plugins/rssfitj.utype_bbs.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/rssj/plugins/rssfitj.utype_bbs.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/rssj/plugins/rssfitj.utype_bbs.php	(revision 405)
@@ -0,0 +1,159 @@
+<?php
+###############################################################################
+##                RSSFit - Extendable XML news feed generator                ##
+##                   Copyright (c) 2004 NS Tai (aka tuff)                    ##
+##                       <http://www.brandycoke.com/>                        ##
+##                      Modified By 2005 CACHE RSSfitJ                       ##
+##                       <http://gyakubiki.kir.jp/>                          ##
+###############################################################################
+##                    XOOPS - PHP Content Management System                  ##
+##                       Copyright (c) 2000 XOOPS.org                        ##
+##                          <http://www.xoops.org/>                          ##
+###############################################################################
+##  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.                                      ##
+##                                                                           ##
+##  You may not change or alter any portion of this comment or credits       ##
+##  of supporting developers from this source code or any supporting         ##
+##  source code which is considered copyrighted (c) material of the          ##
+##  original comment or credit authors.                                      ##
+##                                                                           ##
+##  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 ##
+###############################################################################
+##  Author of this file: CACHE                                               ##
+##  URL: http://gyakubiki.kir.jp/                                            ##
+##  Project: RSSFitJ                                                         ##
+###############################################################################
+/*
+* Step 0: Stop here if you are not sure what you are doing, it's no fun at all
+* Step 1: Clone this file and rename as rssfitj.[mod_dir].php
+* Step 2: Replace the text "RssfitjSample" with "Rssfitj[mod_dir]" at line 47 and line 55, i.e. "RssfitjNews" for the module "News"
+* Step 3: Modify the word in line 48 from 'sample' to [mod_dir]
+* Step 4: Modify the function "grabEntries" to satisfy your needs
+* Step 5: Move the new plug-in file to the plugins folder, i.e.  your-xoops-root/modules/rss/plugins
+* Step 6: Install your plug-in by pointing your browser to your-xoops-url/modules/rss/admin/index.php
+* [mod_dir]: Name of the driectory of your module, i.e. 'news'
+*/
+
+class RssfitjUtype_bbs{
+	var $dirname = 'utype_bbs';
+	var $modname;
+	
+	/*
+    * private
+	* Nothing here so far
+	*/
+	function RssfitjUtype_bbs(){
+	}
+	
+	function loadModule(){
+		global $module_handler;
+		$mod = $module_handler->getByDirname($this->dirname);
+		if( !$mod || !$mod->getVar('isactive') ){
+			return false;
+		}
+		$this->modname = $mod->getVar('name');
+		return $mod;
+	}
+
+	/*
+    * public
+	* return module name 
+	*/
+	function getDirName(){
+		return $this->dirname;
+	}
+
+	function grabEntries(&$obj){
+		global $xoopsDB, $xoopsModuleConfig;
+
+		$myts =& MyTextSanitizer::getInstance();
+		$ret = array();
+		$i = 0;
+
+		if ($obj->getVar('rssfj_param')) {
+			$rcdId=explode(',',$obj->getVar('rssfj_param'));
+			$Tarray=array();
+			$tarray=array();
+			$Carray=array();
+			$carray=array();
+			foreach ($rcdId as $eachId) {
+				if (substr($eachId,0,1)=='T')
+					array_push($Tarray,substr($eachId,1,strlen($eachId)-1));
+				if (substr($eachId,0,1)=='N' || substr($eachId,0,1)=='t')
+					array_push($tarray,substr($eachId,1,strlen($eachId)-1));
+				if (substr($eachId,0,1)=='C')
+					array_push($Carray,substr($eachId,1,strlen($eachId)-1));
+				if (substr($eachId,0,1)=='c')
+					array_push($carray,substr($eachId,1,strlen($eachId)-1));
+			}
+			$add_sql="";
+			if (count($Tarray)) {
+				$add_sql.=" AND (";
+				foreach($Tarray as $TopicId) {
+					$add_sql .= "t.nid=".$TopicId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+			if (count($tarray)) {
+				$add_sql.=" AND NOT(";
+				foreach($tarray as $TopicId) {
+					$add_sql .= "t.nid=".$TopicId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+			if (count($Carray)) {
+				$add_sql.=" AND (";
+				foreach($Carray as $CatId) {
+					$add_sql .= "t.cid=".$CatId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+			if (count($carray)) {
+				$add_sql.=" AND NOT(";
+				foreach($carray as $CatId) {
+					$add_sql .= "t.cid=".$CatId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+		} else {
+			$add_sql="";
+		}
+
+		$sql = 'SELECT t.nid, t.cid, t.a_title, t.a_com, t.p_day, c.top FROM '.$xoopsDB->prefix('u_typebbs').' t, '.$xoopsDB->prefix('u_type_category').' c WHERE c.cid = t.cid AND t.master_nid=0'.$add_sql.' ORDER BY t.p_day DESC';
+		if( !$result = $xoopsDB->query($sql, $obj->getVar('rssfj_grab'), 0) ){
+			return false;
+		}
+
+		while( $row = $xoopsDB->fetchArray($result) ){
+			$desc = $myts->makeTareaData4Show($row['a_com']);
+			$link = XOOPS_URL.'/modules/'.$this->dirname.'/index.php?mode=single&amp;article='.$row['nid'];
+		//	required
+			$desc2=$this->modname." : ".$row['top'].">>".$row['a_title'];
+			$ret[$i]['title'] = $myts->makeTareaData4Show($desc2);
+			$ret[$i]['link'] = $ret[$i]['guid'] = $link;
+			$ret[$i]['timestamp'] = mktime(substr($row['p_day'],8,2),substr($row['p_day'],10,2),substr($row['p_day'],12,2),substr($row['p_day'],4,2),substr($row['p_day'],6,2),substr($row['p_day'],0,4));
+			$ret[$i]['description'] = $desc;
+		//	optional
+			$ret[$i]['category'] = $this->modname;
+			$ret[$i]['domain'] = XOOPS_URL.'/modules/'.$this->dirname.'/';
+			$i++;
+		}
+		return $ret;
+	}
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/rssj/plugins/rssfitj.newbb.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/rssj/plugins/rssfitj.newbb.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/rssj/plugins/rssfitj.newbb.php	(revision 405)
@@ -0,0 +1,183 @@
+<?php
+###############################################################################
+##                RSSFit - Extendable XML news feed generator                ##
+##                   Copyright (c) 2004 NS Tai (aka tuff)                    ##
+##                       <http://www.brandycoke.com/>                        ##
+##                      Modified By 2005 CACHE RSSfitJ                       ##
+##                       <http://gyakubiki.kir.jp/>                          ##
+###############################################################################
+##                    XOOPS - PHP Content Management System                  ##
+##                       Copyright (c) 2000 XOOPS.org                        ##
+##                          <http://www.xoops.org/>                          ##
+###############################################################################
+##  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.                                      ##
+##                                                                           ##
+##  You may not change or alter any portion of this comment or credits       ##
+##  of supporting developers from this source code or any supporting         ##
+##  source code which is considered copyrighted (c) material of the          ##
+##  original comment or credit authors.                                      ##
+##                                                                           ##
+##  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 ##
+###############################################################################
+##  Author of this file: CACHE                                               ##
+##  URL: http://gyakubiki.kir.jp/                                            ##
+##  Project: RSSFitJ                                                         ##
+###############################################################################
+/*
+* Step 0: Stop here if you are not sure what you are doing, it's no fun at all
+* Step 1: Clone this file and rename as rssfitj.[mod_dir].php
+* Step 2: Replace the text "RssfitjSample" with "Rssfitj[mod_dir]" at line 47 and line 55, i.e. "RssfitjNews" for the module "News"
+* Step 3: Modify the word in line 48 from 'sample' to [mod_dir]
+* Step 4: Modify the function "grabEntries" to satisfy your needs
+* Step 5: Move the new plug-in file to the plugins folder, i.e.  your-xoops-root/modules/rss/plugins
+* Step 6: Install your plug-in by pointing your browser to your-xoops-url/modules/rss/admin/index.php
+* [mod_dir]: Name of the driectory of your module, i.e. 'news'
+*/
+
+class RssfitjNewbb{
+	var $dirname = 'newbb';
+	var $modname;
+	
+	/*
+    * private
+	* Nothing here so far
+	*/
+	function RssfitjNewbb(){
+	}
+	
+	function loadModule(){
+		global $module_handler;
+		$mod = $module_handler->getByDirname($this->dirname);
+		if( !$mod || !$mod->getVar('isactive') ){
+			return false;
+		}
+		$this->modname = $mod->getVar('name');
+		return $mod;
+	}
+
+	/*
+    * public
+	* return module name 
+	*/
+	function getDirName(){
+		return $this->dirname;
+	}
+
+	function grabEntries(&$obj){
+		global $xoopsDB;
+
+		$myts =& MyTextSanitizer::getInstance();
+		$ret = array();
+		$i = 0;
+
+		if ($obj->getVar('rssfj_param')) {
+			$rcdId=explode(',',$obj->getVar('rssfj_param'));
+			$Farray=array();
+			$farray=array();
+			$Tarray=array();
+			$tarray=array();
+			$Carray=array();
+			$carray=array();
+			foreach ($rcdId as $eachId) {
+				if (substr($eachId,0,1)=='F')
+					array_push($Farray,substr($eachId,1,strlen($eachId)-1));
+				if (substr($eachId,0,1)=='f')
+					array_push($farray,substr($eachId,1,strlen($eachId)-1));
+				if (substr($eachId,0,1)=='T')
+					array_push($Tarray,substr($eachId,1,strlen($eachId)-1));
+				if (substr($eachId,0,1)=='N' || substr($eachId,0,1)=='t')
+					array_push($tarray,substr($eachId,1,strlen($eachId)-1));
+				if (substr($eachId,0,1)=='C')
+					array_push($Carray,substr($eachId,1,strlen($eachId)-1));
+				if (substr($eachId,0,1)=='c')
+					array_push($carray,substr($eachId,1,strlen($eachId)-1));
+			}
+			$add_sql="";
+			if (count($Tarray)) {
+				$add_sql.=" AND (";
+				foreach($Tarray as $TopicId) {
+					$add_sql .= "t.topic_id=".$TopicId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+			if (count($tarray)) {
+				$add_sql.=" AND NOT(";
+				foreach($tarray as $TopicId) {
+					$add_sql .= "t.topic_id=".$TopicId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+			if (count($Farray)) {
+				$add_sql.=" AND (";
+				foreach($Farray as $forumId) {
+					$add_sql .= "t.forum_id=".$forumId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+			if (count($farray)) {
+				$add_sql.=" AND NOT(";
+				foreach($farray as $forumId) {
+					$add_sql .= "t.forum_id=".$forumId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+			if (count($Carray)) {
+				$add_sql.=" AND (";
+				foreach($Carray as $CatId) {
+					$add_sql .= "f.cat_id=".$CatId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+			if (count($carray)) {
+				$add_sql.=" AND NOT(";
+				foreach($carray as $CatId) {
+					$add_sql .= "f.cat_id=".$CatId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+		} else {
+			$add_sql="";
+		}
+
+		$sql = 'SELECT t.topic_id, t.topic_title, t.topic_last_post_id, t.topic_time, t.forum_id, f.forum_name, c.cat_title FROM '.$xoopsDB->prefix('bb_topics').' t, '.$xoopsDB->prefix('bb_forums').' f, '.$xoopsDB->prefix('bb_categories').' c WHERE f.forum_id = t.forum_id AND f.cat_id = c.cat_id'.$add_sql.' AND f.forum_type != 1 AND f.forum_access = 2 ORDER BY t.topic_time DESC';
+		if( !$result = $xoopsDB->query($sql, $obj->getVar('rssfj_grab'), 0) ){
+			return false;
+		}
+
+		while( $row = $xoopsDB->fetchArray($result) ){
+			$sql = 'SELECT post_text FROM '.$xoopsDB->prefix('bb_posts_text').' WHERE post_id = '.$row['topic_last_post_id'];
+			list($desc) = $xoopsDB->fetchRow($xoopsDB->query($sql));
+			$desc = $myts->makeTareaData4Show($desc);
+			$link = XOOPS_URL.'/modules/'.$this->dirname.'/viewtopic.php?topic_id='.$row['topic_id'].'&amp;forum='.$row['forum_id'].'&amp;post_id='.$row['topic_last_post_id'].'#forumpost='.$row['topic_last_post_id'];
+		//	required
+			$desc2=$this->modname." : ".$row['cat_title']." : ".$row['forum_name']." : ".$row['topic_title'];
+			$ret[$i]['title'] = $myts->makeTareaData4Show($desc2);
+			$ret[$i]['link'] = $ret[$i]['guid'] = $link;
+			$ret[$i]['timestamp'] = $row['topic_time'];
+			$ret[$i]['description'] = $desc;
+		//	optional
+			$ret[$i]['category'] = $this->modname;
+			$ret[$i]['domain'] = XOOPS_URL.'/modules/'.$this->dirname.'/';
+			$i++;
+		}
+		return $ret;
+	}
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/rssj/plugins/rssfitj.xoopspoll.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/rssj/plugins/rssfitj.xoopspoll.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/rssj/plugins/rssfitj.xoopspoll.php	(revision 405)
@@ -0,0 +1,147 @@
+<?php
+###############################################################################
+##                RSSFit - Extendable XML news feed generator                ##
+##                   Copyright (c) 2004 NS Tai (aka tuff)                    ##
+##                       <http://www.brandycoke.com/>                        ##
+##                      Modified By 2005 CACHE RSSfitJ                       ##
+##                       <http://gyakubiki.kir.jp/>                          ##
+###############################################################################
+##                    XOOPS - PHP Content Management System                  ##
+##                       Copyright (c) 2000 XOOPS.org                        ##
+##                          <http://www.xoops.org/>                          ##
+###############################################################################
+##  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.                                      ##
+##                                                                           ##
+##  You may not change or alter any portion of this comment or credits       ##
+##  of supporting developers from this source code or any supporting         ##
+##  source code which is considered copyrighted (c) material of the          ##
+##  original comment or credit authors.                                      ##
+##                                                                           ##
+##  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 ##
+###############################################################################
+##  Author of this file: CACHE                                               ##
+##  URL: http://gyakubiki.kir.jp/                                            ##
+##  Project: RSSFitJ                                                         ##
+###############################################################################
+/*
+* Step 0: Stop here if you are not sure what you are doing, it's no fun at all
+* Step 1: Clone this file and rename as rssfitj.[mod_dir].php
+* Step 2: Replace the text "RssfitjSample" with "Rssfitj[mod_dir]" at line 47 and line 55, i.e. "RssfitjNews" for the module "News"
+* Step 3: Modify the word in line 48 from 'sample' to [mod_dir]
+* Step 4: Modify the function "grabEntries" to satisfy your needs
+* Step 5: Move the new plug-in file to the plugins folder, i.e.  your-xoops-root/modules/rss/plugins
+* Step 6: Install your plug-in by pointing your browser to your-xoops-url/modules/rss/admin/index.php
+* [mod_dir]: Name of the driectory of your module, i.e. 'news'
+*/
+
+class RssfitjXoopspoll{
+	var $dirname = 'xoopspoll';
+	var $modname;
+	
+	/*
+    * private
+	* Nothing here so far
+	*/
+	function RssfitjXoopspoll(){
+	}
+
+	/*
+    * public
+	* return module name 
+	*/
+	function getDirName(){
+		return $this->dirname;
+	}
+
+	/*
+    * private
+	* Load the module
+	*/
+	function loadModule(){
+		global $module_handler;
+		$mod = $module_handler->getByDirname($this->dirname);
+		if( !$mod || !$mod->getVar('isactive') ){
+			return false;
+		}
+		$this->modname = $mod->getVar('name');
+		return $mod;
+	}
+	
+	/*
+    * public
+	* Grab the entries of your module here
+	*/
+	function grabEntries(&$obj){
+		global $xoopsDB;
+		$myts =& MyTextSanitizer::getInstance();
+		$ret = array();
+		$i = 0;
+		
+	//	The following example code grabs the latest entries from the module MyLinks
+
+		if ($obj->getVar('rssfj_param')) {
+			$rcdId=explode(',',$obj->getVar('rssfj_param'));
+			$Tarray=array();
+			$tarray=array();
+			foreach ($rcdId as $eachId) {
+				if (substr($eachId,0,1)=='T')
+					array_push($Tarray,substr($eachId,1,strlen($eachId)-1));
+				if (substr($eachId,0,1)=='N' || substr($eachId,0,1)=='t')
+					array_push($tarray,substr($eachId,1,strlen($eachId)-1));
+			}
+			$add_sql="";
+			if (count($Tarray)) {
+				$add_sql.=" AND (";
+				foreach($Tarray as $TopicId) {
+					$add_sql .= "poll_id=".$TopicId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+			if (count($tarray)) {
+				$add_sql.=" AND NOT(";
+				foreach($tarray as $TopicId) {
+					$add_sql .= "poll_id=".$TopicId." OR ";
+				}
+				$add_sql = substr($add_sql,0,strlen($add_sql)-4);
+				$add_sql .= ")";
+			}
+		} else {
+			$add_sql="";
+		}
+
+		$sql = "SELECT poll_id, question, end_time, description FROM ".$xoopsDB->prefix("xoopspoll_desc")." WHERE poll_id >= 0".$add_sql." ORDER BY end_time DESC";
+		$result = $xoopsDB->query($sql, $obj->getVar('rssfj_grab'), 0);
+		while( $row = $xoopsDB->fetchArray($result) ){
+		//	required items
+			$link = XOOPS_URL.'/modules/'.$this->dirname.'/pollresults.php?poll_id='.$row['poll_id'];
+													// The title of the item
+			$desc=$this->modname." : ".$row['question'];
+			$ret[$i]['title'] = $myts->makeTareaData4Show($desc);
+			$ret[$i]['link'] = $link;				// The URL of the item
+			$ret[$i]['guid'] = $link;				// Unique identifier, usually url
+			$ret[$i]['timestamp'] = $row['end_time'];	// Item modification date,
+													// must be in Unix time format
+			$desc = $row['description'];			// The item synopsis, or 
+													// description, whatever
+			$ret[$i]['description'] = $myts->makeTareaData4Show($desc);
+		//	optional items
+			$ret[$i]['category'] = $this->modname;
+			$ret[$i]['domain'] = XOOPS_URL.'/modules/'.$this->dirname.'/';
+			
+			$i++;
+		}
+		return $ret;
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/rssj/include/common.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/rssj/include/common.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/rssj/include/common.php	(revision 405)
@@ -0,0 +1,49 @@
+<?php
+###############################################################################
+##                RSSFit - Extendable XML news feed generator                ##
+##                   Copyright (c) 2004 NS Tai (aka tuff)                    ##
+##                       <http://www.brandycoke.com/>                        ##
+##                      Modified By 2005 CACHE RSSfitJ                       ##
+##                       <http://gyakubiki.kir.jp/>                          ##
+###############################################################################
+##                    XOOPS - PHP Content Management System                  ##
+##                       Copyright (c) 2000 XOOPS.org                        ##
+##                          <http://www.xoops.org/>                          ##
+###############################################################################
+##  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.                                      ##
+##                                                                           ##
+##  You may not change or alter any portion of this comment or credits       ##
+##  of supporting developers from this source code or any supporting         ##
+##  source code which is considered copyrighted (c) material of the          ##
+##  original comment or credit authors.                                      ##
+##                                                                           ##
+##  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 ##
+###############################################################################
+##  Author of this file: CACHE                                               ##
+##  URL: http://gyakubiki.kir.jp/                                            ##
+##  Project: RSSFitJ                                                         ##
+###############################################################################
+if( !defined("RSSFITJ_URL") ){
+	define("RSSFITJ_URL", XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/');
+}
+if( !defined("RSSFITJ_ROOT_PATH") ){
+	define("RSSFITJ_ROOT_PATH", XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/');
+}
+
+$rssfj_mgr =& xoops_getmodulehandler('rssfitj');
+include_once RSSFITJ_ROOT_PATH.'include/functions.php';
+
+$version = number_format($xoopsModule->getVar('version')/100, 2);
+$version = !substr($version, -1, 1) ? substr($version, 0, 3) : $version;
+define('RSSFITJ_VERSION', 'RSSfitJ '.$version);
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/rssj/include/functions.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/rssj/include/functions.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/rssj/include/functions.php	(revision 405)
@@ -0,0 +1,101 @@
+<?php
+###############################################################################
+##                RSSFit - Extendable XML news feed generator                ##
+##                   Copyright (c) 2004 NS Tai (aka tuff)                    ##
+##                       <http://www.brandycoke.com/>                        ##
+##                      Modified By 2005 CACHE RSSfitJ                       ##
+##                       <http://gyakubiki.kir.jp/>                          ##
+###############################################################################
+##                    XOOPS - PHP Content Management System                  ##
+##                       Copyright (c) 2000 XOOPS.org                        ##
+##                          <http://www.xoops.org/>                          ##
+###############################################################################
+##  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.                                      ##
+##                                                                           ##
+##  You may not change or alter any portion of this comment or credits       ##
+##  of supporting developers from this source code or any supporting         ##
+##  source code which is considered copyrighted (c) material of the          ##
+##  original comment or credit authors.                                      ##
+##                                                                           ##
+##  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 ##
+###############################################################################
+##  Author of this file: CACHE                                               ##
+##  URL: http://gyakubiki.kir.jp/                                            ##
+##  Project: RSSFitJ                                                         ##
+###############################################################################
+function sortTimestamp($a, $b){
+	if( $a['timestamp'] == $b['timestamp'] ){
+		return 0;
+	}
+	return ($a['timestamp'] > $b['timestamp']) ? -1 : 1;
+}
+
+function doSubstr($text, $endwith='...', $charset=_CHARSET){
+	global $xoopsModuleConfig;
+	$ret = $text;
+	$add = array('.', '!', '?', ']', ')', '%');
+	$remove = array(',', '/', ';', ':', ' ');
+	if( strlen($ret) > $xoopsModuleConfig['max_char'] && $xoopsModuleConfig['max_char'] > 0 ){
+		$ret = substrDetect($ret, 0, $xoopsModuleConfig['max_char']);
+		if( false === strrpos($ret, ' ') ){
+			if( false !== strpos($text, ' ',strlen($ret)) ){
+				$ret = substrDetect($text, 0, strpos($text, ' ',strlen($ret)));
+			}
+		}
+		if( in_array(substrDetect($text, strlen($ret), 1), $add) ){
+			$ret .= substrDetect($text, strlen($ret), 1);
+		}else{
+			if( in_array(substrDetect($ret, -1, 1), $remove) ){
+				$ret = substrDetect($ret, 0, -1);
+			}
+		}
+		$ret .= $endwith;
+	}
+	return $ret;
+}
+
+function substrDetect($text, $start, $len){
+	if( function_exists('mb_substr') ){
+		return mb_substr($text, $start, $len, _CHARSET);
+	}
+	return substr($text, $start, $len);
+}
+
+function utf8Encode(&$text){
+	global $xoopsModuleConfig;
+	if( !$xoopsModuleConfig['utf8'] ){
+		return $text;
+	}
+	return xoops_utf8_encode($text);
+}
+
+function adminHtmlHeader(){
+	global $xoopsModule, $xoopsConfig;
+
+	xoops_cp_header();
+	include('./mymenu.php');
+}
+
+// grab intro; temp solution
+function grabIntro(){
+	global $xoopsDB;
+	$sql = 'SELECT misc_title, misc_content FROM '.$xoopsDB->prefix('rssfitJ_misc')." WHERE misc_category = 'intro'";
+	list($t, $c) = $xoopsDB->fetchRow($xoopsDB->query($sql));
+	return array('title' => $t, 'content' => $c);
+}
+
+// generate timestamp in valid RFC-822 date format; temp solution
+function rssTimeStamp($time){
+	return date("D, j M Y H:i:s O", $time);
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/rssj/include/preferences.inc.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/rssj/include/preferences.inc.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/rssj/include/preferences.inc.php	(revision 405)
@@ -0,0 +1,456 @@
+<?php
+// $Id: main.php,v 1.23.20.1 2004/07/29 18:22:38 mithyt2 Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+if ( !is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid()) ) {
+  exit("Access Denied");
+} else {
+  $op = 'list';
+  if ( !empty($_POST['op']) ) { $op = $_POST['op']; }
+  if (isset($_GET['op'])) {
+    $op = trim($_GET['op']);
+  }
+  if (isset($_GET['confcat_id'])) {
+    $confcat_id = intval($_GET['confcat_id']);
+  }
+/*  if ($op == 'list') {
+    $confcat_handler =& xoops_gethandler('configcategory');
+    $confcats =& $confcat_handler->getObjects();
+    $catcount = count($confcats);
+    xoops_cp_header();
+    echo '<h4 style="text-align:left">'._MD_AM_SITEPREF.'</h4><ul>';
+    for ($i = 0; $i < $catcount; $i++) {
+      echo '<li>'.constant($confcats[$i]->getVar('confcat_name')).' [<a href="admin.php?fct=preferences&amp;op=show&amp;confcat_id='.$confcats[$i]->getVar('confcat_id').'">'._EDIT.'</a>]</li>';
+    }
+    echo '</ul>';
+    xoops_cp_footer();
+    exit();
+  } */
+
+/*   if ($op == 'show') {
+    if (empty($confcat_id)) {
+      $confcat_id = 1;
+    }
+    $confcat_handler =& xoops_gethandler('configcategory');
+    $confcat =& $confcat_handler->get($confcat_id);
+    if (!is_object($confcat)) {
+      redirect_header('admin.php?fct=preferences', 1);
+    }
+    include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
+    include_once XOOPS_ROOT_PATH.'/class/xoopslists.php';
+    $form = new XoopsThemeForm(constant($confcat->getVar('confcat_name')), 'pref_form', 'admin.php?fct=preferences');
+    $config_handler =& xoops_gethandler('config');
+    $criteria = new CriteriaCompo();
+    $criteria->add(new Criteria('conf_modid', 0));
+    $criteria->add(new Criteria('conf_catid', $confcat_id));
+    $config =& $config_handler->getConfigs($criteria);
+    $confcount = count($config);
+    for ($i = 0; $i < $confcount; $i++) {
+      $title = (!defined($config[$i]->getVar('conf_desc')) || constant($config[$i]->getVar('conf_desc')) == '') ? constant($config[$i]->getVar('conf_title')) : constant($config[$i]->getVar('conf_title')).'<br /><br /><span style="font-weight:normal;">'.constant($config[$i]->getVar('conf_desc')).'</span>';
+      switch ($config[$i]->getVar('conf_formtype')) {
+      case 'textarea':
+        $myts =& MyTextSanitizer::getInstance();
+        if ($config[$i]->getVar('conf_valuetype') == 'array') {
+          // this is exceptional.. only when value type is arrayneed a smarter way for this
+          $ele = ($config[$i]->getVar('conf_value') != '') ? new XoopsFormTextArea($title, $config[$i]->getVar('conf_name'), $myts->htmlspecialchars(implode('|', $config[$i]->getConfValueForOutput())), 5, 50) : new XoopsFormTextArea($title, $config[$i]->getVar('conf_name'), '', 5, 50);
+        } else {
+          $ele = new XoopsFormTextArea($title, $config[$i]->getVar('conf_name'), $myts->htmlspecialchars($config[$i]->getConfValueForOutput()), 5, 50);
+        }
+        break;
+      case 'select':
+        $ele = new XoopsFormSelect($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput());
+        $options =& $config_handler->getConfigOptions(new Criteria('conf_id', $config[$i]->getVar('conf_id')));
+        $opcount = count($options);
+        for ($j = 0; $j < $opcount; $j++) {
+          $optval = defined($options[$j]->getVar('confop_value')) ? constant($options[$j]->getVar('confop_value')) : $options[$j]->getVar('confop_value');
+          $optkey = defined($options[$j]->getVar('confop_name')) ? constant($options[$j]->getVar('confop_name')) : $options[$j]->getVar('confop_name');
+          $ele->addOption($optval, $optkey);
+        }
+        break;
+      case 'select_multi':
+        $ele = new XoopsFormSelect($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput(), 5, true);
+        $options =& $config_handler->getConfigOptions(new Criteria('conf_id', $config[$i]->getVar('conf_id')));
+        $opcount = count($options);
+        for ($j = 0; $j < $opcount; $j++) {
+          $optval = defined($options[$j]->getVar('confop_value')) ? constant($options[$j]->getVar('confop_value')) : $options[$j]->getVar('confop_value');
+          $optkey = defined($options[$j]->getVar('confop_name')) ? constant($options[$j]->getVar('confop_name')) : $options[$j]->getVar('confop_name');
+          $ele->addOption($optval, $optkey);
+        }
+        break;
+      case 'yesno':
+        $ele = new XoopsFormRadioYN($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput(), _YES, _NO);
+        break;
+      case 'theme':
+      case 'theme_multi':
+        $ele = ($config[$i]->getVar('conf_formtype') != 'theme_multi') ? new XoopsFormSelect($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput()) : new XoopsFormSelect($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput(), 5, true);
+        $handle = opendir(XOOPS_THEME_PATH.'/');
+        $dirlist = array();
+        while (false !== ($file = readdir($handle))) {
+          if (is_dir(XOOPS_THEME_PATH.'/'.$file) && !preg_match("/^[.]{1,2}$/",$file) && strtolower($file) != 'cvs') {
+            $dirlist[$file]=$file;
+          }
+        }
+        closedir($handle);
+        if (!empty($dirlist)) {
+          asort($dirlist);
+          $ele->addOptionArray($dirlist);
+        }
+        //$themeset_handler =& xoops_gethandler('themeset');
+        //$themesetlist =& $themeset_handler->getList();
+        //asort($themesetlist);
+        //foreach ($themesetlist as $key => $name) {
+        //  $ele->addOption($key, $name.' ('._MD_AM_THEMESET.')');
+        //}
+        // old theme value is used to determine whether to update cache or not. kind of dirty way
+        $form->addElement(new XoopsFormHidden('_old_theme', $config[$i]->getConfValueForOutput()));
+        break;
+      case 'tplset':
+        $ele = new XoopsFormSelect($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput());
+        $tplset_handler =& xoops_gethandler('tplset');
+        $tplsetlist =& $tplset_handler->getList();
+        asort($tplsetlist);
+        foreach ($tplsetlist as $key => $name) {
+          $ele->addOption($key, $name);
+        }
+        // old theme value is used to determine whether to update cache or not. kind of dirty way
+        $form->addElement(new XoopsFormHidden('_old_theme', $config[$i]->getConfValueForOutput()));
+        break;
+      case 'timezone':
+        $ele = new XoopsFormSelectTimezone($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput());
+        break;
+      case 'language':
+        $ele = new XoopsFormSelectLang($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput());
+        break;
+      case 'startpage':
+        $ele = new XoopsFormSelect($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput());
+        $module_handler =& xoops_gethandler('module');
+        $criteria = new CriteriaCompo(new Criteria('hasmain', 1));
+        $criteria->add(new Criteria('isactive', 1));
+        $moduleslist =& $module_handler->getList($criteria, true);
+        $moduleslist['--'] = _MD_AM_NONE;
+        $ele->addOptionArray($moduleslist);
+        break;
+      case 'group':
+        $ele = new XoopsFormSelectGroup($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput(), 1, false);
+        break;
+      case 'group_multi':
+        $ele = new XoopsFormSelectGroup($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput(), 5, true);
+        break;
+      // RMV-NOTIFY - added 'user' and 'user_multi'
+      case 'user':
+        $ele = new XoopsFormSelectUser($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput(), 1, false);
+        break;
+      case 'user_multi':
+        $ele = new XoopsFormSelectUser($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput(), 5, true);
+        break;
+      case 'module_cache':
+        $module_handler =& xoops_gethandler('module');
+        $modules =& $module_handler->getObjects(new Criteria('hasmain', 1), true);
+        $currrent_val = $config[$i]->getConfValueForOutput();
+        $cache_options = array('0' => _NOCACHE, '30' => sprintf(_SECONDS, 30), '60' => _MINUTE, '300' => sprintf(_MINUTES, 5), '1800' => sprintf(_MINUTES, 30), '3600' => _HOUR, '18000' => sprintf(_HOURS, 5), '86400' => _DAY, '259200' => sprintf(_DAYS, 3), '604800' => _WEEK);
+        if (count($modules) > 0) {
+          $ele = new XoopsFormElementTray($title, '<br />');
+          foreach (array_keys($modules) as $mid) {
+            $c_val = isset($currrent_val[$mid]) ? intval($currrent_val[$mid]) : null;
+            $selform = new XoopsFormSelect($modules[$mid]->getVar('name'), $config[$i]->getVar('conf_name')."[$mid]", $c_val);
+            $selform->addOptionArray($cache_options);
+            $ele->addElement($selform);
+            unset($selform);
+          }
+        } else {
+          $ele = new XoopsFormLabel($title, _MD_AM_NOMODULE);
+        }
+        break;
+      case 'site_cache':
+        $ele = new XoopsFormSelect($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput());
+        $ele->addOptionArray(array('0' => _NOCACHE, '30' => sprintf(_SECONDS, 30), '60' => _MINUTE, '300' => sprintf(_MINUTES, 5), '1800' => sprintf(_MINUTES, 30), '3600' => _HOUR, '18000' => sprintf(_HOURS, 5), '86400' => _DAY, '259200' => sprintf(_DAYS, 3), '604800' => _WEEK));
+        break;
+      case 'password':
+        $myts =& MyTextSanitizer::getInstance();
+        $ele = new XoopsFormPassword($title, $config[$i]->getVar('conf_name'), 50, 255, $myts->htmlspecialchars($config[$i]->getConfValueForOutput()));
+        break;
+      case 'textbox':
+      default:
+        $myts =& MyTextSanitizer::getInstance();
+        $ele = new XoopsFormText($title, $config[$i]->getVar('conf_name'), 50, 255, $myts->htmlspecialchars($config[$i]->getConfValueForOutput()));
+        break;
+      }
+      $hidden = new XoopsFormHidden('conf_ids[]', $config[$i]->getVar('conf_id'));
+      $form->addElement($ele);
+      $form->addElement($hidden);
+      unset($ele);
+      unset($hidden);
+    }
+    $form->addElement(new XoopsFormHidden('op', 'save'));
+    $form->addElement( $xoopsGTicket->getTicketXoopsForm( __LINE__ ) );
+    $form->addElement(new XoopsFormButton('', 'button', _GO, 'submit'));
+    xoops_cp_header();
+    echo '<a href="admin.php?fct=preferences">'. _MD_AM_PREFMAIN .'</a>&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;'.constant($confcat->getVar('confcat_name')).'<br /><br />';
+    $form->display();
+    xoops_cp_footer();
+    exit();
+  } */
+
+  if ($op == 'showmod') {
+    $config_handler =& xoops_gethandler('config');
+    $mod = isset($_GET['mod']) ? intval($_GET['mod']) : 0;
+    if (empty($mod)) {
+      header('Location: admin.php?fct=preferences');
+      exit();
+    }
+    $config =& $config_handler->getConfigs(new Criteria('conf_modid', $mod));
+    $count = count($config);
+    if ($count < 1) {
+      redirect_header('admin.php?fct=preferences', 1);
+    }
+    include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
+    $form = new XoopsThemeForm(_MD_AM_MODCONFIG, 'pref_form', 'admin.php?fct=preferences');
+    $module_handler =& xoops_gethandler('module');
+    $module =& $module_handler->get($mod);
+    if (file_exists(XOOPS_ROOT_PATH.'/modules/'.$module->getVar('dirname').'/language/'.$xoopsConfig['language'].'/modinfo.php')) {
+      include_once XOOPS_ROOT_PATH.'/modules/'.$module->getVar('dirname').'/language/'.$xoopsConfig['language'].'/modinfo.php';
+    }
+
+    // if has comments feature, need comment lang file
+    if ($module->getVar('hascomments') == 1) {
+      include_once XOOPS_ROOT_PATH.'/language/'.$xoopsConfig['language'].'/comment.php';
+    }
+    // RMV-NOTIFY
+    // if has notification feature, need notification lang file
+    if ($module->getVar('hasnotification') == 1) {
+      include_once XOOPS_ROOT_PATH.'/language/'.$xoopsConfig['language'].'/notification.php';
+    }
+
+    $modname = $module->getVar('name');
+	$button_tray = new XoopsFormElementTray("");
+    if ($module->getInfo('adminindex')) {
+//      $form->addElement(new XoopsFormHidden('redirect', XOOPS_URL.'/modules/'.$module->getVar('dirname').'/'.$module->getInfo('adminindex')));
+        $button_tray->addElement(new XoopsFormHidden('redirect', XOOPS_URL.'/modules/'.$module->getVar('dirname').'/admin/admin.php?fct=preferences&op=showmod&mod='.$module->getVar('mid'))); // GIJ Patch
+    }
+    for ($i = 0; $i < $count; $i++) {
+      $title4tray = (!defined($config[$i]->getVar('conf_desc')) || constant($config[$i]->getVar('conf_desc')) == '') ? constant($config[$i]->getVar('conf_title')) : constant($config[$i]->getVar('conf_title')).'<br /><br /><span style="font-weight:normal;">'.constant($config[$i]->getVar('conf_desc')).'</span>'; // GIJ
+      $title = '' ; // GIJ
+      switch ($config[$i]->getVar('conf_formtype')) {
+      case 'textarea':
+        $myts =& MyTextSanitizer::getInstance();
+        if ($config[$i]->getVar('conf_valuetype') == 'array') {
+          // this is exceptional.. only when value type is arrayneed a smarter way for this
+          $ele = ($config[$i]->getVar('conf_value') != '') ? new XoopsFormTextArea($title, $config[$i]->getVar('conf_name'), $myts->htmlspecialchars(implode('|', $config[$i]->getConfValueForOutput())), 5, 50) : new XoopsFormTextArea($title, $config[$i]->getVar('conf_name'), '', 5, 50);
+        } else {
+          $ele = new XoopsFormTextArea($title, $config[$i]->getVar('conf_name'), $myts->htmlspecialchars($config[$i]->getConfValueForOutput()), 5, 50);
+        }
+        break;
+      case 'select':
+        $ele = new XoopsFormSelect($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput());
+        $options =& $config_handler->getConfigOptions(new Criteria('conf_id', $config[$i]->getVar('conf_id')));
+        $opcount = count($options);
+        for ($j = 0; $j < $opcount; $j++) {
+          $optval = defined($options[$j]->getVar('confop_value')) ? constant($options[$j]->getVar('confop_value')) : $options[$j]->getVar('confop_value');
+          $optkey = defined($options[$j]->getVar('confop_name')) ? constant($options[$j]->getVar('confop_name')) : $options[$j]->getVar('confop_name');
+          $ele->addOption($optval, $optkey);
+        }
+        break;
+      case 'select_multi':
+        $ele = new XoopsFormSelect($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput(), 5, true);
+        $options =& $config_handler->getConfigOptions(new Criteria('conf_id', $config[$i]->getVar('conf_id')));
+        $opcount = count($options);
+        for ($j = 0; $j < $opcount; $j++) {
+          $optval = defined($options[$j]->getVar('confop_value')) ? constant($options[$j]->getVar('confop_value')) : $options[$j]->getVar('confop_value');
+          $optkey = defined($options[$j]->getVar('confop_name')) ? constant($options[$j]->getVar('confop_name')) : $options[$j]->getVar('confop_name');
+          $ele->addOption($optval, $optkey);
+        }
+        break;
+      case 'yesno':
+        $ele = new XoopsFormRadioYN($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput(), _YES, _NO);
+        break;
+      case 'group':
+        include_once XOOPS_ROOT_PATH.'/class/xoopslists.php';
+        $ele = new XoopsFormSelectGroup($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput(), 1, false);
+        break;
+      case 'group_multi':
+        include_once XOOPS_ROOT_PATH.'/class/xoopslists.php';
+        $ele = new XoopsFormSelectGroup($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput(), 5, true);
+        break;
+      // RMV-NOTIFY: added 'user' and 'user_multi'
+      case 'user':
+        include_once XOOPS_ROOT_PATH.'/class/xoopslists.php';
+        $ele = new XoopsFormSelectUser($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput(), 1, false);
+        break;
+      case 'user_multi':
+        include_once XOOPS_ROOT_PATH.'/class/xoopslists.php';
+        $ele = new XoopsFormSelectUser($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput(), 5, true);
+        break;
+      case 'password':
+        $myts =& MyTextSanitizer::getInstance();
+        $ele = new XoopsFormPassword($title, $config[$i]->getVar('conf_name'), 50, 255, $myts->htmlspecialchars($config[$i]->getConfValueForOutput()));
+        break;
+      case 'textbox':
+      default:
+        $myts =& MyTextSanitizer::getInstance();
+        $ele = new XoopsFormText($title, $config[$i]->getVar('conf_name'), 50, 255, $myts->htmlspecialchars($config[$i]->getConfValueForOutput()));
+        break;
+      }
+      $hidden = new XoopsFormHidden('conf_ids[]', $config[$i]->getVar('conf_id'));
+      $ele_tray = new XoopsFormElementTray( $title4tray , '' ) ;
+      $ele_tray->addElement($ele);
+      $ele_tray->addElement($hidden);
+      $form->addElement( $ele_tray ) ;
+      unset($ele_tray);
+      unset($ele);
+      unset($hidden);
+    }
+    $button_tray->addElement(new XoopsFormHidden('op', 'save'));
+    $button_tray->addElement( $xoopsGTicket->getTicketXoopsForm( __LINE__ ) );
+    $button_tray->addElement(new XoopsFormButton('', 'button', _GO, 'submit'));
+    $form->addElement( $button_tray ) ;
+    xoops_cp_header();
+	// GIJ patch start
+	include( './mymenu.php' ) ;
+	echo "<h3 style='text-align:left;'>".$module->getvar('name').' &nbsp; '._PREFERENCES."</h3>\n" ;
+	// GIJ patch end
+    $form->display();
+    xoops_cp_footer();
+    exit();
+  }
+
+  if ($op == 'save') {
+    //if ( !admin_refcheck("/modules/$admin_mydirname/admin/") ) {
+    //  exit('Invalid referer');
+    //}
+    if ( ! $xoopsGTicket->check() ) {
+      redirect_header(XOOPS_URL.'/',3,$xoopsGTicket->getErrors());
+    }
+    require_once(XOOPS_ROOT_PATH.'/class/template.php');
+    $xoopsTpl = new XoopsTpl();
+    $xoopsTpl->clear_all_cache();
+    // regenerate admin menu file
+    xoops_module_write_admin_menu(xoops_module_get_admin_menu());
+    if ( !empty($_POST['conf_ids']) ) { $conf_ids = $_POST['conf_ids']; }
+    $count = count($conf_ids);
+    $tpl_updated = false;
+    $theme_updated = false;
+    $startmod_updated = false;
+    $lang_updated = false;
+    if ($count > 0) {
+      for ($i = 0; $i < $count; $i++) {
+        $config =& $config_handler->getConfig($conf_ids[$i]);
+        $new_value =& $_POST[$config->getVar('conf_name')];
+        if (is_array($new_value) || $new_value != $config->getVar('conf_value')) {
+          // if language has been changed
+          if (!$lang_updated && $config->getVar('conf_catid') == XOOPS_CONF && $config->getVar('conf_name') == 'language') {
+            // regenerate admin menu file
+            $xoopsConfig['language'] = $_POST[$config->getVar('conf_name')];
+            xoops_module_write_admin_menu(xoops_module_get_admin_menu());
+            $lang_updated = true;
+          }
+
+          // if default theme has been changed
+          if (!$theme_updated && $config->getVar('conf_catid') == XOOPS_CONF && $config->getVar('conf_name') == 'theme_set') {
+            $member_handler =& xoops_gethandler('member');
+            $member_handler->updateUsersByField('theme', $_POST[$config->getVar('conf_name')]);
+            $theme_updated = true;
+          }
+
+          // if default template set has been changed
+          if (!$tpl_updated && $config->getVar('conf_catid') == XOOPS_CONF && $config->getVar('conf_name') == 'template_set') {
+            // clear cached/compiled files and regenerate them if default theme has been changed
+            if ($xoopsConfig['template_set'] != $_POST[$config->getVar('conf_name')]) {
+              $newtplset = $_POST[$config->getVar('conf_name')];
+              
+              // clear all compiled and cachedfiles
+              $xoopsTpl->clear_compiled_tpl();
+
+              // generate compiled files for the new theme
+              // block files only for now..
+              $tplfile_handler =& xoops_gethandler('tplfile');
+              $dtemplates =& $tplfile_handler->find('default', 'block');
+              $dcount = count($dtemplates);
+
+              // need to do this to pass to xoops_template_touch function
+              $GLOBALS['xoopsConfig']['template_set'] = $newtplset;
+
+              for ($i = 0; $i < $dcount; $i++) {
+                $found =& $tplfile_handler->find($newtplset, 'block', $dtemplates[$i]->getVar('tpl_refid'), null);
+                if (count($found) > 0) {
+                  // template for the new theme found, compile it
+                  xoops_template_touch($found[0]->getVar('tpl_id'));
+                } else {
+                  // not found, so compile 'default' template file
+                  xoops_template_touch($dtemplates[$i]->getVar('tpl_id'));
+                }
+              }
+
+              // generate image cache files from image binary data, save them under cache/
+              $image_handler =& xoops_gethandler('imagesetimg');
+              $imagefiles =& $image_handler->getObjects(new Criteria('tplset_name', $newtplset), true);
+              foreach (array_keys($imagefiles) as $i) {
+                if (!$fp = fopen(XOOPS_CACHE_PATH.'/'.$newtplset.'_'.$imagefiles[$i]->getVar('imgsetimg_file'), 'wb')) {
+                } else {
+                  fwrite($fp, $imagefiles[$i]->getVar('imgsetimg_body'));
+                  fclose($fp);
+                }
+              }
+            }
+            $tpl_updated = true;
+          }
+
+          // add read permission for the start module to all groups
+          if (!$startmod_updated  && $new_value != '--' && $config->getVar('conf_catid') == XOOPS_CONF && $config->getVar('conf_name') == 'startpage') {
+            $member_handler =& xoops_gethandler('member');
+            $groups =& $member_handler->getGroupList();
+            $moduleperm_handler =& xoops_gethandler('groupperm');
+            $module_handler =& xoops_gethandler('module');
+            $module =& $module_handler->getByDirname($new_value);
+            foreach ($groups as $groupid => $groupname) {
+              if (!$moduleperm_handler->checkRight('module_read', $module->getVar('mid'), $groupid)) {
+                $moduleperm_handler->addRight('module_read', $module->getVar('mid'), $groupid);
+              }
+            }
+            $startmod_updated = true;
+          }
+
+          $config->setConfValueForInput($new_value);
+          $config_handler->insertConfig($config);
+        }
+        unset($new_value);
+      }
+    }
+    if (!empty($use_mysession) && $xoopsConfig['use_mysession'] == 0 && $session_name != '') {
+        setcookie($session_name, session_id(), time()+(60*intval($session_expire)), '/',  '', 0);
+    }
+    if ( ! empty( $_POST['redirect'] ) ) {
+      redirect_header($_POST['redirect'], 2, _MD_AM_DBUPDATED);
+    } else {
+      redirect_header("admin.php?fct=preferences",2,_MD_AM_DBUPDATED);
+    }
+  }
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/rssj/include/gtickets.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/rssj/include/gtickets.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/rssj/include/gtickets.php	(revision 405)
@@ -0,0 +1,186 @@
+<?php
+// GIJOE's Ticket Class (based on Marijuana's Oreteki XOOPS)
+// nobunobu's suggestions are applied
+
+if( ! class_exists( 'XoopsGTicket' ) ) {
+
+class XoopsGTicket {
+
+	var $_errors = array() ;
+	var $_latest_token = '' ;
+
+	// render form as plain html
+	function getTicketHtml( $salt = '' , $timeout = 1800 )
+	{
+		return '<input type="hidden" name="XOOPS_G_TICKET" value="'.$this->issue( $salt , $timeout ).'" />' ;
+	}
+
+	// returns an object of XoopsFormHidden including theh ticket
+	function getTicketXoopsForm( $salt = '' , $timeout = 1800 )
+	{
+		return new XoopsFormHidden( 'XOOPS_G_TICKET' , $this->issue( $salt , $timeout ) ) ;
+	}
+
+	// returns an array for xoops_confirm() ;
+	function getTicketArray( $salt = '' , $timeout = 1800 )
+	{
+		return array( 'XOOPS_G_TICKET' => $this->issue( $salt , $timeout ) ) ;
+	}
+
+	// return GET parameter string.
+	function getTicketParamString( $salt = '' , $noamp = false , $timeout=1800 )
+	{
+	    return ( $noamp ? '' : '&amp;' ) . 'XOOPS_G_TICKET=' . $this->issue( $salt, $timeout ) ;
+	}
+
+	// issue a ticket
+	function issue( $salt = '' , $timeout = 1800 )
+	{
+		// create a token
+		list( $usec , $sec ) = explode( " " , microtime() ) ;
+		$token = crypt( $salt . $usec . $_SERVER['PATH'] . $sec ) ;
+		$this->_latest_token = $token ;
+
+		if( empty( $_SESSION['XOOPS_G_STUBS'] ) ) $_SESSION['XOOPS_G_STUBS'] = array() ;
+
+		// limit max stubs 10
+		if( sizeof( $_SESSION['XOOPS_G_STUBS'] ) > 10 ) {
+			$_SESSION['XOOPS_G_STUBS'] = array_slice( $_SESSION['XOOPS_G_STUBS'] , -10 ) ;
+		}
+
+		// store stub
+		$_SESSION['XOOPS_G_STUBS'][] = array(
+			'expire' => time() + $timeout ,
+			'ip' => $_SERVER['REMOTE_ADDR'] ,
+			'token' => $token
+		) ;
+
+		// paid md5ed token as a ticket
+		return md5( $token . XOOPS_DB_PREFIX ) ;
+	}
+
+	// check a ticket
+	function check( $post = true )
+	{
+
+		$this->_errors = array() ;
+
+		// CHECK: stubs are not stored in session
+		if( empty( $_SESSION['XOOPS_G_STUBS'] ) || ! is_array($_SESSION['XOOPS_G_STUBS'])) {
+			$this->clear() ;
+			$this->_errors[] = 'Invalid Session' ;
+			return false ;
+		}
+
+		// get key&val of the ticket from a user's query
+		if( $post ) {
+			$ticket = empty( $_POST['XOOPS_G_TICKET'] ) ? '' : $_POST['XOOPS_G_TICKET'] ;
+		} else {
+			$ticket = empty( $_GET['XOOPS_G_TICKET'] ) ? '' : $_GET['XOOPS_G_TICKET'] ;
+		}
+
+		// CHECK: no tickets found
+		if( empty( $ticket ) ) {
+			$this->clear() ;
+			$this->_errors[] = 'Irregular post found' ;
+			return false ;
+		}
+
+		// gargage collection & find a right stub
+		$stubs_tmp = $_SESSION['XOOPS_G_STUBS'] ;
+		$_SESSION['XOOPS_G_STUBS'] = array() ;
+		foreach( $stubs_tmp as $stub ) {
+			// default lifetime 30min
+			if( $stub['expire'] >= time() ) {
+				if( md5( $stub['token'] . XOOPS_DB_PREFIX ) === $ticket ) {
+					$found_stub = $stub ;
+				} else {
+					// store the other valid stubs into session
+					$_SESSION['XOOPS_G_STUBS'][] = $stub ;
+				}
+			} else {
+				if( md5( $stub['token'] . XOOPS_DB_PREFIX ) === $ticket ) {
+					// not CSRF but Time-Out
+					$timeout_flag = true ;
+				}
+			}
+		}
+
+		// CHECK: no right stub found
+		if( empty( $found_stub ) ) {
+			$this->clear() ;
+			if( empty( $timeout_flag ) ) $this->_errors[] = 'Invalid Session' ;
+			else $this->_errors[] = 'Time out' ;
+			return false ;
+		}
+
+		// CHECK: different ip
+		/* if( $found_stub['ip'] != $_SERVER['REMOTE_ADDR'] ) {
+			$this->clear() ;
+			$this->_errors[] = 'IP has been changed' ;
+			return false ;
+		} */
+
+		// all green
+		return true;
+	}
+
+
+	// clear all stubs
+	function clear()
+	{
+		$_SESSION['XOOPS_G_STUBS'] = array() ;
+	}
+
+
+	// Ticket Using
+	function using()
+	{
+		if( ! empty( $_SESSION['XOOPS_G_STUBS'] ) ) {
+			return true;
+		} else {
+			return false;
+		}
+	}
+
+
+	// return errors
+	function getErrors( $ashtml = true )
+	{
+		if( $ashtml ) {
+			$ret = '' ;
+			foreach( $this->_errors as $msg ) {
+				$ret .= "$msg<br />\n" ;
+			}
+		} else {
+			$ret = $this->_errors ;
+		}
+		return $ret ;
+	}
+
+// end of class
+}
+
+// create a instance in global scope
+$GLOBALS['xoopsGTicket'] = new XoopsGTicket() ;
+
+}
+
+if( ! function_exists( 'admin_refcheck' ) ) {
+
+//Admin Referer Check By Marijuana(Rev.011)
+function admin_refcheck($chkref = "") {
+	if( empty( $_SERVER['HTTP_REFERER'] ) ) {
+		return true ;
+	} else {
+		$ref = $_SERVER['HTTP_REFERER'];
+	}
+	$cr = XOOPS_URL;
+	if ( $chkref != "" ) { $cr .= $chkref; }
+	if ( strpos($ref, $cr) !== 0 ) { return false; }
+	return true;
+}
+
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/rssj/include/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/rssj/include/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/rssj/include/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/rssj/language/japanese/modinfo.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/rssj/language/japanese/modinfo.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/rssj/language/japanese/modinfo.php	(revision 405)
@@ -0,0 +1,71 @@
+<?php
+###############################################################################
+##                RSSFit - Extendable XML news feed generator                ##
+##                   Copyright (c) 2004 NS Tai (aka tuff)                    ##
+##                       <http://www.brandycoke.com/>                        ##
+##                      Modified By 2005 CACHE RSSfitJ                       ##
+##                       <http://gyakubiki.kir.jp/>                          ##
+###############################################################################
+##                    XOOPS - PHP Content Management System                  ##
+##                       Copyright (c) 2000 XOOPS.org                        ##
+##                          <http://www.xoops.org/>                          ##
+###############################################################################
+##  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.                                      ##
+##                                                                           ##
+##  You may not change or alter any portion of this comment or credits       ##
+##  of supporting developers from this source code or any supporting         ##
+##  source code which is considered copyrighted (c) material of the          ##
+##  original comment or credit authors.                                      ##
+##                                                                           ##
+##  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 ##
+###############################################################################
+##  Author of this file: CACHE                                               ##
+##  URL: http://gyakubiki.kir.jp/                                            ##
+##  Project: RSSFitJ                                                         ##
+###############################################################################
+// Module Info
+
+// The name of this module
+define("_MI_RSSFITJ_NAME","XML (RSS ÇÛ¿®)");
+
+// A brief description of this module
+define("_MI_RSSFITJ_DESC","³ÈÄ¥ XML news ÇÛ¿®µ¡Ç½ÄÉ²Ã");
+
+// admin/menu.php
+define("_MI_RSSFITJ_ADMENU1","Í×ÌóÊ¸ÊÔ½¸");
+define("_MI_RSSFITJ_ADMENU2","¥×¥é¥°¥¤¥ó´ÉÍý");
+define("_MI_RSSFITJ_ADMENU3","¥Ñ¥é¥á¡¼¥¿´ÉÍý");
+
+//	Module Configs
+define("_MI_RSSFITJ_OVERALL_ENTRIES","Áí¥¨¥ó¥È¥ê¡¼¿ô");
+define("_MI_RSSFITJ_OVERALL_ENTRIES_DESC","RSS¤ÇÈ¯¿®¤¹¤ë¥¨¥ó¥È¥ê¡¼¿ô");
+define("_MI_RSSFITJ_PLUGIN_ENTRIES","¥×¥é¥°¥ó¤ÇÈ¯¿®¤¹¤ë¥¨¥ó¥È¥ê¡¼¤Î½é´üÃÍ");
+define("_MI_RSSFITJ_PLUGIN_ENTRIES_DESC","¥×¥é¥°¥¤¥ó¤¬¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤¿»þ¤ËÅ¬ÍÑ¤µ¤ì¤ë½é´üÃÍ");
+define("_MI_RSSFITJ_ENTRIES_SORT","¥½¡¼¥È¹àÌÜ");
+define("_MI_RSSFITJ_ENTRIES_SORT_DESC","RSS½ÐÎÏ»þ¤Î¥½¡¼¥È½ç");
+define("_MI_RSSFITJ_ENTRIES_SORT_DATE","ÆüÉÕ");
+define("_MI_RSSFITJ_ENTRIES_SORT_CAT","¥«¥Æ¥´¥ê¡¼");
+define("_MI_RSSFITJ_CACHE","¥­¥ã¥Ã¥·¥å¤Î´ü¸Â(Ê¬)");
+define("_MI_RSSFITJ_CACHE_DESC","RSS½ÐÎÏ»þ¤Îµ­»ö¤ÎÍ­¸ú´ü¸Â(TTL) 0=Ìµ´ü¸Â");
+define("_MI_RSSFITJ_MAXCHAR","¹àÌÜ¤ÎÀâÌÀ¤ÎºÇÂçÊ¸»ú¿ô");
+define("_MI_RSSFITJ_MAXCHAR_DESC","0 = Á´¤ÆÉ½¼¨¤¹¤ë");
+define("_MI_RSSFITJ_STRIPHTML","HTML¥¿¥°¤òºï½ü");
+define("_MI_RSSFITJ_STRIPHTML_DESC","XOOPS¥¿¥°¤È´éÊ¸»úµ­¹æ¤ò´Þ¤á¤ÆHTML¥¿¥°¤òºï½ü");
+define("_MI_RSSFITJ_ENCODE_UTF8","UTF-8¤Ø¥¨¥ó¥³¡¼¥É");
+define("_MI_RSSFITJ_ENCODE_UTF8_DESC","Ãí°Õ: ¶²¤é¤¯µ¡Ç½¤·¤Ê¤¤¤Î¤Ç¡¢¥ª¥Õ¤Ë¤·¤Æ¤ª¤¯»ö¤ò¿ä¾©");
+
+// template explanations
+define("_MI_RSSFITJ_TMPL_INTRO","¥Û¡¼¥à¥Ú¡¼¥¸¤Î½øÊ¸");
+define("_MI_RSSFITJ_TMPL_RSS","RSS Á÷¿®¥Ç¡¼¥¿");
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/rssj/language/japanese/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/rssj/language/japanese/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/rssj/language/japanese/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/rssj/language/japanese/main.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/rssj/language/japanese/main.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/rssj/language/japanese/main.php	(revision 405)
@@ -0,0 +1,38 @@
+<?php
+###############################################################################
+##                RSSFit - Extendable XML news feed generator                ##
+##                   Copyright (c) 2004 NS Tai (aka tuff)                    ##
+##                       <http://www.brandycoke.com/>                        ##
+##                      Modified By 2005 CACHE RSSfitJ                       ##
+##                       <http://gyakubiki.kir.jp/>                          ##
+###############################################################################
+##                    XOOPS - PHP Content Management System                  ##
+##                       Copyright (c) 2000 XOOPS.org                        ##
+##                          <http://www.xoops.org/>                          ##
+###############################################################################
+##  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.                                      ##
+##                                                                           ##
+##  You may not change or alter any portion of this comment or credits       ##
+##  of supporting developers from this source code or any supporting         ##
+##  source code which is considered copyrighted (c) material of the          ##
+##  original comment or credit authors.                                      ##
+##                                                                           ##
+##  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 ##
+###############################################################################
+##  Author of this file: CACHE                                               ##
+##  URL: http://gyakubiki.kir.jp/                                            ##
+##  Project: RSSFitJ                                                         ##
+###############################################################################
+
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/rssj/language/japanese/admin.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/rssj/language/japanese/admin.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/rssj/language/japanese/admin.php	(revision 405)
@@ -0,0 +1,71 @@
+<?php
+###############################################################################
+##                RSSFit - Extendable XML news feed generator                ##
+##                   Copyright (c) 2004 NS Tai (aka tuff)                    ##
+##                       <http://www.brandycoke.com/>                        ##
+##                      Modified By 2005 CACHE RSSfitJ                       ##
+##                       <http://gyakubiki.kir.jp/>                          ##
+###############################################################################
+##                    XOOPS - PHP Content Management System                  ##
+##                       Copyright (c) 2000 XOOPS.org                        ##
+##                          <http://www.xoops.org/>                          ##
+###############################################################################
+##  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.                                      ##
+##                                                                           ##
+##  You may not change or alter any portion of this comment or credits       ##
+##  of supporting developers from this source code or any supporting         ##
+##  source code which is considered copyrighted (c) material of the          ##
+##  original comment or credit authors.                                      ##
+##                                                                           ##
+##  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 ##
+###############################################################################
+##  Author of this file: CACHE                                               ##
+##  URL: http://gyakubiki.kir.jp/                                            ##
+##  Project: RSSFitJ                                                         ##
+###############################################################################
+
+define("_AM_SAVE","ÊÝÂ¸");
+define("_AM_OK","£Ï£Ë");
+define("_AM_DBUPDATED","¥Ç¡¼¥¿¡¼¥Ù¡¼¥¹¤Î¹¹¿·¤ÏÀ®¸ù¤·¤Þ¤·¤¿¡£");
+define("_AM_ACTION","Áàºî");
+define("_AM_ID","ID");
+define("_AM_SUBMIT","¹¹¿·¤¹¤ë");
+
+define("_AM_EDIT_INTRO", "½øÊ¸ÊÔ½¸");
+define("_AM_EDIT_INTRO_TITLE", "½øÊ¸¥¿¥¤¥È¥ë");
+define("_AM_EDIT_INTRO_TITLE_DESC", "{SITENAME} ¤Ï ¡Ö".$xoopsConfig['sitename']."¡× ¤ò¼¨¤¹");
+define("_AM_EDIT_INTRO_TEXT", "½øÊ¸ËÜÊ¸");
+define("_AM_EDIT_INTRO_TEXT_DESC", _AM_EDIT_INTRO_TITLE_DESC.'<br />{SITEURL} ¤Ï '.XOOPS_URL.'/¡¡¤ò¼¨¤¹');
+
+define("_AM_EDIT_PLUGIN", "¥×¥é¥°¥¤¥ó´ÉÍý");
+define('_AM_PLUGIN_ACTIVATED', '²ÔÆ°Ãæ¤Î¥×¥é¥°¥¤¥ó');
+define('_AM_PLUGIN_INACTIVE', 'Ää»ßÃæ¤Î¥×¥é¥°¥¤¥ó');
+define('_AM_PLUGIN_NONINSTALLED', '¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤Ê¤¤¥×¥é¥°¥¤¥ó');
+define('_AM_PLUGIN_MODNAME', '¥â¥¸¥å¡¼¥ë');
+define('_AM_PLUGIN_FILENAME', '¥Õ¥¡¥¤¥ëÌ¾');
+define('_AM_PLUGIN_SHOWXENTRIES', 'É½¼¨¤¹¤ë¥¨¥ó¥È¥ê¡¼');
+define('_AM_PLUGIN_ORDER', 'É½¼¨½ç');
+define('_AM_PLUGIN_DEACTIVATE', 'Ìµ¸ú');
+define('_AM_PLUGIN_ACTIVATE', 'Í­¸ú');
+define('_AM_PLUGIN_INSTALL', '¥¤¥ó¥¹¥È¡¼¥ë');
+define('_AM_PLUGIN_UNINSTALL', '¥¢¥ó¥¤¥ó¥¹¥È¡¼¥ë');
+define('_AM_PLUGIN_PARAMETERS', '¥Ñ¥é¥á¡¼¥¿¡¼»ØÄê');	//2005.3.7 CACHE
+
+//  errors
+define('_AM_PLUGIN_UNKNOWNERROR', '¸¶°øÉÔÌÀ¤Ê¥¨¥é¡¼');
+define('_AM_PLUGIN_FILENOTFOUND', '¥×¥é¥°¥¤¥ó¥Õ¥¡¥¤¥ë¤¬Ìµ¤¤');
+define('_AM_PLUGIN_MODNOTFOUND', '¥â¥¸¥å¡¼¥ë¤¬¤Ê¤¤');
+define('_AM_PLUGIN_CLASSNOTFOUND', '¥×¥é¥°¥¤¥ó¤ËÉ¬Í×¤Ê¥¯¥é¥¹¤¬Â¸ºß¤·¤Ê¤¤');
+define('_AM_PLUGIN_FUNCNOTFOUND', '¥×¥é¥°¥¤¥ó¤ËÉ¬Í×¤Ê´Ø¿ô¤¬Â¸ºß¤·¤Ê¤¤');
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/rssj/language/english/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/rssj/language/english/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/rssj/language/english/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/rssj/language/english/main.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/rssj/language/english/main.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/rssj/language/english/main.php	(revision 405)
@@ -0,0 +1,38 @@
+<?php
+###############################################################################
+##                RSSFit - Extendable XML news feed generator                ##
+##                   Copyright (c) 2004 NS Tai (aka tuff)                    ##
+##                       <http://www.brandycoke.com/>                        ##
+##                      Modified By 2005 CACHE RSSfitJ                       ##
+##                       <http://gyakubiki.kir.jp/>                          ##
+###############################################################################
+##                    XOOPS - PHP Content Management System                  ##
+##                       Copyright (c) 2000 XOOPS.org                        ##
+##                          <http://www.xoops.org/>                          ##
+###############################################################################
+##  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.                                      ##
+##                                                                           ##
+##  You may not change or alter any portion of this comment or credits       ##
+##  of supporting developers from this source code or any supporting         ##
+##  source code which is considered copyrighted (c) material of the          ##
+##  original comment or credit authors.                                      ##
+##                                                                           ##
+##  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 ##
+###############################################################################
+##  Author of this file: CACHE                                               ##
+##  URL: http://gyakubiki.kir.jp/                                            ##
+##  Project: RSSFitJ                                                         ##
+###############################################################################
+
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/rssj/language/english/admin.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/rssj/language/english/admin.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/rssj/language/english/admin.php	(revision 405)
@@ -0,0 +1,71 @@
+<?php
+###############################################################################
+##                RSSFit - Extendable XML news feed generator                ##
+##                   Copyright (c) 2004 NS Tai (aka tuff)                    ##
+##                       <http://www.brandycoke.com/>                        ##
+##                      Modified By 2005 CACHE RSSfitJ                       ##
+##                       <http://gyakubiki.kir.jp/>                          ##
+###############################################################################
+##                    XOOPS - PHP Content Management System                  ##
+##                       Copyright (c) 2000 XOOPS.org                        ##
+##                          <http://www.xoops.org/>                          ##
+###############################################################################
+##  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.                                      ##
+##                                                                           ##
+##  You may not change or alter any portion of this comment or credits       ##
+##  of supporting developers from this source code or any supporting         ##
+##  source code which is considered copyrighted (c) material of the          ##
+##  original comment or credit authors.                                      ##
+##                                                                           ##
+##  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 ##
+###############################################################################
+##  Author of this file: CACHE                                               ##
+##  URL: http://gyakubiki.kir.jp/                                            ##
+##  Project: RSSFitJ                                                         ##
+###############################################################################
+
+define("_AM_SAVE","Save");
+define("_AM_OK","Okay");
+define("_AM_DBUPDATED","Database Updated Successfully!");
+define("_AM_ACTION","Action");
+define("_AM_ID","ID");
+define("_AM_SUBMIT","Submit changes");
+
+define("_AM_EDIT_INTRO", "Edit introduction");
+define("_AM_EDIT_INTRO_TITLE", "Introduction title");
+define("_AM_EDIT_INTRO_TITLE_DESC", "{SITENAME} will print ".$xoopsConfig['sitename']);
+define("_AM_EDIT_INTRO_TEXT", "Introduction text");
+define("_AM_EDIT_INTRO_TEXT_DESC", _AM_EDIT_INTRO_TITLE_DESC.'<br />{SITEURL} will print '.XOOPS_URL.'/');
+
+define("_AM_EDIT_PLUGIN", "Manage Plug-ins");
+define('_AM_PLUGIN_ACTIVATED', 'Activated Plug-ins');
+define('_AM_PLUGIN_INACTIVE', 'Inactive Plug-ins');
+define('_AM_PLUGIN_NONINSTALLED', 'Non-installed Plug-ins');
+define('_AM_PLUGIN_MODNAME', 'Module');
+define('_AM_PLUGIN_FILENAME', 'File name');
+define('_AM_PLUGIN_SHOWXENTRIES', 'Entries to show');
+define('_AM_PLUGIN_ORDER', 'Display order');
+define('_AM_PLUGIN_DEACTIVATE', 'Deactivate');
+define('_AM_PLUGIN_ACTIVATE', 'Aactivate');
+define('_AM_PLUGIN_INSTALL', 'Install');
+define('_AM_PLUGIN_UNINSTALL', 'Uninstall');
+define('_AM_PLUGIN_PARAMETERS', 'define parameters');	//2005.3.7 CACHE
+
+//  errors
+define('_AM_PLUGIN_UNKNOWNERROR', 'Unknown error');
+define('_AM_PLUGIN_FILENOTFOUND', 'Plug-in file not found');
+define('_AM_PLUGIN_MODNOTFOUND', 'Module not found');
+define('_AM_PLUGIN_CLASSNOTFOUND', 'Plug-in not compatible (Class not exist)');
+define('_AM_PLUGIN_FUNCNOTFOUND', 'Plug-in not compatible (Function not exist)');
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/rssj/language/english/modinfo.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/rssj/language/english/modinfo.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/rssj/language/english/modinfo.php	(revision 405)
@@ -0,0 +1,71 @@
+<?php
+###############################################################################
+##                RSSFit - Extendable XML news feed generator                ##
+##                   Copyright (c) 2004 NS Tai (aka tuff)                    ##
+##                       <http://www.brandycoke.com/>                        ##
+##                      Modified By 2005 CACHE RSSfitJ                       ##
+##                       <http://gyakubiki.kir.jp/>                          ##
+###############################################################################
+##                    XOOPS - PHP Content Management System                  ##
+##                       Copyright (c) 2000 XOOPS.org                        ##
+##                          <http://www.xoops.org/>                          ##
+###############################################################################
+##  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.                                      ##
+##                                                                           ##
+##  You may not change or alter any portion of this comment or credits       ##
+##  of supporting developers from this source code or any supporting         ##
+##  source code which is considered copyrighted (c) material of the          ##
+##  original comment or credit authors.                                      ##
+##                                                                           ##
+##  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 ##
+###############################################################################
+##  Author of this file: CACHE                                               ##
+##  URL: http://gyakubiki.kir.jp/                                            ##
+##  Project: RSSFitJ                                                         ##
+###############################################################################
+// Module Info
+
+// The name of this module
+define("_MI_RSSFITJ_NAME","XML (RSS feed)");
+
+// A brief description of this module
+define("_MI_RSSFITJ_DESC","Extendable XML news feed generator");
+
+// admin/menu.php
+define("_MI_RSSFITJ_ADMENU1","Edit intro");
+define("_MI_RSSFITJ_ADMENU2","Manage plug-ins");
+define("_MI_RSSFITJ_ADMENU3","Manage Parameters");
+
+//	Module Configs
+define("_MI_RSSFITJ_OVERALL_ENTRIES","Total entries to show");
+define("_MI_RSSFITJ_OVERALL_ENTRIES_DESC","Number of entries to show in the RSS feed");
+define("_MI_RSSFITJ_PLUGIN_ENTRIES","Default entry number for plug-ins");
+define("_MI_RSSFITJ_PLUGIN_ENTRIES_DESC","Default number of entries to grab by each plug-in when installed");
+define("_MI_RSSFITJ_ENTRIES_SORT","Entries sort by");
+define("_MI_RSSFITJ_ENTRIES_SORT_DESC","Entries sort order for the RSS feed output");
+define("_MI_RSSFITJ_ENTRIES_SORT_DATE","Date");
+define("_MI_RSSFITJ_ENTRIES_SORT_CAT","Category");
+define("_MI_RSSFITJ_CACHE","Cache lifetime (minutes)");
+define("_MI_RSSFITJ_CACHE_DESC","This option will also be used for the Time-to-Live (TTL) channel element of the RSS output.");
+define("_MI_RSSFITJ_MAXCHAR","Maximum characters of item descriptions");
+define("_MI_RSSFITJ_MAXCHAR_DESC","0 = show entire content");
+define("_MI_RSSFITJ_STRIPHTML","Strip html tags");
+define("_MI_RSSFITJ_STRIPHTML_DESC","Remove html tags from item description elements, including Xoopscodes and Smileys");
+define("_MI_RSSFITJ_ENCODE_UTF8","Encode contents to UTF-8");
+define("_MI_RSSFITJ_ENCODE_UTF8_DESC","Note: probably not functional and recommended to turn off.");
+
+// template explanations
+define("_MI_RSSFITJ_TMPL_INTRO","Introduction in module home page");
+define("_MI_RSSFITJ_TMPL_RSS","RSS feed data");
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/rssj/language/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/rssj/language/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/rssj/language/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/rssj/xoops_version.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/rssj/xoops_version.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/rssj/xoops_version.php	(revision 405)
@@ -0,0 +1,128 @@
+<?php
+###############################################################################
+##                RSSFit - Extendable XML news feed generator                ##
+##                   Copyright (c) 2004 NS Tai (aka tuff)                    ##
+##                       <http://www.brandycoke.com/>                        ##
+##                      Modified By 2005 CACHE RSSfitJ                       ##
+##                       <http://gyakubiki.kir.jp/>                          ##
+###############################################################################
+##                    XOOPS - PHP Content Management System                  ##
+##                       Copyright (c) 2000 XOOPS.org                        ##
+##                          <http://www.xoops.org/>                          ##
+###############################################################################
+##  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.                                      ##
+##                                                                           ##
+##  You may not change or alter any portion of this comment or credits       ##
+##  of supporting developers from this source code or any supporting         ##
+##  source code which is considered copyrighted (c) material of the          ##
+##  original comment or credit authors.                                      ##
+##                                                                           ##
+##  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 ##
+###############################################################################
+##  Author of this file: CACHE                                               ##
+##  URL: http://gyakubiki.kir.jp/                                            ##
+##  Project: RSSFitJ                                                         ##
+###############################################################################
+$modversion['name'] = _MI_RSSFITJ_NAME;
+$modversion['version'] = '1.1';
+$modversion['description'] = _MI_RSSFITJ_DESC;
+$modversion['author'] = "NS Tai (aka tuff),Modified By CACHE";
+$modversion['credits'] = "<a href='http://www.brandycoke.com/'>Brandycoke Productions</a><br /><a href='http://www.gyakubiki.kir.jp/'>CACHE</a>";
+$modversion['help'] = "";
+$modversion['license'] = "<a href='http://creativecommons.org/licenses/GPL/2.0/' target='_blank'>Human-Readable Commons Deed</a><br /><a href='http://www.gnu.org/copyleft/gpl.html' target='_blank'>Full Legal Code</a>";
+$modversion['official'] = 0;
+$modversion['image'] = "images/rssfitJ.png";
+$modversion['dirname'] = "rssj";
+
+// Sql file (must contain sql generated by phpMyAdmin or phpPgAdmin)
+// All tables should not have any prefix!
+$modversion['sqlfile']['mysql'] = "sql/mysql.sql";
+//$modversion['sqlfile']['postgresql'] = "sql/pgsql.sql";
+
+// Tables created by sql file (without prefix!)
+$modversion['tables'][0] = "rssfitJ_plugins";
+$modversion['tables'][1] = "rssfitJ_misc";
+
+// Admin things
+$modversion['hasAdmin'] = 1;
+$modversion['adminindex'] = "admin/index.php";
+$modversion['adminmenu'] = "admin/menu.php";
+
+// Menu -- content in main menu block
+$modversion['hasMain'] = 1;
+
+// Templates
+$modversion['templates'][1]['file'] = 'rssfitJ_index.html';
+$modversion['templates'][1]['description'] = _MI_RSSFITJ_TMPL_INTRO;
+$modversion['templates'][2]['file'] = 'rssfitJ_rss.html';
+$modversion['templates'][2]['description'] = _MI_RSSFITJ_TMPL_RSS;
+
+//	Module Configs
+// $xoopsModuleConfig['overall_entries']
+$modversion['config'][1]['name'] = 'overall_entries';
+$modversion['config'][1]['title'] = '_MI_RSSFITJ_OVERALL_ENTRIES';
+$modversion['config'][1]['description'] = '_MI_RSSFITJ_OVERALL_ENTRIES_DESC';
+$modversion['config'][1]['formtype'] = 'textbox';
+$modversion['config'][1]['valuetype'] = 'int';
+$modversion['config'][1]['default'] = 20;
+
+// $xoopsModuleConfig['plugin_entries']
+$modversion['config'][2]['name'] = 'plugin_entries';
+$modversion['config'][2]['title'] = '_MI_RSSFITJ_PLUGIN_ENTRIES';
+$modversion['config'][2]['description'] = '_MI_RSSFITJ_PLUGIN_ENTRIES_DESC';
+$modversion['config'][2]['formtype'] = 'textbox';
+$modversion['config'][2]['valuetype'] = 'int';
+$modversion['config'][2]['default'] = 5;
+
+// $xoopsModuleConfig['sort']
+$modversion['config'][3]['name'] = 'sort';
+$modversion['config'][3]['title'] = '_MI_RSSFITJ_ENTRIES_SORT';
+$modversion['config'][3]['description'] = '_MI_RSSFITJ_ENTRIES_SORT_DESC';
+$modversion['config'][3]['formtype'] = 'select';
+$modversion['config'][3]['valuetype'] = 'text';
+$modversion['config'][3]['default'] = 'd';
+$modversion['config'][3]['options'] = array(_MI_RSSFITJ_ENTRIES_SORT_DATE=>'d', _MI_RSSFITJ_ENTRIES_SORT_CAT=>'c');
+
+// $xoopsModuleConfig['cache']
+$modversion['config'][4]['name'] = 'cache';
+$modversion['config'][4]['title'] = '_MI_RSSFITJ_CACHE';
+$modversion['config'][4]['description'] = '_MI_RSSFITJ_CACHE_DESC';
+$modversion['config'][4]['formtype'] = 'textbox';
+$modversion['config'][4]['valuetype'] = 'int';
+$modversion['config'][4]['default'] = 0;
+
+// $xoopsModuleConfig['max_char']
+$modversion['config'][5]['name'] = 'max_char';
+$modversion['config'][5]['title'] = '_MI_RSSFITJ_MAXCHAR';
+$modversion['config'][5]['description'] = '_MI_RSSFITJ_MAXCHAR_DESC';
+$modversion['config'][5]['formtype'] = 'textbox';
+$modversion['config'][5]['valuetype'] = 'int';
+$modversion['config'][5]['default'] = 255;
+
+// $xoopsModuleConfig['strip_html']
+$modversion['config'][6]['name'] = 'strip_html';
+$modversion['config'][6]['title'] = '_MI_RSSFITJ_STRIPHTML';
+$modversion['config'][6]['description'] = '_MI_RSSFITJ_STRIPHTML_DESC';
+$modversion['config'][6]['formtype'] = 'yesno';
+$modversion['config'][6]['valuetype'] = 'int';
+$modversion['config'][6]['default'] = 0;
+
+// $xoopsModuleConfig['utf8']
+$modversion['config'][7]['name'] = 'utf8';
+$modversion['config'][7]['title'] = '_MI_RSSFITJ_ENCODE_UTF8';
+$modversion['config'][7]['description'] = '_MI_RSSFITJ_ENCODE_UTF8_DESC';
+$modversion['config'][7]['formtype'] = 'yesno';
+$modversion['config'][7]['valuetype'] = 'int';
+$modversion['config'][7]['default'] = 0;
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/rssj/class/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/rssj/class/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/rssj/class/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/rssj/class/rssfitj.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/rssj/class/rssfitj.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/rssj/class/rssfitj.php	(revision 405)
@@ -0,0 +1,273 @@
+<?php
+###############################################################################
+##                RSSFit - Extendable XML news feed generator                ##
+##                   Copyright (c) 2004 NS Tai (aka tuff)                    ##
+##                       <http://www.brandycoke.com/>                        ##
+##                      Modified By 2005 CACHE RSSfitJ                       ##
+##                       <http://gyakubiki.kir.jp/>                          ##
+###############################################################################
+##                    XOOPS - PHP Content Management System                  ##
+##                       Copyright (c) 2000 XOOPS.org                        ##
+##                          <http://www.xoops.org/>                          ##
+###############################################################################
+##  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.                                      ##
+##                                                                           ##
+##  You may not change or alter any portion of this comment or credits       ##
+##  of supporting developers from this source code or any supporting         ##
+##  source code which is considered copyrighted (c) material of the          ##
+##  original comment or credit authors.                                      ##
+##                                                                           ##
+##  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 ##
+###############################################################################
+##  Author of this file: CACHE                                               ##
+##  URL: http://gyakubiki.kir.jp/                                            ##
+##  Project: RSSFitJ                                                         ##
+###############################################################################
+require_once XOOPS_ROOT_PATH.'/kernel/object.php';
+define('RSSFITJ_PLUGINS_TABLE', $GLOBALS['xoopsDB']->prefix("rssfitJ_plugins"));
+
+class RssjRssfitj extends XoopsObject{
+	function RssjRssfitj(){
+		$this->XoopsObject();
+	//	key, data_type, value, req, max, opt
+		$this->initVar("rssfj_conf_id", XOBJ_DTYPE_INT, NULL, false);
+		$this->initVar("rssfj_filename", XOBJ_DTYPE_TXTBOX, NULL, false);
+		$this->initVar("rssfj_activated", XOBJ_DTYPE_INT);
+		$this->initVar("rssfj_grab", XOBJ_DTYPE_INT, NULL, true);
+		$this->initVar("rssfj_order", XOBJ_DTYPE_INT, NULL);
+		$this->initVar("rssfj_param", XOBJ_DTYPE_TXTAREA, NULL, false);
+	}
+}
+
+class RssjRssfitjHandler{
+	var $db;
+	function RssjRssfitjHandler(&$db){
+		$this->db =& $db;
+	}
+	function &getInstance(&$db){
+		static $instance;
+		if( !isset($instance) ){
+			$instance = new RssjRssfitjHandler($db);
+		}
+		return $instance;
+	}
+	function &create(){
+		return new RssjRssfitj();
+	}
+
+	function &get($id){
+		$id = intval($id);
+		if( $id > 0 ){
+			$sql = "SELECT * FROM ".RSSFITJ_PLUGINS_TABLE." WHERE rssfj_conf_id=".$id;
+			if( !$result = $this->db->query($sql) ){
+				return false;
+			}
+			$numrows = $this->db->getRowsNum($result);
+			if( $numrows == 1 ){
+				$obj = new RssjRssfitj();
+				$obj->assignVars($this->db->fetchArray($result));
+				return $obj;
+			}
+		}
+		return false;
+	}
+
+	function insert(&$obj, $force=false){
+        if( strtolower(get_class($obj)) != 'rssjrssfitj'){
+            return false;
+        }
+        if( !$obj->isDirty() ){
+            return true;
+        }
+        if( !$obj->cleanVars() ){
+            return false;
+        }
+		foreach( $obj->cleanVars as $k=>$v ){
+			${$k} = $v;
+		}
+		
+		if( $obj->isNew() || empty($rssfj_conf_id) ){
+			$rssfj_conf_id = $this->db->genId(RSSFITJ_PLUGINS_TABLE."_rssfj_conf_id_seq");
+			$sql = sprintf(
+					"INSERT INTO %s (
+					rssfj_conf_id,
+					rssfj_filename,
+					rssfj_activated,
+					rssfj_grab,
+					rssfj_order,
+					rssfj_param
+					) VALUES (
+					%u, %s, %u, %u, %u, %s
+					)",
+					RSSFITJ_PLUGINS_TABLE,
+					$rssfj_conf_id,
+					$this->db->quoteString($rssfj_filename),
+					$rssfj_activated,
+					$rssfj_grab,
+					$rssfj_order,
+					$this->db->quoteString($rssfj_param)
+					);
+		}else{
+			$sql = sprintf(
+					"UPDATE %s SET
+					rssfj_filename = %s,
+					rssfj_activated = %u,
+					rssfj_grab = %u,
+					rssfj_order = %u,
+					rssfj_param = %s
+					WHERE rssfj_conf_id = %u",
+					RSSFITJ_PLUGINS_TABLE,
+					$this->db->quoteString($rssfj_filename),
+					$rssfj_activated,
+					$rssfj_grab,
+					$rssfj_order,
+					$this->db->quoteString($rssfj_param),
+					$rssfj_conf_id
+					);
+		}
+        if( false != $force ){
+            $result = $this->db->queryF($sql);
+        }else{
+            $result = $this->db->query($sql);
+        }
+		if( !$result ){
+			$obj->setErrors("Could not store data in the database.<br />".$this->db->error().' ('.$this->db->errno().')<br />'.$sql);
+			return false;
+		}
+		if( empty($rssfj_conf_id) ){
+			return $this->db->getInsertId();
+		}
+        $obj->assignVar('rssfj_conf_id', $rssfj_conf_id);
+		return $rssfj_conf_id;
+	}
+	
+	function delete(&$obj, $force = false){
+		if( strtolower(get_class($obj)) != 'rssjrssfitj' ){
+			return false;
+		}
+		$sql = "DELETE FROM ".RSSFITJ_PLUGINS_TABLE." WHERE rssfj_conf_id=".$obj->getVar("rssfj_conf_id")."";
+        if( false != $force ){
+            $result = $this->db->queryF($sql);
+        }else{
+            $result = $this->db->query($sql);
+        }
+		return true;
+	}
+
+	function &getObjects($criteria = null, $id_as_key = false){
+		$ret = array();
+		$limit = $start = 0;
+		$sql = 'SELECT * FROM '.RSSFITJ_PLUGINS_TABLE;
+		if( isset($criteria) && is_subclass_of($criteria, 'criteriaelement') ){
+			$sql .= ' '.$criteria->renderWhere();
+			if( $criteria->getSort() != '' ){
+				$sql .= ' ORDER BY '.$criteria->getSort().' '.$criteria->getOrder();
+			}
+			$limit = $criteria->getLimit();
+			$start = $criteria->getStart();
+		}
+		$result = $this->db->query($sql, $limit, $start);
+		if( !$result ){
+			return false;
+		}
+		while( $myrow = $this->db->fetchArray($result) ){
+			$obj = new RssjRssfitj();
+			$obj->assignVars($myrow);
+			if( !$id_as_key ){
+				$ret[] =& $obj;
+			}else{
+				$ret[$myrow['rssfj_conf_id']] =& $obj;
+			}
+			unset($obj);
+		}
+		return $ret;
+	}
+	
+    function getCount($criteria = null){
+		$sql = 'SELECT COUNT(*) FROM '.RSSFITJ_PLUGINS_TABLE;
+		if( isset($criteria) && is_subclass_of($criteria, 'criteriaelement') ){
+			$sql .= ' '.$criteria->renderWhere();
+		}
+		$result = $this->db->query($sql);
+		if( !$result ){
+			return false;
+		}
+		list($count) = $this->db->fetchRow($result);
+		return $count;
+	}
+    
+    function deleteAll($criteria = null){
+		$sql = 'DELETE FROM '.RSSFITJ_PLUGINS_TABLE;
+		if( isset($criteria) && is_subclass_of($criteria, 'criteriaelement') ){
+			$sql .= ' '.$criteria->renderWhere();
+		}
+		if( !$result = $this->db->query($sql) ){
+			return false;
+		}
+		return true;
+	}
+	
+	function forceDeactivate(&$obj){
+		$sql = 'UPDATE '.RSSFITJ_PLUGINS_TABLE.' SET rssfj_activated = 0 WHERE rssfj_conf_id = '.$obj->getVar('rssfj_conf_id');
+		$this->db->queryF($sql);
+		return true;
+	}
+	
+	function getPluginFileList(){
+		$sql = 'SELECT rssfj_filename FROM '.RSSFITJ_PLUGINS_TABLE;
+		if( !$result = $this->db->query($sql) ){
+			return false;
+		}
+		$ret="";
+		while( list($filename) = $this->db->fetchRow($result) ){
+			$ret[] =& $filename;
+			unset($filename);
+		}
+		return $ret;
+	}
+	
+	function checkPlugin(&$obj){
+		global $module_handler;
+		$file = RSSFITJ_ROOT_PATH.'plugins/'.$obj->getVar('rssfj_filename');
+		if( file_exists($file) ){
+			$require = require_once $file;
+			$name = explode('.', $obj->getVar('rssfj_filename'));
+			$class = 'Rssfitj'.ucfirst($name[1]);
+			if( class_exists($class) ){
+				$handler = new $class;
+				if( !method_exists($handler, 'loadmodule') || !method_exists($handler, 'grabentries') ){
+					$obj->setErrors(_AM_PLUGIN_FUNCNOTFOUND);
+				}else{
+					$dirname = $handler->dirname;
+					if( !empty($dirname) && is_dir(XOOPS_ROOT_PATH.'/modules/'.$dirname) ){
+						if( !$handler->loadModule() ){
+							$obj->setErrors(_AM_PLUGIN_MODNOTFOUND);
+						}else{
+							return $handler;
+						}
+					}else{
+						$obj->setErrors(_AM_PLUGIN_MODNOTFOUND);
+					}
+				}
+			}else{
+				$obj->setErrors(_AM_PLUGIN_CLASSNOTFOUND);
+			}
+		}else{
+			$obj->setErrors(_AM_PLUGIN_FILENOTFOUND);
+		}
+		return false;
+	}
+
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/rssj/images/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/rssj/images/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/rssj/images/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/rssj/admin/index.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/rssj/admin/index.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/rssj/admin/index.php	(revision 405)
@@ -0,0 +1,348 @@
+<?php
+###############################################################################
+##                RSSFit - Extendable XML news feed generator                ##
+##                   Copyright (c) 2004 NS Tai (aka tuff)                    ##
+##                       <http://www.brandycoke.com/>                        ##
+##                      Modified By 2005 CACHE RSSfitJ                       ##
+##                       <http://gyakubiki.kir.jp/>                          ##
+###############################################################################
+##                    XOOPS - PHP Content Management System                  ##
+##                       Copyright (c) 2000 XOOPS.org                        ##
+##                          <http://www.xoops.org/>                          ##
+###############################################################################
+##  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.                                      ##
+##                                                                           ##
+##  You may not change or alter any portion of this comment or credits       ##
+##  of supporting developers from this source code or any supporting         ##
+##  source code which is considered copyrighted (c) material of the          ##
+##  original comment or credit authors.                                      ##
+##                                                                           ##
+##  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 ##
+###############################################################################
+##  Author of this file: CACHE                                               ##
+##  URL: http://gyakubiki.kir.jp/                                            ##
+##  Project: RSSFitJ                                                         ##
+###############################################################################
+include 'admin_header.php';
+include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
+define('_THIS_PAGE', RSSFITJ_URL.'admin/index.php');
+$op = '';
+if( isset($_POST['op']) ){
+	$op = trim($_POST['op']);
+}elseif( isset($_GET['op']) ){
+	$op = trim($_GET['op']);
+}
+
+switch($op){
+default:
+	adminHtmlHeader();
+break;
+
+case 'intro':
+	adminHtmlHeader();
+	$intro = grabIntro();
+	$myts =& MyTextSanitizer::getInstance();
+	$title = $myts->makeTboxData4Edit($intro['title']);
+	$content = $myts->makeTareaData4Edit($intro['content']);
+	$text = new XoopsFormText(_AM_EDIT_INTRO_TITLE, 'title', 50, 255, $title);
+	$text->setDescription(_AM_EDIT_INTRO_TITLE_DESC);
+	$tarea = new XoopsFormDhtmlTextArea(_AM_EDIT_INTRO_TEXT, 'content', $content, 15, 60);
+	$tarea->setDescription(_AM_EDIT_INTRO_TEXT_DESC);
+	$button = new XoopsFormButton('', 'submit', _AM_SUBMIT, 'submit');
+	$hidden = new XoopsFormHidden('op', 'saveintro');
+	$form = new XoopsThemeForm(_AM_EDIT_INTRO, 'editintro', _THIS_PAGE);
+	$form->addElement($text);
+	$form->addElement($tarea);
+	$form->addElement($button);
+	$form->addElement($hidden);
+	$form->display();
+break;
+
+case 'saveintro':
+	$myts =& MyTextSanitizer::getInstance();
+	$title = $myts->makeTboxData4Save($_POST['title']);
+	$content = $myts->makeTareaData4Save($_POST['content']);
+	$sql = 'UPDATE '.$xoopsDB->prefix('rssfitJ_misc')." SET misc_title = '".$title."', misc_content = '".$content."'  WHERE misc_category = 'intro'";
+	if( !$result = $xoopsDB->query($sql) ){
+		$err = $xoopsDB->error();
+		adminHtmlHeader();
+		echo $err.'<br />'.$sql;
+	}else{
+		redirect_header(_THIS_PAGE.'?op=intro', 0, _AM_DBUPDATED);
+	}
+break;
+
+case 'plugins':
+	$ret = '';
+	adminHtmlHeader();
+	// activated plugins
+	$criteria = new Criteria('rssfj_activated', 1);
+	$criteria->setSort('rssfj_order');
+	if( $plugins =& $rssfj_mgr->getObjects($criteria) ){
+		$ret .= "<table class='outer' width='100%'>\n"
+			."<tr><th colspan='5'>"._AM_PLUGIN_ACTIVATED."</th></tr>\n"
+			."<tr>\n<td class='head' align='center' width='33%'>"._AM_PLUGIN_FILENAME."</td>\n"
+			."<td class='head' align='center'>"._AM_PLUGIN_MODNAME."</td>\n"
+			."<td class='head' align='center'>"._AM_PLUGIN_SHOWXENTRIES."</td>\n"
+			."<td class='head' align='center'>"._AM_PLUGIN_ORDER."</td>\n"
+			."<td class='head' align='center' width='20%'>"._AM_ACTION."</td>\n"
+			."</tr>\n";
+		foreach( $plugins as $p ){
+			if( $handler =& $rssfj_mgr->checkPlugin($p) ){
+				$id = $p->getVar('rssfj_conf_id');
+				$entries =& new XoopsFormText('', 'rssfj_grab['.$id.']', 3, 2, $p->getVar('rssfj_grab'));
+				$order =& new XoopsFormText('', 'rssfj_order['.$id.']', 3, 2, $p->getVar('rssfj_order'));
+				$action =& new XoopsFormSelect('', 'action['.$id.']', '');
+				$action->addOption('', _SELECT);
+				$action->addOption('d', _AM_PLUGIN_DEACTIVATE);
+				$action->addOption('u', _AM_PLUGIN_UNINSTALL);
+				$ret .= "<tr>\n"
+					."<td class='odd' align='center'>"
+						.$p->getVar('rssfj_filename')."</td>\n"
+					."<td class='even' align='center'>"
+						.$handler->modname."</td>\n"
+					."<td class='odd' align='center'>"
+						.$entries->render()."</td>\n"
+					."<td class='odd' align='center'>"
+						.$order->render()."</td>\n"
+					."<td class='odd' align='center'>"
+						.$action->render()."</td>\n"
+					;
+				$ret .= "</tr>\n";
+			}else{
+				$rssfj_mgr->forceDeactivate($p);
+			}
+		}
+		$ret .= "</table>\n";
+	}
+
+	// inactive plugins
+	if( $plugins =& $rssfj_mgr->getObjects(new Criteria('rssfj_activated', 0)) ){
+		$ret .= "<br />\n<table class='outer' width='100%'>\n"
+			."<tr><th colspan='3'>"._AM_PLUGIN_INACTIVE."</th></tr>\n"
+			."<tr>\n<td class='head' align='center' width='33%'>"._AM_PLUGIN_FILENAME."</td>\n"
+			."<td class='head' align='center'>"._AM_PLUGIN_MODNAME."</td>\n"
+			."<td class='head' align='center' width='20%'>"._AM_ACTION."</td>\n"
+			."</tr>\n";
+		foreach( $plugins as $p ){
+			$id = $p->getVar('rssfj_conf_id');
+			$action =& new XoopsFormSelect('', 'action['.$id.']', '');
+			$action->addOption('', _SELECT);
+			$ret .= "<tr>\n"
+				."<td class='odd' align='center'>"
+					.$p->getVar('rssfj_filename')."</td>\n"
+				."<td class='even' align='center'>";
+			if( $handler =& $rssfj_mgr->checkPlugin($p) ){
+				$ret .= $handler->modname;
+				$action->addOption('a', _AM_PLUGIN_ACTIVATE);
+			}else{
+				if( count($p->getErrors()) > 0 ){
+					$ret .= '<b>'._ERRORS."</b>\n";
+					foreach( $p->getErrors() as $e ){
+						$ret .= '<br />'.$e;
+					}
+				}else{
+					$ret .= '<b>'._AM_PLUGIN_UNKNOWNERROR."</b>";
+				}
+			}
+			$ret .= "</td>\n";
+			$action->addOption('u', _AM_PLUGIN_UNINSTALL);
+			$ret .= "<td class='odd' align='center'>"
+				.$action->render()."</td>\n";
+		}
+		$ret .= "</table>\n";
+	}
+
+	// Non-installed plugins
+	if( !$filelist =& $rssfj_mgr->getPluginFileList() ){
+		$filelist = array();
+	}
+	$list =& XoopsLists::getFileListAsArray(RSSFITJ_ROOT_PATH.'plugins');
+	$installable = array();
+	foreach( $list as $f ){
+		if( preg_match('/rssfitj\.+[a-zA-Z0-9_]+\.php/', $f) && !in_array($f, $filelist) ){
+			$installable[] = $f;
+		}
+	}
+	if( count($installable) > 0 ){
+		$ret .= "<br />\n<table class='outer' width='100%'>\n"
+			."<tr><th colspan='3'>"._AM_PLUGIN_NONINSTALLED."</th></tr>\n"
+			."<tr>\n<td class='head' align='center' width='33%'>"._AM_PLUGIN_FILENAME."</td>\n"
+			."<td class='head' align='center'>"._AM_PLUGIN_MODNAME."</td>\n"
+			."<td class='head' align='center' width='20%'>"._AM_PLUGIN_INSTALL."</td>\n"
+			."</tr>\n";
+		foreach( $installable as $i ){
+			$action =& new XoopsFormCheckbox('', 'install['.$i.']');
+			$action->addOption('i', ' ');
+			$ret .= "<tr>\n"
+				."<td class='odd' align='center'>"
+					.$i."</td>\n"
+				."<td class='even' align='center'>";
+			$p =& $rssfj_mgr->create();
+			$p->setVar('rssfj_filename', $i);
+			if( $handler =& $rssfj_mgr->checkPlugin($p) ){
+				$ret .= $handler->modname;
+			}else{
+				if( count($p->getErrors()) > 0 ){
+					$ret .= '<b>'._ERRORS."</b>\n";
+					foreach( $p->getErrors() as $e ){
+						$ret .= '<br />'.$e;
+					}
+				}else{
+					$ret .= '<b>'._AM_PLUGIN_UNKNOWNERROR."</b>";
+				}
+				$action->setExtra('disabled="disabled"');
+			}
+			$ret .= "</td>\n";
+			$ret .= "<td class='odd' align='center'>"
+				.$action->render()."</td>\n";
+		}
+		$ret .= "</table>\n";
+	}
+	
+	if( !empty($ret) ){
+		$button = new XoopsFormButton('', 'submit', _AM_SUBMIT, 'submit');
+		$hidden = new XoopsFormHidden('op', 'saveplugins');
+		$ret = "<form action='"._THIS_PAGE."' method='post'>\n".$ret
+				."<br /><table class='outer' width='100%'><tr><td class='foot' align='center'>\n"
+				.$button->render()."\n".$hidden->render()."\n</td></tr></table></form>"
+				;
+		echo $ret;
+	}
+break;
+
+case 'saveplugins':
+	extract($_POST);
+	$err = '';
+	if (isset($action))
+		$keys = array_keys($action);
+	else
+		$keys = array();
+	foreach( $keys as $k ){
+		$plugin =& $rssfj_mgr->get($k);
+		if( isset($rssfj_grab[$k]) ){
+			$plugin->setVar('rssfj_grab', $rssfj_grab[$k]);
+		}
+		if (isset($rssfj_order[$k]))
+			$plugin->setVar('rssfj_order', $rssfj_order[$k]);
+		switch($action[$k]){
+		default:
+			$result = $rssfj_mgr->insert($plugin);
+		break;
+
+		case 'u':	// uninstall
+			$result = $rssfj_mgr->delete($plugin);
+		break;
+		
+		case 'd':	// deactivate
+			$plugin->setVar('rssfj_activated', 0);
+			$result = $rssfj_mgr->insert($plugin);
+		break;
+		
+		case 'a':	// activate
+			$plugin->setVar('rssfj_activated', 1);
+			$result = $rssfj_mgr->insert($plugin);
+		break;
+		}
+		if( !$result ){
+			$err .= $plugin->getHtmlErrors();
+		}
+	}
+	if( !empty($install) ){
+		$files = array_keys($install);
+		foreach( $files as $f ){
+			$p =& $rssfj_mgr->create();
+			$p->setVar('rssfj_filename', $f);
+			$p->setVar('rssfj_activated', 1);
+			$p->setVar('rssfj_grab', $xoopsModuleConfig['plugin_entries']);
+			if( !$result = $rssfj_mgr->insert($p) ){
+				$err .= $p->getHtmlErrors();
+			}
+		}
+	}
+	if( !empty($err) ){
+		adminHtmlHeader();
+		echo $err;
+	}else{
+		redirect_header(_THIS_PAGE.'?op=plugins', 0, _AM_DBUPDATED);
+	}
+break;
+
+case 'param' :
+	$ret = '';
+	adminHtmlHeader();
+	// activated plugins
+	$criteria = new Criteria('rssfj_activated', 1);
+	$criteria->setSort('rssfj_order');
+	if( $plugins =& $rssfj_mgr->getObjects($criteria) ){
+		$ret .= "<table class='outer' width='100%'>\n"
+			."<tr><th colspan='5'>"._AM_PLUGIN_ACTIVATED."</th></tr>\n"
+			."<tr>\n<td class='head' align='center' width='33%'>"._AM_PLUGIN_FILENAME."</td>\n"
+			."<td class='head' align='center'>"._AM_PLUGIN_MODNAME."</td>\n"
+			."<td class='head' align='center'>"._AM_PLUGIN_PARAMETERS."</td>\n"
+			."</tr>\n";
+		foreach( $plugins as $p ){
+			if( $handler =& $rssfj_mgr->checkPlugin($p) ){
+				$id = $p->getVar('rssfj_conf_id');
+				$entries =& new XoopsFormTextArea('', 'rssfj_param['.$id.']', $p->getVar('rssfj_param'), 5, 60);
+				$ret .= "<tr>\n"
+					."<td class='odd' align='center'>"
+						.$p->getVar('rssfj_filename')."</td>\n"
+					."<td class='even' align='center'>"
+						.$handler->modname."</td>\n"
+					."<td class='odd' align='center'>"
+						.$entries->render()."</td>\n"
+					;
+				$ret .= "</tr>\n";
+			}else{
+				$rssfj_mgr->forceDeactivate($p);
+			}
+		}
+		$ret .= "</table>\n";
+	}
+	if( !empty($ret) ){
+		$button = new XoopsFormButton('', 'submit', _AM_SUBMIT, 'submit');
+		$hidden = new XoopsFormHidden('op', 'saveparam');
+		$ret = "<form action='"._THIS_PAGE."' method='post'>\n".$ret
+				."<br /><table class='outer' width='100%'><tr><td class='foot' align='center'>\n"
+				.$button->render()."\n".$hidden->render()."\n</td></tr></table></form>"
+				;
+		echo $ret;
+	}
+break;
+
+case 'saveparam' :
+	extract($_POST);
+	$err = '';
+	if( !empty($rssfj_param) ){
+		$files = array_keys($rssfj_param);
+		foreach( $files as $f ){
+			$p =& $rssfj_mgr->get($f);
+			$p->setVar('rssfj_param', $rssfj_param[$f]);
+			if( !$result = $rssfj_mgr->insert($p) ){
+				$err .= $p->getHtmlErrors();
+			}
+		}
+	}
+	if( !empty($err) ){
+		adminHtmlHeader();
+		echo $err;
+	}else{
+		redirect_header(_THIS_PAGE.'?op=param', 0, _AM_DBUPDATED);
+	}
+break;
+
+}
+include 'footer.php';
+xoops_cp_footer();
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/rssj/admin/admin.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/rssj/admin/admin.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/rssj/admin/admin.php	(revision 405)
@@ -0,0 +1,160 @@
+<?php
+// $Id: admin.php,v 1.7 2003/04/11 13:00:53 okazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+$admin_mydirname = basename( dirname( dirname( __FILE__ ) ) ) ;
+
+$fct = empty( $_POST['fct'] ) ? '' : trim( $_POST['fct'] ) ;
+$fct = empty( $_GET['fct'] ) ? $fct : trim( $_GET['fct'] ) ;
+if( empty( $fct ) ) $fct = 'preferences' ;
+//if (isset($fct) && $fct == "users") {
+//	$xoopsOption['pagetype'] = "user";
+//}
+include "../../../mainfile.php";
+// include "../../mainfile.php"; GIJ
+include XOOPS_ROOT_PATH."/include/cp_functions.php";
+
+include_once XOOPS_ROOT_PATH."/class/xoopsmodule.php";
+include_once "../include/gtickets.php" ;// GIJ
+
+$admintest = 0;
+
+if (is_object($xoopsUser)) {
+	$xoopsModule =& XoopsModule::getByDirname("system");
+	if ( !$xoopsUser->isAdmin($xoopsModule->mid()) ) {
+		redirect_header(XOOPS_URL.'/user.php',3,_NOPERM);
+		exit();
+	}
+	$admintest=1;
+} else {
+	redirect_header(XOOPS_URL.'/user.php',3,_NOPERM);
+	exit();
+}
+
+// include system category definitions
+include_once XOOPS_ROOT_PATH."/modules/system/constants.php";
+$error = false;
+if ($admintest != 0) {
+	if (isset($fct) && $fct != '') {
+		if (file_exists(XOOPS_ROOT_PATH."/modules/system/admin/".$fct."/xoops_version.php")) {
+
+			if ( file_exists(XOOPS_ROOT_PATH."/modules/system/language/".$xoopsConfig['language']."/admin.php") ) {
+				include XOOPS_ROOT_PATH."/modules/system/language/".$xoopsConfig['language']."/admin.php";
+			} else {
+				include XOOPS_ROOT_PATH."/modules/system/language/english/admin.php";
+			}
+
+			if (file_exists(XOOPS_ROOT_PATH."/modules/system/language/".$xoopsConfig['language']."/admin/".$fct.".php")) {
+				include XOOPS_ROOT_PATH."/modules/system/language/".$xoopsConfig['language']."/admin/".$fct.".php";
+			} elseif (file_exists(XOOPS_ROOT_PATH."/modules/system/language/english/admin/".$fct.".php")) {
+				include XOOPS_ROOT_PATH."/modules/system/language/english/admin/".$fct.".php";
+			}
+			include XOOPS_ROOT_PATH."/modules/system/admin/".$fct."/xoops_version.php";
+			$sysperm_handler =& xoops_gethandler('groupperm');
+			$category = !empty($modversion['category']) ? intval($modversion['category']) : 0;
+			unset($modversion);
+			if ($category > 0) {
+				$groups =& $xoopsUser->getGroups();
+				if (in_array(XOOPS_GROUP_ADMIN, $groups) || false != $sysperm_handler->checkRight('system_admin', $category, $groups, $xoopsModule->getVar('mid'))){
+//					if (file_exists(XOOPS_ROOT_PATH."/modules/system/admin/".$fct."/main.php")) {
+//						include_once XOOPS_ROOT_PATH."/modules/system/admin/".$fct."/main.php"; GIJ
+					if (file_exists("../include/{$fct}.inc.php")) {
+						include_once "../include/{$fct}.inc.php" ;
+					} else {
+						$error = true;
+					}
+				} else {
+					$error = true;
+				}
+			} elseif ($fct == 'version') {
+				if (file_exists(XOOPS_ROOT_PATH."/modules/system/admin/version/main.php")) {
+					include_once XOOPS_ROOT_PATH."/modules/system/admin/version/main.php";
+				} else {
+					$error = true;
+				}
+			} else {
+				$error = true;
+			}
+		} else {
+			$error = true;
+		}
+	} else {
+		$error = true;
+	}
+}
+
+if (false != $error) {
+	xoops_cp_header();
+	echo "<h4>System Configuration</h4>";
+	echo '<table class="outer" cellpadding="4" cellspacing="1">';
+	echo '<tr>';
+	$groups = $xoopsUser->getGroups();
+	$all_ok = false;
+	if (!in_array(XOOPS_GROUP_ADMIN, $groups)) {
+		$sysperm_handler =& xoops_gethandler('groupperm');
+		$ok_syscats =& $sysperm_handler->getItemIds('system_admin', $groups);
+	} else {
+		$all_ok = true;
+	}
+	$admin_dir = XOOPS_ROOT_PATH."/modules/system/admin";
+	$handle = opendir($admin_dir);
+	$counter = 0;
+	$class = 'even';
+	while ($file = readdir($handle)) {
+		if (strtolower($file) != 'cvs' && !preg_match("/[.]/", $file) && is_dir($admin_dir.'/'.$file)) {
+			include $admin_dir.'/'.$file.'/xoops_version.php';
+			if ($modversion['hasAdmin']) {
+				$category = isset($modversion['category']) ? intval($modversion['category']) : 0;
+				if (false != $all_ok || in_array($modversion['category'], $ok_syscats)) {
+					echo "<td class='$class' align='center' valign='bottom' width='19%'>";
+					echo "<a href='".XOOPS_URL."/modules/system/admin.php?fct=".$file."'><b>" .trim($modversion['name'])."</b></a>\n";
+					echo "</td>";
+					$counter++;
+					$class = ($class == 'even') ? 'odd' : 'even';
+				}
+				if ( $counter > 4 ) {
+					$counter = 0;
+					echo "</tr>";
+					echo "<tr>";
+				}
+			}
+			unset($modversion);
+		}
+	}
+	while ($counter < 5) {
+		echo '<td class="'.$class.'">&nbsp;</td>';
+		$class = ($class == 'even') ? 'odd' : 'even';
+		$counter++;
+	}
+	echo '</tr></table>';
+    xoops_cp_footer();
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/rssj/admin/mymenu.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/rssj/admin/mymenu.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/rssj/admin/mymenu.php	(revision 405)
@@ -0,0 +1,66 @@
+<?php
+
+if( ! defined( 'XOOPS_ROOT_PATH' ) ) exit ;
+
+if( ! defined( 'XOOPS_ORETEKI' ) ) {
+	// Skip for ORETEKI XOOPS
+
+	if( ! isset( $module ) || ! is_object( $module ) ) $module = $xoopsModule ;
+	else if( ! is_object( $xoopsModule ) ) die( '$xoopsModule is not set' )  ;
+
+	if( file_exists("../language/".$xoopsConfig['language']."/modinfo.php") ) {
+		include_once("../language/".$xoopsConfig['language']."/modinfo.php");
+	} else {
+		include_once("../language/english/modinfo.php");
+	}
+
+	include( './menu.php' ) ;
+
+//	array_push( $adminmenu , array( 'title' => _PREFERENCES , 'link' => '../system/admin.php?fct=preferences&op=showmod&mod=' . $module->getvar('mid') ) ) ;
+	$menuitem_dirname = $module->getvar('dirname') ;
+	if( $module->getvar('hasconfig') ) array_push( $adminmenu , array( 'title' => _PREFERENCES , 'link' => 'admin/admin.php?fct=preferences&op=showmod&mod=' . $module->getvar('mid') ) ) ;
+
+	$menuitem_count = 0 ;
+	$mymenu_uri = empty( $mymenu_fake_uri ) ? $_SERVER['REQUEST_URI'] : $mymenu_fake_uri ;
+	$mymenu_link = substr( strstr( $mymenu_uri , '/admin/' ) , 1 ) ;
+
+	// hilight
+	foreach( array_keys( $adminmenu ) as $i ) {
+		if( $mymenu_link == $adminmenu[$i]['link'] ) {
+			$adminmenu[$i]['color'] = '#FFCCCC' ;
+			$adminmenu_hilighted = true ;
+		} else {
+			$adminmenu[$i]['color'] = '#DDDDDD' ;
+		}
+	}
+	if( empty( $adminmenu_hilighted ) ) {
+		foreach( array_keys( $adminmenu ) as $i ) {
+			if( stristr( $mymenu_uri , $adminmenu[$i]['link'] ) ) {
+				$adminmenu[$i]['color'] = '#FFCCCC' ;
+			}
+		}
+	}
+
+
+
+/*	// display
+	foreach( $adminmenu as $menuitem ) {
+		echo "<a href='".XOOPS_URL."/modules/$menuitem_dirname/{$menuitem['link']}' style='background-color:{$menuitem['color']};font:normal normal bold 9pt/12pt;'>{$menuitem['title']}</a> &nbsp; \n" ;
+
+		if( ++ $menuitem_count >= 4 ) {
+			echo "</div>\n<div width='95%' align='center'>\n" ;
+			$menuitem_count = 0 ;
+		}
+	}
+	echo "</div>\n" ;
+*/
+	// display
+	echo "<div style='text-align:left;width:98%;'>" ;
+	foreach( $adminmenu as $menuitem ) {
+		echo "<div style='float:left;height:1.5em;'><nobr><a href='".XOOPS_URL."/modules/$menuitem_dirname/{$menuitem['link']}' style='background-color:{$menuitem['color']};font:normal normal bold 9pt/12pt;'>{$menuitem['title']}</a> | </nobr></div>\n" ;
+	}
+	echo "</div>\n<hr style='clear:left;display:block;' />\n" ;
+
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/rssj/admin/footer.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/rssj/admin/footer.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/rssj/admin/footer.php	(revision 405)
@@ -0,0 +1,40 @@
+<?php
+###############################################################################
+##                RSSFit - Extendable XML news feed generator                ##
+##                   Copyright (c) 2004 NS Tai (aka tuff)                    ##
+##                       <http://www.brandycoke.com/>                        ##
+##                      Modified By 2005 CACHE RSSfitJ                       ##
+##                       <http://gyakubiki.kir.jp/>                          ##
+###############################################################################
+##                    XOOPS - PHP Content Management System                  ##
+##                       Copyright (c) 2000 XOOPS.org                        ##
+##                          <http://www.xoops.org/>                          ##
+###############################################################################
+##  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.                                      ##
+##                                                                           ##
+##  You may not change or alter any portion of this comment or credits       ##
+##  of supporting developers from this source code or any supporting         ##
+##  source code which is considered copyrighted (c) material of the          ##
+##  original comment or credit authors.                                      ##
+##                                                                           ##
+##  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 ##
+###############################################################################
+##  Author of this file: CACHE                                               ##
+##  URL: http://gyakubiki.kir.jp/                                            ##
+##  Project: RSSFitJ                                                         ##
+###############################################################################
+
+$credits = "<div style='text-align: right; font-size: x-small; margin-top: 15px;'>Powered by <a href='http://www.brandycoke.com/' target='_blank'>RSSfit Ver1.03</a> &copy; 2004 NS Tai (aka tuff)<br />Modified by <a href='http://www.gyakubiki.kir.jp/' target='_blank'>".RSSFITJ_VERSION."</a> &copy; 2005 CACHE | <a href='http://creativecommons.org/licenses/GPL/2.0/' target='_blank'>License Deed</a></div>";
+
+echo $credits;
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/rssj/admin/admin_header.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/rssj/admin/admin_header.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/rssj/admin/admin_header.php	(revision 405)
@@ -0,0 +1,40 @@
+<?php
+###############################################################################
+##                RSSFit - Extendable XML news feed generator                ##
+##                   Copyright (c) 2004 NS Tai (aka tuff)                    ##
+##                       <http://www.brandycoke.com/>                        ##
+##                      Modified By 2005 CACHE RSSfitJ                       ##
+##                       <http://gyakubiki.kir.jp/>                          ##
+###############################################################################
+##                    XOOPS - PHP Content Management System                  ##
+##                       Copyright (c) 2000 XOOPS.org                        ##
+##                          <http://www.xoops.org/>                          ##
+###############################################################################
+##  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.                                      ##
+##                                                                           ##
+##  You may not change or alter any portion of this comment or credits       ##
+##  of supporting developers from this source code or any supporting         ##
+##  source code which is considered copyrighted (c) material of the          ##
+##  original comment or credit authors.                                      ##
+##                                                                           ##
+##  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 ##
+###############################################################################
+##  Author of this file: CACHE                                               ##
+##  URL: http://gyakubiki.kir.jp/                                            ##
+##  Project: RSSFitJ                                                         ##
+###############################################################################
+
+include '../../../include/cp_header.php';
+include '../include/common.php';
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/rssj/admin/menu.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/rssj/admin/menu.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/rssj/admin/menu.php	(revision 405)
@@ -0,0 +1,42 @@
+<?php
+###############################################################################
+##                RSSFit - Extendable XML news feed generator                ##
+##                   Copyright (c) 2004 NS Tai (aka tuff)                    ##
+##                       <http://www.brandycoke.com/>                        ##
+##                      Modified By 2005 CACHE RSSfitJ                       ##
+##                       <http://gyakubiki.kir.jp/>                          ##
+###############################################################################
+##                    XOOPS - PHP Content Management System                  ##
+##                       Copyright (c) 2000 XOOPS.org                        ##
+##                          <http://www.xoops.org/>                          ##
+###############################################################################
+##  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.                                      ##
+##                                                                           ##
+##  You may not change or alter any portion of this comment or credits       ##
+##  of supporting developers from this source code or any supporting         ##
+##  source code which is considered copyrighted (c) material of the          ##
+##  original comment or credit authors.                                      ##
+##                                                                           ##
+##  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 ##
+###############################################################################
+##  Author of this file: CACHE                                               ##
+##  URL: http://gyakubiki.kir.jp/                                            ##
+##  Project: RSSFitJ                                                         ##
+###############################################################################
+$adminmenu[0]['title'] = _MI_RSSFITJ_ADMENU1;
+$adminmenu[0]['link'] = "admin/index.php?op=intro";
+$adminmenu[1]['title'] = _MI_RSSFITJ_ADMENU2;
+$adminmenu[1]['link'] = "admin/index.php?op=plugins";
+$adminmenu[2]['title'] = _MI_RSSFITJ_ADMENU3;
+$adminmenu[2]['link'] = "admin/index.php?op=param";
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/rssj/index.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/rssj/index.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/rssj/index.php	(revision 405)
@@ -0,0 +1,48 @@
+<?php
+###############################################################################
+##                RSSFit - Extendable XML news feed generator                ##
+##                   Copyright (c) 2004 NS Tai (aka tuff)                    ##
+##                       <http://www.brandycoke.com/>                        ##
+##                      Modified By 2005 CACHE RSSfitJ                       ##
+##                       <http://gyakubiki.kir.jp/>                          ##
+###############################################################################
+##                    XOOPS - PHP Content Management System                  ##
+##                       Copyright (c) 2000 XOOPS.org                        ##
+##                          <http://www.xoops.org/>                          ##
+###############################################################################
+##  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.                                      ##
+##                                                                           ##
+##  You may not change or alter any portion of this comment or credits       ##
+##  of supporting developers from this source code or any supporting         ##
+##  source code which is considered copyrighted (c) material of the          ##
+##  original comment or credit authors.                                      ##
+##                                                                           ##
+##  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 ##
+###############################################################################
+##  Author of this file: CACHE                                               ##
+##  URL: http://gyakubiki.kir.jp/                                            ##
+##  Project: RSSFitJ                                                         ##
+###############################################################################
+include 'header.php';
+$xoopsOption['template_main'] = 'rssfitJ_index.html';
+include XOOPS_ROOT_PATH.'/header.php';
+$intro = grabIntro();
+$myts =& MyTextSanitizer::getInstance();
+$intro['title'] = $myts->makeTboxData4Show($intro['title']);
+$intro['title'] = str_replace('{SITENAME}', $xoopsConfig['sitename'],  $intro['title']);
+$intro['content'] = $myts->makeTareaData4Show($intro['content']);
+$intro['content'] = str_replace('{SITENAME}', $xoopsConfig['sitename'],  $intro['content']);
+$intro['content'] = str_replace('{SITEURL}', XOOPS_URL.'/',  $intro['content']);
+$xoopsTpl->assign('intro', $intro);
+include XOOPS_ROOT_PATH.'/footer.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/rssj/rss.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/rssj/rss.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/rssj/rss.php	(revision 405)
@@ -0,0 +1,126 @@
+<?php
+###############################################################################
+##                RSSFit - Extendable XML news feed generator                ##
+##                   Copyright (c) 2004 NS Tai (aka tuff)                    ##
+##                       <http://www.brandycoke.com/>                        ##
+##                      Modified By 2005 CACHE RSSfitJ                       ##
+##                       <http://gyakubiki.kir.jp/>                          ##
+###############################################################################
+##                    XOOPS - PHP Content Management System                  ##
+##                       Copyright (c) 2000 XOOPS.org                        ##
+##                          <http://www.xoops.org/>                          ##
+###############################################################################
+##  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.                                      ##
+##                                                                           ##
+##  You may not change or alter any portion of this comment or credits       ##
+##  of supporting developers from this source code or any supporting         ##
+##  source code which is considered copyrighted (c) material of the          ##
+##  original comment or credit authors.                                      ##
+##                                                                           ##
+##  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 ##
+###############################################################################
+##  Author of this file: CACHE                                               ##
+##  URL: http://gyakubiki.kir.jp/                                            ##
+##  Project: RSSFitJ                                                         ##
+###############################################################################
+$module_array=array();
+for ($i=0;$i<100;$i++) {
+	if (isset($_GET['module'.$i])) {
+		$module_array[]=$_GET['module'.$i];
+	} else {
+		if (isset($_POST['module'.$i]))
+			$module_array[]=$_POST['module'.$i];
+	}
+}
+if( function_exists('mb_http_output') ){
+	mb_http_output('pass');
+}
+include 'header.php';
+require_once XOOPS_ROOT_PATH.'/class/template.php';
+$xoopsTpl = new XoopsTpl();
+$nocache = !empty($_GET['nocache']) || !$xoopsModuleConfig['cache'] || !empty($_GET['debug']) ? true : false;
+if( $nocache ){
+	$xoopsTpl->xoops_setCaching(0);
+}else{
+	$xoopsTpl->xoops_setCaching(2);
+	$xoopsTpl->xoops_setCacheTime($xoopsModuleConfig['cache']*60);
+}
+
+if( !$xoopsTpl->is_cached('db:rssfitJ_rss.html') || $nocache ){
+	$criteria = new Criteria('rssfj_activated', 1);
+	$criteria->setSort('rssfj_order');
+	if( $plugins =& $rssfj_mgr->getObjects($criteria) ){
+		$entries = array();
+		foreach( $plugins as $p ){
+			if( $handler =& $rssfj_mgr->checkPlugin($p) ){
+				$modDir = $handler->getDirName();
+				if (in_array($modDir,$module_array) ||
+					count($module_array)==0) {
+					$grab = $handler->grabEntries($p);
+					if( count($grab) > 0 ){
+						foreach( $grab as $g ){
+							array_push($entries, $g);
+						}
+					}
+				}
+			}
+		}
+		if( count($entries) > 0 ){
+			if( $xoopsModuleConfig['sort'] == 'd' ){
+				uasort($entries, 'sortTimestamp');
+			}
+			if( count($entries) > $xoopsModuleConfig['overall_entries'] ){
+				$entries = array_slice($entries, 0, $xoopsModuleConfig['overall_entries']);
+			}
+			foreach( $entries as $e ){
+				$e['title'] = utf8Encode(htmlspecialchars($e['title'], ENT_QUOTES));
+				$e['pubdate'] = rssTimeStamp($e['timestamp']);
+				if( $xoopsModuleConfig['strip_html'] ){
+					$e['description'] = preg_replace('/<([^>]|\n)*>/', ' ', $e['description']);
+					$e['description'] = preg_replace('/\[([^>]|\n)*\]/', ' ', $e['description']);
+				}
+				$e['description'] = utf8Encode(htmlspecialchars(doSubstr($e['description']), ENT_QUOTES));
+				$e['category'] = utf8Encode(htmlspecialchars($e['category'], ENT_QUOTES));
+				$xoopsTpl->append('items', $e);
+			}
+		}
+	}
+	
+	$xoopsTpl->assign('channel_title', utf8Encode(htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES)));
+	$xoopsTpl->assign('channel_desc', utf8Encode(htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES)));
+	$sql = "SELECT conf_value FROM ".$xoopsDB->prefix('config')." WHERE conf_name = 'meta_copyright' AND conf_modid = 0 AND conf_catid = ".XOOPS_CONF_METAFOOTER;
+	list($copyright) = $xoopsDB->fetchRow($xoopsDB->query($sql));
+	$xoopsTpl->assign('channel_copyright', utf8Encode(htmlspecialchars($copyright, ENT_QUOTES)));
+	$xoopsTpl->assign('channel_lastbuild', rssTimeStamp(time()));
+	$gen = XOOPS_VERSION.' / '.RSSFITJ_VERSION;
+	$xoopsTpl->assign('channel_generator', utf8Encode($gen));
+	$xoopsTpl->assign('channel_editor', $xoopsConfig['adminmail']);
+	$xoopsTpl->assign('channel_webmaster', $xoopsConfig['adminmail']);
+	if( $xoopsModuleConfig['cache'] > 0 ){
+		$xoopsTpl->assign('channel_ttl', $xoopsModuleConfig['cache']);
+	}
+}
+
+if( empty($_GET['debug']) ){
+	if( !$xoopsModuleConfig['utf8'] ){
+		$xoopsTpl->assign('rssj_encoding', _CHARSET);
+		header('Content-Type:text/xml; charset='._CHARSET);
+	}else{
+		$xoopsTpl->assign('rssj_encoding', 'UTF-8');
+		header('Content-Type:text/xml; charset=UTF-8');
+	}
+}else{
+	header('Content-Type:text/html; charset='._CHARSET);
+}
+$xoopsTpl->display('db:rssfitJ_rss.html');
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/rssj/header.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/rssj/header.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/rssj/header.php	(revision 405)
@@ -0,0 +1,39 @@
+<?php
+###############################################################################
+##                RSSFit - Extendable XML news feed generator                ##
+##                   Copyright (c) 2004 NS Tai (aka tuff)                    ##
+##                       <http://www.brandycoke.com/>                        ##
+##                      Modified By 2005 CACHE RSSfitJ                       ##
+##                       <http://gyakubiki.kir.jp/>                          ##
+###############################################################################
+##                    XOOPS - PHP Content Management System                  ##
+##                       Copyright (c) 2000 XOOPS.org                        ##
+##                          <http://www.xoops.org/>                          ##
+###############################################################################
+##  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.                                      ##
+##                                                                           ##
+##  You may not change or alter any portion of this comment or credits       ##
+##  of supporting developers from this source code or any supporting         ##
+##  source code which is considered copyrighted (c) material of the          ##
+##  original comment or credit authors.                                      ##
+##                                                                           ##
+##  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 ##
+###############################################################################
+##  Author of this file: CACHE                                               ##
+##  URL: http://gyakubiki.kir.jp/                                            ##
+##  Project: RSSFitJ                                                         ##
+###############################################################################
+
+include '../../mainfile.php';
+include 'include/common.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/rssj/rss.css
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/rssj/rss.css	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/rssj/rss.css	(revision 405)
@@ -0,0 +1,80 @@
+/* $Id: rss.css,v 1.4 2003/11/07 18:26:54 creep Exp $ */
+rss {
+	display: block;
+	margin: 10px auto 10px auto;
+	width: 80%;
+	background: #FFF;
+	font-family: Verdana, arial, sans-serif;
+	font-size: small;
+	}
+
+channel {
+	display: block;
+	margin-bottom: 10px;
+	border: 1px solid #CCC;
+	padding: 10px;
+	}
+
+channel>title {
+	display: block;
+	font-size: large;
+	font-weight: bold;
+	}
+
+channel>description {
+	display: block;
+	}
+
+channel>copyright {
+	display: block;
+	font-size: x-small;
+	color: #666;
+	}
+
+channel>lastBuildDate {
+	display: block;
+	text-align: right;
+	}
+
+channel>language,
+channel>image,
+channel>managingEditor,
+channel>webMaster,
+channel>generator,
+channel>docs,
+channel>ttl {
+	display: none;
+	}
+
+item {
+	display: block;
+	padding: 5px;
+	margin-top: 10px;
+	border: 1px solid #CCC;
+	background: #EEE;
+	}
+
+item>title {
+	display: block;
+	float: left;
+	margin-right: 5px;
+	font-weight: bold;
+	}
+
+item>pubDate {
+	margin-right: 5px;
+	font-size: x-small;
+	color: #666;
+	white-space: nowrap;
+	}
+
+item>guid {
+	display: block;
+	margin-right: 5px;
+	font-size: x-small;
+	color: #666;
+	}
+	
+item>category, item>link {
+	display: none;
+	}
Index: /temp/test-xoops.ec-cube.net/html/modules/rssj/templates/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/rssj/templates/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/rssj/templates/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/rssj/templates/rssfitJ_index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/rssj/templates/rssfitJ_index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/rssj/templates/rssfitJ_index.html	(revision 405)
@@ -0,0 +1,2 @@
+<h4><{$intro.title}></h4>
+<{$intro.content}>
Index: /temp/test-xoops.ec-cube.net/html/modules/rssj/templates/rssfitJ_rss.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/rssj/templates/rssfitJ_rss.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/rssj/templates/rssfitJ_rss.html	(revision 405)
@@ -0,0 +1,38 @@
+<{*
+$Id: rssfitJ_rss.html,v 1.4 2004/04/28 16:31:46 tuff Exp $
+*}><?xml version="1.0" encoding="<{$rssj_encoding}>"?>
+<?xml-stylesheet href="rss.css" type="text/css"?>
+<rss version="2.0">
+	<channel>
+		<title><{$channel_title}></title>
+		<link><{$xoops_url}>/</link>
+		<description><{$channel_desc}></description>
+		<language><{$xoops_langcode}></language>
+		<copyright><{$channel_copyright}></copyright>
+		<lastBuildDate><{$channel_lastbuild}></lastBuildDate>
+		<docs>http://backend.userland.com/rss/</docs>
+		<generator><{$channel_generator}></generator>
+		<managingEditor><{$channel_editor}></managingEditor>
+		<webMaster><{$channel_webmaster}></webMaster>
+<{if $channel_ttl gt 0 }>		<ttl><{$channel_ttl}></ttl>
+<{/if}>
+		<image>
+			<title><{$channel_title}></title>
+			<url><{$xoops_url}>/images/logo.gif</url>
+			<link><{$xoops_url}>/</link>
+			<width>144</width>
+			<height>80</height>
+		</image>
+<{foreach item=item from=$items}>
+		<item>
+			<title><{$item.title}></title>
+			<description><{$item.description}></description>
+			<pubDate><{$item.pubdate}></pubDate>
+<{if $item.category != ""}>			<category<{if $item.domain != ""}> domain="<{$item.domain}>"<{/if}>><{$item.category}></category>
+<{/if}>
+			<link><{$item.link}></link>
+			<guid><{$item.guid}></guid>
+		</item>
+<{/foreach}>
+	</channel>
+</rss>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/admin/index.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/admin/index.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/admin/index.php	(revision 405)
@@ -0,0 +1,348 @@
+<?php
+// $Id: index.php,v 1.4 2005/08/03 12:40:01 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+include '../../../include/cp_header.php';
+include XOOPS_ROOT_PATH.'/modules/xoopsheadline/include/functions.php';
+$op = 'list';
+
+if (!empty($_GET['op']) && ($_GET['op'] == 'delete' || $_GET['op'] == 'edit')) {
+    $op = $_GET['op'];
+    $headline_id = intval($_GET['headline_id']);
+} elseif (!empty($_POST['op'])) {
+    $op = $_POST['op'];
+}
+
+if ($op == 'list') {
+    include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
+    $hlman =& xoops_getmodulehandler('headline');;
+    $headlines =& $hlman->getObjects();
+    $count = count($headlines);
+    xoops_cp_header();
+    echo "<h4>"._AM_HEADLINES."</h4>";
+    echo '<form name="xoopsheadline_form" action="index.php" method="post"><table><tr><td>'._AM_SITENAME.'</td><td>'._AM_CACHETIME.'</td><td>'._AM_ENCODING.'</td><td>'._AM_DISPLAY.'</td><td>'._AM_ASBLOCK.'</td><td>'._AM_ORDER.'</td><td>&nbsp;</td></tr>';
+    for ($i = 0; $i < $count; $i++) {
+        echo '<tr><td>'.$headlines[$i]->getVar('headline_name').'</td>
+        <td><select name="headline_cachetime[]">';
+        $cachetime = array('3600' => sprintf(_HOUR, 1), '18000' => sprintf(_HOURS, 5), '86400' => sprintf(_DAY, 1), '259200' => sprintf(_DAYS, 3), '604800' => sprintf(_WEEK, 1), '2592000' => sprintf(_MONTH, 1));
+        foreach ($cachetime as $value => $name) {
+            echo '<option value="'.$value.'"';
+            if ($value == $headlines[$i]->getVar('headline_cachetime')) {
+                echo ' selected="selecetd"';
+            }
+            echo '>'.$name.'</option>';
+        }
+        echo '</select></td>
+        <td><select name="headline_encoding[]">';
+        $encodings = array('utf-8' => 'UTF-8', 'iso-8859-1' => 'ISO-8859-1', 'us-ascii' => 'US-ASCII');
+        foreach ($encodings as $value => $name) {
+            echo '<option value="'.$value.'"';
+            if ($value == $headlines[$i]->getVar('headline_encoding')) {
+                echo ' selected="selecetd"';
+            }
+            echo '>'.$name.'</option>';
+        }
+        echo '</select></td>';
+        echo '<td><input type="checkbox" value="1" name="headline_display['.$headlines[$i]->getVar('headline_id').']"';
+        if (1 == $headlines[$i]->getVar('headline_display')) {
+            echo ' checked="checked"';
+        }
+        echo ' /></td>';
+        echo '<td><input type="checkbox" value="1" name="headline_asblock['.$headlines[$i]->getVar('headline_id').']"';
+        if (1 == $headlines[$i]->getVar('headline_asblock')) {
+            echo ' checked="checked"';
+        }
+        echo ' /></td>';
+        echo '<td><input type="text" maxlength="3" size="4" name="headline_weight[]" value="'.$headlines[$i]->getVar('headline_weight').'" /><td><a href="index.php?op=edit&amp;headline_id='.$headlines[$i]->getVar('headline_id').'">'._EDIT.'</a>&nbsp;<a href="index.php?op=delete&amp;headline_id='.$headlines[$i]->getVar('headline_id').'">'._DELETE.'</a><input type="hidden" name="headline_id[]" value="'.$headlines[$i]->getVar('headline_id').'" /></td></tr>';
+    }
+    echo '</table><div style="text-align:center"><input type="hidden" name="op" value="update" /><input type="submit" name="headline_submit" value="'._SUBMIT.'" /></div></form>';
+    $form = new XoopsThemeForm(_AM_ADDHEADL, 'xoopsheadline_form_new', 'index.php');
+    $form->addElement(new XoopsFormText(_AM_SITENAME, 'headline_name', 50, 255), true);
+    $form->addElement(new XoopsFormText(_AM_URL, 'headline_url', 50, 255, 'http://'), true);
+    $form->addElement(new XoopsFormText(_AM_URLEDFXML, 'headline_rssurl', 50, 255, 'http://'), true);
+    $form->addElement(new XoopsFormText(_AM_ORDER, 'headline_weight', 4, 3, 0));    $enc_sel = new XoopsFormSelect(_AM_ENCODING, 'headline_encoding', 'utf-8');
+    $enc_sel->addOptionArray(array('utf-8' => 'UTF-8', 'iso-8859-1' => 'ISO-8859-1', 'us-ascii' => 'US-ASCII'));
+    $form->addElement($enc_sel);
+    $cache_sel = new XoopsFormSelect(_AM_CACHETIME, 'headline_cachetime', 86400);
+    $cache_sel->addOptionArray(array('3600' => _HOUR, '18000' => sprintf(_HOURS, 5), '86400' => _DAY, '259200' => sprintf(_DAYS, 3), '604800' => _WEEK, '2592000' => _MONTH));
+    $form->addElement($cache_sel);
+
+    $form->insertBreak(_AM_MAINSETT);
+    $form->addElement(new XoopsFormRadioYN(_AM_DISPLAY, 'headline_display', 1, _YES, _NO));
+    $form->addElement(new XoopsFormRadioYN(_AM_DISPIMG, 'headline_mainimg', 0, _YES, _NO));
+    $form->addElement(new XoopsFormRadioYN(_AM_DISPFULL, 'headline_mainfull', 0, _YES, _NO));
+    $mmax_sel = new XoopsFormSelect(_AM_DISPMAX, 'headline_mainmax', 10);
+    $mmax_sel->addOptionArray(array('1' => 1, '5' => 5, '10' => 10, '15' => 15, '20' => 20, '25' => 25, '30' => 30));
+    $form->addElement($mmax_sel);
+
+    $form->insertBreak(_AM_BLOCKSETT);
+    $form->addElement(new XoopsFormRadioYN(_AM_ASBLOCK, 'headline_asblock', 1, _YES, _NO));
+    $form->addElement(new XoopsFormRadioYN(_AM_DISPIMG, 'headline_blockimg', 0, _YES, _NO));
+    $bmax_sel = new XoopsFormSelect(_AM_DISPMAX, 'headline_blockmax', 5);
+    $bmax_sel->addOptionArray(array('1' => 1, '5' => 5, '10' => 10, '15' => 15, '20' => 20, '25' => 25, '30' => 30));
+    $form->addElement($bmax_sel);
+
+
+    $form->insertBreak();
+    $form->addElement(new XoopsFormHidden('op', 'addgo'));
+    $form->addElement(new XoopsFormButton('', 'headline_submit2', _SUBMIT, 'submit'));
+    $form->display();
+    xoops_cp_footer();
+    exit();
+}
+
+if ($op == 'update') {
+    $hlman =& xoops_getmodulehandler('headline');;
+    $i = 0;
+    $msg = '';
+    foreach ($_POST['headline_id'] as $id) {
+        $hl =& $hlman->get($id);
+        if (!is_object($hl)) {
+            $i++;
+            continue;
+        }
+        $headline_display[$id] = empty($_POST['headline_display'][$id]) ? 0 : $_POST['headline_display'][$id];
+        $headline_asblock[$id] = empty($_POST['headline_asblock'][$id]) ? 0 : $_POST['headline_asblock'][$id];
+        $old_cachetime = $hl->getVar('headline_cachetime');
+        $hl->setVar('headline_cachetime', $_POST['headline_cachetime'][$i]);
+        $old_display = $hl->getVar('headline_display');
+        $hl->setVar('headline_display', $headline_display[$id]);
+        $hl->setVar('headline_weight', $_POST['headline_weight'][$i]);
+        $old_asblock = $hl->getVar('headline_asblock');
+        $hl->setVar('headline_asblock', $headline_asblock[$id]);
+        $old_encoding = $hl->getVar('headline_encoding');
+        if (!$hlman->insert($hl)) {
+            $msg .= '<br />'.sprintf(_AM_FAILUPDATE, $hl->getVar('headline_name'));
+        } else {
+            if ($hl->getVar('headline_xml') == '') {
+                $renderer =& xoopsheadline_getrenderer($hl);
+                $renderer->updateCache();
+            }
+        }
+        $i++;
+    }
+    if ($msg != '') {
+        xoops_cp_header();
+        echo "<h4>"._AM_HEADLINES."</h4>";
+        xoops_error($msg);
+        xoops_cp_footer();
+        exit();
+    }
+    redirect_header('index.php', 2, _AM_DBUPDATED);
+}
+
+if ($op == 'addgo') {
+    $hlman =& xoops_getmodulehandler('headline');;
+    $hl =& $hlman->create();
+    $hl->setVar('headline_name', $_POST['headline_name']);
+    $hl->setVar('headline_url', $_POST['headline_url']);
+    $hl->setVar('headline_rssurl', $_POST['headline_rssurl']);
+    $hl->setVar('headline_display', $_POST['headline_display']);
+    $hl->setVar('headline_weight', $_POST['headline_weight']);
+    $hl->setVar('headline_asblock', $_POST['headline_asblock']);
+    $hl->setVar('headline_encoding', $_POST['headline_encoding']);
+    $hl->setVar('headline_cachetime', $_POST['headline_cachetime']);
+    $hl->setVar('headline_mainfull', $_POST['headline_mainfull']);
+    $hl->setVar('headline_mainimg', $_POST['headline_mainimg']);
+    $hl->setVar('headline_mainmax', $_POST['headline_mainmax']);
+    $hl->setVar('headline_blockimg', $_POST['headline_blockimg']);
+    $hl->setVar('headline_blockmax', $_POST['headline_blockmax']);
+    if (!$hlman->insert($hl)) {
+        $msg = sprintf(_AM_FAILUPDATE, $hl->getVar('headline_name'));
+        $msg .= '<br />'.$hl->getErrors();
+        xoops_cp_header();
+        echo "<h4>"._AM_HEADLINES."</h4>";
+        xoops_error($msg);
+        xoops_cp_footer();
+        exit();
+    } else {
+        if ($hl->getVar('headline_xml') == '') {
+            $renderer =& xoopsheadline_getrenderer($hl);
+            $renderer->updateCache();
+        }
+    }
+    redirect_header('index.php', 2, _AM_DBUPDATED);
+}
+
+if ($op == 'edit') {
+
+    if ($headline_id <= 0) {
+        xoops_cp_header();
+        echo "<h4>"._AM_HEADLINES."</h4>";
+        xoops_error(_AM_INVALIDID);
+        xoops_cp_footer();
+        exit();
+    }
+    $hlman =& xoops_getmodulehandler('headline');;
+    $hl =& $hlman->get($headline_id);
+    if (!is_object($hl)) {
+        xoops_cp_header();
+        echo "<h4>"._AM_HEADLINES."</h4>";
+        xoops_error(_AM_OBJECTNG);
+        xoops_cp_footer();
+        exit();
+    }
+    include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
+    $form = new XoopsThemeForm(_AM_EDITHEADL, 'xoopsheadline_form', 'index.php');
+    $form->addElement(new XoopsFormText(_AM_SITENAME, 'headline_name', 50, 255, $hl->getVar('headline_name')), true);
+    $form->addElement(new XoopsFormText(_AM_URL, 'headline_url', 50, 255, $hl->getVar('headline_url')), true);
+    $form->addElement(new XoopsFormText(_AM_URLEDFXML, 'headline_rssurl', 50, 255, $hl->getVar('headline_rssurl')), true);
+    $form->addElement(new XoopsFormText(_AM_ORDER, 'headline_weight', 4, 3, $hl->getVar('headline_weight')));
+    $enc_sel = new XoopsFormSelect(_AM_ENCODING, 'headline_encoding', $hl->getVar('headline_encoding'));
+    $enc_sel->addOptionArray(array('utf-8' => 'UTF-8', 'iso-8859-1' => 'ISO-8859-1', 'us-ascii' => 'US-ASCII'));
+    $form->addElement($enc_sel);
+    $cache_sel = new XoopsFormSelect(_AM_CACHETIME, 'headline_cachetime', $hl->getVar('headline_cachetime'));
+    $cache_sel->addOptionArray(array('3600' => _HOUR, '18000' => sprintf(_HOURS, 5), '86400' => _DAY, '259200' => sprintf(_DAYS, 3), '604800' => _WEEK, '2592000' => _MONTH));
+    $form->addElement($cache_sel);
+
+    $form->insertBreak(_AM_MAINSETT);
+    $form->addElement(new XoopsFormRadioYN(_AM_DISPLAY, 'headline_display', $hl->getVar('headline_display'), _YES, _NO));
+    $form->addElement(new XoopsFormRadioYN(_AM_DISPIMG, 'headline_mainimg', $hl->getVar('headline_mainimg'), _YES, _NO));
+    $form->addElement(new XoopsFormRadioYN(_AM_DISPFULL, 'headline_mainfull', $hl->getVar('headline_mainfull'), _YES, _NO));
+    $mmax_sel = new XoopsFormSelect(_AM_DISPMAX, 'headline_mainmax', $hl->getVar('headline_mainmax'));
+    $mmax_sel->addOptionArray(array('1' => 1, '5' => 5, '10' => 10, '15' => 15, '20' => 20, '25' => 25, '30' => 30));
+    $form->addElement($mmax_sel);
+
+    $form->insertBreak(_AM_BLOCKSETT);
+    $form->addElement(new XoopsFormRadioYN(_AM_ASBLOCK, 'headline_asblock', $hl->getVar('headline_asblock'), _YES, _NO));
+    $form->addElement(new XoopsFormRadioYN(_AM_DISPIMG, 'headline_blockimg', $hl->getVar('headline_blockimg'), _YES, _NO));
+    $bmax_sel = new XoopsFormSelect(_AM_DISPMAX, 'headline_blockmax', $hl->getVar('headline_blockmax'));
+    $bmax_sel->addOptionArray(array('1' => 1, '5' => 5, '10' => 10, '15' => 15, '20' => 20, '25' => 25, '30' => 30));
+    $form->addElement($bmax_sel);
+    $form->insertBreak();
+    $form->addElement(new XoopsFormHidden('headline_id', $hl->getVar('headline_id')));
+    $form->addElement(new XoopsFormHidden('op', 'editgo'));
+    $form->addElement(new XoopsFormButton('', 'headline_submit', _SUBMIT, 'submit'));
+    xoops_cp_header();
+    echo "<h4>"._AM_HEADLINES."</h4><br />";
+    //echo '<a href="index.php">'. _AM_HLMAIN .'</a>&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;'.$hl->getVar('headline_name').'<br /><br />';
+    $form->display();
+    xoops_cp_footer();
+    exit();
+}
+
+if ($op == 'editgo') {
+    $headline_id = !empty($_POST['headline_id']) ? intval($_POST['headline_id']) : 0;
+    if ($headline_id <= 0) {
+        xoops_cp_header();
+        echo "<h4>"._AM_HEADLINES."</h4>";
+        xoops_error(_AM_INVALIDID);
+        xoops_cp_footer();
+        exit();
+    }
+    $hlman =& xoops_getmodulehandler('headline');;
+    $hl =& $hlman->get($headline_id);
+    if (!is_object($hl)) {
+        xoops_cp_header();
+        echo "<h4>"._AM_HEADLINES."</h4>";
+        xoops_error(_AM_OBJECTNG);
+        xoops_cp_footer();
+        exit();
+    }
+    $hl->setVar('headline_name', $_POST['headline_name']);
+    $hl->setVar('headline_url', $_POST['headline_url']);
+    $hl->setVar('headline_encoding', $_POST['headline_encoding']);
+    $hl->setVar('headline_rssurl', $_POST['headline_rssurl']);
+    $hl->setVar('headline_display', $_POST['headline_display']);
+    $hl->setVar('headline_weight', $_POST['headline_weight']);
+    $hl->setVar('headline_asblock', $_POST['headline_asblock']);
+    $hl->setVar('headline_cachetime', $_POST['headline_cachetime']);
+    $hl->setVar('headline_mainfull', $_POST['headline_mainfull']);
+    $hl->setVar('headline_mainimg', $_POST['headline_mainimg']);
+    $hl->setVar('headline_mainmax', $_POST['headline_mainmax']);
+    $hl->setVar('headline_blockimg', $_POST['headline_blockimg']);
+    $hl->setVar('headline_blockmax', $_POST['headline_blockmax']);
+
+    if (!$res = $hlman->insert($hl)) {
+        $msg = sprintf(_AM_FAILUPDATE, $hl->getVar('headline_name'));
+        $msg .= '<br />'.$hl->getHtmlErrors();
+        xoops_cp_header();
+        echo "<h4>"._AM_HEADLINES."</h4>";
+        xoops_error($msg);
+        xoops_cp_footer();
+        exit();
+    } else {
+        if ($hl->getVar('headline_xml') == '') {
+            $renderer =& xoopsheadline_getrenderer($hl);
+            $renderer->updateCache();
+        }
+    }
+    redirect_header('index.php', 2, _AM_DBUPDATED);
+}
+
+if ($op == 'delete') {
+    if ($headline_id <= 0) {
+        xoops_cp_header();
+        echo "<h4>"._AM_HEADLINES."</h4>";
+        xoops_error(_AM_INVALIDID);
+        xoops_cp_footer();
+        exit();
+    }
+    $hlman =& xoops_getmodulehandler('headline');;
+    $hl =& $hlman->get($headline_id);
+    if (!is_object($hl)) {
+        xoops_cp_header();
+        echo "<h4>"._AM_HEADLINES."</h4>";
+        xoops_error(_AM_OBJECTNG);
+        xoops_cp_footer();
+        exit();
+    }
+    xoops_cp_header();
+    $name = $hl->getVar('headline_name');
+    echo "<h4>"._AM_HEADLINES."</h4>";
+    xoops_confirm(array('op' => 'deletego', 'headline_id' => $hl->getVar('headline_id')), 'index.php', sprintf(_AM_WANTDEL, $name));
+    xoops_cp_footer();
+    exit();
+}
+
+if ($op == 'deletego') {
+    $headline_id = !empty($_POST['headline_id']) ? intval($_POST['headline_id']) : 0;
+    if ($headline_id <= 0) {
+        xoops_cp_header();
+        echo "<h4>"._AM_HEADLINES."</h4>";
+        xoops_error(_AM_INVALIDID);
+        xoops_cp_footer();
+        exit();
+    }
+    $hlman =& xoops_getmodulehandler('headline');;
+    $hl =& $hlman->get($headline_id);
+    if (!is_object($hl)) {
+        xoops_cp_header();
+        echo "<h4>"._AM_HEADLINES."</h4>";
+        xoops_error(_AM_OBJECTNG);
+        xoops_cp_footer();
+        exit();
+    }
+    if (!$hlman->delete($hl)) {
+        xoops_cp_header();
+        echo "<h4>"._AM_HEADLINES."</h4>";
+        xoops_error(sprintf(_AM_FAILDELETE, $hl->getVar('headline_name')));
+        xoops_cp_footer();
+        exit();
+    }
+    redirect_header('index.php', 2, _AM_DBUPDATED);
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/admin/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/admin/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/admin/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/admin/menu.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/admin/menu.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/admin/menu.php	(revision 405)
@@ -0,0 +1,29 @@
+<?php
+// $Id: menu.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+$adminmenu[0]['title'] = _MI_HEADLINES_ADMENU1;
+$adminmenu[0]['link'] = "admin/index.php";
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/blocks/headline.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/blocks/headline.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/blocks/headline.php	(revision 405)
@@ -0,0 +1,48 @@
+<?php
+// $Id: headline.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ // 
+include_once XOOPS_ROOT_PATH.'/modules/xoopsheadline/include/functions.php';
+
+function b_xoopsheadline_show($options)
+{
+	global $xoopsConfig;
+	$block = array();
+	$hlman =& xoops_getmodulehandler('headline', 'xoopsheadline');
+	$headlines =& $hlman->getObjects(new Criteria('headline_asblock', 1));
+	$count = count($headlines);
+	for ($i = 0; $i < $count; $i++) {
+		$renderer =& xoopsheadline_getrenderer($headlines[$i]);
+		if (!$renderer->renderBlock()) {
+			if ($xoopsConfig['debug_mode'] == 2) {
+				$block['feeds'][] = sprintf(_HL_FAILGET, $headlines[$i]->getVar('headline_name')).'<br />'.$renderer->getErrors();
+			}
+			continue;
+		}
+		$block['feeds'][] = $renderer->getBlock();
+	}
+	return $block;
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/blocks/headline_block.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/blocks/headline_block.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/blocks/headline_block.html	(revision 405)
@@ -0,0 +1,12 @@
+<a href="<{$site_url}>" target="_blank"><{$site_name}></a><br />
+<{if $image.url != ""}>
+  <img src="<{$image.url}>" width="<{$image.width|default:88}>" height="<{$image.height|default:31}>" alt="<{$image.title}>" /><br />
+<{/if}>
+
+<ul>
+<{section name=i loop=$items}>
+  <{if $items[i].title != ""}>
+  <li><a href="<{$xoops_url}>/modules/xoopsheadline/index.php?id=<{$site_id}>#<{$items[i].link}>"><{$items[i].title}></a></li>
+  <{/if}>
+<{/section}>
+</ul>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/blocks/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/blocks/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/blocks/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/index.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/index.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/index.php	(revision 405)
@@ -0,0 +1,57 @@
+<?php
+// $Id: index.php,v 1.3 2005/09/04 20:46:12 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+include '../../mainfile.php';
+include 'include/functions.php';
+$hlman =& xoops_getmodulehandler('headline');;
+$hlid = isset($_GET['id']) ? intval($_GET['id']) : 0;
+$xoopsOption['template_main'] = 'xoopsheadline_index.html';
+include XOOPS_ROOT_PATH.'/header.php';
+$headlines =& $hlman->getObjects(new Criteria('headline_display', 1));
+$count = count($headlines);
+for ($i = 0; $i < $count; $i++) {
+	$xoopsTpl->append('feed_sites', array('id' => $headlines[$i]->getVar('headline_id'), 'name' => $headlines[$i]->getVar('headline_name')));
+}
+$xoopsTpl->assign('lang_headlines', _HL_HEADLINES);
+if ($hlid == 0) {
+	$hlid = $headlines[0]->getVar('headline_id');
+}
+if ($hlid > 0) {
+	$headline =& $hlman->get($hlid);
+	if (is_object($headline)) {
+		$renderer =& xoopsheadline_getrenderer($headline);
+		if (!$renderer->renderFeed()) {
+			if ($xoopsConfig['debug_mode'] == 2) {
+				$xoopsTpl->assign('headline', '<p>'.sprintf(_HL_FAILGET, $headline->getVar('headline_name')).'<br />'.$renderer->getErrors().'</p>');
+			}
+		} else {
+			$xoopsTpl->assign('headline', $renderer->getFeed());
+		}
+	}
+}
+include XOOPS_ROOT_PATH.'/footer.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/templates/xoopsheadline_feed.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/templates/xoopsheadline_feed.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/templates/xoopsheadline_feed.html	(revision 405)
@@ -0,0 +1,68 @@
+<table cellspacing="1" class="outer">
+  <tr>
+    <th colspan="3"><a href="<{$channel.link}>" target="_blank"><{$channel.title}></a></th>
+  </tr>
+  <tr>
+    <td width="25%" rowspan="6">
+      <{if $image.url != ""}>
+        <img src="<{$image.url}>" width="<{$image.width|default:88}>" height="<{$image.height|default:31}>" alt="<{$image.title}>" />
+      <{else}>
+        &nbsp;
+      <{/if}>
+    </td>
+    <td valign="top" class="head"><{$lang_lastbuild}></td>
+    <td class="odd"><{$channel.lastbuilddate|default:"&nbsp;"}></td>
+  </tr>
+  <tr>
+    <td valign="top" class="head"><{$lang_description}></td>
+    <td class="even"><{$channel.description|default:"&nbsp;"}></td>
+  </tr>
+  <tr>
+    <td valign="top" class="head"><{$lang_webmaster}></td>
+    <td class="odd"><{$channel.webmaster|default:"&nbsp;"}></td>
+  </tr>
+  <tr>
+    <td valign="top" class="head"><{$lang_category}></td>
+    <td class="even"><{$channel.category|default:"&nbsp;"}></td>
+  </tr>
+  <tr>
+    <td valign="top" class="head"><{$lang_generator}></td>
+    <td class="odd"><{$channel.generator|default:"&nbsp;"}></td>
+  </tr>
+  <tr>
+    <td valign="top" class="head"><{$lang_language}></td>
+    <td class="even"><{$channel.language|default:"&nbsp;"}></td>
+  </tr>
+  <{section name=i loop=$items}>
+  <{if $items[i].title != ""}>
+  <tr class="head">
+    <td colspan="3"><a id="<{$items[i].link}>"></a><a href="<{$items[i].link}>" target="_blank"><{$items[i].title}></a></td>
+  </tr>
+  <{/if}>
+  <{if $show_full == true}>
+    <{if $items[i].category != ""}>
+    <tr>
+      <td class="even" valign="top"><{$lang_category}></td>
+      <td class="odd" colspan="2"><{$items[i].category}></td>
+    </tr>
+    <{/if}>
+    <{if $items[i].pubdate != ""}>
+    <tr>
+      <td class="even" valign="top"><{$lang_pubdate}>:</td>
+      <td class="odd" colspan="2"><{$items[i].pubdate}></td>
+    </tr>
+    <{/if}>
+    <{if $items[i].description != ""}>
+    <tr>
+      <td class="even" valign="top"><{$lang_description}>:</td>
+      <td colspan="2" class="odd"><{$items[i].description}><{if $items[i].guid != ""}>&nbsp;&nbsp;<a href="<{$items[i].guid}>" target="_blank"><{$lang_more}></a><{/if}></td>
+    </tr>
+    <{elseif $items[i].guid != ""}>
+    <tr>
+      <td class="even" valign="top"></td>
+      <td colspan="2" class="odd"><a href="<{$items[i].guid}>" target="_blank"><{$lang_more}></a></td>
+    </tr>
+    <{/if}>
+  <{/if}>
+  <{/section}>
+</table>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/templates/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/templates/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/templates/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/templates/xoopsheadline_index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/templates/xoopsheadline_index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/templates/xoopsheadline_index.html	(revision 405)
@@ -0,0 +1,12 @@
+<h4 style="text-align:left;"><{$lang_headlines}></h4>
+<div style='padding: 1px; text-align: left;'>
+      <ul style="list-style-image:url(images/rss.gif);">
+      <!-- start site loop -->
+      <{foreach item=site from=$feed_sites}>
+        <li>&nbsp;<a href="<{$xoops_url}>/modules/xoopsheadline/index.php?id=<{$site.id}>"><{$site.name}></a></li>
+      <{/foreach}>
+      <!-- end site loop -->
+      </ul>
+</div>
+
+<{$headline}>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/templates/blocks/xoopsheadline_block_rss.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/templates/blocks/xoopsheadline_block_rss.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/templates/blocks/xoopsheadline_block_rss.html	(revision 405)
@@ -0,0 +1,3 @@
+<{foreach item=feed from=$block.feeds}>
+<p><{$feed}></p>
+<{/foreach}>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/templates/blocks/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/templates/blocks/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/templates/blocks/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/sql/mysql.sql
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/sql/mysql.sql	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/sql/mysql.sql	(revision 405)
@@ -0,0 +1,23 @@
+CREATE TABLE xoopsheadline (
+  headline_id smallint(3) unsigned NOT NULL auto_increment,
+  headline_name varchar(255) NOT NULL default '',
+  headline_url varchar(255) NOT NULL default '',
+  headline_rssurl varchar(255) NOT NULL default '',
+  headline_encoding varchar(15) NOT NULL default '',
+  headline_cachetime mediumint(8) unsigned NOT NULL default '3600',
+  headline_asblock tinyint(1) unsigned NOT NULL default '0',
+  headline_display tinyint(1) unsigned NOT NULL default '0',
+  headline_weight smallint(3) unsigned NOT NULL default '0',
+  headline_mainfull tinyint(1) unsigned NOT NULL default '1',
+  headline_mainimg tinyint(1) unsigned NOT NULL default '1',
+  headline_mainmax tinyint(2) unsigned NOT NULL default '10',
+  headline_blockimg tinyint(1) unsigned NOT NULL default '0',
+  headline_blockmax tinyint(2) unsigned NOT NULL default '10',
+  headline_xml text NOT NULL default '',
+  headline_updated int(10) NOT NULL default'0',
+  PRIMARY KEY  (headline_id)
+) TYPE=MyISAM;
+
+
+
+INSERT INTO xoopsheadline VALUES (1, 'XOOPS Official Website', 'http://www.xoops.org/', 'http://www.xoops.org/backend.php', 'ISO-8859-1', 86400, 0, 1, 0, 1, 1, 10, 0, 10, '', 0);
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/include/functions.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/include/functions.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/include/functions.php	(revision 405)
@@ -0,0 +1,14 @@
+<?php
+
+function &xoopsheadline_getrenderer(&$headline)
+{
+	include_once XOOPS_ROOT_PATH.'/modules/xoopsheadline/class/headlinerenderer.php';
+	if (file_exists(XOOPS_ROOT_PATH.'/modules/xoopsheadline/language/'.$GLOBALS['xoopsConfig']['language'].'/headlinerenderer.php')) {
+		include_once XOOPS_ROOT_PATH.'/modules/xoopsheadline/language/'.$GLOBALS['xoopsConfig']['language'].'/headlinerenderer.php';
+		if (class_exists('XoopsHeadlineRendererLocal')) {
+			return new XoopsHeadlineRendererLocal($headline);
+		}
+	}
+	return new XoopsHeadlineRenderer($headline);
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/language/japanese/admin.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/language/japanese/admin.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/language/japanese/admin.php	(revision 405)
@@ -0,0 +1,27 @@
+<?php
+// $Id: admin.php,v 1.4 2005/08/03 12:40:01 onokazu Exp $
+//%%%%%%        Admin Module Name  Headlines         %%%%%
+define('_AM_DBUPDATED','¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò¹¹¿·¤·¤Þ¤·¤¿!');
+define('_AM_HEADLINES','¥Ø¥Ã¥É¥é¥¤¥óÀßÄê');
+define('_AM_HLMAIN','¥Ø¥Ã¥É¥é¥¤¥ó¥á¥¤¥ó');
+define('_AM_SITENAME','¥µ¥¤¥ÈÌ¾');
+define('_AM_URL','¥µ¥¤¥ÈURL');
+define('_AM_ORDER', 'É½¼¨½ç');
+define('_AM_ENCODING', 'RSS¥¨¥ó¥³¡¼¥É');
+define('_AM_CACHETIME', '¥­¥ã¥Ã¥·¥å¥¿¥¤¥à');
+define('_AM_MAINSETT', '¥á¥¤¥ó¥Ú¡¼¥¸¤ÎÀßÄê');
+define('_AM_BLOCKSETT', '¥Ö¥í¥Ã¥¯¤ÎÀßÄê');
+define('_AM_DISPLAY', '¥á¥¤¥ó¥Ú¡¼¥¸¤ËÉ½¼¨');
+define('_AM_DISPIMG', '²èÁü¤òÉ½¼¨');
+define('_AM_DISPFULL', '¤¹¤Ù¤Æ¤òÉ½¼¨');
+define('_AM_DISPMAX', 'ºÇÂçÉ½¼¨·ï¿ô');
+define('_AM_ASBLOCK', '¥Ö¥í¥Ã¥¯¤ËÉ½¼¨');
+define('_AM_ADDHEADL','¥Ø¥Ã¥É¥é¥¤¥ó¤Î¿·µ¬ÄÉ²Ã');
+define('_AM_URLEDFXML','RDF/RSS¥Õ¥¡¥¤¥ë¤ÎURL');
+define('_AM_EDITHEADL','¥Ø¥Ã¥É¥é¥¤¥ó¤ÎÊÔ½¸');
+define('_AM_WANTDEL','ËÜÅö¤Ë¤³¤Î¥Ø¥Ã¥É¥é¥¤¥ó¤òºï½ü¤·¤Æ¤â¤è¤í¤·¤¤¤Ç¤¹¤«¡©<br /> ¥µ¥¤¥ÈÌ¾¡§ %s');
+define('_AM_INVALIDID', 'ID¤¬Àµ¤·¤¯¤¢¤ê¤Þ¤»¤ó');
+define('_AM_OBJECTNG', '¥ª¥Ö¥¸¥§¥¯¥È¤¬Â¸ºß¤·¤Þ¤»¤ó');
+define('_AM_FAILUPDATE', '¥Ø¥Ã¥É¥é¥¤¥ó¤ÎÊÝÂ¸¤¬¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿<br /> %s');
+define('_AM_FAILDELETE', '¥Ø¥Ã¥É¥é¥¤¥ó¤Îºï½ü¤¬¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿<br /> %s');
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/language/japanese/modinfo.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/language/japanese/modinfo.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/language/japanese/modinfo.php	(revision 405)
@@ -0,0 +1,16 @@
+<?php
+// $Id: modinfo.php,v 1.2 2005/03/18 13:00:59 onokazu Exp $
+// Module Info
+
+// The name of this module
+define("_MI_HEADLINES_NAME","¥Ø¥Ã¥É¥é¥¤¥ó");
+
+// A brief description of this module
+define("_MI_HEADLINES_DESC","RSS/XML·Á¼°¤Î¥Ë¥å¡¼¥¹µ­»ö¤ò¥Ö¥í¥Ã¥¯Æâ¤ËÉ½¼¨¤·¤Þ¤¹");
+
+// Names of blocks for this module (Not all module has blocks)
+define("_MI_HEADLINES_BNAME","¥Ø¥Ã¥É¥é¥¤¥ó¥Ö¥í¥Ã¥¯");
+
+// Names of admin menu items
+define("_MI_HEADLINES_ADMENU1","¥Ø¥Ã¥É¥é¥¤¥ó°ìÍ÷");
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/language/japanese/blocks.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/language/japanese/blocks.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/language/japanese/blocks.php	(revision 405)
@@ -0,0 +1,9 @@
+<?php
+// $Id: blocks.php,v 1.2 2005/03/18 13:00:59 onokazu Exp $
+// Blocks
+//define('_MB_HEADLINES_TITLE','¥Ø¥Ã¥É¥é¥¤¥ó');
+
+define('_MB_HEADLINES_DISPLAYF', '¥µ¥¤¥È¥í¥´¤ÎÉ½¼¨');
+
+define('_MB_HEADLINES_MAXITEM', '¤½¤ì¤¾¤ì¤Îµ­»ö¤ÎÉ½¼¨·ï¿ô');
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/language/japanese/headlinerenderer.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/language/japanese/headlinerenderer.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/language/japanese/headlinerenderer.php	(revision 405)
@@ -0,0 +1,45 @@
+<?php
+// $Id: headlinerenderer.php,v 1.2 2005/03/18 13:00:59 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+if (function_exists('mb_convert_encoding')) {
+	class XoopsHeadlineRendererLocal extends XoopsHeadlineRenderer
+	{
+		function convertFromUtf8(&$value, $key)
+		{
+			$value = is_string($value) ? mb_convert_encoding($value, "EUC-JP", "auto"): $value;
+		}
+
+		function &convertToUtf8(&$xmlfile)
+		{
+			if (preg_match("/^<\?xml .* encoding=(['\"]?)(Shift_JIS|euc-jp)\\1/i", $xmlfile)) {
+				$xmlfile = mb_convert_encoding(preg_replace("/ encoding=(['\"]?)(Shift_JIS|euc-jp)\\1/i", ' encoding="utf-8"', $xmlfile), "UTF-8", "AUTO");
+            }
+			return $xmlfile;
+        }
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/language/japanese/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/language/japanese/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/language/japanese/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/language/japanese/main.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/language/japanese/main.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/language/japanese/main.php	(revision 405)
@@ -0,0 +1,14 @@
+<?php
+// $Id: main.php,v 1.2 2005/03/18 13:00:59 onokazu Exp $
+define('_HL_LASTBUILD', 'ºÇ½ª¹¹¿·Æü');
+define('_HL_LANGUAGE', '¸À¸ì');
+define('_HL_DESCRIPTION', '¥µ¥¤¥È'); //description
+define('_HL_WEBMASTER', '¥¦¥§¥Ö¥Þ¥¹¥¿¡¼');
+define('_HL_CATEGORY', '¥«¥Æ¥´¥ê');
+define('_HL_GENERATOR', 'ºîÀ®');
+define('_HL_TITLE', 'ÂêÌ¾');
+define('_HL_PUBDATE', '¸ø³«');
+define('_HL_FAILGET', '%s ¤«¤é¤Î RSS¤Î¼èÆÀ¤¬¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£');
+define('_HL_GOTOTOP', '¥È¥Ã¥×¤ËÌá¤ë');
+define('_HL_HEADLINES', '¥Ø¥Ã¥É¥é¥¤¥ó');
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/language/english/blocks.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/language/english/blocks.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/language/english/blocks.php	(revision 405)
@@ -0,0 +1,7 @@
+<?php
+// $Id: blocks.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+// Blocks
+
+define('_MB_HEADLINES_DISPLAYF', 'Display site logo');
+define('_MB_HEADLINES_MAXITEM', 'Max number of items for each headline');
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/language/english/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/language/english/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/language/english/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/language/english/main.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/language/english/main.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/language/english/main.php	(revision 405)
@@ -0,0 +1,14 @@
+<?php
+// $Id: main.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+define('_HL_LASTBUILD', 'Updated');
+define('_HL_LANGUAGE', 'Language');
+define('_HL_DESCRIPTION', 'Description');
+define('_HL_WEBMASTER', 'Webmaster');
+define('_HL_CATEGORY', 'Category');
+define('_HL_GENERATOR', 'Generator');
+define('_HL_TITLE', 'Title');
+define('_HL_PUBDATE', 'Published');
+define('_HL_FAILGET', 'Failed retrieving RSS feed from %s');
+define('_HL_GOTOTOP', 'Goto Top');
+define('_HL_HEADLINES', 'Headlines');
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/language/english/admin.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/language/english/admin.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/language/english/admin.php	(revision 405)
@@ -0,0 +1,27 @@
+<?php
+// $Id: admin.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+//%%%%%%        Admin Module Name  Headlines         %%%%%
+define('_AM_DBUPDATED','Database Updated Successfully!');
+define('_AM_HEADLINES','Headlines Configuration');
+define('_AM_HLMAIN','Headline Main');
+define('_AM_SITENAME','Site Name');
+define('_AM_URL','URL');
+define('_AM_ORDER', 'Order');
+define('_AM_ENCODING', 'RSS Encoding');
+define('_AM_CACHETIME', 'Cache Time');
+define('_AM_MAINSETT', 'Main Page Settings');
+define('_AM_BLOCKSETT', 'Block Settings');
+define('_AM_DISPLAY', 'Display in main page');
+define('_AM_DISPIMG', 'Display image');
+define('_AM_DISPFULL', 'Display in full view');
+define('_AM_DISPMAX', 'Max items to display');
+define('_AM_ASBLOCK', 'Display in block');
+define('_AM_ADDHEADL','Add Headline');
+define('_AM_URLEDFXML','URL of RDF/RSS file');
+define('_AM_EDITHEADL','Edit Headline');
+define('_AM_WANTDEL','Are you sure you want to delete headline for %s?');
+define('_AM_INVALIDID', 'Invalid ID');
+define('_AM_OBJECTNG', 'Object does not exist');
+define('_AM_FAILUPDATE', 'Failed saving data to database for headline %s');
+define('_AM_FAILDELETE', 'Failed deleting data from database for headline %s');
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/language/english/modinfo.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/language/english/modinfo.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/language/english/modinfo.php	(revision 405)
@@ -0,0 +1,16 @@
+<?php
+// $Id: modinfo.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+// Module Info
+
+// The name of this module
+define("_MI_HEADLINES_NAME","Headlines");
+
+// A brief description of this module
+define("_MI_HEADLINES_DESC","Displayes RSS/XML Newsfeed from other sites");
+
+// Names of blocks for this module (Not all module has blocks)
+define("_MI_HEADLINES_BNAME","Headlines");
+
+// Names of admin menu items
+define("_MI_HEADLINES_ADMENU1","List Headlines");
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/language/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/language/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/language/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/xoops_version.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/xoops_version.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/xoops_version.php	(revision 405)
@@ -0,0 +1,66 @@
+<?php
+// $Id: xoops_version.php,v 1.2 2005/03/18 12:52:49 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+$modversion['name'] = _MI_HEADLINES_NAME;
+$modversion['version'] = 1.00;
+$modversion['description'] = _MI_HEADLINES_DESC;
+$modversion['author'] = "Kazumi Ono<br>( http://www.xoops.org/ http://jp.xoops.org/ http://www.myweb.ne.jp/ )";
+$modversion['credits'] = "The XOOPS Project";
+$modversion['help'] = "headlines.html";
+$modversion['license'] = "GPL see LICENSE";
+$modversion['official'] = 1;
+$modversion['image'] = "images/headline_slogo.png";
+$modversion['dirname'] = "xoopsheadline";
+
+// Sql file (must contain sql generated by phpMyAdmin or phpPgAdmin)
+// All tables should not have any prefix!
+$modversion['sqlfile']['mysql'] = "sql/mysql.sql";
+//$modversion['sqlfile']['postgresql'] = "sql/pgsql.sql";
+
+// Tables created by sql file (without prefix!)
+$modversion['tables'][0] = "xoopsheadline";
+
+// Admin things
+$modversion['hasAdmin'] = 1;
+$modversion['adminindex'] = "admin/index.php";
+$modversion['adminmenu'] = "admin/menu.php";
+
+// Blocks
+$modversion['blocks'][1]['file'] = "headline.php";
+$modversion['blocks'][1]['name'] = _MI_HEADLINES_BNAME;
+$modversion['blocks'][1]['description'] = "Shows headline news via RDF/RSS news feed";
+$modversion['blocks'][1]['show_func'] = 'b_xoopsheadline_show';
+$modversion['blocks'][1]['template'] = 'xoopsheadline_block_rss.html';
+
+// Menu
+$modversion['hasMain'] = 1;
+
+// Templates
+$modversion['templates'][1]['file'] = 'xoopsheadline_index.html';
+$modversion['templates'][1]['description'] = '';
+$modversion['templates'][2]['file'] = 'xoopsheadline_feed.html';
+$modversion['templates'][2]['description'] = '';
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/class/headline.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/class/headline.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/class/headline.php	(revision 405)
@@ -0,0 +1,181 @@
+<?php
+// $Id: headline.php,v 1.4 2005/08/03 12:40:01 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+class XoopsheadlineHeadline extends XoopsObject
+{
+
+    function XoopsheadlineHeadline()
+    {
+        $this->XoopsObject();
+        $this->initVar('headline_id', XOBJ_DTYPE_INT, null, false);
+        $this->initVar('headline_name', XOBJ_DTYPE_TXTBOX, null, true, 255);
+        $this->initVar('headline_url', XOBJ_DTYPE_TXTBOX, null, true, 255);
+        $this->initVar('headline_rssurl', XOBJ_DTYPE_TXTBOX, null, true, 255);
+        $this->initVar('headline_cachetime', XOBJ_DTYPE_INT, 600, false);
+        $this->initVar('headline_asblock', XOBJ_DTYPE_INT, 0, false);
+        $this->initVar('headline_display', XOBJ_DTYPE_INT, 0, false);
+        $this->initVar('headline_encoding', XOBJ_DTYPE_OTHER, null, false);
+        $this->initVar('headline_weight', XOBJ_DTYPE_INT, 0, false);
+        $this->initVar('headline_mainimg', XOBJ_DTYPE_INT, 1, false);
+        $this->initVar('headline_mainfull', XOBJ_DTYPE_INT, 1, false);
+        $this->initVar('headline_mainmax', XOBJ_DTYPE_INT, 10, false);
+        $this->initVar('headline_blockimg', XOBJ_DTYPE_INT, 0, false);
+        $this->initVar('headline_blockmax', XOBJ_DTYPE_INT, 10, false);
+        $this->initVar('headline_xml', XOBJ_DTYPE_SOURCE, null, false);
+        $this->initVar('headline_updated', XOBJ_DTYPE_INT, 0, false);
+    }
+
+    function cacheExpired()
+    {
+        if (time() - $this->getVar('headline_updated') > $this->getVar('headline_cachetime')) {
+            return true;
+        }
+        return false;
+    }
+}
+
+class xoopsheadlineHeadlineHandler
+{
+    var $db;
+
+    function XoopsheadlineHeadlineHandler(&$db)
+    {
+        $this->db =& $db;
+    }
+
+    function &getInstance(&$db)
+    {
+        static $instance;
+        if (!isset($instance)) {
+            $instance = new XoopsheadlineHeadlineHandler($db);
+        }
+        return $instance;
+    }
+
+    function &create()
+    {
+        return new XoopsheadlineHeadline();
+    }
+
+    function &get($id)
+    {
+        $id = intval($id);
+        if ($id > 0) {
+            $sql = 'SELECT * FROM '.$this->db->prefix('xoopsheadline').' WHERE headline_id='.$id;
+            if (!$result = $this->db->query($sql)) {
+                return false;
+            }
+            $numrows = $this->db->getRowsNum($result);
+            if ($numrows == 1) {
+                $headline = new XoopsheadlineHeadline();
+                $headline->assignVars($this->db->fetchArray($result));
+                return $headline;
+            }
+        }
+        return false;
+    }
+
+    function insert(&$headline)
+    {
+        if (strtolower(get_class($headline)) != 'xoopsheadlineheadline') {
+            return false;
+        }
+        if (!$headline->cleanVars()) {
+            return false;
+        }
+        foreach ($headline->cleanVars as $k => $v) {
+            ${$k} = $v;
+        }
+        if (empty($headline_id)) {
+            $headline_id = $this->db->genId('xoopsheadline_headline_id_seq');
+            $sql = 'INSERT INTO '.$this->db->prefix('xoopsheadline').' (headline_id, headline_name, headline_url, headline_rssurl, headline_encoding, headline_cachetime, headline_asblock, headline_display, headline_weight, headline_mainimg, headline_mainfull, headline_mainmax, headline_blockimg, headline_blockmax, headline_xml, headline_updated) VALUES ('.$headline_id.', '.$this->db->quoteString($headline_name).', '.$this->db->quoteString($headline_url).', '.$this->db->quoteString($headline_rssurl).', '.$this->db->quoteString($headline_encoding).', '.$headline_cachetime.', '.$headline_asblock.', '.$headline_display.', '.$headline_weight.', '.$headline_mainimg.', '.$headline_mainfull.', '.$headline_mainmax.', '.$headline_blockimg.', '.$headline_blockmax.', '.$this->db->quoteString($headline_xml).', '.time().')';
+        } else {
+            $sql = 'UPDATE '.$this->db->prefix('xoopsheadline').' SET headline_name='.$this->db->quoteString($headline_name).', headline_url='.$this->db->quoteString($headline_url).', headline_rssurl='.$this->db->quoteString($headline_rssurl).', headline_encoding='.$this->db->quoteString($headline_encoding).', headline_cachetime='.$headline_cachetime.', headline_asblock='.$headline_asblock.', headline_display='.$headline_display.', headline_weight='.$headline_weight.', headline_mainimg='.$headline_mainimg.', headline_mainfull='.$headline_mainfull.', headline_mainmax='.$headline_mainmax.', headline_blockimg='.$headline_blockimg.', headline_blockmax='.$headline_blockmax.', headline_xml = '.$this->db->quoteString($headline_xml).', headline_updated='.$headline_updated.' WHERE headline_id='.$headline_id;
+        }
+        if (!$result = $this->db->queryF($sql)) {
+            return false;
+        }
+        if (empty($headline_id)) {
+            $headline_id = $this->db->getInsertId();
+        }
+        $headline->assignVar('headline_id', $headline_id);
+        return $headline_id;
+    }
+
+    function delete(&$headline)
+    {
+        if (get_class($headline) != 'xoopsheadlineheadline') {
+            return false;
+        }
+        $sql = sprintf("DELETE FROM %s WHERE headline_id = %u", $this->db->prefix('xoopsheadline'), $headline->getVar('headline_id'));
+        if (!$result = $this->db->query($sql)) {
+            return false;
+        }
+        return true;
+    }
+
+    function &getObjects($criteria = null)
+    {
+        $ret = array();
+        $limit = $start = 0;
+        $sql = 'SELECT * FROM '.$this->db->prefix('xoopsheadline');
+        if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
+            $sql .= ' '.$criteria->renderWhere();
+            $sql .= ' ORDER BY headline_weight '.$criteria->getOrder();
+            $limit = $criteria->getLimit();
+            $start = $criteria->getStart();
+        }
+        $result = $this->db->query($sql, $limit, $start);
+        if (!$result) {
+            return $ret;
+        }
+        while ($myrow = $this->db->fetchArray($result)) {
+            $headline = new XoopsheadlineHeadline();
+            $headline->assignVars($myrow);
+            $ret[] =& $headline;
+            unset($headline);
+        }
+        return $ret;
+    }
+
+    function getCount($criteria = null)
+    {
+        $sql = 'SELECT COUNT(*) FROM '.$this->db->prefix('xoopsheadline');
+        if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
+            $sql .= ' '.$criteria->renderWhere();
+        }
+        if (!$result =& $this->db->query($sql)) {
+            return 0;
+        }
+        list($count) = $this->db->fetchRow($result);
+        return $count;
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/class/headlinerenderer.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/class/headlinerenderer.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/class/headlinerenderer.php	(revision 405)
@@ -0,0 +1,219 @@
+<?php
+// $Id: headlinerenderer.php,v 1.3 2005/08/03 12:40:01 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+include_once XOOPS_ROOT_PATH.'/class/template.php';
+include_once XOOPS_ROOT_PATH.'/modules/xoopsheadline/language/'.$GLOBALS['xoopsConfig']['language'].'/main.php';
+
+class XoopsHeadlineRenderer
+{
+	// holds reference to xoopsheadline class object
+	var $_hl;
+
+	// XoopTemplate object
+	var $_tpl;
+
+	var $_feed;
+
+	var $_block;
+
+	var $_errors = array();
+
+	// RSS2 SAX parser
+	var $_parser;
+
+
+	function XoopsHeadlineRenderer(&$headline)
+	{
+		$this->_hl =& $headline;
+		$this->_tpl = new XoopsTpl();
+	}
+
+	function updateCache()
+	{
+		if (!$fp = fopen($this->_hl->getVar('headline_rssurl'), 'r')) {
+			$this->_setErrors('Could not open file: '.$this->_hl->getVar('headline_rssurl'));
+			return false;
+		}
+		$data = '';
+		while (!feof ($fp)) {
+			$data .= fgets($fp, 4096);
+		}
+		fclose ($fp);
+		$this->_hl->setVar('headline_xml', $this->convertToUtf8($data));
+		$this->_hl->setVar('headline_updated', time());
+		$headline_handler =& xoops_getmodulehandler('headline', 'xoopsheadline');
+		return $headline_handler->insert($this->_hl);
+	}
+
+	function renderFeed($force_update = false)
+	{
+		if ($force_update || $this->_hl->cacheExpired()) {
+			if (!$this->updateCache()) {
+				return false;
+			}
+		}
+		if (!$this->_parse()) {
+			return false;
+		}
+		$this->_tpl->clear_all_assign();
+		$this->_tpl->assign('xoops_url', XOOPS_URL);
+		$channel_data =& $this->_parser->getChannelData();
+		array_walk($channel_data, array($this, 'convertFromUtf8'));
+		$this->_tpl->assign_by_ref('channel', $channel_data);
+		if ($this->_hl->getVar('headline_mainimg') == 1) {
+			$image_data =& $this->_parser->getImageData();
+			array_walk($image_data, array($this, 'convertFromUtf8'));
+			$this->_tpl->assign_by_ref('image', $image_data);
+		}
+		if ($this->_hl->getVar('headline_mainfull') == 1) {
+			$this->_tpl->assign('show_full', true);
+		} else {
+			$this->_tpl->assign('show_full', false);
+		}
+		$items =& $this->_parser->getItems();
+		$count = count($items);
+		$max = ($count > $this->_hl->getVar('headline_mainmax')) ? $this->_hl->getVar('headline_mainmax') : $count;
+		for ($i = 0; $i < $max; $i++) {
+			array_walk($items[$i], array($this, 'convertFromUtf8'));
+			$this->_tpl->append_by_ref('items', $items[$i]);
+		}
+		$this->_tpl->assign(array('lang_lastbuild' => _HL_LASTBUILD, 'lang_language' => _HL_LANGUAGE, 'lang_description' => _HL_DESCRIPTION, 'lang_webmaster' => _HL_WEBMASTER, 'lang_category' => _HL_CATEGORY, 'lang_generator' => _HL_GENERATOR, 'lang_title' => _HL_TITLE, 'lang_pubdate' => _HL_PUBDATE, 'lang_description' => _HL_DESCRIPTION, 'lang_more' => _MORE));
+		$this->_feed =& $this->_tpl->fetch('db:xoopsheadline_feed.html');
+		return true;
+	}
+
+	function renderBlock($force_update = false)
+	{
+		if ($force_update || $this->_hl->cacheExpired()) {
+			if (!$this->updateCache()) {
+				return false;
+			}
+		}
+		if (!$this->_parse()) {
+			return false;
+		}
+		$this->_tpl->clear_all_assign();
+		$this->_tpl->assign('xoops_url', XOOPS_URL);
+		$channel_data =& $this->_parser->getChannelData();
+		array_walk($channel_data, array($this, 'convertFromUtf8'));
+		$this->_tpl->assign_by_ref('channel', $channel_data);
+		if ($this->_hl->getVar('headline_blockimg') == 1) {
+			$image_data =& $this->_parser->getImageData();
+			array_walk($image_data, array($this, 'convertFromUtf8'));
+			$this->_tpl->assign_by_ref('image', $image_data);
+		}
+		$items =& $this->_parser->getItems();
+		$count = count($items);
+		$max = ($count > $this->_hl->getVar('headline_blockmax')) ? $this->_hl->getVar('headline_blockmax') : $count;
+		for ($i = 0; $i < $max; $i++) {
+			array_walk($items[$i], array($this, 'convertFromUtf8'));
+			$this->_tpl->append_by_ref('items', $items[$i]);
+		}
+		$this->_tpl->assign(array('site_name' => $this->_hl->getVar('headline_name'), 'site_url' => $this->_hl->getVar('headline_url'), 'site_id' => $this->_hl->getVar('headline_id')));
+		$this->_block =& $this->_tpl->fetch('file:'.XOOPS_ROOT_PATH.'/modules/xoopsheadline/blocks/headline_block.html');
+		return true;
+	}
+
+
+	
+	function &_parse()
+	{
+		if (isset($this->_parser)) {
+			return true;
+		}
+		include_once XOOPS_ROOT_PATH.'/class/xml/rss/xmlrss2parser.php';
+		$this->_parser = new XoopsXmlRss2Parser($this->_hl->getVar('headline_xml'));
+		switch ($this->_hl->getVar('headline_encoding')) {
+		case 'utf-8':
+			$this->_parser->useUtfEncoding();
+			break;
+		case 'us-ascii':
+			$this->_parser->useAsciiEncoding();
+			break;
+		default:
+			$this->_parser->useIsoEncoding();
+			break;
+		}
+		$result = $this->_parser->parse();
+		if (!$result) {
+			$this->_setErrors($this->_parser->getErrors(false));
+			unset($this->_parser);
+			return false;
+		}
+		return true;
+	}
+
+	function &getFeed()
+	{
+		return $this->_feed;
+	}
+
+	function &getBlock()
+	{
+		return $this->_block;
+	}
+
+	function _setErrors($err)
+	{
+		$this->_errors[] = $err;
+	}
+
+	function &getErrors($ashtml = true)
+	{
+		if (!$ashtml) {
+			return $this->_errors;
+		} else {
+		$ret = '';
+		if (count($this->_errors) > 0) {
+			foreach ($this->_errors as $error) {
+				$ret .= $error.'<br />';
+			}
+		}
+		return $ret;
+		}
+	}
+
+	// abstract
+	// overide this method in /language/your_language/headlinerenderer.php
+	// this method is called by the array_walk function
+	// return void
+	function convertFromUtf8(&$value, $key)
+	{
+	}
+
+	// abstract
+	// overide this method in /language/your_language/headlinerenderer.php
+	// return string
+	function &convertToUtf8(&$xmlfile)
+	{
+		return $xmlfile;
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/class/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/class/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/class/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/images/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/images/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/modules/xoopsheadline/images/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/register.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/register.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/register.php	(revision 405)
@@ -0,0 +1,305 @@
+<?php
+// $Id: register.php,v 1.4 2005/08/03 12:39:11 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+$xoopsOption['pagetype'] = 'user';
+
+include 'mainfile.php';
+$myts =& MyTextSanitizer::getInstance();
+
+$config_handler =& xoops_gethandler('config');
+$xoopsConfigUser =& $config_handler->getConfigsByCat(XOOPS_CONF_USER);
+
+if (empty($xoopsConfigUser['allow_register'])) {
+    redirect_header('index.php', 6, _US_NOREGISTER);
+    exit();
+}
+
+function userCheck($uname, $email, $pass, $vpass)
+{
+    global $xoopsConfigUser;
+    $xoopsDB =& Database::getInstance();
+    $myts =& MyTextSanitizer::getInstance();
+    $stop = '';
+    if (!checkEmail($email)) {
+        $stop .= _US_INVALIDMAIL.'<br />';
+    }
+    foreach ($xoopsConfigUser['bad_emails'] as $be) {
+        if (!empty($be) && preg_match("/".$be."/i", $email)) {
+            $stop .= _US_INVALIDMAIL.'<br />';
+            break;
+        }
+    }
+    if (strrpos($email,' ') > 0) {
+        $stop .= _US_EMAILNOSPACES.'<br />';
+    }
+    $uname = xoops_trim($uname);
+    switch ($xoopsConfigUser['uname_test_level']) {
+    case 0:
+        // strict
+        $restriction = '/[^a-zA-Z0-9\_\-]/';
+        break;
+    case 1:
+        // medium
+        $restriction = '/[^a-zA-Z0-9\_\-\<\>\,\.\$\%\#\@\!\\\'\"]/';
+        break;
+    case 2:
+        // loose
+        $restriction = '/[\000-\040]/';
+        break;
+    }
+    if (empty($uname) || preg_match($restriction, $uname)) {
+        $stop .= _US_INVALIDNICKNAME."<br />";
+    }
+    if (strlen($uname) > $xoopsConfigUser['maxuname']) {
+        $stop .= sprintf(_US_NICKNAMETOOLONG, $xoopsConfigUser['maxuname'])."<br />";
+    }
+    if (strlen($uname) < $xoopsConfigUser['minuname']) {
+        $stop .= sprintf(_US_NICKNAMETOOSHORT, $xoopsConfigUser['minuname'])."<br />";
+    }
+    foreach ($xoopsConfigUser['bad_unames'] as $bu) {
+        if (!empty($bu) && preg_match("/".$bu."/i", $uname)) {
+            $stop .= _US_NAMERESERVED."<br />";
+            break;
+        }
+    }
+    if (strrpos($uname, ' ') > 0) {
+        $stop .= _US_NICKNAMENOSPACES."<br />";
+    }
+    $sql = sprintf('SELECT COUNT(*) FROM %s WHERE uname = %s', $xoopsDB->prefix('users'), $xoopsDB->quoteString(addslashes($uname)));
+    $result = $xoopsDB->query($sql);
+    list($count) = $xoopsDB->fetchRow($result);
+    if ($count > 0) {
+        $stop .= _US_NICKNAMETAKEN."<br />";
+    }
+    $count = 0;
+    if ( $email ) {
+        $sql = sprintf('SELECT COUNT(*) FROM %s WHERE email = %s', $xoopsDB->prefix('users'), $xoopsDB->quoteString(addslashes($email)));
+        $result = $xoopsDB->query($sql);
+        list($count) = $xoopsDB->fetchRow($result);
+        if ( $count > 0 ) {
+            $stop .= _US_EMAILTAKEN."<br />";
+        }
+    }
+    if ( !isset($pass) || $pass == '' || !isset($vpass) || $vpass == '' ) {
+        $stop .= _US_ENTERPWD.'<br />';
+    }
+    if ( (isset($pass)) && ($pass != $vpass) ) {
+        $stop .= _US_PASSNOTSAME.'<br />';
+    } elseif ( ($pass != '') && (strlen($pass) < $xoopsConfigUser['minpass']) ) {
+        $stop .= sprintf(_US_PWDTOOSHORT,$xoopsConfigUser['minpass'])."<br />";
+    }
+    return $stop;
+}
+$op = !isset($_POST['op']) ? 'register' : $_POST['op'];
+$uname = isset($_POST['uname']) ? $myts->stripSlashesGPC($_POST['uname']) : '';
+$email = isset($_POST['email']) ? trim($myts->stripSlashesGPC($_POST['email'])) : '';
+$url = isset($_POST['url']) ? trim($myts->stripSlashesGPC($_POST['url'])) : '';
+$pass = isset($_POST['pass']) ? $myts->stripSlashesGPC($_POST['pass']) : '';
+$vpass = isset($_POST['vpass']) ? $myts->stripSlashesGPC($_POST['vpass']) : '';
+$timezone_offset = $xoopsConfig['default_TZ'];
+$user_viewemail = (isset($_POST['user_viewemail']) && intval($_POST['user_viewemail'])) ? 1 : 0;
+$user_mailok = (isset($_POST['user_mailok']) && intval($_POST['user_mailok'])) ? 1 : 0;
+$agree_disc = 1;
+switch ( $op ) {
+case 'newuser':
+    if (!XoopsSingleTokenHandler::quickValidate('register_newuser')) {
+        exit();
+    }
+    include 'header.php';
+    $stop = '';
+    if ($xoopsConfigUser['reg_dispdsclmr'] != 0 && $xoopsConfigUser['reg_disclaimer'] != '') {
+        if (empty($agree_disc)) {
+            $stop .= _US_UNEEDAGREE.'<br />';
+        }
+    }
+
+    $stop .= userCheck($uname, $email, $pass, $vpass);
+    if (empty($stop)) {
+		$token =& XoopsSingleTokenHandler::quickCreate('register_finish');
+
+		/* ¥Õ¥©¡¼¥à¾åµ­¥³¥á¥ó¥È */
+		echo "<table id='centerMessage'>
+			<tr>
+				<td>
+					<span class='fs22'><span class='red'>¢¨</span>¡ÖÁ÷¿®¡×¥Ü¥¿¥ó¤ò²¡¤¹¤È¥æ¡¼¥¶ÅÐÏ¿ÍÑ¥á¡¼¥ë¤òÁ÷¿®¤·¤Þ¤¹¡£<br />
+					ËÜÊ¸¤Ëµ­ºÜ¤µ¤ì¤Æ¤¤¤ë¥ê¥ó¥¯¤ò¥¯¥ê¥Ã¥¯¤·¤Æ¥æ¡¼¥¶ÅÐÏ¿´°Î»¤·¤Æ¤¯¤À¤µ¤¤¡£<br /><br />
+					¢§---²¼µ­¥á¡¼¥ë¥¢¥É¥ì¥¹¤Ø¥á¡¼¥ë¤òÁ÷¿®¤·¤Þ¤¹¡£---
+					</span>
+				</td>
+			</tr>
+			<tr><td heigth='10'></td></tr>
+			<tr>
+				<td><span class='fs22'>";
+		
+        echo _US_USERNAME.": ".$myts->htmlSpecialChars($uname)."<br />";
+        echo _US_EMAIL.": ".$myts->htmlSpecialChars($email)."<br />";
+        if ($url != '') {
+            $url = formatURL($url);
+            echo _US_WEBSITE.': '.$myts->htmlSpecialChars($url).'<br />';
+        }
+        //$f_timezone = ($timezone_offset < 0) ? 'GMT '.$timezone_offset : 'GMT +'.$timezone_offset;
+        //echo _US_TIMEZONE.": $f_timezone<br />";
+        echo "<form action='register.php' method='post'>";
+        echo $token->getHtml();
+		echo "<input type='hidden' name='uname' value='".$myts->htmlSpecialChars($uname)."' />
+        <input type='hidden' name='email' value='".$myts->htmlSpecialChars($email)."' />";
+        echo "<input type='hidden' name='user_viewemail' value='".$user_viewemail."' />
+        <input type='hidden' name='url' value='".$myts->htmlSpecialChars($url)."' />
+        <input type='hidden' name='pass' value='".$myts->htmlSpecialChars($pass)."' />
+        <input type='hidden' name='vpass' value='".$myts->htmlSpecialChars($vpass)."' />
+        <input type='hidden' name='timezone_offset' value='".(float)$timezone_offset."' />
+        <input type='hidden' name='user_mailok' value='1' />
+        <br /><br /><input type='hidden' name='op' value='finish' /><center><input type='submit' value='". _US_FINISH ."' /></center></form>
+        	</span></td>
+        	</tr>
+        </table>";
+    } else {
+        echo "<span style='color:#ff0000;'>$stop</span>";
+        include 'include/registerform.php';
+        $reg_form->display();
+    }
+    include 'footer.php';
+    break;
+case 'finish':
+    if (!XoopsSingleTokenHandler::quickValidate('register_finish')) {
+        exit();
+    }
+    include 'header.php';
+    include 'include/registerform.php';
+
+    $stop = userCheck($uname, $email, $pass, $vpass);
+    if ( empty($stop) ) {
+        $member_handler =& xoops_gethandler('member');
+        $newuser =& $member_handler->createUser();
+        $newuser->setVar('user_viewemail',$user_viewemail, true);
+        $newuser->setVar('uname', $uname, true);
+        $newuser->setVar('email', $email, true);
+        if ($url != '') {
+            $newuser->setVar('url', formatURL($url), true);
+        }
+        $newuser->setVar('user_avatar','blank.gif', true);
+        $actkey = substr(md5(uniqid(mt_rand(), 1)), 0, 8);
+        $newuser->setVar('actkey', $actkey, true);
+        $newuser->setVar('pass', md5($pass), true);
+        $newuser->setVar('timezone_offset', $timezone_offset, true);
+        $newuser->setVar('user_regdate', time(), true);
+        $newuser->setVar('uorder',$xoopsConfig['com_order'], true);
+        $newuser->setVar('umode',$xoopsConfig['com_mode'], true);
+        $newuser->setVar('user_mailok',$user_mailok, true);
+        if ($xoopsConfigUser['activation_type'] == 1) {
+            $newuser->setVar('level', 1, true);
+        }
+        if (!$member_handler->insertUser($newuser)) {
+            echo _US_REGISTERNG;
+            include 'footer.php';
+            exit();
+        }
+        $newid = $newuser->getVar('uid');
+        if (!$member_handler->addUserToGroup(XOOPS_GROUP_USERS, $newid)) {
+            echo _US_REGISTERNG;
+            include 'footer.php';
+            exit();
+        }
+        if ($xoopsConfigUser['activation_type'] == 1) {
+            redirect_header('index.php', 4, _US_ACTLOGIN);
+            exit();
+        }
+        if ($xoopsConfigUser['activation_type'] == 0) {
+            $xoopsMailer =& getMailer();
+            $xoopsMailer->useMail();
+            $xoopsMailer->setTemplate('register.tpl');
+            $xoopsMailer->assign('SITENAME', $xoopsConfig['sitename']);
+            $xoopsMailer->assign('ADMINMAIL', $xoopsConfig['adminmail']);
+            $xoopsMailer->assign('SITEURL', XOOPS_URL."/");
+            $xoopsMailer->setToUsers(new XoopsUser($newid));
+            $xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
+            $xoopsMailer->setFromName($xoopsConfig['sitename']);
+            $xoopsMailer->setSubject(sprintf(_US_USERKEYFOR, $uname));
+            if ( !$xoopsMailer->send() ) {
+                echo _US_YOURREGMAILNG;
+            } else {
+			    // ¾åÉô¥á¥Ã¥»¡¼¥¸
+			    echo "<table id='centerMessage'>
+						<tr>
+							<td>
+								<span class='fs22'><span class='red'>¢¨</span>¤´ÅÐÏ¿Í­Æñ¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£<br />
+								ÅÐÏ¿ÍÑ¥á¡¼¥ë¤òÁ÷¿®Ã×¤·¤Þ¤·¤¿¡£</span>
+							</td>
+						</tr>
+					</table>";
+                //echo _US_YOURREGISTERED;
+            }
+        } elseif ($xoopsConfigUser['activation_type'] == 2) {
+            $xoopsMailer =& getMailer();
+            $xoopsMailer->useMail();
+            $xoopsMailer->setTemplate('adminactivate.tpl');
+            $xoopsMailer->assign('USERNAME', $uname);
+            $xoopsMailer->assign('USEREMAIL', $email);
+            $xoopsMailer->assign('USERACTLINK', XOOPS_URL.'/user.php?op=actv&id='.$newid.'&actkey='.$actkey);
+            $xoopsMailer->assign('SITENAME', $xoopsConfig['sitename']);
+            $xoopsMailer->assign('ADMINMAIL', $xoopsConfig['adminmail']);
+            $xoopsMailer->assign('SITEURL', XOOPS_URL."/");
+            $member_handler =& xoops_gethandler('member');
+            $xoopsMailer->setToGroups($member_handler->getGroup($xoopsConfigUser['activation_group']));
+            $xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
+            $xoopsMailer->setFromName($xoopsConfig['sitename']);
+            $xoopsMailer->setSubject(sprintf(_US_USERKEYFOR, $uname));
+            if ( !$xoopsMailer->send() ) {
+                echo _US_YOURREGMAILNG;
+            } else {
+                echo _US_YOURREGISTERED2;
+            }
+        }
+        if ($xoopsConfigUser['new_user_notify'] == 1 && !empty($xoopsConfigUser['new_user_notify_group'])) {
+            /* ¥æ¡¼¥¶ÅÐÏ¿»þ´ÉÍý¼Ô¤Ø¤Î¥á¡¼¥ëÇÛ¿®¤òÄä»ß */
+            /*$xoopsMailer =& getMailer();
+            $xoopsMailer->useMail();
+            $member_handler =& xoops_gethandler('member');
+            $xoopsMailer->setToGroups($member_handler->getGroup($xoopsConfigUser['new_user_notify_group']));
+            $xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
+            $xoopsMailer->setFromName($xoopsConfig['sitename']);
+            $xoopsMailer->setSubject(sprintf(_US_NEWUSERREGAT,$xoopsConfig['sitename']));
+            $xoopsMailer->setBody(sprintf(_US_HASJUSTREG, $uname));
+            $xoopsMailer->send();
+            */
+        }
+    } else {
+        echo "<span style='color:#ff0000; font-weight:bold;'>$stop</span>";
+        include 'include/registerform.php';
+        $reg_form->display();
+    }
+    include 'footer.php';
+    break;
+case 'register':
+default:
+    include 'header.php';
+    include 'include/registerform.php';
+    $reg_form->display();
+    include 'footer.php';
+    break;
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/mainfile.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/mainfile.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/mainfile.php	(revision 405)
@@ -0,0 +1,101 @@
+<?php
+// $Id: mainfile.dist.php,v 1.3 2006/05/01 02:37:26 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+if ( !defined("XOOPS_MAINFILE_INCLUDED") ) {
+    define("XOOPS_MAINFILE_INCLUDED",1);
+
+    // XOOPS Physical Path
+    // Physical path to your main XOOPS directory WITHOUT trailing slash
+    // Example: define('XOOPS_ROOT_PATH', '/home/web/xoops.ec-cube.net/html');
+    define('XOOPS_ROOT_PATH', '/home/web/xoops.ec-cube.net/html');
+
+    // XOOPS Virtual Path (URL)
+    // Virtual path to your main XOOPS directory WITHOUT trailing slash
+    // Example: define('XOOPS_URL', 'http://xoops.ec-cube.net');
+    define('XOOPS_URL', 'http://xoops.ec-cube.net');
+
+    define('XOOPS_CHECK_PATH', 0);
+    // Protect against external scripts execution if safe mode is not enabled
+    if ( XOOPS_CHECK_PATH && !@ini_get('safe_mode') ) {
+        if ( function_exists('debug_backtrace') ) {
+            $xoopsScriptPath = debug_backtrace();
+            if ( !count($xoopsScriptPath) ) {
+                die("XOOPS path check: this file cannot be requested directly");
+            }
+            $xoopsScriptPath = $xoopsScriptPath[0]['file'];
+        } else {
+            $xoopsScriptPath = isset($_SERVER['PATH_TRANSLATED']) ? $_SERVER['PATH_TRANSLATED'] :  $_SERVER['SCRIPT_FILENAME'];
+        }
+        if ( DIRECTORY_SEPARATOR != '/' ) {
+            // IIS6 may double the \ chars
+            $xoopsScriptPath = str_replace( strpos( $xoopsScriptPath, '\\\\', 2 ) ? '\\\\' : DIRECTORY_SEPARATOR, '/', $xoopsScriptPath);
+        }
+        if ( strcasecmp( substr($xoopsScriptPath, 0, strlen(XOOPS_ROOT_PATH)), str_replace( DIRECTORY_SEPARATOR, '/', XOOPS_ROOT_PATH)) ) {
+            exit("XOOPS path check: Script is not inside XOOPS_ROOT_PATH and cannot run.");
+        }
+    }
+
+    // Database
+    // Choose the database to be used
+    define('XOOPS_DB_TYPE', 'mysql');
+
+    // Table Prefix
+    // This prefix will be added to all new tables created to avoid name conflict in the database. If you are unsure, just use the default 'xoops'.
+    define('XOOPS_DB_PREFIX', 'xoops');
+
+    // Database Hostname
+    // Hostname of the database server. If you are unsure, 'localhost' works in most cases.
+    define('XOOPS_DB_HOST', 'localhost');
+
+    // Database Username
+    // Your database user account on the host
+    define('XOOPS_DB_USER', 'xoops');
+
+    // Database Password
+    // Password for your database user account
+    define('XOOPS_DB_PASS', 'password');
+
+    // Database Name
+    // The name of database on the host. The installer will attempt to create the database if not exist
+    define('XOOPS_DB_NAME', 'xoops_db');
+
+    // Use persistent connection? (Yes=1 No=0)
+    // Default is 'No'. Choose 'No' if you are unsure.
+    define('XOOPS_DB_PCONNECT', 0);
+
+    define('XOOPS_GROUP_ADMIN', '1');
+    define('XOOPS_GROUP_USERS', '2');
+    define('XOOPS_GROUP_ANONYMOUS', '3');
+
+	// I[gOCúÔ
+    define('XOOPS_AUTOLOGIN_LIFETIME',7257600);
+
+    if (!isset($xoopsOption['nocommon']) && XOOPS_ROOT_PATH != '') {
+        include XOOPS_ROOT_PATH."/include/common.php";
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/mainfile.dist.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/mainfile.dist.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/mainfile.dist.php	(revision 405)
@@ -0,0 +1,98 @@
+<?php
+// $Id: mainfile.dist.php,v 1.3 2006/05/01 02:37:26 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+if ( !defined("XOOPS_MAINFILE_INCLUDED") ) {
+    define("XOOPS_MAINFILE_INCLUDED",1);
+
+    // XOOPS Physical Path
+    // Physical path to your main XOOPS directory WITHOUT trailing slash
+    // Example: define('XOOPS_ROOT_PATH', '/path/to/xoops/directory');
+    define('XOOPS_ROOT_PATH', '');
+
+    // XOOPS Virtual Path (URL)
+    // Virtual path to your main XOOPS directory WITHOUT trailing slash
+    // Example: define('XOOPS_URL', 'http://url_to_xoops_directory');
+    define('XOOPS_URL', 'http://');
+
+    define('XOOPS_CHECK_PATH', 0);
+    // Protect against external scripts execution if safe mode is not enabled
+    if ( XOOPS_CHECK_PATH && !@ini_get('safe_mode') ) {
+        if ( function_exists('debug_backtrace') ) {
+            $xoopsScriptPath = debug_backtrace();
+            if ( !count($xoopsScriptPath) ) {
+                die("XOOPS path check: this file cannot be requested directly");
+            }
+            $xoopsScriptPath = $xoopsScriptPath[0]['file'];
+        } else {
+            $xoopsScriptPath = isset($_SERVER['PATH_TRANSLATED']) ? $_SERVER['PATH_TRANSLATED'] :  $_SERVER['SCRIPT_FILENAME'];
+        }
+        if ( DIRECTORY_SEPARATOR != '/' ) {
+            // IIS6 may double the \ chars
+            $xoopsScriptPath = str_replace( strpos( $xoopsScriptPath, '\\\\', 2 ) ? '\\\\' : DIRECTORY_SEPARATOR, '/', $xoopsScriptPath);
+        }
+        if ( strcasecmp( substr($xoopsScriptPath, 0, strlen(XOOPS_ROOT_PATH)), str_replace( DIRECTORY_SEPARATOR, '/', XOOPS_ROOT_PATH)) ) {
+            exit("XOOPS path check: Script is not inside XOOPS_ROOT_PATH and cannot run.");
+        }
+    }
+
+    // Database
+    // Choose the database to be used
+    define('XOOPS_DB_TYPE', 'mysql');
+
+    // Table Prefix
+    // This prefix will be added to all new tables created to avoid name conflict in the database. If you are unsure, just use the default 'xoops'.
+    define('XOOPS_DB_PREFIX', 'xoops');
+
+    // Database Hostname
+    // Hostname of the database server. If you are unsure, 'localhost' works in most cases.
+    define('XOOPS_DB_HOST', 'localhost');
+
+    // Database Username
+    // Your database user account on the host
+    define('XOOPS_DB_USER', '');
+
+    // Database Password
+    // Password for your database user account
+    define('XOOPS_DB_PASS', '');
+
+    // Database Name
+    // The name of database on the host. The installer will attempt to create the database if not exist
+    define('XOOPS_DB_NAME', '');
+
+    // Use persistent connection? (Yes=1 No=0)
+    // Default is 'No'. Choose 'No' if you are unsure.
+    define('XOOPS_DB_PCONNECT', 0);
+
+    define("XOOPS_GROUP_ADMIN", "1");
+    define("XOOPS_GROUP_USERS", "2");
+    define("XOOPS_GROUP_ANONYMOUS", "3");
+
+    if (!isset($xoopsOption['nocommon']) && XOOPS_ROOT_PATH != '') {
+        include XOOPS_ROOT_PATH."/include/common.php";
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/admin.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/admin.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/admin.php	(revision 405)
@@ -0,0 +1,132 @@
+<?php
+// $Id: admin.php,v 1.4 2005/08/03 12:39:11 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+$xoopsOption['pagetype'] = "admin";
+include "mainfile.php";
+include XOOPS_ROOT_PATH."/include/cp_functions.php";
+/*********************************************************/
+/* Admin Authentication                                  */
+/*********************************************************/
+
+if ( $xoopsUser ) {
+    if ( !$xoopsUser->isAdmin(-1) ) {
+        redirect_header("index.php",2,_AD_NORIGHT);
+        exit();
+    }
+} else {
+    redirect_header("index.php",2,_AD_NORIGHT);
+    exit();
+}
+$op = "list";
+
+if ( !empty($_GET['op']) ) {
+    $op = $_GET['op'];
+}
+
+if ( !empty($_POST['op']) ) {
+    $op = $_POST['op'];
+}
+
+if (!file_exists(XOOPS_CACHE_PATH.'/adminmenu.php') && $op != 'generate') {
+    xoops_header();
+    xoops_token_confirm(array('op' => 'generate'), 'admin.php', _AD_PRESSGEN);
+    xoops_footer();
+    exit();
+}
+
+switch ($op) {
+case "list":
+    xoops_cp_header();
+    // ###### Output warn messages for security ######
+    if (is_dir(XOOPS_ROOT_PATH."/install/" )) {
+        xoops_error(sprintf(_WARNINSTALL2,XOOPS_ROOT_PATH.'/install/'));
+        echo '<br />';
+    }
+    if ( is_writable(XOOPS_ROOT_PATH."/mainfile.php" ) ) {
+        xoops_error(sprintf(_WARNINWRITEABLE,XOOPS_ROOT_PATH.'/mainfile.php'));
+        echo '<br />';
+    }
+/*    if (function_exists('mb_convert_encoding') && !empty($_GET['xoopsorgnews'])) {
+        $rssurl = 'http://jp.xoops.org/backend.php';
+        $rssfile = XOOPS_CACHE_PATH.'/adminnews.xml';
+        $rssdata = '';
+        if (!file_exists($rssfile) || filemtime($rssfile) < time() - 86400) {
+            require_once XOOPS_ROOT_PATH.'/class/snoopy.php';
+            $snoopy = new Snoopy;
+            if ($snoopy->fetch($rssurl)) {
+                $rssdata = $snoopy->results;
+                if (false !== $fp = fopen($rssfile, 'w')) {
+                    fwrite($fp, $rssdata);
+                }
+                fclose($fp);
+            }
+        } else {
+            if (false !== $fp = fopen($rssfile, 'r')) {
+                while (!feof ($fp)) {
+                    $rssdata .= fgets($fp, 4096);
+                }
+                fclose($fp);
+            }
+        }
+        if ($rssdata != '') {
+            include_once XOOPS_ROOT_PATH.'/class/xml/rss/xmlrss2parser.php';
+            $rss2parser = new XoopsXmlRss2Parser($rssdata);
+            if (false != $rss2parser->parse()) {
+                echo '<table class="outer" width="100%">';
+                $items =& $rss2parser->getItems();
+                $count = count($items);
+                for ($i = 0; $i < $count; $i++) {
+                    echo '<tr class="head"><td><a href="'.htmlspecialchars($items[$i]['link']).'" target="_blank">';
+                    echo htmlspecialchars(mb_convert_encoding($items[$i]['title'], _CHARSET, 'auto')).'</a> ('.htmlspecialchars($items[$i]['pubdate']).')</td></tr>';
+                    if ($items[$i]['description'] != "") {
+                        echo '<tr><td class="odd">'.mb_convert_encoding($items[$i]['description'], _CHARSET, 'auto');
+                        if ($items[$i]['guid'] != "") {
+                            echo '&nbsp;&nbsp;<a href="'.htmlspecialchars($items[$i]['guid']).'" target="_blank">'._MORE.'</a>';
+                        }
+                        echo '</td></tr>';
+                    } elseif ($items[$i]['guid'] != "") {
+                        echo '<tr><td class="even" valign="top"></td><td colspan="2" class="odd"><a href="'.htmlspecialchars($items[$i]['guid']).'" target="_blank">'._MORE.'</a></td></tr>';
+                    }
+                }
+                echo '</table>';
+            } else {
+                echo $rss2parser->getErrors();
+            }
+        }
+    }*/
+    xoops_cp_footer();
+    break;
+case 'generate':
+    if (xoops_confirm_validate()) {
+        xoops_module_write_admin_menu(xoops_module_get_admin_menu());
+    }
+    redirect_header('admin.php', 1, _AD_LOGINADMIN);
+    break;
+default:
+    break;
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/autologin.txt
===================================================================
--- /temp/test-xoops.ec-cube.net/html/autologin.txt	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/autologin.txt	(revision 405)
@@ -0,0 +1,154 @@
+[mlimg]
+[xlang:en]
+
+   == AUTO-LOGIN V3 (REMEMBER ME) hacked files for XOOPS 2.0.16aJP ==
+
+------------------------------------------------------------------
+
+Hacked core files to be able to login automatically (+ alpha).
+This package is for XOOPS 2.0.16aJP
+
+
+[b]USAGE:[/b]
+1) Overwrite these files into your XOOPS 2.0.16aJP
+2) update system module. If you are using a custom template set you will need
+to edit or delete the system_block_login.html for that set by template
+manager.
+
+AUTO-LOGIN V3 is a little safer than V2.
+V3 stores user's password as md5 encoded with time limitation.
+If cookie is stolen by someone, he can't login after auto-login expiration.
+This means that short expiration makes your site a little bit safer.
+
+The feature of Retry or Repost is implemented with AUTO-LOGIN V2.
+
+- You can access dynamic contents directly with autologin without CSRF
+  vulnerablities.
+
+- You can retry to post even if you are timed-out from the session.
+
+These features are implemented in session_confirm.php.
+Don't forget uploding this file.
+
+
+If you want to set the life time of remembering, insert a line into
+mainfile.php like this:
+[code]
+define('XOOPS_AUTOLOGIN_LIFETIME',2678400);
+[/code]
+This example specifies the life time as 1 month.
+The default value is 604800 (= 1week).
+
+The prior version of auto-login hacks useed the value of session_expire.
+But this hack harms customizing session.
+Thus I've changed the code like above.
+
+
+This hack stores the password as an MD5 hash on the client, but this is
+vulnerable to dictionary attacks, and simple copying to another computer.
+
+This hack is a potential security hole, don't enable it lightly.
+
+
+[b]HACKED POINTS:[/b]
+
+You can easily find hacked points by searching the words 'GIJ'.
+If you use customized language files or some language files other than english
+or japanese, you should manually add a line into language/(your
+language)/global.php
+
+[code]
+define('_REMEMBERME','remember me'); // describe with your language
+define('_RETRYPOST','Time-out. Do you post again?');
+[/code]
+
+And if you can, edit this line.
+
+[code]
+define('_USERNAME','username or email: '); // describe with your language
+[/code]
+
+
+[b]ABOUT + ALPHA:[/b]
+
+This hack also modifies your XOOPS can be logged in by email.
+Users can login not only uname+password but also email+password.
+Of course, even the users logged in by email+password can login automatically
+on/after next access.
+
+
+
+[/xlang:en]
+[xlang:ja]
+
+¡üXOOPS 2.0.16aJPÍÑ¤Î¥ª¡¼¥È¥í¥°¥¤¥ó¥Ï¥Ã¥¯(+¦Á)ºÑ¤ß¥³¥¢¥Õ¥¡¥¤¥ë¥Ñ¥Ã¥¯ (V3)
+
+--------------------------------------------------
+
+XOOPS 2.0.16aJP
+¤Ë¼«Æ°¥í¥°¥¤¥óµ¡Ç½¤òÉÕÍ¿¤¹¤ë¤¿¤á¤Î¥Ñ¥Ã¥Á¤Ç¤¹¡£
+¤³¤Î¥¢¡¼¥«¥¤¥ÖÆâ¤Ë´Þ¤Þ¤ì¤ëÁ´¥Õ¥¡¥¤¥ë¤ò¡¢¤ª»È¤¤¤ÎXOOPS 2.0.16aJP
+¤Ë¾å½ñ¤­¤¹¤ë¤³¤È¤Ç¡¢¼«Æ°¥í¥°¥¤¥óµ¡Ç½¤¬Í­¸ú¤Ë¤Ê¤ê¤Þ¤¹¡£
+
+¤µ¤é¤Ë¡¢¾å½ñ¤­¸å¤Î¥·¥¹¥Æ¥à¥â¥¸¥å¡¼¥ë¥¢¥Ã¥×¥Ç¡¼¥È¤Ç¡¢¡ÖID¤È¥Ñ¥¹¥ï¡¼¥É¤òµ­²±¡×¤È¤¤¤¦¥Á¥§¥Ã¥¯¥Ü¥Ã¥¯¥¹¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£¤Ê¤ª¡¢¥«¥¹¥¿¥à¥Æ¥ó¥×¥ì¡¼¥È¥»¥Ã¥È¤òÍøÍÑ¤·¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢¥Æ¥ó¥×¥ì¡¼¥È¥Þ¥Í¡¼¥¸¥ã¤ËÆþ¤ê¡¢¤´ÍøÍÑ¤Î¥Æ¥ó¥×¥ì¡¼¥È¥»¥Ã¥ÈÆâ¤Î¥·¥¹¥Æ¥à´ÉÍý¤Îsystem_userform.html¤ª¤è¤Ósystem_block_login.html¤òºï½ü¤¹¤ë¡¢¤Þ¤¿¤Ï¼êºî¶È¤Ç¥Á¥§¥Ã¥¯¥Ü¥Ã¥¯¥¹¤òÄÉ²Ã¤¹¤ëÉ¬Í×¤¬¤¢¤ê¤Þ¤¹¡£
+
+¼ÂºÝ¤Ë¤Ï¡¢¥Æ¥ó¥×¥ì¡¼¥È´ÉÍý¤ò¤Á¤ã¤ó¤È¹Ô¤¦°Õ¼±¤Ï½ÅÍ×¤Ç¡¢¥â¥¸¥å¡¼¥ë¥¢¥Ã¥×¥Ç¡¼¥È¤è¤ê¤â¡¢tplsadmin¤òÍøÍÑ¤·¤Æ¡¢¤É¤Î¤è¤¦¤Ê¥Æ¥ó¥×¥ì¡¼¥È¤Îº¹Ê¬¤¬¤¢¤ë¤«¤òÍý²ò¤·¤Ê¤¬¤é¡¢¥Æ¥ó¥×¥ì¡¼¥È¤ò¹¹¿·¤¹¤ë¤Î¤¬¥Ù¥¹¥È¤Ç¤¹¡£
+
+V3 ¤Ç¤Ï¡¢¥¯¥Ã¥­¡¼¤Ø¤ÎÊÝÂ¸·Á¼°¤ò¼ã´³ÊÑ¤¨¤ë¤³¤È¤Ç¡¢°ÂÁ´À­¤¬Â¿¾¯¥Þ¥·¤Ë¤Ê¤ê¤Þ¤·¤¿¡£
+´ü¸ÂÉÕ¤­¤Çmd5¥¨¥ó¥³¡¼¥É¤µ¤ì¤¿¥Ñ¥¹¥ï¡¼¥É¤·¤«¥¯¥Ã¥­¡¼¤ËÊÝÂ¸¤·¤Þ¤»¤ó¤Î¤Ç¡¢Ã¯¤«¤¬¥¯¥Ã¥­¡¼¤òÅð¤ó¤À¤È¤·¤Æ¤â¡¢¤½¤Î´ü¸Â°Ê¹ß¤Ç¤¢¤ì¤Ð¥í¥°¥¤¥ó¤ËÀ®¸ù¤·¤Þ¤»¤ó¡£
+¤Ä¤Þ¤ê¡¢¥ª¡¼¥È¥í¥°¥¤¥óÍ­¸ú´ü¸Â¤¬½ÅÍ×¤Ê¤ï¤±¤Ç¡¢¥Ç¥Õ¥©¥ë¥È¤Î£±½µ´Ö¤ò£±¥ö·î¤ä£±Ç¯¤Ë±äÄ¹¤¹¤ë¤È¡¢¤½¤ì¤À¤±´í¸±À­¤¬Áý¤¹¤³¤È¤ËÎ±°Õ¤¯¤À¤µ¤¤¡£
+
+¥ª¡¼¥È¥í¥°¥¤¥óV2¤Ç¡¢¥ê¥È¥é¥¤µ¡Ç½¤¬¤Ä¤­¤Þ¤·¤¿¡£½¾Íè¤Î¥ª¡¼¥È¥í¥°¥¤¥óHack¤Ç¤Ï¡¢CSRFÂÐºö¤Î¤¿¤á¤Ë¡¢¤¤¤­¤Ê¤ê¥³¥ó¥Æ¥ó¥Ä¤Ë¥¢¥¯¥»¥¹¤¹¤ë¤È¥È¥Ã¥×¤ËÈô¤Ð¤µ¤ì¤ë¤³¤È¤¬Â¿¤¯¤¢¤ê¤Þ¤·¤¿¤¬¡¢º£¤Ï¤¤¤Ã¤¿¤ósession_confirm.php¤Ë¥ê¥À¥¤¥ì¥¯¥È¤·¤Æ¤«¤é¡¢¸µ¤Î¾ì½ê¤ËÌá¤ê¤Þ¤¹¡£
+
+¤³¤Îsession_confirm.php¤¬V2¤ÇÁý¤¨¤¿¥Õ¥¡¥¤¥ë¤Ç¤¹¡£Ëº¤ì¤º¤Ë¥¢¥Ã¥×¥í¡¼¥É¤·¤Æ¤¯¤À¤µ¤¤¡£
+
+¤Þ¤¿¡¢²¿¤«Åê¹Æ¤·¤¿»þ¤Ë¥»¥Ã¥·¥ç¥ó¤¬»þ´ÖÀÚ¤ì¤Ç¡¢Åê¹ÆÆâÍÆ¤ò¥í¥¹¥È¤·¤¿¡¢¤È¤¤¤¦·Ð¸³¤ò¤ª»ý¤Á¤ÎÊý¤â¾¯¤Ê¤¯¤Ê¤¤¤È»×¤¤¤Þ¤¹¤¬¡¢¤³¤Î¥ª¡¼¥È¥í¥°¥¤¥óV2¤òÍ­¸ú¤Ë¤·¤Æ¤¤¤ë¥æ¡¼¥¶¤Ç¤¢¤ì¤Ð¡¢ºÆÅÙ¼«Æ°¥í¥°¥¤¥ó¤·¤Æ¡¢Ä¾¸å¤ËºÆÅê¹Æ¤Îµ¡²ñ¤¬Í¿¤¨¤é¤ì¤Þ¤¹¡£¡ÊV2¤ÎÌÜ¶Ìµ¡Ç½¡Ë
+
+
+¤³¤ÎHack¤Ï¡¢uname¤Èmd5¥Ï¥Ã¥·¥åºÑ¤Î¥Ñ¥¹¥ï¡¼¥É¤ò¥¯¥Ã¥­¡¼¤ËÊÝÂ¸¤¹¤ë¤Î¤Ç¤¹¤¬¡¢¤½¤ÎÍ­¸ú»þ´Ö¤Ï¡¢¥Ç¥Õ¥©¥ë¥È¤Ç£±½µ´Ö(604800)¤È¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£
+
+¤â¤·¡¢¤³¤ÎÃÍ¤òÊÑ¹¹¤·¤¿¤¤¾ì¹ç¤Ï¡¢mainfile.php
+¤ËÂÐ¤·¤Æ²¼¤Î¤è¤¦¤Ë£±¹ÔÄÉ²Ã¤·¤Æ²¼¤µ¤¤¡£
+[code]
+define('XOOPS_AUTOLOGIN_LIFETIME',2678400);
+[/code]
+¤³¤Î¹Ô¤Ï¾¯¤Ê¤¯¤È¤â¡¢include XOOPS_ROOT_PATH."/include/common.php";
+¤È½ñ¤«¤ì¤¿¹Ô¤è¤ê¾å¤Ë¤¢¤ëÉ¬Í×¤¬¤¢¤ê¤Þ¤¹¡£
+
+¤Þ¤¿¡¢¸À¸ì¥Õ¥¡¥¤¥ë (langage/japanese/global.php)
+¤Ë¼ê¤òÆþ¤ì¤Æ¤¤¤ëÊý¤Ï¡¢¤³¤Î¥Õ¥¡¥¤¥ë¤ò¾å½ñ¤­¤¹¤ë¤Î¤Ç¤Ï¤Ê¤¯¡¢¤´¼«¿È¤Ç½ñ¤­´¹¤¨¤Æ¤¯¤À¤µ¤¤¡£
+
+[code]
+define('_USERNAME','¥æ¡¼¥¶ID ¤Þ¤¿¤Ï e-mail: '); // ½ñ¤­´¹¤¨
+[/code]
+
+[code]
+define('_REMEMBERME','ID¤È¥Ñ¥¹¥ï¡¼¥É¤òµ­²±'); // ÄÉ²Ã
+define('_RETRYPOST','»þ´ÖÀÚ¤ì¤Ç¤·¤¿¡£ºÆÅê¹Æ¤·¤Þ¤¹¤«¡©'); // ÄÉ²Ã
+[/code]
+
+
+¤³¤ì¤Ï½ÅÍ×¤ÊÃí°ÕÅÀ¤Ç¤¹¤¬¡¢¥¯¥Ã¥­¡¼¤Ë¥í¥°¥¤¥ó¾ðÊó¤¬»Ä¤Ã¤Æ¤¤¤ë¤È¤¤¤¦¤³¤È¤Ï¡¢ÅöÁ³¡¢Ã¯¤«¤ËÅð¤Þ¤ì¤ë²ÄÇ½À­¤¬¤¢¤ê¤Þ¤¹¡£¶¦ÍÑ¥³¥ó¥Ô¥å¡¼¥¿¤Ê¤É¤ò¤´ÍøÍÑ¤ÎºÝ¤Ë¤Ï¡¢É¬¤º¥í¥°¥¢¥¦¥È¤·¤Æ¤«¤é½ªÎ»¤¹¤ë¤è¤¦¤Ë¥¢¥Ê¥¦¥ó¥¹¤¹¤ëÉ¬Í×¤¬¤¢¤ë¤Ç¤·¤ç¤¦¡£
+
+
+½¾Á°¤Î¼«Æ°¥í¥°¥¤¥óHack¤Ç¤Ï¡¢¼«Æ°¥í¥°¥¤¥ó¤ÎÍ­¸ú´ü¸Â¤È¤·¤Æ¡¢session_expire¤ÎÃÍ¤òÎ®ÍÑ¤·¤Æ¤¤¤Þ¤·¤¿¤¬¡¢¤³¤¦¤·¤Æ¤·¤Þ¤¦¤È¡¢¥«¥¹¥¿¥à¥»¥Ã¥·¥ç¥óµ¡Ç½¤¬»ö¼Â¾å»È¤¨¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤¦¤¿¤á¡¢XOOPS_AUTOLOGIN_LIFETIME
+¤È¤¤¤¦Äê¿ô¤Ç»ØÄê¤¹¤ëÊý¼°¤Ë²þ¤á¤Æ¤¤¤Þ¤¹¡£
+
+
+¤½¤ì¤È¡¢¤³¤Î¥¢¡¼¥«¥¤¥Ö¤ò¾å½ñ¤­¤¹¤ë¤È¡¢email¥¢¥É¥ì¥¹¤Ç¤â¥í¥°¥¤¥ó¤Ç¤­¤ëHack¤â¼«Æ°Åª¤ËÍ­¸ú¤Ë¤Ê¤ê¤Þ¤¹¡£
+¤³¤ì¤À¤±½ñ¤¯¤È¡¢Ryuji¤µ¤ó¤ÎemailLoginHack¤ÈÆ±¤¸¤¸¤ã¤Ê¤¤¤«¡¢¤È»×¤ï¤ì¤½¤¦¤Ç¤¹¤¬¡¢¤¢¤½¤³¤Þ¤Ç¤­¤Á¤ó¤Èºî¤Ã¤Æ¤¤¤Þ¤»¤ó¡£¥æ¡¼¥¶¡¼Ì¾¤È¤·¤ÆÁ÷¤é¤ì¤Æ¤­¤¿Ê¸»úÎó¤Ë¡¢@
+¤¬´Þ¤Þ¤ì¤Æ¤¤¤ì¤Ð¡¢email
+¤Ë¤è¤ë¥í¥°¥¤¥ó¤À¤È¿äÄê¤·¤Æ¥í¥°¥¤¥ó¤ò»î¤¹¡¢¤È¤¤¤¦¤À¤±¤ÎHack¤Ç¤¹¡£
+
+µÕ¤Ë¸À¤¨¤Ð¡¢¤½¤ÎÊ¬¡¢Hack²Õ½ê¤â¾¯¤Ê¤¯¤ÆºÑ¤ó¤Ç¤¤¤Þ¤¹¡£´ðËÜÅª¤Ë¤Ï¡¢include/checklogin.php
+¤À¤±¤ÎÊÑ¹¹¤Ç¤¹¤Î¤Ç¡¢¥³¥¢¥Ð¡¼¥¸¥ç¥ó¤Ø¤ÎÄÉ¿ï¤â¾¯¤·¤Ï³Ú¤Ë¤Ê¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£
+
+ºÇ¶á¤Î¥·¥ç¥Ã¥Ô¥ó¥°¥µ¥¤¥È¤Ç¤Ï¡¢²ñ°÷ÈÖ¹æ¤Ç¤â¥á¡¼¥ë¥¢¥É¥ì¥¹¤Ç¤â¼õ¤±ÉÕ¤±¤ë¡¢¤È¤¤¤¦¤â¤Î¤¬Áý¤¨¤Æ¤­¤Æ¤¤¤ë¤Î¤Ç¡¢¤½¤ì¤Ê¤ê¤Ë¼õÆþ¤ì¤ä¤¹¤¤Hack¤Ç¤Ï¤Ê¤¤¤Ç¤·¤ç¤¦¤«¡£
+
+
+¤Þ¤¿¡¢include/common.php
+¤Ê¤É¤Ï¡¢Â¾¤ÎHack¤È¥Ð¥Ã¥Æ¥£¥ó¥°¤·¤ä¤¹¤¤¤Î¤Ç¡¢¾å½ñ¤­¤µ¤ì¤ë¤Èº¤¤ë¥±¡¼¥¹¤â¤¢¤ë¤Ç¤·¤ç¤¦¡£¤½¤Î¾ì¹ç¤Ï¡¢¤³¤Î¥¢¡¼¥«¥¤¥Ö¤Î³Æ¥Õ¥¡¥¤¥ë¤Ë¤Ä¤¤¤Æ¡¢'GIJ'¤È¤¤¤¦Ê¸»úÎó¤Ç¸¡º÷¤¹¤ì¤Ð¡¢Hack²Õ½ê¤¬¤É¤³¤«¡¢¤¹¤°¤ËÈ½¤ë¤Ï¤º¤Ç¤¹¡£
+
+
+                    by GIJOE    http://www.peak.ne.jp/xoops/
+[/xlang:ja]
Index: /temp/test-xoops.ec-cube.net/html/pmlite.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/pmlite.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/pmlite.php	(revision 405)
@@ -0,0 +1,138 @@
+<?php
+// $Id: pmlite.php,v 1.4 2005/08/03 12:39:11 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+$xoopsOption['pagetype'] = "pmsg";
+
+include "mainfile.php";
+$reply = !empty($_GET['reply']) ? 1 : 0;
+$send = !empty($_GET['send']) ? 1 : 0;
+$send2 = !empty($_GET['send2']) ? 1 : 0;
+$to_userid = !empty($_GET['to_userid']) ? intval($_GET['to_userid']) : 0;
+$msg_id = !empty($_GET['msg_id']) ? intval($_GET['msg_id']) : 0;
+if ( empty($_GET['refresh'] ) && isset($_POST['op']) && $_POST['op'] != "submit" ) {
+	$jump = "pmlite.php?refresh=".time()."";
+	if ( $send == 1 ) {
+		$jump .= "&amp;send=".$send."";
+	} elseif ( $send2 == 1 ) {
+		$jump .= "&amp;send2=".$send2."&amp;to_userid=".$to_userid."";
+	} elseif ( $reply == 1 ) {
+		$jump .= "&amp;reply=".$reply."&amp;msg_id=".$msg_id."";
+	} else {
+	}
+	echo "<html><head><meta http-equiv='Refresh' content='0; url=".$jump."' /></head><body></body></html>";
+	exit();
+}
+xoops_header();
+if ($xoopsUser) {
+	$myts =& MyTextSanitizer::getInstance();
+	if (isset($_POST['op']) && $_POST['op'] == "submit" && XoopsMultiTokenHandler::quickValidate('pm')) {
+		$res = $xoopsDB->query("SELECT COUNT(*) FROM ".$xoopsDB->prefix("users")." WHERE uid=".intval($_POST['to_userid'])."");
+        	list($count) = $xoopsDB->fetchRow($res);
+        	if ($count != 1) {
+			echo "<br /><br /><div><h4>"._PM_USERNOEXIST."<br />";
+			echo _PM_PLZTRYAGAIN."</h4><br />";
+            		echo "[ <a href='javascript:history.go(-1)'>"._PM_GOBACK."</a> ]</div>";
+		} else {
+			$pm_handler =& xoops_gethandler('privmessage');
+			$pm =& $pm_handler->create();
+			$pm->setVar("subject", $_POST['subject']);
+			$pm->setVar("msg_text", $_POST['message']);
+			$pm->setVar("to_userid", $_POST['to_userid']);
+			$pm->setVar("from_userid", $xoopsUser->getVar("uid"));
+			if (!$pm_handler->insert($pm)) {
+				echo $pm->getHtmlErrors();
+				echo "<br /><a href='javascript:history.go(-1)'>"._PM_GOBACK."</a>";
+			} else {
+				echo "<br /><br /><div style='text-align:center;'><h4>"._PM_MESSAGEPOSTED."</h4><br /><a href=\"javascript:window.opener.location='".XOOPS_URL."/viewpmsg.php';window.close();\">"._PM_CLICKHERE."</a><br /><br /><a href=\"javascript:window.close();\">"._PM_ORCLOSEWINDOW."</a></div>";
+			}
+		}
+	} elseif ($reply == 1 || $send == 1 || $send2 == 1) {
+		$token=&XoopsMultiTokenHandler::quickCreate('pm');
+
+		include_once XOOPS_ROOT_PATH."/include/xoopscodes.php";
+		if ($reply == 1) {
+			$pm_handler =& xoops_gethandler('privmessage');
+			$pm =& $pm_handler->get($msg_id);
+			if ($pm->getVar("to_userid") == $xoopsUser->getVar('uid')) {
+				$pm_uname = XoopsUser::getUnameFromId($pm->getVar("from_userid"));
+                $message  = "[quote]\n";
+				$message .= sprintf(_PM_USERWROTE,$pm_uname);
+				$message .= "\n".$pm->getVar("msg_text", "E")."\n[/quote]";
+			} else {
+				unset($pm);
+				$reply = $send2 = 0;
+			}
+		}
+		echo "<form action='pmlite.php' method='post' name='coolsus'>\n";
+		echo $token->getHtml();
+        	echo "<table width='300' align='center' class='outer'><tr><td class='head' width='25%'>"._PM_TO."</td>";
+		if ( $reply == 1 ) {
+			echo "<td class='even'><input type='hidden' name='to_userid' value='".$pm->getVar("from_userid")."' />".$pm_uname."</td>";
+		} elseif ( $send2 == 1 ) {
+			$to_username = XoopsUser::getUnameFromId($to_userid);
+			echo "<td class='even'><input type='hidden' name='to_userid' value='".$to_userid."' />".$to_username."</td>";
+		} else {
+			echo "<td class='even'><select name='to_userid'>";
+			$result = $xoopsDB->query("SELECT uid, uname FROM ".$xoopsDB->prefix("users")." WHERE level > 0 ORDER BY uname");
+            while ( list($ftouid, $ftouname) = $xoopsDB->fetchRow($result) ) {
+				echo "<option value='".$ftouid."'>".$myts->makeTboxData4Show($ftouname)."</option>";
+			}
+            echo "</select></td>";
+        }
+        echo "</tr>";
+        echo "<tr><td class='head' width='25%'>"._PM_SUBJECTC."</td>";
+		if ( $reply == 1 ) {
+			$subject = $pm->getVar('subject', 'E');
+			if (!preg_match("/^Re:/i",$subject)) {
+				$subject = 'Re: '.$subject;
+			}
+			echo "<td class='even'><input type='text' name='subject' value='".$subject."' size='30' maxlength='100' /></td>";
+		} else {
+			echo "<td class='even'><input type='text' name='subject' size='30' maxlength='100' /></td>";
+		}
+		echo "</tr>";
+        echo "<tr valign='top'><td class='head' width='25%'>"._PM_MESSAGEC."</td>";
+		echo "<td class='even'>";
+		xoopsCodeTarea("message",37,8);
+		xoopsSmilies("message");
+		echo "</td>";
+		echo "</tr>";
+        echo "<tr><td class='head'>&nbsp;</td><td class='even'>
+		<input type='hidden' name='op' value='submit' />
+		<input type='submit' class='formButton' name='submit' value='"._PM_SUBMIT."' />&nbsp;
+		<input type='reset' class='formButton' value='"._PM_CLEAR."' />
+		&nbsp;<input type='button' class='formButton' name='cancel' value='"._PM_CANCELSEND."' onclick='javascript:window.close();' />
+		</td></tr></table>\n";
+	   	echo "</form>\n";
+	}
+} else {
+	echo _PM_SORRY."<br /><br /><a href='".XOOPS_URL."/register.php'>"._PM_REGISTERNOW."</a>.";
+}
+
+xoops_footer();
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/kernel/group.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/kernel/group.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/kernel/group.php	(revision 405)
@@ -0,0 +1,444 @@
+<?php
+// $Id: group.php,v 1.3 2006/05/01 02:37:28 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+if (!defined('XOOPS_ROOT_PATH')) {
+    exit();
+}
+
+/**
+ * a group of users
+ * 
+ * @copyright copyright (c) 2000-2003 XOOPS.org
+ * @author Kazumi Ono <onokazu@xoops.org> 
+ * @package kernel
+ */
+class XoopsGroup extends XoopsObject
+{
+    /**
+     * constructor 
+     */
+    function XoopsGroup()
+    {
+        $this->XoopsObject();
+        $this->initVar('groupid', XOBJ_DTYPE_INT, null, false);
+        $this->initVar('name', XOBJ_DTYPE_TXTBOX, null, true, 100);
+        $this->initVar('description', XOBJ_DTYPE_TXTAREA, null, false);
+        $this->initVar('group_type', XOBJ_DTYPE_OTHER, null, false);
+    }
+}
+
+
+/**
+* XOOPS group handler class.
+* This class is responsible for providing data access mechanisms to the data source
+* of XOOPS group class objects.
+*
+* @author Kazumi Ono <onokazu@xoops.org>
+* @copyright copyright (c) 2000-2003 XOOPS.org
+* @package kernel
+* @subpackage member
+*/
+class XoopsGroupHandler extends XoopsObjectHandler
+{
+
+    /**
+     * create a new {@link XoopsGroup} object
+     * 
+     * @param bool $isNew mark the new object as "new"?
+     * @return object XoopsGroup reference to the new object
+     * 
+     */
+    function &create($isNew = true)
+    {
+        $group =& new XoopsGroup();
+        if ($isNew) {
+            $group->setNew();
+        }
+        return $group;
+    }
+
+    /**
+     * retrieve a specific group
+     * 
+     * @param int $id ID of the group to get
+     * @return object XoopsGroup reference to the group object, FALSE if failed
+     */
+    function &get($id)
+    {
+        $ret = false;
+        if (intval($id) > 0) {
+            $sql = 'SELECT * FROM '.$this->db->prefix('groups').' WHERE groupid='.$id;
+            if ($result = $this->db->query($sql)) {
+                $numrows = $this->db->getRowsNum($result);
+                if ($numrows == 1) {
+                    $group = new XoopsGroup();
+                    $group->assignVars($this->db->fetchArray($result));
+                    $ret =& $group;
+                }
+            }
+        }
+        return $ret;
+    }
+
+    /**
+     * insert a group into the database
+     * 
+     * @param object reference to the group object
+     * @return mixed ID of the group if inserted, FALSE if failed, TRUE if already present and unchanged.
+     */
+    function insert(&$group)
+    {
+        if (strtolower(get_class($group)) != 'xoopsgroup') {
+            return false;
+        }
+        if (!$group->isDirty()) {
+            return true;
+        }
+        if (!$group->cleanVars()) {
+            return false;
+        }
+        foreach ($group->cleanVars as $k => $v) {
+            ${$k} = $v;
+        }
+        if ($group->isNew()) {
+            $groupid = $this->db->genId('group_groupid_seq');
+            $sql = sprintf("INSERT INTO %s (groupid, name, description, group_type) VALUES (%u, %s, %s, %s)", $this->db->prefix('groups'), $groupid, $this->db->quoteString($name), $this->db->quoteString($description), $this->db->quoteString($group_type));
+        } else {
+            $sql = sprintf("UPDATE %s SET name = %s, description = %s, group_type = %s WHERE groupid = %u", $this->db->prefix('groups'), $this->db->quoteString($name), $this->db->quoteString($description), $this->db->quoteString($group_type), $groupid);
+        }
+        if (!$result = $this->db->query($sql)) {
+            return false;
+        }
+        if (empty($groupid)) {
+            $groupid = $this->db->getInsertId();
+        }
+        $group->assignVar('groupid', $groupid);
+        return true;
+    }
+
+    /**
+     * remove a group from the database
+     * 
+     * @param object $group reference to the group to be removed
+     * @return bool FALSE if failed
+     */
+    function delete(&$group)
+    {
+        if (strtolower(get_class($group)) != 'xoopsgroup') {
+            return false;
+        }
+        $sql = sprintf("DELETE FROM %s WHERE groupid = %u", $this->db->prefix('groups'), $group->getVar('groupid'));
+        if (!$result = $this->db->query($sql)) {
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     * retrieve groups from the database
+     * 
+     * @param object $criteria {@link CriteriaElement} with conditions for the groups
+     * @param bool $id_as_key should the groups' IDs be used as keys for the associative array?
+     * @return mixed Array of groups
+     */
+    function &getObjects($criteria = null, $id_as_key = false)
+    {
+        $ret = array();
+        $limit = $start = 0;
+        $sql = 'SELECT * FROM '.$this->db->prefix('groups');
+        if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
+            $sql .= ' '.$criteria->renderWhere();
+            $limit = $criteria->getLimit();
+            $start = $criteria->getStart();
+        }
+        $result = $this->db->query($sql, $limit, $start);
+        if (!$result) {
+            return $ret;
+        }
+        while ($myrow = $this->db->fetchArray($result)) {
+            $group =& new XoopsGroup();
+            $group->assignVars($myrow);
+            if (!$id_as_key) {
+                $ret[] =& $group;
+            } else {
+                $ret[$myrow['groupid']] =& $group;
+            }
+            unset($group);
+        }
+        return $ret;
+    }
+}
+
+/**
+ * membership of a user in a group
+ * 
+ * @author Kazumi Ono <onokazu@xoops.org>
+ * @copyright copyright (c) 2000-2003 XOOPS.org
+ * @package kernel
+ */
+class XoopsMembership extends XoopsObject
+{
+    /**
+     * constructor 
+     */
+    function XoopsMembership()
+    {
+        $this->XoopsObject();
+        $this->initVar('linkid', XOBJ_DTYPE_INT, null, false);
+        $this->initVar('groupid', XOBJ_DTYPE_INT, null, false);
+        $this->initVar('uid', XOBJ_DTYPE_INT, null, false);
+    }
+}
+
+/**
+* XOOPS membership handler class. (Singleton)
+* 
+* This class is responsible for providing data access mechanisms to the data source 
+* of XOOPS group membership class objects.
+*
+* @author Kazumi Ono <onokazu@xoops.org>
+* @copyright copyright (c) 2000-2003 XOOPS.org
+* @package kernel
+*/
+class XoopsMembershipHandler extends XoopsObjectHandler
+{
+
+    /**
+     * create a new membership
+     * 
+     * @param bool $isNew should the new object be set to "new"?
+     * @return object XoopsMembership
+     */
+    function &create($isNew = true)
+    {
+        $mship =& new XoopsMembership();
+        if ($isNew) {
+            $mship->setNew();
+        }
+        return $mship;
+    }
+
+    /**
+     * retrieve a membership
+     * 
+     * @param int $id ID of the membership to get
+     * @return mixed reference to the object if successful, else FALSE
+     */
+    function &get($id)
+    {
+        $ret = false;
+        if (intval($id) > 0) {
+            $sql = 'SELECT * FROM '.$this->db->prefix('groups_users_link').' WHERE linkid='.$id;
+            if ($result = $this->db->query($sql)) {
+                $numrows = $this->db->getRowsNum($result);
+                if ($numrows == 1) {
+                    $mship =& new XoopsMembership();
+                    $mship->assignVars($this->db->fetchArray($result));
+                    $ret =& $mship;
+                }
+            }
+        }
+        return $ret;
+    }
+
+    /**
+     * inserts a membership in the database
+     * 
+     * @param object $mship reference to the membership object
+     * @return bool TRUE if already in DB or successful, FALSE if failed
+     */
+    function insert(&$mship)
+    {
+        if (strtolower(get_class($mship)) != 'xoopsmembership') {
+            return false;
+        }
+        if (!$mship->isDirty()) {
+            return true;
+        }
+        if (!$mship->cleanVars()) {
+            return false;
+        }
+        foreach ($mship->cleanVars as $k => $v) {
+            ${$k} = $v;
+        }
+        if ($mship->isNew()) {
+            $linkid = $this->db->genId('groups_users_link_linkid_seq');
+            $sql = sprintf("INSERT INTO %s (linkid, groupid, uid) VALUES (%u, %u, %u)", $this->db->prefix('groups_users_link'), $linkid, $groupid, $uid);
+        } else {
+            $sql = sprintf("UPDATE %s SET groupid = %u, uid = %u WHERE linkid = %u", $this->db->prefix('groups_users_link'), $groupid, $uid, $linkid);
+        }
+        if (!$result = $this->db->query($sql)) {
+            return false;
+        }
+        if (empty($linkid)) {
+            $linkid = $this->db->getInsertId();
+        }
+        $mship->assignVar('linkid', $linkid);
+        return true;
+    }
+
+    /**
+     * delete a membership from the database
+     * 
+     * @param object $mship reference to the membership object
+     * @return bool FALSE if failed
+     */
+    function delete(&$mship)
+    {
+        if (strtolower(get_class($mship)) != 'xoopsmembership') {
+            return false;
+        }
+        $sql = sprintf("DELETE FROM %s WHERE linkid = %u", $this->db->prefix('groups_users_link'), $groupm->getVar('linkid'));
+        if (!$result = $this->db->query($sql)) {
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     * retrieve memberships from the database
+     * 
+     * @param object $criteria {@link CriteriaElement} conditions to meet
+     * @param bool $id_as_key should the ID be used as the array's key?
+     * @return array array of references
+     */
+    function &getObjects($criteria = null, $id_as_key = false)
+    {
+        $ret = array();
+        $limit = $start = 0;
+        $sql = 'SELECT * FROM '.$this->db->prefix('groups_users_link');
+        if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
+            $sql .= ' '.$criteria->renderWhere();
+            $limit = $criteria->getLimit();
+            $start = $criteria->getStart();
+        }
+        $result = $this->db->query($sql, $limit, $start);
+        if (!$result) {
+            return $ret;
+        }
+        while ($myrow = $this->db->fetchArray($result)) {
+            $mship = new XoopsMembership();
+            $mship->assignVars($myrow);
+            if (!$id_as_key) {
+                $ret[] =& $mship;
+            } else {
+                $ret[$myrow['linkid']] =& $mship;
+            }
+            unset($mship);
+        }
+        return $ret;
+    }
+
+    /**
+     * count how many memberships meet the conditions
+     * 
+     * @param object $criteria {@link CriteriaElement} conditions to meet
+     * @return int
+     */
+    function getCount($criteria = null)
+    {
+        $sql = 'SELECT COUNT(*) FROM '.$this->db->prefix('groups_users_link');
+        if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
+            $sql .= ' '.$criteria->renderWhere();
+        }
+        $result = $this->db->query($sql);
+        if (!$result) {
+            return 0;
+        }
+        list($count) = $this->db->fetchRow($result);
+        return $count;
+    }
+
+    /**
+     * delete all memberships meeting the conditions
+     * 
+     * @param object $criteria {@link CriteriaElement} with conditions to meet
+     * @return bool
+     */
+    function deleteAll($criteria = null)
+    {
+        $sql = 'DELETE FROM '.$this->db->prefix('groups_users_link');
+        if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
+            $sql .= ' '.$criteria->renderWhere();
+        }
+        if (!$result = $this->db->query($sql)) {
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     * retrieve groups for a user
+     * 
+     * @param int $uid ID of the user
+     * @param bool $asobject should the groups be returned as {@link XoopsGroup}
+     * objects? FALSE returns associative array.
+     * @return array array of groups the user belongs to
+     */
+    function getGroupsByUser($uid)
+    {
+        $ret = array();
+        $sql = 'SELECT groupid FROM '.$this->db->prefix('groups_users_link').' WHERE uid='.intval($uid);
+        $result = $this->db->query($sql);
+        if (!$result) {
+            return $ret;
+        }
+        while ($myrow = $this->db->fetchArray($result)) {
+            $ret[] = $myrow['groupid'];
+        }
+        return $ret;
+    }
+
+    /**
+     * retrieve users belonging to a group
+     * 
+     * @param int $groupid ID of the group
+     * @param bool $asobject return users as {@link XoopsUser} objects?
+     * FALSE will return arrays
+     * @param int $limit number of entries to return
+     * @param int $start offset of first entry to return
+     * @return array array of users belonging to the group
+     */
+    function getUsersByGroup($groupid, $limit=0, $start=0)
+    {
+        $ret = array();
+        $sql = 'SELECT uid FROM '.$this->db->prefix('groups_users_link').' WHERE groupid='.intval($groupid);
+        $result = $this->db->query($sql, $limit, $start);
+        if (!$result) {
+            return $ret;
+        }
+        while ($myrow = $this->db->fetchArray($result)) {
+            $ret[] = $myrow['uid'];
+        }
+        return $ret;
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/kernel/imageset.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/kernel/imageset.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/kernel/imageset.php	(revision 405)
@@ -0,0 +1,207 @@
+<?php
+// $Id: imageset.php,v 1.3 2006/05/01 02:37:28 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+if (!defined('XOOPS_ROOT_PATH')) {
+    exit();
+}
+
+class XoopsImageset extends XoopsObject
+{
+
+    function XoopsImageset()
+    {
+        $this->XoopsObject();
+        $this->initVar('imgset_id', XOBJ_DTYPE_INT, null, false);
+        $this->initVar('imgset_name', XOBJ_DTYPE_TXTBOX, null, true, 50);
+        $this->initVar('imgset_refid', XOBJ_DTYPE_INT, 0, false);
+    }
+}
+
+/**
+* XOOPS imageset handler class.  
+* This class is responsible for providing data access mechanisms to the data source 
+* of XOOPS imageset class objects.
+*
+*
+* @author  Kazumi Ono <onokazu@xoops.org>
+*/
+
+class XoopsImagesetHandler extends XoopsObjectHandler
+{
+
+    function &create($isNew = true)
+    {
+        $imgset =& new XoopsImageset();
+        if ($isNew) {
+            $imgset->setNew();
+        }
+        return $imgset;
+    }
+
+    function &get($id)
+    {
+        $ret = false;
+        if (intval($id) > 0) {
+            $sql = 'SELECT * FROM '.$this->db->prefix('imgset').' WHERE imgset_id='.$id;
+            if ($result = $this->db->query($sql)) {
+                $numrows = $this->db->getRowsNum($result);
+                if ($numrows == 1) {
+                    $imgset =& new XoopsImageset();
+                    $imgset->assignVars($this->db->fetchArray($result));
+                    $ret =& $imgset;
+                }
+            }
+        }
+        return $ret;
+    }
+
+    function insert(&$imgset)
+    {
+        if (strtolower(get_class($imgset)) != 'xoopsimageset') {
+            return false;
+        }
+        if (!$imgset->isDirty()) {
+            return true;
+        }
+        if (!$imgset->cleanVars()) {
+            return false;
+        }
+        foreach ($imgset->cleanVars as $k => $v) {
+            ${$k} = $v;
+        }
+        if ($imgset->isNew()) {
+            $imgset_id = $this->db->genId('imgset_imgset_id_seq');
+            $sql = sprintf("INSERT INTO %s (imgset_id, imgset_name, imgset_refid) VALUES (%u, %s, %u)", $this->db->prefix('imgset'), $imgset_id, $this->db->quoteString($imgset_name), $imgset_refid);
+        } else {
+            $sql = sprintf("UPDATE %s SET imgset_name = %s, imgset_refid = %u WHERE imgset_id = %u", $this->db->prefix('imgset'), $this->db->quoteString($imgset_name), $imgset_refid, $imgset_id);
+        }
+        if (!$result = $this->db->query($sql)) {
+            return false;
+        }
+        if (empty($imgset_id)) {
+            $imgset_id = $this->db->getInsertId();
+        }
+        $imgset->assignVar('imgset_id', $imgset_id);
+        return true;
+    }
+
+    function delete(&$imgset)
+    {
+        if (strtolower(get_class($imgset)) != 'xoopsimageset') {
+            return false;
+        }
+        $sql = sprintf("DELETE FROM %s WHERE imgset_id = %u", $this->db->prefix('imgset'), $imgset->getVar('imgset_id'));
+        if (!$result = $this->db->query($sql)) {
+            return false;
+        }
+        $sql = sprintf("DELETE FROM %s WHERE imgset_id = %u", $this->db->prefix('imgset_tplset_link'), $imgset->getVar('imgset_id'));
+        $this->db->query($sql);
+        return true;
+    }
+
+    function &getObjects($criteria = null, $id_as_key = false)
+    {
+        $ret = array();
+        $limit = $start = 0;
+        $sql = 'SELECT DISTINCT i.* FROM '.$this->db->prefix('imgset'). ' i LEFT JOIN '.$this->db->prefix('imgset_tplset_link'). ' l ON l.imgset_id=i.imgset_id';
+        if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
+            $sql .= ' '.$criteria->renderWhere();
+            $limit = $criteria->getLimit();
+            $start = $criteria->getStart();
+        }
+        $result = $this->db->query($sql, $limit, $start);
+        if (!$result) {
+            return $ret;
+        }
+        while ($myrow = $this->db->fetchArray($result)) {
+            $imgset =& new XoopsImageset();
+            $imgset->assignVars($myrow);
+            if (!$id_as_key) {
+                $ret[] =& $imgset;
+            } else {
+                $ret[$myrow['imgset_id']] =& $imgset;
+            }
+            unset($imgset);
+        }
+        return $ret;
+    }
+
+    function linkThemeset($imgset_id, $tplset_name)
+    {
+        $imgset_id = intval($imgset_id);
+        $tplset_name = trim($tplset_name);
+        if ($imgset_id <= 0 || $tplset_name == '') {
+            return false;
+        }
+        if (!$this->unlinkThemeset($imgset_id, $tplset_name)) {
+            return false;
+        }
+        $sql = sprintf("INSERT INTO %s (imgset_id, tplset_name) VALUES (%u, %s)", $this->db->prefix('imgset_tplset_link'), $imgset_id, $this->db->quoteString($tplset_name));
+        $result = $this->db->query($sql);
+        if (!$result) {
+            return false;
+        }
+        return true;
+    }
+
+    function unlinkThemeset($imgset_id, $tplset_name)
+    {
+        $imgset_id = intval($imgset_id);
+        $tplset_name = trim($tplset_name);
+        if ($imgset_id <= 0 || $tplset_name == '') {
+            return false;
+        }
+        $sql = sprintf("DELETE FROM %s WHERE imgset_id = %u AND tplset_name = %s", $this->db->prefix('imgset_tplset_link'), $imgset_id, $this->db->quoteString($tplset_name));
+        $result = $this->db->query($sql);
+        if (!$result) {
+            return false;
+        }
+        return true;
+    }
+
+    function &getList($refid = null, $tplset = null)
+    {
+        $criteria = new CriteriaCompo();
+        if (isset($refid)) {
+            $criteria->add(new Criteria('imgset_refid', intval($refid)));
+        }
+        if (isset($tplset)) {
+            $criteria->add(new Criteria('tplset_name', $tplset));
+        }
+        $imgsets =& $this->getObjects($criteria, true);
+        $ret = array();
+        foreach (array_keys($imgsets) as $i) {
+            $ret[$i] = $imgsets[$i]->getVar('imgset_name');
+        }
+        return $ret;
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/kernel/configoption.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/kernel/configoption.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/kernel/configoption.php	(revision 405)
@@ -0,0 +1,212 @@
+<?php
+// $Id: configoption.php,v 1.3 2006/05/01 02:37:28 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+if (!defined('XOOPS_ROOT_PATH')) {
+    exit();
+}
+
+/**
+ * 
+ * 
+ * @package     kernel
+ * 
+ * @author      Kazumi Ono  <onokazu@xoops.org>
+ * @copyright   copyright (c) 2000-2003 XOOPS.org
+ */
+
+/**
+ * A Config-Option
+ * 
+ * @author  Kazumi Ono  <onokazu@xoops.org>
+ * @copyright   copyright (c) 2000-2003 XOOPS.org
+ * 
+ * @package     kernel
+ */
+class XoopsConfigOption extends XoopsObject
+{
+    /**
+     * Constructor
+     */
+    function XoopsConfigOption()
+    {
+        $this->XoopsObject();
+        $this->initVar('confop_id', XOBJ_DTYPE_INT, null);
+        $this->initVar('confop_name', XOBJ_DTYPE_TXTBOX, null, true, 255);
+        $this->initVar('confop_value', XOBJ_DTYPE_TXTBOX, null, true, 255);
+        $this->initVar('conf_id', XOBJ_DTYPE_INT, 0);
+    }
+}
+
+/**
+ * XOOPS configuration option handler class.  
+ * This class is responsible for providing data access mechanisms to the data source 
+ * of XOOPS configuration option class objects.
+ *
+ * @copyright   copyright (c) 2000-2003 XOOPS.org
+ * @author  Kazumi Ono <onokazu@xoops.org>
+ * 
+ * @package     kernel
+ * @subpackage  config
+*/
+class XoopsConfigOptionHandler extends XoopsObjectHandler
+{
+
+    /**
+     * Create a new option
+     * 
+     * @param   bool    $isNew  Flag the option as "new"?
+     * 
+     * @return  object  {@link XoopsConfigOption} 
+     */
+    function &create($isNew = true)
+    {
+        $confoption =& new XoopsConfigOption();
+        if ($isNew) {
+            $confoption->setNew();
+        }
+        return $confoption;
+    }
+
+    /**
+     * Get an option from the database
+     * 
+     * @param   int $id ID of the option
+     * 
+     * @return  object  reference to the {@link XoopsConfigOption}, FALSE on fail
+     */
+    function &get($id)
+    {
+        $ret = false;
+        $id = intval($id);
+        if ($id > 0) {
+            $sql = 'SELECT * FROM '.$this->db->prefix('configoption').' WHERE confop_id='.$id;
+            if ($result = $this->db->query($sql)) {
+                $numrows = $this->db->getRowsNum($result);
+                if ($numrows == 1) {
+                    $confoption =& new XoopsConfigOption();
+                    $confoption->assignVars($this->db->fetchArray($result));
+                    $ret =& $confoption;
+                }
+            }
+        }
+        return $ret;
+    }
+
+    /**
+     * Insert a new option in the database
+     * 
+     * @param   object  &$confoption    reference to a {@link XoopsConfigOption} 
+     * @return  bool    TRUE if successfull.
+     */
+    function insert(&$confoption)
+    {
+        if (strtolower(get_class($confoption)) != 'xoopsconfigoption') {
+            return false;
+        }
+        if (!$confoption->isDirty()) {
+            return true;
+        }
+        if (!$confoption->cleanVars()) {
+            return false;
+        }
+        foreach ($confoption->cleanVars as $k => $v) {
+            ${$k} = $v;
+        }
+        if ($confoption->isNew()) {
+            $confop_id = $this->db->genId('configoption_confop_id_seq');
+            $sql = sprintf("INSERT INTO %s (confop_id, confop_name, confop_value, conf_id) VALUES (%u, %s, %s, %u)", $this->db->prefix('configoption'), $confop_id, $this->db->quoteString($confop_name), $this->db->quoteString($confop_value), $conf_id);
+        } else {
+            $sql = sprintf("UPDATE %s SET confop_name = %s, confop_value = %s WHERE confop_id = %u", $this->db->prefix('configoption'), $this->db->quoteString($confop_name), $this->db->quoteString($confop_value), $confop_id);
+        }
+        if (!$result = $this->db->query($sql)) {
+            return false;
+        }
+        if (empty($confop_id)) {
+            $confop_id = $this->db->getInsertId();
+        }
+        $confoption->assignVar('confop_id', $confop_id);
+        return $confop_id;
+    }
+
+    /**
+     * Delete an option
+     * 
+     * @param   object  &$confoption    reference to a {@link XoopsConfigOption} 
+     * @return  bool    TRUE if successful
+     */
+    function delete(&$confoption)
+    {
+        if (strtolower(get_class($confoption)) != 'xoopsconfigoption') {
+            return false;
+        }
+        $sql = sprintf("DELETE FROM %s WHERE confop_id = %u", $this->db->prefix('configoption'), $confoption->getVar('confop_id'));
+        if (!$result = $this->db->query($sql)) {
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     * Get some {@link XoopsConfigOption}s 
+     * 
+     * @param   object  $criteria   {@link CriteriaElement} 
+     * @param   bool    $id_as_key  Use the IDs as array-keys?
+     * 
+     * @return  array   Array of {@link XoopsConfigOption}s 
+     */
+    function &getObjects($criteria = null, $id_as_key = false)
+    {
+        $ret = array();
+        $limit = $start = 0;
+        $sql = 'SELECT * FROM '.$this->db->prefix('configoption');
+        if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
+            $sql .= ' '.$criteria->renderWhere().' ORDER BY confop_id '.$criteria->getOrder();
+            $limit = $criteria->getLimit();
+            $start = $criteria->getStart();
+        }
+        $result = $this->db->query($sql, $limit, $start);
+        if (!$result) {
+            return $ret;
+        }
+        while ($myrow = $this->db->fetchArray($result)) {
+            $confoption =& new XoopsConfigOption();
+            $confoption->assignVars($myrow);
+            if (!$id_as_key) {
+                $ret[] =& $confoption;
+            } else {
+                $ret[$myrow['confop_id']] =& $confoption;
+            }
+            unset($confoption);
+        }
+        return $ret;
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/kernel/tplfile.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/kernel/tplfile.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/kernel/tplfile.php	(revision 405)
@@ -0,0 +1,314 @@
+<?php
+// $Id: tplfile.php,v 1.4 2006/05/01 02:37:28 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+if (!defined('XOOPS_ROOT_PATH')) {
+    exit();
+}
+class XoopsTplfile extends XoopsObject
+{
+
+    function XoopsTplfile()
+    {
+        $this->XoopsObject();
+        $this->initVar('tpl_id', XOBJ_DTYPE_INT, null, false);
+        $this->initVar('tpl_refid', XOBJ_DTYPE_INT, 0, false);
+        $this->initVar('tpl_tplset', XOBJ_DTYPE_OTHER, null, false);
+        $this->initVar('tpl_file', XOBJ_DTYPE_TXTBOX, null, true, 100);
+        $this->initVar('tpl_desc', XOBJ_DTYPE_TXTBOX, null, false, 100);
+        $this->initVar('tpl_lastmodified', XOBJ_DTYPE_INT, 0, false);
+        $this->initVar('tpl_lastimported', XOBJ_DTYPE_INT, 0, false);
+        $this->initVar('tpl_module', XOBJ_DTYPE_OTHER, null, false);
+        $this->initVar('tpl_type', XOBJ_DTYPE_OTHER, null, false);
+        $this->initVar('tpl_source', XOBJ_DTYPE_SOURCE, null, false);
+    }
+
+    function &getSource()
+    {
+        $ret =& $this->getVar('tpl_source');
+        return $ret;
+    }
+
+    function getLastModified()
+    {
+        return $this->getVar('tpl_lastmodified');
+    }
+}
+
+/**
+* XOOPS template file handler class.  
+* This class is responsible for providing data access mechanisms to the data source 
+* of XOOPS template file class objects.
+*
+*
+* @author  Kazumi Ono <onokazu@xoops.org>
+*/
+
+class XoopsTplfileHandler extends XoopsObjectHandler
+{
+
+    function &create($isNew = true)
+    {
+        $tplfile =& new XoopsTplfile();
+        if ($isNew) {
+            $tplfile->setNew();
+        }
+        return $tplfile;
+    }
+
+    function &get($id, $getsource = false)
+    {
+        $ret = false;
+        $id = intval($id);
+        if ($id > 0) {
+            if (!$getsource) {
+                $sql = 'SELECT * FROM '.$this->db->prefix('tplfile').' WHERE tpl_id='.$id;
+            } else {
+                $sql = 'SELECT f.*, s.tpl_source FROM '.$this->db->prefix('tplfile').' f LEFT JOIN '.$this->db->prefix('tplsource').' s  ON s.tpl_id=f.tpl_id WHERE f.tpl_id='.$id;
+            }
+            if ($result = $this->db->query($sql)) {
+                $numrows = $this->db->getRowsNum($result);
+                if ($numrows == 1) {
+                    $ret =& new XoopsTplfile();
+                    $ret->assignVars($this->db->fetchArray($result));
+                }
+            }
+        }
+        return $ret;
+    }
+
+    function loadSource(&$tplfile)
+    {
+        if (strtolower(get_class($tplfile)) != 'xoopstplfile') {
+            return false;
+        }
+        if (!$tplfile->getVar('tpl_source')) {
+            $sql = 'SELECT tpl_source FROM '.$this->db->prefix('tplsource').' WHERE tpl_id='.$tplfile->getVar('tpl_id');
+            if (!$result = $this->db->query($sql)) {
+                return false;
+            }
+            $myrow = $this->db->fetchArray($result);
+            $tplfile->assignVar('tpl_source', $myrow['tpl_source']);
+        }
+        return true;
+    }
+
+    function insert(&$tplfile)
+    {
+        if (strtolower(get_class($tplfile)) != 'xoopstplfile') {
+            return false;
+        }
+        if (!$tplfile->isDirty()) {
+            return true;
+        }
+        if (!$tplfile->cleanVars()) {
+            return false;
+        }
+        foreach ($tplfile->cleanVars as $k => $v) {
+            ${$k} = $v;
+        }
+        if ($tplfile->isNew()) {
+            $tpl_id = $this->db->genId('tpltpl_file_id_seq');
+            $sql = sprintf("INSERT INTO %s (tpl_id, tpl_module, tpl_refid, tpl_tplset, tpl_file, tpl_desc, tpl_lastmodified, tpl_lastimported, tpl_type) VALUES (%u, %s, %u, %s, %s, %s, %u, %u, %s)", $this->db->prefix('tplfile'), $tpl_id, $this->db->quoteString($tpl_module), $tpl_refid, $this->db->quoteString($tpl_tplset), $this->db->quoteString($tpl_file), $this->db->quoteString($tpl_desc), $tpl_lastmodified, $tpl_lastimported, $this->db->quoteString($tpl_type));
+            if (!$result = $this->db->query($sql)) {
+                return false;
+            }
+            if (empty($tpl_id)) {
+                $tpl_id = $this->db->getInsertId();
+            }
+            if (isset($tpl_source) && $tpl_source != '') {
+                $sql = sprintf("INSERT INTO %s (tpl_id, tpl_source) VALUES (%u, %s)", $this->db->prefix('tplsource'), $tpl_id, $this->db->quoteString($tpl_source));
+                if (!$result = $this->db->query($sql)) {
+                    $this->db->query(sprintf("DELETE FROM %s WHERE tpl_id = %u", $this->db->prefix('tplfile'), $tpl_id));
+                    return false;
+                }
+            }
+            $tplfile->assignVar('tpl_id', $tpl_id);
+        } else {
+            $sql = sprintf("UPDATE %s SET tpl_tplset = %s, tpl_file = %s, tpl_desc = %s, tpl_lastimported = %u, tpl_lastmodified = %u WHERE tpl_id = %u", $this->db->prefix('tplfile'), $this->db->quoteString($tpl_tplset), $this->db->quoteString($tpl_file), $this->db->quoteString($tpl_desc), $tpl_lastimported, $tpl_lastmodified, $tpl_id);
+            if (!$result = $this->db->query($sql)) {
+                return false;
+            }
+            if (isset($tpl_source) && $tpl_source != '') {
+                $sql = sprintf("UPDATE %s SET tpl_source = %s WHERE tpl_id = %u", $this->db->prefix('tplsource'), $this->db->quoteString($tpl_source), $tpl_id);
+                if (!$result = $this->db->query($sql)) {
+                    return false;
+                }
+            }
+        }
+        return true;
+    }
+
+    function forceUpdate(&$tplfile)
+    {
+        if (strtolower(get_class($tplfile)) != 'xoopstplfile') {
+            return false;
+        }
+        if (!$tplfile->isDirty()) {
+            return true;
+        }
+        if (!$tplfile->cleanVars()) {
+            return false;
+        }
+        foreach ($tplfile->cleanVars as $k => $v) {
+            ${$k} = $v;
+        }
+        if (!$tplfile->isNew()) {
+            $sql = sprintf("UPDATE %s SET tpl_tplset = %s, tpl_file = %s, tpl_desc = %s, tpl_lastimported = %u, tpl_lastmodified = %u WHERE tpl_id = %u", $this->db->prefix('tplfile'), $this->db->quoteString($tpl_tplset), $this->db->quoteString($tpl_file), $this->db->quoteString($tpl_desc), $tpl_lastimported, $tpl_lastmodified, $tpl_id);
+            if (!$result = $this->db->queryF($sql)) {
+                return false;
+            }
+            if (isset($tpl_source) && $tpl_source != '') {
+                $sql = sprintf("UPDATE %s SET tpl_source = %s WHERE tpl_id = %u", $this->db->prefix('tplsource'), $this->db->quoteString($tpl_source), $tpl_id);
+                if (!$result = $this->db->queryF($sql)) {
+                    return false;
+                }
+            }
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    function delete(&$tplfile)
+    {
+        if (strtolower(get_class($tplfile)) != 'xoopstplfile') {
+            return false;
+        }
+        $id = $tplfile->getVar('tpl_id');
+        $sql = sprintf("DELETE FROM %s WHERE tpl_id = %u", $this->db->prefix('tplfile'), $id);
+        if (!$result = $this->db->query($sql)) {
+            return false;
+        }
+        $sql = sprintf("DELETE FROM %s WHERE tpl_id = %u", $this->db->prefix('tplsource'), $id);
+        $this->db->query($sql);
+        return true;
+    }
+
+    function &getObjects($criteria = null, $getsource = false, $id_as_key = false)
+    {
+        $ret = array();
+        $limit = $start = 0;
+        if ($getsource) {
+            $sql = 'SELECT f.*, s.tpl_source FROM '.$this->db->prefix('tplfile').' f LEFT JOIN '.$this->db->prefix('tplsource').' s ON s.tpl_id=f.tpl_id';
+        } else {
+            $sql = 'SELECT * FROM '.$this->db->prefix('tplfile');
+        }
+        if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
+            $sql .= ' '.$criteria->renderWhere().' ORDER BY tpl_refid';
+            $limit = $criteria->getLimit();
+            $start = $criteria->getStart();
+        }
+        $result = $this->db->query($sql, $limit, $start);
+        if (!$result) {
+            return $ret;
+        }
+        while ($myrow = $this->db->fetchArray($result)) {
+            $tplfile =& new XoopsTplfile();
+            $tplfile->assignVars($myrow);
+            if (!$id_as_key) {
+                $ret[] =& $tplfile;
+            } else {
+                $ret[$myrow['tpl_id']] =& $tplfile;
+            }
+            unset($tplfile);
+        }
+        return $ret;
+    }
+
+    function getCount($criteria = null)
+    {
+        $sql = 'SELECT COUNT(*) FROM '.$this->db->prefix('tplfile');
+        if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
+            $sql .= ' '.$criteria->renderWhere();
+        }
+        if (!$result =& $this->db->query($sql)) {
+            return 0;
+        }
+        list($count) = $this->db->fetchRow($result);
+        return $count;
+    }
+
+    function getModuleTplCount($tplset)
+    {
+        $ret = array();
+        $sql = "SELECT tpl_module, COUNT(tpl_id) AS count FROM ".$this->db->prefix('tplfile')." WHERE tpl_tplset=".$this->db->quoteString($tplset)." GROUP BY tpl_module";
+        $result = $this->db->query($sql);
+        if (!$result) {
+            return $ret;
+        }
+        while ($myrow = $this->db->fetchArray($result)) {
+            if ($myrow['tpl_module'] != '') {
+                $ret[$myrow['tpl_module']] = $myrow['count'];
+            }
+        }
+        return $ret;
+    }
+
+    function &find($tplset = null, $type = null, $refid = null, $module = null, $file = null, $getsource = false)
+    {
+        $criteria = new CriteriaCompo();
+        if (isset($tplset)) {
+            $criteria->add(new Criteria('tpl_tplset', addslashes(trim($tplset))));
+        }
+        if (isset($module)) {
+            $criteria->add(new Criteria('tpl_module', $module));
+        }
+        if (isset($refid)) {
+            $criteria->add(new Criteria('tpl_refid', $refid));
+        }
+        if (isset($file)) {
+            $criteria->add(new Criteria('tpl_file', $file));
+        }
+        if (isset($type)) {
+            if (is_array($type)) {
+                $criteria2 = new CriteriaCompo();
+                foreach ($type as $t) {
+                    $criteria2->add(new Criteria('tpl_type', $t), 'OR');
+                }
+                $criteria->add($criteria2);
+            } else {
+                $criteria->add(new Criteria('tpl_type', $type));
+            }
+        }
+        $ret =& $this->getObjects($criteria, $getsource, false);
+        return $ret;
+    }
+
+    function templateExists($tplname, $tplset_name)
+    {
+        $criteria = new CriteriaCompo(new Criteria('tpl_file', trim($tplname)));
+        $criteria->add(new Criteria('tpl_tplset', addslashes(trim($tplset_name))));
+        if ($this->getCount($criteria) > 0) {
+            return true;
+        }
+        return false;
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/kernel/comment.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/kernel/comment.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/kernel/comment.php	(revision 405)
@@ -0,0 +1,456 @@
+<?php
+// $Id: comment.php,v 1.2 2005/03/18 12:52:14 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.xoops.org/ http://jp.xoops.org/  http://www.myweb.ne.jp/  //
+// Project: The XOOPS Project (http://www.xoops.org/)                        //
+// ------------------------------------------------------------------------- //
+
+if (!defined('XOOPS_ROOT_PATH')) {
+	exit();
+}
+
+/**
+ * 
+ * 
+ * @package     kernel
+ * 
+ * @author	    Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ */
+
+/**
+ * A Comment
+ * 
+ * @package     kernel
+ * 
+ * @author	    Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ */
+class XoopsComment extends XoopsObject
+{
+
+    /**
+     * Constructor
+     **/
+    function XoopsComment()
+    {
+        $this->XoopsObject();
+        $this->initVar('com_id', XOBJ_DTYPE_INT, null, false);
+        $this->initVar('com_pid', XOBJ_DTYPE_INT, 0, false);
+        $this->initVar('com_modid', XOBJ_DTYPE_INT, null, false);
+        $this->initVar('com_icon', XOBJ_DTYPE_OTHER, null, false);
+        $this->initVar('com_title', XOBJ_DTYPE_TXTBOX, null, true, 255, true);
+        
+        
+        //Added By Viva(2005/12/13) --->
+        $this->initVar('com_poster_name',XOBJ_DTYPE_TXTBOX,null,true,60,true);
+        //Added By Viva(2005/12/13) <---
+        
+        
+        $this->initVar('com_text', XOBJ_DTYPE_TXTAREA, null, true, null, true);
+        $this->initVar('com_created', XOBJ_DTYPE_INT, 0, false);
+        $this->initVar('com_modified', XOBJ_DTYPE_INT, 0, false);
+        $this->initVar('com_uid', XOBJ_DTYPE_INT, 0, true);
+        $this->initVar('com_ip', XOBJ_DTYPE_OTHER, null, false);
+        $this->initVar('com_sig', XOBJ_DTYPE_INT, 0, false);
+        $this->initVar('com_itemid', XOBJ_DTYPE_INT, 0, false);
+        $this->initVar('com_rootid', XOBJ_DTYPE_INT, 0, false);
+        $this->initVar('com_status', XOBJ_DTYPE_INT, 0, false);
+        $this->initVar('com_exparams', XOBJ_DTYPE_OTHER, null, false, 255);
+        $this->initVar('dohtml', XOBJ_DTYPE_INT, 0, false);
+        $this->initVar('dosmiley', XOBJ_DTYPE_INT, 0, false);
+        $this->initVar('doxcode', XOBJ_DTYPE_INT, 0, false);
+        $this->initVar('doimage', XOBJ_DTYPE_INT, 0, false);
+        $this->initVar('dobr', XOBJ_DTYPE_INT, 0, false);
+    }
+
+	/**
+	 * Is this comment on the root level?
+	 * 
+	 * @return  bool
+	 **/
+	function isRoot()
+    {
+        return ($this->getVar('com_id') == $this->getVar('com_rootid'));
+    }
+}
+
+/**
+ * XOOPS comment handler class.  
+ * 
+ * This class is responsible for providing data access mechanisms to the data source 
+ * of XOOPS comment class objects.
+ *
+ * 
+ * @package     kernel
+ * @subpackage  comment
+ * 
+ * @author	    Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ */
+class XoopsCommentHandler extends XoopsObjectHandler
+{
+
+    /**
+     * Create a {@link XoopsComment} 
+     * 
+     * @param	bool    $isNew  Flag the object as "new"?
+     * 
+     * @return	object
+     */
+    function &create($isNew = true)
+    {
+        $comment = new XoopsComment();
+        if ($isNew) {
+            $comment->setNew();
+        }
+        return $comment;
+    }
+
+    /**
+     * Retrieve a {@link XoopsComment} 
+     * 
+     * @param   int $id ID
+     * 
+     * @return  object  {@link XoopsComment}, FALSE on fail
+     **/
+    function &get($id)
+    {
+        $id = intval($id);
+        if ($id > 0) {
+            $sql = 'SELECT * FROM '.$this->db->prefix('xoopscomments').' WHERE com_id='.$id;
+            if (!$result = $this->db->query($sql)) {
+                return false;
+            }
+            $numrows = $this->db->getRowsNum($result);
+            if ($numrows == 1) {
+                $comment = new XoopsComment();
+                $comment->assignVars($this->db->fetchArray($result));
+                return $comment;
+            }
+        }
+        return false;
+    }
+
+    /**
+     * Write a comment to database
+     * 
+     * @param   object  &$comment
+     * 
+     * @return  bool
+     **/
+    function insert(&$comment)
+    {
+        if (strtolower(get_class($comment)) != 'xoopscomment') {
+            return false;
+        }
+        if (!$comment->isDirty()) {
+            return true;
+        }
+        if (!$comment->cleanVars()) {
+            return false;
+        }
+        foreach ($comment->cleanVars as $k => $v) {
+            ${$k} = $v;
+        }
+        if ($comment->isNew()) {
+            $com_id = $this->db->genId('xoopscomments_com_id_seq');
+            
+            
+            //Modified By Viva(2005/12/13) --->
+            //$sql = sprintf("INSERT INTO %s (com_id, com_pid, com_modid, com_icon, com_title, com_text, com_created, com_modified, com_uid, com_ip, com_sig, com_itemid, com_rootid, com_status, com_exparams, dohtml, dosmiley, doxcode, doimage, dobr) VALUES (%u, %u, %u, %s, %s, %s, %u, %u, %u, %s, %u, %u, %u, %u, %s, %u, %u, %u, %u, %u)", $this->db->prefix('xoopscomments'), $com_id, $com_pid, $com_modid, $this->db->quoteString($com_icon), $this->db->quoteString($com_title), $this->db->quoteString($com_text), $com_created, $com_modified, $com_uid, $this->db->quoteString($com_ip), $com_sig, $com_itemid, $com_rootid, $com_status, $this->db->quoteString($com_exparams), $dohtml, $dosmiley, $doxcode, $doimage, $dobr);
+            $sql = sprintf("INSERT INTO %s (com_id, com_pid, com_modid, com_icon, com_title, com_text, com_created, com_modified, com_uid, com_ip, com_sig, com_itemid, com_rootid, com_status, com_exparams, dohtml, dosmiley, doxcode, doimage, dobr, com_poster_name) VALUES (%u, %u, %u, %s, %s, %s, %u, %u, %u, %s, %u, %u, %u, %u, %s, %u, %u, %u, %u, %u, %s)", $this->db->prefix('xoopscomments'), $com_id, $com_pid, $com_modid, $this->db->quoteString($com_icon), $this->db->quoteString($com_title), $this->db->quoteString($com_text), $com_created, $com_modified, $com_uid, $this->db->quoteString($com_ip), $com_sig, $com_itemid, $com_rootid, $com_status, $this->db->quoteString($com_exparams), $dohtml, $dosmiley, $doxcode, $doimage, $dobr, $this->db->quoteString($com_poster_name));
+            //Modified By Viva(2005/12/13) <---
+
+
+        } else {
+            $sql = sprintf("UPDATE %s SET com_pid = %u, com_icon = %s, com_title = %s, com_text = %s, com_created = %u, com_modified = %u, com_uid = %u, com_ip = %s, com_sig = %u, com_itemid = %u, com_rootid = %u, com_status = %u, com_exparams = %s, dohtml = %u, dosmiley = %u, doxcode = %u, doimage = %u, dobr = %u WHERE com_id = %u", $this->db->prefix('xoopscomments'), $com_pid, $this->db->quoteString($com_icon), $this->db->quoteString($com_title), $this->db->quoteString($com_text), $com_created, $com_modified, $com_uid, $this->db->quoteString($com_ip), $com_sig, $com_itemid, $com_rootid, $com_status, $this->db->quoteString($com_exparams), $dohtml, $dosmiley, $doxcode, $doimage, $dobr, $com_id);
+        }
+        if (!$result = $this->db->query($sql)) {
+            return false;
+        }
+        if (empty($com_id)) {
+            $com_id = $this->db->getInsertId();
+        }
+        $comment->assignVar('com_id', $com_id);
+        return true;
+    }
+
+    /**
+     * Delete a {@link XoopsComment} from the database
+     * 
+     * @param   object  &$comment
+     * 
+     * @return  bool
+     **/
+    function delete(&$comment)
+    {
+        if (strtolower(get_class($comment)) != 'xoopscomment') {
+            return false;
+        }
+        $sql = sprintf("DELETE FROM %s WHERE com_id = %u", $this->db->prefix('xoopscomments'), $comment->getVar('com_id'));
+        if (!$result = $this->db->query($sql)) {
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     * Get some {@link XoopsComment}s 
+     * 
+     * @param   object  $criteria
+     * @param   bool    $id_as_key  Use IDs as keys into the array?
+     * 
+     * @return  array   Array of {@link XoopsComment} objects
+     **/
+    function &getObjects($criteria = null, $id_as_key = false)
+    {
+        $ret = array();
+        $limit = $start = 0;
+        $sql = 'SELECT * FROM '.$this->db->prefix('xoopscomments');
+        if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
+            $sql .= ' '.$criteria->renderWhere();
+            $sort = ($criteria->getSort() != '') ? $criteria->getSort() : 'com_id';
+            $sql .= ' ORDER BY '.$sort.' '.$criteria->getOrder();
+            $limit = $criteria->getLimit();
+            $start = $criteria->getStart();
+        }
+        $result = $this->db->query($sql, $limit, $start);
+        if (!$result) {
+            return $ret;
+        }
+        while ($myrow = $this->db->fetchArray($result)) {
+            $comment = new XoopsComment();
+            $comment->assignVars($myrow);
+            if (!$id_as_key) {
+                $ret[] =& $comment;
+            } else {
+                $ret[$myrow['com_id']] =& $comment;
+            }
+            unset($comment);
+        }
+        return $ret;
+    }
+
+    /**
+     * Count Comments
+     * 
+     * @param   object  $criteria   {@link CriteriaElement} 
+     * 
+     * @return  int     Count
+     **/
+    function getCount($criteria = null)
+    {
+        $sql = 'SELECT COUNT(*) FROM '.$this->db->prefix('xoopscomments');
+        if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
+            $sql .= ' '.$criteria->renderWhere();
+        }
+        if (!$result =& $this->db->query($sql)) {
+            return 0;
+        }
+        list($count) = $this->db->fetchRow($result);
+        return $count;
+    }
+
+    /**
+     * Delete multiple comments
+     * 
+     * @param   object  $criteria   {@link CriteriaElement} 
+     * 
+     * @return  bool
+     **/
+    function deleteAll($criteria = null)
+    {
+        $sql = 'DELETE FROM '.$this->db->prefix('xoopscomments');
+        if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
+            $sql .= ' '.$criteria->renderWhere();
+        }
+        if (!$result = $this->db->query($sql)) {
+            return false;
+        }
+        return true;
+    }
+
+   /**
+     * Get a list of comments
+     * 
+     * @param   object  $criteria   {@link CriteriaElement} 
+     * 
+     * @return  array   Array of raw database records
+     **/
+    function &getList($criteria = null)
+    {
+        $comments =& $this->getObjects($criteria, true);
+        $ret = array();
+        foreach (array_keys($comments) as $i) {
+            $ret[$i] = $comments[$i]->getVar('com_title');
+        }
+        return $ret;
+    }
+
+    /**
+     * Retrieves comments for an item
+     * 
+     * @param   int     $module_id  Module ID
+     * @param   int     $item_id    Item ID
+     * @param   string  $order      Sort order
+     * @param   int     $status     Status of the comment
+     * @param   int     $limit      Max num of comments to retrieve
+     * @param   int     $start      Start offset
+     * 
+     * @return  array   Array of {@link XoopsComment} objects
+     **/
+    function &getByItemId($module_id, $item_id, $order = null, $status = null, $limit = null, $start = 0)
+    {
+        $criteria = new CriteriaCompo(new Criteria('com_modid', intval($module_id)));
+        $criteria->add(new Criteria('com_itemid', intval($item_id)));
+        if (isset($status)) {
+            $criteria->add(new Criteria('com_status', intval($status)));
+        }
+        if (isset($order)) {
+            $criteria->setOrder($order);
+        }
+        if (isset($limit)) {
+            $criteria->setLimit($limit);
+			$criteria->setStart($start);
+        }
+        return $this->getObjects($criteria);
+    }
+
+    /**
+     * Gets total number of comments for an item
+     * 
+     * @param   int     $module_id  Module ID
+     * @param   int     $item_id    Item ID
+     * @param   int     $status     Status of the comment
+     * 
+     * @return  array   Array of {@link XoopsComment} objects
+     **/
+    function &getCountByItemId($module_id, $item_id, $status = null)
+    {
+        $criteria = new CriteriaCompo(new Criteria('com_modid', intval($module_id)));
+        $criteria->add(new Criteria('com_itemid', intval($item_id)));
+        if (isset($status)) {
+            $criteria->add(new Criteria('com_status', intval($status)));
+        }
+        return $this->getCount($criteria);
+    }
+
+
+    /**
+     * Get the top {@link XoopsComment}s 
+     * 
+     * @param   int     $module_id
+     * @param   int     $item_id
+     * @param   strint  $order
+     * @param   int     $status
+     * 
+     * @return  array   Array of {@link XoopsComment} objects
+     **/
+    function &getTopComments($module_id, $item_id, $order, $status = null)
+    {
+        $criteria = new CriteriaCompo(new Criteria('com_modid', intval($module_id)));
+        $criteria->add(new Criteria('com_itemid', intval($item_id)));
+        $criteria->add(new Criteria('com_pid', 0));
+        if (isset($status)) {
+            $criteria->add(new Criteria('com_status', intval($status)));
+        }
+        $criteria->setOrder($order);
+        return $this->getObjects($criteria);
+    }
+
+    /**
+     * Retrieve a whole thread
+     * 
+     * @param   int     $comment_rootid
+     * @param   int     $comment_id
+     * @param   int     $status
+     * 
+     * @return  array   Array of {@link XoopsComment} objects
+     **/
+    function &getThread($comment_rootid, $comment_id, $status = null)
+    {
+        $criteria = new CriteriaCompo(new Criteria('com_rootid', intval($comment_rootid)));
+        $criteria->add(new Criteria('com_id', intval($comment_id), '>='));
+        if (isset($status)) {
+            $criteria->add(new Criteria('com_status', intval($status)));
+        }
+        return $this->getObjects($criteria);
+    }
+
+    /**
+     * Update
+     * 
+     * @param   object  &$comment       {@link XoopsComment} object
+     * @param   string  $field_name     Name of the field
+     * @param   mixed   $field_value    Value to write
+     * 
+     * @return  bool
+     **/
+    function updateByField(&$comment, $field_name, $field_value)
+    {
+        $comment->unsetNew();
+        $comment->setVar($field_name, $field_value);
+        return $this->insert($comment);
+    }
+
+    /**
+     * Delete all comments for one whole module
+     * 
+     * @param   int $module_id  ID of the module
+     * @return  bool
+     **/
+    function deleteByModule($module_id)
+    {
+        return $this->deleteAll(new Criteria('com_modid', intval($module_id)));
+    }
+
+    /**
+     * Change a value in multiple comments
+     * 
+     * @param   string  $fieldname  Name of the field
+     * @param   string  $fieldvalue Value to write
+     * @param   object  $criteria   {@link CriteriaElement} 
+     * 
+     * @return  bool
+     **/
+/*    
+    function updateAll($fieldname, $fieldvalue, $criteria = null)
+    {
+        $set_clause = is_numeric($fieldvalue) ? $filedname.' = '.$fieldvalue : $filedname.' = '.$this->db->quoteString($fieldvalue);
+        $sql = 'UPDATE '.$this->db->prefix('xoopscomments').' SET '.$set_clause;
+        if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
+            $sql .= ' '.$criteria->renderWhere();
+        }
+        if (!$result = $this->db->query($sql)) {
+            return false;
+        }
+        return true;
+    }
+*/
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/kernel/configcategory.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/kernel/configcategory.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/kernel/configcategory.php	(revision 405)
@@ -0,0 +1,219 @@
+<?php
+// $Id: configcategory.php,v 1.3 2006/05/01 02:37:28 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+if (!defined('XOOPS_ROOT_PATH')) {
+    exit();
+}
+
+/**
+ * 
+ * 
+ * @package     kernel
+ * 
+ * @author      Kazumi Ono  <onokazu@xoops.org>
+ * @copyright   copyright (c) 2000-2003 XOOPS.org
+ */
+
+
+/**
+ * A category of configs
+ * 
+ * @author  Kazumi Ono  <onokazu@xoops.org>
+ * @copyright   copyright (c) 2000-2003 XOOPS.org
+ * 
+ * @package     kernel
+ */
+class XoopsConfigCategory extends XoopsObject
+{
+    /**
+     * Constructor
+     * 
+     */
+    function XoopsConfigCategory()
+    {
+        $this->XoopsObject();
+        $this->initVar('confcat_id', XOBJ_DTYPE_INT, null);
+        $this->initVar('confcat_name', XOBJ_DTYPE_OTHER, null);
+        $this->initVar('confcat_order', XOBJ_DTYPE_INT, 0);
+    }
+}
+
+
+/**
+ * XOOPS configuration category handler class.  
+ * 
+ * This class is responsible for providing data access mechanisms to the data source 
+ * of XOOPS configuration category class objects.
+ *
+ * @author  Kazumi Ono <onokazu@xoops.org>
+ * @copyright   copyright (c) 2000-2003 XOOPS.org
+ * 
+ * @package     kernel
+ * @subpackage  config
+ */
+class XoopsConfigCategoryHandler extends XoopsObjectHandler
+{
+
+    /**
+     * Create a new category
+     * 
+     * @param   bool    $isNew  Flag the new object as "new"?
+     * 
+     * @return  object  New {@link XoopsConfigCategory} 
+     */
+    function &create($isNew = true)
+    {
+        $confcat =& new XoopsConfigCategory();
+        if ($isNew) {
+            $confcat->setNew();
+        }
+        return $confcat;
+    }
+
+    /**
+     * Retrieve a {@link XoopsConfigCategory} 
+     * 
+     * @param   int $id ID
+     * 
+     * @return  object  {@link XoopsConfigCategory}, FALSE on fail
+     */
+    function &get($id)
+    {
+        $ret = false;
+        $id = intval($id);
+        if ($id > 0) {
+            $sql = 'SELECT * FROM '.$this->db->prefix('configcategory').' WHERE confcat_id='.$id;
+            if ($result = $this->db->query($sql)) {
+                $numrows = $this->db->getRowsNum($result);
+                if ($numrows == 1) {
+                    $confcat =& new XoopsConfigCategory();
+                    $confcat->assignVars($this->db->fetchArray($result), false);
+                    $ret =& $confcat;
+                }
+            }
+        }
+        return $ret;
+    }
+
+    /**
+     * Store a {@link XoopsConfigCategory}
+     * 
+     * @param   object   &$confcat  {@link XoopsConfigCategory}
+     * 
+     * @return  bool    TRUE on success
+     */
+    function insert(&$confcat)
+    {
+        if (strtolower(get_class($confcat)) != 'xoopsconfigcategory') {
+            return false;
+        }
+        if (!$confcat->isDirty()) {
+            return true;
+        }
+        if (!$confcat->cleanVars()) {
+            return false;
+        }
+        foreach ($confcat->cleanVars as $k => $v) {
+            ${$k} = $v;
+        }
+        if ($confcat->isNew()) {
+            $confcat_id = $this->db->genId('configcategory_confcat_id_seq');
+            $sql = sprintf("INSERT INTO %s (confcat_id, confcat_name, confcat_order) VALUES (%u, %s, %u)", $this->db->prefix('configcategory'), $confcat_id, $this->db->quoteString($confcat_name), $confcat_order);
+        } else {
+            $sql = sprintf("UPDATE %s SET confcat_name = %s, confcat_order = %u WHERE confcat_id = %u", $this->db->prefix('configcategory'), $this->db->quoteString($confcat_name), $confcat_order, $confcat_id);
+        }
+        if (!$result = $this->db->query($sql)) {
+            return false;
+        }
+        if (empty($confcat_id)) {
+            $confcat_id = $this->db->getInsertId();
+        }
+        $confcat->assignVar('confcat_id', $confcat_id);
+        return $confcat_id;
+    }
+
+    /**
+     * Delelete a {@link XoopsConfigCategory}
+     * 
+     * @param   object  &$confcat   {@link XoopsConfigCategory}
+     * 
+     * @return  bool    TRUE on success
+     */
+    function delete(&$confcat)
+    {
+        if (strtolower(get_class($confcat)) != 'xoopsconfigcategory') {
+            return false;
+        }
+        $sql = sprintf("DELETE FROM %s WHERE confcat_id = %u", $this->db->prefix('configcategory'), $configcategory->getVar('confcat_id'));
+        if (!$result = $this->db->query($sql)) {
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     * Get some {@link XoopsConfigCategory}s
+     * 
+     * @param   object  $criteria   {@link CriteriaElement} 
+     * @param   bool    $id_as_key  Use the IDs as keys to the array?
+     * 
+     * @return  array   Array of {@link XoopsConfigCategory}s
+     */
+    function &getObjects($criteria = null, $id_as_key = false)
+    {
+        $ret = array();
+        $limit = $start = 0;
+        $sql = 'SELECT * FROM '.$this->db->prefix('configcategory');
+        if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
+            $sql .= ' '.$criteria->renderWhere();
+            $sort = !in_array($criteria->getSort(), array('confcat_id', 'confcat_name', 'confcat_order')) ? 'confcat_order' : $criteria->getSort();
+            $sql .= ' ORDER BY '.$sort.' '.$criteria->getOrder();
+            $limit = $criteria->getLimit();
+            $start = $criteria->getStart();
+        }
+        $result = $this->db->query($sql, $limit, $start);
+        if (!$result) {
+            return $ret;
+        }
+        while ($myrow = $this->db->fetchArray($result)) {
+            $confcat =& new XoopsConfigCategory();
+            $confcat->assignVars($myrow, false);
+            if (!$id_as_key) {
+                $ret[] =& $confcat;
+            } else {
+                $ret[$myrow['confcat_id']] =& $confcat;
+            }
+            unset($confcat);
+        }
+        return $ret;
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/kernel/config.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/kernel/config.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/kernel/config.php	(revision 405)
@@ -0,0 +1,310 @@
+<?php
+// $Id: config.php,v 1.3 2006/05/01 02:37:28 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+if (!defined('XOOPS_ROOT_PATH')) {
+    exit();
+}
+
+require_once XOOPS_ROOT_PATH.'/kernel/configoption.php';
+require_once XOOPS_ROOT_PATH.'/kernel/configitem.php';
+
+/**
+ * @package     kernel
+ * 
+ * @author      Kazumi Ono  <onokazu@xoops.org>
+ * @copyright   copyright (c) 2000-2003 XOOPS.org
+ */
+
+
+/**
+* XOOPS configuration handling class.
+* This class acts as an interface for handling general configurations of XOOPS
+* and its modules.
+*
+*
+* @author  Kazumi Ono <webmaster@myweb.ne.jp>
+* @todo    Tests that need to be made:
+*          - error handling
+* @access  public
+*/
+
+class XoopsConfigHandler
+{
+
+    /**
+     * holds reference to config item handler(DAO) class
+     * 
+     * @var     object
+     * @access  private
+     */
+    var $_cHandler;
+
+    /**
+     * holds reference to config option handler(DAO) class
+     * 
+     * @var     object
+     * @access  private
+     */
+    var $_oHandler;
+
+    /**
+     * holds an array of cached references to config value arrays,
+     *  indexed on module id and category id
+     *
+     * @var     array
+     * @access  private
+     */
+    var $_cachedConfigs = array();
+
+    /**
+     * Constructor
+     * 
+     * @param   object  &$db    reference to database object
+     */
+    function XoopsConfigHandler(&$db)
+    {
+        $this->_cHandler =& new XoopsConfigItemHandler($db);
+        $this->_oHandler =& new XoopsConfigOptionHandler($db);
+    }
+
+    /**
+     * Create a config
+     * 
+     * @see     XoopsConfigItem
+     * @return  object  reference to the new {@link XoopsConfigItem}
+     */
+    function &createConfig()
+    {
+        $ret =& $this->_cHandler->create();
+        return $ret;
+    }
+
+    /**
+     * Get a config
+     * 
+     * @param   int     $id             ID of the config
+     * @param   bool    $withoptions    load the config's options now?
+     * @return  object  reference to the {@link XoopsConfig} 
+     */
+    function &getConfig($id, $withoptions = false)
+    {
+        $config =& $this->_cHandler->get($id);
+        if ($withoptions == true) {
+            $config->setConfOptions($this->getConfigOptions(new Criteria('conf_id', $id)));
+        }
+        return $config;
+    }
+
+    /**
+     * insert a new config in the database
+     * 
+     * @param   object  &$config    reference to the {@link XoopsConfigItem} 
+     */
+    function insertConfig(&$config)
+    {
+        if (!$this->_cHandler->insert($config)) {
+            return false;
+        }
+        $options =& $config->getConfOptions();
+        $count = count($options);
+        $conf_id = $config->getVar('conf_id');
+        for ($i = 0; $i < $count; $i++) {
+            $options[$i]->setVar('conf_id', $conf_id);
+            if (!$this->_oHandler->insert($options[$i])) {
+                echo $options[$i]->getErrors();
+            }
+        }
+        if (!empty($this->_cachedConfigs[$config->getVar('conf_modid')][$config->getVar('conf_catid')])) {
+            unset ($this->_cachedConfigs[$config->getVar('conf_modid')][$config->getVar('conf_catid')]);
+        }
+        return true;
+    }
+
+    /**
+     * Delete a config from the database
+     * 
+     * @param   object  &$config    reference to a {@link XoopsConfigItem} 
+     */
+    function deleteConfig(&$config)
+    {
+        if (!$this->_cHandler->delete($config)) {
+            return false;
+        }
+        $options =& $config->getConfOptions();
+        $count = count($options);
+        if ($count == 0) {
+            $options =& $this->getConfigOptions(new Criteria('conf_id', $config->getVar('conf_id')));
+            $count = count($options);
+        }
+        if (is_array($options) && $count > 0) {
+            for ($i = 0; $i < $count; $i++) {
+                $this->_oHandler->delete($options[$i]);
+            }
+        }
+        if (!empty($this->_cachedConfigs[$config->getVar('conf_modid')][$config->getVar('conf_catid')])) {
+            unset ($this->_cachedConfigs[$config->getVar('conf_modid')][$config->getVar('conf_catid')]);
+        }
+        return true;
+    }
+
+    /**
+     * get one or more Configs
+     * 
+     * @param   object  $criteria       {@link CriteriaElement} 
+     * @param   bool    $id_as_key      Use the configs' ID as keys?
+     * @param   bool    $with_options   get the options now?
+     * 
+     * @return  array   Array of {@link XoopsConfigItem} objects
+     */
+    function &getConfigs($criteria = null, $id_as_key = false, $with_options = false)
+    {
+        $ret =& $this->_cHandler->getObjects($criteria, $id_as_key); 
+        return $ret;
+    }
+
+    /**
+     * Count some configs
+     * 
+     * @param   object  $criteria   {@link CriteriaElement} 
+     */
+    function getConfigCount($criteria = null)
+    {
+        return $this->_cHandler->getCount($criteria);
+    }
+
+    /**
+     * Get configs from a certain category
+     * 
+     * @param   int $category   ID of a category
+     * @param   int $module     ID of a module
+     * 
+     * @return  array   array of {@link XoopsConfig}s 
+     */
+    function &getConfigsByCat($category, $module = 0)
+    {
+        static $_cachedConfigs;
+        if (!empty($_cachedConfigs[$module][$category])) {
+            return $_cachedConfigs[$module][$category];
+        } else {
+            $ret = array();
+            $criteria = new CriteriaCompo(new Criteria('conf_modid', intval($module)));
+            if (!empty($category)) {
+                $criteria->add(new Criteria('conf_catid', intval($category)));
+            }
+            $configs =& $this->getConfigs($criteria, true);
+            if (is_array($configs)) {
+                foreach (array_keys($configs) as $i) {
+                    $ret[$configs[$i]->getVar('conf_name')] = $configs[$i]->getConfValueForOutput();
+                }
+            }
+            $_cachedConfigs[$module][$category] =& $ret;
+            return $ret;
+        }
+    }
+
+    /**
+     * Make a new {@link XoopsConfigOption} 
+     * 
+     * @return  object  {@link XoopsConfigOption} 
+     */
+    function &createConfigOption(){
+        $ret =& $this->_oHandler->create();
+        return $ret;
+    }
+
+    /**
+     * Get a {@link XoopsConfigOption} 
+     * 
+     * @param   int $id ID of the config option
+     * 
+     * @return  object  {@link XoopsConfigOption} 
+     */
+    function &getConfigOption($id)
+    {
+        $ret =& $this->_oHandler->get($id);
+        return $ret;
+    }
+
+    /**
+     * Get one or more {@link XoopsConfigOption}s
+     * 
+     * @param   object  $criteria   {@link CriteriaElement} 
+     * @param   bool    $id_as_key  Use IDs as keys in the array?
+     * 
+     * @return  array   Array of {@link XoopsConfigOption}s
+     */
+    function &getConfigOptions($criteria = null, $id_as_key = false)
+    {
+        $ret =& $this->_oHandler->getObjects($criteria, $id_as_key);
+        return $ret;
+    }
+
+    /**
+     * Count some {@link XoopsConfigOption}s
+     * 
+     * @param   object  $criteria   {@link CriteriaElement} 
+     * 
+     * @return  int     Count of {@link XoopsConfigOption}s matching $criteria
+     */
+    function getConfigOptionsCount($criteria = null)
+    {
+        return $this->_oHandler->getCount($criteria);
+    }
+
+    /**
+     * Get a list of configs
+     * 
+     * @param   int $conf_modid ID of the modules
+     * @param   int $conf_catid ID of the category
+     * 
+     * @return  array   Associative array of name=>value pairs.
+     */
+    function &getConfigList($conf_modid, $conf_catid = 0)
+    {
+        if (!empty($this->_cachedConfigs[$conf_modid][$conf_catid])) {
+            return $this->_cachedConfigs[$conf_modid][$conf_catid];
+        } else {
+            $criteria = new CriteriaCompo(new Criteria('conf_modid', $conf_modid));
+            if (empty($conf_catid)) {
+                $criteria->add(new Criteria('conf_catid', $conf_catid));
+            }
+            $configs =& $this->_cHandler->getObjects($criteria);
+            $confcount = count($configs);
+            $ret = array();
+            for ($i = 0; $i < $confcount; $i++) {
+                $ret[$configs[$i]->getVar('conf_name')] = $configs[$i]->getConfValueForOutput();
+            }
+            $this->_cachedConfigs[$conf_modid][$conf_catid] =& $ret;
+            return $ret;
+        }
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/kernel/object.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/kernel/object.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/kernel/object.php	(revision 405)
@@ -0,0 +1,666 @@
+<?php
+// $Id: object.php,v 1.6 2006/07/27 00:17:18 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+/**
+ * @package kernel
+ * @copyright copyright &copy; 2000 XOOPS.org
+ */
+
+/**#@+
+ * Xoops object datatype
+ *
+ **/
+define('XOBJ_DTYPE_TXTBOX', 1);
+define('XOBJ_DTYPE_TXTAREA', 2);
+define('XOBJ_DTYPE_INT', 3);
+define('XOBJ_DTYPE_URL', 4);
+define('XOBJ_DTYPE_EMAIL', 5);
+define('XOBJ_DTYPE_ARRAY', 6);
+define('XOBJ_DTYPE_OTHER', 7);
+define('XOBJ_DTYPE_SOURCE', 8);
+define('XOBJ_DTYPE_STIME', 9);
+define('XOBJ_DTYPE_MTIME', 10);
+define('XOBJ_DTYPE_LTIME', 11);
+/**#@-*/
+
+//include_once "xoopspluginloader.php";
+
+/**
+ * Base class for all objects in the Xoops kernel (and beyond)
+ *
+ * @author Kazumi Ono (AKA onokazu)
+ * @copyright copyright &copy; 2000 XOOPS.org
+ * @package kernel
+ **/
+class XoopsObject
+{
+
+    /**
+     * holds all variables(properties) of an object
+     *
+     * @var array
+     * @access protected
+     **/
+    var $vars = array();
+
+    /**
+    * variables cleaned for store in DB
+    *
+    * @var array
+    * @access protected
+    */
+    var $cleanVars = array();
+
+    /**
+    * is it a newly created object?
+    *
+    * @var bool
+    * @access private
+    */
+    var $_isNew = false;
+
+    /**
+    * has any of the values been modified?
+    *
+    * @var bool
+    * @access private
+    */
+    var $_isDirty = false;
+
+    /**
+    * errors
+    *
+    * @var array
+    * @access private
+    */
+    var $_errors = array();
+
+    /**
+    * additional filters registered dynamically by a child class object
+    *
+    * @access private
+    */
+    var $_filters = array();
+
+    /**
+    * constructor
+    *
+    * normally, this is called from child classes only
+    * @access public
+    */
+    function XoopsObject()
+    {
+    }
+
+    /**#@+
+    * used for new/clone objects
+    *
+    * @access public
+    */
+    function setNew()
+    {
+        $this->_isNew = true;
+    }
+    function unsetNew()
+    {
+        $this->_isNew = false;
+    }
+    function isNew()
+    {
+        return $this->_isNew;
+    }
+    /**#@-*/
+
+    /**#@+
+    * mark modified objects as dirty
+    *
+    * used for modified objects only
+    * @access public
+    */
+    function setDirty()
+    {
+        $this->_isDirty = true;
+    }
+    function unsetDirty()
+    {
+        $this->_isDirty = false;
+    }
+    function isDirty()
+    {
+        return $this->_isDirty;
+    }
+    /**#@-*/
+
+    /**
+    * initialize variables for the object
+    *
+    * @access public
+    * @param string $key
+    * @param int $data_type  set to one of XOBJ_DTYPE_XXX constants (set to XOBJ_DTYPE_OTHER if no data type ckecking nor text sanitizing is required)
+    * @param mixed
+    * @param bool $required  require html form input?
+    * @param int $maxlength  for XOBJ_DTYPE_TXTBOX type only
+    * @param string $option  does this data have any select options?
+    */
+    function initVar($key, $data_type, $value = null, $required = false, $maxlength = null, $options = '')
+    {
+        $this->vars[$key] = array('value' => $value, 'required' => $required, 'data_type' => $data_type, 'maxlength' => $maxlength, 'changed' => false, 'options' => $options);
+    }
+
+    /**
+    * assign a value to a variable
+    *
+    * @access public
+    * @param string $key name of the variable to assign
+    * @param mixed $value value to assign
+    */
+    function assignVar($key, $value)
+    {
+        if (isset($value) && isset($this->vars[$key])) {
+            $this->vars[$key]['value'] =& $value;
+        }
+    }
+
+    /**
+    * assign values to multiple variables in a batch
+    *
+    * @access private
+    * @param array $var_array associative array of values to assign
+    */
+    function assignVars($var_arr)
+    {
+        foreach ($var_arr as $key => $value) {
+            $this->assignVar($key, $value);
+        }
+    }
+
+    /**
+    * assign a value to a variable
+    *
+    * @access public
+    * @param string $key name of the variable to assign
+    * @param mixed $value value to assign
+    * @param bool $not_gpc
+    */
+    function setVar($key, $value, $not_gpc = false)
+    {
+        if (!empty($key) && isset($value) && isset($this->vars[$key])) {
+            $this->vars[$key]['value'] =& $value;
+            $this->vars[$key]['not_gpc'] = $not_gpc;
+            $this->vars[$key]['changed'] = true;
+            $this->setDirty();
+        }
+    }
+
+    /**
+    * assign values to multiple variables in a batch
+    *
+    * @access private
+    * @param array $var_arr associative array of values to assign
+    * @param bool $not_gpc
+    */
+    function setVars($var_arr, $not_gpc = false)
+    {
+        foreach ($var_arr as $key => $value) {
+            $this->setVar($key, $value, $not_gpc);
+        }
+    }
+
+    /**
+    * Assign values to multiple variables in a batch
+    *
+    * Meant for a CGI contenxt:
+    * - prefixed CGI args are considered save
+    * - avoids polluting of namespace with CGI args
+    *
+    * @access private
+    * @param array $var_arr associative array of values to assign
+    * @param string $pref prefix (only keys starting with the prefix will be set)
+    */
+    function setFormVars($var_arr=null, $pref='xo_', $not_gpc=false) {
+        $len = strlen($pref);
+        foreach ($var_arr as $key => $value) {
+            if ($pref == substr($key,0,$len)) {
+                $this->setVar(substr($key,$len), $value, $not_gpc);
+            }
+        }
+    }
+
+
+    /**
+    * returns all variables for the object
+    *
+    * @access public
+    * @return array associative array of key->value pairs
+    */
+    function &getVars()
+    {
+        return $this->vars;
+    }
+
+    /**
+    * returns a specific variable for the object in a proper format
+    *
+    * @access public
+    * @param string $key key of the object's variable to be returned
+    * @param string $format format to use for the output
+    * @return mixed formatted value of the variable
+    */
+    function &getVar($key, $format = 's')
+    {
+        $ret = $this->vars[$key]['value'];
+        switch ($this->vars[$key]['data_type']) {
+
+        case XOBJ_DTYPE_TXTBOX:
+            switch (strtolower($format)) {
+            case 's':
+            case 'show':
+            case 'e':
+            case 'edit':
+                $ts =& MyTextSanitizer::getInstance();
+                $ret = $ts->htmlSpecialChars($ret);
+                return $ret;
+                break 1;
+            case 'p':
+            case 'preview':
+            case 'f':
+            case 'formpreview':
+                $ts =& MyTextSanitizer::getInstance();
+                $ret = $ts->htmlSpecialChars($ts->stripSlashesGPC($ret));
+                return $ret;
+                break 1;
+            case 'n':
+            case 'none':
+            default:
+                break 1;
+            }
+            break;
+        case XOBJ_DTYPE_TXTAREA:
+            switch (strtolower($format)) {
+            case 's':
+            case 'show':
+                $ts =& MyTextSanitizer::getInstance();
+                $html = !empty($this->vars['dohtml']['value']) ? 1 : 0;
+                $xcode = (!isset($this->vars['doxcode']['value']) || $this->vars['doxcode']['value'] == 1) ? 1 : 0;
+                $smiley = (!isset($this->vars['dosmiley']['value']) || $this->vars['dosmiley']['value'] == 1) ? 1 : 0;
+                $image = (!isset($this->vars['doimage']['value']) || $this->vars['doimage']['value'] == 1) ? 1 : 0;
+                $br = (!isset($this->vars['dobr']['value']) || $this->vars['dobr']['value'] == 1) ? 1 : 0;
+                $ret = $ts->displayTarea($ret, $html, $smiley, $xcode, $image, $br);
+                return $ret;
+                break 1;
+            case 'e':
+            case 'edit':
+                $ret = htmlspecialchars($ret, ENT_QUOTES);
+                return $ret;
+                break 1;
+            case 'p':
+            case 'preview':
+                $ts =& MyTextSanitizer::getInstance();
+                $html = !empty($this->vars['dohtml']['value']) ? 1 : 0;
+                $xcode = (!isset($this->vars['doxcode']['value']) || $this->vars['doxcode']['value'] == 1) ? 1 : 0;
+                $smiley = (!isset($this->vars['dosmiley']['value']) || $this->vars['dosmiley']['value'] == 1) ? 1 : 0;
+                $image = (!isset($this->vars['doimage']['value']) || $this->vars['doimage']['value'] == 1) ? 1 : 0;
+                $br = (!isset($this->vars['dobr']['value']) || $this->vars['dobr']['value'] == 1) ? 1 : 0;
+                $ret = $ts->previewTarea($ret, $html, $smiley, $xcode, $image, $br);
+                return $ret;
+                break 1;
+            case 'f':
+            case 'formpreview':
+                $ts =& MyTextSanitizer::getInstance();
+                $ret = htmlspecialchars($ts->stripSlashesGPC($ret), ENT_QUOTES);
+                return $ret;
+                break 1;
+            case 'n':
+            case 'none':
+            default:
+                break 1;
+            }
+            break;
+        case XOBJ_DTYPE_ARRAY:
+            $ret = unserialize($ret);
+            break;
+        case XOBJ_DTYPE_SOURCE:
+            switch (strtolower($format)) {
+            case 's':
+            case 'show':
+                break 1;
+            case 'e':
+            case 'edit':
+                $ret = htmlspecialchars($ret, ENT_QUOTES);
+                return $ret;
+                break 1;
+            case 'p':
+            case 'preview':
+                $ts =& MyTextSanitizer::getInstance();
+                $ret = $ts->stripSlashesGPC($ret);
+                return $ret;
+                break 1;
+            case 'f':
+            case 'formpreview':
+                $ts =& MyTextSanitizer::getInstance();
+                $ret = htmlspecialchars($ts->stripSlashesGPC($ret), ENT_QUOTES);
+                return $ret;
+                break 1;
+            case 'n':
+            case 'none':
+            default:
+                break 1;
+            }
+            break;
+        default:
+            if ($this->vars[$key]['options'] != '' && $ret != '') {
+                switch (strtolower($format)) {
+                case 's':
+                case 'show':
+                    $selected = explode('|', $ret);
+                    $options = explode('|', $this->vars[$key]['options']);
+                    $i = 1;
+                    $ret = array();
+                    foreach ($options as $op) {
+                        if (in_array($i, $selected)) {
+                            $ret[] = $op;
+                        }
+                        $i++;
+                    }
+                    $ret = implode(', ', $ret);
+                    return $ret;
+                case 'e':
+                case 'edit':
+                    $ret = explode('|', $ret);
+                    break 1;
+                default:
+                    break 1;
+                }
+
+            }
+            break;
+        }
+        return $ret;
+    }
+
+    /**
+     * clean values of all variables of the object for storage.
+     * also add slashes whereever needed
+     *
+     * @return bool true if successful
+     * @access public
+     */
+    function cleanVars()
+    {
+        $ts =& MyTextSanitizer::getInstance();
+        foreach ($this->vars as $k => $v) {
+            $cleanv = $v['value'];
+            if (!$v['changed']) {
+            } else {
+                $cleanv = is_string($cleanv) ? trim($cleanv) : $cleanv;
+                switch ($v['data_type']) {
+                case XOBJ_DTYPE_TXTBOX:
+                    if ($v['required'] && $cleanv != '0' && $cleanv == '') {
+                        $this->setErrors("$k is required.");
+                        continue;
+                    }
+                    if (isset($v['maxlength']) && strlen($cleanv) > intval($v['maxlength'])) {
+                        $this->setErrors("$k must be shorter than ".intval($v['maxlength'])." characters.");
+                        continue;
+                    }
+                    if (!$v['not_gpc']) {
+                        $cleanv = $ts->stripSlashesGPC($ts->censorString($cleanv));
+                    } else {
+                        $cleanv = $ts->censorString($cleanv);
+                    }
+                    break;
+                case XOBJ_DTYPE_TXTAREA:
+                    if ($v['required'] && $cleanv != '0' && $cleanv == '') {
+                        $this->setErrors("$k is required.");
+                        continue;
+                    }
+                    if (!$v['not_gpc']) {
+                        $cleanv = $ts->stripSlashesGPC($ts->censorString($cleanv));
+                    } else {
+                        $cleanv = $ts->censorString($cleanv);
+                    }
+                    break;
+                case XOBJ_DTYPE_SOURCE:
+                    if (!$v['not_gpc']) {
+                        $cleanv = $ts->stripSlashesGPC($cleanv);
+                    } else {
+                        $cleanv = $cleanv;
+                    }
+                    break;
+                case XOBJ_DTYPE_INT:
+                    $cleanv = intval($cleanv);
+                    break;
+                case XOBJ_DTYPE_EMAIL:
+                    if ($v['required'] && $cleanv == '') {
+                        $this->setErrors("$k is required.");
+                        continue;
+                    }
+                    if ($cleanv != '' && !preg_match("/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+([\.][a-z0-9-]+)+$/i",$cleanv)) {
+                        $this->setErrors("Invalid Email");
+                        continue;
+                    }
+                    if (!$v['not_gpc']) {
+                        $cleanv = $ts->stripSlashesGPC($cleanv);
+                    }
+                    break;
+                case XOBJ_DTYPE_URL:
+                    if ($v['required'] && $cleanv == '') {
+                        $this->setErrors("$k is required.");
+                        continue;
+                    }
+                    if ($cleanv != '' && !preg_match("/^http[s]*:\/\//i", $cleanv)) {
+                        $cleanv = 'http://' . $cleanv;
+                    }
+                    if (!$v['not_gpc']) {
+                        $cleanv =& $ts->stripSlashesGPC($cleanv);
+                    }
+                    break;
+                case XOBJ_DTYPE_ARRAY:
+                    $cleanv = serialize($cleanv);
+                    break;
+                case XOBJ_DTYPE_STIME:
+                case XOBJ_DTYPE_MTIME:
+                case XOBJ_DTYPE_LTIME:
+                    $cleanv = !is_string($cleanv) ? intval($cleanv) : strtotime($cleanv);
+                    break;
+                default:
+                    break;
+                }
+            }
+            $this->cleanVars[$k] =& $cleanv;
+            unset($cleanv);
+        }
+        if (count($this->_errors) > 0) {
+            return false;
+        }
+        $this->unsetDirty();
+        return true;
+    }
+
+    /**
+     * dynamically register additional filter for the object
+     *
+     * @param string $filtername name of the filter
+     * @access public
+     */
+    function registerFilter($filtername)
+    {
+        $this->_filters[] = $filtername;
+    }
+
+    /**
+     * load all additional filters that have been registered to the object
+     *
+     * @access private
+     */
+    function _loadFilters()
+    {
+        //include_once XOOPS_ROOT_PATH.'/class/filters/filter.php';
+        //foreach ($this->_filters as $f) {
+        //    include_once XOOPS_ROOT_PATH.'/class/filters/'.strtolower($f).'php';
+        //}
+    }
+
+    /**
+     * create a clone(copy) of the current object
+     *
+     * @access public
+     * @return object clone
+     */
+    function &xoopsClone()
+    {
+        $class = get_class($this);
+        $clone =& new $class();
+        foreach ($this->vars as $k => $v) {
+            $clone->assignVar($k, $v['value']);
+        }
+        // need this to notify the handler class that this is a newly created object
+        $clone->setNew();
+        return $clone;
+    }
+
+    /**
+     * add an error
+     *
+     * @param string $value error to add
+     * @access public
+     */
+    function setErrors($err_str)
+    {
+        $this->_errors[] = trim($err_str);
+    }
+
+    /**
+     * return the errors for this object as an array
+     *
+     * @return array an array of errors
+     * @access public
+     */
+    function getErrors()
+    {
+        return $this->_errors;
+    }
+
+    /**
+     * return the errors for this object as html
+     *
+     * @return string html listing the errors
+     * @access public
+     */
+    function getHtmlErrors()
+    {
+        $ret = '<h4>Errors</h4>';
+        if (!empty($this->_errors)) {
+            foreach ($this->_errors as $error) {
+                $ret .= $error.'<br />';
+            }
+        } else {
+            $ret .= 'None<br />';
+        }
+        return $ret;
+    }
+}
+
+/**
+* XOOPS object handler class.
+* This class is an abstract class of handler classes that are responsible for providing
+* data access mechanisms to the data source of its corresponsing data objects
+* @package kernel
+* @abstract
+*
+* @author  Kazumi Ono <onokazu@xoops.org>
+* @copyright copyright &copy; 2000 The XOOPS Project
+*/
+class XoopsObjectHandler
+{
+
+    /**
+     * holds referenced to {@link XoopsDatabase} class object
+     *
+     * @var object
+     * @see XoopsDatabase
+     * @access protected
+     */
+    var $db;
+
+    //
+    /**
+     * called from child classes only
+     *
+     * @param object $db reference to the {@link XoopsDatabase} object
+     * @access protected
+     */
+    function XoopsObjectHandler(&$db)
+    {
+        $this->db =& $db;
+    }
+
+    /**
+     * creates a new object
+     *
+     * @abstract
+     */
+    function &create()
+    {
+    }
+
+    /**
+     * gets a value object
+     *
+     * @param int $int_id
+     * @abstract
+     */
+    function &get($int_id)
+    {
+    }
+
+    /**
+     * insert/update object
+     *
+     * @param object $object
+     * @abstract
+     */
+    function insert(&$object)
+    {
+    }
+
+    /**
+     * delete obejct from database
+     *
+     * @param object $object
+     * @abstract
+     */
+    function delete(&$object)
+    {
+    }
+
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/kernel/member.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/kernel/member.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/kernel/member.php	(revision 405)
@@ -0,0 +1,417 @@
+<?php
+// $Id: member.php,v 1.5 2006/05/01 02:37:28 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+if (!defined('XOOPS_ROOT_PATH')) {
+    exit();
+}
+require_once XOOPS_ROOT_PATH.'/kernel/user.php';
+require_once XOOPS_ROOT_PATH.'/kernel/group.php';
+
+/**
+* XOOPS member handler class.
+* This class provides simple interface (a facade class) for handling groups/users/
+* membership data.
+*
+*
+* @author  Kazumi Ono <onokazu@xoops.org>
+* @copyright copyright (c) 2000-2003 XOOPS.org
+* @package kernel
+*/
+
+class XoopsMemberHandler{
+
+    /**#@+
+    * holds reference to group handler(DAO) class
+    * @access private
+    */
+    var $_gHandler;
+
+    /**
+    * holds reference to user handler(DAO) class
+    */
+    var $_uHandler;
+
+    /**
+    * holds reference to membership handler(DAO) class
+    */
+    var $_mHandler;
+
+    /**
+    * holds temporary user objects
+    */
+    var $_members = array();
+    /**#@-*/
+
+    /**
+     * constructor
+     *
+     */
+    function XoopsMemberHandler(&$db)
+    {
+        $this->_gHandler =& new XoopsGroupHandler($db);
+        $this->_uHandler =& new XoopsUserHandler($db);
+        $this->_mHandler =& new XoopsMembershipHandler($db);
+    }
+
+    /**
+     * create a new group
+     *
+     * @return object XoopsGroup reference to the new group
+     */
+    function &createGroup()
+    {
+        $ret =& $this->_gHandler->create();
+        return $ret;
+    }
+
+    /**
+     * create a new user
+     *
+     * @return object XoopsUser reference to the new user
+     */
+    function &createUser()
+    {
+        $ret =& $this->_uHandler->create();
+        return $ret;
+    }
+
+    /**
+     * retrieve a group
+     *
+     * @param int $id ID for the group
+     * @return object XoopsGroup reference to the group
+     */
+    function &getGroup($id)
+    {
+        $ret =& $this->_gHandler->get($id);
+        return $ret;
+    }
+
+    /**
+     * retrieve a user
+     *
+     * @param int $id ID for the user
+     * @return object XoopsUser reference to the user
+     */
+    function &getUser($id)
+    {
+        if (!isset($this->_members[$id])) {
+            $this->_members[$id] =& $this->_uHandler->get($id);
+        }
+        return $this->_members[$id];
+    }
+
+    /**
+     * delete a group
+     *
+     * @param object $group reference to the group to delete
+     * @return bool FALSE if failed
+     */
+    function deleteGroup(&$group)
+    {
+        $this->_gHandler->delete($group);
+        $this->_mHandler->deleteAll(new Criteria('groupid', $group->getVar('groupid')));
+        return true;
+    }
+
+    /**
+     * delete a user
+     *
+     * @param object $user reference to the user to delete
+     * @return bool FALSE if failed
+     */
+    function deleteUser(&$user)
+    {
+        $this->_uHandler->delete($user);
+        $this->_mHandler->deleteAll(new Criteria('uid', $user->getVar('uid')));
+        return true;
+    }
+
+    /**
+     * insert a group into the database
+     *
+     * @param object $group reference to the group to insert
+     * @return bool TRUE if already in database and unchanged
+     * FALSE on failure
+     */
+    function insertGroup(&$group)
+    {
+        return $this->_gHandler->insert($group);
+    }
+
+    /**
+     * insert a user into the database
+     *
+     * @param object $user reference to the user to insert
+     * @return bool TRUE if already in database and unchanged
+     * FALSE on failure
+     */
+    function insertUser(&$user, $force = false)
+    {
+        return $this->_uHandler->insert($user, $force);
+    }
+
+    /**
+     * retrieve groups from the database
+     *
+     * @param object $criteria {@link CriteriaElement}
+     * @param bool $id_as_key use the group's ID as key for the array?
+     * @return array array of {@link XoopsGroup} objects
+     */
+    function getGroups($criteria = null, $id_as_key = false)
+    {
+        return $this->_gHandler->getObjects($criteria, $id_as_key);
+    }
+
+    /**
+     * retrieve users from the database
+     *
+     * @param object $criteria {@link CriteriaElement}
+     * @param bool $id_as_key use the group's ID as key for the array?
+     * @return array array of {@link XoopsUser} objects
+     */
+    function getUsers($criteria = null, $id_as_key = false)
+    {
+        return $this->_uHandler->getObjects($criteria, $id_as_key);
+    }
+
+    /**
+     * get a list of groupnames and their IDs
+     *
+     * @param object $criteria {@link CriteriaElement} object
+     * @return array associative array of group-IDs and names
+     */
+    function &getGroupList($criteria = null)
+    {
+        $groups =& $this->_gHandler->getObjects($criteria, true);
+        $ret = array();
+        foreach (array_keys($groups) as $i) {
+            $ret[$i] = $groups[$i]->getVar('name');
+        }
+        return $ret;
+    }
+
+    /**
+     * get a list of usernames and their IDs
+     *
+     * @param object $criteria {@link CriteriaElement} object
+     * @return array associative array of user-IDs and names
+     */
+    function getUserList($criteria = null)
+    {
+        $users =& $this->_uHandler->getObjects($criteria, true);
+        $ret = array();
+        foreach (array_keys($users) as $i) {
+            $ret[$i] = $users[$i]->getVar('uname');
+        }
+        return $ret;
+    }
+
+    /**
+     * add a user to a group
+     *
+     * @param int $group_id ID of the group
+     * @param int $user_id ID of the user
+     * @return object XoopsMembership
+     */
+    function addUserToGroup($group_id, $user_id)
+    {
+        $mship =& $this->_mHandler->create();
+        $mship->setVar('groupid', $group_id);
+        $mship->setVar('uid', $user_id);
+        return $this->_mHandler->insert($mship);
+    }
+
+    /**
+     * remove a list of users from a group
+     *
+     * @param int $group_id ID of the group
+     * @param array $user_ids array of user-IDs
+     * @return bool success?
+     */
+    function removeUsersFromGroup($group_id, $user_ids = array())
+    {
+        $criteria = new CriteriaCompo();
+        $criteria->add(new Criteria('groupid', $group_id));
+        $criteria2 = new CriteriaCompo();
+        foreach ($user_ids as $uid) {
+            $criteria2->add(new Criteria('uid', $uid), 'OR');
+        }
+        $criteria->add($criteria2);
+        return $this->_mHandler->deleteAll($criteria);
+    }
+
+    /**
+     * get a list of users belonging to a group
+     *
+     * @param int $group_id ID of the group
+     * @param bool $asobject return the users as objects?
+     * @param int $limit number of users to return
+     * @param int $start index of the first user to return
+     * @return array Array of {@link XoopsUser} objects (if $asobject is TRUE)
+     * or of associative arrays matching the record structure in the database.
+     */
+    function getUsersByGroup($group_id, $asobject = false, $limit = 0, $start = 0)
+    {
+        $user_ids = $this->_mHandler->getUsersByGroup($group_id, $limit, $start);
+        if (!$asobject) {
+           return $user_ids;
+        } else {
+           $ret = array();
+           foreach ($user_ids as $u_id) {
+               $user =& $this->getUser($u_id);
+                if (is_object($user)) {
+                    $ret[] =& $user;
+                }
+                unset($user);
+           }
+           return $ret;
+        }
+    }
+
+    /**
+     * get a list of groups that a user is member of
+     *
+     * @param int $user_id ID of the user
+     * @param bool $asobject return groups as {@link XoopsGroup} objects or arrays?
+     * @return array array of objects or arrays
+     */
+    function getGroupsByUser($user_id, $asobject = false)
+    {
+        $group_ids = $this->_mHandler->getGroupsByUser($user_id);
+        if (!$asobject) {
+           return $group_ids;
+        } else {
+           foreach ($group_ids as $g_id) {
+               $ret[] =& $this->getGroup($g_id);
+           }
+           return $ret;
+        }
+    }
+
+    /**
+     * log in a user
+     *
+     * @param string $uname username as entered in the login form
+     * @param string $pwd password entered in the login form
+     * @return mixed XoopsUser reference to the logged in user. FALSE if failed to log in
+     */
+    function &loginUser($uname, $pwd)
+    {
+        $user =& $this->loginUserMd5($uname, md5($pwd));
+        return $user;
+    }
+
+    /**
+     * logs in a user with an md5 encrypted password
+     *
+     * @param string $uname username
+     * @param string $md5pwd password encrypted with md5
+     * @return mixed XoopsUser reference to the logged in user. FALSE if failed to log in
+     */
+    function &loginUserMd5($uname, $md5pwd)
+    {
+        $criteria = new CriteriaCompo(new Criteria('uname', $uname));
+        $criteria->add(new Criteria('pass', $md5pwd));
+        $user =& $this->_uHandler->getObjects($criteria, false);
+        if (!$user || count($user) != 1) {
+            $ret = false;
+            return $ret;
+        }
+        return $user[0];
+    }
+
+    /**
+     * count users matching certain conditions
+     *
+     * @param object $criteria {@link CriteriaElement} object
+     * @return int
+     */
+    function getUserCount($criteria = null)
+    {
+        return $this->_uHandler->getCount($criteria);
+    }
+
+    /**
+     * count users belonging to a group
+     *
+     * @param int $group_id ID of the group
+     * @return int
+     */
+    function getUserCountByGroup($group_id)
+    {
+        return $this->_mHandler->getCount(new Criteria('groupid', $group_id));
+    }
+
+    /**
+     * updates a single field in a users record
+     *
+     * @param object $user reference to the {@link XoopsUser} object
+     * @param string $fieldName name of the field to update
+     * @param string $fieldValue updated value for the field
+     * @return bool TRUE if success or unchanged, FALSE on failure
+     */
+    function updateUserByField(&$user, $fieldName, $fieldValue)
+    {
+        $user->setVar($fieldName, $fieldValue);
+        return $this->insertUser($user);
+    }
+
+    /**
+     * updates a single field in a users record
+     *
+     * @param string $fieldName name of the field to update
+     * @param string $fieldValue updated value for the field
+     * @param object $criteria {@link CriteriaElement} object
+     * @return bool TRUE if success or unchanged, FALSE on failure
+     */
+    function updateUsersByField($fieldName, $fieldValue, $criteria = null)
+    {
+        return $this->_uHandler->updateAll($fieldName, $fieldValue, $criteria);
+    }
+
+    /**
+     * activate a user
+     *
+     * @param object $user reference to the {@link XoopsUser} object
+     * @return bool successful?
+     */
+    function activateUser(&$user)
+    {
+        if ($user->getVar('level') != 0) {
+            return true;
+        }
+        $user->setVar('level', 1);
+        return $this->_uHandler->insert($user, true);
+    }
+
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/kernel/tplset.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/kernel/tplset.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/kernel/tplset.php	(revision 405)
@@ -0,0 +1,200 @@
+<?php
+// $Id: tplset.php,v 1.3 2006/05/01 02:37:28 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+if (!defined('XOOPS_ROOT_PATH')) {
+    exit();
+}
+class XoopsTplset extends XoopsObject
+{
+
+    function XoopsTplset()
+    {
+        $this->XoopsObject();
+        $this->initVar('tplset_id', XOBJ_DTYPE_INT, null, false);
+        $this->initVar('tplset_name', XOBJ_DTYPE_OTHER, null, false);
+        $this->initVar('tplset_desc', XOBJ_DTYPE_TXTBOX, null, false, 255);
+        $this->initVar('tplset_credits', XOBJ_DTYPE_TXTAREA, null, false);
+        $this->initVar('tplset_created', XOBJ_DTYPE_INT, 0, false);
+    }
+}
+
+/**
+* XOOPS tplset handler class.
+* This class is responsible for providing data access mechanisms to the data source
+* of XOOPS tplset class objects.
+*
+*
+* @author  Kazumi Ono <onokazu@xoops.org>
+*/
+
+class XoopsTplsetHandler extends XoopsObjectHandler
+{
+
+    function &create($isNew = true)
+    {
+        $tplset =& new XoopsTplset();
+        if ($isNew) {
+            $tplset->setNew();
+        }
+        return $tplset;
+    }
+
+    function &get($id)
+    {
+        $ret = false;
+        $id = intval($id);
+        if ($id > 0) {
+            $sql = 'SELECT * FROM '.$this->db->prefix('tplset').' WHERE tplset_id='.$id;
+            if ($result = $this->db->query($sql)) {
+                $numrows = $this->db->getRowsNum($result);
+                if ($numrows == 1) {
+                    $tplset = new XoopsTplset();
+                    $tplset->assignVars($this->db->fetchArray($result));
+                    $ret =& $tplset;
+                }
+            }
+        }
+        return $ret;
+    }
+
+    function &getByName($tplset_name)
+    {
+        $ret = false;
+        $tplset_name = trim($tplset_name);
+        if ($tplset_name != '') {
+            $sql = 'SELECT * FROM '.$this->db->prefix('tplset').' WHERE tplset_name='.$this->db->quoteString($tplset_name);
+            if ($result = $this->db->query($sql)) {
+                $numrows = $this->db->getRowsNum($result);
+                if ($numrows == 1) {
+                    $tplset =& new XoopsTplset();
+                    $tplset->assignVars($this->db->fetchArray($result));
+                    $ret =& $tplset;
+                }
+            }
+        }
+        return $ret;
+    }
+
+    function insert(&$tplset)
+    {
+        if (strtolower(get_class($tplset)) != 'xoopstplset') {
+            return false;
+        }
+        if (!$tplset->isDirty()) {
+            return true;
+        }
+        if (!$tplset->cleanVars()) {
+            return false;
+        }
+        foreach ($tplset->cleanVars as $k => $v) {
+            ${$k} = $v;
+        }
+        if ($tplset->isNew()) {
+            $tplset_id = $this->db->genId('tplset_tplset_id_seq');
+            $sql = sprintf("INSERT INTO %s (tplset_id, tplset_name, tplset_desc, tplset_credits, tplset_created) VALUES (%u, %s, %s, %s, %u)", $this->db->prefix('tplset'), $tplset_id, $this->db->quoteString($tplset_name), $this->db->quoteString($tplset_desc), $this->db->quoteString($tplset_credits), $tplset_created);
+        } else {
+            $sql = sprintf("UPDATE %s SET tplset_name = %s, tplset_desc = %s, tplset_credits = %s, tplset_created = %u WHERE tplset_id = %u", $this->db->prefix('tplset'), $this->db->quoteString($tplset_name), $this->db->quoteString($tplset_desc), $this->db->quoteString($tplset_credits), $tplset_created, $tplset_id);
+        }
+        if (!$result = $this->db->query($sql)) {
+            return false;
+        }
+        if (empty($tplset_id)) {
+            $tplset_id = $this->db->getInsertId();
+        }
+        $tplset->assignVar('tplset_id', $tplset_id);
+        return true;
+    }
+
+    function delete(&$tplset)
+    {
+        if (strtolower(get_class($tplset)) != 'xoopstplset') {
+            return false;
+        }
+        $sql = sprintf("DELETE FROM %s WHERE tplset_id = %u", $this->db->prefix('tplset'), $tplset->getVar('tplset_id'));
+        if (!$result = $this->db->query($sql)) {
+            return false;
+        }
+        $sql = sprintf("DELETE FROM %s WHERE tplset_name = %s", $this->db->prefix('imgset_tplset_link'), $this->db->quoteString($tplset->getVar('tplset_name')));
+        $this->db->query($sql);
+        return true;
+    }
+
+    function &getObjects($criteria = null, $id_as_key = false)
+    {
+        $ret = array();
+        $limit = $start = 0;
+        $sql = 'SELECT * FROM '.$this->db->prefix('tplset');
+        if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
+            $sql .= ' '.$criteria->renderWhere().' ORDER BY tplset_id';
+            $limit = $criteria->getLimit();
+            $start = $criteria->getStart();
+        }
+        $result = $this->db->query($sql, $limit, $start);
+        if (!$result) {
+            return $ret;
+        }
+        while ($myrow = $this->db->fetchArray($result)) {
+            $tplset =& new XoopsTplset();
+            $tplset->assignVars($myrow);
+            if (!$id_as_key) {
+                $ret[] =& $tplset;
+            } else {
+                $ret[$myrow['tplset_id']] =& $tplset;
+            }
+            unset($tplset);
+        }
+        return $ret;
+    }
+
+
+    function getCount($criteria = null)
+    {
+        $sql = 'SELECT COUNT(*) FROM '.$this->db->prefix('tplset');
+        if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
+            $sql .= ' '.$criteria->renderWhere();
+        }
+        if (!$result =& $this->db->query($sql)) {
+            return 0;
+        }
+        list($count) = $this->db->fetchRow($result);
+        return $count;
+    }
+
+    function &getList($criteria = null)
+    {
+        $ret = array();
+        $tplsets =& $this->getObjects($criteria, true);
+        foreach (array_keys($tplsets) as $i) {
+            $ret[$tplsets[$i]->getVar('tplset_name')] = $tplsets[$i]->getVar('tplset_name');
+        }
+        return $ret;
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/kernel/avatar.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/kernel/avatar.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/kernel/avatar.php	(revision 405)
@@ -0,0 +1,239 @@
+<?php
+// $Id: avatar.php,v 1.3 2006/05/01 02:37:28 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+if (!defined('XOOPS_ROOT_PATH')) {
+    exit();
+}
+
+class XoopsAvatar extends XoopsObject
+{
+    var $_userCount;
+
+    function XoopsAvatar()
+    {
+        $this->XoopsObject();
+        $this->initVar('avatar_id', XOBJ_DTYPE_INT, null, false);
+        $this->initVar('avatar_file', XOBJ_DTYPE_OTHER, null, false, 30);
+        $this->initVar('avatar_name', XOBJ_DTYPE_TXTBOX, null, true, 100);
+        $this->initVar('avatar_mimetype', XOBJ_DTYPE_OTHER, null, false);
+        $this->initVar('avatar_created', XOBJ_DTYPE_INT, null, false);
+        $this->initVar('avatar_display', XOBJ_DTYPE_INT, 1, false);
+        $this->initVar('avatar_weight', XOBJ_DTYPE_INT, 0, false);
+        $this->initVar('avatar_type', XOBJ_DTYPE_OTHER, 0, false);
+    }
+
+    function setUserCount($value)
+    {
+        $this->_userCount = intval($value);
+    }
+
+    function getUserCount()
+    {
+        return $this->_userCount;
+    }
+}
+
+
+/**
+* XOOPS avatar handler class.
+* This class is responsible for providing data access mechanisms to the data source
+* of XOOPS avatar class objects.
+*
+*
+* @author  Kazumi Ono <onokazu@xoops.org>
+*/
+
+class XoopsAvatarHandler extends XoopsObjectHandler
+{
+
+    function &create($isNew = true)
+    {
+        $avatar =& new XoopsAvatar();
+        if ($isNew) {
+            $avatar->setNew();
+        }
+        return $avatar;
+    }
+
+    function &get($id)
+    {
+        $ret = false;
+        $id = intval($id);
+        if ($id > 0) {
+            $sql = 'SELECT * FROM '.$this->db->prefix('avatar').' WHERE avatar_id='.$id;
+            if ($result = $this->db->query($sql)) {
+                $numrows = $this->db->getRowsNum($result);
+                if ($numrows == 1) {
+                    $avatar =& new XoopsAvatar();
+                    $avatar->assignVars($this->db->fetchArray($result));
+                    $ret =& $avatar;
+                }
+            }
+        }
+        return $ret;
+    }
+
+    function insert(&$avatar)
+    {
+        if (strtolower(get_class($avatar)) != 'xoopsavatar') {
+            return false;
+        }
+        if (!$avatar->isDirty()) {
+            return true;
+        }
+        if (!$avatar->cleanVars()) {
+            return false;
+        }
+        foreach ($avatar->cleanVars as $k => $v) {
+            ${$k} = $v;
+        }
+        if ($avatar->isNew()) {
+            $avatar_id = $this->db->genId('avatar_avatar_id_seq');
+            $sql = sprintf("INSERT INTO %s (avatar_id, avatar_file, avatar_name, avatar_created, avatar_mimetype, avatar_display, avatar_weight, avatar_type) VALUES (%u, %s, %s, %u, %s, %u, %u, %s)", $this->db->prefix('avatar'), $avatar_id, $this->db->quoteString($avatar_file), $this->db->quoteString($avatar_name), time(), $this->db->quoteString($avatar_mimetype), $avatar_display, $avatar_weight, $this->db->quoteString($avatar_type));
+        } else {
+            $sql = sprintf("UPDATE %s SET avatar_file = %s, avatar_name = %s, avatar_created = %u, avatar_mimetype= %s, avatar_display = %u, avatar_weight = %u, avatar_type = %s WHERE avatar_id = %u", $this->db->prefix('avatar'), $this->db->quoteString($avatar_file), $this->db->quoteString($avatar_name), $avatar_created, $this->db->quoteString($avatar_mimetype), $avatar_display, $avatar_weight, $this->db->quoteString($avatar_type), $avatar_id);
+        }
+        if (!$result = $this->db->query($sql)) {
+            return false;
+        }
+        if (empty($avatar_id)) {
+            $avatar_id = $this->db->getInsertId();
+        }
+        $avatar->assignVar('avatar_id', $avatar_id);
+        return true;
+    }
+
+    function delete(&$avatar)
+    {
+        if (strtolower(get_class($avatar)) != 'xoopsavatar') {
+            return false;
+        }
+        $id = $avatar->getVar('avatar_id');
+        $sql = sprintf("DELETE FROM %s WHERE avatar_id = %u", $this->db->prefix('avatar'), $id);
+        if (!$result = $this->db->query($sql)) {
+            return false;
+        }
+        $sql = sprintf("DELETE FROM %s WHERE avatar_id = %u", $this->db->prefix('avatar_user_link'), $id);
+        $result = $this->db->query($sql);
+        return true;
+    }
+
+    function &getObjects($criteria = null, $id_as_key = false)
+    {
+        $ret = array();
+        $limit = $start = 0;
+        $sql = 'SELECT a.*, COUNT(u.user_id) AS count FROM '.$this->db->prefix('avatar').' a LEFT JOIN '.$this->db->prefix('avatar_user_link').' u ON u.avatar_id=a.avatar_id';
+        if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
+            $sql .= ' '.$criteria->renderWhere();
+            $sql .= ' GROUP BY a.avatar_id ORDER BY avatar_weight, avatar_id';
+            $limit = $criteria->getLimit();
+            $start = $criteria->getStart();
+        }
+        $result = $this->db->query($sql, $limit, $start);
+        if (!$result) {
+            return $ret;
+        }
+        while ($myrow = $this->db->fetchArray($result)) {
+            $avatar =& new XoopsAvatar();
+            $avatar->assignVars($myrow);
+            $avatar->setUserCount($myrow['count']);
+            if (!$id_as_key) {
+                $ret[] =& $avatar;
+            } else {
+                $ret[$myrow['avatar_id']] =& $avatar;
+            }
+            unset($avatar);
+        }
+        return $ret;
+    }
+
+    function getCount($criteria = null)
+    {
+        $sql = 'SELECT COUNT(*) FROM '.$this->db->prefix('avatar');
+        if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
+            $sql .= ' '.$criteria->renderWhere();
+        }
+        if (!$result =& $this->db->query($sql)) {
+            return 0;
+        }
+        list($count) = $this->db->fetchRow($result);
+        return $count;
+    }
+
+    function addUser($avatar_id, $user_id){
+        $avatar_id = intval($avatar_id);
+        $user_id = intval($user_id);
+        if ($avatar_id < 1 || $user_id < 1) {
+            return false;
+        }
+        $sql = sprintf("DELETE FROM %s WHERE user_id = %u", $this->db->prefix('avatar_user_link'), $user_id);
+        $this->db->query($sql);
+        $sql = sprintf("INSERT INTO %s (avatar_id, user_id) VALUES (%u, %u)", $this->db->prefix('avatar_user_link'), $avatar_id, $user_id);
+        if (!$result =& $this->db->query($sql)) {
+            return false;
+        }
+        return true;
+    }
+
+    function &getUser(&$avatar){
+        $ret = array();
+        if (strtolower(get_class($avatar)) != 'xoopsavatar') {
+            return $ret;
+        }
+        $sql = 'SELECT user_id FROM '.$this->db->prefix('avatar_user_link').' WHERE avatar_id='.$avatar->getVar('avatar_id');
+        if (!$result = $this->db->query($sql)) {
+            return $ret;
+        }
+        while ($myrow = $this->db->fetchArray($result)) {
+            $ret[] =& $myrow['user_id'];
+        }
+        return $ret;
+    }
+
+    function &getList($avatar_type = null, $avatar_display = null)
+    {
+        $criteria = new CriteriaCompo();
+        if (isset($avatar_type)) {
+            $avatar_type = ($avatar_type == 'C') ? 'C' : 'S';
+            $criteria->add(new Criteria('avatar_type', $avatar_type));
+        }
+        if (isset($avatar_display)) {
+            $criteria->add(new Criteria('avatar_display', intval($avatar_display)));
+        }
+        $avatars =& $this->getObjects($criteria, true);
+        $ret = array('blank.gif' => _NONE);
+        foreach (array_keys($avatars) as $i) {
+            $ret[$avatars[$i]->getVar('avatar_file')] = $avatars[$i]->getVar('avatar_name');
+        }
+        return $ret;
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/kernel/user.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/kernel/user.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/kernel/user.php	(revision 405)
@@ -0,0 +1,665 @@
+<?php
+// $Id: user.php,v 1.3 2006/05/01 02:37:28 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+if (!defined('XOOPS_ROOT_PATH')) {
+    exit();
+}
+/**
+ * Class for users 
+ * @author Kazumi Ono <onokazu@xoops.org>
+ * @copyright copyright (c) 2000-2003 XOOPS.org
+ * @package kernel
+ */
+class XoopsUser extends XoopsObject
+{
+
+    /**
+     * Array of groups that user belongs to 
+     * @var array
+     * @access private
+     */
+    var $_groups = array();
+    /**
+     * @var bool is the user admin? 
+     * @access private
+     */
+    var $_isAdmin = null;
+    /**
+     * @var string user's rank
+     * @access private
+     */
+    var $_rank = null;
+    /**
+     * @var bool is the user online?
+     * @access private
+     */
+    var $_isOnline = null;
+
+    /**
+     * constructor 
+     * @param array $id Array of key-value-pairs to be assigned to the user. (for backward compatibility only)
+     * @param int $id ID of the user to be loaded from the database.
+     */
+    function XoopsUser($id = null)
+    {
+        $this->initVar('uid', XOBJ_DTYPE_INT, null, false);
+        $this->initVar('name', XOBJ_DTYPE_TXTBOX, null, false, 60);
+        $this->initVar('uname', XOBJ_DTYPE_TXTBOX, null, true, 25);
+        $this->initVar('email', XOBJ_DTYPE_TXTBOX, null, true, 60);
+        $this->initVar('url', XOBJ_DTYPE_TXTBOX, null, false, 100);
+        $this->initVar('user_avatar', XOBJ_DTYPE_TXTBOX, null, false, 30);
+        $this->initVar('user_regdate', XOBJ_DTYPE_INT, null, false);
+        $this->initVar('user_icq', XOBJ_DTYPE_TXTBOX, null, false, 15);
+        $this->initVar('user_from', XOBJ_DTYPE_TXTBOX, null, false, 100);
+        $this->initVar('user_sig', XOBJ_DTYPE_TXTAREA, null, false, null);
+        $this->initVar('user_viewemail', XOBJ_DTYPE_INT, 0, false);
+        $this->initVar('actkey', XOBJ_DTYPE_OTHER, null, false);
+        $this->initVar('user_aim', XOBJ_DTYPE_TXTBOX, null, false, 18);
+        $this->initVar('user_yim', XOBJ_DTYPE_TXTBOX, null, false, 25);
+        $this->initVar('user_msnm', XOBJ_DTYPE_TXTBOX, null, false, 100);
+        $this->initVar('pass', XOBJ_DTYPE_TXTBOX, null, false, 32);
+        $this->initVar('posts', XOBJ_DTYPE_INT, null, false);
+        $this->initVar('attachsig', XOBJ_DTYPE_INT, 0, false);
+        $this->initVar('rank', XOBJ_DTYPE_INT, 0, false);
+        $this->initVar('level', XOBJ_DTYPE_INT, 0, false);
+        $this->initVar('theme', XOBJ_DTYPE_OTHER, null, false);
+        $this->initVar('timezone_offset', XOBJ_DTYPE_OTHER, null, false);
+        $this->initVar('last_login', XOBJ_DTYPE_INT, 0, false);
+        $this->initVar('umode', XOBJ_DTYPE_OTHER, null, false);
+        $this->initVar('uorder', XOBJ_DTYPE_INT, 1, false);
+        // RMV-NOTIFY
+        $this->initVar('notify_method', XOBJ_DTYPE_OTHER, 1, false);
+        $this->initVar('notify_mode', XOBJ_DTYPE_OTHER, 0, false); 
+        $this->initVar('user_occ', XOBJ_DTYPE_TXTBOX, null, false, 100);
+        $this->initVar('bio', XOBJ_DTYPE_TXTAREA, null, false, null);
+        $this->initVar('user_intrest', XOBJ_DTYPE_TXTBOX, null, false, 150);
+        $this->initVar('user_mailok', XOBJ_DTYPE_INT, 1, false);
+
+        // for backward compatibility
+        if (isset($id)) {
+            if (is_array($id)) {
+                $this->assignVars($id);
+            } else {
+                $member_handler =& xoops_gethandler('member');
+                $user =& $member_handler->getUser($id);
+                foreach ($user->vars as $k => $v) {
+                    $this->assignVar($k, $v['value']);
+                }
+            }
+        }
+    }
+
+    /**
+     * check if the user is a guest user
+     *
+     * @return bool returns false
+     *
+     */
+    function isGuest()
+    {
+        return false;
+    }
+
+
+    /**
+     * Updated by Catzwolf 11 Jan 2004
+     * find the username for a given ID
+     * 
+     * @param int $userid ID of the user to find
+     * @param int $usereal switch for usename or realname
+     * @return string name of the user. name for "anonymous" if not found.
+     */
+    function getUnameFromId( $userid, $usereal = 0 )
+    {
+        $userid = intval($userid);
+        $usereal = intval($usereal);
+        if ($userid > 0) {
+            $member_handler =& xoops_gethandler('member');
+            $user =& $member_handler->getUser($userid);
+            if (is_object($user)) {
+                $ts =& MyTextSanitizer::getInstance();
+                if ( $usereal ) { 
+                    return $ts->htmlSpecialChars($user->getVar('name'));
+                } else {
+                    return $ts->htmlSpecialChars($user->getVar('uname'));
+                }
+            }
+        }
+        return $GLOBALS['xoopsConfig']['anonymous'];
+    }
+    /**
+     * increase the number of posts for the user 
+     *
+     * @deprecated
+     */
+    function incrementPost(){
+        $member_handler =& xoops_gethandler('member');
+        return $member_handler->updateUserByField($this, 'posts', $this->getVar('posts') + 1);
+    }
+    /**
+     * set the groups for the user
+     * 
+     * @param array $groupsArr Array of groups that user belongs to
+     */
+    function setGroups($groupsArr)
+    {
+        if (is_array($groupsArr)) {
+            $this->_groups =& $groupsArr;
+        }
+    }
+    /**
+     * get the groups that the user belongs to
+     * 
+     * @return array array of groups 
+     */
+    function getGroups()
+    {
+        if (empty($this->_groups)) {
+            $member_handler =& xoops_gethandler('member');
+            $this->_groups = $member_handler->getGroupsByUser($this->getVar('uid'));
+        }
+        return $this->_groups;
+    }
+    /**
+     * alias for {@link getGroups()}
+     * @see getGroups()
+     * @return array array of groups
+     * @deprecated
+     */
+    function groups()
+    {
+        return $this->getGroups();
+    }
+    /**
+     * Is the user admin ?
+     *
+     * This method will return true if this user has admin rights for the specified module.<br />
+     * - If you don't specify any module ID, the current module will be checked.<br />
+     * - If you set the module_id to -1, it will return true if the user has admin rights for at least one module
+     *
+     * @param int $module_id check if user is admin of this module
+     * @return bool is the user admin of that module?
+     */
+    function isAdmin( $module_id = null ) {
+        if ( is_null( $module_id ) ) {
+            $module_id = isset($GLOBALS['xoopsModule']) ? $GLOBALS['xoopsModule']->getVar( 'mid', 'n' ) : 1;
+        } elseif ( intval($module_id) < 1 ) {
+            $module_id = 0;
+        }
+        $moduleperm_handler =& xoops_gethandler('groupperm');
+        return $moduleperm_handler->checkRight('module_admin', $module_id, $this->getGroups());
+    }
+    /**
+     * get the user's rank
+     * @return array array of rank ID and title
+     */
+    function rank()
+    {
+        if (!isset($this->_rank)) {
+            $this->_rank = xoops_getrank($this->getVar('rank'), $this->getVar('posts'));
+        }
+        return $this->_rank;
+    }
+    /**
+     * is the user activated?
+     * @return bool
+     */
+    function isActive()
+    {
+        if ($this->getVar('level') == 0) {
+            return false;
+        }
+        return true;
+    }
+    /**
+     * is the user currently logged in? 
+     * @return bool
+     */
+    function isOnline()
+    {
+        if (!isset($this->_isOnline)) {
+            $onlinehandler =& xoops_gethandler('online');
+            $this->_isOnline = ($onlinehandler->getCount(new Criteria('online_uid', $this->getVar('uid'))) > 0) ? true : false;
+        }
+        return $this->_isOnline;
+    }
+    /**#@+
+     * specialized wrapper for {@link XoopsObject::getVar()}
+     * 
+     * kept for compatibility reasons.
+     * 
+     * @see XoopsObject::getVar()
+     * @deprecated
+     */
+    /**
+     * get the users UID 
+     * @return int
+     */
+    function uid()
+    {
+        return $this->getVar("uid");
+    }
+    
+    /**
+     * get the users name
+     * @param string $format format for the output, see {@link XoopsObject::getVar()}
+     * @return string 
+     */
+    function name($format="S")
+    {
+        return $this->getVar("name", $format);
+    }
+    
+    /**
+     * get the user's uname
+     * @param string $format format for the output, see {@link XoopsObject::getVar()}
+     * @return string
+     */
+    function uname($format="S")
+    {
+        return $this->getVar("uname", $format);
+    }
+    
+    /**
+     * get the user's email 
+     * 
+     * @param string $format format for the output, see {@link XoopsObject::getVar()}
+     * @return string
+     */
+    function email($format="S")
+    {
+        return $this->getVar("email", $format);
+    }
+    
+    function url($format="S")
+    {
+        return $this->getVar("url", $format);
+    }
+    
+    function user_avatar($format="S")
+    {
+        return $this->getVar("user_avatar");
+    }
+    
+    function user_regdate()
+    {
+        return $this->getVar("user_regdate");
+    }
+    
+    function user_icq($format="S")
+    {
+        return $this->getVar("user_icq", $format);
+    }
+    
+    function user_from($format="S")
+    {
+        return $this->getVar("user_from", $format);
+    }
+    function user_sig($format="S")
+    {
+        return $this->getVar("user_sig", $format);
+    }
+    
+    function user_viewemail()
+    {
+        return $this->getVar("user_viewemail");
+    }
+    
+    function actkey()
+    {
+        return $this->getVar("actkey");
+    }
+    
+    function user_aim($format="S")
+    {
+        return $this->getVar("user_aim", $format);
+    }
+    
+    function user_yim($format="S")
+    {
+        return $this->getVar("user_yim", $format);
+    }
+    
+    function user_msnm($format="S")
+    {
+        return $this->getVar("user_msnm", $format);
+    }
+    
+    function pass()
+    {
+        return $this->getVar("pass");
+    }
+    
+    function posts()
+    {
+        return $this->getVar("posts");
+    }
+    
+    function attachsig()
+    {
+        return $this->getVar("attachsig");
+    }
+    
+    function level()
+    {
+        return $this->getVar("level");
+    }
+    
+    function theme()
+    {
+        return $this->getVar("theme");
+    }
+    
+    function timezone()
+    {
+        return $this->getVar("timezone_offset");
+    }
+    
+    function umode()
+    {
+        return $this->getVar("umode");
+    }
+    
+    function uorder()
+    {
+        return $this->getVar("uorder");
+    }
+   
+    // RMV-NOTIFY
+    function notify_method()
+    {
+        return $this->getVar("notify_method");
+    }
+
+    function notify_mode()
+    {
+        return $this->getVar("notify_mode");
+    }
+ 
+    function user_occ($format="S")
+    {
+        return $this->getVar("user_occ", $format);
+    }
+    
+    function bio($format="S")
+    {
+        return $this->getVar("bio", $format);
+    }
+    
+    function user_intrest($format="S")
+    {
+        return $this->getVar("user_intrest", $format);
+    }
+    
+    function last_login()
+    {
+        return $this->getVar("last_login");
+    }
+    /**#@-*/
+    
+}
+
+/**
+ * Class that represents a guest user
+ * @author Kazumi Ono <onokazu@xoops.org>
+ * @copyright copyright (c) 2000-2003 XOOPS.org
+ * @package kernel
+ */
+class XoopsGuestUser extends XoopsUser
+{
+    /**
+     * check if the user is a guest user
+     *
+     * @return bool returns true
+     *
+     */
+    function isGuest()
+    {
+        return true;
+    }
+}
+
+
+/**
+* XOOPS user handler class.  
+* This class is responsible for providing data access mechanisms to the data source 
+* of XOOPS user class objects.
+*
+* @author  Kazumi Ono <onokazu@xoops.org>
+* @copyright copyright (c) 2000-2003 XOOPS.org
+* @package kernel
+*/
+class XoopsUserHandler extends XoopsObjectHandler
+{
+
+    /**
+     * create a new user
+     * 
+     * @param bool $isNew flag the new objects as "new"?
+     * @return object XoopsUser
+     */
+    function &create($isNew = true)
+    {
+        $user =& new XoopsUser();
+        if ($isNew) {
+            $user->setNew();
+        }
+        return $user;
+    }
+
+    /**
+     * retrieve a user
+     * 
+     * @param int $id UID of the user
+     * @return mixed reference to the {@link XoopsUser} object, FALSE if failed
+     */
+    function &get($id)
+    {
+        $ret = false;
+        if (intval($id) > 0) {
+            $sql = 'SELECT * FROM '.$this->db->prefix('users').' WHERE uid='.$id;
+            if ($result = $this->db->query($sql)) {
+                $numrows = $this->db->getRowsNum($result);
+                if ($numrows == 1) {
+                    $user =& new XoopsUser();
+                    $user->assignVars($this->db->fetchArray($result));
+                    $ret =& $user;
+                }
+            }
+        }
+        return $ret;
+    }
+
+    /**
+     * insert a new user in the database
+     * 
+     * @param object $user reference to the {@link XoopsUser} object
+     * @param bool $force
+     * @return bool FALSE if failed, TRUE if already present and unchanged or successful
+     */
+    function insert(&$user, $force = false)
+    {
+        if (strtolower(get_class($user)) != 'xoopsuser') {
+            return false;
+        }
+        if (!$user->isDirty()) {
+            return true;
+        }
+        if (!$user->cleanVars()) {
+            return false;
+        }
+        foreach ($user->cleanVars as $k => $v) {
+            ${$k} = $v;
+        }
+        // RMV-NOTIFY
+        // Added two fields, notify_method, notify_mode
+        if ($user->isNew()) {
+            $uid = $this->db->genId($this->db->prefix('users').'_uid_seq');
+            $sql = sprintf("INSERT INTO %s (uid, uname, name, email, url, user_avatar, user_regdate, user_icq, user_from, user_sig, user_viewemail, actkey, user_aim, user_yim, user_msnm, pass, posts, attachsig, rank, level, theme, timezone_offset, last_login, umode, uorder, notify_method, notify_mode, user_occ, bio, user_intrest, user_mailok) VALUES (%u, %s, %s, %s, %s, %s, %u, %s, %s, %s, %u, %s, %s, %s, %s, %s, %u, %u, %u, %u, %s, %.2f, %u, %s, %u, %u, %u, %s, %s, %s, %u)", $this->db->prefix('users'), $uid, $this->db->quoteString($uname), $this->db->quoteString($name), $this->db->quoteString($email), $this->db->quoteString($url), $this->db->quoteString($user_avatar), time(), $this->db->quoteString($user_icq), $this->db->quoteString($user_from), $this->db->quoteString($user_sig), $user_viewemail, $this->db->quoteString($actkey), $this->db->quoteString($user_aim), $this->db->quoteString($user_yim), $this->db->quoteString($user_msnm), $this->db->quoteString($pass), $posts, $attachsig, $rank, $level, $this->db->quoteString($theme), $timezone_offset, 0, $this->db->quoteString($umode), $uorder, $notify_method, $notify_mode, $this->db->quoteString($user_occ), $this->db->quoteString($bio), $this->db->quoteString($user_intrest), $user_mailok);
+        } else {
+            $sql = sprintf("UPDATE %s SET uname = %s, name = %s, email = %s, url = %s, user_avatar = %s, user_icq = %s, user_from = %s, user_sig = %s, user_viewemail = %u, user_aim = %s, user_yim = %s, user_msnm = %s, posts = %d,  pass = %s, attachsig = %u, rank = %u, level= %u, theme = %s, timezone_offset = %.2f, umode = %s, last_login = %u, uorder = %u, notify_method = %u, notify_mode = %u, user_occ = %s, bio = %s, user_intrest = %s, user_mailok = %u WHERE uid = %u", $this->db->prefix('users'), $this->db->quoteString($uname), $this->db->quoteString($name), $this->db->quoteString($email), $this->db->quoteString($url), $this->db->quoteString($user_avatar), $this->db->quoteString($user_icq), $this->db->quoteString($user_from), $this->db->quoteString($user_sig), $user_viewemail, $this->db->quoteString($user_aim), $this->db->quoteString($user_yim), $this->db->quoteString($user_msnm), $posts, $this->db->quoteString($pass), $attachsig, $rank, $level, $this->db->quoteString($theme), $timezone_offset, $this->db->quoteString($umode), $last_login, $uorder, $notify_method, $notify_mode, $this->db->quoteString($user_occ), $this->db->quoteString($bio), $this->db->quoteString($user_intrest), $user_mailok, $uid);
+        }
+        if (false != $force) {
+            $result = $this->db->queryF($sql);
+        } else {
+            $result = $this->db->query($sql);
+        }
+        if (!$result) {
+            return false;
+        }
+        if (empty($uid)) {
+            $uid = $this->db->getInsertId();
+        }
+        $user->assignVar('uid', $uid);
+        return true;
+    }
+
+    /**
+     * delete a user from the database
+     * 
+     * @param object $user reference to the user to delete
+     * @param bool $force
+     * @return bool FALSE if failed.
+     */
+    function delete(&$user, $force = false)
+    {
+        if (strtolower(get_class($user)) != 'xoopsuser') {
+            return false;
+        }
+        $sql = sprintf("DELETE FROM %s WHERE uid = %u", $this->db->prefix("users"), $user->getVar('uid'));
+        if (false != $force) {
+            $result = $this->db->queryF($sql);
+        } else {
+            $result = $this->db->query($sql);
+        }
+        if (!$result) {
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     * retrieve users from the database
+     * 
+     * @param object $criteria {@link CriteriaElement} conditions to be met
+     * @param bool $id_as_key use the UID as key for the array?
+     * @return array array of {@link XoopsUser} objects
+     */
+    function &getObjects($criteria = null, $id_as_key = false)
+    {
+        $ret = array();
+        $limit = $start = 0;
+        $sql = 'SELECT * FROM '.$this->db->prefix('users');
+        if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
+            $sql .= ' '.$criteria->renderWhere();
+            if ($criteria->getSort() != '') {
+                $sql .= ' ORDER BY '.$criteria->getSort().' '.$criteria->getOrder();
+            }
+            $limit = $criteria->getLimit();
+            $start = $criteria->getStart();
+        }
+        $result = $this->db->query($sql, $limit, $start);
+        if (!$result) {
+            return $ret;
+        }
+        while ($myrow = $this->db->fetchArray($result)) {
+            $user =& new XoopsUser();
+            $user->assignVars($myrow);
+            if (!$id_as_key) {
+                $ret[] =& $user;
+            } else {
+                $ret[$myrow['uid']] =& $user;
+            }
+            unset($user);
+        }
+        return $ret;
+    }
+
+    /**
+     * count users matching a condition
+     * 
+     * @param object $criteria {@link CriteriaElement} to match
+     * @return int count of users
+     */
+    function getCount($criteria = null)
+    {
+        $sql = 'SELECT COUNT(*) FROM '.$this->db->prefix('users');
+        if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
+            $sql .= ' '.$criteria->renderWhere();
+        }
+        $result = $this->db->query($sql);
+        if (!$result) {
+            return 0;
+        }
+        list($count) = $this->db->fetchRow($result);
+        return $count;
+    }
+
+    /**
+     * delete users matching a set of conditions
+     * 
+     * @param object $criteria {@link CriteriaElement} 
+     * @return bool FALSE if deletion failed
+     */
+    function deleteAll($criteria = null)
+    {
+        $sql = 'DELETE FROM '.$this->db->prefix('users');
+        if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
+            $sql .= ' '.$criteria->renderWhere();
+        }
+        if (!$result = $this->db->query($sql)) {
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     * Change a value for users with a certain criteria
+     * 
+     * @param   string  $fieldname  Name of the field
+     * @param   string  $fieldvalue Value to write
+     * @param   object  $criteria   {@link CriteriaElement} 
+     * 
+     * @return  bool
+     **/
+    function updateAll($fieldname, $fieldvalue, $criteria = null)
+    {
+        $set_clause = is_numeric($fieldvalue) ? $fieldname.' = '.$fieldvalue : $fieldname.' = '.$this->db->quoteString($fieldvalue);
+        $sql = 'UPDATE '.$this->db->prefix('users').' SET '.$set_clause;
+        if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
+            $sql .= ' '.$criteria->renderWhere();
+        }
+        if (!$result = $this->db->query($sql)) {
+            return false;
+        }
+        return true;
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/kernel/imagecategory.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/kernel/imagecategory.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/kernel/imagecategory.php	(revision 405)
@@ -0,0 +1,217 @@
+<?php
+// $Id: imagecategory.php,v 1.3 2006/05/01 02:37:28 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+if (!defined('XOOPS_ROOT_PATH')) {
+    exit();
+}
+
+class XoopsImagecategory extends XoopsObject
+{
+    var $_imageCount;
+
+    function XoopsImagecategory()
+    {
+        $this->XoopsObject();
+        $this->initVar('imgcat_id', XOBJ_DTYPE_INT, null, false);
+        $this->initVar('imgcat_name', XOBJ_DTYPE_TXTBOX, null, true, 100);
+        $this->initVar('imgcat_display', XOBJ_DTYPE_INT, 1, false);
+        $this->initVar('imgcat_weight', XOBJ_DTYPE_INT, 0, false);
+        $this->initVar('imgcat_maxsize', XOBJ_DTYPE_INT, 0, false);
+        $this->initVar('imgcat_maxwidth', XOBJ_DTYPE_INT, 0, false);
+        $this->initVar('imgcat_maxheight', XOBJ_DTYPE_INT, 0, false);
+        $this->initVar('imgcat_type', XOBJ_DTYPE_OTHER, null, false);
+        $this->initVar('imgcat_storetype', XOBJ_DTYPE_OTHER, null, false);
+    }
+
+    function setImageCount($value)
+    {
+        $this->_imageCount = intval($value);
+    }
+
+    function getImageCount()
+    {
+        return $this->_imageCount;
+    }
+}
+
+/**
+* XOOPS image caetgory handler class.  
+* This class is responsible for providing data access mechanisms to the data source 
+* of XOOPS image category class objects.
+*
+*
+* @author  Kazumi Ono <onokazu@xoops.org>
+*/
+
+class XoopsImagecategoryHandler extends XoopsObjectHandler
+{
+
+    function &create($isNew = true)
+    {
+        $imgcat =& new XoopsImagecategory();
+        if ($isNew) {
+            $imgcat->setNew();
+        }
+        return $imgcat;
+    }
+
+    function &get($id)
+    {
+        $ret = false;
+        if (intval($id) > 0) {
+            $sql = 'SELECT * FROM '.$this->db->prefix('imagecategory').' WHERE imgcat_id='.$id;
+            if ($result = $this->db->query($sql)) {
+                $numrows = $this->db->getRowsNum($result);
+                if ($numrows == 1) {
+                    $imgcat =& new XoopsImagecategory();
+                    $imgcat->assignVars($this->db->fetchArray($result));
+                    $ret =& $imgcat;
+                }
+            }
+        }
+        return $ret;
+    }
+
+    function insert(&$imgcat)
+    {
+        if (strtolower(get_class($imgcat)) != 'xoopsimagecategory') {
+            return false;
+        }
+        if (!$imgcat->isDirty()) {
+            return true;
+        }
+        if (!$imgcat->cleanVars()) {
+            return false;
+        }
+        foreach ($imgcat->cleanVars as $k => $v) {
+            ${$k} = $v;
+        }
+        if ($imgcat->isNew()) {
+            $imgcat_id = $this->db->genId('imgcat_imgcat_id_seq');
+            $sql = sprintf("INSERT INTO %s (imgcat_id, imgcat_name, imgcat_display, imgcat_weight, imgcat_maxsize, imgcat_maxwidth, imgcat_maxheight, imgcat_type, imgcat_storetype) VALUES (%u, %s, %u, %u, %u, %u, %u, %s, %s)", $this->db->prefix('imagecategory'), $imgcat_id, $this->db->quoteString($imgcat_name), $imgcat_display, $imgcat_weight, $imgcat_maxsize, $imgcat_maxwidth, $imgcat_maxheight, $this->db->quoteString($imgcat_type), $this->db->quoteString($imgcat_storetype));
+        } else {
+            $sql = sprintf("UPDATE %s SET imgcat_name = %s, imgcat_display = %u, imgcat_weight = %u, imgcat_maxsize = %u, imgcat_maxwidth = %u, imgcat_maxheight = %u, imgcat_type = %s WHERE imgcat_id = %u", $this->db->prefix('imagecategory'), $this->db->quoteString($imgcat_name), $imgcat_display, $imgcat_weight, $imgcat_maxsize, $imgcat_maxwidth, $imgcat_maxheight, $this->db->quoteString($imgcat_type), $imgcat_id);
+        }
+        if (!$result = $this->db->query($sql)) {
+            return false;
+        }
+        if (empty($imgcat_id)) {
+            $imgcat_id = $this->db->getInsertId();
+        }
+        $imgcat->assignVar('imgcat_id', $imgcat_id);
+        return true;
+    }
+
+    function delete(&$imgcat)
+    {
+        if (strtolower(get_class($imgcat)) != 'xoopsimagecategory') {
+            return false;
+        }
+        $sql = sprintf("DELETE FROM %s WHERE imgcat_id = %u", $this->db->prefix('imagecategory'), $imgcat->getVar('imgcat_id'));
+        if (!$result = $this->db->query($sql)) {
+            return false;
+        }
+        return true;
+    }
+
+    function &getObjects($criteria = null, $id_as_key = false)
+    {
+        $ret = array();
+        $limit = $start = 0;
+        $sql = 'SELECT DISTINCT c.* FROM '.$this->db->prefix('imagecategory').' c LEFT JOIN '.$this->db->prefix('group_permission')." l ON l.gperm_itemid=c.imgcat_id WHERE (l.gperm_name = 'imgcat_read' OR l.gperm_name = 'imgcat_write')";
+        if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
+            $where = $criteria->render();
+            $sql .= ($where != '') ? ' AND '.$where : '';
+            $limit = $criteria->getLimit();
+            $start = $criteria->getStart();
+        }
+        $sql .= ' ORDER BY imgcat_weight, imgcat_id ASC';
+        $result = $this->db->query($sql, $limit, $start);
+        if (!$result) {
+            return $ret;
+        }
+        while ($myrow = $this->db->fetchArray($result)) {
+            $imgcat =& new XoopsImagecategory();
+            $imgcat->assignVars($myrow);
+            if (!$id_as_key) {
+                $ret[] =& $imgcat;
+            } else {
+                $ret[$myrow['imgcat_id']] =& $imgcat;
+            }
+            unset($imgcat);
+        }
+        return $ret;
+    }
+
+
+    function getCount($criteria = null)
+    {
+        $sql = 'SELECT COUNT(*) FROM '.$this->db->prefix('imagecategory').' i LEFT JOIN '.$this->db->prefix('group_permission')." l ON l.gperm_itemid=i.imgcat_id WHERE (l.gperm_name = 'imgcat_read' OR l.gperm_name = 'imgcat_write')";
+        if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
+            $where = $criteria->render();
+            $sql .= ($where != '') ? ' AND '.$where : '';
+        }
+        if (!$result =& $this->db->query($sql)) {
+            return 0;
+        }
+        list($count) = $this->db->fetchRow($result);
+        return $count;
+    }
+
+    function &getList($groups = array(), $perm = 'imgcat_read', $display = null, $storetype = null)
+    {
+        $criteria = new CriteriaCompo();
+        if (is_array($groups) && !empty($groups)) {
+            $criteriaTray = new CriteriaCompo();
+            foreach ($groups as $gid) {
+                $criteriaTray->add(new Criteria('gperm_groupid', $gid), 'OR');
+            }
+            $criteria->add($criteriaTray);
+            if ($perm == 'imgcat_read' || $perm == 'imgcat_write') {
+                $criteria->add(new Criteria('gperm_name', $perm));
+                $criteria->add(new Criteria('gperm_modid', 1));
+            }
+        }
+        if (isset($display)) {
+            $criteria->add(new Criteria('imgcat_display', intval($display)));
+        }
+        if (isset($storetype)) {
+            $criteria->add(new Criteria('imgcat_storetype', $storetype));
+        }
+        $categories =& $this->getObjects($criteria, true);
+        $ret = array();
+        foreach (array_keys($categories) as $i) {
+                $ret[$i] = $categories[$i]->getVar('imgcat_name');
+        }
+        return $ret;
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/kernel/groupperm.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/kernel/groupperm.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/kernel/groupperm.php	(revision 405)
@@ -0,0 +1,406 @@
+<?php
+// $Id: groupperm.php,v 1.3 2006/05/01 02:37:28 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+if (!defined('XOOPS_ROOT_PATH')) {
+    exit();
+}
+
+/**
+ * 
+ * 
+ * @package     kernel
+ * 
+ * @author      Kazumi Ono  <onokazu@xoops.org>
+ * @copyright   copyright (c) 2000-2003 XOOPS.org
+ */
+
+/**
+ * A group permission
+ * 
+ * These permissions are managed through a {@link XoopsGroupPermHandler} object
+ * 
+ * @package     kernel
+ * 
+ * @author      Kazumi Ono  <onokazu@xoops.org>
+ * @copyright   copyright (c) 2000-2003 XOOPS.org
+ */
+class XoopsGroupPerm extends XoopsObject
+{
+
+    /**
+     * Constructor
+     * 
+     */
+    function XoopsGroupPerm()
+    {
+        $this->XoopsObject();
+        $this->initVar('gperm_id', XOBJ_DTYPE_INT, null, false);
+        $this->initVar('gperm_groupid', XOBJ_DTYPE_INT, null, false);
+        $this->initVar('gperm_itemid', XOBJ_DTYPE_INT, null, false);
+        $this->initVar('gperm_modid', XOBJ_DTYPE_INT, 0, false);
+        $this->initVar('gperm_name', XOBJ_DTYPE_OTHER, null, false);
+    }
+}
+
+
+/**
+* XOOPS group permission handler class.
+* 
+* This class is responsible for providing data access mechanisms to the data source 
+* of XOOPS group permission class objects. 
+* This class is an abstract class to be implemented by child group permission classes.
+*
+* @see          XoopsGroupPerm
+* @author       Kazumi Ono  <onokazu@xoops.org>
+* @copyright    copyright (c) 2000-2003 XOOPS.org
+*/
+class XoopsGroupPermHandler extends XoopsObjectHandler
+{
+
+    /**
+     * Create a new {@link XoopsGroupPerm} 
+     * 
+     * @return  bool    $isNew  Flag the object as "new"?
+     */
+    function &create($isNew = true)
+    {
+        $perm =& new XoopsGroupPerm();
+        if ($isNew) {
+            $perm->setNew();
+        }
+        return $perm;
+    }
+
+    /**
+     * Retrieve a group permission
+     * 
+     * @param   int $id ID
+     * 
+     * @return  object  {@link XoopsGroupPerm}, FALSE on fail
+     */
+    function &get($id)
+    {
+        $ret = false;
+        if (intval($id) > 0) {
+            $sql = sprintf("SELECT * FROM %s WHERE gperm_id = %u", $this->db->prefix('group_permission'), $id);
+            if ($result = $this->db->query($sql)) {
+                $numrows = $this->db->getRowsNum($result);
+                if ( $numrows == 1 ) {
+                    $perm =& new XoopsGroupPerm();
+                    $perm->assignVars($this->db->fetchArray($result));
+                    $ret =& $perm;
+                }
+            }
+        }
+        return $ret;
+    }
+
+    /**
+     * Store a {@link XoopsGroupPerm} 
+     * 
+     * @param   object  &$perm  {@link XoopsGroupPerm} object
+     * 
+     * @return  bool    TRUE on success
+     */
+    function insert(&$perm)
+    {
+        if ( strtolower(get_class($perm)) != 'xoopsgroupperm' ) {
+            return false;
+        }
+        if ( !$perm->isDirty() ) {
+            return true;
+        }
+        if (!$perm->cleanVars()) {
+            return false;
+        }
+        foreach ($perm->cleanVars as $k => $v) {
+            ${$k} = $v;
+        }
+        if ($perm->isNew()) {
+            $gperm_id = $this->db->genId('group_permission_gperm_id_seq');
+            $sql = sprintf("INSERT INTO %s (gperm_id, gperm_groupid, gperm_itemid, gperm_modid, gperm_name) VALUES (%u, %u, %u, %u, %s)", $this->db->prefix('group_permission'), $gperm_id, $gperm_groupid, $gperm_itemid, $gperm_modid, $this->db->quoteString($gperm_name));
+        } else {
+            $sql = sprintf("UPDATE %s SET gperm_groupid = %u, gperm_itemid = %u, gperm_modid = %u WHERE gperm_id = %u", $this->db->prefix('group_permission'), $gperm_groupid, $gperm_itemid, $gperm_modid, $gperm_id);
+        }
+        if (!$result = $this->db->query($sql)) {
+            return false;
+        }
+        if (empty($gperm_id)) {
+            $gperm_id = $this->db->getInsertId();
+        }
+        $perm->assignVar('gperm_id', $gperm_id);
+        return true;
+    }
+
+    /**
+     * Delete a {@link XoopsGroupPerm} 
+     * 
+     * @param   object  &$perm  
+     * 
+     * @return  bool    TRUE on success
+     */
+    function delete(&$perm)
+    {
+        if (strtolower(get_class($perm)) != 'xoopsgroupperm') {
+            return false;
+        }
+        $sql = sprintf("DELETE FROM %s WHERE gperm_id = %u", $this->db->prefix('group_permission'), $perm->getVar('gperm_id'));
+        if (!$result = $this->db->query($sql)) {
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     * Retrieve multiple {@link XoopsGroupPerm}s 
+     * 
+     * @param   object  $criteria   {@link CriteriaElement}
+     * @param   bool    $id_as_key  Use IDs as array keys?
+     * 
+     * @return  array   Array of {@link XoopsGroupPerm}s 
+     */
+    function &getObjects($criteria = null, $id_as_key = false)
+    {
+        $ret = array();
+        $limit = $start = 0;
+        $sql = 'SELECT * FROM '.$this->db->prefix('group_permission');
+        if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
+            $sql .= ' '.$criteria->renderWhere();
+            $limit = $criteria->getLimit();
+            $start = $criteria->getStart();
+        }
+        $result = $this->db->query($sql, $limit, $start);
+        if (!$result) {
+            return $ret;
+        }
+        while ($myrow = $this->db->fetchArray($result)) {
+            $perm =& new XoopsGroupPerm();
+            $perm->assignVars($myrow);
+            if (!$id_as_key) {
+                $ret[] =& $perm;
+            } else {
+                $ret[$myrow['gperm_id']] =& $perm;
+            }
+            unset($perm);
+        }
+        return $ret;
+    }
+
+    /**
+     * Count some {@link XoopsGroupPerm}s 
+     * 
+     * @param   object  $criteria   {@link CriteriaElement} 
+     * 
+     * @return  int
+     */
+    function getCount($criteria = null)
+    {
+        $sql = 'SELECT COUNT(*) FROM '.$this->db->prefix('group_permission');
+        if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
+            $sql .= ' '.$criteria->renderWhere();
+        }
+        $result = $this->db->query($sql);
+        if (!$result) {
+            return 0;
+        }
+        list($count) = $this->db->fetchRow($result);
+        return $count;
+    }
+
+    /**
+     * Delete all permissions by a certain criteria
+     * 
+     * @param   object  $criteria   {@link CriteriaElement} 
+     * 
+     * @return  bool    TRUE on success
+     */
+    function deleteAll($criteria = null)
+    {
+        $sql = sprintf("DELETE FROM %s", $this->db->prefix('group_permission'));        if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
+            $sql .= ' '.$criteria->renderWhere();
+        }
+        if (!$result = $this->db->query($sql)) {
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     * Delete all module specific permissions assigned for a group
+     * 
+     * @param   int  $gperm_groupid ID of a group
+     * @param   int  $gperm_modid ID of a module
+     * 
+     * @return  bool TRUE on success
+     */
+    function deleteByGroup($gperm_groupid, $gperm_modid = null)
+    {
+        $criteria = new CriteriaCompo(new Criteria('gperm_groupid', intval($gperm_groupid)));
+        if (isset($gperm_modid)) {
+            $criteria->add(new Criteria('gperm_modid', intval($gperm_modid)));
+        }
+        return $this->deleteAll($criteria);
+    }
+
+    /**
+     * Delete all module specific permissions
+     * 
+     * @param   int  $gperm_modid ID of a module
+     * @param   string  $gperm_name Name of a module permission
+     * @param   int  $gperm_itemid ID of a module item
+     * 
+     * @return  bool TRUE on success
+     */
+    function deleteByModule($gperm_modid, $gperm_name = null, $gperm_itemid = null)
+    {
+        $criteria = new CriteriaCompo(new Criteria('gperm_modid', intval($gperm_modid)));
+        if (isset($gperm_name)) {
+            $criteria->add(new Criteria('gperm_name', $gperm_name));
+            if (isset($gperm_itemid)) {
+                $criteria->add(new Criteria('gperm_itemid', intval($gperm_itemid)));
+            }
+        }
+        return $this->deleteAll($criteria);
+    }
+    /**#@-*/
+
+    /**
+     * Check permission
+     * 
+     * @param   string    $gperm_name       Name of permission
+     * @param   int       $gperm_itemid     ID of an item
+     * @param   int/array $gperm_groupid    A group ID or an array of group IDs
+     * @param   int       $gperm_modid      ID of a module
+     * 
+     * @return  bool    TRUE if permission is enabled
+     */
+    function checkRight($gperm_name, $gperm_itemid, $gperm_groupid, $gperm_modid = 1)
+    {
+        $criteria = new CriteriaCompo(new Criteria('gperm_modid', $gperm_modid));
+        $criteria->add(new Criteria('gperm_name', $gperm_name));
+        $gperm_itemid = intval($gperm_itemid);
+        if ($gperm_itemid > 0) {
+            $criteria->add(new Criteria('gperm_itemid', $gperm_itemid));
+        }
+        if (is_array($gperm_groupid)) {
+            if (in_array(XOOPS_GROUP_ADMIN, $gperm_groupid)) {
+                return true;
+            }
+            $criteria2 = new CriteriaCompo();
+            foreach ($gperm_groupid as $gid) {
+                $criteria2->add(new Criteria('gperm_groupid', $gid), 'OR');
+            }
+            $criteria->add($criteria2);
+        } else {
+            if (XOOPS_GROUP_ADMIN == $gperm_groupid) {
+                return true;
+            }
+            $criteria->add(new Criteria('gperm_groupid', $gperm_groupid));
+        }
+        if ($this->getCount($criteria) > 0) {
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * Add a permission
+     * 
+     * @param   string  $gperm_name       Name of permission
+     * @param   int     $gperm_itemid     ID of an item
+     * @param   int     $gperm_groupid    ID of a group
+     * @param   int     $gperm_modid      ID of a module
+     *
+     * @return  bool    TRUE jf success
+     */
+    function addRight($gperm_name, $gperm_itemid, $gperm_groupid, $gperm_modid = 1)
+    {
+        $perm =& $this->create();
+        $perm->setVar('gperm_name', $gperm_name);
+        $perm->setVar('gperm_groupid', $gperm_groupid);
+        $perm->setVar('gperm_itemid', $gperm_itemid);
+        $perm->setVar('gperm_modid', $gperm_modid);
+        return $this->insert($perm);
+    }
+
+    /**
+     * Get all item IDs that a group is assigned a specific permission
+     * 
+     * @param   string    $gperm_name       Name of permission
+     * @param   int/array $gperm_groupid    A group ID or an array of group IDs
+     * @param   int       $gperm_modid      ID of a module
+     *
+     * @return  array     array of item IDs
+     */
+    function getItemIds($gperm_name, $gperm_groupid, $gperm_modid = 1)
+    {
+        $ret = array();
+        $criteria = new CriteriaCompo(new Criteria('gperm_name', $gperm_name));
+        $criteria->add(new Criteria('gperm_modid', intval($gperm_modid)));
+        if (is_array($gperm_groupid)) {
+            $criteria2 = new CriteriaCompo();
+            foreach ($gperm_groupid as $gid) {
+                $criteria2->add(new Criteria('gperm_groupid', $gid), 'OR');
+            }
+            $criteria->add($criteria2);
+        } else {
+            $criteria->add(new Criteria('gperm_groupid', intval($gperm_groupid)));
+        }
+        $perms =& $this->getObjects($criteria, true);
+        foreach (array_keys($perms) as $i) {
+            $ret[] = $perms[$i]->getVar('gperm_itemid');
+        }
+        return array_unique($ret);
+    }
+
+    /**
+     * Get all group IDs assigned a specific permission for a particular item
+     * 
+     * @param   string  $gperm_name       Name of permission
+     * @param   int     $gperm_itemid     ID of an item
+     * @param   int     $gperm_modid      ID of a module
+     *
+     * @return  array   array of group IDs
+     */
+    function getGroupIds($gperm_name, $gperm_itemid, $gperm_modid = 1)
+    {
+        $ret = array();
+        $criteria = new CriteriaCompo(new Criteria('gperm_name', $gperm_name));
+        $criteria->add(new Criteria('gperm_itemid', intval($gperm_itemid)));
+        $criteria->add(new Criteria('gperm_modid', intval($gperm_modid)));
+        $perms =& $this->getObjects($criteria, true);
+        foreach (array_keys($perms) as $i) {
+            $ret[] = $perms[$i]->getVar('gperm_groupid');
+        }
+        return $ret;
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/kernel/image.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/kernel/image.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/kernel/image.php	(revision 405)
@@ -0,0 +1,273 @@
+<?php
+// $Id: image.php,v 1.3 2006/05/01 02:37:28 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+if (!defined('XOOPS_ROOT_PATH')) {
+    exit();
+}
+
+/**
+ * An Image
+ *
+ * @package     kernel
+ * @author      Kazumi Ono  <onokazu@xoops.org>
+ * @copyright   (c) 2000-2003 The Xoops Project - www.xoops.org
+ */
+class XoopsImage extends XoopsObject
+{
+    /**
+     * Constructor
+     **/
+    function XoopsImage()
+    {
+        $this->XoopsObject();
+        $this->initVar('image_id', XOBJ_DTYPE_INT, null, false);
+        $this->initVar('image_name', XOBJ_DTYPE_OTHER, null, false, 30);
+        $this->initVar('image_nicename', XOBJ_DTYPE_TXTBOX, null, true, 100);
+        $this->initVar('image_mimetype', XOBJ_DTYPE_OTHER, null, false);
+        $this->initVar('image_created', XOBJ_DTYPE_INT, null, false);
+        $this->initVar('image_display', XOBJ_DTYPE_INT, 1, false);
+        $this->initVar('image_weight', XOBJ_DTYPE_INT, 0, false);
+        $this->initVar('image_body', XOBJ_DTYPE_SOURCE, null, true);
+        $this->initVar('imgcat_id', XOBJ_DTYPE_INT, 0, false);
+    }
+}
+
+/**
+ * XOOPS image handler class.  
+ * 
+ * This class is responsible for providing data access mechanisms to the data source 
+ * of XOOPS image class objects.
+ *
+ * @package     kernel
+ *
+ * @author      Kazumi Ono  <onokazu@xoops.org>
+ * @copyright   (c) 2000-2003 The Xoops Project - www.xoops.org
+ */
+class XoopsImageHandler extends XoopsObjectHandler
+{
+
+    /**
+     * Create a new {@link XoopsImage} 
+     * 
+     * @param   boolean $isNew  Flag the object as "new"
+     * @return  object
+     **/
+    function &create($isNew = true)
+    {
+        $image =& new XoopsImage();
+        if ($isNew) {
+            $image->setNew();
+        }
+        return $image;
+    }
+
+    /**
+     * Load a {@link XoopsImage} object from the database
+     * 
+     * @param   int     $id     ID
+     * @param   boolean $getbinary  
+     * @return  object  {@link XoopsImage}, FALSE on fail
+     **/
+    function &get($id, $getbinary=true)
+    {
+        $ret = false;
+        $id = intval($id);
+        if ($id > 0) {
+            $sql = 'SELECT i.*, b.image_body FROM '.$this->db->prefix('image').' i LEFT JOIN '.$this->db->prefix('imagebody').' b ON b.image_id=i.image_id WHERE i.image_id='.$id;
+            if ($result = $this->db->query($sql)) {
+                $numrows = $this->db->getRowsNum($result);
+                if ($numrows == 1) {
+                    $image =& new XoopsImage();
+                    $image->assignVars($this->db->fetchArray($result));
+                    $ret =& $image;
+                }
+            }
+        }
+        return $ret;
+    }
+
+    /**
+     * Write a {@link XoopsImage} object to the database
+     * 
+     * @param   object  &$image {@link XoopsImage} 
+     * @return  bool
+     **/
+    function insert(&$image)
+    {
+        if (strtolower(get_class($image)) != 'xoopsimage') {
+            return false;
+        }
+        if (!$image->isDirty()) {
+            return true;
+        }
+        if (!$image->cleanVars()) {
+            return false;
+        }
+        foreach ($image->cleanVars as $k => $v) {
+            ${$k} = $v;
+        }
+        if ($image->isNew()) {
+            $image_id = $this->db->genId('image_image_id_seq');
+            $sql = sprintf("INSERT INTO %s (image_id, image_name, image_nicename, image_mimetype, image_created, image_display, image_weight, imgcat_id) VALUES (%u, %s, %s, %s, %u, %u, %u, %u)", $this->db->prefix('image'), $image_id, $this->db->quoteString($image_name), $this->db->quoteString($image_nicename), $this->db->quoteString($image_mimetype), time(), $image_display, $image_weight, $imgcat_id);
+            if (!$result = $this->db->query($sql)) {
+                return false;
+            }
+            if (empty($image_id)) {
+                $image_id = $this->db->getInsertId();
+            }
+            if (isset($image_body) && $image_body != '') {
+                $sql = sprintf("INSERT INTO %s (image_id, image_body) VALUES (%u, %s)", $this->db->prefix('imagebody'), $image_id, $this->db->quoteString($image_body));
+                if (!$result = $this->db->query($sql)) {
+                    $sql = sprintf("DELETE FROM %s WHERE image_id = %u", $this->db->prefix('image'), $image_id);
+                    $this->db->query($sql);
+                    return false;
+                }
+            }
+            $image->assignVar('image_id', $image_id);
+        } else {
+            $sql = sprintf("UPDATE %s SET image_name = %s, image_nicename = %s, image_display = %u, image_weight = %u, imgcat_id = %u WHERE image_id = %u", $this->db->prefix('image'), $this->db->quoteString($image_name), $this->db->quoteString($image_nicename), $image_display, $image_weight, $imgcat_id, $image_id);
+            if (!$result = $this->db->query($sql)) {
+                return false;
+            }
+            if (isset($image_body) && $image_body != '') {
+                $sql = sprintf("UPDATE %s SET image_body = %s WHERE image_id = %u", $this->db->prefix('imagebody'), $this->db->quoteString($image_body), $image_id);
+                if (!$result = $this->db->query($sql)) {
+                    $this->db->query(sprintf("DELETE FROM %s WHERE image_id = %u", $this->db->prefix('image'), $image_id));
+                    return false;
+                }
+            }
+        }
+        return true;
+    }
+
+    /**
+     * Delete an image from the database
+     * 
+     * @param   object  &$image {@link XoopsImage} 
+     * @return  bool
+     **/
+    function delete(&$image)
+    {
+        if (strtolower(get_class($image)) != 'xoopsimage') {
+            return false;
+        }
+        $id = $image->getVar('image_id');
+        $sql = sprintf("DELETE FROM %s WHERE image_id = %u", $this->db->prefix('image'), $id);
+        if (!$result = $this->db->query($sql)) {
+            return false;
+        }
+        $sql = sprintf("DELETE FROM %s WHERE image_id = %u", $this->db->prefix('imagebody'), $id);
+        $this->db->query($sql);
+        return true;
+    }
+
+    /**
+     * Load {@link XoopsImage}s from the database
+     * 
+     * @param   object  $criteria   {@link CriteriaElement} 
+     * @param   boolean $id_as_key  Use the ID as key into the array
+     * @param   boolean $getbinary  
+     * @return  array   Array of {@link XoopsImage} objects
+     **/
+    function &getObjects($criteria = null, $id_as_key = false, $getbinary = false)
+    {
+        $ret = array();
+        $limit = $start = 0;
+        if ($getbinary) {
+            $sql = 'SELECT i.*, b.image_body FROM '.$this->db->prefix('image').' i LEFT JOIN '.$this->db->prefix('imagebody').' b ON b.image_id=i.image_id';
+        } else {
+            $sql = 'SELECT * FROM '.$this->db->prefix('image');
+        }
+        if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
+            $sql .= ' '.$criteria->renderWhere();
+            $sort = !in_array($criteria->getSort(), array('image_id', 'image_created', 'image_mimetype', 'image_display', 'image_weight')) ? 'image_weight' : $criteria->getSort();
+            $sql .= ' ORDER BY '.$sort.' '.$criteria->getOrder();
+            $limit = $criteria->getLimit();
+            $start = $criteria->getStart();
+        }
+        $result = $this->db->query($sql, $limit, $start);
+        if (!$result) {
+            return $ret;
+        }
+        while ($myrow = $this->db->fetchArray($result)) {
+            $image =& new XoopsImage();
+            $image->assignVars($myrow);
+            if (!$id_as_key) {
+                $ret[] =& $image;
+            } else {
+                $ret[$myrow['image_id']] =& $image;
+            }
+            unset($image);
+        }
+        return $ret;
+    }
+
+    /**
+     * Count some images
+     * 
+     * @param   object  $criteria   {@link CriteriaElement} 
+     * @return  int
+     **/
+    function getCount($criteria = null)
+    {
+        $sql = 'SELECT COUNT(*) FROM '.$this->db->prefix('image');
+        if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
+            $sql .= ' '.$criteria->renderWhere();
+        }
+        if (!$result =& $this->db->query($sql)) {
+            return 0;
+        }
+        list($count) = $this->db->fetchRow($result);
+        return $count;
+    }
+
+    /**
+     * Get a list of images
+     * 
+     * @param   int     $imgcat_id
+     * @param   bool    $image_display
+     * @return  array   Array of {@link XoopsImage} objects
+     **/
+    function &getList($imgcat_id, $image_display = null)
+    {
+        $criteria = new CriteriaCompo(new Criteria('imgcat_id', intval($imgcat_id)));
+        if (isset($image_display)) {
+            $criteria->add(new Criteria('image_display', intval($image_display)));
+        }
+        $images =& $this->getObjects($criteria, false, true);
+        $ret = array();
+        foreach (array_keys($images) as $i) {
+            $ret[$images[$i]->getVar('image_name')] = $images[$i]->getVar('image_nicename');
+        }
+        return $ret;
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/kernel/session.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/kernel/session.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/kernel/session.php	(revision 405)
@@ -0,0 +1,161 @@
+<?php
+// $Id: session.php,v 1.2 2005/03/18 12:52:14 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+/**
+ * @package     kernel
+ * 
+ * @author	    Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ */
+
+
+/**
+ * Handler for a session
+ * @package     kernel
+ * 
+ * @author	    Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ */
+class XoopsSessionHandler
+{
+
+    /**
+     * Database connection
+     * 
+     * @var	object
+     * @access	private
+     */
+    var $db;
+
+    /**
+     * Constructor
+     * 
+     * @param	object  &$mf    reference to a XoopsManagerFactory
+     * 
+     */
+    function XoopsSessionHandler(&$db)
+    {
+        $this->db =& $db;
+    }
+
+    /**
+     * Open a session
+     * 
+     * @param	string  $save_path
+     * @param	string  $session_name
+     * 
+     * @return	bool
+     */
+    function open($save_path, $session_name)
+	{
+        return true;
+    }
+
+    /**
+     * Close a session
+     * 
+     * @return	bool
+     */
+    function close()
+	{
+        return true;
+    }
+
+    /**
+     * Read a session from the database
+     * 
+     * @param	string  &sess_id    ID of the session
+     * 
+     * @return	array   Session data
+     */
+    function read($sess_id)
+	{
+        $sql = sprintf('SELECT sess_data FROM %s WHERE sess_id = %s', $this->db->prefix('session'), $this->db->quoteString($sess_id));
+        if (false != $result = $this->db->query($sql)) {
+            if (list($sess_data) = $this->db->fetchRow($result)) {
+                return $sess_data;
+            }
+        }
+        return '';
+    }
+
+    /**
+     * Write a session to the database
+     * 
+     * @param   string  $sess_id
+     * @param   string  $sess_data
+     * 
+     * @return  bool    
+     **/
+    function write($sess_id, $sess_data)
+	{
+		$sess_id = $this->db->quoteString($sess_id);
+		list($count) = $this->db->fetchRow($this->db->query("SELECT COUNT(*) FROM ".$this->db->prefix('session')." WHERE sess_id=".$sess_id));
+        if ( $count > 0 ) {
+			$sql = sprintf('UPDATE %s SET sess_updated = %u, sess_data = %s WHERE sess_id = %s', $this->db->prefix('session'), time(), $this->db->quoteString($sess_data), $sess_id);
+        } else {
+			$sql = sprintf('INSERT INTO %s (sess_id, sess_updated, sess_ip, sess_data) VALUES (%s, %u, %s, %s)', $this->db->prefix('session'), $sess_id, time(), $this->db->quoteString($_SERVER['REMOTE_ADDR']), $this->db->quoteString($sess_data));
+        }
+		if (!$this->db->queryF($sql)) {
+            return false;
+        }
+		return true;
+    }
+
+    /**
+     * Destroy a session
+     * 
+     * @param   string  $sess_id
+     * 
+     * @return  bool
+     **/
+    function destroy($sess_id)
+    {
+		$sql = sprintf('DELETE FROM %s WHERE sess_id = %s', $this->db->prefix('session'), $this->db->quoteString($sess_id));
+        if ( !$result = $this->db->queryF($sql) ) {
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     * Garbage Collector
+     * 
+     * @param   int $expire Time in seconds until a session expires
+	 * @return  bool
+     **/
+    function gc($expire)
+    {
+        $mintime = time() - intval($expire);
+		$sql = sprintf('DELETE FROM %s WHERE sess_updated < %u', $this->db->prefix('session'), $mintime);
+        return $this->db->queryF($sql);
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/kernel/configitem.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/kernel/configitem.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/kernel/configitem.php	(revision 405)
@@ -0,0 +1,335 @@
+<?php
+// $Id: configitem.php,v 1.3 2006/05/01 02:37:28 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+if (!defined('XOOPS_ROOT_PATH')) {
+    exit();
+}
+
+/**
+ * @package     kernel
+ * 
+ * @author      Kazumi Ono  <onokazu@xoops.org>
+ * @copyright   copyright (c) 2000-2003 XOOPS.org
+ */
+
+/**#@+
+ * Config type
+ */
+define('XOOPS_CONF', 1);
+define('XOOPS_CONF_USER', 2);
+define('XOOPS_CONF_METAFOOTER', 3);
+define('XOOPS_CONF_CENSOR', 4);
+define('XOOPS_CONF_SEARCH', 5);
+define('XOOPS_CONF_MAILER', 6);
+/**#@-*/
+
+/**
+ * 
+ * 
+ * @author      Kazumi Ono  <onokazu@xoops.org>
+ * @copyright   copyright (c) 2000-2003 XOOPS.org
+ */
+class XoopsConfigItem extends XoopsObject
+{
+
+    /**
+     * Config options
+     * 
+     * @var array
+     * @access  private
+     */
+    var $_confOptions = array();
+
+    /**
+     * Constructor
+     */
+    function XoopsConfigItem()
+    {
+        $this->initVar('conf_id', XOBJ_DTYPE_INT, null, false);
+        $this->initVar('conf_modid', XOBJ_DTYPE_INT, null, false);
+        $this->initVar('conf_catid', XOBJ_DTYPE_INT, null, false);
+        $this->initVar('conf_name', XOBJ_DTYPE_OTHER);
+        $this->initVar('conf_title', XOBJ_DTYPE_TXTBOX);
+        $this->initVar('conf_value', XOBJ_DTYPE_TXTAREA);
+        $this->initVar('conf_desc', XOBJ_DTYPE_OTHER);
+        $this->initVar('conf_formtype', XOBJ_DTYPE_OTHER);
+        $this->initVar('conf_valuetype', XOBJ_DTYPE_OTHER);
+        $this->initVar('conf_order', XOBJ_DTYPE_INT);
+    }
+
+    /**
+     * Get a config value in a format ready for output
+     * 
+     * @return  string
+     */
+    function &getConfValueForOutput()
+    {
+        switch ($this->getVar('conf_valuetype')) {
+        case 'int':
+            $ret = intval($this->getVar('conf_value', 'N'));
+            break;
+        case 'array':
+            $ret = unserialize($this->getVar('conf_value', 'N'));
+            break;
+        case 'float':
+            $value = $this->getVar('conf_value', 'N');
+            $ret = (float)$value;
+            break;
+        case 'textarea':
+            $ret = $this->getVar('conf_value');
+            break;
+        default:
+            $ret = $this->getVar('conf_value', 'N');
+            break;
+        }
+        return $ret;
+    }
+
+    /**
+     * Set a config value
+     * 
+     * @param   mixed   &$value Value
+     * @param   bool    $force_slash
+     */
+    function setConfValueForInput(&$value, $force_slash = false)
+    {
+        switch($this->getVar('conf_valuetype')) {
+        case 'array':
+            if (!is_array($value)) {
+                $value = explode('|', trim($value));
+            }
+            $this->setVar('conf_value', serialize($value), $force_slash);
+            break;
+        case 'text':
+            $this->setVar('conf_value', trim($value), $force_slash);
+            break;
+        default:
+            $this->setVar('conf_value', $value, $force_slash);
+            break;
+        }
+    }
+
+    /**
+     * Assign one or more {@link XoopsConfigItemOption}s 
+     * 
+     * @param   mixed   $option either a {@link XoopsConfigItemOption} object or an array of them
+     */
+    function setConfOptions($option)
+    {
+        if (is_array($option)) {
+            $count = count($option);
+            for ($i = 0; $i < $count; $i++) {
+                $this->setConfOptions($option[$i]);
+            }
+        } else {
+            if(is_object($option)) {
+                $this->_confOptions[] =& $option;
+            }
+        }
+    }
+
+    /**
+     * Get the {@link XoopsConfigItemOption}s of this Config
+     * 
+     * @return  array   array of {@link XoopsConfigItemOption} 
+     */
+    function &getConfOptions()
+    {
+        return $this->_confOptions;
+    }
+}
+
+
+/**
+* XOOPS configuration handler class.  
+* 
+* This class is responsible for providing data access mechanisms to the data source 
+* of XOOPS configuration class objects.
+*
+* @author       Kazumi Ono <onokazu@xoops.org>
+* @copyright    copyright (c) 2000-2003 XOOPS.org
+*/
+class XoopsConfigItemHandler extends XoopsObjectHandler
+{
+
+    /**
+     * Create a new {@link XoopsConfigItem}
+     * 
+     * @see     XoopsConfigItem
+     * @param   bool    $isNew  Flag the config as "new"?
+     * @return  object  reference to the new config
+     */
+    function &create($isNew = true)
+    {
+        $config =& new XoopsConfigItem();
+        if ($isNew) {
+            $config->setNew();
+        }
+        return $config;
+    }
+
+    /**
+     * Load a config from the database
+     * 
+     * @param   int $id ID of the config
+     * @return  object  reference to the config, FALSE on fail
+     */
+    function &get($id)
+    {
+        $ret = false;
+        $id = intval($id);
+        if ($id > 0) {
+            $sql = 'SELECT * FROM '.$this->db->prefix('config').' WHERE conf_id='.$id;
+            if ($result = $this->db->query($sql)) {
+                $numrows = $this->db->getRowsNum($result);
+                if ($numrows == 1) {
+                    $myrow = $this->db->fetchArray($result);
+                    $config =& new XoopsConfigItem();
+                    $config->assignVars($myrow);
+                    $ret =& $config;
+                }
+            }
+        }
+        return $ret;
+    }
+
+    /**
+     * Write a config to the database
+     * 
+     * @param   object  &$config    {@link XoopsConfigItem} object
+     * @return  mixed   FALSE on fail.
+     */
+    function insert(&$config)
+    {
+        if (strtolower(get_class($config)) != 'xoopsconfigitem') {
+            return false;
+        }
+        if (!$config->isDirty()) {
+            return true;
+        }
+        if (!$config->cleanVars()) {
+            return false;
+        }
+        foreach ($config->cleanVars as $k => $v) {
+            ${$k} = $v;
+        }
+        if ($config->isNew()) {
+            $conf_id = $this->db->genId('config_conf_id_seq');
+            $sql = sprintf("INSERT INTO %s (conf_id, conf_modid, conf_catid, conf_name, conf_title, conf_value, conf_desc, conf_formtype, conf_valuetype, conf_order) VALUES (%u, %u, %u, %s, %s, %s, %s, %s, %s, %u)", $this->db->prefix('config'), $conf_id, $conf_modid, $conf_catid, $this->db->quoteString($conf_name), $this->db->quoteString($conf_title), $this->db->quoteString($conf_value), $this->db->quoteString($conf_desc), $this->db->quoteString($conf_formtype), $this->db->quoteString($conf_valuetype), $conf_order);
+        } else {
+            $sql = sprintf("UPDATE %s SET conf_modid = %u, conf_catid = %u, conf_name = %s, conf_title = %s, conf_value = %s, conf_desc = %s, conf_formtype = %s, conf_valuetype = %s, conf_order = %u WHERE conf_id = %u", $this->db->prefix('config'), $conf_modid, $conf_catid, $this->db->quoteString($conf_name), $this->db->quoteString($conf_title), $this->db->quoteString($conf_value), $this->db->quoteString($conf_desc), $this->db->quoteString($conf_formtype), $this->db->quoteString($conf_valuetype), $conf_order, $conf_id);
+        }
+        if (!$result = $this->db->query($sql)) {
+            return false;
+        }
+        if (empty($conf_id)) {
+            $conf_id = $this->db->getInsertId();
+        }
+        $config->assignVar('conf_id', $conf_id);
+        return true;
+    }
+
+    /**
+     * Delete a config from the database
+     * 
+     * @param   object  &$config    Config to delete
+     * @return  bool    Successful?
+     */
+    function delete(&$config)
+    {
+        if (strtolower(get_class($config)) != 'xoopsconfigitem') {
+            return false;
+        }
+        $sql = sprintf("DELETE FROM %s WHERE conf_id = %u", $this->db->prefix('config'), $config->getVar('conf_id'));
+        if (!$result = $this->db->query($sql)) {
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     * Get configs from the database
+     * 
+     * @param   object  $criteria   {@link CriteriaElement}
+     * @param   bool    $id_as_key  return the config's id as key?
+     * @return  array   Array of {@link XoopsConfigItem} objects
+     */
+    function &getObjects($criteria = null, $id_as_key = false)
+    {
+        $ret = array();
+        $limit = $start = 0;
+        $sql = 'SELECT * FROM '.$this->db->prefix('config');
+        if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
+            $sql .= ' '.$criteria->renderWhere();
+            $sql .= ' ORDER BY conf_order ASC';
+            $limit = $criteria->getLimit();
+            $start = $criteria->getStart();
+        }
+        $result = $this->db->query($sql, $limit, $start);
+        if (!$result) {
+            return $ret;
+        }
+        while ($myrow = $this->db->fetchArray($result)) {
+            $config =& new XoopsConfigItem();
+            $config->assignVars($myrow);
+            if (!$id_as_key) {
+                $ret[] =& $config;
+            } else {
+                $ret[$myrow['conf_id']] =& $config;
+            }
+            unset($config);
+        }
+        return $ret;
+    }
+
+    /**
+     * Count configs
+     * 
+     * @param   object  $criteria   {@link CriteriaElement} 
+     * @return  int     Count of configs matching $criteria
+     */
+    function getCount($criteria = null)
+    {
+        $limit = $start = 0;
+        $sql = 'SELECT * FROM '.$this->db->prefix('config');
+        if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
+            $sql .= ' '.$criteria->renderWhere();
+        }
+        $result =& $this->db->query($sql);
+        if (!$result) {
+            return false;
+        }
+        list($count) = $this->db->fetchRow($result);
+        return $count;
+    }
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/kernel/online.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/kernel/online.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/kernel/online.php	(revision 405)
@@ -0,0 +1,173 @@
+<?php
+// $Id: online.php,v 1.3 2006/05/01 02:37:28 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+/**
+ * @package     kernel
+ * 
+ * @author      Kazumi Ono  <onokazu@xoops.org>
+ * @copyright   copyright (c) 2000-2003 XOOPS.org
+ */
+
+/**
+ * A handler for "Who is Online?" information
+ * 
+ * @package     kernel
+ * 
+ * @author      Kazumi Ono  <onokazu@xoops.org>
+ * @copyright   copyright (c) 2000-2003 XOOPS.org
+ */
+class XoopsOnlineHandler
+{
+
+    /**
+     * Database connection
+     * 
+     * @var object
+     * @access  private
+     */
+    var $db;
+
+    /**
+     * Constructor
+     * 
+     * @param   object  &$db    {@link XoopsHandlerFactory} 
+     */
+    function XoopsOnlineHandler(&$db)
+    {
+        $this->db =& $db;
+    }
+
+    /**
+     * Write online information to the database
+     * 
+     * @param   int     $uid    UID of the active user
+     * @param   string  $uname  Username
+     * @param   string  $timestamp
+     * @param   string  $module Current module
+     * @param   string  $ip     User's IP adress
+     * 
+     * @return  bool    TRUE on success
+     */
+    function write($uid, $uname, $time, $module, $ip)
+    {
+        $uid = intval($uid);
+        if ($uid > 0) {
+            $sql = "SELECT COUNT(*) FROM ".$this->db->prefix('online')." WHERE online_uid=".$uid;
+        } else {
+            $sql = "SELECT COUNT(*) FROM ".$this->db->prefix('online')." WHERE online_uid=".$uid." AND online_ip='".$ip."'";
+        }
+        list($count) = $this->db->fetchRow($this->db->queryF($sql));
+        if ( $count > 0 ) {
+            $sql = "UPDATE ".$this->db->prefix('online')." SET online_updated=".$time.", online_module = ".$module." WHERE online_uid = ".$uid;
+            if ($uid == 0) {
+                $sql .= " AND online_ip='".$ip."'";
+            }
+        } else {
+            $sql = sprintf("INSERT INTO %s (online_uid, online_uname, online_updated, online_ip, online_module) VALUES (%u, %s, %u, %s, %u)", $this->db->prefix('online'), $uid, $this->db->quoteString($uname), $time, $this->db->quoteString($ip), $module);
+        }
+        if (!$this->db->queryF($sql)) {
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     * Delete online information for a user
+     * 
+     * @param   int $uid    UID
+     * 
+     * @return  bool    TRUE on success
+     */
+    function destroy($uid)
+    {
+        $sql = sprintf("DELETE FROM %s WHERE online_uid = %u", $this->db->prefix('online'), $uid);
+        if (!$result = $this->db->queryF($sql)) {
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     * Garbage Collection
+     * 
+     * Delete all online information that has not been updated for a certain time
+     * 
+     * @param   int $expire Expiration time in seconds
+     */
+    function gc($expire)
+    {
+        $sql = sprintf("DELETE FROM %s WHERE online_updated < %u", $this->db->prefix('online'), time() - intval($expire));
+        $this->db->queryF($sql);
+    }
+
+    /**
+     * Get an array of online information
+     * 
+     * @param   object  $criteria   {@link CriteriaElement} 
+     * @return  array   Array of associative arrays of online information
+     */
+    function &getAll($criteria = null)
+    {
+        $ret = array();
+        $limit = $start = 0;
+        $sql = 'SELECT * FROM '.$this->db->prefix('online');
+        if (is_object($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
+            $sql .= ' '.$criteria->renderWhere();
+            $limit = $criteria->getLimit();
+            $start = $criteria->getStart();
+        }
+        if ($result = $this->db->query($sql, $limit, $start)) {
+            while ($myrow = $this->db->fetchArray($result)) {
+                $ret[] =& $myrow;
+                unset($myrow);
+            }
+        }
+        return $ret;
+    }
+
+    /**
+     * Count the number of online users
+     * 
+     * @param   object  $criteria   {@link CriteriaElement} 
+     */
+    function getCount($criteria = null)
+    {
+        $sql = 'SELECT COUNT(*) FROM '.$this->db->prefix('online');
+        if (is_object($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
+            $sql .= ' '.$criteria->renderWhere();
+        }
+        $ret = false;
+        if ($result = $this->db->query($sql)) {
+            list($ret) = $this->db->fetchRow($result);
+        }
+        return $ret;
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/kernel/module.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/kernel/module.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/kernel/module.php	(revision 405)
@@ -0,0 +1,553 @@
+<?php
+// $Id: module.php,v 1.5 2006/05/01 02:37:28 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+if (!defined('XOOPS_ROOT_PATH')) {
+    exit();
+}
+
+/**
+ * A Module
+ *
+ * @package     kernel
+ *
+ * @author      Kazumi Ono  <onokazu@xoops.org>
+ * @copyright   (c) 2000-2003 The Xoops Project - www.xoops.org
+ */
+class XoopsModule extends XoopsObject
+{
+    /**
+     * @var string
+     */
+    var $modinfo;
+    /**
+     * @var string
+     */
+    var $adminmenu;
+
+    /**
+     * Constructor
+     */
+    function XoopsModule()
+    {
+        $this->XoopsObject();
+        $this->initVar('mid', XOBJ_DTYPE_INT, null, false);
+        $this->initVar('name', XOBJ_DTYPE_TXTBOX, null, true, 150);
+        $this->initVar('version', XOBJ_DTYPE_INT, 100, false);
+        $this->initVar('last_update', XOBJ_DTYPE_INT, null, false);
+        $this->initVar('weight', XOBJ_DTYPE_INT, 0, false);
+        $this->initVar('isactive', XOBJ_DTYPE_INT, 1, false);
+        $this->initVar('dirname', XOBJ_DTYPE_OTHER, null, true);
+        $this->initVar('hasmain', XOBJ_DTYPE_INT, 0, false);
+        $this->initVar('hasadmin', XOBJ_DTYPE_INT, 0, false);
+        $this->initVar('hassearch', XOBJ_DTYPE_INT, 0, false);
+        $this->initVar('hasconfig', XOBJ_DTYPE_INT, 0, false);
+        $this->initVar('hascomments', XOBJ_DTYPE_INT, 0, false);
+        // RMV-NOTIFY
+        $this->initVar('hasnotification', XOBJ_DTYPE_INT, 0, false);
+    }
+
+    /**
+     * Load module info
+     *
+     * @param   string  $dirname    Directory Name
+     * @param   boolean $verbose
+     **/
+    function loadInfoAsVar($dirname, $verbose = true)
+    {
+        if ( !isset($this->modinfo) ) {
+            $this->loadInfo($dirname, $verbose);
+        }
+        $this->setVar('name', $this->modinfo['name'], true);
+        $this->setVar('version', round(100 * $this->modinfo['version']));
+        $this->setVar('dirname', $this->modinfo['dirname'], true);
+        $hasmain = (isset($this->modinfo['hasMain']) && $this->modinfo['hasMain'] == 1) ? 1 : 0;
+        $hasadmin = (isset($this->modinfo['hasAdmin']) && $this->modinfo['hasAdmin'] == 1) ? 1 : 0;
+        $hassearch = (isset($this->modinfo['hasSearch']) && $this->modinfo['hasSearch'] == 1) ? 1 : 0;
+        $hasconfig = ((isset($this->modinfo['config']) && is_array($this->modinfo['config'])) || !empty($this->modinfo['hasComments'])) ? 1 : 0;
+        $hascomments = (isset($this->modinfo['hasComments']) && $this->modinfo['hasComments'] == 1) ? 1 : 0;
+        // RMV-NOTIFY
+        $hasnotification = (isset($this->modinfo['hasNotification']) && $this->modinfo['hasNotification'] == 1) ? 1 : 0;
+        $this->setVar('hasmain', $hasmain);
+        $this->setVar('hasadmin', $hasadmin);
+        $this->setVar('hassearch', $hassearch);
+        $this->setVar('hasconfig', $hasconfig);
+        $this->setVar('hascomments', $hascomments);
+        // RMV-NOTIFY
+        $this->setVar('hasnotification', $hasnotification);
+    }
+
+    /**
+     * Get module info
+     *
+     * @param   string  $name
+     * @return  array|string    Array of module information.
+     *          If {@link $name} is set, returns a singel module information item as string.
+     **/
+    function &getInfo($name=null)
+    {
+        if ( !isset($this->modinfo) ) {
+            $this->loadInfo($this->getVar('dirname'));
+        }
+        if ( isset($name) ) {
+            if ( isset($this->modinfo[$name]) ) {
+                return $this->modinfo[$name];
+            }
+            $ret = false;
+            return $ret;
+        }
+        return $this->modinfo;
+    }
+
+    /**
+     * Get a link to the modules main page
+     *
+     * @return  string  FALSE on fail
+     */
+    function mainLink()
+    {
+        if ( $this->getVar('hasmain') == 1 ) {
+            $ret = '<a href="'.XOOPS_URL.'/modules/'.$this->getVar('dirname').'/">'.$this->getVar('name').'</a>';
+            return $ret;
+        }
+        return false;
+    }
+
+    /**
+     * Get links to the subpages
+     *
+     * @return  string
+     */
+    function &subLink()
+    {
+        $ret = array();
+        if ( $this->getInfo('sub') && is_array($this->getInfo('sub')) ) {
+            foreach ( $this->getInfo('sub') as $submenu ) {
+                $ret[] = array('name' => $submenu['name'], 'url' => $submenu['url']);
+            }
+        }
+        return $ret;
+    }
+
+    /**
+     * Load the admin menu for the module
+     */
+    function loadAdminMenu()
+    {
+        if ($this->getInfo('adminmenu') && $this->getInfo('adminmenu') != '' && file_exists(XOOPS_ROOT_PATH.'/modules/'.$this->getVar('dirname').'/'.$this->getInfo('adminmenu'))) {
+            include XOOPS_ROOT_PATH.'/modules/'.$this->getVar('dirname').'/'.$this->getInfo('adminmenu');
+            $this->adminmenu =& $adminmenu;
+        }
+    }
+
+    /**
+     * Get the admin menu for the module
+     *
+     * @return  string
+     */
+    function &getAdminMenu()
+    {
+        if ( !isset($this->adminmenu) ) {
+            $this->loadAdminMenu();
+        }
+        return $this->adminmenu;
+    }
+
+    /**
+     * Load the module info for this module
+     *
+     * @param   string  $dirname    Module directory
+     * @param   bool    $verbose    Give an error on fail?
+     */
+    function loadInfo($dirname, $verbose = true)
+    {
+        global $xoopsConfig;
+        if (file_exists(XOOPS_ROOT_PATH.'/modules/'.$dirname.'/language/'.$xoopsConfig['language'].'/modinfo.php')) {
+            include_once XOOPS_ROOT_PATH.'/modules/'.$dirname.'/language/'.$xoopsConfig['language'].'/modinfo.php';
+        } elseif (file_exists(XOOPS_ROOT_PATH.'/modules/'.$dirname.'/language/english/modinfo.php')) {
+            include_once XOOPS_ROOT_PATH.'/modules/'.$dirname.'/language/english/modinfo.php';
+        }
+        if (file_exists(XOOPS_ROOT_PATH.'/modules/'.$dirname.'/xoops_version.php')) {
+            include XOOPS_ROOT_PATH.'/modules/'.$dirname.'/xoops_version.php';
+        } else {
+            if (false != $verbose) {
+                echo "Module File for $dirname Not Found!";
+            }
+            return;
+        }
+        $this->modinfo =& $modversion;
+    }
+
+    /**
+     * Search contents within a module
+     *
+     * @param   string  $term
+     * @param   string  $andor  'AND' or 'OR'
+     * @param   integer $limit
+     * @param   integer $offset
+     * @param   integer $userid
+     * @return  mixed   Search result.
+     **/
+    function &search($term = '', $andor = 'AND', $limit = 0, $offset = 0, $userid = 0)
+    {
+        $ret = false;
+        if ($this->getVar('hassearch') != 1) {
+            return $ret;
+        }
+        $search =& $this->getInfo('search');
+        if ($this->getVar('hassearch') != 1 || !isset($search['file']) || !isset($search['func']) || $search['func'] == '' || $search['file'] == '') {
+            return $ret;
+        }
+        if (file_exists(XOOPS_ROOT_PATH."/modules/".$this->getVar('dirname').'/'.$search['file'])) {
+            include_once XOOPS_ROOT_PATH.'/modules/'.$this->getVar('dirname').'/'.$search['file'];
+        } else {
+            return $ret;
+        }
+        if (function_exists($search['func'])) {
+            $func = $search['func'];
+            $ret = $func($term, $andor, $limit, $offset, $userid);
+        }
+        return $ret;
+    }
+
+    /**#@+
+     * For backward compatibility only!
+     * @deprecated
+     */
+    function mid()
+    {
+        return $this->getVar('mid');
+    }
+    function dirname()
+    {
+        return $this->getVar('dirname');
+    }
+    function name()
+    {
+        return $this->getVar('name');
+    }
+    function &getByDirName($dirname)
+    {
+        $modhandler =& xoops_gethandler('module');
+        $ret =& $modhandler->getByDirname($dirname);
+        return $ret;
+    }
+    /**#@-*/
+}
+
+
+/**
+ * XOOPS module handler class.
+ *
+ * This class is responsible for providing data access mechanisms to the data source
+ * of XOOPS module class objects.
+ *
+ * @package     kernel
+ *
+ * @author      Kazumi Ono  <onokazu@xoops.org>
+ * @copyright   (c) 2000-2003 The Xoops Project - www.xoops.org
+ */
+class XoopsModuleHandler extends XoopsObjectHandler
+{
+    /**
+     * holds an array of cached module references, indexed by module id
+     *
+     * @var    array
+     * @access private
+     */
+    var $_cachedModule_mid = array();
+
+    /**
+     * holds an array of cached module references, indexed by module dirname
+     *
+     * @var    array
+     * @access private
+     */
+    var $_cachedModule_dirname = array();
+
+    /**
+     * Create a new {@link XoopsModule} object
+     *
+     * @param   boolean     $isNew   Flag the new object as "new"
+     * @return  object
+     **/
+    function &create($isNew = true)
+    {
+        $module =& new XoopsModule();
+        if ($isNew) {
+            $module->setNew();
+        }
+        return $module;
+    }
+
+    /**
+     * Load a module from the database
+     *
+     * @param   int     $id     ID of the module
+     *
+     * @return  object  FALSE on fail
+     */
+    function &get($id)
+    {
+        static $_cachedModule_dirname;
+        static $_cachedModule_mid;
+        $ret = false;
+        $id = intval($id);
+        if ($id > 0) {
+            if (!empty($_cachedModule_mid[$id])) {
+                return $_cachedModule_mid[$id];
+            } else {
+                $sql = 'SELECT * FROM '.$this->db->prefix('modules').' WHERE mid = '.$id;
+                if ($result = $this->db->query($sql)) {
+                    $numrows = $this->db->getRowsNum($result);
+                    if ($numrows == 1) {
+                        $module =& new XoopsModule();
+                        $myrow = $this->db->fetchArray($result);
+                        $module->assignVars($myrow);
+                        $_cachedModule_mid[$id] =& $module;
+                        $_cachedModule_dirname[$module->getVar('dirname')] =& $module;
+                        $ret =& $module;
+                    }
+                }
+            }
+        }
+        return $ret;
+    }
+
+    /**
+     * Load a module by its dirname
+     *
+     * @param   string  $dirname
+     *
+     * @return  object  FALSE on fail
+     */
+    function &getByDirname($dirname)
+    {
+        static $_cachedModule_mid;
+        static $_cachedModule_dirname;
+        $ret = false;
+        if (!empty($_cachedModule_dirname[$dirname])) {
+            $ret = $_cachedModule_dirname[$dirname];
+        } else {
+            $sql = "SELECT * FROM ".$this->db->prefix('modules')." WHERE dirname = '".trim($dirname)."'";
+            if ($result = $this->db->query($sql)) {
+                $numrows = $this->db->getRowsNum($result);
+                if ($numrows == 1) {
+                    $module =& new XoopsModule();
+                    $myrow = $this->db->fetchArray($result);
+                    $module->assignVars($myrow);
+                    $_cachedModule_dirname[$dirname] =& $module;
+                    $_cachedModule_mid[$module->getVar('mid')] =& $module;
+                    $ret =& $module;
+                }
+            }
+        }
+        return $ret;
+    }
+
+    /**
+     * Write a module to the database
+     *
+     * @param   object  &$module reference to a {@link XoopsModule}
+     * @return  bool
+     **/
+    function insert(&$module)
+    {
+        if (strtolower(get_class($module)) != 'xoopsmodule') {
+            return false;
+        }
+        if (!$module->isDirty()) {
+            return true;
+        }
+        if (!$module->cleanVars()) {
+            return false;
+        }
+        foreach ($module->cleanVars as $k => $v) {
+            ${$k} = $v;
+        }
+        if ($module->isNew()) {
+            $mid = $this->db->genId('modules_mid_seq');
+            $sql = sprintf("INSERT INTO %s (mid, name, version, last_update, weight, isactive, dirname, hasmain, hasadmin, hassearch, hasconfig, hascomments, hasnotification) VALUES (%u, %s, %u, %u, %u, %u, %s, %u, %u, %u, %u, %u, %u)", $this->db->prefix('modules'), $mid, $this->db->quoteString($name), $version, time(), $weight, 1, $this->db->quoteString($dirname), $hasmain, $hasadmin, $hassearch, $hasconfig, $hascomments, $hasnotification);
+        } else {
+            $sql = sprintf("UPDATE %s SET name = %s, dirname = %s, version = %u, last_update = %u, weight = %u, isactive = %u, hasmain = %u, hasadmin = %u, hassearch = %u, hasconfig = %u, hascomments = %u, hasnotification = %u WHERE mid = %u", $this->db->prefix('modules'), $this->db->quoteString($name), $this->db->quoteString($dirname), $version, time(), $weight, $isactive, $hasmain, $hasadmin, $hassearch, $hasconfig, $hascomments, $hasnotification, $mid);
+        }
+        if (!$result = $this->db->query($sql)) {
+            return false;
+        }
+        if (empty($mid)) {
+            $mid = $this->db->getInsertId();
+        }
+        $module->assignVar('mid', $mid);
+        if (!empty($this->_cachedModule_dirname[$dirname])) {
+            unset ($this->_cachedModule_dirname[$dirname]);
+        }
+        if (!empty($this->_cachedModule_mid[$mid])) {
+            unset ($this->_cachedModule_mid[$mid]);
+        }
+        return true;
+    }
+
+    /**
+     * Delete a module from the database
+     *
+     * @param   object  &$module
+     * @return  bool
+     **/
+    function delete(&$module)
+    {
+        if (strtolower(get_class($module)) != 'xoopsmodule') {
+            return false;
+        }
+        $sql = sprintf("DELETE FROM %s WHERE mid = %u", $this->db->prefix('modules'), $module->getVar('mid'));
+        if ( !$result = $this->db->query($sql) ) {
+            return false;
+        }
+        // delete admin permissions assigned for this module
+        $sql = sprintf("DELETE FROM %s WHERE gperm_name = 'module_admin' AND gperm_itemid = %u", $this->db->prefix('group_permission'), $module->getVar('mid'));
+        $this->db->query($sql);
+        // delete read permissions assigned for this module
+        $sql = sprintf("DELETE FROM %s WHERE gperm_name = 'module_read' AND gperm_itemid = %u", $this->db->prefix('group_permission'), $module->getVar('mid'));
+        $this->db->query($sql);
+
+        $sql = sprintf("SELECT block_id FROM %s WHERE module_id = %u", $this->db->prefix('block_module_link'), $module->getVar('mid'));
+        if ($result = $this->db->query($sql)) {
+            $block_id_arr = array();
+            while ($myrow = $this->db->fetchArray($result))
+{
+                array_push($block_id_arr, $myrow['block_id']);
+            }
+        }
+        // loop through block_id_arr
+        if (isset($block_id_arr)) {
+            foreach ($block_id_arr as $i) {
+                $sql = sprintf("SELECT block_id FROM %s WHERE module_id != %u AND block_id = %u", $this->db->prefix('block_module_link'), $module->getVar('mid'), $i);
+                if ($result2 = $this->db->query($sql)) {
+                    if (0 < $this->db->getRowsNum($result2)) {
+                    // this block has other entries, so delete the entry for this module
+                        $sql = sprintf("DELETE FROM %s WHERE (module_id = %u) AND (block_id = %u)", $this->db->prefix('block_module_link'), $module->getVar('mid'), $i);
+                        $this->db->query($sql);
+                    } else {
+                    // this block doesnt have other entries, so disable the block and let it show on top page only. otherwise, this block will not display anymore on block admin page!
+                        $sql = sprintf("UPDATE %s SET visible = 0 WHERE bid = %u", $this->db->prefix('newblocks'), $i);
+                        $this->db->query($sql);
+                        $sql = sprintf("UPDATE %s SET module_id = -1 WHERE module_id = %u", $this->db->prefix('block_module_link'), $module->getVar('mid'));
+                        $this->db->query($sql);
+                    }
+                }
+            }
+        }
+
+        if (!empty($this->_cachedModule_dirname[$module->getVar('dirname')])) {
+            unset ($this->_cachedModule_dirname[$module->getVar('dirname')]);
+        }
+        if (!empty($this->_cachedModule_mid[$module->getVar('mid')])) {
+            unset ($this->_cachedModule_mid[$module->getVar('mid')]);
+        }
+        return true;
+    }
+
+    /**
+     * Load some modules
+     *
+     * @param   object  $criteria   {@link CriteriaElement}
+     * @param   boolean $id_as_key  Use the ID as key into the array
+     * @return  array
+     **/
+    function &getObjects($criteria = null, $id_as_key = false)
+    {
+        $ret = array();
+        $limit = $start = 0;
+        $sql = 'SELECT * FROM '.$this->db->prefix('modules');
+        if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
+            $sql .= ' '.$criteria->renderWhere();
+            $sql .= ' ORDER BY weight '.$criteria->getOrder().', mid ASC';
+            $limit = $criteria->getLimit();
+            $start = $criteria->getStart();
+        }
+        $result = $this->db->query($sql, $limit, $start);
+        if (!$result) {
+            return $ret;
+        }
+        while ($myrow = $this->db->fetchArray($result)) {
+            $module =& new XoopsModule();
+            $module->assignVars($myrow);
+            if (!$id_as_key) {
+                $ret[] =& $module;
+            } else {
+                $ret[$myrow['mid']] =& $module;
+            }
+            unset($module);
+        }
+        return $ret;
+    }
+
+    /**
+     * Count some modules
+     *
+     * @param   object  $criteria   {@link CriteriaElement}
+     * @return  int
+     **/
+    function getCount($criteria = null)
+    {
+        $sql = 'SELECT COUNT(*) FROM '.$this->db->prefix('modules');
+        if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
+            $sql .= ' '.$criteria->renderWhere();
+        }
+        if (!$result =& $this->db->query($sql)) {
+            return 0;
+        }
+        list($count) = $this->db->fetchRow($result);
+        return $count;
+    }
+
+    /**
+     * returns an array of module names
+     *
+     * @param   bool    $criteria
+     * @param   boolean $dirname_as_key
+     *      if true, array keys will be module directory names
+     *      if false, array keys will be module id
+     * @return  array
+     **/
+    function &getList($criteria = null, $dirname_as_key = false)
+    {
+        $ret = array();
+        $modules =& $this->getObjects($criteria, true);
+        foreach (array_keys($modules) as $i) {
+            if (!$dirname_as_key) {
+                $ret[$i] =& $modules[$i]->getVar('name');
+            } else {
+                $ret[$modules[$i]->getVar('dirname')] =& $modules[$i]->getVar('name');
+            }
+        }
+        return $ret;
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/kernel/privmessage.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/kernel/privmessage.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/kernel/privmessage.php	(revision 405)
@@ -0,0 +1,238 @@
+<?php
+// $Id: privmessage.php,v 1.3 2006/05/01 02:37:28 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+if (!defined('XOOPS_ROOT_PATH')) {
+    exit();
+}
+/**
+ * {description}
+ *
+ * @package     kernel
+ *
+ * @author      Kazumi Ono  <onokazu@xoops.org>
+ * @copyright   copyright (c) 2000-2003 The XOOPS Project (http://www.xoops.org)
+ *
+ * @version     $Revision: 1.3 $ - $Date: 2006/05/01 02:37:28 $
+ */
+class XoopsPrivmessage extends XoopsObject
+{
+
+/**
+ * constructor
+ **/
+    function XoopsPrivmessage()
+    {
+        $this->XoopsObject();
+        $this->initVar('msg_id', XOBJ_DTYPE_INT, null, false);
+        $this->initVar('msg_image', XOBJ_DTYPE_OTHER, 'icon1.gif', false, 100);
+        $this->initVar('subject', XOBJ_DTYPE_TXTBOX, null, true, 255);
+        $this->initVar('from_userid', XOBJ_DTYPE_INT, null, true);
+        $this->initVar('to_userid', XOBJ_DTYPE_INT, null, true);
+        $this->initVar('msg_time', XOBJ_DTYPE_OTHER, null, false);
+        $this->initVar('msg_text', XOBJ_DTYPE_TXTAREA, null, true);
+        $this->initVar('read_msg', XOBJ_DTYPE_INT, 0, false);
+    }
+}
+
+/**
+ * XOOPS private message handler class.
+ * 
+ * This class is responsible for providing data access mechanisms to the data source
+ * of XOOPS private message class objects.
+ *
+ * @package     kernel
+ *
+ * @author      Kazumi Ono  <onokazu@xoops.org>
+ * @copyright   copyright (c) 2000-2003 The XOOPS Project (http://www.xoops.org)
+ *
+ * @version     $Revision: 1.3 $ - $Date: 2006/05/01 02:37:28 $
+ */
+class XoopsPrivmessageHandler extends XoopsObjectHandler
+{
+
+/**
+ * Create a new {@link XoopsPrivmessage} object
+ * @param   bool    $isNew  Flag as "new"?
+ * @return  object
+ **/
+    function &create($isNew = true)
+    {
+        $pm =& new XoopsPrivmessage();
+        if ($isNew) {
+            $pm->setNew();
+        }
+        return $pm;
+    }
+
+/**
+ * Load a {@link XoopsPrivmessage} object
+ * @param   int     $id ID of the message
+ * @return  object
+ **/
+    function &get($id)
+    {
+        $ret = false;
+        $id = intval($id);
+        if ($id > 0) {
+            $sql = 'SELECT * FROM '.$this->db->prefix('priv_msgs').' WHERE msg_id='.$id;
+            if ($result = $this->db->query($sql)) {
+                $numrows = $this->db->getRowsNum($result);
+                if ($numrows == 1) {
+                    $pm =& new XoopsPrivmessage();
+                    $pm->assignVars($this->db->fetchArray($result));
+                    $ret =& $pm;
+                }
+            }
+        }
+        return $ret;
+    }
+
+/**
+ * Insert a message in the database
+ * @param   object  $pm     {@link XoopsPrivmessage} object
+ * @return  bool
+ **/
+    function insert(&$pm)
+    {
+        if (strtolower(get_class($pm)) != 'xoopsprivmessage') {
+            return false;
+        }
+        if (!$pm->isDirty()) {
+            return true;
+        }
+        if (!$pm->cleanVars()) {
+            return false;
+        }
+        foreach ($pm->cleanVars as $k => $v) {
+            ${$k} = $v;
+        }
+        if ($pm->isNew()) {
+            $msg_id = $this->db->genId('priv_msgs_msg_id_seq');
+            $sql = sprintf("INSERT INTO %s (msg_id, msg_image, subject, from_userid, to_userid, msg_time, msg_text, read_msg) VALUES (%u, %s, %s, %u, %u, %u, %s, %u)", $this->db->prefix('priv_msgs'), $msg_id, $this->db->quoteString($msg_image), $this->db->quoteString($subject), $from_userid, $to_userid, time(), $this->db->quoteString($msg_text), 0);
+        } else {
+            $sql = sprintf("UPDATE %s SET msg_image = %s, subject = %s, from_userid = %u, to_userid = %u, msg_text = %s, read_msg = %u WHERE msg_id = %u", $this->db->prefix('priv_msgs'), $this->db->quoteString($msg_image), $this->db->quoteString($subject), $from_userid, $to_userid, $this->db->quoteString($msg_text), $read_msg, $msg_id);
+        }
+        if (!$result = $this->db->query($sql)) {
+            return false;
+        }
+        if (empty($msg_id)) {
+            $msg_id = $this->db->getInsertId();
+        }
+        $pm->assignVar('msg_id', $msg_id);
+        return true;
+    }
+
+/**
+ * Delete from the database
+ * @param   object  $pm     {@link XoopsPrivmessage} object
+ * @return  bool
+ **/
+    function delete(&$pm)
+    {
+        if (strtolower(get_class($pm)) != 'xoopsprivmessage') {
+            return false;
+        }
+        if (!$result = $this->db->query(sprintf("DELETE FROM %s WHERE msg_id = %u", $this->db->prefix('priv_msgs'), $pm->getVar('msg_id')))) {
+            return false;
+        }
+        return true;
+    }
+
+/**
+ * Load messages from the database
+ * @param   object  $criteria   {@link CriteriaElement} object
+ * @param   bool    $id_as_key  use ID as key into the array?
+ * @return  array   Array of {@link XoopsPrivmessage} objects
+ **/
+    function &getObjects($criteria = null, $id_as_key = false)
+    {
+        $ret = array();
+        $limit = $start = 0;
+        $sql = 'SELECT * FROM '.$this->db->prefix('priv_msgs');
+        if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
+            $sql .= ' '.$criteria->renderWhere();
+            $sort = !in_array($criteria->getSort(), array('msg_id', 'msg_time', 'from_userid')) ? 'msg_id' : $criteria->getSort();
+            $sql .= ' ORDER BY '.$sort.' '.$criteria->getOrder();
+            $limit = $criteria->getLimit();
+            $start = $criteria->getStart();
+        }
+        $result = $this->db->query($sql, $limit, $start);
+        if (!$result) {
+            return $ret;
+        }
+        while ($myrow = $this->db->fetchArray($result)) {
+            $pm =& new XoopsPrivmessage();
+            $pm->assignVars($myrow);
+            if (!$id_as_key) {
+                $ret[] =& $pm;
+            } else {
+                $ret[$myrow['msg_id']] =& $pm;
+            }
+            unset($pm);
+        }
+        return $ret;
+    }
+
+/**
+ * Count message
+ * @param   object  $criteria = null    {@link CriteriaElement} object
+ * @return  int
+ **/
+    function getCount($criteria = null)
+    {
+        $sql = 'SELECT COUNT(*) FROM '.$this->db->prefix('priv_msgs');
+        if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
+            $sql .= ' '.$criteria->renderWhere();
+        }
+        if (!$result = $this->db->query($sql)) {
+            return 0;
+        }
+        list($count) = $this->db->fetchRow($result);
+        return $count;
+    }
+
+/**
+ * Mark a message as read
+ * @param   object  $pm     {@link XoopsPrivmessage} object
+ * @return  bool
+ **/
+    function setRead(&$pm)
+    {
+        if (strtolower(get_class($pm)) != 'xoopsprivmessage') {
+            return false;
+        }
+        $sql = sprintf("UPDATE %s SET read_msg = 1 WHERE msg_id = %u", $this->db->prefix('priv_msgs'), $pm->getVar('msg_id'));
+        if (!$this->db->queryF($sql)) {
+            return false;
+        }
+        return true;
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/kernel/notification.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/kernel/notification.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/kernel/notification.php	(revision 405)
@@ -0,0 +1,788 @@
+<?php
+// $Id: notification.php,v 1.3 2006/05/01 02:37:28 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.xoops.org/ http://jp.xoops.org/  http://www.myweb.ne.jp/  //
+// Project: The XOOPS Project (http://www.xoops.org/)                        //
+// ------------------------------------------------------------------------- //
+
+if (!defined('XOOPS_ROOT_PATH')) {
+    exit();
+}
+// RMV-NOTIFY
+include_once XOOPS_ROOT_PATH . '/include/notification_constants.php';
+include_once XOOPS_ROOT_PATH . '/include/notification_functions.php';
+
+/**
+ *
+ *
+ * @package     kernel
+ * @subpackage  notification
+ *
+ * @author      Michael van Dam <mvandam@caltech.edu>
+ * @copyright   copyright (c) 2000-2003 XOOPS.org
+ */
+
+/**
+ * A Notification
+ *
+ * @package     kernel
+ * @subpackage  notification
+ *
+ * @author      Michael van Dam <mvandam@caltech.edu>
+ * @copyright   copyright (c) 2000-2003 XOOPS.org
+ */
+class XoopsNotification extends XoopsObject
+{
+    /**
+     * Constructor
+     **/
+    function XoopsNotification()
+    {
+        $this->XoopsObject();
+        $this->initVar('not_id', XOBJ_DTYPE_INT, NULL, false);
+        $this->initVar('not_modid', XOBJ_DTYPE_INT, NULL, false);
+        $this->initVar('not_category', XOBJ_DTYPE_TXTBOX, null, false, 30);
+        $this->initVar('not_itemid', XOBJ_DTYPE_INT, 0, false);
+        $this->initVar('not_event', XOBJ_DTYPE_TXTBOX, null, false, 30);
+        $this->initVar('not_uid', XOBJ_DTYPE_INT, 0, true);
+        $this->initVar('not_mode', XOBJ_DTYPE_INT, 0, false);
+    }
+
+// FIXME:???
+// To send email to multiple users simultaneously, we would need to move
+// the notify functionality to the handler class.  BUT, some of the tags
+// are user-dependent, so every email msg will be unique.  (Unless maybe use
+// smarty for email templates in the future.)  Also we would have to keep
+// track if each user wanted email or PM.
+
+    /**
+     * Send a notification message to the user
+     *
+     * @param  string  $template_dir  Template directory
+     * @param  string  $template      Template name
+     * @param  string  $subject       Subject line for notification message
+     * @param  array   $tags Array of substitutions for template variables
+     *
+     * @return  bool    true if success, false if error
+     **/
+    function notifyUser($template_dir, $template, $subject, $tags)
+    {
+        // Check the user's notification preference.
+        $member_handler =& xoops_gethandler('member');
+        $user =& $member_handler->getUser($this->getVar('not_uid'));
+        if (!is_object($user)) {
+            return true;
+        }
+        $method = $user->getVar('notify_method');
+        $xoopsMailer =& getMailer();
+        include_once XOOPS_ROOT_PATH . '/include/notification_constants.php';
+        switch($method) {
+        case XOOPS_NOTIFICATION_METHOD_PM:
+            $xoopsMailer->usePM();
+            $config_handler =& xoops_gethandler('config');
+            $xoopsMailerConfig =& $config_handler->getConfigsByCat(XOOPS_CONF_MAILER);
+            $xoopsMailer->setFromUser($member_handler->getUser($xoopsMailerConfig['fromuid']));
+            foreach ($tags as $k=>$v) {
+                $xoopsMailer->assign($k, $v);
+            }
+            break;
+        case XOOPS_NOTIFICATION_METHOD_EMAIL:
+            $xoopsMailer->useMail();
+            foreach ($tags as $k=>$v) {
+                $xoopsMailer->assign($k, preg_replace("/&amp;/i", '&', $v));
+            }
+            break;
+        default:
+            return true; // report error in user's profile??
+            break;
+        }
+        // Set up the mailer
+        $xoopsMailer->setTemplateDir($template_dir);
+        $xoopsMailer->setTemplate($template);
+        $xoopsMailer->setToUsers($user);
+        //global $xoopsConfig;
+        //$xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
+        //$xoopsMailer->setFromName($xoopsConfig['sitename']);
+        $xoopsMailer->setSubject($subject);
+        $success = $xoopsMailer->send();
+        // If send-once-then-delete, delete notification
+        // If send-once-then-wait, disable notification
+        include_once XOOPS_ROOT_PATH . '/include/notification_constants.php';
+        $notification_handler =& xoops_gethandler('notification');
+        if ($this->getVar('not_mode') == XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE) {
+            $notification_handler->delete($this);
+            return $success;
+        }
+        if ($this->getVar('not_mode') == XOOPS_NOTIFICATION_MODE_SENDONCETHENWAIT) {
+            $this->setVar('not_mode', XOOPS_NOTIFICATION_MODE_WAITFORLOGIN);
+            $notification_handler->insert($this);
+        }
+        return $success;
+    }
+}
+
+/**
+ * XOOPS notification handler class.
+ *
+ * This class is responsible for providing data access mechanisms to the data source
+ * of XOOPS notification class objects.
+ *
+ *
+ * @package     kernel
+ * @subpackage  notification
+ *
+ * @author      Michael van Dam <mvandam@caltech.edu>
+ * @copyright   copyright (c) 2000-2003 XOOPS.org
+ */
+class XoopsNotificationHandler extends XoopsObjectHandler
+{
+
+    /**
+     * Create a {@link XoopsNotification}
+     *
+     * @param   bool    $isNew  Flag the object as "new"?
+     *
+     * @return  object
+     */
+    function &create($isNew = true)
+    {
+        $notification =& new XoopsNotification();
+        if ($isNew) {
+            $notification->setNew();
+        }
+        return $notification;
+    }
+
+    /**
+     * Retrieve a {@link XoopsNotification}
+     *
+     * @param   int $id ID
+     *
+     * @return  object  {@link XoopsNotification}, FALSE on fail
+     **/
+    function &get($id)
+    {
+        $id = intval($id);
+        $ret = false;
+        if ($id > 0) {
+            $sql = 'SELECT * FROM '.$this->db->prefix('xoopsnotifications').' WHERE not_id='.$id;
+            if ($result = $this->db->query($sql)) {
+                $numrows = $this->db->getRowsNum($result);
+                if ($numrows == 1) {
+                    $notification =& new XoopsNotification();
+                    $notification->assignVars($this->db->fetchArray($result));
+                    $ret =& $notification;
+                }
+            }
+        }
+        return $ret;
+    }
+
+    /**
+     * Write a notification(subscription) to database
+     *
+     * @param   object  &$notification
+     *
+     * @return  bool
+     **/
+    function insert(&$notification)
+    {
+        if (strtolower(get_class($notification)) != 'xoopsnotification') {
+            return false;
+        }
+        if (!$notification->isDirty()) {
+            return true;
+        }
+        if (!$notification->cleanVars()) {
+            return false;
+        }
+        foreach ($notification->cleanVars as $k => $v) {
+            ${$k} = $v;
+        }
+        if ($notification->isNew()) {
+            $not_id = $this->db->genId('xoopsnotifications_not_id_seq');
+        $sql = sprintf("INSERT INTO %s (not_id, not_modid, not_itemid, not_category, not_uid, not_event, not_mode) VALUES (%u, %u, %u, %s, %u, %s, %u)", $this->db->prefix('xoopsnotifications'), $not_id, $not_modid, $not_itemid, $this->db->quoteString($not_category), $not_uid, $this->db->quoteString($not_event), $not_mode);
+        } else {
+        $sql = sprintf("UPDATE %s SET not_modid = %u, not_itemid = %u, not_category = %s, not_uid = %u, not_event = %s, not_mode = %u WHERE not_id = %u", $this->db->prefix('xoopsnotifications'), $not_modid, $not_itemid, $this->db->quoteString($not_category), $not_uid, $this->db->quoteString($not_event), $not_mode, $not_id);
+        }
+        if (!$result = $this->db->query($sql)) {
+            return false;
+        }
+        if (empty($not_id)) {
+            $not_id = $this->db->getInsertId();
+        }
+        $notification->assignVar('not_id', $not_id);
+        return true;
+    }
+
+    /**
+     * Delete a {@link XoopsNotification} from the database
+     *
+     * @param   object  &$notification
+     *
+     * @return  bool
+     **/
+    function delete(&$notification)
+    {
+        if (strtolower(get_class($notification)) != 'xoopsnotification') {
+            return false;
+        }
+        $sql = sprintf("DELETE FROM %s WHERE not_id = %u", $this->db->prefix('xoopsnotifications'), $notification->getVar('not_id'));
+        if (!$result = $this->db->query($sql)) {
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     * Get some {@link XoopsNotification}s
+     *
+     * @param   object  $criteria
+     * @param   bool    $id_as_key  Use IDs as keys into the array?
+     *
+     * @return  array   Array of {@link XoopsNotification} objects
+     **/
+    function &getObjects($criteria = null, $id_as_key = false)
+    {
+        $ret = array();
+        $limit = $start = 0;
+        $sql = 'SELECT * FROM '.$this->db->prefix('xoopsnotifications');
+        if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
+            $sql .= ' '.$criteria->renderWhere();
+            $sort = ($criteria->getSort() != '') ? $criteria->getSort() : 'not_id';
+            $sql .= ' ORDER BY '.$sort.' '.$criteria->getOrder();
+            $limit = $criteria->getLimit();
+            $start = $criteria->getStart();
+        }
+        $result = $this->db->query($sql, $limit, $start);
+        if (!$result) {
+            return $ret;
+        }
+        while ($myrow = $this->db->fetchArray($result)) {
+            $notification =& new XoopsNotification();
+            $notification->assignVars($myrow);
+            if (!$id_as_key) {
+                $ret[] =& $notification;
+            } else {
+                $ret[$myrow['not_id']] =& $notification;
+            }
+            unset($notification);
+        }
+        return $ret;
+    }
+
+// TODO: Need this??
+    /**
+     * Count Notifications
+     *
+     * @param   object  $criteria   {@link CriteriaElement}
+     *
+     * @return  int     Count
+     **/
+    function getCount($criteria = null)
+    {
+        $sql = 'SELECT COUNT(*) FROM '.$this->db->prefix('xoopsnotifications');
+        if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
+            $sql .= ' '.$criteria->renderWhere();
+        }
+        if (!$result =& $this->db->query($sql)) {
+            return 0;
+        }
+        list($count) = $this->db->fetchRow($result);
+        return $count;
+    }
+
+    /**
+     * Delete multiple notifications
+     *
+     * @param   object  $criteria   {@link CriteriaElement}
+     *
+     * @return  bool
+     **/
+    function deleteAll($criteria = null)
+    {
+        $sql = 'DELETE FROM '.$this->db->prefix('xoopsnotifications');
+        if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
+            $sql .= ' '.$criteria->renderWhere();
+        }
+        if (!$result = $this->db->query($sql)) {
+            return false;
+        }
+        return true;
+    }
+
+// Need this??
+    /**
+     * Change a value in multiple notifications
+     *
+     * @param   string  $fieldname  Name of the field
+     * @param   string  $fieldvalue Value to write
+     * @param   object  $criteria   {@link CriteriaElement}
+     *
+     * @return  bool
+     **/
+/*
+    function updateAll($fieldname, $fieldvalue, $criteria = null)
+    {
+        $set_clause = is_numeric($fieldvalue) ? $filedname.' = '.$fieldvalue : $filedname." = '".$fieldvalue."'";
+        $sql = 'UPDATE '.$this->db->prefix('xoopsnotifications').' SET '.$set_clause;
+        if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
+            $sql .= ' '.$criteria->renderWhere();
+        }
+        if (!$result = $this->db->query($sql)) {
+            return false;
+        }
+        return true;
+    }
+*/
+
+    // TODO: rename this...
+    // Also, should we have get by module, get by category, etc...??
+
+    function &getNotification ($module_id, $category, $item_id, $event, $user_id)
+    {
+        $ret = false;
+        $criteria = new CriteriaCompo();
+        $criteria->add(new Criteria('not_modid', intval($module_id)));
+        $criteria->add(new Criteria('not_category', $category));
+        $criteria->add(new Criteria('not_itemid', intval($item_id)));
+        $criteria->add(new Criteria('not_event', $event));
+        $criteria->add(new Criteria('not_uid', intval($user_id)));
+        $objects = $this->getObjects($criteria);
+        if (count($objects) == 1) {
+            $ret =& $objects[0];
+        }
+        return $ret;
+    }
+
+    /**
+     * Determine if a user is subscribed to a particular event in
+     * a particular module.
+     *
+     * @param  string  $category  Category of notification event
+     * @param  int     $item_id   Item ID of notification event
+     * @param  string  $event     Event
+     * @param  int     $module_id ID of module (default current module)
+     * @param  int     $user_id   ID of user (default current user)
+     * return int  0 if not subscribe; non-zero if subscribed
+     */
+
+    function isSubscribed ($category, $item_id, $event, $module_id, $user_id)
+    {
+        $criteria = new CriteriaCompo();
+        $criteria->add(new Criteria('not_modid', intval($module_id)));
+        $criteria->add(new Criteria('not_category', $category));
+        $criteria->add(new Criteria('not_itemid', intval($item_id)));
+        $criteria->add(new Criteria('not_event', $event));
+        $criteria->add(new Criteria('not_uid', intval($user_id)));
+        return $this->getCount($criteria);
+    }
+
+    // TODO: how about a function to subscribe a whole group of users???
+    // e.g. if we want to add all moderators to be notified of subscription
+    // of new threads...
+
+    /**
+     * Subscribe for notification for an event(s)
+     *
+     * @param  string $category    category of notification
+     * @param  int    $item_id     ID of the item
+     * @param  mixed  $events      event string or array of events
+     * @param  int    $mode        force a particular notification mode
+     *                             (e.g. once_only) (default to current user preference)
+     * @param  int    $module_id   ID of the module (default to current module)
+     * @param  int    $user_id     ID of the user (default to current user)
+     **/
+    function subscribe ($category, $item_id, $events, $mode=null, $module_id=null, $user_id=null)
+    {
+        if (!isset($user_id)) {
+            global $xoopsUser;
+            if (empty($xoopsUser)) {
+                return false;  // anonymous cannot subscribe
+            } else {
+                $user_id = $xoopsUser->getVar('uid');
+            }
+        }
+        if (!isset($module_id)) {
+            global $xoopsModule;
+            $module_id = $xoopsModule->getVar('mid');
+        }
+        if (!isset($mode)) {
+            $user = new XoopsUser($user_id);
+            $mode = $user->getVar('notify_mode');
+        }
+        if (!is_array($events)) $events = array($events);
+        foreach ($events as $event) {
+            if ($notification =& $this->getNotification($module_id, $category, $item_id, $event, $user_id)) {
+                if ($notification->getVar('not_mode') != $mode) {
+                    $this->updateByField($notification, 'not_mode', $mode);
+                }
+            } else {
+                $notification =& $this->create();
+                $notification->setVar('not_modid', $module_id);
+                $notification->setVar('not_category', $category);
+                $notification->setVar('not_itemid', $item_id);
+                $notification->setVar('not_uid', $user_id);
+                $notification->setVar('not_event', $event);
+                $notification->setVar('not_mode', $mode);
+                $this->insert($notification);
+            }
+        }
+    }
+
+// TODO: this will be to provide a list of everything a particular
+// user has subscribed to... e.g. for on the 'Profile' page, similar
+// to how we see the various posts etc. that the user has made.
+// We may also want to have a function where we can specify module id
+    /**
+     * Get a list of notifications by user ID
+     *
+     * @param  int  $user_id  ID of the user
+     *
+     * @return array  Array of {@link XoopsNotification} objects
+     **/
+    function &getByUser ($user_id)
+    {
+        $criteria = new Criteria ('not_uid', $user_id);
+        $ret =& $this->getObjects($criteria, true);
+        return $ret;
+    }
+
+    // TODO: rename this??
+    /**
+     * Get a list of notification events for the current item/mod/user
+     *
+     **/
+    function &getSubscribedEvents ($category, $item_id, $module_id, $user_id)
+    {
+        $criteria = new CriteriaCompo();
+        $criteria->add (new Criteria('not_modid', $module_id));
+        $criteria->add (new Criteria('not_category', $category));
+        if ($item_id) {
+            $criteria->add (new Criteria('not_itemid', $item_id));
+        }
+        $criteria->add (new Criteria('not_uid', $user_id));
+        $results = $this->getObjects($criteria, true);
+        $ret = array();
+        foreach (array_keys($results) as $i) {
+            $ret[] = $results[$i]->getVar('not_event');
+        }
+        return $ret;
+    }
+
+// TODO: is this a useful function?? (Copied from comment_handler)
+    /**
+     * Retrieve items by their ID
+     *
+     * @param   int     $module_id  Module ID
+     * @param   int     $item_id    Item ID
+     * @param   string  $order      Sort order
+     *
+     * @return  array   Array of {@link XoopsNotification} objects
+     **/
+    function &getByItemId($module_id, $item_id, $order = null, $status = null)
+    {
+        $criteria = new CriteriaCompo(new Criteria('com_modid', intval($module_id)));
+        $criteria->add(new Criteria('com_itemid', intval($item_id)));
+        if (isset($status)) {
+            $criteria->add(new Criteria('com_status', intval($status)));
+        }
+        if (isset($order)) {
+            $criteria->setOrder($order);
+        }
+        $ret =& $this->getObjects($criteria);
+        return $ret;
+    }
+
+    /**
+     * Send notifications to users
+     *
+     * @param  string $category   notification category
+     * @param  int $item_id    ID of the item
+     * @param  string  $event  notification event
+     * @param  array  $extra_tags array of substitutions for template to be
+     *                             merged with the one from function..
+     * @param  array  $user_list  only notify the selected users
+     * @param  int $module_id  ID of the module
+     * @param  int $omit_user_id    ID of the user to omit from notifications. (default to current user).  set to 0 for all users to receive notification.
+     **/
+    // TODO:(?) - pass in an event LIST.  This will help to avoid
+    // problem of sending people multiple emails for similar events.
+    // BUT, then we need an array of mail templates, etc...  Unless
+    // mail templates can include logic in the future, then we can
+    // tailor the mail so it makes sense for any of the possible
+    // (or combination of) events.
+
+    function triggerEvents ($category, $item_id, $events, $extra_tags=array(), $user_list=array(), $module_id=null, $omit_user_id=null)
+    {
+        if (!is_array($events)) {
+            $events = array($events);
+        }
+        foreach ($events as $event) {
+            $this->triggerEvent($category, $item_id, $event, $extra_tags, $user_list, $module_id, $omit_user_id);
+        }
+    }
+
+    function triggerEvent ($category, $item_id, $event, $extra_tags=array(), $user_list=array(), $module_id=null, $omit_user_id=null)
+    {
+        if (!isset($module_id)) {
+            global $xoopsModule;
+            $module =& $xoopsModule;
+            $module_id = !empty($xoopsModule) ? $xoopsModule->getVar('mid') : 0;
+        } else {
+            $module_handler =& xoops_gethandler('module');
+            $module =& $module_handler->get($module_id);
+        }
+
+        // Check if event is enabled
+        $config_handler =& xoops_gethandler('config');
+        $mod_config =& $config_handler->getConfigsByCat(0,$module->getVar('mid'));
+        if (empty($mod_config['notification_enabled'])) {
+            return false;
+        }
+        $category_info =& notificationCategoryInfo ($category, $module_id);
+        $event_info =& notificationEventInfo ($category, $event, $module_id);
+        if (!in_array(notificationGenerateConfig($category_info,$event_info,'option_name'),$mod_config['notification_events']) && empty($event_info['invisible'])) {
+            return false;
+        }
+
+        if (!isset($omit_user_id)) {
+            global $xoopsUser;
+            if (!empty($xoopsUser)) {
+                $omit_user_id = $xoopsUser->getVar('uid');
+            } else {
+                $omit_user_id = 0;
+            }
+        }
+        $criteria = new CriteriaCompo();
+        $criteria->add(new Criteria('not_modid', intval($module_id)));
+        $criteria->add(new Criteria('not_category', $category));
+        $criteria->add(new Criteria('not_itemid', intval($item_id)));
+        $criteria->add(new Criteria('not_event', $event));
+        $mode_criteria = new CriteriaCompo();
+        $mode_criteria->add (new Criteria('not_mode', XOOPS_NOTIFICATION_MODE_SENDALWAYS), 'OR');
+        $mode_criteria->add (new Criteria('not_mode', XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE), 'OR');
+        $mode_criteria->add (new Criteria('not_mode', XOOPS_NOTIFICATION_MODE_SENDONCETHENWAIT), 'OR');
+        $criteria->add($mode_criteria);
+        if (!empty($user_list)) {
+            $user_criteria = new CriteriaCompo();
+            foreach ($user_list as $user) {
+                $user_criteria->add (new Criteria('not_uid', $user), 'OR');
+            }
+            $criteria->add($user_criteria);
+        }
+        $notifications =& $this->getObjects($criteria);
+        if (empty($notifications)) {
+            return;
+        }
+
+        // Add some tag substitutions here
+
+        $not_config = $module->getInfo('notification');
+        $tags = array();
+        if (!empty($not_config)) {
+            if (!empty($not_config['tags_file'])) {
+                $tags_file = XOOPS_ROOT_PATH . '/modules/' . $module->getVar('dirname') . '/' . $not_config['tags_file'];
+                if (file_exists($tags_file)) {
+                    include_once $tags_file;
+                    if (!empty($not_config['tags_func'])) {
+                        $tags_func = $not_config['tags_func'];
+                        if (function_exists($tags_func)) {
+                            $tags = $tags_func($category, intval($item_id), $event);
+                        }
+                    }
+                }
+            }
+            // RMV-NEW
+            if (!empty($not_config['lookup_file'])) {
+                $lookup_file = XOOPS_ROOT_PATH . '/modules/' . $module->getVar('dirname') . '/' . $not_config['lookup_file'];
+                if (file_exists($lookup_file)) {
+                    include_once $lookup_file;
+                    if (!empty($not_config['lookup_func'])) {
+                        $lookup_func = $not_config['lookup_func'];
+                        if (function_exists($lookup_func)) {
+                            $item_info = $lookup_func($category, intval($item_id));
+                        }
+                    }
+                }
+            }
+        }
+        $tags['X_ITEM_NAME'] = !empty($item_info['name']) ? $item_info['name'] : '[' . _NOT_ITEMNAMENOTAVAILABLE . ']';
+        $tags['X_ITEM_URL']  = !empty($item_info['url']) ? $item_info['url'] : '[' . _NOT_ITEMURLNOTAVAILABLE . ']';
+        $tags['X_ITEM_TYPE'] = !empty($category_info['item_name']) ? $category_info['title'] : '[' . _NOT_ITEMTYPENOTAVAILABLE . ']';
+        $tags['X_MODULE'] = $module->getVar('name');
+        $tags['X_MODULE_URL'] = XOOPS_URL . '/modules/' . $module->getVar('dirname') . '/';
+        $tags['X_NOTIFY_CATEGORY'] = $category;
+        $tags['X_NOTIFY_EVENT'] = $event;
+
+        $template_dir = $event_info['mail_template_dir'];
+        $template = $event_info['mail_template'] . '.tpl';
+        $subject = $event_info['mail_subject'];
+
+        foreach ($notifications as $notification) {
+            if (empty($omit_user_id) || $notification->getVar('not_uid') != $omit_user_id) {
+                // user-specific tags
+                //$tags['X_UNSUBSCRIBE_URL'] = 'TODO';
+                // TODO: don't show unsubscribe link if it is 'one-time' ??
+                $tags['X_UNSUBSCRIBE_URL'] = XOOPS_URL . '/notifications.php';
+                $tags = array_merge ($tags, $extra_tags);
+
+                $notification->notifyUser($template_dir, $template, $subject, $tags);
+            }
+        }
+    }
+
+    /**
+     * Delete all notifications for one user
+     *
+     * @param   int $user_id  ID of the user
+     * @return  bool
+     **/
+    function unsubscribeByUser ($user_id)
+    {
+        $criteria = new Criteria('not_uid', intval($user_id));
+        return $this->deleteAll($criteria);
+    }
+
+// TODO: allow these to use current module, etc...
+
+    /**
+     * Unsubscribe notifications for an event(s).
+     *
+     * @param  string  $category    category of the events
+     * @param  int     $item_id     ID of the item
+     * @param  mixed   $events      event string or array of events
+     * @param  int     $module_id   ID of the module (default current module)
+     * @param  int     $user_id     UID of the user (default current user)
+     *
+     * @return bool
+     **/
+
+    function unsubscribe ($category, $item_id, $events, $module_id=null, $user_id=null)
+    {
+        if (!isset($user_id)) {
+            global $xoopsUser;
+            if (empty($xoopsUser)) {
+                return false;  // anonymous cannot subscribe
+            } else {
+                $user_id = $xoopsUser->getVar('uid');
+            }
+        }
+
+        if (!isset($module_id)) {
+            global $xoopsModule;
+            $module_id = $xoopsModule->getVar('mid');
+        }
+
+        $criteria = new CriteriaCompo();
+        $criteria->add (new Criteria('not_modid', intval($module_id)));
+        $criteria->add (new Criteria('not_category', $category));
+        $criteria->add (new Criteria('not_itemid', intval($item_id)));
+        $criteria->add (new Criteria('not_uid', intval($user_id)));
+        if (!is_array($events)) {
+            $events = array($events);
+        }
+        $event_criteria = new CriteriaCompo();
+        foreach ($events as $event) {
+            $event_criteria->add (new Criteria('not_event', $event), 'OR');
+        }
+        $criteria->add($event_criteria);
+        return $this->deleteAll($criteria);
+    }
+
+    // TODO: When 'update' a module, may need to switch around some
+    //  notification classes/IDs...  or delete the ones that no longer
+    //  exist.
+
+    /**
+     * Delete all notifications for a particular module
+     *
+     * @param   int $module_id  ID of the module
+     * @return  bool
+     **/
+    function unsubscribeByModule ($module_id)
+    {
+        $criteria = new Criteria('not_modid', intval($module_id));
+        return $this->deleteAll($criteria);
+    }
+
+    /**
+     * Delete all subscriptions for a particular item.
+     *
+     * @param  int    $module_id  ID of the module to which item belongs
+     * @param  string $category   Notification category of the item
+     * @param  int    $item_id    ID of the item
+     *
+     * @return bool
+     **/
+    function unsubscribeByItem ($module_id, $category, $item_id)
+    {
+        $criteria = new CriteriaCompo();
+        $criteria->add (new Criteria('not_modid', intval($module_id)));
+        $criteria->add (new Criteria('not_category', $category));
+        $criteria->add (new Criteria('not_itemid', intval($item_id)));
+        return $this->deleteAll($criteria);
+    }
+
+    /**
+     * Perform notification maintenance activites at login time.
+     * In particular, any notifications for the newly logged-in
+     * user with mode XOOPS_NOTIFICATION_MODE_WAITFORLOGIN are
+     * switched to mode XOOPS_NOTIFICATION_MODE_SENDONCETHENWAIT.
+     *
+     * @param  int  $user_id  ID of the user being logged in
+     **/
+    function doLoginMaintenance ($user_id)
+    {
+        $criteria = new CriteriaCompo();
+        $criteria->add (new Criteria('not_uid', intval($user_id)));
+        $criteria->add (new Criteria('not_mode', XOOPS_NOTIFICATION_MODE_WAITFORLOGIN));
+
+        $notifications = $this->getObjects($criteria, true);
+        foreach ($notifications as $n) {
+            $n->setVar('not_mode', XOOPS_NOTIFICATION_MODE_SENDONCETHENWAIT);
+            $this->insert($n);
+        }
+    }
+
+    /**
+     * Update
+     *
+     * @param   object  &$notification  {@link XoopsNotification} object
+     * @param   string  $field_name     Name of the field
+     * @param   mixed   $field_value    Value to write
+     *
+     * @return  bool
+     **/
+    function updateByField(&$notification, $field_name, $field_value)
+    {
+        $notification->unsetNew();
+        $notification->setVar($field_name, $field_value);
+        return $this->insert($notification);
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/kernel/block.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/kernel/block.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/kernel/block.php	(revision 405)
@@ -0,0 +1,331 @@
+<?php
+// $Id: block.php,v 1.4 2005/08/03 12:39:12 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+if (!defined('XOOPS_ROOT_PATH')) {
+    exit();
+}
+
+/**
+ * @author  Kazumi Ono <onokazu@xoops.org>
+ * @copyright copyright (c) 2000 XOOPS.org
+ **/
+
+/**
+ * A block
+ *
+ * @author Kazumi Ono <onokazu@xoops.org>
+ * @copyright copyright (c) 2000 XOOPS.org
+ *
+ * @package kernel
+ **/
+class XoopsBlock extends XoopsObject
+{
+
+    /**
+     * constructor
+     *
+     * @param mixed $id
+     **/
+    function XoopsBlock($id = null)
+    {
+        $this->initVar('bid', XOBJ_DTYPE_INT, null, false);
+        $this->initVar('mid', XOBJ_DTYPE_INT, 0, false);
+        $this->initVar('func_num', XOBJ_DTYPE_INT, 0, false);
+        $this->initVar('options', XOBJ_DTYPE_TXTBOX, null, false, 255);
+        $this->initVar('name', XOBJ_DTYPE_TXTBOX, null, true, 150);
+        //$this->initVar('position', XOBJ_DTYPE_INT, 0, false);
+        $this->initVar('title', XOBJ_DTYPE_TXTBOX, null, false, 150);
+        $this->initVar('content', XOBJ_DTYPE_TXTAREA, null, false);
+        $this->initVar('side', XOBJ_DTYPE_INT, 0, false);
+        $this->initVar('weight', XOBJ_DTYPE_INT, 0, false);
+        $this->initVar('visible', XOBJ_DTYPE_INT, 0, false);
+        $this->initVar('block_type', XOBJ_DTYPE_OTHER, null, false);
+        $this->initVar('c_type', XOBJ_DTYPE_OTHER, null, false);
+        $this->initVar('isactive', XOBJ_DTYPE_INT, null, false);
+        $this->initVar('dirname', XOBJ_DTYPE_TXTBOX, null, false, 50);
+        $this->initVar('func_file', XOBJ_DTYPE_TXTBOX, null, false, 50);
+        $this->initVar('show_func', XOBJ_DTYPE_TXTBOX, null, false, 50);
+        $this->initVar('edit_func', XOBJ_DTYPE_TXTBOX, null, false, 50);
+        $this->initVar('template', XOBJ_DTYPE_OTHER, null, false);
+        $this->initVar('bcachetime', XOBJ_DTYPE_INT, 0, false);
+        $this->initVar('last_modified', XOBJ_DTYPE_INT, 0, false);
+
+        // for backward compatibility
+        if (isset($id)) {
+            if (is_array($id)) {
+                $this->assignVars($id);
+            } else {
+                $blkhandler =& xoops_gethandler('block');
+                $obj =& $blkhandler->get($id);
+                $this->assignVars($obj->getVars());
+            }
+        }
+    }
+
+    /**
+     * return the content of the block for output
+     *
+     * @param string $format
+     * @param string $c_type type of content<br>
+     * Legal value for the type of content<br>
+     * <ul><li>H : custom HTML block
+     * <li>P : custom PHP block
+     * <li>S : use text sanitizater (smilies enabled)
+     * <li>T : use text sanitizater (smilies disabled)</ul>
+     * @return string content for output
+     **/
+    function &getContent($format = 'S', $c_type = 'T')
+    {
+        switch ( $format ) {
+        case 'S':
+            if ( $c_type == 'H' ) {
+                return str_replace('{X_SITEURL}', XOOPS_URL.'/', $this->getVar('content', 'N'));
+            } elseif ( $c_type == 'P' ) {
+                ob_start();
+                echo eval($this->getVar('content', 'N'));
+                $content = ob_get_contents();
+                ob_end_clean();
+                return str_replace('{X_SITEURL}', XOOPS_URL.'/', $content);
+            } elseif ( $c_type == 'S' ) {
+                $myts =& MyTextSanitizer::getInstance();
+                return str_replace('{X_SITEURL}', XOOPS_URL.'/', $myts->displayTarea($this->getVar('content', 'N'), 0, 1));
+            } else {
+                $myts =& MyTextSanitizer::getInstance();
+                return str_replace('{X_SITEURL}', XOOPS_URL.'/', $myts->displayTarea($this->getVar('content', 'N'), 0, 0));
+            }
+            break;
+        case 'E':
+            return $this->getVar('content', 'E');
+            break;
+        default:
+            return $this->getVar('content', 'N');
+            break;
+        }
+    }
+
+    /**
+     * (HTML-) form for setting the options of the block
+     *
+     * @return string HTML for the form, FALSE if not defined for this block
+     **/
+    function getOptions()
+    {
+        if ($this->getVar('block_type') != 'C') {
+            $edit_func = $this->getVar('edit_func');
+            if (!$edit_func) {
+                return false;
+            }
+            if (file_exists(XOOPS_ROOT_PATH.'/modules/'.$this->getVar('dirname').'/blocks/'.$this->getVar('func_file'))) {
+                if (file_exists(XOOPS_ROOT_PATH.'/modules/'.$this->getVar('dirname').'/language/'.$GLOBALS['xoopsConfig']['language'].'/blocks.php')) {
+                    include_once XOOPS_ROOT_PATH.'/modules/'.$this->getVar('dirname').'/language/'.$GLOBALS['xoopsConfig']['language'].'/blocks.php';
+                } elseif (file_exists(XOOPS_ROOT_PATH.'/modules/'.$this->getVar('dirname').'/language/english/blocks.php')) {
+                    include_once XOOPS_ROOT_PATH.'/modules/'.$this->getVar('dirname').'/language/english/blocks.php';
+                }
+                include_once XOOPS_ROOT_PATH.'/modules/'.$this->getVar('dirname').'/blocks/'.$this->getVar('func_file');
+                $options = explode('|', $this->getVar('options'));
+                $edit_form = $edit_func($options);
+                if (!$edit_form) {
+                    return false;
+                }
+                return $edit_form;
+            } else {
+                return false;
+            }
+        } else {
+            return false;
+        }
+    }
+}
+
+
+/**
+ * XOOPS block handler class. (Singelton)
+ *
+ * This class is responsible for providing data access mechanisms to the data source
+ * of XOOPS block class objects.
+ *
+ * @author  Kazumi Ono <onokazu@xoops.org>
+ * @copyright copyright (c) 2000 XOOPS.org
+ * @package kernel
+ * @subpackage block
+*/
+class XoopsBlockHandler extends XoopsObjectHandler
+{
+
+    /**
+     * create a new block
+     *
+     * @see XoopsBlock
+     * @param bool $isNew is the new block new??
+     * @return object XoopsBlock reference to the new block
+     **/
+    function &create($isNew = true)
+    {
+        $block = new XoopsBlock();
+        if ($isNew) {
+            $block->setNew();
+        }
+        return $block;
+    }
+
+    /**
+     * retrieve a specific {@link XoopsBlock}
+     *
+     * @see XoopsBlock
+     * @param int $id bid of the block to retrieve
+     * @return object XoopsBlock reference to the block
+     **/
+    function &get($id)
+    {
+        $id = intval($id);
+        if ($id > 0) {
+            $sql = 'SELECT * FROM '.$this->db->prefix('newblocks').' WHERE bid='.$id;
+            if (!$result = $this->db->query($sql)) {
+                return false;
+            }
+            $numrows = $this->db->getRowsNum($result);
+            if ($numrows == 1) {
+                $block = new XoopsBlock();
+                $block->assignVars($this->db->fetchArray($result));
+                return $block;
+            }
+        }
+        return false;
+    }
+
+    /**
+     * write a new block into the database
+     *
+     * @param object XoopsBlock $block reference to the block to insert
+     * @return bool TRUE if succesful
+     **/
+    function insert(&$block)
+    {
+        if (strtolower(get_class($block)) != 'xoopsblock') {
+            return false;
+        }
+        if (!$block->isDirty()) {
+            return true;
+        }
+        if (!$block->cleanVars()) {
+            return false;
+        }
+        foreach ($block->cleanVars as $k => $v) {
+            ${$k} = $v;
+        }
+        if ($block->isNew()) {
+            $bid = $this->db->genId('newblocks_bid_seq');
+            $sql = sprintf("INSERT INTO %s (bid, mid, func_num, options, name, title, content, side, weight, visible, block_type, c_type, isactive, dirname, func_file, show_func, edit_func, template, bcachetime, last_modified) VALUES (%u, %u, %u, '%s', '%s', '%s', '%s', %u, %u, %u, '%s', '%s', %u, '%s', '%s', '%s', '%s', '%s', %u, %u)", $this->db->prefix('newblocks'), $bid, $mid, $func_num, $options, $name, $title, $content, $side, $weight, $visible, $block_type, $c_type, 1, $dirname, $func_file, $show_func, $edit_func, $template, $bcachetime, time());
+        } else {
+            $sql = sprintf("UPDATE %s SET func_num = %u, options = '%s', name = '%s', title = '%s', content = '%s', side = %u, weight = %u, visible = %u, c_type = '%s', isactive = %u, func_file = '%s', show_func = '%s', edit_func = '%s', template = '%s', bcachetime = %u, last_modified = %u WHERE bid = %u", $this->db->prefix('newblocks'), $func_num, $options, $name, $title, $content, $side, $weight, $visible, $c_type, $isactive, $func_file, $show_func, $edit_func, $template, $bcachetime, time(), $bid);
+        }
+        if (!$result = $this->db->query($sql)) {
+            return false;
+        }
+        if (empty($bid)) {
+            $bid = $this->db->getInsertId();
+        }
+        $block->assignVar('bid', $bid);
+        return true;
+    }
+
+    /**
+     * delete a block from the database
+     *
+     * @param object XoopsBlock $block reference to the block to delete
+     * @return bool TRUE if succesful
+     **/
+    function delete(&$block)
+    {
+        if (strtolower(get_class($block)) != 'xoopsblock') {
+            return false;
+        }
+        $id = $block->getVar('bid');
+        $sql = sprintf("DELETE FROM %s WHERE bid = %u", $this->db->prefix('newblocks'), $id);
+        if (!$result = $this->db->query($sql)) {
+            return false;
+        }
+        $sql = sprintf("DELETE FROM %s WHERE block_id = %u", $this->db->prefix('block_module_link'), $id);
+        $this->db->query($sql);
+        return true;
+    }
+
+    /**
+     * retrieve array of {@link XoopsBlock}s meeting certain conditions
+     * @param object $criteria {@link CriteriaElement} with conditions for the blocks
+     * @param bool $id_as_key should the blocks' bid be the key for the returned array?
+     * @return array {@link XoopsBlock}s matching the conditions
+     **/
+    function &getObjects($criteria = null, $id_as_key = false)
+    {
+        $ret = array();
+        $limit = $start = 0;
+        $sql = 'SELECT DISTINCT(b.*) FROM '.$this->db->prefix('newblocks').' b LEFT JOIN '.$this->db->prefix('block_module_link').' l ON b.bid=l.block_id';
+        if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
+            $sql .= ' '.$criteria->renderWhere();
+            $limit = $criteria->getLimit();
+            $start = $criteria->getStart();
+        }
+        $result = $this->db->query($sql, $limit, $start);
+        if (!$result) {
+            return $ret;
+        }
+        while ($myrow = $this->db->fetchArray($result)) {
+            $block = new XoopsBlock();
+            $block->assignVars($myrow);
+            if (!$id_as_key) {
+                $ret[] =& $block;
+            } else {
+                $ret[$myrow['bid']] =& $block;
+            }
+            unset($block);
+        }
+        return $ret;
+    }
+
+    /**
+     * get a list of blocks matchich certain conditions
+     *
+     * @param string $criteria conditions to match
+     * @return array array of blocks matching the conditions
+     **/
+    function &getList($criteria = null)
+    {
+        $blocks =& $this->getObjects($criteria, true);
+        $ret = array();
+        foreach (array_keys($blocks) as $i) {
+            $name = ($blocks[$i]->getVar('block_type') != 'C') ? $blocks[$i]->getVar('name') : $blocks[$i]->getVar('title');
+            $ret[$i] = $name;
+        }
+        return $ret;
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/kernel/imagesetimg.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/kernel/imagesetimg.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/kernel/imagesetimg.php	(revision 405)
@@ -0,0 +1,200 @@
+<?php
+// $Id: imagesetimg.php,v 1.3 2006/05/01 02:37:28 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+if (!defined('XOOPS_ROOT_PATH')) {
+    exit();
+}
+
+class XoopsImagesetimg extends XoopsObject
+{
+    function XoopsImagesetimg()
+    {
+        $this->XoopsObject();
+        $this->initVar('imgsetimg_id', XOBJ_DTYPE_INT, null, false);
+        $this->initVar('imgsetimg_file', XOBJ_DTYPE_OTHER, null, false);
+        $this->initVar('imgsetimg_body', XOBJ_DTYPE_SOURCE, null, false);
+        $this->initVar('imgsetimg_imgset', XOBJ_DTYPE_INT, null, false);
+    }
+}
+
+/**
+* XOOPS imageset image handler class.  
+* This class is responsible for providing data access mechanisms to the data source 
+* of XOOPS imageset image class objects.
+*
+*
+* @author  Kazumi Ono <onokazu@xoops.org>
+*/
+
+class XoopsImagesetimgHandler extends XoopsObjectHandler
+{
+
+    function &create($isNew = true)
+    {
+        $imgsetimg =& new XoopsImagesetimg();
+        if ($isNew) {
+            $imgsetimg->setNew();
+        }
+        return $imgsetimg;
+    }
+
+    function &get($id)
+    {
+        $ret = false;
+        $id = intval($id);
+        if ($id > 0) {
+            $sql = 'SELECT * FROM '.$this->db->prefix('imgsetimg').' WHERE imgsetimg_id='.$id;
+            if ($result = $this->db->query($sql)) {
+                $numrows = $this->db->getRowsNum($result);
+                if ($numrows == 1) {
+                    $imgsetimg =& new XoopsImagesetimg();
+                    $imgsetimg->assignVars($this->db->fetchArray($result));
+                    $ret =& $imgsetimg;
+                }
+            }
+        }
+        return $ret;
+    }
+
+    function insert(&$imgsetimg)
+    {
+        if (strtolower(get_class($imgsetimg)) != 'xoopsimagesetimg') {
+            return false;
+        }
+        if (!$imgsetimg->isDirty()) {
+            return true;
+        }
+        if (!$imgsetimg->cleanVars()) {
+            return false;
+        }
+        foreach ($imgsetimg->cleanVars as $k => $v) {
+            ${$k} = $v;
+        }
+        if ($imgsetimg->isNew()) {
+            $imgsetimg_id = $this->db->genId('imgsetimg_imgsetimg_id_seq');
+            $sql = sprintf("INSERT INTO %s (imgsetimg_id, imgsetimg_file, imgsetimg_body, imgsetimg_imgset) VALUES (%u, %s, %s, %s)", $this->db->prefix('imgsetimg'), $imgsetimg_id, $this->db->quoteString($imgsetimg_file), $this->db->quoteString($imgsetimg_body), $this->db->quoteString($imgsetimg_imgset));
+        } else {
+            $sql = sprintf("UPDATE %s SET imgsetimg_file = %s, imgsetimg_body = %s, imgsetimg_imgset = %s WHERE imgsetimg_id = %u", $this->db->prefix('imgsetimg'), $this->db->quoteString($imgsetimg_file), $this->db->quoteString($imgsetimg_body), $this->db->quoteString($imgsetimg_imgset), $imgsetimg_id);
+        }
+        if (!$result = $this->db->query($sql)) {
+            return false;
+        }
+        if (empty($imgsetimg_id)) {
+            $imgsetimg_id = $this->db->getInsertId();
+        }
+        $imgsetimg->assignVar('imgsetimg_id', $imgsetimg_id);
+        return true;
+    }
+
+    function delete(&$imgsetimg)
+    {
+        if (strtolower(get_class($imgsetimg)) != 'xoopsimagesetimg') {
+            return false;
+        }
+        $sql = sprintf("DELETE FROM %s WHERE imgsetimg_id = %u", $this->db->prefix('imgsetimg'), $imgsetimg->getVar('imgsetimg_id'));
+        if (!$result = $this->db->query($sql)) {
+            return false;
+        }
+        return true;
+    }
+
+    function &getObjects($criteria = null, $id_as_key = false)
+    {
+        $ret = array();
+        $limit = $start = 0;
+        $sql = 'SELECT DISTINCT i.* FROM '.$this->db->prefix('imgsetimg'). ' i LEFT JOIN '.$this->db->prefix('imgset_tplset_link'). ' l ON l.imgset_id=i.imgsetimg_imgset LEFT JOIN '.$this->db->prefix('imgset').' s ON s.imgset_id=l.imgset_id';
+        if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
+            $sql .= ' '.$criteria->renderWhere();
+            $sql .= ' ORDER BY imgsetimg_id '.$criteria->getOrder();
+            $limit = $criteria->getLimit();
+            $start = $criteria->getStart();
+        }
+        $result = $this->db->query($sql, $limit, $start);
+        if (!$result) {
+            return $ret;
+        }
+        while ($myrow = $this->db->fetchArray($result)) {
+            $imgsetimg =& new XoopsImagesetimg();
+            $imgsetimg->assignVars($myrow);
+            if (!$id_as_key) {
+                $ret[] =& $imgsetimg;
+            } else {
+                $ret[$myrow['imgsetimg_id']] =& $imgsetimg;
+            }
+            unset($imgsetimg);
+        }
+        return $ret;
+    }
+
+    function getCount($criteria = null)
+    {
+        $sql = 'SELECT COUNT(i.imgsetimg_id) FROM '.$this->db->prefix('imgsetimg'). ' i LEFT JOIN '.$this->db->prefix('imgset_tplset_link'). ' l ON l.imgset_id=i.imgsetimg_imgset';
+        if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
+            $sql .= ' '.$criteria->renderWhere().' GROUP BY i.imgsetimg_id';
+        }
+        if (!$result =& $this->db->query($sql)) {
+            return 0;
+        }
+        list($count) = $this->db->fetchRow($result);
+        return $count;
+    }
+
+/**
+ * Function-Documentation
+ * @param type $imgset_id documentation
+ * @param type $id_as_key = false documentation
+ * @return type documentation
+ * @author Kazumi Ono <onokazu@xoops.org>
+ **/
+    function &getByImageset($imgset_id, $id_as_key = false)
+    {
+        $ret =& $this->getObjects(new Criteria('imgsetimg_imgset', intval($imgset_id)), $id_as_key);
+        return $ret;
+    }
+
+/**
+ * Function-Documentation
+ * @param type $filename documentation
+ * @param type $imgset_id documentation
+ * @return type documentation
+ * @author Kazumi Ono <onokazu@xoops.org>
+ **/
+    function imageExists($filename, $imgset_id)
+    {
+        $criteria = new CriteriaCompo(new Criteria('imgsetimg_file', $filename));
+        $criteria->add(new Criteria('imgsetimg_imgset', intval($imgset_id)));
+        if ($this->getCount($criteria) > 0) {
+            return true;
+        }
+        return false;
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/userinfo.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/userinfo.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/userinfo.php	(revision 405)
@@ -0,0 +1,192 @@
+<?php
+// $Id: userinfo.php,v 1.3 2006/05/01 02:37:26 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+$xoopsOption['pagetype'] = 'user';
+include 'mainfile.php';
+include_once XOOPS_ROOT_PATH.'/class/module.textsanitizer.php';
+
+include_once XOOPS_ROOT_PATH . '/modules/system/constants.php';
+
+$uid = intval($_GET['uid']);
+if ($uid <= 0) {
+    redirect_header('index.php', 3, _US_SELECTNG);
+    exit();
+}
+
+$gperm_handler = & xoops_gethandler( 'groupperm' );
+$groups = ( $xoopsUser ) ? $xoopsUser -> getGroups() : XOOPS_GROUP_ANONYMOUS;
+
+$isAdmin = $gperm_handler->checkRight( 'system_admin', XOOPS_SYSTEM_USER, $groups);         // isadmin is true if user has 'edit users' admin rights
+
+if (is_object($xoopsUser)) {
+    if ($uid == $xoopsUser->getVar('uid')) {
+        $config_handler =& xoops_gethandler('config');
+        $xoopsConfigUser =& $config_handler->getConfigsByCat(XOOPS_CONF_USER);
+        $xoopsOption['template_main'] = 'system_userinfo.html';
+        include XOOPS_ROOT_PATH.'/header.php';
+        $xoopsTpl->assign('user_ownpage', true);
+        $xoopsTpl->assign('lang_editprofile', _US_EDITPROFILE);
+        $xoopsTpl->assign('lang_avatar', _US_AVATAR);
+        $xoopsTpl->assign('lang_inbox', _US_INBOX);
+        $xoopsTpl->assign('lang_logout', _US_LOGOUT);
+        if ($xoopsConfigUser['self_delete'] == 1) {
+            $xoopsTpl->assign('user_candelete', true);
+            $xoopsTpl->assign('lang_deleteaccount', _US_DELACCOUNT);
+        } else {
+            $xoopsTpl->assign('user_candelete', false);
+        }
+        $thisUser =& $xoopsUser;
+    } else {
+        $member_handler =& xoops_gethandler('member');
+        $thisUser =& $member_handler->getUser($uid);
+        if (!is_object($thisUser) || !$thisUser->isActive() ) {
+            redirect_header("index.php",3,_US_SELECTNG);
+            exit();
+        }
+        $xoopsOption['template_main'] = 'system_userinfo.html';
+        include XOOPS_ROOT_PATH.'/header.php';
+        $xoopsTpl->assign('user_ownpage', false);
+    }
+} else {
+    $member_handler =& xoops_gethandler('member');
+    $thisUser =& $member_handler->getUser($uid);
+    if (!is_object($thisUser) || !$thisUser->isActive()) {
+        redirect_header("index.php",3,_US_SELECTNG);
+        exit();
+    }
+    $xoopsOption['template_main'] = 'system_userinfo.html';
+    include(XOOPS_ROOT_PATH.'/header.php');
+    $xoopsTpl->assign('user_ownpage', false);
+}
+$myts =& MyTextSanitizer::getInstance();
+if ( is_object($xoopsUser) && $isAdmin ) {
+    $xoopsTpl->assign('lang_editprofile', _US_EDITPROFILE);
+    $xoopsTpl->assign('lang_deleteaccount', _US_DELACCOUNT);
+    $xoopsTpl->assign('user_uid', $thisUser->getVar('uid'));
+}
+$xoopsTpl->assign('lang_allaboutuser', sprintf(_US_ALLABOUT,$thisUser->getVar('uname')));
+$xoopsTpl->assign('lang_avatar', _US_AVATAR);
+$xoopsTpl->assign('user_avatarurl', 'uploads/'.$thisUser->getVar('user_avatar'));
+$xoopsTpl->assign('lang_realname', _US_REALNAME);
+$xoopsTpl->assign('user_realname', $thisUser->getVar('name'));
+$xoopsTpl->assign('lang_website', _US_WEBSITE);
+$xoopsTpl->assign('user_websiteurl', '<a href="'.$thisUser->getVar('url', 'E').'" target="_blank">'.$thisUser->getVar('url').'</a>');
+$xoopsTpl->assign('lang_email', _US_EMAIL);
+$xoopsTpl->assign('lang_privmsg', _US_PM);
+$xoopsTpl->assign('lang_icq', _US_ICQ);
+$xoopsTpl->assign('user_icq', $thisUser->getVar('user_icq'));
+$xoopsTpl->assign('lang_aim', _US_AIM);
+$xoopsTpl->assign('user_aim', $thisUser->getVar('user_aim'));
+$xoopsTpl->assign('lang_yim', _US_YIM);
+$xoopsTpl->assign('user_yim', $thisUser->getVar('user_yim'));
+$xoopsTpl->assign('lang_msnm', _US_MSNM);
+$xoopsTpl->assign('user_msnm', $thisUser->getVar('user_msnm'));
+$xoopsTpl->assign('lang_location', _US_LOCATION);
+$xoopsTpl->assign('user_location', $thisUser->getVar('user_from'));
+$xoopsTpl->assign('lang_occupation', _US_OCCUPATION);
+$xoopsTpl->assign('user_occupation', $thisUser->getVar('user_occ'));
+$xoopsTpl->assign('lang_interest', _US_INTEREST);
+$xoopsTpl->assign('user_interest', $thisUser->getVar('user_intrest'));
+$xoopsTpl->assign('lang_extrainfo', _US_EXTRAINFO);
+$xoopsTpl->assign('user_extrainfo', $myts->makeTareaData4Show($thisUser->getVar('bio', 'N'),0,1,1));
+$xoopsTpl->assign('lang_statistics', _US_STATISTICS);
+$xoopsTpl->assign('lang_membersince', _US_MEMBERSINCE);
+$xoopsTpl->assign('user_joindate', formatTimestamp($thisUser->getVar('user_regdate'),'s'));
+$xoopsTpl->assign('lang_rank', _US_RANK);
+$xoopsTpl->assign('lang_posts', _US_POSTS);
+$xoopsTpl->assign('lang_basicInfo', _US_BASICINFO);
+$xoopsTpl->assign('lang_more', _US_MOREABOUT);
+$xoopsTpl->assign('lang_myinfo', _US_MYINFO);
+$xoopsTpl->assign('user_posts', $thisUser->getVar('posts'));
+$xoopsTpl->assign('lang_lastlogin', _US_LASTLOGIN);
+$xoopsTpl->assign('lang_notregistered', _US_NOTREGISTERED);
+
+$xoopsTpl->assign('lang_signature', _US_SIGNATURE);
+$xoopsTpl->assign('user_signature', $myts->makeTareaData4Show($thisUser->getVar('user_sig', 'N'),0,1,1));
+
+if ($thisUser->getVar('user_viewemail') == 1) {
+    $xoopsTpl->assign('user_email', $thisUser->getVar('email', 'E'));
+} else {
+    if (is_object($xoopsUser)) {
+        // All admins will be allowed to see emails, even those that are not allowed to edit users (I think it's ok like this)
+        if ($xoopsUserIsAdmin || ($xoopsUser->getVar("uid") == $thisUser->getVar("uid"))) {
+            $xoopsTpl->assign('user_email', $thisUser->getVar('email', 'E'));
+        } else {
+            $xoopsTpl->assign('user_email', '&nbsp;');
+        }
+    }
+}
+if (is_object($xoopsUser)) {
+    $xoopsTpl->assign('user_pmlink', "<a href=\"javascript:openWithSelfMain('".XOOPS_URL."/pmlite.php?send2=1&amp;to_userid=".$thisUser->getVar('uid')."', 'pmlite', 450, 380);\"><img src=\"".XOOPS_URL."/images/icons/pm.gif\" alt=\"".sprintf(_SENDPMTO,$thisUser->getVar('uname'))."\" /></a>");
+} else {
+    $xoopsTpl->assign('user_pmlink', '');
+}
+$userrank = $thisUser->rank();
+if ($userrank['image']) {
+    $xoopsTpl->assign('user_rankimage', '<img src="'.XOOPS_UPLOAD_URL.'/'.$userrank['image'].'" alt="" />');
+}
+$xoopsTpl->assign('user_ranktitle', $userrank['title']);
+$date = $thisUser->getVar("last_login");
+if (!empty($date)) {
+    $xoopsTpl->assign('user_lastlogin', formatTimestamp($date,"m"));
+}
+
+
+$module_handler =& xoops_gethandler('module');
+$criteria = new CriteriaCompo(new Criteria('hassearch', 1));
+$criteria->add(new Criteria('isactive', 1));
+$mids = array_keys($module_handler->getList($criteria));
+
+foreach ($mids as $mid) {
+    // Hack by marcan : only return results of modules for which user has access permission
+  if ( $gperm_handler->checkRight('module_read', $mid, $groups)) {
+    $module =& $module_handler->get($mid);
+    $results =& $module->search('', '', 5, 0, $thisUser->getVar('uid'));
+    $count = count($results);
+    if (is_array($results) && $count > 0) {
+        for ($i = 0; $i < $count; $i++) {
+            if (isset($results[$i]['image']) && $results[$i]['image'] != '') {
+                $results[$i]['image'] = 'modules/'.$module->getVar('dirname').'/'.$results[$i]['image'];
+            } else {
+                $results[$i]['image'] = 'images/icons/posticon2.gif';
+            }
+            $results[$i]['link'] = 'modules/'.$module->getVar('dirname').'/'.$results[$i]['link'];
+            $results[$i]['title'] = $myts->makeTboxData4Show($results[$i]['title']);
+            $results[$i]['time'] = $results[$i]['time'] ? formatTimestamp($results[$i]['time']) : '';
+        }
+        if ($count == 5) {
+            $showall_link = '<a href="search.php?action=showallbyuser&amp;mid='.$mid.'&amp;uid='.$thisUser->getVar('uid').'">'._US_SHOWALL.'</a>';
+        } else {
+            $showall_link = '';
+        }
+        $xoopsTpl->append('modules', array('name' => $module->getVar('name'), 'results' => $results, 'showall_link' => $showall_link));
+    }
+    unset($module);
+  }
+}
+include XOOPS_ROOT_PATH.'/footer.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/language/japanese/notification.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/language/japanese/notification.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/language/japanese/notification.php	(revision 405)
@@ -0,0 +1,90 @@
+<?php
+// $Id: notification.php,v 1.5 2005/09/04 20:46:09 onokazu Exp $
+
+// RMV-NOTIFY
+
+// Text for various templates...
+
+define ('_NOT_NOTIFICATIONOPTIONS', '¥¤¥Ù¥ó¥È¤ÎÁªÂò');
+define ('_NOT_UPDATENOW', 'º£¤¹¤°¹¹¿·');
+define ('_NOT_UPDATEOPTIONS', '¥¤¥Ù¥ó¥È¤Î¹¹¿·');
+
+define ('_NOT_CANCEL', 'Ãæ»ß');
+define ('_NOT_CLEAR', '¥¯¥ê¥¢');
+define ('_NOT_DELETE', 'ºï½ü');
+define ('_NOT_CHECKALL', 'Á´¤Æ¥Á¥§¥Ã¥¯');
+define ('_NOT_MODULE', '¥â¥¸¥å¡¼¥ë');
+define ('_NOT_CATEGORY', '¥«¥Æ¥´¥ê');
+define ('_NOT_ITEMID', 'ID');
+define ('_NOT_ITEMNAME', 'Ì¾¾Î');
+define ('_NOT_EVENT', '¥¤¥Ù¥ó¥È');
+define ('_NOT_EVENTS', '¥¤¥Ù¥ó¥È');
+define ('_NOT_ACTIVENOTIFICATIONS', 'ÁªÂò²ÄÇ½¤Ê¥¤¥Ù¥ó¥È');
+define ('_NOT_NAMENOTAVAILABLE', 'ÌµÂê');
+define ('_NOT_ITEMNAMENOTAVAILABLE', '¹àÌÜÌ¾¤¬Ìµ¸ú¤Ç¤¹');
+define ('_NOT_ITEMTYPENOTAVAILABLE', '¹àÌÜ¥¿¥¤¥×¤¬Ìµ¸ú¤Ç¤¹');
+define ('_NOT_ITEMURLNOTAVAILABLE', '¹àÌÜURL¤¬Ìµ¸ú¤Ç¤¹');
+define ('_NOT_DELETINGNOTIFICATIONS', 'ÁªÂò¥¤¥Ù¥ó¥È¤Îºï½ü');
+define ('_NOT_DELETESUCCESS', 'ÁªÂò¤µ¤ì¤¿¥¤¥Ù¥ó¥È¤òºï½ü¤·¤Þ¤·¤¿');
+define ('_NOT_UPDATEOK', '¥¤¥Ù¥ó¥È¤ò¹¹¿·¤·¤Þ¤·¤¿');
+define ('_NOT_NOTIFICATIONMETHODIS', 'ÄÌÃÎÊýË¡¡§');
+define ('_NOT_EMAIL', '¥á¡¼¥ë');
+define ('_NOT_PM', '¥×¥é¥¤¥Ù¡¼¥È¡¦¥á¥Ã¥»¡¼¥¸');
+define ('_NOT_DISABLE', 'Ìµ¸ú¤Ë¤¹¤ë');
+define ('_NOT_CHANGE', 'ÊÑ¹¹');
+define ('_NOT_RUSUREDEL', 'ÁªÂò¤·¤¿¥¤¥Ù¥ó¥È¤òºï½ü¤·¤Æ¤â¤¤¤¤¤Ç¤¹¤«¡©');
+define ('_NOT_NOACCESS', '¤³¤Î¥Ú¡¼¥¸¤Ë¥¢¥¯¥»¥¹¤¹¤ë¸¢¸Â¤¬¤¢¤ê¤Þ¤»¤ó¡£');
+
+// Text for module config options
+
+define ('_NOT_ENABLE', 'Í­¸ú¤Ë¤¹¤ë');
+define ('_NOT_NOTIFICATION', '¥¤¥Ù¥ó¥ÈÄÌÃÎµ¡Ç½');
+
+define ('_NOT_CONFIG_ENABLED', '¥¤¥Ù¥ó¥ÈÄÌÃÎµ¡Ç½¤ÎÀßÄê');
+define ('_NOT_CONFIG_ENABLEDDSC', '¤³¤Î¥â¥¸¥å¡¼¥ë¤Ç¤Ï¡¢¤¢¤ëÆÃÄê¤Î¥¤¥Ù¥ó¥È¤¬È¯À¸¤·¤¿ºÝ¤Ë¡¢Åö³º¥¤¥Ù¥ó¥È¹ØÆÉ¼Ô¤ËÂÐ¤·ÄÌÃÎ¥á¥Ã¥»¡¼¥¸¤¬Á÷¤é¤ì¤ë¤è¤¦¤ËÀßÄê¤Ç¤­¤Þ¤¹¡£¤³¤Îµ¡Ç½¤òÍ­¸ú¤Ë¤¹¤ë¤Ë¤Ï¡Ö¤Ï¤¤¡×¤òÁªÂò¤·¤Æ¤¯¤À¤µ¤¤¡£');
+
+define ('_NOT_CONFIG_EVENTS', 'ÆÃÄê¥¤¥Ù¥ó¥È¤òÍ­¸ú¤Ë¤¹¤ë');
+define ('_NOT_CONFIG_EVENTSDSC', '¥æ¡¼¥¶¤¬ÁªÂò²ÄÇ½¤Ê¥¤¥Ù¥ó¥È¤òÀßÄê¤·¤Æ¤¯¤À¤µ¤¤¡£');
+
+define ('_NOT_CONFIG_ENABLE', '¥¤¥Ù¥ó¥ÈÄÌÃÎµ¡Ç½¤ÎÀßÄê');
+define ('_NOT_CONFIG_ENABLEDSC', '¤³¤Î¥â¥¸¥å¡¼¥ë¤Ç¤Ï¡¢¤¢¤ëÆÃÄê¤Î¥¤¥Ù¥ó¥È¤¬È¯À¸¤·¤¿ºÝ¤Ë¡¢Åö³º¥¤¥Ù¥ó¥È¹ØÆÉ¼Ô¤ËÂÐ¤·ÄÌÃÎ¥á¥Ã¥»¡¼¥¸¤¬Á÷¤é¤ì¤ë¤è¤¦¤ËÀßÄê¤Ç¤­¤Þ¤¹¡£¤³¤Îµ¡Ç½¤òÍ­¸ú¤Ë¤¹¤ë¤¿¤á¤Î·Á¼°¤òÁªÂò¤·¤Æ¤¯¤À¤µ¤¤¡£');
+define ('_NOT_CONFIG_DISABLE', '¤³¤Îµ¡Ç½¤òÌµ¸ú¤Ë¤¹¤ë');
+define ('_NOT_CONFIG_ENABLEBLOCK', '¥¤¥Ù¥ó¥ÈÁªÂò¥ª¥×¥·¥ç¥ó¤ò¥Ö¥í¥Ã¥¯¤ËÉ½¼¨¤¹¤ë');
+define ('_NOT_CONFIG_ENABLEINLINE', '¥¤¥Ù¥ó¥ÈÁªÂò¥ª¥×¥·¥ç¥ó¤ò¥á¥¤¥ó¥³¥ó¥Æ¥ó¥Ä²¼Éô¤ËÉ½¼¨¤¹¤ë');
+define ('_NOT_CONFIG_ENABLEBOTH', '¥¤¥Ù¥ó¥ÈÁªÂò¥ª¥×¥·¥ç¥ó¤ò¥Ö¥í¥Ã¥¯¤ª¤è¤Ó¥á¥¤¥ó¥³¥ó¥Æ¥ó¥Ä²¼Éô¤ÎÎ¾Êý¤ËÉ½¼¨¤¹¤ë');
+
+// For notification about comment events
+
+define ('_NOT_COMMENT_NOTIFY', '¥³¥á¥ó¥È¤¬ÄÉ²Ã¤µ¤ì¤Þ¤·¤¿');
+define ('_NOT_COMMENT_NOTIFYCAP', '¤³¤Î¥Ú¡¼¥¸¤Ë¥³¥á¥ó¥È¤¬ÄÉ²Ã¤µ¤ì¤¿ºÝ¤ËÄÌÃÎ¤¹¤ë');
+define ('_NOT_COMMENT_NOTIFYDSC', '');
+define ('_NOT_COMMENT_NOTIFYSBJ', '[{X_MODULE}] ¡Ö{X_ITEM_TYPE}¡×¤ËÂÐ¤·¤Æ¥³¥á¥ó¥È¤¬ÄÉ²Ã¤µ¤ì¤Þ¤·¤¿ ¡Ê¼«Æ°ÄÌÃÎ¡Ë');
+
+define ('_NOT_COMMENTSUBMIT_NOTIFY', '¿·µ¬¥³¥á¥ó¥È¤ÎÅê¹Æ¤¬¤¢¤ê¤Þ¤·¤¿');
+define ('_NOT_COMMENTSUBMIT_NOTIFYCAP', '¤³¤Î¥Ú¡¼¥¸¤Ë¾µÇ§¤¬É¬Í×¤Ê¥³¥á¥ó¥È¤¬Åê¹Æ¤µ¤ì¤¿ºÝ¤ËÄÌÃÎ¤¹¤ë');
+define ('_NOT_COMMENTSUBMIT_NOTIFYDSC', '');
+define ('_NOT_COMMENTSUBMIT_NOTIFYSBJ', '[{X_MODULE}] ¡Ö{X_ITEM_TYPE}¡×¤ËÂÐ¤·¤Æ¿·µ¬¥³¥á¥ó¥È¤ÎÅê¹Æ¤¬¤¢¤ê¤Þ¤·¤¿ ¡Ê¼«Æ°ÄÌÃÎ¡Ë');
+
+// For notification bookmark feature
+// (Not really notification, but easy to do with this module)
+
+define ('_NOT_BOOKMARK_NOTIFY', '¥Ö¥Ã¥¯¥Þ¡¼¥¯');
+define ('_NOT_BOOKMARK_NOTIFYCAP', '¤³¤Î¥Ú¡¼¥¸¤ò¥Ö¥Ã¥¯¥Þ¡¼¥¯¤¹¤ë');
+define ('_NOT_BOOKMARK_NOTIFYDSC', '¤³¤Î¥Ú¡¼¥¸¤ò¥Ö¥Ã¥¯¥Þ¡¼¥¯¤·¤Þ¤¹¡£ÄÌÃÎ¥á¥Ã¥»¡¼¥¸¤ÏÁ÷¤é¤ì¤Þ¤»¤ó¡£');
+
+// For user profile
+// FIXME: These should be reworded a little...
+
+define ('_NOT_NOTIFYMETHOD', '¥¤¥Ù¥ó¥È¹¹¿·ÄÌÃÎ¥á¥Ã¥»¡¼¥¸¤Î¼õ¼èÊýË¡');
+define ('_NOT_METHOD_EMAIL', '¥á¡¼¥ë');
+define ('_NOT_METHOD_PM', '¥×¥é¥¤¥Ù¡¼¥È¡¦¥á¥Ã¥»¡¼¥¸');
+define ('_NOT_METHOD_DISABLE', '°ì»þÅª¤ËÃæ»ß');
+
+define ('_NOT_NOTIFYMODE', '¥¤¥Ù¥ó¥ÈÄÌÃÎ¤Î¥¿¥¤¥ß¥ó¥°');
+define ('_NOT_MODE_SENDALWAYS', '¥¤¥Ù¥ó¥È¹¹¿·»þ¤ËÉ¬¤ºÄÌÃÎ¤¹¤ë');
+define ('_NOT_MODE_SENDONCE', '°ìÅÙ¤À¤±ÄÌÃÎ¤¹¤ë');
+define ('_NOT_MODE_SENDONCEPERLOGIN', '°ìÅÙÄÌÃÎ¤·¤¿¸å¡¢ºÆÅÙ¥í¥°¥¤¥ó¤¹¤ë¤Þ¤ÇÄÌÃÎ¤·¤Ê¤¤');
+
+define('_NOT_NOTHINGTODELETE', 'ºï½ü¤¹¤ë¥¤¥Ù¥ó¥È¤¬¤¢¤ê¤Þ¤»¤ó');
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/language/japanese/pmsg.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/language/japanese/pmsg.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/language/japanese/pmsg.php	(revision 405)
@@ -0,0 +1,43 @@
+<?php
+//%%%%%%	File Name readpmsg.php 	%%%%%
+define('_PM_DELETED','¥á¥Ã¥»¡¼¥¸¤òºï½ü¤·¤Þ¤·¤¿¡£');
+define('_PM_PRIVATEMESSAGE','¥×¥é¥¤¥Ù¡¼¥È¥á¥Ã¥»¡¼¥¸');
+define('_PM_INBOX','¼õ¿®È¢');
+define('_PM_FROM','Á÷¿®¼Ô');
+define('_PM_YOUDONTHAVE','¥×¥é¥¤¥Ù¡¼¥È¥á¥Ã¥»¡¼¥¸¤Ï¤¢¤ê¤Þ¤»¤ó¡£');
+define('_PM_FROMC','Á÷¿®¼Ô¡§ ');
+define('_PM_SENTC','Á÷¿®Æü»þ¡§ '); // The date of message sent
+define('_PM_PROFILE','¥×¥í¥Õ¥£¡¼¥ë');
+
+// %s is a username
+define('_PM_PREVIOUS','Á°¤Î¥á¥Ã¥»¡¼¥¸');
+define('_PM_NEXT','¼¡¤Î¥á¥Ã¥»¡¼¥¸');
+
+//%%%%%%	File Name pmlite.php 	%%%%%
+define('_PM_SORRY','¥×¥é¥¤¥Ù¡¼¥È¥á¥Ã¥»¡¼¥¸¤ò»ÈÍÑ¤¹¤ë¤Ë¤Ï¥æ¡¼¥¶ÅÐÏ¿¤¬É¬Í×¤Ç¤¹¡£');
+define('_PM_REGISTERNOW','º£¤¹¤°ÅÐÏ¿');
+define('_PM_GOBACK','Ìá¤ë');
+define('_PM_USERNOEXIST','ÁªÂò¤·¤¿¥æ¡¼¥¶¤ÏÂ¸ºß¤·¤Þ¤»¤ó¡£');
+define('_PM_PLZTRYAGAIN','¥æ¡¼¥¶Ì¾¤ò³ÎÇ§¤·¤â¤¦°ìÅÙ¤ä¤êÄ¾¤·¤Æ¤¯¤À¤µ¤¤¡£');
+define('_PM_MESSAGEPOSTED','¥á¥Ã¥»¡¼¥¸¤òÁ÷¿®¤·¤Þ¤·¤¿¡£');
+define('_PM_CLICKHERE','¥×¥é¥¤¥Ù¡¼¥È¥á¥Ã¥»¡¼¥¸¤Î¼õ¿®È¢¤òÉ½¼¨¤¹¤ë');
+define('_PM_ORCLOSEWINDOW','¤³¤Î¥¦¥£¥ó¥É¥¦¤òÊÄ¤¸¤ë');
+define('_PM_USERWROTE','%s ¤µ¤ó¤Ï½ñ¤­¤Þ¤·¤¿¡§');
+define('_PM_TO','°¸Àè¡§');
+define('_PM_SUBJECTC','·ïÌ¾¡§');
+define('_PM_MESSAGEC','¥á¥Ã¥»¡¼¥¸¡§');
+define('_PM_CLEAR','¥¯¥ê¥¢');
+define('_PM_CANCELSEND','¥­¥ã¥ó¥»¥ë');
+define('_PM_SUBMIT','Á÷¿®');
+
+//%%%%%%	File Name viewpmsg.php 	%%%%%
+define('_PM_SUBJECT','·ïÌ¾');
+define('_PM_DATE','Á÷¿®Æü»þ');
+define('_PM_NOTREAD','Ì¤ÆÉ');
+define('_PM_SEND','Á÷¿®');
+define('_PM_DELETE','ºï½ü');
+define('_PM_REPLY', 'ÊÖ¿®');
+define('_PM_PLZREG','¥×¥é¥¤¥Ù¡¼¥È¥á¥Ã¥»¡¼¥¸¤ò»ÈÍÑ¤¹¤ë¤Ë¤Ï¥æ¡¼¥¶ÅÐÏ¿¤¬É¬Í×¤Ç¤¹¡£');
+
+define('_PM_ONLINE', '¥ª¥ó¥é¥¤¥ó');
+?>
Index: /temp/test-xoops.ec-cube.net/html/language/japanese/mail_template/commentsubmit_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/language/japanese/mail_template/commentsubmit_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/language/japanese/mail_template/commentsubmit_notify.tpl	(revision 405)
@@ -0,0 +1,18 @@
+{X_UNAME}¤µ¤ó¡¢¤³¤ó¤Ë¤Á¤Ï
+
+Åö¥µ¥¤¥È{X_MODULE}¥â¥¸¥å¡¼¥ë¤Ë¤ª¤¤¤Æ¿·µ¬¥³¥á¥ó¥È¤ÎÅê¹Æ¤¬¤¢¤ê¤Þ¤·¤¿¡ÊÌ¤¾µÇ§¡Ë¡£
+
+²¼µ­¤Î¥ê¥ó¥¯¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤È¤³¤Î¥³¥á¥ó¥È¤ò¸«¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡§
+{X_COMMENT_URL}
+
+-----------
+
+¤³¤Î¥á¡¼¥ë¤ÏXOOPS¤Î¼«Æ°ÄÌÃÎµ¡Ç½¤Ë¤è¤Ã¤ÆÁ÷¿®¤µ¤ì¤Æ¤¤¤Þ¤¹
+
+¼«Æ°ÄÌÃÎ¤òÄä»ß¤·¤¿¤¤¾ì¹ç¤Ï²¼µ­¤ÎURL¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡§
+{X_UNSUBSCRIBE_URL}
+
+-----------
+{X_SITENAME} ({X_SITEURL}) 
+´ÉÍý¿Í
+{X_ADMINMAIL}
Index: /temp/test-xoops.ec-cube.net/html/language/japanese/mail_template/activated.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/language/japanese/mail_template/activated.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/language/japanese/mail_template/activated.tpl	(revision 405)
@@ -0,0 +1,12 @@
+{X_UNAME}¤µ¤ó
+
+{SITENAME}¤Ç¤Î¥æ¡¼¥¶¥¢¥«¥¦¥ó¥È¤¬´ÉÍý¿Í¤Ë¤è¤ê¾µÇ§¤µ¤ì¤Þ¤·¤¿¡£
+
+ÅÐÏ¿»þ¤Ë»ØÄê¤·¤¿¥Ñ¥¹¥ï¡¼¥É¤ò»ÈÍÑ¤·¤Æ²¼µ­¥ê¥ó¥¯¤è¤ê¥í¥°¥¤¥ó¤·¤Æ¤¯¤À¤µ¤¤¡£
+
+{SITEURL}user.php
+
+-----------
+{SITENAME} ({SITEURL}) 
+webmaster
+{ADMINMAIL}
Index: /temp/test-xoops.ec-cube.net/html/language/japanese/mail_template/register.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/language/japanese/mail_template/register.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/language/japanese/mail_template/register.tpl	(revision 405)
@@ -0,0 +1,12 @@
+{X_UNAME}¤µ¤ó¡¢¤³¤ó¤Ë¤Á¤Ï
+
+{SITENAME}¤Ë¤ª¤±¤ë¥æ¡¼¥¶ÅÐÏ¿ÍÑ¥á¡¼¥ë¥¢¥É¥ì¥¹¤È¤·¤Æ¤¢¤Ê¤¿¤Î¥á¡¼¥ë¥¢¥É¥ì¥¹¡Ê{X_UEMAIL}¡Ë¤¬»ÈÍÑ¤µ¤ì¤Þ¤·¤¿¡£¤â¤·{SITENAME}¤Ç¤Î¥æ¡¼¥¶ÅÐÏ¿¤Ë³Ð¤¨¤¬¤Ê¤¤¾ì¹ç¤Ï¤³¤Î¥á¡¼¥ë¤òÇË´þ¤·¤Æ¤¯¤À¤µ¤¤¡£
+
+{SITENAME}¤Ç¤Î¥æ¡¼¥¶ÅÐÏ¿¤ò´°Î»¤¹¤ë¤Ë¤Ï²¼µ­¤Î¥ê¥ó¥¯¤ò¥¯¥ê¥Ã¥¯¤·¤ÆÅÐÏ¿¤Î¾µÇ§¤ò¹Ô¤Ã¤Æ¤¯¤À¤µ¤¤¡£
+
+{X_UACTLINK}
+
+-----------
+{SITENAME} ({SITEURL}) 
+webmaster
+{ADMINMAIL}
Index: /temp/test-xoops.ec-cube.net/html/language/japanese/mail_template/tellfriend.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/language/japanese/mail_template/tellfriend.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/language/japanese/mail_template/tellfriend.tpl	(revision 405)
@@ -0,0 +1,11 @@
+{FRIEND_NAME}¤µ¤ó¡¢¤³¤ó¤Ë¤Á¤Ï
+
+¤¢¤Ê¤¿¤Î¤ªÍ§Ã£¤Î{YOUR_NAME}¤µ¤ó¤«¤é¡¢²¼µ­¥µ¥¤¥È¿äÁ¦¤Î¥á¡¼¥ë¤¬ÆÏ¤­¤Þ¤·¤¿¡£
+
+¥µ¥¤¥ÈÌ¾¡§ {SITENAME}
+¥Û¡¼¥à¥Ú¡¼¥¸¡§  {SITEURL}
+
+-----------
+{SITENAME} ({SITEURL}) 
+webmaster
+{ADMINMAIL}
Index: /temp/test-xoops.ec-cube.net/html/language/japanese/mail_template/adminactivate.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/language/japanese/mail_template/adminactivate.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/language/japanese/mail_template/adminactivate.tpl	(revision 405)
@@ -0,0 +1,15 @@
+{X_UNAME}¤µ¤ó
+
+{SITENAME}¤Ë¤Æ¿·µ¬¥æ¡¼¥¶¤ÎÅÐÏ¿¤¬¤¢¤ê¤Þ¤·¤¿¡£
+
+¥æ¡¼¥¶Ì¾¡§{USERNAME}
+¥á¡¼¥ë¥¢¥É¥ì¥¹¡§ {USEREMAIL}
+
+²¼µ­¤Î¥ê¥ó¥¯¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤È¤³¤Î¥æ¡¼¥¶¤Î¾µÇ§¤¬´°Î»¤·¤Þ¤¹¡£
+
+{USERACTLINK}
+
+-----------
+{SITENAME} ({SITEURL}) 
+webmaster
+{ADMINMAIL}
Index: /temp/test-xoops.ec-cube.net/html/language/japanese/mail_template/lostpass1.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/language/japanese/mail_template/lostpass1.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/language/japanese/mail_template/lostpass1.tpl	(revision 405)
@@ -0,0 +1,12 @@
+{X_UNAME}¤µ¤ó¡¢¤³¤ó¤Ë¤Á¤Ï
+
+IP¥¢¥É¥ì¥¹{IP}¤Î¥æ¡¼¥¶¤«¤é¡¢{SITENAME}¤Ë¤ª¤±¤ë¤¢¤Ê¤¿¤Î¥í¥°¥¤¥óÍÑ¥Ñ¥¹¥ï¡¼¥É¤Î¿·µ¬È¯¹Ô¥ê¥¯¥¨¥¹¥È¤¬¤¢¤ê¤Þ¤·¤¿¡£¤â¤·¿·¤¿¤Ë¥Ñ¥¹¥ï¡¼¥É¤òÈ¯¹Ô¤¹¤ë¾ì¹ç¤Ï²¼µ­¤Î¥ê¥ó¥¯¤ò¥¯¥ê¥Ã¥¯¤·¤Æ¤¯¤À¤µ¤¤¡£ 
+
+{NEWPWD_LINK}
+
+¤â¤·¤³¤Î¥ê¥¯¥¨¥¹¥È¤¬¼ê°ã¤¤¤Î¾ì¹ç¤Ï¤³¤Î¥á¡¼¥ë¤òÇË´þ¤·¤Æ¤¯¤À¤µ¤¤¡£º£¤Þ¤Ç¤Î¥Ñ¥¹¥ï¡¼¥É¤Ç¥í¥°¥¤¥ó¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
+
+-----------
+{SITENAME} ({SITEURL}) 
+webmaster
+{ADMINMAIL}
Index: /temp/test-xoops.ec-cube.net/html/language/japanese/mail_template/comment_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/language/japanese/mail_template/comment_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/language/japanese/mail_template/comment_notify.tpl	(revision 405)
@@ -0,0 +1,18 @@
+{X_UNAME}¤µ¤ó¡¢¤³¤ó¤Ë¤Á¤Ï
+
+Åö¥µ¥¤¥È{X_MODULE}¥â¥¸¥å¡¼¥ë¤Ë¤ª¤¤¤Æ{X_ITEM_TYPE}¡Ö{X_ITEM_NAME}¡×¤ËÂÐ¤¹¤ë¥³¥á¥ó¥È¤Î¿·µ¬Åê¹Æ¤¬¤¢¤ê¤Þ¤·¤¿¡£
+
+²¼µ­¤Î¥ê¥ó¥¯¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤È¤³¤Î¥³¥á¥ó¥È¤ò¸«¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡§
+{X_COMMENT_URL}
+
+-----------
+
+¤³¤Î¥á¡¼¥ë¤ÏXOOPS¤Î¼«Æ°ÄÌÃÎµ¡Ç½¤Ë¤è¤Ã¤ÆÁ÷¿®¤µ¤ì¤Æ¤¤¤Þ¤¹
+
+¼«Æ°ÄÌÃÎ¤òÄä»ß¤·¤¿¤¤¾ì¹ç¤Ï²¼µ­¤ÎURL¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡§
+{X_UNSUBSCRIBE_URL}
+
+-----------
+{X_SITENAME} ({X_SITEURL}) 
+´ÉÍý¿Í
+{X_ADMINMAIL}
Index: /temp/test-xoops.ec-cube.net/html/language/japanese/mail_template/lostpass2.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/language/japanese/mail_template/lostpass2.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/language/japanese/mail_template/lostpass2.tpl	(revision 405)
@@ -0,0 +1,13 @@
+{X_UNAME}¤µ¤ó¡¢¤³¤ó¤Ë¤Á¤Ï
+
+IP¥¢¥É¥ì¥¹{IP}¤Î¥æ¡¼¥¶¤«¤é¡¢{SITENAME}¤Ë¤ª¤±¤ë¥í¥°¥¤¥óÍÑ¥Ñ¥¹¥ï¡¼¥É¤Î¿·µ¬È¯¹Ô¥ê¥¯¥¨¥¹¥È¤¬¤¢¤ê¤Þ¤·¤¿¡£ °Ê²¼¤¬¤¢¤Ê¤¿¤Î¿·¤·¤¤¥í¥°¥¤¥ó¾ðÊó¤Ç¤¹¡£
+
+¥æ¡¼¥¶Ì¾¡§ {X_UNAME}
+¿·¥Ñ¥¹¥ï¡¼¥É¡§ {NEWPWD}
+
+¾åµ­¥Ñ¥¹¥ï¡¼¥É¤ò»ÈÍÑ¤·¤Æ{SITEURL}user.php¤«¤é¥í¥°¥¤¥ó¤·¡¢¤³¤Î¥Ñ¥¹¥ï¡¼¥É¤òÄ¾¤Á¤ËÊÑ¹¹¤¹¤ë¤³¤È¤ò¤ª´«¤á¤·¤Þ¤¹¡£
+
+-----------
+{SITENAME} ({SITEURL}) 
+webmaster
+{ADMINMAIL}
Index: /temp/test-xoops.ec-cube.net/html/language/japanese/mail_template/default_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/language/japanese/mail_template/default_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/language/japanese/mail_template/default_notify.tpl	(revision 405)
@@ -0,0 +1,18 @@
+{X_UNAME}¤µ¤ó¡¢¤³¤ó¤Ë¤Á¤Ï
+
+Åö¥µ¥¤¥È{X_NOTIFY_MODULE}¥â¥¸¥å¡¼¥ë¤Ë¤ª¤±¤ë{X_ITEM_TYPE} "{X_ITEM_TILE}"¤ËÂÐ¤·¤Æ{X_NOTIFY_EVENT}¤¬È¯À¸¤·¤Þ¤·¤¿¡£
+
+²¼µ­¤Î¥ê¥ó¥¯¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤È¤³¤Î¥³¥á¥ó¥È¡Ê{X_ITEM_TYPE}¡Ë¤ò¸«¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡§
+{X_ITEM_URL}
+
+-----------
+
+¤³¤Î¥á¡¼¥ë¤ÏXOOPS¤Î¼«Æ°ÄÌÃÎµ¡Ç½¤Ë¤è¤Ã¤ÆÁ÷¿®¤µ¤ì¤Æ¤¤¤Þ¤¹
+
+¼«Æ°ÄÌÃÎ¤òÄä»ß¤·¤¿¤¤¾ì¹ç¤Ï²¼µ­¤ÎURL¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡§
+{UNSUBSCRIBE_URL}
+
+-----------
+{X_SITENAME} ({X_SITEURL}) 
+´ÉÍý¿Í
+{X_ADMINMAIL}
Index: /temp/test-xoops.ec-cube.net/html/language/japanese/mail_template/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/language/japanese/mail_template/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/language/japanese/mail_template/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/language/japanese/admin.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/language/japanese/admin.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/language/japanese/admin.php	(revision 405)
@@ -0,0 +1,14 @@
+<?php
+//%%%%%%	File Name  admin.php 	%%%%%
+define('_AD_NORIGHT','¤³¤Î¥¨¥ê¥¢¤Ë¥¢¥¯¥»¥¹¤¹¤ë¸¢¸Â¤¬¤¢¤ê¤Þ¤»¤ó¡£');
+define('_AD_ACTION','');
+define('_AD_EDIT','ÊÔ½¸');
+define('_AD_DELETE','ºï½ü');
+define('_AD_LASTTENUSERS','ºÇ¶áÅÐÏ¿¤µ¤ì¤¿10¥æ¡¼¥¶');
+define('_AD_NICKNAME','¥æ¡¼¥¶Ì¾');
+define('_AD_EMAIL','¥á¡¼¥ë¥¢¥É¥ì¥¹');
+define('_AD_AVATAR','¥¢¥Ð¥¿¡¼');
+define('_AD_REGISTERED','ÅÐÏ¿Æü'); //Registered Date
+define('_AD_PRESSGEN', '¥¤¥ó¥¹¥È¡¼¥ë¸å½é¤á¤Æ´ÉÍý²èÌÌ¤ò³«¤­¤Þ¤¹¡£²¼¤Î¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤ÈÂ³¹Ô¤·¤Þ¤¹¡£');
+define('_AD_LOGINADMIN', '´ÉÍý²èÌÌ¤Ø¥í¥°¥¤¥óÃæ..');
+?>
Index: /temp/test-xoops.ec-cube.net/html/language/japanese/calendar.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/language/japanese/calendar.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/language/japanese/calendar.php	(revision 405)
@@ -0,0 +1,34 @@
+<?php
+// $Id: calendar.php,v 1.2 2005/03/18 13:00:58 onokazu Exp $
+//%%%%%		Time Zone	%%%%
+define("_CAL_SUNDAY", "ÆüÍËÆü");
+define("_CAL_MONDAY", "·îÍËÆü");
+define("_CAL_TUESDAY", "²ÐÍËÆü");
+define("_CAL_WEDNESDAY", "¿åÍËÆü");
+define("_CAL_THURSDAY", "ÌÚÍËÆü");
+define("_CAL_FRIDAY", "¶âÍËÆü");
+define("_CAL_SATURDAY", "ÅÚÍËÆü");
+define("_CAL_JANUARY", "1·î");
+define("_CAL_FEBRUARY", "2·î");
+define("_CAL_MARCH", "3·î");
+define("_CAL_APRIL", "4·î");
+define("_CAL_MAY", "5·î");
+define("_CAL_JUNE", "6·î");
+define("_CAL_JULY", "7·î");
+define("_CAL_AUGUST", "8·î");
+define("_CAL_SEPTEMBER", "9·î");
+define("_CAL_OCTOBER", "10·î");
+define("_CAL_NOVEMBER", "11·î");
+define("_CAL_DECEMBER", "12·î");
+define("_CAL_TGL1STD", "½µ½é¤á¤ÎÍËÆü¤òÀÚÂØ¤¨¤ë");
+define("_CAL_PREVYR", "Á°¤ÎÇ¯");
+define("_CAL_PREVMNTH", "Á°¤Î·î");
+define("_CAL_GOTODAY", "º£Æü¤ÎÆüÉÕ");
+define("_CAL_NXTMNTH", "¼¡¤Î·î");
+define("_CAL_NEXTYR", "¼¡¤ÎÇ¯");
+define("_CAL_SELDATE", "ÆüÉÕ¤òÁªÂò¤·¤Æ¤¯¤À¤µ¤¤");
+define("_CAL_DRAGMOVE", "¥É¥é¥Ã¥°¤·¤Æ°ÜÆ°");
+define("_CAL_TODAY", "º£Æü");
+define("_CAL_DISPM1ST", "·îÍËÆü¤«¤éÉ½¼¨");
+define("_CAL_DISPS1ST", "ÆüÍËÆü¤«¤éÉ½¼¨");
+?>
Index: /temp/test-xoops.ec-cube.net/html/language/japanese/timezone.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/language/japanese/timezone.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/language/japanese/timezone.php	(revision 405)
@@ -0,0 +1,34 @@
+<?php
+// $Id: timezone.php,v 1.2 2005/03/18 13:00:58 onokazu Exp $
+//%%%%%		Time Zone	%%%%
+define('_TZ_GMTM12', '(GMT-12:00) ¥¨¥Ë¥¦¥§¥È¥¯¡¢¥¯¥¨¥¸¥§¥ê¥ó');
+define('_TZ_GMTM11', '(GMT-11:00) ¥ß¥Ã¥É¥¦¥§¡¼Åç¡¢¥µ¥â¥¢');
+define('_TZ_GMTM10', '(GMT-10:00) ¥Ï¥ï¥¤');
+define('_TZ_GMTM9', '(GMT-9:00) ¥¢¥é¥¹¥«');
+define('_TZ_GMTM8', '(GMT-8:00) ÂÀÊ¿ÍÎÉ¸½à»þ¡ÊÊÆ¹ñ¤ª¤è¤Ó¥«¥Ê¥À¡Ë¡¢¥Æ¥£¥Õ¥¡¥Ê');
+define('_TZ_GMTM7', '(GMT-7:00) »³ÃÏÉ¸½à»þ¡ÊÊÆ¹ñ¤ª¤è¤Ó¥«¥Ê¥À¡Ë');
+define('_TZ_GMTM6', '(GMT-6:00) ÃæÉôÉ¸½à»þ¡ÊÊÆ¹ñ¤ª¤è¤Ó¥«¥Ê¥À¡Ë¡¢¥á¥­¥·¥³¥·¥Æ¥£');
+define('_TZ_GMTM5', '(GMT-5:00) ÅìÉôÉ¸½à»þ¡ÊÊÆ¹ñ¤ª¤è¤Ó¥«¥Ê¥À¡Ë¡¢¥Ü¥´¥¿¡¢¥ê¥Þ¡¢¥­¥È');
+define('_TZ_GMTM4', '(GMT-4:00) ÂçÀ¾ÍÎÉ¸½à»þ¡Ê¥«¥Ê¥À¡Ë¡¢¥«¥é¥«¥¹¡¢¥é¥Ñ¥¹');
+define('_TZ_GMTM35', '(GMT-3:30) ¥Ë¥å¡¼¥Õ¥¡¥ó¥É¥é¥ó¥É');
+define('_TZ_GMTM3', '(GMT-3:00) ¥Ö¥é¥¸¥ê¥¢¡¢¥Ö¥¨¥Î¥¹¥¢¥¤¥ì¥¹¡¢¥¸¥ç¡¼¥¸¥¿¥¦¥ó');
+define('_TZ_GMTM2', '(GMT-2:00) Ãæ±ûÂçÀ¾ÍÎ');
+define('_TZ_GMTM1', '(GMT-1:00) ¥¢¥¾¥ì¥¹½ôÅç¡¢¥«¡¼¥Ü¥Ù¥ë¥Ç½ôÅç');
+define('_TZ_GMT0', '(GMT) ¥°¥ê¥Ë¥Ã¥¸É¸½à»þ¡¢¥À¥Ö¥ê¥ó¡¢¥í¥ó¥É¥ó¡¢¥ê¥¹¥Ü¥ó¡¢¥¨¥¸¥ó¥Ð¥é');
+define('_TZ_GMTP1', '(GMT+1:00) ¥Ö¥ê¥å¥Ã¥»¥ë¡¢¥³¥Ú¥ó¥Ï¡¼¥²¥ó¡¢¥Þ¥É¥ê¥Ã¥É¡¢¥Ñ¥ê¡¢¥¢¥à¥¹¥Æ¥ë¥À¥à');
+define('_TZ_GMTP2', '(GMT+2:00) ¥¢¥Æ¥Í¡¢¥¤¥¹¥¿¥ó¥Ö¡¼¥ë¡¢¥¨¥ë¥µ¥ì¥à¡¢¥«¥¤¥í¡¢¥Ø¥ë¥·¥ó¥­');
+define('_TZ_GMTP3', '(GMT+3:00) ¥Ð¥°¥À¥Ã¥É¡¢¥Ê¥¤¥í¥Ó¡¢¥¯¥¦¥§¡¼¥È¡¢¥ê¥ä¥É¡¢¥â¥¹¥¯¥ï');
+define('_TZ_GMTP35', '(GMT+3:30) ¥Æ¥Ø¥é¥ó');
+define('_TZ_GMTP4', '(GMT+4:00) ¥¢¥Ö¥À¥Ó¡¢¥Þ¥¹¥«¥Ã¥È¡¢¥Ð¥¯¡¢¥È¥Ó¥ê¥·');
+define('_TZ_GMTP45', '(GMT+4:30) ¥«¥Ö¡¼¥ë');
+define('_TZ_GMTP5', '(GMT+5:00) ¥¤¥¹¥é¥Þ¥Ð¡¼¥É¡¢¥«¥é¥Á¡¢¥¿¥·¥±¥ó¥È¡¢¥¨¥«¥Æ¥ê¥ó¥Ð¡¼¥°');
+define('_TZ_GMTP55', '(GMT+5:30) ¥«¥ë¥«¥Ã¥¿¡¢¥Á¥§¥ó¥Ê¥¤¡¢¥à¥ó¥Ð¥¤¡¢¥Ë¥å¡¼¥Ç¥ê¡¼');
+define('_TZ_GMTP6', '(GMT+6:00) ¥À¥Ã¥«¡¢¥¢¥ë¥Þ¥Æ¥£¡¢¥¹¥ê¡¦¥¸¥ã¥ä¥ï¥ë¥À¥Ê¥×¥é');
+define('_TZ_GMTP7', '(GMT+7:00) ¥Ð¥ó¥³¥¯¡¢¥Ï¥Î¥¤¡¢¥¸¥ã¥«¥ë¥¿');
+define('_TZ_GMTP8', '(GMT+8:00) ¥·¥ó¥¬¥Ý¡¼¥ë¡¢¥Ñ¡¼¥¹¡¢ÂæËÌ¡¢ËÌµþ¡¢½Å·Ä¡¢¹á¹Á¡¢¥¦¥ë¥à¥Á');
+define('_TZ_GMTP9', '(GMT+9:00) Åìµþ¡¢Âçºå¡¢»¥ËÚ¡¢¥½¥¦¥ë¡¢¥ä¥¯¡¼¥Ä¥¯');
+define('_TZ_GMTP95', '(GMT+9:30) ¥¢¥Ç¥ì¡¼¥É¡¢¥À¡¼¥¦¥£¥ó');
+define('_TZ_GMTP10', '(GMT+10:00) ¥¦¥é¥¸¥ª¥¹¥È¥¯¡¢¥­¥ã¥ó¥Ù¥é¡¢¥á¥ë¥Ü¥ë¥ó¡¢¥·¥É¥Ë¡¼¡¢¥°¥¢¥à');
+define('_TZ_GMTP11', '(GMT+11:00) ¥Þ¥¬¥À¥ó¡¢¥½¥í¥â¥ó½ôÅç¡¢¥Ë¥å¡¼¥«¥ì¥É¥Ë¥¢');
+define('_TZ_GMTP12', '(GMT+12:00) ¥ª¡¼¥¯¥é¥ó¥É¡¢¥¦¥§¥ê¥ó¥È¥ó¡¢¥Õ¥£¥¸¡¼¡¢¥«¥à¥Á¥ã¥Ã¥«');
+?>
Index: /temp/test-xoops.ec-cube.net/html/language/japanese/misc.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/language/japanese/misc.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/language/japanese/misc.php	(revision 405)
@@ -0,0 +1,22 @@
+<?php
+// $Id: misc.php,v 1.2 2005/03/18 13:00:58 onokazu Exp $
+define('_MSC_YOURNAMEC','¤¢¤Ê¤¿¤ÎÌ¾Á°¡§ ');
+define('_MSC_YOUREMAILC','¤¢¤Ê¤¿¤ÎEmail¡§ ');
+define('_MSC_FRIENDNAMEC','Í§Ã£¤ÎÌ¾Á°¡§ ');
+define('_MSC_FRIENDEMAILC','Í§Ã£¤ÎEmail¡§ ');
+define('_MSC_RECOMMENDSITE','Åö¥µ¥¤¥È¤òÍ§Ã£¤ËÁ¦¤á¤ë');
+// %s is your site name
+define('_MSC_INTSITE','¤ªÁ¦¤á¥µ¥¤¥È¡§ %s');
+define('_MSC_REFERENCESENT','Åö¥µ¥¤¥È¤ò¾Ò²ð¤¹¤ë¥á¡¼¥ë¤ò¤¢¤Ê¤¿¤Î¤ªÍ§Ã£¤ËÁ÷¿®¤·¤Þ¤·¤¿¡£');
+define('_MSC_ENTERYNAME','¤¢¤Ê¤¿¤ÎÌ¾Á°¤òÆþÎÏ¤·¤Æ¤¯¤À¤µ¤¤¡£');
+define('_MSC_ENTERFNAME','¤ªÍ§Ã£¤ÎÌ¾Á°¤òÆþÎÏ¤·¤Æ¤¯¤À¤µ¤¤¡£');
+define('_MSC_ENTERFMAIL','¤ªÍ§Ã£¤Î¥á¡¼¥ë¥¢¥É¥ì¥¹¤òÆþÎÏ¤·¤Æ¤¯¤À¤µ¤¤¡£');
+define('_MSC_NEEDINFO','É¬Í×¤Ê¥Ç¡¼¥¿¤¬¤¹¤Ù¤ÆÆþÎÏ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£');
+define('_MSC_INVALIDEMAIL1','ÉÔÀµ¤Ê¥á¡¼¥ë¥¢¥É¥ì¥¹¤Ç¤¹¡£');
+define('_MSC_INVALIDEMAIL2','¥á¡¼¥ë¥¢¥É¥ì¥¹¤¬Àµ¤·¤¤¤«¤É¤¦¤«³ÎÇ§¤·¤Æ¤¯¤À¤µ¤¤¡£');
+define('_MSC_AVAVATARS','¥¢¥Ð¥¿¡¼°ìÍ÷');
+define('_MSC_SMILIES','´é¥¢¥¤¥³¥ó');
+define('_MSC_CLICKASMILIE','²èÁü¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤È´é¥¢¥¤¥³¥ó(¥¹¥Þ¥¤¥ê¡¼)¤òËÜÊ¸¤ËÄÉ²Ã¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£');
+define('_MSC_CODE','´éÊ¸»ú');
+define('_MSC_EMOTION','°ÕÌ£');
+?>
Index: /temp/test-xoops.ec-cube.net/html/language/japanese/xoopsmailerlocal.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/language/japanese/xoopsmailerlocal.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/language/japanese/xoopsmailerlocal.php	(revision 405)
@@ -0,0 +1,186 @@
+<?php
+// $Id: xoopsmailerlocal.php,v 1.3 2006/07/27 00:17:18 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: NobuNobu (Nobuki@Kowa.ORG)                                        //
+// URL:  http://jp.xoops.org                                                 //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+class XoopsMailerLocal extends XoopsMailer {
+
+    function XoopsMailerLocal(){
+        $this->multimailer = new XoopsMultiMailerLocal();
+        $this->reset();
+        $this->charSet = 'iso-2022-jp';
+        $this->encoding = '7bit';
+		$this->multimailer->CharSet = $this->charSet;
+    }
+
+    function encodeFromName($text){
+        return $this->STRtoJIS($text,_CHARSET);
+    }
+
+    function encodeSubject($text){
+        if ($this->multimailer->needs_encode) {
+            return $this->STRtoJIS($text,_CHARSET);
+        } else {
+            return $text;
+        }
+    }
+
+    function encodeBody(&$text){
+        if ($this->multimailer->needs_encode) {
+            $text = $this->STRtoJIS($text,_CHARSET);
+        }
+    }
+
+    /*-------------------------------------
+     PHP FORM MAIL 1.01 by TOMO
+     URL : http://www.spencernetwork.org/
+     E-Mail : groove@spencernetwork.org
+    --------------------------------------*/
+    function STRtoJIS($str, $from_charset){
+        if (function_exists('mb_convert_encoding')) { //Use mb_string extension if exists.
+            $str_JIS  = mb_convert_encoding($str, "ISO-2022-JP", $from_charset);
+        } else if ($from_charset=='EUC-JP') {
+            $str_JIS = '';
+            $mode = 0;
+            $b = unpack("C*", $str);
+            $n = count($b);
+            for ($i = 1; $i <= $n; $i++) {
+                if ($b[$i] == 0x8E) {
+                    if ($mode != 2) {
+                        $mode = 2;
+                        $str_JIS .= pack("CCC", 0x1B, 0x28, 0x49);
+                    }
+                    $b[$i+1] -= 0x80;
+                    $str_JIS .= pack("C", $b[$i+1]);
+                    $i++;
+                } elseif ($b[$i] > 0x8E) {
+                    if ($mode != 1){
+                        $mode = 1;
+                        $str_JIS .= pack("CCC", 0x1B, 0x24, 0x42);
+                    }
+                    $b[$i] -= 0x80; $b[$i+1] -= 0x80;
+                    $str_JIS .= pack("CC", $b[$i], $b[$i+1]);
+                    $i++;
+                } else {
+                    if ($mode != 0) {
+                        $mode = 0;
+                        $str_JIS .= pack("CCC", 0x1B, 0x28, 0x42);
+                    }
+                    $str_JIS .= pack("C", $b[$i]);
+                }
+            }
+            if ($mode != 0) $str_JIS .= pack("CCC", 0x1B, 0x28, 0x42);
+        }
+        return $str_JIS;
+    }
+}
+
+class XoopsMultiMailerLocal extends XoopsMultiMailer {
+
+    var $needs_encode;
+
+    function XoopsMultiMailerLocal() {
+        $this->XoopsMultiMailer();
+        
+        $this->needs_encode = true;
+        if (function_exists('mb_convert_encoding')) {
+            $mb_overload = ini_get('mbstring.func_overload');
+            if (($this->Mailer == 'mail') && (intval($mb_overload) & 1)) { //check if mbstring extension overloads mail()
+                $this->needs_encode = false;
+            }
+        }
+    }
+
+    function AddrFormat($addr) {
+        if(empty($addr[1])) {
+            $formatted = $addr[0];
+        } else {
+            $formatted = $this->EncodeHeader($addr[1], 'text') . " <" . 
+                         $addr[0] . ">";
+        }
+        return $formatted;
+    }
+
+    function EncodeHeader ($str, $position = 'text', $force=false) {
+        if (!preg_match('/^4\.4\.[01]([^0-9]+|$)/',PHP_VERSION)) {
+            if (function_exists('mb_convert_encoding')) { //Use mb_string extension if exists.
+                if ($this->needs_encode || $force) {
+                    $encoded = mb_convert_encoding($str, _CHARSET, mb_detect_encoding($str));
+                    $encoded = mb_encode_mimeheader($encoded, "ISO-2022-JP", "B", "\n");
+                } else {
+                    $encoded = $str;
+                }
+            } else {
+                $encoded = parent::EncodeHeader($str, $position);
+            }
+            return $encoded;
+        } else {
+            //Following Logic are made for recovering PHP4.4.0 and 4.4.1 mb_encode_mimeheader() bug.
+            //TODO: If mb_encode_mimeheader() bug is fixed. Replace this to simple logic.
+            $encode_charset = strtoupper($this->CharSet);
+            if (function_exists('mb_convert_encoding')) { //Using mb_string extension if exists.
+                if ($this->needs_encode || $force) {
+                	$str_encoding = mb_detect_encoding($str, 'ASCII,'.$encode_charset );
+                    if ($str_encoding == 'ASCII') { // Return original if string from only ASCII chars.
+                        return $str;
+                    } else if ($str_encoding != $encode_charset) { // Maybe this case may not occur.
+                        $str = mb_convert_encoding($str, $encode_charset, $str_encoding);
+                    }
+                    $cut_start = 0;
+                    $encoded ='';
+                    $cut_length = floor((76-strlen('Subject: =?'.$encode_charset.'?B?'.'?='))/4)*3;
+                    while($cut_start < strlen($str)) {
+                        $partstr = mb_strcut ( $str, $cut_start, $cut_length, $encode_charset);
+                        $partstr_length = strlen($partstr);
+                        if (!$partstr_length) break;
+                        if ($encode_charset == 'ISO-2022-JP') { 
+                            //Should Adjust next cutting place for SO & SI char insertion.
+                            if ((substr($partstr, 0, 3)===chr(27).'$B') 
+                              && (substr($str, $cut_start, 3) !== chr(27).'$B')) {
+                                $partstr_length -= 3;
+                            }
+                            if ((substr($partstr,-3)===chr(27).'(B') 
+                              && (substr($str, $cut_start+$partstr_length-3, 3) !== chr(27).'(B')) {
+                                $partstr_length -= 3;
+                            }
+                        }
+                        if ($cut_start) $encoded .= "\r\n\t";
+                        $encoded .= '=?' . $encode_charset . '?B?' . base64_encode($partstr) . '?=';
+                        $cut_start += $partstr_length;
+                    }
+                } else {
+                    $encoded = $str;
+                }
+            } else {
+                $encoded = parent::EncodeHeader($str, $position);
+            }
+            return $encoded;
+        }
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/language/japanese/user.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/language/japanese/user.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/language/japanese/user.php	(revision 405)
@@ -0,0 +1,133 @@
+<?php
+//%%%%%%		File Name user.php 		%%%%%
+define('_US_NOTREGISTERED','º£¤¹¤°<a href="register.php">ÅÐÏ¿</a>¤·¤Þ¤»¤ó¤«¡©');
+define('_US_LOSTPASSWORD','¥Ñ¥¹¥ï¡¼¥É¤òÊ¶¼º¤µ¤ì¤Þ¤·¤¿¤«¡©');
+define('_US_NOPROBLEM','¤´¿´ÇÛ¤Ê¤¯¡£¤Þ¤º¤Ï¤¢¤Ê¤¿¤¬ÅÐÏ¿¤Ë»ÈÍÑ¤·¤¿¥á¡¼¥ë¥¢¥É¥ì¥¹¤òÆþÎÏ¤·¡¢¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤Æ¤¯¤À¤µ¤¤¡£ ¥Ñ¥¹¥ï¡¼¥É¼èÆÀÍÑ¤Î¥ê¥ó¥¯¤¬µ­ºÜ¤µ¤ì¤¿¥á¡¼¥ë¤¬¤¢¤Ê¤¿¤ÎÅÐÏ¿¥á¡¼¥ë¥¢¥É¥ì¥¹°¸¤ËÁ÷¤é¤ì¤Þ¤¹¡£');
+define('_US_YOUREMAIL','ÅÐÏ¿¥á¡¼¥ë¥¢¥É¥ì¥¹¡§');
+define('_US_SENDPASSWORD','Á÷¿®');
+define('_US_LOGGEDOUT','¥í¥°¥¢¥¦¥È¤·¤Þ¤·¤¿¡£');
+define('_US_THANKYOUFORVISIT','Åö¥µ¥¤¥È¤ò¤´ÍøÍÑ¤¤¤¿¤À¤­¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£');
+define('_US_INCORRECTLOGIN','¥í¥°¥¤¥ó¾ðÊó¤¬´Ö°ã¤Ã¤Æ¤¤¤Þ¤¹¡£');
+define('_US_LOGGINGU','%s¤µ¤ó¡¢¤è¤¦¤³¤½¡£¥í¥°¥¤¥ó½èÍýÃæ¤Ç¤¹¡£');
+
+// 2001-11-17 ADD
+define('_US_NOACTTPADM','ÁªÂò¤µ¤ì¤¿¥æ¡¼¥¶¤Ï¤Þ¤ÀÂ¸ºß¤·¤Ê¤¤¤«¡¢¾µÇ§¤¬´°Î»¤·¤Æ¤¤¤Þ¤»¤ó¡£<br />¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï¥µ¥¤¥È´ÉÍý¼Ô¤Ë¤ªÌä¹ç¤»¤¯¤À¤µ¤¤¡£');
+define('_US_ACTKEYNOT','¾µÇ§¥­¡¼¤¬´Ö°ã¤Ã¤Æ¤¤¤Þ¤¹¡£');
+define('_US_ACONTACT','ÁªÂò¤µ¤ì¤¿¥¢¥«¥¦¥ó¥È¤Ï´û¤Ë¾µÇ§¤¬´°Î»¤·¤Æ¤¤¤Þ¤¹¡£');
+define('_US_ACTLOGIN','¥¢¥«¥¦¥ó¥È¤ò¾µÇ§¤·¤Þ¤·¤¿¡£ÅÐÏ¿¤ÎºÝ¤Ëµ­Æþ¤·¤¿¥Ñ¥¹¥ï¡¼¥É¤ò»ÈÍÑ¤·¤Æ¥í¥°¥¤¥ó¤·¤Æ¤¯¤À¤µ¤¤¡£');
+define('_US_NOPERMISS','¤³¤Î¥æ¡¼¥¶¾ðÊó¤òÊÑ¹¹¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£');
+define('_US_SURETODEL','¥æ¡¼¥¶¥¢¥«¥¦¥ó¥È¤òËÜÅö¤Ëºï½ü¤·¤Æ¤âÎÉ¤¤¤Ç¤¹¤«¡©');
+define('_US_REMOVEINFO','¥¢¥«¥¦¥ó¥È¤òºï½ü¤·¤¿¾ì¹ç¡¢Á´¤Æ¤Î¥æ¡¼¥¶¾ðÊó¤¬¼º¤ï¤ì¤Þ¤¹¡£');
+define('_US_BEENDELED','¥¢¥«¥¦¥ó¥È¤òºï½ü¤·¤Þ¤·¤¿¡£');
+//
+
+//%%%%%%		File Name register.php 		%%%%%
+define('_US_USERREG','¥æ¡¼¥¶ÅÐÏ¿');
+define('_US_NICKNAME','¥æ¡¼¥¶Ì¾');
+define('_US_EMAIL','¥á¡¼¥ë¥¢¥É¥ì¥¹');
+define('_US_ALLOWVIEWEMAIL','¤³¤Î¥á¡¼¥ë¥¢¥É¥ì¥¹¤ò¸ø³«¤¹¤ë');
+define('_US_WEBSITE','¥Û¡¼¥à¥Ú¡¼¥¸');
+define('_US_TIMEZONE','¥¿¥¤¥à¥¾¡¼¥ó');
+define('_US_AVATAR','¥¢¥Ð¥¿¡¼');
+define('_US_VERIFYPASS','¥Ñ¥¹¥ï¡¼¥É³ÎÇ§');
+define('_US_SUBMIT','Á÷¿®');
+define('_US_USERNAME','¥æ¡¼¥¶Ì¾');
+define('_US_FINISH','Á÷¿®');
+define('_US_REGISTERNG','ÅÐÏ¿¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿');
+define('_US_MAILOK','Åö¥µ¥¤¥È¤Î¿·Ãå¾ðÊó¤Ê¤É¤ò<br />¥á¡¼¥ë¤Ç¼õ¤±¼è¤ë');
+
+define('_US_INVALIDMAIL','ÉÔÀµ¤Ê¥á¡¼¥ë¥¢¥É¥ì¥¹¤Ç¤¹¡£');
+define('_US_EMAILNOSPACES','¥á¡¼¥ë¥¢¥É¥ì¥¹¤Ë¶õÇò¤ò´Þ¤á¤Ê¤¤¤Ç¤¯¤À¤µ¤¤¡£');
+define('_US_INVALIDNICKNAME','ÉÔÀµ¤Ê¥æ¡¼¥¶Ì¾¤Ç¤¹¡£');
+define('_US_NICKNAMETOOLONG','¥æ¡¼¥¶Ì¾¤¬Ä¹¤¹¤®¤Þ¤¹¡£È¾³Ñ %s Ê¸»ú°ÊÆâ¤Ë¼ý¤á¤Æ¤¯¤À¤µ¤¤¡£');
+define('_US_NICKNAMETOOSHORT','¥æ¡¼¥¶Ì¾¤¬Ã»¤¹¤®¤Þ¤¹¡£È¾³Ñ %s Ê¸»ú°Ê¾å¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£');
+define('_US_NAMERESERVED','¤³¤Î¥æ¡¼¥¶Ì¾¤Ï»ÈÍÑ¤Ç¤­¤Þ¤»¤ó¡£');
+define('_US_NICKNAMENOSPACES','¥æ¡¼¥¶Ì¾¤Ë¶õÇò¤ò´Þ¤á¤Ê¤¤¤Ç¤¯¤À¤µ¤¤¡£');
+define('_US_NICKNAMETAKEN','¤³¤Î¥æ¡¼¥¶Ì¾¤Ï´û¤Ë»ÈÍÑ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£');
+define('_US_EMAILTAKEN','¤³¤Î¥á¡¼¥ë¥¢¥É¥ì¥¹¤Ï´û¤Ë»ÈÍÑ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£');
+define('_US_ENTERPWD','¥Ñ¥¹¥ï¡¼¥É¤òµ­Æþ¤·¤Æ¤¯¤À¤µ¤¤¡£');
+define('_US_SORRYNOTFOUND','¥æ¡¼¥¶¾ðÊó¤¬¸«¤Ä¤«¤ê¤Þ¤»¤ó¤Ç¤·¤¿¡£');
+
+define('_US_DISCLAIMER','ÌÈÀÕ');
+define('_US_IAGREE','»ä¤Ï¾åµ­»ö¹à¤ËÆ±°Õ¤·¤Þ¤¹¡£');
+define('_US_UNEEDAGREE', '¿½¤·Ìõ¤´¤¶¤¤¤Þ¤»¤ó¤¬¡¢ÅÐÏ¿¤¹¤ë¤¿¤á¤Ë¤ÏÌÈÀÕ»ö¹à¤Ë¤´Æ±°Õ¤¤¤¿¤À¤¯É¬Í×¤¬¤¢¤ê¤Þ¤¹¡£');
+define('_US_NOREGISTER','¿½¤·Ìõ¤´¤¶¤¤¤Þ¤»¤ó¤¬¡¢¸½ºß¤³¤Î¥µ¥¤¥È¤Ç¤Ï¿·µ¬¥æ¡¼¥¶¤ÎÅÐÏ¿¼õÉÕ¤ò¹Ô¤Ã¤Æ¤ª¤ê¤Þ¤»¤ó¡£');
+
+// %s is username. This is a subject for email
+define('_US_USERKEYFOR','%s¤µ¤ó¤Î¾µÇ§¥­¡¼¤Ç¤¹');
+
+define('_US_YOURREGISTERED','ÅÐÏ¿¤¬´°Î»¤·¤Þ¤·¤¿¡£µ­ºÜ¤µ¤ì¤¿¥á¡¼¥ë¤òÅÐÏ¿¥á¡¼¥ë¥¢¥É¥ì¥¹°¸¤Ë¾µÇ§¥­¡¼¤òÁ÷¿®¤·¤Þ¤·¤¿¡£¥á¡¼¥ë¤Î»Ø¼¨¤Ë½¾¤¤¡¢¾µÇ§¤ò´°Î»¤·¤Æ¤¯¤À¤µ¤¤¡£');
+define('_US_YOURREGMAILNG','ÅÐÏ¿¤¬´°Î»¤·¤Þ¤·¤¿¡£¤·¤«¤·¡¢¥µ¡¼¥ÐÆâÉô¥¨¥é¡¼¤Ë¤è¤ê¾µÇ§¥­¡¼¤¬µ­ºÜ¤µ¤ì¤¿¥á¡¼¥ë¤òÁ÷¿®¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£ÂçÊÑ¿½¤·Ìõ¤¢¤ê¤Þ¤»¤ó¤¬¡¢¥µ¥¤¥È´ÉÍý¼Ô¤Þ¤Ç¤ªÌä¤¤¹ç¤ï¤»¤¯¤À¤µ¤¤¡£');
+define('_US_YOURREGISTERED2','ÅÐÏ¿¤¬´°Î»¤·¤Þ¤·¤¿¡£¥µ¥¤¥È´ÉÍý¼Ô¤¬¥¢¥«¥¦¥ó¥È¤ò¾µÇ§¤¹¤ë¤Þ¤Ç¤ªÂÔ¤Á¤¯¤À¤µ¤¤¡£¾µÇ§´°Î»»þ¤Ë¤Ï¥á¡¼¥ë¤Ë¤Æ¤ªÃÎ¤é¤»¤·¤Þ¤¹¡£');
+
+// %s is your site name
+define('_US_NEWUSERREGAT','¿·µ¬ÅÐÏ¿¥æ¡¼¥¶¡÷%s');
+// %s is a username
+define('_US_HASJUSTREG','¿·µ¬ÅÐÏ¿¥æ¡¼¥¶¤¬¤¢¤ê¤Þ¤·¤¿¡ª¡¡¥æ¡¼¥¶Ì¾¡§%s');
+
+// %s is your site name
+define('_US_NEWPWDREQ','¿·µ¬¥Ñ¥¹¥ï¡¼¥É¤Î¥ê¥¯¥¨¥¹¥È¡÷%s');
+define('_US_YOURACCOUNT', '%s¤Ç¤Î¥æ¡¼¥¶¥¢¥«¥¦¥ó¥È');
+
+define('_US_MAILPWDNG','mail_password: ¥æ¡¼¥¶¾ðÊó¤Î¹¹¿·¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£¤ª¼ê¿ô¤Ç¤¹¤¬¡¢¥µ¥¤¥È´ÉÍý¼Ô¤Þ¤Ç¤ªÌä¹ç¤»¤¯¤À¤µ¤¤¡£');
+
+// %s is a username
+define('_US_PWDMAILED','%s¤µ¤ó°¸¤Ë¥Ñ¥¹¥ï¡¼¥É¤òÁ÷¿®¤·¤Þ¤·¤¿¡£');
+define('_US_CONFMAIL','¥Ñ¥¹¥ï¡¼¥É¼èÆÀÍÑ¥ê¥ó¥¯¤¬µ­ºÜ¤µ¤ì¤¿¥á¡¼¥ë¤ò%s¤µ¤ó°¸¤ËÁ÷¿®¤·¤Þ¤·¤¿¡£');
+define('_US_ACTVMAILNG', '%s¤µ¤ó¤Ø¤Î¥á¡¼¥ëÁ÷¿®¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£');
+define('_US_ACTVMAILOK', '%s¤µ¤ó¤Ø¥á¡¼¥ë¤òÁ÷¿®¤·¤Þ¤·¤¿¡£');
+
+//%%%%%%		File Name userinfo.php 		%%%%%
+define('_US_SELECTNG','¥æ¡¼¥¶¤¬ÁªÂò¤µ¤ì¤Æ¤¤¤Þ¤»¤ó');
+define('_US_PM','PM');
+define('_US_ICQ','ICQ');
+define('_US_AIM','AIM');
+define('_US_YIM','YIM');
+define('_US_MSNM','MSNM');
+define('_US_LOCATION','µï½»ÃÏ');
+define('_US_OCCUPATION','¿¦¶È');
+define('_US_INTEREST','¼ñÌ£');
+define('_US_SIGNATURE','½ðÌ¾');
+define('_US_EXTRAINFO','¤½¤ÎÂ¾');
+define('_US_EDITPROFILE','¥×¥í¥Õ¥£¡¼¥ë¤ÎÊÔ½¸');
+define('_US_LOGOUT','¥í¥°¥¢¥¦¥È');
+define('_US_INBOX','¼õ¿®È¢');
+define('_US_MEMBERSINCE','ÅÐÏ¿Æü');
+define('_US_RANK','¥é¥ó¥¯');
+define('_US_POSTS','Åê¹Æ¿ô');
+define('_US_LASTLOGIN','ºÇ½ª¥í¥°¥¤¥óÆü»þ');
+define('_US_ALLABOUT','%s¤µ¤ó¤Î´ðËÜ¾ðÊó');
+define('_US_STATISTICS','Åý·×¾ðÊó');
+define('_US_MYINFO','¸Ä¿Í¾ðÊó');//My Info');
+define('_US_BASICINFO','´ðËÜ¾ðÊó');
+define('_US_MOREABOUT','¸Ä¿Í¾ðÊó¾ÜºÙ');//More About Me');
+define('_US_SHOWALL','¤¹¤Ù¤ÆÉ½¼¨');
+
+
+//%%%%%%		File Name edituser.php 		%%%%%
+define('_US_PROFILE','¥×¥í¥Õ¥£¡¼¥ë');
+define('_US_REALNAME','ËÜÌ¾');
+define('_US_SHOWSIG','Åê¹Æ¤Ë½ðÌ¾¤òÉ¬¤ºÄÉ²Ã¤¹¤ë');
+define('_US_CDISPLAYMODE','¥³¥á¥ó¥ÈÉ½¼¨¥â¡¼¥É');
+define('_US_CSORTORDER','¥³¥á¥ó¥È¤ÎÊÂ¤Ó½ç');
+define('_US_PASSWORD','¥Ñ¥¹¥ï¡¼¥É');
+define('_US_TYPEPASSTWICE','¡Ê¥Ñ¥¹¥ï¡¼¥É¤òÊÑ¹¹¤¹¤ë¾ì¹ç¤Î¤ßµ­Æþ¤·¤Æ¤¯¤À¤µ¤¤¡Ë');
+define('_US_SAVECHANGES','ÊÑ¹¹¤òÊÝÂ¸');
+define('_US_NOEDITRIGHT','¤³¤Î¥æ¡¼¥¶¾ðÊó¤òÊÑ¹¹¤¹¤ë¸¢¸Â¤¬¤¢¤ê¤Þ¤»¤ó¡£');
+define('_US_PASSNOTSAME','¥Ñ¥¹¥ï¡¼¥É¤¬Àµ¤·¤¯¤¢¤ê¤Þ¤»¤ó¡£Æ±¤¸¥Ñ¥¹¥ï¡¼¥É¤òÆóÅÙÆþÎÏ¤·¤Æ¤¯¤À¤µ¤¤¡£');
+define('_US_PWDTOOSHORT','¥Ñ¥¹¥ï¡¼¥É¤ÏÈ¾³Ñ<b>%s</b>Ê¸»ú°Ê¾å¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£');
+define('_US_PROFUPDATED','¥×¥í¥Õ¥£¡¼¥ë¤ò¹¹¿·¤·¤Þ¤·¤¿¡£');
+define('_US_USECOOKIE','¥æ¡¼¥¶Ì¾¤ò£±Ç¯´Ö¥¯¥Ã¥­¡¼¤ËÊÝÂ¸¤¹¤ë');
+define('_US_NO','¤¤¤¤¤¨');
+define('_US_DELACCOUNT','¥¢¥«¥¦¥ó¥È¤òºï½ü¤¹¤ë');
+define('_US_MYAVATAR', '¥¢¥Ã¥×¥í¡¼¥ÉºÑ¤ß¥¢¥Ð¥¿¡¼');
+define('_US_UPLOADMYAVATAR', '¥¢¥Ð¥¿¡¼¤ò¥¢¥Ã¥×¥í¡¼¥É¤¹¤ë');
+define('_US_MAXPIXEL','ºÇÂç¥Ô¥¯¥»¥ë¿ô');
+define('_US_MAXIMGSZ','ºÇÂç¥Õ¥¡¥¤¥ë¥µ¥¤¥º');
+define('_US_SELFILE','¥Õ¥¡¥¤¥ëÁªÂò');
+define('_US_OLDDELETED','¸Å¤¤¥¢¥Ð¥¿¡¼²èÁü¤Ï¾å½ñ¤­¤µ¤ì¤Þ¤¹¡£');
+define('_US_CHOOSEAVT', '¥¢¥Ð¥¿¡¼¤ò°ìÍ÷¤«¤éÁªÂò¤·¤Æ¤¯¤À¤µ¤¤¡£');
+define('_US_PRESSLOGIN', '²¼µ­¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤Æ¥í¥°¥¤¥ó¤·¤Æ¤¯¤À¤µ¤¤¡£');
+define('_US_ADMINNO', '´ÉÍý¼Ô¥°¥ë¡¼¥×¤ËÂ°¤¹¤ë¥æ¡¼¥¶¤Ïºï½ü¤Ç¤­¤Þ¤»¤ó');
+define('_US_GROUPS', '½êÂ°¥°¥ë¡¼¥×');
+?>
Index: /temp/test-xoops.ec-cube.net/html/language/japanese/global.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/language/japanese/global.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/language/japanese/global.php	(revision 405)
@@ -0,0 +1,184 @@
+<?php
+
+//%%%%%%	File Name mainfile.php 	%%%%%
+define('_PLEASEWAIT','¤·¤Ð¤é¤¯¤ªÂÔ¤Á¤¯¤À¤µ¤¤');
+define('_FETCHING','Loading...');
+define('_TAKINGBACK','¸µ¤Î¾ì½ê¤Ø¤ÈÌá¤ê¤Þ¤¹....');
+define('_LOGOUT','¥í¥°¥¢¥¦¥È');
+define('_SUBJECT','É½Âê');
+define('_MESSAGEICON','¥¢¥¤¥³¥ó');
+define('_COMMENTS','¥³¥á¥ó¥È');
+define('_POSTANON','Æ¿Ì¾¤ÇÅê¹Æ');
+define('_DISABLESMILEY','´é¥¢¥¤¥³¥ó¤òÌµ¸ú');
+define('_DISABLEHTML','HTML¥¿¥°¤òÌµ¸ú');
+define('_PREVIEW','¥×¥ì¥Ó¥å¡¼');
+
+define('_GO','Á÷¿®');
+define('_NESTED','¥Í¥¹¥ÈÉ½¼¨');
+define('_NOCOMMENTS','¥³¥á¥ó¥ÈÈóÉ½¼¨');
+define('_FLAT','¥Õ¥é¥Ã¥ÈÉ½¼¨');
+define('_THREADED','¥¹¥ì¥Ã¥ÉÉ½¼¨');
+define('_OLDESTFIRST','¸Å¤¤¤â¤Î¤«¤é');
+define('_NEWESTFIRST','¿·¤·¤¤¤â¤Î¤«¤é');
+define('_MORE','¤â¤Ã¤È...');
+define("_MULTIPAGE","<span style='color:red;'>[pagebreak]</span>¥¿¥°¤òËÜÊ¸Æâ¤Ëµ­Æþ¤¹¤ë¤³¤È¤Ç¥Ú¡¼¥¸¶èÀÚ¤ê¤òÁÞÆþ¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£");
+define('_IFNOTRELOAD','¥Ú¡¼¥¸¤¬¼«Æ°Åª¤Ë¹¹¿·¤µ¤ì¤Ê¤¤¾ì¹ç¤Ï<a href="%s">¤³¤³</a>¤ò¥¯¥ê¥Ã¥¯¤·¤Æ¤¯¤À¤µ¤¤');
+define('_WARNINSTALL2','Ãí°Õ¡§¥Õ¥¡¥¤¥ë%s¤¬¥µ¡¼¥Ð¾å¤ËÂ¸ºß¤·¤Þ¤¹¡£¥¤¥ó¥¹¥È¡¼¥ë´°Î»¸å¤ÏÉ¬¤ººï½ü¤·¤Æ¤¯¤À¤µ¤¤¡£');
+define('_WARNINWRITEABLE','Ãí°Õ¡§¥Õ¥¡¥¤¥ë%s¤Ø¤Î½ñ¤­¹þ¤ß¤¬²ÄÇ½¤È¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£¤³¤Î¥Õ¥¡¥¤¥ë¤Î¥Ñ¡¼¥ß¥Ã¥·¥ç¥óÀßÄê¤òÊÑ¹¹¤·¤Æ¤¯¤À¤µ¤¤¡£');
+
+//%%%%%%	File Name themeuserpost.php 	%%%%%
+define('_POSTEDBY','Åê¹Æ¼Ô¡§'); // Posted date
+define('_PROFILE','¥×¥í¥Õ¥£¡¼¥ë');
+define('_VISITWEBSITE','¥Û¡¼¥à¥Ú¡¼¥¸');
+define('_SENDPMTO','%s¤µ¤ó¤Ë¥×¥é¥¤¥Ù¡¼¥È¥á¥Ã¥»¡¼¥¸¤òÁ÷¤ë¡£');
+define('_SENDEMAILTO','%s¤µ¤ó¤Ë¥á¡¼¥ë¤òÁ÷¤ë¡£');
+define('_ADD','ÄÉ²Ã');
+define('_REPLY','ÊÖ¿®');
+define('_DATE','Åê¹ÆÆü»þ¡§');
+
+//%%%%%%	File Name admin_functions.php 	%%%%%
+define('_MAIN','¥È¥Ã¥×');
+define('_MANUAL','¥Þ¥Ë¥å¥¢¥ë');
+define('_INFO','¥Ð¡¼¥¸¥ç¥ó¾ðÊó');
+define('_CPHOME','´ÉÍý¥á¥Ë¥å¡¼');
+define('_YOURHOME','¥Û¡¼¥à¥Ú¡¼¥¸');
+
+//%%%%%%	File Name misc.php (who's-online popup)	%%%%%
+define('_WHOSONLINE','¥ª¥ó¥é¥¤¥ó¾õ¶·'); 
+define('_GUESTS', '¥²¥¹¥È');
+define('_MEMBERS', 'ÅÐÏ¿¥æ¡¼¥¶');
+define('_ONLINEPHRASE','<b>%s</b> ¿Í¤Î¥æ¡¼¥¶¤¬¸½ºß¥ª¥ó¥é¥¤¥ó¤Ç¤¹¡£');
+define('_ONLINEPHRASEX','<b>%s</b> ¿Í¤Î¥æ¡¼¥¶¤¬ <b>%s</b> ¤ò»²¾È¤·¤Æ¤¤¤Þ¤¹¡£');
+define('_CLOSE','ÊÄ¤¸¤ë');  // Close window
+
+//%%%%%%	File Name module.textsanitizer.php 	%%%%%
+define('_QUOTEC','°úÍÑ¡§');
+
+//%%%%%%	File Name admin.php 	%%%%%
+define('_NOPERM','¤³¤Î¥¨¥ê¥¢¤Ø¤Î¥¢¥¯¥»¥¹¤Ïµö²Ä¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£');
+
+//%%%%%		Common Phrases		%%%%%
+define('_NO','¤¤¤¤¤¨');
+define('_YES','¤Ï¤¤');
+define('_EDIT','ÊÔ½¸');
+define('_DELETE','ºï½ü');
+define('_SUBMIT','Á÷¿®');
+define('_MODULENOEXIST','ÁªÂò¤µ¤ì¤¿¥Ú¡¼¥¸¤ÏÂ¸ºß¤·¤Þ¤»¤ó');
+define('_ALIGN','°ÌÃÖ');
+define('_LEFT','º¸');
+define('_CENTER','Ãæ±û');
+define('_RIGHT','±¦');
+define('_FORM_ENTER', '%s¤òÆþÎÏ¤·¤Æ¤¯¤À¤µ¤¤');
+// %s represents file name
+define('_MUSTWABLE','¥Õ¥¡¥¤¥ë %s ¤Ø¤Î½ñ¤­¹þ¤ß¸¢¸Â¤¬¤¢¤ë¤«¤É¤¦¤«³ÎÇ§¤·¤Æ¤¯¤À¤µ¤¤¡£');
+
+define('_PREFERENCES', '°ìÈÌÀßÄê');
+define('_VERSION', '¥Ð¡¼¥¸¥ç¥ó');
+define('_DESCRIPTION', 'ÀâÌÀ');
+define('_ERRORS', '¥¨¥é¡¼');
+define('_NONE', '¤Ê¤·');
+define('_ON','Åê¹ÆÆü»þ¡§');
+define('_READS','¥Ò¥Ã¥È');
+define('_WELCOMETO','%s¤Ø¤è¤¦¤³¤½');
+define('_SEARCH','¸¡º÷');
+define('_ALL', '¤¹¤Ù¤Æ');
+define('_TITLE', 'ÂêÌ¾');      //-no use
+define('_OPTIONS', '¥ª¥×¥·¥ç¥ó');
+define('_QUOTE', '°úÍÑ');     //-no use
+define('_LIST', '°ìÍ÷');
+define('_LOGIN','¥í¥°¥¤¥ó');
+define('_USERNAME','¥æ¡¼¥¶ID ¤Þ¤¿¤Ï e-mail: '); // uname&email hack GIJ
+define('_PASSWORD','¥Ñ¥¹¥ï¡¼¥É: ');
+define('_REMEMBERME','¼¡²ó¤«¤é¼«Æ°¥í¥°¥¤¥ó'); // autologin hack GIJ
+define('_RETRYPOST','»þ´ÖÀÚ¤ì¤Ç¤·¤¿¡£ºÆÅê¹Æ¤·¤Þ¤¹¤«¡©'); // autologin hack GIJ
+define('_SELECT','ÁªÂò');
+define('_IMAGE','²èÁü');
+define('_SEND','Á÷¿®');
+define('_CANCEL','¥­¥ã¥ó¥»¥ë');
+define('_ASCENDING','¾º½ç');
+define('_DESCENDING','¹ß½ç');
+define('_BACK', 'Ìá¤ë');
+define('_NOTITLE', 'ÌµÂê');
+
+/* Image manager */
+define('_IMGMANAGER','¥¤¥á¡¼¥¸¡¦¥Þ¥Í¥¸¥ã¡¼');
+define('_NUMIMAGES', '%s Ëç');
+define('_ADDIMAGE','²èÁü¥Õ¥¡¥¤¥ë¤ÎÄÉ²Ã');
+define('_IMAGENAME','²èÁüÌ¾:');
+define('_IMGMAXSIZE','¥¢¥Ã¥×¥í¡¼¥É¤òµö²Ä¤¹¤ë¥Õ¥¡¥¤¥ë¥µ¥¤¥º(¥Ð¥¤¥È¿ô):');
+define('_IMGMAXWIDTH','¥¢¥Ã¥×¥í¡¼¥É¤òµö²Ä¤¹¤ë²èÁü¤Î²£Éý¡Ê¥Ô¥¯¥»¥ë¿ô¡Ë:');
+define('_IMGMAXHEIGHT','¥¢¥Ã¥×¥í¡¼¥É¤òµö²Ä¤¹¤ë²èÁü¤Î¹â¤µ¡Ê¥Ô¥¯¥»¥ë¿ô¡Ë:');
+define('_IMAGECAT','¥«¥Æ¥´¥ê:');
+define('_IMAGEFILE','²èÁü¥Õ¥¡¥¤¥ëÌ¾:');
+define('_IMGWEIGHT','¥¤¥á¡¼¥¸¥Þ¥Í¥¸¥ã¡¼¤Ç¤ÎÉ½¼¨½ç:');
+define('_IMGDISPLAY','¤³¤Î²èÁü¤òÉ½¼¨¤¹¤ë');
+define('_IMAGEMIME','MIME¥¿¥¤¥×:');
+define('_FAILFETCHIMG', '¥¢¥Ã¥×¥í¡¼¥É¥Õ¥¡¥¤¥ë %s ¤¬¼èÆÀ¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£');
+define('_FAILSAVEIMG', '²èÁü¥Õ¥¡¥¤¥ë %s ¤ò¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë³ÊÇ¼¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£');
+define('_NOCACHE', '¥­¥ã¥Ã¥·¥å¤Ê¤·');
+define('_CLONE', 'Ê£À½');
+
+
+
+//%%%%%	File Name class/xoopsform/formmatchoption.php 	%%%%%
+define('_STARTSWITH', 'Á°Êý°ìÃ×');
+define('_ENDSWITH', '¸åÊý°ìÃ×');
+define('_MATCHES', '´°Á´°ìÃ×');
+define('_CONTAINS', '¼¡¤ÎÃ±¸ì¤ò´Þ¤à');
+
+//%%%%%%	File Name commentform.php 	%%%%%
+define('_REGISTER','ÅÐÏ¿');
+
+//%%%%%%	File Name xoopscodes.php 	%%%%%
+define('_SIZE','Âç¤­¤µ');  // font size
+define('_FONT','¥Õ¥©¥ó¥È');  // font family
+define('_COLOR','¿§');  // font color
+define('_EXAMPLE','¥µ¥ó¥×¥ë');
+define('_ENTERURL','¥ê¥ó¥¯¤·¤¿¤¤¥µ¥¤¥È¤ÎURL¤òÆþÎÏ¤·¤Æ¤¯¤À¤µ¤¤¡£');
+define('_ENTERWEBTITLE','¥µ¥¤¥ÈÌ¾¤òÆþÎÏ¤·¤Æ¤¯¤À¤µ¤¤¡£');
+define('_ENTERIMGURL','²èÁü¥Õ¥¡¥¤¥ë¤ÎURL¤òÆþÎÏ¤·¤Æ¤¯¤À¤µ¤¤¡£');
+define('_ENTERIMGPOS','²èÁü¥Õ¥¡¥¤¥ë¤ÎÇÛÃÖ¤ò·è¤á¤Æ¤¯¤À¤µ¤¤¡£');
+define('_IMGPOSRORL','¡ÖR¡×¤Þ¤¿¤Ï¡Ör¡×¤òÆþÎÏ¤¹¤ë¤È±¦Â¦¤Ë¡¢¡ÖL¡×¤Þ¤¿¤Ï¡Öl¡×¤òÆþÎÏ¤¹¤ë¤Èº¸Â¦¤ËÉ½¼¨¤µ¤ì¤Þ¤¹¡£»ØÄê¤·¤Ê¤¤¾ì¹ç¤Ï¶õÍó¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£');
+define('_ERRORIMGPOS','ÆþÎÏ¤¬Àµ¤·¤¯¤¢¤ê¤Þ¤»¤ó¡£²èÁü¥Õ¥¡¥¤¥ë¤ÎÇÛÃÖ¤ò·è¤á¤Æ¤¯¤À¤µ¤¤¡£');
+define('_ENTEREMAIL','¥ê¥ó¥¯¤·¤¿¤¤¥á¡¼¥ë¥¢¥É¥ì¥¹¤òÆþÎÏ¤·¤Æ¤¯¤À¤µ¤¤¡£');
+define('_ENTERCODE','¥×¥í¥°¥é¥à¥³¡¼¥É¤òÆþÎÏ¤·¤Æ¤¯¤À¤µ¤¤¡£');
+define('_ENTERQUOTE','°úÍÑ¤·¤¿¤¤Ê¸¤òÆþÎÏ¤·¤Æ¤¯¤À¤µ¤¤¡£');
+define('_ENTERTEXTBOX','¥Æ¥­¥¹¥È¥Ü¥Ã¥¯¥¹¤ËÆþÎÏ¤·¤Æ¤¯¤À¤µ¤¤¡£');
+define('_ALLOWEDCHAR','ºÇÂç¥Ð¥¤¥È¿ô¡§');
+define('_CURRCHAR','¸½ºß¤Î¥Ð¥¤¥È¿ô¡§');
+define('_PLZCOMPLETE','É½Âê¤ª¤è¤Ó¥á¥Ã¥»¡¼¥¸Ê¸¤òµ­Æþ¤·¤Æ¤¯¤À¤µ¤¤¡£');
+define('_MESSAGETOOLONG','¥á¥Ã¥»¡¼¥¸Ê¸¤¬Ä¹¤¹¤®¤Þ¤¹¡£');
+
+//%%%%%		TIME FORMAT SETTINGS   %%%%%
+
+define("_DATESTRING","Y-n-j G:i:s");
+define("_MEDIUMDATESTRING","Y-n-j G:i");
+define("_SHORTDATESTRING","Y-n-j");
+
+define('_SECOND', '1ÉÃ');
+define('_SECONDS', '%sÉÃ');
+define('_MINUTE', '1Ê¬');
+define('_MINUTES', '%sÊ¬');
+define('_HOUR', '1»þ´Ö');
+define('_HOURS', '%s»þ´Ö');
+define('_DAY', '1Æü');
+define('_DAYS', '%sÆü');
+define('_WEEK', '1½µ´Ö');
+define('_MONTH', '1¥ö·î');
+
+//%%%%%		LANGUAGE SPECIFIC SETTINGS   %%%%%
+define('_CHARSET', 'EUC-JP');
+define('_LANGCODE', 'ja');
+
+// change 0 to 1 if this language is a multi-bytes language
+define('XOOPS_USE_MULTIBYTES', '1');
+
+function xoops_language_trim($text)
+{
+	if (function_exists('mb_convert_kana')) {
+		$text = mb_convert_kana($text, 's');
+	}
+	$text = trim($text);
+	return $text;
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/language/japanese/comment.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/language/japanese/comment.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/language/japanese/comment.php	(revision 405)
@@ -0,0 +1,40 @@
+<?php
+// $Id: comment.php,v 1.2 2005/03/18 13:00:58 onokazu Exp $
+define('_CM_TITLE','É½Âê');
+define('_CM_MESSAGE','¥³¥á¥ó¥È');
+define('_CM_DOSMILEY','´é¥¢¥¤¥³¥ó¤òÍ­¸ú¤Ë¤¹¤ë');
+define('_CM_DOHTML','HTML¥¿¥°¤òÍ­¸ú¤Ë¤¹¤ë');
+define('_CM_DOAUTOWRAP','²þ¹Ô¤ò¼«Æ°ÁÞÆþ¤¹¤ë');
+define('_CM_DOXCODE','XOOPS¥³¡¼¥É¤òÍ­¸ú¤Ë¤¹¤ë');
+define('_CM_REFRESH','¹¹¿·');
+define('_CM_PENDING','¾µÇ§ÂÔ¤Á');
+define('_CM_HIDDEN','ÈóÉ½¼¨');
+define('_CM_ACTIVE','¥¢¥¯¥Æ¥£¥Ö');
+define('_CM_STATUS','¥¹¥Æ¡¼¥¿¥¹');
+define('_CM_POSTCOMMENT','Åê¹Æ¤¹¤ë');
+define('_CM_REPLIES','ÊÖ¿®');
+define('_CM_PARENT','¿Æ¥³¥á¥ó¥È');
+define('_CM_TOP','¾å¤Ø');
+define('_CM_BOTTOM','²¼¤Ø');
+define('_CM_ONLINE','¥ª¥ó¥é¥¤¥ó');
+define('_CM_POSTED','Åê¹ÆÆü»þ'); // Posted date
+define('_CM_UPDATED', '¹¹¿·Æü»þ');
+define('_CM_THREAD','¥¹¥ì¥Ã¥É');
+define('_CM_POSTER','Åê¹Æ¼Ô');
+define('_CM_JOINED','ÅÐÏ¿Æü');
+define('_CM_POSTS','Åê¹Æ¿ô');
+define('_CM_FROM','µï½»ÃÏ');
+define('_CM_COMDELETED', '¥³¥á¥ó¥È¤òºï½ü¤·¤Þ¤·¤¿¡£');
+define('_CM_COMDELETENG', '¥³¥á¥ó¥È¤òºï½ü¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£');
+define('_CM_DELETESELECT' , '¥³¥á¥ó¥È¤Îºï½üÊýË¡¤òÁªÂò¤·¤Æ¤¯¤À¤µ¤¤¡£');
+define('_CM_DELETEONE' , '¤³¤Î¥³¥á¥ó¥È¤À¤±ºï½ü¤¹¤ë');
+define('_CM_DELETEALL', '¤³¤Î¥³¥á¥ó¥È¤ËÂÐ¤¹¤ëÊÖ¿®¤âÁ´¤Æºï½ü¤¹¤ë');
+define('_CM_THANKSPOST', 'Åê¹Æ¤ò¼õ¤±ÉÕ¤±¤Þ¤·¤¿¡£');
+define('_CM_NOTICE', 'Åê¹Æ¤µ¤ì¤¿ÆâÍÆ¤ÎÃøºî¸¢¤Ï¥³¥á¥ó¥È¤ÎÅê¹Æ¼Ô¤Ëµ¢Â°¤·¤Þ¤¹¡£');
+define('_CM_COMRULES','¥³¥á¥ó¥ÈÅê¹Æ¤Ë´Ø¤¹¤ë¥ë¡¼¥ë');
+define('_CM_COMAPPROVEALL','¥³¥á¥ó¥È¤Ë¾µÇ§¤ÏÉ¬Í×¤Ê¤¤');
+define('_CM_COMAPPROVEUSER','ÅÐÏ¿¥æ¡¼¥¶°Ê³°¤Î¥³¥á¥ó¥È¤Ï¾µÇ§¤¬É¬Í×');
+define('_CM_COMAPPROVEADMIN','¥³¥á¥ó¥È¤ÏÁ´¤Æ¾µÇ§¤¬É¬Í×');
+define('_CM_COMANONPOST','Æ¿Ì¾¤Ë¤è¤ë¥³¥á¥ó¥ÈÅê¹Æ¤òµö²Ä¤·¤Þ¤¹¤«¡©');
+define('_CM_COMNOCOM','¥³¥á¥ó¥Èµ¡Ç½¤òÌµ¸ú¤Ë¤¹¤ë');
+?>
Index: /temp/test-xoops.ec-cube.net/html/language/japanese/mail.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/language/japanese/mail.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/language/japanese/mail.php	(revision 405)
@@ -0,0 +1,10 @@
+<?php
+define("_MAIL_MSGBODY", "¥á¥Ã¥»¡¼¥¸ËÜÊ¸¤¬¤¢¤ê¤Þ¤»¤ó");
+define("_MAIL_FAILOPTPL", "¥Æ¥ó¥×¥ì¡¼¥È¥Õ¥¡¥¤¥ë¤ÎÆÉ¤ß¹þ¤ß¤Ë¼ºÇÔ¤·¤Þ¤·¤¿");
+define("_MAIL_FNAMENG", "¡ÖÁ÷¿®¼Ô¡×¤òµ­Æþ¤·¤Æ¤¯¤À¤µ¤¤");
+define("_MAIL_FEMAILNG", "¡ÖÁ÷¿®¼Ô¥á¡¼¥ë¥¢¥É¥ì¥¹¡×¤òµ­Æþ¤·¤Æ¤¯¤À¤µ¤¤");
+define("_MAIL_SENDMAILNG", "%s¤µ¤ó°¸¤Ë¥á¡¼¥ë¤òÁ÷¿®¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿");
+define("_MAIL_MAILGOOD", "%s¤µ¤ó°¸¤Ë¥á¡¼¥ë¤òÁ÷¿®¤·¤Þ¤·¤¿");
+define("_MAIL_SENDPMNG", "%s¤µ¤ó°¸¤Ë¥×¥é¥¤¥Ù¡¼¥È¥á¥Ã¥»¡¼¥¸¤òÁ÷¿®¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿");
+define("_MAIL_PMGOOD", "%s¤µ¤ó°¸¤Ë¥×¥é¥¤¥Ù¡¼¥È¥á¥Ã¥»¡¼¥¸¤òÁ÷¿®¤·¤Þ¤·¤¿");
+?>
Index: /temp/test-xoops.ec-cube.net/html/language/japanese/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/language/japanese/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/language/japanese/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/language/japanese/search.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/language/japanese/search.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/language/japanese/search.php	(revision 405)
@@ -0,0 +1,22 @@
+<?php
+//%%%%%%	File Name search.php 	%%%%%
+define('_SR_SEARCH','¸¡º÷');
+define('_SR_PLZENTER','É¬Í×¤Ê¥Ç¡¼¥¿¤òÁ´¤ÆÆþÎÏ¤·¤Æ¤¯¤À¤µ¤¤¡£');
+define('_SR_SEARCHRESULTS','¸¡º÷·ë²Ì');
+define('_SR_NOMATCH','³ºÅö¥Ç¡¼¥¿¤Ê¤·¡£');
+define('_SR_FOUND','<b>%s</b>·ï¤Î¥Ç¡¼¥¿¤¬¸«¤Ä¤«¤ê¤Þ¤·¤¿¡£');
+define('_SR_SHOWING','¡Ê%d ¡Á %d ·ïÌÜ¤òÉ½¼¨¡Ë');
+define('_SR_ANY','¤¤¤º¤ì¤«¡ÊOR¸¡º÷¡Ë');
+define('_SR_ALL','¤¹¤Ù¤Æ¡ÊAND¸¡º÷¡Ë');
+define('_SR_EXACT','¥Õ¥ì¡¼¥º');
+define('_SR_SHOWALLR','¤¹¤Ù¤ÆÉ½¼¨');
+define('_SR_NEXT','¼¡¤Î¥Ú¡¼¥¸ >>');
+define('_SR_PREVIOUS','<< Á°¤Î¥Ú¡¼¥¸');
+define('_SR_KEYWORDS','¥­¡¼¥ï¡¼¥É');
+define('_SR_TYPE','¸¡º÷¤Î¼ïÎà');
+define('_SR_SEARCHIN','¸¡º÷ÂÐ¾Ý¤Î¥â¥¸¥å¡¼¥ë');
+define('_SR_KEYTOOSHORT', '¥­¡¼¥ï¡¼¥É¤Ï %s Ê¸»ú°Ê¾å¤Ç»ØÄê¤·¤Æ¤¯¤À¤µ¤¤¡£');
+define('_SR_KEYIGNORE', 'Ê¸»ú¿ô¤¬ <b>%s</b> Ê¸»úÌ¤Ëþ¤Î¥­¡¼¥ï¡¼¥É¤ÏÌµ»ë¤µ¤ì¤Þ¤¹¡£');
+define('_SR_SEARCHRULE', '¸¡º÷¤Î¥ë¡¼¥ë');
+define('_SR_IGNOREDWORDS', '¼¡¤Î¸ì¶ç¤ÏÃ»¤¹¤®¤ë¡Ê%u Ê¸»ú°Ê²¼¡Ë¤¿¤á¸¡º÷¤Ë»ÈÍÑ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£');
+?>
Index: /temp/test-xoops.ec-cube.net/html/language/english/user.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/language/english/user.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/language/english/user.php	(revision 405)
@@ -0,0 +1,138 @@
+<?php
+// $Id: user.php,v 1.2 2005/03/18 12:52:14 onokazu Exp $
+//%%%%%%		File Name user.php 		%%%%%
+define('_US_NOTREGISTERED','Not registered?  Click <a href="register.php">here</a>.');
+define('_US_LOSTPASSWORD','Lost your Password?');
+define('_US_NOPROBLEM','No problem. Simply enter the e-mail address we have on file for your account.');
+define('_US_YOUREMAIL','Your Email: ');
+define('_US_SENDPASSWORD','Send Password');
+define('_US_LOGGEDOUT','You are now logged out');
+define('_US_THANKYOUFORVISIT','Thank you for your visit to our site!');
+define('_US_INCORRECTLOGIN','Incorrect Login!');
+define('_US_LOGGINGU','Thank you for logging in, %s.');
+
+// 2001-11-17 ADD
+define('_US_NOACTTPADM','The selected user has been deactivated or has not been activated yet.<br />Please contact the administrator for details.');
+define('_US_ACTKEYNOT','Activation key not correct!');
+define('_US_ACONTACT','Selected account is already activated!');
+define('_US_ACTLOGIN','Your account has been activated. Please login with the registered password.');
+define('_US_NOPERMISS','Sorry, you dont have the permission to perform this action!');
+define('_US_SURETODEL','Are you sure you want to delete your account?');
+define('_US_REMOVEINFO','This will remove all your info from our database.');
+define('_US_BEENDELED','Your account has been deleted.');
+//
+
+//%%%%%%		File Name register.php 		%%%%%
+define('_US_USERREG','User Registration');
+define('_US_NICKNAME','Username');
+define('_US_EMAIL','Email');
+define('_US_ALLOWVIEWEMAIL','Allow other users to view my email address');
+define('_US_WEBSITE','Website');
+define('_US_TIMEZONE','Time Zone');
+define('_US_AVATAR','Avatar');
+define('_US_VERIFYPASS','Verify Password');
+define('_US_SUBMIT','Submit');
+define('_US_USERNAME','Username');
+define('_US_FINISH','Finish');
+define('_US_REGISTERNG','Could not register new user.');
+define('_US_MAILOK','Receive occasional email notices <br />from administrators and moderators?');
+define('_US_DISCLAIMER','Disclaimer');
+define('_US_IAGREE','I agree to the above');
+define('_US_UNEEDAGREE', 'Sorry, you have to agree to our disclaimer to get registered.');
+define('_US_NOREGISTER','Sorry, we are currently closed for new user registrations');
+
+
+// %s is username. This is a subject for email
+define('_US_USERKEYFOR','User activation key for %s');
+
+define('_US_YOURREGISTERED','You are now registered. An email containing an user activation key has been sent to the email account you provided. Please follow the instructions in the mail to activate your account. ');
+define('_US_YOURREGMAILNG','You are now registered. However, we were unable to send the activation mail to your email account due to an internal error that had occurred on our server. We are sorry for the inconvenience, please send the webmaster an email notifying him/her of the situation.');
+define('_US_YOURREGISTERED2','You are now registered.  Please wait for your account to be activated by the adminstrators.  You will receive an email once you are activated.  This could take a while so please be patient.');
+
+// %s is your site name
+define('_US_NEWUSERREGAT','New user registration at %s');
+// %s is a username
+define('_US_HASJUSTREG','%s has just registered!');
+
+define('_US_INVALIDMAIL','ERROR: Invalid email');
+define('_US_EMAILNOSPACES','ERROR: Email addresses do not contain spaces.');
+define('_US_INVALIDNICKNAME','ERROR: Invalid Username');
+define('_US_NICKNAMETOOLONG','Username is too long. It must be less than %s characters.');
+define('_US_NICKNAMETOOSHORT','Username is too short. It must be more than %s characters.');
+define('_US_NAMERESERVED','ERROR: Name is reserved.');
+define('_US_NICKNAMENOSPACES','There cannot be any spaces in the Username.');
+define('_US_NICKNAMETAKEN','ERROR: Username taken.');
+define('_US_EMAILTAKEN','ERROR: Email address already registered.');
+define('_US_ENTERPWD','ERROR: You must provide a password.');
+define('_US_SORRYNOTFOUND','Sorry, no corresponding user info was found.');
+
+
+
+
+// %s is your site name
+define('_US_NEWPWDREQ','New Password Request at %s');
+define('_US_YOURACCOUNT', 'Your account at %s');
+
+define('_US_MAILPWDNG','mail_password: could not update user entry. Contact the Administrator');
+
+// %s is a username
+define('_US_PWDMAILED','Password for %s mailed.');
+define('_US_CONFMAIL','Confirmation Mail for %s mailed.');
+define('_US_ACTVMAILNG', 'Failed sending notification mail to %s');
+define('_US_ACTVMAILOK', 'Notification mail to %s sent.');
+
+//%%%%%%		File Name userinfo.php 		%%%%%
+define('_US_SELECTNG','No User Selected! Please go back and try again.');
+define('_US_PM','PM');
+define('_US_ICQ','ICQ');
+define('_US_AIM','AIM');
+define('_US_YIM','YIM');
+define('_US_MSNM','MSNM');
+define('_US_LOCATION','Location');
+define('_US_OCCUPATION','Occupation');
+define('_US_INTEREST','Interest');
+define('_US_SIGNATURE','Signature');
+define('_US_EXTRAINFO','Extra Info');
+define('_US_EDITPROFILE','Edit Profile');
+define('_US_LOGOUT','Logout');
+define('_US_INBOX','Inbox');
+define('_US_MEMBERSINCE','Member Since');
+define('_US_RANK','Rank');
+define('_US_POSTS','Comments/Posts');
+define('_US_LASTLOGIN','Last Login');
+define('_US_ALLABOUT','All about %s');
+define('_US_STATISTICS','Statistics');
+define('_US_MYINFO','My Info');
+define('_US_BASICINFO','Basic information');
+define('_US_MOREABOUT','More About Me');
+define('_US_SHOWALL','Show All');
+
+//%%%%%%		File Name edituser.php 		%%%%%
+define('_US_PROFILE','Profile');
+define('_US_REALNAME','Real Name');
+define('_US_SHOWSIG','Always attach my signature');
+define('_US_CDISPLAYMODE','Comments Display Mode');
+define('_US_CSORTORDER','Comments Sort Order');
+define('_US_PASSWORD','Password');
+define('_US_TYPEPASSTWICE','(type a new password twice to change it)');
+define('_US_SAVECHANGES','Save Changes');
+define('_US_NOEDITRIGHT',"Sorry, you don't have the right to edit this user's info.");
+define('_US_PASSNOTSAME','Both passwords are different. They must be identical.');
+define('_US_PWDTOOSHORT','Sorry, your password must be at least <b>%s</b> characters long.');
+define('_US_PROFUPDATED','Your Profile Updated!');
+define('_US_USECOOKIE','Store my user name in a cookie for 1 year');
+define('_US_NO','No');
+define('_US_DELACCOUNT','Delete Account');
+define('_US_MYAVATAR', 'My Avatar');
+define('_US_UPLOADMYAVATAR', 'Upload Avatar');
+define('_US_MAXPIXEL','Max Pixels');
+define('_US_MAXIMGSZ','Max Image Size (Bytes)');
+define('_US_SELFILE','Select file');
+define('_US_OLDDELETED','Your old avatar will be deleted!');
+define('_US_CHOOSEAVT', 'Choose avatar from the available list');
+
+define('_US_PRESSLOGIN', 'Press the button below to login');
+
+define('_US_ADMINNO', 'User in the webmasters group cannot be removed');
+define('_US_GROUPS', 'User\'s Groups');
+?>
Index: /temp/test-xoops.ec-cube.net/html/language/english/global.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/language/english/global.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/language/english/global.php	(revision 405)
@@ -0,0 +1,202 @@
+<?php
+// $Id: global.php,v 1.2 2005/03/18 12:52:14 onokazu Exp $
+//%%%%%%	File Name mainfile.php 	%%%%%
+define("_PLEASEWAIT","Please Wait");
+define("_FETCHING","Loading...");
+define("_TAKINGBACK","Taking you back to where you were....");
+define("_LOGOUT","Logout");
+define("_SUBJECT","Subject");
+define("_MESSAGEICON","Message Icon");
+define("_COMMENTS","Comments");
+define("_POSTANON","Post Anonymously");
+define("_DISABLESMILEY","Disable smiley");
+define("_DISABLEHTML","Disable html");
+define("_PREVIEW","Preview");
+
+define("_GO","Go!");
+define("_NESTED","Nested");
+define("_NOCOMMENTS","No Comments");
+define("_FLAT","Flat");
+define("_THREADED","Threaded");
+define("_OLDESTFIRST","Oldest First");
+define("_NEWESTFIRST","Newest First");
+define("_MORE","more...");
+define("_MULTIPAGE","To have your article span multiple pages, insert the word <font color=red>[pagebreak]</font> (with brackets) in the article.");
+define("_IFNOTRELOAD","If the page does not automatically reload, please click <a href='%s'>here</a>");
+define("_WARNINSTALL2","WARNING: Directory %s exists on your server. <br />Please remove this directory for security reasons.");
+define("_WARNINWRITEABLE","WARNING: File %s is writeable by the server. <br />Please change the permission of this file for security reasons.<br /> in Unix (444), in Win32 (read-only)");
+
+//%%%%%%	File Name themeuserpost.php 	%%%%%
+define("_PROFILE","Profile");
+define("_POSTEDBY","Posted by");
+define("_VISITWEBSITE","Visit Website");
+define("_SENDPMTO","Send Private Message to %s");
+define("_SENDEMAILTO","Send Email to %s");
+define("_ADD","Add");
+define("_REPLY","Reply");
+define("_DATE","Date");   // Posted date
+
+//%%%%%%	File Name admin_functions.php 	%%%%%
+define("_MAIN","Main");
+define("_MANUAL","Manual");
+define("_INFO","Info");
+define("_CPHOME","Control Panel Home");
+define("_YOURHOME","Home Page");
+
+//%%%%%%	File Name misc.php (who's-online popup)	%%%%%
+define("_WHOSONLINE","Who's Online");
+define('_GUESTS', 'Guests');
+define('_MEMBERS', 'Members');
+define("_ONLINEPHRASE","<b>%s</b> user(s) are online");
+define("_ONLINEPHRASEX","<b>%s</b> user(s) are browsing <b>%s</b>");
+define("_CLOSE","Close");  // Close window
+
+//%%%%%%	File Name module.textsanitizer.php 	%%%%%
+define("_QUOTEC","Quote:");
+
+//%%%%%%	File Name admin.php 	%%%%%
+define("_NOPERM","Sorry, you don't have the permission to access this area.");
+
+//%%%%%		Common Phrases		%%%%%
+define("_NO","No");
+define("_YES","Yes");
+define("_EDIT","Edit");
+define("_DELETE","Delete");
+define("_SUBMIT","Submit");
+define("_MODULENOEXIST","Selected module does not exist!");
+define("_ALIGN","Align");
+define("_LEFT","Left");
+define("_CENTER","Center");
+define("_RIGHT","Right");
+define("_FORM_ENTER", "Please enter %s");
+// %s represents file name
+define("_MUSTWABLE","File %s must be writable by the server!");
+// Module info
+define('_PREFERENCES', 'Preferences');
+define("_VERSION", "Version");
+define("_DESCRIPTION", "Description");
+define("_ERRORS", "Errors");
+define("_NONE", "None");
+define('_ON','on');
+define('_READS','reads');
+define('_WELCOMETO','Welcome to %s');
+define('_SEARCH','Search');
+define('_ALL', 'All');
+define('_TITLE', 'Title');
+define('_OPTIONS', 'Options');
+define('_QUOTE', 'Quote');
+define('_LIST', 'List');
+define('_LOGIN','User Login');
+define('_USERNAME','Username or e-mail: '); // uname&email hack GIJ
+define('_PASSWORD','Password: ');
+define('_REMEMBERME','Remember Me');  // autologin hack GIJ
+define('_RETRYPOST','Time-out. Do you post again?'); // autologin hack GIJ
+define("_SELECT","Select");
+define("_IMAGE","Image");
+define("_SEND","Send");
+define("_CANCEL","Cancel");
+define("_ASCENDING","Ascending order");
+define("_DESCENDING","Descending order");
+define('_BACK', 'Back');
+define('_NOTITLE', 'No title');
+
+/* Image manager */
+define('_IMGMANAGER','Image Manager');
+define('_NUMIMAGES', '%s images');
+define('_ADDIMAGE','Add Image File');
+define('_IMAGENAME','Name:');
+define('_IMGMAXSIZE','Max size allowed (bytes):');
+define('_IMGMAXWIDTH','Max width allowed (pixels):');
+define('_IMGMAXHEIGHT','Max height allowed (pixels):');
+define('_IMAGECAT','Category:');
+define('_IMAGEFILE','Image file:');
+define('_IMGWEIGHT','Display order in image manager:');
+define('_IMGDISPLAY','Display this image?');
+define('_IMAGEMIME','MIME type:');
+define('_FAILFETCHIMG', 'Could not get uploaded file %s');
+define('_FAILSAVEIMG', 'Failed storing image %s into the database');
+define('_NOCACHE', 'No Cache');
+define('_CLONE', 'Clone');
+
+//%%%%%	File Name class/xoopsform/formmatchoption.php 	%%%%%
+define("_STARTSWITH", "Starts with");
+define("_ENDSWITH", "Ends with");
+define("_MATCHES", "Matches");
+define("_CONTAINS", "Contains");
+
+//%%%%%%	File Name commentform.php 	%%%%%
+define("_REGISTER","Register");
+
+//%%%%%%	File Name xoopscodes.php 	%%%%%
+define("_SIZE","SIZE");  // font size
+define("_FONT","FONT");  // font family
+define("_COLOR","COLOR");  // font color
+define("_EXAMPLE","SAMPLE");
+define("_ENTERURL","Enter the URL of the link you want to add:");
+define("_ENTERWEBTITLE","Enter the web site title:");
+define("_ENTERIMGURL","Enter the URL of the image you want to add.");
+define("_ENTERIMGPOS","Now, enter the position of the image.");
+define("_IMGPOSRORL","'R' or 'r' for right, 'L' or 'l' for left, or leave it blank.");
+define("_ERRORIMGPOS","ERROR! Enter the position of the image.");
+define("_ENTEREMAIL","Enter the email address you want to add.");
+define("_ENTERCODE","Enter the codes that you want to add.");
+define("_ENTERQUOTE","Enter the text that you want to be quoted.");
+define("_ENTERTEXTBOX","Please input text into the textbox.");
+define("_ALLOWEDCHAR","Allowed max chars length: ");
+define("_CURRCHAR","Current chars length: ");
+define("_PLZCOMPLETE","Please complete the subject and message fields.");
+define("_MESSAGETOOLONG","Your message is too long.");
+
+//%%%%%		TIME FORMAT SETTINGS   %%%%%
+define('_SECOND', '1 second');
+define('_SECONDS', '%s seconds');
+define('_MINUTE', '1 minute');
+define('_MINUTES', '%s minutes');
+define('_HOUR', '1 hour');
+define('_HOURS', '%s hours');
+define('_DAY', '1 day');
+define('_DAYS', '%s days');
+define('_WEEK', '1 week');
+define('_MONTH', '1 month');
+
+define("_DATESTRING","Y/n/j G:i:s");
+define("_MEDIUMDATESTRING","Y/n/j G:i");
+define("_SHORTDATESTRING","Y/n/j");
+/*
+The following characters are recognized in the format string:
+a - "am" or "pm"
+A - "AM" or "PM"
+d - day of the month, 2 digits with leading zeros; i.e. "01" to "31"
+D - day of the week, textual, 3 letters; i.e. "Fri"
+F - month, textual, long; i.e. "January"
+h - hour, 12-hour format; i.e. "01" to "12"
+H - hour, 24-hour format; i.e. "00" to "23"
+g - hour, 12-hour format without leading zeros; i.e. "1" to "12"
+G - hour, 24-hour format without leading zeros; i.e. "0" to "23"
+i - minutes; i.e. "00" to "59"
+j - day of the month without leading zeros; i.e. "1" to "31"
+l (lowercase 'L') - day of the week, textual, long; i.e. "Friday"
+L - boolean for whether it is a leap year; i.e. "0" or "1"
+m - month; i.e. "01" to "12"
+n - month without leading zeros; i.e. "1" to "12"
+M - month, textual, 3 letters; i.e. "Jan"
+s - seconds; i.e. "00" to "59"
+S - English ordinal suffix, textual, 2 characters; i.e. "th", "nd"
+t - number of days in the given month; i.e. "28" to "31"
+T - Timezone setting of this machine; i.e. "MDT"
+U - seconds since the epoch
+w - day of the week, numeric, i.e. "0" (Sunday) to "6" (Saturday)
+Y - year, 4 digits; i.e. "1999"
+y - year, 2 digits; i.e. "99"
+z - day of the year; i.e. "0" to "365"
+Z - timezone offset in seconds (i.e. "-43200" to "43200")
+*/
+
+
+//%%%%%		LANGUAGE SPECIFIC SETTINGS   %%%%%
+define('_CHARSET', 'ISO-8859-1');
+define('_LANGCODE', 'en');
+
+// change 0 to 1 if this language is a multi-bytes language
+define("XOOPS_USE_MULTIBYTES", "0");
+?>
Index: /temp/test-xoops.ec-cube.net/html/language/english/comment.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/language/english/comment.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/language/english/comment.php	(revision 405)
@@ -0,0 +1,40 @@
+<?php
+// $Id: comment.php,v 1.2 2005/03/18 12:52:14 onokazu Exp $
+define('_CM_TITLE','Title');
+define('_CM_MESSAGE','Message');
+define('_CM_DOSMILEY','Enable Smiley Icons');
+define('_CM_DOHTML','Enable HTML Tags');
+define('_CM_DOAUTOWRAP','Auto wrap lines');
+define('_CM_DOXCODE','Enable XOOPS Codes');
+define('_CM_REFRESH','Refresh');
+define('_CM_PENDING','Pending');
+define('_CM_HIDDEN','Hidden');
+define('_CM_ACTIVE','Active');
+define('_CM_STATUS','Status');
+define('_CM_POSTCOMMENT','Post Comment');
+define('_CM_REPLIES','Replies');
+define('_CM_PARENT','Parent');
+define('_CM_TOP','Top');
+define('_CM_BOTTOM','Bottom');
+define('_CM_ONLINE','Online!');
+define('_CM_POSTED','Posted'); // Posted date
+define('_CM_UPDATED', 'Updated');
+define('_CM_THREAD','Thread');
+define('_CM_POSTER','Poster');
+define('_CM_JOINED','Joined');
+define('_CM_POSTS','Posts');
+define('_CM_FROM','From');
+define('_CM_COMDELETED', 'Comment(s) deleted.');
+define('_CM_COMDELETENG', 'Could not delete comment.');
+define('_CM_DELETESELECT' , 'Delete all its child comments?');
+define('_CM_DELETEONE' , 'No, delete only this comment');
+define('_CM_DELETEALL', 'Yes, delete all');
+define('_CM_THANKSPOST', 'Thanks for posting!');
+define('_CM_NOTICE', "The comments are owned by the poster. We aren't responsible for their content.");
+define('_CM_COMRULES','Comment Rules');
+define('_CM_COMAPPROVEALL','Comments are always approved');
+define('_CM_COMAPPROVEUSER','Comments by registered users are always approved');
+define('_CM_COMAPPROVEADMIN','All comments need to be approved by administrator');
+define('_CM_COMANONPOST','Allow anonymous post in comments?');
+define('_CM_COMNOCOM','Disable comments');
+?>
Index: /temp/test-xoops.ec-cube.net/html/language/english/mail.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/language/english/mail.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/language/english/mail.php	(revision 405)
@@ -0,0 +1,10 @@
+<?php
+define("_MAIL_MSGBODY", "Message body is not set.");
+define("_MAIL_FAILOPTPL", "Failed opening template file.");
+define("_MAIL_FNAMENG", "From Name is not set.");
+define("_MAIL_FEMAILNG", "From Email is not set.");
+define("_MAIL_SENDMAILNG", "Could not send mail to %s.");
+define("_MAIL_MAILGOOD", "Mail sent to %s.");
+define("_MAIL_SENDPMNG", "Could not send private message to %s.");
+define("_MAIL_PMGOOD", "Private message sent to %s.");
+?>
Index: /temp/test-xoops.ec-cube.net/html/language/english/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/language/english/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/language/english/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/language/english/search.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/language/english/search.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/language/english/search.php	(revision 405)
@@ -0,0 +1,23 @@
+<?php
+// $Id: search.php,v 1.2 2005/03/18 12:52:14 onokazu Exp $
+//%%%%%%	File Name search.php 	%%%%%
+define("_SR_SEARCH","Search");
+define("_SR_PLZENTER","Please enter all required data!");
+define("_SR_SEARCHRESULTS","Search Results");
+define("_SR_NOMATCH","No Match Found for your Query");
+define("_SR_FOUND","Found <b>%s</b> match(es)");
+define("_SR_SHOWING","(Showing %d - %d)");
+define("_SR_ANY","Any (OR)");
+define("_SR_ALL","All (AND)");
+define("_SR_EXACT","Exact Match");
+define("_SR_SHOWALLR","Show all results");
+define("_SR_NEXT","Next >>");
+define("_SR_PREVIOUS","<< Previous");
+define("_SR_KEYWORDS","Keyword(s)");
+define("_SR_TYPE","Type");
+define("_SR_SEARCHIN","Search in");
+define('_SR_KEYTOOSHORT', 'Keywords must be at least <b>%s</b> characters long');
+define('_SR_KEYIGNORE', 'Keywords shorter than <b>%s</b> characters will be ignored');
+define('_SR_SEARCHRULE', 'Seach Rule');
+define('_SR_IGNOREDWORDS', 'The following words are shorter than allowed minmum length (%u chars) and were not included in your search:');
+?>
Index: /temp/test-xoops.ec-cube.net/html/language/english/notification.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/language/english/notification.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/language/english/notification.php	(revision 405)
@@ -0,0 +1,87 @@
+<?php
+// $Id: notification.php,v 1.3 2005/09/04 20:46:09 onokazu Exp $
+
+// RMV-NOTIFY
+
+// Text for various templates...
+
+define ('_NOT_NOTIFICATIONOPTIONS', 'Notification Options');
+define ('_NOT_UPDATENOW', 'Update Now');
+define ('_NOT_UPDATEOPTIONS', 'Update Notification Options');
+
+define ('_NOT_CLEAR', 'Clear');
+define ('_NOT_CHECKALL', 'Check All');
+define ('_NOT_MODULE', 'Module');
+define ('_NOT_CATEGORY', 'Category');
+define ('_NOT_ITEMID', 'ID');
+define ('_NOT_ITEMNAME', 'Name');
+define ('_NOT_EVENT', 'Event');
+define ('_NOT_EVENTS', 'Events');
+define ('_NOT_ACTIVENOTIFICATIONS', 'Active Notifications');
+define ('_NOT_NAMENOTAVAILABLE', 'Name Not Available');
+// RMV-NEW : TODO: remove NAMENOTAVAILBLE above
+define ('_NOT_ITEMNAMENOTAVAILABLE', 'Item Name Not Available');
+define ('_NOT_ITEMTYPENOTAVAILABLE', 'Item Type Not Available');
+define ('_NOT_ITEMURLNOTAVAILABLE', 'Item URL Not Available');
+define ('_NOT_DELETINGNOTIFICATIONS', 'Deleting Notifications');
+define ('_NOT_DELETESUCCESS', 'Notification(s) deleted successfully.');
+define ('_NOT_UPDATEOK', 'Notification options updated');
+define ('_NOT_NOTIFICATIONMETHODIS', 'Notification method is');
+define ('_NOT_EMAIL', 'email');
+define ('_NOT_PM', 'private message');
+define ('_NOT_DISABLE', 'disabled');
+define ('_NOT_CHANGE', 'Change');
+define ('_NOT_RUSUREDEL', 'Are you sure you want to delete these Notifications');
+define ('_NOT_NOACCESS', 'You do not have permission to access this page.');
+
+// Text for module config options
+
+define ('_NOT_ENABLE', 'Enable');
+define ('_NOT_NOTIFICATION', 'Notification');
+
+define ('_NOT_CONFIG_ENABLED', 'Enable Notification');
+define ('_NOT_CONFIG_ENABLEDDSC', 'This module allows users to select to be notified when certain events occur.  Choose "yes" to enable this feature.');
+
+define ('_NOT_CONFIG_EVENTS', 'Enable Specific Events');
+define ('_NOT_CONFIG_EVENTSDSC', 'Select which notification events to which your users may subscribe.');
+
+define ('_NOT_CONFIG_ENABLE', 'Enable Notification');
+define ('_NOT_CONFIG_ENABLEDSC', 'This module allows users to be notified when certain events occur.  Select if users should be presented with notification options in a Block (Block-style), within the module (Inline-style), or both.  For block-style notification, the Notification Options block must be enabled for this module.');
+define ('_NOT_CONFIG_DISABLE', 'Disable Notification');
+define ('_NOT_CONFIG_ENABLEBLOCK', 'Enable only Block-style');
+define ('_NOT_CONFIG_ENABLEINLINE', 'Enable only Inline-style');
+define ('_NOT_CONFIG_ENABLEBOTH', 'Enable Notification (both styles)');
+
+// For notification about comment events
+
+define ('_NOT_COMMENT_NOTIFY', 'Comment Added');
+define ('_NOT_COMMENT_NOTIFYCAP', 'Notify me when a new comment is posted for this item.');
+define ('_NOT_COMMENT_NOTIFYDSC', 'Receive notification whenever a new comment is posted (or approved) for this item.');
+define ('_NOT_COMMENT_NOTIFYSBJ', '[{X_SITENAME}] {X_MODULE} auto-notify: Comment added to {X_ITEM_TYPE}');
+
+define ('_NOT_COMMENTSUBMIT_NOTIFY', 'Comment Submitted');
+define ('_NOT_COMMENTSUBMIT_NOTIFYCAP', 'Notify me when a new comment is submitted (awaiting approval) for this item.');
+define ('_NOT_COMMENTSUBMIT_NOTIFYDSC', 'Receive notification whenever a new comment is submitted (awaiting approval) for this item.');
+define ('_NOT_COMMENTSUBMIT_NOTIFYSBJ', '[{X_SITENAME}] {X_MODULE} auto-notify: Comment submitted for {X_ITEM_TYPE}');
+
+// For notification bookmark feature
+// (Not really notification, but easy to do with this module)
+
+define ('_NOT_BOOKMARK_NOTIFY', 'Bookmark');
+define ('_NOT_BOOKMARK_NOTIFYCAP', 'Bookmark this item (no notification).');
+define ('_NOT_BOOKMARK_NOTIFYDSC', 'Keep track of this item without receiving any event notifications.');
+
+// For user profile
+// FIXME: These should be reworded a little...
+
+define ('_NOT_NOTIFYMETHOD', 'Notification Method: When you monitor e.g. a forum, how would you like to receive notifications of updates?');
+define ('_NOT_METHOD_EMAIL', 'Email (use address in my profile)');
+define ('_NOT_METHOD_PM', 'Private Message');
+define ('_NOT_METHOD_DISABLE', 'Temporarily Disable');
+
+define ('_NOT_NOTIFYMODE', 'Default Notification Mode');
+define ('_NOT_MODE_SENDALWAYS', 'Notify me of all selected updates');
+define ('_NOT_MODE_SENDONCE', 'Notify me only once');
+define ('_NOT_MODE_SENDONCEPERLOGIN', 'Notify me once then disable until I log in again');
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/language/english/pmsg.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/language/english/pmsg.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/language/english/pmsg.php	(revision 405)
@@ -0,0 +1,44 @@
+<?php
+// $Id: pmsg.php,v 1.2 2005/03/18 12:52:14 onokazu Exp $
+//%%%%%%	File Name readpmsg.php 	%%%%%
+define("_PM_DELETED","Your message(s) has been deleted");
+define("_PM_PRIVATEMESSAGE","Private Messages");
+define("_PM_INBOX","Inbox");
+define("_PM_FROM","From");
+define("_PM_YOUDONTHAVE","You don't have any private messages");
+define("_PM_FROMC","From: ");
+define("_PM_SENTC","Sent: "); // The date of message sent
+define("_PM_PROFILE","Profile");
+
+// %s is a username
+define("_PM_PREVIOUS","Previous Message");
+define("_PM_NEXT","Next Message");
+
+//%%%%%%	File Name pmlite.php 	%%%%%
+define("_PM_SORRY","Sorry! You are not a registered user.");
+define("_PM_REGISTERNOW","Register Now!");
+define("_PM_GOBACK","Go Back");
+define("_PM_USERNOEXIST","The selected user doesn't exist in the database.");
+define("_PM_PLZTRYAGAIN","Please check the name and try again.");
+define("_PM_MESSAGEPOSTED","Your message has been posted");
+define("_PM_CLICKHERE","You can click here to view your private messages");
+define("_PM_ORCLOSEWINDOW","Or click here to close this window.");
+define("_PM_USERWROTE","%s wrote:");
+define("_PM_TO","To: ");
+define("_PM_SUBJECTC","Subject: ");
+define("_PM_MESSAGEC","Message: ");
+define("_PM_CLEAR","Clear");
+define("_PM_CANCELSEND","Cancel Send");
+define("_PM_SUBMIT","Submit");
+
+//%%%%%%	File Name viewpmsg.php 	%%%%%
+define("_PM_SUBJECT","Subject");
+define("_PM_DATE","Date");
+define("_PM_NOTREAD","Not Read");
+define("_PM_SEND","Send");
+define("_PM_DELETE","Delete");
+define("_PM_REPLY", "Reply");
+define("_PM_PLZREG","Please register first to send private messages!");
+
+define("_PM_ONLINE", "Online");
+?>
Index: /temp/test-xoops.ec-cube.net/html/language/english/mail_template/activated.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/language/english/mail_template/activated.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/language/english/mail_template/activated.tpl	(revision 405)
@@ -0,0 +1,12 @@
+Hello {X_UNAME},
+
+Your new account at {SITENAME} has been activated by the administrator.
+
+You can now login from the following URL with the password you have provided upon registration.
+
+{SITEURL}user.php
+
+-----------
+{SITENAME} ({SITEURL}) 
+webmaster
+{ADMINMAIL}
Index: /temp/test-xoops.ec-cube.net/html/language/english/mail_template/register.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/language/english/mail_template/register.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/language/english/mail_template/register.tpl	(revision 405)
@@ -0,0 +1,21 @@
+Hello {X_UNAME},
+
+Thanks for subscribing to {SITENAME}. As a registered member your can:
+- Send private messages among members
+- Participate in discussion boards
+- Get the latest news
+- Submit content
+- Much, much more....
+
+The email address ({X_UEMAIL}) has been used to register an account.
+
+To become a member of {SITENAME}, please confirm your
+request by clicking on the link below:
+
+{X_UACTLINK}
+
+-----------
+Best Regards
+{SITENAME}
+({SITEURL}) 
+{ADMINMAIL}
Index: /temp/test-xoops.ec-cube.net/html/language/english/mail_template/tellfriend.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/language/english/mail_template/tellfriend.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/language/english/mail_template/tellfriend.tpl	(revision 405)
@@ -0,0 +1,11 @@
+Hello {FRIEND_NAME},
+
+Your friend {YOUR_NAME} liked our site and wanted to show it to you.
+
+Site Name: {SITENAME}
+Site URL:  {SITEURL}
+
+-----------
+{SITENAME} ({SITEURL}) 
+webmaster
+{ADMINMAIL}
Index: /temp/test-xoops.ec-cube.net/html/language/english/mail_template/adminactivate.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/language/english/mail_template/adminactivate.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/language/english/mail_template/adminactivate.tpl	(revision 405)
@@ -0,0 +1,11 @@
+Hello {X_UNAME},
+
+A new user {USERNAME} ({USEREMAIL}) has just registered an account at {SITENAME}.
+Clicking on the link below will activate the account of this user:
+
+{USERACTLINK}
+
+-----------
+{SITENAME} ({SITEURL}) 
+webmaster
+{ADMINMAIL}
Index: /temp/test-xoops.ec-cube.net/html/language/english/mail_template/lostpass1.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/language/english/mail_template/lostpass1.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/language/english/mail_template/lostpass1.tpl	(revision 405)
@@ -0,0 +1,13 @@
+Hello {X_UNAME},
+
+A web user from {IP} has just requested a new password for your account at {SITENAME}.
+You can get your new password by clicking on the link below:
+
+{NEWPWD_LINK}
+
+If you didn't ask for this, don't worry. Just delete this Email.
+
+-----------
+{SITENAME} ({SITEURL}) 
+webmaster
+{ADMINMAIL}
Index: /temp/test-xoops.ec-cube.net/html/language/english/mail_template/comment_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/language/english/mail_template/comment_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/language/english/mail_template/comment_notify.tpl	(revision 405)
@@ -0,0 +1,20 @@
+Hello {X_UNAME},
+
+A comment has been added to the {X_ITEM_TYPE} "{X_ITEM_NAME}" you are monitoring in the {X_MODULE} module at our site.
+
+You can view the comment here:
+{X_COMMENT_URL}
+
+-----------
+
+You are receiving this message because you selected to be notified when comments are added to this {X_ITEM_TYPE}.
+
+If this is an error or you wish not to receive further such notifications, please update your subscriptions by visiting the link below:
+{X_UNSUBSCRIBE_URL}
+
+Please do not reply to this message.
+
+-----------
+{X_SITENAME} ({X_SITEURL}) 
+webmaster
+{X_ADMINMAIL}
Index: /temp/test-xoops.ec-cube.net/html/language/english/mail_template/lostpass2.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/language/english/mail_template/lostpass2.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/language/english/mail_template/lostpass2.tpl	(revision 405)
@@ -0,0 +1,15 @@
+Hello {X_UNAME},
+
+A web user from {IP} has just requested that password be sent.
+Here are your login details at {SITENAME}.
+
+Username: {X_UNAME}
+New Password: {NEWPWD}
+
+You can change it after you login at {SITEURL}user.php.
+If you didn't ask for this, don't worry. You are seeing this message, not 'them'. If this was an error, we are really sorry but please login with your new password.
+
+-----------
+{SITENAME} ({SITEURL}) 
+webmaster
+{ADMINMAIL}
Index: /temp/test-xoops.ec-cube.net/html/language/english/mail_template/default_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/language/english/mail_template/default_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/language/english/mail_template/default_notify.tpl	(revision 405)
@@ -0,0 +1,20 @@
+Hello {X_UNAME},
+
+The event {X_NOTIFY_EVENT} has occurred to the {X_ITEM_TYPE} "{X_ITEM_TILE}" you are monitoring in the {X_MODULE} module at our site.
+
+You can view the {X_ITEM_TYPE} here:
+{X_ITEM_URL}
+
+-----------
+
+You have subscribed to receive notifications of this sort.
+
+If this is an error or you wish not to receive further such notifications, please update your subscriptions by visiting the link below:
+{X_UNSUBSCRIBE_URL}
+
+Please do not reply to this message.
+
+-----------
+{X_SITENAME} ({X_SITEURL}) 
+webmaster
+{X_ADMINMAIL}
Index: /temp/test-xoops.ec-cube.net/html/language/english/mail_template/commentsubmit_notify.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/language/english/mail_template/commentsubmit_notify.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/language/english/mail_template/commentsubmit_notify.tpl	(revision 405)
@@ -0,0 +1,20 @@
+Hello {X_UNAME},
+
+A comment has been submitted (but not yet approved) to the {X_ITEM_TYPE} "{X_ITEM_NAME}" you are monitoring in the {X_MODULE} module at our site.
+
+You can view the comment here (if you have permission):
+{X_COMMENT_URL}
+
+-----------
+
+You are receiving this message because you selected to be notified when comments are submitted to this {X_ITEM_TYPE}.
+
+If this is an error or you wish not to receive further such notifications, please update your subscriptions by visiting the link below:
+{X_UNSUBSCRIBE_URL}
+
+Please do not reply to this message.
+
+-----------
+{X_SITENAME} ({X_SITEURL}) 
+webmaster
+{X_ADMINMAIL}
Index: /temp/test-xoops.ec-cube.net/html/language/english/admin.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/language/english/admin.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/language/english/admin.php	(revision 405)
@@ -0,0 +1,15 @@
+<?php
+// $Id: admin.php,v 1.2 2005/03/18 12:52:14 onokazu Exp $
+//%%%%%%	File Name  admin.php 	%%%%%
+define("_AD_NORIGHT","You don't have the right to access this area");
+define("_AD_ACTION","Action");
+define("_AD_EDIT","Edit");
+define("_AD_DELETE","Delete");
+define("_AD_LASTTENUSERS","Last 10 registered users");
+define("_AD_NICKNAME","Nickname");
+define("_AD_EMAIL","Email");
+define("_AD_AVATAR","Avatar");
+define("_AD_REGISTERED","Registered"); //Registered Date
+define('_AD_PRESSGEN', 'This is your first time to enter the administration section. Press the button below to proceed.');
+define('_AD_LOGINADMIN', 'Logging you in..');
+?>
Index: /temp/test-xoops.ec-cube.net/html/language/english/calendar.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/language/english/calendar.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/language/english/calendar.php	(revision 405)
@@ -0,0 +1,34 @@
+<?php
+// $Id: calendar.php,v 1.2 2005/03/18 12:52:14 onokazu Exp $
+//%%%%%		Time Zone	%%%%
+define("_CAL_SUNDAY", "Sunday");
+define("_CAL_MONDAY", "Monday");
+define("_CAL_TUESDAY", "Tuesday");
+define("_CAL_WEDNESDAY", "Wednesday");
+define("_CAL_THURSDAY", "Thursday");
+define("_CAL_FRIDAY", "Friday");
+define("_CAL_SATURDAY", "Saturday");
+define("_CAL_JANUARY", "January");
+define("_CAL_FEBRUARY", "February");
+define("_CAL_MARCH", "March");
+define("_CAL_APRIL", "April");
+define("_CAL_MAY", "May");
+define("_CAL_JUNE", "June");
+define("_CAL_JULY", "July");
+define("_CAL_AUGUST", "August");
+define("_CAL_SEPTEMBER", "September");
+define("_CAL_OCTOBER", "October");
+define("_CAL_NOVEMBER", "November");
+define("_CAL_DECEMBER", "December");
+define("_CAL_TGL1STD", "Toggle first day of week");
+define("_CAL_PREVYR", "Prev. year (hold for menu)");
+define("_CAL_PREVMNTH", "Prev. month (hold for menu)");
+define("_CAL_GOTODAY", "Go Today");
+define("_CAL_NXTMNTH", "Next month (hold for menu)");
+define("_CAL_NEXTYR", "Next year (hold for menu)");
+define("_CAL_SELDATE", "Select date");
+define("_CAL_DRAGMOVE", "Drag to move");
+define("_CAL_TODAY", "Today");
+define("_CAL_DISPM1ST", "Display Monday first");
+define("_CAL_DISPS1ST", "Display Sunday first");
+?>
Index: /temp/test-xoops.ec-cube.net/html/language/english/timezone.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/language/english/timezone.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/language/english/timezone.php	(revision 405)
@@ -0,0 +1,34 @@
+<?php
+// $Id: timezone.php,v 1.2 2005/03/18 12:52:14 onokazu Exp $
+//%%%%%		Time Zone	%%%%
+define("_TZ_GMTM12", "(GMT-12:00) Eniwetok, Kwajalein");
+define("_TZ_GMTM11", "(GMT-11:00) Midway Island, Samoa");
+define("_TZ_GMTM10", "(GMT-10:00) Hawaii");
+define("_TZ_GMTM9", "(GMT-9:00) Alaska");
+define("_TZ_GMTM8", "(GMT-8:00) Pacific Time (US &amp; Canada)");
+define("_TZ_GMTM7", "(GMT-7:00) Mountain Time (US &amp; Canada)");
+define("_TZ_GMTM6", "(GMT-6:00) Central Time (US &amp; Canada), Mexico City");
+define("_TZ_GMTM5", "(GMT-5:00) Eastern Time (US &amp; Canada), Bogota, Lima, Quito");
+define("_TZ_GMTM4", "(GMT-4:00) Atlantic Time (Canada), Caracas, La Paz");
+define("_TZ_GMTM35", "(GMT-3:30) Newfoundland");
+define("_TZ_GMTM3", "(GMT-3:00) Brasilia, Buenos Aires, Georgetown");
+define("_TZ_GMTM2", "(GMT-2:00) Mid-Atlantic");
+define("_TZ_GMTM1", "(GMT-1:00) Azores, Cape Verde Islands");
+define("_TZ_GMT0", "(GMT) Greenwich Mean Time, London, Dublin, Lisbon, Casablanca, Monrovia");
+define("_TZ_GMTP1", "(GMT+1:00) Amsterdam, Berlin, Rome, Copenhagen, Brussels, Madrid, Paris");
+define("_TZ_GMTP2", "(GMT+2:00) Athens, Istanbul, Minsk, Helsinki, Jerusalem, South Africa");
+define("_TZ_GMTP3", "(GMT+3:00) Baghdad, Kuwait, Riyadh, Moscow, St. Petersburg");
+define("_TZ_GMTP35", "(GMT+3:30) Tehran");
+define("_TZ_GMTP4", "(GMT+4:00) Abu Dhabi, Muscat, Baku, Tbilisi");
+define("_TZ_GMTP45", "(GMT+4:30) Kabul");
+define("_TZ_GMTP5", "(GMT+5:00) Ekaterinburg, Islamabad, Karachi, Tashkent");
+define("_TZ_GMTP55", "(GMT+5:30) Bombay, Calcutta, Madras, New Delhi");
+define("_TZ_GMTP6", "(GMT+6:00) Almaty, Dhaka, Colombo");
+define("_TZ_GMTP7", "(GMT+7:00) Bangkok, Hanoi, Jakarta");
+define("_TZ_GMTP8", "(GMT+8:00) Beijing, Perth, Singapore, Hong Kong, Urumqi, Taipei");
+define("_TZ_GMTP9", "(GMT+9:00) Tokyo, Seoul, Osaka, Sapporo, Yakutsk");
+define("_TZ_GMTP95", "(GMT+9:30) Adelaide, Darwin");
+define("_TZ_GMTP10", "(GMT+10:00) Brisbane, Canberra, Melbourne, Sydney, Guam,Vlasdiostok");
+define("_TZ_GMTP11", "(GMT+11:00) Magadan, Solomon Islands, New Caledonia");
+define("_TZ_GMTP12", "(GMT+12:00) Auckland, Wellington, Fiji, Kamchatka, Marshall Island");
+?>
Index: /temp/test-xoops.ec-cube.net/html/language/english/misc.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/language/english/misc.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/language/english/misc.php	(revision 405)
@@ -0,0 +1,24 @@
+<?php
+// $Id: misc.php,v 1.2 2005/03/18 12:52:14 onokazu Exp $
+define("_MSC_YOURNAMEC","Your Name: ");
+define("_MSC_YOUREMAILC","Your Email: ");
+define("_MSC_FRIENDNAMEC","Friend Name: ");
+define("_MSC_FRIENDEMAILC","Friend Email: ");
+define("_MSC_RECOMMENDSITE","Recommend this Site to a Friend");
+// %s is your site name
+define("_MSC_INTSITE","Interesting Site: %s");
+define("_MSC_REFERENCESENT","The reference to our site has been sent to your friend. Thanks!");
+define("_MSC_ENTERYNAME","Please enter your name");
+define("_MSC_ENTERFNAME","Please enter your friend's name");
+define("_MSC_ENTERFMAIL","Please enter your friend's email address");
+define("_MSC_NEEDINFO","You need to enter required info!");
+define("_MSC_INVALIDEMAIL1","The email address you provided is not a valid address.");
+define("_MSC_INVALIDEMAIL2","Please check the address and try again.");
+
+define("_MSC_AVAVATARS","Available Avatars");
+
+define("_MSC_SMILIES","Smilies");
+define("_MSC_CLICKASMILIE","Click a smilie to insert it into your message.");
+define("_MSC_CODE","Code");
+define("_MSC_EMOTION","Emotion");
+?>
Index: /temp/test-xoops.ec-cube.net/html/language/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/language/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/language/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/include/checklogin.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/include/checklogin.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/include/checklogin.php	(revision 405)
@@ -0,0 +1,130 @@
+<?php
+// $Id: checklogin.php,v 1.6.2.1 2006/07/27 00:34:59 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.xoops.org/ http://jp.xoops.org/  http://www.myweb.ne.jp/  //
+// Project: The XOOPS Project (http://www.xoops.org/)                        //
+// ------------------------------------------------------------------------- //
+
+if (!defined('XOOPS_ROOT_PATH')) {
+    exit();
+}
+include_once XOOPS_ROOT_PATH.'/language/'.$xoopsConfig['language'].'/user.php';
+$uname = !isset($_POST['uname']) ? '' : trim($_POST['uname']);
+$pass = !isset($_POST['pass']) ? '' : trim($_POST['pass']);
+if ($uname == '' || $pass == '') {
+    redirect_header(XOOPS_URL.'/user.php', 1, _US_INCORRECTLOGIN);
+    exit();
+}
+$member_handler =& xoops_gethandler('member');
+$myts =& MyTextsanitizer::getInstance();
+//$user =& $member_handler->loginUser(addslashes($myts->stripSlashesGPC($uname)), $myts->stripSlashesGPC($pass));
+// uname&email hack GIJ
+$uname4sql = addslashes( $myts->stripSlashesGPC($uname) ) ;
+$pass = $myts->stripSlashesGPC($pass) ;
+if( strstr( $uname , '@' ) ) {
+	// check by email if uname includes '@'
+	$criteria = new CriteriaCompo(new Criteria('email', $uname4sql ));
+	$criteria->add(new Criteria('pass', md5( $pass )));
+	$user_handler =& xoops_gethandler('user');
+	$users =& $user_handler->getObjects($criteria, false);
+	if( empty( $users ) || count( $users ) != 1 ) $user = false ;
+	else $user = $users[0] ;
+	unset( $users ) ;
+}
+if( empty( $user ) || ! is_object( $user ) ) {
+	$user =& $member_handler->loginUser($uname4sql,$pass);
+}
+// end of uname&email hack GIJ
+
+if (false != $user) {
+    if (0 == $user->getVar('level')) {
+        redirect_header(XOOPS_URL.'/index.php', 5, _US_NOACTTPADM);
+        exit();
+    }
+    if ($xoopsConfig['closesite'] == 1) {
+        $allowed = false;
+        foreach ($user->getGroups() as $group) {
+            if (in_array($group, $xoopsConfig['closesite_okgrp']) || XOOPS_GROUP_ADMIN == $group) {
+                $allowed = true;
+                break;
+            }
+        }
+        if (!$allowed) {
+            redirect_header(XOOPS_URL.'/index.php', 1, _NOPERM);
+            exit();
+        }
+    }
+    $user->setVar('last_login', time());
+    if (!$member_handler->insertUser($user)) {
+    }
+    require_once XOOPS_ROOT_PATH . '/include/session.php';
+    xoops_session_regenerate();
+    $_SESSION = array();
+    $_SESSION['xoopsUserId'] = $user->getVar('uid');
+    $_SESSION['xoopsUserGroups'] = $user->getGroups();
+    if ($xoopsConfig['use_mysession'] && $xoopsConfig['session_name'] != '') {
+        setcookie($xoopsConfig['session_name'], session_id(), time()+(60 * $xoopsConfig['session_expire']), '/',  '', 0);
+    }
+    $user_theme = $user->getVar('theme');
+    if (in_array($user_theme, $xoopsConfig['theme_set_allowed'])) {
+        $_SESSION['xoopsUserTheme'] = $user_theme;
+    }
+    if (!empty($_POST['xoops_redirect']) && !strpos($_POST['xoops_redirect'], 'register')) {
+        $parsed = parse_url(XOOPS_URL);
+        $url = isset($parsed['scheme']) ? $parsed['scheme'].'://' : 'http://';
+        if (isset($parsed['host'])) {
+            $url .= isset($parsed['port']) ?$parsed['host'].':'.$parsed['port'].trim($_POST['xoops_redirect']): $parsed['host'].trim($_POST['xoops_redirect']);
+        } else {
+            $url .= xoops_getenv('HTTP_HOST').trim($_POST['xoops_redirect']);
+        }
+    } else {
+        $url = XOOPS_URL.'/index.php';
+    }
+
+	// autologin hack V3.1 GIJ (set cookie)
+	$xoops_cookie_path = defined('XOOPS_COOKIE_PATH') ? XOOPS_COOKIE_PATH : preg_replace( '?http://[^/]+(/.*)$?' , "$1" , XOOPS_URL ) ;
+	if( $xoops_cookie_path == XOOPS_URL ) $xoops_cookie_path = '/' ;
+	if (!empty($_POST['rememberme'])) {
+		$expire = time() + ( defined('XOOPS_AUTOLOGIN_LIFETIME') ? XOOPS_AUTOLOGIN_LIFETIME : 604800 ) ; // 1 week default
+		setcookie('autologin_uname', $user->getVar('uname'), $expire, $xoops_cookie_path, '', 0);
+		$Ynj = date( 'Y-n-j' ) ;
+		setcookie('autologin_pass', $Ynj . ':' . md5( $user->getVar('pass') . XOOPS_DB_PASS . XOOPS_DB_PREFIX . $Ynj ) , $expire, $xoops_cookie_path, '', 0);
+	}
+	// end of autologin hack V3.1 GIJ
+
+    // RMV-NOTIFY
+    // Perform some maintenance of notification records
+    $notification_handler =& xoops_gethandler('notification');
+    $notification_handler->doLoginMaintenance($user->getVar('uid'));
+
+    redirect_header($url, 1, sprintf(_US_LOGGINGU, $user->getVar('uname')));
+} else {
+
+    redirect_header(XOOPS_URL.'/user.php',1,_US_INCORRECTLOGIN);
+}
+exit();
+?>
Index: /temp/test-xoops.ec-cube.net/html/include/calendarjs.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/include/calendarjs.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/include/calendarjs.php	(revision 405)
@@ -0,0 +1,91 @@
+<?php
+if (!defined('XOOPS_ROOT_PATH')) {
+    exit();
+}
+include_once XOOPS_ROOT_PATH.'/language/'.$GLOBALS['xoopsConfig']['language'].'/calendar.php';
+?>
+<link rel="stylesheet" type="text/css" media="all" href="<?php echo XOOPS_URL;?>/include/calendar-blue.css" />
+<script type="text/javascript" src="<?php echo XOOPS_URL.'/include/calendar.js';?>"></script>
+<script type="text/javascript">
+<!--
+var calendar = null;
+
+function selected(cal, date) {
+  cal.sel.value = date;
+}
+
+function closeHandler(cal) {
+  cal.hide();
+  Calendar.removeEvent(document, "mousedown", checkCalendar);
+}
+
+function checkCalendar(ev) {
+  var el = Calendar.is_ie ? Calendar.getElement(ev) : Calendar.getTargetElement(ev);
+  for (; el != null; el = el.parentNode)
+    if (el == calendar.element || el.tagName == "A") break;
+  if (el == null) {
+    calendar.callCloseHandler(); Calendar.stopEvent(ev);
+  }
+}
+function showCalendar(id) {
+  var el = xoopsGetElementById(id);
+  if (calendar != null) {
+    calendar.hide();
+  } else {
+    var cal = new Calendar(true, <?php if (isset($jstime)) { echo $jstime; } else { echo 'null';}?>, selected, closeHandler);
+    calendar = cal;
+    cal.setRange(2000, 2015);
+    calendar.create();
+  }
+  calendar.sel = el;
+  calendar.parseDate(el.value);
+  calendar.showAtElement(el);
+  Calendar.addEvent(document, "mousedown", checkCalendar);
+  return false;
+}
+
+Calendar._DN = new Array
+("<?php echo _CAL_SUNDAY;?>",
+ "<?php echo _CAL_MONDAY;?>",
+ "<?php echo _CAL_TUESDAY;?>",
+ "<?php echo _CAL_WEDNESDAY;?>",
+ "<?php echo _CAL_THURSDAY;?>",
+ "<?php echo _CAL_FRIDAY;?>",
+ "<?php echo _CAL_SATURDAY;?>",
+ "<?php echo _CAL_SUNDAY;?>");
+Calendar._MN = new Array
+("<?php echo _CAL_JANUARY;?>",
+ "<?php echo _CAL_FEBRUARY;?>",
+ "<?php echo _CAL_MARCH;?>",
+ "<?php echo _CAL_APRIL;?>",
+ "<?php echo _CAL_MAY;?>",
+ "<?php echo _CAL_JUNE;?>",
+ "<?php echo _CAL_JULY;?>",
+ "<?php echo _CAL_AUGUST;?>",
+ "<?php echo _CAL_SEPTEMBER;?>",
+ "<?php echo _CAL_OCTOBER;?>",
+ "<?php echo _CAL_NOVEMBER;?>",
+ "<?php echo _CAL_DECEMBER;?>");
+
+Calendar._TT = {};
+Calendar._TT["TOGGLE"] = "<?php echo _CAL_TGL1STD;?>";
+Calendar._TT["PREV_YEAR"] = "<?php echo _CAL_PREVYR;?>";
+Calendar._TT["PREV_MONTH"] = "<?php echo _CAL_PREVMNTH;?>";
+Calendar._TT["GO_TODAY"] = "<?php echo _CAL_GOTODAY;?>";
+Calendar._TT["NEXT_MONTH"] = "<?php echo _CAL_NXTMNTH;?>";
+Calendar._TT["NEXT_YEAR"] = "<?php echo _CAL_NEXTYR;?>";
+Calendar._TT["SEL_DATE"] = "<?php echo _CAL_SELDATE;?>";
+Calendar._TT["DRAG_TO_MOVE"] = "<?php echo _CAL_DRAGMOVE;?>";
+Calendar._TT["PART_TODAY"] = "(<?php echo _CAL_TODAY;?>)";
+Calendar._TT["MON_FIRST"] = "<?php echo _CAL_DISPM1ST;?>";
+Calendar._TT["SUN_FIRST"] = "<?php echo _CAL_DISPS1ST;?>";
+Calendar._TT["CLOSE"] = "<?php echo _CLOSE;?>";
+Calendar._TT["TODAY"] = "<?php echo _CAL_TODAY;?>";
+
+// date formats
+Calendar._TT["DEF_DATE_FORMAT"] = "y-mm-dd";
+Calendar._TT["TT_DATE_FORMAT"] = "y-mm-dd";
+
+Calendar._TT["WK"] = "";
+//-->
+</script>
Index: /temp/test-xoops.ec-cube.net/html/include/old_functions.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/include/old_functions.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/include/old_functions.php	(revision 405)
@@ -0,0 +1,209 @@
+<?php
+// #################### Block functions from here ##################
+
+/*
+ * Purpose : Builds the blocks on both sides
+ * Input   : $side = On wich side should the block are displayed?
+ *             0, l, left : On the left side
+ *             1, r, right: On the right side
+ *             other:   Only on one side (
+ *                          Call from theme.php makes all blocks on the left side
+ *                          and from theme.php for the right site)
+ */
+function make_sidebar($side)
+{
+	global $xoopsUser;
+	$xoopsblock = new XoopsBlock();
+	if ($side == "left") {
+		$side = XOOPS_SIDEBLOCK_LEFT;
+	} elseif ($side == "right") {
+		$side = XOOPS_SIDEBLOCK_RIGHT;
+	} else {
+		$side = XOOPS_SIDEBLOCK_BOTH;
+	}
+	if (is_object($xoopsUser)) {
+		$block_arr =& $xoopsblock->getAllBlocksByGroup($xoopsUser->getGroups(), true, $side, XOOPS_BLOCK_VISIBLE);
+	} else {
+		$block_arr =& $xoopsblock->getAllBlocksByGroup(XOOPS_GROUP_ANONYMOUS, true, $side, XOOPS_BLOCK_VISIBLE);
+	}
+
+	$block_count = count($block_arr);
+	if (!isset($GLOBALS['xoopsTpl']) || !is_object($GLOBALS['xoopsTpl'])) {
+		include_once XOOPS_ROOT_PATH.'/class/template.php';
+		$xoopsTpl = new XoopsTpl();
+	} else {
+		$xoopsTpl =& $GLOBALS['xoopsTpl'];
+	}
+	$xoopsLogger =& XoopsLogger::instance();
+	for ($i = 0; $i < $block_count; $i++) {
+		$bcachetime = intval($block_arr[$i]->getVar('bcachetime'));
+		if (empty($bcachetime)) {
+			$xoopsTpl->xoops_setCaching(0);
+		} else {
+			$xoopsTpl->xoops_setCaching(2);
+			$xoopsTpl->xoops_setCacheTime($bcachetime);
+		}
+		$btpl = $block_arr[$i]->getVar('template');
+		if ($btpl != '') {
+			if (empty($bcachetime) || !$xoopsTpl->is_cached('db:'.$btpl)) {
+				$xoopsLogger->addBlock($block_arr[$i]->getVar('name'));
+				$bresult =& $block_arr[$i]->buildBlock();
+				if (!$bresult) {
+					continue;
+				}
+				$xoopsTpl->assign_by_ref('block', $bresult);
+				$bcontent =& $xoopsTpl->fetch('db:'.$btpl);
+				$xoopsTpl->clear_assign('block');
+			} else {
+				$xoopsLogger->addBlock($block_arr[$i]->getVar('name'), true, $bcachetime);
+				$bcontent =& $xoopsTpl->fetch('db:'.$btpl);
+			}
+		} else {
+			$bid = $block_arr[$i]->getVar('bid');
+			if (empty($bcachetime) || !$xoopsTpl->is_cached('db:system_dummy.html', 'blk_'.$bid)) {
+				$xoopsLogger->addBlock($block_arr[$i]->getVar('name'));
+				$bresult =& $block_arr[$i]->buildBlock();
+				if (!$bresult) {
+					continue;
+				}
+				$xoopsTpl->assign_by_ref('dummy_content', $bresult['content']);
+				$bcontent =& $xoopsTpl->fetch('db:system_dummy.html', 'blk_'.$bid);
+				$xoopsTpl->clear_assign('block');
+			} else {
+				$xoopsLogger->addBlock($block_arr[$i]->getVar('name'), true, $bcachetime);
+				$bcontent =& $xoopsTpl->fetch('db:system_dummy.html', 'blk_'.$bid);
+			}
+		}
+		switch ($block_arr[$i]->getVar('side')) {
+		case XOOPS_SIDEBLOCK_LEFT:
+			themesidebox($block_arr[$i]->getVar('title'), $bcontent);
+			break;
+		case XOOPS_SIDEBLOCK_RIGHT:
+			if (function_exists("themesidebox_right")) {
+				themesidebox_right($block_arr[$i]->getVar('title'), $bcontent);
+			} else {
+				themesidebox($block_arr[$i]->getVar('title'), $bcontent);
+			}
+			break;
+		}
+		unset($bcontent);
+	}
+}
+
+/*
+ * Function to display center block
+ */
+function make_cblock()
+{
+	global $xoopsUser, $xoopsOption;
+	$xoopsblock = new XoopsBlock();
+	$cc_block = $cl_block = $cr_block = "";
+	$arr = array();
+	if ($xoopsOption['theme_use_smarty'] == 0) {
+		if (!isset($GLOBALS['xoopsTpl']) || !is_object($GLOBALS['xoopsTpl'])) {
+			include_once XOOPS_ROOT_PATH.'/class/template.php';
+			$xoopsTpl = new XoopsTpl();
+		} else {
+			$xoopsTpl =& $GLOBALS['xoopsTpl'];
+		}
+		if (is_object($xoopsUser)) {
+			$block_arr =& $xoopsblock->getAllBlocksByGroup($xoopsUser->getGroups(), true, XOOPS_CENTERBLOCK_ALL, XOOPS_BLOCK_VISIBLE);
+		} else {
+			$block_arr =& $xoopsblock->getAllBlocksByGroup(XOOPS_GROUP_ANONYMOUS, true, XOOPS_CENTERBLOCK_ALL, XOOPS_BLOCK_VISIBLE);
+		}
+		$block_count = count($block_arr);
+		$xoopsLogger =& XoopsLogger::instance();
+		for ($i = 0; $i < $block_count; $i++) {
+			$bcachetime = intval($block_arr[$i]->getVar('bcachetime'));
+			if (empty($bcachetime)) {
+				$xoopsTpl->xoops_setCaching(0);
+			} else {
+				$xoopsTpl->xoops_setCaching(2);
+				$xoopsTpl->xoops_setCacheTime($bcachetime);
+			}
+			$btpl = $block_arr[$i]->getVar('template');
+			if ($btpl != '') {
+				if (empty($bcachetime) || !$xoopsTpl->is_cached('db:'.$btpl)) {
+					$xoopsLogger->addBlock($block_arr[$i]->getVar('name'));
+					$bresult =& $block_arr[$i]->buildBlock();
+					if (!$bresult) {
+						continue;
+					}
+					$xoopsTpl->assign_by_ref('block', $bresult);
+					$bcontent =& $xoopsTpl->fetch('db:'.$btpl);
+					$xoopsTpl->clear_assign('block');
+				} else {
+					$xoopsLogger->addBlock($block_arr[$i]->getVar('name'), true, $bcachetime);
+					$bcontent =& $xoopsTpl->fetch('db:'.$btpl);
+				}
+			} else {
+				$bid = $block_arr[$i]->getVar('bid');
+				if (empty($bcachetime) || !$xoopsTpl->is_cached('db:system_dummy.html', 'blk_'.$bid)) {
+					$xoopsLogger->addBlock($block_arr[$i]->getVar('name'));
+					$bresult =& $block_arr[$i]->buildBlock();
+					if (!$bresult) {
+						continue;
+					}
+					$xoopsTpl->assign_by_ref('dummy_content', $bresult['content']);
+					$bcontent =& $xoopsTpl->fetch('db:system_dummy.html', 'blk_'.$bid);
+					$xoopsTpl->clear_assign('block');
+				} else {
+					$xoopsLogger->addBlock($block_arr[$i]->getVar('name'), true, $bcachetime);
+					$bcontent =& $xoopsTpl->fetch('db:system_dummy.html', 'blk_'.$bid);
+				}
+			}
+			$title = $block_arr[$i]->getVar('title');
+			switch ($block_arr[$i]->getVar('side')) {
+			case XOOPS_CENTERBLOCK_CENTER:
+				if ($title != "") {
+					$cc_block .= '<tr valign="top"><td colspan="2"><b>'.$title.'</b><hr />'.$bcontent.'<br /><br /></td></tr>'."\n";
+				} else {
+					$cc_block .= '<tr><td colspan="2">'.$bcontent.'<br /><br /></td></tr>'."\n";
+				}
+				break;
+			case XOOPS_CENTERBLOCK_LEFT:
+				if ($title != "") {
+					$cl_block .= '<p><b>'.$title.'</b><hr />'.$bcontent.'</p>'."\n";
+				} else {
+					$cl_block .= '<p>'.$bcontent.'</p>'."\n";
+				}
+				break;
+			case XOOPS_CENTERBLOCK_RIGHT:
+				if ($title != "") {
+					$cr_block .= '<p><b>'.$title.'</b><hr />'.$bcontent.'</p>'."\n";
+				} else {
+					$cr_block .= '<p>'.$bcontent.'</p>'."\n";
+				}
+				break;
+			default:
+				break;
+			}
+			unset($bcontent, $title);
+		}
+		echo '<table width="100%">'.$cc_block.'<tr valign="top"><td width="50%">'.$cl_block.'</td><td width="50%">'.$cr_block.'</td></tr></table>'."\n";
+	}
+}
+
+function openThread($width="100%")
+{
+	echo "<table border='0' cellpadding='0' cellspacing='0' align='center' width='$width'><tr><td class='bg2'><table border='0' cellpadding='4' cellspacing='1' width='100%'><tr class='bg3' align='left'><td class='bg3' width='20%'>". _CM_POSTER ."</td><td class='bg3'>". _CM_THREAD ."</td></tr>";
+}
+
+function showThread($color_number, $subject_image, $subject, $text, $post_date, $ip_image, $reply_image, $edit_image, $delete_image, $username="", $rank_title="", $rank_image="", $avatar_image="", $reg_date="", $posts="", $user_from="", $online_image="", $profile_image="", $pm_image="", $email_image="", $www_image="", $icq_image="", $aim_image="", $yim_image="", $msnm_image="")
+{
+	if ( $color_number == 1 ) {
+		$bg = 'bg1';
+	} else {
+		$bg = 'bg3';
+	}
+	echo "<tr align='left'><td valign='top' class='$bg' nowrap='nowrap'><b>$username</b><br />$rank_title<br />$rank_image<br />$avatar_image<br /><br />$reg_date<br />$posts<br />$user_from<br /><br />$online_image</td>";
+	echo "<td valign='top' class='$bg'><table width='100%' border='0'><tr><td valign='top'>$subject_image&nbsp;<b>$subject</b></td><td align='right'>".$ip_image."".$reply_image."".$edit_image."".$delete_image."</td></tr>";
+	echo "<tr><td colspan='2'><p>$text</p></td></tr></table></td></tr>";
+	echo "<tr align='left'><td class='$bg' valign='middle'>$post_date</td><td class='$bg' valign='middle'>".$profile_image."".$pm_image."".$email_image."".$www_image."".$icq_image."".$aim_image."".$yim_image."".$msnm_image."</td></tr>";
+}
+
+function closeThread()
+{
+	echo '</table></td></tr></table>';
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/include/comment_post.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/include/comment_post.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/include/comment_post.php	(revision 405)
@@ -0,0 +1,427 @@
+<?php
+// $Id: comment_post.php,v 1.5 2005/08/03 12:39:11 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.xoops.org/ http://jp.xoops.org/  http://www.myweb.ne.jp/  //
+// Project: The XOOPS Project (http://www.xoops.org/)                        //
+// ------------------------------------------------------------------------- //
+
+if (!defined('XOOPS_ROOT_PATH') || !is_object($xoopsModule)) {
+    exit();
+}
+include_once XOOPS_ROOT_PATH.'/language/'.$xoopsConfig['language'].'/comment.php';
+include_once XOOPS_ROOT_PATH.'/include/comment_constants.php';
+$com_id = isset($_POST['com_id']) ? intval($_POST['com_id']) : 0;
+$extra_params = '';
+if ('system' == $xoopsModule->getVar('dirname')) {
+    if (empty($com_id)) {
+        exit();
+    }
+    $comment_handler =& xoops_gethandler('comment');
+    $comment =& $comment_handler->get($com_id);
+    $module_handler =& xoops_gethandler('module');
+    $module =& $module_handler->get($comment->getVar('com_modid'));
+    $comment_config = $module->getInfo('comments');
+    $com_modid = $module->getVar('mid');
+    $redirect_page = XOOPS_URL.'/modules/system/admin.php?fct=comments&amp;com_modid='.$com_modid.'&amp;com_itemid';
+    $moddir = $module->getVar('dirname');
+    unset($comment);
+} else {
+    if (XOOPS_COMMENT_APPROVENONE == $xoopsModuleConfig['com_rule']) {
+        exit();
+    }
+    $comment_config = $xoopsModule->getInfo('comments');
+    $com_modid = $xoopsModule->getVar('mid');
+    $redirect_page = $comment_config['pageName'].'?';
+    if (isset($comment_config['extraParams']) && is_array($comment_config['extraParams'])) {
+        $myts =& MyTextSanitizer::getInstance();
+        foreach ($comment_config['extraParams'] as $extra_param) {
+            $extra_params .= isset($_POST[$extra_param]) ? $extra_param.'='.$myts->stripSlashesGPC($_POST[$extra_param]).'&amp;' : $extra_param.'=&amp;';
+        }
+        $redirect_page .= $extra_params;
+    }
+    $redirect_page .= $comment_config['itemName'];
+    $comment_url = $redirect_page;
+    $moddir = $xoopsModule->getVar('dirname');
+}
+$op = '';
+if (!empty($_POST)) {
+
+    if (isset($_POST['com_dopost'])) {
+        $op = 'post';
+    } elseif (isset($_POST['com_dopreview'])) {
+        $op = 'preview';
+    }
+    if (isset($_POST['com_dodelete'])) {
+        $op = 'delete';
+    }
+
+//    if ($op == 'preview' || $op == 'post') {
+//        if (!xoops_token_validate()) {
+//            $op = '';
+//        }
+//    }
+
+    $com_mode = isset($_POST['com_mode']) ? htmlspecialchars(trim($_POST['com_mode']), ENT_QUOTES) : 'flat';
+    $com_order = isset($_POST['com_order']) ? intval($_POST['com_order']) : XOOPS_COMMENT_OLD1ST;
+    $com_itemid = isset($_POST['com_itemid']) ? intval($_POST['com_itemid']) : 0;
+    $com_pid = isset($_POST['com_pid']) ? intval($_POST['com_pid']) : 0;
+    $com_rootid = isset($_POST['com_rootid']) ? intval($_POST['com_rootid']) : 0;
+    $com_status = isset($_POST['com_status']) ? intval($_POST['com_status']) : 0;
+    $dosmiley = (isset($_POST['dosmiley']) && intval($_POST['dosmiley']) > 0) ? 1 : 0;
+    $doxcode = (isset($_POST['doxcode']) && intval($_POST['doxcode']) > 0) ? 1 : 0;
+    $dobr = (isset($_POST['dobr']) && intval($_POST['dobr']) > 0) ? 1 : 0;
+    $dohtml = (isset($_POST['dohtml']) && intval($_POST['dohtml']) > 0) ? 1 : 0;
+    $doimage = (isset($_POST['doimage']) && intval($_POST['doimage']) > 0) ? 1 : 0;
+    $com_icon = isset($_POST['com_icon']) ? trim($_POST['com_icon']) : '';
+    $noname = isset($_POST['noname']) ? intval($_POST['noname']) : 0;
+} else {
+    exit();
+}
+
+switch ( $op ) {
+
+case "delete":
+    include XOOPS_ROOT_PATH.'/include/comment_delete.php';
+    break;
+case "preview":
+    $myts =& MyTextSanitizer::getInstance();
+    $doimage = 1;
+    $com_title = $myts->htmlSpecialChars($myts->stripSlashesGPC($_POST['com_title']));
+    if ($dohtml != 0) {
+        if (is_object($xoopsUser)) {
+            if (!$xoopsUser->isAdmin($com_modid)) {
+                $sysperm_handler =& xoops_gethandler('groupperm');
+                if (!$sysperm_handler->checkRight('system_admin', XOOPS_SYSTEM_COMMENT, $xoopsUser->getGroups())) {
+                    $dohtml = 0;
+                }
+            }
+        } else {
+            $dohtml = 0;
+        }
+    }
+    $p_comment =& $myts->previewTarea($_POST['com_text'], $dohtml, $dosmiley, $doxcode, $doimage, $dobr);
+    $com_text = $myts->htmlSpecialChars($myts->stripSlashesGPC($_POST['com_text']));
+	//Added By viva(2006/06/08) --->
+    $com_poster_name = $myts->htmlSpecialChars($myts->stripSlashesGPC($_POST['com_poster_name']));
+	//Added By viva(2006/06/08) <---
+    if ($xoopsModule->getVar('dirname') != 'system') {
+        include XOOPS_ROOT_PATH.'/header.php';
+        themecenterposts($com_title, $p_comment);
+        include XOOPS_ROOT_PATH.'/include/comment_form.php';
+        include XOOPS_ROOT_PATH.'/footer.php';
+    } else {
+        xoops_cp_header();
+        themecenterposts($com_title, $p_comment);
+        include XOOPS_ROOT_PATH.'/include/comment_form.php';
+        xoops_cp_footer();
+    }
+    break;
+case "post":
+    $doimage = 1;
+    $comment_handler =& xoops_gethandler('comment');
+    $add_userpost = false;
+    $call_approvefunc = false;
+    $call_updatefunc = false;
+    // RMV-NOTIFY - this can be set to 'comment' or 'comment_submit'
+    $notify_event = false;
+    if (!empty($com_id)) {
+        $comment =& $comment_handler->get($com_id);
+        $accesserror = false;
+
+        if (is_object($xoopsUser)) {
+            $sysperm_handler =& xoops_gethandler('groupperm');
+            if ($xoopsUser->isAdmin($com_modid) || $sysperm_handler->checkRight('system_admin', XOOPS_SYSTEM_COMMENT, $xoopsUser->getGroups())) {
+                if (!empty($com_status) && $com_status != XOOPS_COMMENT_PENDING) {
+                    $old_com_status = $comment->getVar('com_status');
+                    $comment->setVar('com_status', $com_status);
+                    // if changing status from pending state, increment user post
+                    if (XOOPS_COMMENT_PENDING == $old_com_status) {
+                        $add_userpost = true;
+                        if (XOOPS_COMMENT_ACTIVE == $com_status) {
+                            $call_updatefunc = true;
+                            $call_approvefunc = true;
+                            // RMV-NOTIFY
+                            $notify_event = 'comment';
+                        }
+                    } elseif (XOOPS_COMMENT_HIDDEN == $old_com_status && XOOPS_COMMENT_ACTIVE == $com_status) {
+                        $call_updatefunc = true;
+                        // Comments can not be directly posted hidden,
+                        // no need to send notification here
+                    } elseif (XOOPS_COMMENT_ACTIVE == $old_com_status && XOOPS_COMMENT_HIDDEN == $com_status) {
+                        $call_updatefunc = true;
+                    }
+                }
+            } else {
+                $dohtml = 0;
+                if ($comment->getVar('com_uid') != $xoopsUser->getVar('uid')) {
+                    $accesserror = true;
+                }
+            }
+        } else {
+            $dohtml = 0;
+            $accesserror = true;
+        }
+        if (false != $accesserror) {
+            redirect_header($redirect_page.'='.$com_itemid.'&amp;com_id='.$com_id.'&amp;com_mode='.$com_mode.'&amp;com_order='.$com_order, 1, _NOPERM);
+            exit();
+        }
+    } else {
+        $comment = $comment_handler->create();
+        $comment->setVar('com_created', time());
+        $comment->setVar('com_pid', $com_pid);
+        $comment->setVar('com_itemid', $com_itemid);
+        $comment->setVar('com_rootid', $com_rootid);
+        $comment->setVar('com_ip', xoops_getenv('REMOTE_ADDR'));
+        if (is_object($xoopsUser)) {
+            $sysperm_handler =& xoops_gethandler('groupperm');
+            if ($xoopsUser->isAdmin($com_modid) || $sysperm_handler->checkRight('system_admin', XOOPS_SYSTEM_COMMENT, $xoopsUser->getGroups())) {
+                $comment->setVar('com_status', XOOPS_COMMENT_ACTIVE);
+                $add_userpost = true;
+                $call_approvefunc = true;
+                $call_updatefunc = true;
+                // RMV-NOTIFY
+                $notify_event = 'comment';
+            } else {
+                $dohtml = 0;
+                switch ($xoopsModuleConfig['com_rule']) {
+                case XOOPS_COMMENT_APPROVEALL:
+                case XOOPS_COMMENT_APPROVEUSER:
+                    $comment->setVar('com_status', XOOPS_COMMENT_ACTIVE);
+                    $add_userpost = true;
+                    $call_approvefunc = true;
+                    $call_updatefunc = true;
+                    // RMV-NOTIFY
+                    $notify_event = 'comment';
+                    break;
+                case XOOPS_COMMENT_APPROVEADMIN:
+                default:
+                    $comment->setVar('com_status', XOOPS_COMMENT_PENDING);
+                    $notify_event = 'comment_submit';
+                    break;
+                }
+            }
+            if (!empty($xoopsModuleConfig['com_anonpost']) && !empty($noname)) {
+                $uid = 0;
+            } else {
+                $uid = $xoopsUser->getVar('uid');
+            }
+        } else {
+            $dohtml = 0;
+            $uid = 0;
+            if ($xoopsModuleConfig['com_anonpost'] != 1) {
+                redirect_header($redirect_page.'='.$com_itemid.'&amp;com_id='.$com_id.'&amp;com_mode='.$com_mode.'&amp;com_order='.$com_order, 1, _NOPERM);
+                exit();
+            }
+        }
+        if ($uid == 0) {
+            switch ($xoopsModuleConfig['com_rule']) {
+            case XOOPS_COMMENT_APPROVEALL:
+                $comment->setVar('com_status', XOOPS_COMMENT_ACTIVE);
+                $add_userpost = true;
+                $call_approvefunc = true;
+                $call_updatefunc = true;
+                // RMV-NOTIFY
+                $notify_event = 'comment';
+                break;
+            case XOOPS_COMMENT_APPROVEADMIN:
+            case XOOPS_COMMENT_APPROVEUSER:
+            default:
+                $comment->setVar('com_status', XOOPS_COMMENT_PENDING);
+                // RMV-NOTIFY
+                $notify_event = 'comment_submit';
+                break;
+            }
+        }
+        $comment->setVar('com_uid', $uid);
+    }
+    $com_title = xoops_trim($_POST['com_title']);
+    $com_title = ($com_title == '') ? _NOTITLE : $com_title;
+
+
+	//Added By viva(2005/12/13) --->
+	$com_poster_name = "";
+	if( !empty($_POST['com_poster_name']) ) {
+		$com_poster_name = xoops_trim($_POST['com_poster_name']);
+	}
+	if(empty($com_poster_name)) {
+		global $xoopsUser;
+		if( !empty($xoopsUser) ) {
+			$com_poster_name = $xoopsUser->getVar('uname', 'E');
+		} else {
+		$com_poster_name = $GLOBALS['xoopsConfig']['anonymous'];
+		}
+	}
+	$comment->setVar('com_poster_name', $com_poster_name);
+	//Added By viva(2005/12/13) <---
+
+
+    $comment->setVar('com_title', $com_title);
+    $comment->setVar('com_text', $_POST['com_text']);
+    $comment->setVar('dohtml', $dohtml);
+    $comment->setVar('dosmiley', $dosmiley);
+    $comment->setVar('doxcode', $doxcode);
+    $comment->setVar('doimage', $doimage);
+    $comment->setVar('dobr', $dobr);
+    $comment->setVar('com_icon', $com_icon);
+    $comment->setVar('com_modified', time());
+    $comment->setVar('com_modid', $com_modid);
+    if (!empty($extra_params)) {
+        $comment->setVar('com_exparams', str_replace('&amp;', '&', $extra_params));
+    }
+    if (false != $comment_handler->insert($comment)) {
+        $newcid = $comment->getVar('com_id');
+
+        // set own id as root id if this is a top comment
+        if ($com_rootid == 0) {
+            $com_rootid = $newcid;
+            if (!$comment_handler->updateByField($comment, 'com_rootid', $com_rootid)) {
+                $comment_handler->delete($comment);
+                include XOOPS_ROOT_PATH.'/header.php';
+                xoops_error();
+                include XOOPS_ROOT_PATH.'/footer.php';
+            }
+        }
+
+        // call custom approve function if any
+        if (false != $call_approvefunc && isset($comment_config['callback']['approve']) && trim($comment_config['callback']['approve']) != '') {
+            $skip = false;
+            if (!function_exists($comment_config['callback']['approve'])) {
+                if (isset($comment_config['callbackFile'])) {
+                    $callbackfile = trim($comment_config['callbackFile']);
+                    if ($callbackfile != '' && file_exists(XOOPS_ROOT_PATH.'/modules/'.$moddir.'/'.$callbackfile)) {
+                        include_once XOOPS_ROOT_PATH.'/modules/'.$moddir.'/'.$callbackfile;
+                    }
+                    if (!function_exists($comment_config['callback']['approve'])) {
+                        $skip = true;
+                    }
+                } else {
+                    $skip = true;
+                }
+            }
+            if (!$skip) {
+                $comment_config['callback']['approve']($comment);
+            }
+        }
+
+        // call custom update function if any
+        if (false != $call_updatefunc && isset($comment_config['callback']['update']) && trim($comment_config['callback']['update']) != '') {
+            $skip = false;
+            if (!function_exists($comment_config['callback']['update'])) {
+                if (isset($comment_config['callbackFile'])) {
+                    $callbackfile = trim($comment_config['callbackFile']);
+                    if ($callbackfile != '' && file_exists(XOOPS_ROOT_PATH.'/modules/'.$moddir.'/'.$callbackfile)) {
+                        include_once XOOPS_ROOT_PATH.'/modules/'.$moddir.'/'.$callbackfile;
+                    }
+                    if (!function_exists($comment_config['callback']['update'])) {
+                        $skip = true;
+                    }
+                } else {
+                    $skip = true;
+                }
+            }
+            if (!$skip) {
+                $criteria = new CriteriaCompo(new Criteria('com_modid', $com_modid));
+                $criteria->add(new Criteria('com_itemid', $com_itemid));
+                $criteria->add(new Criteria('com_status', XOOPS_COMMENT_ACTIVE));
+                $comment_count = $comment_handler->getCount($criteria);
+                $func = $comment_config['callback']['update'];
+                call_user_func_array($func, array($com_itemid, $comment_count, $comment->getVar('com_id')));
+            }
+        }
+
+        // increment user post if needed
+        $uid = $comment->getVar('com_uid');
+        if ($uid > 0 && false != $add_userpost) {
+            $member_handler =& xoops_gethandler('member');
+            $poster =& $member_handler->getUser($uid);
+            if (is_object($poster)) {
+                $member_handler->updateUserByField($poster, 'posts', $poster->getVar('posts') + 1);
+            }
+        }
+
+        // RMV-NOTIFY
+        // trigger notification event if necessary
+        if ($notify_event) {
+            $not_modid = $com_modid;
+            include_once XOOPS_ROOT_PATH . '/include/notification_functions.php';
+            $not_catinfo =& notificationCommentCategoryInfo($not_modid);
+            $not_category = $not_catinfo['name'];
+            $not_itemid = $com_itemid;
+            $not_event = $notify_event;
+            // Build an ABSOLUTE URL to view the comment.  Make sure we
+            // point to a viewable page (i.e. not the system administration
+            // module).
+            $comment_tags = array();
+            if ('system' == $xoopsModule->getVar('dirname')) {
+                $module_handler =& xoops_gethandler('module');
+                $not_module =& $module_handler->get($not_modid);
+            } else {
+                $not_module =& $xoopsModule;
+            }
+            if (!isset($comment_url)) {
+                $com_config =& $not_module->getInfo('comments');
+                $comment_url = $com_config['pageName'] . '?';
+                if (isset($com_config['extraParams']) && is_array($com_config['extraParams'])) {
+                    $extra_params = '';
+                    foreach ($com_config['extraParams'] as $extra_param) {
+                        $extra_params .= isset($_POST[$extra_param]) ? $extra_param.'='.$_POST[$extra_param].'&amp;' : $extra_param.'=&amp;';
+                        //$extra_params .= isset($_GET[$extra_param]) ? $extra_param.'='.$_GET[$extra_param].'&amp;' : $extra_param.'=&amp;';
+                    }
+                    $comment_url .= $extra_params;
+                }
+                $comment_url .= $com_config['itemName'];
+            }
+            $comment_tags['X_COMMENT_URL'] = XOOPS_URL . '/modules/' . $not_module->getVar('dirname') . '/' .$comment_url . '=' . $com_itemid.'&amp;com_id='.$newcid.'&amp;com_rootid='.$com_rootid.'&amp;com_mode='.$com_mode.'&amp;com_order='.$com_order.'#comment'.$newcid;
+            $notification_handler =& xoops_gethandler('notification');
+            $notification_handler->triggerEvent ($not_category, $not_itemid, $not_event, $comment_tags, false, $not_modid);
+        }
+
+        if (!isset($comment_post_results)) {
+
+            // if the comment is active, redirect to posted comment
+            if ($comment->getVar('com_status') == XOOPS_COMMENT_ACTIVE) {
+                redirect_header($redirect_page.'='.$com_itemid.'&amp;com_id='.$newcid.'&amp;com_rootid='.$com_rootid.'&amp;com_mode='.$com_mode.'&amp;com_order='.$com_order.'#comment'.$newcid, 2, _CM_THANKSPOST);
+            } else {
+                // not active, so redirect to top comment page
+                redirect_header($redirect_page.'='.$com_itemid.'&amp;com_mode='.$com_mode.'&amp;com_order='.$com_order.'#comment'.$newcid, 2, _CM_THANKSPOST);
+            }
+        }
+    } else {
+        if (!isset($purge_comment_post_results)) {
+            include XOOPS_ROOT_PATH.'/header.php';
+            xoops_error($comment->getHtmlErrors());
+            include XOOPS_ROOT_PATH.'/footer.php';
+        } else {
+            $comment_post_results = $comment->getErrors();
+        }
+    }
+    break;
+default:
+    redirect_header(XOOPS_URL.'/',3);
+    break;
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/include/comment_edit.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/include/comment_edit.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/include/comment_edit.php	(revision 405)
@@ -0,0 +1,89 @@
+<?php
+// $Id: comment_edit.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.xoops.org/ http://jp.xoops.org/  http://www.myweb.ne.jp/  //
+// Project: The XOOPS Project (http://www.xoops.org/)                        //
+// ------------------------------------------------------------------------- //
+
+if (!defined('XOOPS_ROOT_PATH') || !is_object($xoopsModule)) {
+	exit();
+}
+
+//added By viva(2005/12/25) --->
+include_once XOOPS_ROOT_PATH.'/include/comment_constants.php';
+//added By viva(2005/12/25) <---
+if ('system' != $xoopsModule->getVar('dirname') && XOOPS_COMMENT_APPROVENONE == $xoopsModuleConfig['com_rule']) {
+	exit();
+}
+
+include_once XOOPS_ROOT_PATH.'/language/'.$xoopsConfig['language'].'/comment.php';
+$com_id = isset($_GET['com_id']) ? intval($_GET['com_id']) : 0;
+$com_mode = isset($_GET['com_mode']) ? htmlspecialchars(trim($_GET['com_mode']), ENT_QUOTES) : '';
+if ($com_mode == '') {
+	if (is_object($xoopsUser)) {
+		$com_mode = $xoopsUser->getVar('umode');
+	} else {
+		$com_mode = $xoopsConfig['com_mode'];
+	}
+}
+if (!isset($_GET['com_order'])) {
+	if (is_object($xoopsUser)) {
+		$com_order = $xoopsUser->getVar('uorder');
+	} else {
+		$com_order = $xoopsConfig['com_order'];
+	}
+} else {
+	$com_order = intval($_GET['com_order']);
+}
+$comment_handler =& xoops_gethandler('comment');
+$comment =& $comment_handler->get($com_id);
+$dohtml = $comment->getVar('dohtml');
+$dosmiley = $comment->getVar('dosmiley');
+$dobr = $comment->getVar('dobr');
+$doxcode = $comment->getVar('doxcode');
+$com_icon = $comment->getVar('com_icon');
+$com_itemid = $comment->getVar('com_itemid');
+$com_title = $comment->getVar('com_title', 'E');
+$com_text = $comment->getVar('com_text', 'E');
+$com_pid = $comment->getVar('com_pid');
+$com_status = $comment->getVar('com_status');
+$com_rootid = $comment->getVar('com_rootid');
+
+//Modified By viva(2005/12/25) --->
+$com_poster_name = $comment->getVar('com_poster_name');
+//Modified By viva(2005/12/25) <---
+
+if ($xoopsModule->getVar('dirname') != 'system') {
+	include XOOPS_ROOT_PATH.'/header.php';
+	include XOOPS_ROOT_PATH.'/include/comment_form.php';
+	include XOOPS_ROOT_PATH.'/footer.php';
+} else {
+	xoops_cp_header();
+	include XOOPS_ROOT_PATH.'/include/comment_form.php';
+	xoops_cp_footer();
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/include/functions.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/include/functions.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/include/functions.php	(revision 405)
@@ -0,0 +1,762 @@
+<?php
+// $Id: functions.php,v 1.7 2006/05/01 02:37:26 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+// ################## Various functions from here ################
+
+function xoops_header($closehead=true)
+{
+    global $xoopsConfig, $xoopsTheme, $xoopsConfigMetaFooter;
+    $myts =& MyTextSanitizer::getInstance();
+    if ($xoopsConfig['gzip_compression'] == 1) {
+        ob_start("ob_gzhandler");
+    } else {
+        ob_start();
+    }
+    if (!headers_sent()) {
+        header ('Content-Type:text/html; charset='._CHARSET);
+        header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
+        header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
+        header('Cache-Control: no-store, no-cache, max-age=1, s-maxage=1, must-revalidate, post-check=0, pre-check=0');
+        header("Pragma: no-cache");
+    }
+    echo "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>";
+
+    echo '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="'._LANGCODE.'" lang="'._LANGCODE.'">
+    <head>
+    <meta http-equiv="content-type" content="text/html; charset='._CHARSET.'" />
+    <meta http-equiv="content-language" content="'._LANGCODE.'" />
+    <meta name="robots" content="'.htmlspecialchars($xoopsConfigMetaFooter['meta_robots']).'" />
+    <meta name="keywords" content="'.htmlspecialchars($xoopsConfigMetaFooter['meta_keywords']).'" />
+    <meta name="description" content="'.htmlspecialchars($xoopsConfigMetaFooter['meta_desc']).'" />
+    <meta name="rating" content="'.htmlspecialchars($xoopsConfigMetaFooter['meta_rating']).'" />
+    <meta name="author" content="'.htmlspecialchars($xoopsConfigMetaFooter['meta_author']).'" />
+    <meta name="copyright" content="'.htmlspecialchars($xoopsConfigMetaFooter['meta_copyright']).'" />
+    <meta name="generator" content="XOOPS" />
+    <title>'.htmlspecialchars($xoopsConfig['sitename']).'</title>
+    <script type="text/javascript" src="'.XOOPS_URL.'/include/xoops.js"></script>
+    ';
+    $themecss = getcss($xoopsConfig['theme_set']);
+    echo '<link rel="stylesheet" type="text/css" media="all" href="'.XOOPS_URL.'/xoops.css" />';
+    if ($themecss) {
+        echo '<link rel="stylesheet" type="text/css" media="all" href="'.$themecss.'" />';
+        //echo '<style type="text/css" media="all"><!-- @import url('.$themecss.'); --></style>';
+    }
+    if ($closehead) {
+        echo '</head><body>';
+    }
+}
+
+function xoops_footer()
+{
+    echo '</body></html>';
+    ob_end_flush();
+}
+
+function xoops_error($msg, $title='')
+{
+    echo '
+    <div class="errorMsg">';
+    if ($title != '') {
+        echo '<h4>'.$title.'</h4>';
+    }
+    if (is_array($msg)) {
+        foreach ($msg as $m) {
+            echo $m.'<br />';
+        }
+    } else {
+        echo $msg;
+    }
+    echo '</div>';
+}
+
+function xoops_result($msg, $title='')
+{
+    echo '
+    <div class="resultMsg">';
+    if ($title != '') {
+        echo '<h4>'.$title.'</h4>';
+    }
+    if (is_array($msg)) {
+        foreach ($msg as $m) {
+            echo $m.'<br />';
+        }
+    } else {
+        echo $msg;
+    }
+    echo '</div>';
+}
+
+function xoops_confirm($hiddens, $action, $msg, $submit = '', $addToken = true)
+{
+    $submit = ($submit != '') ? trim($submit) : _SUBMIT;
+    echo '
+    <div class="confirmMsg">
+      <h4>'.$msg.'</h4>
+      <form method="post" action="'.$action.'">
+    ';
+    foreach ($hiddens as $name => $value) {
+        if (is_array($value)) {
+            foreach ($value as $caption => $newvalue) {
+                echo '<input type="radio" name="'.$name.'" value="'.htmlspecialchars($newvalue).'" /> '.$caption;
+            }
+            echo '<br />';
+        } else {
+            echo '<input type="hidden" name="'.$name.'" value="'.htmlspecialchars($value).'" />';
+        }
+    }
+    if ($addToken != false) {
+        $token=&XoopsMultiTokenHandler::quickCreate(XOOPS_TOKEN_DEFAULT);
+        echo $token->getHtml();
+    }
+    echo '
+        <input type="submit" name="confirm_submit" value="'.$submit.'" /> <input type="button" name="confirm_back" value="'._CANCEL.'" onclick="javascript:history.go(-1);" />
+      </form>
+    </div>
+    ';
+}
+
+/**
+ * @brief xoops_confirm alias [test]
+ */
+function xoops_token_confirm($hiddens, $action, $msg, $submit='')
+{
+    return xoops_confirm($hiddens, $action, $msg, $submit, true);
+}
+
+function xoops_confirm_validate()
+{
+    return XoopsMultiTokenHandler::quickValidate(XOOPS_TOKEN_DEFAULT);
+}
+
+function xoops_refcheck($docheck=1)
+{
+    $ref = xoops_getenv('HTTP_REFERER');
+    if ($docheck == 0) {
+        return true;
+    }
+    if ($ref == '') {
+        return false;
+    }
+    if (strpos($ref, XOOPS_URL) !== 0 ) {
+        return false;
+    }
+    return true;
+}
+
+function xoops_getUserTimestamp($time, $timeoffset="")
+{
+    global $xoopsConfig, $xoopsUser;
+    if ($timeoffset == '') {
+        if ($xoopsUser) {
+            $timeoffset = $xoopsUser->getVar("timezone_offset");
+        } else {
+            $timeoffset = $xoopsConfig['default_TZ'];
+        }
+    }
+    $usertimestamp = intval($time) + (intval($timeoffset) - $xoopsConfig['server_TZ'])*3600;
+    return $usertimestamp;
+}
+
+
+
+/*
+ * Function to display formatted times in user timezone
+ */
+function formatTimestamp($time, $format="l", $timeoffset="")
+{
+    global $xoopsConfig, $xoopsUser;
+    $usertimestamp = xoops_getUserTimestamp($time, $timeoffset);
+    switch (strtolower($format)) {
+    case 's':
+        $datestring = _SHORTDATESTRING;
+        break;
+    case 'm':
+        $datestring = _MEDIUMDATESTRING;
+        break;
+    case 'mysql':
+        $datestring = "Y-m-d H:i:s";
+        break;
+    case 'rss':
+        $datestring = "r";
+        break;
+    case 'l':
+        $datestring = _DATESTRING;
+        break;
+    default:
+        if ($format != '') {
+            $datestring = $format;
+        } else {
+            $datestring = _DATESTRING;
+        }
+        break;
+    }
+    return ucfirst(date($datestring, $usertimestamp));
+}
+
+/*
+ * Function to calculate server timestamp from user entered time (timestamp)
+ */
+function userTimeToServerTime($timestamp, $userTZ=null)
+{
+    global $xoopsConfig;
+    if (!isset($userTZ)) {
+        $userTZ = $xoopsConfig['default_TZ'];
+    }
+    $timestamp = $timestamp - (($userTZ - $xoopsConfig['server_TZ']) * 3600);
+    return $timestamp;
+}
+
+function xoops_makepass() {
+    $makepass = '';
+    $syllables = array("er","in","tia","wol","fe","pre","vet","jo","nes","al","len","son","cha","ir","ler","bo","ok","tio","nar","sim","ple","bla","ten","toe","cho","co","lat","spe","ak","er","po","co","lor","pen","cil","li","ght","wh","at","the","he","ck","is","mam","bo","no","fi","ve","any","way","pol","iti","cs","ra","dio","sou","rce","sea","rch","pa","per","com","bo","sp","eak","st","fi","rst","gr","oup","boy","ea","gle","tr","ail","bi","ble","brb","pri","dee","kay","en","be","se");
+    srand((double)microtime()*1000000);
+    for ($count = 1; $count <= 4; $count++) {
+        if (rand()%10 == 1) {
+            $makepass .= sprintf("%0.0f",(rand()%50)+1);
+        } else {
+            $makepass .= sprintf("%s",$syllables[rand()%62]);
+        }
+    }
+    return $makepass;
+}
+
+/*
+ * Functions to display dhtml loading image box
+ */
+function OpenWaitBox()
+{
+    echo "<div id='waitDiv' style='position:absolute;left:40%;top:50%;visibility:hidden;text-align: center;'>
+    <table cellpadding='6' border='2' class='bg2'>
+      <tr>
+        <td align='center'><b><big>" ._FETCHING."</big></b><br /><img src='".XOOPS_URL."/images/await.gif' alt='' /><br />" ._PLEASEWAIT."</td>
+      </tr>
+    </table>
+    </div>
+    <script type='text/javascript'>
+    <!--//
+    var DHTML = (document.getElementById || document.all || document.layers);
+    function ap_getObj(name) {
+        if (document.getElementById) {
+            return document.getElementById(name).style;
+        } else if (document.all) {
+            return document.all[name].style;
+        } else if (document.layers) {
+            return document.layers[name];
+        }
+    }
+    function ap_showWaitMessage(div,flag)  {
+        if (!DHTML) {
+            return;
+        }
+        var x = ap_getObj(div);
+        x.visibility = (flag) ? 'visible' : 'hidden';
+        if (!document.getElementById) {
+            if (document.layers) {
+                x.left=280/2;
+            }
+        }
+        return true;
+    }
+    ap_showWaitMessage('waitDiv', 1);
+    //-->
+    </script>";
+}
+
+function CloseWaitBox()
+{
+    echo "<script type='text/javascript'>
+    <!--//
+    ap_showWaitMessage('waitDiv', 0);
+    //-->
+    </script>
+    ";
+}
+
+function checkEmail($email,$antispam = false)
+{
+    if (!$email || !preg_match("/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+([\.][a-z0-9-]+)+$/i",$email)){
+        return false;
+    }
+    if ($antispam) {
+        $email = str_replace("@", " at ", $email);
+        $email = str_replace(".", " dot ", $email);
+        return $email;
+    } else {
+        return true;
+    }
+}
+
+function formatURL($url)
+{
+    $url = trim($url);
+    if ($url != '') {
+        if ((!preg_match("/^http[s]*:\/\//i", $url)) && (!preg_match("/^ftp*:\/\//i", $url)) && (!preg_match("/^ed2k*:\/\//i", $url)) ) {
+            $url = 'http://'.$url;
+        }
+    }
+    return $url;
+}
+
+/*
+ * Function to display banners in all pages
+ */
+function showbanner()
+{
+    echo xoops_getbanner();
+}
+
+/*
+ * Function to get banner html tags for use in templates
+ */
+function xoops_getbanner()
+{
+    global $xoopsConfig;
+    $db =& Database::getInstance();
+    $bresult = $db->query("SELECT COUNT(*) FROM ".$db->prefix("banner"));
+    list ($numrows) = $db->fetchRow($bresult);
+    if ( $numrows > 1 ) {
+        $numrows = $numrows-1;
+        mt_srand((double)microtime()*1000000);
+        $bannum = mt_rand(0, $numrows);
+    } else {
+        $bannum = 0;
+    }
+    if ( $numrows > 0 ) {
+        $bresult = $db->query("SELECT * FROM ".$db->prefix("banner"), 1, $bannum);
+        list ($bid, $cid, $imptotal, $impmade, $clicks, $imageurl, $clickurl, $date, $htmlbanner, $htmlcode) = $db->fetchRow($bresult);
+        if ($xoopsConfig['my_ip'] == xoops_getenv('REMOTE_ADDR')) {
+            // EMPTY
+        } else {
+            $db->queryF(sprintf("UPDATE %s SET impmade = impmade+1 WHERE bid = %u", $db->prefix("banner"), $bid));
+        }
+        /* Check if this impression is the last one and print the banner */
+        if ( $imptotal == $impmade ) {
+            $newid = $db->genId($db->prefix("bannerfinish")."_bid_seq");
+            $sql = sprintf("INSERT INTO %s (bid, cid, impressions, clicks, datestart, dateend) VALUES (%u, %u, %u, %u, %u, %u)", $db->prefix("bannerfinish"), $newid, $cid, $impmade, $clicks, $date, time());
+            $db->queryF($sql);
+            $db->queryF(sprintf("DELETE FROM %s WHERE bid = %u", $db->prefix("banner"), $bid));
+        }
+        if ($htmlbanner){
+            $bannerobject = $htmlcode;
+        }else{
+            $bannerobject = '<div><a href="'.XOOPS_URL.'/banners.php?op=click&amp;bid='.$bid.'" target="_blank">';
+            if (stristr($imageurl, '.swf')) {
+                $bannerobject = $bannerobject
+                    .'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" width="468" height="60">'
+                    .'<param name="movie" value="'.$imageurl.'"></param>'
+                    .'<param name="quality" value="high"></param>'
+                    .'<embed src="'.$imageurl.'" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"; type="application/x-shockwave-flash" width="468" height="60">'
+                    .'</embed>'
+                    .'</object>';
+            } else {
+                $bannerobject = $bannerobject.'<img src="'.$imageurl.'" alt="" />';
+            }
+
+            $bannerobject = $bannerobject.'</a></div>';
+        }
+        return $bannerobject;
+    }
+}
+
+/*
+* Function to redirect a user to certain pages
+*/
+function redirect_header($url, $time = 3, $message = '', $addredirect = true)
+{
+    global $xoopsConfig, $xoopsRequestUri;
+    if (preg_match("/[\\0-\\31]/", $url) || preg_match("/^(javascript|vbscript|about):/i", $url)) {
+        $url = XOOPS_URL;
+    }
+    if (!defined('XOOPS_CPFUNC_LOADED')) {
+        require_once XOOPS_ROOT_PATH.'/class/template.php';
+        $xoopsTpl = new XoopsTpl();
+        $xoopsTpl->assign('sitename', htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES));
+        $xoopsTpl->assign('langcode', _LANGCODE);
+        $xoopsTpl->assign('charset', _CHARSET);
+        $xoopsTpl->assign('time', $time);
+        if ($addredirect && strstr($url, 'user.php')) {
+            if (!strstr($url, '?')) {
+                $url .= '?xoops_redirect='.urlencode($xoopsRequestUri);
+            } else {
+                $url .= '&amp;xoops_redirect='.urlencode($xoopsRequestUri);
+            }
+        }
+        if (defined('SID') && (! isset($_COOKIE[session_name()]) || ($xoopsConfig['use_mysession'] && $xoopsConfig['session_name'] != '' && !isset($_COOKIE[$xoopsConfig['session_name']])))) {
+            if (!strstr($url, '?')) {
+                $url .= '?' . SID;
+            }
+            else {
+                $url .= '&amp;'.SID;
+            }
+        }
+        $url = preg_replace("/&amp;/i", '&', htmlspecialchars($url, ENT_QUOTES));
+        $xoopsTpl->assign('url', $url);
+        $message = trim($message) != '' ? $message : _TAKINGBACK;
+        $xoopsTpl->assign('message', $message);
+        $xoopsTpl->assign('lang_ifnotreload', sprintf(_IFNOTRELOAD, $url));
+        $GLOBALS['xoopsModuleUpdate'] = 1;
+        $xoopsTpl->display('db:system_redirect.html');
+        exit();
+    } else {
+        $url = preg_replace("/&amp;/i", '&', htmlspecialchars($url, ENT_QUOTES));
+        echo '
+        <html>
+        <head>
+        <title>'.htmlspecialchars($xoopsConfig['sitename']).'</title>
+        <meta http-equiv="Content-Type" content="text/html; charset='._CHARSET.'" />
+        <meta http-equiv="Refresh" content="'.$time.'; url='.$url.'" />
+        <style type="text/css">
+                body {background-color : #fcfcfc; font-size: 12px; font-family: Trebuchet MS,Verdana, Arial, Helvetica, sans-serif; margin: 0px;}
+                .redirect {width: 70%; margin: 110px; text-align: center; padding: 15px; border: #e0e0e0 1px solid; color: #666666; background-color: #f6f6f6;}
+                .redirect a:link {color: #666666; text-decoration: none; font-weight: bold;}
+                .redirect a:visited {color: #666666; text-decoration: none; font-weight: bold;}
+                .redirect a:hover {color: #999999; text-decoration: underline; font-weight: bold;}
+        </style>
+        </head>
+        <body>
+        <div align="center">
+        <div class="redirect">
+          <span style="font-size: 16px; font-weight: bold;">'.$message.'</span>
+          <hr style="height: 3px; border: 3px #E18A00 solid; width: 95%;" />
+          <p>'.sprintf(_IFNOTRELOAD, $url).'</p>
+        </div>
+        </div>
+        </body>
+        </html>';
+    }
+    exit();
+}
+
+function xoops_getenv($key)
+{
+    $ret = '';
+    //$phpv = explode(".", PHP_VERSION);
+    //if ($phpv[0] > 3 && $phpv[1] > 0) {
+    //  $ret = isset($_SERVER[$key]) ? $_SERVER[$key] : $_ENV[$key];
+    //} else {
+        $ret = isset($_SERVER[$key]) ? $_SERVER[$key] : $_ENV[$key];
+    //}
+
+    switch($key) {
+        case 'PHP_SELF':
+        case 'PATH_INFO':
+        case 'PATH_TRANSLATED':
+            $ret = htmlspecialchars($ret,ENT_QUOTES);
+            break;
+    }
+
+    return $ret;
+}
+
+/*
+ * This function is deprecated. Do not use!
+ */
+function getTheme()
+{
+    return $GLOBALS['xoopsConfig']['theme_set'];
+}
+
+/*
+ * Function to get css file for a certain theme
+ * This function will be deprecated.
+ */
+function getcss($theme = '')
+{
+    return xoops_getcss($theme);
+}
+
+/*
+ * Function to get css file for a certain themeset
+ */
+function xoops_getcss($theme = '')
+{
+    if ($theme == '') {
+        $theme = $GLOBALS['xoopsConfig']['theme_set'];
+    }
+    $uagent = xoops_getenv('HTTP_USER_AGENT');
+    if (stristr($uagent, 'mac')) {
+        $str_css = 'styleMAC.css';
+    } elseif (preg_match("/MSIE ([0-9]\.[0-9]{1,2})/i", $uagent)) {
+        $str_css = 'style.css';
+    } else {
+        $str_css = 'styleNN.css';
+    }
+    if (is_dir(XOOPS_THEME_PATH.'/'.$theme)) {
+        if (file_exists(XOOPS_THEME_PATH.'/'.$theme.'/'.$str_css)) {
+            return XOOPS_THEME_URL.'/'.$theme.'/'.$str_css;
+        } elseif (file_exists(XOOPS_THEME_PATH.'/'.$theme.'/style.css')) {
+            return XOOPS_THEME_URL.'/'.$theme.'/style.css';
+        }
+    }
+    return '';
+}
+
+function &getMailer()
+{
+    global $xoopsConfig;
+    include_once XOOPS_ROOT_PATH."/class/xoopsmailer.php";
+    if ( file_exists(XOOPS_ROOT_PATH."/language/".$xoopsConfig['language']."/xoopsmailerlocal.php") ) {
+        include_once XOOPS_ROOT_PATH."/language/".$xoopsConfig['language']."/xoopsmailerlocal.php";
+        if ( class_exists("XoopsMailerLocal") ) {
+            $ret =& new XoopsMailerLocal();
+            return $ret;
+        }
+    }
+    $ret =& new XoopsMailer();
+    return $ret;
+}
+
+function &xoops_gethandler($name, $optional = false )
+{
+    static $handlers;
+    $name = strtolower(trim($name));
+    if (!isset($handlers[$name])) {
+        if ( file_exists( $hnd_file = XOOPS_ROOT_PATH.'/kernel/'.$name.'.php' ) ) {
+            require_once $hnd_file;
+        }
+        $class = 'Xoops'.ucfirst($name).'Handler';
+        if (class_exists($class)) {
+            $handlers[$name] = new $class($GLOBALS['xoopsDB']);
+        }
+    }
+    if (!isset($handlers[$name]) && !$optional ) {
+        trigger_error('Class <b>'.$class.'</b> does not exist<br />Handler Name: '.$name, E_USER_ERROR);
+    }
+    $ret = false;
+    if (isset($handlers[$name])) {
+        $ret =& $handlers[$name];
+    }
+    return $ret;
+}
+
+function &xoops_getmodulehandler($name = null, $module_dir = null, $optional = false)
+{
+    static $handlers;
+    // if $module_dir is not specified
+    if (!isset($module_dir)) {
+        //if a module is loaded
+        if (isset($GLOBALS['xoopsModule']) && is_object($GLOBALS['xoopsModule'])) {
+            $module_dir = $GLOBALS['xoopsModule']->getVar('dirname');
+        } else {
+            trigger_error('No Module is loaded', E_USER_ERROR);
+        }
+    } else {
+        $module_dir = trim($module_dir);
+    }
+    $name = (!isset($name)) ? $module_dir : trim($name);
+    if (!isset($handlers[$module_dir][$name])) {
+        if ( file_exists( $hnd_file = XOOPS_ROOT_PATH . "/modules/{$module_dir}/class/{$name}.php" ) ) {
+            include_once $hnd_file;
+        }
+        $class = ucfirst(strtolower($module_dir)).ucfirst($name).'Handler';
+        if (class_exists($class)) {
+            $handlers[$module_dir][$name] = new $class($GLOBALS['xoopsDB']);
+        }
+    }
+    if (!isset($handlers[$module_dir][$name]) && !$optional) {
+        trigger_error('Handler does not exist<br />Module: '.$module_dir.'<br />Name: '.$name, E_USER_ERROR);
+    }
+    $ret = false;
+    if (isset($handlers[$module_dir][$name])) {
+        $ret =& $handlers[$module_dir][$name];
+    }
+    return $ret;
+}
+
+function xoops_getrank($rank_id =0, $posts = 0)
+{
+    $db =& Database::getInstance();
+    $myts =& MyTextSanitizer::getInstance();
+    $rank_id = intval($rank_id);
+    if ($rank_id != 0) {
+        $sql = "SELECT rank_title AS title, rank_image AS image FROM ".$db->prefix('ranks')." WHERE rank_id = ".$rank_id;
+    } else {
+        $sql = "SELECT rank_title AS title, rank_image AS image FROM ".$db->prefix('ranks')." WHERE rank_min <= ".$posts." AND rank_max >= ".$posts." AND rank_special = 0";
+    }
+    $rank = $db->fetchArray($db->query($sql));
+    $rank['title'] = $myts->makeTboxData4Show($rank['title']);
+    $rank['id'] = $rank_id;
+    return $rank;
+}
+
+
+/**
+* Returns the portion of string specified by the start and length parameters. If $trimmarker is supplied, it is appended to the return string. This function works fine with multi-byte characters if mb_* functions exist on the server.
+*
+* @param    string    $str
+* @param    int       $start
+* @param    int       $length
+* @param    string    $trimmarker
+*
+* @return   string
+*/
+function xoops_substr($str, $start, $length, $trimmarker = '...')
+{
+    if ( !XOOPS_USE_MULTIBYTES ) {
+        return ( strlen($str) - $start <= $length ) ? substr( $str, $start, $length ) : substr( $str, $start, $length - strlen($trimmarker) ) . $trimmarker;
+    }
+    if (function_exists('mb_internal_encoding') && @mb_internal_encoding(_CHARSET)) {
+        $str2 = mb_strcut( $str , $start , $length - strlen( $trimmarker ) );
+        return $str2 . ( mb_strlen($str)!=mb_strlen($str2) ? $trimmarker : '' );
+    }
+    // phppp patch
+    $DEP_CHAR=127;
+    $pos_st=0;
+    $action = false;
+    for ( $pos_i = 0; $pos_i < strlen($str); $pos_i++ ) {
+        if ( ord( substr( $str, $pos_i, 1) ) > 127 ) {
+            $pos_i++;
+        }
+        if ($pos_i<=$start) {
+            $pos_st=$pos_i;
+        }
+        if ($pos_i>=$pos_st+$length) {
+            $action = true;
+            break;
+        }
+    }
+    return ($action) ? substr( $str, $pos_st, $pos_i - $pos_st - strlen($trimmarker) ) . $trimmarker : $str;
+}
+
+// RMV-NOTIFY
+// ################ Notification Helper Functions ##################
+
+// We want to be able to delete by module, by user, or by item.
+// How do we specify this??
+
+function xoops_notification_deletebymodule ($module_id)
+{
+    $notification_handler =& xoops_gethandler('notification');
+    return $notification_handler->unsubscribeByModule ($module_id);
+}
+
+function xoops_notification_deletebyuser ($user_id)
+{
+    $notification_handler =& xoops_gethandler('notification');
+    return $notification_handler->unsubscribeByUser ($user_id);
+}
+
+function xoops_notification_deletebyitem ($module_id, $category, $item_id)
+{
+    $notification_handler =& xoops_gethandler('notification');
+    return $notification_handler->unsubscribeByItem ($module_id, $category, $item_id);
+}
+
+// ################### Comment helper functions ####################
+
+function xoops_comment_count($module_id, $item_id = null)
+{
+    $comment_handler =& xoops_gethandler('comment');
+    $criteria = new CriteriaCompo(new Criteria('com_modid', intval($module_id)));
+    if (isset($item_id)) {
+        $criteria->add(new Criteria('com_itemid', intval($item_id)));
+    }
+    return $comment_handler->getCount($criteria);
+}
+
+function xoops_comment_delete($module_id, $item_id)
+{
+    if (intval($module_id) > 0 && intval($item_id) > 0) {
+        $comment_handler =& xoops_gethandler('comment');
+        $comments =& $comment_handler->getByItemId($module_id, $item_id);
+        if (is_array($comments)) {
+            $count = count($comments);
+            $deleted_num = array();
+            for ($i = 0; $i < $count; $i++) {
+                if (false != $comment_handler->delete($comments[$i])) {
+                    // store poster ID and deleted post number into array for later use
+                    $poster_id = $comments[$i]->getVar('com_uid');
+                    if ($poster_id != 0) {
+                        $deleted_num[$poster_id] = !isset($deleted_num[$poster_id]) ? 1 : ($deleted_num[$poster_id] + 1);
+                    }
+                }
+            }
+            $member_handler =& xoops_gethandler('member');
+            foreach ($deleted_num as $user_id => $post_num) {
+                // update user posts
+                $com_poster = $member_handler->getUser($user_id);
+                if (is_object($com_poster)) {
+                    $member_handler->updateUserByField($com_poster, 'posts', $com_poster->getVar('posts') - $post_num);
+                }
+            }
+            return true;
+        }
+    }
+    return false;
+}
+
+// ################ Group Permission Helper Functions ##################
+
+function xoops_groupperm_deletebymoditem($module_id, $perm_name, $item_id = null)
+{
+    // do not allow system permissions to be deleted
+    if (intval($module_id) <= 1) {
+        return false;
+    }
+    $gperm_handler =& xoops_gethandler('groupperm');
+    return $gperm_handler->deleteByModule($module_id, $perm_name, $item_id);
+}
+
+function &xoops_utf8_encode(&$text)
+{
+    if (XOOPS_USE_MULTIBYTES == 1) {
+        if (function_exists('mb_convert_encoding')) {
+            return mb_convert_encoding($text, 'UTF-8', 'auto');
+        }
+        return $text;
+    }
+    return utf8_encode($text);
+}
+
+function &xoops_convert_encoding(&$text)
+{
+    return xoops_utf8_encode($text);
+}
+
+function xoops_getLinkedUnameFromId($userid)
+{
+    $userid = intval($userid);
+    if ($userid > 0) {
+        $member_handler =& xoops_gethandler('member');
+        $user =& $member_handler->getUser($userid);
+        if (is_object($user)) {
+            $linkeduser = '<a href="'.XOOPS_URL.'/userinfo.php?uid='.$userid.'">'. $user->getVar('uname').'</a>';
+            return $linkeduser;
+        }
+    }
+    return $GLOBALS['xoopsConfig']['anonymous'];
+}
+
+function xoops_trim($text)
+{
+    if (function_exists('xoops_language_trim')) {
+        return xoops_language_trim($text);
+    }
+    return trim($text);
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/include/registerform.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/include/registerform.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/include/registerform.php	(revision 405)
@@ -0,0 +1,97 @@
+<?php
+// $Id: registerform.php,v 1.6 2005/09/04 20:46:09 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+if (!defined('XOOPS_ROOT_PATH')) {
+    exit();
+}
+include_once XOOPS_ROOT_PATH."/class/xoopslists.php";
+include_once XOOPS_ROOT_PATH."/class/xoopsformloader.php";
+
+
+$email_tray = new XoopsFormElementTray(_US_EMAIL, "<br />");
+$email_text = new XoopsFormText("", "email", 25, 60, $myts->htmlSpecialChars($email));
+$email_option = new XoopsFormCheckBox("", "user_viewemail", $user_viewemail);
+$email_option->addOption(1, _US_ALLOWVIEWEMAIL);
+$email_tray->addElement($email_text);
+$email_tray->addElement($email_option);
+
+//$avatar_select = new XoopsFormSelect("", "user_avatar", $user_avatar);
+//$avatar_array =& XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH."/images/avatar/");
+//$avatar_select->addOptionArray($avatar_array);
+//$a_dirlist =& XoopsLists::getDirListAsArray(XOOPS_ROOT_PATH."/images/avatar/");
+//$a_dir_labels = array();
+//$a_count = 0;
+//$a_dir_link = "<a href=\"javascript:openWithSelfMain('".XOOPS_URL."/misc.php?action=showpopups&amp;type=avatars&amp;start=".$a_count."','avatars',600,400);\">XOOPS</a>";
+//$a_count = $a_count + count($avatar_array);
+//$a_dir_labels[] = new XoopsFormLabel("", $a_dir_link);
+//foreach ($a_dirlist as $a_dir) {
+//  if ( $a_dir == "users" ) {
+//      continue;
+//  }
+//  $avatars_array =& XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH."/images/avatar/".$a_dir."/", $a_dir."/");
+//  $avatar_select->addOptionArray($avatars_array);
+//  $a_dir_link = "<a href=\"javascript:openWithSelfMain('".XOOPS_URL."/misc.php?action=showpopups&amp;type=avatars&amp;subdir=".$a_dir."&amp;start=".$a_count."','avatars',600,400);\">".$a_dir."</a>";
+//  $a_dir_labels[] = new XoopsFormLabel("", $a_dir_link);
+//  $a_count = $a_count + count($avatars_array);
+//}
+//$avatar_select->setExtra("onchange='showImgSelected(\"avatar\", \"user_avatar\", \"images/avatar\", \"\", \"".XOOPS_URL."\")'");
+//$avatar_label = new XoopsFormLabel("", "<img src='images/avatar/blank.gif' name='avatar' id='avatar' alt='' />");
+//$avatar_tray = new XoopsFormElementTray(_US_AVATAR, "&nbsp;");
+//$avatar_tray->addElement($avatar_select);
+//$avatar_tray->addElement($avatar_label);
+//foreach ($a_dir_labels as $a_dir_label) {
+//  $avatar_tray->addElement($a_dir_label);
+//}
+
+$reg_form = new XoopsThemeForm(_US_USERREG, "userinfo", "register.php");
+$uname_size = $xoopsConfigUser['maxuname'] < 25 ? $xoopsConfigUser['maxuname'] : 25;
+$reg_form->addElement(new XoopsFormText(_US_NICKNAME, "uname", $uname_size, $uname_size, $myts->htmlSpecialChars($uname)), true);
+$reg_form->addElement($email_tray);
+$reg_form->addElement(new XoopsFormText(_US_WEBSITE, "url", 25, 255, $myts->htmlSpecialChars($url)));
+$tzselected = ($timezone_offset != "") ? $timezone_offset : $xoopsConfig['default_TZ'];
+//$reg_form->addElement(new XoopsFormSelectTimezone(_US_TIMEZONE, "timezone_offset", $tzselected));
+//$reg_form->addElement($avatar_tray);
+$reg_form->addElement(new XoopsFormPassword(_US_PASSWORD, "pass", 10, 32, $myts->htmlSpecialChars($pass)), true);
+$reg_form->addElement(new XoopsFormPassword(_US_VERIFYPASS, "vpass", 10, 32, $myts->htmlSpecialChars($vpass)), true);
+$reg_form->addElement(new XoopsFormRadioYN(_US_MAILOK, 'user_mailok', $user_mailok));
+/* ¥Æ¥­¥¹¥È¥¨¥ê¥¢ÈóÉ½¼¨
+if ($xoopsConfigUser['reg_dispdsclmr'] != 0 && $xoopsConfigUser['reg_disclaimer'] != '') {
+    $disc_tray = new XoopsFormElementTray(_US_DISCLAIMER, '<br />');
+    $disc_text = new XoopsFormTextarea('', 'disclaimer', $xoopsConfigUser['reg_disclaimer'], 8);
+    $disc_text->setExtra('readonly="readonly"');
+    $disc_tray->addElement($disc_text);
+    $agree_chk = new XoopsFormCheckBox('', 'agree_disc', $agree_disc);
+    $agree_chk->addOption(1, _US_IAGREE);
+    $disc_tray->addElement($agree_chk);
+    $reg_form->addElement($disc_tray);
+}
+*/
+$reg_form->addElement(new XoopsFormHidden("op", "newuser"));
+$reg_form->addElement(new XoopsFormToken(XoopsSingleTokenHandler::quickCreate('register_newuser')));
+$reg_form->addElement(new XoopsFormButton("", "submit", _US_SUBMIT, "submit"));
+$reg_form->setRequired($email_text);
+?>
Index: /temp/test-xoops.ec-cube.net/html/include/layersmenu.js
===================================================================
--- /temp/test-xoops.ec-cube.net/html/include/layersmenu.js	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/include/layersmenu.js	(revision 405)
@@ -0,0 +1,120 @@
+// PHP Layers Menu 1.0.7 (c) 2001, 2002 Marco Pratesi <pratesi@telug.it>
+
+DOM = (document.getElementById) ? 1 : 0;
+NS4 = (document.layers) ? 1 : 0;
+IE4 = (document.all) ? 1 : 0;
+var loaded = 0;	// to avoid stupid errors of Microsoft browsers
+Konqueror = (navigator.userAgent.indexOf("Konqueror") > -1) ? 1 : 0;
+// We need to explicitly detect Konqueror
+// because Konqueror 3 sets IE4 = 1 ... AAAAAAAAAARGHHH!!!
+Opera5 = (navigator.userAgent.indexOf("Opera 5") > -1 || navigator.userAgent.indexOf("Opera/5") > -1 || navigator.userAgent.indexOf("Opera 6") > -1 || navigator.userAgent.indexOf("Opera/6") > -1) ? 1 : 0;
+
+// it works with NS4, Mozilla, NS6, Opera 5 and 6, IE
+currentY = -1;
+function grabMouse(e) {
+	if ((DOM && !IE4) || Opera5) {
+		currentY = e.clientY;
+	} else if (NS4) {
+		currentY = e.pageY;
+	} else {
+		currentY = event.y;
+	}
+	if (DOM && !IE4 && !Opera5 && !Konqueror) {
+		currentY += window.pageYOffset;
+	} else if (IE4 && DOM && !Opera5 && !Konqueror) {
+		currentY += document.body.scrollTop;
+	}
+}
+if ((DOM || NS4) && !IE4) {
+	document.captureEvents(Event.MOUSEDOWN | Event.MOUSEMOVE);
+}
+document.onmousemove = grabMouse;
+
+function popUp(menuName,on) {
+	if (loaded) {	// to avoid stupid errors of Microsoft browsers
+		if (on) {
+//			moveLayers();
+			if (DOM) {
+				document.getElementById(menuName).style.visibility = "visible";
+				document.getElementById(menuName).style.zIndex = 1000;
+			} else if (NS4) {
+				document.layers[menuName].visibility = "show";
+				document.layers[menuName].zIndex = 1000;
+			} else {
+				document.all[menuName].style.visibility = "visible";
+				document.all[menuName].style.zIndex = 1000;
+			}
+		} else {
+			if (DOM) {
+				document.getElementById(menuName).style.visibility = "hidden";
+			} else if (NS4) {
+				document.layers[menuName].visibility = "hide";
+			} else {
+				document.all[menuName].style.visibility = "hidden";
+			}
+		}
+	}
+}
+
+function setleft(layer,x) {
+	if (DOM) {
+		document.getElementById(layer).style.left = x;
+		document.getElementById(layer).style.left = x + 'px';
+	} else if (NS4) {
+		document.layers[layer].left = x;
+	} else {
+		document.all[layer].style.pixelLeft = x;
+	}
+}
+
+function settop(layer,y) {
+	if (DOM) {
+		document.getElementById(layer).style.top = y;
+		document.getElementById(layer).style.top = y + 'px';
+	} else if (NS4) {
+		document.layers[layer].top = y;
+	} else {
+		document.all[layer].style.pixelTop = y;
+	}
+}
+
+function setwidth(layer,w) {
+	if (DOM) {
+		document.getElementById(layer).style.width = w;
+		document.getElementById(layer).style.width = w + 'px';
+	} else if (NS4) {
+//		document.layers[layer].width = w;
+	} else {
+		document.all[layer].style.pixelWidth = w;
+	}
+}
+
+function moveLayerY(menuName, ordinata, e) {
+	if (loaded) {	
+	// to avoid stupid errors of Microsoft browsers
+	//alert (ordinata);
+	// Konqueror: ordinata = -1 according to the initialization currentY = -1
+	// Opera: isNaN(ordinata), currentY is NaN, it seems that Opera ignores the initialization currentY = -1
+		if (ordinata != -1 && !isNaN(ordinata)) {	// The browser has detected the mouse position
+			if (DOM) {
+				// attenzione a "px" !!!
+				if (e && e.clientY) { // just use the pos of the mouseOver event if we have it
+					document.getElementById(menuName).style.top = e.clientY + 'px';
+				} else {
+					appoggio = parseInt(document.getElementById(menuName).style.top);
+					if (isNaN(appoggio)) appoggio = 0;
+					if (Math.abs(appoggio + ordinata_margin - ordinata) > thresholdY)
+						document.getElementById(menuName).style.top = (ordinata - ordinata_margin) + 'px';
+				}
+
+			} else if (NS4) {
+					if (Math.abs(document.layers[menuName].top + ordinata_margin - ordinata) > thresholdY)
+						document.layers[menuName].top = ordinata - ordinata_margin;
+			} else {
+				if (Math.abs(document.all[menuName].style.pixelTop + ordinata_margin - ordinata) > thresholdY)
+					document.all[menuName].style.pixelTop = ordinata - ordinata_margin;
+			}
+		}
+	}
+}
+
Index: /temp/test-xoops.ec-cube.net/html/include/cp_header.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/include/cp_header.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/include/cp_header.php	(revision 405)
@@ -0,0 +1,38 @@
+<?php 
+// $Id: cp_header.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+/**
+ * module files can include this file for admin authorization
+ * the file that will include this file must be located under xoops_url/modules/module_directory_name/admin_directory_name/
+ */
+ 
+include_once '../../../mainfile.php';
+include_once XOOPS_ROOT_PATH . "/include/cp_functions.php";
+$moduleperm_handler = & xoops_gethandler( 'groupperm' );
+if ( $xoopsUser ) {
+    $url_arr = explode('/',strstr($xoopsRequestUri,'/modules/'));
+    $module_handler =& xoops_gethandler('module');
+    $xoopsModule =& $module_handler->getByDirname($url_arr[2]);
+    unset($url_arr);
+    
+    if ( !$moduleperm_handler->checkRight( 'module_admin', $xoopsModule->getVar( 'mid' ), $xoopsUser->getGroups() ) ) {
+        redirect_header( XOOPS_URL . "/user.php", 1, _NOPERM );
+        exit();
+    } 
+} else {
+    redirect_header( XOOPS_URL . "/user.php", 1, _NOPERM );
+    exit();
+}
+// set config values for this module
+if ( $xoopsModule->getVar( 'hasconfig' ) == 1 || $xoopsModule->getVar( 'hascomments' ) == 1 ) {
+    $config_handler = & xoops_gethandler( 'config' );
+    $xoopsModuleConfig = & $config_handler->getConfigsByCat( 0, $xoopsModule->getVar( 'mid' ) );
+}
+
+// include the default language file for the admin interface
+if ( file_exists( "../language/" . $xoopsConfig['language'] . "/admin.php" ) ) {
+    include "../language/" . $xoopsConfig['language'] . "/admin.php";
+}
+elseif ( file_exists( "../language/english/admin.php" ) ) {
+    include "../language/english/admin.php";
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/include/comment_new.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/include/comment_new.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/include/comment_new.php	(revision 405)
@@ -0,0 +1,94 @@
+<?php
+// $Id: comment_new.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.xoops.org/ http://jp.xoops.org/  http://www.myweb.ne.jp/  //
+// Project: The XOOPS Project (http://www.xoops.org/)                        //
+// ------------------------------------------------------------------------- //
+
+if (!defined('XOOPS_ROOT_PATH') || !is_object($xoopsModule)) {
+	exit();
+}
+
+include_once XOOPS_ROOT_PATH.'/include/comment_constants.php';
+if ('system' != $xoopsModule->getVar('dirname') && XOOPS_COMMENT_APPROVENONE == $xoopsModuleConfig['com_rule']) {
+	exit();
+}
+
+include_once XOOPS_ROOT_PATH.'/language/'.$xoopsConfig['language'].'/comment.php';
+$com_itemid = isset($_GET['com_itemid']) ? intval($_GET['com_itemid']) : 0;
+
+if ($com_itemid > 0) {
+	include XOOPS_ROOT_PATH.'/header.php';
+	if (isset($com_replytitle)) {
+		if (isset($com_replytext)) {
+			themecenterposts($com_replytitle, $com_replytext);
+		}
+		$myts =& MyTextSanitizer::getInstance();
+		$com_title = $myts->htmlSpecialChars($com_replytitle);
+		if (!preg_match("/^re:/i", $com_title)) {
+			$com_title = "Re: ".xoops_substr($com_title, 0, 56);
+		}
+	} else {
+		$com_title = '';
+	}
+	$com_mode = isset($_GET['com_mode']) ? htmlspecialchars(trim($_GET['com_mode']), ENT_QUOTES) : '';
+	if ($com_mode == '') {
+		if (is_object($xoopsUser)) {
+			$com_mode = $xoopsUser->getVar('umode');
+		} else {
+			$com_mode = $xoopsConfig['com_mode'];
+		}
+	}
+	
+	if (!isset($_GET['com_order'])) {
+		if (is_object($xoopsUser)) {
+			$com_order = $xoopsUser->getVar('uorder');
+		} else {
+			$com_order = $xoopsConfig['com_order'];
+		}
+	} else {
+		$com_order = intval($_GET['com_order']);
+	}
+	$com_id = 0;
+	$noname = 0;
+	$dosmiley = 1;
+	$dohtml = 0;
+	$dobr = 1;
+	$doxcode = 1;
+	$com_icon = '';
+	$com_pid = 0;
+	$com_rootid = 0;
+	$com_text = '';
+
+	//Modified By viva(2005/12/25) --->
+	$com_poster_name = '';
+	//Modified By viva(2005/12/25) <---
+
+	include XOOPS_ROOT_PATH.'/include/comment_form.php';
+	include XOOPS_ROOT_PATH.'/footer.php';
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/include/comment_reply.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/include/comment_reply.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/include/comment_reply.php	(revision 405)
@@ -0,0 +1,86 @@
+<?php
+// $Id: comment_reply.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.xoops.org/ http://jp.xoops.org/  http://www.myweb.ne.jp/  //
+// Project: The XOOPS Project (http://www.xoops.org/)                        //
+// ------------------------------------------------------------------------- //
+
+if (!defined('XOOPS_ROOT_PATH') || !is_object($xoopsModule)) {
+	exit();
+}
+include_once XOOPS_ROOT_PATH.'/language/'.$xoopsConfig['language'].'/comment.php';
+$com_id = isset($_GET['com_id']) ? intval($_GET['com_id']) : 0;
+$com_mode = isset($_GET['com_mode']) ? htmlspecialchars(trim($_GET['com_mode']), ENT_QUOTES) : '';
+if ($com_mode == '') {
+	if (is_object($xoopsUser)) {
+		$com_mode = $xoopsUser->getVar('umode');
+	} else {
+		$com_mode = $xoopsConfig['com_mode'];
+	}
+}
+if (!isset($_GET['com_order'])) {
+	if (is_object($xoopsUser)) {
+		$com_order = $xoopsUser->getVar('uorder');
+	} else {
+		$com_order = $xoopsConfig['com_order'];
+	}
+} else {
+	$com_order = intval($_GET['com_order']);
+}
+$comment_handler =& xoops_gethandler('comment');
+$comment =& $comment_handler->get($com_id);
+$r_name = XoopsUser::getUnameFromId($comment->getVar('com_uid'));
+
+//added By viva !!indicated by kamagasako m(_@_)m!! (2006/06/08) --->
+if ($r_name == $GLOBALS['xoopsConfig']['anonymous']) {
+	$r_name = $comment->getVar('com_poster_name');
+}
+//added By viva !!indicated by kamagasako m(_@_)m!! (2006/06/08) <---
+
+$r_text = _CM_POSTER.': <b>'.$r_name.'</b>&nbsp;&nbsp;'._CM_POSTED.': <b>'.formatTimestamp($comment->getVar('com_created')).'</b><br /><br />'.$comment->getVar('com_text');$com_title = $comment->getVar('com_title', 'E');
+if (!preg_match("/^re:/i", $com_title)) {
+	$com_title = "Re: ".xoops_substr($com_title, 0, 56);
+}
+$com_pid = $com_id;
+$com_text = '';
+$com_id = 0;
+$dosmiley = 1;
+$dohtml = 0;
+$doxcode = 1;
+$dobr = 1;
+$doimage = 1;
+$com_icon = '';
+$com_rootid = $comment->getVar('com_rootid');
+$com_itemid = $comment->getVar('com_itemid');
+//added By viva(2005/12/25) --->
+$com_poster_name = '';
+//added By viva(2005/12/25) <---
+include XOOPS_ROOT_PATH.'/header.php';
+themecenterposts($comment->getVar('com_title'), $r_text);
+include XOOPS_ROOT_PATH.'/include/comment_form.php';
+include XOOPS_ROOT_PATH.'/footer.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/include/notification_functions.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/include/notification_functions.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/include/notification_functions.php	(revision 405)
@@ -0,0 +1,394 @@
+<?php
+// $Id: notification_functions.php,v 1.3 2005/09/04 20:46:09 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.xoops.org/ http://jp.xoops.org/  http://www.myweb.ne.jp/  //
+// Project: The XOOPS Project (http://www.xoops.org/)                        //
+// ------------------------------------------------------------------------- //
+
+// RMV-NOTIFY
+
+// FIXME: Do some caching, so we don't retrieve the same category / event
+// info many times.
+
+
+/**
+ * Determine if notification is enabled for the selected module.
+ *
+ * @param  string  $style      Subscription style: 'block' or 'inline'
+ * @param  int     $module_id  ID of the module  (default current module)
+ * @return bool
+ */
+function notificationEnabled ($style, $module_id=null)
+{
+	if (isset($GLOBALS['xoopsModuleConfig']['notification_enabled'])) {
+		$status = $GLOBALS['xoopsModuleConfig']['notification_enabled'];
+	} else {
+		if (!isset($module_id)) {
+			return false;
+		}
+		$module_handler =& xoops_gethandler('module');
+		$module =& $module_handler->get($module_id);
+		if (!empty($module) && $module->getVar('hasnotification') == 1) {
+			$config_handler =& xoops_gethandler('config');
+			$config = $config_handler->getConfigsByCat(0,$module_id);
+			$status = $config['notification_enabled'];
+		} else {
+			return false;
+		}
+	}
+	include_once XOOPS_ROOT_PATH . '/include/notification_constants.php';
+	if (($style == 'block') && ($status == XOOPS_NOTIFICATION_ENABLEBLOCK || $status == XOOPS_NOTIFICATION_ENABLEBOTH)) {
+		return true;
+	}
+	if (($style == 'inline') && ($status == XOOPS_NOTIFICATION_ENABLEINLINE || $status == XOOPS_NOTIFICATION_ENABLEBOTH)) {
+		return true;
+	}
+	// if ($status != XOOPS_NOTIFICATION_DISABLE) {
+	// 		return true;
+	// }
+	return false;
+}
+
+/**
+ * Get an associative array of info for a particular notification
+ * category in the selected module.  If no category is selected,
+ * return an array of info for all categories.
+ *
+ * @param  string  $name       Category name (default all categories)
+ * @param  int     $module_id  ID of the module (default current module)
+ * @return mixed
+ */
+function &notificationCategoryInfo ($category_name='', $module_id=null)
+{
+	if (!isset($module_id)) {
+		global $xoopsModule;
+		$module_id = !empty($xoopsModule) ? $xoopsModule->getVar('mid') : 0;
+		$module =& $xoopsModule;
+	} else {
+		$module_handler =& xoops_gethandler('module');
+		$module =& $module_handler->get($module_id);
+	}
+	$not_config =& $module->getInfo('notification');
+	if (empty($category_name)) {
+		return $not_config['category'];
+	}
+	foreach ($not_config['category'] as $category) {
+		if ($category['name'] == $category_name) {
+			return $category;
+		}
+	}
+	return false;
+}
+
+/**
+ * Get associative array of info for the category to which comment events
+ * belong.
+ *
+ * @todo This could be more efficient... maybe specify in
+ *        $modversion['comments'] the notification category.
+ *       This would also serve as a way to enable notification
+ *        of comments, and also remove the restriction that
+ *        all notification categories must have unique item_name. (TODO)
+ *
+ * @param  int  $module_id  ID of the module (default current module)
+ * @return mixed            Associative array of category info
+ */
+function &notificationCommentCategoryInfo($module_id=null)
+{
+	$all_categories =& notificationCategoryInfo ('', $module_id);
+	if (empty($all_categories)) {
+		return false;
+	}
+	foreach ($all_categories as $category) {
+		$all_events =& notificationEvents ($category['name'], false, $module_id);
+		if (empty($all_events)) {
+			continue;
+		}
+		foreach ($all_events as $event) {
+			if ($event['name'] == 'comment') {
+				return $category;
+			}
+		}
+	}
+	return false;
+}
+
+// TODO: some way to include or exclude admin-only events...
+
+/**
+ * Get an array of info for all events (each event has associative array)
+ * in the selected category of the selected module.
+ *
+ * @param  string  $category_name  Category name
+ * @param  bool    $enabled_only   If true, return only enabled events
+ * @param  int     $module_id      ID of the module (default current module)
+ * @return mixed
+ */
+function &notificationEvents ($category_name, $enabled_only, $module_id=null)
+{
+	if (!isset($module_id)) {
+		global $xoopsModule;
+		$module_id = !empty($xoopsModule) ? $xoopsModule->getVar('mid') : 0;
+		$module =& $xoopsModule;
+	} else {
+		$module_handler =& xoops_gethandler('module');
+		$module =& $module_handler->get($module_id);
+	}
+	$not_config =& $module->getInfo('notification');
+	$config_handler =& xoops_gethandler('config');
+	$mod_config = $config_handler->getConfigsByCat(0,$module_id);
+
+	$category =& notificationCategoryInfo($category_name, $module_id);
+
+	global $xoopsConfig;
+	$event_array = array();
+
+	$override_comment = false;
+	$override_commentsubmit = false;
+	$override_bookmark = false;
+	
+	foreach ($not_config['event'] as $event) {
+		if ($event['category'] == $category_name) {
+			$event['mail_template_dir'] = XOOPS_ROOT_PATH . '/modules/' . $module->getVar('dirname') . '/language/' . $xoopsConfig['language'] . '/mail_template/';
+			if (!$enabled_only || notificationEventEnabled ($category, $event, $module)) {
+				$event_array[] = $event;
+			}
+			if ($event['name'] == 'comment') {
+				$override_comment = true;
+			}
+			if ($event['name'] == 'comment_submit') {
+				$override_commentsubmit = true;
+			}
+			if ($event['name'] == 'bookmark') {
+				$override_bookmark = true;
+			}
+		}
+	}
+
+	include_once XOOPS_ROOT_PATH . '/language/' . $xoopsConfig['language'] . '/notification.php';
+
+	// Insert comment info if applicable
+	
+	if ($module->getVar('hascomments')) {
+		$com_config = $module->getInfo('comments');
+		if (!empty($category['item_name']) && $category['item_name'] == $com_config['itemName']) {
+			$mail_template_dir = XOOPS_ROOT_PATH . '/language/' . $xoopsConfig['language'] . '/mail_template/';
+			include_once XOOPS_ROOT_PATH . '/include/comment_constants.php';
+			$config_handler =& xoops_gethandler('config');
+			$com_config = $config_handler->getConfigsByCat(0,$module_id);
+			if (!$enabled_only) {
+				$insert_comment = true;
+				$insert_submit = true;
+			} else {
+				$insert_comment = false;
+				$insert_submit = false;
+				switch($com_config['com_rule']) {
+				case XOOPS_COMMENT_APPROVENONE:
+					// comments disabled, no comment events
+					break;
+				case XOOPS_COMMENT_APPROVEALL:
+					// all comments are automatically approved, no 'submit'
+					if (!$override_comment) {
+						$insert_comment = true;
+					}
+					break;
+				case XOOPS_COMMENT_APPROVEUSER:
+				case XOOPS_COMMENT_APPROVEADMIN:
+					// comments first submitted, require later approval
+					if (!$override_comment) {
+						$insert_comment = true;
+					}
+					if (!$override_commentsubmit) {
+						$insert_submit = true;
+					}
+					break;
+				}
+			}
+			if ($insert_comment) {
+				$event = array ('name'=>'comment', 'category'=>$category['name'], 'title'=>_NOT_COMMENT_NOTIFY, 'caption'=>_NOT_COMMENT_NOTIFYCAP, 'description'=>_NOT_COMMENT_NOTIFYDSC, 'mail_template_dir'=>$mail_template_dir, 'mail_template'=>'comment_notify', 'mail_subject'=>_NOT_COMMENT_NOTIFYSBJ);
+				if (!$enabled_only || notificationEventEnabled($category, $event, $module)) {
+					$event_array[] = $event;
+				}
+			}
+			if ($insert_submit) {
+				$event = array ('name'=>'comment_submit', 'category'=>$category['name'], 'title'=>_NOT_COMMENTSUBMIT_NOTIFY, 'caption'=>_NOT_COMMENTSUBMIT_NOTIFYCAP, 'description'=>_NOT_COMMENTSUBMIT_NOTIFYDSC, 'mail_template_dir'=>$mail_template_dir, 'mail_template'=>'commentsubmit_notify', 'mail_subject'=>_NOT_COMMENTSUBMIT_NOTIFYSBJ, 'admin_only'=>1);
+				if (!$enabled_only || notificationEventEnabled($category, $event, $module)) {
+					$event_array[] = $event;
+				}
+			}
+				
+
+		}
+	}
+
+	// Insert bookmark info if appropriate
+
+	if (!empty($category['allow_bookmark'])) {
+		if (!$override_bookmark) {
+			$event = array ('name'=>'bookmark', 'category'=>$category['name'], 'title'=>_NOT_BOOKMARK_NOTIFY, 'caption'=>_NOT_BOOKMARK_NOTIFYCAP, 'description'=>_NOT_BOOKMARK_NOTIFYDSC);
+			if (!$enabled_only || notificationEventEnabled($category, $event, $module)) {
+				$event_array[] = $event;
+			}
+		}	
+	}
+
+
+	return $event_array;
+	
+}
+
+/**
+ * Determine whether a particular notification event is enabled.
+ * Depends on module config options.
+ *
+ * @todo  Check that this works correctly for comment and other
+ *   events which depend on additional config options...
+ *
+ * @param  array  $category  Category info array
+ * @param  array  $event     Event info array
+ * @param  object $module    Module
+ * @return bool
+ **/
+function notificationEventEnabled (&$category, &$event, &$module)
+{
+	$config_handler =& xoops_gethandler('config');
+	$mod_config = $config_handler->getConfigsByCat(0,$module->getVar('mid'));
+
+	$option_name = notificationGenerateConfig ($category, $event, 'option_name');
+	if (in_array($option_name, $mod_config['notification_events'])) {
+		return true;
+	}
+	$notification_handler =& xoops_gethandler('notification');
+
+	return false;
+}
+
+
+/**
+ * Get associative array of info for the selected event in the selected
+ * category (for the selected module).
+ *
+ * @param  string  $category_name  Notification category
+ * @param  string  $event_name     Notification event
+ * @param  int     $module_id      ID of the module (default current module)
+ * @return mixed
+ */
+function &notificationEventInfo ($category_name, $event_name, $module_id=null)
+{
+	$all_events =& notificationEvents ($category_name, false, $module_id);
+	foreach ($all_events as $event) {
+		if ($event['name'] == $event_name) {
+			return $event;
+		}
+	}
+	return false;
+}
+
+
+/**
+ * Get an array of associative info arrays for subscribable categories
+ * for the selected module.
+ *
+ * @param  int  $module_id  ID of the module
+ * @return mixed
+ */
+
+function &notificationSubscribableCategoryInfo ($module_id=null)
+{
+	$all_categories =& notificationCategoryInfo ('', $module_id);
+
+	// FIXME: better or more standardized way to do this?
+	$script_url = explode('/', xoops_getenv('PHP_SELF'));
+	$script_name = $script_url[count($script_url)-1];
+
+	$sub_categories = array();
+
+	foreach ($all_categories as $category) {
+
+		// Check the script name
+
+		$subscribe_from = $category['subscribe_from'];
+		if (!is_array($subscribe_from)) {
+			if ($subscribe_from == '*') {
+				$subscribe_from = array($script_name);
+				// FIXME: this is just a hack: force a match
+			} else {
+				$subscribe_from = array($subscribe_from);
+			}
+		}
+		if (!in_array($script_name, $subscribe_from)) {
+			continue;
+		}	
+
+		// If 'item_name' is missing, automatic match.  Otherwise
+		// check if that argument exists...
+
+		if (empty($category['item_name'])) {
+			$category['item_name'] = '';
+			$category['item_id'] = 0;
+			$sub_categories[] = $category;
+		} else {
+			$item_name = $category['item_name'];
+			$id = ($item_name != '' && isset($_GET[$item_name])) ? intval($_GET[$item_name]) : 0;
+			if ($id > 0)  {
+				$category['item_id'] = $id;
+				$sub_categories[] = $category;
+			}
+		}
+	}
+	return $sub_categories;
+
+}
+
+/**
+ * Generate module config info for a particular category, event pair.
+ * The selectable config options are given names depending on the
+ * category and event names, and the text depends on the category
+ * and event titles.  These are pieced together in this function in
+ * case we wish to alter the syntax.
+ *
+ * @param  array  $category  Array of category info
+ * @param  array  $event     Array of event info
+ * @param  string $type      The particular name to generate
+ * return string
+ **/
+function notificationGenerateConfig (&$category, &$event, $type)
+{
+	switch ($type) {
+	case 'option_value':
+	case 'name':
+		return 'notify:' . $category['name'] . '-' . $event['name'];
+		break;
+	case 'option_name':
+		return $category['name'] . '-' . $event['name'];
+		break;
+	default:
+		return false;
+		break;
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/include/notification_constants.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/include/notification_constants.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/include/notification_constants.php	(revision 405)
@@ -0,0 +1,48 @@
+<?php
+// $Id: notification_constants.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.xoops.org/ http://jp.xoops.org/  http://www.myweb.ne.jp/  //
+// Project: The XOOPS Project (http://www.xoops.org/)                        //
+// ------------------------------------------------------------------------- //
+
+// RMV-NOTIFY
+
+define('XOOPS_NOTIFICATION_MODE_SENDALWAYS', 0);
+define('XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE', 1);
+define('XOOPS_NOTIFICATION_MODE_SENDONCETHENWAIT', 2);
+define('XOOPS_NOTIFICATION_MODE_WAITFORLOGIN', 3);
+
+define('XOOPS_NOTIFICATION_METHOD_DISABLE', 0);
+define('XOOPS_NOTIFICATION_METHOD_PM', 1);
+define('XOOPS_NOTIFICATION_METHOD_EMAIL', 2);
+
+define('XOOPS_NOTIFICATION_DISABLE', 0);
+define('XOOPS_NOTIFICATION_ENABLEBLOCK', 1);
+define('XOOPS_NOTIFICATION_ENABLEINLINE', 2);
+define('XOOPS_NOTIFICATION_ENABLEBOTH', 3);
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/include/session.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/include/session.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/include/session.php	(revision 405)
@@ -0,0 +1,39 @@
+<?php
+if (!defined('XOOPS_ROOT_PATH')) {
+    exit();
+}
+
+if (!function_exists('session_regenerate_id')) {
+    if (!defined('XOOPS_SALT')) {
+        define('XOOPS_SALT', substr(md5(XOOPS_DB_PREFIX . XOOPS_DB_USER . XOOPS_ROOT_PATH), 5, 8));
+    }
+    // session_regenerate_id compatible function for PHP Version< PHP4.3.2
+    function session_regenerate_id() {
+        srand(microtime() * 100000);
+        $random = md5(XOOPS_SALT . uniqid(rand(), true));
+        if (session_id($random)) {
+           return true;
+        } else {
+           return false;
+        }
+    }
+}
+
+// Regenerate New Session ID & Delete OLD Session
+function xoops_session_regenerate() {
+    $old_sessid = session_id();
+    session_regenerate_id();
+    $new_sessid = session_id();
+    session_id($old_sessid);
+    session_destroy();
+    $old_session = $_SESSION;
+    session_id($new_sessid);
+    $sess_handler =& xoops_gethandler('session');
+    session_set_save_handler(array(&$sess_handler, 'open'), array(&$sess_handler, 'close'), array(&$sess_handler, 'read'), array(&$sess_handler, 'write'), array(&$sess_handler, 'destroy'), array(&$sess_handler, 'gc'));
+    session_start();
+    $_SESSION = array();
+    foreach (array_keys($old_session) as $key) {
+        $_SESSION[$key] = $old_session[$key];
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/include/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/include/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/include/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/include/comment_delete.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/include/comment_delete.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/include/comment_delete.php	(revision 405)
@@ -0,0 +1,283 @@
+<?php
+// $Id: comment_delete.php,v 1.4 2005/08/03 12:39:11 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.xoops.org/ http://jp.xoops.org/  http://www.myweb.ne.jp/  //
+// Project: The XOOPS Project (http://www.xoops.org/)                        //
+// ------------------------------------------------------------------------- //
+
+if (!defined('XOOPS_ROOT_PATH') || !is_object($xoopsModule)) {
+    exit();
+}
+include_once XOOPS_ROOT_PATH.'/include/comment_constants.php';
+$op = 'delete';
+if (!empty($_POST)) {
+    $com_mode = isset($_POST['com_mode']) ? htmlspecialchars(trim($_POST['com_mode']), ENT_QUOTES) : 'flat';
+    $com_order = isset($_POST['com_order']) ? intval($_POST['com_order']) : XOOPS_COMMENT_OLD1ST;
+    $com_id = isset($_POST['com_id']) ? intval($_POST['com_id']) : 0;
+    $op = isset($_POST['op']) ? $_POST['op'] : 'delete';
+} else {
+    $com_mode = isset($_GET['com_mode']) ? htmlspecialchars(trim($_GET['com_mode']), ENT_QUOTES) : 'flat';
+    $com_order = isset($_GET['com_order']) ? intval($_GET['com_order']) : XOOPS_COMMENT_OLD1ST;
+    $com_id = isset($_GET['com_id']) ? intval($_GET['com_id']) : 0;
+
+}
+
+if ('system' == $xoopsModule->getVar('dirname')) {
+    $comment_handler =& xoops_gethandler('comment');
+    $comment =& $comment_handler->get($com_id);
+    $module_handler =& xoops_gethandler('module');
+    $module =& $module_handler->get($comment->getVar('com_modid'));
+    $comment_config = $module->getInfo('comments');
+    $com_modid = $module->getVar('mid');
+    $redirect_page = XOOPS_URL.'/modules/system/admin.php?fct=comments&amp;com_modid='.$com_modid.'&amp;com_itemid';
+    $moddir = $module->getVar('dirname');
+    unset($comment);
+} else {
+    if (XOOPS_COMMENT_APPROVENONE == $xoopsModuleConfig['com_rule']) {
+        exit();
+    }
+    $comment_config = $xoopsModule->getInfo('comments');
+    $com_modid = $xoopsModule->getVar('mid');
+    $redirect_page = $comment_config['pageName'].'?';
+    $comment_confirm_extra = array();
+    if (isset($comment_config['extraParams']) && is_array($comment_config['extraParams'])) {
+        foreach ($comment_config['extraParams'] as $extra_param) {
+            if (isset(${$extra_param})) {
+                $redirect_page .= $extra_param.'='.${$extra_param}.'&amp;';
+
+                // for the confirmation page
+                $comment_confirm_extra [$extra_param] = ${$extra_param};
+            } elseif (isset($_GET[$extra_param])) {
+                $redirect_page .= $extra_param.'='.$_GET[$extra_param].'&amp;';
+
+                // for the confirmation page
+                $comment_confirm_extra [$extra_param] = $_GET[$extra_param];
+            }
+        }
+    }
+    $redirect_page .= $comment_config['itemName'];
+    $moddir = $xoopsModule->getVar('dirname');
+}
+
+$accesserror = false;
+if (!is_object($xoopsUser)) {
+    $accesserror = true;
+} else {
+    if (!$xoopsUser->isAdmin($com_modid)) {
+        $sysperm_handler =& xoops_gethandler('groupperm');
+        if (!$sysperm_handler->checkRight('system_admin', XOOPS_SYSTEM_COMMENT, $xoopsUser->getGroups())) {
+            $accesserror = true;
+        }
+    }
+}
+
+if (false != $accesserror) {
+    $ref = xoops_getenv('HTTP_REFERER');
+    if ($ref != '') {
+        redirect_header($ref, 2, _NOPERM);
+    } else {
+        redirect_header($redirect_page.'?'.$comment_config['itemName'].'='.intval($com_itemid), 2, _NOPERM);
+    }
+    exit();
+}
+
+include_once XOOPS_ROOT_PATH.'/language/'.$xoopsConfig['language'].'/comment.php';
+
+switch ($op) {
+case 'delete_one':
+    $comment_handler = xoops_gethandler('comment');
+    $comment =& $comment_handler->get($com_id);
+    if (!$comment_handler->delete($comment)) {
+        include XOOPS_ROOT_PATH.'/header.php';
+        xoops_error(_CM_COMDELETENG.' (ID: '.$comment->getVar('com_id').')');
+        include XOOPS_ROOT_PATH.'/footer.php';
+        exit();
+    }
+
+    $com_itemid = $comment->getVar('com_itemid');
+
+    // execute updateStat callback function if set
+    if (isset($comment_config['callback']['update']) && trim($comment_config['callback']['update']) != '') {
+        $skip = false;
+        if (!function_exists($comment_config['callback']['update'])) {
+            if (isset($comment_config['callbackFile'])) {
+                $callbackfile = trim($comment_config['callbackFile']);
+                if ($callbackfile != '' && file_exists(XOOPS_ROOT_PATH.'/modules/'.$moddir.'/'.$callbackfile)) {
+                    include_once XOOPS_ROOT_PATH.'/modules/'.$moddir.'/'.$callbackfile;
+                }
+                if (!function_exists($comment_config['callback']['update'])) {
+                    $skip = true;
+                }
+            } else {
+                $skip = true;
+            }
+        }
+        if (!$skip) {
+            $criteria = new CriteriaCompo(new Criteria('com_modid', $com_modid));
+            $criteria->add(new Criteria('com_itemid', $com_itemid));
+            $criteria->add(new Criteria('com_status', XOOPS_COMMENT_ACTIVE));
+            $comment_count = $comment_handler->getCount($criteria);
+            $comment_config['callback']['update']($com_itemid, $comment_count);
+        }
+    }
+
+    // update user posts if its not an anonymous post
+    if ($comment->getVar('com_uid') != 0) {
+        $member_handler =& xoops_gethandler('member');
+        $com_poster =& $member_handler->getUser($comment->getVar('com_uid'));
+        if (is_object($com_poster)) {
+            $member_handler->updateUserByField($com_poster, 'posts', $com_poster->getVar('posts') - 1);
+        }
+    }
+
+    // get all comments posted later within the same thread
+    $thread_comments =& $comment_handler->getThread($comment->getVar('com_rootid'), $com_id);
+
+    include_once XOOPS_ROOT_PATH.'/class/tree.php';
+    $xot = new XoopsObjectTree($thread_comments, 'com_id', 'com_pid', 'com_rootid');
+
+    $child_comments =& $xot->getFirstChild($com_id);
+
+    // now set new parent ID for direct child comments
+    $new_pid = $comment->getVar('com_pid');
+    $errs = array();
+    foreach (array_keys($child_comments) as $i) {
+        $child_comments[$i]->setVar('com_pid', $new_pid);
+        // if the deleted comment is a root comment, need to change root id to own id
+        if (false != $comment->isRoot()) {
+            $new_rootid = $child_comments[$i]->getVar('com_id');
+            $child_comments[$i]->setVar('com_rootid', $child_comments[$i]->getVar('com_id'));
+            if (!$comment_handler->insert($child_comments[$i])) {
+                $errs[] = 'Could not change comment parent ID from <b>'.$com_id.'</b> to <b>'.$new_pid.'</b>. (ID: '.$new_rootid.')';
+            } else {
+                // need to change root id for all its child comments as well
+                $c_child_comments =& $xot->getAllChild($new_rootid);
+                $cc_count = count($c_child_comments);
+                foreach (array_keys($c_child_comments) as $j) {
+                    $c_child_comments[$j]->setVar('com_rootid', $new_rootid);
+                    if (!$comment_handler->insert($c_child_comments[$j])) {
+                        $errs[] = 'Could not change comment root ID from <b>'.$com_id.'</b> to <b>'.$new_rootid.'</b>.';
+                    }
+                }
+            }
+        } else {
+            if (!$comment_handler->insert($child_comments[$i])) {
+                $errs[] = 'Could not change comment parent ID from <b>'.$com_id.'</b> to <b>'.$new_pid.'</b>.';
+            }
+        }
+    }
+    if (count($errs) > 0) {
+        include XOOPS_ROOT_PATH.'/header.php';
+        xoops_error($errs);
+        include XOOPS_ROOT_PATH.'/footer.php';
+        exit();
+    }
+    redirect_header($redirect_page.'='.$com_itemid.'&amp;com_order='.$com_order.'&amp;com_mode='.$com_mode, 1, _CM_COMDELETED);
+    break;
+
+case 'delete_all':
+    $comment_handler = xoops_gethandler('comment');
+    $comment =& $comment_handler->get($com_id);
+    $com_rootid = $comment->getVar('com_rootid');
+
+    // get all comments posted later within the same thread
+    $thread_comments =& $comment_handler->getThread($com_rootid, $com_id);
+
+    // construct a comment tree
+    include_once XOOPS_ROOT_PATH.'/class/tree.php';
+    $xot = new XoopsObjectTree($thread_comments, 'com_id', 'com_pid', 'com_rootid');
+    $child_comments =& $xot->getAllChild($com_id);
+    // add itself here
+    $child_comments[$com_id] =& $comment;
+    $msgs = array();
+    $deleted_num = array();
+    $member_handler =& xoops_gethandler('member');
+    foreach (array_keys($child_comments) as $i) {
+        if (!$comment_handler->delete($child_comments[$i])) {
+            $msgs[] = _CM_COMDELETENG.' (ID: '.$child_comments[$i]->getVar('com_id').')';
+        } else {
+            $msgs[] = _CM_COMDELETED.' (ID: '.$child_comments[$i]->getVar('com_id').')';
+            // store poster ID and deleted post number into array for later use
+            $poster_id = $child_comments[$i]->getVar('com_uid');
+            if ($poster_id > 0) {
+                $deleted_num[$poster_id] = !isset($deleted_num[$poster_id]) ? 1 : ($deleted_num[$poster_id] + 1);
+            }
+        }
+    }
+    foreach ($deleted_num as $user_id => $post_num) {
+        // update user posts
+        $com_poster = $member_handler->getUser($user_id);
+        if (is_object($com_poster)) {
+            $member_handler->updateUserByField($com_poster, 'posts', $com_poster->getVar('posts') - $post_num);
+        }
+    }
+
+    $com_itemid = $comment->getVar('com_itemid');
+
+    // execute updateStat callback function if set
+    if (isset($comment_config['callback']['update']) && trim($comment_config['callback']['update']) != '') {
+        $skip = false;
+        if (!function_exists($comment_config['callback']['update'])) {
+            if (isset($comment_config['callbackFile'])) {
+                $callbackfile = trim($comment_config['callbackFile']);
+                if ($callbackfile != '' && file_exists(XOOPS_ROOT_PATH.'/modules/'.$moddir.'/'.$callbackfile)) {
+                    include_once XOOPS_ROOT_PATH.'/modules/'.$moddir.'/'.$callbackfile;
+                }
+                if (!function_exists($comment_config['callback']['update'])) {
+                    $skip = true;
+                }
+            } else {
+                $skip = true;
+            }
+        }
+        if (!$skip) {
+            $criteria = new CriteriaCompo(new Criteria('com_modid', $com_modid));
+            $criteria->add(new Criteria('com_itemid', $com_itemid));
+            $criteria->add(new Criteria('com_status', XOOPS_COMMENT_ACTIVE));
+            $comment_count = $comment_handler->getCount($criteria);
+            $comment_config['callback']['update']($com_itemid, $comment_count);
+        }
+    }
+
+    include XOOPS_ROOT_PATH.'/header.php';
+    xoops_result($msgs);
+    echo '<br /><a href="'.$redirect_page.'='.$com_itemid.'&amp;com_order='.$com_order.'&amp;com_mode='.$com_mode.'">'._BACK.'</a>';
+    include XOOPS_ROOT_PATH.'/footer.php';
+    break;
+
+case 'delete':
+default:
+    include XOOPS_ROOT_PATH.'/header.php';
+    $comment_confirm = array('com_id' => $com_id, 'com_mode' => $com_mode, 'com_order' => $com_order, 'op' => array(_CM_DELETEONE => 'delete_one', _CM_DELETEALL => 'delete_all'));
+    if (!empty($comment_confirm_extra) && is_array($comment_confirm_extra)) {
+        $comment_confirm = $comment_confirm + $comment_confirm_extra;
+    }
+    xoops_confirm($comment_confirm, 'comment_delete.php', _CM_DELETESELECT);
+    include XOOPS_ROOT_PATH.'/footer.php';
+    break;
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/include/version.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/include/version.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/include/version.php	(revision 405)
@@ -0,0 +1,4 @@
+<?php
+// $Id: version.php,v 1.16 2006/08/06 13:07:08 onokazu Exp $
+define("XOOPS_VERSION","XOOPS 2.0.16a JP");
+?>
Index: /temp/test-xoops.ec-cube.net/html/include/notification_select.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/include/notification_select.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/include/notification_select.php	(revision 405)
@@ -0,0 +1,83 @@
+<?php
+// $Id: notification_select.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+if (!defined('XOOPS_ROOT_PATH')) {
+	exit();
+}
+include_once XOOPS_ROOT_PATH.'/include/notification_constants.php';
+include_once XOOPS_ROOT_PATH.'/include/notification_functions.php';
+$xoops_notification = array();
+$xoops_notification['show'] = isset($xoopsModule) && is_object($xoopsUser) && notificationEnabled('inline') ? 1 : 0;
+if ($xoops_notification['show']) {
+	include_once XOOPS_ROOT_PATH.'/language/'.$xoopsConfig['language'].'/notification.php';
+	$categories =& notificationSubscribableCategoryInfo();
+	$event_count = 0;
+	if (!empty($categories)) {
+		$notification_handler =& xoops_gethandler('notification');
+		foreach ($categories as $category) {
+			$section['name'] = $category['name'];
+			$section['title'] = $category['title'];
+			$section['description'] = $category['description'];
+			$section['itemid'] = $category['item_id'];
+			$section['events'] = array();
+			$subscribed_events =& $notification_handler->getSubscribedEvents($category['name'], $category['item_id'], $xoopsModule->getVar('mid'), $xoopsUser->getVar('uid'));
+			foreach (notificationEvents($category['name'], true) as $event) {
+            	if (!empty($event['admin_only']) && !$xoopsUser->isAdmin($xoopsModule->getVar('mid'))) {
+                	continue;
+            	}
+				if (!empty($event['invisible'])) {
+					continue;
+				}
+				$subscribed = in_array($event['name'], $subscribed_events) ? 1 : 0;
+				$section['events'][$event['name']] = array ('name'=>$event['name'], 'title'=>$event['title'], 'caption'=>$event['caption'], 'description'=>$event['description'], 'subscribed'=>$subscribed);
+				$event_count ++;
+			}
+			$xoops_notification['categories'][$category['name']] = $section;
+		}
+		$xoops_notification['target_page'] = "notification_update.php";
+		$xoops_notification['redirect_script'] = xoops_getenv('PHP_SELF');
+		$xoopsTpl->assign(array('lang_activenotifications' => _NOT_ACTIVENOTIFICATIONS, 'lang_notificationoptions' => _NOT_NOTIFICATIONOPTIONS, 'lang_updateoptions' => _NOT_UPDATEOPTIONS, 'lang_updatenow' => _NOT_UPDATENOW, 'lang_category' => _NOT_CATEGORY, 'lang_event' => _NOT_EVENT, 'lang_events' => _NOT_EVENTS, 'lang_checkall' => _NOT_CHECKALL, 'lang_notificationmethodis' => _NOT_NOTIFICATIONMETHODIS, 'lang_change' => _NOT_CHANGE, 'editprofile_url' => XOOPS_URL . '/edituser.php?uid=' . $xoopsUser->getVar('uid')));
+		switch ($xoopsUser->getVar('notify_method')) {
+		case XOOPS_NOTIFICATION_METHOD_DISABLE:
+			$xoopsTpl->assign('user_method', _NOT_DISABLE);
+			break;
+		case XOOPS_NOTIFICATION_METHOD_PM:
+			$xoopsTpl->assign('user_method', _NOT_PM);
+			break;
+		case XOOPS_NOTIFICATION_METHOD_EMAIL:
+			$xoopsTpl->assign('user_method', _NOT_EMAIL);
+			break;
+		}
+	} else {
+		$xoops_notification['show'] = 0;
+	}
+	if ($event_count == 0) {
+		$xoops_notification['show'] = 0;
+	}
+}
+$xoopsTpl->assign('xoops_notification', $xoops_notification);
+?>
Index: /temp/test-xoops.ec-cube.net/html/include/comment_form.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/include/comment_form.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/include/comment_form.php	(revision 405)
@@ -0,0 +1,144 @@
+<?php
+// $Id: comment_form.php,v 1.5 2005/08/03 12:39:11 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+if (!defined('XOOPS_ROOT_PATH') || !is_object($xoopsModule)) {
+    exit();
+}
+$com_modid = $xoopsModule->getVar('mid');
+include_once XOOPS_ROOT_PATH."/class/xoopslists.php";
+include_once XOOPS_ROOT_PATH."/class/xoopsformloader.php";
+$cform = new XoopsThemeForm(_CM_POSTCOMMENT, "commentform", 'comment_post.php');if (isset($xoopsModuleConfig['com_rule'])) {
+    include_once XOOPS_ROOT_PATH.'/include/comment_constants.php';
+    switch ($xoopsModuleConfig['com_rule']) {
+    case XOOPS_COMMENT_APPROVEALL:
+        $rule_text = _CM_COMAPPROVEALL;
+        break;
+    case XOOPS_COMMENT_APPROVEUSER:
+        $rule_text = _CM_COMAPPROVEUSER;
+        break;
+    case XOOPS_COMMENT_APPROVEADMIN:
+        default:
+        $rule_text = _CM_COMAPPROVEADMIN;
+        break;
+    }
+    $cform->addElement(new XoopsFormLabel(_CM_COMRULES, $rule_text));
+}
+
+$cform->addElement(new XoopsFormText(_CM_TITLE, 'com_title', 50, 255, $com_title), true);
+$icons_radio = new XoopsFormRadio(_MESSAGEICON, 'com_icon', $com_icon);
+$subject_icons = XoopsLists::getSubjectsList();
+
+
+//Added By viva(2005/12/13) --->
+if (!is_object($xoopsUser)) {
+	$cform->addElement(
+				new XoopsFormText(
+					_CM_POSTER,
+					'com_poster_name',
+					 20,
+					 60,
+					 $com_poster_name
+				),
+			true);
+}
+//Added By viva(2005/12/13) <---
+
+
+foreach ($subject_icons as $iconfile) {
+    $icons_radio->addOption($iconfile, '<img src="'.XOOPS_URL.'/images/subject/'.$iconfile.'" alt="" />');
+}
+$cform->addElement($icons_radio);
+$cform->addElement(new XoopsFormDhtmlTextArea(_CM_MESSAGE, 'com_text', $com_text, 10, 50), true);
+$option_tray = new XoopsFormElementTray(_OPTIONS,'<br />');
+
+$button_tray = new XoopsFormElementTray('' ,'&nbsp;');
+
+
+if (is_object($xoopsUser)) {
+    if ($xoopsModuleConfig['com_anonpost'] == 1) {
+        $noname = !empty($noname) ? 1 : 0;
+        $noname_checkbox = new XoopsFormCheckBox('', 'noname', $noname);
+        $noname_checkbox->addOption(1, _POSTANON);
+        $option_tray->addElement($noname_checkbox);
+    }
+    if (false != $xoopsUser->isAdmin($com_modid)) {
+        // show status change box when editing (comment id is not empty)
+        if (!empty($com_id)) {
+            include_once XOOPS_ROOT_PATH.'/include/comment_constants.php';
+            $status_select = new XoopsFormSelect(_CM_STATUS, 'com_status', $com_status);
+            $status_select->addOptionArray(array(XOOPS_COMMENT_PENDING => _CM_PENDING, XOOPS_COMMENT_ACTIVE => _CM_ACTIVE, XOOPS_COMMENT_HIDDEN => _CM_HIDDEN));
+            $cform->addElement($status_select);
+            $button_tray->addElement(new XoopsFormButton('', 'com_dodelete', _DELETE, 'submit'));
+        }
+        $html_checkbox = new XoopsFormCheckBox('', 'dohtml', $dohtml);
+        $html_checkbox->addOption(1, _CM_DOHTML);
+        $option_tray->addElement($html_checkbox);
+    }
+}
+$smiley_checkbox = new XoopsFormCheckBox('', 'dosmiley', $dosmiley);
+$smiley_checkbox->addOption(1, _CM_DOSMILEY);
+$option_tray->addElement($smiley_checkbox);
+$xcode_checkbox = new XoopsFormCheckBox('', 'doxcode', $doxcode);
+$xcode_checkbox->addOption(1, _CM_DOXCODE);
+$option_tray->addElement($xcode_checkbox);
+$br_checkbox = new XoopsFormCheckBox('', 'dobr', $dobr);
+$br_checkbox->addOption(1, _CM_DOAUTOWRAP);
+$option_tray->addElement($br_checkbox);
+
+$cform->addElement($option_tray);
+$cform->addElement(new XoopsFormHidden('com_pid', intval($com_pid)));
+$cform->addElement(new XoopsFormHidden('com_rootid', intval($com_rootid)));
+$cform->addElement(new XoopsFormHidden('com_id', $com_id));
+$cform->addElement(new XoopsFormHidden('com_itemid', $com_itemid));
+$cform->addElement(new XoopsFormHidden('com_order', $com_order));
+$cform->addElement(new XoopsFormHidden('com_mode', $com_mode));
+
+// add module specific extra params
+
+if ('system' != $xoopsModule->getVar('dirname')) {
+    $comment_config = $xoopsModule->getInfo('comments');
+    if (isset($comment_config['extraParams']) && is_array($comment_config['extraParams'])) {
+        $myts =& MyTextSanitizer::getInstance();
+        foreach ($comment_config['extraParams'] as $extra_param) {
+            // This routine is included from forms accessed via both GET and POST
+            if (isset($_POST[$extra_param])) {
+                $hidden_value = $myts->stripSlashesGPC($_POST[$extra_param]);
+            } elseif (isset($_GET[$extra_param])) {
+                $hidden_value = $myts->stripSlashesGPC($_GET[$extra_param]);
+            } else {
+                $hidden_value = '';
+            }
+            $cform->addElement(new XoopsFormHidden($extra_param, htmlspecialchars($hidden_value, ENT_QUOTES)));
+        }
+    }
+}
+$button_tray->addElement(new XoopsFormButton('', 'com_dopreview', _PREVIEW, 'submit'));
+$button_tray->addElement(new XoopsFormButton('', 'com_dopost', _CM_POSTCOMMENT, 'submit'));
+$cform->addElement($button_tray);
+//$cform->addElement(new XoopsFormHiddenToken());
+$cform->display();
+?>
Index: /temp/test-xoops.ec-cube.net/html/include/xoopscodes.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/include/xoopscodes.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/include/xoopscodes.php	(revision 405)
@@ -0,0 +1,107 @@
+<?php
+// $Id: xoopscodes.php,v 1.5 2006/05/01 02:37:26 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.xoops.org/ http://jp.xoops.org/  http://www.myweb.ne.jp/  //
+// Project: The XOOPS Project (http://www.xoops.org/)                        //
+// ------------------------------------------------------------------------- //
+
+/*
+*  displayes xoopsCode buttons and target textarea to which xoopscodes are inserted
+*  $textarea_id is a unique id of the target textarea
+*/
+function xoopsCodeTarea($textarea_id, $cols=60, $rows=15, $suffix=null)
+{
+    $hiddentext = isset($suffix) ? 'xoopsHiddenText'.trim($suffix) : 'xoopsHiddenText';
+    //Hack for url, email ...., the anchor is for having a link on [_More...]
+    echo "<a name='moresmiley'></a><img src='".XOOPS_URL."/images/url.gif' alt='url' onmouseover='style.cursor=\"hand\"' onclick='xoopsCodeUrl(\"$textarea_id\", \"".htmlspecialchars(_ENTERURL, ENT_QUOTES)."\", \"".htmlspecialchars(_ENTERWEBTITLE, ENT_QUOTES)."\");'/>&nbsp;<img src='".XOOPS_URL."/images/email.gif' alt='email' onmouseover='style.cursor=\"hand\"' onclick='xoopsCodeEmail(\"$textarea_id\", \"".htmlspecialchars(_ENTEREMAIL, ENT_QUOTES)."\");' />&nbsp;<img src='".XOOPS_URL."/images/imgsrc.gif' alt='imgsrc' onmouseover='style.cursor=\"hand\"' onclick='xoopsCodeImg(\"$textarea_id\", \"".htmlspecialchars(_ENTERIMGURL, ENT_QUOTES)."\", \"".htmlspecialchars(_ENTERIMGPOS, ENT_QUOTES)."\", \"".htmlspecialchars(_IMGPOSRORL, ENT_QUOTES)."\", \"".htmlspecialchars(_ERRORIMGPOS, ENT_QUOTES)."\");' />&nbsp;<img src='".XOOPS_URL."/images/image.gif' alt='image' onmouseover='style.cursor=\"hand\"' onclick='openWithSelfMain(\"".XOOPS_URL."/imagemanager.php?target=".$textarea_id."\",\"imgmanager\",400,430);' />&nbsp;<img src='".XOOPS_URL."/images/code.gif' alt='code' onmouseover='style.cursor=\"hand\"' onclick='xoopsCodeCode(\"$textarea_id\", \"".htmlspecialchars(_ENTERCODE, ENT_QUOTES)."\");' />&nbsp;<img src='".XOOPS_URL."/images/quote.gif' alt='quote' onmouseover='style.cursor=\"hand\"' onclick='xoopsCodeQuote(\"$textarea_id\");'/><br />\n";
+
+    $sizearray = array("xx-small", "x-small", "small", "medium", "large", "x-large", "xx-large");
+    echo "<select id='".$textarea_id."Size' onchange='setVisible(\"xoopsHiddenText\");setElementSize(\"".$hiddentext."\",this.options[this.selectedIndex].value);'>\n";
+    echo "<option value='SIZE'>"._SIZE."</option>\n";
+    foreach ( $sizearray as $size ) {
+        echo "<option value='$size'>$size</option>\n";
+    }
+    echo "</select>\n";
+
+    $fontarray = array("Arial", "Courier", "Georgia", "Helvetica", "Impact", "Verdana");
+    echo "<select id='".$textarea_id."Font' onchange='setVisible(\"xoopsHiddenText\");setElementFont(\"".$hiddentext."\",this.options[this.selectedIndex].value);'>\n";
+    echo "<option value='FONT'>"._FONT."</option>\n";
+    foreach ( $fontarray as $font ) {
+        echo "<option value='$font'>$font</option>\n";
+    }
+    echo "</select>\n";
+
+    $colorarray = array("00", "33", "66", "99", "CC", "FF");
+    echo "<select id='".$textarea_id."Color' onchange='setVisible(\"xoopsHiddenText\");setElementColor(\"".$hiddentext."\",this.options[this.selectedIndex].value);'>\n";
+    echo "<option value='COLOR'>"._COLOR."</option>\n";
+    foreach ( $colorarray as $color1 ) {
+        foreach ( $colorarray as $color2 ) {
+            foreach ( $colorarray as $color3 ) {
+                echo "<option value='".$color1.$color2.$color3."' style='background-color:#".$color1.$color2.$color3.";color:#".$color1.$color2.$color3.";'>#".$color1.$color2.$color3."</option>\n";
+            }
+        }
+    }
+    echo "</select><span id='".$hiddentext."'>"._EXAMPLE."</span>\n";
+
+    echo "<br />\n";
+    //Hack smilies move for bold, italic ...
+    $areacontent = isset( $GLOBALS[$textarea_id] ) ? $GLOBALS[$textarea_id] : '';
+    echo "<img src='".XOOPS_URL."/images/bold.gif' alt='bold' onmouseover='style.cursor=\"hand\"' onclick='setVisible(\"".$hiddentext."\");makeBold(\"".$hiddentext."\");' />&nbsp;<img src='".XOOPS_URL."/images/italic.gif' alt='italic' onmouseover='style.cursor=\"hand\"' onclick='setVisible(\"".$hiddentext."\");makeItalic(\"".$hiddentext."\");' />&nbsp;<img src='".XOOPS_URL."/images/underline.gif' alt='underline' onmouseover='style.cursor=\"hand\"' onclick='setVisible(\"".$hiddentext."\");makeUnderline(\"".$hiddentext."\");'/>&nbsp;<img src='".XOOPS_URL."/images/linethrough.gif' alt='linethrough' onmouseover='style.cursor=\"hand\"' onclick='setVisible(\"".$hiddentext."\");makeLineThrough(\"".$hiddentext."\");' />&nbsp;<input type='text' id='".$textarea_id."Addtext' size='20' />&nbsp;<input type='button' onclick='xoopsCodeText(\"$textarea_id\", \"".$hiddentext."\", \"".htmlspecialchars(_ENTERTEXTBOX, ENT_QUOTES)."\")' value='"._ADD."' /><br /><br /><textarea id='".$textarea_id."' name='".$textarea_id."' cols='$cols' rows='$rows'>".$areacontent."</textarea><br />\n";
+    //Fin du hack
+}
+
+/*
+*  Displays smilie image buttons used to insert smilie codes to a target textarea in a form
+* $textarea_id is a unique of the target textarea
+*/
+function xoopsSmilies($textarea_id)
+{
+    $myts =& MyTextSanitizer::getInstance();
+    $smiles = $myts->getSmileys();
+    if (empty($smileys)) {
+        $db =& Database::getInstance();
+        if ($result = $db->query('SELECT * FROM '.$db->prefix('smiles').' WHERE display=1')) {
+            while ($smiles = $db->fetchArray($result)) {
+            //hack smilies move for the smilies !!
+                echo "<img src='".XOOPS_UPLOAD_URL."/".htmlspecialchars($smiles['smile_url'])."' border='0' onmouseover='style.cursor=\"hand\"' alt='' onclick='xoopsCodeSmilie(\"".$textarea_id."\", \" ".$smiles['code']." \");' />";
+            //fin du hack
+            }
+        }
+    } else {
+        $count = count($smiles);
+        for ($i = 0; $i < $count; $i++) {
+            if ($smiles[$i]['display'] == 1) {
+            //hack bis
+                echo "<img src='".XOOPS_UPLOAD_URL."/".$myts->oopsHtmlSpecialChars($smiles['smile_url'])."' border='0' alt='' onclick='xoopsCodeSmilie(\"".$textarea_id."\", \" ".$smiles[$i]['code']." \");' onmouseover='style.cursor=\"hand\"' />";
+            //fin du hack
+            }
+        }
+    }
+    //hack for more
+    echo "&nbsp;[<a href='#moresmiley' onmouseover='style.cursor=\"hand\"' alt='' onclick='openWithSelfMain(\"".XOOPS_URL."/misc.php?action=showpopups&amp;type=smilies&amp;target=".$textarea_id."\",\"smilies\",300,475);'>"._MORE."</a>]";
+}  //fin du hack
+?>
Index: /temp/test-xoops.ec-cube.net/html/include/old_theme_functions.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/include/old_theme_functions.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/include/old_theme_functions.php	(revision 405)
@@ -0,0 +1,56 @@
+<?php
+// $Id: old_theme_functions.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.xoops.org/ http://jp.xoops.org/  http://www.myweb.ne.jp/  //
+// Project: The XOOPS Project (http://www.xoops.org/)                        //
+// ------------------------------------------------------------------------- //
+
+// These are needed when viewing old modules (that don't use Smarty template files) when a theme that use Smarty templates are selected.
+
+// function_exists check is needed for inclusion from the admin side
+
+if (!function_exists('opentable')) {
+	function OpenTable($width='100%')
+	{
+		echo '<table width="'.$width.'" cellspacing="0" class="outer"><tr><td class="even">';
+	}
+}
+
+if (!function_exists('closetable')) {
+	function CloseTable()
+	{
+		echo '</td></tr></table>';
+	}
+}
+
+if (!function_exists('themecenterposts')) {
+	function themecenterposts($title, $content)
+	{
+		echo '<table cellpadding="4" cellspacing="1" width="98%" class="outer"><tr><td class="head">'.$title.'</td></tr><tr><td><br />'.$content.'<br /></td></tr></table>';
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/include/notification_update.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/include/notification_update.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/include/notification_update.php	(revision 405)
@@ -0,0 +1,123 @@
+<?php
+// $Id: notification_update.php,v 1.3 2005/08/03 12:39:11 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+// RMV-NOTIFY
+
+// This module expects the following arguments:
+//
+// not_submit
+// not_redirect (to return back after update)
+// not_mid (TODO)
+// not_uid (TODO)
+// not_list[1][params] = {category},{itemid},{event}
+// not_list[1][status] = 1 if selected; 0 or missing if not selected
+// etc...
+
+// TODO: can we put arguments in the not_redirect argument??? do we need
+// to specially encode them first???
+
+// TODO: allow 'GET' also so we can process 'unsubscribe' requests??
+
+if (!defined('XOOPS_ROOT_PATH') || !is_object($xoopsModule)) {
+	exit();
+}
+
+include_once XOOPS_ROOT_PATH.'/include/notification_constants.php';
+include_once XOOPS_ROOT_PATH.'/include/notification_functions.php';
+include_once XOOPS_ROOT_PATH.'/language/'.$xoopsConfig['language'].'/notification.php';
+
+if (!isset($_POST['not_submit'])) {
+	exit();
+}
+
+// NOTE: in addition to the templates provided in the block and view
+// modes, we can have buttons, etc. which load the arguments to be
+// read by this script.  That way a module can really customize its 
+// look as to where/how the notification options are made available.
+
+$update_list = $_POST['not_list'];
+
+$module_id = $xoopsModule->getVar('mid');
+$user_id = !empty($xoopsUser) ? $xoopsUser->getVar('uid') : 0;
+
+// For each event, update the notification depending on the status.
+// If status=1, subscribe to the event; otherwise, unsubscribe.
+
+// FIXME: right now I just ignore database errors (e.g. if already
+//  subscribed)... deal with this more gracefully?
+
+$notification_handler =& xoops_gethandler('notification');
+
+foreach ($update_list as $update_item) {
+
+	list($category, $item_id, $event) = split (',', $update_item['params']);
+	$status = !empty($update_item['status']) ? 1 : 0;
+
+	if (!$status) {
+		$notification_handler->unsubscribe($category, $item_id, $event, $module_id, $user_id);
+	} else {
+		$notification_handler->subscribe($category, $item_id, $event);
+	}
+
+}
+
+// TODO: something like grey box summary of actions (like multiple comment
+// deletion), with a button to return back...  NOTE: we need some arguments
+// to help us get back to where we were...
+
+// TODO: finish integration with comments... i.e. need calls to
+// notifyUsers at appropriate places... (need to figure out where
+// comment submit occurs and where comment approval occurs)...
+
+include_once XOOPS_ROOT_PATH . '/include/notification_functions.php';
+
+$redirect_args = array();
+foreach ($update_list as $update_item) {
+	list($category,$item_id,$event) = split(',',$update_item['params']);
+	$category_info =& notificationCategoryInfo($category);
+	if (!empty($category_info['item_name'])) {
+		$redirect_args[$category_info['item_name']] = $item_id;
+	}
+}
+
+// TODO: write a central function to put together args with '?' and '&amp;'
+// symbols...
+$argstring = '';
+$first_arg = 1;
+foreach (array_keys($redirect_args) as $arg) {
+	if ($first_arg) {
+		$argstring .= "?" . $arg . "=" . $redirect_args[$arg];
+		$first_arg = 0;
+	} else {
+		$argstring .= "&amp;" . $arg . "=" . $redirect_args[$arg];
+	}
+}
+
+redirect_header ($_POST['not_redirect'].$argstring, 3, _NOT_UPDATEOK);
+exit();
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/include/common.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/include/common.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/include/common.php	(revision 405)
@@ -0,0 +1,346 @@
+<?php
+// $Id: common.php,v 1.6.2.1 2005/08/25 03:16:50 minahito Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+if (!defined("XOOPS_MAINFILE_INCLUDED")) {
+    exit();
+} else {
+    foreach (array('GLOBALS', '_SESSION', 'HTTP_SESSION_VARS', '_GET', 'HTTP_GET_VARS', '_POST', 'HTTP_POST_VARS', '_COOKIE', 'HTTP_COOKIE_VARS', '_REQUEST', '_SERVER', 'HTTP_SERVER_VARS', '_ENV', 'HTTP_ENV_VARS', '_FILES', 'HTTP_POST_FILES', 'xoopsDB', 'xoopsUser', 'xoopsUserId', 'xoopsUserGroups', 'xoopsUserIsAdmin', 'xoopsConfig', 'xoopsOption', 'xoopsModule', 'xoopsModuleConfig') as $bad_global) {
+        if (isset($_REQUEST[$bad_global])) {
+            header('Location: '.XOOPS_URL.'/');
+            exit();
+        }
+    }
+    // ############## Activate error handler ##############
+    include_once XOOPS_ROOT_PATH . '/class/errorhandler.php';
+    $xoopsErrorHandler =& XoopsErrorHandler::getInstance();
+    // Turn on error handler by default (until config value obtained from DB)
+    $xoopsErrorHandler->activate(true);
+
+    define("XOOPS_SIDEBLOCK_LEFT",0);
+    define("XOOPS_SIDEBLOCK_RIGHT",1);
+    define("XOOPS_SIDEBLOCK_BOTH",2);
+    define("XOOPS_CENTERBLOCK_LEFT",3);
+    define("XOOPS_CENTERBLOCK_RIGHT",4);
+    define("XOOPS_CENTERBLOCK_CENTER",5);
+    define("XOOPS_CENTERBLOCK_ALL",6);
+    define("XOOPS_BLOCK_INVISIBLE",0);
+    define("XOOPS_BLOCK_VISIBLE",1);
+    define("XOOPS_MATCH_START",0);
+    define("XOOPS_MATCH_END",1);
+    define("XOOPS_MATCH_EQUAL",2);
+    define("XOOPS_MATCH_CONTAIN",3);
+    define("SMARTY_DIR", XOOPS_ROOT_PATH."/class/smarty/");
+    define("XOOPS_CACHE_PATH", XOOPS_ROOT_PATH."/cache");
+    define("XOOPS_UPLOAD_PATH", XOOPS_ROOT_PATH."/uploads");
+    define("XOOPS_THEME_PATH", XOOPS_ROOT_PATH."/themes");
+    define("XOOPS_COMPILE_PATH", XOOPS_ROOT_PATH."/templates_c");
+    define("XOOPS_THEME_URL", XOOPS_URL."/themes");
+    define("XOOPS_UPLOAD_URL", XOOPS_URL."/uploads");
+    set_magic_quotes_runtime(0);
+    include_once XOOPS_ROOT_PATH.'/class/logger.php';
+    $xoopsLogger =& XoopsLogger::instance();
+    $xoopsLogger->startTime();
+    if (!defined('XOOPS_XMLRPC')) {
+        define('XOOPS_DB_CHKREF', 1);
+    } else {
+        define('XOOPS_DB_CHKREF', 0);
+    }
+
+    // ############## Include common functions file ##############
+    include_once XOOPS_ROOT_PATH.'/include/functions.php';
+
+    // #################### Connect to DB ##################
+    require_once XOOPS_ROOT_PATH.'/class/database/databasefactory.php';
+    if ($_SERVER['REQUEST_METHOD'] != 'POST' || !xoops_refcheck(XOOPS_DB_CHKREF)) {
+        define('XOOPS_DB_PROXY', 1);
+    }
+    $xoopsDB =& XoopsDatabaseFactory::getDatabaseConnection();
+
+    // ################# Include required files ##############
+    require_once XOOPS_ROOT_PATH.'/kernel/object.php';
+    require_once XOOPS_ROOT_PATH.'/class/criteria.php';
+    require_once XOOPS_ROOT_PATH.'/class/token.php';
+
+    // for xoops.org 2.0.10 compatibility
+    require_once XOOPS_ROOT_PATH.'/class/xoopssecurity.php';
+    $xoopsSecurity = new XoopsSecurity();
+
+    // #################### Include text sanitizer ##################
+    include_once XOOPS_ROOT_PATH."/class/module.textsanitizer.php";
+
+    // ################# Load Config Settings ##############
+    $config_handler =& xoops_gethandler('config');
+    $xoopsConfig =& $config_handler->getConfigsByCat(XOOPS_CONF);
+
+    // #################### Error reporting settings ##################
+    error_reporting(0);
+
+    if ($xoopsConfig['debug_mode'] == 1) {
+        error_reporting(E_ALL);
+    } else {
+        // Turn off error handler
+        $xoopsErrorHandler->activate(false);
+    }
+
+    if ($xoopsConfig['enable_badips'] == 1 && isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] != '') {
+        foreach ($xoopsConfig['bad_ips'] as $bi) {
+            if (!empty($bi) && preg_match("/".$bi."/", $_SERVER['REMOTE_ADDR'])) {
+                exit();
+            }
+        }
+    }
+    unset($bi);
+    unset($bad_ips);
+    unset($xoopsConfig['badips']);
+
+    // ################# Include version info file ##############
+    include_once XOOPS_ROOT_PATH."/include/version.php";
+
+    // for older versions...will be DEPRECATED!
+    $xoopsConfig['xoops_url'] = XOOPS_URL;
+    $xoopsConfig['root_path'] = XOOPS_ROOT_PATH."/";
+
+
+    // #################### Include site-wide lang file ##################
+    if ( file_exists(XOOPS_ROOT_PATH."/language/".$xoopsConfig['language']."/global.php") ) {
+        include_once XOOPS_ROOT_PATH."/language/".$xoopsConfig['language']."/global.php";
+    } else {
+        include_once XOOPS_ROOT_PATH."/language/english/global.php";
+    }
+
+    // ################ Include page-specific lang file ################
+    if (isset($xoopsOption['pagetype']) && false === strpos($xoopsOption['pagetype'], '.')) {
+        if ( file_exists(XOOPS_ROOT_PATH."/language/".$xoopsConfig['language']."/".$xoopsOption['pagetype'].".php") ) {
+            include_once XOOPS_ROOT_PATH."/language/".$xoopsConfig['language']."/".$xoopsOption['pagetype'].".php";
+        } else {
+            include_once XOOPS_ROOT_PATH."/language/english/".$xoopsOption['pagetype'].".php";
+        }
+    }
+    $xoopsOption = array();
+
+    if ( !defined("XOOPS_USE_MULTIBYTES") ) {
+        define("XOOPS_USE_MULTIBYTES",0);
+    }
+
+    /**#@+
+     * Host abstraction layer
+     */
+    if ( !isset($_SERVER['PATH_TRANSLATED']) && isset($_SERVER['SCRIPT_FILENAME']) ) {
+        $_SERVER['PATH_TRANSLATED'] =& $_SERVER['SCRIPT_FILENAME'];     // For Apache CGI
+    } elseif ( isset($_SERVER['PATH_TRANSLATED']) && !isset($_SERVER['SCRIPT_FILENAME']) ) {
+        $_SERVER['SCRIPT_FILENAME'] =& $_SERVER['PATH_TRANSLATED'];     // For IIS/2K now I think :-(
+    }
+
+    if (empty($_SERVER['REQUEST_URI'])) {         // Not defined by IIS
+        // Under some configs, IIS makes SCRIPT_NAME point to php.exe :-(
+        if ( !( $_SERVER[ 'REQUEST_URI' ] = @$_SERVER['PHP_SELF'] ) ) {
+            $_SERVER[ 'REQUEST_URI' ] = $_SERVER['SCRIPT_NAME'];
+        }
+        if ( isset( $_SERVER[ 'QUERY_STRING' ] ) ) {
+            $_SERVER[ 'REQUEST_URI' ] .= '?' . $_SERVER[ 'QUERY_STRING' ];
+        }
+        
+        // Guard for XSS string of PHP_SELF
+        if(preg_match("/[\<\>\"\'\(\)]/",$_SERVER['REQUEST_URI']))
+            die();
+    }
+    $xoopsRequestUri = $_SERVER[ 'REQUEST_URI' ];       // Deprecated (use the corrected $_SERVER variable now)
+    /**#@-*/
+
+    // ############## Login a user with a valid session ##############
+    $xoopsUser = '';
+    $xoopsUserIsAdmin = false;
+    $member_handler =& xoops_gethandler('member');
+    $sess_handler =& xoops_gethandler('session');
+    if ($xoopsConfig['use_ssl'] && isset($_POST[$xoopsConfig['sslpost_name']]) && $_POST[$xoopsConfig['sslpost_name']] != '') {
+        session_id($_POST[$xoopsConfig['sslpost_name']]);
+    } elseif ($xoopsConfig['use_mysession'] && $xoopsConfig['session_name'] != '') {
+        if (isset($_COOKIE[$xoopsConfig['session_name']])) {
+            session_id($_COOKIE[$xoopsConfig['session_name']]);
+        } else {
+            // no custom session cookie set, destroy session if any
+            $_SESSION = array();
+            //session_destroy();
+        }
+        @ini_set('session.gc_maxlifetime', $xoopsConfig['session_expire'] * 60);
+    }
+    session_set_save_handler(array(&$sess_handler, 'open'), array(&$sess_handler, 'close'), array(&$sess_handler, 'read'), array(&$sess_handler, 'write'), array(&$sess_handler, 'destroy'), array(&$sess_handler, 'gc'));
+    session_start();
+
+	// autologin hack GIJ
+	if(empty($_SESSION['xoopsUserId']) && isset($_COOKIE['autologin_uname']) && isset($_COOKIE['autologin_pass'])) {
+
+		// autologin V2 GIJ
+		if( ! empty( $_POST ) ) {
+			$_SESSION['AUTOLOGIN_POST'] = $_POST ;
+			$_SESSION['AUTOLOGIN_REQUEST_URI'] = $_SERVER['REQUEST_URI'] ;
+			redirect_header( XOOPS_URL . '/session_confirm.php' , 0 , '&nbsp;' ) ;
+		} else if( ! empty( $_SERVER['QUERY_STRING'] ) && substr( $_SERVER['SCRIPT_NAME'] , -19 ) != 'session_confirm.php') {
+			$_SESSION['AUTOLOGIN_REQUEST_URI'] = $_SERVER['REQUEST_URI'] ;
+			redirect_header( XOOPS_URL . '/session_confirm.php' , 0 , '&nbsp;' ) ;
+		}
+		// end of autologin V2
+
+		// redirect to XOOPS_URL/ when query string exists (anti-CSRF) V1 code
+		/* if( ! empty( $_SERVER['QUERY_STRING'] ) ) {
+			redirect_header( XOOPS_URL . '/' , 0 , 'Now, logging in automatically' ) ;
+			exit ;
+		}*/
+
+		$myts =& MyTextSanitizer::getInstance();
+		$uname = $myts->stripSlashesGPC($_COOKIE['autologin_uname']);
+		$pass = $myts->stripSlashesGPC($_COOKIE['autologin_pass']);
+		if( empty( $uname ) || is_numeric( $pass ) ) $user = false ;
+		else {
+			// V3
+			$uname4sql = addslashes( $uname ) ;
+			$criteria = new CriteriaCompo(new Criteria('uname', $uname4sql ));
+			$user_handler =& xoops_gethandler('user');
+			$users =& $user_handler->getObjects($criteria, false);
+			if( empty( $users ) || count( $users ) != 1 ) $user = false ;
+			else {
+				// V3.1 begin
+				$user = $users[0] ;
+				$old_limit = time() - ( defined('XOOPS_AUTOLOGIN_LIFETIME') ? XOOPS_AUTOLOGIN_LIFETIME : 604800 ) ; // 1 week default
+				list( $old_Ynj , $old_encpass ) = explode( ':' , $pass ) ;
+				if( strtotime( $old_Ynj ) < $old_limit || md5( $user->getVar('pass') . XOOPS_DB_PASS . XOOPS_DB_PREFIX . $old_Ynj ) != $old_encpass ) $user = false ;
+				// V3.1 end
+			}
+			unset( $users ) ;
+		}
+		$xoops_cookie_path = defined('XOOPS_COOKIE_PATH') ? XOOPS_COOKIE_PATH : preg_replace( '?http://[^/]+(/.*)$?' , "$1" , XOOPS_URL ) ;
+		if( $xoops_cookie_path == XOOPS_URL ) $xoops_cookie_path = '/' ;
+		if (false != $user && $user->getVar('level') > 0) {
+			// update time of last login
+			$user->setVar('last_login', time());
+			if (!$member_handler->insertUser($user, true)) {
+			}
+			//$_SESSION = array();
+			$_SESSION['xoopsUserId'] = $user->getVar('uid');
+			$_SESSION['xoopsUserGroups'] = $user->getGroups();
+			// begin newly added in 2004-11-30
+			$user_theme = $user->getVar('theme');
+			if (in_array($user_theme, $xoopsConfig['theme_set_allowed'])) {
+				$_SESSION['xoopsUserTheme'] = $user_theme;
+			}
+			// end newly added in 2004-11-30
+			// update autologin cookies
+			$expire = time() + ( defined('XOOPS_AUTOLOGIN_LIFETIME') ? XOOPS_AUTOLOGIN_LIFETIME : 604800 ) ; // 1 week default
+			setcookie('autologin_uname', $uname, $expire, $xoops_cookie_path, '', 0);
+			// V3.1
+			$Ynj = date( 'Y-n-j' ) ;
+			setcookie('autologin_pass', $Ynj . ':' . md5( $user->getVar('pass') . XOOPS_DB_PASS . XOOPS_DB_PREFIX . $Ynj ) , $expire, $xoops_cookie_path, '', 0);
+		} else {
+			setcookie('autologin_uname', '', time() - 3600, $xoops_cookie_path, '', 0);
+			setcookie('autologin_pass', '', time() - 3600, $xoops_cookie_path, '', 0);
+		}
+	}
+	// end of autologin hack GIJ
+
+   if (!empty($_SESSION['xoopsUserId'])) {
+        $xoopsUser =& $member_handler->getUser($_SESSION['xoopsUserId']);
+        if (!is_object($xoopsUser)) {
+            $xoopsUser = '';
+            $_SESSION = array();
+        } else {
+            if ($xoopsConfig['use_mysession'] && $xoopsConfig['session_name'] != '') {
+                setcookie($xoopsConfig['session_name'], session_id(), time()+(60*$xoopsConfig['session_expire']), '/',  '', 0);
+            }
+            $xoopsUser->setGroups($_SESSION['xoopsUserGroups']);
+            $xoopsUserIsAdmin = $xoopsUser->isAdmin();
+        }
+    }
+    if (!empty($_POST['xoops_theme_select']) && in_array($_POST['xoops_theme_select'], $xoopsConfig['theme_set_allowed'])) {
+        $xoopsConfig['theme_set'] = $_POST['xoops_theme_select'];
+        $_SESSION['xoopsUserTheme'] = $_POST['xoops_theme_select'];
+    } elseif (!empty($_SESSION['xoopsUserTheme']) && in_array($_SESSION['xoopsUserTheme'], $xoopsConfig['theme_set_allowed'])) {
+        $xoopsConfig['theme_set'] = $_SESSION['xoopsUserTheme'];
+    }
+
+    if ($xoopsConfig['closesite'] == 1) {
+        $allowed = false;
+        if (is_object($xoopsUser)) {
+            foreach ($xoopsUser->getGroups() as $group) {
+                if (in_array($group, $xoopsConfig['closesite_okgrp']) || XOOPS_GROUP_ADMIN == $group) {
+                    $allowed = true;
+                    break;
+                }
+            }
+        } elseif (!empty($_POST['xoops_login'])) {
+            include_once XOOPS_ROOT_PATH.'/include/checklogin.php';
+            exit();
+        }
+        if (!$allowed) {
+            include_once XOOPS_ROOT_PATH.'/class/template.php';
+            $xoopsTpl = new XoopsTpl();
+            $xoopsTpl->assign(array('xoops_sitename' => htmlspecialchars($xoopsConfig['sitename']), 'xoops_themecss' => xoops_getcss(), 'xoops_imageurl' => XOOPS_THEME_URL.'/'.$xoopsConfig['theme_set'].'/', 'lang_login' => _LOGIN, 'lang_username' => _USERNAME, 'lang_password' => _PASSWORD, 'lang_siteclosemsg' => $xoopsConfig['closesite_text']));
+            $xoopsTpl->xoops_setCaching(1);
+            $xoopsTpl->display('db:system_siteclosed.html');
+            exit();
+        }
+        unset($allowed, $group);
+    }
+
+    if (file_exists('./xoops_version.php')) {
+        $url_arr = explode('/',strstr($xoopsRequestUri,'/modules/'));
+        $module_handler =& xoops_gethandler('module');
+        $xoopsModule =& $module_handler->getByDirname($url_arr[2]);
+        unset($url_arr);
+        if (!$xoopsModule || !$xoopsModule->getVar('isactive')) {
+            include_once XOOPS_ROOT_PATH."/header.php";
+            echo "<h4>"._MODULENOEXIST."</h4>";
+            include_once XOOPS_ROOT_PATH."/footer.php";
+            exit();
+        }
+        $moduleperm_handler =& xoops_gethandler('groupperm');
+        if ($xoopsUser) {
+            if (!$moduleperm_handler->checkRight('module_read', $xoopsModule->getVar('mid'), $xoopsUser->getGroups())) {
+                redirect_header(XOOPS_URL."/user.php",1,_NOPERM);
+                exit();
+            }
+            $xoopsUserIsAdmin = $xoopsUser->isAdmin($xoopsModule->getVar('mid'));
+        } else {
+            if (!$moduleperm_handler->checkRight('module_read', $xoopsModule->getVar('mid'), XOOPS_GROUP_ANONYMOUS)) {
+                redirect_header(XOOPS_URL."/user.php",1,_NOPERM);
+                exit();
+            }
+        }
+        if ( file_exists(XOOPS_ROOT_PATH."/modules/".$xoopsModule->getVar('dirname')."/language/".$xoopsConfig['language']."/main.php") ) {
+            include_once XOOPS_ROOT_PATH."/modules/".$xoopsModule->getVar('dirname')."/language/".$xoopsConfig['language']."/main.php";
+        } else {
+            if ( file_exists(XOOPS_ROOT_PATH."/modules/".$xoopsModule->getVar('dirname')."/language/english/main.php") ) {
+                include_once XOOPS_ROOT_PATH."/modules/".$xoopsModule->getVar('dirname')."/language/english/main.php";
+            }
+        }
+        if ($xoopsModule->getVar('hasconfig') == 1 || $xoopsModule->getVar('hascomments') == 1 || $xoopsModule->getVar( 'hasnotification' ) == 1) {
+            $xoopsModuleConfig =& $config_handler->getConfigsByCat(0, $xoopsModule->getVar('mid'));
+        }
+    } elseif($xoopsUser) {
+        $xoopsUserIsAdmin = $xoopsUser->isAdmin(1);
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/include/searchform.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/include/searchform.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/include/searchform.php	(revision 405)
@@ -0,0 +1,68 @@
+<?php
+// $Id: searchform.php,v 1.4 2005/09/04 20:46:09 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+if (!defined('XOOPS_ROOT_PATH')) {
+    exit();
+}
+include_once XOOPS_ROOT_PATH."/class/xoopsformloader.php";
+
+// create form
+$search_form = new XoopsThemeForm(_SR_SEARCH, "search", "search.php", 'get');
+
+// create form elements
+$search_form->addElement(new XoopsFormText(_SR_KEYWORDS, "query", 30, 255, htmlspecialchars(stripslashes(implode(" ", $queries)), ENT_QUOTES)), true);
+$type_select = new XoopsFormSelect(_SR_TYPE, "andor", $andor);
+$type_select->addOptionArray(array("AND"=>_SR_ALL, "OR"=>_SR_ANY, "exact"=>_SR_EXACT));
+$search_form->addElement($type_select);
+if (!empty($mids)) {
+    $mods_checkbox = new XoopsFormCheckBox(_SR_SEARCHIN, "mids[]", $mids);
+} else {
+    $mods_checkbox = new XoopsFormCheckBox(_SR_SEARCHIN, "mids[]", $mid);
+}
+if (empty($modules)) {
+    $criteria = new CriteriaCompo();
+    $criteria->add(new Criteria('hassearch', 1));
+    $criteria->add(new Criteria('isactive', 1));
+    if (!empty($available_modules)) {
+        $criteria->add(new Criteria('mid', "(".implode(',', $available_modules).")", 'IN'));
+    }
+    $module_handler =& xoops_gethandler('module');
+    $mods_checkbox->addOptionArray($module_handler->getList($criteria));
+}
+else {
+    foreach ($modules as $mid => $module) {
+        $module_array[$mid] = $module->getVar('name');
+    }
+    $mods_checkbox->addOptionArray($module_array);
+}
+$search_form->addElement($mods_checkbox);
+if ($xoopsConfigSearch['keyword_min'] > 0) {
+    $search_form->addElement(new XoopsFormLabel(_SR_SEARCHRULE, sprintf(_SR_KEYIGNORE, $xoopsConfigSearch['keyword_min'])));
+}
+$search_form->addElement(new XoopsFormHidden("action", "results"));
+$search_form->addElement(new XoopsFormButton("", "submit", _SR_SEARCH, "submit"));
+?>
Index: /temp/test-xoops.ec-cube.net/html/include/cp_functions.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/include/cp_functions.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/include/cp_functions.php	(revision 405)
@@ -0,0 +1,448 @@
+<?php
+// $Id: cp_functions.php,v 1.5 2006/05/01 02:37:26 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+define('XOOPS_CPFUNC_LOADED', 1);
+
+function xoops_cp_header()
+{
+    global $xoopsConfig, $xoopsUser;
+    if ($xoopsConfig['gzip_compression'] == 1) {
+        ob_start("ob_gzhandler");
+    } else {
+        ob_start();
+    }
+    if (!headers_sent()) {
+        header ('Content-Type:text/html; charset='._CHARSET);
+        header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
+        header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
+        header('Cache-Control: no-store, no-cache, must-revalidate');
+        header("Cache-Control: post-check=0, pre-check=0", false);
+        header("Pragma: no-cache");
+        }
+    echo "<!DOCTYPE html PUBLIC '//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>";
+    echo '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="'._LANGCODE.'" lang="'._LANGCODE.'">
+    <head>
+    <meta http-equiv="content-type" content="text/html; charset='._CHARSET.'" />
+    <meta http-equiv="content-language" content="'._LANGCODE.'" />
+    <title>'.htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES).' Administration</title>
+    <script type="text/javascript" src="'.XOOPS_URL.'/include/xoops.js"></script>
+    ';
+    echo '<link rel="stylesheet" type="text/css" media="all" href="'.XOOPS_URL.'/xoops.css" />';
+        echo '<link rel="stylesheet" type="text/css" media="all" href="'.XOOPS_URL.'/modules/system/style.css" />';
+        include_once XOOPS_CACHE_PATH.'/adminmenu.php';
+        $moduleperm_handler =& xoops_gethandler('groupperm');
+        $admin_mids = $moduleperm_handler->getItemIds('module_admin', $xoopsUser->getGroups());
+
+        $module_handler =& xoops_gethandler('module');
+        $modules =& $module_handler->getObjects(new
+Criteria('mid', "(".implode(',', $admin_mids).")", 'IN'), true);
+        $admin_mids = array_keys($modules);
+
+?>
+
+<script type='text/javascript'>
+<!--
+var thresholdY = 15; // in pixels; threshold for vertical repositioning of a layer
+var ordinata_margin = 20; // to start the layer a bit above the mouse vertical coordinate
+// -->
+</script>
+
+<script type='text/javascript' src='<?php echo XOOPS_URL."/include/layersmenu.js";?>'></script>
+
+<script type='text/javascript'>
+<!--
+<?php
+        echo $xoops_admin_menu_js;
+?>
+function moveLayers() {
+<?php
+        foreach ( $admin_mids as $adm ) {
+            if (isset($xoops_admin_menu_ml[$adm])) {
+                echo $xoops_admin_menu_ml[$adm];
+            }
+        }
+?>
+}
+function shutdown() {
+<?php
+        foreach ( $admin_mids as $adm ) {
+            if (isset($xoops_admin_menu_sd[$adm])) {
+                echo $xoops_admin_menu_sd[$adm];
+            }
+        }
+?>
+}
+if (NS4) {
+document.onmousedown = function() { shutdown(); }
+} else {
+document.onclick = function() { shutdown(); }
+}
+// -->
+</script>
+
+<?php
+        $logo = file_exists(XOOPS_THEME_URL."/".getTheme()."/images/logo.gif") ? XOOPS_THEME_URL."/".getTheme()."/images/logo.gif" : XOOPS_URL."/images/logo.gif";
+        echo "</head>
+        <body>
+        <table border='0' width='100%' cellspacing='0' cellpadding='0'>
+          <tr>
+            <td bgcolor='#2F5376'><a href='http://xoopscube.org/' target='_blank'><img src='".XOOPS_URL."/modules/system/images/logo.gif' alt='".htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES)."' /></a></td>
+            <td align='right' bgcolor='#2F5376' colspan='2'><img src='".XOOPS_URL."/modules/system/images/xoops2.gif' alt='' /></td>
+          </tr>
+          <tr>
+            <td align='left' colspan='3' class='bg5'>
+              <table border='0' width='100%' cellspacing='0' cellpadding='0'>
+                <tr>
+                  <td width='1%'><img src='".XOOPS_URL."/modules/system/images/hbar_left.gif' width='10' height='23' /></td>
+                  <td background='".XOOPS_URL."/modules/system/images/hbar_middle.gif'>&nbsp;<a href='".XOOPS_URL."/admin.php'>"._CPHOME."</a><!--//&nbsp;|&nbsp;<a href='".XOOPS_URL."/admin.php?xoopsorgnews=1'>XOOPS News</a>//--></td>
+                  <td background='".XOOPS_URL."/modules/system/images/hbar_middle.gif' align='right'><a href='".XOOPS_URL."/user.php?op=logout'>"._LOGOUT."</a>&nbsp;|&nbsp;<a href='".XOOPS_URL."/'>"._YOURHOME."</a> &nbsp;</td>
+                  <td width='1%'><img src='".XOOPS_URL."/modules/system/images/hbar_right.gif' width='10' height='23' /></td>
+                </tr>
+              </table>
+            </td>
+          </tr>
+        </table>
+        <table border='0' cellpadding='0' cellspacing='0' width='100%'>
+          <tr>
+            <td width='2%' valign='top' class='bg5'  background='".XOOPS_URL."/modules/system/images/bg_menu.gif' align='center'></td>
+            <td width='15%' valign='top' class='bg5' align='center'><img src='".XOOPS_URL."/modules/system/images/menu.gif' /><br />
+              <table border='0' cellpadding='4' cellspacing='0' width='100%'>";
+        foreach ( $admin_mids as $adm ) {
+            if ( !empty($xoops_admin_menu_ft[$adm]) ) {
+                echo "<tr><td align='center'>".$xoops_admin_menu_ft[$adm]."</td></tr>";
+            }
+        }
+        echo "
+              </table>
+              <br />
+            </td>
+            <td align='left' valign='top' width='82%'>
+              <div class='content'><br />\n";
+}
+
+function xoops_cp_footer()
+{
+    global $xoopsConfig, $xoopsLogger;
+    echo"
+              </div><br />
+            </td>
+            <td width='1%' background='".XOOPS_URL."/modules/system/images/bg_content.gif'></td>
+          </tr>
+          <tr>
+            <td align='center' colspan='4' class='bg5' height='15'>
+              <table border='0' width='100%' cellspacing='0' cellpadding='0'>
+                <tr>
+                  <td width='1%'><img src='".XOOPS_URL."/modules/system/images/hbar_left.gif' width='10' height='23' /></td>
+                  <td width='98%' background='".XOOPS_URL."/modules/system/images/hbar_middle.gif' align='center'><div class='fontSmall'>Powered by&nbsp;".XOOPS_VERSION." &copy; 2001-2005 <a href='http://xoopscube.org/' target='_blank'>The XOOPS Cube Project</a></div></td><td width='1%'><img src='".XOOPS_URL."/modules/system/images/hbar_right.gif' width='10' height='23' /></td>
+                </tr>
+              </table>
+            </td>
+          </tr>
+        </table>";
+    include XOOPS_CACHE_PATH.'/adminmenu.php';
+    echo $xoops_admin_menu_dv;
+    echo "
+        </body>
+      </html>
+    ";
+    if ($xoopsConfig['debug_mode'] == 2) {
+        echo '<script type="text/javascript">
+        <!--//
+        debug_window = openWithSelfMain("", "popup", 680, 450, true);
+        ';
+        $content = '<html><head><meta http-equiv="content-type" content="text/html; charset='._CHARSET.'" /><meta http-equiv="content-language" content="'._LANGCODE.'" /><title>'.htmlspecialchars($xoopsConfig['sitename']).'</title><link rel="stylesheet" type="text/css" media="all" href="'.getcss($xoopsConfig['theme_set']).'" /></head><body>'.$xoopsLogger->dumpAll().'<div style="text-align:center;"><input class="formButton" value="'._CLOSE.'" type="button" onclick="javascript:window.close();" /></div></body></html>';
+        $lines = preg_split("/(\r\n|\r|\n)( *)/", $content);
+        foreach ($lines as $line) {
+            echo 'debug_window.document.writeln("'.str_replace('"', '\"', $line).'");';
+        }
+        echo '
+        debug_window.document.close();
+        //-->
+        </script>';
+    }
+    ob_end_flush();
+}
+
+// We need these because theme files will not be included
+function OpenTable()
+{
+    echo "<table width='100%' border='0' cellspacing='1' cellpadding='8' style='border: 2px solid #2F5376;'><tr class='bg4'><td valign='top'>\n";
+}
+
+function CloseTable()
+{
+    echo '</td></tr></table>';
+}
+
+function themecenterposts($title, $content)
+{
+    echo '<table cellpadding="4" cellspacing="1" width="98%" class="outer"><tr><td class="head">'.$title.'</td></tr><tr><td><br />'.$content.'<br /></td></tr></table>';
+}
+
+function myTextForm($url , $value)
+{
+    return '<form action="'.$url.'" method="post"><input type="submit" value="'.$value.'" /></form>';
+}
+
+function xoopsfwrite()
+{
+    if ($_SERVER['REQUEST_METHOD'] != 'POST') {
+        return false;
+    } else {
+
+    }
+    if (!xoops_refcheck()) {
+        return false;
+    } else {
+
+    }
+    return true;
+}
+
+function xoops_module_get_admin_menu()
+{
+    /************************************************************
+    * Based on:
+    * - PHP Layers Menu 1.0.7(c)2001,2002 Marco Pratesi <pratesi@telug.it>
+    * - TreeMenu 1.1 - Bjorge Dijkstra <bjorge@gmx.net>
+    ************************************************************/
+    $abscissa_step = 90;        // step for the left boundaries of layers
+    $abscissa_offset = 15;        // to choose the horizontal coordinate start offset for the layers
+    $rightarrow = "";
+    // the following is to support browsers not detecting the mouse position
+    $ordinata_step = 15;        // estimated value of the number of pixels between links on a layer
+    $ordinata[1] = 150-$ordinata_step;// to choose the vertical coordinate start offset for the layers
+    $moveLayers = array();
+    $shutdown = array();
+    $firstleveltable = array();
+
+    /*********************************************/
+    /* read file to $tree array                  */
+    /* tree[x][0] -> tree level                  */
+    /* tree[x][1] -> item text                   */
+    /* tree[x][2] -> item link                   */
+    /* tree[x][3] -> link target                 */
+    /* tree[x][4] -> module id                   */
+    /*********************************************/
+
+    $js = "";
+    $maxlevel = 0;
+    $cnt = 1;
+    $module_handler =& xoops_gethandler('module');
+    $criteria = new CriteriaCompo();
+    $criteria->add(new Criteria('hasadmin', 1));
+    $criteria->add(new Criteria('isactive', 1));
+    $criteria->setSort('mid');
+    $mods =& $module_handler->getObjects($criteria);
+    foreach ($mods as $mod) {
+        // RMV-NOTIFY:
+        // Why need 'adminindex' defined??  Should just be for ALL modules
+        // because sometimes comments, notification gives options but
+        // module may have no other admin functions...
+        /*if ($mod->getInfo('adminindex') && trim($mod->getInfo('adminindex')) != '') {*/
+            $tree[$cnt][0] = 1;
+            $tree[$cnt][5] = "<img src='\".XOOPS_URL.\"/modules/".$mod->getVar('dirname')."/".$mod->getInfo('image')."' alt='' />";
+            $tree[$cnt][1] = $mod->getVar('name');
+            $tree[$cnt][2] = "\".XOOPS_URL.\"/modules/".$mod->getVar('dirname')."/".trim($mod->getInfo('adminindex'));
+            $tree[$cnt][3] = "";
+            $tree[$cnt][4] = $mod->getVar('mid');
+            $tree[$cnt][6] = "<b>\"._VERSION.\":</b> ".round($mod->getVar('version')/100 , 2)."<br /><b>\"._DESCRIPTION.\":</b> ".$mod->getInfo('description');
+            $layer_label[$cnt] = "L" . $cnt;
+            if ( $tree[$cnt][0] > $maxlevel ) {
+                $maxlevel = $tree[$cnt][0];
+            }
+            $cnt++;
+            $adminmenu = $mod->getAdminMenu();
+            if ($mod->getVar('hasnotification') || ($mod->getInfo('config') && is_array($mod->getInfo('config'))) || ($mod->getInfo('comments') && is_array($mod->getInfo('comments')))) {
+                $adminmenu[] = array('link' => '".XOOPS_URL."/modules/system/admin.php?fct=preferences&amp;op=showmod&amp;mod='.$mod->getVar('mid'), 'title' => _PREFERENCES, 'absolute' => true);
+            }
+            if (!empty($adminmenu)) {
+                foreach ( $adminmenu as $menuitem ) {
+                    $menuitem['link'] = trim($menuitem['link']);
+                    $menuitem['target'] = isset($menuitem['target']) ? trim($menuitem['target']) : '';
+                    $tree[$cnt][0] = 2;
+                    $tree[$cnt][1] = trim($menuitem['title']);
+                    if (isset($menuitem['absolute']) && $menuitem['absolute']) {
+                        $tree[$cnt][2] = (empty($menuitem['link'])) ? "#" : $menuitem['link'];
+                    } else {
+                        $tree[$cnt][2] = (empty($menuitem['link'])) ? "#" : "\".XOOPS_URL.\"/modules/".$mod->getVar('dirname')."/".$menuitem['link'];
+                    }
+                    $tree[$cnt][3] = (empty($menuitem['target'])) ? "" : $menuitem['target'];
+                    $tree[$cnt][4] = $mod->getVar('mid');
+                    $layer_label[$cnt] = "L" . $cnt;
+                    if ($tree[$cnt][0] > $maxlevel) {
+                        $maxlevel = $tree[$cnt][0];
+                    }
+                    $cnt++;
+                }
+            }
+        /*
+        }*/
+    }
+    $tmpcount = count($tree);
+    $tree[$tmpcount+1][0] = 0;
+    for ( $i = 0; $i < $maxlevel; $i++) {
+        $abscissa[$i] = $i * $abscissa_step + $abscissa_offset;
+    }
+    for ( $cnt = 1; $cnt <= $tmpcount; $cnt++) {        // this counter scans all nodes
+        // assign the layers name to the current hierarchical level,
+        // to keep trace of the route leading to the current node on the tree
+        $layername[$tree[$cnt][0]] = $layer_label[$cnt];
+
+        // assign the starting vertical coordinates for all sublevels
+        for ( $i = $tree[$cnt][0] + 1; $i < $maxlevel; $i++) {
+            $ordinata[$i] = $ordinata[$i-1] + 1.5*$ordinata_step;
+        }
+        // increment the starting vertical coordinate for the current sublevel
+        if ($tree[$cnt][0] < $maxlevel) {
+            $ordinata[$tree[$cnt][0]] += $ordinata_step;
+        }
+        if ($tree[$cnt+1][0]>$tree[$cnt][0] && $cnt<$tmpcount) {                        // the node is not a leaf, hence it has at least a child
+            // initialize the corresponding layer content trought a void string
+            $layer[$layer_label[$cnt]] = "";
+            // prepare the popUp function related to the children
+            $js .= "function popUp" . $layer_label[$cnt] . "() {\n" . "shutdown();\n";
+            for ($i=1; $i<=$tree[$cnt][0]; $i++) {
+                $js .= "popUp(\\\"" . $layername[$i] . "\\\",true);\n";
+            }
+            $js .= "}\n";
+
+            // geometrical parameters are assigned to the new layer, related to the above mentioned children
+            if (!isset($moveLayers[$tree[$cnt][4]])) {
+                $moveLayers[$tree[$cnt][4]] = "setleft('" . $layer_label[$cnt] . "'," . $abscissa[$tree[$cnt][0]] . ");\n";
+            } else {
+                $moveLayers[$tree[$cnt][4]] .= "setleft('" . $layer_label[$cnt] . "'," . $abscissa[$tree[$cnt][0]] . ");\n";
+                }
+                if (!isset($moveLayers[$tree[$cnt][4]])) {
+                    $moveLayers[$tree[$cnt][4]] = "settop('" . $layer_label[$cnt] . "'," . $ordinata[$tree[$cnt][0]] . ");\n";
+                } else {
+                    $moveLayers[$tree[$cnt][4]] .= "settop('" . $layer_label[$cnt] . "'," . $ordinata[$tree[$cnt][0]] . ");\n";
+                }
+                //$moveLayers[$tree[$cnt][4]] .= "setwidth('" . $layer_label[$cnt] . "'," . $abscissa_step . ");\n";
+
+                // the new layer is accounted for in the shutdown() function
+                if (!isset($shutdown[$tree[$cnt][4]])) {
+                    $shutdown[$tree[$cnt][4]] = "popUp('" . $layer_label[$cnt] . "',false);\n";
+                } else {
+                    $shutdown[$tree[$cnt][4]] .= "popUp('" . $layer_label[$cnt] . "',false);\n";
+                }
+            }
+            if ($tree[$cnt+1][0]>$tree[$cnt][0] && $cnt<$tmpcount) {
+                // not a leaf
+                $currentarrow = $rightarrow;
+            } else {
+                // a leaf
+                $currentarrow = "";
+            }
+            /* */
+            $currentlink = $tree[$cnt][2];
+            /* */
+            /*
+            if ( $tree[$cnt+1][0] > $tree[$cnt][0] && $cnt < $tmpcount) {
+                // not a leaf
+                $currentlink = "#";
+            } else {
+                // a leaf
+                $currentlink = $tree[$cnt][2];
+            }
+            */
+            if ($tree[$cnt][3] != "") {
+                $currenttarget = " target='" . $tree[$cnt][3] . "'";
+            } else {
+                $currenttarget = "";
+            }
+            if ($tree[$cnt][0] > 1) {
+                // the hierarchical level is > 1, hence the current node is not a child of the root node
+                // handle accordingly the corresponding link, distinguishing if the current node is a leaf or not
+                if ( $tree[$cnt+1][0] > $tree[$cnt][0] && $cnt < $tmpcount ) {        // not a leaf
+                    $onmouseover = " onmouseover='moveLayerY(\\\"" . $layer_label[$cnt] . "\\\", currentY) ; popUp" . $layer_label[$cnt] . "();";
+                    $onmouseover = " onmouseover='moveLayerY(\\\"" . $layer_label[$cnt] . "\\\", currentY, event) ; popUp" . $layer_label[$cnt] . "();";
+                } else {        // a leaf
+                    $onmouseover = " onmouseover='popUp" . $layername[$tree[$cnt][0]-1] . "();";
+                }
+                $layer[$layername[$tree[$cnt][0]-1]] .= "<img src='\".XOOPS_URL.\"/images/pointer.gif' width='8' height='8' alt='' />&nbsp;<a href='" . $currentlink . "'" . $onmouseover . "'" . $currenttarget . ">" .$tree[$cnt][1]. "</a>" . $currentarrow . "<br />\n";
+            } elseif ($tree[$cnt][0] == 1) {
+                // the hierarchical level is = 1, hence the current node is a child of the root node
+                // handle accordingly the corresponding link, distinguishing if the current node is a leaf or not
+                if ($tree[$cnt+1][0]>$tree[$cnt][0] && $cnt<$tmpcount) {
+                    // not a leaf
+                    $onmouseover = " onmouseover='moveLayerY(\\\"" . $layer_label[$cnt] . "\\\", currentY) ; popUp" . $layer_label[$cnt] . "();";
+                    $onmouseover = " onmouseover='moveLayerY(\\\"" . $layer_label[$cnt] . "\\\", currentY,event) ; popUp" . $layer_label[$cnt] . "();";
+                } else {
+                    // a leaf
+                   $onmouseover = " onmouseover='shutdown();";
+                }
+                if (!isset($firstleveltable[$tree[$cnt][4]])) {
+                    $firstleveltable[$tree[$cnt][4]] = "<a href='" . $currentlink . "'" . $onmouseover . "'" . $currenttarget . ">" . $tree[$cnt][5] . "</a>" . $currentarrow . "<br />\n";
+                } else {
+                    $firstleveltable[$tree[$cnt][4]] .= "<a href='" . $currentlink . "'" . $onmouseover . "'" . $currenttarget . ">" . $tree[$cnt][5] . "</a>" . $currentarrow . "<br />\n";
+                }
+            }
+        }        // end of the "for" cycle scanning all nodes
+
+        $cellpadding = 10;
+        $width = $abscissa_step - $cellpadding;
+        $menu_layers = "";
+        for ( $cnt = 1; $cnt <= $tmpcount; $cnt++ ) {
+            if (!($tree[$cnt+1][0]<=$tree[$cnt][0])) {
+                $menu_layers .= "<div id='".$layer_label[$cnt]."' style='position: absolute; visibility: hidden; z-index:1000;'><table class='outer' width='150' cellspacing='1'><tr><th nowrap='nowrap'>".$tree[$cnt][1]."</th></tr><tr><td class='even' nowrap='nowrap'>".$layer[$layer_label[$cnt]]."<div style='margin-top: 5px; font-size: smaller; text-align: right;'><a href='#' onmouseover='shutdown();'>["._CLOSE."]</a></div></td></tr><tr><th style='font-size: smaller; text-align: left;'>".$tree[$cnt][5]."<br />".$tree[$cnt][6]."</th></tr></table></div>\n";
+            }
+        }
+        $menu_layers .= "<script language='JavaScript'>\n<!--\nmoveLayers();\nloaded = 1;\n// -->\n</script>\n";
+        $content = "<"."?php\n";
+        $content .= "\$xoops_admin_menu_js = \"".$js."\";\n";
+        foreach ( $moveLayers as $k => $v ){
+            $content .= "\$xoops_admin_menu_ml[$k] = \"".$v."\";\n";
+        }
+        foreach ( $shutdown as $k => $v ){
+            $content .= "\$xoops_admin_menu_sd[$k] = \"".$v."\";\n";
+    }
+    foreach ( $firstleveltable as $k => $v ){
+        $content .= "\$xoops_admin_menu_ft[$k] = \"".$v."\";\n";
+    }
+    $content .= "\$xoops_admin_menu_dv = \"".$menu_layers."\";\n";
+    $content .= "\n?".">";
+    return $content;
+}
+
+function xoops_module_write_admin_menu($content)
+{
+    if (!xoopsfwrite()) {
+        return false;
+    }
+    $filename = XOOPS_CACHE_PATH.'/adminmenu.php';
+    if ( !$file = fopen($filename, "w") ) {
+        echo 'failed open file';
+        return false;
+    }
+    if ( fwrite($file, $content) == -1 ) {
+        echo 'failed write file';
+        return false;
+    }
+    fclose($file);
+    return true;
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/include/comment_view.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/include/comment_view.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/include/comment_view.php	(revision 405)
@@ -0,0 +1,217 @@
+<?php
+// $Id: comment_view.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.xoops.org/ http://jp.xoops.org/  http://www.myweb.ne.jp/  //
+// Project: The XOOPS Project (http://www.xoops.org/)                        //
+// ------------------------------------------------------------------------- //
+
+if (!defined('XOOPS_ROOT_PATH') || !is_object($xoopsModule)) {
+	exit();
+}
+include_once XOOPS_ROOT_PATH.'/include/comment_constants.php';
+include_once XOOPS_ROOT_PATH.'/modules/system/constants.php';
+
+if (XOOPS_COMMENT_APPROVENONE != $xoopsModuleConfig['com_rule']) {
+
+	$gperm_handler = & xoops_gethandler( 'groupperm' );
+	$groups = ( $xoopsUser ) ? $xoopsUser -> getGroups() : XOOPS_GROUP_ANONYMOUS;
+	$xoopsTpl->assign( 'xoops_iscommentadmin', $gperm_handler->checkRight( 'system_admin', XOOPS_SYSTEM_COMMENT, $groups) );
+
+ 	include_once XOOPS_ROOT_PATH.'/language/'.$xoopsConfig['language'].'/comment.php';
+	$comment_config = $xoopsModule->getInfo('comments');
+	$com_itemid = (trim($comment_config['itemName']) != '' && isset($_GET[$comment_config['itemName']])) ? intval($_GET[$comment_config['itemName']]) : 0;
+
+	if ($com_itemid > 0) {
+		$com_mode = isset($_GET['com_mode']) ? htmlspecialchars(trim($_GET['com_mode']), ENT_QUOTES) : '';
+		if ($com_mode == '') {
+			if (is_object($xoopsUser)) {
+				$com_mode = $xoopsUser->getVar('umode');
+			} else {
+				$com_mode = $xoopsConfig['com_mode'];
+			}
+		}
+		$xoopsTpl->assign('comment_mode', $com_mode);
+		if (!isset($_GET['com_order'])) {
+			if (is_object($xoopsUser)) {
+				$com_order = $xoopsUser->getVar('uorder');
+			} else {
+				$com_order = $xoopsConfig['com_order'];
+			}
+		} else {
+			$com_order = intval($_GET['com_order']);
+		}
+		if ($com_order != XOOPS_COMMENT_OLD1ST) {
+			$xoopsTpl->assign(array('comment_order' => XOOPS_COMMENT_NEW1ST, 'order_other' => XOOPS_COMMENT_OLD1ST));
+			$com_dborder = 'DESC';
+		} else {
+			$xoopsTpl->assign(array('comment_order' => XOOPS_COMMENT_OLD1ST, 'order_other' => XOOPS_COMMENT_NEW1ST));
+			$com_dborder = 'ASC';
+		}
+		// admins can view all comments and IPs, others can only view approved(active) comments
+		if (is_object($xoopsUser) && $xoopsUser->isAdmin($xoopsModule->getVar('mid'))) {
+			$admin_view = true;
+		} else {
+			$admin_view = false;
+		}
+
+		$com_id = isset($_GET['com_id']) ? intval($_GET['com_id']) : 0;
+		$com_rootid = isset($_GET['com_rootid']) ? intval($_GET['com_rootid']) : 0;
+		$comment_handler =& xoops_gethandler('comment');
+		if ($com_mode == 'flat') {
+			$comments =& $comment_handler->getByItemId($xoopsModule->getVar('mid'), $com_itemid, $com_dborder);
+			include_once XOOPS_ROOT_PATH.'/class/commentrenderer.php';
+			$renderer =& XoopsCommentRenderer::instance($xoopsTpl);
+			$renderer->setComments($comments);
+			$renderer->renderFlatView($admin_view);
+		} elseif ($com_mode == 'thread') {
+			// RMV-FIX... added extraParam stuff here
+			$comment_url = $comment_config['pageName'] . '?';
+			if (isset($comment_config['extraParams']) && is_array($comment_config['extraParams'])) {
+				$extra_params = '';
+				foreach ($comment_config['extraParams'] as $extra_param) {
+				    // This page is included in the module hosting page -- param could be from anywhere
+					if (isset(${$extra_param})) {
+						$extra_params .= $extra_param .'='.${$extra_param}.'&amp;';
+					} elseif (isset($_POST[$extra_param])) {
+						$extra_params .= $extra_param .'='.$_POST[$extra_param].'&amp;';
+					} elseif (isset($_GET[$extra_param])) {
+						$extra_params .= $extra_param .'='.$_GET[$extra_param].'&amp;';
+					} else {
+						$extra_params .= $extra_param .'=&amp;';
+					}
+					//$extra_params .= isset(${$extra_param}) ? $extra_param .'='.${$extra_param}.'&amp;' : $extra_param .'=&amp;';
+				}
+				$comment_url .= $extra_params;
+			}
+			$xoopsTpl->assign('comment_url', $comment_url.$comment_config['itemName'].'='.$com_itemid.'&amp;com_mode=thread&amp;com_order='.$com_order);
+			if (!empty($com_id) && !empty($com_rootid) && ($com_id != $com_rootid)) {
+				// Show specific thread tree
+				$comments =& $comment_handler->getThread($com_rootid, $com_id);
+				if (false != $comments) {
+					include_once XOOPS_ROOT_PATH.'/class/commentrenderer.php';
+					$renderer =& XoopsCommentRenderer::instance($xoopsTpl);
+					$renderer->setComments($comments);
+					$renderer->renderThreadView($com_id, $admin_view);
+				}
+			} else {
+				// Show all threads
+				$top_comments =& $comment_handler->getTopComments($xoopsModule->getVar('mid'), $com_itemid, $com_dborder);
+				$c_count = count($top_comments);
+				if ($c_count> 0) {
+					for ($i = 0; $i < $c_count; $i++) {
+						$comments =& $comment_handler->getThread($top_comments[$i]->getVar('com_rootid'), $top_comments[$i]->getVar('com_id'));
+						if (false != $comments) {
+							include_once XOOPS_ROOT_PATH.'/class/commentrenderer.php';
+							$renderer =& XoopsCommentRenderer::instance($xoopsTpl);
+							$renderer->setComments($comments);
+							$renderer->renderThreadView($top_comments[$i]->getVar('com_id'), $admin_view);
+						}
+						unset($comments);
+					}
+				}
+			}
+		} else {
+			// Show all threads
+			$top_comments =& $comment_handler->getTopComments($xoopsModule->getVar('mid'), $com_itemid, $com_dborder);
+			$c_count = count($top_comments);
+			if ($c_count> 0) {
+				for ($i = 0; $i < $c_count; $i++) {
+					$comments =& $comment_handler->getThread($top_comments[$i]->getVar('com_rootid'), $top_comments[$i]->getVar('com_id'));
+					include_once XOOPS_ROOT_PATH.'/class/commentrenderer.php';
+					$renderer =& XoopsCommentRenderer::instance($xoopsTpl);
+					$renderer->setComments($comments);
+					$renderer->renderNestView($top_comments[$i]->getVar('com_id'), $admin_view);
+				}
+			}
+		}
+
+		// assign comment nav bar
+		$navbar = '
+<form method="get" action="'.$comment_config['pageName'].'">
+<table width="95%" class="outer" cellspacing="1">
+  <tr>
+    <td class="even" align="center"><select name="com_mode"><option value="flat"';
+		if ($com_mode == 'flat') {
+			$navbar .= ' selected="selected"';
+		}
+		$navbar .= '>'._FLAT.'</option><option value="thread"';
+		if ($com_mode == 'thread' || $com_mode == '') {
+			$navbar .= ' selected="selected"';
+		}
+		$navbar .= '>'. _THREADED .'</option><option value="nest"';
+		if ($com_mode == 'nest') {
+			$navbar .= ' selected="selected"';
+		}
+		$navbar .= '>'. _NESTED .'</option></select> <select name="com_order"><option value="'.XOOPS_COMMENT_OLD1ST.'"';
+		if ($com_order == XOOPS_COMMENT_OLD1ST) {
+			$navbar .= ' selected="selected"';
+		}
+		$navbar .= '>'. _OLDESTFIRST .'</option><option value="'.XOOPS_COMMENT_NEW1ST.'"';
+		if ($com_order == XOOPS_COMMENT_NEW1ST) {
+			$navbar .= ' selected="selected"';
+		}
+		unset($postcomment_link);
+		$navbar .= '>'. _NEWESTFIRST .'</option></select><input type="hidden" name="'.$comment_config['itemName'].'" value="'.$com_itemid.'" /> <input type="submit" value="'. _CM_REFRESH .'" class="formButton" />';
+		if (!empty($xoopsModuleConfig['com_anonpost']) || is_object($xoopsUser)) {
+			$postcomment_link = 'comment_new.php?com_itemid='.$com_itemid.'&amp;com_order='.$com_order.'&amp;com_mode='.$com_mode;
+
+			$xoopsTpl->assign('anon_canpost', true);
+		}
+		$link_extra = '';
+		if (isset($comment_config['extraParams']) && is_array($comment_config['extraParams'])) {
+			foreach ($comment_config['extraParams'] as $extra_param) {
+			    if (isset(${$extra_param})) {
+			        $link_extra .= '&amp;'.$extra_param.'='.${$extra_param};
+			        $hidden_value = htmlspecialchars(${$extra_param}, ENT_QUOTES);
+			        $extra_param_val = ${$extra_param};
+			    } elseif (isset($_POST[$extra_param])) {
+			        $extra_param_val = $_POST[$extra_param];
+			    } elseif (isset($_GET[$extra_param])) {
+			        $extra_param_val = $_GET[$extra_param];
+			    }
+			    if (isset($extra_param_val)) {
+			        $link_extra .= '&amp;'.$extra_param.'='.$extra_param_val;
+			        $hidden_value = htmlspecialchars($extra_param_val, ENT_QUOTES);
+					$navbar .= '<input type="hidden" name="'.$extra_param.'" value="'.$hidden_value.'" />';
+				}
+			}
+		}
+		if (isset($postcomment_link)) {
+			$navbar .= '&nbsp;<input type="button" onclick="self.location.href=\''.$postcomment_link.''.$link_extra.'\'" class="formButton" value="'._CM_POSTCOMMENT.'" />';
+		}
+		$navbar .= '
+    </td>
+  </tr>
+</table>
+</form>';
+		$xoopsTpl->assign(array('commentsnav' => $navbar, 'editcomment_link' => 'comment_edit.php?com_itemid='.$com_itemid.'&amp;com_order='.$com_order.'&amp;com_mode='.$com_mode.''.$link_extra, 'deletecomment_link' => 'comment_delete.php?com_itemid='.$com_itemid.'&amp;com_order='.$com_order.'&amp;com_mode='.$com_mode.''.$link_extra, 'replycomment_link' => 'comment_reply.php?com_itemid='.$com_itemid.'&amp;com_order='.$com_order.'&amp;com_mode='.$com_mode.''.$link_extra));
+
+		// assign some lang variables
+		$xoopsTpl->assign(array('lang_from' => _CM_FROM, 'lang_joined' => _CM_JOINED, 'lang_posts' => _CM_POSTS, 'lang_poster' => _CM_POSTER, 'lang_thread' => _CM_THREAD, 'lang_edit' => _EDIT, 'lang_delete' => _DELETE, 'lang_reply' => _REPLY, 'lang_subject' => _CM_REPLIES, 'lang_posted' => _CM_POSTED, 'lang_updated' => _CM_UPDATED, 'lang_notice' => _CM_NOTICE));
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/include/xoops.js
===================================================================
--- /temp/test-xoops.ec-cube.net/html/include/xoops.js	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/include/xoops.js	(revision 405)
@@ -0,0 +1,395 @@
+function xoopsGetElementById(id){
+    if (document.getElementById) {
+        return (document.getElementById(id));
+    } else if (document.all) {
+        return (document.all[id]);
+    } else {
+        if ((navigator.appname.indexOf("Netscape") != -1) && parseInt(navigator.appversion == 4)) {
+            return (document.layers[id]);
+        }
+    }
+}
+
+function xoopsSetElementProp(name, prop, val) {
+    var elt=xoopsGetElementById(name);
+    if (elt) elt[prop]=val;
+}
+
+function xoopsSetElementStyle(name, prop, val) {
+    var elt=xoopsGetElementById(name);
+    if (elt && elt.style) elt.style[prop]=val;
+}
+
+function xoopsGetFormElement(fname, ctlname) {
+    var frm=document.forms[fname];
+    return frm?frm.elements[ctlname]:null;
+}
+
+function justReturn() {
+    return;
+}
+
+function openWithSelfMain(url, name, width, height, returnwindow) {
+    var options = "width=" + width + ",height=" + height + "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no";
+    new_window = window.open(url, name, options);
+    window.self.name = "main";
+    new_window.document.clear();
+    new_window.focus();
+    if (returnwindow != null) {
+        return new_window;
+    }
+}
+
+function setElementColor(id, color){
+    xoopsGetElementById(id).style.color = "#" + color;
+}
+
+function setElementFont(id, font){
+    xoopsGetElementById(id).style.fontFamily = font;
+}
+
+function setElementSize(id, size){
+    xoopsGetElementById(id).style.fontSize = size;
+}
+
+function changeDisplay(id){
+    var elestyle = xoopsGetElementById(id).style;
+    if (elestyle.display == "") {
+        elestyle.display = "none";
+    } else {
+        elestyle.display = "block";
+    }
+}
+
+function setVisible(id){
+    xoopsGetElementById(id).style.visibility = "visible";
+}
+
+function setHidden(id){
+    xoopsGetElementById(id).style.visibility = "hidden";
+}
+
+function makeBold(id){
+    var eleStyle = xoopsGetElementById(id).style;
+    if (eleStyle.fontWeight != "bold" && eleStyle.fontWeight != "700") {
+        eleStyle.fontWeight = "bold";
+    } else {
+        eleStyle.fontWeight = "normal";
+    }
+}
+
+function makeItalic(id){
+    var eleStyle = xoopsGetElementById(id).style;
+    if (eleStyle.fontStyle != "italic") {
+        eleStyle.fontStyle = "italic";
+    } else {
+        eleStyle.fontStyle = "normal";
+    }
+}
+
+function makeUnderline(id){
+    var eleStyle = xoopsGetElementById(id).style;
+    if (eleStyle.textDecoration != "underline") {
+        eleStyle.textDecoration = "underline";
+    } else {
+        eleStyle.textDecoration = "none";
+    }
+}
+
+function makeLineThrough(id){
+    var eleStyle = xoopsGetElementById(id).style;
+    if (eleStyle.textDecoration != "line-through") {
+        eleStyle.textDecoration = "line-through";
+    } else {
+        eleStyle.textDecoration = "none";
+    }
+}
+
+function appendSelectOption(selectMenuId, optionName, optionValue){
+    var selectMenu = xoopsGetElementById(selectMenuId);
+    var newoption = new Option(optionName, optionValue);
+    selectMenu.options[selectMenu.length] = newoption;
+    selectMenu.options[selectMenu.length].selected = true;
+}
+
+function disableElement(target){
+    var targetDom = xoopsGetElementById(target);
+    if (targetDom.disabled != true) {
+        targetDom.disabled = true;
+    } else {
+        targetDom.disabled = false;
+    }
+}
+function xoopsCheckAll(formname, switchid) {
+    var ele = document.forms[formname].elements;
+    var switch_cbox = xoopsGetElementById(switchid);
+    for (var i = 0; i < ele.length; i++) {
+        var e = ele[i];
+        if ( (e.name != switch_cbox.name) && (e.type == 'checkbox') ) {
+            e.checked = switch_cbox.checked;
+        }
+    }
+}
+
+function xoopsCheckGroup(formname, switchid, groupid) {
+    var ele = document.forms[formname].elements;
+    var switch_cbox = xoopsGetElementById(switchid);
+    for (var i = 0; i < ele.length; i++) {
+        var e = ele[i];
+        if ( (e.type == 'checkbox') && (e.id == groupid) ) {
+            e.checked = switch_cbox.checked;
+            e.click(); e.click();  // Click to activate subgroups
+                                    // Twice so we don't reverse effect
+        }
+    }
+}
+
+function xoopsCheckAllElements(elementIds, switchId) {
+    var switch_cbox = xoopsGetElementById(switchId);
+    for (var i = 0; i < elementIds.length; i++) {
+        var e = xoopsGetElementById(elementIds[i]);
+        if ((e.name != switch_cbox.name) && (e.type == 'checkbox')) {
+            e.checked = switch_cbox.checked;
+        }
+    }
+}
+
+function xoopsSavePosition(id)
+{
+    var textareaDom = xoopsGetElementById(id);
+    if (textareaDom.createTextRange) {
+        textareaDom.caretPos = document.selection.createRange().duplicate();
+    }
+}
+
+function xoopsInsertText(domobj, text)
+{
+    if (domobj.createTextRange && domobj.caretPos){
+        var caretPos = domobj.caretPos;
+        caretPos.text = caretPos.text.charAt(caretPos.text.length - 1)
+== ' ' ? text + ' ' : text;
+    } else if (domobj.getSelection && domobj.caretPos){
+        var caretPos = domobj.caretPos;
+        caretPos.text = caretPos.text.charat(caretPos.text.length - 1)
+== ' ' ? text + ' ' : text;
+    } else {
+        domobj.value = domobj.value + text;
+    }
+}
+
+function xoopsCodeSmilie(id, smilieCode) {
+    var revisedMessage;
+    var textareaDom = xoopsGetElementById(id);
+    xoopsInsertText(textareaDom, smilieCode);
+    textareaDom.focus();
+    return;
+}
+
+function showImgSelected(imgId, selectId, imgDir, extra, xoopsUrl) {
+    if (xoopsUrl == null) {
+        xoopsUrl = "./";
+    }
+    imgDom = xoopsGetElementById(imgId);
+    selectDom = xoopsGetElementById(selectId);
+    imgDom.src = xoopsUrl + "/"+ imgDir + "/" + selectDom.options[selectDom.selectedIndex].value + extra;
+}
+
+function xoopsCodeUrl(id, enterUrlPhrase, enterWebsitePhrase){
+    if (enterUrlPhrase == null) {
+        enterUrlPhrase = "Enter the URL of the link you want to add:";
+    }
+    var text = prompt(enterUrlPhrase, "");
+    var domobj = xoopsGetElementById(id);
+    if ( text != null && text != "" ) {
+        if (enterWebsitePhrase == null) {
+            enterWebsitePhrase = "Enter the web site title:";
+        }
+        var text2 = prompt(enterWebsitePhrase, "");
+        if ( text2 != null ) {
+            if ( text2 == "" ) {
+                var result = "[url=" + text + "]" + text + "[/url]";
+            } else {
+                var pos = text2.indexOf(unescape('%00'));
+                if(0 < pos){
+                    text2 = text2.substr(0,pos);
+                }
+                var result = "[url=" + text + "]" + text2 + "[/url]";
+            }
+            xoopsInsertText(domobj, result);
+        }
+    }
+    domobj.focus();
+}
+
+function xoopsCodeImg(id, enterImgUrlPhrase, enterImgPosPhrase, imgPosRorLPhrase, errorImgPosPhrase){
+    if (enterImgUrlPhrase == null) {
+        enterImgUrlPhrase = "Enter the URL of the image you want to add:";
+    }
+    var text = prompt(enterImgUrlPhrase, "");
+    var domobj = xoopsGetElementById(id);
+    if ( text != null && text != "" ) {
+        if (enterImgPosPhrase == null) {
+            enterImgPosPhrase = "Now, enter the position of the image.";
+        }
+        if (imgPosRorLPhrase == null) {
+            imgPosRorLPhrase = "'R' or 'r' for right, 'L' or 'l' for left, or leave it blank.";
+        }
+        if (errorImgPosPhrase == null) {
+            errorImgPosPhrase = "ERROR! Enter the position of the image:";
+        }
+        var text2 = prompt(enterImgPosPhrase + "\n" + imgPosRorLPhrase, "");
+        while ( ( text2 != "" ) && ( text2 != "r" ) && ( text2 != "R" ) && ( text2 != "l" ) && ( text2 != "L" ) && ( text2 != null ) ) {
+            text2 = prompt(errorImgPosPhrase + "\n" + imgPosRorLPhrase,"");
+        }
+        if ( text2 == "l" || text2 == "L" ) {
+            text2 = " align=left";
+        } else if ( text2 == "r" || text2 == "R" ) {
+            text2 = " align=right";
+        } else {
+            text2 = "";
+        }
+        var result = "[img" + text2 + "]" + text + "[/img]";
+        xoopsInsertText(domobj, result);
+    }
+    domobj.focus();
+}
+
+function xoopsCodeEmail(id, enterEmailPhrase){
+    if (enterEmailPhrase == null) {
+        enterEmailPhrase = "Enter the email address you want to add:";
+    }
+    var text = prompt(enterEmailPhrase, "");
+    var domobj = xoopsGetElementById(id);
+    if ( text != null && text != "" ) {
+        var result = "[email]" + text + "[/email]";
+        xoopsInsertText(domobj, result);
+    }
+    domobj.focus();
+}
+
+function xoopsCodeQuote(id, enterQuotePhrase){
+    if (enterQuotePhrase == null) {
+        enterQuotePhrase = "Enter the text that you want to be quoted:";
+    }
+    var text = prompt(enterQuotePhrase, "");
+    var domobj = xoopsGetElementById(id);
+    if ( text != null && text != "" ) {
+        var pos = text.indexOf(unescape('%00'));
+        if(0 < pos){
+            text = text.substr(0,pos);
+        }
+        var result = "[quote]" + text + "[/quote]";
+        xoopsInsertText(domobj, result);
+    }
+    domobj.focus();
+}
+
+function xoopsCodeCode(id, enterCodePhrase){
+    if (enterCodePhrase == null) {
+        enterCodePhrase = "Enter the codes that you want to add.";
+    }
+    var text = prompt(enterCodePhrase, "");
+    var domobj = xoopsGetElementById(id);
+    if ( text != null && text != "" ) {
+        var result = "[code]" + text + "[/code]";
+        xoopsInsertText(domobj, result);
+    }
+    domobj.focus();
+}
+
+function xoopsCodeText(id, hiddentext, enterTextboxPhrase){
+    var textareaDom = xoopsGetElementById(id);
+    var textDom = xoopsGetElementById(id + "Addtext");
+    var fontDom = xoopsGetElementById(id + "Font");
+    var colorDom = xoopsGetElementById(id + "Color");
+    var sizeDom = xoopsGetElementById(id + "Size");
+    var xoopsHiddenTextDomStyle = xoopsGetElementById(hiddentext).style;
+    var textDomValue = textDom.value;
+    var fontDomValue = fontDom.options[fontDom.options.selectedIndex].value;
+    var colorDomValue = colorDom.options[colorDom.options.selectedIndex].value;
+    var sizeDomValue = sizeDom.options[sizeDom.options.selectedIndex].value;
+    if ( textDomValue == "" ) {
+        if (enterTextboxPhrase == null) {
+            enterTextboxPhrase = "Please input text into the textbox.";
+        }
+        alert(enterTextboxPhrase);
+        textDom.focus();
+    } else {
+        if ( fontDomValue != "FONT") {
+            textDomValue = "[font=" + fontDomValue + "]" + textDomValue + "[/font]";
+            fontDom.options[0].selected = true;
+        }
+        if ( colorDomValue != "COLOR") {
+            textDomValue = "[color=" + colorDomValue + "]" + textDomValue + "[/color]";
+            colorDom.options[0].selected = true;
+        }
+        if ( sizeDomValue != "SIZE") {
+            textDomValue = "[size=" + sizeDomValue + "]" + textDomValue + "[/size]";
+            sizeDom.options[0].selected = true;
+        }
+        if (xoopsHiddenTextDomStyle.fontWeight == "bold" || xoopsHiddenTextDomStyle.fontWeight == "700") {
+            textDomValue = "[b]" + textDomValue + "[/b]";
+            xoopsHiddenTextDomStyle.fontWeight = "normal";
+        }
+        if (xoopsHiddenTextDomStyle.fontStyle == "italic") {
+            textDomValue = "[i]" + textDomValue + "[/i]";
+            xoopsHiddenTextDomStyle.fontStyle = "normal";
+        }
+        if (xoopsHiddenTextDomStyle.textDecoration == "underline") {
+            textDomValue = "[u]" + textDomValue + "[/u]";
+            xoopsHiddenTextDomStyle.textDecoration = "none";
+        }
+        if (xoopsHiddenTextDomStyle.textDecoration == "line-through") {
+            textDomValue = "[d]" + textDomValue + "[/d]";
+            xoopsHiddenTextDomStyle.textDecoration = "none";
+        }
+        xoopsInsertText(textareaDom, textDomValue);
+        textDom.value = "";
+        xoopsHiddenTextDomStyle.color = "#000000";
+        xoopsHiddenTextDomStyle.fontFamily = "";
+        xoopsHiddenTextDomStyle.fontSize = "12px";
+        xoopsHiddenTextDomStyle.visibility = "hidden";
+        textareaDom.focus();
+    }
+}
+
+function xoopsValidate(subjectId, textareaId, submitId, plzCompletePhrase, msgTooLongPhrase, allowedCharPhrase, currCharPhrase) {
+    var maxchars = 65535;
+    var subjectDom = xoopsGetElementById(subjectId);
+    var textareaDom = xoopsGetElementById(textareaId);
+    var submitDom = xoopsGetElementById(submitId);
+    if (textareaDom.value == "" || subjectDom.value == "") {
+        if (plzCompletePhrase == null) {
+            plzCompletePhrase = "Please complete the subject and message fields.";
+        }
+        alert(plzCompletePhrase);
+        return false;
+    }
+    if (maxchars != 0) {
+        if (textareaDom.value.length > maxchars) {
+            if (msgTooLongPhrase == null) {
+                msgTooLongPhrase = "Your message is too long.";
+            }
+            if (allowedCharPhrase == null) {
+                allowedCharPhrase = "Allowed max chars length: ";
+            }
+            if (currCharPhrase == null) {
+                currCharPhrase = "Current chars length: ";
+            }
+            alert(msgTooLongPhrase + "\n\n" + allowedCharPhrase + maxchars + "\n" + currCharPhrase + textareaDom.value.length + "");
+            textareaDom.focus();
+            return false;
+        } else {
+            submitDom.disabled = true;
+            return true;
+        }
+    } else {
+        submitDom.disabled = true;
+        return true;
+    }
+}
+
+function chgImg(fileName,imgName){
+	document.images[imgName].src = fileName;
+}
+
Index: /temp/test-xoops.ec-cube.net/html/include/commentform.inc.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/include/commentform.inc.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/include/commentform.inc.php	(revision 405)
@@ -0,0 +1,72 @@
+<?php
+// $Id: commentform.inc.php,v 1.4 2005/09/04 20:46:09 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+if (!defined('XOOPS_ROOT_PATH')) {
+    exit();
+}
+include_once XOOPS_ROOT_PATH."/class/xoopslists.php";
+include XOOPS_ROOT_PATH."/class/xoopsformloader.php";
+$cform = new XoopsThemeForm(_CM_POSTCOMMENT, "commentform", "postcomment.php");
+if (!preg_match("/^re:/i", $subject)) {
+    $subject = "Re: ".xoops_substr($subject,0,56);
+}
+$cform->addElement(new XoopsFormText(_CM_TITLE, 'subject', 50, 255, $subject), true);
+$icons_radio = new XoopsFormRadio(_MESSAGEICON, 'icon', $icon);
+$subject_icons = XoopsLists::getSubjectsList();
+foreach ($subject_icons as $iconfile) {
+    $icons_radio->addOption($iconfile, '<img src="'.XOOPS_URL.'/images/subject/'.$iconfile.'" alt="" />');
+}
+$cform->addElement($icons_radio);
+$cform->addElement(new XoopsFormDhtmlTextArea(_CM_MESSAGE, 'message', $message, 10, 50), true);
+$option_tray = new XoopsFormElementTray(_OPTIONS,'<br />');
+if ($xoopsUser) {
+    if ($xoopsConfig['anonpost'] == 1) {
+        $noname_checkbox = new XoopsFormCheckBox('', 'noname', $noname);
+        $noname_checkbox->addOption(1, _POSTANON);
+        $option_tray->addElement($noname_checkbox);
+    }
+    if ($xoopsUser->isAdmin($xoopsModule->getVar('mid'))) {
+        $nohtml_checkbox = new XoopsFormCheckBox('', 'nohtml', $nohtml);
+        $nohtml_checkbox->addOption(1, _DISABLEHTML);
+        $option_tray->addElement($nohtml_checkbox);
+    }
+}
+$smiley_checkbox = new XoopsFormCheckBox('', 'nosmiley', $nosmiley);
+$smiley_checkbox->addOption(1, _DISABLESMILEY);
+$option_tray->addElement($smiley_checkbox);
+
+$cform->addElement($option_tray);
+$cform->addElement(new XoopsFormHidden('pid', intval($pid)));
+$cform->addElement(new XoopsFormHidden('comment_id', intval($comment_id)));
+$cform->addElement(new XoopsFormHidden('item_id', intval($item_id)));
+$cform->addElement(new XoopsFormHidden('order', intval($order)));
+$button_tray = new XoopsFormElementTray('' ,'&nbsp;');
+$button_tray->addElement(new XoopsFormButton('', 'preview', _PREVIEW, 'submit'));
+$button_tray->addElement(new XoopsFormButton('', 'post', _CM_POSTCOMMENT, 'submit'));
+$cform->addElement($button_tray);
+$cform->display();
+?>
Index: /temp/test-xoops.ec-cube.net/html/include/comment_constants.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/include/comment_constants.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/include/comment_constants.php	(revision 405)
@@ -0,0 +1,41 @@
+<?php
+// $Id: comment_constants.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.xoops.org/ http://jp.xoops.org/  http://www.myweb.ne.jp/  //
+// Project: The XOOPS Project (http://www.xoops.org/)                        //
+// ------------------------------------------------------------------------- //
+
+define('XOOPS_COMMENT_APPROVENONE', 0);
+define('XOOPS_COMMENT_APPROVEALL', 1);
+define('XOOPS_COMMENT_APPROVEUSER', 2);
+define('XOOPS_COMMENT_APPROVEADMIN', 3);
+define('XOOPS_COMMENT_PENDING', 1);
+define('XOOPS_COMMENT_ACTIVE', 2);
+define('XOOPS_COMMENT_HIDDEN', 3);
+define('XOOPS_COMMENT_OLD1ST', 0);
+define('XOOPS_COMMENT_NEW1ST', 1);
+?>
Index: /temp/test-xoops.ec-cube.net/html/include/calendar.js
===================================================================
--- /temp/test-xoops.ec-cube.net/html/include/calendar.js	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/include/calendar.js	(revision 405)
@@ -0,0 +1,1295 @@
+/*  Copyright Mihai Bazon, 2002  |  http://students.infoiasi.ro/~mishoo
+ * ---------------------------------------------------------------------
+ *
+ * The DHTML Calendar, version 0.9.2 "The art of date selection"
+ *
+ * Details and latest version at:
+ * http://students.infoiasi.ro/~mishoo/site/calendar.epl
+ *
+ * Feel free to use this script under the terms of the GNU Lesser General
+ * Public License, as long as you do not remove or alter this notice.
+ */
+
+// $Id: calendar.js,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+
+/** The Calendar object constructor. */
+Calendar = function (mondayFirst, dateStr, onSelected, onClose) {
+	// member variables
+	this.activeDiv = null;
+	this.currentDateEl = null;
+	this.checkDisabled = 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.mondayFirst = mondayFirst;
+	this.dateStr = dateStr;
+	this.ar_days = 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;
+
+	// one-time initializations
+	if (!Calendar._DN3) {
+		// table of short day names
+		var ar = new Array();
+		for (var i = 8; i > 0;) {
+			ar[--i] = Calendar._DN[i].substr(0, 3);
+		}
+		Calendar._DN3 = ar;
+		// table of short month names
+		ar = new Array();
+		for (var i = 12; i > 0;) {
+			ar[--i] = Calendar._MN[i].substr(0, 3);
+		}
+		Calendar._MN3 = ar;
+	}
+};
+
+// ** constants
+
+/// "static", needed for event handlers.
+Calendar._C = null;
+
+/// detect a special case of "web browser"
+Calendar.is_ie = ( (navigator.userAgent.toLowerCase().indexOf("msie") != -1) &&
+		   (navigator.userAgent.toLowerCase().indexOf("opera") == -1) );
+
+// short day names array (initialized at first constructor call)
+Calendar._DN3 = null;
+
+// short month names array (initialized at first constructor call)
+Calendar._MN3 = null;
+
+// BEGIN: UTILITY FUNCTIONS; beware that these might be moved into a separate
+//        library, at some point.
+
+Calendar.getAbsolutePos = function(el) {
+	var r = { x: el.offsetLeft, y: el.offsetTop };
+	if (el.offsetParent) {
+		var tmp = Calendar.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) {
+	if (Calendar.is_ie) {
+		return window.event.srcElement;
+	} else {
+		return ev.currentTarget;
+	}
+};
+
+Calendar.getTargetElement = function(ev) {
+	if (Calendar.is_ie) {
+		return window.event.srcElement;
+	} else {
+		return ev.target;
+	}
+};
+
+Calendar.stopEvent = function(ev) {
+	if (Calendar.is_ie) {
+		window.event.cancelBubble = true;
+		window.event.returnValue = false;
+	} else {
+		ev.preventDefault();
+		ev.stopPropagation();
+	}
+};
+
+Calendar.addEvent = function(el, evname, func) {
+	if (Calendar.is_ie) {
+		el.attachEvent("on" + evname, func);
+	} else {
+		el.addEventListener(evname, func, true);
+	}
+};
+
+Calendar.removeEvent = function(el, evname, func) {
+	if (Calendar.is_ie) {
+		el.detachEvent("on" + evname, func);
+	} else {
+		el.removeEventListener(evname, func, true);
+	}
+};
+
+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;
+	mc.style.left = cd.offsetLeft + "px";
+	mc.style.top = (cd.offsetTop + cd.offsetHeight) + "px";
+	mc.style.display = "block";
+};
+
+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.firstChild.data = Y;
+			yr.year = Y;
+			yr.style.display = "block";
+			show = true;
+		} else {
+			yr.style.display = "none";
+		}
+		yr = yr.nextSibling;
+		Y += fwd ? 2 : -2;
+	}
+	if (show) {
+		yc.style.left = cd.offsetLeft + "px";
+		yc.style.top = (cd.offsetTop + cd.offsetHeight) + "px";
+		yc.style.display = "block";
+	}
+};
+
+// 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);
+	Calendar.removeClass(el, "active");
+	if (target == el || target.parentNode == el) {
+		Calendar.cellClick(el);
+	}
+	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);
+		}
+	} 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);
+			}
+		}
+	}
+	with (Calendar) {
+		removeEvent(document, "mouseup", tableMouseUp);
+		removeEvent(document, "mouseover", tableMouseOver);
+		removeEvent(document, "mousemove", tableMouseOver);
+		cal._hideCombos();
+		stopEvent(ev);
+		_C = null;
+	}
+};
+
+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 {
+		Calendar.removeClass(el, "active");
+		Calendar.removeClass(el, "hilite");
+		Calendar.removeClass(el.parentNode, "rowhilite");
+	}
+	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 {
+		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");
+			}
+		}
+	}
+	Calendar.stopEvent(ev);
+};
+
+Calendar.tableMouseDown = function (ev) {
+	if (Calendar.getTargetElement(ev) == Calendar.getElement(ev)) {
+		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";
+	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, "mouseover", stopEvent);
+		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) {
+		addClass(el, "hilite active");
+		addEvent(document, "mouseover", tableMouseOver);
+		addEvent(document, "mousemove", tableMouseOver);
+		addEvent(document, "mouseup", tableMouseUp);
+	} else if (cal.isPopup) {
+		cal._dragStart(ev);
+	}
+	Calendar.stopEvent(ev);
+	if (el.navtype == -1 || el.navtype == 1) {
+		cal.timeout = setTimeout("Calendar.showMonthsCombo()", 250);
+	} else if (el.navtype == -2 || el.navtype == 2) {
+		cal.timeout = setTimeout((el.navtype > 0) ? "Calendar.showYearsCombo(true)" : "Calendar.showYearsCombo(false)", 250);
+	} else {
+		cal.timeout = null;
+	}
+};
+
+Calendar.dayMouseDblClick = function(ev) {
+	Calendar.cellClick(Calendar.getElement(ev));
+	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) == "_") {
+			var date = null;
+			with (el.calendar.date) {
+				date = new Date(getFullYear(), getMonth(), el.caldate);
+			}
+			el.ttip = date.print(el.calendar.ttDateFormat) + el.ttip.substr(1);
+		}
+		el.calendar.tooltips.firstChild.data = el.ttip;
+	}
+	if (el.navtype != 300) {
+		Calendar.addClass(el, "hilite");
+		if (el.caldate) {
+			Calendar.addClass(el.parentNode, "rowhilite");
+		}
+	}
+	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");
+		}
+		el.calendar.tooltips.firstChild.data = _TT["SEL_DATE"];
+		stopEvent(ev);
+	}
+};
+
+/**
+ *  A generic "click" handler :) handles all types of buttons defined in this
+ *  calendar.
+ */
+Calendar.cellClick = function(el) {
+	var cal = el.calendar;
+	var closing = false;
+	var newdate = false;
+	var date = null;
+	if (typeof el.navtype == "undefined") {
+		Calendar.removeClass(cal.currentDateEl, "selected");
+		Calendar.addClass(el, "selected");
+		closing = (cal.currentDateEl == el);
+		if (!closing) {
+			cal.currentDateEl = el;
+		}
+		cal.date.setDate(el.caldate);
+		date = cal.date;
+		newdate = true;
+	} else {
+		if (el.navtype == 200) {
+			Calendar.removeClass(el, "hilite");
+			cal.callCloseHandler();
+			return;
+		}
+		date = (el.navtype == 0) ? new Date() : new Date(cal.date);
+		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 -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.setMondayFirst(!cal.mondayFirst);
+			return;
+		}
+		if (!date.equalsTo(cal.date)) {
+			cal.setDate(date);
+			newdate = el.navtype == 0;
+		}
+	}
+	if (newdate) {
+		cal.callHandler();
+	}
+	if (closing) {
+		Calendar.removeClass(el, "hilite");
+		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.style.width = "150px";
+	}
+	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";
+		Calendar._add_evs(cell);
+		cell.calendar = cal;
+		cell.navtype = navtype;
+		if (text.substr(0, 1) != "&") {
+			cell.appendChild(document.createTextNode(text));
+		}
+		else {
+			// FIXME: dirty hack for entities
+			cell.innerHTML = text;
+		}
+		return cell;
+	};
+
+	row = Calendar.createElement("tr", thead);
+	var title_length = 6;
+	(this.isPopup) && --title_length;
+	(this.weekNumbers) && ++title_length;
+
+	hh("-", 1, 100).ttip = Calendar._TT["TOGGLE"];
+	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.appendChild(document.createTextNode(Calendar._TT["WK"]));
+	}
+	for (var i = 7; i > 0; --i) {
+		cell = Calendar.createElement("td", row);
+		cell.appendChild(document.createTextNode(""));
+		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);
+			cell.appendChild(document.createTextNode(""));
+		}
+		for (var j = 7; j > 0; --j) {
+			cell = Calendar.createElement("td", row);
+			cell.appendChild(document.createTextNode(""));
+			cell.calendar = this;
+			Calendar._add_evs(cell);
+		}
+	}
+
+	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 = "label";
+		mn.month = i;
+		mn.appendChild(document.createTextNode(Calendar._MN3[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 = "label";
+		yr.appendChild(document.createTextNode(""));
+		div.appendChild(yr);
+	}
+
+	this._init(this.mondayFirst, this.date);
+	parent.appendChild(this.element);
+};
+
+/** keyboard navigation, only for popup calendars */
+Calendar._keyEvent = function(ev) {
+	if (!window.calendar) {
+		return false;
+	}
+	(Calendar.is_ie) && (ev = window.event);
+	var cal = window.calendar;
+	var act = (Calendar.is_ie || ev.type == "keypress");
+	if (ev.ctrlKey) {
+		switch (ev.keyCode) {
+		    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 (ev.keyCode) {
+	    case 32: // KEY space (now)
+		Calendar.cellClick(cal._nav_now);
+		break;
+	    case 27: // KEY esc
+		act && cal.hide();
+		break;
+	    case 37: // KEY left
+	    case 38: // KEY up
+	    case 39: // KEY right
+	    case 40: // KEY down
+		if (act) {
+			var date = cal.date.getDate() - 1;
+			var el = cal.currentDateEl;
+			var ne = null;
+			var prev = (ev.keyCode == 37) || (ev.keyCode == 38);
+			switch (ev.keyCode) {
+			    case 37: // KEY left
+				(--date >= 0) && (ne = cal.ar_days[date]);
+				break;
+			    case 38: // KEY up
+				date -= 7;
+				(date >= 0) && (ne = cal.ar_days[date]);
+				break;
+			    case 39: // KEY right
+				(++date < cal.ar_days.length) && (ne = cal.ar_days[date]);
+				break;
+			    case 40: // KEY down
+				date += 7;
+				(date < cal.ar_days.length) && (ne = cal.ar_days[date]);
+				break;
+			}
+			if (!ne) {
+				if (prev) {
+					Calendar.cellClick(cal._nav_pm);
+				} else {
+					Calendar.cellClick(cal._nav_nm);
+				}
+				date = (prev) ? cal.date.getMonthDays() : 1;
+				el = cal.currentDateEl;
+				ne = cal.ar_days[date - 1];
+			}
+			Calendar.removeClass(el, "selected");
+			Calendar.addClass(ne, "selected");
+			cal.date.setDate(ne.caldate);
+			cal.currentDateEl = ne;
+		}
+		break;
+	    case 13: // KEY enter
+		if (act) {
+			cal.callHandler();
+			cal.hide();
+		}
+		break;
+	    default:
+		return false;
+	}
+	Calendar.stopEvent(ev);
+};
+
+/**
+ *  (RE)Initializes the calendar to the given date and style (if mondayFirst is
+ *  true it makes Monday the first day of week, otherwise the weeks start on
+ *  Sunday.
+ */
+Calendar.prototype._init = function (mondayFirst, date) {
+	var today = new Date();
+	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.mondayFirst = mondayFirst;
+	this.date = new Date(date);
+	var month = date.getMonth();
+	var mday = date.getDate();
+	var no_days = date.getMonthDays();
+	date.setDate(1);
+	var wday = date.getDay();
+	var MON = mondayFirst ? 1 : 0;
+	var SAT = mondayFirst ? 5 : 6;
+	var SUN = mondayFirst ? 6 : 0;
+	if (mondayFirst) {
+		wday = (wday > 0) ? (wday - 1) : 6;
+	}
+	var iday = 1;
+	var row = this.tbody.firstChild;
+	var MN = Calendar._MN3[month];
+	var hasToday = ((today.getFullYear() == year) && (today.getMonth() == month));
+	var todayDate = today.getDate();
+	var week_number = date.getWeekNumber();
+	var ar_days = new Array();
+	for (var i = 0; i < 6; ++i) {
+		if (iday > no_days) {
+			row.className = "emptyrow";
+			row = row.nextSibling;
+			continue;
+		}
+		var cell = row.firstChild;
+		if (this.weekNumbers) {
+			cell.className = "day wn";
+			cell.firstChild.data = week_number;
+			cell = cell.nextSibling;
+		}
+		++week_number;
+		row.className = "daysrow";
+		for (var j = 0; j < 7; ++j) {
+			cell.className = "day";
+			if ((!i && j < wday) || iday > no_days) {
+				// cell.className = "emptycell";
+				cell.innerHTML = "&nbsp;";
+				cell.disabled = true;
+				cell = cell.nextSibling;
+				continue;
+			}
+			cell.disabled = false;
+			cell.firstChild.data = iday;
+			if (typeof this.checkDisabled == "function") {
+				date.setDate(iday);
+				if (this.checkDisabled(date)) {
+					cell.className += " disabled";
+					cell.disabled = true;
+				}
+			}
+			if (!cell.disabled) {
+				ar_days[ar_days.length] = cell;
+				cell.caldate = iday;
+				cell.ttip = "_";
+				if (iday == mday) {
+					cell.className += " selected";
+					this.currentDateEl = cell;
+				}
+				if (hasToday && (iday == todayDate)) {
+					cell.className += " today";
+					cell.ttip += Calendar._TT["PART_TODAY"];
+				}
+				if (wday == SAT || wday == SUN) {
+					cell.className += " weekend";
+				}
+			}
+			++iday;
+			((++wday) ^ 7) || (wday = 0);
+			cell = cell.nextSibling;
+		}
+		row = row.nextSibling;
+	}
+	this.ar_days = ar_days;
+	this.title.firstChild.data = Calendar._MN[month] + ", " + year;
+	// PROFILE
+	// this.tooltips.firstChild.data = "Generated in " + ((new Date()) - today) + " ms";
+};
+
+/**
+ *  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.mondayFirst, date);
+	}
+};
+
+/** Modifies the "mondayFirst" parameter (EU/US style). */
+Calendar.prototype.setMondayFirst = function (mondayFirst) {
+	this._init(mondayFirst, 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.setDisabledHandler = function (unaryFunction) {
+	this.checkDisabled = 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;
+	delete el;
+};
+
+/**
+ *  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) {
+	if (!window.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.calendar.callCloseHandler();
+		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.calendar = 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) {
+	var p = Calendar.getAbsolutePos(el);
+	this.showAt(p.x, p.y + el.offsetHeight);
+};
+
+/** 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) {
+	var y = 0;
+	var m = -1;
+	var d = 0;
+	var a = str.split(/\W+/);
+	if (!fmt) {
+		fmt = this.dateFormat;
+	}
+	var b = fmt.split(/\W+/);
+	var i = 0, j = 0;
+	for (i = 0; i < a.length; ++i) {
+		if (b[i] == "D" || b[i] == "DD") {
+			continue;
+		}
+		if (b[i] == "d" || b[i] == "dd") {
+			d = parseInt(a[i]);
+		}
+		if (b[i] == "m" || b[i] == "mm") {
+			m = parseInt(a[i]) - 1;
+		}
+		if (b[i] == "y") {
+			y = parseInt(a[i]);
+		}
+		if (b[i] == "yy") {
+			y = parseInt(a[i]) + 1900;
+		}
+		if (b[i] == "M" || b[i] == "MM") {
+			for (j = 0; j < 12; ++j) {
+				if (Calendar._MN[j].substr(0, a[i].length).toLowerCase() == a[i].toLowerCase()) { m = j; break; }
+			}
+		}
+	}
+	if (y != 0 && m != -1 && d != 0) {
+		this.setDate(new Date(y, m, d));
+		return;
+	}
+	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]) <= 12 && m == -1) {
+			m = a[i]-1;
+		} else if (parseInt(a[i]) > 31 && y == 0) {
+			y = a[i];
+		} else if (d == 0) {
+			d = a[i];
+		}
+	}
+	if (y == 0) {
+		var today = new Date();
+		y = today.getFullYear();
+	}
+	if (m != -1 && d != 0) {
+		this.setDate(new Date(y, m, d));
+	}
+};
+
+Calendar.prototype.hideShowCovered = function () {
+	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)) {
+				cc.style.visibility = "visible";
+			} else {
+				cc.style.visibility = "hidden";
+			}
+		}
+	}
+};
+
+/** Internal function; it displays the bar with the names of the weekday. */
+Calendar.prototype._displayWeekdays = function () {
+	var MON = this.mondayFirst ? 0 : 1;
+	var SUN = this.mondayFirst ? 6 : 0;
+	var SAT = this.mondayFirst ? 5 : 6;
+	var cell = this.firstdayname;
+	for (var i = 0; i < 7; ++i) {
+		cell.className = "day name";
+		if (!i) {
+			cell.ttip = this.mondayFirst ? Calendar._TT["SUN_FIRST"] : Calendar._TT["MON_FIRST"];
+			cell.navtype = 100;
+			cell.calendar = this;
+			Calendar._add_evs(cell);
+		}
+		if (i == SUN || i == SAT) {
+			Calendar.addClass(cell, "weekend");
+		}
+		cell.firstChild.data = Calendar._DN3[i + 1 - MON];
+		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, "mouseover", stopEvent);
+		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;
+
+/** 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 the week.  The algorithm was "stolen" from PPK's
+ * website, hope it's correct :) http://www.xs4all.nl/~ppk/js/week.html */
+Date.prototype.getWeekNumber = function() {
+	var now = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0);
+	var then = new Date(this.getFullYear(), 0, 1, 0, 0, 0);
+	var time = now - then;
+	var day = then.getDay();
+	(day > 3) && (day -= 4) || (day += 3);
+	return Math.round(((time / Date.DAY) + day) / 7);
+};
+
+/** Checks dates equality (ignores time) */
+Date.prototype.equalsTo = function(date) {
+	return ((this.getFullYear() == date.getFullYear()) &&
+		(this.getMonth() == date.getMonth()) &&
+		(this.getDate() == date.getDate()));
+};
+
+/** Prints the date in a string according to the given format. */
+Date.prototype.print = function (frm) {
+	var str = new String(frm);
+	var m = this.getMonth();
+	var d = this.getDate();
+	var y = this.getFullYear();
+	var wn = this.getWeekNumber();
+	var w = this.getDay();
+	var s = new Array();
+	s["d"] = d;
+	s["dd"] = (d < 10) ? ("0" + d) : d;
+	s["m"] = 1+m;
+	s["mm"] = (m < 9) ? ("0" + (1+m)) : (1+m);
+	s["y"] = y;
+	s["yy"] = new String(y).substr(2, 2);
+	s["w"] = wn;
+	s["ww"] = (wn < 10) ? ("0" + wn) : wn;
+	with (Calendar) {
+		s["D"] = _DN3[w];
+		s["DD"] = _DN[w];
+		s["M"] = _MN3[m];
+		s["MM"] = _MN[m];
+	}
+	var re = /(.*)(\W|^)(d|dd|m|mm|y|yy|MM|M|DD|D|w|ww)(\W|$)(.*)/;
+	while (re.exec(str) != null) {
+		str = RegExp.$1 + RegExp.$2 + s[RegExp.$3] + RegExp.$4 + RegExp.$5;
+	}
+	return str;
+};
+
+// END: DATE OBJECT PATCHES
+
+// global object that remembers the calendar
+window.calendar = null;
Index: /temp/test-xoops.ec-cube.net/html/include/calendar-blue.css
===================================================================
--- /temp/test-xoops.ec-cube.net/html/include/calendar-blue.css	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/include/calendar-blue.css	(revision 405)
@@ -0,0 +1,178 @@
+/* The main calendar widget.  DIV containing a table. */
+
+div.calendar { position: relative; }
+
+.calendar, .calendar table {
+  border: 1px solid #556;
+  font-size: 11px;
+  color: #000;
+  cursor: default;
+  background: #eef;
+  font-family: tahoma,verdana,sans-serif;
+}
+
+/* Header part -- contains navigation buttons and day names. */
+
+.calendar .button { /* "<<", "<", ">", ">>" buttons have this class */
+  text-align: center;    /* They are the navigation buttons */
+  padding: 2px;          /* Make the buttons seem like they're pressing */
+}
+
+.calendar thead .title { /* This holds the current "month, year" */
+  font-weight: bold;      /* Pressing it will take you to the current date */
+  text-align: center;
+  background: #fff;
+  color: #000;
+  padding: 2px;
+}
+
+.calendar thead .headrow { /* Row <TR> containing navigation buttons */
+  background: #778;
+  color: #fff;
+}
+
+.calendar thead .daynames { /* Row <TR> containing the day names */
+  background: #bdf;
+}
+
+.calendar thead .name { /* Cells <TD> containing the day names */
+  border-bottom: 1px solid #556;
+  padding: 2px;
+  text-align: center;
+  color: #000;
+}
+
+.calendar thead .weekend { /* How a weekend day name shows in header */
+  color: #a66;
+}
+
+.calendar thead .hilite { /* How do the buttons in header appear when hover */
+  background: #aaf;
+  color: #000;
+  border: 1px solid #04f;
+  padding: 1px;
+}
+
+.calendar thead .active { /* Active (pressed) buttons in header */
+  background: #77c;
+  padding: 2px 0px 0px 2px;
+}
+
+/* The body part -- contains all the days in month. */
+
+.calendar tbody .day { /* Cells <TD> containing month days dates */
+  width: 2em;
+  color: #456;
+  text-align: right;
+  padding: 2px 4px 2px 2px;
+}
+
+.calendar table .wn {
+  padding: 2px 3px 2px 2px;
+  border-right: 1px solid #000;
+  background: #bdf;
+}
+
+.calendar tbody .rowhilite td {
+  background: #def;
+}
+
+.calendar tbody .rowhilite td.wn {
+  background: #eef;
+}
+
+.calendar tbody td.hilite { /* Hovered cells <TD> */
+  background: #def;
+  padding: 1px 3px 1px 1px;
+  border: 1px solid #bbb;
+}
+
+.calendar tbody td.active { /* Active (pressed) cells <TD> */
+  background: #cde;
+  padding: 2px 2px 0px 2px;
+}
+
+.calendar tbody td.selected { /* Cell showing today date */
+  font-weight: bold;
+  border: 1px solid #000;
+  padding: 1px 3px 1px 1px;
+  background: #fff;
+  color: #000;
+}
+
+.calendar tbody td.weekend { /* Cells showing weekend days */
+  color: #a66;
+}
+
+.calendar tbody td.today { /* Cell showing selected 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) */
+  text-align: center;
+  background: #556;
+  color: #fff;
+}
+
+.calendar tfoot .ttip { /* Tooltip (status bar) cell <TD> */
+  background: #fff;
+  color: #445;
+  border-top: 1px solid #556;
+  padding: 1px;
+}
+
+.calendar tfoot .hilite { /* Hover style for buttons in footer */
+  background: #aaf;
+  border: 1px solid #04f;
+  color: #000;
+  padding: 1px;
+}
+
+.calendar tfoot .active { /* Active (pressed) style for buttons in footer */
+  background: #77c;
+  padding: 2px 0px 0px 2px;
+}
+
+/* Combo boxes (menus that display months/years for direct selection) */
+
+.combo {
+  position: absolute;
+  display: none;
+  top: 0px;
+  left: 0px;
+  width: 4em;
+  cursor: default;
+  border: 1px solid #655;
+  background: #def;
+  color: #000;
+  font-size: smaller;
+}
+
+.combo .label {
+  width: 100%;
+  text-align: center;
+}
+
+.combo .hilite {
+  background: #acf;
+}
+
+.combo .active {
+  border-top: 1px solid #46a;
+  border-bottom: 1px solid #46a;
+  background: #eef;
+  font-weight: bold;
+}
Index: /temp/test-xoops.ec-cube.net/html/footer.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/footer.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/footer.php	(revision 405)
@@ -0,0 +1,91 @@
+<?php
+// $Id: footer.php,v 1.6 2006/05/01 02:37:26 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2005 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+if (!defined('XOOPS_ROOT_PATH')) {
+    exit();
+}
+if ( !defined("XOOPS_FOOTER_INCLUDED") ) {
+    define("XOOPS_FOOTER_INCLUDED",1);
+    $xoopsLogger->stopTime();
+    if ($xoopsOption['theme_use_smarty'] == 0) {
+        // the old way
+        $footer = htmlspecialchars($xoopsConfigMetaFooter['footer']).'<br /><div style="text-align:center">Powered by XOOPS Cube &copy; 2005-2006 <a href="http://xoopscube.org/" target="_blank">The XOOPS Cube Project</a></div>';
+        if (isset($xoopsOption['template_main'])) {
+            $xoopsTpl->xoops_setCaching(0);
+            $xoopsTpl->display('db:'.$xoopsOption['template_main']);
+        }
+        if (!isset($xoopsOption['show_rblock'])) {
+            $xoopsOption['show_rblock'] = 0;
+        }
+        themefooter($xoopsOption['show_rblock'], $footer);
+        xoops_footer();
+    } else {
+        // RMV-NOTIFY
+        include_once XOOPS_ROOT_PATH . '/include/notification_select.php';
+        if (isset($xoopsOption['template_main'])) {
+            if (isset($xoopsCachedTemplateId)) {
+                $xoopsTpl->assign('xoops_contents', $xoopsTpl->fetch('db:'.$xoopsOption['template_main'], $xoopsCachedTemplateId));
+            } else {
+                $xoopsTpl->assign('xoops_contents', $xoopsTpl->fetch('db:'.$xoopsOption['template_main']));
+            }
+        } else {
+            if (isset($xoopsCachedTemplate)) {
+                $xoopsTpl->assign('dummy_content', ob_get_contents());
+                $xoopsTpl->assign('xoops_contents', $xoopsTpl->fetch($xoopsCachedTemplate, $xoopsCachedTemplateId));
+            } else {
+                $xoopsTpl->assign('xoops_contents', ob_get_contents());
+            }
+            ob_end_clean();
+        }
+        if (!headers_sent()) {
+            header('Content-Type:text/html; charset='._CHARSET);
+            header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
+            header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
+            header('Cache-Control: no-store, no-cache, must-revalidate');
+            header('Cache-Control: post-check=0, pre-check=0', false);
+            header('Pragma: no-cache');
+        }
+        $xoopsTpl->xoops_setCaching(0);
+        $xoopsTpl->display($xoopsConfig['theme_set'].'/theme.html');
+    }
+    if ($xoopsConfig['debug_mode'] == 2 && $xoopsUserIsAdmin) {
+        echo '<script type="text/javascript">
+        <!--//
+        debug_window = openWithSelfMain("", "xoops_debug", 680, 600, true);
+        ';
+        $content = '<html><head><meta http-equiv="content-type" content="text/html; charset='._CHARSET.'" /><meta http-equiv="content-language" content="'._LANGCODE.'" /><title>'.htmlspecialchars($xoopsConfig['sitename']).'</title><link rel="stylesheet" type="text/css" media="all" href="'.getcss($xoopsConfig['theme_set']).'" /></head><body>'.$xoopsLogger->dumpAll().'<div style="text-align:center;"><input class="formButton" value="'._CLOSE.'" type="button" onclick="javascript:window.close();" /></div></body></html>';
+        $lines = preg_split("/(\r\n|\r|\n)( *)/", $content);
+        foreach ($lines as $line) {
+            echo 'debug_window.document.writeln("'.str_replace('"', '\"', $line).'");';
+        }
+        echo '
+        debug_window.document.close();
+        //-->
+        </script>';
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/themes/default/styleNN.css
===================================================================
--- /temp/test-xoops.ec-cube.net/html/themes/default/styleNN.css	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/themes/default/styleNN.css	(revision 405)
@@ -0,0 +1,3 @@
+@import url(style.css); 
+/* Very short Gecko-specific additions/changes here (if 
+any) */ 
Index: /temp/test-xoops.ec-cube.net/html/themes/default/theme.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/themes/default/theme.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/themes/default/theme.html	(revision 405)
@@ -0,0 +1,134 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<{$xoops_langcode}>" lang="<{$xoops_langcode}>">
+<head>
+<link rel="alternate" type="application/rss+xml" title="RSS" href="<{$xoops_url}>/modules/rssj/rss.php" />
+<meta http-equiv="content-type" content="text/html; charset=<{$xoops_charset}>" />
+<meta http-equiv="content-language" content="<{$xoops_langcode}>" />
+<meta name="robots" content="<{$xoops_meta_robots}>" />
+<meta name="keywords" content="<{$xoops_meta_keywords}>" />
+<meta name="description" content="<{$xoops_meta_description}>" />
+<meta name="rating" content="<{$xoops_meta_rating}>" />
+<meta name="author" content="<{$xoops_meta_author}>" />
+<meta name="copyright" content="<{$xoops_meta_copyright}>" />
+<meta name="generator" content="XOOPS" />
+<title><{$xoops_sitename}> - <{$xoops_pagetitle}></title>
+<link href="<{$xoops_url}>/favicon.ico" rel="SHORTCUT ICON" />
+<link rel="stylesheet" type="text/css" media="screen" href="<{$xoops_url}>/xoops.css" />
+<link rel="stylesheet" type="text/css" media="screen" href="<{$xoops_themecss}>" />
+<!-- RMV: added module header -->
+<{$xoops_module_header}>
+<script type="text/javascript">
+<!--
+<{$xoops_js}>
+//-->
+</script>
+</head>
+<body>
+<table cellspacing="0" width="780">
+	<tr id="header">
+		<td id="headerlogo"><a href="<{$xoops_url}>"><img src="<{$xoops_url}>/images/logo.jpg" width="236" height="68" alt="EC-CUBE" /></a></td>
+		<td><img src="<{$xoops_url}>/themes/default/img/copy.jpg" width="260" height="68" alt="ÆüËÜÈ¯¤Î¡ÖEC¥ª¡¼¥×¥ó¥½¡¼¥¹¡×³«È¯¥³¥ß¥å¥Ë¥Æ¥£¥µ¥¤¥È" /></td>
+		<td id="headerbanner">
+		<table cellspacing="0">
+			<{if $xoops_uname != "" }>
+			<tr>
+				<td style="color: #fff; text-align:right;"><img src="<{$xoops_url}>/images/arrow.gif" width="12" height="6" alt="" /> <strong>¤è¤¦¤³¤½¡ª<{$xoops_uname}> ÍÍ</strong></td> 
+			</tr>
+			<{/if}>
+			<tr><td height="5"></td></tr>
+			<tr>
+				<form action="<{$xoops_url}>/search.php" method="get">
+				<td>
+				<input type="text" name="query" size="20">
+				<input type="hidden" name="action" value="results">
+				<input type="submit" name="searchSubmit" value="Ã±¸ì¸¡º÷">
+				</td>
+				</form>
+			</tr>
+		</table>
+		</td>
+	</tr>
+	<tr>
+		<td id="headerbar" colspan="3"><img src="<{$xoops_url}>/images/bar.jpg" width="780" height="12" alt="" /></td>
+	</tr>
+</table>
+
+  <table cellspacing="0" width="780">
+    <tr>
+      <td id="leftcolumn">
+        <!-- Start left blocks loop -->
+        <{foreach item=block from=$xoops_lblocks}>
+          <{include file="default/theme_blockleft.html"}>
+        <{/foreach}>
+        <!-- End left blocks loop -->
+      </td>
+
+      <td id="centercolumn">
+
+        <!-- Display center blocks if any -->
+
+        <{if $xoops_showcblock == 1}>
+
+
+        <table cellspacing="0">
+          <tr>
+            <td id="centerCcolumn" colspan="2">
+
+            <!-- Start center-center blocks loop -->
+            <{foreach item=block from=$xoops_ccblocks}>
+              <{include file="default/theme_blockcenter_c.html"}>
+            <{/foreach}>
+            <!-- End center-center blocks loop -->
+
+            </td>
+          </tr>
+          <tr>
+            <td id="centerLcolumn">
+
+            <!-- Start center-left blocks loop -->
+              <{foreach item=block from=$xoops_clblocks}>
+                <{include file="default/theme_blockcenter_l.html"}>
+              <{/foreach}>
+            <!-- End center-left blocks loop -->
+
+            </td><td id="centerRcolumn">
+
+            <!-- Start center-right blocks loop -->
+              <{foreach item=block from=$xoops_crblocks}>
+                <{include file="default/theme_blockcenter_r.html"}>
+              <{/foreach}>
+            <!-- End center-right blocks loop -->
+
+            </td>
+          </tr>
+        </table>
+
+        <{/if}>
+        <!-- End display center blocks -->
+
+        <div id="content">
+          <{$xoops_contents}>
+        </div>
+      </td>
+
+      <{if $xoops_showrblock == 1}>
+
+      <td id="rightcolumn">
+        <!-- Start right blocks loop -->
+        <{foreach item=block from=$xoops_rblocks}>
+          <{include file="default/theme_blockright.html"}>
+        <{/foreach}>
+        <!-- End right blocks loop -->
+      </td>
+
+      <{/if}>
+
+    </tr>
+  </table>
+<table border="0" cellspacing="0" cellpadding="0"style="width:100%;">
+	<tr bgcolor="#3d3f4f">
+		<td style="text-align: right; color: #fff; font-size: x-small; padding: 10px 15px;">Copyright&copy; 2000-2006 LOCKON CO.,LTD. All Rights Reserved.</td>
+	</tr>
+</table>
+</body>
+</html>
Index: /temp/test-xoops.ec-cube.net/html/themes/default/style.css
===================================================================
--- /temp/test-xoops.ec-cube.net/html/themes/default/style.css	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/themes/default/style.css	(revision 405)
@@ -0,0 +1,205 @@
+@charset "euc-jp";
+
+/* COLOR */
+.ast { color: #cc0000; font-size: 90%; }
+.darkred { color: #cc0000; }
+.gray { color: #b6b7ba; }
+.white { color: #ffffff; }
+.whitest { color: #ffffff; font-weight: bold; }
+.white10 { color: #ffffff; font-size: 62.5%;}
+.red { color: #ff0000; }
+.red10 { color:#ff0000; font-size: 10px; }
+.red12 { color:#cc0000; font-size: 12px; }
+.reselt { color: #ffcc00; font-size: 120%; font-weight: bold; }
+.orange { color:#ff6600;}
+.bluest { color: #3a75af; font-weight: bold; }
+
+/* TEXT */
+.fs10 {font-size: 62.5%; line-height: 150%;}
+.fs12 {font-size: 75%; line-height: 150%;}
+.fs14 {font-size: 87.5%; line-height: 150%;}
+.fs18 {font-size: 117.5%; line-height: 150%;}
+.fs22 {font-size: 137.5%; line-height: 130%;}
+.fs24 {font-size: 150%; line-height: 130%;}
+.fs30 {font-size: 187.5%; line-height: 125%;}
+.fs10n {font-size: 62.5%;}
+.fs12n {font-size: 75%;}
+.fs14n {font-size: 87.5%;}
+.fs18n {font-size: 117.5%;}
+.fs22n {font-size: 137.5%;}
+.fs24n {font-size: 150%;}
+.fs30n {font-size: 187.5%;}
+
+.message1 {
+    font-size: 10px;
+    font-color: #b6b7ba;
+}
+
+body {color: black; background: white; margin: 0; padding: 0;}
+
+table {width: 100%; margin: 0; padding: 0; font-size: small;}
+table td {padding: 0; margin: 0; border-width: 0; vertical-align: top; font-family: Verdana, Arial, Helvetica, sans-serif;}
+
+a:link { color: #006699; text-decoration: none; }
+a:visited { color: #006699; text-decoration: none; }
+a:hover { color: #ff6600; text-decoration: underline; }
+
+h1 {}
+h2 {}
+h3 {}
+h4 {}
+h5 {}
+ul { margin: 2px; padding: 2px; list-style: decimal inside; text-align: left;}
+li { margin-left: 2px; list-style: square inside; color: #2F5376}
+
+input.formButton {}
+
+
+
+th {background-color: #000000; color: #FFFFFF; padding : 2px; vertical-align : middle; font-family: Verdana, Arial, Helvetica, sans-serif;}
+
+tr#header{background-image: url(./img/bg.jpg); background-repeat: repeat-x;}
+td#headerbanner {width: 780px; background-image: url(./img/bg.jpg); background-repeat: repeat-x; vertical-align: middle; text-align:right; padding-right: 8px;}
+td#headerbar {background-image: url(./img/bar.jpg); background-repeat: repeat-x;}
+
+td#leftcolumn {background-color: #f7f7f7; width: 180px; border-right: 1px solid #cccccc; font-size:12px;}
+td#leftcolumn th {background-color: #2F5376; color: #FFFFFF; vertical-align: middle;}
+td#leftcolumn div.blockTitle {padding: 9px 0 11px 30px; background-image: url(./img/left/title_bg.gif); background-repeat: no-repeat; color: #fff; font-weight: bold;}
+td#leftcolumn div.blockContent {line-height: 120%; line-height: 120%;}
+
+td#leftbanner {padding: 5px;}
+
+td#centercolumn {font-size: 12px; line-height: 150%;}
+
+/* ************************************** */
+td#centercolumn th {background-color: #2F5376; color: #FFFFFF; vertical-align: middle;}
+td#centerCcolumn .blockIcon {background-image: url(./img/top/title_icon.gif); background-repeat: no-repeat; background-position: left center;}
+td#centerCcolumn div.blockTitle {color: #fff; font-weight: bold; margin-left: 30px;}
+td#centerCcolumn div.blockContent {padding: 0; margin-right: 0px;  margin-left: 0px; margin-bottom: 2px; line-height: 120%;}
+
+td#centerLcolumn {width: 50%; padding: 0px 3px 0px 0px;}
+td#centerLcolumn legend.blockTitle {padding: 3px; color: #000000; font-weight: bold; margin-top: 0px;}
+td#centerLcolumn div.blockContent {border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; border-bottom: 1px solid #dddddd; padding: 3px; margin-left: 3px; margin-right: 2px; margin-bottom: 2px; line-height: 120%;}
+
+td#centerRcolumn {width: 50%; padding: 0px 3px 0px 0px;}
+td#centerRcolumn legend.blockTitle {padding: 3px; color: #000000; font-weight: bold; margin-top: 0px;}
+td#centerRcolumn div.blockContent {border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; border-bottom: 1px solid #dddddd; padding: 3px; margin-left: 2px; margin-right: 3px; margin-bottom: 2px; line-height: 120%;}
+
+div#content {text-align: left; padding: 0 15px;}
+
+td#rightcolumn {width: 160px; padding: 0 10px 0 0; font-size:12px;}
+td#rightcolumn th {background-color: #2F5376; color: #FFFFFF; vertical-align: middle;}
+td#rightcolumn div.blockTitle {background-color: #dddddd; color: #000000; font-weight: bold;}
+td#rightcolumn div.blockContent {padding: 5px; line-height: 120%;}
+
+td#footerbar {padding: 6px; background-color: #b6b7ba; font-color: #ffffff; font-size: 10px;}
+
+/* ¡Ú¥á¥¤¥ó¥á¥Ë¥å¡¼¡Ûdefault¥¹¥¿¥¤¥ë
+td#mainmenu a {background-color: #e6e6e6; display: block; margin: 0; padding: 4px;}
+td#mainmenu a:hover {background-color: #ffffff;}
+td#mainmenu a.menuTop {padding-left: 3px; border-top: 1px solid silver; border-right: 1px solid #666666; border-bottom: 1px solid #666666; border-left: 1px solid silver;}
+td#mainmenu a.menuMain {padding-left: 3px; border-right: 1px solid #666666; border-bottom: 1px solid #666666; border-left: 1px solid silver;}
+td#mainmenu a.menuSub {padding-left: 9px; border-right: 1px solid #666666; border-bottom: 1px solid #666666; border-left: 1px solid silver;}
+*/
+
+/* ¡Ú¥á¥¤¥ó¥á¥Ë¥å¡¼¡Û¥·¥ó¥×¥ë */
+td#mainmenu a {display: block; margin: 0;}
+td#mainmenu a:link { color: #000; text-decoration: none; }
+td#mainmenu a:visited { color: #000; text-decoration: none; }
+td#mainmenu a:hover {background-color: #ffffff; color: #ff6600;}
+td#mainmenu a.menuTop {padding-left: 3px; border-bottom: 1px dotted silver; padding: 8px 4px;}
+td#mainmenu a.menuMain {padding-left: 3px; padding: 8px 4px;}
+td#mainmenu span.menuMain {display: block; margin: 0; padding-left: 3px; padding: 8px 4px;}
+td#mainmenu a.menuSub {padding: 0 0 6px 16px; font-size: x-small;}
+
+/* ¡Ú¥á¥¤¥ó¥á¥Ë¥å¡¼¡Ûblock¥¹¥¿¥¤¥ë 
+td#mainmenu a {
+	display: block;
+	padding: 5px 5px 5px 0.5em;
+	border-left: 10px solid #1958b7;
+	border-right: 10px solid #508fc4;
+	background-color: #2175BC;
+	color: #FFFFFF;
+	text-decoration: none;
+	margin-bottom: 1px;
+}
+td#mainmenu a:hover {
+	border-left: 10px solid #1C64D1;
+	border-right: 10px solid #5BA3E0;
+	background-color: #2586D7;
+	color: #FFFFFF;
+}
+td#mainmenu a.menuTop {padding-left: 8px;}
+td#mainmenu a.menuMain {padding-left: 8px;}
+td#mainmenu a.menuSub {padding-left: 18px; text-align:left;}
+*/
+
+/* ¡Ú¥æ¡¼¥¶¥á¥Ë¥å¡¼¡Ûdefault¥¹¥¿¥¤¥ë*/
+/*
+td#usermenu a {background-color: #e6e6e6; display: block; margin: 0; padding: 4px; border-right: 1px solid #666666; border-bottom: 1px solid #666666; border-left: 1px solid silver;}
+td#usermenu a:hover {background-color: #ffffff;}
+td#usermenu a.menuTop {border-top: 1px solid silver;}
+td#usermenu a.highlight {background-color: #fcc;}
+*/
+/* ¡Ú¥æ¡¼¥¶¥á¥Ë¥å¡¼¡Û¥·¥ó¥×¥ë*/
+td#usermenu a {display: block; margin: 0;}
+td#usermenu a:link { color: #000; text-decoration: none; }
+td#usermenu a:visited { color: #000; text-decoration: none; }
+td#usermenu a:hover {background-color: #ffffff; color: #ff6600;}
+td#usermenu a.menuTop {padding-left: 3px; border-bottom: 1px dotted silver; padding: 8px 4px;}
+td#usermenu a.menuMain {padding-left: 3px; padding: 8px 4px;}
+td#usermenu a.highlight {padding-left: 3px; border-bottom: 1px dotted silver;}
+
+.outer {border: 1px solid silver;}
+.head {background-color: #c2cdd6; padding: 5px; font-weight: bold;}
+.even {background-color: #dee3e7; padding: 5px;}
+.odd {background-color: #E9E9E9; padding: 5px;}
+.foot {background-color: #c2cdd6; padding: 5px; font-weight: bold;}
+tr.even td {background-color: #dee3e7; padding: 5px;}
+tr.odd td {background-color: #E9E9E9; padding: 5px;}
+
+div.errorMsg { background-color: #FFCCCC; text-align: center; border-top: 1px solid #DDDDFF; border-left: 1px solid #DDDDFF; border-right: 1px solid #AAAAAA; border-bottom: 1px solid #AAAAAA; font-weight: bold; padding: 10px;}
+div.confirmMsg { background-color: #DDFFDF; color: #136C99; text-align: center; border-top: 1px solid #DDDDFF; border-left: 1px solid #DDDDFF; border-right: 1px solid #AAAAAA; border-bottom: 1px solid #AAAAAA; font-weight: bold; padding: 10px;}
+div.resultMsg { background-color : #CCCCCC; color: #333333; text-align: center; border-top: 1px solid silver; border-left: 1px solid silver; font-weight: bold; border-right: 1px solid #666666; border-bottom: 1px solid #666666; padding: 10px;}
+
+div.xoopsCode { background: #FFFFFF; border: 1px inset #000080; font-family: "Courier New",Courier,monospace; padding: 0px 6px 6px 6px;}
+div.xoopsQuote { background: #FFFFFF; border: 1px inset #000080; font-family: "Courier New",Courier,monospace; padding: 0px 6px 6px 6px;}
+
+
+.comTitle {font-weight: bold; margin-bottom: 2px;}
+.comText {padding: 2px;}
+.comUserStat {font-size: 10px; color: #2F5376; font-weight:bold; border: 1px solid silver; background-color: #ffffff; margin: 2px; padding: 2px;}
+.comUserStatCaption {font-weight: normal;}
+.comUserStatus {margin-left: 2px; margin-top: 10px; color: #2F5376; font-weight:bold; font-size: 10px;}
+.comUserRank {margin: 2px;}
+.comUserRankText {font-size: 10px;font-weight:bold;}
+.comUserRankImg {border: 0;}
+.comUserName {}
+.comUserImg {margin: 2px;}
+.comDate {font-weight: normal; font-style: italic; font-size: smaller}
+.comDateCaption {font-weight: bold; font-style: normal;}
+.comResponse {font-weight: normal; font-size: smaller}
+
+
+/* ¥í¥°¥¤¥ó¥Ö¥í¥Ã¥¯ */
+table#login { border:1px solid #b6b7ba;}
+
+/* Ãæ±û¥Ö¥í¥Ã¥¯¥¯¥³¥á¥ó¥ÈÉ½¼¨*/
+table#centerMessage {font-size: 12px; border:1px solid #b6b7ba;}
+
+/* ¥Ë¥å¡¼¥¹*/
+div.news {margin: 0; padding: 0 5px;}
+div.news dl {border-bottom: 1px dotted silver; margin: 0; padding: 10px 0;}
+div.news dt img {margin: 0 5px 0 12px;}
+div.news dd {margin: 0 10px 0 0; padding: 0 0 0 20px;}
+
+/* ¥ê¥ê¡¼¥¹¥Î¡¼¥È*/
+div.release {margin: 0; padding: 0 5px;}
+div.release dl {border-bottom: 1px dotted silver; margin: 0; padding: 12px 0;}
+div.release dt img {margin: 0 5px 0 12px;}
+div.release dd {margin: 0 10px 0 0; padding: 0 0 0 20px;}
+
+/* ¥é¥ó¥­¥ó¥°¥Æ¡¼¥Ö¥ë*/
+
+.ranking01 {width: 15%; background-color: #ededed; padding: 10px;}
+.ranking02 {width: 85%;background-color: #ffffff; padding: 10px;}
Index: /temp/test-xoops.ec-cube.net/html/themes/default/styleMAC.css
===================================================================
--- /temp/test-xoops.ec-cube.net/html/themes/default/styleMAC.css	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/themes/default/styleMAC.css	(revision 405)
@@ -0,0 +1,3 @@
+@import url(style.css); 
+/* Very short Mac-specific additions/changes here (if 
+any) */ 
Index: /temp/test-xoops.ec-cube.net/html/themes/default/theme_blockleft.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/themes/default/theme_blockleft.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/themes/default/theme_blockleft.html	(revision 405)
@@ -0,0 +1,2 @@
+<div class="blockTitle"><{$block.title}></div>
+<div class="blockContent"><{$block.content}></div>
Index: /temp/test-xoops.ec-cube.net/html/themes/default/theme_blockcenter_l.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/themes/default/theme_blockcenter_l.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/themes/default/theme_blockcenter_l.html	(revision 405)
@@ -0,0 +1,6 @@
+<div style="padding: 0px 0px 0px 8px;">
+  <fieldset>
+    <legend class="blockTitle"><{$block.title}></legend>
+    <div class="blockContent"><{$block.content}></div>
+  </fieldset>
+</div>
Index: /temp/test-xoops.ec-cube.net/html/themes/default/theme_blockright.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/themes/default/theme_blockright.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/themes/default/theme_blockright.html	(revision 405)
@@ -0,0 +1,6 @@
+<div style="padding: 10px 0 0 0;">
+<{if $block.title != 'escape'}>
+<div class="blockTitle"><{$block.title}></div>
+<{/if}>
+<div class="blockContent"><{$block.content}></div>
+</div>
Index: /temp/test-xoops.ec-cube.net/html/themes/default/theme_blockcenter_r.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/themes/default/theme_blockcenter_r.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/themes/default/theme_blockcenter_r.html	(revision 405)
@@ -0,0 +1,6 @@
+<div style="padding: 0px 5px 0px 0px;">
+  <fieldset>
+    <legend class="blockTitle"><{$block.title}></legend>
+    <div class="blockContent"><{$block.content}></div>
+  </fieldset>
+</div>
Index: /temp/test-xoops.ec-cube.net/html/themes/default/theme_blockcenter_c.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/themes/default/theme_blockcenter_c.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/themes/default/theme_blockcenter_c.html	(revision 405)
@@ -0,0 +1,27 @@
+<div style="padding: 15px 15px 10px 15px;">
+	<{if $block.title != 'escape'}>
+	<table border="0" cellspacing="0" cellpadding="0">
+		<tr bgcolor="#2b8200">
+			<td><img src="<{$xoops_url}>/themes/default/img/top/title_left_top.gif" width="10" height="7" alt="" border="0"></td>
+			<td style="width:100%;"></td>
+			<td align="left"><img src="<{$xoops_url}>/themes/default/img/top/title_right_top.gif" width="10" height="7" alt="" border="0"></td>
+		</tr>
+		<tr>
+			<td bgcolor="#2b8200" colspan="3">
+			<table border="0" cellspacing="0" cellpadding="0">
+				<tr>
+					<td class="blockIcon"><div class="blockTitle"><{$block.title}></div></td>
+				</tr>
+			</table>
+			</td>
+		</tr>
+		<tr bgcolor="#2b8200">
+			<td><img src="<{$xoops_url}>/themes/default/img/top/title_left_bottom.gif" width="10" height="7" alt="" border="0"></td>
+			<td></td>
+			<td align="left"><img src="<{$xoops_url}>/themes/default/img/top/title_right_bottom.gif" width="10" height="7" alt="" border="0"></td>
+		</tr>
+		<tr><td height="10"></td></tr>
+	</table>
+	<{/if}>
+	<div class="blockContent"><{$block.content}></div>
+</div>
Index: /temp/test-xoops.ec-cube.net/html/themes/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/themes/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/themes/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/themes/phpkaox/styleNN.css
===================================================================
--- /temp/test-xoops.ec-cube.net/html/themes/phpkaox/styleNN.css	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/themes/phpkaox/styleNN.css	(revision 405)
@@ -0,0 +1,52 @@
+table { width: 100%; margin: 5; padding: 5; font-size: small}
+table td { padding: 0; border-width: 0; vertical-align: top; font-family: Verdana, Arial, Helvetica, sans-serif;}
+div#content { padding: 5px; text-align: left;}
+div#content td { padding: 3px;}
+
+body { font-family: Tahoma, taipei; color;#000000; font-size: 12px}
+a { font-family: Tahoma, taipei; font-size: 12px; text-decoration: none; color: #666666; font-style: normal}
+a:hover { text-decoration: underline overline;  font-family: Tahoma, taipei; font-size: 12px; color: #FF9966; font-style: normal}
+td {  font-family: Tahoma, taipei; color: #000000; font-size: 12px;border-top-width : 1px; border-right-width : 1px; border-bottom-width : 1px; border-left-width : 1px;}
+input { background-color : transparent; color : #000000; font-family : Tahoma, taipei, Verdana, Arial, Helvetica, sans-serif; font-size : 12px; font-weight : normal;border-color : #000000;  border-top-width : 1px; border-right-width : 1px; border-bottom-width : 1px; border-left-width : 1px;text-indent : 2px;  }
+textarea {font-family: Tahoma, taipei, Verdana, Arial, Helvetica, sans-serif; font-size: 12px;background-color : transparent; font-weight : bold; border-color : #000000;  border-top-width : 1px; border-right-width : 1px; border-bottom-width : 1px; border-left-width : 1px; text-indent : 2px;}
+select {font-family: Tahoma, taipei, Verdana, Arial, Helvetica, sans-serif; font-size: 12px;font-weight : bold;background-color:#F5F5F5; } 
+img { border: 0;}
+ul { margin: 2px; padding: 2px; list-style: decimal inside; text-align: left;}
+li { margin-left: 2px; list-style: disc inside;}
+
+.odd { background-color: #eeeeee;}
+.outer { background-color: #CCCCCC;}
+.even { background-color: #DDE1DE;}
+th { background-color: #e0e0e0; text-align: left; padding: 3px;}
+.head { background-color: #E2DBD3; padding: 3px;}
+.foot { background-color: #E2DBD3; padding: 3px;}
+
+.comTitle {font-weight: bold; margin-bottom: 2px;}
+.comText {padding: 2px;}
+.comUserStat {font-size: 10px; color: #333333; font-weight:bold; border: 1px solid #cccccc; background-color: #ffffff; margin: 2px; padding: 2px;}
+.comUserStatCaption {font-weight: normal;}
+.comUserStatus {margin-left: 2px; margin-top: 10px; color: #333333; font-weight:bold; font-size: 10px;}
+.comUserRank {margin: 2px;}
+.comUserRankText {font-size: 10px;font-weight:bold;}
+.comUserRankImg {border: 0;}
+.comUserName {}
+.comUserImg {margin: 2px;}
+.comDate {font-weight: normal; font-style: italic; font-size: smaller}
+.comDateCaption {font-weight: bold; font-style: normal;}
+
+.item {border: 1px solid #cccccc;}
+.itemHead {background-color: #E2DBD3; color: #666600; padding: 2px; font-weight: bold; text-align: left;}
+.itemInfo {text-align: right; padding: 3px; background-color: #efefef}
+.itemTitle a {font-size: 130%; font-weight: bold; font-variant: small-caps; color: #666600; background-color: transparent;}
+.itemPoster {font-size: 90%; font-style:italic;}
+.itemPostDate {font-size: 90%; font-style:italic;}
+.itemStats {font-size: 90%; font-style:italic;}
+.itemBody {padding-left: 5px; text-align: left}
+.itemText {margin-top: 5px; margin-bottom: 5px; line-height: 1.5em;}
+.itemText:first-letter {font-size: 133%; font-weight: bold;}
+.itemFoot {text-align: right; padding: 3px; background-color: #efefef}
+.itemAdminLink {font-size: 90%;}
+.itemPermaLink {font-size: 90%;}
+
+.blockTitle {background-color: #E2DBD3; color: #666600; padding: 2px; font-weight: bold}
+.blockContent {background-color: #efefef; padding: 2px;}
Index: /temp/test-xoops.ec-cube.net/html/themes/phpkaox/theme.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/themes/phpkaox/theme.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/themes/phpkaox/theme.html	(revision 405)
@@ -0,0 +1,147 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<{$xoops_langcode}>" lang="<{$xoops_langcode}>">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=<{$xoops_charset}>" />
+<meta http-equiv="content-language" content="<{$xoops_langcode}>" />
+<meta name="robots" content="<{$xoops_meta_robots}>" />
+<meta name="keywords" content="<{$xoops_meta_keywords}>" />
+<meta name="description" content="<{$xoops_meta_description}>" />
+<meta name="rating" content="<{$xoops_meta_rating}>" />
+<meta name="author" content="<{$xoops_meta_author}>" />
+<meta name="copyright" content="<{$xoops_meta_copyright}>" />
+<meta name="generator" content="XOOPS" />
+<title><{$xoops_sitename}> - <{$xoops_pagetitle}></title>
+<link href="<{$xoops_url}>/favicon.ico" rel="SHORTCUT ICON" />
+<link rel="stylesheet" type="text/css" media="all" href="<{$xoops_url}>/xoops.css" />
+<link rel="stylesheet" type="text/css" media="all" href="<{$xoops_themecss}>" />
+<!-- RMV: added module header -->
+<{$xoops_module_header}>
+<script type="text/javascript">
+<!--
+<{$xoops_js}>
+//-->
+</script>
+</head>
+<body>
+<table cellspacing="1" cellpadding="0" bgcolor="#666666">
+  <tr>
+    <td bgcolor="#DDE1DE">
+      <table cellspacing="0" cellpadding="0">
+        <tr>
+          <td width="285"><a href="<{$xoops_url}>"><img src="<{$xoops_imageurl}>images/logo.gif" alt="logo" align="middle" /></a></td>
+          <td width="100%" align="center"><div style="text-align: center; padding-top: 5px;"><{$xoops_banner}></div></td>
+        </tr>
+      </table>
+    </td>
+  </tr>
+  <tr>
+    <td bgcolor="#FFFFFF">
+      <table cellspacing="0" cellpadding="0">
+        <tr>
+          <td width="20%" bgcolor="#EFEFEF">
+          <!-- Start left blocks loop -->
+            <{foreach item=block from=$xoops_lblocks}>
+            <table cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="blockTitle">&nbsp;<{$block.title}></td>
+              </tr>
+              <tr>
+                <td class="blockContent"><{$block.content}></td>
+              </tr>
+            </table>
+            <{/foreach}>
+          <!-- End left blocks loop -->
+          </td>
+          <td style="padding: 0px 5px 0px;" align="center">
+          <!-- Display center blocks if any -->
+            <{if $xoops_showcblock == 1}>
+
+            <table cellspacing="0">
+              <tr>
+                <td width="100%" colspan="2">
+
+                <!-- Start center-center blocks loop -->
+                  <{foreach item=block from=$xoops_ccblocks}>
+                  <table cellspacing="1" cellpadding="5">
+                    <tr>
+                      <td class="blockTitle">&nbsp;<{$block.title}></td>
+                    </tr>
+                    <tr>
+                      <td class="blockContent"><{$block.content}></td>
+                    </tr>
+                  </table>
+                  <{/foreach}>
+                <!-- End center-center blocks loop -->
+
+                </td>
+              </tr>
+              <tr>
+                <td width="50%">
+
+                <!-- Start center-left blocks loop -->
+                  <{foreach item=block from=$xoops_clblocks}>
+                  <table cellspacing="1" cellpadding="5">
+                    <tr>
+                      <td class="blockTitle">&nbsp;<{$block.title}></td>
+                    </tr>
+                    <tr>
+                      <td class="blockContent"><{$block.content}></td>
+                    </tr>
+                  </table>
+                  <{/foreach}>
+                <!-- End center-left blocks loop -->
+
+                </td><td width="50%">
+
+                <!-- Start center-right blocks loop -->
+                  <{foreach item=block from=$xoops_crblocks}>
+                  <table cellspacing="1" cellpadding="5">
+                    <tr>
+                      <td class="blockTitle">&nbsp;<{$block.title}></td>
+                    </tr>
+                    <tr>
+                      <td class="blockContent"><{$block.content}></td>
+                    </tr>
+                  </table>
+                  <{/foreach}>
+                <!-- End center-right blocks loop -->
+
+                </td>
+              </tr>
+            </table>
+
+            <{/if}>
+            <!-- End display center blocks -->
+
+            <div id="content">
+              <{$xoops_contents}>
+            </div>
+          </td>
+
+          <{if $xoops_showrblock == 1}>
+	      <td width=20% bgcolor=#efefef align=center>
+          <!-- Start right blocks loop -->
+            <{foreach item=block from=$xoops_rblocks}>
+            <table cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="blockTitle">&nbsp;<{$block.title}></td>
+              </tr>
+              <tr>
+                <td class="blockContent"><{$block.content}></td>
+              </tr>
+            </table>
+            <br />
+            <{/foreach}>
+          <!-- End right blocks loop -->
+          <{/if}>
+          </td>
+        </tr>
+      </table>
+    </td>
+  </tr>
+  <tr>
+    <td height="30" valign="middle" bgcolor="#DDE1DE" align="center"><div style="text-align: center; padding-top: 2px; font-size: 10px"><{$xoops_footer}></div></td>
+  </tr>
+</table>
+</body>
+</html>
Index: /temp/test-xoops.ec-cube.net/html/themes/phpkaox/style.css
===================================================================
--- /temp/test-xoops.ec-cube.net/html/themes/phpkaox/style.css	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/themes/phpkaox/style.css	(revision 405)
@@ -0,0 +1,52 @@
+table { width: 100%; margin: 5; padding: 5; font-size: small}
+table td { padding: 0; border-width: 0; vertical-align: top; font-family: Verdana, Arial, Helvetica, sans-serif;}
+div#content { padding: 5px; text-align: left;}
+div#content td { padding: 3px;}
+
+body { font-family: Tahoma, taipei; color;#000000; font-size: 12px}
+a { font-family: Tahoma, taipei; font-size: 12px; text-decoration: none; color: #666666; font-style: normal}
+a:hover { text-decoration: underline overline;  font-family: Tahoma, taipei; font-size: 12px; color: #FF9966; font-style: normal}
+td {  font-family: Tahoma, taipei; color: #000000; font-size: 12px;border-top-width : 1px; border-right-width : 1px; border-bottom-width : 1px; border-left-width : 1px;}
+input { background-color : transparent; color : #000000; font-family : Tahoma, taipei, Verdana, Arial, Helvetica, sans-serif; font-size : 12px; font-weight : normal;border-color : #000000;  border-top-width : 1px; border-right-width : 1px; border-bottom-width : 1px; border-left-width : 1px;text-indent : 2px;  }
+textarea {font-family: Tahoma, taipei, Verdana, Arial, Helvetica, sans-serif; font-size: 12px;background-color : transparent; font-weight : bold; border-color : #000000;  border-top-width : 1px; border-right-width : 1px; border-bottom-width : 1px; border-left-width : 1px; text-indent : 2px;}
+select {font-family: Tahoma, taipei, Verdana, Arial, Helvetica, sans-serif; font-size: 12px;font-weight : bold;background-color:#F5F5F5; } 
+img { border: 0;}
+ul { margin: 2px; padding: 2px; list-style: decimal inside; text-align: left;}
+li { margin-left: 2px; list-style: disc inside;}
+
+.odd { background-color: #eeeeee;}
+.outer { background-color: #CCCCCC;}
+.even { background-color: #DDE1DE;}
+th { background-color: #e0e0e0; text-align: left; padding: 3px;}
+.head { background-color: #E2DBD3; padding: 3px;}
+.foot { background-color: #E2DBD3; padding: 3px;}
+
+.comTitle {font-weight: bold; margin-bottom: 2px;}
+.comText {padding: 2px;}
+.comUserStat {font-size: 10px; color: #333333; font-weight:bold; border: 1px solid #cccccc; background-color: #ffffff; margin: 2px; padding: 2px;}
+.comUserStatCaption {font-weight: normal;}
+.comUserStatus {margin-left: 2px; margin-top: 10px; color: #333333; font-weight:bold; font-size: 10px;}
+.comUserRank {margin: 2px;}
+.comUserRankText {font-size: 10px;font-weight:bold;}
+.comUserRankImg {border: 0;}
+.comUserName {}
+.comUserImg {margin: 2px;}
+.comDate {font-weight: normal; font-style: italic; font-size: smaller}
+.comDateCaption {font-weight: bold; font-style: normal;}
+
+.item {border: 1px solid #cccccc;}
+.itemHead {background-color: #E2DBD3; color: #666600; padding: 2px; font-weight: bold; text-align: left;}
+.itemInfo {text-align: right; padding: 3px; background-color: #efefef}
+.itemTitle a {font-size: 130%; font-weight: bold; font-variant: small-caps; color: #666600; background-color: transparent;}
+.itemPoster {font-size: 90%; font-style:italic;}
+.itemPostDate {font-size: 90%; font-style:italic;}
+.itemStats {font-size: 90%; font-style:italic;}
+.itemBody {padding-left: 5px; text-align: left}
+.itemText {margin-top: 5px; margin-bottom: 5px; line-height: 1.5em;}
+.itemText:first-letter {font-size: 133%; font-weight: bold;}
+.itemFoot {text-align: right; padding: 3px; background-color: #efefef}
+.itemAdminLink {font-size: 90%;}
+.itemPermaLink {font-size: 90%;}
+
+.blockTitle {background-color: #E2DBD3; color: #666600; padding: 2px; font-weight: bold}
+.blockContent {background-color: #efefef; padding: 2px;}
Index: /temp/test-xoops.ec-cube.net/html/themes/phpkaox/styleMAC.css
===================================================================
--- /temp/test-xoops.ec-cube.net/html/themes/phpkaox/styleMAC.css	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/themes/phpkaox/styleMAC.css	(revision 405)
@@ -0,0 +1,52 @@
+table { width: 100%; margin: 5; padding: 5; font-size: small}
+table td { padding: 0; border-width: 0; vertical-align: top; font-family: Verdana, Arial, Helvetica, sans-serif;}
+div#content { padding: 5px; text-align: left;}
+div#content td { padding: 3px;}
+
+body { font-family: Tahoma, taipei; color;#000000; font-size: 12px}
+a { font-family: Tahoma, taipei; font-size: 12px; text-decoration: none; color: #666666; font-style: normal}
+a:hover { text-decoration: underline overline;  font-family: Tahoma, taipei; font-size: 12px; color: #FF9966; font-style: normal}
+td {  font-family: Tahoma, taipei; color: #000000; font-size: 12px;border-top-width : 1px; border-right-width : 1px; border-bottom-width : 1px; border-left-width : 1px;}
+input { background-color : transparent; color : #000000; font-family : Tahoma, taipei, Verdana, Arial, Helvetica, sans-serif; font-size : 12px; font-weight : normal;border-color : #000000;  border-top-width : 1px; border-right-width : 1px; border-bottom-width : 1px; border-left-width : 1px;text-indent : 2px;  }
+textarea {font-family: Tahoma, taipei, Verdana, Arial, Helvetica, sans-serif; font-size: 12px;background-color : transparent; font-weight : bold; border-color : #000000;  border-top-width : 1px; border-right-width : 1px; border-bottom-width : 1px; border-left-width : 1px; text-indent : 2px;}
+select {font-family: Tahoma, taipei, Verdana, Arial, Helvetica, sans-serif; font-size: 12px;font-weight : bold;background-color:#F5F5F5; } 
+img { border: 0;}
+ul { margin: 2px; padding: 2px; list-style: decimal inside; text-align: left;}
+li { margin-left: 2px; list-style: disc inside;}
+
+.odd { background-color: #eeeeee;}
+.outer { background-color: #CCCCCC;}
+.even { background-color: #DDE1DE;}
+th { background-color: #e0e0e0; text-align: left; padding: 3px;}
+.head { background-color: #E2DBD3; padding: 3px;}
+.foot { background-color: #E2DBD3; padding: 3px;}
+
+.comTitle {font-weight: bold; margin-bottom: 2px;}
+.comText {padding: 2px;}
+.comUserStat {font-size: 10px; color: #333333; font-weight:bold; border: 1px solid #cccccc; background-color: #ffffff; margin: 2px; padding: 2px;}
+.comUserStatCaption {font-weight: normal;}
+.comUserStatus {margin-left: 2px; margin-top: 10px; color: #333333; font-weight:bold; font-size: 10px;}
+.comUserRank {margin: 2px;}
+.comUserRankText {font-size: 10px;font-weight:bold;}
+.comUserRankImg {border: 0;}
+.comUserName {}
+.comUserImg {margin: 2px;}
+.comDate {font-weight: normal; font-style: italic; font-size: smaller}
+.comDateCaption {font-weight: bold; font-style: normal;}
+
+.item {border: 1px solid #cccccc;}
+.itemHead {background-color: #E2DBD3; color: #666600; padding: 2px; font-weight: bold; text-align: left;}
+.itemInfo {text-align: right; padding: 3px; background-color: #efefef}
+.itemTitle a {font-size: 130%; font-weight: bold; font-variant: small-caps; color: #666600; background-color: transparent;}
+.itemPoster {font-size: 90%; font-style:italic;}
+.itemPostDate {font-size: 90%; font-style:italic;}
+.itemStats {font-size: 90%; font-style:italic;}
+.itemBody {padding-left: 5px; text-align: left}
+.itemText {margin-top: 5px; margin-bottom: 5px; line-height: 1.5em;}
+.itemText:first-letter {font-size: 133%; font-weight: bold;}
+.itemFoot {text-align: right; padding: 3px; background-color: #efefef}
+.itemAdminLink {font-size: 90%;}
+.itemPermaLink {font-size: 90%;}
+
+.blockTitle {background-color: #E2DBD3; color: #666600; padding: 2px; font-weight: bold}
+.blockContent {background-color: #efefef; padding: 2px;}
Index: /temp/test-xoops.ec-cube.net/html/themes/terms.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/themes/terms.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/themes/terms.html	(revision 405)
@@ -0,0 +1,68 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=EUC-JP" />
+<meta http-equiv="content-language" content="ja" />
+<title>EC-CUBE - ÍøÍÑµ¬Ìó</title>
+<link href="http://xoops.ec-cube.net/favicon.ico" rel="SHORTCUT ICON" />
+<link rel="stylesheet" type="text/css" media="screen" href="http://xoops.ec-cube.net/xoops.css" />
+<link rel="stylesheet" type="text/css" media="screen" href="http://xoops.ec-cube.net/themes/default/style.css" />
+</head>
+<body>
+	<table width="600" border="0" cellspacing="0" cellpadding="0" summary=" ">
+		<tr>
+			<td align="center"><span class="fs18">¡ÖEC-CUBE ¥³¥ß¥å¥Ë¥Æ¥£¥µ¥¤¥È¡×ÍøÍÑµ¬Ìó</td>
+		</tr>
+		<tr><td height="10"></td></tr>
+		<tr>
+			<td>ËÜµ¬Ìó¤Ï³ô¼°²ñ¼Ò¥í¥Ã¥¯¥ª¥ó¡Ê°Ê²¼¡Ö±¿±Ä¼Ô¡×¡Ë¤¬¡ÖEC-CUBE ¥³¥ß¥å¥Ë¥Æ¥£¥µ¥¤¥È¡×¡Ê°Ê²¼¡ÖËÜ¥µ¥¤¥È¡×¡Ë¤òÄÌ¤¸¤ÆÄó¶¡¤¹¤ë¥µ¡¼¥Ó¥¹¤ò¤´ÍøÍÑ¤µ¤ì¤ë¸Ä¿Í¤ª¤è¤ÓË¡¿Í¡Ê°Ê²¼¡ÖÍøÍÑ¼Ô¡×¡Ë¤ËÅ¬ÍÑ¤µ¤ì¡¢ÍøÍÑ¼Ô¤È±¿±Ä¼Ô¤È¤Î´Ö¤ËÅ¬ÍÑ¤µ¤ì¡¢ËÜ¥µ¡¼¥Ó¥¹¤ÎÍøÍÑ¤Ë´Ø¤·¤ÆÀ¸¤º¤ë¤¹¤Ù¤Æ¤Î´Ø·¸¤ËÅ¬ÍÑ¤µ¤ì¤ë¤â¤Î¤È¤·¤Þ¤¹¡£</td>
+		</tr>
+		<tr><td height="10"></td></tr>
+		<tr>
+			<td><span class="fs16">¢£¶Ø»ß¹Ô°Ù</span></td>
+		</tr>
+		<tr><td height="5"></td></tr>
+		<tr>
+			<td>
+			¡¦¸ø½øÎÉÂ¯¤ËÈ¿¤¹¤ë¹Ô°Ù<br />
+			¡¦Ë¡Îá¤Ë°ãÈ¿¤¹¤ë¹Ô°Ù<br />
+			¡¦ÈÈºá¹Ô°ÙµÚ¤ÓÈÈºá¹Ô°Ù¤Ë·ë¤Ó¤Ä¤¯¹Ô°Ù<br />
+			¡¦Â¾¤ÎÍøÍÑ¼Ô¡¢Âè»°¼Ô¡¢Åö¥µ¥¤¥È¤Î¸¢Íø¤ò¿¯³²¤¹¤ë¹Ô°Ù<br />
+			¡¦Â¾¤ÎÍøÍÑ¼Ô¡¢Âè»°¼Ô¡¢Åö¥µ¥¤¥È¤òÈðëî¡¢Ãæ½ý¤¹¤ë¹Ô°ÙµÚ¤ÓÌ¾ÍÀ¡¦¿®ÍÑ¤ò½ý¤Ä¤±¤ë¹Ô°Ù<br />
+			¡¦Â¾¤ÎÍøÍÑ¼Ô¡¢Âè»°¼Ô¡¢Åö¥µ¥¤¥È¤ËÉÔÍø±×¤òÍ¿¤¨¤ë¹Ô°Ù<br />
+			¡¦Åö¥µ¥¤¥È¤Î±¿±Ä¤òË¸³²¤¹¤ë¹Ô°Ù<br />
+			¡¦»ö¼Â¤Ç¤Ê¤¤¾ðÊó¤òÈ¯¿®¤¹¤ë¹Ô°Ù<br />
+			¡¦¥×¥é¥¤¥Ð¥·¡¼¿¯³²¤Î¶²¤ì¤Î¤¢¤ë¸Ä¿Í¾ðÊó¤ÎÅê¹Æ<br />
+			¡¦¤½¤ÎÂ¾¡¢Åö¥µ¥¤¥È¤¬ÉÔÅ¬Åö¤ÈÈ½ÃÇ¤¹¤ë¹Ô°Ù<br />
+			</td>
+		</tr>
+		<tr><td height="10"></td></tr>
+		<tr>
+			<td><span class="fs16">¢£ÌÈÀÕ»ö¹à</span></td>
+		</tr>
+		<tr><td height="5"></td></tr>
+		<tr>
+			<td>¡¦±¿±Ä¼Ô¤Ï¡¢ÍøÍÑ¼Ô¤¬Åö¥µ¥¤¥ÈµÚ¤ÓÅö¥µ¥¤¥È¤Ë´ØÏ¢¤¹¤ë¥³¥ó¥Æ¥ó¥Ä¡¢¥ê¥ó¥¯Àè¥µ¥¤¥È¤Ë¤ª¤±¤ë°ìÀÚ¤Î¥µ¡¼¥Ó¥¹Åù¤ò¤´ÍøÍÑ¤µ¤ì¤¿¤³¤È¤Ëµ¯°ø¤Þ¤¿¤Ï´ØÏ¢¤·¤ÆÀ¸¤¸¤¿°ìÀÚ¤ÎÂ»³²¡Ê´ÖÀÜÅª¤Ç¤¢¤ë¤ÈÄ¾ÀÜÅª¤Ç¤¢¤ë¤È¤òÌä¤ï¤Ê¤¤¡Ë¤Ë¤Ä¤¤¤Æ¡¢ÀÕÇ¤¤òÉé¤¤¤Þ¤»¤ó¡£ </td>
+		</tr>
+		<tr><td height="10"></td></tr>
+		<tr>
+			<td>¡¦±¿±Ä¼Ô¤Ï¡¢ËÜ¥µ¥¤¥È¤Ç¤ÎÍøÍÑ¼Ô¤«¤é¤Î¤´¼ÁÌä¤ËÂÐ¤·¤Æ¤Î¤´²óÅú¤òÊÝ¾ÚÃ×¤·¤Þ¤»¤ó¡£</td>
+		</tr>
+		<tr><td height="10"></td></tr>
+
+		<tr>
+			<td><span class="fs16">¢£Ãøºî¸¢</span></td>
+		</tr>
+		<tr><td height="5"></td></tr>
+		<tr>
+			<td>ËÜ¥µ¥¤¥È¤Ë¼ýÏ¿¤µ¤ì¤Æ¤¤¤ë¥³¥ó¥Æ¥ó¥ÄÊÂ¤Ó¤ËÅê¹ÆÆâÍÆÅù¤Î°ìÀÚ¤ÎÃøºî¸¢¤Ï¡¢³ô¼°²ñ¼Ò¥í¥Ã¥¯¥ª¥ó¤Ëµ¢Â°¤·¤Þ¤¹¡£¤´ÍøÍÑ¼Ô¸Ä¿Í¤ÇÍøÍÑ¤¹¤ë¤¿¤á¡¢¥À¥¦¥ó¥í¡¼¥É¤·¤¿¤ê¡¢¤´ÍøÍÑ¼Ô¸Ä¿Í¤Î¥Ñ¥½¥³¥ó¤Ë¥Ç¡¼¥¿ÊÝÂ¸¡¢¤Þ¤¿¤Ï¥×¥ê¥ó¥È¥¢¥¦¥È¤¹¤ë¤³¤È¤Ï¹½¤¤¤Þ¤»¤ó¤¬¡¢¤³¤ì¤òËÜ¥µ¥¤¥È°Ê³°¤ÎÂ¾¤Î¥¦¥§¥Ö¥µ¥¤¥È¤ä°õºþÇÞÂÎ¤ËÅ¾ºÜ¡¢Ê£À½¤ª¤è¤Ó¤´ÍøÍÑ¼Ô°Ê³°¤ÎÊý¤ËÈÒÉÛÅù¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£</td>
+		</tr>
+		<tr><td height="10"></td></tr>
+		<tr>
+			<td>ËÜµ¬Ìó¤ÎÆâÍÆ¤Ï»öÁ°¤ÎÄÌ¹ð¤Ê¤¯ÊÑ¹¹¤¹¤ë¤³¤È¤¬¤´¤¶¤¤¤Þ¤¹¤Î¤Ç¡¢¤´ÍøÍÑ¤ÎºÝ¤Ë¤ÏËÜ¥Ú¡¼¥¸¤Ë·ÇºÜ¤µ¤ì¤Æ¤¤¤ëºÇ¿·¤Î¥¬¥¤¥É¡ÊÍøÍÑµ¬Ìó¡Ë¤ò¤´Í÷¤¯¤À¤µ¤¤¡£ËÜ¥µ¥¤¥È¤ò¤´ÍøÍÑ¤Ë¤Ê¤Ã¤¿¾ì¹ç¤Ï¡¢¾åµ­¤Ë¤Ä¤¤¤ÆÆ±°Õ¤µ¤ì¤¿¤â¤Î¤È¸«¤Ê¤µ¤ì¤ë¤â¤Î¤È¤·¤Þ¤¹¡£¡Ê2006Ç¯9·î8Æü¡¡À©Äê¡Ë</td>
+		</tr>
+		<tr><td height="20"></td></tr>
+		<tr><td align="center"><input type="button" onClick="window.close()" value="ÊÄ¤¸¤ë"></td></tr>
+	</table>
+</body>
+</html>
Index: /temp/test-xoops.ec-cube.net/html/themes/x2t/theme_blockcenter_l.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/themes/x2t/theme_blockcenter_l.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/themes/x2t/theme_blockcenter_l.html	(revision 405)
@@ -0,0 +1,2 @@
+<div class="blockTitle"><{$block.title}></div>
+<div class="blockContent"><{$block.content}></div>
Index: /temp/test-xoops.ec-cube.net/html/themes/x2t/theme_blockcenter_r.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/themes/x2t/theme_blockcenter_r.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/themes/x2t/theme_blockcenter_r.html	(revision 405)
@@ -0,0 +1,2 @@
+<div class="blockTitle"><{$block.title}></div>
+<div class="blockContent"><{$block.content}></div>
Index: /temp/test-xoops.ec-cube.net/html/themes/x2t/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/themes/x2t/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/themes/x2t/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/themes/x2t/theme_blockcenter_c.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/themes/x2t/theme_blockcenter_c.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/themes/x2t/theme_blockcenter_c.html	(revision 405)
@@ -0,0 +1,8 @@
+<table width="100%" border="0" cellpadding="0" cellspacing="0">
+	<tr>
+		<td class="toprowleft"></td>
+		<td class="toprow"><{$block.title}></td>
+		<td class="toprowright"></td>
+	</tr>
+</table>
+<div class="blockContent"><{$block.content}></div>
Index: /temp/test-xoops.ec-cube.net/html/themes/x2t/style.css
===================================================================
--- /temp/test-xoops.ec-cube.net/html/themes/x2t/style.css	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/themes/x2t/style.css	(revision 405)
@@ -0,0 +1,278 @@
+/* General definitions */
+body {background-color: #fcfcfc; color: #000000; font-weight: normal; font-size: 12px; font-family: "Trebuchet MS",Verdana, Arial, Helvetica, sans-serif; margin: 0px; padding: 0px;}
+
+/* Specific definitions of general Tags */
+h1 {font-size: 20px;}
+h2 {font-size: 18px;}
+h3 {font-size: 16px;}
+h4 {font-size: 14px;}
+form {margin: 0px; padding: 0px;}
+ul {margin: 2px; padding: 2px; list-style: decimal inside; text-align: left;}
+li {margin-left: 2px; list-style: square inside; color: #000000; background-color: transparent;}
+b {font-weight: bold;}
+img {border: 0px;}
+a:link {color: #003399; text-decoration: none; font-weight: bold; background-color: transparent;}
+a:visited {color: #003399; text-decoration: none; font-weight: bold; background-color: transparent;}
+a:hover {color: #D68000; text-decoration: underline; background-color: transparent;}
+
+/* Only IE that not affect the other Browsers */
+*  {scrollbar-face-color: #E9E9E9; scrollbar-highlight-color: #ffffff; scrollbar-shadow-color: #E0E0E0; scrollbar-3dlight-color: #000000; scrollbar-arrow-color: #000000; scrollbar-track-color: #ffffff; scrollbar-darkshadow-color: #000000;}
+hr {height: 3px; border: 3px #D68000 solid; filter: Alpha(Opacity=100,FinishOpacity=10,Style=2); width: 95%;}
+
+/*Blocks side Definitions*/
+div.rightcolumn {font-size:11px; width: 170px;}
+td.rightcolumn {background-color: #f0f0f0; color: #000000;}
+div.rightcolumn div.blockContent {background-color: transparent; color: #000000; padding-top:5px; padding-left:5px; text-align:left;}
+div.rightcolumn div.blockTitle {background-color: transparent; color: #666666; padding-top: 3px; padding-right: 15px; font-size:12px; width: 170px; height: 20px; font-weight: bold; background: url('bg_right_blocktitle.gif'); text-align:center;}
+div.rightcolumn a:link {text-decoration: none; color: #000000; background-color: transparent;}
+div.rightcolumn a:visited {text-decoration: none; color: #000000; background-color: transparent;}
+div.rightcolumn a:hover {text-decoration: underline; color: #D68000; background-color: transparent;}
+
+div.leftcolumn {font-size:11px; width: 170px;}
+td.leftcolumn {border-right: #cccccc solid 1px; background-color: #f0f0f0; color: #000000;}
+div.leftcolumn div.blockTitle {background-color: transparent; color: #666666; padding-top: 3px; padding-left: 5px; font-size:12px; width: 170px; height: 20px; font-weight: bold; background: url('bg_left_blocktitle.gif'); text-align:center;}
+div.leftcolumn div.blockContent {background-color: transparent; color: #000000; padding-top: 5px; padding-left: 15px; text-align: left;}
+div.leftcolumn a:link {text-decoration: none; color: #000000; background-color: transparent;}
+div.leftcolumn a:visited {text-decoration: none; color :#000000; background-color: transparent;}
+div.leftcolumn a:hover {text-decoration: underline; color: #1778cb; background-color: transparent;}
+
+td.centercolumn {font-size: 12px; width: 100%;}
+div.centercolumn div.blockTitle {background-color: #f0f0f0; color: #000000; text-align: left; border: 1px solid #CCCCCC; font-weight: bold; padding: 1px; text-decoration: none; vertical-align: middle; }
+div.centercolumn div.blockContent {background-color: #ffffff; color: #000000; padding: 2px; text-align: left; border: 1px solid #CCCCCC; border-top: 0px ;}
+
+td.centerLcolumn {width: 50%; font-size: 12px;}
+div.centerLcolumn div.blockTitle {background-color: #f0f0f0; color: #000000; text-align: left; border: 1px solid #CCCCCC; font-weight: bold; padding: 1px; text-decoration: none; vertical-align: middle;}
+div.centerLcolumn div.blockContent {background-color: #ffffff; color: #000000; padding: 2px; text-align: left; border: 1px solid #CCCCCC; border-top: 0px ;}
+
+td.centerRcolumn {width: 50%; font-size: 12px;}
+div.centerRcolumn div.blockTitle {background-color: #f0f0f0; color: #000000; text-align: left; border: 1px solid #CCCCCC; font-weight: bold; padding: 1px; text-decoration: none; vertical-align: middle;}
+div.centerRcolumn div.blockContent {background-color: #ffffff; color: #000000; padding: 2px; text-align: left; border: 1px solid #CCCCCC; border-top: 0px ;}
+
+/* Dynamic menu */
+td#mainmenu a {background-color: #E0E0E0; margin: 0; border-top: 1px solid #F2F1F2; border-bottom: 1px solid #ADACAD; padding: 0;}
+td#mainmenu a:hover {background-color: #D1D0D1;text-decoration: none;}
+td#mainmenu a.menuTop {padding-left: 2px; border-top: 1px solid silver; border-right: 1px solid #666666; border-bottom: 1px solid #ADACAD; border-left: 1px solid silver;text-decoration: none;}
+td#mainmenu a.menuMain {padding-left: 2px; border-right: 1px solid #666666; border-bottom: 1px solid #ADACAD; border-left: 1px solid silver;text-decoration: none;}
+td#mainmenu a.menuSub {padding-left: 25px; background-color: #E7EAED; border-right: 1px solid #666666; border-bottom: 1px solid #ADACAD; border-left: 1px solid silver;text-decoration: none;}
+td#mainmenu a.menuSubadmin {padding-left: 25px; background-color: #eae3e7; border-right: 1px solid #666666; border-bottom: 1px solid #ADACAD; border-left: 1px solid silver;text-decoration: none;}
+
+td#usermenu a {background-color: #E0E0E0; margin: 0; border-top: 1px solid #F2F1F2; border-bottom: 1px solid #ADACAD; padding: 0;}
+td#usermenu a:hover {background-color: #D1D0D1;text-decoration: none;}
+td#usermenu a.menuTopTop {padding-left: 5px; border-top: 1px solid silver; border-right: 1px solid #666666; border-bottom: 1px solid #ADACAD; border-left: 1px solid silver;text-decoration: none;}
+td#usermenu a.menuTop {padding-left: 5px; border-right: 1px solid #666666; border-bottom: 1px solid #ADACAD; border-left: 1px solid silver;text-decoration: none;}
+td#usermenu a.menuTopadmin {padding-left: 5px; border-right: 1px solid #666666; border-bottom: 1px solid #ADACAD; border-left: 1px solid silver;text-decoration: none; background-color: #eae3e7;}
+td#usermenu a.highlight {padding-left: 5px;background-color: #fcc; border-right: 1px solid #666666; border-bottom: 1px solid #ADACAD; border-left: 1px solid silver;text-decoration: none;}
+
+/* Misc. Definitions */
+.navtext {font-size:10px; vertical-align: middle;}
+.navinput {width: 7em; height: 1.3em; font-size: 80%;  border:1px solid #000000; background-color: #E9E9E9; padding:0px 2px 0px 0px; vertical-align: middle;}
+.navinputImage {vertical-align: middle;}
+.bcenterbg {background: url('center_bg.gif'); font-size: 12px; font-weight: bold; height: 37px; letter-spacing: 1px; line-height:37px; vertical-align: bottom;}
+.bcenterleft {background: url('center_left.gif'); height: 37px; width: 11px;}
+.bcenterright {background: url('center_right.gif'); height: 37px; width: 175px;}
+.contentbox {background-color: #fcfcfc; color: #000000;}
+.centerContent {border-bottom: #cccccc 1px solid; background-color: #dee3e7; color: #000000;}
+.tabOn {padding: 2px; text-align:left; border-top: 1px solid #CCCCCC; border-left: 1px solid #CCCCCC; cursor: pointer; color: #000000; background-color: #FFFFFF; width: 120px;}
+.tabOff {padding: 2px; text-align:left; background-color: #F6F6F6; color: #666666; border-top: 1px solid #CCCCCC; border-left: 1px solid #CCCCCC; cursor: pointer; width: 120px;} 
+.outer {border: 1px solid silver;}
+.head {background-color: #c2cdd6; padding: 5px; font-weight: bold;}
+.even {background-color: #dee3e7; padding: 5px;}
+.odd {background-color: #E9E9E9; padding: 5px;}
+tr.even td {background-color: #dee3e7; padding: 5px;}
+tr.odd td {background-color: #E9E9E9; padding: 5px;}
+.foot {background-color: #c2cdd6; padding: 5px; font-weight: bold;}
+.copyright {font-size: 10px; background-color: transparent;}
+a.copyright {color: #003399; background-color:transparent;}
+a.copyright:hover {color: #C23030; text-decoration: underline; background-color:transparent;}
+th {background-color: #2F5376; color: #FFFFFF; padding: 2px; vertical-align: middle; font-family: Verdana, Arial, Helvetica, sans-serif;}
+#notifform {display: none;}
+
+/* Redirect messages */
+div.errorMsg { background-color: #FF3737; color: White; text-align: center; border-top: 1px solid #E9E9E9; border-left: 1px solid #E9E9E9; border-right: 1px solid #999999; border-bottom: 1px solid #999999; font-weight: bold; padding: 10px;}
+div.confirmMsg { background-color: #DDFFDF; color: #003399; text-align: center; border-top: 1px solid #E9E9E9; border-left: 1px solid #E9E9E9; border-right: 1px solid #999999; border-bottom: 1px solid #999999; font-weight: bold; padding: 10px;}
+div.resultMsg { background-color : #CCCCCC; color: Black; text-align: center; border-top: 1px solid silver; border-left: 1px solid silver; font-weight: bold; border-right: 1px solid #666666; border-bottom: 1px solid #666666; padding: 10px;}
+
+/* Comments Definitions */
+.comTitle {font-weight: bold; margin-bottom: 2px;}
+.comText {padding: 2px;}
+.comUserStat {font-size: 10px; color: #2F5376; font-weight:bold; border: 1px solid silver; background-color: #ffffff; margin: 2px; padding: 2px;}
+.comUserStatCaption {font-weight: normal;}
+.comUserStatus {margin-left: 2px; margin-top: 10px; color: #2F5376; font-weight:bold; font-size: 10px;}
+.comUserRank {margin: 2px;}
+.comUserRankText {font-size: 10px;font-weight:bold;}
+.comUserRankImg {border: 0;}
+.comUserName {border: 0;}
+.comUserImg {margin: 2px;}
+.comDate {font-weight: normal; font-style: italic; font-size: smaller}
+.comDateCaption {font-weight: bold; font-style: normal;}
+
+/*forms elements*/
+input.formButton {border: 1px solid #5E5D63; color: #000000; font-family: verdana, tahoma, arial, helvetica, sans-serif; font-size: 9px; text-align:center; background: url('inputbg.gif'); }
+textarea.formBox {border: #000000 1px solid; background: #ffffff; font: 11px verdana, arial, helvetica, sans-serif; }
+input.formTextBox {border: #000000 1px solid;background: #ffffff; font: 11px verdana, arial, helvetica, sans-serif; }
+select {border: #000000 1px solid;background: #ffffff; font: 10px verdana, arial, helvetica,sans-serif; }
+
+/* Content template definition */
+div.content {text-align: left; padding: 0px 10px 0px 10px;}
+
+/* Code and Quote Definition */
+div.xoopsCode {padding: 3px; font-size: 12px; color: #003399; background-color: #F6FAFD; border-right: #c2cdd6 1px dashed; border-top:  #c2cdd6 1px dashed; border-left: #c2cdd6 1px dashed; border-bottom: #c2cdd6 1px dashed;}
+div.xoopsQuote {padding: 3px; font-size: 12px; color: #003399; line-height: 125%; text-align: justify; background-color: #F6FAFD; border-right: #c2cdd6 1px dashed; border-top: #c2cdd6 1px dashed; border-left: #c2cdd6 1px dashed; border-bottom: #c2cdd6 1px dashed;}
+
+/* Links for Quotes */
+div.xoopsQuote a:link, div.xoopsQuote a:visited { color: Black; font-weight: bold; background-color: transparent; }
+div.xoopsQuote a:hover, div.xoopsQuote a:active { color: #1778cb; font-weight: bold; background-color: transparent; }
+
+/* News module definitions */
+td.newsTitle {border-right: #cccccc 1px; border-top: #cccccc 1px; border-left: #cccccc 1px; border-bottom: #cccccc 1px dashed; background-color: transparent; font-size: 18px; text-align: left; font-weight: bold; color: #2F5376; letter-spacing: -1.5px; margin: 0; line-height: 18px;}
+td.newsSubtitle {padding: 5px; border-right: #d0d0d0 1px solid; border-top: #d0d0d0 1px solid; border-left: #d0d0d0 1px solid; color: #666666; border-bottom: #d0d0d0 1px solid; background-color: #dfdfdf; font-size: 15px; text-align: left; font-weight: bold; letter-spacing: -1.5px; margin: 0; line-height: 15px;}
+td.newsSubSubtitle {padding: 3px; border-right: #d0d0d0 1px solid; border-top: #d0d0d0 1px solid; border-left: #d0d0d0 1px solid; color: #666666; border-bottom: #d0d0d0 1px solid; background-color: #eaeaea;}
+td.newsPoster {padding: 3px; border-right: #e0e0e0 1px solid; border-top: #e0e0e0 1px solid; border-left: #e0e0e0 1px solid; color: #666666; border-bottom: #e0e0e0 1px solid; background-color: #f6f6f6;}
+td.newsPoster a:link {color: #666666; text-decoration: none; font-weight: bold; background-color: transparent;}
+td.newsPoster a:visited {color: #666666; text-decoration: none; font-weight: bold; background-color: transparent;}
+td.newsPoster a:hover {color: #999999; text-decoration: underline; font-weight: bold; background-color: transparent;}
+td.commentsNav {padding: 3px; border-right: #e0e0e0 1px solid; border-top: #e0e0e0 1px solid; border-left: #e0e0e0 1px solid; color: #666666; border-bottom: #e0e0e0 1px solid; background-color: #f6f6f6;}
+span.textPoster {color: #999999; background-color: transparent;}
+td.newsMisc {background-color: #f6f6f6; border: 1px #e0e0e0 dashed;  padding: 10px;  text-align: center;}
+td.newsContent {padding-right: 5px; padding-left: 5px; padding-bottom: 5px; border-bottom: #cccccc 1px dashed; padding-top: 5px; border-top: #cccccc 1px dashed; font-size: 11px; background-color: #F9F9F9; color: #000000;}
+table.comments {background-color: #ffffff; color: #000000; border: 2px #2F5376 solid;}
+td.commentsHead {padding: 2px; color: #ffffff; background-color: #2F5376;}
+td.sCommentFoot {padding: 3px; border-bottom: #2F5376 1px solid; background-color: #c2cdd6;}
+.sCommentHead {border-right: #e0e0e0 1px solid;  border-left: #e0e0e0 1px solid; color: #666666; border-bottom: #e0e0e0 1px solid; background-color: #f6f6f6;}
+td.sCommentThread {color: #000000; border-bottom: #2F5376 1px solid; text-align: left; background-color: #dee3e7;}
+td.sCommentRank {border-top: #2F5376 1px solid; border-right: 1px #CCCCCC solid;  border-bottom: #2F5376 1px solid; padding: 10px;  text-align: left; background-color: #dee3e7; color: #000000;}
+td.sCommentText {padding-right: 5px; padding-left: 5px; padding-bottom: 5px; padding-top: 0px; font-size: 11px; background-color: #F5F5F5;  border-top: #2F5376 1px solid; border-bottom: #2F5376 1px solid; color: #000000;}
+
+/* system module definition */
+table.userinfo {border: 1px solid #2F5376;}
+td.uinfoHead {color: #ffffff; background-color: #2F5376; padding: 3px;}
+td.uinfoBody {color: #666666; background-color: #f6f6f6;}
+td.uinfoMain {padding: 3px; color: #666666; background-color: #c2cdd6;}
+tr.uinfoData {padding: 3px; background-color: #dee3e7; color: #000000;}
+tr.uinfoData a:link {color: #666666; text-decoration: none; font-weight: bold; background-color: transparent;}
+tr.uinfoData a:visited {color: #666666; text-decoration: none; font-weight: bold; background-color: transparent;}
+tr.uinfoData a:hover {color: #999999; text-decoration: underline; font-weight: bold; background-color: transparent;}
+
+/*Downloads class*/
+.info {padding: 3px;border: #e0e0e0 1px solid; color: #666666; background-color: #f6f6f6;}
+.info a:link {color: #666666; text-decoration: none; font-weight: bold; background-color: transparent;}
+.info a:visited {color: #666666; text-decoration: none; font-weight: bold; background-color: transparent;}
+.info a:hover {color: #999999; text-decoration: underline; font-weight: bold; background-color: transparent;}
+span.category  { font-size: 16px;}
+span.subcategories  { font-size: 11px;}
+span.bigtext  { font-size: 25px;}
+
+/* Forum class */
+.toprow {background: url('_toprow_bg.gif'); font-size: 12px; font-weight: bold; height: 23px; letter-spacing: 1px; line-height: 23px; text-align: center;}
+.toprowleft {background: url('_toprow_left.gif'); height: 23px; width: 14px;}
+.toprowright {background: url('_toprow_right.gif'); height: 23px; width: 14px;}
+.catrow {background: url('_cellpic_cat.gif'); color: #F6F6F6; font-weight: bold; height: 24px; letter-spacing: 1px; line-height: 24px; padding-left: 5px; padding-right: 5px; text-align: center; background-color: transparent;}
+.catrow a:link {color: #F6F6F6; text-decoration: none; font-weight: bold; background-color: transparent;}
+.catrow a:visited {color: #F6F6F6; text-decoration: none; font-weight: bold; background-color: transparent;}
+.catrow a:hover {color: #F6F6F6; text-decoration: underline; font-weight: bold; background-color: transparent;}
+.row1 {background-color: #F0F0F0; padding: 5px;}
+.row2 {background-color: #F9F9F9; padding: 5px;}
+.row3 {background-color: #f6f6f6; padding: 5px;}
+.small {font-size: 10px;}
+.spacer {background-color: #D1D0D1; height: 1px; width: 1px;}
+.footrow {background: url('_foot_bg.gif'); color: #FFFFFF; height: 7px; background-color: transparent;}
+.footrowleft {background: url('_foot_left.gif'); height: 7px; width: 6px;}
+.footrowright {background: url('_foot_right.gif'); height: 7px; width: 6px;}
+.row1top {background-color: #c2cdd6; padding: 5px;}
+.row2top {background-color: #dee3e7; padding: 5px;}
+.row1bot {background-color: #c2cdd6; padding: 5px;}
+.row2bot {background-color: #dee3e7; padding: 5px;}
+.dots {background: url('dots.gif'); height: 5px;}
+.moderate {padding: 3px; border: #e0e0e0 1px solid; background-color: #f6f6f6; text-align: left; width:98%;}
+.moderate a:link {color: #666666; text-decoration: none; font-weight: bold; background-color: transparent;}
+.moderate a:visited {color: #666666; text-decoration: none; font-weight: bold; background-color: transparent;}
+.moderate a:hover {color: #999999; text-decoration: underline; font-weight: bold; background-color: transparent;}
+
+/* for test only */
+table.subType {color: #000000; background-color: #FFFFFF; border-right: #AEBDC4 1px solid; border-top:#AEBDC4 1px solid; border-left:#AEBDC4 1px solid; border-bottom:#AEBDC4 1px solid;}
+td.lightRow {background-color: #F0F0F0; color: #000000;}
+
+/* texto para el td lightRow */
+.lightRow {font-size: 12px; text-decoration: none; color: #000000; background-color: transparent;}
+td.lightRow a:link {text-decoration: underline; color: #003399; background-color: transparent;}
+td.lightRow a:visited {text-decoration: underline; color: #003399; background-color: transparent;}
+td.lightRow a:hover {text-decoration: underline; color: #D68000; background-color: transparent;}
+
+td.mediumRow {background-color: #dee3e7; color: #000000;}
+
+/* texto para el td mediumRow */
+.mediumRow {font-size: 12px; text-decoration: none; color: #000000; background-color: transparent;}
+td.mediumRow a:link {text-decoration: underline; color: #003399; background-color: transparent;}
+td.mediumRow a:visited {text-decoration: underline; color: #003399; background-color: transparent;}
+td.mediumRow a:hover {text-decoration: underline; color: #D68000; background-color: transparent;}
+
+td.darkRow {background-color: #c2cdd6; color: #000000;         }
+
+/* text for td darkRow */
+.darkRow {font-size: 12px; text-decoration: none; color: #000000; background-color: transparent;}
+td.darkRow a:link {text-decoration: underline; color: #003399; background-color: transparent;}
+td.darkRow a:visited {text-decoration: underline; color: #003399; background-color: transparent;}
+td.darkRow a:hover {text-decoration: underline; color: #D68000; background-color: transparent;}
+
+/* blocks colors */
+.bdownloadr { background-color: #EDF4FB;padding: 2px;}
+.bdownloadt { background-color: #E6F0FA;padding: 2px;}
+.blinkr { background-color: #FFFAF9;padding: 2px;}
+.blinkt { background-color: #FFF3F0;padding: 2px;}
+.bnewsr { background-color: #F9FFF9;padding: 2px;}
+.bnewst { background-color: #F0FFF0;padding: 2px;}
+.bcust { background-color: #FFFFF4;padding: 2px;}
+.bfaqsr { background-color: #FFFBF4;padding: 2px;}
+.bfaqsrq { background-color: #FFF3DF;padding: 2px;}
+
+/* weBlog module */
+div.blogDate {background-color: #f6f6f6; border: 1px #e0e0e0 dashed;  padding: 2px;  text-align: right;margin-bottom: 12px;margin-top: 12px; font-style: italic;}
+div.blogTitle { color: #666666; border-bottom: #cccccc 1px dashed; background-color: transparent;margin-left: 20px; font-size: 150%;font-weight: bold;}
+div.blogContents {margin-left: 35px;padding: 5px;}
+div.blogFooter {padding: 3px; border: #e0e0e0 1px solid; color: #666666; background-color: #f6f6f6;font-size: 80%;}
+
+/* smartfaq module */
+.bfaqr { background-color: #F5F5FF;padding: 2px;}
+.xinfotitle {margin-top: 8px; color: #335380; margin-bottom: 8px; font-size: 18px; line-height: 18px; font-weight: bold; display: block;}
+.xinfotext  {color: #456; margin-bottom: 8px; line-height: 130%; display: block;}#335380
+.itemFoot {text-align: right; padding:3px; border:1px solid #808080; background-color: #fff; color: #000;}
+
+/* soapbox module */
+#mod_header { width: 100%; padding: 0; margin: 0; border-bottom: 1px solid #2F5376;}
+.col_header { width: 100%; padding: 0; margin: 0; border-top: 2px solid #2F5376;}
+.clean { width: 100%; padding: 0; margin: 0;}
+.clean99 { width: 99%; padding: 0; margin: 0 0 4px 0;}
+.h18px { font-size: 10px; line-height: 18px;}
+.h18right { font-size: 18px; text-align: right; font-weight: bold; color: #2F5376; letter-spacing: -1.5px; margin: 0; line-height: 18px;}
+.h3a { margin: 6px 0;}
+.h3b { margin: 8px 0 4px 0;}
+.h3c { margin: 0 0 6px 0; color: #2F5376;}
+.intro { color: #456; margin-top: 4px; margin-bottom: 12px;line-height: 130%; display: block;}
+.intro2	{ font-size: 12px; color: #456; margin: 4px 0 0 0; line-height: 150%;}
+.intro8 { color: #456; margin: 0px 8px 8px 8px; line-height: 130%; display: block; }
+.nocontent { background-color: #efefef; border: 1px solid silver; padding: 18px; margin-top: 12px; font-size: 12px;}
+.padded	{ padding: 24px;}
+.th6bot	{ margin-bottom: 6px;}
+.columnlink { font-size: 16px;}
+.rightfloater {	width: 150px; border: 1px solid #456; padding: 4px; margin: 0 0 8px 8px;float:right; }
+.clear { height: 0px;}
+.picleft { float:left; width: 80px; margin: 8px 10px 10px 0;}
+.pic { border: 1px solid black;	width: 80px;}
+.left {	background-color: #e7e7e7; width: 70%;padding-left: 4px; line-height: 24px;}
+.right { text-align: right; background-color: #e7e7e7;font-weight: bold; width: 30%; padding-right: 8px; line-height: 24px;}
+.subdate { font-size: 9px; color: #2F5376; margin-bottom: 8px;}
+.teaser	{ color: #456; line-height: 130%; margin: 0;}
+.coldesc { color: #456; margin: 6px 0; font-size: 11px; font-style: italic;}
+.coldesc8 { color: #456; margin: 6px 0; padding: 0 8px;font-size: 10px;}
+.nine {	font-size: 9px;	margin-bottom: 12px;}
+.nine2 { font-size: 9px; margin-bottom: 4px;}
+.art { border: 1px solid #ccc; margin-bottom: 8px;}
+.arttitle { margin-bottom: 4px; padding: 8px 8px 4px 8px;}
+li.box { list-style-position: outside; margin-left: 16px;}
+.smallpub { font-size: 9px; font-weight: normal; margin-bottom: 4px;}
+.pad18 { padding-left: 18px;}
+div.texto, div.texto p { color: #456; margin: 6px 0; line-height: 130%;}
+.storypic { display: block; margin-bottom: 12px;}
+.storynav { text-align: left; margin: 10px;}
+.colteaser {background-color: #efefef;padding: 12px; border: #e7e7e7; clear: right;}
+.iconlinks { padding: 5px; text-align: right; margin-right:3px;}
Index: /temp/test-xoops.ec-cube.net/html/themes/x2t/theme_blockleft.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/themes/x2t/theme_blockleft.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/themes/x2t/theme_blockleft.html	(revision 405)
@@ -0,0 +1,2 @@
+<div class="blockTitle"><{$block.title}></div>
+<div class="blockContent"><{$block.content}></div>
Index: /temp/test-xoops.ec-cube.net/html/themes/x2t/theme.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/themes/x2t/theme.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/themes/x2t/theme.html	(revision 405)
@@ -0,0 +1,154 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<{$xoops_langcode}>" lang="<{$xoops_langcode}>">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=<{$xoops_charset}>" />
+<meta http-equiv="content-language" content="<{$xoops_langcode}>" />
+<meta name="robots" content="<{$xoops_meta_robots}>" />
+<meta name="keywords" content="<{$xoops_meta_keywords}>" />
+<meta name="description" content="<{$xoops_meta_description}>" />
+<meta name="rating" content="<{$xoops_meta_rating}>" />
+<meta name="author" content="<{$xoops_meta_author}>" />
+<meta name="copyright" content="<{$xoops_meta_copyright}>" />
+<meta name="generator" content="XOOPS" />
+<title><{$xoops_sitename}> - <{$xoops_pagetitle}></title>
+<link href="<{$xoops_url}>/favicon.ico" rel="SHORTCUT ICON" />
+<link rel="stylesheet" type="text/css" media="screen" href="<{$xoops_url}>/xoops.css" />
+<link rel="stylesheet" type="text/css" media="screen" href="<{$xoops_themecss}>" />
+<!-- RMV: added module header -->
+<{$xoops_module_header}>
+<script type="text/javascript">
+<!--
+<{$xoops_js}>
+//-->
+</script>
+</head>
+<body>
+<!-- Start Header -->
+<table cellspacing="0" cellpadding="0" width="100%" border="0" style="background-color : #2F5376; color: #ffffff">
+  <tr>
+    <td height="70" width="150" valign="middle" align="left" rowspan="2">
+    <a href="<{$xoops_url}>"><img src="<{$xoops_imageurl}>logo.gif" alt="" /></a></td>
+<td valign="middle" align="center" width="100%">
+<{$xoops_banner}>
+</td></tr><tr>
+    <td width="100%" valign="bottom" align="right" class="navbar" >
+	<table border="0" cellpadding="1" cellspacing="0">
+	   <tr>
+         <td class="tabOff" onmouseover="this.className='tabOn';" onmouseout="this.className='tabOff';"><a href="<{$xoops_url}>">Home</a></td>
+         <td class="tabOff" onmouseover="this.className='tabOn';" onmouseout="this.className='tabOff';"><a href="http://xoopscube.org/modules/xhnewbb/">XOOPS Cube Forums</a></td>
+         <td class="tabOff" onmouseover="this.className='tabOn';" onmouseout="this.className='tabOff';"><a href="http://xoopscube.org/">XOOPS Cube Support</a></td>
+	   </tr>
+	</table>
+     </td>
+  </tr>
+</table>
+<!-- End Header -->
+<!-- Start Headerbar -->
+<table border="0" width="100%" cellspacing="0" cellpadding="0">
+        <tr>
+          <td width="10"><img src="<{$xoops_imageurl}>hbar_left.gif" width="10" height="23" alt="" /></td>
+          <td style="background-image: url(<{$xoops_imageurl}>hbar_middle.gif);" align="left">&nbsp;</td>
+<td width="15%" style="background-image: url(<{$xoops_imageurl}>hbar_middle.gif);" align="right">
+<form action="<{$xoops_url}>/search.php" method="post">
+        <input type="text" name="query" class="navinput" /><input type="hidden" name="action" value="results" /> <input class="navinputImage" type="image" src="<{$xoops_imageurl}>searchButton.gif" name="searchSubmit" />
+    </form></td>
+          <td width="10"><img src="<{$xoops_imageurl}>hbar_right.gif" width="10" height="23" alt="" /></td>
+        </tr>
+</table>
+<!-- End Headerbar -->
+
+    <table width="100%"  cellspacing="0" cellpadding="0" border="0">
+  <tr>
+         <td class="leftcolumn" valign="top" style="background-image: url(<{$xoops_imageurl}>bg_left.gif);"><div class="leftcolumn">
+        <!-- Start left blocks loop -->
+        <{foreach item=block from=$xoops_lblocks}>
+          <{include file="x2t/theme_blockleft.html"}>
+        <{/foreach}>
+        <!-- End left blocks loop -->
+         </div></td>
+         <td width="100%" valign="top" class="contentbox">
+
+         <!-- Display center blocks if any -->
+         <{if $xoops_showcblock == 1}>
+<br />
+<table width="98%" border="0" cellpadding="0" cellspacing="0" align="center">
+<tr>
+<td class="bcenterleft">&nbsp;</td>
+<td class="bcenterbg">&nbsp;</td>
+<td class="bcenterright">&nbsp;</td>
+</tr>
+</table>
+
+         <table width="98%" cellpadding="3" cellspacing="0" align="center" style="border-left: #cccccc 1px solid;border-right: #cccccc 1px solid;border-bottom: #cccccc 1px solid;">
+
+              <tr>
+                <td class="centerLcolumn" valign="top">
+                <div class="centerLcolumn">
+            <!-- Start center-left blocks loop -->
+              <{foreach item=block from=$xoops_clblocks}>
+                <{include file="x2t/theme_blockcenter_l.html"}>
+                <br />
+              <{/foreach}>
+            <!-- End center-left blocks loop -->
+                </div>
+               </td>
+                <td class="centerRcolumn" valign="top">
+                <div class="centerRcolumn">
+            <!-- Start center-right blocks loop -->
+              <{foreach item=block from=$xoops_crblocks}>
+                <{include file="x2t/theme_blockcenter_r.html"}>
+                <br />
+              <{/foreach}>
+            <!-- End center-right blocks loop -->
+                </div>
+       		   </td>
+              </tr>
+            </table>
+            <{/if}>
+            <!-- End display center blocks -->
+
+
+         <br />
+            <div class="content">
+              <{$xoops_contents}>
+            </div>
+         <br />
+         <table width="98%" cellpadding="3" cellspacing="0" align="center">
+             <tr>
+                <td class="centercolumn" valign="top" colspan="2">
+			<div class="centercolumn">
+			      <!-- Start center-center blocks loop -->
+			      <{foreach item=block from=$xoops_ccblocks}>
+			      <{include file="x2t/theme_blockcenter_c.html"}>
+			      <br />
+			      <{/foreach}>
+			      <!-- End center-center blocks loop -->
+			</div>
+                </td></tr>
+	   </table>
+	 </td>
+         <{if $xoops_showrblock == 1}>
+         <td class="rightcolumn" valign="top" align="right" style="background-image: url(<{$xoops_imageurl}>bg_right.gif);"><div class="rightcolumn">
+        <!-- Start right blocks loop -->
+        <{foreach item=block from=$xoops_rblocks}>
+          <{include file="x2t/theme_blockright.html"}>
+        <{/foreach}>
+        <!-- End right blocks loop -->
+         </div>
+         </td>
+<{else}>
+<td width="10" style="background-image: url(<{$xoops_imageurl}>bg_right2.gif);"><img src="<{$xoops_imageurl}>dummy.gif" width="10" height="10" alt="" /></td>
+<{/if}>
+   </tr>
+           <tr>
+          <td colspan="3" width="100%">
+
+<table border="0" width="100%" cellspacing="0" cellpadding="0">
+        <tr>
+          <td width="10"><img src="<{$xoops_imageurl}>hbar_left.gif" width="10" height="23" alt="" /></td>
+          <td style="background-image: url(<{$xoops_imageurl}>hbar_middle.gif);" align="center">&nbsp;<span class="copyright"><{$xoops_footer}></span></td>
+          <td width="10"><img src="<{$xoops_imageurl}>hbar_right.gif" width="10" height="23" alt="" /></td></tr>
+</table>
+</td></tr></table>
+</body>
+</html>
Index: /temp/test-xoops.ec-cube.net/html/themes/x2t/styleMAC.css
===================================================================
--- /temp/test-xoops.ec-cube.net/html/themes/x2t/styleMAC.css	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/themes/x2t/styleMAC.css	(revision 405)
@@ -0,0 +1,275 @@
+/* General definitions */
+body {background-color: #fcfcfc; color: #000000; font-weight: normal; font-size: 12px; font-family: "Trebuchet MS",Verdana, Arial, Helvetica, sans-serif; margin: 0px; padding: 0px;}
+
+/* Specific definitions of general Tags */
+h1 {font-size: 20px;}
+h2 {font-size: 18px;}
+h3 {font-size: 16px;}
+h4 {font-size: 14px;}
+form {margin: 0px; padding: 0px;}
+ul {margin: 2px; padding: 2px; list-style: decimal inside; text-align: left;}
+li {margin-left: 2px; list-style: square inside; color: #000000; background-color: transparent;}
+b {font-weight:bold;}
+img {border: 0px;}
+a:link {color: #003399; text-decoration: none; font-weight: bold; background-color: transparent;}
+a:visited {color: #003399; text-decoration: none; font-weight: bold; background-color: transparent;}
+a:hover {color: #D68000; text-decoration: underline; background-color: transparent;}
+hr {height: 3px; border: 3px #D68000 solid; width: 95%;}
+
+/*Blocks side Definitions*/
+div.rightcolumn {font-size:11px; width: 170px;}
+td.rightcolumn {background-color: #f0f0f0; color: #000000;}
+div.rightcolumn div.blockContent {background-color: transparent; color: #000000; padding-top:5px; padding-left:5px; text-align:left;}
+div.rightcolumn div.blockTitle {background-color: transparent; color: #666666; padding-top: 3px; padding-right: 15px; font-size:12px; width: 170px; height: 20px; font-weight: bold; background: url('bg_right_blocktitle.gif'); text-align:center;}
+div.rightcolumn a:link {text-decoration: none; color: #000000; background-color: transparent;}
+div.rightcolumn a:visited {text-decoration: none; color: #000000; background-color: transparent;}
+div.rightcolumn a:hover {text-decoration: underline; color: #D68000; background-color: transparent;}
+
+div.leftcolumn {font-size:11px; width: 170px;}
+td.leftcolumn {border-right: #cccccc solid 1px; background-color: #f0f0f0; color: #000000;}
+div.leftcolumn div.blockTitle {background-color: transparent; color: #666666; padding-top: 3px; padding-left: 5px; font-size:12px; width: 170px; height: 20px; font-weight: bold; background: url('bg_left_blocktitle.gif'); text-align:center;}
+div.leftcolumn div.blockContent {background-color: transparent; color: #000000; padding-top: 5px; padding-left: 15px; text-align: left;}
+div.leftcolumn a:link {text-decoration: none; color: #000000; background-color: transparent;}
+div.leftcolumn a:visited {text-decoration: none; color :#000000; background-color: transparent;}
+div.leftcolumn a:hover {text-decoration: underline; color: #1778cb; background-color: transparent;}
+
+td.centercolumn {font-size: 12px; width: 100%;}
+div.centercolumn div.blockTitle {background-color: #f0f0f0; color: #000000; text-align: left; border: 1px solid #CCCCCC; font-weight: bold; padding: 1px; text-decoration: none; vertical-align: middle; }
+div.centercolumn div.blockContent {background-color: #ffffff; color: #000000; padding: 2px; text-align: left; border: 1px solid #CCCCCC; border-top: 0px ;}
+
+td.centerLcolumn {width: 50%; font-size: 12px;}
+div.centerLcolumn div.blockTitle {background-color: #f0f0f0; color: #000000; text-align: left; border: 1px solid #CCCCCC; font-weight: bold; padding: 1px; text-decoration: none; vertical-align: middle;}
+div.centerLcolumn div.blockContent {background-color: #ffffff; color: #000000; padding: 2px; text-align: left; border: 1px solid #CCCCCC; border-top: 0px ;}
+
+td.centerRcolumn {width: 50%; font-size: 12px;}
+div.centerRcolumn div.blockTitle {background-color: #f0f0f0; color: #000000; text-align: left; border: 1px solid #CCCCCC; font-weight: bold; padding: 1px; text-decoration: none; vertical-align: middle;}
+div.centerRcolumn div.blockContent {background-color: #ffffff; color: #000000; padding: 2px; text-align: left; border: 1px solid #CCCCCC; border-top: 0px ;}
+
+/* Dynamic menu */
+td#mainmenu a {background-color: #E0E0E0; margin: 0; border-top: 1px solid #F2F1F2; border-bottom: 1px solid #ADACAD; padding: 0;}
+td#mainmenu a:hover {background-color: #D1D0D1;text-decoration: none;}
+td#mainmenu a.menuTop {padding-left: 2px; border-top: 1px solid silver; border-right: 1px solid #666666; border-bottom: 1px solid #ADACAD; border-left: 1px solid silver;text-decoration: none;}
+td#mainmenu a.menuMain {padding-left: 2px; border-right: 1px solid #666666; border-bottom: 1px solid #ADACAD; border-left: 1px solid silver;text-decoration: none;}
+td#mainmenu a.menuSub {padding-left: 25px; background-color: #E7EAED; border-right: 1px solid #666666; border-bottom: 1px solid #ADACAD; border-left: 1px solid silver;text-decoration: none;}
+td#mainmenu a.menuSubadmin {padding-left: 25px; background-color: #eae3e7; border-right: 1px solid #666666; border-bottom: 1px solid #ADACAD; border-left: 1px solid silver;text-decoration: none;}
+
+td#usermenu a {background-color: #E0E0E0; margin: 0; border-top: 1px solid #F2F1F2; border-bottom: 1px solid #ADACAD; padding: 0;}
+td#usermenu a:hover {background-color: #D1D0D1;text-decoration: none;}
+td#usermenu a.menuTopTop {padding-left: 5px; border-top: 1px solid silver; border-right: 1px solid #666666; border-bottom: 1px solid #ADACAD; border-left: 1px solid silver;text-decoration: none;}
+td#usermenu a.menuTop {padding-left: 5px; border-right: 1px solid #666666; border-bottom: 1px solid #ADACAD; border-left: 1px solid silver;text-decoration: none;}
+td#usermenu a.menuTopadmin {padding-left: 5px; border-right: 1px solid #666666; border-bottom: 1px solid #ADACAD; border-left: 1px solid silver;text-decoration: none; background-color: #eae3e7;}
+td#usermenu a.highlight {padding-left: 5px;background-color: #fcc; border-right: 1px solid #666666; border-bottom: 1px solid #ADACAD; border-left: 1px solid silver;text-decoration: none;}
+
+/* Misc. Definitions */
+.navtext {font-size:10px; vertical-align: middle;}
+.navinput {width: 7em; height: 1.3em; font-size: 80%;  border:1px solid #000000; background-color: #E9E9E9; padding:0px 2px 0px 0px; vertical-align: middle;}
+.navinputImage {vertical-align: middle;}
+.bcenterbg {background: url('center_bg.gif'); font-size: 12px; font-weight: bold; height: 37px; letter-spacing: 1px; line-height:37px; vertical-align: bottom;}
+.bcenterleft {background: url('center_left.gif'); height: 37px; width: 11px;}
+.bcenterright {background: url('center_right.gif'); height: 37px; width: 175px;}
+.contentbox {background-color: #fcfcfc; color: #000000;}
+.centerContent {border-bottom: #cccccc 1px solid; background-color: #dee3e7; color: #000000;}
+.tabOn {padding: 2px; text-align:left; border-top: 1px solid #CCCCCC; border-left: 1px solid #CCCCCC; cursor: pointer; color: #000000; background-color: #FFFFFF; width: 120px;}
+.tabOff {padding: 2px; text-align:left; background-color: #F6F6F6; color: #666666; border-top: 1px solid #CCCCCC; border-left: 1px solid #CCCCCC; cursor: pointer; width: 120px;} 
+.outer {border: 1px solid silver;}
+.head {background-color: #c2cdd6; padding: 5px; font-weight: bold;}
+.even {background-color: #dee3e7; padding: 5px;}
+.odd {background-color: #E9E9E9; padding: 5px;}
+tr.even td {background-color: #dee3e7; padding: 5px;}
+tr.odd td {background-color: #E9E9E9; padding: 5px;}
+.foot {background-color: #c2cdd6; padding: 5px; font-weight: bold;}
+.copyright {font-size:10px; background-color: transparent;}
+a.copyright {color: #003399; background-color:transparent;}
+a.copyright:hover {color: #C23030; text-decoration: underline; background-color:transparent;}
+th {background-color: #2F5376; color: #FFFFFF; padding:2px; vertical-align:middle; font-family: Verdana, Arial, Helvetica, sans-serif;}
+#notifform {display: none;}
+
+/* Redirect messages */
+div.errorMsg { background-color: #FF3737; color: White; text-align: center; border-top: 1px solid #E9E9E9; border-left: 1px solid #E9E9E9; border-right: 1px solid #999999; border-bottom: 1px solid #999999; font-weight: bold; padding: 10px;}
+div.confirmMsg { background-color: #DDFFDF; color: #003399; text-align: center; border-top: 1px solid #E9E9E9; border-left: 1px solid #E9E9E9; border-right: 1px solid #999999; border-bottom: 1px solid #999999; font-weight: bold; padding: 10px;}
+div.resultMsg { background-color : #CCCCCC; color: Black; text-align: center; border-top: 1px solid silver; border-left: 1px solid silver; font-weight: bold; border-right: 1px solid #666666; border-bottom: 1px solid #666666; padding: 10px;}
+
+/* Comments Definitions */
+.comTitle {font-weight: bold; margin-bottom: 2px;}
+.comText {padding: 2px;}
+.comUserStat {font-size: 10px; color: #2F5376; font-weight:bold; border: 1px solid silver; background-color: #ffffff; margin: 2px; padding: 2px;}
+.comUserStatCaption {font-weight: normal;}
+.comUserStatus {margin-left: 2px; margin-top: 10px; color: #2F5376; font-weight:bold; font-size: 10px;}
+.comUserRank {margin: 2px;}
+.comUserRankText {font-size: 10px;font-weight:bold;}
+.comUserRankImg {border: 0;}
+.comUserName {border: 0;}
+.comUserImg {margin: 2px;}
+.comDate {font-weight: normal; font-style: italic; font-size: smaller}
+.comDateCaption {font-weight: bold; font-style: normal;}
+
+/*forms elements*/
+input.formButton {border: 1px solid #5E5D63; color: #000000; font-family: verdana, tahoma, arial, helvetica, sans-serif; font-size: 9px; text-align:center; background: url('inputbg.gif'); }
+textarea.formBox {border: #000000 1px solid; background: #ffffff; font: 11px verdana, arial, helvetica, sans-serif; }
+input.formTextBox {border: #000000 1px solid;background: #ffffff; font: 11px verdana, arial, helvetica, sans-serif; }
+select {border: #000000 1px solid;background: #ffffff; font: 10px verdana, arial, helvetica,sans-serif; }
+
+/* Content template definition */
+div.content {text-align: left; padding: 0px 10px 0px 10px;}
+
+/* Code and Quote Definition */
+div.xoopsCode {padding: 3px; font-size: 12px; color: #003399; background-color: #F6FAFD; border-right: #c2cdd6 1px dashed; border-top:  #c2cdd6 1px dashed; border-left: #c2cdd6 1px dashed; border-bottom: #c2cdd6 1px dashed;}
+div.xoopsQuote {padding: 3px; font-size: 12px; color: #003399; line-height: 125%; text-align: justify; background-color: #F6FAFD; border-right: #c2cdd6 1px dashed; border-top: #c2cdd6 1px dashed; border-left: #c2cdd6 1px dashed; border-bottom: #c2cdd6 1px dashed;}
+
+/* Links for Quotes */
+div.xoopsQuote a:link, div.xoopsQuote a:visited { color: Black; font-weight: bold; background-color: transparent; }
+div.xoopsQuote a:hover, div.xoopsQuote a:active { color: #1778cb; font-weight: bold; background-color: transparent; }
+
+/* News module definitions */
+td.newsTitle {border-right: #cccccc 1px; border-top: #cccccc 1px; border-left: #cccccc 1px; border-bottom: #cccccc 1px dashed; background-color: transparent; font-size: 18px; text-align: left; font-weight: bold; color: #2F5376; letter-spacing: -1.5px; margin: 0; line-height: 18px;}
+td.newsSubtitle {padding: 5px; border-right: #d0d0d0 1px solid; border-top: #d0d0d0 1px solid; border-left: #d0d0d0 1px solid; color: #666666; border-bottom: #d0d0d0 1px solid; background-color: #dfdfdf; font-size: 15px; text-align: left; font-weight: bold; letter-spacing: -1.5px; margin: 0; line-height: 15px;}
+td.newsSubSubtitle {padding: 3px; border-right: #d0d0d0 1px solid; border-top: #d0d0d0 1px solid; border-left: #d0d0d0 1px solid; color: #666666; border-bottom: #d0d0d0 1px solid; background-color: #eaeaea;}
+td.newsPoster {padding: 3px; border-right: #e0e0e0 1px solid; border-top: #e0e0e0 1px solid; border-left: #e0e0e0 1px solid; color: #666666; border-bottom: #e0e0e0 1px solid; background-color: #f6f6f6;}
+td.newsPoster a:link {color: #666666; text-decoration: none; font-weight: bold; background-color: transparent;}
+td.newsPoster a:visited {color: #666666; text-decoration: none; font-weight: bold; background-color: transparent;}
+td.newsPoster a:hover {color: #999999; text-decoration: underline; font-weight: bold; background-color: transparent;}
+td.commentsNav {padding: 3px; border-right: #e0e0e0 1px solid; border-top: #e0e0e0 1px solid; border-left: #e0e0e0 1px solid; color: #666666; border-bottom: #e0e0e0 1px solid; background-color: #f6f6f6;}
+span.textPoster {color: #999999; background-color: transparent;}
+td.newsMisc {background-color: #f6f6f6; border: 1px #e0e0e0 dashed;  padding: 10px;  text-align: center;}
+td.newsContent {padding-right: 5px; padding-left: 5px; padding-bottom: 5px; border-bottom: #cccccc 1px dashed; padding-top: 5px; border-top: #cccccc 1px dashed; font-size: 11px; background-color: #F9F9F9; color: #000000;}
+table.comments {background-color: #ffffff; color: #000000; border: 2px #2F5376 solid;}
+td.commentsHead {padding: 2px; color: #ffffff; background-color: #2F5376;}
+td.sCommentFoot {padding: 3px; border-bottom: #2F5376 1px solid; background-color: #c2cdd6;}
+.sCommentHead {border-right: #e0e0e0 1px solid;  border-left: #e0e0e0 1px solid; color: #666666; border-bottom: #e0e0e0 1px solid; background-color: #f6f6f6;}
+td.sCommentThread {color: #000000; border-bottom: #2F5376 1px solid; text-align: left; background-color: #dee3e7;}
+td.sCommentRank {border-top: #2F5376 1px solid; border-right: 1px #CCCCCC solid;  border-bottom: #2F5376 1px solid; padding: 10px;  text-align: left; background-color: #dee3e7; color: #000000;}
+td.sCommentText {padding-right: 5px; padding-left: 5px; padding-bottom: 5px; padding-top: 0px; font-size: 11px; background-color: #F5F5F5;  border-top: #2F5376 1px solid; border-bottom: #2F5376 1px solid; color: #000000;}
+
+/* system module definition */
+table.userinfo {border: 1px solid #2F5376;}
+td.uinfoHead {color: #ffffff; background-color: #2F5376; padding: 3px;}
+td.uinfoBody {color: #666666; background-color: #f6f6f6;}
+td.uinfoMain {padding: 3px; color: #666666; background-color: #c2cdd6;}
+tr.uinfoData {padding: 3px; background-color: #dee3e7; color: #000000;}
+tr.uinfoData a:link {color: #666666; text-decoration: none; font-weight: bold; background-color: transparent;}
+tr.uinfoData a:visited {color: #666666; text-decoration: none; font-weight: bold; background-color: transparent;}
+tr.uinfoData a:hover {color: #999999; text-decoration: underline; font-weight: bold; background-color: transparent;}
+
+/*Downloads class*/
+.info {padding: 3px;border: #e0e0e0 1px solid; color: #666666; background-color: #f6f6f6;}
+.info a:link {color: #666666; text-decoration: none; font-weight: bold; background-color: transparent;}
+.info a:visited {color: #666666; text-decoration: none; font-weight: bold; background-color: transparent;}
+.info a:hover {color: #999999; text-decoration: underline; font-weight: bold; background-color: transparent;}
+span.category  { font-size: 16px;}
+span.subcategories  { font-size: 11px;}
+span.bigtext  { font-size: 25px;}
+
+/* Forum class */
+.toprow {background: url('_toprow_bg.gif'); font-size: 12px; font-weight: bold; height: 23px; letter-spacing: 1px; line-height: 23px; text-align: center;}
+.toprowleft {background: url('_toprow_left.gif'); height: 23px; width: 14px;}
+.toprowright {background: url('_toprow_right.gif'); height: 23px; width: 14px;}
+.catrow {background: url('_cellpic_cat.gif'); color: #F6F6F6; font-weight: bold; height: 24px; letter-spacing: 1px; line-height: 24px; padding-left: 5px; padding-right: 5px; text-align: center; background-color: transparent;}
+.catrow a:link {color: #F6F6F6; text-decoration: none; font-weight: bold; background-color: transparent;}
+.catrow a:visited {color: #F6F6F6; text-decoration: none; font-weight: bold; background-color: transparent;}
+.catrow a:hover {color: #F6F6F6; text-decoration: underline; font-weight: bold; background-color: transparent;}
+.row1 {background-color: #F0F0F0; padding: 5px;}
+.row2 {background-color: #F9F9F9; padding: 5px;}
+.row3 {background-color: #f6f6f6; padding: 5px;}
+.small {font-size: 10px;}
+.spacer {background-color: #D1D0D1; height: 1px; width: 1px;}
+.footrow {background: url('_foot_bg.gif'); color: #FFFFFF; height: 7px; background-color: transparent;}
+.footrowleft {background: url('_foot_left.gif'); height: 7px; width: 6px;}
+.footrowright {background: url('_foot_right.gif'); height: 7px; width: 6px;}
+.row1top {background-color: #c2cdd6; padding: 5px;}
+.row2top {background-color: #dee3e7; padding: 5px;}
+.row1bot {background-color: #c2cdd6; padding: 5px;}
+.row2bot {background-color: #dee3e7; padding: 5px;}
+.dots {background: url('dots.gif'); height: 5px;}
+.moderate {padding: 3px; border: #e0e0e0 1px solid; background-color: #f6f6f6; text-align: left; width:98%;}
+.moderate a:link {color: #666666; text-decoration: none; font-weight: bold; background-color: transparent;}
+.moderate a:visited {color: #666666; text-decoration: none; font-weight: bold; background-color: transparent;}
+.moderate a:hover {color: #999999; text-decoration: underline; font-weight: bold; background-color: transparent;}
+
+/* for test only */
+table.subType {color: #000000; background-color: #FFFFFF; border-right: #AEBDC4 1px solid; border-top:#AEBDC4 1px solid; border-left:#AEBDC4 1px solid; border-bottom:#AEBDC4 1px solid;}
+td.lightRow {background-color: #F0F0F0; color: #000000;}
+
+        /* texto para el td lightRow */
+.lightRow {font-size:12px; text-decoration:none; color:#000000; background-color: transparent;}
+td.lightRow a:link {text-decoration: underline; color:#003399; background-color: transparent;}
+td.lightRow a:visited {text-decoration: underline; color:#003399; background-color: transparent;}
+td.lightRow a:hover {text-decoration: underline; color:#D68000; background-color: transparent;}
+
+td.mediumRow {background-color: #dee3e7; color: #000000;}
+
+/* texto para el td mediumRow */
+.mediumRow {font-size:12px; text-decoration:none; color:#000000; background-color: transparent;}
+td.mediumRow a:link {text-decoration: underline; color:#003399; background-color: transparent;}
+td.mediumRow a:visited {text-decoration: underline; color:#003399; background-color: transparent;}
+td.mediumRow a:hover {text-decoration: underline; color:#D68000; background-color: transparent;}
+
+td.darkRow {background-color: #c2cdd6; color: #000000;}
+
+/* text for td darkRow */
+.darkRow {font-size:12px; text-decoration:none; color:#000000; background-color: transparent;}
+td.darkRow a:link {text-decoration: underline; color:#003399; background-color: transparent;}
+td.darkRow a:visited {text-decoration: underline; color:#003399; background-color: transparent;}
+td.darkRow a:hover {text-decoration: underline; color:#D68000; background-color: transparent;}
+
+/* blocks colors */
+.bdownloadr { background-color: #EDF4FB;padding: 2px;}
+.bdownloadt { background-color: #E6F0FA;padding: 2px;}
+.blinkr { background-color: #FFFAF9;padding: 2px;}
+.blinkt { background-color: #FFF3F0;padding: 2px;}
+.bnewsr { background-color: #F9FFF9;padding: 2px;}
+.bnewst { background-color: #F0FFF0;padding: 2px;}
+.bcust { background-color: #FFFFF4;padding: 2px;}
+.bfaqsr { background-color: #FFFBF4;padding: 2px;}
+.bfaqsrq { background-color: #FFF3DF;padding: 2px;}
+
+/* weBlog module */
+div.blogDate {background-color: #f6f6f6; border: 1px #e0e0e0 dashed;  padding: 2px;  text-align: right;margin-bottom: 12px;margin-top: 12px; font-style: italic;}
+div.blogTitle { color: #666666; border-bottom: #cccccc 1px dashed; background-color: transparent;margin-left: 20px; font-size: 150%;font-weight: bold;}
+div.blogContents {margin-left: 35px;padding: 5px;}
+div.blogFooter {padding: 3px; border: #e0e0e0 1px solid; color: #666666; background-color: #f6f6f6;font-size: 80%;}
+
+/* smartfaq module */
+.bfaqr { background-color: #F5F5FF;padding: 2px;}
+.xinfotitle {margin-top: 8px; color: #335380; margin-bottom: 8px; font-size: 18px; line-height: 18px; font-weight: bold; display: block;}
+.xinfotext  {color: #456; margin-bottom: 8px; line-height: 130%; display: block;}#335380
+.itemFoot {text-align: right; padding:3px; border:1px solid #808080; background-color: #fff; color: #000;}
+
+/* soapbox module */
+#mod_header { width: 100%; padding: 0; margin: 0; border-bottom: 1px solid #2F5376;}
+.col_header { width: 100%; padding: 0; margin: 0; border-top: 2px solid #2F5376;}
+.clean { width: 100%; padding: 0; margin: 0;}
+.clean99 { width: 99%; padding: 0; margin: 0 0 4px 0;}
+.h18px { font-size: 10px; line-height: 18px;}
+.h18right { font-size: 18px; text-align: right; font-weight: bold; color: #2F5376; letter-spacing: -1.5px; margin: 0; line-height: 18px;}
+.h3a { margin: 6px 0;}
+.h3b { margin: 8px 0 4px 0;}
+.h3c { margin: 0 0 6px 0; color: #2F5376;}
+.intro { color: #456; margin-top: 4px; margin-bottom: 12px;line-height: 130%; display: block;}
+.intro2	{ font-size: 12px; color: #456; margin: 4px 0 0 0; line-height: 150%;}
+.intro8 { color: #456; margin: 0px 8px 8px 8px; line-height: 130%; display: block; }
+.nocontent { background-color: #efefef; border: 1px solid silver; padding: 18px; margin-top: 12px; font-size: 12px;}
+.padded	{ padding: 24px;}
+.th6bot	{ margin-bottom: 6px;}
+.columnlink { font-size: 16px;}
+.rightfloater {	width: 150px; border: 1px solid #456; padding: 4px; margin: 0 0 8px 8px;float:right; }
+.clear { height: 0px;}
+.picleft { float:left; width: 80px; margin: 8px 10px 10px 0;}
+.pic { border: 1px solid black;	width: 80px;}
+.left {	background-color: #e7e7e7; width: 70%;padding-left: 4px; line-height: 24px;}
+.right { text-align: right; background-color: #e7e7e7;font-weight: bold; width: 30%; padding-right: 8px; line-height: 24px;}
+.subdate { font-size: 9px; color: #2F5376; margin-bottom: 8px;}
+.teaser	{ color: #456; line-height: 130%; margin: 0;}
+.coldesc { color: #456; margin: 6px 0; font-size: 11px; font-style: italic;}
+.coldesc8 { color: #456; margin: 6px 0; padding: 0 8px;font-size: 10px;}
+.nine {	font-size: 9px;	margin-bottom: 12px;}
+.nine2 { font-size: 9px; margin-bottom: 4px;}
+.art { border: 1px solid #ccc; margin-bottom: 8px;}
+.arttitle { margin-bottom: 4px; padding: 8px 8px 4px 8px;}
+li.box { list-style-position: outside; margin-left: 16px;}
+.smallpub { font-size: 9px; font-weight: normal; margin-bottom: 4px;}
+.pad18 { padding-left: 18px;}
+div.texto, div.texto p { color: #456; margin: 6px 0; line-height: 130%;}
+.storypic { display: block; margin-bottom: 12px;}
+.storynav { text-align: left; margin: 10px;}
+.colteaser {background-color: #efefef;padding: 12px; border: #e7e7e7; clear: right;}
+.iconlinks { padding: 5px; text-align: right; margin-right:3px;}
Index: /temp/test-xoops.ec-cube.net/html/themes/x2t/theme_blockright.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/themes/x2t/theme_blockright.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/themes/x2t/theme_blockright.html	(revision 405)
@@ -0,0 +1,2 @@
+<div class="blockTitle"><{$block.title}></div>
+<div class="blockContent"><{$block.content}></div>
Index: /temp/test-xoops.ec-cube.net/html/themes/x2t/styleNN.css
===================================================================
--- /temp/test-xoops.ec-cube.net/html/themes/x2t/styleNN.css	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/themes/x2t/styleNN.css	(revision 405)
@@ -0,0 +1,275 @@
+/* General definitions */
+body {background-color: #fcfcfc; color: #000000; font-weight: normal; font-size: 12px; font-family: "Trebuchet MS",Verdana, Arial, Helvetica, sans-serif; margin: 0px; padding: 0px;}
+
+/* Specific definitions of general Tags */
+h1 {font-size: 20px;}
+h2 {font-size: 18px;}
+h3 {font-size: 16px;}
+h4 {font-size: 14px;}
+form {margin: 0px;  padding: 0px;}
+ul {margin: 2px;  padding: 2px;  list-style: decimal inside;  text-align: left;}
+li {margin-left: 2px;  list-style: square inside;  color: #000000; background-color: transparent;}
+b {font-weight : bold;}
+img {border: 0px;}
+a:link {color: #003399;  text-decoration: none;  font-weight: bold; background-color: transparent;}
+a:visited {color: #003399;  text-decoration: none;  font-weight: bold; background-color: transparent;}
+a:hover {color: #D68000;  text-decoration: underline; background-color: transparent;}
+hr {height: 1px; #D68000 solid; width: 95%;}
+
+/*Blocks side Definitions*/
+div.rightcolumn {font-size:11px; width: 185px;}
+td.rightcolumn {border-left: #cccccc solid 1px;background-color: #f0f0f0;  color: #000000;}
+div.rightcolumn div.blockContent {background-color: transparent; color: #000000; padding-top:5px; padding-left:5px; padding-right: 15px;text-align:left;}
+div.rightcolumn div.blockTitle {background-color: transparent; color: #666666; padding-top: 3px; padding-right: 15px; font-size:12px; width: 170px; height: 20px; font-weight: bold; background: url('bg_right_blocktitle.gif'); text-align:center;}
+div.rightcolumn a:link {text-decoration: none; color: #000000; background-color: transparent;}
+div.rightcolumn a:visited {text-decoration: none; color: #000000; background-color: transparent;}
+div.rightcolumn a:hover {text-decoration: underline; color: #D68000; background-color: transparent;}
+
+div.leftcolumn {font-size:11px; width: 185px;}
+td.leftcolumn {border-right: #cccccc solid 1px; background-color: #f0f0f0; color: #000000;}
+div.leftcolumn div.blockTitle {background-color: transparent; color: #666666; padding-top: 3px; padding-left: 3px; font-size:12px; width: 185px; height: 20px; font-weight: bold; background: url('bg_left_blocktitle.gif'); text-align:center;}
+div.leftcolumn div.blockContent {background-color: transparent; color: #000000; padding-top: 5px; padding-left: 15px;padding-right: 2px; text-align: left;}
+div.leftcolumn a:link {text-decoration: none; color: #000000; background-color: transparent;}
+div.leftcolumn a:visited {text-decoration: none; color :#000000; background-color: transparent;}
+div.leftcolumn a:hover {text-decoration: underline; color: #1778cb; background-color: transparent;}
+
+td.centercolumn {font-size: 12px; width: 100%;}
+div.centercolumn div.blockTitle {background-color: #f0f0f0; color: #000000; text-align: left; border: 1px solid #CCCCCC; font-weight: bold; padding: 1px; text-decoration: none; vertical-align: middle; }
+div.centercolumn div.blockContent {background-color: #ffffff; color: #000000; padding: 2px; text-align: left; border: 1px solid #CCCCCC; border-top: 0px ;}
+
+td.centerLcolumn {width: 50%; font-size: 12px;}
+div.centerLcolumn div.blockTitle {background-color: #f0f0f0; color: #000000; text-align: left; border: 1px solid #CCCCCC; font-weight: bold; padding: 1px; text-decoration: none; vertical-align: middle;}
+div.centerLcolumn div.blockContent {background-color: #ffffff; color: #000000; padding: 2px; text-align: left; border: 1px solid #CCCCCC; border-top: 0px ;}
+
+td.centerRcolumn {width: 50%; font-size: 12px;}
+div.centerRcolumn div.blockTitle {background-color: #f0f0f0; color: #000000; text-align: left; border: 1px solid #CCCCCC; font-weight: bold; padding: 1px; text-decoration: none; vertical-align: middle;}
+div.centerRcolumn div.blockContent {background-color: #ffffff; color: #000000; padding: 2px; text-align: left; border: 1px solid #CCCCCC; border-top: 0px ;}
+
+/* Dynamic menu */
+td#mainmenu a {background-color: #E0E0E0; margin: 0; border-top: 1px solid #F2F1F2; border-bottom: 1px solid #ADACAD; padding: 0;}
+td#mainmenu a:hover {background-color: #D1D0D1;text-decoration: none;}
+td#mainmenu a.menuTop {padding-left: 2px; border-top: 1px solid silver; border-right: 1px solid #666666; border-bottom: 1px solid #ADACAD; border-left: 1px solid silver;text-decoration: none;}
+td#mainmenu a.menuMain {padding-left: 2px; border-right: 1px solid #666666; border-bottom: 1px solid #ADACAD; border-left: 1px solid silver;text-decoration: none;}
+td#mainmenu a.menuSub {padding-left: 25px; background-color: #E7EAED; border-right: 1px solid #666666; border-bottom: 1px solid #ADACAD; border-left: 1px solid silver;text-decoration: none;}
+td#mainmenu a.menuSubadmin {padding-left: 25px; background-color: #eae3e7; border-right: 1px solid #666666; border-bottom: 1px solid #ADACAD; border-left: 1px solid silver;text-decoration: none;}
+
+td#usermenu a {background-color: #E0E0E0; margin: 0; border-top: 1px solid #F2F1F2; border-bottom: 1px solid #ADACAD; padding: 0;}
+td#usermenu a:hover {background-color: #D1D0D1;text-decoration: none;}
+td#usermenu a.menuTopTop {padding-left: 5px; border-top: 1px solid silver; border-right: 1px solid #666666; border-bottom: 1px solid #ADACAD; border-left: 1px solid silver;text-decoration: none;}
+td#usermenu a.menuTop {padding-left: 5px; border-right: 1px solid #666666; border-bottom: 1px solid #ADACAD; border-left: 1px solid silver;text-decoration: none;}
+td#usermenu a.menuTopadmin {padding-left: 5px; border-right: 1px solid #666666; border-bottom: 1px solid #ADACAD; border-left: 1px solid silver;text-decoration: none; background-color: #eae3e7;}
+td#usermenu a.highlight {padding-left: 5px;background-color: #fcc; border-right: 1px solid #666666; border-bottom: 1px solid #ADACAD; border-left: 1px solid silver;text-decoration: none;}
+
+/* Misc. Definitions */
+.navtext {font-size:10px;  font-family:Arial, Sans-serif;}
+.navinput {width: 7em; height: 1.3em; font-size: 80%;  border:1px solid #000000; background-color: #E9E9E9; padding:0px 2px 0px 0px; vertical-align: middle;}
+.navinputImage {vertical-align: middle;  }
+.bcenterbg {background: url('center_bg.gif'); font-size: 12px; font-weight: bold; height: 37px; letter-spacing: 1px; line-height:37px; vertical-align: bottom;}
+.bcenterleft {background: url('center_left.gif'); height: 37px; width: 11px;}
+.bcenterright {background: url('center_right.gif'); height: 37px; width: 175px;}
+.contentbox {background-color: #fcfcfc;  color: #000000;  }
+.centerContent {border-bottom: #cccccc 1px solid;  background-color: #dee3e7;  color: #000000;}
+.tabOn {padding: 2px; text-align:left; border-top: 1px solid #CCCCCC; border-left: 1px solid #CCCCCC; cursor: pointer; color: #000000; background-color: #FFFFFF; width: 120px;}
+.tabOff {padding: 2px; text-align:left; background-color: #F6F6F6; color: #666666; border-top: 1px solid #CCCCCC; border-left: 1px solid #CCCCCC; cursor: pointer; width: 120px;} 
+.outer {border: 1px solid silver;}
+.head {background-color: #c2cdd6;  padding: 5px;  font-weight: bold;}
+.even {background-color: #dee3e7; padding: 5px;}
+.odd {background-color: #E9E9E9; padding: 5px;}
+tr.even td {background-color: #dee3e7; padding: 5px;}
+tr.odd td {background-color: #E9E9E9; padding: 5px;}
+.foot {background-color: #c2cdd6;  padding: 5px;  font-weight: bold;}
+.copyright {font-size : 10px;  background-color: transparent;}
+a.copyright {color: #003399; background-color:transparent;}
+a.copyright:hover {color: #C23030;  text-decoration: underline;  background-color:transparent;}
+th {background-color: #2F5376;  color: #FFFFFF;  padding : 2px;  vertical-align : middle;  font-family: Verdana, Arial, Helvetica, sans-serif;}
+#notifform {display: none;}
+
+/* Redirect messages */
+div.errorMsg { background-color: #FF3737; color: White; text-align: center; border-top: 1px solid #E9E9E9; border-left: 1px solid #E9E9E9; border-right: 1px solid #999999; border-bottom: 1px solid #999999; font-weight: bold; padding: 10px;}
+div.confirmMsg { background-color: #DDFFDF; color: #003399; text-align: center; border-top: 1px solid #E9E9E9; border-left: 1px solid #E9E9E9; border-right: 1px solid #999999; border-bottom: 1px solid #999999; font-weight: bold; padding: 10px;}
+div.resultMsg { background-color : #CCCCCC; color: Black; text-align: center; border-top: 1px solid silver; border-left: 1px solid silver; font-weight: bold; border-right: 1px solid #666666; border-bottom: 1px solid #666666; padding: 10px;}
+
+/* Comments Definitions */
+.comTitle {font-weight: bold; margin-bottom: 2px;}
+.comText {padding: 2px;}
+.comUserStat {font-size: 10px; color: #2F5376; font-weight:bold; border: 1px solid silver; background-color: #ffffff; margin: 2px; padding: 2px;}
+.comUserStatCaption {font-weight: normal;}
+.comUserStatus {margin-left: 2px; margin-top: 10px; color: #2F5376; font-weight:bold; font-size: 10px;}
+.comUserRank {margin: 2px;}
+.comUserRankText {font-size: 10px;font-weight:bold;}
+.comUserRankImg {border: 0;}
+.comUserName {border: 0;}
+.comUserImg {margin: 2px;}
+.comDate {font-weight: normal; font-style: italic; font-size: smaller}
+.comDateCaption {font-weight: bold; font-style: normal;}
+
+/*forms elements*/
+input.formButton {border: 1px solid #5E5D63; color: #000000; font-family: verdana, tahoma, arial, helvetica, sans-serif; font-size: 9px; text-align:center;background: url('inputbg.gif');}
+textarea.formBox {border: #000000 1px solid; background: #ffffff; font: 11px verdana, arial, helvetica, sans-serif; }
+input.formTextBox {border: #000000 1px solid;background: #ffffff; font: 11px verdana, arial, helvetica, sans-serif; }
+select {border: #000000 1px solid;background: #ffffff; font: 10px verdana, arial, helvetica,sans-serif; }
+
+/* Content template definition */
+div.content {text-align: left;  padding: 0px 10px 0px 10px;}
+
+/* Code and Quote Definition */
+div.xoopsCode {padding: 3px; font-size: 12px; color: #003399; background-color: #F6FAFD; border-right: #c2cdd6 1px dashed; border-top:  #c2cdd6 1px dashed; border-left: #c2cdd6 1px dashed; border-bottom: #c2cdd6 1px dashed;}
+div.xoopsQuote {padding: 3px; font-size: 12px; color: #003399; line-height: 125%; text-align: justify; background-color: #F6FAFD; border-right: #c2cdd6 1px dashed; border-top: #c2cdd6 1px dashed; border-left: #c2cdd6 1px dashed; border-bottom: #c2cdd6 1px dashed;}
+
+/* Links for Quotes */
+div.xoopsQuote a:link, div.xoopsQuote a:visited { color: Black; font-weight: bold; background-color: transparent; }
+div.xoopsQuote a:hover, div.xoopsQuote a:active { color: #1778cb; font-weight: bold; background-color: transparent; }
+
+/* News module definitions */
+td.newsTitle {border-right: #cccccc 1px; border-top: #cccccc 1px; border-left: #cccccc 1px; border-bottom: #cccccc 1px dashed; background-color: transparent; font-size: 18px; text-align: left; font-weight: bold; color: #2F5376; letter-spacing: -1.5px; margin: 0; line-height: 18px;}
+td.newsSubtitle {padding: 5px; border-right: #d0d0d0 1px solid; border-top: #d0d0d0 1px solid; border-left: #d0d0d0 1px solid; color: #666666; border-bottom: #d0d0d0 1px solid; background-color: #dfdfdf; font-size: 15px; text-align: left; font-weight: bold; letter-spacing: -1.5px; margin: 0; line-height: 15px;}
+td.newsSubSubtitle {padding: 3px; border-right: #d0d0d0 1px solid; border-top: #d0d0d0 1px solid; border-left: #d0d0d0 1px solid; color: #666666; border-bottom: #d0d0d0 1px solid; background-color: #eaeaea;}
+td.newsPoster {padding: 3px;  border-right: #e0e0e0 1px solid;  border-top: #e0e0e0 1px solid;  border-left: #e0e0e0 1px solid;  color: #666666;  border-bottom: #e0e0e0 1px solid;  background-color: #f6f6f6;}
+td.newsPoster a:link {color: #666666;  text-decoration: none;  font-weight: bold; background-color: transparent;}
+td.newsPoster a:visited {color: #666666;  text-decoration: none;  font-weight: bold; background-color: transparent;}
+td.newsPoster a:hover {color: #999999;  text-decoration: underline;  font-weight: bold; background-color: transparent;}
+td.commentsNav {padding: 3px;  border-right: #e0e0e0 1px solid;  border-top: #e0e0e0 1px solid;  border-left: #e0e0e0 1px solid;  color: #666666;  border-bottom: #e0e0e0 1px solid;  background-color: #f6f6f6;}
+span.textPoster {color: #999999; background-color: transparent;}
+td.newsMisc {background-color: #f6f6f6;  border: 1px #e0e0e0 dashed;   padding: 10px;   text-align: center;}
+td.newsContent {padding-right: 5px; padding-left: 5px; padding-bottom: 5px; border-bottom: #cccccc 1px dashed; padding-top: 5px; border-top: #cccccc 1px dashed; font-size: 11px; background-color: #F9F9F9; color: #000000;}
+table.comments {background-color: #ffffff;  color: #000000;  border: 2px #2F5376 solid;}
+td.commentsHead {padding: 2px; color: #ffffff;  background-color: #2F5376;}
+td.sCommentFoot {padding: 3px;  border-bottom: #2F5376 1px solid;  background-color: #c2cdd6;}
+.sCommentHead {border-right: #e0e0e0 1px solid;   border-left: #e0e0e0 1px solid;  color: #666666;  border-bottom: #e0e0e0 1px solid;  background-color: #f6f6f6;}
+td.sCommentThread {color: #000000;  border-bottom: #2F5376 1px solid;  text-align: left;  background-color: #dee3e7;}
+td.sCommentRank {border-top: #2F5376 1px solid;  border-right: 1px #CCCCCC solid;   border-bottom: #2F5376 1px solid;  padding: 10px;   text-align: left;  background-color: #dee3e7;  color: #000000;}
+td.sCommentText {padding-right: 5px;  padding-left: 5px;  padding-bottom: 5px;  padding-top: 0px;  font-size: 11px; background-color: #F5F5F5;   border-top: #2F5376 1px solid;  border-bottom: #2F5376 1px solid;  color: #000000;}
+
+/* system module definition */
+table.userinfo {border: 1px solid #2F5376;}
+td.uinfoHead {color: #ffffff;  background-color: #2F5376;  padding: 3px;}
+td.uinfoBody {color: #666666;  background-color: #f6f6f6;}
+td.uinfoMain {padding: 3px; color: #666666; background-color: #c2cdd6;}
+tr.uinfoData {padding: 3px; background-color: #dee3e7; color: #000000;}
+tr.uinfoData a:link {color: #666666;  text-decoration: none;  font-weight: bold; background-color: transparent;}
+tr.uinfoData a:visited {color: #666666;  text-decoration: none;  font-weight: bold; background-color: transparent;}
+tr.uinfoData a:hover {color: #999999;  text-decoration: underline;  font-weight: bold; background-color: transparent;}
+
+/*Downloads class*/
+.info {padding: 3px;border: #e0e0e0 1px solid; color: #666666; background-color: #f6f6f6;}
+.info a:link {color: #666666;  text-decoration: none;  font-weight: bold; background-color: transparent;}
+.info a:visited {color: #666666;  text-decoration: none;  font-weight: bold; background-color: transparent;}
+.info a:hover {color: #999999;  text-decoration: underline;  font-weight: bold; background-color: transparent;}
+span.category  { font-size: 16px;  }
+span.subcategories  { font-size: 11px;  }
+span.bigtext  { font-size: 25px;  }
+
+/* Forum class */
+.toprow {background: url('_toprow_bg.gif'); font-size: 12px; font-weight: bold; height: 23px; letter-spacing: 1px; line-height: 23px; text-align: center;}
+.toprowleft {background: url('_toprow_left.gif'); height: 23px; width: 14px;}
+.toprowright {background: url('_toprow_right.gif'); height: 23px; width: 14px;}
+.catrow {background: url('_cellpic_cat.gif'); color: #F6F6F6; font-weight: bold; height: 24px; letter-spacing: 1px; line-height: 24px; padding-left: 5px; padding-right: 5px; text-align: center; background-color: transparent;}
+.catrow a:link {color: #F6F6F6;  text-decoration: none;  font-weight: bold; background-color: transparent;}
+.catrow a:visited {color: #F6F6F6;  text-decoration: none;  font-weight: bold; background-color: transparent;}
+.catrow a:hover {color: #F6F6F6;  text-decoration: underline;  font-weight: bold; background-color: transparent;}
+.row1 {background-color: #F0F0F0; padding: 5px;}
+.row2 {background-color: #F9F9F9; padding: 5px;}
+.row3 {background-color: #f6f6f6; padding: 5px;}
+.small {font-size: 10px;}
+.spacer {background-color: #D1D0D1; height: 1px; width: 1px;}
+.footrow {background: url('_foot_bg.gif'); color: #FFFFFF; height: 7px; background-color: transparent;}
+.footrowleft {background: url('_foot_left.gif'); height: 7px; width: 6px;}
+.footrowright {background: url('_foot_right.gif'); height: 7px; width: 6px;}
+.row1top {background-color: #c2cdd6; padding: 5px;}
+.row2top {background-color: #dee3e7; padding: 5px;}
+.row1bot {background-color: #c2cdd6; padding: 5px;}
+.row2bot {background-color: #dee3e7; padding: 5px;}
+.dots {background: url('dots.gif'); height: 5px;}
+.moderate {padding: 3px;  border: #e0e0e0 1px solid;  background-color: #f6f6f6; text-align: left;  width:98%;}
+.moderate a:link {color: #666666;  text-decoration: none;  font-weight: bold; background-color: transparent;}
+.moderate a:visited {color: #666666;  text-decoration: none;  font-weight: bold; background-color: transparent;}
+.moderate a:hover {color: #999999;  text-decoration: underline;  font-weight: bold; background-color: transparent;}
+
+/* for test only */
+table.subType {color: #000000; background-color: #FFFFFF; border-right: #AEBDC4 1px solid; border-top:#AEBDC4 1px solid; border-left:#AEBDC4 1px solid; border-bottom:#AEBDC4 1px solid;}
+td.lightRow {background-color: #F0F0F0; color: #000000;}
+
+        /* texto para el td lightRow */
+.lightRow {font-size : 12px;  text-decoration : none;  color : #000000;  background-color: transparent;}
+td.lightRow a:link {text-decoration: underline;  color : #003399;  background-color: transparent;}
+td.lightRow a:visited {text-decoration: underline;  color : #003399;  background-color: transparent;}
+td.lightRow a:hover {text-decoration: underline;  color : #D68000;  background-color: transparent;}
+
+td.mediumRow {background-color: #dee3e7;  color: #000000;}
+
+/* texto para el td mediumRow */
+.mediumRow {font-size : 12px;  text-decoration : none;  color : #000000;  background-color: transparent;}
+td.mediumRow a:link {text-decoration: underline;  color : #003399;  background-color: transparent;}
+td.mediumRow a:visited {text-decoration: underline;  color : #003399;  background-color: transparent;}
+td.mediumRow a:hover {text-decoration: underline;  color : #D68000;  background-color: transparent;}
+
+td.darkRow {background-color: #c2cdd6;  color: #000000; }
+
+/* text for td darkRow */
+.darkRow {font-size : 12px;  text-decoration : none;  color : #000000;  background-color: transparent;}
+td.darkRow a:link {text-decoration: underline;  color : #003399;  background-color: transparent;}
+td.darkRow a:visited {text-decoration: underline;  color : #003399;  background-color: transparent;}
+td.darkRow a:hover {text-decoration: underline;  color : #D68000;  background-color: transparent;}
+
+/* blocks colors */
+.bdownloadr { background-color: #EDF4FB;padding: 2px;}
+.bdownloadt { background-color: #E6F0FA;padding: 2px;}
+.blinkr { background-color: #FFFAF9;padding: 2px;}
+.blinkt { background-color: #FFF3F0;padding: 2px;}
+.bnewsr { background-color: #F9FFF9;padding: 2px;}
+.bnewst { background-color: #F0FFF0;padding: 2px;}
+.bcust { background-color: #FFFFF4;padding: 2px;}
+.bfaqsr { background-color: #FFFBF4;padding: 2px;}
+.bfaqsrq { background-color: #FFF3DF;padding: 2px;}
+
+/* weBlog module */
+div.blogDate {background-color: #f6f6f6; border: 1px #e0e0e0 dashed;  padding: 2px;  text-align: right;margin-bottom: 12px;margin-top: 12px; font-style: italic;}
+div.blogTitle { color: #666666; border-bottom: #cccccc 1px dashed; background-color: transparent;margin-left: 20px; font-size: 150%;font-weight: bold;}
+div.blogContents {margin-left: 35px;padding: 5px;}
+div.blogFooter {padding: 3px; border: #e0e0e0 1px solid; color: #666666; background-color: #f6f6f6;font-size: 80%;}
+
+/* smartfaq module */
+.bfaqr { background-color: #F5F5FF;padding: 2px;}
+.xinfotitle {margin-top: 8px; color: #335380; margin-bottom: 8px; font-size: 18px; line-height: 18px; font-weight: bold; display: block;}
+.xinfotext  {color: #456; margin-bottom: 8px; line-height: 130%; display: block;}#335380
+.itemFoot {text-align: right; padding:3px; border:1px solid #808080; background-color: #fff; color: #000;}
+
+/* soapbox module */
+#mod_header { width: 100%; padding: 0; margin: 0; border-bottom: 1px solid #2F5376;}
+.col_header { width: 100%; padding: 0; margin: 0; border-top: 2px solid #2F5376;}
+.clean { width: 100%; padding: 0; margin: 0;}
+.clean99 { width: 99%; padding: 0; margin: 0 0 4px 0;}
+.h18px { font-size: 10px; line-height: 18px;}
+.h18right { font-size: 18px; text-align: right; font-weight: bold; color: #2F5376; letter-spacing: -1.5px; margin: 0; line-height: 18px;}
+.h3a { margin: 6px 0;}
+.h3b { margin: 8px 0 4px 0;}
+.h3c { margin: 0 0 6px 0; color: #2F5376;}
+.intro { color: #456; margin-top: 4px; margin-bottom: 12px;line-height: 130%; display: block;}
+.intro2	{ font-size: 12px; color: #456; margin: 4px 0 0 0; line-height: 150%;}
+.intro8 { color: #456; margin: 0px 8px 8px 8px; line-height: 130%; display: block; }
+.nocontent { background-color: #efefef; border: 1px solid silver; padding: 18px; margin-top: 12px; font-size: 12px;}
+.padded	{ padding: 24px;}
+.th6bot	{ margin-bottom: 6px;}
+.columnlink { font-size: 16px;}
+.rightfloater {	width: 150px; border: 1px solid #456; padding: 4px; margin: 0 0 8px 8px;float:right; }
+.clear { height: 0px;}
+.picleft { float:left; width: 80px; margin: 8px 10px 10px 0;}
+.pic { border: 1px solid black;	width: 80px;}
+.left {	background-color: #e7e7e7; width: 70%;padding-left: 4px; line-height: 24px;}
+.right { text-align: right; background-color: #e7e7e7;font-weight: bold; width: 30%; padding-right: 8px; line-height: 24px;}
+.subdate { font-size: 9px; color: #2F5376; margin-bottom: 8px;}
+.teaser	{ color: #456; line-height: 130%; margin: 0;}
+.coldesc { color: #456; margin: 6px 0; font-size: 11px; font-style: italic;}
+.coldesc8 { color: #456; margin: 6px 0; padding: 0 8px;font-size: 10px;}
+.nine {	font-size: 9px;	margin-bottom: 12px;}
+.nine2 { font-size: 9px; margin-bottom: 4px;}
+.art { border: 1px solid #ccc; margin-bottom: 8px;}
+.arttitle { margin-bottom: 4px; padding: 8px 8px 4px 8px;}
+li.box { list-style-position: outside; margin-left: 16px;}
+.smallpub { font-size: 9px; font-weight: normal; margin-bottom: 4px;}
+.pad18 { padding-left: 18px;}
+div.texto, div.texto p { color: #456; margin: 6px 0; line-height: 130%;}
+.storypic { display: block; margin-bottom: 12px;}
+.storynav { text-align: left; margin: 10px;}
+.colteaser {background-color: #efefef;padding: 12px; border: #e7e7e7; clear: right;}
+.iconlinks { padding: 5px; text-align: right; margin-right:3px;}
Index: /temp/test-xoops.ec-cube.net/html/session_confirm.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/session_confirm.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/session_confirm.php	(revision 405)
@@ -0,0 +1,73 @@
+<?php
+
+include "mainfile.php";
+
+// security check
+if( ! isset( $_SESSION['AUTOLOGIN_REQUEST_URI'] ) ) exit ;
+
+// get URI
+$url = $_SESSION['AUTOLOGIN_REQUEST_URI'] ;
+unset( $_SESSION['AUTOLOGIN_REQUEST_URI'] ) ;
+if( preg_match('/javascript:/si', $url) ) exit ; // black list of url
+$url4disp = preg_replace("/&amp;/i", '&', htmlspecialchars($url, ENT_QUOTES));
+
+
+if( isset( $_SESSION['AUTOLOGIN_POST'] ) ) {
+
+	// posting confirmation
+
+	$old_post = $_SESSION['AUTOLOGIN_POST'] ;
+	unset( $_SESSION['AUTOLOGIN_POST'] ) ;
+
+	$hidden_str = '' ;
+	foreach( $old_post as $k => $v ) {
+		$hidden_str .= "\t".'      <input type="hidden" name="'.htmlspecialchars($k,ENT_QUOTES).'" value="'.htmlspecialchars($v,ENT_QUOTES).'" />'."\n" ;
+	}
+
+	echo '
+	<html>
+	<head>
+	<meta http-equiv="Content-Type" content="text/html; charset='._CHARSET.'" />
+	<title>'.$xoopsConfig['sitename'].'</title>
+	</head>
+	<body>
+	<div style="text-align:center; background-color: #EBEBEB; border-top: 1px solid #FFFFFF; border-left: 1px solid #FFFFFF; border-right: 1px solid #AAAAAA; border-bottom: 1px solid #AAAAAA; font-weight : bold;">
+	  <h4>'._RETRYPOST.'</h4>
+	  <form action="'.$url4disp.'" method="POST">
+	  '.$hidden_str.'
+	    <input type="submit" name="timeout_repost" value="'._SUBMIT.'" />
+	  </form>
+	</div>
+	</body>
+	</html>
+	' ;
+	exit ;
+
+} else {
+
+	// just redirecting
+
+	$time = 1 ;
+	// $message = empty( $message ) ? _TAKINGBACK : $message ;
+	$message = _TAKINGBACK ;
+
+	echo '
+	<html>
+	<head>
+	<meta http-equiv="Content-Type" content="text/html; charset='._CHARSET.'" />
+	<meta http-equiv="Refresh" content="'.$time.'; url='.$url4disp.'" />
+	<title>'.$xoopsConfig['sitename'].'</title>
+	</head>
+	<body>
+	<div style="text-align:center; background-color: #EBEBEB; border-top: 1px solid #FFFFFF; border-left: 1px solid #FFFFFF; border-right: 1px solid #AAAAAA; border-bottom: 1px solid #AAAAAA; font-weight : bold;">
+	  <h4>'.$message.'</h4>
+	  <p>'.sprintf(_IFNOTRELOAD, $url4disp).'</p>
+	</div>
+	</body>
+	</html>
+	' ;
+	exit ;
+
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/readpmsg.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/readpmsg.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/readpmsg.php	(revision 405)
@@ -0,0 +1,107 @@
+<?php
+// $Id: readpmsg.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+$xoopsOption['pagetype'] = "pmsg";
+include_once "mainfile.php";
+
+if ( !$xoopsUser ) {
+	redirect_header("user.php",0);
+	exit();
+} else {
+	$pm_handler =& xoops_gethandler('privmessage');
+	if ( !empty($_POST['delete']) ) {
+		$pm =& $pm_handler->get(intval($_POST['msg_id']));
+		if (!is_object($pm) || $pm->getVar('to_userid') != $xoopsUser->getVar('uid') || !$pm_handler->delete($pm)) {
+			exit();
+		} else {
+			redirect_header("viewpmsg.php",1,_PM_DELETED);
+			exit();
+		}
+	}
+	$start = !empty($_GET['start']) ? intval($_GET['start']) : 0;
+	$total_messages = !empty($_GET['total_messages']) ? intval($_GET['total_messages']) : 0;
+	include XOOPS_ROOT_PATH.'/header.php';
+	$criteria = new Criteria('to_userid', $xoopsUser->getVar('uid'));
+	$criteria->setLimit(1);
+	$criteria->setStart($start);
+	$criteria->setSort('msg_time');
+	$pm_arr =& $pm_handler->getObjects($criteria);
+	echo "<div><h4>". _PM_PRIVATEMESSAGE."</h4></div><br /><a href='userinfo.php?uid=". $xoopsUser->getVar("uid") ."'>". _PM_PROFILE ."</a>&nbsp;<span style='font-weight:bold;'>&raquo;&raquo;</span>&nbsp;<a href='viewpmsg.php'>". _PM_INBOX ."</a>&nbsp;<span style='font-weight:bold;'>&raquo;&raquo;</span>&nbsp;\n";
+	if (empty($pm_arr)) {
+		echo '<br /><br />'._PM_YOUDONTHAVE;
+	} else {
+		if (!$pm_handler->setRead($pm_arr[0])) {
+			//echo "failed";
+		}
+		echo $pm_arr[0]->getVar("subject")."<br /><form action='readpmsg.php' method='post' name='delete".$pm_arr[0]->getVar("msg_id")."'><table border='0' cellpadding='4' cellspacing='1' class='outer' width='100%'><tr><th colspan='2'>". _PM_FROM ."</th></tr><tr class='even'>\n";
+		$poster = new XoopsUser($pm_arr[0]->getVar("from_userid"));
+		if ( !$poster->isActive() ) {
+			$poster = false;
+		}
+		echo "<td valign='top'>";
+		if ( $poster != false ) { // we need to do this for deleted users
+		    	echo "<a href='userinfo.php?uid=".$poster->getVar("uid")."'>".$poster->getVar("uname")."</a><br />\n";
+			if ( $poster->getVar("user_avatar") != "" ) {
+				echo "<img src='uploads/".$poster->getVar("user_avatar")."' alt='' /><br />\n";
+			}
+			if ( $poster->getVar("user_from") != "" ) {
+				echo _PM_FROMC."".$poster->getVar("user_from")."<br /><br />\n";
+			}
+			if ( $poster->isOnline() ) {
+			echo "<span style='color:#ee0000;font-weight:bold;'>"._PM_ONLINE."</span><br /><br />\n";
+			}
+		} else {
+			echo $xoopsConfig['anonymous']; // we need to do this for deleted users
+		}
+		echo "</td><td><img src='images/subject/".$pm_arr[0]->getVar("msg_image", "E")."' alt='' />&nbsp;"._PM_SENTC."".formatTimestamp($pm_arr[0]->getVar("msg_time"));
+		echo "<hr /><b>".$pm_arr[0]->getVar("subject")."</b><br /><br />\n";
+		echo $pm_arr[0]->getVar("msg_text") . "<br /><br /></td></tr><tr class='foot'><td width='20%' colspan='2' align='left'>";
+		// we dont want to reply to a deleted user!
+		if ( $poster != false ) {
+			echo "<a href='#' onclick='javascript:openWithSelfMain(\"".XOOPS_URL."/pmlite.php?reply=1&amp;msg_id=".$pm_arr[0]->getVar("msg_id")."\",\"pmlite\",450,380);'><img src='".XOOPS_URL."/images/icons/reply.gif' alt='"._PM_REPLY."' /></a>\n";
+		}
+		echo "<input type='hidden' name='delete' value='1' />";
+		echo "<input type='hidden' name='msg_id' value='".$pm_arr[0]->getVar("msg_id")."' />";
+		echo "<a href='#".$pm_arr[0]->getVar("msg_id")."' onclick='javascript:document.delete".$pm_arr[0]->getVar("msg_id").".submit();'><img src='".XOOPS_URL."/images/icons/delete.gif' alt='"._PM_DELETE."' /></a>";
+		echo "</td></tr><tr><td colspan='2' align='right'>";
+		$previous = $start - 1;
+        	$next = $start + 1;
+        	if ( $previous >= 0 ) {
+			echo "<a href='readpmsg.php?start=".$previous."&amp;total_messages=".$total_messages."'>"._PM_PREVIOUS."</a> | ";
+		} else {
+			echo _PM_PREVIOUS." | ";
+		}
+		if ( $next < $total_messages ) {
+			echo "<a href='readpmsg.php?start=".$next."&amp;total_messages=".$total_messages."'>"._PM_NEXT."</a>";
+		} else {
+			echo _PM_NEXT;
+		}
+		echo "</td></tr></table></form>\n";
+	}
+	include "footer.php";
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/pda.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/pda.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/pda.php	(revision 405)
@@ -0,0 +1,56 @@
+<?php
+// $Id: pda.php,v 1.4 2005/08/03 12:39:11 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+include "mainfile.php";
+header("Content-Type: text/html");
+
+echo "<html><head><title>". htmlspecialchars($xoopsConfig['sitename'])."</title>
+      <meta name='HandheldFriendly' content='True' />
+      <meta name='PalmComputingPlatform' content='True' />
+      </head>
+      <body>";
+
+$sql = "SELECT storyid, title FROM ".$xoopsDB->prefix("stories")." WHERE published>0 AND published<".time()." ORDER BY published DESC";
+
+$result = $xoopsDB->query($sql,10,0);
+
+if (!$result) {
+    echo "An error occured";
+} else {
+    echo "<img src='images/logo.gif' alt='".htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES)."' border='0' /><br />";
+    echo "<h2>".htmlspecialchars($xoopsConfig['slogan'])."</h2>";
+    echo "<div>";
+    while (list($storyid, $title) = $xoopsDB->fetchRow($result)) {
+        echo "<a href='".XOOPS_URL."/modules/news/print.php?storyid=$storyid'>".htmlspecialchars($title)."</a><br />";
+
+    }
+    echo "</div>";
+}
+
+echo "</body></html>";
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/search.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/search.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/search.php	(revision 405)
@@ -0,0 +1,293 @@
+<?php
+// $Id: search.php,v 1.4 2005/08/03 12:39:11 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+$xoopsOption['pagetype'] = "search";
+
+include 'mainfile.php';
+$config_handler =& xoops_gethandler('config');
+$xoopsConfigSearch =& $config_handler->getConfigsByCat(XOOPS_CONF_SEARCH);
+
+if ($xoopsConfigSearch['enable_search'] != 1) {
+    header('Location: '.XOOPS_URL.'/index.php');
+    exit();
+}
+$action = "search";
+if (!empty($_GET['action'])) {
+  $action = $_GET['action'];
+} elseif (!empty($_POST['action'])) {
+  $action = $_POST['action'];
+}
+$query = "";
+if (!empty($_GET['query'])) {
+  $query = trim($_GET['query']);
+} elseif (!empty($_POST['query'])) {
+  $query = trim($_POST['query']);
+}
+$andor = "AND";
+if (!empty($_GET['andor'])) {
+  $andor = $_GET['andor'];
+} elseif (!empty($_POST['andor'])) {
+  $andor = $_POST['andor'];
+}
+$mid = $uid = $start = 0;
+if ( !empty($_GET['mid']) ) {
+  $mid = intval($_GET['mid']);
+} elseif ( !empty($_POST['mid']) ) {
+  $mid = intval($_POST['mid']);
+}
+if (!empty($_GET['uid'])) {
+  $uid = intval($_GET['uid']);
+} elseif (!empty($_POST['uid'])) {
+  $uid = intval($_POST['uid']);
+}
+if (!empty($_GET['start'])) {
+  $start = intval($_GET['start']);
+} elseif (!empty($_POST['start'])) {
+  $start = intval($_POST['start']);
+}
+if (!empty($_GET['mids'])) {
+  $mids = $_GET['mids'];
+} elseif (!empty($_POST['mids'])) {
+  $mids = $_POST['mids'];
+}
+
+$queries = array();
+
+if ($action == "results") {
+    if ($query == "") {
+         redirect_header("search.php",1,_SR_PLZENTER);
+        exit();
+    }
+} elseif ($action == "showall") {
+    if ($query == "" || empty($mid)) {
+        redirect_header("search.php",1,_SR_PLZENTER);
+        exit();
+    }
+} elseif ($action == "showallbyuser") {
+    if (empty($mid) || empty($uid)) {
+        redirect_header("search.php",1,_SR_PLZENTER);
+        exit();
+    }
+}
+
+$groups = is_object($xoopsUser) ? $xoopsUser -> getGroups() : XOOPS_GROUP_ANONYMOUS;
+$gperm_handler = & xoops_gethandler( 'groupperm' );
+$available_modules = $gperm_handler->getItemIds('module_read', $groups);
+
+if ($action == 'search') {
+    include XOOPS_ROOT_PATH.'/header.php';
+    include 'include/searchform.php';
+    $search_form->display();
+    include XOOPS_ROOT_PATH.'/footer.php';
+    exit();
+}
+
+if ( $andor != "OR" && $andor != "exact" && $andor != "AND" ) {
+    $andor = "AND";
+}
+
+$myts =& MyTextSanitizer::getInstance();
+if ($action != 'showallbyuser') {
+    if ( $andor != "exact" ) {
+        $ignored_queries = array(); // holds kewords that are shorter than allowed minmum length
+        $temp_queries = preg_split('/[\s,]+/', $query);
+        foreach ($temp_queries as $q) {
+            $q = trim($q);
+            if (strlen($q) >= $xoopsConfigSearch['keyword_min']) {
+                $queries[] = $myts->addSlashes($q);
+            } else {
+                $ignored_queries[] = $myts->addSlashes($q);
+            }
+        }
+        if (count($queries) == 0) {
+            redirect_header('search.php', 2, sprintf(_SR_KEYTOOSHORT, $xoopsConfigSearch['keyword_min']));
+            exit();
+        }
+    } else {
+        $query = trim($query);
+        if (strlen($query) < $xoopsConfigSearch['keyword_min']) {
+            redirect_header('search.php', 2, sprintf(_SR_KEYTOOSHORT, $xoopsConfigSearch['keyword_min']));
+            exit();
+        }
+        $queries = array($myts->addSlashes($query));
+    }
+}
+switch ($action) {
+    case "results":
+    $module_handler =& xoops_gethandler('module');
+    $criteria = new CriteriaCompo(new Criteria('hassearch', 1));
+    $criteria->add(new Criteria('isactive', 1));
+    $criteria->add(new Criteria('mid', "(".implode(',', $available_modules).")", 'IN'));
+    $modules =& $module_handler->getObjects($criteria, true);
+    if (empty($mids) || !is_array($mids)) {
+        unset($mids);
+        $mids = array_keys($modules);
+    }
+    include XOOPS_ROOT_PATH."/header.php";
+    echo "<h3>"._SR_SEARCHRESULTS."</h3>\n";
+    echo _SR_KEYWORDS.':';
+    if ($andor != 'exact') {
+        foreach ($queries as $q) {
+            echo ' <b>'.htmlspecialchars(stripslashes($q)).'</b>';
+        }
+        if (!empty($ignored_queries)) {
+            echo '<br />';
+            printf(_SR_IGNOREDWORDS, $xoopsConfigSearch['keyword_min']);
+            foreach ($ignored_queries as $q) {
+                echo ' <b>'.htmlspecialchars(stripslashes($q)).'</b>';
+            }
+        }
+    } else {
+        echo ' "<b>'.htmlspecialchars(stripslashes($queries[0])).'</b>"';
+    }
+    echo '<br />';
+    foreach ($mids as $mid) {
+        $mid = intval($mid);
+        if ( in_array($mid, $available_modules) ) {
+            $module =& $modules[$mid];
+            $results =& $module->search($queries, $andor, 5, 0);
+            echo "<h4>".$myts->makeTboxData4Show($module->getVar('name'))."</h4>";
+            $count = count($results);
+            if (!is_array($results) || $count == 0) {
+                echo "<p>"._SR_NOMATCH."</p>";
+            } else {
+                for ($i = 0; $i < $count; $i++) {
+                    if (isset($results[$i]['image']) && $results[$i]['image'] != "") {
+                        echo "<img src='modules/".$module->getVar('dirname')."/".$results[$i]['image']."' alt='".$myts->makeTboxData4Show($module->getVar('name'))."' />&nbsp;";
+                    } else {
+                        echo "<img src='images/icons/posticon2.gif' alt='".$myts->makeTboxData4Show($module->getVar('name'))."' width='26' height='26' />&nbsp;";
+                    }
+                    echo "<b><a href='modules/".$module->getVar('dirname')."/".$results[$i]['link']."'>".$myts->makeTboxData4Show($results[$i]['title'])."</a></b><br />\n";
+                    echo "<small>";
+                    $results[$i]['uid'] = intval($results[$i]['uid']);
+                    if ( !empty($results[$i]['uid']) ) {
+                        $uname = XoopsUser::getUnameFromId($results[$i]['uid']);
+                        echo "&nbsp;&nbsp;<a href='".XOOPS_URL."/userinfo.php?uid=".$results[$i]['uid']."'>".$uname."</a>\n";
+                    }
+                    echo $results[$i]['time'] ? " (". formatTimestamp(intval($results[$i]['time'])).")" : "";
+                    echo "</small><br />\n";
+                }
+                if ( $count == 5 ) {
+                    $search_url = XOOPS_URL.'/search.php?query='.urlencode(stripslashes(implode(' ', $queries)));
+                    $search_url .= "&mid=$mid&action=showall&andor=$andor";
+                    echo '<br /><a href="'.htmlspecialchars($search_url).'">'._SR_SHOWALLR.'</a></p>';
+                }
+            }
+        }
+        unset($results);
+        unset($module);
+    }
+    include "include/searchform.php";
+    $search_form->display();
+    break;
+    case "showall":
+    case 'showallbyuser':
+    include XOOPS_ROOT_PATH."/header.php";
+    $module_handler =& xoops_gethandler('module');
+    $module =& $module_handler->get($mid);
+    $results =& $module->search($queries, $andor, 20, $start, $uid);
+    $count = count($results);
+    if (is_array($results) && $count > 0) {
+        $next_results =& $module->search($queries, $andor, 1, $start + 20, $uid);
+        $next_count = count($next_results);
+        $has_next = false;
+        if (is_array($next_results) && $next_count == 1) {
+            $has_next = true;
+        }
+        echo "<h4>"._SR_SEARCHRESULTS."</h4>\n";
+        if ($action == 'showall') {
+            echo _SR_KEYWORDS.':';
+            if ($andor != 'exact') {
+                foreach ($queries as $q) {
+                    echo ' <b>'.htmlspecialchars(stripslashes($q)).'</b>';
+                }
+            } else {
+                echo ' "<b>'.htmlspecialchars(stripslashes($queries[0])).'</b>"';
+            }
+            echo '<br />';
+        }
+        //    printf(_SR_FOUND,$count);
+        //    echo "<br />";
+        printf(_SR_SHOWING, $start+1, $start + $count);
+        echo "<h5>".$myts->makeTboxData4Show($module->getVar('name'))."</h5>";
+        for ($i = 0; $i < $count; $i++) {
+            if (isset($results[$i]['image']) && $results[$i]['image'] != '') {
+                echo "<img src='modules/".$module->getVar('dirname')."/".$results[$i]['image']."' alt='".$myts->makeTboxData4Show($module->getVar('name'))."' />&nbsp;";
+            } else {
+                echo "<img src='images/icons/posticon2.gif' alt='".$myts->makeTboxData4Show($module->name())."' width='26' height='26' />&nbsp;";
+            }
+            echo "<b><a href='modules/".$module->getVar('dirname')."/".$results[$i]['link']."'>".$myts->makeTboxData4Show($results[$i]['title'])."</a></b><br />\n";
+            echo "<small>";
+            $results[$i]['uid'] = intval($results[$i]['uid']);
+            if ( !empty($results[$i]['uid']) ) {
+                $uname = XoopsUser::getUnameFromId($results[$i]['uid']);
+                echo "&nbsp;&nbsp;<a href='".XOOPS_URL."/userinfo.php?uid=".$results[$i]['uid']."'>".$uname."</a>\n";
+            }
+            echo $results[$i]['time'] ? " (". formatTimestamp(intval($results[$i]['time'])).")" : "";
+            echo "</small><br />\n";
+        }
+        echo '
+        <table>
+          <tr>
+        ';
+        $search_url = XOOPS_URL.'/search.php?query='.urlencode(stripslashes(implode(' ', $queries)));
+        $search_url .= "&mid=$mid&action=$action&andor=$andor";
+        if ($action=='showallbyuser') {
+            $search_url .= "&uid=$uid";
+        }
+        if ( $start > 0 ) {
+            $prev = $start - 20;
+            echo '<td align="left">
+            ';
+            $search_url_prev = $search_url."&start=$prev";
+            echo '<a href="'.htmlspecialchars($search_url_prev).'">'._SR_PREVIOUS.'</a></td>
+            ';
+        }
+        echo '<td>&nbsp;&nbsp;</td>
+        ';
+        if (false != $has_next) {
+            $next = $start + 20;
+            $search_url_next = $search_url."&start=$next";
+            echo '<td align="right"><a href="'.htmlspecialchars($search_url_next).'">'._SR_NEXT.'</a></td>
+            ';
+        }
+        echo '
+          </tr>
+        </table>
+        <p>
+        ';
+    } else {
+        echo '<p>'._SR_NOMATCH.'</p>';
+    }
+    include "include/searchform.php";
+    $search_form->display();
+    echo '</p>
+    ';
+    break;
+}
+include XOOPS_ROOT_PATH."/footer.php";
+?>
Index: /temp/test-xoops.ec-cube.net/html/xmlrpc.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/xmlrpc.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/xmlrpc.php	(revision 405)
@@ -0,0 +1,78 @@
+<?php
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+define('XOOPS_XMLRPC', 1);
+include './mainfile.php';
+error_reporting(0);
+include_once XOOPS_ROOT_PATH.'/class/xml/rpc/xmlrpctag.php';
+include_once XOOPS_ROOT_PATH.'/class/xml/rpc/xmlrpcparser.php';
+$response = new XoopsXmlRpcResponse();
+$parser = new XoopsXmlRpcParser(rawurldecode($GLOBALS['HTTP_RAW_POST_DATA']));
+if (!$parser->parse()) {
+    $response->add(new XoopsXmlRpcFault(102));
+} else {
+    $module_handler =& xoops_gethandler('module');
+    $module =& $module_handler->getByDirname('news');
+    if (!is_object($module)) {
+        $response->add(new XoopsXmlRpcFault(110));
+    } else {
+        $methods = explode('.', $parser->getMethodName());
+        switch ($methods[0]) {
+        case 'blogger':
+            include_once XOOPS_ROOT_PATH.'/class/xml/rpc/bloggerapi.php';
+            $rpc_api = new BloggerApi($parser->getParam(), $response, $module);
+            break;
+        case 'metaWeblog':
+            include_once XOOPS_ROOT_PATH.'/class/xml/rpc/metaweblogapi.php';
+            $rpc_api = new MetaWeblogApi($parser->getParam(), $response, $module);
+            break;
+        case 'mt':
+            include_once XOOPS_ROOT_PATH.'/class/xml/rpc/movabletypeapi.php';
+            $rpc_api = new MovableTypeApi($parser->getParam(), $response, $module);
+            break;
+        case 'xoops':
+        default:
+            include_once XOOPS_ROOT_PATH.'/class/xml/rpc/xoopsapi.php';
+            $rpc_api = new XoopsApi($parser->getParam(), $response, $module);
+            break;
+        }
+        $method = $methods[1];
+        if (!method_exists($rpc_api, $method)) {
+            $response->add(new XoopsXmlRpcFault(107));
+        } else {
+            $rpc_api->$method();
+        }
+    }
+}
+$payload =& $response->render();
+//$fp = fopen(XOOPS_CACHE_PATH.'/xmllog.txt', 'w');
+//fwrite($fp, $payload);
+//fclose($fp);
+header('Server: XOOPS XML-RPC Server');
+header('Content-type: text/xml');
+header('Content-Length: '.strlen($payload));
+echo $payload;
+?>
Index: /temp/test-xoops.ec-cube.net/html/index.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/index.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/index.php	(revision 405)
@@ -0,0 +1,54 @@
+<?php
+// $Id: index.php,v 1.3 2006/07/27 00:17:17 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+/**
+ * Catch new users and redirect them to the start page, if any
+ * @copyright &copy; 2000 xoops.org
+ **/
+ 
+/**
+ * redirects to installation, if xoops is not installed yet
+ **/
+include "mainfile.php";
+
+//
+// Fall back on simple protector of common.php by checking the constant that
+// is defined in common.php
+//
+if (!defined("XOOPS_CACHE_PATH")) {
+    die();
+}
+
+//check if start page is defined
+if ( isset($xoopsConfig['startpage']) && $xoopsConfig['startpage'] != "" && $xoopsConfig['startpage'] != "--" ) {
+	header('Location: '.XOOPS_URL.'/modules/'.$xoopsConfig['startpage'].'/');
+	exit();
+} else {
+	$xoopsOption['show_cblock'] =1;
+	include "header.php";
+	include "footer.php";
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/xoops.css
===================================================================
--- /temp/test-xoops.ec-cube.net/html/xoops.css	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/xoops.css	(revision 405)
@@ -0,0 +1,26 @@
+img {border: 0;}
+
+#xoopsHiddenText {visibility: hidden; color: #000000; font-weight: normal; font-style: normal; text-decoration: none;}
+
+.pagneutral {font-size: 10px; width: 16px; height: 19px;text-align: center; background-image: url(./images/pagneutral.gif);}
+.pagact {font-size: 10px; width: 16px; height: 19px;text-align: center; background-image: url(./images/pagact.gif);}
+.paginact {font-size: 10px; width: 16px; height: 19px;text-align: center; background-image: url(./images/paginact.gif);}
+
+
+#mainmenu a {text-align:left; display: block; margin: 0; padding: 4px;}
+#mainmenu a.menuTop {padding-left: 3px;}
+#mainmenu a.menuMain {padding-left: 3px;}
+#mainmenu a.menuSub {padding-left: 9px;}
+
+#usermenu a {text-align:left; display: block; margin: 0; padding: 4px;}
+#usermenu a.menuTop {}
+#usermenu a.highlight {color: #0000ff; background-color: #fcc;}
+
+.box {
+height: 80px;
+width: 500px;
+overflow: auto;
+margin: 10px 0 10px 0;
+border: 1px #bbbbbb solid;
+border-width: 1px 1px 1px 1px;
+}
Index: /temp/test-xoops.ec-cube.net/html/imagemanager.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/imagemanager.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/imagemanager.php	(revision 405)
@@ -0,0 +1,255 @@
+<?php
+// $Id: imagemanager.php,v 1.5 2005/09/04 20:46:08 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+include './mainfile.php';
+if (!isset($_GET['target']) && !isset($_POST['target'])) {
+    exit();
+}
+$op = 'list';
+if (isset($_GET['op']) && $_GET['op'] == 'upload') {
+    $op = 'upload';
+} elseif (isset($_POST['op']) && $_POST['op'] == 'doupload') {
+    $op = 'doupload';
+}
+
+if (!is_object($xoopsUser)) {
+    $group = array(XOOPS_GROUP_ANONYMOUS);
+} else {
+    $group =& $xoopsUser->getGroups();
+}
+if ($op == 'list') {
+    require_once XOOPS_ROOT_PATH.'/class/template.php';
+    $xoopsTpl = new XoopsTpl();
+    $xoopsTpl->assign('lang_imgmanager', _IMGMANAGER);
+    $xoopsTpl->assign('sitename', htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES));
+    $target = htmlspecialchars($_GET['target'], ENT_QUOTES);
+    $xoopsTpl->assign('target', $target);
+    $imgcat_handler =& xoops_gethandler('imagecategory');
+    $catlist =& $imgcat_handler->getList($group, 'imgcat_read', 1);
+    $catcount = count($catlist);
+    $xoopsTpl->assign('lang_align', _ALIGN);
+    $xoopsTpl->assign('lang_add', _ADD);
+    $xoopsTpl->assign('lang_close', _CLOSE);
+    if ($catcount > 0) {
+        $xoopsTpl->assign('lang_go', _GO);
+        $catshow = !isset($_GET['cat_id']) ? 0 : intval($_GET['cat_id']);
+        $catshow = (!empty($catshow) && in_array($catshow, array_keys($catlist))) ? $catshow : 0;
+        $xoopsTpl->assign('show_cat', $catshow);
+        if ($catshow > 0) {
+            $xoopsTpl->assign('lang_addimage', _ADDIMAGE);
+        }
+        $catlist = array('0' => '--') + $catlist;
+        $cat_options = '';
+        foreach ($catlist as $c_id => $c_name) {
+            $sel = '';
+            if ($c_id == $catshow) {
+                $sel = ' selected="selected"';
+            }
+            $cat_options .= '<option value="'.$c_id.'"'.$sel.'>'.$c_name.'</option>';
+        }
+        $xoopsTpl->assign('cat_options', $cat_options);
+        if ($catshow > 0) {
+            $image_handler = xoops_gethandler('image');
+            $criteria = new CriteriaCompo(new Criteria('imgcat_id', $catshow));
+            $criteria->add(new Criteria('image_display', 1));
+            $total = $image_handler->getCount($criteria);
+            if ($total > 0) {
+                $imgcat_handler =& xoops_gethandler('imagecategory');
+                $imgcat =& $imgcat_handler->get($catshow);
+                $xoopsTpl->assign('image_total', $total);
+                $xoopsTpl->assign('lang_image', _IMAGE);
+                $xoopsTpl->assign('lang_imagename', _IMAGENAME);
+                $xoopsTpl->assign('lang_imagemime', _IMAGEMIME);
+                $start = isset($_GET['start']) ? intval($_GET['start']) : 0;
+                $criteria->setLimit(10);
+                $criteria->setStart($start);
+                $storetype = $imgcat->getVar('imgcat_storetype');
+                if ($storetype == 'db') {
+                    $images =& $image_handler->getObjects($criteria, false, true);
+                } else {
+                    $images =& $image_handler->getObjects($criteria, false, false);
+                }
+                $imgcount = count($images);
+                $max = ($imgcount > 10) ? 10 : $imgcount;
+
+                for ($i = 0; $i < $max; $i++) {
+                    if ($storetype == 'db') {
+                        $lcode = '[img align=left id='.$images[$i]->getVar('image_id').']'.$images[$i]->getVar('image_nicename').'[/img]';
+                        $code = '[img id='.$images[$i]->getVar('image_id').']'.$images[$i]->getVar('image_nicename').'[/img]';
+                        $rcode = '[img align=right id='.$images[$i]->getVar('image_id').']'.$images[$i]->getVar('image_nicename').'[/img]';
+                        $src = XOOPS_URL."/image.php?id=".$images[$i]->getVar('image_id');
+                    } else {
+                        $lcode = '[img align=left]'.XOOPS_UPLOAD_URL.'/'.$images[$i]->getVar('image_name').'[/img]';
+                        $code = '[img]'.XOOPS_UPLOAD_URL.'/'.$images[$i]->getVar('image_name').'[/img]';
+                        $rcode = '[img align=right]'.XOOPS_UPLOAD_URL.'/'.$images[$i]->getVar('image_name').'[/img]';
+                        $src = XOOPS_UPLOAD_URL.'/'.$images[$i]->getVar('image_name');
+                    }
+                    $xoopsTpl->append('images', array('id' => $images[$i]->getVar('image_id'), 'nicename' => $images[$i]->getVar('image_nicename'), 'mimetype' => $images[$i]->getVar('image_mimetype'), 'src' => $src, 'lxcode' => $lcode, 'xcode' => $code, 'rxcode' => $rcode));
+                }
+                if ($total > 10) {
+                    include_once XOOPS_ROOT_PATH.'/class/pagenav.php';
+                    $nav = new XoopsPageNav($total, 10, $start, 'start', 'target='.$target.'&amp;cat_id='.$catshow);
+                    $xoopsTpl->assign('pagenav', $nav->renderNav());
+                }
+            } else {
+                $xoopsTpl->assign('image_total', 0);
+            }
+        }
+        $xoopsTpl->assign('xsize', 600);
+        $xoopsTpl->assign('ysize', 400);
+    } else {
+        $xoopsTpl->assign('xsize', 400);
+        $xoopsTpl->assign('ysize', 180);
+    }
+    $xoopsTpl->display('db:system_imagemanager.html');
+    exit();
+}
+
+if ($op == 'upload') {
+    $imgcat_handler =& xoops_gethandler('imagecategory');
+    $imgcat_id = intval($_GET['imgcat_id']);
+    $imgcat =& $imgcat_handler->get($imgcat_id);
+    $error = false;
+    if (!is_object($imgcat)) {
+        $error = true;
+    } else {
+        $imgcatperm_handler =& xoops_gethandler('groupperm');
+        if (is_object($xoopsUser)) {
+            if (!$imgcatperm_handler->checkRight('imgcat_write', $imgcat_id, $xoopsUser->getGroups())) {
+                $error = true;
+            }
+        } else {
+            if (!$imgcatperm_handler->checkRight('imgcat_write', $imgcat_id, XOOPS_GROUP_ANONYMOUS)) {
+                $error = true;
+            }
+        }
+    }
+    if ($error != false) {
+        xoops_header(false);
+        echo '</head><body><div style="text-align:center;"><input value="'._BACK.'" type="button" onclick="javascript:history.go(-1);" /></div>';
+        xoops_footer();
+        exit();
+    }
+    require_once XOOPS_ROOT_PATH.'/class/template.php';
+    $xoopsTpl = new XoopsTpl();
+    $xoopsTpl->assign('show_cat', $imgcat_id);
+    $xoopsTpl->assign('lang_imgmanager', _IMGMANAGER);
+    $xoopsTpl->assign('sitename', htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES));
+    $xoopsTpl->assign('target', htmlspecialchars($_GET['target'], ENT_QUOTES));
+    include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
+    $form = new XoopsThemeForm('', 'image_form', 'imagemanager.php');
+    $form->setExtra('enctype="multipart/form-data"');
+    $form->addElement(new XoopsFormText(_IMAGENAME, 'image_nicename', 20, 255), true);
+    $form->addElement(new XoopsFormLabel(_IMAGECAT, $imgcat->getVar('imgcat_name')));
+    $form->addElement(new XoopsFormFile(_IMAGEFILE, 'image_file', $imgcat->getVar('imgcat_maxsize')), true);
+    $form->addElement(new XoopsFormLabel(_IMGMAXSIZE, $imgcat->getVar('imgcat_maxsize')));
+    $form->addElement(new XoopsFormLabel(_IMGMAXWIDTH, $imgcat->getVar('imgcat_maxwidth')));
+    $form->addElement(new XoopsFormLabel(_IMGMAXHEIGHT, $imgcat->getVar('imgcat_maxheight')));
+    $form->addElement(new XoopsFormHidden('imgcat_id', $imgcat_id));
+    $form->addElement(new XoopsFormHidden('op', 'doupload'));
+    $form->addElement(new XoopsFormToken(XoopsMultiTokenHandler::quickCreate('imagemanager')));
+    $form->addElement(new XoopsFormHidden('target', $target));
+    $form->addElement(new XoopsFormButton('', 'img_button', _SUBMIT, 'submit'));
+    $form->assign($xoopsTpl);
+    $xoopsTpl->assign('lang_close', _CLOSE);
+    $xoopsTpl->display('db:system_imagemanager2.html');
+    exit();
+}
+
+if ($op == 'doupload') {
+    if (!XoopsMultiTokenHandler::quickValidate('imagemanager')) {
+        exit();
+    }
+    $image_nicename = isset($_POST['image_nicename']) ? $_POST['image_nicename'] : '';
+    $xoops_upload_file = isset($_POST['xoops_upload_file']) ? $_POST['xoops_upload_file'] : array();
+    $target = isset($_POST['target']) ? $_POST['target'] : '';
+    $imgcat_id = isset($_POST['imgcat_id']) ? intval($_POST['imgcat_id']) : 0;
+    include_once XOOPS_ROOT_PATH.'/class/uploader.php';
+    $imgcat_handler =& xoops_gethandler('imagecategory');
+    $imgcat =& $imgcat_handler->get($imgcat_id);
+    $error = false;
+    if (!is_object($imgcat)) {
+        $error = true;
+    } else {
+        $imgcatperm_handler =& xoops_gethandler('groupperm');
+        if (is_object($xoopsUser)) {
+            if (!$imgcatperm_handler->checkRight('imgcat_write', $imgcat_id, $xoopsUser->getGroups())) {
+                $error = true;
+            }
+        } else {
+            if (!$imgcatperm_handler->checkRight('imgcat_write', $imgcat_id, XOOPS_GROUP_ANONYMOUS)) {
+                $error = true;
+            }
+        }
+    }
+    if ($error != false) {
+        xoops_header(false);
+        echo '</head><body><div style="text-align:center;"><input value="'._BACK.'" type="button" onclick="javascript:history.go(-1);" /></div>';
+        xoops_footer();
+        exit();
+    }
+    $uploader = new XoopsMediaUploader(XOOPS_UPLOAD_PATH, array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/x-png', 'image/png'), $imgcat->getVar('imgcat_maxsize'), $imgcat->getVar('imgcat_maxwidth'), $imgcat->getVar('imgcat_maxheight'));
+    $uploader->setAllowedExtensions(array('gif', 'jpeg', 'jpg', 'png'));
+    $uploader->setPrefix('img');
+    if ($uploader->fetchMedia($xoops_upload_file[0])) {
+        if (!$uploader->upload()) {
+            $err = $uploader->getErrors();
+        } else {
+            $image_handler =& xoops_gethandler('image');
+            $image =& $image_handler->create();
+            $image->setVar('image_name', $uploader->getSavedFileName());
+            $image->setVar('image_nicename', $image_nicename);
+            $image->setVar('image_mimetype', $uploader->getMediaType());
+            $image->setVar('image_created', time());
+            $image->setVar('image_display', 1);
+            $image->setVar('image_weight', 0);
+            $image->setVar('imgcat_id', $imgcat_id);
+            if ($imgcat->getVar('imgcat_storetype') == 'db') {
+                $fp = @fopen($uploader->getSavedDestination(), 'rb');
+                $fbinary = @fread($fp, filesize($uploader->getSavedDestination()));
+                @fclose($fp);
+                $image->setVar('image_body', $fbinary, true);
+                @unlink($uploader->getSavedDestination());
+            }
+            if (!$image_handler->insert($image)) {
+                $err = sprintf(_FAILSAVEIMG, $image->getVar('image_nicename'));
+            }
+        }
+    } else {
+        $err = _FAILFETCHIMG;
+    }
+    if (isset($err)) {
+        xoops_header(false);
+        xoops_error($err);
+        echo '</head><body><div style="text-align:center;"><input value="'._BACK.'" type="button" onclick="javascript:history.go(-1);" /></div>';
+        xoops_footer();
+        exit();
+    }
+    header('location: imagemanager.php?cat_id='.$imgcat_id.'&target='.$target);
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/class/xoopslists.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xoopslists.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xoopslists.php	(revision 405)
@@ -0,0 +1,535 @@
+<?php
+// $Id: xoopslists.php,v 1.5 2006/05/01 02:37:24 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: The XOOPS Project                                                 //
+// URL: http://www.xoops.org/                                                //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+
+if ( !defined("XOOPS_LISTS_INCLUDED") ) {
+    define("XOOPS_LISTS_INCLUDED",1);
+    class XoopsLists
+    {
+        function &getTimeZoneList()
+        {
+            include_once XOOPS_ROOT_PATH.'/language/'.$GLOBALS['xoopsConfig']['language'].'/timezone.php';
+            $time_zone_list = array ("-12" => _TZ_GMTM12, "-11" => _TZ_GMTM11, "-10" => _TZ_GMTM10, "-9" => _TZ_GMTM9, "-8" => _TZ_GMTM8, "-7" => _TZ_GMTM7, "-6" => _TZ_GMTM6, "-5" => _TZ_GMTM5, "-4" => _TZ_GMTM4, "-3.5" => _TZ_GMTM35, "-3" => _TZ_GMTM3, "-2" => _TZ_GMTM2, "-1" => _TZ_GMTM1, "0" => _TZ_GMT0, "1" => _TZ_GMTP1, "2" => _TZ_GMTP2, "3" => _TZ_GMTP3, "3.5" => _TZ_GMTP35, "4" => _TZ_GMTP4, "4.5" => _TZ_GMTP45, "5" => _TZ_GMTP5, "5.5" => _TZ_GMTP55, "6" => _TZ_GMTP6, "7" => _TZ_GMTP7, "8" => _TZ_GMTP8, "9" => _TZ_GMTP9, "9.5" => _TZ_GMTP95, "10" => _TZ_GMTP10, "11" => _TZ_GMTP11, "12" => _TZ_GMTP12);
+            return $time_zone_list;
+        }
+
+        /*
+         * gets list of themes folder from themes directory
+         */
+        function &getThemesList()
+        {
+            $ret =& XoopsLists::getDirListAsArray(XOOPS_THEME_PATH.'/');
+            return $ret;
+        }
+
+        /*
+         * gets a list of module folders from the modules directory
+         */
+        function &getModulesList()
+        {
+            $ret =& XoopsLists::getDirListAsArray(XOOPS_ROOT_PATH."/modules/");
+            return $ret;
+        }
+
+        /*
+         * gets list of name of directories inside a directory
+         */
+        function &getDirListAsArray($dirname)
+        {
+            $dirlist = array();
+            if (is_dir($dirname) && $handle = opendir($dirname)) {
+                while (false !== ($file = readdir($handle))) {
+                    if (!preg_match("/^\..*$/", $file)) {
+                        if (strtolower($file) != 'cvs' && is_dir($dirname.$file) ) {
+                            $dirlist[$file]=$file;
+                        }
+                    }
+                }
+                closedir($handle);
+                asort($dirlist);
+                reset($dirlist);
+            }
+            return $dirlist;
+        }
+
+        /*
+         *  gets list of all files in a directory
+         */
+        function &getFileListAsArray($dirname, $prefix="")
+        {
+            $filelist = array();
+            if (substr($dirname, -1) == '/') {
+                $dirname = substr($dirname, 0, -1);
+            }
+            if (is_dir($dirname) && $handle = opendir($dirname)) {
+                while (false !== ($file = readdir($handle))) {
+                    if (!preg_match("/^[\.]{1,2}$/",$file) && is_file($dirname.'/'.$file)) {
+                        $file = $prefix.$file;
+                        $filelist[$file]=$file;
+                    }
+                }
+                closedir($handle);
+                asort($filelist);
+                reset($filelist);
+            }
+            return $filelist;
+        }
+
+        /*
+         *  gets list of image file names in a directory
+         */
+        function &getImgListAsArray($dirname, $prefix="")
+        {
+            $filelist = array();
+            if ($handle = opendir($dirname)) {
+                while (false !== ($file = readdir($handle))) {
+                    if ( !preg_match("/^[\.]{1,2}$/",$file) && preg_match("/(\.gif|\.jpg|\.png)$/i",$file) ) {
+                        $file = $prefix.$file;
+                        $filelist[$file]=$file;
+                    }
+                }
+                closedir($handle);
+                asort($filelist);
+                reset($filelist);
+            }
+            return $filelist;
+        }
+
+        /*
+         *  gets list of html file names in a certain directory
+        */
+        function &getHtmlListAsArray($dirname, $prefix="")
+        {
+            $filelist = array();
+            if ($handle = opendir($dirname)) {
+                while (false !== ($file = readdir($handle))) {
+                    if ( ( !preg_match( "/^[\.]{1,2}$/", $file ) && preg_match( "/(\.htm|\.html|\.xhtml)$/i", $file ) && !is_dir( $file ) ) )
+                    {
+                        if ( strtolower( $file ) != 'cvs' && !is_dir( $file ) )
+                        {
+                            $file = $prefix.$file;
+                            $filelist[$file] = $prefix.$file;
+                        }
+                    }
+                }
+                closedir($handle);
+                asort($filelist);
+                reset($filelist);
+            }
+            return $filelist;
+        }
+
+        /*
+         *  gets list of avatar file names in a certain directory
+         *  if directory is not specified, default directory will be searched
+         */
+        function &getAvatarsList($avatar_dir="")
+        {
+            $avatars = array();
+            if ( $avatar_dir != "" ) {
+                $avatars =& XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH."/images/avatar/".$avatar_dir."/", $avatar_dir."/");
+            } else {
+                $avatars =& XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH."/images/avatar/");
+            }
+            return $avatars;
+        }
+
+        /*
+         *  gets list of all avatar image files inside default avatars directory
+         */
+        function &getAllAvatarsList()
+        {
+            $avatars = array();
+            $dirlist = array();
+            $dirlist =& XoopsLists::getDirListAsArray(XOOPS_ROOT_PATH."/images/avatar/");
+            if ( count($dirlist) > 0 ) {
+                foreach ( $dirlist as $dir ) {
+                    $avatars[$dir] =& XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH."/images/avatar/".$dir."/", $dir."/");
+                }
+                return $avatars;
+            }
+            $ret = false;
+            return $ret;
+        }
+
+        /*
+        *  gets list of subject icon image file names in a certain directory
+        *  if directory is not specified, default directory will be searched
+        */
+        function &getSubjectsList($sub_dir="")
+        {
+            $subjects = array();
+            if($sub_dir != ""){
+                $subjects =& XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH."/images/subject/".$sub_dir, $sub_dir."/");
+            } else {
+                $subjects =& XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH."/images/subject/");
+            }
+            return $subjects;
+        }
+
+        /*
+         * gets list of language folders inside default language directory
+         */
+        function &getLangList()
+        {
+            $lang_list = array();
+            $lang_list =& XoopsLists::getDirListAsArray(XOOPS_ROOT_PATH."/language/");
+            return $lang_list;
+        }
+
+        function &getCountryList()
+        {
+            $country_list = array (
+                ""   => "-",
+                "AD" => "Andorra",
+                "AE" => "United Arab Emirates",
+                "AF" => "Afghanistan",
+                "AG" => "Antigua and Barbuda",
+                "AI" => "Anguilla",
+                "AL" => "Albania",
+                "AM" => "Armenia",
+                "AN" => "Netherlands Antilles",
+                "AO" => "Angola",
+                "AQ" => "Antarctica",
+                "AR" => "Argentina",
+                "AS" => "American Samoa",
+                "AT" => "Austria",
+                "AU" => "Australia",
+                "AW" => "Aruba",
+                "AZ" => "Azerbaijan",
+                "BA" => "Bosnia and Herzegovina",
+                "BB" => "Barbados",
+                "BD" => "Bangladesh",
+                "BE" => "Belgium",
+                "BF" => "Burkina Faso",
+                "BG" => "Bulgaria",
+                "BH" => "Bahrain",
+                "BI" => "Burundi",
+                "BJ" => "Benin",
+                "BM" => "Bermuda",
+                "BN" => "Brunei Darussalam",
+                "BO" => "Bolivia",
+                "BR" => "Brazil",
+                "BS" => "Bahamas",
+                "BT" => "Bhutan",
+                "BV" => "Bouvet Island",
+                "BW" => "Botswana",
+                "BY" => "Belarus",
+                "BZ" => "Belize",
+                "CA" => "Canada",
+                "CC" => "Cocos (Keeling) Islands",
+                "CF" => "Central African Republic",
+                "CG" => "Congo",
+                "CH" => "Switzerland",
+                "CI" => "Cote D'Ivoire (Ivory Coast)",
+                "CK" => "Cook Islands",
+                "CL" => "Chile",
+                "CM" => "Cameroon",
+                "CN" => "China",
+                "CO" => "Colombia",
+                "CR" => "Costa Rica",
+                "CS" => "Czechoslovakia (former)",
+                "CU" => "Cuba",
+                "CV" => "Cape Verde",
+                "CX" => "Christmas Island",
+                "CY" => "Cyprus",
+                "CZ" => "Czech Republic",
+                "DE" => "Germany",
+                "DJ" => "Djibouti",
+                "DK" => "Denmark",
+                "DM" => "Dominica",
+                "DO" => "Dominican Republic",
+                "DZ" => "Algeria",
+                "EC" => "Ecuador",
+                "EE" => "Estonia",
+                "EG" => "Egypt",
+                "EH" => "Western Sahara",
+                "ER" => "Eritrea",
+                "ES" => "Spain",
+                "ET" => "Ethiopia",
+                "FI" => "Finland",
+                "FJ" => "Fiji",
+                "FK" => "Falkland Islands (Malvinas)",
+                "FM" => "Micronesia",
+                "FO" => "Faroe Islands",
+                "FR" => "France",
+                "FX" => "France, Metropolitan",
+                "GA" => "Gabon",
+                "GB" => "Great Britain (UK)",
+                "GD" => "Grenada",
+                "GE" => "Georgia",
+                "GF" => "French Guiana",
+                "GH" => "Ghana",
+                "GI" => "Gibraltar",
+                "GL" => "Greenland",
+                "GM" => "Gambia",
+                "GN" => "Guinea",
+                "GP" => "Guadeloupe",
+                "GQ" => "Equatorial Guinea",
+                "GR" => "Greece",
+                "GS" => "S. Georgia and S. Sandwich Isls.",
+                "GT" => "Guatemala",
+                "GU" => "Guam",
+                "GW" => "Guinea-Bissau",
+                "GY" => "Guyana",
+                "HK" => "Hong Kong",
+                "HM" => "Heard and McDonald Islands",
+                "HN" => "Honduras",
+                "HR" => "Croatia (Hrvatska)",
+                "HT" => "Haiti",
+                "HU" => "Hungary",
+                "ID" => "Indonesia",
+                "IE" => "Ireland",
+                "IL" => "Israel",
+                "IN" => "India",
+                "IO" => "British Indian Ocean Territory",
+                "IQ" => "Iraq",
+                "IR" => "Iran",
+                "IS" => "Iceland",
+                "IT" => "Italy",
+                "JM" => "Jamaica",
+                "JO" => "Jordan",
+                "JP" => "Japan",
+                "KE" => "Kenya",
+                "KG" => "Kyrgyzstan",
+                "KH" => "Cambodia",
+                "KI" => "Kiribati",
+                "KM" => "Comoros",
+                "KN" => "Saint Kitts and Nevis",
+                "KP" => "Korea (North)",
+                "KR" => "Korea (South)",
+                "KW" => "Kuwait",
+                "KY" => "Cayman Islands",
+                "KZ" => "Kazakhstan",
+                "LA" => "Laos",
+                "LB" => "Lebanon",
+                "LC" => "Saint Lucia",
+                "LI" => "Liechtenstein",
+                "LK" => "Sri Lanka",
+                "LR" => "Liberia",
+                "LS" => "Lesotho",
+                "LT" => "Lithuania",
+                "LU" => "Luxembourg",
+                "LV" => "Latvia",
+                "LY" => "Libya",
+                "MA" => "Morocco",
+                "MC" => "Monaco",
+                "MD" => "Moldova",
+                "MG" => "Madagascar",
+                "MH" => "Marshall Islands",
+                "MK" => "Macedonia",
+                "ML" => "Mali",
+                "MM" => "Myanmar",
+                "MN" => "Mongolia",
+                "MO" => "Macau",
+                "MP" => "Northern Mariana Islands",
+                "MQ" => "Martinique",
+                "MR" => "Mauritania",
+                "MS" => "Montserrat",
+                "MT" => "Malta",
+                "MU" => "Mauritius",
+                "MV" => "Maldives",
+                "MW" => "Malawi",
+                "MX" => "Mexico",
+                "MY" => "Malaysia",
+                "MZ" => "Mozambique",
+                "NA" => "Namibia",
+                "NC" => "New Caledonia",
+                "NE" => "Niger",
+                "NF" => "Norfolk Island",
+                "NG" => "Nigeria",
+                "NI" => "Nicaragua",
+                "NL" => "Netherlands",
+                "NO" => "Norway",
+                "NP" => "Nepal",
+                "NR" => "Nauru",
+                "NT" => "Neutral Zone",
+                "NU" => "Niue",
+                "NZ" => "New Zealand (Aotearoa)",
+                "OM" => "Oman",
+                "PA" => "Panama",
+                "PE" => "Peru",
+                "PF" => "French Polynesia",
+                "PG" => "Papua New Guinea",
+                "PH" => "Philippines",
+                "PK" => "Pakistan",
+                "PL" => "Poland",
+                "PM" => "St. Pierre and Miquelon",
+                "PN" => "Pitcairn",
+                "PR" => "Puerto Rico",
+                "PT" => "Portugal",
+                "PW" => "Palau",
+                "PY" => "Paraguay",
+                "QA" => "Qatar",
+                "RE" => "Reunion",
+                "RO" => "Romania",
+                "RU" => "Russian Federation",
+                "RW" => "Rwanda",
+                "SA" => "Saudi Arabia",
+                "Sb" => "Solomon Islands",
+                "SC" => "Seychelles",
+                "SD" => "Sudan",
+                "SE" => "Sweden",
+                "SG" => "Singapore",
+                "SH" => "St. Helena",
+                "SI" => "Slovenia",
+                "SJ" => "Svalbard and Jan Mayen Islands",
+                "SK" => "Slovak Republic",
+                "SL" => "Sierra Leone",
+                "SM" => "San Marino",
+                "SN" => "Senegal",
+                "SO" => "Somalia",
+                "SR" => "Suriname",
+                "ST" => "Sao Tome and Principe",
+                "SU" => "USSR (former)",
+                "SV" => "El Salvador",
+                "SY" => "Syria",
+                "SZ" => "Swaziland",
+                "TC" => "Turks and Caicos Islands",
+                "TD" => "Chad",
+                "TF" => "French Southern Territories",
+                "TG" => "Togo",
+                "TH" => "Thailand",
+                "TJ" => "Tajikistan",
+                "TK" => "Tokelau",
+                "TM" => "Turkmenistan",
+                "TN" => "Tunisia",
+                "TO" => "Tonga",
+                "TP" => "East Timor",
+                "TR" => "Turkey",
+                "TT" => "Trinidad and Tobago",
+                "TV" => "Tuvalu",
+                "TW" => "Taiwan",
+                "TZ" => "Tanzania",
+                "UA" => "Ukraine",
+                "UG" => "Uganda",
+                "UK" => "United Kingdom",
+                "UM" => "US Minor Outlying Islands",
+                "US" => "United States",
+                "UY" => "Uruguay",
+                "UZ" => "Uzbekistan",
+                "VA" => "Vatican City State (Holy See)",
+                "VC" => "Saint Vincent and the Grenadines",
+                "VE" => "Venezuela",
+                "VG" => "Virgin Islands (British)",
+                "VI" => "Virgin Islands (U.S.)",
+                "VN" => "Viet Nam",
+                "VU" => "Vanuatu",
+                "WF" => "Wallis and Futuna Islands",
+                "WS" => "Samoa",
+                "YE" => "Yemen",
+                "YT" => "Mayotte",
+                "YU" => "Yugoslavia",
+                "ZA" => "South Africa",
+                "ZM" => "Zambia",
+                "ZR" => "Zaire",
+                "ZW" => "Zimbabwe"
+            );
+            asort($country_list);
+            reset($country_list);
+            return $country_list;
+        }
+
+        function &getHtmlList()
+        {
+            $html_list = array (
+                "a" => "&lt;a&gt;",
+                "abbr" => "&lt;abbr&gt;",
+                "acronym" => "&lt;acronym&gt;",
+                "address" => "&lt;address&gt;",
+                "b" => "&lt;b&gt;",
+                "bdo" => "&lt;bdo&gt;",
+                "big" => "&lt;big&gt;",
+                "blockquote" => "&lt;blockquote&gt;",
+                "caption" => "&lt;caption&gt;",
+                "cite" => "&lt;cite&gt;",
+                "code" => "&lt;code&gt;",
+                "col" => "&lt;col&gt;",
+                "colgroup" => "&lt;colgroup&gt;",
+                "dd" => "&lt;dd&gt;",
+                "del" => "&lt;del&gt;",
+                "dfn" => "&lt;dfn&gt;",
+                "div" => "&lt;div&gt;",
+                "dl" => "&lt;dl&gt;",
+                "dt" => "&lt;dt&gt;",
+                "em" => "&lt;em&gt;",
+                "font" => "&lt;font&gt;",
+                "h1" => "&lt;h1&gt;",
+                "h2" => "&lt;h2&gt;",
+                "h3" => "&lt;h3&gt;",
+                "h4" => "&lt;h4&gt;",
+                "h5" => "&lt;h5&gt;",
+                "h6" => "&lt;h6&gt;",
+                "hr" => "&lt;hr&gt;",
+                "i" => "&lt;i&gt;",
+                "img" => "&lt;img&gt;",
+                "ins" => "&lt;ins&gt;",
+                "kbd" => "&lt;kbd&gt;",
+                "li" => "&lt;li&gt;",
+                "map" => "&lt;map&gt;",
+                "object" => "&lt;object&gt;",
+                "ol" => "&lt;ol&gt;",
+                "samp" => "&lt;samp&gt;",
+                "small" => "&lt;small&gt;",
+                "strong" => "&lt;strong&gt;",
+                "sub" => "&lt;sub&gt;",
+                "sup" => "&lt;sup&gt;",
+                "table" => "&lt;table&gt;",
+                "tbody" => "&lt;tbody&gt;",
+                "td" => "&lt;td&gt;",
+                "tfoot" => "&lt;tfoot&gt;",
+                "th" => "&lt;th&gt;",
+                "thead" => "&lt;thead&gt;",
+                "tr" => "&lt;tr&gt;",
+                "tt" => "&lt;tt&gt;",
+                "ul" => "&lt;ul&gt;",
+                "var" => "&lt;var&gt;"
+            );
+            asort($html_list);
+            reset($html_list);
+            return $html_list;
+        }
+
+        function &getUserRankList()
+        {
+            $db =& Database::getInstance();
+            $myts =& MyTextSanitizer::getInstance();
+            $sql = "SELECT rank_id, rank_title FROM ".$db->prefix("ranks")." WHERE rank_special = 1";
+            $ret = array();
+            $result = $db->query($sql);
+            while ( $myrow = $db->fetchArray($result) ) {
+                $ret[$myrow['rank_id']] = $myts->makeTboxData4Show($myrow['rank_title']);
+            }
+            return $ret;
+        }
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/xoopstree.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xoopstree.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xoopstree.php	(revision 405)
@@ -0,0 +1,257 @@
+<?php
+// $Id: xoopstree.php,v 1.3 2005/08/03 12:39:11 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+class XoopsTree
+{
+	var $table;     //table with parent-child structure
+	var $id;    //name of unique id for records in table $table
+	var $pid;     // name of parent id used in table $table
+	var $order;    //specifies the order of query results
+	var $title;     // name of a field in table $table which will be used when  selection box and paths are generated
+	var $db;
+
+	//constructor of class XoopsTree
+	//sets the names of table, unique id, and parend id
+	function XoopsTree($table_name, $id_name, $pid_name)
+	{
+		$this->db =& Database::getInstance();
+		$this->table = $table_name;
+		$this->id = $id_name;
+		$this->pid = $pid_name;
+	}
+
+
+	// returns an array of first child objects for a given id($sel_id)
+	function getFirstChild($sel_id, $order="")
+	{
+		$arr =array();
+		$sql = "SELECT * FROM ".$this->table." WHERE ".$this->pid."=".$sel_id."";
+		if ( $order != "" ) {
+			$sql .= " ORDER BY $order";
+		}
+		$result = $this->db->query($sql);
+		$count = $this->db->getRowsNum($result);
+		if ( $count==0 ) {
+			return $arr;
+		}
+		while ( $myrow=$this->db->fetchArray($result) ) {
+			array_push($arr, $myrow);
+		}
+		return $arr;
+	}
+
+	// returns an array of all FIRST child ids of a given id($sel_id)
+	function getFirstChildId($sel_id)
+	{
+		$idarray =array();
+		$result = $this->db->query("SELECT ".$this->id." FROM ".$this->table." WHERE ".$this->pid."=".$sel_id."");
+		$count = $this->db->getRowsNum($result);
+		if ( $count == 0 ) {
+			return $idarray;
+		}
+		while ( list($id) = $this->db->fetchRow($result) ) {
+			array_push($idarray, $id);
+		}
+		return $idarray;
+	}
+
+	//returns an array of ALL child ids for a given id($sel_id)
+	function getAllChildId($sel_id, $order="", $idarray = array())
+	{
+		$sql = "SELECT ".$this->id." FROM ".$this->table." WHERE ".$this->pid."=".$sel_id."";
+		if ( $order != "" ) {
+			$sql .= " ORDER BY $order";
+		}
+		$result=$this->db->query($sql);
+		$count = $this->db->getRowsNum($result);
+		if ( $count==0 ) {
+			return $idarray;
+		}
+		while ( list($r_id) = $this->db->fetchRow($result) ) {
+			array_push($idarray, $r_id);
+			$idarray = $this->getAllChildId($r_id,$order,$idarray);
+		}
+		return $idarray;
+	}
+
+	//returns an array of ALL parent ids for a given id($sel_id)
+	function getAllParentId($sel_id, $order="", $idarray = array())
+	{
+		$sql = "SELECT ".$this->pid." FROM ".$this->table." WHERE ".$this->id."=".$sel_id."";
+		if ( $order != "" ) {
+			$sql .= " ORDER BY $order";
+		}
+		$result=$this->db->query($sql);
+		list($r_id) = $this->db->fetchRow($result);
+		if ( $r_id == 0 ) {
+			return $idarray;
+		}
+		array_push($idarray, $r_id);
+		$idarray = $this->getAllParentId($r_id,$order,$idarray);
+		return $idarray;
+	}
+
+	//generates path from the root id to a given id($sel_id)
+	// the path is delimetered with "/"
+	function getPathFromId($sel_id, $title, $path="")
+	{
+		$result = $this->db->query("SELECT ".$this->pid.", ".$title." FROM ".$this->table." WHERE ".$this->id."=$sel_id");
+		if ( $this->db->getRowsNum($result) == 0 ) {
+			return $path;
+		}
+		list($parentid,$name) = $this->db->fetchRow($result);
+		$myts =& MyTextSanitizer::getInstance();
+		$name = $myts->makeTboxData4Show($name);
+		$path = "/".$name.$path."";
+		if ( $parentid == 0 ) {
+			return $path;
+		}
+		$path = $this->getPathFromId($parentid, $title, $path);
+		return $path;
+	}
+
+	//makes a nicely ordered selection box
+	//$preset_id is used to specify a preselected item
+	//set $none to 1 to add a option with value 0
+	function makeMySelBox($title,$order="",$preset_id=0, $none=0, $sel_name="", $onchange="")
+	{
+		if ( $sel_name == "" ) {
+			$sel_name = $this->id;
+		}
+		$myts =& MyTextSanitizer::getInstance();
+		echo "<select name='".$sel_name."'";
+		if ( $onchange != "" ) {
+			echo " onchange='".$onchange."'";
+		}
+		echo ">\n";
+		$sql = "SELECT ".$this->id.", ".$title." FROM ".$this->table." WHERE ".$this->pid."=0";
+		if ( $order != "" ) {
+			$sql .= " ORDER BY $order";
+		}
+		$result = $this->db->query($sql);
+		if ( $none ) {
+			echo "<option value='0'>----</option>\n";
+		}
+		while ( list($catid, $name) = $this->db->fetchRow($result) ) {
+			$sel = "";
+			if ( $catid == $preset_id ) {
+				$sel = " selected='selected'";
+			}
+			echo "<option value='$catid'$sel>$name</option>\n";
+			$sel = "";
+			$arr = $this->getChildTreeArray($catid, $order);
+			foreach ( $arr as $option ) {
+				$option['prefix'] = str_replace(".","--",$option['prefix']);
+				$catpath = $option['prefix']."&nbsp;".$myts->makeTboxData4Show($option[$title]);
+				if ( $option[$this->id] == $preset_id ) {
+					$sel = " selected='selected'";
+				}
+				echo "<option value='".$option[$this->id]."'$sel>$catpath</option>\n";
+				$sel = "";
+			}
+		}
+		echo "</select>\n";
+	}
+
+	//generates nicely formatted linked path from the root id to a given id
+	function getNicePathFromId($sel_id, $title, $funcURL, $path="")
+	{
+		$sql = "SELECT ".$this->pid.", ".$title." FROM ".$this->table." WHERE ".$this->id."=$sel_id";
+		$result = $this->db->query($sql);
+		if ( $this->db->getRowsNum($result) == 0 ) {
+			return $path;
+		}
+		list($parentid,$name) = $this->db->fetchRow($result);
+		$myts =& MyTextSanitizer::getInstance();
+		$name = $myts->makeTboxData4Show($name);
+		$path = "<a href='".$funcURL."&amp;".$this->id."=".$sel_id."'>".$name."</a>&nbsp;:&nbsp;".$path."";
+		if ( $parentid == 0 ) {
+			return $path;
+		}
+		$path = $this->getNicePathFromId($parentid, $title, $funcURL, $path);
+		return $path;
+	}
+
+	//generates id path from the root id to a given id
+	// the path is delimetered with "/"
+	function getIdPathFromId($sel_id, $path="")
+	{
+		$result = $this->db->query("SELECT ".$this->pid." FROM ".$this->table." WHERE ".$this->id."=$sel_id");
+		if ( $this->db->getRowsNum($result) == 0 ) {
+			return $path;
+		}
+		list($parentid) = $this->db->fetchRow($result);
+		$path = "/".$sel_id.$path."";
+		if ( $parentid == 0 ) {
+			return $path;
+		}
+		$path = $this->getIdPathFromId($parentid, $path);
+		return $path;
+	}
+
+	function getAllChild($sel_id=0,$order="",$parray = array())
+	{
+		$sql = "SELECT * FROM ".$this->table." WHERE ".$this->pid."=".$sel_id."";
+		if ( $order != "" ) {
+			$sql .= " ORDER BY $order";
+		}
+		$result = $this->db->query($sql);
+		$count = $this->db->getRowsNum($result);
+		if ( $count == 0 ) {
+			return $parray;
+		}
+		while ( $row = $this->db->fetchArray($result) ) {
+			array_push($parray, $row);
+			$parray=$this->getAllChild($row[$this->id],$order,$parray);
+		}
+		return $parray;
+	}
+
+	function getChildTreeArray($sel_id=0,$order="",$parray = array(),$r_prefix="")
+	{
+		$sql = "SELECT * FROM ".$this->table." WHERE ".$this->pid."=".$sel_id."";
+		if ( $order != "" ) {
+			$sql .= " ORDER BY $order";
+		}
+		$result = $this->db->query($sql);
+		$count = $this->db->getRowsNum($result);
+		if ( $count == 0 ) {
+			return $parray;
+		}
+		while ( $row = $this->db->fetchArray($result) ) {
+			$row['prefix'] = $r_prefix.".";
+			array_push($parray, $row);
+			$parray = $this->getChildTreeArray($row[$this->id],$order,$parray,$row['prefix']);
+		}
+		return $parray;
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/downloader.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/downloader.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/downloader.php	(revision 405)
@@ -0,0 +1,141 @@
+<?php
+// $Id: downloader.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+/**
+ * Sends non HTML files through a http socket
+ * 
+ * @package     kernel
+ * @subpackage  core
+ * 
+ * @author	    Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ */
+class XoopsDownloader
+{
+
+	/**#@+
+	 * file information
+	 */
+	var $mimetype;
+	var $ext;
+	var $archiver;
+    /**#@-*/
+
+	/**
+	 * Constructor
+	 */
+	function XoopsDownloader()
+	{
+		//EMPTY
+	}
+
+	/**
+	 * Send the HTTP header
+     * 
+     * @param	string  $filename
+     * 
+     * @access	private
+	 */
+	function _header($filename)
+	{
+		if (function_exists('mb_http_output')) {
+			mb_http_output('pass');
+		}
+		header('Content-Type: '.$this->mimetype);
+		if (preg_match("/MSIE ([0-9]\.[0-9]{1,2})/", $_SERVER['HTTP_USER_AGENT'])) {
+			header('Content-Disposition: inline; filename="'.$filename.'"');
+			header('Expires: 0');
+			header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
+			header('Pragma: public');
+		} else {
+			header('Content-Disposition: attachment; filename="'.$filename.'"');
+			header('Expires: 0');
+			header('Pragma: no-cache');
+		}
+	}
+
+	/**
+	 * XoopsDownloader::addFile()
+	 * 
+	 * @param   string  $filepath
+	 * @param   string   $newfilename
+	 **/
+	function addFile($filepath, $newfilename=null)
+	{
+		//EMPTY
+	}
+
+	/**
+	 * XoopsDownloader::addBinaryFile()
+	 * 
+	 * @param   string  $filepath
+	 * @param   string  $newfilename
+	 **/
+	function addBinaryFile($filepath, $newfilename=null)
+	{
+		//EMPTY
+	}
+
+	/**
+	 * XoopsDownloader::addFileData()
+	 * 
+	 * @param   mixed     $data
+	 * @param   string    $filename
+	 * @param   integer   $time
+	 **/
+	function addFileData(&$data, $filename, $time=0)
+	{
+		//EMPTY
+	}
+
+	/**
+	 * XoopsDownloader::addBinaryFileData()
+	 * 
+	 * @param   mixed   $data
+	 * @param   string  $filename
+	 * @param   integer $time
+	 **/
+	function addBinaryFileData(&$data, $filename, $time=0)
+	{
+		//EMPTY
+	}
+
+	/**
+	 * XoopsDownloader::download()
+	 * 
+	 * @param   string  $name
+	 * @param   boolean $gzip
+	 **/
+	function download($name, $gzip = true)
+	{
+		//EMPTY
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/tree.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/tree.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/tree.php	(revision 405)
@@ -0,0 +1,227 @@
+<?php
+// $Id: tree.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.xoops.org/ http://jp.xoops.org/  http://www.myweb.ne.jp/  //
+// Project: The XOOPS Project (http://www.xoops.org/)                        //
+// ------------------------------------------------------------------------- //
+
+/**
+ * A tree structures with {@link XoopsObject}s as nodes
+ *
+ * @package		kernel
+ * @subpackage	core
+ *
+ * @author		Kazumi Ono 	<onokazu@xoops.org>
+ * @copyright	(c) 2000-2003 The Xoops Project - www.xoops.org
+ */
+class XoopsObjectTree {
+
+	/**#@+
+	 * @access	private
+	 */
+	var $_parentId;
+	var $_myId;
+	var $_rootId = null;
+	var $_tree = array();
+	var $_objects;
+    /**#@-*/
+
+	/**
+	 * Constructor
+	 * 
+	 * @param   array   $objectArr  Array of {@link XoopsObject}s 
+	 * @param   string     $myId       field name of object ID
+	 * @param   string     $parentId   field name of parent object ID
+	 * @param   string     $rootId     field name of root object ID
+	 **/
+	function XoopsObjectTree(&$objectArr, $myId, $parentId, $rootId = null)
+	{
+		$this->_objects =& $objectArr;
+		$this->_myId = $myId;
+		$this->_parentId = $parentId;
+		if (isset($rootId)) {
+			$this->_rootId = $rootId;
+		}
+		$this->_initialize();
+	}
+
+	/**
+	 * Initialize the object
+	 * 
+	 * @access	private
+	 **/
+	function _initialize()
+	{
+		foreach (array_keys($this->_objects) as $i) {
+            $key1 = $this->_objects[$i]->getVar($this->_myId);
+            $this->_tree[$key1]['obj'] =& $this->_objects[$i];
+            $key2 = $this->_objects[$i]->getVar($this->_parentId);
+            $this->_tree[$key1]['parent'] = $key2;
+            $this->_tree[$key2]['child'][] = $key1;
+			if (isset($this->_rootId)) {
+            	$this->_tree[$key1]['root'] = $this->_objects[$i]->getVar($this->_rootId);
+			}
+        }
+	}
+
+	/**
+	 * Get the tree
+	 * 
+	 * @return  array   Associative array comprising the tree 
+	 **/
+	function &getTree()
+	{
+		return $this->_tree;
+	}
+
+	/**
+	 * returns an object from the tree specified by its id
+	 * 
+	 * @param   string  $key    ID of the object to retrieve
+     * @return  object  Object within the tree
+	 **/
+	function &getByKey($key)
+	{
+		return $this->_tree[$key]['obj'];
+	}
+
+	/**
+	 * returns an array of all the first child object of an object specified by its id
+	 * 
+	 * @param   string  $key    ID of the parent object
+	 * @return  array   Array of children of the parent
+	 **/
+	function &getFirstChild($key)
+	{
+		$ret = array();
+		if (isset($this->_tree[$key]['child'])) {
+			foreach ($this->_tree[$key]['child'] as $childkey) {
+				$ret[$childkey] =& $this->_tree[$childkey]['obj'];
+			}
+		}
+		return $ret;
+	}
+
+	/**
+	 * returns an array of all child objects of an object specified by its id
+	 * 
+	 * @param   string     $key    ID of the parent
+	 * @param   array   $ret    (Empty when called from client) Array of children from previous recursions.
+	 * @return  array   Array of child nodes.
+	 **/
+	function &getAllChild($key, $ret = array())
+	{
+		if (isset($this->_tree[$key]['child'])) {
+			foreach ($this->_tree[$key]['child'] as $childkey) {
+				$ret[$childkey] =& $this->_tree[$childkey]['obj'];
+				$children =& $this->getAllChild($childkey, $ret);
+				foreach (array_keys($children) as $newkey) {
+					$ret[$newkey] =& $children[$newkey];
+				}
+			}
+		}
+		return $ret;
+	}
+
+	/**
+     * returns an array of all parent objects.
+     * the key of returned array represents how many levels up from the specified object
+	 * 
+	 * @param   string     $key    ID of the child object
+	 * @param   array   $ret    (empty when called from outside) Result from previous recursions
+	 * @param   int $uplevel (empty when called from outside) level of recursion
+	 * @return  array   Array of parent nodes. 
+	 **/
+	function &getAllParent($key, $ret = array(), $uplevel = 1)
+	{
+		if (isset($this->_tree[$key]['parent']) && isset($this->_tree[$this->_tree[$key]['parent']]['obj'])) {
+			$ret[$uplevel] =& $this->_tree[$this->_tree[$key]['parent']]['obj'];
+			$parents =& $this->getAllParent($this->_tree[$key]['parent'], $ret, $uplevel+1);
+			foreach (array_keys($parents) as $newkey) {
+				$ret[$newkey] =& $parents[$newkey];
+			}
+		}
+		return $ret;
+	}
+
+	/**
+	 * Make options for a select box from
+	 * 
+	 * @param   string  $fieldName   Name of the member variable from the
+     *  node objects that should be used as the title for the options.
+	 * @param   string  $selected    Value to display as selected
+	 * @param   int $key         ID of the object to display as the root of select options
+     * @param   string  $ret         (reference to a string when called from outside) Result from previous recursions
+	 * @param   string  $prefix_orig  String to indent items at deeper levels
+	 * @param   string  $prefix_curr  String to indent the current item
+	 * @return
+     * 
+     * @access	private 
+	 **/
+	function _makeSelBoxOptions($fieldName, $selected, $key, &$ret, $prefix_orig, $prefix_curr = '')
+	{
+        if ($key > 0) {
+            $value = $this->_tree[$key]['obj']->getVar($this->_myId);
+            $ret .= '<option value="'.$value.'"';
+			if ($value == $selected) {
+				$ret .= ' selected="selected"';
+			}
+			$ret .= '>'.$prefix_curr.$this->_tree[$key]['obj']->getVar($fieldName).'</option>';
+            $prefix_curr .= $prefix_orig;
+        }
+        if (isset($this->_tree[$key]['child']) && !empty($this->_tree[$key]['child'])) {
+            foreach ($this->_tree[$key]['child'] as $childkey) {
+                $this->_makeSelBoxOptions($fieldName, $selected, $childkey, $ret, $prefix_orig, $prefix_curr);
+            }
+        }
+	}
+
+	/**
+	 * Make a select box with options from the tree
+	 * 
+	 * @param   string  $name            Name of the select box
+	 * @param   string  $fieldName       Name of the member variable from the
+     *  node objects that should be used as the title for the options.  
+	 * @param   string  $prefix          String to indent deeper levels
+	 * @param   string  $selected        Value to display as selected
+	 * @param   bool    $addEmptyOption  Set TRUE to add an empty option with value "0" at the top of the hierarchy
+	 * @param   integer $key             ID of the object to display as the root of select options
+	 * @return  string  HTML select box
+	 **/
+	function &makeSelBox($name, $fieldName, $prefix='-', $selected='', $addEmptyOption = false, $key=0)
+    {
+        $ret = '<select name='.$name.'>';
+        if (false != $addEmptyOption) {
+            $ret .= '<option value="0"></option>';
+        }
+        $this->_makeSelBoxOptions($fieldName, $selected, $key, $ret, $prefix);
+        return $ret.'</select>';
+    }
+
+
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/module.textsanitizer.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/module.textsanitizer.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/module.textsanitizer.php	(revision 405)
@@ -0,0 +1,612 @@
+<?php
+// $Id: module.textsanitizer.php,v 1.8 2006/07/27 00:17:17 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (http://www.myweb.ne.jp/, http://jp.xoops.org/)        //
+//         Goghs Cheng (http://www.eqiao.com, http://www.devbeez.com/)       //
+// Project: The XOOPS Project (http://www.xoops.org/)                        //
+// ------------------------------------------------------------------------- //
+
+/**
+ * Class to "clean up" text for various uses
+ *
+ * <b>Singleton</b>
+ *
+ * @package     kernel
+ * @subpackage  core
+ *
+ * @author      Kazumi Ono  <onokazu@xoops.org>
+ * @author      Goghs Cheng
+ * @copyright   (c) 2000-2003 The Xoops Project - www.xoops.org
+ */
+class MyTextSanitizer
+{
+    /**
+     * @var array
+     */
+    var $smileys = array();
+
+    /**
+     *
+     */
+    var $censorConf;
+
+    /*
+    * Constructor of this class
+    *
+    * Gets allowed html tags from admin config settings
+    * <br> should not be allowed since nl2br will be used
+    * when storing data.
+    *
+    * @access   private
+    *
+    * @todo Sofar, this does nuttin' ;-)
+    */
+    function MyTextSanitizer()
+    {
+
+    }
+
+    /**
+     * Access the only instance of this class
+     *
+     * @return  object
+     *
+     * @static
+     * @staticvar   object
+     */
+    function &getInstance()
+    {
+        static $instance;
+        if (!isset($instance)) {
+            $instance = new MyTextSanitizer();
+        }
+        return $instance;
+    }
+
+    /**
+     * Get the smileys
+     *
+     * @return  array
+     */
+    function getSmileys()
+    {
+        return $this->smileys;
+    }
+
+    /**
+     * Replace emoticons in the message with smiley images
+     *
+     * @param   string  $message
+     *
+     * @return  string
+     */
+    function &smiley($message)
+    {
+        $db =& Database::getInstance();
+        if (count($this->smileys) == 0) {
+            if ($getsmiles = $db->query("SELECT * FROM ".$db->prefix("smiles"))){
+                while ($smiles = $db->fetchArray($getsmiles)) {
+                    $message = str_replace($smiles['code'], '<img src="'.XOOPS_UPLOAD_URL.'/'.htmlspecialchars($smiles['smile_url']).'" alt="" />', $message);
+                    array_push($this->smileys, $smiles);
+                }
+            }
+        }
+        elseif (is_array($this->smileys)) {
+            foreach ($this->smileys as $smile) {
+                $message = str_replace($smile['code'], '<img src="'.XOOPS_UPLOAD_URL.'/'.htmlspecialchars($smile['smile_url']).'" alt="" />', $message);
+            }
+        }
+        return $message;
+    }
+
+    /**
+     * Make links in the text clickable
+     *
+     * @param   string  $text
+     * @return  string
+     **/
+    function &makeClickable(&$text)
+    {
+        $patterns = array("/(^|[^]_a-z0-9-=\"'\/])([a-z]+?):\/\/([^, \r\n\"\(\)'<>]+)/i", "/(^|[^]_a-z0-9-=\"'\/])www\.([a-z0-9\-]+)\.([^, \r\n\"\(\)'<>]+)/i", "/(^|[^]_a-z0-9-=\"'\/])ftp\.([a-z0-9\-]+)\.([^, \r\n\"\(\)'<>]+)/i", "/(^|[^]_a-z0-9-=\"'\/:\.])([a-z0-9\-_\.]+?)@([^, \r\n\"\(\)'<>\[\]]+)/i");
+        $replacements = array("\\1<a href=\"\\2://\\3\" target=\"_blank\">\\2://\\3</a>", "\\1<a href=\"http://www.\\2.\\3\" target=\"_blank\">www.\\2.\\3</a>", "\\1<a href=\"ftp://ftp.\\2.\\3\" target=\"_blank\">ftp.\\2.\\3</a>", "\\1<a href=\"mailto:\\2@\\3\">\\2@\\3</a>");
+        $ret = preg_replace($patterns, $replacements, $text);
+        return $ret;
+    }
+
+    /**
+     * Replace XoopsCodes with their equivalent HTML formatting
+     *
+     * @param   string  $text
+     * @param   bool    $allowimage Allow images in the text?
+     *                              On FALSE, uses links to images.
+     * @return  string
+     **/
+    function &xoopsCodeDecode(&$text, $allowimage = 1)
+    {
+        $imgCallbackPattern = "/\[img( align=\w+)]([^\"\(\)\?\&'<>]*)\[\/img\]/sU";
+        $text = preg_replace_callback($imgCallbackPattern, array($this, '_filterImgUrl'), $text);
+
+        $patterns = array();
+        $replacements = array();
+        // RMV: added new markup for intrasite url (allows easier site moves)
+        // TODO: automatically convert other URLs to this format if XOOPS_URL matches??
+        $patterns[] = "/\[siteurl=(['\"]?)([^\"'<>]*)\\1](.*)\[\/siteurl\]/sU";
+        $replacements[] = '<a href="'.XOOPS_URL.'/\\2" target="_blank">\\3</a>';
+        $patterns[] = "/\[url=(['\"]?)(http[s]?:\/\/[^\"'<>]*)\\1](.*)\[\/url\]/sU";
+        $replacements[] = '<a href="\\2" target="_blank">\\3</a>';
+        $patterns[] = "/\[url=(['\"]?)(ftp?:\/\/[^\"'<>]*)\\1](.*)\[\/url\]/sU";
+        $replacements[] = '<a href="\\2" target="_blank">\\3</a>';
+        $patterns[] = "/\[url=(['\"]?)([^\"'<>]*)\\1](.*)\[\/url\]/sU";
+        $replacements[] = '<a href="http://\\2" target="_blank">\\3</a>';
+        $patterns[] = "/\[color=(['\"]?)([a-zA-Z0-9]*)\\1](.*)\[\/color\]/sU";
+        $replacements[] = '<span style="color: #\\2;">\\3</span>';
+        $patterns[] = "/\[size=(['\"]?)([a-z0-9-]*)\\1](.*)\[\/size\]/sU";
+        $replacements[] = '<span style="font-size: \\2;">\\3</span>';
+        $patterns[] = "/\[font=(['\"]?)([^;<>\*\(\)\"']*)\\1](.*)\[\/font\]/sU";
+        $replacements[] = '<span style="font-family: \\2;">\\3</span>';
+        $patterns[] = "/\[email]([^;<>\*\(\)\"']*)\[\/email\]/sU";
+        $replacements[] = '<a href="mailto:\\1">\\1</a>';
+        $patterns[] = "/\[b](.*)\[\/b\]/sU";
+        $replacements[] = '<b>\\1</b>';
+        $patterns[] = "/\[i](.*)\[\/i\]/sU";
+        $replacements[] = '<i>\\1</i>';
+        $patterns[] = "/\[u](.*)\[\/u\]/sU";
+        $replacements[] = '<u>\\1</u>';
+        $patterns[] = "/\[d](.*)\[\/d\]/sU";
+        $replacements[] = '<del>\\1</del>';
+        //$patterns[] = "/\[li](.*)\[\/li\]/sU";
+        //$replacements[] = '<li>\\1</li>';
+        $patterns[] = "/\[img align=(['\"]?)(left|center|right)\\1]([^\"\(\)\?\&'<>]*)\[\/img\]/sU";
+        $patterns[] = "/\[img]([^\"\(\)\?\&'<>]*)\[\/img\]/sU";
+        $patterns[] = "/\[img align=(['\"]?)(left|center|right)\\1 id=(['\"]?)([0-9]*)\\3]([^\"\(\)\?\&'<>]*)\[\/img\]/sU";
+        $patterns[] = "/\[img id=(['\"]?)([0-9]*)\\1]([^\"\(\)\?\&'<>]*)\[\/img\]/sU";
+        if ($allowimage != 1) {
+            $replacements[] = '<a href="\\3" target="_blank">\\3</a>';
+            $replacements[] = '<a href="\\1" target="_blank">\\1</a>';
+            $replacements[] = '<a href="'.XOOPS_URL.'/image.php?id=\\4" target="_blank">\\5</a>';
+            $replacements[] = '<a href="'.XOOPS_URL.'/image.php?id=\\2" target="_blank">\\3</a>';
+        } else {
+            $replacements[] = '<img src="\\3" align="\\2" alt="" />';
+            $replacements[] = '<img src="\\1" alt="" />';
+            $replacements[] = '<img src="'.XOOPS_URL.'/image.php?id=\\4" align="\\2" alt="\\5" />';
+            $replacements[] = '<img src="'.XOOPS_URL.'/image.php?id=\\2" alt="\\3" />';
+        }
+        $patterns[] = "/\[quote]/sU";
+        $replacements[] = _QUOTEC.'<div class="xoopsQuote"><blockquote>';
+        //$replacements[] = 'Quote: <div class="xoopsQuote"><blockquote>';
+        $patterns[] = "/\[\/quote]/sU";
+        $replacements[] = '</blockquote></div>';
+        $patterns[] = "/javascript:/si";
+        $replacements[] = "java script:";
+        $patterns[] = "/about:/si";
+        $replacements[] = "about :";
+        $ret = preg_replace($patterns, $replacements, $text);
+        return $ret;
+    }
+
+    /**
+     * Filters out invalid strings included in URL, if any
+     *
+     * @param   array  $matches
+     * @return  string
+     */
+    function _filterImgUrl($matches)
+    {
+        if ($this->checkUrlString($matches[2])) {
+            return $matches[0];
+        } else {
+            return "";
+        }
+    }
+
+    /**
+     * Checks if invalid strings are included in URL
+     *
+     * @param   string  $text
+     * @return  bool
+     */
+    function checkUrlString($text)
+    {
+        // Check control code
+        if (preg_match("/[\\0-\\31]/", $text)) {
+            return false;
+        }
+        // check black pattern(deprecated)
+        return !preg_match("/^(javascript|vbscript|about):/i", $text);
+    }
+
+    /**
+     * Convert linebreaks to <br /> tags
+     *
+     * @param   string  $text
+     *
+     * @return  string
+     */
+    function &nl2Br($text)
+    {
+        $ret = preg_replace("/(\015\012)|(\015)|(\012)/","<br />",$text);
+        return $ret;
+    }
+
+    /**
+     * Add slashes to the text if magic_quotes_gpc is turned off.
+     *
+     * @param   string  $text
+     * @return  string
+     **/
+    function &addSlashes($text)
+    {
+        if (!get_magic_quotes_gpc()) {
+            $text = addslashes($text);
+        }
+        return $text;
+    }
+    /*
+    * if magic_quotes_gpc is on, stirip back slashes
+    *
+    * @param    string  $text
+    *
+    * @return   string
+    */
+    function &stripSlashesGPC($text)
+    {
+        if (get_magic_quotes_gpc()) {
+            $text = stripslashes($text);
+        }
+        return $text;
+    }
+
+    /*
+    *  for displaying data in html textbox forms
+    *
+    * @param    string  $text
+    *
+    * @return   string
+    */
+    function &htmlSpecialChars($text)
+    {
+        //return preg_replace("/&amp;/i", '&', htmlspecialchars($text, ENT_QUOTES));
+        $ret = preg_replace(array("/&amp;/i", "/&nbsp;/i"), array('&', '&amp;nbsp;'), htmlspecialchars($text, ENT_QUOTES));
+        return $ret;
+    }
+
+    /**
+     * Reverses {@link htmlSpecialChars()}
+     *
+     * @param   string  $text
+     * @return  string
+     **/
+    function &undoHtmlSpecialChars(&$text)
+    {
+        return preg_replace(array("/&gt;/i", "/&lt;/i", "/&quot;/i", "/&#039;/i"), array(">", "<", "\"", "'"), $text);
+    }
+
+    /**
+     * Filters textarea form data in DB for display
+     *
+     * @param   string  $text
+     * @param   bool    $html   allow html?
+     * @param   bool    $smiley allow smileys?
+     * @param   bool    $xcode  allow xoopscode?
+     * @param   bool    $image  allow inline images?
+     * @param   bool    $br     convert linebreaks?
+     * @return  string
+     **/
+    function &displayTarea(&$text, $html = 0, $smiley = 1, $xcode = 1, $image = 1, $br = 1)
+    {
+        if ($html != 1) {
+            // html not allowed
+            $text =& $this->htmlSpecialChars($text);
+        }
+        $text = $this->codePreConv($text, $xcode); // Ryuji_edit(2003-11-18)
+        $text =& $this->makeClickable($text);
+        if ($smiley != 0) {
+            // process smiley
+            $text =& $this->smiley($text);
+        }
+        if ($xcode != 0) {
+            // decode xcode
+            if ($image != 0) {
+                // image allowed
+                $text =& $this->xoopsCodeDecode($text);
+                    } else {
+                        // image not allowed
+                        $text =& $this->xoopsCodeDecode($text, 0);
+            }
+        }
+        if ($br != 0) {
+            $text =& $this->nl2Br($text);
+        }
+        $text = $this->codeConv($text, $xcode, $image);    // Ryuji_edit(2003-11-18)
+        return $text;
+    }
+
+    /**
+     * Filters textarea form data submitted for preview
+     *
+     * @param   string  $text
+     * @param   bool    $html   allow html?
+     * @param   bool    $smiley allow smileys?
+     * @param   bool    $xcode  allow xoopscode?
+     * @param   bool    $image  allow inline images?
+     * @param   bool    $br     convert linebreaks?
+     * @return  string
+     **/
+    function &previewTarea(&$text, $html = 0, $smiley = 1, $xcode = 1, $image = 1, $br = 1)
+    {
+        $text =& $this->stripSlashesGPC($text);
+        if ($html != 1) {
+            // html not allowed
+            $text =& $this->htmlSpecialChars($text);
+        }
+        $text = $this->codePreConv($text, $xcode); // Ryuji_edit(2003-11-18)
+        $text =& $this->makeClickable($text);
+        if ($smiley != 0) {
+            // process smiley
+            $text =& $this->smiley($text);
+        }
+        if ($xcode != 0) {
+            // decode xcode
+            if ($image != 0) {
+                // image allowed
+                $text =& $this->xoopsCodeDecode($text);
+            } else {
+                // image not allowed
+                $text =& $this->xoopsCodeDecode($text, 0);
+            }
+        }
+        if ($br != 0) {
+            $text =& $this->nl2Br($text);
+        }
+        $text = $this->codeConv($text, $xcode, $image);    // Ryuji_edit(2003-11-18)
+        return $text;
+    }
+
+    /**
+     * Replaces banned words in a string with their replacements
+     *
+     * @param   string $text
+     * @return  string
+     *
+     * @deprecated
+     **/
+    function &censorString(&$text)
+    {
+        if (!isset($this->censorConf)) {
+            $config_handler =& xoops_gethandler('config');
+            $this->censorConf =& $config_handler->getConfigsByCat(XOOPS_CONF_CENSOR);
+        }
+        if ($this->censorConf['censor_enable'] == 1) {
+            $replacement = $this->censorConf['censor_replace'];
+            foreach ($this->censorConf['censor_words'] as $bad) {
+                if ( !empty($bad) ) {
+                    $bad = quotemeta($bad);
+                    $patterns[] = "/(\s)".$bad."/siU";
+                    $replacements[] = "\\1".$replacement;
+                    $patterns[] = "/^".$bad."/siU";
+                    $replacements[] = $replacement;
+                    $patterns[] = "/(\n)".$bad."/siU";
+                    $replacements[] = "\\1".$replacement;
+                    $patterns[] = "/]".$bad."/siU";
+                    $replacements[] = "]".$replacement;
+                    $text = preg_replace($patterns, $replacements, $text);
+                }
+            }
+        }
+        return $text;
+    }
+
+
+    /**#@+
+     * Sanitizing of [code] tag
+     */
+    function codePreConv($text, $xcode = 1) {
+        if($xcode != 0){
+            $patterns = "/\[code](.*)\[\/code\]/esU";
+            $replacements = "'[code]'.base64_encode('$1').'[/code]'";
+            $text =  preg_replace($patterns, $replacements, $text);
+        }
+        return $text;
+    }
+
+    function codeConv($text, $xcode = 1, $image = 1){
+        if($xcode != 0){
+            $patterns = "/\[code](.*)\[\/code\]/esU";
+            if ($image != 0) {
+                // image allowed
+                $replacements = "'<div class=\"xoopsCode\"><pre><code>'.MyTextSanitizer::codeSanitizer('$1').'</code></pre></div>'";
+                //$text =& $this->xoopsCodeDecode($text);
+            } else {
+                // image not allowed
+                $replacements = "'<div class=\"xoopsCode\"><pre><code>'.MyTextSanitizer::codeSanitizer('$1', 0).'</code></pre></div>'";
+                //$text =& $this->xoopsCodeDecode($text, 0);
+            }
+            $text =  preg_replace($patterns, $replacements, $text);
+        }
+        return $text;
+    }
+
+    function codeSanitizer($str, $image = 1){
+        if($image != 0){
+            $str = $this->xoopsCodeDecode(
+                $this->htmlSpecialChars(str_replace('\"', '"', base64_decode($str)))
+                );
+        }else{
+            $str = $this->xoopsCodeDecode(
+                $this->htmlSpecialChars(str_replace('\"', '"', base64_decode($str))),0
+                );
+        }
+        return $str;
+    }
+
+
+    /**#@-*/
+
+
+##################### Deprecated Methods ######################
+
+    /**#@+
+     * @deprecated
+     */
+    function sanitizeForDisplay($text, $allowhtml = 0, $smiley = 1, $bbcode = 1)
+    {
+        if ( $allowhtml == 0 ) {
+            $text = $this->htmlSpecialChars($text);
+        } else {
+            //$config =& $GLOBALS['xoopsConfig'];
+            //$allowed = $config['allowed_html'];
+            //$text = strip_tags($text, $allowed);
+            $text = $this->makeClickable($text);
+        }
+        if ( $smiley == 1 ) {
+            $text = $this->smiley($text);
+        }
+        if ( $bbcode == 1 ) {
+            $text = $this->xoopsCodeDecode($text);
+        }
+        $text = $this->nl2Br($text);
+        return $text;
+    }
+
+    function sanitizeForPreview($text, $allowhtml = 0, $smiley = 1, $bbcode = 1)
+    {
+        $text = $this->oopsStripSlashesGPC($text);
+        if ( $allowhtml == 0 ) {
+            $text = $this->htmlSpecialChars($text);
+        } else {
+            //$config =& $GLOBALS['xoopsConfig'];
+            //$allowed = $config['allowed_html'];
+            //$text = strip_tags($text, $allowed);
+            $text = $this->makeClickable($text);
+        }
+        if ( $smiley == 1 ) {
+            $text = $this->smiley($text);
+        }
+        if ( $bbcode == 1 ) {
+            $text = $this->xoopsCodeDecode($text);
+        }
+        $text = $this->nl2Br($text);
+        return $text;
+    }
+
+    function makeTboxData4Save($text)
+    {
+        //$text = $this->undoHtmlSpecialChars($text);
+        return $this->addSlashes($text);
+    }
+
+    function makeTboxData4Show($text, $smiley=0)
+    {
+        $text = $this->htmlSpecialChars($text);
+        return $text;
+    }
+
+    function makeTboxData4Edit($text)
+    {
+        return $this->htmlSpecialChars($text);
+    }
+
+    function makeTboxData4Preview($text, $smiley=0)
+    {
+        $text = $this->stripSlashesGPC($text);
+        $text = $this->htmlSpecialChars($text);
+        return $text;
+    }
+
+    function makeTboxData4PreviewInForm($text)
+    {
+        $text = $this->stripSlashesGPC($text);
+        return $this->htmlSpecialChars($text);
+    }
+
+    function makeTareaData4Save($text)
+    {
+        return $this->addSlashes($text);
+    }
+
+    function &makeTareaData4Show(&$text, $html=1, $smiley=1, $xcode=1)
+    {
+        $ret = $this->displayTarea($text, $html, $smiley, $xcode);
+        return $ret;
+    }
+
+    function makeTareaData4Edit($text)
+    {
+        return $this->htmlSpecialChars($text);
+    }
+
+    function &makeTareaData4Preview(&$text, $html=1, $smiley=1, $xcode=1)
+    {
+        $ret = $this->previewTarea($text, $html, $smiley, $xcode);
+        return $ret;
+    }
+
+    function makeTareaData4PreviewInForm($text)
+    {
+        //if magic_quotes_gpc is on, do stipslashes
+        $text = $this->stripSlashesGPC($text);
+        return $this->htmlSpecialChars($text);
+    }
+
+    function makeTareaData4InsideQuotes($text)
+    {
+        return $this->htmlSpecialChars($text);
+    }
+
+    function &oopsStripSlashesGPC($text)
+    {
+        $ret = $this->stripSlashesGPC($text);
+        return $ret;
+    }
+
+    function &oopsStripSlashesRT($text)
+    {
+        if (get_magic_quotes_runtime()) {
+            $text =& stripslashes($text);
+        }
+        return $text;
+    }
+
+    function &oopsAddSlashes($text)
+    {
+        $ret = $this->addSlashes($text);
+        return $ret;
+    }
+
+    function &oopsHtmlSpecialChars($text)
+    {
+        $ret = $this->htmlSpecialChars($text);
+        return $ret;
+    }
+
+    function &oopsNl2Br($text)
+    {
+        $ret = $this->nl2br($text);
+        return $ret;
+    }
+    /**#@-*/
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/xoopsmailer.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xoopsmailer.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xoopsmailer.php	(revision 405)
@@ -0,0 +1,546 @@
+<?php
+// $Id: xoopsmailer.php,v 1.3 2006/05/01 02:37:24 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+if (isset($GLOBALS['xoopsConfig']['language']) && file_exists(XOOPS_ROOT_PATH.'/language/'.$GLOBALS['xoopsConfig']['language'].'/mail.php')) {
+	include_once XOOPS_ROOT_PATH.'/language/'.$GLOBALS['xoopsConfig']['language'].'/mail.php';
+} else {
+	include_once XOOPS_ROOT_PATH.'/language/english/mail.php';
+}
+
+/**
+ * The new Multimailer class that will carry out the actual sending and will later replace this class. 
+ * If you're writing new code, please use that class instead.
+ */
+include_once(XOOPS_ROOT_PATH."/class/mail/xoopsmultimailer.php");
+
+
+/**
+ * Class for sending mail.
+ *
+ * Changed to use the facilities of  {@link XoopsMultiMailer}
+ *
+ * @deprecated	use {@link XoopsMultiMailer} instead.
+ *
+ * @package		class
+ * @subpackage	mail
+ *
+ * @author		Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	(c) 2000-2003 The Xoops Project - www.xoops.org
+ */
+class XoopsMailer
+{
+	/**
+	 * reference to a {@link XoopsMultiMailer}
+	 *
+	 * @var		XoopsMultiMailer
+	 * @access	private
+	 * @since	21.02.2003 14:14:13
+	 */
+	var $multimailer;
+
+	// sender email address
+	// private
+	var $fromEmail;
+
+	// sender name
+	// private
+	var $fromName;
+
+	// RMV-NOTIFY
+	// sender UID
+	// private
+	var $fromUser;
+
+	// array of user class objects
+	// private
+	var $toUsers;
+
+	// array of email addresses
+	// private
+	var $toEmails;
+
+	// custom headers
+	// private
+	var $headers;
+
+	// subjet of mail
+	// private
+	var $subject;
+
+	// body of mail
+	// private
+	var $body;
+
+	// error messages
+	// private
+	var $errors;
+
+	// messages upon success
+	// private
+	var $success;
+
+	// private
+	var $isMail;
+
+	// private
+	var $isPM;
+
+	// private
+	var $assignedTags;
+
+	// private
+	var $template;
+
+	// private
+	var $templatedir;
+
+	// protected
+	var $charSet = 'iso-8859-1';
+
+	// protected
+	var $encoding = '8bit';
+
+	function XoopsMailer()
+	{
+
+		$this->multimailer = new XoopsMultiMailer();
+		$this->reset();
+	}
+
+	// public
+	// reset all properties to default
+	function reset()
+	{
+		$this->fromEmail = "";
+		$this->fromName = "";
+		$this->fromUser = null; // RMV-NOTIFY
+		$this->priority = '';
+		$this->toUsers = array();
+		$this->toEmails = array();
+		$this->headers = array();
+		$this->subject = "";
+		$this->body = "";
+		$this->errors = array();
+		$this->success = array();
+		$this->isMail = false;
+		$this->isPM = false;
+		$this->assignedTags = array();
+		$this->template = "";
+		$this->templatedir = "";
+		// Change below to \r\n if you have problem sending mail
+		$this->LE ="\n";
+	}
+
+	// public
+	function setTemplateDir($value)
+	{
+		if ( substr($value, -1, 1) != "/" ) {
+			$value .= "/";
+		}
+		$this->templatedir = $value;
+	}
+
+	// public
+	function setTemplate($value)
+	{
+		$this->template = $value;
+	}
+
+	// pupblic
+	function setFromEmail($value)
+	{
+        if ($this->_checkValidEmail($value)) {
+			$this->fromEmail = trim($value);
+		}
+    }
+
+	// public
+	function setFromName($value)
+	{
+        if ($this->_checkNoneContorolChar($value)) {
+			$this->fromName = trim($value);
+		}
+    }
+
+	// RMV-NOTIFY
+	// public
+	function setFromUser(&$user)
+	{
+        if ( strtolower(get_class($user)) == "xoopsuser" ) {
+			$this->fromUser =& $user;
+		}
+	}
+
+	// public
+	function setPriority($value)
+	{
+        if ($this->_checkNoneContorolChar($value)) {
+			$this->priority = trim($value);
+		}
+    }
+
+
+	// public
+	function setSubject($value)
+	{
+        if ($this->_checkNoneContorolChar($value)) {
+			$this->subject = trim($value);
+		}
+    }
+
+	// public
+	function setBody($value)
+	{
+		$this->body = trim($value);
+	}
+
+	// public
+	function useMail()
+	{
+		$this->isMail = true;
+	}
+
+	// public
+	function usePM()
+	{
+		$this->isPM = true;
+	}
+
+	// public
+	function send($debug = false)
+	{
+		global $xoopsConfig;
+		if ( $this->body == "" && $this->template == "" ) {
+			if ($debug) {
+				$this->errors[] = _MAIL_MSGBODY;
+			}
+			return false;
+		} elseif ( $this->template != "" ) {
+			$path = ( $this->templatedir != "" ) ? $this->templatedir."".$this->template : (XOOPS_ROOT_PATH."/language/".$xoopsConfig['language']."/mail_template/".$this->template);
+			if ( !($fd = @fopen($path, 'r')) ) {
+				if ($debug) {
+					$this->errors[] = _MAIL_FAILOPTPL;
+				}
+            			return false;
+        		}
+			$this->setBody(fread($fd, filesize($path)));
+		}
+
+		// for sending mail only
+		if ( $this->isMail  || !empty($this->toEmails) ) {
+			if (!empty($this->priority)) {
+				$this->headers[] = "X-Priority: " . $this->priority;
+			}
+			$this->headers[] = "X-Mailer: XOOPS Cube";
+            if (!empty($this->fromEmail)) {
+				$this->headers[] = "Return-Path: ".$this->fromEmail;
+            }
+			$headers = join($this->LE, $this->headers);
+		}
+
+// TODO: we should have an option of no-reply for private messages and emails
+// to which we do not accept replies.  e.g. the site admin doesn't want a
+// a lot of message from people trying to unsubscribe.  Just make sure to
+// give good instructions in the message.
+
+		// add some standard tags (user-dependent tags are included later)
+		global $xoopsConfig;
+		$this->assign ('X_ADMINMAIL', $xoopsConfig['adminmail']);
+		$this->assign ('X_SITENAME', $xoopsConfig['sitename']);
+		$this->assign ('X_SITEURL', XOOPS_URL);
+		// TODO: also X_ADMINNAME??
+		// TODO: X_SIGNATURE, X_DISCLAIMER ?? - these are probably best
+		//  done as includes if mail templates ever get this sophisticated
+
+		// replace tags with actual values
+		foreach ( $this->assignedTags as $k => $v ) {
+			$this->body = str_replace("{".$k."}", $v, $this->body);
+			$this->subject = str_replace("{".$k."}", $v, $this->subject);
+		}
+		$this->body = str_replace("\r\n", "\n", $this->body);
+		$this->body = str_replace("\r", "\n", $this->body);
+		$this->body = str_replace("\n", $this->LE, $this->body);
+
+		// send mail to specified mail addresses, if any
+		foreach ( $this->toEmails as $mailaddr ) {
+			if ( !$this->sendMail($mailaddr, $this->subject, $this->body, $headers) ) {
+				if ($debug) {
+					$this->errors[] = sprintf(_MAIL_SENDMAILNG, $mailaddr);
+				}
+			} else {
+				if ($debug) {
+					$this->success[] = sprintf(_MAIL_MAILGOOD, $mailaddr);
+				}
+			}
+		}
+
+		// send message to specified users, if any
+
+		// NOTE: we don't send to LIST of recipients, because the tags
+		// below are dependent on the user identity; i.e. each user
+		// receives (potentially) a different message
+
+		foreach ( $this->toUsers as $user ) {
+			// set some user specific variables
+			$subject = str_replace("{X_UNAME}", $user->getVar("uname"), $this->subject );
+			$text = str_replace("{X_UID}", $user->getVar("uid"), $this->body );
+			$text = str_replace("{X_UEMAIL}", $user->getVar("email"), $text );
+			$text = str_replace("{X_UNAME}", $user->getVar("uname"), $text );
+			$text = str_replace("{X_UACTLINK}", XOOPS_URL."/user.php?op=actv&id=".$user->getVar("uid")."&actkey=".$user->getVar('actkey'), $text );
+			// send mail
+			if ( $this->isMail ) {
+				if ( !$this->sendMail($user->getVar("email"), $subject, $text, $headers) ) {
+					if ($debug) {
+						$this->errors[] = sprintf(_MAIL_SENDMAILNG, $user->getVar("uname"));
+					}
+				} else {
+					if ($debug) {
+						$this->success[] = sprintf(_MAIL_MAILGOOD, $user->getVar("uname"));
+					}
+				}
+			}
+			// send private message
+			if ( $this->isPM ) {
+				if ( !$this->sendPM($user->getVar("uid"), $subject, $text) ) {
+					if ($debug) {
+						$this->errors[] = sprintf(_MAIL_SENDPMNG, $user->getVar("uname"));
+					}
+				} else {
+					if ($debug) {
+						$this->success[] = sprintf(_MAIL_PMGOOD, $user->getVar("uname"));
+					}
+				}
+			}
+			flush();
+		}
+		if ( count($this->errors) > 0 ) {
+			return false;
+		}
+		return true;
+	}
+
+	// private
+	function sendPM($uid, $subject, $body)
+	{
+		global $xoopsUser;
+		$pm_handler =& xoops_gethandler('privmessage');
+		$pm =& $pm_handler->create();
+		$pm->setVar("subject", $subject);
+		// RMV-NOTIFY
+		$pm->setVar('from_userid', !empty($this->fromUser) ? $this->fromUser->getVar('uid') : $xoopsUser->getVar('uid'));
+		$pm->setVar("msg_text", $body);
+		$pm->setVar("to_userid", $uid);
+		if (!$pm_handler->insert($pm)) {
+			return false;
+		}
+		return true;
+	}
+
+	/**
+	 * Send email
+	 *
+	 * Uses the new XoopsMultiMailer
+	 *
+	 * @param	string
+	 * @param	string
+	 * @param	string
+	 * @return	boolean	FALSE on error.
+	 */
+
+	function sendMail($email, $subject, $body, $headers)
+	{
+		$subject = $this->encodeSubject($subject);
+		$this->encodeBody($body);
+		$this->multimailer->ClearAllRecipients();
+		$this->multimailer->AddAddress($email);
+		$this->multimailer->Subject = $subject;
+		$this->multimailer->Body = $body;
+		$this->multimailer->CharSet = $this->charSet;
+		$this->multimailer->Encoding = $this->encoding;
+		if (!empty($this->fromName)) {
+			$this->multimailer->FromName = $this->encodeFromName($this->fromName);
+		}
+		if (!empty($this->fromEmail)) {
+			$this->multimailer->From = $this->fromEmail;
+		}
+		$this->multimailer->ClearCustomHeaders();
+		foreach ($this->headers as $header) {
+			$this->multimailer->AddCustomHeader($header);
+		}
+		if (!$this->multimailer->Send()) {
+		    $this->errors[] = $this->multimailer->ErrorInfo;
+			return FALSE;
+		}
+		return TRUE;
+	}
+
+	// public
+	function getErrors($ashtml = true)
+	{
+		if ( !$ashtml ) {
+			return $this->errors;
+		} else {
+			if ( !empty($this->errors) ) {
+				$ret = "<h4>"._ERRORS."</h4>";
+				foreach ( $this->errors as $error ) {
+					$ret .= $error."<br />";
+				}
+			} else {
+				$ret = "";
+			}
+			return $ret;
+		}
+	}
+
+	// public
+	function getSuccess($ashtml = true)
+	{
+		if ( !$ashtml ) {
+			return $this->success;
+		} else {
+			$ret = "";
+			if ( !empty($this->success) ) {
+				foreach ( $this->success as $suc ) {
+					$ret .= $suc."<br />";
+				}
+			}
+			return $ret;
+		}
+	}
+
+	// public
+	function assign($tag, $value=null)
+	{
+		if ( is_array($tag) ) {
+			foreach ( $tag as $k => $v ) {
+				$this->assign($k, $v);
+			}
+		} else {
+			if ( !empty($tag) && isset($value) ) {
+				$tag = strtoupper(trim($tag));
+// RMV-NOTIFY
+// TEMPORARY FIXME: until the X_tags are all in here
+//				if ( substr($tag, 0, 2) != "X_" ) {
+					$this->assignedTags[$tag] = $value;
+//				}
+			}
+		}
+	}
+
+	// public
+	function addHeaders($value)
+	{
+        if ($this->_checkNoneContorolChar($value)) {
+			$this->headers[] = trim($value).$this->LE;
+		}
+    }
+
+	// public
+	function setToEmails($email)
+	{
+		if ( !is_array($email) ) {
+            if ($this->_checkValidEmail($email)) {
+				array_push($this->toEmails, $email);
+			}
+		} else {
+			foreach ( $email as $e) {
+				$this->setToEmails($e);
+			}
+		}
+	}
+
+	// public
+	function setToUsers(&$user)
+	{
+		if ( !is_array($user) ) {
+			if ( strtolower(get_class($user)) == "xoopsuser" ) {
+				array_push($this->toUsers, $user);
+			}
+		} else {
+			foreach ( $user as $u) {
+				$this->setToUsers($u);
+			}
+		}
+	}
+
+	// public
+	function setToGroups($group)
+	{
+		if ( !is_array($group) ) {
+			if ( strtolower(get_class($group)) == "xoopsgroup" ) {
+				$member_handler =& xoops_gethandler('member');
+				$groups=&$member_handler->getUsersByGroup($group->getVar('groupid'),true);
+				$this->setToUsers($groups, true);
+			}
+		} else {
+			foreach ($group as $g) {
+				$this->setToGroups($g);
+			}
+		}
+	}
+
+	// abstract
+	// to be overidden by lang specific mail class, if needed
+	function encodeFromName($text)
+	{
+		return $text;
+	}
+
+	// abstract
+	// to be overidden by lang specific mail class, if needed
+	function encodeSubject($text)
+	{
+		return $text;
+	}
+
+	// abstract
+	// to be overidden by lang specific mail class, if needed
+	function encodeBody(&$text)
+	{
+
+	}
+    
+    function _checkNoneContorolChar($text) {
+        if (preg_match("/[\\0-\\31]/", $text)) {
+            $this->errors[] = "Invalid Mail Header String."; //ToDo : Use message catalog
+            return false;
+        }
+        return true;
+    }
+    function _checkValidEmail($addr) {
+        if (!preg_match("/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+([\.][a-z0-9-]+)+$/i",$addr) ) {
+            $this->errors[] = "Invalid Mail Address Format."; //ToDo : Use message catalog;
+            return false;
+        }
+        return true;
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/criteria.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/criteria.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/criteria.php	(revision 405)
@@ -0,0 +1,376 @@
+<?php
+// $Id: criteria.php,v 1.6 2006/07/27 00:17:17 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+// Modified by: Nathan Dial                                                  //
+// Date: 20 March 2003                                                       //
+// Desc: added experimental LDAP filter generation code                      //
+//       also refactored to remove about 20 lines of redundant code.         //
+// ------------------------------------------------------------------------- //
+
+/**
+ *
+ *
+ * @package     kernel
+ * @subpackage  database
+ *
+ * @author      Kazumi Ono  <onokazu@xoops.org>
+ * @copyright   copyright (c) 2000-2003 XOOPS.org
+ */
+
+/**
+ * A criteria (grammar?) for a database query.
+ *
+ * Abstract base class should never be instantiated directly.
+ *
+ * @abstract
+ *
+ * @package     kernel
+ * @subpackage  database
+ *
+ * @author      Kazumi Ono  <onokazu@xoops.org>
+ * @copyright   copyright (c) 2000-2003 XOOPS.org
+ */
+class CriteriaElement
+{
+    /**
+     * Sort order
+     * @var string
+     */
+    var $order = 'ASC';
+
+    /**
+     * @var string
+     */
+    var $sort = '';
+
+    /**
+     * Number of records to retrieve
+     * @var int
+     */
+    var $limit = 0;
+
+    /**
+     * Offset of first record
+     * @var int
+     */
+    var $start = 0;
+
+    /**
+     * @var string
+     */
+    var $groupby = '';
+
+    /**
+     * Constructor
+     **/
+    function CriteriaElement()
+    {
+
+    }
+
+    /**
+     * Render the criteria element
+     */
+    function render()
+    {
+
+    }
+
+    /**#@+
+     * Accessor
+     */
+    /**
+     * @param   string  $sort
+     */
+    function setSort($sort)
+    {
+        $this->sort = $sort;
+    }
+
+    /**
+     * @return  string
+     */
+    function getSort()
+    {
+        return $this->sort;
+    }
+
+    /**
+     * @param   string  $order
+     */
+    function setOrder($order)
+    {
+        if ('DESC' == strtoupper($order)) {
+            $this->order = 'DESC';
+        }
+    }
+
+    /**
+     * @return  string
+     */
+    function getOrder()
+    {
+        return $this->order;
+    }
+
+    /**
+     * @param   int $limit
+     */
+    function setLimit($limit=0)
+    {
+        $this->limit = intval($limit);
+    }
+
+    /**
+     * @return  int
+     */
+    function getLimit()
+    {
+        return $this->limit;
+    }
+
+    /**
+     * @param   int $start
+     */
+    function setStart($start=0)
+    {
+        $this->start = intval($start);
+    }
+
+    /**
+     * @return  int
+     */
+    function getStart()
+    {
+        return $this->start;
+    }
+
+    /**
+     * @param   string  $group
+     */
+    function setGroupby($group){
+        $this->groupby = $group;
+    }
+
+    /**
+     * @return  string
+     */
+    function getGroupby(){
+        return ' GROUP BY '.$this->groupby;
+    }
+    /**#@-*/
+}
+
+/**
+ * Collection of multiple {@link CriteriaElement}s
+ *
+ * @package     kernel
+ * @subpackage  database
+ *
+ * @author      Kazumi Ono  <onokazu@xoops.org>
+ * @copyright   copyright (c) 2000-2003 XOOPS.org
+ */
+class CriteriaCompo extends CriteriaElement
+{
+
+    /**
+     * The elements of the collection
+     * @var array   Array of {@link CriteriaElement} objects
+     */
+    var $criteriaElements = array();
+
+    /**
+     * Conditions
+     * @var array
+     */
+    var $conditions = array();
+
+    /**
+     * Constructor
+     *
+     * @param   object  $ele
+     * @param   string  $condition
+     **/
+    function CriteriaCompo($ele=null, $condition='AND')
+    {
+        if (isset($ele) && is_object($ele)) {
+            $this->add($ele, $condition);
+        }
+    }
+
+    /**
+     * Add an element
+     *
+     * @param   object  &$criteriaElement
+     * @param   string  $condition
+     *
+     * @return  object  reference to this collection
+     **/
+    function &add(&$criteriaElement, $condition='AND')
+    {
+        $this->criteriaElements[] =& $criteriaElement;
+        $this->conditions[] = $condition;
+        return $this;
+    }
+
+    /**
+     * Make the criteria into a query string
+     *
+     * @return  string
+     */
+    function render()
+    {
+        $ret = '';
+        $count = count($this->criteriaElements);
+        if ($count > 0) {
+            $ret = '('. $this->criteriaElements[0]->render();
+            for ($i = 1; $i < $count; $i++) {
+                $ret .= ' '.$this->conditions[$i].' '.$this->criteriaElements[$i]->render();
+            }
+            $ret .= ')';
+        }
+        return $ret;
+    }
+
+    /**
+     * Make the criteria into a SQL "WHERE" clause
+     *
+     * @return  string
+     */
+    function renderWhere()
+    {
+        $ret = $this->render();
+        $ret = ($ret != '') ? 'WHERE ' . $ret : $ret;
+        return $ret;
+    }
+
+    /**
+     * Generate an LDAP filter from criteria
+     *
+     * @return string
+     * @author Nathan Dial ndial@trillion21.com
+     */
+    function renderLdap(){
+        $retval = '';
+        $count = count($this->criteriaElements);
+        if ($count > 0) {
+            $retval = $this->criteriaElements[0]->renderLdap();
+            for ($i = 1; $i < $count; $i++) {
+                $cond = $this->conditions[$i];
+                if(strtoupper($cond) == 'AND'){
+                    $op = '&';
+                } elseif (strtoupper($cond)=='OR'){
+                    $op = '|';
+                }
+                $retval = "($op$retval" . $this->criteriaElements[$i]->renderLdap().")";
+            }
+        }
+        return $retval;
+    }
+}
+
+
+/**
+ * A single criteria
+ *
+ * @package     kernel
+ * @subpackage  database
+ *
+ * @author      Kazumi Ono  <onokazu@xoops.org>
+ * @copyright   copyright (c) 2000-2003 XOOPS.org
+ */
+class Criteria extends CriteriaElement
+{
+
+    /**
+     * @var string
+     */
+    var $prefix;
+    var $function;
+    var $column;
+    var $operator;
+    var $value;
+
+    /**
+     * Constructor
+     *
+     * @param   string  $column
+     * @param   string  $value
+     * @param   string  $operator
+     **/
+    function Criteria($column, $value='', $operator='=', $prefix = '', $function = '') {
+        $this->prefix = $prefix;
+        $this->function = $function;
+        $this->column = $column;
+        $this->value = $value;
+        $this->operator = $operator;
+    }
+
+    /**
+     * Make a sql condition string
+     *
+     * @return  string
+     **/
+    function render() {
+        $value = $this->value;
+        if (!in_array(strtoupper($this->operator), array('IN', 'NOT IN'))) {
+            $value = "'".$value."'";
+        }
+        $clause = (!empty($this->prefix) ? "{$this->prefix}." : "") . $this->column;
+        if ( !empty($this->function) ) {
+            $clause = sprintf($this->function, $clause);
+        }
+        $clause .= " {$this->operator} $value";
+        return $clause;
+    }
+
+   /**
+     * Generate an LDAP filter from criteria
+     *
+     * @return string
+     * @author Nathan Dial ndial@trillion21.com
+     */
+    function renderLdap(){
+        $clause = "(" . $this->column . $this->operator . $this->value . ")";
+        return $clause;
+    }
+
+    /**
+     * Make a SQL "WHERE" clause
+     *
+     * @return  string
+     */
+    function renderWhere() {
+        $cond = $this->render();
+        return empty($cond) ? '' : "WHERE $cond";
+    }
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/tardownloader.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/tardownloader.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/tardownloader.php	(revision 405)
@@ -0,0 +1,177 @@
+<?php
+// $Id: tardownloader.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+if (!defined('XOOPS_ROOT_PATH')) {
+	exit();
+}
+
+/**
+ * base class
+ */
+include_once XOOPS_ROOT_PATH.'/class/downloader.php';
+/**
+ * Class to handle tar files
+ */
+include_once XOOPS_ROOT_PATH.'/class/class.tar.php';
+
+/**
+ * Send tar files through a http socket
+ *
+ * @package		kernel
+ * @subpackage	core
+ *
+ * @author		Kazumi Ono 	<onokazu@xoops.org>
+ * @copyright	(c) 2000-2003 The Xoops Project - www.xoops.org
+ */
+class XoopsTarDownloader extends XoopsDownloader
+{
+
+	/**
+	 * Constructor
+	 * 
+	 * @param string $ext       file extension
+	 * @param string $mimyType  Mimetype
+	 **/
+	function XoopsTarDownloader($ext = '.tar.gz', $mimyType = 'application/x-gzip')
+	{
+		$this->archiver = new tar();
+		$this->ext = trim($ext);
+		$this->mimeType = trim($mimyType);
+	}
+
+	/**
+	 * Add a file to the archive
+	 * 
+	 * @param   string  $filepath       Full path to the file
+	 * @param   string  $newfilename    Filename (if you don't want to use the original)
+	 **/
+	function addFile($filepath, $newfilename=null)
+	{
+		$this->archiver->addFile($filepath);
+		if (isset($newfilename)) {
+			// dirty, but no other way
+			for ($i = 0; $i < $this->archiver->numFiles; $i++) {
+				if ($this->archiver->files[$i]['name'] == $filepath) {
+					$this->archiver->files[$i]['name'] = trim($newfilename);
+					break;
+				}
+			}
+		}
+	}
+
+	/**
+	 * Add a binary file to the archive
+	 * 
+	 * @param   string  $filepath       Full path to the file
+	 * @param   string  $newfilename    Filename (if you don't want to use the original)
+	 **/
+	function addBinaryFile($filepath, $newfilename=null)
+	{
+		$this->archiver->addFile($filepath, true);
+		if (isset($newfilename)) {
+			// dirty, but no other way
+			for ($i = 0; $i < $this->archiver->numFiles; $i++) {
+				if ($this->archiver->files[$i]['name'] == $filepath) {
+					$this->archiver->files[$i]['name'] = trim($newfilename);
+					break;
+				}
+			}
+		}
+	}
+
+	/**
+	 * Add a dummy file to the archive
+	 * 
+	 * @param   string  $data       Data to write
+	 * @param   string  $filename   Name for the file in the archive
+	 * @param   integer $time
+	 **/
+	function addFileData(&$data, $filename, $time=0)
+	{
+		$dummyfile = XOOPS_CACHE_PATH.'/dummy_'.time().'.html';
+		$fp = fopen($dummyfile, 'w');
+		fwrite($fp, $data);
+		fclose($fp);
+		$this->archiver->addFile($dummyfile);
+		unlink($dummyfile);
+
+		// dirty, but no other way
+		for ($i = 0; $i < $this->archiver->numFiles; $i++) {
+			if ($this->archiver->files[$i]['name'] == $dummyfile) {
+				$this->archiver->files[$i]['name'] = $filename;
+				if ($time != 0) {
+					$this->archiver->files[$i]['time'] = $time;
+				}
+				break;
+			}
+		}
+	}
+
+	/**
+	 * Add a binary dummy file to the archive
+	 * 
+	 * @param   string  $data   Data to write
+	 * @param   string  $filename   Name for the file in the archive
+	 * @param   integer $time
+	 **/
+	function addBinaryFileData(&$data, $filename, $time=0)
+	{
+		$dummyfile = XOOPS_CACHE_PATH.'/dummy_'.time().'.html';
+		$fp = fopen($dummyfile, 'wb');
+		fwrite($fp, $data);
+		fclose($fp);
+		$this->archiver->addFile($dummyfile, true);
+		unlink($dummyfile);
+
+		// dirty, but no other way
+		for ($i = 0; $i < $this->archiver->numFiles; $i++) {
+			if ($this->archiver->files[$i]['name'] == $dummyfile) {
+				$this->archiver->files[$i]['name'] = $filename;
+				if ($time != 0) {
+					$this->archiver->files[$i]['time'] = $time;
+				}
+				break;
+			}
+		}
+	}
+
+	/**
+	 * Send the file to the client
+	 * 
+	 * @param   string  $name   Filename
+	 * @param   boolean $gzip   Use GZ compression
+	 **/
+	function download($name, $gzip = true)
+	{
+		$this->_header($name.$this->ext);
+		echo $this->archiver->toTarOutput($name.$this->ext, $gzip);
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/class.zipfile.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/class.zipfile.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/class.zipfile.php	(revision 405)
@@ -0,0 +1,196 @@
+<?php
+// $Id: class.zipfile.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+/*
+	package::i.tools
+
+	php-downloader	v1.0	-	www.ipunkt.biz
+
+	(c)	2002 - www.ipunkt.biz (rok)
+
+ * Zip file creation class.
+ * Makes zip files.
+ *
+ * Based on :
+ *
+ *  http://www.zend.com/codex.php?id=535&single=1
+ *  By Eric Mueller <eric@themepark.com>
+ *
+ *  http://www.zend.com/codex.php?id=470&single=1
+ *  by Denis125 <webmaster@atlant.ru>
+ *
+ *  a patch from Peter Listiak <mlady@users.sourceforge.net> for last modified
+ *  date and time of the compressed file
+ *
+ * Official ZIP file format: http://www.pkware.com/appnote.txt
+ *
+ * @copyright	(c)	2002 - www.ipunkt.biz (rok)
+ * @access  public
+ * 
+ * @package     kernel
+ * @subpackage  core
+ */
+class zipfile
+{
+    /**
+     * Array to store compressed data
+     *
+     * @var  array    $datasec
+     */
+    var $datasec      = array();
+
+    /**
+     * Central directory
+     *
+     * @var  array    $ctrl_dir
+     */
+    var $ctrl_dir     = array();
+
+    /**
+     * End of central directory record
+     *
+     * @var  string   $eof_ctrl_dir
+     */
+    var $eof_ctrl_dir = "\x50\x4b\x05\x06\x00\x00\x00\x00";
+
+    /**
+     * Last offset position
+     *
+     * @var  integer  $old_offset
+     */
+    var $old_offset   = 0;
+
+
+    /**
+     * Converts an Unix timestamp to a four byte DOS date and time format (date
+     * in high two bytes, time in low two bytes allowing magnitude comparison).
+     *
+     * @param  integer  the current Unix timestamp
+     *
+     * @return integer  the current date in a four byte DOS format
+     *
+     * @access private
+     */
+    function unix2DosTime($unixtime = 0)
+	{
+        $timearray = ($unixtime == 0) ? getdate() : getdate($unixtime);
+
+        if ($timearray['year'] < 1980) {
+        	$timearray['year']    = 1980;
+        	$timearray['mon']     = 1;
+        	$timearray['mday']    = 1;
+        	$timearray['hours']   = 0;
+        	$timearray['minutes'] = 0;
+        	$timearray['seconds'] = 0;
+        } // end if
+
+        return (($timearray['year'] - 1980) << 25) | ($timearray['mon'] << 21) | ($timearray['mday'] << 16) |
+                ($timearray['hours'] << 11) | ($timearray['minutes'] << 5) | ($timearray['seconds'] >> 1);
+    } // end of the 'unix2DosTime()' method
+
+
+    /**
+     * Adds "file" to archive
+     *
+     * @param  string   file contents
+     * @param  string   name of the file in the archive (may contains the path)
+     * @param  integer  the current timestamp
+     *
+     * @access public
+     */
+    function addFile($data, $name, $time = 0)
+    {
+        $name     = str_replace('\\', '/', $name);
+
+        $dtime    = dechex($this->unix2DosTime($time));
+        $hexdtime = '\x' . $dtime[6] . $dtime[7]
+                  . '\x' . $dtime[4] . $dtime[5]
+                  . '\x' . $dtime[2] . $dtime[3]
+                  . '\x' . $dtime[0] . $dtime[1];
+        eval('$hexdtime = "' . $hexdtime . '";');
+
+        $fr   = "\x50\x4b\x03\x04";
+        $fr   .= "\x14\x00";            // ver needed to extract
+        $fr   .= "\x00\x00";            // gen purpose bit flag
+        $fr   .= "\x08\x00";            // compression method
+        $fr   .= $hexdtime;             // last mod time and date
+
+        // "local file header" segment
+        $unc_len = strlen($data);
+        $crc     = crc32($data);
+        $zdata   = gzcompress($data);
+        $zdata   = substr(substr($zdata, 0, strlen($zdata) - 4), 2); // fix crc bug
+        $c_len   = strlen($zdata);
+        $fr      .= pack('V', $crc);             // crc32
+        $fr      .= pack('V', $c_len);           // compressed filesize
+        $fr      .= pack('V', $unc_len);         // uncompressed filesize
+        $fr      .= pack('v', strlen($name));    // length of filename
+        $fr      .= pack('v', 0);                // extra field length
+        $fr      .= $name;
+
+        // "file data" segment
+        $fr .= $zdata;
+
+        // "data descriptor" segment (optional but necessary if archive is not
+        // served as file)
+        $fr .= pack('V', $crc);                 // crc32
+        $fr .= pack('V', $c_len);               // compressed filesize
+        $fr .= pack('V', $unc_len);             // uncompressed filesize
+
+        // add this entry to array
+        $this -> datasec[] = $fr;
+        $new_offset        = strlen(implode('', $this->datasec));
+
+        // now add to central directory record
+        $cdrec = "\x50\x4b\x01\x02";
+        $cdrec .= "\x00\x00";                // version made by
+        $cdrec .= "\x14\x00";                // version needed to extract
+        $cdrec .= "\x00\x00";                // gen purpose bit flag
+        $cdrec .= "\x08\x00";                // compression method
+        $cdrec .= $hexdtime;                 // last mod time & date
+        $cdrec .= pack('V', $crc);           // crc32
+        $cdrec .= pack('V', $c_len);         // compressed filesize
+        $cdrec .= pack('V', $unc_len);       // uncompressed filesize
+        $cdrec .= pack('v', strlen($name) ); // length of filename
+        $cdrec .= pack('v', 0 );             // extra field length
+        $cdrec .= pack('v', 0 );             // file comment length
+        $cdrec .= pack('v', 0 );             // disk number start
+        $cdrec .= pack('v', 0 );             // internal file attributes
+        $cdrec .= pack('V', 32 );            // external file attributes - 'archive' bit set
+
+        $cdrec .= pack('V', $this -> old_offset ); // relative offset of local header
+        $this -> old_offset = $new_offset;
+
+        $cdrec .= $name;
+
+        // optional extra field, file comment goes here
+        // save to central directory
+        $this -> ctrl_dir[] = $cdrec;
+    } // end of the 'addFile()' method
+
+
+    /**
+     * Dumps out file
+     *
+     * @return  string  the zipped file
+     *
+     * @access public
+     */
+    function file()
+    {
+        $data    = implode('', $this -> datasec);
+        $ctrldir = implode('', $this -> ctrl_dir);
+
+        return
+            $data .
+            $ctrldir .
+            $this -> eof_ctrl_dir .
+            pack('v', count($this -> ctrl_dir)) .  // total # of entries "on this disk"
+            pack('v', count($this -> ctrl_dir)) .  // total # of entries overall
+            pack('V', strlen($ctrldir)) .           // size of central dir
+            pack('V', strlen($data)) .              // offset to start of central dir
+            "\x00\x00";                             // .zip file comment length
+    } // end of the 'file()' method
+
+} // end of the 'zipfile' class
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/xoopstopic.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xoopstopic.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xoopstopic.php	(revision 405)
@@ -0,0 +1,340 @@
+<?php
+// $Id: xoopstopic.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+if (!defined('XOOPS_ROOT_PATH')) {
+	exit();
+}
+include_once XOOPS_ROOT_PATH."/class/xoopstree.php";
+
+class XoopsTopic
+{
+	var $table;
+	var $topic_id;
+	var $topic_pid;
+	var $topic_title;
+	var $topic_imgurl;
+	var $prefix; // only used in topic tree
+	var $use_permission=false;
+	var $mid; // module id used for setting permission
+
+	function XoopsTopic($table, $topicid=0)
+	{
+		$this->db =& Database::getInstance();
+		$this->table = $table;
+		if ( is_array($topicid) ) {
+			$this->makeTopic($topicid);
+		} elseif ( $topicid != 0 ) {
+			$this->getTopic(intval($topicid));
+		} else {
+			$this->topic_id = $topicid;
+		}
+	}
+
+	function setTopicTitle($value)
+	{
+		$this->topic_title = $value;
+	}
+
+	function setTopicImgurl($value)
+	{
+		$this->topic_imgurl = $value;
+	}
+
+	function setTopicPid($value)
+	{
+		$this->topic_pid = $value;
+	}
+
+	function getTopic($topicid)
+	{
+		$sql = "SELECT * FROM ".$this->table." WHERE topic_id=".$topicid."";
+		$array = $this->db->fetchArray($this->db->query($sql));
+		$this->makeTopic($array);
+	}
+
+	function makeTopic($array)
+	{
+		foreach($array as $key=>$value){
+			$this->$key = $value;
+		}
+	}
+
+	function usePermission($mid)
+	{
+		$this->mid = $mid;
+		$this->use_permission = true;
+	}
+
+	function store()
+	{
+		$myts =& MyTextSanitizer::getInstance();
+		$title = "";
+		$imgurl = "";
+		if ( isset($this->topic_title) && $this->topic_title != "" ) {
+			$title = $myts->makeTboxData4Save($this->topic_title);
+		}
+		if ( isset($this->topic_imgurl) && $this->topic_imgurl != "" ) {
+			$imgurl = $myts->makeTboxData4Save($this->topic_imgurl);
+		}
+		if ( !isset($this->topic_pid) || !is_numeric($this->topic_pid) ) {
+			$this->topic_pid = 0;
+		}
+		if ( empty($this->topic_id) ) {
+			$this->topic_id = $this->db->genId($this->table."_topic_id_seq");
+			$sql = sprintf("INSERT INTO %s (topic_id, topic_pid, topic_imgurl, topic_title) VALUES (%u, %u, '%s', '%s')", $this->table, $this->topic_id, $this->topic_pid, $imgurl, $title);
+		} else {
+			$sql = sprintf("UPDATE %s SET topic_pid = %u, topic_imgurl = '%s', topic_title = '%s' WHERE topic_id = %u", $this->table, $this->topic_pid, $imgurl, $title, $this->topic_id);
+		}
+		if ( !$result = $this->db->query($sql) ) {
+			ErrorHandler::show('0022');
+		}
+		if ( $this->use_permission == true ) {
+			if ( empty($this->topic_id) ) {
+				$this->topic_id = $this->db->getInsertId();
+			}
+			$xt = new XoopsTree($this->table, "topic_id", "topic_pid");
+			$parent_topics = $xt->getAllParentId($this->topic_id);
+			if ( !empty($this->m_groups) && is_array($this->m_groups) ){
+				foreach ( $this->m_groups as $m_g ) {
+					$moderate_topics = XoopsPerms::getPermitted($this->mid, "ModInTopic", $m_g);
+					$add = true;
+					// only grant this permission when the group has this permission in all parent topics of the created topic
+					foreach($parent_topics as $p_topic){
+						if ( !in_array($p_topic, $moderate_topics) ) {
+							$add = false;
+							continue;
+						}
+					}
+					if ( $add == true ) {
+						$xp = new XoopsPerms();
+						$xp->setModuleId($this->mid);
+						$xp->setName("ModInTopic");
+						$xp->setItemId($this->topic_id);
+						$xp->store();
+						$xp->addGroup($m_g);
+					}
+				}
+			}
+			if ( !empty($this->s_groups) && is_array($this->s_groups) ){
+				foreach ( $s_groups as $s_g ) {
+					$submit_topics = XoopsPerms::getPermitted($this->mid, "SubmitInTopic", $s_g);
+					$add = true;
+					foreach($parent_topics as $p_topic){
+						if ( !in_array($p_topic, $submit_topics) ) {
+							$add = false;
+							continue;
+						}
+					}
+					if ( $add == true ) {
+						$xp = new XoopsPerms();
+						$xp->setModuleId($this->mid);
+						$xp->setName("SubmitInTopic");
+						$xp->setItemId($this->topic_id);
+						$xp->store();
+						$xp->addGroup($s_g);
+					}
+				}
+			}
+			if ( !empty($this->r_groups) && is_array($this->r_groups) ){
+				foreach ( $r_groups as $r_g ) {
+					$read_topics = XoopsPerms::getPermitted($this->mid, "ReadInTopic", $r_g);
+					$add = true;
+					foreach($parent_topics as $p_topic){
+						if ( !in_array($p_topic, $read_topics) ) {
+							$add = false;
+							continue;
+						}
+					}
+					if ( $add == true ) {
+						$xp = new XoopsPerms();
+						$xp->setModuleId($this->mid);
+						$xp->setName("ReadInTopic");
+						$xp->setItemId($this->topic_id);
+						$xp->store();
+						$xp->addGroup($r_g);
+					}
+				}
+			}
+		}
+		return true;
+	}
+
+	function delete()
+	{
+		$sql = sprintf("DELETE FROM %s WHERE topic_id = %u", $this->table, $this->topic_id);
+		$this->db->query($sql);
+	}
+
+	function topic_id()
+	{
+		return $this->topic_id;
+	}
+
+	function topic_pid()
+	{
+		return $this->topic_pid;
+	}
+
+	function topic_title($format="S")
+	{
+		$myts =& MyTextSanitizer::getInstance();
+		switch($format){
+			case "S":
+				$title = $myts->makeTboxData4Show($this->topic_title);
+				break;
+			case "E":
+				$title = $myts->makeTboxData4Edit($this->topic_title);
+				break;
+			case "P":
+				$title = $myts->makeTboxData4Preview($this->topic_title);
+				break;
+			case "F":
+				$title = $myts->makeTboxData4PreviewInForm($this->topic_title);
+				break;
+		}
+		return $title;
+	}
+
+	function topic_imgurl($format="S")
+	{
+		$myts =& MyTextSanitizer::getInstance();
+		switch($format){
+			case "S":
+				$imgurl= $myts->makeTboxData4Show($this->topic_imgurl);
+				break;
+			case "E":
+				$imgurl = $myts->makeTboxData4Edit($this->topic_imgurl);
+				break;
+			case "P":
+				$imgurl = $myts->makeTboxData4Preview($this->topic_imgurl);
+				break;
+			case "F":
+				$imgurl = $myts->makeTboxData4PreviewInForm($this->topic_imgurl);
+				break;
+		}
+		return $imgurl;
+	}
+
+	function prefix()
+	{
+		if ( isset($this->prefix) ) {
+			return $this->prefix;
+		}
+	}
+
+	function getFirstChildTopics()
+	{
+		$ret = array();
+		$xt = new XoopsTree($this->table, "topic_id", "topic_pid");
+		$topic_arr = $xt->getFirstChild($this->topic_id, "topic_title");
+		if ( is_array($topic_arr) && count($topic_arr) ) {
+			foreach($topic_arr as $topic){
+				$ret[] = new XoopsTopic($this->table, $topic);
+			}
+		}
+		return $ret;
+	}
+
+	function getAllChildTopics()
+	{
+		$ret = array();
+		$xt = new XoopsTree($this->table, "topic_id", "topic_pid");
+		$topic_arr = $xt->getAllChild($this->topic_id, "topic_title");
+		if ( is_array($topic_arr) && count($topic_arr) ) {
+			foreach($topic_arr as $topic){
+				$ret[] = new XoopsTopic($this->table, $topic);
+			}
+		}
+		return $ret;
+	}
+
+	function getChildTopicsTreeArray()
+	{
+		$ret = array();
+		$xt = new XoopsTree($this->table, "topic_id", "topic_pid");
+		$topic_arr = $xt->getChildTreeArray($this->topic_id, "topic_title");
+		if ( is_array($topic_arr) && count($topic_arr) ) {
+			foreach($topic_arr as $topic){
+				$ret[] = new XoopsTopic($this->table, $topic);
+			}
+		}
+		return $ret;
+	}
+
+	function makeTopicSelBox($none=0, $seltopic=-1, $selname="", $onchange="")
+	{
+		$xt = new XoopsTree($this->table, "topic_id", "topic_pid");
+		if ( $seltopic != -1 ) {
+			$xt->makeMySelBox("topic_title", "topic_title", $seltopic, $none, $selname, $onchange);
+		} elseif ( !empty($this->topic_id) ) {
+			$xt->makeMySelBox("topic_title", "topic_title", $this->topic_id, $none, $selname, $onchange);
+		} else {
+			$xt->makeMySelBox("topic_title", "topic_title", 0, $none, $selname, $onchange);
+		}
+	}
+
+	//generates nicely formatted linked path from the root id to a given id
+	function getNiceTopicPathFromId($funcURL)
+	{
+		$xt = new XoopsTree($this->table, "topic_id", "topic_pid");
+		$ret = $xt->getNicePathFromId($this->topic_id, "toppic_title", $funcURL);
+		return $ret;
+	}
+
+	function getAllChildTopicsId()
+	{
+		$xt = new XoopsTree($this->table, "topic_id", "topic_pid");
+		$ret = $xt->getAllChildId($this->topic_id, "toppic_title");
+		return $ret;
+	}
+
+	function &getTopicsList()
+	{
+		$result = $this->db->query('SELECT topic_id, topic_pid, topic_title FROM '.$this->table);
+		$ret = array();
+		$myts =& MyTextSanitizer::getInstance();
+		while ($myrow = $this->db->fetchArray($result)) {
+			$ret[$myrow['topic_id']] = array('title' => $myts->htmlspecialchars($myrow['topic_title']), 'pid' => $myrow['topic_pid']);
+		}
+		return $ret;
+	}
+
+	function topicExists($pid, $title) {
+		$sql = "SELECT COUNT(*) from ".$this->table." WHERE topic_pid = ".intval($pid)." AND topic_title = '".trim($title)."'";
+		$rs = $this->db->query($sql);
+        list($count) = $this->db->fetchRow($rs);
+		if ($count > 0) {
+			return true;
+		} else {
+			return false;
+		}
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/xml/saxparser.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xml/saxparser.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xml/saxparser.php	(revision 405)
@@ -0,0 +1,372 @@
+<?php
+// $Id: saxparser.php,v 1.4 2005/08/03 12:39:11 onokazu Exp $
+/*******************************************************************************
+    Location: <b>xml/SaxParser.class</b><br>
+     <br>
+    Provides basic functionality to read and parse XML documents.  Subclasses
+    must implement all the their custom handlers by using add* function methods.
+    They may also use the handle*() methods to parse a specific XML begin and end
+    tags, but this is not recommended as it is more difficult.<br>
+    <br>
+    Copyright &copy; 2001 eXtremePHP.  All rights reserved.<br>
+    <br>
+    @author Ken Egervari<br>
+*******************************************************************************/
+
+class SaxParser
+{
+    var $level;
+    var $parser;
+
+    var $isCaseFolding;
+    var $targetEncoding;
+
+    /* Custom Handler Variables */
+    var $tagHandlers = array();
+
+    /* Tag stack */
+    var $tags = array();
+
+    /* Xml Source Input */
+    var $xmlInput;
+
+    var $errors = array();
+
+    /****************************************************************************
+        Creates a SaxParser object using a FileInput to represent the stream
+        of XML data to parse.  Use the static methods createFileInput or
+        createStringInput to construct xml input source objects to supply
+        to the constructor, or the implementor can construct them individually.
+    ****************************************************************************/
+    function SaxParser(&$input)
+    {
+        $this->level = 0;
+        $this->parser = xml_parser_create('UTF-8');
+        xml_set_object($this->parser, $this);
+        $this->input =& $input;
+        $this->setCaseFolding(false);
+        $this->useUtfEncoding();
+        xml_set_element_handler($this->parser, 'handleBeginElement','handleEndElement');
+        xml_set_character_data_handler($this->parser, 'handleCharacterData');
+        xml_set_processing_instruction_handler($this->parser, 'handleProcessingInstruction');
+        xml_set_default_handler($this->parser, 'handleDefault');
+        xml_set_unparsed_entity_decl_handler($this->parser, 'handleUnparsedEntityDecl');
+        xml_set_notation_decl_handler($this->parser, 'handleNotationDecl');
+        xml_set_external_entity_ref_handler($this->parser, 'handleExternalEntityRef');
+    }
+
+    /*---------------------------------------------------------------------------
+        Property Methods
+    ---------------------------------------------------------------------------*/
+
+    function getCurrentLevel()
+    {
+        return $this->level;
+    }
+
+    /****************************************************************************
+        * @param $isCaseFolding
+        * @returns void
+    ****************************************************************************/
+    function setCaseFolding($isCaseFolding)
+    {
+        assert(is_bool($isCaseFolding));
+
+        $this->isCaseFolding = $isCaseFolding;
+        xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, $this->isCaseFolding);
+    }
+
+    /****************************************************************************
+        * @returns void
+    ****************************************************************************/
+    function useIsoEncoding()
+    {
+        $this->targetEncoding = 'ISO-8859-1';
+        xml_parser_set_option($this->parser, XML_OPTION_TARGET_ENCODING, $this->targetEncoding);
+    }
+
+    /****************************************************************************
+        * @returns void
+    ****************************************************************************/
+    function useAsciiEncoding()
+    {
+        $this->targetEncoding = 'US-ASCII';
+        xml_parser_set_option($this->parser, XML_OPTION_TARGET_ENCODING, $this->targetEncoding);
+    }
+
+    /****************************************************************************
+        * @returns void
+    ****************************************************************************/
+    function useUtfEncoding()
+    {
+        $this->targetEncoding = 'UTF-8';
+        xml_parser_set_option($this->parser, XML_OPTION_TARGET_ENCODING, $this->targetEncoding);
+    }
+
+    /****************************************************************************
+        Returns the name of the xml tag being parsed
+        * @returns string
+    ****************************************************************************/
+    function getCurrentTag()
+    {
+        return $this->tags[count($this->tags) - 1];
+    }
+
+    function getParentTag()
+    {
+        if (isset($this->tags[count($this->tags) - 2])) {
+            return $this->tags[count($this->tags) - 2];
+        }
+        return false;
+    }
+
+
+
+    /*---------------------------------------------------------------------------
+        Parser methods
+    ---------------------------------------------------------------------------*/
+
+    /****************************************************************************
+        * @returns void
+    ****************************************************************************/
+    function parse()
+    {
+        if (!is_resource($this->input)) {
+            if (!xml_parse($this->parser, $this->input)) {
+                $this->setErrors($this->getXmlError());
+                return false;
+            }
+            //if (!$fp = fopen($this->input, 'r')) {
+            //    $this->setErrors('Could not open file: '.$this->input);
+            //    return false;
+            //}
+        } else {
+            while ($data = fread($this->input, 4096)) {
+                if (!xml_parse($this->parser, str_replace("'", "&apos;", $data), feof($this->input))) {
+                    $this->setErrors($this->getXmlError());
+                    fclose($this->input);
+                    return false;
+                }
+            }
+            fclose($this->input);
+        }
+        return true;
+    }
+
+    /****************************************************************************
+        * @returns void
+    ****************************************************************************/
+    function free()
+    {
+        xml_parser_free($this->parser);
+
+        if (!method_exists($this, '__destruct')) {
+             unset($this);
+        } else {
+            $this->__destruct();
+        }
+    }
+
+    /****************************************************************************
+        * @private
+        * @returns string
+    ****************************************************************************/
+    function getXmlError()
+    {
+        return sprintf("XmlParse error: %s at line %d", xml_error_string(xml_get_error_code($this->parser)), xml_get_current_line_number($this->parser));
+    }
+
+    /*---------------------------------------------------------------------------
+        Custom Handler Methods
+    ---------------------------------------------------------------------------*/
+
+    /****************************************************************************
+        Adds a callback function to be called when a tag is encountered.<br>
+        Functions that are added must be of the form:<br>
+        <b>functionName( $attributes )</b>
+        * @param $tagName string.  The name of the tag currently being parsed.
+        * @param $functionName string.  The name of the function in XmlDocument's
+        subclass.
+        * @returns void
+    ****************************************************************************/
+    function addTagHandler(&$tagHandler)
+    {
+        $name = $tagHandler->getName();
+        if (is_array($name)) {
+            foreach ($name as $n) {
+                $this->tagHandlers[$n] =& $tagHandler;
+            }
+        } else {
+            $this->tagHandlers[$name] =& $tagHandler;
+        }
+    }
+
+
+    /*---------------------------------------------------------------------------
+        Private Handler Methods
+    ---------------------------------------------------------------------------*/
+
+    /****************************************************************************
+        Callback function that executes whenever a the start of a tag
+        occurs when being parsed.
+        * @param $parser int.  The handle to the parser.
+        * @param $tagName string.  The name of the tag currently being parsed.
+        * @param $attributesArray attay.  The list of attributes associated with
+        the tag.
+        * @private
+        * @returns void
+    ****************************************************************************/
+    function handleBeginElement($parser, $tagName, $attributesArray)
+    {
+        array_push($this->tags, $tagName);
+        $this->level++;
+        if (isset($this->tagHandlers[$tagName]) && is_subclass_of($this->tagHandlers[$tagName], 'xmltaghandler')) {
+            $this->tagHandlers[$tagName]->handleBeginElement($this, $attributesArray);
+        } else {
+            $this->handleBeginElementDefault($parser, $tagName, $attributesArray);
+        }
+    }
+
+    /****************************************************************************
+        Callback function that executes whenever the end of a tag
+        occurs when being parsed.
+        * @param $parser int.  The handle to the parser.
+        * @param $tagName string.  The name of the tag currently being parsed.
+        * @private
+        * @returns void
+    ****************************************************************************/
+    function handleEndElement($parser, $tagName)
+    {
+        array_pop($this->tags);
+        if (isset($this->tagHandlers[$tagName]) && is_subclass_of($this->tagHandlers[$tagName], 'xmltaghandler')) {
+            $this->tagHandlers[$tagName]->handleEndElement($this);
+        } else {
+            $this->handleEndElementDefault($parser, $tagName);
+        }
+        $this->level--;
+    }
+
+    /****************************************************************************
+        Callback function that executes whenever character data is encountered
+        while being parsed.
+        * @param $parser int.  The handle to the parser.
+        * @param $data string.  Character data inside the tag
+        * @returns void
+    ****************************************************************************/
+    function handleCharacterData($parser, $data)
+    {
+        $tagHandler =& $this->tagHandlers[$this->getCurrentTag()];
+        if (isset($tagHandler) && is_subclass_of($tagHandler, 'xmltaghandler')) {
+            $tagHandler->handleCharacterData($this, $data);
+        } else {
+            $this->handleCharacterDataDefault($parser, $data);
+        }
+    }
+
+    /****************************************************************************
+        * @param $parser int.  The handle to the parser.
+        * @returns void
+    ****************************************************************************/
+    function handleProcessingInstruction($parser, &$target, &$data)
+    {
+//        if($target == 'php') {
+//            eval($data);
+//        }
+    }
+
+    /****************************************************************************
+        * @param $parser int.  The handle to the parser.
+        * @returns void
+    ****************************************************************************/
+    function handleDefault($parser, $data)
+    {
+
+    }
+
+    /****************************************************************************
+        * @param $parser int.  The handle to the parser.
+        * @returns void
+    ****************************************************************************/
+    function handleUnparsedEntityDecl($parser, $entityName, $base, $systemId, $publicId, $notationName)
+    {
+
+    }
+
+    /****************************************************************************
+        * @param $parser int.  The handle to the parser.
+        * @returns void
+    ****************************************************************************/
+    function handleNotationDecl($parser, $notationName, $base, $systemId, $publicId)
+    {
+
+    }
+
+    /****************************************************************************
+        * @param $parser int.  The handle to the parser.
+        * @returns void
+    ****************************************************************************/
+    function handleExternalEntityRef($parser, $openEntityNames, $base, $systemId, $publicId)
+    {
+
+    }
+
+    /**
+     * The default tag handler method for a tag with no handler
+     *
+     * @abstract
+     */
+    function handleBeginElementDefault($parser, $tagName, $attributesArray)
+    {
+    }
+
+    /**
+     * The default tag handler method for a tag with no handler
+     *
+     * @abstract
+     */
+    function handleEndElementDefault($parser, $tagName)
+    {
+    }
+
+    /**
+     * The default tag handler method for a tag with no handler
+     *
+     * @abstract
+     */
+    function handleCharacterDataDefault($parser, $data)
+    {
+    }
+
+    /**
+     * Sets error messages
+     *
+     * @param   $error  string  an error message
+     */
+    function setErrors($error)
+    {
+        $this->errors[] = trim($error);
+    }
+
+    /**
+     * Gets all the error messages
+     *
+     * @param   $ashtml bool    return as html?
+     * @return  mixed
+     */
+    function &getErrors($ashtml = true)
+    {
+        if (!$ashtml) {
+            return $this->errors;
+        } else {
+            $ret = '';
+            if (count($this->errors) > 0) {
+                foreach ($this->errors as $error) {
+                    $ret .= $error.'<br />';
+                }
+            }
+            return $ret;
+        }
+    }
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/xml/xmltaghandler.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xml/xmltaghandler.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xml/xmltaghandler.php	(revision 405)
@@ -0,0 +1,56 @@
+<?php
+// $Id: xmltaghandler.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+/*******************************************************************************
+    Location: <b>xml/XmlTagHandler</b><br>
+     <br>
+    XmlTagHandler<br>
+    <br>
+    Copyright &copy; 2001 eXtremePHP.  All rights reserved.<br>
+    <br>
+    @author Ken Egervari, Remi Michalski<br>
+*******************************************************************************/
+
+class XmlTagHandler
+{
+
+    /****************************************************************************
+
+    ****************************************************************************/
+    function XmlTagHandler()
+    {
+    }
+
+    /****************************************************************************
+
+    ****************************************************************************/
+    function getName()
+    {
+        return '';
+    }
+
+    /****************************************************************************
+
+    ****************************************************************************/
+    function handleBeginElement(&$parser, &$attributes)
+    {
+
+    }
+
+    /****************************************************************************
+
+    ****************************************************************************/
+    function handleEndElement(&$parser)
+    {
+
+    }
+
+    /****************************************************************************
+
+    ****************************************************************************/
+    function handleCharacterData(&$parser,  &$data)
+    {
+
+    }
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/xml/themesetparser.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xml/themesetparser.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xml/themesetparser.php	(revision 405)
@@ -0,0 +1,412 @@
+<?php
+// $Id: themesetparser.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+include_once XOOPS_ROOT_PATH.'/class/xml/saxparser.php';
+include_once XOOPS_ROOT_PATH.'/class/xml/xmltaghandler.php';
+
+class XoopsThemeSetParser extends SaxParser
+{
+	var $tempArr = array();
+	var $themeSetData = array();
+	var $imagesData = array();
+	var $templatesData = array();
+
+	function XoopsThemeSetParser(&$input)
+	{
+		$this->SaxParser($input);
+		$this->addTagHandler(new ThemeSetThemeNameHandler());
+		$this->addTagHandler(new ThemeSetDateCreatedHandler());
+		$this->addTagHandler(new ThemeSetAuthorHandler());
+		$this->addTagHandler(new ThemeSetDescriptionHandler());
+		$this->addTagHandler(new ThemeSetGeneratorHandler());
+		$this->addTagHandler(new ThemeSetNameHandler());
+		$this->addTagHandler(new ThemeSetEmailHandler());
+		$this->addTagHandler(new ThemeSetLinkHandler());
+		$this->addTagHandler(new ThemeSetTemplateHandler());
+		$this->addTagHandler(new ThemeSetImageHandler());
+		$this->addTagHandler(new ThemeSetModuleHandler());
+		$this->addTagHandler(new ThemeSetFileTypeHandler());
+		$this->addTagHandler(new ThemeSetTagHandler());
+	}
+
+	function setThemeSetData($name, &$value)
+	{
+		$this->themeSetData[$name] =& $value;
+	}
+
+	function &getThemeSetData($name=null)
+	{
+		if (isset($name)) {
+			if (isset($this->themeSetData[$name])) {
+				return $this->themeSetData[$name];
+			}
+			return false;
+		}
+		return $this->themeSetData;
+	}
+
+	function setImagesData(&$imagearr)
+	{
+		$this->imagesData[] =& $imagearr;
+	}
+
+	function &getImagesData()
+	{
+		return $this->imagesData;
+	}
+
+	function setTemplatesData(&$tplarr)
+	{
+		$this->templatesData[] =& $tplarr;
+	}
+
+	function &getTemplatesData()
+	{
+		return $this->templatesData;
+	}
+
+	function setTempArr($name, &$value, $delim='')
+	{
+		if (!isset($this->tempArr[$name])) {
+			$this->tempArr[$name] =& $value;
+		} else {
+			$this->tempArr[$name] .= $delim.$value;
+		}
+	}
+
+	function getTempArr()
+	{
+		return $this->tempArr;
+	}
+
+	function resetTempArr()
+	{
+		unset($this->tempArr);
+		$this->tempArr = array();
+	}
+}
+
+
+class ThemeSetDateCreatedHandler extends XmlTagHandler
+{
+
+	function ThemeSetDateCreatedHandler()
+	{
+
+	}
+
+	function getName()
+	{
+		return 'dateCreated';
+	}
+
+	function handleCharacterData(&$parser, &$data)
+	{
+		switch ($parser->getParentTag()) {
+		case 'themeset':
+			$parser->setThemeSetData('date', $data);
+			break;
+		default:
+			break;
+		}
+	}
+}
+
+class ThemeSetAuthorHandler extends XmlTagHandler
+{
+	function ThemeSetAuthorHandler()
+	{
+
+	}
+
+	function getName()
+	{
+		return 'author';
+	}
+
+	function handleBeginElement(&$parser, &$attributes)
+	{
+		$parser->resetTempArr();
+	}
+
+	function handleEndElement(&$parser)
+	{
+		$parser->setCreditsData($parser->getTempArr());
+	}
+}
+
+class ThemeSetDescriptionHandler extends XmlTagHandler
+{
+	function ThemeSetDescriptionHandler()
+	{
+
+	}
+
+	function getName()
+	{
+		return 'description';
+	}
+
+	function handleCharacterData(&$parser, &$data)
+	{
+		switch ($parser->getParentTag()) {
+		case 'template':
+			$parser->setTempArr('description', $data);
+			break;
+		case 'image':
+			$parser->setTempArr('description', $data);
+			break;
+		default:
+			break;
+		}
+	}
+}
+
+class ThemeSetGeneratorHandler extends XmlTagHandler
+{
+	function ThemeSetGeneratorHandler()
+	{
+
+	}
+
+	function getName()
+	{
+		return 'generator';
+	}
+
+	function handleCharacterData(&$parser, &$data)
+	{
+		switch ($parser->getParentTag()) {
+		case 'themeset':
+			$parser->setThemeSetData('generator', $data);
+			break;
+		default:
+			break;
+		}
+	}
+}
+
+class ThemeSetNameHandler extends XmlTagHandler
+{
+	function ThemeSetNameHandler()
+	{
+
+	}
+
+	function getName()
+	{
+		return 'name';
+	}
+
+	function handleCharacterData(&$parser, &$data)
+	{
+		switch ($parser->getParentTag()) {
+		case 'themeset':
+			$parser->setThemeSetData('name', $data);
+			break;
+		case 'author':
+			$parser->setTempArr('name', $data);
+			break;
+		default:
+			break;
+		}
+	}
+}
+
+class ThemeSetEmailHandler extends XmlTagHandler
+{
+	function ThemeSetEmailHandler()
+	{
+
+	}
+
+	function getName()
+	{
+		return 'email';
+	}
+
+	function handleCharacterData(&$parser, &$data)
+	{
+		switch ($parser->getParentTag()) {
+		case 'author':
+			$parser->setTempArr('email', $data);
+			break;
+		default:
+			break;
+		}
+	}
+}
+
+class ThemeSetLinkHandler extends XmlTagHandler
+{
+	function ThemeSetLinkHandler()
+	{
+
+	}
+
+	function getName()
+	{
+		return 'link';
+	}
+
+	function handleCharacterData(&$parser, &$data)
+	{
+		switch ($parser->getParentTag()) {
+		case 'author':
+			$parser->setTempArr('link', $data);
+			break;
+		default:
+			break;
+		}
+	}
+}
+
+class ThemeSetTemplateHandler extends XmlTagHandler
+{
+	function ThemeSetTemplateHandler()
+	{
+
+	}
+
+	function getName()
+	{
+		return 'template';
+	}
+
+	function handleBeginElement(&$parser, &$attributes)
+	{
+		$parser->resetTempArr();
+		$parser->setTempArr('name', $attributes['name']);
+	}
+
+	function handleEndElement(&$parser)
+	{
+		$parser->setTemplatesData($parser->getTempArr());
+	}
+}
+
+class ThemeSetImageHandler extends XmlTagHandler
+{
+	function ThemeSetImageHandler()
+	{
+
+	}
+
+	function getName()
+	{
+		return 'image';
+	}
+
+	function handleBeginElement(&$parser, &$attributes)
+	{
+		$parser->resetTempArr();
+		$parser->setTempArr('name', $attributes[0]);
+	}
+
+	function handleEndElement(&$parser)
+	{
+		$parser->setImagesData($parser->getTempArr());
+	}
+}
+
+class ThemeSetModuleHandler extends XmlTagHandler
+{
+	function ThemeSetModuleHandler()
+	{
+
+	}
+
+	function getName()
+	{
+		return 'module';
+	}
+
+	function handleCharacterData(&$parser, &$data)
+	{
+		switch ($parser->getParentTag()) {
+		case 'template':
+		case 'image':
+			$parser->setTempArr('module', $data);
+			break;
+		default:
+			break;
+		}
+	}
+}
+
+class ThemeSetFileTypeHandler extends XmlTagHandler
+{
+	function ThemeSetFileTypeHandler()
+	{
+
+	}
+
+	function getName()
+	{
+		return 'fileType';
+	}
+
+	function handleCharacterData(&$parser, &$data)
+	{
+		switch ($parser->getParentTag()) {
+		case 'template':
+			$parser->setTempArr('type', $data);
+			break;
+		default:
+			break;
+		}
+	}
+}
+
+class ThemeSetTagHandler extends XmlTagHandler
+{
+	function ThemeSetTagHandler()
+	{
+
+	}
+
+	function getName()
+	{
+		return 'tag';
+	}
+
+	function handleCharacterData(&$parser, &$data)
+	{
+		switch ($parser->getParentTag()) {
+		case 'image':
+			$parser->setTempArr('tag', $data);
+			break;
+		default:
+			break;
+		}
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/xml/rpc/xmlrpcapi.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xml/rpc/xmlrpcapi.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xml/rpc/xmlrpcapi.php	(revision 405)
@@ -0,0 +1,167 @@
+<?php
+// $Id: xmlrpcapi.php,v 1.6 2006/05/01 02:37:26 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+
+class XoopsXmlRpcApi
+{
+
+    // reference to method parameters
+    var $params;
+
+    // reference to xmlrpc document class object
+    var $response;
+
+    // reference to module class object
+    var $module;
+
+    // map between xoops tags and blogger specific tags
+    var $xoopsTagMap = array();
+
+    // user class object
+    var $user;
+
+    var $isadmin = false;
+
+
+
+    function XoopsXmlRpcApi(&$params, &$response, &$module)
+    {
+        $this->params =& $params;
+        $this->response =& $response;
+        $this->module =& $module;
+    }
+
+    function _setUser(&$user, $isadmin = false)
+    {
+        if (is_object($user)) {
+            $this->user =& $user;
+            $this->isadmin = $isadmin;
+        }
+    }
+
+    function _checkUser($username, $password)
+    {
+        if (isset($this->user)) {
+            return true;
+        }
+        $member_handler =& xoops_gethandler('member');
+        $this->user =& $member_handler->loginUser(addslashes($username), trim($password));
+        if (!is_object($this->user)) {
+            unset($this->user);
+            return false;
+        }
+        $moduleperm_handler =& xoops_gethandler('groupperm');
+        if (!$moduleperm_handler->checkRight('module_read', $this->module->getVar('mid'), $this->user->getGroups())) {
+            unset($this->user);
+            return false;
+        }
+        return true;
+    }
+
+    function _checkAdmin()
+    {
+        if ($this->isadmin) {
+            return true;
+        }
+        if (!isset($this->user)) {
+            return false;
+        }
+        if (!$this->user->isAdmin($this->module->getVar('mid'))) {
+            return false;
+        }
+        $this->isadmin = true;
+        return true;
+    }
+
+    function &_getPostFields($post_id = null, $blog_id = null)
+    {
+        $ret = array();
+        $ret['title'] = array('required' => true, 'form_type' => 'textbox', 'value_type' => 'text');
+        $ret['hometext'] = array('required' => false, 'form_type' => 'textarea', 'data_type' => 'textarea');
+        $ret['moretext'] = array('required' => false, 'form_type' => 'textarea', 'data_type' => 'textarea');
+        $ret['categories'] = array('required' => false, 'form_type' => 'select_multi', 'data_type' => 'array');
+        /*
+        if (!isset($blog_id)) {
+            if (!isset($post_id)) {
+                return false;
+            }
+            $itemman =& $this->mf->get(MANAGER_ITEM);
+            $item =& $itemman->get($post_id);
+            $blog_id = $item->getVar('sect_id');
+        }
+        $sectman =& $this->mf->get(MANAGER_SECTION);
+        $this->section =& $sectman->get($blog_id);
+        $ret =& $this->section->getVar('sect_fields');
+        */
+        return $ret;
+    }
+
+    function _setXoopsTagMap($xoopstag, $blogtag)
+    {
+        if (trim($blogtag) != '') {
+            $this->xoopsTagMap[$xoopstag] = $blogtag;
+        }
+    }
+
+    function _getXoopsTagMap($xoopstag)
+    {
+        if (isset($this->xoopsTagMap[$xoopstag])) {
+            return $this->xoopsTagMap[$xoopstag];
+        }
+        return $xoopstag;
+    }
+
+    function _getTagCdata(&$text, $tag, $remove = true)
+    {
+        $ret = '';
+        $match = array();
+        if (preg_match("/\<".$tag."\>(.*)\<\/".$tag."\>/is", $text, $match)) {
+            if ($remove) {
+                $text = str_replace($match[0], '', $text);
+            }
+            $ret = $match[1];
+        }
+        return $ret;
+    }
+
+    // kind of dirty method to load XOOPS API and create a new object thereof
+    // returns itself if the calling object is XOOPS API
+    function &_getXoopsApi(&$params)
+    {
+        if (strtolower(get_class($this)) != 'xoopsapi') {
+            require_once(XOOPS_ROOT_PATH.'/class/xml/rpc/xoopsapi.php');
+            return new XoopsApi($params, $this->response, $this->module);
+        } else {
+            return $this;
+        }
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/xml/rpc/metaweblogapi.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xml/rpc/metaweblogapi.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xml/rpc/metaweblogapi.php	(revision 405)
@@ -0,0 +1,275 @@
+<?php
+// $Id: metaweblogapi.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+require_once XOOPS_ROOT_PATH.'/class/xml/rpc/xmlrpcapi.php';
+
+class MetaWeblogApi extends XoopsXmlRpcApi
+{
+    function MetaWeblogApi(&$params, &$response, &$module)
+    {
+        $this->XoopsXmlRpcApi($params, $response, $module);
+        $this->_setXoopsTagMap('storyid', 'postid');
+        $this->_setXoopsTagMap('published', 'dateCreated');
+        $this->_setXoopsTagMap('uid', 'userid');
+        //$this->_setXoopsTagMap('hometext', 'description');
+    }
+
+    function newPost()
+    {
+        if (!$this->_checkUser($this->params[1], $this->params[2])) {
+            
+            $this->response->add(new XoopsXmlRpcFault(104));
+        } else {
+            if (!$fields =& $this->_getPostFields(null, $this->params[0])) {
+                $this->response->add(new XoopsXmlRpcFault(106));
+            } else {
+                $missing = array();
+                $post = array();
+                foreach ($fields as $tag => $detail) {
+                    $maptag = $this->_getXoopsTagMap($tag);
+                    if (!isset($this->params[3][$maptag])) {
+                        $data = $this->_getTagCdata($this->params[3]['description'], $maptag, true);
+                        if (trim($data) == ''){
+                            if ($detail['required']) {
+                                $missing[] = $maptag;
+                            }
+                        } else {
+                            $post[$tag] = $data;
+                        }
+                    } else {
+                        $post[$tag] = $this->params[3][$maptag];
+                    }
+                }
+                if (count($missing) > 0) {
+                    $msg = '';
+                    foreach ($missing as $m) {
+                        $msg .= '<'.$m.'> ';echo $m;
+                    }
+                    $this->response->add(new XoopsXmlRpcFault(109, $msg));
+                } else {
+                    $newparams = array();
+                    $newparams[0] = $this->params[0];
+                    $newparams[1] = $this->params[1];
+                    $newparams[2] = $this->params[2];
+                    foreach ($post as $key => $value) {
+                        $newparams[3][$key] =& $value;
+                        unset($value);
+                    }
+                    $newparams[3]['xoops_text'] = $this->params[3]['description'];
+                    if (isset($this->params[3]['categories']) && is_array($this->params[3]['categories'])) {
+                        foreach ($this->params[3]['categories'] as $k => $v) {
+                            $newparams[3]['categories'][$k] = $v;
+                        }
+                    }
+                    $newparams[4] = $this->params[4];
+                    $xoopsapi =& $this->_getXoopsApi($newparams);
+                    $xoopsapi->_setUser($this->user, $this->isadmin);
+                    $xoopsapi->newPost();
+                }
+            }
+        }
+    }
+
+    function editPost()
+    {
+        if (!$this->_checkUser($this->params[1], $this->params[2])) {
+            $this->response->add(new XoopsXmlRpcFault(104));
+        } else {
+            if (!$fields =& $this->_getPostFields($this->params[0])) {
+            } else {
+                $missing = array();
+                $post = array();
+                foreach ($fields as $tag => $detail) {
+                    $maptag = $this->_getXoopsTagMap($tag);
+                    if (!isset($this->params[3][$maptag])) {
+                        $data = $this->_getTagCdata($this->params[3]['description'], $maptag, true);
+                        if (trim($data) == ''){
+                            if ($detail['required']) {
+                                $missing[] = $tag;
+                            }
+                        } else {
+                            $post[$tag] = $data;
+                        }
+                    } else {
+                        $post[$tag] =& $this->params[3][$maptag];
+                    }
+                }
+                if (count($missing) > 0) {
+                    $msg = '';
+                    foreach ($missing as $m) {
+                        $msg .= '<'.$m.'> ';
+                    }
+                    $this->response->add(new XoopsXmlRpcFault(109, $msg));
+                } else {
+                    $newparams = array();
+                    $newparams[0] = $this->params[0];
+                    $newparams[1] = $this->params[1];
+                    $newparams[2] = $this->params[2];
+                    foreach ($post as $key => $value) {
+                        $newparams[3][$key] =& $value;
+                        unset($value);
+                    }
+                    if (isset($this->params[3]['categories']) && is_array($this->params[3]['categories'])) {
+                        foreach ($this->params[3]['categories'] as $k => $v) {
+                            $newparams[3]['categories'][$k] = $v;
+                        }
+                    }
+                    $newparams[3]['xoops_text'] = $this->params[3]['description'];
+                    $newparams[4] = $this->params[4];
+                    $xoopsapi =& $this->_getXoopsApi($newparams);
+                    $xoopsapi->_setUser($this->user, $this->isadmin);
+                    $xoopsapi->editPost();
+                }
+            }
+        }
+    }
+
+    function getPost()
+    {
+        if (!$this->_checkUser($this->params[1], $this->params[2])) {
+            $this->response->add(new XoopsXmlRpcFault(104));
+        } else {
+            $xoopsapi =& $this->_getXoopsApi($this->params);
+            $xoopsapi->_setUser($this->user, $this->isadmin);
+            $ret =& $xoopsapi->getPost(false);
+            if (is_array($ret)) {
+                $struct = new XoopsXmlRpcStruct();
+                $content = '';
+                foreach ($ret as $key => $value) {
+                    $maptag = $this->_getXoopsTagMap($key);
+                    switch($maptag) {
+                    case 'userid':
+                        $struct->add('userid', new XoopsXmlRpcString($value));
+                        break;
+                    case 'dateCreated':
+                        $struct->add('dateCreated', new XoopsXmlRpcDatetime($value));
+                        break;
+                    case 'postid':
+                        $struct->add('postid', new XoopsXmlRpcString($value));
+                        $struct->add('link', new XoopsXmlRpcString(XOOPS_URL.'/modules/xoopssections/item.php?item='.$value));
+                        $struct->add('permaLink', new XoopsXmlRpcString(XOOPS_URL.'/modules/xoopssections/item.php?item='.$value));
+                        break;
+                    case 'title':
+                        $struct->add('title', new XoopsXmlRpcString($value));
+                        break;
+                    default :
+                        $content .= '<'.$key.'>'.trim($value).'</'.$key.'>';
+                        break;
+                    }
+                }
+                $struct->add('description', new XoopsXmlRpcString($content));
+                $this->response->add($struct);
+            } else {
+                $this->response->add(new XoopsXmlRpcFault(106));
+            }
+        }
+    }
+
+    function getRecentPosts()
+    {
+        if (!$this->_checkUser($this->params[1], $this->params[2])) {
+            $this->response->add(new XoopsXmlRpcFault(104));
+        } else {
+            $xoopsapi =& $this->_getXoopsApi($this->params);
+            $xoopsapi->_setUser($this->user, $this->isadmin);
+            $ret =& $xoopsapi->getRecentPosts(false);
+            if (is_array($ret)) {
+                $arr = new XoopsXmlRpcArray();
+                $count = count($ret);
+                if ($count == 0) {
+                    $this->response->add(new XoopsXmlRpcFault(106, 'Found 0 Entries'));
+                } else {
+                    for ($i = 0; $i < $count; $i++) {
+                        $struct = new XoopsXmlRpcStruct();
+                        $content = '';
+                        foreach($ret[$i] as $key => $value) {
+                            $maptag = $this->_getXoopsTagMap($key);
+                            switch($maptag) {
+                            case 'userid':
+                                $struct->add('userid', new XoopsXmlRpcString($value));
+                                break;
+                            case 'dateCreated':
+                                $struct->add('dateCreated', new XoopsXmlRpcDatetime($value));
+                                break;
+                            case 'postid':
+                                $struct->add('postid', new XoopsXmlRpcString($value));
+                                $struct->add('link', new XoopsXmlRpcString(XOOPS_URL.'/modules/news/article.php?item_id='.$value));
+                                $struct->add('permaLink', new XoopsXmlRpcString(XOOPS_URL.'/modules/news/article.php?item_id='.$value));
+                                break;
+                            case 'title':
+                                $struct->add('title', new XoopsXmlRpcString($value));
+                                break;
+                            default :
+                                $content .= '<'.$key.'>'.trim($value).'</'.$key.'>';
+                                break;
+                            }
+                        }
+                        $struct->add('description', new XoopsXmlRpcString($content));
+                        $arr->add($struct);
+                        unset($struct);
+                    }
+                    $this->response->add($arr);
+                }
+            } else {
+                $this->response->add(new XoopsXmlRpcFault(106));
+            }
+        }
+    }
+
+    function getCategories()
+    {
+        if (!$this->_checkUser($this->params[1], $this->params[2])) {
+            $this->response->add(new XoopsXmlRpcFault(104));
+        } else {
+            $xoopsapi =& $this->_getXoopsApi($this->params);
+            $xoopsapi->_setUser($this->user, $this->isadmin);
+            $ret =& $xoopsapi->getCategories(false);
+            if (is_array($ret)) {
+                $arr = new XoopsXmlRpcArray();
+                foreach ($ret as $id => $detail) {
+                    $struct = new XoopsXmlRpcStruct();
+                    $struct->add('description', new XoopsXmlRpcString($detail));
+                    $struct->add('htmlUrl', new XoopsXmlRpcString(XOOPS_URL.'/modules/news/index.php?storytopic='.$id));
+                    $struct->add('rssUrl', new XoopsXmlRpcString(''));
+                    $catstruct = new XoopsXmlRpcStruct();
+                    $catstruct->add($detail['title'], $struct);
+                    $arr->add($catstruct);
+                    unset($struct);
+                    unset($catstruct);
+                }
+                $this->response->add($arr);
+            } else {
+                $this->response->add(new XoopsXmlRpcFault(106));
+            }
+        }
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/xml/rpc/movabletypeapi.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xml/rpc/movabletypeapi.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xml/rpc/movabletypeapi.php	(revision 405)
@@ -0,0 +1,80 @@
+<?php
+// $Id: movabletypeapi.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+require_once XOOPS_ROOT_PATH.'/class/xml/rpc/xmlrpcapi.php';
+
+class MovableTypeApi extends XoopsXmlRpcApi
+{
+    function MovableTypeApi(&$params, &$response, &$module)
+    {
+        $this->XoopsXmlRpcApi($params, $response, $module);
+    }
+
+    function getCategoryList()
+    {
+        if (!$this->_checkUser($this->params[1], $this->params[2])) {
+            $this->response->add(new XoopsXmlRpcFault(104));
+        } else {
+            $xoopsapi =& $this->_getXoopsApi($this->params);
+            $xoopsapi->_setUser($this->user, $this->isadmin);
+            $ret =& $xoopsapi->getCategories(false);
+            if (is_array($ret)) {
+                $arr = new XoopsXmlRpcArray();
+                foreach ($ret as $id => $name) {
+                    $struct = new XoopsXmlRpcStruct();
+                    $struct->add('categoryId', new XoopsXmlRpcString($id));
+                    $struct->add('categoryName', new XoopsXmlRpcString($name['title']));
+                    $arr->add($struct);
+                    unset($struct);
+                }
+                $this->response->add($arr);
+            } else {
+                $this->response->add(new XoopsXmlRpcFault(106));
+            }
+        }
+    }
+
+    function getPostCategories()
+    {
+        $this->response->add(new XoopsXmlRpcFault(107));
+    }
+
+    function setPostCategories()
+    {
+        $this->response->add(new XoopsXmlRpcFault(107));
+    }
+
+    function supportedMethods()
+    {
+        $this->response->add(new XoopsXmlRpcFault(107));
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/xml/rpc/xmlrpctag.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xml/rpc/xmlrpctag.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xml/rpc/xmlrpctag.php	(revision 405)
@@ -0,0 +1,326 @@
+<?php
+// $Id: xmlrpctag.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+class XoopsXmlRpcDocument
+{
+
+    var $_tags = array();
+
+    function XoopsXmlRpcDocument()
+    {
+
+    }
+
+    function add(&$tagobj)
+    {
+        $this->_tags[] =& $tagobj;
+    }
+
+    function render()
+    {
+    }
+
+}
+
+class XoopsXmlRpcResponse extends XoopsXmlRpcDocument
+{
+	function render()
+    {
+        $count = count($this->_tags);
+        $payload = '';
+        for ($i = 0; $i < $count; $i++) {
+            if (!$this->_tags[$i]->isFault()) {
+                $payload .= $this->_tags[$i]->render();
+            } else {
+                return '<?xml version="1.0"?><methodResponse>'.$this->_tags[$i]->render().'</methodResponse>';
+            }
+        }
+        return '<?xml version="1.0"?><methodResponse><params><param>'.$payload.'</param></params></methodResponse>';
+    }
+}
+
+class XoopsXmlRpcRequest extends XoopsXmlRpcDocument
+{
+
+	var $methodName;
+
+	function XoopsXmlRpcRequest($methodName)
+	{
+		$this->methodName = trim($methodName);
+	}
+
+	function render()
+    {
+        $count = count($this->_tags);
+        $payload = '';
+        for ($i = 0; $i < $count; $i++) {
+            $payload .= '<param>'.$this->_tags[$i]->render().'</param>';
+        }
+        return '<?xml version="1.0"?><methodCall><methodName>'.$this->methodName.'</methodName><params>'.$payload.'</params></methodCall>';
+    }
+}
+
+class XoopsXmlRpcTag
+{
+
+    var $_fault = false;
+
+    function XoopsXmlRpcTag()
+    {
+
+    }
+
+    function &encode(&$text)
+    {
+        $text = preg_replace(array("/\&([a-z\d\#]+)\;/i", "/\&/", "/\#\|\|([a-z\d\#]+)\|\|\#/i"), array("#||\\1||#", "&amp;", "&\\1;"), str_replace(array("<", ">"), array("&lt;", "&gt;"), $text));
+		return $text;
+    }
+
+    function setFault($fault = true){
+        $this->_fault = (intval($fault) > 0) ? true : false;
+    }
+
+    function isFault()
+    {
+        return $this->_fault;
+    }
+
+    function render()
+    {
+    }
+}
+
+class XoopsXmlRpcFault extends XoopsXmlRpcTag
+{
+
+    var $_code;
+    var $_extra;
+
+    function XoopsXmlRpcFault($code, $extra = null)
+    {
+        $this->setFault(true);
+        $this->_code = intval($code);
+        $this->_extra = isset($extra) ? trim($extra) : '';
+    }
+
+    function render()
+    {
+        switch ($this->_code) {
+        case 101:
+            $string = 'Invalid server URI';
+            break;
+        case 102:
+            $string = 'Parser parse error';
+            break;
+        case 103:
+            $string = 'Module not found';
+            break;
+        case 104:
+            $string = 'User authentication failed';
+            break;
+        case 105:
+            $string = 'Module API not found';
+            break;
+        case 106:
+            $string = 'Method response error';
+            break;
+        case 107:
+            $string = 'Method not supported';
+            break;
+        case 108:
+            $string = 'Invalid parameter';
+            break;
+        case 109:
+            $string = 'Missing parameters';
+            break;
+        case 110:
+            $string = 'Selected blog application does not exist';
+            break;
+        case 111:
+            $string = 'Method permission denied';
+            break;
+        default:
+            $string = 'Method response error';
+            break;
+        }
+        $string .= "\n".$this->_extra;
+        return '<fault><value><struct><member><name>faultCode</name><value>'.$this->_code.'</value></member><member><name>faultString</name><value>'.$this->encode($string).'</value></member></struct></value></fault>';
+    }
+}
+
+class XoopsXmlRpcInt extends XoopsXmlRpcTag
+{
+
+    var $_value;
+
+    function XoopsXmlRpcInt($value)
+    {
+        $this->_value = intval($value);
+    }
+
+    function render()
+    {
+        return '<value><int>'.$this->_value.'</int></value>';
+    }
+}
+
+class XoopsXmlRpcDouble extends XoopsXmlRpcTag
+{
+
+    var $_value;
+
+    function XoopsXmlRpcDouble($value)
+    {
+        $this->_value = (float)$value;
+    }
+
+    function render()
+    {
+        return '<value><double>'.$this->_value.'</double></value>';
+    }
+}
+
+class XoopsXmlRpcBoolean extends XoopsXmlRpcTag
+{
+
+    var $_value;
+
+    function XoopsXmlRpcBoolean($value)
+    {
+        $this->_value = (!empty($value) && $value != false) ? 1 : 0;
+    }
+
+    function render()
+    {
+        return '<value><boolean>'.$this->_value.'</boolean></value>';
+    }
+}
+
+class XoopsXmlRpcString extends XoopsXmlRpcTag
+{
+
+    var $_value;
+
+    function XoopsXmlRpcString($value)
+    {
+        $this->_value = strval($value);
+    }
+
+    function render()
+    {
+        return '<value><string>'.$this->encode($this->_value).'</string></value>';
+    }
+}
+
+class XoopsXmlRpcDatetime extends XoopsXmlRpcTag
+{
+
+    var $_value;
+
+    function XoopsXmlRpcDatetime($value)
+    {
+        if (!is_numeric($value)) {
+            $this->_value = strtotime($value);
+        } else {
+            $this->_value = intval($value);
+        }
+    }
+
+    function render()
+    {
+        return '<value><dateTime.iso8601>'.gmstrftime("%Y%m%dT%H:%M:%S", $this->_value).'</dateTime.iso8601></value>';
+    }
+}
+
+class XoopsXmlRpcBase64 extends XoopsXmlRpcTag
+{
+
+    var $_value;
+
+    function XoopsXmlRpcBase64($value)
+    {
+        $this->_value = base64_encode($value);
+    }
+
+    function render()
+    {
+        return '<value><base64>'.$this->_value.'</base64></value>';
+    }
+}
+
+class XoopsXmlRpcArray extends XoopsXmlRpcTag
+{
+
+    var $_tags = array();
+
+    function XoopsXmlRpcArray()
+    {
+    }
+
+    function add(&$tagobj)
+    {
+        $this->_tags[] =& $tagobj;
+    }
+
+    function render()
+    {
+        $count = count($this->_tags);
+        $ret = '<value><array><data>';
+        for ($i = 0; $i < $count; $i++) {
+            $ret .= $this->_tags[$i]->render();
+        }
+        $ret .= '</data></array></value>';
+        return $ret;
+    }
+}
+
+class XoopsXmlRpcStruct extends XoopsXmlRpcTag{
+
+    var $_tags = array();
+
+    function XoopsXmlRpcStruct(){
+    }
+
+    function add($name, &$tagobj){
+        $this->_tags[] = array('name' => $name, 'value' => $tagobj);
+    }
+
+    function render(){
+        $count = count($this->_tags);
+        $ret = '<value><struct>';
+        for ($i = 0; $i < $count; $i++) {
+            $ret .= '<member><name>'.$this->encode($this->_tags[$i]['name']).'</name>'.$this->_tags[$i]['value']->render().'</member>';
+        }
+        $ret .= '</struct></value>';
+        return $ret;
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/xml/rpc/xmlrpcparser.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xml/rpc/xmlrpcparser.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xml/rpc/xmlrpcparser.php	(revision 405)
@@ -0,0 +1,967 @@
+<?php
+// $Id: xmlrpcparser.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+require_once XOOPS_ROOT_PATH.'/class/xml/saxparser.php';
+require_once XOOPS_ROOT_PATH.'/class/xml/xmltaghandler.php';
+
+/**
+* Class RSS Parser
+*
+* This class offers methods to parse RSS Files
+*
+* @link      http://www.xoops.org/ Latest release of this class
+* @package   XOOPS
+* @copyright Copyright (c) 2001 xoops.org. All rights reserved.
+* @author    Kazumi Ono <onokazu@xoops.org>
+* @version   1.6 ($Date: 2005/03/18 12:51:55 $) $Revision: 1.2 $
+* @access    public
+*/
+
+class XoopsXmlRpcParser extends SaxParser
+{
+
+    /**
+    *
+    *
+    *
+    *
+    * @access private
+    * @var    array
+    */
+    var $_param;
+
+    /**
+    *
+    *
+    *
+    *
+    * @access private
+    * @var    string
+    */
+    var $_methodName;
+
+    /**
+    *
+    *
+    *
+    *
+    * @access private
+    * @var    array
+    */
+    var $_tempName;
+
+    /**
+    *
+    *
+    *
+    *
+    * @access private
+    * @var    array
+    */
+    var $_tempValue;
+
+    /**
+    *
+    *
+    *
+    *
+    * @access private
+    * @var    array
+    */
+    var $_tempMember;
+
+    /**
+    *
+    *
+    *
+    *
+    * @access private
+    * @var    array
+    */
+    var $_tempStruct;
+
+    /**
+    *
+    *
+    *
+    *
+    * @access private
+    * @var    array
+    */
+    var $_tempArray;
+
+    /**
+    *
+    *
+    *
+    *
+    * @access private
+    * @var    array
+    */
+    var $_workingLevel = array();
+
+
+    /**
+    * Constructor of the class
+    *
+    *
+    *
+    *
+    * @access
+    * @author
+    * @see
+    */
+    function XoopsXmlRpcParser(&$input)
+    {
+        $this->SaxParser($input);
+        $this->addTagHandler(new RpcMethodNameHandler());
+        $this->addTagHandler(new RpcIntHandler());
+        $this->addTagHandler(new RpcDoubleHandler());
+        $this->addTagHandler(new RpcBooleanHandler());
+        $this->addTagHandler(new RpcStringHandler());
+        $this->addTagHandler(new RpcDateTimeHandler());
+        $this->addTagHandler(new RpcBase64Handler());
+        $this->addTagHandler(new RpcNameHandler());
+        $this->addTagHandler(new RpcValueHandler());
+        $this->addTagHandler(new RpcMemberHandler());
+        $this->addTagHandler(new RpcStructHandler());
+        $this->addTagHandler(new RpcArrayHandler());
+    }
+
+    /**
+    * This Method starts the parsing of the specified RDF File. The File can be a local or a remote File.
+    *
+    * @access
+    * @author
+    * @param
+    * @return
+    * @see
+    */
+    function setTempName($name)
+    {
+        $this->_tempName[$this->getWorkingLevel()] = $name;
+    }
+
+    /**
+    * This Method starts the parsing of the specified RDF File. The File can be a local or a remote File.
+    *
+    * @access
+    * @author
+    * @param
+    * @return
+    * @see
+    */
+    function getTempName()
+    {
+        return $this->_tempName[$this->getWorkingLevel()];
+    }
+
+    /**
+    * This Method starts the parsing of the specified RDF File. The File can be a local or a remote File.
+    *
+    * @access
+    * @author
+    * @param
+    * @return
+    * @see
+    */
+    function setTempValue($value)
+    {
+        if (is_array($value)) {
+            settype($this->_tempValue, 'array');
+            foreach ($value as $k => $v) {
+                $this->_tempValue[$k] = $v;
+            }
+        } elseif (is_string($value)) {
+            if (isset($this->_tempValue)) {
+                if (is_string($this->_tempValue)) {
+                    $this->_tempValue .= $value;
+                }
+            } else {
+                $this->_tempValue = $value;
+            }
+        } else {
+            $this->_tempValue = $value;
+        }
+    }
+
+    /**
+    * This Method starts the parsing of the specified RDF File. The File can be a local or a remote File.
+    *
+    * @access
+    * @author
+    * @param
+    * @return
+    * @see
+    */
+    function getTempValue()
+    {
+        return $this->_tempValue;
+    }
+
+    /**
+    * This Method starts the parsing of the specified RDF File. The File can be a local or a remote File.
+    *
+    * @access
+    * @author
+    * @param
+    * @return
+    * @see
+    */
+    function resetTempValue()
+    {
+        unset($this->_tempValue);
+    }
+
+    /**
+    * This Method starts the parsing of the specified RDF File. The File can be a local or a remote File.
+    *
+    * @access
+    * @author
+    * @param
+    * @return
+    * @see
+    */
+    function setTempMember($name, $value)
+    {
+        $this->_tempMember[$this->getWorkingLevel()][$name] = $value;
+    }
+
+    /**
+    * This Method starts the parsing of the specified RDF File. The File can be a local or a remote File.
+    *
+    * @access
+    * @author
+    * @param
+    * @return
+    * @see
+    */
+    function getTempMember()
+    {
+        return $this->_tempMember[$this->getWorkingLevel()];
+    }
+
+    /**
+    * This Method starts the parsing of the specified RDF File. The File can be a local or a remote File.
+    *
+    * @access
+    * @author
+    * @param
+    * @return
+    * @see
+    */
+    function resetTempMember()
+    {
+        $this->_tempMember[$this->getCurrentLevel()] = array();
+    }
+
+    /**
+    * This Method starts the parsing of the specified RDF File. The File can be a local or a remote File.
+    *
+    * @access
+    * @author
+    * @param
+    * @return
+    * @see
+    */
+    function setWorkingLevel()
+    {
+        array_push($this->_workingLevel, $this->getCurrentLevel());
+    }
+
+    /**
+    * This Method starts the parsing of the specified RDF File. The File can be a local or a remote File.
+    *
+    * @access
+    * @author
+    * @param
+    * @return
+    * @see
+    */
+    function getWorkingLevel()
+    {
+        return $this->_workingLevel[count($this->_workingLevel) - 1];
+    }
+
+    /**
+    * This Method starts the parsing of the specified RDF File. The File can be a local or a remote File.
+    *
+    * @access
+    * @author
+    * @param
+    * @return
+    * @see
+    */
+    function releaseWorkingLevel()
+    {
+        array_pop($this->_workingLevel);
+    }
+
+    /**
+    * This Method starts the parsing of the specified RDF File. The File can be a local or a remote File.
+    *
+    * @access
+    * @author
+    * @param
+    * @return
+    * @see
+    */
+    function setTempStruct($member)
+    {
+        $key = key($member);
+        $this->_tempStruct[$this->getWorkingLevel()][$key] = $member[$key];
+    }
+
+    /**
+    * This Method starts the parsing of the specified RDF File. The File can be a local or a remote File.
+    *
+    * @access
+    * @author
+    * @param
+    * @return
+    * @see
+    */
+    function getTempStruct()
+    {
+        return $this->_tempStruct[$this->getWorkingLevel()];
+    }
+
+    /**
+    * This Method starts the parsing of the specified RDF File. The File can be a local or a remote File.
+    *
+    * @access
+    * @author
+    * @param
+    * @return
+    * @see
+    */
+    function resetTempStruct()
+    {
+        $this->_tempStruct[$this->getCurrentLevel()] = array();
+    }
+
+    /**
+    * This Method starts the parsing of the specified RDF File. The File can be a local or a remote File.
+    *
+    * @access
+    * @author
+    * @param
+    * @return
+    * @see
+    */
+    function setTempArray($value)
+    {
+        $this->_tempArray[$this->getWorkingLevel()][] = $value;
+    }
+
+    /**
+    * This Method starts the parsing of the specified RDF File. The File can be a local or a remote File.
+    *
+    * @access
+    * @author
+    * @param
+    * @return
+    * @see
+    */
+    function getTempArray()
+    {
+        return $this->_tempArray[$this->getWorkingLevel()];
+    }
+
+    /**
+    * This Method starts the parsing of the specified RDF File. The File can be a local or a remote File.
+    *
+    * @access
+    * @author
+    * @param
+    * @return
+    * @see
+    */
+    function resetTempArray()
+    {
+        $this->_tempArray[$this->getCurrentLevel()] = array();
+    }
+
+    /**
+    * This Method starts the parsing of the specified RDF File. The File can be a local or a remote File.
+    *
+    * @access
+    * @author
+    * @param
+    * @return
+    * @see
+    */
+    function setMethodName($methodName)
+    {
+        $this->_methodName = $methodName;
+    }
+
+    /**
+    * This Method starts the parsing of the specified RDF File. The File can be a local or a remote File.
+    *
+    * @access
+    * @author
+    * @param
+    * @return
+    * @see
+    */
+    function getMethodName()
+    {
+        return $this->_methodName;
+    }
+
+    /**
+    * This Method starts the parsing of the specified RDF File. The File can be a local or a remote File.
+    *
+    * @access
+    * @author
+    * @param
+    * @return
+    * @see
+    */
+    function setParam($value)
+    {
+        $this->_param[] = $value;
+    }
+
+    /**
+    * This Method starts the parsing of the specified RDF File. The File can be a local or a remote File.
+    *
+    * @access
+    * @author
+    * @param
+    * @return
+    * @see
+    */
+    function &getParam()
+    {
+        return $this->_param;
+    }
+}
+
+
+class RpcMethodNameHandler extends XmlTagHandler
+{
+
+    /**
+    * This Method starts the parsing of the specified RDF File. The File can be a local or a remote File.
+    *
+    * @access
+    * @author
+    * @param
+    * @return
+    * @see
+    */
+    function getName()
+    {
+        return 'methodName';
+    }
+
+    /**
+    * This Method starts the parsing of the specified RDF File. The File can be a local or a remote File.
+    *
+    * @access
+    * @author
+    * @param
+    * @return
+    * @see
+    */
+    function handleCharacterData(&$parser, &$data)
+    {
+        $parser->setMethodName($data);
+    }
+}
+
+class RpcIntHandler extends XmlTagHandler
+{
+
+    /**
+    * This Method starts the parsing of the specified RDF File. The File can be a local or a remote File.
+    *
+    * @access
+    * @author
+    * @param
+    * @return
+    * @see
+    */
+    function getName()
+    {
+        return array('int', 'i4');
+    }
+
+    /**
+    * This Method starts the parsing of the specified RDF File. The File can be a local or a remote File.
+    *
+    * @access
+    * @author
+    * @param
+    * @return
+    * @see
+    */
+    function handleCharacterData(&$parser, &$data)
+    {
+        $parser->setTempValue(intval($data));
+    }
+}
+
+class RpcDoubleHandler extends XmlTagHandler
+{
+
+    /**
+    * This Method starts the parsing of the specified RDF File. The File can be a local or a remote File.
+    *
+    * @access
+    * @author
+    * @param
+    * @return
+    * @see
+    */
+    function getName()
+    {
+        return 'double';
+    }
+
+    /**
+    * This Method starts the parsing of the specified RDF File. The File can be a local or a remote File.
+    *
+    * @access
+    * @author
+    * @param
+    * @return
+    * @see
+    */
+    function handleCharacterData(&$parser, &$data)
+    {
+        $data = (float)$data;
+        $parser->setTempValue($data);
+    }
+}
+
+class RpcBooleanHandler extends XmlTagHandler
+{
+
+    /**
+    * This Method starts the parsing of the specified RDF File. The File can be a local or a remote File.
+    *
+    * @access
+    * @author
+    * @param
+    * @return
+    * @see
+    */
+    function getName()
+    {
+        return 'boolean';
+    }
+
+    /**
+    * This Method starts the parsing of the specified RDF File. The File can be a local or a remote File.
+    *
+    * @access
+    * @author
+    * @param
+    * @return
+    * @see
+    */
+    function handleCharacterData(&$parser, &$data)
+    {
+        $data = (boolean)$data;
+        $parser->setTempValue($data);
+    }
+}
+
+class RpcStringHandler extends XmlTagHandler
+{
+
+    /**
+    * This Method starts the parsing of the specified RDF File. The File can be a local or a remote File.
+    *
+    * @access
+    * @author
+    * @param
+    * @return
+    * @see
+    */
+    function getName()
+    {
+        return 'string';
+    }
+
+    /**
+    * This Method starts the parsing of the specified RDF File. The File can be a local or a remote File.
+    *
+    * @access
+    * @author
+    * @param
+    * @return
+    * @see
+    */
+    function handleCharacterData(&$parser, &$data)
+    {
+        $parser->setTempValue(strval($data));
+    }
+}
+
+class RpcDateTimeHandler extends XmlTagHandler
+{
+
+    /**
+    * This Method starts the parsing of the specified RDF File. The File can be a local or a remote File.
+    *
+    * @access
+    * @author
+    * @param
+    * @return
+    * @see
+    */
+    function getName()
+    {
+        return 'dateTime.iso8601';
+    }
+
+    /**
+    * This Method starts the parsing of the specified RDF File. The File can be a local or a remote File.
+    *
+    * @access
+    * @author
+    * @param
+    * @return
+    * @see
+    */
+    function handleCharacterData(&$parser, &$data)
+    {
+        $matches = array();
+        if (!preg_match("/^([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})$/", $data, $matches)) {
+            $parser->setTempValue(time());
+        } else {
+            $parser->setTempValue(gmmktime($matches[4], $matches[5], $meatches[6], $matches[2], $matches[3], $matches[1]));
+        }
+    }
+}
+
+class RpcBase64Handler extends XmlTagHandler
+{
+
+    /**
+    * This Method starts the parsing of the specified RDF File. The File can be a local or a remote File.
+    *
+    * @access
+    * @author
+    * @param
+    * @return
+    * @see
+    */
+    function getName()
+    {
+        return 'base64';
+    }
+
+    /**
+    * This Method starts the parsing of the specified RDF File. The File can be a local or a remote File.
+    *
+    * @access
+    * @author
+    * @param
+    * @return
+    * @see
+    */
+    function handleCharacterData(&$parser, &$data)
+    {
+        $parser->setTempValue(base64_decode($data));
+    }
+}
+
+class RpcNameHandler extends XmlTagHandler
+{
+
+    /**
+    * This Method starts the parsing of the specified RDF File. The File can be a local or a remote File.
+    *
+    * @access
+    * @author
+    * @param
+    * @return
+    * @see
+    */
+    function getName()
+    {
+        return 'name';
+    }
+
+    /**
+    * This Method starts the parsing of the specified RDF File. The File can be a local or a remote File.
+    *
+    * @access
+    * @author
+    * @param
+    * @return
+    * @see
+    */
+    function handleCharacterData(&$parser, &$data)
+    {
+        switch ($parser->getParentTag()) {
+        case 'member':
+            $parser->setTempName($data);
+            break;
+        default:
+            break;
+        }
+    }
+}
+
+
+class RpcValueHandler extends XmlTagHandler
+{
+
+    /**
+    * This Method starts the parsing of the specified RDF File. The File can be a local or a remote File.
+    *
+    * @access
+    * @author
+    * @param
+    * @return
+    * @see
+    */
+    function getName()
+    {
+        return 'value';
+    }
+
+    /**
+    * This Method starts the parsing of the specified RDF File. The File can be a local or a remote File.
+    *
+    * @access
+    * @author
+    * @param
+    * @return
+    * @see
+    */
+    function handleCharacterData(&$parser, &$data)
+    {
+        switch ($parser->getParentTag()) {
+        case 'member':
+            $parser->setTempValue($data);
+            break;
+        case 'data':
+        case 'array':
+            $parser->setTempValue($data);
+            break;
+        default:
+            break;
+        }
+    }
+
+    /**
+    * This Method starts the parsing of the specified RDF File. The File can be a local or a remote File.
+    *
+    * @access
+    * @author
+    * @param
+    * @return
+    * @see
+    */
+    function handleBeginElement(&$parser, &$attributes)
+    {
+        //$parser->resetTempValue();
+    }
+
+    /**
+    * This Method starts the parsing of the specified RDF File. The File can be a local or a remote File.
+    *
+    * @access
+    * @author
+    * @param
+    * @return
+    * @see
+    */
+    function handleEndElement(&$parser)
+    {
+        switch ($parser->getCurrentTag()) {
+        case 'member':
+            $parser->setTempMember($parser->getTempName(), $parser->getTempValue());
+            break;
+        case 'array':
+        case 'data':
+            $parser->setTempArray($parser->getTempValue());
+            break;
+        default:
+            $parser->setParam($parser->getTempValue());
+            break;
+        }
+        $parser->resetTempValue();
+    }
+}
+
+class RpcMemberHandler extends XmlTagHandler
+{
+
+    /**
+    * This Method starts the parsing of the specified RDF File. The File can be a local or a remote File.
+    *
+    * @access
+    * @author
+    * @param
+    * @return
+    * @see
+    */
+    function getName()
+    {
+        return 'member';
+    }
+
+    /**
+    * This Method starts the parsing of the specified RDF File. The File can be a local or a remote File.
+    *
+    * @access
+    * @author
+    * @param
+    * @return
+    * @see
+    */
+    function handleBeginElement(&$parser, &$attributes)
+    {
+        $parser->setWorkingLevel();
+        $parser->resetTempMember();
+    }
+
+    /**
+    * This Method starts the parsing of the specified RDF File. The File can be a local or a remote File.
+    *
+    * @access
+    * @author
+    * @param
+    * @return
+    * @see
+    */
+    function handleEndElement(&$parser)
+    {
+        $member =& $parser->getTempMember();
+        $parser->releaseWorkingLevel();
+        $parser->setTempStruct($member);
+    }
+}
+
+class RpcArrayHandler extends XmlTagHandler
+{
+
+    /**
+    * This Method starts the parsing of the specified RDF File. The File can be a local or a remote File.
+    *
+    * @access
+    * @author
+    * @param
+    * @return
+    * @see
+    */
+    function getName()
+    {
+        return 'array';
+    }
+
+    /**
+    * This Method starts the parsing of the specified RDF File. The File can be a local or a remote File.
+    *
+    * @access
+    * @author
+    * @param
+    * @return
+    * @see
+    */
+    function handleBeginElement(&$parser, &$attributes)
+    {
+        $parser->setWorkingLevel();
+        $parser->resetTempArray();
+    }
+
+    /**
+    * This Method starts the parsing of the specified RDF File. The File can be a local or a remote File.
+    *
+    * @access
+    * @author
+    * @param
+    * @return
+    * @see
+    */
+    function handleEndElement(&$parser)
+    {
+        $parser->setTempValue($parser->getTempArray());
+        $parser->releaseWorkingLevel();
+    }
+}
+
+class RpcStructHandler extends XmlTagHandler
+{
+
+    /**
+    *
+    *
+    * @access
+    * @author
+    * @param
+    * @return
+    * @see
+    */
+    function getName()
+    {
+        return 'struct';
+    }
+
+    /**
+    *
+    *
+    * @access
+    * @author
+    * @param
+    * @return
+    * @see
+    */
+    function handleBeginElement(&$parser, &$attributes)
+    {
+        $parser->setWorkingLevel();
+        $parser->resetTempStruct();
+    }
+
+    /**
+    *
+    *
+    * @access
+    * @author
+    * @param
+    * @return
+    * @see
+    */
+    function handleEndElement(&$parser)
+    {
+        $parser->setTempValue($parser->getTempStruct());
+        $parser->releaseWorkingLevel();
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/xml/rpc/xoopsapi.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xml/rpc/xoopsapi.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xml/rpc/xoopsapi.php	(revision 405)
@@ -0,0 +1,347 @@
+<?php
+// $Id: xoopsapi.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+require_once XOOPS_ROOT_PATH.'/class/xml/rpc/xmlrpcapi.php';
+
+class XoopsApi extends XoopsXmlRpcApi
+{
+
+    function XoopsApi(&$params, &$response, &$module)
+    {
+        $this->XoopsXmlRpcApi($params, $response, $module);
+    }
+
+    function newPost()
+    {
+        if (!$this->_checkUser($this->params[1], $this->params[2])) {
+            $this->response->add(new XoopsXmlRpcFault(104));
+        } else {
+            if (!$fields =& $this->_getPostFields(null, $this->params[0])) {
+                $this->response->add(new XoopsXmlRpcFault(106));
+            } else {
+                $missing = array();
+                foreach ($fields as $tag => $detail) {
+                    if (!isset($this->params[3][$tag])) {
+                        $data = $this->_getTagCdata($this->params[3]['xoops_text'], $tag, true);
+                        if (trim($data) == ''){
+                            if ($detail['required']) {
+                                $missing[] = $tag;
+                            }
+                        } else {
+                            $post[$tag] =& $data;
+                        }
+                    } else {
+                        $post[$tag] =& $this->params[3][$tag];
+                    }
+                }
+                if (count($missing) > 0) {
+                    $msg = '';
+                    foreach ($missing as $m) {
+                        $msg .= '<'.$m.'> ';
+                    }
+                    $this->response->add(new XoopsXmlRpcFault(109, $msg));
+                } else {
+                    // will be removed... don't worry if this looks bad
+                    include_once XOOPS_ROOT_PATH.'/modules/news/class/class.newsstory.php';
+                    $story = new NewsStory();
+                    $error = false;
+                    if (intval($this->params[4]) > 0) {
+                        if (!$this->_checkAdmin()) {
+                            // non admin users cannot publish
+                            $error = true;
+                            $this->response->add(new XoopsXmlRpcFault(111));
+                        } else {
+                            $story->setType('admin');
+                            $story->setApproved(true);
+                            $story->setPublished(time());
+                        }
+                    } else {
+                        if (!$this->_checkAdmin()) {
+                            $story->setType('user');
+                        } else {
+                            $story->setType('admin');
+                        }
+                    }
+                    if (!$error) {
+                        if (isset($post['categories']) && !empty($post['categories'][0])) {
+                            $story->setTopicId(intval($post['categories'][0]['categoryId']));
+                        } else {
+                            $story->setTopicId(1);
+                        }
+                        $story->setTitle(addslashes(trim($post['title'])));
+                        if (isset($post['moretext'])) {
+                            $story->setBodytext(addslashes(trim($post['moretext'])));
+                        }
+                        if (!isset($post['hometext'])) {
+                            $story->setHometext(addslashes(trim($this->params[3]['xoops_text'])));
+                        } else {
+                            $story->setHometext(addslashes(trim($post['hometext'])));
+                        }
+                        $story->setUid($this->user->getVar('uid'));
+                        $story->setHostname($_SERVER['REMOTE_ADDR']);
+                        if (!$this->_checkAdmin()) {
+                            $story->setNohtml(1);
+                        } else {
+                            $story->setNohtml(0);
+                        }
+                        $story->setNosmiley(0);
+                        $story->setNotifyPub(1);
+                        $story->setTopicalign('R');
+                        $ret = $story->store();
+                        if (!$ret) {
+                            $this->response->add(new XoopsXmlRpcFault(106));
+                        } else {
+                            $this->response->add(new XoopsXmlRpcString($ret));
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    function editPost()
+    {
+        if (!$this->_checkUser($this->params[1], $this->params[2])) {
+            $this->response->add(new XoopsXmlRpcFault(104));
+        } else {
+            if (!$fields =& $this->_getPostFields($this->params[0])) {
+            } else {
+                $missing = array();
+                foreach ($fields as $tag => $detail) {
+                    if (!isset($this->params[3][$tag])) {
+                        $data = $this->_getTagCdata($this->params[3]['xoops_text'], $tag, true);
+                        if (trim($data) == ''){
+                            if ($detail['required']) {
+                                $missing[] = $tag;
+                            }
+                        } else {
+                            $post[$tag] = $data;
+                        }
+                    } else {
+                        $post[$tag] = $this->params[3][$tag];
+                    }
+                }
+                if (count($missing) > 0) {
+                    $msg = '';
+                    foreach ($missing as $m) {
+                        $msg .= '<'.$m.'> ';
+                    }
+                    $this->response->add(new XoopsXmlRpcFault(109, $msg));
+                } else {
+                    // will be removed... don't worry if this looks bad
+                    include_once XOOPS_ROOT_PATH.'/modules/news/class/class.newsstory.php';
+                    $story = new NewsStory($this->params[0]);
+                    $storyid = $story->storyid();
+                    if (empty($storyid)) {
+                        $this->response->add(new XoopsXmlRpcFault(106));
+                    } elseif (!$this->_checkAdmin()) {
+                        $this->response->add(new XoopsXmlRpcFault(111));
+                    } else {
+                        $story->setTitle(addslashes(trim($post['title'])));
+                        if (isset($post['moretext'])) {
+                            $story->setBodytext(addslashes(trim($post['moretext'])));
+                        }
+                        if (!isset($post['hometext'])) {
+                            $story->setHometext(addslashes(trim($this->params[3]['xoops_text'])));
+                        } else {
+                            $story->setHometext(addslashes(trim($post['hometext'])));
+                        }
+                        if ($this->params[4]) {
+                            $story->setApproved(true);
+                            $story->setPublished(time());
+                        }
+                        $story->setTopicalign('R');
+                        if (!$story->store()) {
+                            $this->response->add(new XoopsXmlRpcFault(106));
+                        } else {
+                            $this->response->add(new XoopsXmlRpcBoolean(true));
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    function deletePost()
+    {
+        if (!$this->_checkUser($this->params[1], $this->params[2])) {
+            $this->response->add(new XoopsXmlRpcFault(104));
+        } else {
+            if (!$this->_checkAdmin()) {
+                $this->response->add(new XoopsXmlRpcFault(111));
+            } else {
+                // will be removed... don't worry if this looks bad
+                include_once XOOPS_ROOT_PATH.'/modules/news/class/class.newsstory.php';
+                $story = new NewsStory($this->params[0]);
+                if (!$story->delete()) {
+                    $this->response->add(new XoopsXmlRpcFault(106));
+                } else {
+                    $this->response->add(new XoopsXmlRpcBoolean(true));
+                }
+            }
+        }
+    }
+
+    // currently returns the same struct as in metaWeblogApi
+    function &getPost($respond=true)
+    {
+        if (!$this->_checkUser($this->params[1], $this->params[2])) {
+            $this->response->add(new XoopsXmlRpcFault(104));
+        } else {
+            // will be removed... don't worry if this looks bad
+            include_once XOOPS_ROOT_PATH.'/modules/news/class/class.newsstory.php';
+            $story = new NewsStory($this->params[0]);
+            $ret = array('uid' => $story->uid(), 'published' => $story->published(), 'storyid' => $story->storyId(), 'title' => $story->title('Edit'), 'hometext' => $story->hometext('Edit'), 'moretext' => $story->bodytext('Edit'));
+            if (!$respond) {
+                return $ret;
+            } else {
+                if (!$ret) {
+                    $this->response->add(new XoopsXmlRpcFault(106));
+                } else {
+                    $struct = new XoopsXmlRpcStruct();
+                    $content = '';
+                    foreach ($ret as $key => $value) {
+                        switch($key) {
+                        case 'uid':
+                            $struct->add('userid', new XoopsXmlRpcString($value));
+                            break;
+                        case 'published':
+                            $struct->add('dateCreated', new XoopsXmlRpcDatetime($value));
+                            break;
+                        case 'storyid':
+                            $struct->add('postid', new XoopsXmlRpcString($value));
+                            $struct->add('link', new XoopsXmlRpcString(XOOPS_URL.'/modules/news/article.php?item_id='.$value));
+                            $struct->add('permaLink', new XoopsXmlRpcString(XOOPS_URL.'/modules/news/article.php?item_id='.$value));
+                            break;
+                        case 'title':
+                            $struct->add('title', new XoopsXmlRpcString($value));
+                            break;
+                        default :
+                            $content .= '<'.$key.'>'.trim($value).'</'.$key.'>';
+                            break;
+                        }
+                    }
+                    $struct->add('description', new XoopsXmlRpcString($content));
+                    $this->response->add($struct);
+                }
+            }
+        }
+    }
+
+    function &getRecentPosts($respond=true)
+    {
+        if (!$this->_checkUser($this->params[1], $this->params[2])) {
+            $this->response->add(new XoopsXmlRpcFault(104));
+        } else {
+            include_once XOOPS_ROOT_PATH.'/modules/news/class/class.newsstory.php';
+			if (isset($this->params[4]) && intval($this->params[4]) > 0) {
+				$stories =& NewsStory::getAllPublished(intval($this->params[3]), 0, $this->params[4]);
+			} else {
+            	$stories =& NewsStory::getAllPublished(intval($this->params[3]));
+			}
+            $scount = count($stories);
+            $ret = array();
+            for ($i = 0; $i < $scount; $i++) {
+                $ret[] = array('uid' => $stories[$i]->uid(), 'published' => $stories[$i]->published(), 'storyid' => $stories[$i]->storyId(), 'title' => $stories[$i]->title('Edit'), 'hometext' => $stories[$i]->hometext('Edit'), 'moretext' => $stories[$i]->bodytext('Edit'));
+            }
+            if (!$respond) {
+                return $ret;
+            } else {
+                if (count($ret) == 0) {
+                    $this->response->add(new XoopsXmlRpcFault(106, 'Found 0 Entries'));
+                } else {
+                    $arr = new XoopsXmlRpcArray();
+                    $count = count($ret);
+                    for ($i = 0; $i < $count; $i++) {
+                        $struct = new XoopsXmlRpcStruct();
+                        $content = '';
+                        foreach($ret[$i] as $key => $value) {
+                            switch($key) {
+                            case 'uid':
+                                $struct->add('userid', new XoopsXmlRpcString($value));
+                                break;
+                            case 'published':
+                                $struct->add('dateCreated', new XoopsXmlRpcDatetime($value));
+                                break;
+                            case 'storyid':
+                                $struct->add('postid', new XoopsXmlRpcString($value));
+                                $struct->add('link', new XoopsXmlRpcString(XOOPS_URL.'/modules/news/article.php?item_id='.$value));
+                                $struct->add('permaLink', new XoopsXmlRpcString(XOOPS_URL.'/modules/news/article.php?item_id='.$value));
+                                break;
+                            case 'title':
+                                $struct->add('title', new XoopsXmlRpcString($value));
+                                break;
+                            default :
+                                $content .= '<'.$key.'>'.trim($value).'</'.$key.'>';
+                                break;
+                            }
+                        }
+                        $struct->add('description', new XoopsXmlRpcString($content));
+                        $arr->add($struct);
+                        unset($struct);
+                    }
+                    $this->response->add($arr);
+                }
+            }
+        }
+    }
+
+    function &getCategories($respond=true)
+    {
+        if (!$this->_checkUser($this->params[1], $this->params[2])) {
+            $this->response->add(new XoopsXmlRpcFault(104));
+        } else {
+            include_once XOOPS_ROOT_PATH.'/class/xoopstopic.php';
+            $db =& Database::getInstance();
+            $xt = new XoopsTopic($db->prefix('topics'));
+            $ret = $xt->getTopicsList();
+            if (!$respond) {
+                return $ret;
+            } else {
+                if (count($ret) == 0) {
+                    $this->response->add(new XoopsXmlRpcFault(106, 'Found 0 Entries'));
+                } else {
+                    $arr = new XoopsXmlRpcArray();
+                    foreach ($ret as $topic_id => $topic_vars) {
+                        $struct = new XoopsXmlRpcStruct();
+                        $struct->add('categoryId', new XoopsXmlRpcString($topic_id));
+                        $struct->add('categoryName', new XoopsXmlRpcString($topic_vars['title']));
+						$struct->add('categoryPid', new XoopsXmlRpcString($topic_vars['pid']));
+                        $arr->add($struct);
+                        unset($struct);
+                    }
+                    $this->response->add($arr);
+                }
+            }
+        }
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/xml/rpc/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xml/rpc/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xml/rpc/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/class/xml/rpc/bloggerapi.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xml/rpc/bloggerapi.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xml/rpc/bloggerapi.php	(revision 405)
@@ -0,0 +1,295 @@
+<?php
+// $Id: bloggerapi.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+require_once XOOPS_ROOT_PATH.'/class/xml/rpc/xmlrpcapi.php';
+
+class BloggerApi extends XoopsXmlRpcApi
+{
+
+    function BloggerApi(&$params, &$response, &$module)
+    {
+        $this->XoopsXmlRpcApi($params, $response, $module);
+        $this->_setXoopsTagMap('storyid', 'postid');
+        $this->_setXoopsTagMap('published', 'dateCreated');
+        $this->_setXoopsTagMap('uid', 'userid');
+    }
+
+    function newPost()
+    {
+        if (!$this->_checkUser($this->params[2], $this->params[3])) {
+            $this->response->add(new XoopsXmlRpcFault(104));
+        } else {
+            if (!$fields =& $this->_getPostFields(null, $this->params[1])) {
+                $this->response->add(new XoopsXmlRpcFault(106));
+            } else {
+                $missing = array();
+                $post = array();
+                foreach ($fields as $tag => $detail) {
+                    $maptag = $this->_getXoopsTagMap($tag);
+                    $data = $this->_getTagCdata($this->params[4], $maptag, true);
+                    if (trim($data) == ''){
+                        if ($detail['required']) {
+                            $missing[] = $maptag;
+                        }
+                    } else {
+                        $post[$tag] = $data;
+                    }
+                }
+                if (count($missing) > 0) {
+                    $msg = '';
+                    foreach ($missing as $m) {
+                        $msg .= '<'.$m.'> ';
+                    }
+                    $this->response->add(new XoopsXmlRpcFault(109, $msg));
+                } else {
+                    $newparams = array();
+                    // Xoops Api ignores App key
+                    $newparams[0] = $this->params[1];
+                    $newparams[1] = $this->params[2];
+                    $newparams[2] = $this->params[3];
+                    foreach ($post as $key => $value) {
+                        $newparams[3][$key] =& $value;
+                        unset($value);
+                    }
+                    $newparams[3]['xoops_text'] =& $this->params[4];
+                    $newparams[4] = $this->params[5];
+                    $xoopsapi =& $this->_getXoopsApi($newparams);
+                    $xoopsapi->_setUser($this->user, $this->isadmin);
+                    $xoopsapi->newPost();
+                }
+            }
+        }
+    }
+
+    function editPost()
+    {
+        if (!$this->_checkUser($this->params[2], $this->params[3])) {
+            $this->response->add(new XoopsXmlRpcFault(104));
+        } else {
+            if (!$fields =& $this->_getPostFields($this->params[1])) {
+            } else {
+                $missing = array();
+                $post = array();
+                foreach ($fields as $tag => $detail) {
+                    $data = $this->_getTagCdata($this->params[4], $tag, true);
+                    if (trim($data) == ''){
+                        if ($detail['required']) {
+                            $missing[] = $tag;
+                        }
+                    } else {
+                        $post[$tag] = $data;
+                    }
+                }
+                if (count($missing) > 0) {
+                    $msg = '';
+                    foreach ($missing as $m) {
+                        $msg .= '<'.$m.'> ';
+                    }
+                    $this->response->add(new XoopsXmlRpcFault(109, $msg));
+                } else {
+                    $newparams = array();
+                    // XOOPS API ignores App key (index 0 of params)
+                    $newparams[0] = $this->params[1];
+                    $newparams[1] = $this->params[2];
+                    $newparams[2] = $this->params[3];
+                    foreach ($post as $key => $value) {
+                        $newparams[3][$key] =& $value;
+                        unset($value);
+                    }
+                    $newparams[3]['xoops_text'] =& $this->params[4];
+                    $newparams[4] = $this->params[5];
+                    $xoopsapi =& $this->_getXoopsApi($newparams);
+                    $xoopsapi->_setUser($this->user, $this->isadmin);
+                    $xoopsapi->editPost();
+                }
+            }
+        }
+    }
+
+    function deletePost()
+    {
+        if (!$this->_checkUser($this->params[2], $this->params[3])) {
+            $this->response->add(new XoopsXmlRpcFault(104));
+        } else {
+            // XOOPS API ignores App key (index 0 of params)
+            array_shift($this->params);
+            $xoopsapi =& $this->_getXoopsApi($this->params);
+            $xoopsapi->_setUser($this->user, $this->isadmin);
+            $xoopsapi->deletePost();
+        }
+    }
+
+    function getPost()
+    {
+        if (!$this->_checkUser($this->params[2], $this->params[3])) {
+            $this->response->add(new XoopsXmlRpcFault(104));
+        } else {
+            // XOOPS API ignores App key (index 0 of params)
+            array_shift($this->params);
+            $xoopsapi =& $this->_getXoopsApi($this->params);
+            $xoopsapi->_setUser($this->user, $this->isadmin);
+            $ret =& $xoopsapi->getPost(false);
+            if (is_array($ret)) {
+                $struct = new XoopsXmlRpcStruct();
+                $content = '';
+                foreach ($ret as $key => $value) {
+                    $maptag = $this->_getXoopsTagMap($key);
+                    switch($maptag) {
+                    case 'userid':
+                        $struct->add('userid', new XoopsXmlRpcString($value));
+                        break;
+                    case 'dateCreated':
+                        $struct->add('dateCreated', new XoopsXmlRpcDatetime($value));
+                        break;
+                    case 'postid':
+                        $struct->add('postid', new XoopsXmlRpcString($value));
+                        break;
+                    default :
+                        $content .= '<'.$key.'>'.trim($value).'</'.$key.'>';
+                        break;
+                    }
+                }
+                $struct->add('content', new XoopsXmlRpcString($content));
+                $this->response->add($struct);
+            } else {
+                $this->response->add(new XoopsXmlRpcFault(106));
+            }
+        }
+    }
+
+    function getRecentPosts()
+    {
+        if (!$this->_checkUser($this->params[2], $this->params[3])) {
+            $this->response->add(new XoopsXmlRpcFault(104));
+        } else {
+            // XOOPS API ignores App key (index 0 of params)
+            array_shift($this->params);
+            $xoopsapi =& $this->_getXoopsApi($this->params);
+            $xoopsapi->_setUser($this->user, $this->isadmin);
+            $ret =& $xoopsapi->getRecentPosts(false);
+            if (is_array($ret)) {
+                $arr = new XoopsXmlRpcArray();
+                $count = count($ret);
+                if ($count == 0) {
+                    $this->response->add(new XoopsXmlRpcFault(106, 'Found 0 Entries'));
+                } else {
+                    for ($i = 0; $i < $count; $i++) {
+                        $struct = new XoopsXmlRpcStruct();
+                        $content = '';
+                        foreach($ret[$i] as $key => $value) {
+                            $maptag = $this->_getXoopsTagMap($key);
+                            switch($maptag) {
+                            case 'userid':
+                                $struct->add('userid', new XoopsXmlRpcString($value));
+                                break;
+                            case 'dateCreated':
+                                $struct->add('dateCreated', new XoopsXmlRpcDatetime($value));
+                                break;
+                            case 'postid':
+                                $struct->add('postid', new XoopsXmlRpcString($value));
+                                break;
+                            default :
+                                $content .= '<'.$key.'>'.trim($value).'</'.$key.'>';
+                                break;
+                            }
+                        }
+                        $struct->add('content', new XoopsXmlRpcString($content));
+                        $arr->add($struct);
+                        unset($struct);
+                    }
+                    $this->response->add($arr);
+                }
+            } else {
+                $this->response->add(new XoopsXmlRpcFault(106));
+            }
+        }
+    }
+
+    function getUsersBlogs()
+    {
+        if (!$this->_checkUser($this->params[1], $this->params[2])) {
+            $this->response->add(new XoopsXmlRpcFault(104));
+        } else {
+            $arr = new XoopsXmlRpcArray();
+            $struct = new XoopsXmlRpcStruct();
+            $struct->add('url', new XoopsXmlRpcString(XOOPS_URL.'/modules/'.$this->module->getVar('dirname').'/'));
+            $struct->add('blogid', new XoopsXmlRpcString($this->module->getVar('mid')));
+            $struct->add('blogName', new XoopsXmlRpcString('XOOPS Blog'));
+            $arr->add($struct);
+            $this->response->add($arr);
+        }
+    }
+
+    function getUserInfo()
+    {
+        if (!$this->_checkUser($this->params[1], $this->params[2])) {
+            $this->response->add(new XoopsXmlRpcFault(104));
+        } else {
+            $struct = new XoopsXmlRpcStruct();
+            $struct->add('nickname', new XoopsXmlRpcString($this->user->getVar('uname')));
+            $struct->add('userid', new XoopsXmlRpcString($this->user->getVar('uid')));
+            $struct->add('url', new XoopsXmlRpcString($this->user->getVar('url')));
+            $struct->add('email', new XoopsXmlRpcString($this->user->getVar('email')));
+            $struct->add('lastname', new XoopsXmlRpcString(''));
+            $struct->add('firstname', new XoopsXmlRpcString($this->user->getVar('name')));
+            $this->response->add($struct);
+        }
+    }
+
+    function getTemplate()
+    {
+        if (!$this->_checkUser($this->params[2], $this->params[3])) {
+            $this->response->add(new XoopsXmlRpcFault(104));
+        } else {
+            switch ($this->params[5]) {
+            case 'main':
+                $this->response->add(new XoopsXmlRpcFault(107));
+                break;
+            case 'archiveIndex':
+                $this->response->add(new XoopsXmlRpcFault(107));
+                break;
+            default:
+                $this->response->add(new XoopsXmlRpcFault(107));
+                break;
+            }
+        }
+    }
+
+    function setTemplate()
+    {
+        if (!$this->_checkUser($this->params[2], $this->params[3])) {
+            $this->response->add(new XoopsXmlRpcFault(104));
+        } else {
+            $this->response->add(new XoopsXmlRpcFault(107));
+        }
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/xml/rss/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xml/rss/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xml/rss/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/class/xml/rss/xmlrss2parser.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xml/rss/xmlrss2parser.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xml/rss/xmlrss2parser.php	(revision 405)
@@ -0,0 +1,741 @@
+<?php
+// $Id: xmlrss2parser.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+require_once(XOOPS_ROOT_PATH.'/class/xml/saxparser.php');
+require_once(XOOPS_ROOT_PATH.'/class/xml/xmltaghandler.php');
+
+class XoopsXmlRss2Parser extends SaxParser
+{
+    var $_tempArr = array();
+    var $_channelData = array();
+    var $_imageData = array();
+    var $_items = array();
+
+    function XoopsXmlRss2Parser(&$input)
+    {
+        $this->SaxParser($input);
+		$this->useUtfEncoding();
+        $this->addTagHandler(new RssChannelHandler());
+        $this->addTagHandler(new RssTitleHandler());
+        $this->addTagHandler(new RssLinkHandler());
+        $this->addTagHandler(new RssGeneratorHandler());
+        $this->addTagHandler(new RssDescriptionHandler());
+        $this->addTagHandler(new RssCopyrightHandler());
+        $this->addTagHandler(new RssNameHandler());
+        $this->addTagHandler(new RssManagingEditorHandler());
+        $this->addTagHandler(new RssLanguageHandler());
+        $this->addTagHandler(new RssLastBuildDateHandler());
+        $this->addTagHandler(new RssWebMasterHandler());
+        $this->addTagHandler(new RssImageHandler());
+        $this->addTagHandler(new RssUrlHandler());
+        $this->addTagHandler(new RssWidthHandler());
+        $this->addTagHandler(new RssHeightHandler());
+        $this->addTagHandler(new RssItemHandler());
+        $this->addTagHandler(new RssCategoryHandler());
+        $this->addTagHandler(new RssPubDateHandler());
+        $this->addTagHandler(new RssCommentsHandler());
+        $this->addTagHandler(new RssSourceHandler());
+        $this->addTagHandler(new RssAuthorHandler());
+        $this->addTagHandler(new RssGuidHandler());
+        $this->addTagHandler(new RssTextInputHandler());
+    }
+
+	function setChannelData($name, &$value)
+	{
+		if (!isset($this->_channelData[$name])) {
+			$this->_channelData[$name] =& $value;
+		} else {
+			$this->_channelData[$name] .= $value;
+		}
+	}
+
+    function &getChannelData($name = null)
+    {
+        if (isset($name)) {
+            if (isset($this->_channelData[$name])) {
+                return $this->_channelData[$name];
+            }
+            return false;
+        }
+        return $this->_channelData;
+    }
+
+    function setImageData($name, &$value)
+    {
+        $this->_imageData[$name] =& $value;
+    }
+
+    function &getImageData($name = null)
+    {
+        if (isset($name)) {
+            if (isset($this->_imageData[$name])) {
+                return $this->_imageData[$name];
+            }
+            return false;
+        }
+        return $this->_imageData;
+    }
+
+    function setItems(&$itemarr)
+    {
+        $this->_items[] =& $itemarr;
+    }
+
+    function &getItems()
+    {
+        return $this->_items;
+    }
+
+    function setTempArr($name, &$value, $delim = '')
+    {
+        if (!isset($this->_tempArr[$name])) {
+            $this->_tempArr[$name] =& $value;
+        } else {
+            $this->_tempArr[$name] .= $delim.$value;
+        }
+    }
+
+    function getTempArr()
+    {
+        return $this->_tempArr;
+    }
+
+    function resetTempArr()
+    {
+        unset($this->_tempArr);
+        $this->_tempArr = array();
+    }
+}
+
+class RssChannelHandler extends XmlTagHandler
+{
+
+    function RssChannelHandler()
+    {
+
+    }
+
+    function getName()
+    {
+        return 'channel';
+    }
+}
+
+class RssTitleHandler extends XmlTagHandler
+{
+
+    function RssTitleHandler()
+    {
+
+    }
+
+    function getName()
+    {
+        return 'title';
+    }
+
+    function handleCharacterData(&$parser, &$data)
+    {
+        switch ($parser->getParentTag()) {
+        case 'channel':
+            $parser->setChannelData('title', $data);
+            break;
+        case 'image':
+            $parser->setImageData('title', $data);
+            break;
+        case 'item':
+        case 'textInput':
+            $parser->setTempArr('title', $data);
+            break;
+        default:
+            break;
+        }
+    }
+}
+
+class RssLinkHandler extends XmlTagHandler
+{
+
+    function RssLinkHandler()
+    {
+
+    }
+
+    function getName()
+    {
+        return 'link';
+    }
+
+    function handleCharacterData(&$parser, &$data)
+    {
+        switch ($parser->getParentTag()) {
+        case 'channel':
+            $parser->setChannelData('link', $data);
+            break;
+        case 'image':
+            $parser->setImageData('link', $data);
+            break;
+        case 'item':
+        case 'textInput':
+            $parser->setTempArr('link', $data);
+            break;
+        default:
+            break;
+        }
+    }
+}
+
+class RssDescriptionHandler extends XmlTagHandler
+{
+
+    function RssDescriptionHandler()
+    {
+
+    }
+
+    function getName()
+    {
+        return 'description';
+    }
+
+    function handleCharacterData(&$parser, &$data)
+    {
+        switch ($parser->getParentTag()) {
+        case 'channel':
+            $parser->setChannelData('description', $data);
+            break;
+        case 'image':
+            $parser->setImageData('description', $data);
+            break;
+        case 'item':
+        case 'textInput':
+            $parser->setTempArr('description', $data);
+            break;
+        default:
+            break;
+        }
+    }
+}
+
+class RssGeneratorHandler extends XmlTagHandler
+{
+
+    function RssGeneratorHandler()
+    {
+
+    }
+
+    function getName()
+    {
+        return 'generator';
+    }
+
+    function handleCharacterData(&$parser, &$data)
+    {
+        switch ($parser->getParentTag()) {
+        case 'channel':
+            $parser->setChannelData('generator', $data);
+            break;
+        default:
+            break;
+        }
+    }
+}
+
+class RssCopyrightHandler extends XmlTagHandler
+{
+
+    function RssCopyrightHandler()
+    {
+
+    }
+
+    function getName()
+    {
+        return 'copyright';
+    }
+
+    function handleCharacterData(&$parser, &$data)
+    {
+        switch ($parser->getParentTag()) {
+        case 'channel':
+            $parser->setChannelData('copyright', $data);
+            break;
+        default:
+            break;
+        }
+    }
+}
+
+class RssNameHandler extends XmlTagHandler
+{
+
+    function RssNameHandler()
+    {
+
+    }
+
+    function getName()
+    {
+        return 'name';
+    }
+
+    function handleCharacterData(&$parser, &$data)
+    {
+        switch ($parser->getParentTag()) {
+        case 'textInput':
+            $parser->setTempArr('name', $data);
+            break;
+        default:
+            break;
+        }
+    }
+}
+
+class RssManagingEditorHandler extends XmlTagHandler
+{
+
+    function RssManagingEditorHandler()
+    {
+
+    }
+
+    function getName()
+    {
+        return 'managingEditor';
+    }
+
+    function handleCharacterData(&$parser, &$data)
+    {
+        switch ($parser->getParentTag()) {
+        case 'channel':
+            $parser->setChannelData('editor', $data);
+            break;
+        default:
+            break;
+        }
+    }
+}
+
+class RssLanguageHandler extends XmlTagHandler
+{
+
+    function RssLanguageHandler()
+    {
+
+    }
+
+    function getName()
+    {
+        return 'language';
+    }
+
+    function handleCharacterData(&$parser, &$data)
+    {
+        switch ($parser->getParentTag()) {
+        case 'channel':
+            $parser->setChannelData('language', $data);
+            break;
+        default:
+            break;
+        }
+    }
+}
+
+class RssWebMasterHandler extends XmlTagHandler
+{
+
+    function RssWebMasterHandler()
+    {
+
+    }
+
+    function getName()
+    {
+        return 'webMaster';
+    }
+
+    function handleCharacterData(&$parser, &$data)
+    {
+        switch ($parser->getParentTag()) {
+        case 'channel':
+            $parser->setChannelData('webmaster', $data);
+            break;
+        default:
+            break;
+        }
+    }
+}
+
+class RssDocsHandler extends XmlTagHandler
+{
+
+    function RssDocsHandler()
+    {
+
+    }
+
+    function getName()
+    {
+        return 'docs';
+    }
+
+    function handleCharacterData(&$parser, &$data)
+    {
+        switch ($parser->getParentTag()) {
+        case 'channel':
+            $parser->setChannelData('docs', $data);
+            break;
+        default:
+            break;
+        }
+    }
+}
+
+class RssTtlHandler extends XmlTagHandler
+{
+
+    function RssTtlHandler()
+    {
+
+    }
+
+    function getName()
+    {
+        return 'ttl';
+    }
+
+    function handleCharacterData(&$parser, &$data)
+    {
+        switch ($parser->getParentTag()) {
+        case 'channel':
+            $parser->setChannelData('ttl', $data);
+            break;
+        default:
+            break;
+        }
+    }
+}
+
+class RssTextInputHandler extends XmlTagHandler
+{
+
+    function RssWebMasterHandler()
+    {
+
+    }
+
+    function getName()
+    {
+        return 'textInput';
+    }
+
+    function handleBeginElement(&$parser, &$attributes)
+    {
+        $parser->resetTempArr();
+    }
+
+    function handleEndElement(&$parser)
+    {
+        $parser->setChannelData('textinput', $parser->getTempArr());
+    }
+}
+
+class RssLastBuildDateHandler extends XmlTagHandler
+{
+
+    function RssLastBuildDateHandler()
+    {
+
+    }
+
+    function getName()
+    {
+        return 'lastBuildDate';
+    }
+
+    function handleCharacterData(&$parser, &$data)
+    {
+        switch ($parser->getParentTag()) {
+        case 'channel':
+            $parser->setChannelData('lastbuilddate', $data);
+            break;
+        default:
+            break;
+        }
+    }
+}
+
+class RssImageHandler extends XmlTagHandler
+{
+
+    function RssImageHandler()
+    {
+    }
+
+    function getName()
+    {
+        return 'image';
+    }
+}
+
+class RssUrlHandler extends XmlTagHandler
+{
+
+    function RssUrlHandler()
+    {
+
+    }
+
+    function getName()
+    {
+        return 'url';
+    }
+
+    function handleCharacterData(&$parser, &$data)
+    {
+        if ($parser->getParentTag() == 'image') {
+            $parser->setImageData('url', $data);
+        }
+    }
+}
+
+class RssWidthHandler extends XmlTagHandler
+{
+
+    function RssWidthHandler()
+    {
+
+    }
+
+    function getName()
+    {
+        return 'width';
+    }
+
+    function handleCharacterData(&$parser, &$data)
+    {
+        if ($parser->getParentTag() == 'image') {
+            $parser->setImageData('width', $data);
+        }
+    }
+}
+
+class RssHeightHandler extends XmlTagHandler
+{
+
+    function RssHeightHandler()
+    {
+    }
+
+    function getName()
+    {
+        return 'height';
+    }
+
+    function handleCharacterData(&$parser, &$data)
+    {
+        if ($parser->getParentTag() == 'image') {
+            $parser->setImageData('height', $data);
+        }
+    }
+}
+
+class RssItemHandler extends XmlTagHandler
+{
+
+    function RssItemHandler()
+    {
+
+    }
+
+    function getName()
+    {
+        return 'item';
+    }
+
+    function handleBeginElement(&$parser, &$attributes)
+    {
+        $parser->resetTempArr();
+    }
+
+    function handleEndElement(&$parser)
+    {
+        $parser->setItems($parser->getTempArr());
+    }
+}
+
+class RssCategoryHandler extends XmlTagHandler
+{
+
+    function RssCategoryHandler()
+    {
+
+    }
+
+    function getName()
+    {
+        return 'category';
+    }
+
+    function handleCharacterData(&$parser, &$data)
+    {
+        switch ($parser->getParentTag()) {
+        case 'channel':
+            $parser->setChannelData('category', $data);
+            break;
+        case 'item':
+            $parser->setTempArr('category', $data, ', ');
+        default:
+            break;
+        }
+    }
+}
+
+class RssCommentsHandler extends XmlTagHandler
+{
+
+    function RssCommentsHandler()
+    {
+
+    }
+
+    function getName()
+    {
+        return 'comments';
+    }
+
+    function handleCharacterData(&$parser, &$data)
+    {
+        if ($parser->getParentTag() == 'item') {
+            $parser->setTempArr('comments', $data);
+        }
+    }
+}
+
+class RssPubDateHandler extends XmlTagHandler
+{
+
+    function RssPubDateHandler()
+    {
+
+    }
+
+    function getName()
+    {
+        return 'pubDate';
+    }
+
+    function handleCharacterData(&$parser, &$data)
+    {
+        switch ($parser->getParentTag()) {
+        case 'channel':
+            $parser->setChannelData('pubdate', $data);
+            break;
+        case 'item':
+            $parser->setTempArr('pubdate', $data);
+            break;
+        default:
+            break;
+        }
+    }
+}
+
+class RssGuidHandler extends XmlTagHandler
+{
+
+    function RssGuidHandler()
+    {
+
+    }
+
+    function getName()
+    {
+        return 'guid';
+    }
+
+    function handleCharacterData(&$parser, &$data)
+    {
+        if ($parser->getParentTag() == 'item') {
+            $parser->setTempArr('guid', $data);
+        }
+    }
+}
+
+class RssAuthorHandler extends XmlTagHandler
+{
+
+    function RssGuidHandler()
+    {
+
+    }
+
+    function getName()
+    {
+        return 'author';
+    }
+
+    function handleCharacterData(&$parser, &$data)
+    {
+        if ($parser->getParentTag() == 'item') {
+            $parser->setTempArr('author', $data);
+        }
+    }
+}
+
+class RssSourceHandler extends XmlTagHandler
+{
+
+    function RssSourceHandler()
+    {
+
+    }
+
+    function getName()
+    {
+        return 'source';
+    }
+
+    function handleBeginElement(&$parser, &$attributes)
+    {
+        if ($parser->getParentTag() == 'item') {
+            $parser->setTempArr('source_url', $attributes['url']);
+        }
+    }
+
+    function handleCharacterData(&$parser, &$data)
+    {
+        if ($parser->getParentTag() == 'item') {
+            $parser->setTempArr('source', $data);
+        }
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/xml/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xml/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xml/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/class/module.errorhandler.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/module.errorhandler.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/module.errorhandler.php	(revision 405)
@@ -0,0 +1,123 @@
+<?php
+// $Id: module.errorhandler.php,v 1.4 2005/08/03 12:39:11 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author of File: Goghs (http://www.eqiao.com/)                             //
+################################################################################
+
+if ( !defined("XOOPS_C_ERRORHANDLER_INCLUDED") ) {
+    define("XOOPS_C_ERRORHANDLER_INCLUDED",1);
+
+    /**
+     * Error Handler class
+     *
+     * @package     kernel
+     * @subpackage  core
+     *
+     * @author      Goghs (http://www.eqiao.com/)
+     * @copyright   (c) 2000-2003 The Xoops Project - www.xoops.org
+     */
+    class ErrorHandler
+    {
+        /**
+         * Show an error message
+         *
+         * @param   string  $e_code Errorcode
+         * @param   integer $pages  How many pages should the link take you back?
+         *
+         * @global  $xoopsConfig
+         **/
+        function show($e_code, $pages=1)
+        {
+            global $xoopsConfig, $xoopsUser, $xoopsRequestUri, $xoopsModule, $xoopsLogger;
+            $errmsg = array(
+            "0001" =>"Could not connect to the forums database.",
+            "0002" => "The forum you selected does not exist. Please go back and try again.",
+            "0003" => "Password Incorrect.",
+            "0004" => "Could not query the topics database.",
+            "0005" => "Error getting messages from the database.",
+            "0006" => "Please enter the Nickname and the Password.",
+            "0007" => "You are not the Moderator of this forum therefore you can't perform this function.",
+            "0008" => "You did not enter the correct password, please go back and try again.",
+            "0009" => "Could not remove posts from the database.",
+            "0010" => "Could not move selected topic to selected forum. Please go back and try again.",
+            "0011" => "Could not lock the selected topic. Please go back and try again.",
+            "0012" => "Could not unlock the selected topic. Please go back and try again.",
+            "0013" => "Could not query the database. <br />Error: ".mysql_error()."",
+            "0014" => "No such user or post in the database.",
+            "0015" => "Search Engine was unable to query the forums database.",
+            "0016" => "That user does not exist. Please go back and search again.",
+            "0017" => "You must type a subject to post. You can't post an empty subject. Go back and enter the subject",
+            "0018" => "You must choose message icon to post. Go back and choose message icon.",
+            "0019" => "You must type a message to post. You can't post an empty message. Go back and enter a message.",
+            "0020" => "Could not enter data into the database. Please go back and try again.",
+            "0021" => "Can't delete the selected message.",
+            "0022" => "An error ocurred while querying the database.",
+            "0023" => "Selected message was not found in the forum database.",
+            "0024" => "You can't reply to that message. It wasn't sent to you.",
+            "0025" => "You can't post a reply to this topic, it has been locked. Contact the administrator if you have any question.",
+            "0026" => "The forum or topic you are attempting to post to does not exist. Please try again.",
+            "0027" => "You must enter your username and password. Go back and do so.",
+            "0028" => "You have entered an incorrect password. Go back and try again.",
+            "0029" => "Couldn't update post count.",
+            "0030" => "The forum you are attempting to post to does not exist. Please try again.",
+            "0031" => "Unknown Error",
+            "0035" => "You can't edit a post that's not yours.",
+            "0036" => "You do not have permission to edit this post.",
+            "0037" => "You did not supply the correct password or do not have permission to edit this post. Please go back and try again.",
+            "1001" => "Please enter value for Title.",
+            "1002" => "Please enter value for Phone.",
+            "1003" => "Please enter value for Summary.",
+            "1004" => "Please enter value for Address.",
+            "1005" => "Please enter value for City.",
+            "1006" => "Please enter value for State/Province.",
+            "1007" => "Please enter value for Zipcode.",
+            "1008" => "Please enter value for Description.",
+            "1009" => "Vote for the selected resource only once.<br />All votes are logged and reviewed.",
+            "1010" => "You cannot vote on the resource you submitted.<br />All votes are logged and reviewed.",
+            "1011" => "No rating selected - no vote tallied.",
+            "1013" => "Please enter a search query.",
+            "1016" => "Please enter value for URL.",
+            "1017" => "Please enter value for Home Page.",
+            "9999" => "OOPS! God Knows"
+            );
+
+            $errorno = array_keys($errmsg);
+            if (!in_array($e_code, $errorno)) {
+                $e_code = '9999';
+            }
+            include_once XOOPS_ROOT_PATH."/header.php";
+            //OpenTable();
+            echo "<div><b>".htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES)." Error</b><br /><br />";
+            echo "Error Code: $e_code<br /><br /><br />";
+            echo "<b>ERROR:</b> $errmsg[$e_code]<br /><br /><br />";
+            echo "[ <a href='javascript:history.go(-".$pages.")'>Go Back</a> ]</div>";
+            //CloseTable();
+            include_once XOOPS_ROOT_PATH."/footer.php";
+            exit();
+        }
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/xoopsmodule.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xoopsmodule.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xoopsmodule.php	(revision 405)
@@ -0,0 +1,14 @@
+<?php
+// $Id: xoopsmodule.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+if (!defined('XOOPS_ROOT_PATH')) {
+	exit();
+}
+/**
+ * this file is for backward compatibility only 
+ *
+ **/
+/**
+ * load the new module class 
+ **/
+require_once XOOPS_ROOT_PATH.'/kernel/module.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/database/databasefactory.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/database/databasefactory.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/database/databasefactory.php	(revision 405)
@@ -0,0 +1,66 @@
+<?php
+class XoopsDatabaseFactory
+{
+
+	function XoopsDatabaseFactory()
+	{
+	}
+
+	/**
+	 * Get a reference to the only instance of database class and connects to DB
+     * 
+     * if the class has not been instantiated yet, this will also take 
+     * care of that
+	 * 
+     * @static
+     * @staticvar   object  The only instance of database class
+     * @return      object  Reference to the only instance of database class
+	 */
+	function &getDatabaseConnection()
+	{
+		static $instance;
+		if (!isset($instance)) {
+			$file = XOOPS_ROOT_PATH.'/class/database/'.XOOPS_DB_TYPE.'database.php';
+			require_once $file;
+			if (!defined('XOOPS_DB_PROXY')) {
+				$class = 'Xoops'.ucfirst(XOOPS_DB_TYPE).'DatabaseSafe';
+			} else {
+				$class = 'Xoops'.ucfirst(XOOPS_DB_TYPE).'DatabaseProxy';
+			}
+			$instance =& new $class();
+			$instance->setLogger(XoopsLogger::instance());
+			$instance->setPrefix(XOOPS_DB_PREFIX);
+			if (!$instance->connect()) {
+				trigger_error("Unable to connect to database", E_USER_ERROR);
+			}
+		}
+		return $instance;
+	}
+
+	/**
+	 * Gets a reference to the only instance of database class. Currently
+	 * only being used within the installer.
+	 * 
+     * @static
+     * @staticvar   object  The only instance of database class
+     * @return      object  Reference to the only instance of database class
+	 */
+	function &getDatabase()
+	{
+		static $database;
+		if (!isset($database)) {
+			$file = XOOPS_ROOT_PATH.'/class/database/'.XOOPS_DB_TYPE.'database.php';
+			require_once $file;
+			if (!defined('XOOPS_DB_PROXY')) {
+				$class = 'Xoops'.ucfirst(XOOPS_DB_TYPE).'DatabaseSafe';
+			} else {
+				$class = 'Xoops'.ucfirst(XOOPS_DB_TYPE).'DatabaseProxy';
+			}
+			$database =& new $class();
+		}
+		return $database;
+	}
+
+
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/database/sqlutility.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/database/sqlutility.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/database/sqlutility.php	(revision 405)
@@ -0,0 +1,160 @@
+<?php
+// $Id: sqlutility.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+// sqlutility.php - defines utility class for MySQL database
+/**
+ * @package     kernel
+ * @subpackage  database
+ * 
+ * @author	    Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ */
+
+/**
+ * provide some utility methods for databases
+ * 
+ * @author Kazumi Ono <onokazu@xoops.org>
+ * @copyright copyright (c) 2000-2003 XOOPS.org
+ * 
+ * @package kernel
+ * @subpackage  database
+ */
+class SqlUtility
+{
+	/**
+	* Function from phpMyAdmin (http://phpwizard.net/projects/phpMyAdmin/)
+	*
+ 	* Removes comment and splits large sql files into individual queries
+ 	*
+	* Last revision: September 23, 2001 - gandon
+ 	*
+ 	* @param   array    the splitted sql commands
+ 	* @param   string   the sql commands
+ 	* @return  boolean  always true
+ 	* @access  public
+ 	*/
+	function splitMySqlFile(&$ret, $sql)
+	{
+		$sql               = trim($sql);
+		$sql_len           = strlen($sql);
+		$char              = '';
+    	$string_start      = '';
+    	$in_string         = false;
+
+    	for ($i = 0; $i < $sql_len; ++$i) {
+        	$char = $sql[$i];
+
+           // We are in a string, check for not escaped end of
+		   // strings except for backquotes that can't be escaped
+           if ($in_string) {
+           		for (;;) {
+               		$i         = strpos($sql, $string_start, $i);
+					// No end of string found -> add the current
+					// substring to the returned array
+                	if (!$i) {
+						$ret[] = $sql;
+                    	return true;
+                	}
+					// Backquotes or no backslashes before 
+					// quotes: it's indeed the end of the 
+					// string -> exit the loop
+                	else if ($string_start == '`' || $sql[$i-1] != '\\') {
+						$string_start      = '';
+                   		$in_string         = false;
+                    	break;
+                	}
+                	// one or more Backslashes before the presumed 
+					// end of string...
+                	else {
+						// first checks for escaped backslashes
+                    	$j                     = 2;
+                    	$escaped_backslash     = false;
+						while ($i-$j > 0 && $sql[$i-$j] == '\\') {
+							$escaped_backslash = !$escaped_backslash;
+                        	$j++;
+                    	}
+                    	// ... if escaped backslashes: it's really the 
+						// end of the string -> exit the loop
+                    	if ($escaped_backslash) {
+							$string_start  = '';
+                        	$in_string     = false;
+							break;
+                    	}
+                    	// ... else loop
+                    	else {
+							$i++;
+                    	}
+                	} // end if...elseif...else
+            	} // end for
+        	} // end if (in string)
+        	// We are not in a string, first check for delimiter...
+        	else if ($char == ';') {
+				// if delimiter found, add the parsed part to the returned array
+            	$ret[]    = substr($sql, 0, $i);
+            	$sql      = ltrim(substr($sql, min($i + 1, $sql_len)));
+           		$sql_len  = strlen($sql);
+            	if ($sql_len) {
+					$i      = -1;
+            	} else {
+                	// The submited statement(s) end(s) here
+                	return true;
+				}
+        	} // end else if (is delimiter)
+        	// ... then check for start of a string,...
+        	else if (($char == '"') || ($char == '\'') || ($char == '`')) {
+				$in_string    = true;
+				$string_start = $char;
+        	} // end else if (is start of string)
+
+        	// for start of a comment (and remove this comment if found)...
+        	else if ($char == '#' || ($char == ' ' && $i > 1 && $sql[$i-2] . $sql[$i-1] == '--')) {
+            	// starting position of the comment depends on the comment type
+           		$start_of_comment = (($sql[$i] == '#') ? $i : $i-2);
+            	// if no "\n" exits in the remaining string, checks for "\r"
+            	// (Mac eol style)
+           		$end_of_comment   = (strpos(' ' . $sql, "\012", $i+2))
+                              ? strpos(' ' . $sql, "\012", $i+2)
+                              : strpos(' ' . $sql, "\015", $i+2);
+           		if (!$end_of_comment) {
+                // no eol found after '#', add the parsed part to the returned
+                // array and exit
+					// RMV fix for comments at end of file
+               		$last = trim(substr($sql, 0, $i-1));
+					if (!empty($last)) {
+						$ret[] = $last;
+					}
+               		return true;
+				} else {
+                	$sql     = substr($sql, 0, $start_of_comment) . ltrim(substr($sql, $end_of_comment));
+                	$sql_len = strlen($sql);
+                	$i--;
+            	} // end if...else
+        	} // end else if (is comment)
+    	} // end for
+
+    	// add any rest to the returned array
+    	if (!empty($sql) && trim($sql) != '') {
+			$ret[] = $sql;
+    	}
+    	return true;
+	}
+
+	/**
+	 * add a prefix.'_' to all tablenames in a query
+     * 
+     * @param   string  $query  valid SQL query string
+     * @param   string  $prefix prefix to add to all table names
+	 * @return  mixed   FALSE on failure
+	 */
+	function prefixQuery($query, $prefix)
+	{
+		$pattern = "/^(INSERT INTO|CREATE TABLE|ALTER TABLE|UPDATE)(\s)+([`]?)([^`\s]+)\\3(\s)+/siU";
+		$pattern2 = "/^(DROP TABLE)(\s)+([`]?)([^`\s]+)\\3(\s)?$/siU";
+		if (preg_match($pattern, $query, $matches) || preg_match($pattern2, $query, $matches)) {
+			$replace = "\\1 ".$prefix."_\\4\\5";
+			$matches[0] = preg_replace($pattern, $replace, $query);
+			return $matches;
+		}
+		return false;
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/database/database.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/database/database.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/database/database.php	(revision 405)
@@ -0,0 +1,133 @@
+<?php
+// $Id: database.php,v 1.3 2006/05/01 02:37:24 onokazu Exp $
+// database.php - defines abstract database wrapper class 
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+/**
+ * @package     kernel
+ * @subpackage  database
+ * 
+ * @author      Kazumi Ono  <onokazu@xoops.org>
+ * @copyright   copyright (c) 2000-2003 XOOPS.org
+ */
+
+/**
+ * make sure this is only included once!
+ */
+if ( !defined("XOOPS_C_DATABASE_INCLUDED") ) {
+    define("XOOPS_C_DATABASE_INCLUDED",1);
+
+/**
+ * Abstract base class for Database access classes
+ * 
+ * @abstract
+ * 
+ * @author Kazumi Ono <onokazu@xoops.org>
+ * @copyright copyright (c) 2000-2003 XOOPS.org
+ * 
+ * @package kernel
+ * @subpackage database
+ */
+class XoopsDatabase
+    {
+        /**
+         * Prefix for tables in the database
+         * @var string
+         */
+        var $prefix = '';
+        /**
+         * reference to a {@link XoopsLogger} object
+         * @see XoopsLogger
+         * @var object XoopsLogger
+         */
+        var $logger;
+
+        /**
+         * constructor
+         * 
+         * will always fail, because this is an abstract class!
+         */
+        function XoopsDatabase()
+        {
+            // exit("Cannot instantiate this class directly");
+        }
+
+        /**
+         * assign a {@link XoopsLogger} object to the database
+         * 
+         * @see XoopsLogger
+         * @param object $logger reference to a {@link XoopsLogger} object
+         */
+        function setLogger(&$logger)
+        {
+            $this->logger =& $logger;
+        }
+
+        /**
+         * set the prefix for tables in the database
+         * 
+         * @param string $value table prefix
+         */
+        function setPrefix($value)
+        {
+            $this->prefix = $value;
+        }
+        
+        /**
+         * attach the prefix.'_' to a given tablename
+         * 
+         * if tablename is empty, only prefix will be returned
+         * 
+         * @param string $tablename tablename
+         * @return string prefixed tablename, just prefix if tablename is empty
+         */
+        function prefix($tablename='')
+        {
+            if ( $tablename != '' ) {
+                return $this->prefix .'_'. $tablename;
+            } else {
+                return $this->prefix;
+            }
+        }
+    }
+}
+
+
+/**
+ * Only for backward compatibility
+ * 
+ * @deprecated
+ */
+class Database
+{
+
+    function &getInstance()
+    {
+        $ret =& XoopsDatabaseFactory::getDatabaseConnection();
+        return $ret;
+    }
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/database/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/database/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/database/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/class/database/mysqldatabase.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/database/mysqldatabase.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/database/mysqldatabase.php	(revision 405)
@@ -0,0 +1,393 @@
+<?php
+// $Id: mysqldatabase.php,v 1.3 2006/05/01 02:37:24 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+/**
+ * @package     kernel
+ * @subpackage  database
+ * 
+ * @author      Kazumi Ono  <onokazu@xoops.org>
+ * @copyright   copyright (c) 2000-2003 XOOPS.org
+ */
+
+/**
+ * base class
+ */
+include_once XOOPS_ROOT_PATH."/class/database/database.php";
+
+/**
+ * connection to a mysql database
+ * 
+ * @abstract
+ * 
+ * @author      Kazumi Ono  <onokazu@xoops.org>
+ * @copyright   copyright (c) 2000-2003 XOOPS.org
+ * 
+ * @package     kernel
+ * @subpackage  database
+ */
+class XoopsMySQLDatabase extends XoopsDatabase
+{
+    /**
+     * Database connection
+     * @var resource
+     */
+    var $conn;
+
+    /**
+     * connect to the database
+     * 
+     * @param bool $selectdb select the database now?
+     * @return bool successful?
+     */
+    function connect($selectdb = true)
+    {
+        if (XOOPS_DB_PCONNECT == 1) {
+            $this->conn = @mysql_pconnect(XOOPS_DB_HOST, XOOPS_DB_USER, XOOPS_DB_PASS);
+        } else {
+            $this->conn = @mysql_connect(XOOPS_DB_HOST, XOOPS_DB_USER, XOOPS_DB_PASS);
+        }
+    
+        if (!$this->conn) {
+            $this->logger->addQuery('', $this->error(), $this->errno());
+            return false;
+        }
+        
+        if($selectdb != false){
+            if (!mysql_select_db(XOOPS_DB_NAME)) {
+                $this->logger->addQuery('', $this->error(), $this->errno());
+                return false;
+            }
+        }
+        return true;
+    }
+
+    /**
+     * generate an ID for a new row
+     * 
+     * This is for compatibility only. Will always return 0, because MySQL supports
+     * autoincrement for primary keys.
+     * 
+     * @param string $sequence name of the sequence from which to get the next ID
+     * @return int always 0, because mysql has support for autoincrement
+     */
+    function genId($sequence)
+    {
+        return 0; // will use auto_increment
+    }
+
+    /**
+     * Get a result row as an enumerated array
+     * 
+     * @param resource $result
+     * @return array
+     */
+    function fetchRow($result)
+    {
+        return @mysql_fetch_row($result);
+    }
+
+    /**
+     * Fetch a result row as an associative array
+     *
+     * @return array
+     */
+    function fetchArray($result)
+    {
+        return @mysql_fetch_assoc( $result );
+    }
+
+    /**
+     * Fetch a result row as an associative array
+     *
+     * @return array
+     */
+    function fetchBoth($result)
+    {
+        return @mysql_fetch_array( $result, MYSQL_BOTH );
+    }
+
+    /**
+     * Get the ID generated from the previous INSERT operation
+     * 
+     * @return int
+     */
+    function getInsertId()
+    {
+        return mysql_insert_id($this->conn);
+    }
+
+    /**
+     * Get number of rows in result
+     * 
+     * @param resource query result
+     * @return int
+     */
+    function getRowsNum($result)
+    {
+        return @mysql_num_rows($result);
+    }
+
+    /**
+     * Get number of affected rows
+     *
+     * @return int
+     */
+    function getAffectedRows()
+    {
+        return mysql_affected_rows($this->conn);
+    }
+
+    /**
+     * Close MySQL connection
+     * 
+     */
+    function close()
+    {
+        mysql_close($this->conn);
+    }
+
+    /**
+     * will free all memory associated with the result identifier result.
+     * 
+     * @param resource query result
+     * @return bool TRUE on success or FALSE on failure. 
+     */
+    function freeRecordSet($result)
+    {
+        return mysql_free_result($result);
+    }
+
+    /**
+     * Returns the text of the error message from previous MySQL operation
+     * 
+     * @return bool Returns the error text from the last MySQL function, or '' (the empty string) if no error occurred. 
+     */
+    function error()
+    {
+        return @mysql_error();
+    }
+
+    /**
+     * Returns the numerical value of the error message from previous MySQL operation 
+     * 
+     * @return int Returns the error number from the last MySQL function, or 0 (zero) if no error occurred. 
+     */
+    function errno()
+    {
+        return @mysql_errno();
+    }
+
+    /**
+     * Returns escaped string text with single quotes around it to be safely stored in database
+     * 
+     * @param string $str unescaped string text
+     * @return string escaped string text with single quotes around
+     */
+    function quoteString($str)
+    {
+         $str = "'".str_replace('\\"', '"', addslashes($str))."'";
+         return $str;
+    }
+
+    /**
+     * perform a query on the database
+     * 
+     * @param string $sql a valid MySQL query
+     * @param int $limit number of records to return
+     * @param int $start offset of first record to return
+     * @return resource query result or FALSE if successful
+     * or TRUE if successful and no result
+     */
+    function &queryF($sql, $limit=0, $start=0)
+    {
+        if ( !empty($limit) ) {
+            if (empty($start)) {
+                $start = 0;
+            }
+            $sql = $sql. ' LIMIT '.(int)$start.', '.(int)$limit;
+        }
+        $result = mysql_query($sql, $this->conn);
+        if ( $result ) {
+            $this->logger->addQuery($sql);
+            return $result;
+        } else {
+            $this->logger->addQuery($sql, $this->error(), $this->errno());
+            $ret = false;
+            return $ret;
+        }
+    }
+
+    /**
+     * perform a query
+     * 
+     * This method is empty and does nothing! It should therefore only be
+     * used if nothing is exactly what you want done! ;-)
+     * 
+     * @param string $sql a valid MySQL query
+     * @param int $limit number of records to return
+     * @param int $start offset of first record to return
+     * 
+     * @abstract
+     */
+    function &query($sql, $limit=0, $start=0)
+    {
+
+    }
+
+    /**
+     * perform queries from SQL dump file in a batch
+     * 
+     * @param string $file file path to an SQL dump file
+     * 
+     * @return bool FALSE if failed reading SQL file or TRUE if the file has been read and queries executed
+     */
+    function queryFromFile($file){
+        if (false !== ($fp = fopen($file, 'r'))) {
+            include_once XOOPS_ROOT_PATH.'/class/database/sqlutility.php';
+            $sql_queries = trim(fread($fp, filesize($file)));
+            SqlUtility::splitMySqlFile($pieces, $sql_queries);
+            foreach ($pieces as $query) {
+                // [0] contains the prefixed query
+                // [4] contains unprefixed table name
+                $prefixed_query = SqlUtility::prefixQuery(trim($query), $this->prefix());
+                if ($prefixed_query != false) {
+                    $this->query($prefixed_query[0]);
+                }
+            }
+            return true;
+        }
+        return false;
+    }
+    
+    /**
+     * Get field name
+     *
+     * @param resource $result query result
+     * @param int numerical field index
+     * @return string
+     */
+    function getFieldName($result, $offset)
+    {
+        return mysql_field_name($result, $offset);
+    }
+
+    /**
+     * Get field type
+     *
+     * @param resource $result query result
+     * @param int $offset numerical field index
+     * @return string
+     */
+    function getFieldType($result, $offset)
+    {
+        return mysql_field_type($result, $offset);
+    }
+
+    /**
+     * Get number of fields in result
+     *
+     * @param resource $result query result
+     * @return int
+     */
+    function getFieldsNum($result)
+    {
+        return mysql_num_fields($result);
+    }
+}
+
+/**
+ * Safe Connection to a MySQL database.
+ * 
+ * 
+ * @author Kazumi Ono <onokazu@xoops.org>
+ * @copyright copyright (c) 2000-2003 XOOPS.org
+ * 
+ * @package kernel
+ * @subpackage database
+ */
+class XoopsMySQLDatabaseSafe extends XoopsMySQLDatabase
+{
+
+    /**
+     * perform a query on the database
+     * 
+     * @param string $sql a valid MySQL query
+     * @param int $limit number of records to return
+     * @param int $start offset of first record to return
+     * @return resource query result or FALSE if successful
+     * or TRUE if successful and no result
+     */
+    function &query($sql, $limit=0, $start=0)
+    {
+        $ret =& $this->queryF($sql, $limit, $start);
+        return $ret;
+    }
+}
+
+/**
+ * Read-Only connection to a MySQL database.
+ * 
+ * This class allows only SELECT queries to be performed through its 
+ * {@link query()} method for security reasons.
+ * 
+ * 
+ * @author Kazumi Ono <onokazu@xoops.org>
+ * @copyright copyright (c) 2000-2003 XOOPS.org
+ * 
+ * @package kernel
+ * @subpackage database
+ */
+class XoopsMySQLDatabaseProxy extends XoopsMySQLDatabase
+{
+
+    /**
+     * perform a query on the database
+     * 
+     * this method allows only SELECT queries for safety.
+     * 
+     * @param string $sql a valid MySQL query
+     * @param int $limit number of records to return
+     * @param int $start offset of first record to return
+     * @return resource query result or FALSE if unsuccessful
+     */
+    function &query($sql, $limit=0, $start=0)
+    {
+        $ret = false;
+        $sql = ltrim($sql);
+        if (strtolower(substr($sql, 0, 6)) == 'select') {
+        //if (preg_match("/^SELECT.*/i", $sql)) {
+            $ret =& $this->queryF($sql, $limit, $start);
+        } else {
+            $this->logger->addQuery($sql, 'Database update not allowed during processing of a GET request', 0);
+        }
+        return $ret;
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/pagenav.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/pagenav.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/pagenav.php	(revision 405)
@@ -0,0 +1,194 @@
+<?php
+// $Id: pagenav.php,v 1.5 2005/09/04 20:46:08 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+/**
+ * Class to facilitate navigation in a multi page document/list
+ *
+ * @package     kernel
+ * @subpackage  util
+ *
+ * @author      Kazumi Ono  <onokazu@xoops.org>
+ * @copyright   (c) 2000-2003 The Xoops Project - www.xoops.org
+ */
+class XoopsPageNav
+{
+    /**#@+
+     * @access  private
+     */
+    var $total;
+    var $perpage;
+    var $current;
+    var $url;
+    /**#@-*/
+
+    /**
+     * Constructor
+     *
+     * @param   int     $total_items    Total number of items
+     * @param   int     $items_perpage  Number of items per page
+     * @param   int     $current_start  First item on the current page
+     * @param   string  $start_name     Name for "start" or "offset"
+     * @param   string  $extra_arg      Additional arguments to pass in the URL
+     **/
+    function XoopsPageNav($total_items, $items_perpage, $current_start, $start_name="start", $extra_arg="")
+    {
+        $this->total = intval($total_items);
+        $this->perpage = intval($items_perpage);
+        $this->current = intval($current_start);
+        if ( $extra_arg != '' && ( substr($extra_arg, -5) != '&amp;' || substr($extra_arg, -1) != '&' ) ) {
+            $extra_arg .= '&amp;';
+        }
+        $this->url = xoops_getenv('PHP_SELF').'?'.$extra_arg.trim($start_name).'=';
+    }
+
+    /**
+     * Create text navigation
+     *
+     * @param   integer $offset
+     * @return  string
+     **/
+    function renderNav($offset = 4)
+    {
+        $ret = '';
+        if ( $this->total <= $this->perpage ) {
+            return $ret;
+        }
+        $total_pages = ceil($this->total / $this->perpage);
+        if ( $total_pages > 1 ) {
+            $prev = $this->current - $this->perpage;
+            if ( $prev >= 0 ) {
+                $ret .= '<a href="'.$this->url.$prev.'"><u>&laquo;</u></a> ';
+            }
+            $counter = 1;
+            $current_page = intval(floor(($this->current + $this->perpage) / $this->perpage));
+            while ( $counter <= $total_pages ) {
+                if ( $counter == $current_page ) {
+                    $ret .= '<b>('.$counter.')</b> ';
+                } elseif ( ($counter > $current_page-$offset && $counter < $current_page + $offset ) || $counter == 1 || $counter == $total_pages ) {
+                    if ( $counter == $total_pages && $current_page < $total_pages - $offset ) {
+                        $ret .= '... ';
+                    }
+                    $ret .= '<a href="'.$this->url.(($counter - 1) * $this->perpage).'">'.$counter.'</a> ';
+                    if ( $counter == 1 && $current_page > 1 + $offset ) {
+                        $ret .= '... ';
+                    }
+                }
+                $counter++;
+            }
+            $next = $this->current + $this->perpage;
+            if ( $this->total > $next ) {
+                $ret .= '<a href="'.$this->url.$next.'"><u>&raquo;</u></a> ';
+            }
+        }
+        return $ret;
+    }
+
+    /**
+     * Create a navigational dropdown list
+     *
+     * @param   boolean     $showbutton Show the "Go" button?
+     * @return  string
+     **/
+    function renderSelect($showbutton = false)
+    {
+        if ( $this->total < $this->perpage ) {
+            return;
+        }
+        $total_pages = ceil($this->total / $this->perpage);
+        $ret = '';
+        if ( $total_pages > 1 ) {
+            $ret = '<form name="pagenavform" action="'.xoops_getenv('PHP_SELF').'">';
+            $ret .= '<select name="pagenavselect" onchange="location=this.options[this.options.selectedIndex].value;">';
+            $counter = 1;
+            $current_page = intval(floor(($this->current + $this->perpage) / $this->perpage));
+            while ( $counter <= $total_pages ) {
+                if ( $counter == $current_page ) {
+                    $ret .= '<option value="'.$this->url.(($counter - 1) * $this->perpage).'" selected="selected">'.$counter.'</option>';
+                } else {
+                    $ret .= '<option value="'.$this->url.(($counter - 1) * $this->perpage).'">'.$counter.'</option>';
+                }
+                $counter++;
+            }
+            $ret .= '</select>';
+            if ($showbutton) {
+                $ret .= '&nbsp;<input type="submit" value="'._GO.'" />';
+            }
+            $ret .= '</form>';
+        }
+        return $ret;
+    }
+
+    /**
+     * Create navigation with images
+     *
+     * @param   integer     $offset
+     * @return  string
+     **/
+    function renderImageNav($offset = 4)
+    {
+        if ( $this->total < $this->perpage ) {
+            return;
+        }
+        $total_pages = ceil($this->total / $this->perpage);
+        $ret = '';
+        if ( $total_pages > 1 ) {
+            $ret = '<table><tr>';
+            $prev = $this->current - $this->perpage;
+            if ( $prev >= 0 ) {
+                $ret .= '<td class="pagneutral"><a href="'.$this->url.$prev.'">&lt;</a></td><td><img src="'.XOOPS_URL.'/images/blank.gif" width="6" alt="" /></td>';
+            }
+            $counter = 1;
+            $current_page = intval(floor(($this->current + $this->perpage) / $this->perpage));
+            while ( $counter <= $total_pages ) {
+                if ( $counter == $current_page ) {
+                    $ret .= '<td class="pagact"><b>'.$counter.'</b></td>';
+                } elseif ( ($counter > $current_page-$offset && $counter < $current_page + $offset ) || $counter == 1 || $counter == $total_pages ) {
+                    if ( $counter == $total_pages && $current_page < $total_pages - $offset ) {
+                        $ret .= '<td class="paginact">...</td>';
+                    }
+                    $ret .= '<td class="paginact"><a href="'.$this->url.(($counter - 1) * $this->perpage).'">'.$counter.'</a></td>';
+                    if ( $counter == 1 && $current_page > 1 + $offset ) {
+                        $ret .= '<td class="paginact">...</td>';
+                    }
+                }
+                $counter++;
+            }
+            $next = $this->current + $this->perpage;
+            if ( $this->total > $next ) {
+                $ret .= '<td><img src="'.XOOPS_URL.'/images/blank.gif" width="6" alt="" /></td><td class="pagneutral"><a href="'.$this->url.$next.'">&gt;</a></td>';
+            }
+            $ret .= '</tr></table>';
+        }
+        return $ret;
+    }
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/zipdownloader.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/zipdownloader.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/zipdownloader.php	(revision 405)
@@ -0,0 +1,84 @@
+<?php
+// $Id: zipdownloader.php,v 1.4 2005/08/03 12:39:11 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+if (!defined('XOOPS_ROOT_PATH')) {
+    exit();
+}
+include_once XOOPS_ROOT_PATH.'/class/downloader.php';
+include_once XOOPS_ROOT_PATH.'/class/class.zipfile.php';
+
+class XoopsZipDownloader extends XoopsDownloader
+{
+    function XoopsZipDownloader($ext = '.zip', $mimyType = 'application/x-zip')
+    {
+        $this->archiver = new zipfile();
+        $this->ext      = trim($ext);
+        $this->mimeType = trim($mimyType);
+    }
+
+    function addFile($filepath, $newfilename=null)
+    {
+        // Read in the file's contents
+        $fp = fopen($filepath, "r");
+        $data = fread($fp, filesize($filepath));
+        fclose($fp);
+        $filename = (isset($newfilename) && trim($newfilename) != '') ? trim($newfilename) : $filepath;
+        $filepath = is_file($filename) ? $filename : $filepath;
+        $this->archiver->addFile($data, $filename, filemtime($filepath));
+    }
+
+    function addBinaryFile($filepath, $newfilename=null)
+    {
+        // Read in the file's contents
+        $fp = fopen($filepath, "rb");
+        $data = fread($fp, filesize($filepath));
+        fclose($fp);
+        $filename = (isset($newfilename) && trim($newfilename) != '') ? trim($newfilename) : $filepath;
+        $filepath = is_file($filename) ? $filename : $filepath;
+        $this->archiver->addFile($data, $filename, filemtime($filepath));
+    }
+
+    function addFileData(&$data, $filename, $time=0)
+    {
+        $this->archiver->addFile($data, $filename, $time);
+    }
+
+    function addBinaryFileData(&$data, $filename, $time=0)
+    {
+        $this->addFileData($data, $filename, $time);
+    }
+
+    function download($name, $gzip = true)
+    {
+        $this->_header($name.$this->ext);
+        echo $this->archiver->file();
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/xoopsformloader.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xoopsformloader.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xoopsformloader.php	(revision 405)
@@ -0,0 +1,37 @@
+<?php
+// $Id: xoopsformloader.php,v 1.4 2005/08/03 12:39:11 onokazu Exp $
+if (!defined('XOOPS_ROOT_PATH')) {
+    exit();
+}
+include_once XOOPS_ROOT_PATH."/class/xoopsform/formelement.php";
+include_once XOOPS_ROOT_PATH."/class/xoopsform/form.php";
+include_once XOOPS_ROOT_PATH."/class/xoopsform/formlabel.php";
+include_once XOOPS_ROOT_PATH."/class/xoopsform/formselect.php";
+include_once XOOPS_ROOT_PATH."/class/xoopsform/formpassword.php";
+include_once XOOPS_ROOT_PATH."/class/xoopsform/formbutton.php";
+include_once XOOPS_ROOT_PATH."/class/xoopsform/formcheckbox.php";
+include_once XOOPS_ROOT_PATH."/class/xoopsform/formhidden.php";
+include_once XOOPS_ROOT_PATH."/class/xoopsform/formfile.php";
+include_once XOOPS_ROOT_PATH."/class/xoopsform/formradio.php";
+include_once XOOPS_ROOT_PATH."/class/xoopsform/formradioyn.php";
+//include_once XOOPS_ROOT_PATH."/class/xoopsform/formselectavatar.php";
+include_once XOOPS_ROOT_PATH."/class/xoopsform/formselectcountry.php";
+include_once XOOPS_ROOT_PATH."/class/xoopsform/formselecttimezone.php";
+include_once XOOPS_ROOT_PATH."/class/xoopsform/formselectlang.php";
+include_once XOOPS_ROOT_PATH."/class/xoopsform/formselectgroup.php";
+include_once XOOPS_ROOT_PATH."/class/xoopsform/formselectuser.php";
+include_once XOOPS_ROOT_PATH."/class/xoopsform/formselecttheme.php";
+include_once XOOPS_ROOT_PATH."/class/xoopsform/formselectmatchoption.php";
+include_once XOOPS_ROOT_PATH."/class/xoopsform/formtext.php";
+include_once XOOPS_ROOT_PATH."/class/xoopsform/formtextarea.php";
+include_once XOOPS_ROOT_PATH."/class/xoopsform/formdhtmltextarea.php";
+include_once XOOPS_ROOT_PATH."/class/xoopsform/formelementtray.php";
+include_once XOOPS_ROOT_PATH."/class/xoopsform/themeform.php";
+include_once XOOPS_ROOT_PATH."/class/xoopsform/simpleform.php";
+include_once XOOPS_ROOT_PATH."/class/xoopsform/formtextdateselect.php";
+include_once XOOPS_ROOT_PATH."/class/xoopsform/formdatetime.php";
+include_once XOOPS_ROOT_PATH."/class/xoopsform/formhiddentoken.php";
+include_once XOOPS_ROOT_PATH."/class/xoopsform/formtoken.php";
+//include_once XOOPS_ROOT_PATH."/class/xoopsform/grouppermform.php";
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/xoopsblock.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xoopsblock.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xoopsblock.php	(revision 405)
@@ -0,0 +1,539 @@
+<?php
+// $Id: xoopsblock.php,v 1.5 2006/05/01 02:37:24 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+if (!defined('XOOPS_ROOT_PATH')) {
+    exit();
+}
+require_once XOOPS_ROOT_PATH."/kernel/object.php";
+
+class XoopsBlock extends XoopsObject
+{
+    var $db;
+
+    function XoopsBlock($id = null)
+    {
+        $this->db =& Database::getInstance();
+        $this->initVar('bid', XOBJ_DTYPE_INT, null, false);
+        $this->initVar('mid', XOBJ_DTYPE_INT, 0, false);
+        $this->initVar('func_num', XOBJ_DTYPE_INT, 0, false);
+        $this->initVar('options', XOBJ_DTYPE_TXTBOX, null, false, 255);
+        $this->initVar('name', XOBJ_DTYPE_TXTBOX, null, true, 150);
+        //$this->initVar('position', XOBJ_DTYPE_INT, 0, false);
+        $this->initVar('title', XOBJ_DTYPE_TXTBOX, null, false, 150);
+        $this->initVar('content', XOBJ_DTYPE_TXTAREA, null, false);
+        $this->initVar('side', XOBJ_DTYPE_INT, 0, false);
+        $this->initVar('weight', XOBJ_DTYPE_INT, 0, false);
+        $this->initVar('visible', XOBJ_DTYPE_INT, 0, false);
+        $this->initVar('block_type', XOBJ_DTYPE_OTHER, null, false);
+        $this->initVar('c_type', XOBJ_DTYPE_OTHER, null, false);
+        $this->initVar('isactive', XOBJ_DTYPE_INT, null, false);
+
+        $this->initVar('dirname', XOBJ_DTYPE_TXTBOX, null, false, 50);
+        $this->initVar('func_file', XOBJ_DTYPE_TXTBOX, null, false, 50);
+        $this->initVar('show_func', XOBJ_DTYPE_TXTBOX, null, false, 50);
+        $this->initVar('edit_func', XOBJ_DTYPE_TXTBOX, null, false, 50);
+
+        $this->initVar('template', XOBJ_DTYPE_OTHER, null, false);
+        $this->initVar('bcachetime', XOBJ_DTYPE_INT, 0, false);
+        $this->initVar('last_modified', XOBJ_DTYPE_INT, 0, false);
+
+        if ( !empty($id) ) {
+            if ( is_array($id) ) {
+                $this->assignVars($id);
+            } else {
+                $this->load(intval($id));
+            }
+        }
+    }
+
+    function load($id)
+    {
+        $sql = 'SELECT * FROM '.$this->db->prefix('newblocks').' WHERE bid = '.$id;
+        $arr = $this->db->fetchArray($this->db->query($sql));
+        $this->assignVars($arr);
+    }
+
+    function store()
+    {
+        if ( !$this->cleanVars() ) {
+            return false;
+        }
+        foreach ( $this->cleanVars as $k=>$v ) {
+            ${$k} = $v;
+        }
+        if ( empty($bid) ) {
+            $bid = $this->db->genId($this->db->prefix("newblocks")."_bid_seq");
+            $sql = sprintf("INSERT INTO %s (bid, mid, func_num, options, name, title, content, side, weight, visible, block_type, c_type, isactive, dirname, func_file, show_func, edit_func, template, bcachetime, last_modified) VALUES (%u, %u, %u, %s, %s, %s, %s, %u, %u, %u, %s, %s, %u, %s, %s, %s, %s, %s, %u, %u)", $this->db->prefix('newblocks'), $bid, $mid, $func_num, $this->db->quoteString($options), $this->db->quoteString($name), $this->db->quoteString($title), $this->db->quoteString($content), $side, $weight, $visible, $this->db->quoteString($block_type), $this->db->quoteString($c_type), 1, $this->db->quoteString($dirname), $this->db->quoteString($func_file), $this->db->quoteString($show_func), $this->db->quoteString($edit_func), $this->db->quoteString($template), $bcachetime, time());
+        } else {
+            $sql = "UPDATE ".$this->db->prefix("newblocks")." SET options=".$this->db->quoteString($options);
+            // a custom block needs its own name
+            if ( $block_type == "C" ) {
+                $sql .= ", name=".$this->db->quoteString($name);
+            }
+            $sql .= ", isactive=".$isactive.", title=".$this->db->quoteString($title).", content=".$this->db->quoteString($content).", side=".$side.", weight=".$weight.", visible=".$visible.", c_type=".$this->db->quoteString($c_type).", template=".$this->db->quoteString($template).", bcachetime=".$bcachetime.", last_modified=".time()." WHERE bid=".$bid;
+        }
+        if ( !$this->db->query($sql) ) {
+            $this->setErrors("Could not save block data into database");
+            return false;
+        }
+        if ( empty($bid) ) {
+            $bid = $this->db->getInsertId();
+        }
+        return $bid;
+    }
+
+    function delete()
+    {
+        $sql = sprintf("DELETE FROM %s WHERE bid = %u", $this->db->prefix('newblocks'), $this->getVar('bid'));
+        if ( !$this->db->query($sql) ) {
+            return false;
+        }
+        $sql = sprintf("DELETE FROM %s WHERE gperm_name = 'block_read' AND gperm_itemid = %u AND gperm_modid = 1", $this->db->prefix('group_permission'), $this->getVar('bid'));
+        $this->db->query($sql);
+        $sql = sprintf("DELETE FROM %s WHERE block_id = %u", $this->db->prefix('block_module_link'), $this->getVar('bid'));
+        $this->db->query($sql);
+        return true;
+    }
+
+    /**
+    * do stripslashes/htmlspecialchars according to the needed output
+    *
+    * @param $format      output use: S for Show and E for Edit
+    * @param $c_type    type of block content
+    * @returns string
+    */
+    function &getContent($format = 'S', $c_type = 'T')
+    {
+        switch ( $format ) {
+        case 'S':
+            // check the type of content
+            // H : custom HTML block
+            // P : custom PHP block
+            // S : use text sanitizater (smilies enabled)
+            // T : use text sanitizater (smilies disabled)
+            if ( $c_type == 'H' ) {
+                $ret = str_replace('{X_SITEURL}', XOOPS_URL.'/', $this->getVar('content', 'N'));
+            } elseif ( $c_type == 'P' ) {
+                ob_start();
+                echo eval($this->getVar('content', 'N'));
+                $content = ob_get_contents();
+                ob_end_clean();
+                $ret = str_replace('{X_SITEURL}', XOOPS_URL.'/', $content);
+            } elseif ( $c_type == 'S' ) {
+                $myts =& MyTextSanitizer::getInstance();
+                $ret = str_replace('{X_SITEURL}', XOOPS_URL.'/', $myts->displayTarea($this->getVar('content', 'N'), 1, 1));
+            } else {
+                $myts =& MyTextSanitizer::getInstance();
+                $ret = str_replace('{X_SITEURL}', XOOPS_URL.'/', $myts->displayTarea($this->getVar('content', 'N'), 1, 0));
+            }
+            break;
+        case 'E':
+            $ret = $this->getVar('content', 'E');
+            break;
+        default:
+            $ret = $this->getVar('content', 'N');
+            break;
+        }
+        return $ret;
+    }
+
+    function &buildBlock()
+    {
+        global $xoopsConfig, $xoopsOption;
+        $ret = false;
+        $block = array();
+        // M for module block, S for system block C for Custom
+        if ( $this->getVar("block_type") != "C" ) {
+            // get block display function
+            $show_func = $this->getVar('show_func');
+            if ( !$show_func ) {
+                return $ret;
+            }
+            // must get lang files b4 execution of the function
+            if ( file_exists(XOOPS_ROOT_PATH."/modules/".$this->getVar('dirname')."/blocks/".$this->getVar('func_file')) ) {
+                if ( file_exists(XOOPS_ROOT_PATH."/modules/".$this->getVar('dirname')."/language/".$xoopsConfig['language']."/blocks.php") ) {
+                    include_once XOOPS_ROOT_PATH."/modules/".$this->getVar('dirname')."/language/".$xoopsConfig['language']."/blocks.php";
+                } elseif ( file_exists(XOOPS_ROOT_PATH."/modules/".$this->getVar('dirname')."/language/english/blocks.php") ) {
+                    include_once XOOPS_ROOT_PATH."/modules/".$this->getVar('dirname')."/language/english/blocks.php";
+                }
+                include_once XOOPS_ROOT_PATH."/modules/".$this->getVar('dirname')."/blocks/".$this->getVar('func_file');
+                $options = explode("|", $this->getVar("options"));
+                if ( function_exists($show_func) ) {
+                    // execute the function
+                    $block = $show_func($options);
+                    if ( !$block ) {
+                        return $ret;
+                    }
+                } else {
+                    return $ret;
+                }
+            } else {
+                return $ret;
+            }
+        } else {
+            // it is a custom block, so just return the contents
+            $block['content'] = $this->getContent("S",$this->getVar("c_type"));
+            if (empty($block['content'])) {
+                return $ret;
+            }
+        }
+        return $block;
+    }
+
+    /*
+    * Aligns the content of a block
+    * If position is 0, content in DB is positioned
+    * before the original content
+    * If position is 1, content in DB is positioned
+    * after the original content
+    */
+    function &buildContent($position,$content="",$contentdb="")
+    {
+        if ( $position == 0 ) {
+            $ret = $contentdb.$content;
+        } elseif ( $position == 1 ) {
+            $ret = $content.$contentdb;
+        }
+        return $ret;
+    }
+
+    function &buildTitle($originaltitle, $newtitle="")
+    {
+        if ($newtitle != "") {
+            $ret = $newtitle;
+        } else {
+            $ret = $originaltitle;
+        }
+        return $ret;
+    }
+
+    function isCustom()
+    {
+        if ( $this->getVar("block_type") == "C" ) {
+            return true;
+        }
+        return false;
+    }
+
+    /**
+    * gets html form for editting block options
+    *
+    */
+    function getOptions()
+    {
+        global $xoopsConfig;
+        if ( $this->getVar("block_type") != "C" ) {
+            $edit_func = $this->getVar('edit_func');
+            if ( !$edit_func ) {
+                return false;
+            }
+            if ( file_exists(XOOPS_ROOT_PATH."/modules/".$this->getVar('dirname')."/blocks/".$this->getVar('func_file')) ) {
+                if ( file_exists(XOOPS_ROOT_PATH."/modules/".$this->getVar('dirname')."/language/".$xoopsConfig['language']."/blocks.php") ) {
+                    include_once XOOPS_ROOT_PATH."/modules/".$this->getVar('dirname')."/language/".$xoopsConfig['language']."/blocks.php";
+                } elseif ( file_exists(XOOPS_ROOT_PATH."/modules/".$this->getVar('dirname')."/language/english/blocks.php") ) {
+                    include_once XOOPS_ROOT_PATH."/modules/".$this->getVar('dirname')."/language/english/blocks.php";
+                }
+                include_once XOOPS_ROOT_PATH.'/modules/'.$this->getVar('dirname').'/blocks/'.$this->getVar('func_file');
+                $options = explode("|", $this->getVar("options"));
+                $edit_form = $edit_func($options);
+                if ( !$edit_form ) {
+                    return false;
+                }
+                return $edit_form;
+            } else {
+                return false;
+            }
+        } else {
+            return false;
+        }
+    }
+
+    /**
+    * get all the blocks that match the supplied parameters
+    * @param $side   0: sideblock - left
+    *        1: sideblock - right
+    *        2: sideblock - left and right
+    *        3: centerblock - left
+    *        4: centerblock - right
+    *        5: centerblock - center
+    *        6: centerblock - left, right, center
+    * @param $groupid   groupid (can be an array)
+    * @param $visible   0: not visible 1: visible
+    * @param $orderby   order of the blocks
+    * @returns array of block objects
+    */
+    function &getAllBlocksByGroup($groupid, $asobject=true, $side=null, $visible=null, $orderby="b.weight,b.bid", $isactive=1)
+    {
+        $db =& Database::getInstance();
+        $ret = array();
+        if ( !$asobject ) {
+            $sql = "SELECT b.bid ";
+        } else {
+            $sql = "SELECT b.* ";
+        }
+        $sql .= "FROM ".$db->prefix("newblocks")." b LEFT JOIN ".$db->prefix("group_permission")." l ON l.gperm_itemid=b.bid WHERE gperm_name = 'block_read' AND gperm_modid = 1";
+        if ( is_array($groupid) ) {
+            $sql .= " AND (l.gperm_groupid=".$groupid[0]."";
+            $size = count($groupid);
+            if ( $size  > 1 ) {
+                for ( $i = 1; $i < $size; $i++ ) {
+                    $sql .= " OR l.gperm_groupid=".$groupid[$i]."";
+                }
+            }
+            $sql .= ")";
+        } else {
+            $sql .= " AND l.gperm_groupid=".$groupid."";
+        }
+        $sql .= " AND b.isactive=".$isactive;
+        if ( isset($side) ) {
+            // get both sides in sidebox? (some themes need this)
+            if ( $side == XOOPS_SIDEBLOCK_BOTH ) {
+                $side = "(b.side=0 OR b.side=1)";
+            } elseif ( $side == XOOPS_CENTERBLOCK_ALL ) {
+                $side = "(b.side=3 OR b.side=4 OR b.side=5)";
+            } else {
+                $side = "b.side=".$side;
+            }
+            $sql .= " AND ".$side;
+        }
+        if ( isset($visible) ) {
+            $sql .= " AND b.visible=$visible";
+        }
+        $sql .= " ORDER BY $orderby";
+        $result = $db->query($sql);
+        $added = array();
+        while ( $myrow = $db->fetchArray($result) ) {
+            if ( !in_array($myrow['bid'], $added) ) {
+                if (!$asobject) {
+                    $ret[] = $myrow['bid'];
+                } else {
+                    $ret[] =& new XoopsBlock($myrow);
+                }
+                array_push($added, $myrow['bid']);
+            }
+        }
+        //echo $sql;
+        return $ret;
+    }
+
+    function &getAllBlocks($rettype="object", $side=null, $visible=null, $orderby="side,weight,bid", $isactive=1)
+    {
+        $db =& Database::getInstance();
+        $ret = array();
+        $where_query = " WHERE isactive=".$isactive;
+        if ( isset($side) ) {
+            // get both sides in sidebox? (some themes need this)
+            if ( $side == 2 ) {
+                $side = "(side=0 OR side=1)";
+            } elseif ( $side == 6 ) {
+                $side = "(side=3 OR side=4 OR side=5)";
+            } else {
+                $side = "side=".$side;
+            }
+            $where_query .= " AND ".$side;
+        }
+        if ( isset($visible) ) {
+            $where_query .= " AND visible=$visible";
+        }
+        $where_query .= " ORDER BY $orderby";
+        switch ($rettype) {
+        case "object":
+            $sql = "SELECT * FROM ".$db->prefix("newblocks")."".$where_query;
+            $result = $db->query($sql);
+            while ( $myrow = $db->fetchArray($result) ) {
+                $ret[] =& new XoopsBlock($myrow);
+            }
+            break;
+        case "list":
+            $sql = "SELECT * FROM ".$db->prefix("newblocks")."".$where_query;
+            $result = $db->query($sql);
+            while ( $myrow = $db->fetchArray($result) ) {
+                $block =& new XoopsBlock($myrow);
+                $name = ($block->getVar("block_type") != "C") ? $block->getVar("name") : $block->getVar("title");
+                $ret[$block->getVar("bid")] = $name;
+                unset($block);
+            }
+            break;
+        case "id":
+            $sql = "SELECT bid FROM ".$db->prefix("newblocks")."".$where_query;
+            $result = $db->query($sql);
+            while ( $myrow = $db->fetchArray($result) ) {
+                $ret[] = $myrow['bid'];
+            }
+            break;
+        }
+        //echo $sql;
+        return $ret;
+    }
+
+    function &getByModule($moduleid, $asobject=true)
+    {
+        $db =& Database::getInstance();
+        if ( $asobject == true ) {
+            $sql = $sql = "SELECT * FROM ".$db->prefix("newblocks")." WHERE mid=".$moduleid."";
+        } else {
+            $sql = "SELECT bid FROM ".$db->prefix("newblocks")." WHERE mid=".$moduleid."";
+        }
+        $result = $db->query($sql);
+        $ret = array();
+        while( $myrow = $db->fetchArray($result) ) {
+            if ( $asobject ) {
+                $ret[] =& new XoopsBlock($myrow);
+            } else {
+                $ret[] = $myrow['bid'];
+            }
+        }
+        return $ret;
+    }
+
+    function &getAllByGroupModule($groupid, $module_id=0, $toponlyblock=false, $visible=null, $orderby='b.weight,b.bid', $isactive=1)
+    {
+        $db =& Database::getInstance();
+        $ret = array();
+        $sql = "SELECT DISTINCT gperm_itemid FROM ".$db->prefix('group_permission')." WHERE gperm_name = 'block_read' AND gperm_modid = 1";
+        if ( is_array($groupid) ) {
+            $sql .= ' AND gperm_groupid IN ('.implode(',', $groupid).')';
+        } else {
+            if (intval($groupid) > 0) {
+                $sql .= ' AND gperm_groupid='.$groupid;
+            }
+        }
+        $result = $db->query($sql);
+        $blockids = array();
+        while ( $myrow = $db->fetchArray($result) ) {
+            $blockids[] = $myrow['gperm_itemid'];
+        }
+        if (!empty($blockids)) {
+            $sql = 'SELECT b.* FROM '.$db->prefix('newblocks').' b, '.$db->prefix('block_module_link').' m WHERE m.block_id=b.bid';
+            $sql .= ' AND b.isactive='.$isactive;
+            if (isset($visible)) {
+                $sql .= ' AND b.visible='.intval($visible);
+            }
+            $module_id = intval($module_id);
+            if (!empty($module_id)) {
+                $sql .= ' AND m.module_id IN (0,'.$module_id;
+                if ($toponlyblock) {
+                    $sql .= ',-1';
+                }
+                $sql .= ')';
+            } else {
+                if ($toponlyblock) {
+                    $sql .= ' AND m.module_id IN (0,-1)';
+                } else {
+                    $sql .= ' AND m.module_id=0';
+                }
+            }
+            $sql .= ' AND b.bid IN ('.implode(',', $blockids).')';
+            $sql .= ' ORDER BY '.$orderby;
+            $result = $db->query($sql);
+            while ( $myrow = $db->fetchArray($result) ) {
+                $block =& new XoopsBlock($myrow);
+                $ret[$myrow['bid']] =& $block;
+                unset($block);
+            }
+        }
+        return $ret;
+    }
+
+    function &getNonGroupedBlocks($module_id=0, $toponlyblock=false, $visible=null, $orderby='b.weight,b.bid', $isactive=1)
+    {
+        $db =& Database::getInstance();
+        $ret = array();
+        $bids = array();
+        $sql = "SELECT DISTINCT(bid) from ".$db->prefix('newblocks');
+        if ($result = $db->query($sql)) {
+            while ( $myrow = $db->fetchArray($result) ) {
+                $bids[] = $myrow['bid'];
+            }
+        }
+        $sql = "SELECT DISTINCT(p.gperm_itemid) from ".$db->prefix('group_permission')." p, ".$db->prefix('groups')." g WHERE g.groupid=p.gperm_groupid AND p.gperm_name='block_read'";
+        $grouped = array();
+        if ($result = $db->query($sql)) {
+            while ( $myrow = $db->fetchArray($result) ) {
+                $grouped[] = $myrow['gperm_itemid'];
+            }
+        }
+        $non_grouped = array_diff($bids, $grouped);
+        if (!empty($non_grouped)) {
+            $sql = 'SELECT b.* FROM '.$db->prefix('newblocks').' b, '.$db->prefix('block_module_link').' m WHERE m.block_id=b.bid';
+            $sql .= ' AND b.isactive='.$isactive;
+            if (isset($visible)) {
+                $sql .= ' AND b.visible='.intval($visible);
+            }
+            $module_id = intval($module_id);
+            if (!empty($module_id)) {
+                $sql .= ' AND m.module_id IN (0,'.$module_id;
+                if ($toponlyblock) {
+                    $sql .= ',-1';
+                }
+                $sql .= ')';
+            } else {
+                if ($toponlyblock) {
+                    $sql .= ' AND m.module_id IN (0,-1)';
+                } else {
+                    $sql .= ' AND m.module_id=0';
+                }
+            }
+            $sql .= ' AND b.bid IN ('.implode(',', $non_grouped).')';
+            $sql .= ' ORDER BY '.$orderby;
+            $result = $db->query($sql);
+            while ( $myrow = $db->fetchArray($result) ) {
+                $block =& new XoopsBlock($myrow);
+                $ret[$myrow['bid']] =& $block;
+                unset($block);
+            }
+        }
+        return $ret;
+    }
+
+    function countSimilarBlocks($moduleId, $funcNum, $showFunc = null)
+    {
+        $funcNum = intval($funcNum);
+        $moduleId = intval($moduleId);
+        if ($funcNum < 1 || $moduleId < 1) {
+            // invalid query
+            return 0;
+        }
+        $db =& Database::getInstance();
+        if (isset($showFunc)) {
+            // showFunc is set for more strict comparison
+            $sql = sprintf("SELECT COUNT(*) FROM %s WHERE mid = %d AND func_num = %d AND show_func = %s", $db->prefix('newblocks'), $moduleId, $funcNum, $db->quoteString(trim($showFunc)));
+        } else {
+            $sql = sprintf("SELECT COUNT(*) FROM %s WHERE mid = %d AND func_num = %d", $db->prefix('newblocks'), $moduleId, $funcNum);
+        }
+        if (!$result = $db->query($sql)) {
+            return 0;
+        }
+        list($count) = $db->fetchRow($result);
+        return $count;
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/mimetypes.inc.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/mimetypes.inc.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/mimetypes.inc.php	(revision 405)
@@ -0,0 +1,118 @@
+<?php
+// $Id: mimetypes.inc.php,v 1.1.4.2 2005/04/22 04:35:29 onokazu Exp $
+/**
+* Extension to mimetype lookup table
+*
+* This file is provided as an helper for objects who need to perform filename to mimetype translations.
+* Common types have been provided, but feel free to add your own one if you need it.
+* <br /><br />
+* See the enclosed file LICENSE for licensing information.
+* If you did not receive this file, get it at http://www.fsf.org/copyleft/gpl.html
+*
+* @copyright    The Xoops project http://www.xoops.org/
+* @license      http://www.fsf.org/copyleft/gpl.html GNU public license
+* @author       Skalpa Keo <skalpa@xoops.org>
+* @since        2.0.9.3
+*/
+
+return array(
+     "hqx"      => "application/mac-binhex40",
+     "doc"      => "application/msword",
+     "dot"      => "application/msword",
+     "bin"      => "application/octet-stream",
+     "lha"      => "application/octet-stream",
+     "lzh"      => "application/octet-stream",
+     "exe"      => "application/octet-stream",
+     "class"    => "application/octet-stream",
+     "so"       => "application/octet-stream",
+     "dll"      => "application/octet-stream",
+     "pdf"      => "application/pdf",
+     "ai"       => "application/postscript",
+     "eps"      => "application/postscript",
+     "ps"       => "application/postscript",
+     "smi"      => "application/smil",
+     "smil"     => "application/smil",
+     "wbxml"    => "application/vnd.wap.wbxml",
+     "wmlc"     => "application/vnd.wap.wmlc",
+     "wmlsc"    => "application/vnd.wap.wmlscriptc",
+     "xla"      => "application/vnd.ms-excel",
+     "xls"      => "application/vnd.ms-excel",
+     "xlt"      => "application/vnd.ms-excel",
+     "ppt"      => "application/vnd.ms-powerpoint",
+     "csh"      => "application/x-csh",
+     "dcr"      => "application/x-director",
+     "dir"      => "application/x-director",
+     "dxr"      => "application/x-director",
+     "spl"      => "application/x-futuresplash",
+     "gtar"     => "application/x-gtar",
+     "php"      => "application/x-httpd-php",
+     "php3"     => "application/x-httpd-php",
+     "php5"     => "application/x-httpd-php",
+     "phtml"    => "application/x-httpd-php",
+     "js"       => "application/x-javascript",
+     "sh"       => "application/x-sh",
+     "swf"      => "application/x-shockwave-flash",
+     "sit"      => "application/x-stuffit",
+     "tar"      => "application/x-tar",
+     "tcl"      => "application/x-tcl",
+     "xhtml"    => "application/xhtml+xml",
+     "xht"      => "application/xhtml+xml",
+     "xhtml"    => "application/xml",
+     "ent"      => "application/xml-external-parsed-entity",
+     "dtd"      => "application/xml-dtd",
+     "mod"      => "application/xml-dtd",
+     "gz"       => "application/x-gzip",
+     "zip"      => "application/zip",
+     "au"       => "audio/basic",
+     "snd"      => "audio/basic",
+     "mid"      => "audio/midi",
+     "midi"     => "audio/midi",
+     "kar"      => "audio/midi",
+     "mp1"      => "audio/mpeg",
+     "mp2"      => "audio/mpeg",
+     "mp3"      => "audio/mpeg",
+     "aif"      => "audio/x-aiff",
+     "aiff"     => "audio/x-aiff",
+     "m3u"      => "audio/x-mpegurl",
+     "ram"      => "audio/x-pn-realaudio",
+     "rm"       => "audio/x-pn-realaudio",
+     "rpm"      => "audio/x-pn-realaudio-plugin",
+     "ra"       => "audio/x-realaudio",
+     "wav"      => "audio/x-wav",
+     "bmp"      => "image/bmp",
+     "gif"      => "image/gif",
+     "jpeg"     => "image/jpeg",
+     "jpg"      => "image/jpeg",
+     "jpe"      => "image/jpeg",
+     "png"      => "image/png",
+     "tiff"     => "image/tiff",
+     "tif"      => "image/tif",
+     "wbmp"     => "image/vnd.wap.wbmp",
+     "pnm"      => "image/x-portable-anymap",
+     "pbm"      => "image/x-portable-bitmap",
+     "pgm"      => "image/x-portable-graymap",
+     "ppm"      => "image/x-portable-pixmap",
+     "xbm"      => "image/x-xbitmap",
+     "xpm"      => "image/x-xpixmap",
+     "ics"      => "text/calendar",
+     "ifb"      => "text/calendar",
+     "css"      => "text/css",
+     "html"     => "text/html",
+     "htm"      => "text/html",
+     "asc"      => "text/plain",
+     "txt"      => "text/plain",
+     "rtf"      => "text/rtf",
+     "sgml"     => "text/x-sgml",
+     "sgm"      => "text/x-sgml",
+     "tsv"      => "text/tab-seperated-values",
+     "wml"      => "text/vnd.wap.wml",
+     "wmls"     => "text/vnd.wap.wmlscript",
+     "xsl"      => "text/xml",
+     "mpeg"     => "video/mpeg",
+     "mpg"      => "video/mpeg",
+     "mpe"      => "video/mpeg",
+     "qt"       => "video/quicktime",
+     "mov"      => "video/quicktime",
+     "avi"      => "video/x-msvideo",
+);
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/errorhandler.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/errorhandler.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/errorhandler.php	(revision 405)
@@ -0,0 +1,218 @@
+<?php
+// $Id: errorhandler.php,v 1.5 2006/05/01 02:37:24 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+/**
+ * Error handler class
+ *
+ * @author Michael van Dam
+ */
+class XoopsErrorHandler
+{
+    /**
+     * List of errors
+     *
+     * @var array
+     * @access private
+     */
+    var $_errors = array();
+
+    /**
+     * Show error messages?
+     *
+     * @var boolean
+     * @access private
+     */
+    var $_showErrors = false;
+
+    /**
+     * Was there a fatal error (E_USER_ERROR)
+     *
+     * @var boolean
+     * @access private
+     */
+    var $_isFatal = false;
+
+    /**
+     * Constructor
+     *
+     * Registers the error handler and shutdown functions.  NOTE: when
+     * registering an error handler, the setting or 'error_reporting' is
+     * ignored and *everything* is trapped.
+     */
+    function XoopsErrorHandler()
+    {
+        set_error_handler('XoopsErrorHandler_HandleError');
+        register_shutdown_function('XoopsErrorHandler_Shutdown');
+    }
+
+    /**
+     * Get the (singleton) instance of the error handler
+     *
+     * @access public
+     */
+    function &getInstance()
+    {
+        static $instance = null;
+        if (empty($instance)) {
+            $instance = new XoopsErrorHandler;
+        }
+        return $instance;
+    }
+
+    /**
+     * Activate the error handler
+     *
+     * @access public
+     * @param boolean $showErrors True if debug mode is on
+     * @return void
+     */
+    function activate($showErrors=false)
+    {
+        $this->_showErrors = $showErrors;
+    }
+
+    /**
+     * Handle an error
+     *
+     * @param array $error Associative array containing error info
+     * @access public
+     * @return void
+     */
+    function handleError($error)
+    {
+        if (($error['errno'] & error_reporting()) != $error['errno']) {
+            return;
+        }
+        $this->_errors[] = $error;
+        if ($error['errno'] == E_USER_ERROR) {
+            $this->_isFatal = true;
+            exit();
+        }
+    }
+
+    /**
+     * Render the list of errors
+     *
+     * NOTE: Unfortunately PHP 'fatal' and 'parse' errors are not trappable.
+     * If the server has 'display_errors Off', then the result will be a
+     * blank page.  It would be nice to print a message 'This page cannot
+     * be displayed', but there seems to be no way to print this only when
+     * exiting due to a fatal error rather than normal end of page.
+     *
+     * Thus, 'trigger_error' should be used to trap problems early and
+     * display a meaningful message before a PHP fatal or parse error can
+     * occur.
+     *
+     * @TODO Use CSS
+     * @TODO Use language? or allow customized message?
+     *
+     * @access public
+     * @return void
+     */
+    function renderErrors()
+    {
+		//
+		// TODO We should plan new style about the following lines.
+		//
+        $output = '';
+        if ($this->_isFatal) {
+            $output .= 'This page cannot be displayed due to an internal error.<br/><br/>';
+            $output .= 'If you are the administrator of this site, please visit the <a href="http://xoopscube.org/">XOOPS Cube official site</a> for assistance.<br/><br/>';
+        }
+        if (!$this->_showErrors || empty($this->_errors)) {
+            return $output;
+        }
+
+        foreach( $this->_errors as $error )
+        {
+            switch ( $error['errno'] )
+            {
+                case E_USER_NOTICE:
+                    $output .= "Notice [Xoops]: ";
+                    break;
+                case E_USER_WARNING:
+                    $output .= "Warning [Xoops]: ";
+                    break;
+                case E_USER_ERROR:
+                    $output .= "Error [Xoops]: ";
+                    break;
+                case E_NOTICE:
+                    $output .= "Notice [PHP]: ";
+                    break;
+                case E_WARNING:
+                    $output .= "Warning [PHP]: ";
+                    break;
+                default:
+                    $output .= "Unknown Condition [" . $error['errno'] . "]: ";
+            }
+            $output .= sprintf( "%s in file %s line %s<br />\n", $error['errstr'], $error['errfile'], $error['errline'] );
+        }
+        return $output;
+    }
+
+}
+
+/**
+ * User-defined error handler (called from 'trigger_error')
+ *
+ * NOTE: Some recent versions of PHP have a 5th parameter, &$p_ErrContext
+ * which is an associative array of all variables defined in scope in which
+ * error occurred.  We cannot support this, for compatibility with older PHP.
+ *
+ * @access public
+ * @param int $errNo Type of error
+ * @param string $errStr Error message
+ * @param string $errFile File in which error occurred
+ * @param int $errLine Line number on which error occurred
+ * @return void
+ */
+function XoopsErrorHandler_HandleError($errNo, $errStr, $errFile, $errLine)
+{
+    // NOTE: we only store relative pathnames
+    $new_error = array(
+        'errno' => $errNo,
+        'errstr' => $errStr,
+        'errfile' => preg_replace("|^" . XOOPS_ROOT_PATH . "/|", '', $errFile),
+        'errline' => $errLine
+        );
+    $error_handler =& XoopsErrorHandler::getInstance();
+    $error_handler->handleError($new_error);
+}
+
+/**
+ * User-defined shutdown function (called from 'exit')
+ *
+ * @access public
+ * @return void
+ */
+function XoopsErrorHandler_Shutdown()
+{
+    $error_handler =& XoopsErrorHandler::getInstance();
+    echo $error_handler->renderErrors();
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/snoopy.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/snoopy.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/snoopy.php	(revision 405)
@@ -0,0 +1,1289 @@
+<?php
+
+/*************************************************
+
+Snoopy - the PHP net client
+Author: Monte Ohrt <monte@ispi.net>
+Copyright (c): 1999-2000 ispi, all rights reserved
+Version: 1.01
+
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+You may contact the author of Snoopy by e-mail at:
+monte@ispi.net
+
+Or, write to:
+Monte Ohrt
+CTO, ispi
+237 S. 70th suite 220
+Lincoln, NE 68510
+
+The latest version of Snoopy can be obtained from:
+http://snoopy.sourceforge.net/
+
+*************************************************/
+
+class Snoopy
+{
+	/**** Public variables ****/
+	
+	/* user definable vars */
+
+	var $host			=	"www.php.net";		// host name we are connecting to
+	var $port			=	80;					// port we are connecting to
+	var $host_port		=	"";					// port for Host Header
+	var $proxy_host		=	"";					// proxy host to use
+	var $proxy_port		=	"";					// proxy port to use
+	var $proxy_user		=	"";					// proxy user to use
+	var $proxy_pass		=	"";					// proxy password to use
+	
+	var $agent			=	"Snoopy v1.2.3";	// agent we masquerade as
+	var	$referer		=	"";					// referer info to pass
+	var $cookies		=	array();			// array of cookies to pass
+												// $cookies["username"]="joe";
+	var	$rawheaders		=	array();			// array of raw headers to send
+												// $rawheaders["Content-type"]="text/html";
+
+	var $maxredirs		=	5;					// http redirection depth maximum. 0 = disallow
+	var $lastredirectaddr	=	"";				// contains address of last redirected address
+	var	$offsiteok		=	true;				// allows redirection off-site
+	var $maxframes		=	0;					// frame content depth maximum. 0 = disallow
+	var $expandlinks	=	true;				// expand links to fully qualified URLs.
+												// this only applies to fetchlinks()
+												// submitlinks(), and submittext()
+	var $passcookies	=	true;				// pass set cookies back through redirects
+												// NOTE: this currently does not respect
+												// dates, domains or paths.
+	
+	var	$user			=	"";					// user for http authentication
+	var	$pass			=	"";					// password for http authentication
+	
+	// http accept types
+	var $accept			=	"image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*";
+	
+	var $results		=	"";					// where the content is put
+		
+	var $error			=	"";					// error messages sent here
+	var	$response_code	=	"";					// response code returned from server
+	var	$headers		=	array();			// headers returned from server sent here
+	var	$maxlength		=	500000;				// max return data length (body)
+	var $read_timeout	=	0;					// timeout on read operations, in seconds
+												// supported only since PHP 4 Beta 4
+												// set to 0 to disallow timeouts
+	var $timed_out		=	false;				// if a read operation timed out
+	var	$status			=	0;					// http request status
+
+	var $temp_dir		=	"/tmp";				// temporary directory that the webserver
+												// has permission to write to.
+												// under Windows, this should be C:\temp
+
+	var	$curl_path		=	"/usr/local/bin/curl";
+												// Snoopy will use cURL for fetching
+												// SSL content if a full system path to
+												// the cURL binary is supplied here.
+												// set to false if you do not have
+												// cURL installed. See http://curl.haxx.se
+												// for details on installing cURL.
+												// Snoopy does *not* use the cURL
+												// library functions built into php,
+												// as these functions are not stable
+												// as of this Snoopy release.
+	
+	/**** Private variables ****/	
+	
+	var	$_maxlinelen	=	4096;				// max line length (headers)
+	
+	var $_httpmethod	=	"GET";				// default http request method
+	var $_httpversion	=	"HTTP/1.0";			// default http request version
+	var $_submit_method	=	"POST";				// default submit method
+	var $_submit_type	=	"application/x-www-form-urlencoded";	// default submit type
+	var $_mime_boundary	=   "";					// MIME boundary for multipart/form-data submit type
+	var $_redirectaddr	=	false;				// will be set if page fetched is a redirect
+	var $_redirectdepth	=	0;					// increments on an http redirect
+	var $_frameurls		= 	array();			// frame src urls
+	var $_framedepth	=	0;					// increments on frame depth
+	
+	var $_isproxy		=	false;				// set if using a proxy server
+	var $_fp_timeout	=	30;					// timeout for socket connection
+
+/*======================================================================*\
+	Function:	fetch
+	Purpose:	fetch the contents of a web page
+				(and possibly other protocols in the
+				future like ftp, nntp, gopher, etc.)
+	Input:		$URI	the location of the page to fetch
+	Output:		$this->results	the output text from the fetch
+\*======================================================================*/
+
+	function fetch($URI)
+	{
+	
+		//preg_match("|^([^:]+)://([^:/]+)(:[\d]+)*(.*)|",$URI,$URI_PARTS);
+		$URI_PARTS = parse_url($URI);
+		if (!empty($URI_PARTS["user"]))
+			$this->user = $URI_PARTS["user"];
+		if (!empty($URI_PARTS["pass"]))
+			$this->pass = $URI_PARTS["pass"];
+		if (empty($URI_PARTS["query"]))
+			$URI_PARTS["query"] = '';
+		if (empty($URI_PARTS["path"]))
+			$URI_PARTS["path"] = '';
+				
+		switch(strtolower($URI_PARTS["scheme"]))
+		{
+			case "http":
+				$this->host = $URI_PARTS["host"];
+				if(!empty($URI_PARTS["port"])) {
+					$this->port = $URI_PARTS["port"];
+					$this->host_port = $URI_PARTS["port"];
+				}
+				if($this->_connect($fp))
+				{
+					if($this->_isproxy)
+					{
+						// using proxy, send entire URI
+						$this->_httprequest($URI,$fp,$URI,$this->_httpmethod);
+					}
+					else
+					{
+						$path = $URI_PARTS["path"].($URI_PARTS["query"] ? "?".$URI_PARTS["query"] : "");
+						// no proxy, send only the path
+						$this->_httprequest($path, $fp, $URI, $this->_httpmethod);
+					}
+					
+					$this->_disconnect($fp);
+
+					if($this->_redirectaddr)
+					{
+						/* url was redirected, check if we've hit the max depth */
+						if($this->maxredirs > $this->_redirectdepth)
+						{
+							// only follow redirect if it's on this site, or offsiteok is true
+							if(preg_match("|^http://".preg_quote($this->host)."|i",$this->_redirectaddr) || $this->offsiteok)
+							{
+								/* follow the redirect */
+								$this->_redirectdepth++;
+								$this->lastredirectaddr=$this->_redirectaddr;
+								$this->fetch($this->_redirectaddr);
+							}
+						}
+					}
+
+					if($this->_framedepth < $this->maxframes && count($this->_frameurls) > 0)
+					{
+						$frameurls = $this->_frameurls;
+						$this->_frameurls = array();
+						
+						while(list(,$frameurl) = each($frameurls))
+						{
+							if($this->_framedepth < $this->maxframes)
+							{
+								$this->fetch($frameurl);
+								$this->_framedepth++;
+							}
+							else
+								break;
+						}
+					}					
+				}
+				else
+				{
+					return false;
+				}
+				return true;					
+				break;
+			case "https":
+				if(!$this->curl_path)
+					return false;
+				if(function_exists("is_executable"))
+				    if (!is_executable($this->curl_path))
+				        return false;
+				$this->host = $URI_PARTS["host"];
+				if(!empty($URI_PARTS["port"])) {
+					$this->port = $URI_PARTS["port"];
+					$this->host_port = $URI_PARTS["port"];
+				}
+				if($this->_isproxy)
+				{
+					// using proxy, send entire URI
+					$this->_httpsrequest($URI,$URI,$this->_httpmethod);
+				}
+				else
+				{
+					$path = $URI_PARTS["path"].($URI_PARTS["query"] ? "?".$URI_PARTS["query"] : "");
+					// no proxy, send only the path
+					$this->_httpsrequest($path, $URI, $this->_httpmethod);
+				}
+
+				if($this->_redirectaddr)
+				{
+					/* url was redirected, check if we've hit the max depth */
+					if($this->maxredirs > $this->_redirectdepth)
+					{
+						// only follow redirect if it's on this site, or offsiteok is true
+						if(preg_match("|^http://".preg_quote($this->host)."|i",$this->_redirectaddr) || $this->offsiteok)
+						{
+							/* follow the redirect */
+							$this->_redirectdepth++;
+							$this->lastredirectaddr=$this->_redirectaddr;
+							$this->fetch($this->_redirectaddr);
+						}
+					}
+				}
+
+				if($this->_framedepth < $this->maxframes && count($this->_frameurls) > 0)
+				{
+					$frameurls = $this->_frameurls;
+					$this->_frameurls = array();
+
+					while(list(,$frameurl) = each($frameurls))
+					{
+						if($this->_framedepth < $this->maxframes)
+						{
+							$this->fetch($frameurl);
+							$this->_framedepth++;
+						}
+						else
+							break;
+					}
+				}					
+				return true;					
+				break;
+			default:
+				// not a valid protocol
+				$this->error	=	'Invalid protocol "'.$URI_PARTS["scheme"].'"\n';
+				return false;
+				break;
+		}		
+		return true;
+	}
+
+/*======================================================================*\
+	Function:	submit
+	Purpose:	submit an http form
+	Input:		$URI	the location to post the data
+				$formvars	the formvars to use.
+					format: $formvars["var"] = "val";
+				$formfiles  an array of files to submit
+					format: $formfiles["var"] = "/dir/filename.ext";
+	Output:		$this->results	the text output from the post
+\*======================================================================*/
+
+	function submit($URI, $formvars="", $formfiles="")
+	{
+		unset($postdata);
+		
+		$postdata = $this->_prepare_post_body($formvars, $formfiles);
+			
+		$URI_PARTS = parse_url($URI);
+		if (!empty($URI_PARTS["user"]))
+			$this->user = $URI_PARTS["user"];
+		if (!empty($URI_PARTS["pass"]))
+			$this->pass = $URI_PARTS["pass"];
+		if (empty($URI_PARTS["query"]))
+			$URI_PARTS["query"] = '';
+		if (empty($URI_PARTS["path"]))
+			$URI_PARTS["path"] = '';
+
+		switch(strtolower($URI_PARTS["scheme"]))
+		{
+			case "http":
+				$this->host = $URI_PARTS["host"];
+				if(!empty($URI_PARTS["port"])) {
+					$this->port = $URI_PARTS["port"];
+					$this->host_port = $URI_PARTS["port"];
+				}
+				if($this->_connect($fp))
+				{
+					if($this->_isproxy)
+					{
+						// using proxy, send entire URI
+						$this->_httprequest($URI,$fp,$URI,$this->_submit_method,$this->_submit_type,$postdata);
+					}
+					else
+					{
+						$path = $URI_PARTS["path"].($URI_PARTS["query"] ? "?".$URI_PARTS["query"] : "");
+						// no proxy, send only the path
+						$this->_httprequest($path, $fp, $URI, $this->_submit_method, $this->_submit_type, $postdata);
+					}
+					
+					$this->_disconnect($fp);
+
+					if($this->_redirectaddr)
+					{
+						/* url was redirected, check if we've hit the max depth */
+						if($this->maxredirs > $this->_redirectdepth)
+						{						
+							if(!preg_match("|^".$URI_PARTS["scheme"]."://|", $this->_redirectaddr))
+								$this->_redirectaddr = $this->_expandlinks($this->_redirectaddr,$URI_PARTS["scheme"]."://".$URI_PARTS["host"]);						
+							
+							// only follow redirect if it's on this site, or offsiteok is true
+							if(preg_match("|^http://".preg_quote($this->host)."|i",$this->_redirectaddr) || $this->offsiteok)
+							{
+								/* follow the redirect */
+								$this->_redirectdepth++;
+								$this->lastredirectaddr=$this->_redirectaddr;
+								if( strpos( $this->_redirectaddr, "?" ) > 0 )
+									$this->fetch($this->_redirectaddr); // the redirect has changed the request method from post to get
+								else
+									$this->submit($this->_redirectaddr,$formvars, $formfiles);
+							}
+						}
+					}
+
+					if($this->_framedepth < $this->maxframes && count($this->_frameurls) > 0)
+					{
+						$frameurls = $this->_frameurls;
+						$this->_frameurls = array();
+						
+						while(list(,$frameurl) = each($frameurls))
+						{														
+							if($this->_framedepth < $this->maxframes)
+							{
+								$this->fetch($frameurl);
+								$this->_framedepth++;
+							}
+							else
+								break;
+						}
+					}					
+					
+				}
+				else
+				{
+					return false;
+				}
+				return true;					
+				break;
+			case "https":
+				if(!$this->curl_path)
+					return false;
+				if(function_exists("is_executable"))
+				    if (!is_executable($this->curl_path))
+				        return false;
+				$this->host = $URI_PARTS["host"];
+				if(!empty($URI_PARTS["port"])) {
+					$this->port = $URI_PARTS["port"];
+					$this->host_port = $URI_PARTS["port"];
+				}
+				if($this->_isproxy)
+				{
+					// using proxy, send entire URI
+					$this->_httpsrequest($URI, $URI, $this->_submit_method, $this->_submit_type, $postdata);
+				}
+				else
+				{
+					$path = $URI_PARTS["path"].($URI_PARTS["query"] ? "?".$URI_PARTS["query"] : "");
+					// no proxy, send only the path
+					$this->_httpsrequest($path, $URI, $this->_submit_method, $this->_submit_type, $postdata);
+				}
+
+				if($this->_redirectaddr)
+				{
+					/* url was redirected, check if we've hit the max depth */
+					if($this->maxredirs > $this->_redirectdepth)
+					{						
+						if(!preg_match("|^".$URI_PARTS["scheme"]."://|", $this->_redirectaddr))
+							$this->_redirectaddr = $this->_expandlinks($this->_redirectaddr,$URI_PARTS["scheme"]."://".$URI_PARTS["host"]);						
+
+						// only follow redirect if it's on this site, or offsiteok is true
+						if(preg_match("|^http://".preg_quote($this->host)."|i",$this->_redirectaddr) || $this->offsiteok)
+						{
+							/* follow the redirect */
+							$this->_redirectdepth++;
+							$this->lastredirectaddr=$this->_redirectaddr;
+							if( strpos( $this->_redirectaddr, "?" ) > 0 )
+								$this->fetch($this->_redirectaddr); // the redirect has changed the request method from post to get
+							else
+								$this->submit($this->_redirectaddr,$formvars, $formfiles);
+						}
+					}
+				}
+
+				if($this->_framedepth < $this->maxframes && count($this->_frameurls) > 0)
+				{
+					$frameurls = $this->_frameurls;
+					$this->_frameurls = array();
+
+					while(list(,$frameurl) = each($frameurls))
+					{														
+						if($this->_framedepth < $this->maxframes)
+						{
+							$this->fetch($frameurl);
+							$this->_framedepth++;
+						}
+						else
+							break;
+					}
+				}					
+				return true;					
+				break;
+				
+			default:
+				// not a valid protocol
+				$this->error	=	'Invalid protocol "'.$URI_PARTS["scheme"].'"\n';
+				return false;
+				break;
+		}		
+		return true;
+	}
+
+/*======================================================================*\
+	Function:	fetchlinks
+	Purpose:	fetch the links from a web page
+	Input:		$URI	where you are fetching from
+	Output:		$this->results	an array of the URLs
+\*======================================================================*/
+
+	function fetchlinks($URI)
+	{
+		if ($this->fetch($URI))
+		{			
+			if($this->lastredirectaddr)
+				$URI = $this->lastredirectaddr;
+			if(is_array($this->results))
+			{
+				for($x=0;$x<count($this->results);$x++)
+					$this->results[$x] = $this->_striplinks($this->results[$x]);
+			}
+			else
+				$this->results = $this->_striplinks($this->results);
+
+			if($this->expandlinks)
+				$this->results = $this->_expandlinks($this->results, $URI);
+			return true;
+		}
+		else
+			return false;
+	}
+
+/*======================================================================*\
+	Function:	fetchform
+	Purpose:	fetch the form elements from a web page
+	Input:		$URI	where you are fetching from
+	Output:		$this->results	the resulting html form
+\*======================================================================*/
+
+	function fetchform($URI)
+	{
+		
+		if ($this->fetch($URI))
+		{			
+
+			if(is_array($this->results))
+			{
+				for($x=0;$x<count($this->results);$x++)
+					$this->results[$x] = $this->_stripform($this->results[$x]);
+			}
+			else
+				$this->results = $this->_stripform($this->results);
+			
+			return true;
+		}
+		else
+			return false;
+	}
+	
+	
+/*======================================================================*\
+	Function:	fetchtext
+	Purpose:	fetch the text from a web page, stripping the links
+	Input:		$URI	where you are fetching from
+	Output:		$this->results	the text from the web page
+\*======================================================================*/
+
+	function fetchtext($URI)
+	{
+		if($this->fetch($URI))
+		{			
+			if(is_array($this->results))
+			{
+				for($x=0;$x<count($this->results);$x++)
+					$this->results[$x] = $this->_striptext($this->results[$x]);
+			}
+			else
+				$this->results = $this->_striptext($this->results);
+			return true;
+		}
+		else
+			return false;
+	}
+
+/*======================================================================*\
+	Function:	submitlinks
+	Purpose:	grab links from a form submission
+	Input:		$URI	where you are submitting from
+	Output:		$this->results	an array of the links from the post
+\*======================================================================*/
+
+	function submitlinks($URI, $formvars="", $formfiles="")
+	{
+		if($this->submit($URI,$formvars, $formfiles))
+		{			
+			if($this->lastredirectaddr)
+				$URI = $this->lastredirectaddr;
+			if(is_array($this->results))
+			{
+				for($x=0;$x<count($this->results);$x++)
+				{
+					$this->results[$x] = $this->_striplinks($this->results[$x]);
+					if($this->expandlinks)
+						$this->results[$x] = $this->_expandlinks($this->results[$x],$URI);
+				}
+			}
+			else
+			{
+				$this->results = $this->_striplinks($this->results);
+				if($this->expandlinks)
+					$this->results = $this->_expandlinks($this->results,$URI);
+			}
+			return true;
+		}
+		else
+			return false;
+	}
+
+/*======================================================================*\
+	Function:	submittext
+	Purpose:	grab text from a form submission
+	Input:		$URI	where you are submitting from
+	Output:		$this->results	the text from the web page
+\*======================================================================*/
+
+	function submittext($URI, $formvars = "", $formfiles = "")
+	{
+		if($this->submit($URI,$formvars, $formfiles))
+		{			
+			if($this->lastredirectaddr)
+				$URI = $this->lastredirectaddr;
+			if(is_array($this->results))
+			{
+				for($x=0;$x<count($this->results);$x++)
+				{
+					$this->results[$x] = $this->_striptext($this->results[$x]);
+					if($this->expandlinks)
+						$this->results[$x] = $this->_expandlinks($this->results[$x],$URI);
+				}
+			}
+			else
+			{
+				$this->results = $this->_striptext($this->results);
+				if($this->expandlinks)
+					$this->results = $this->_expandlinks($this->results,$URI);
+			}
+			return true;
+		}
+		else
+			return false;
+	}
+
+	
+
+/*======================================================================*\
+	Function:	set_submit_multipart
+	Purpose:	Set the form submission content type to
+				multipart/form-data
+\*======================================================================*/
+	function set_submit_multipart()
+	{
+		$this->_submit_type = "multipart/form-data";
+	}
+
+	
+/*======================================================================*\
+	Function:	set_submit_normal
+	Purpose:	Set the form submission content type to
+				application/x-www-form-urlencoded
+\*======================================================================*/
+	function set_submit_normal()
+	{
+		$this->_submit_type = "application/x-www-form-urlencoded";
+	}
+
+	
+// XOOPS2 Hack begin
+// Added on March 4, 2003 by onokazu@xoops.org
+/*======================================================================*\
+	Function:	set_submit_xml
+	Purpose:	Set the submission content type to
+				text/xml
+\*======================================================================*/
+	function set_submit_xml()
+	{
+		$this->_submit_type = "text/xml";
+	}
+// XOOPS2 Hack end
+	
+
+/*======================================================================*\
+	Private functions
+\*======================================================================*/
+	
+	
+/*======================================================================*\
+	Function:	_striplinks
+	Purpose:	strip the hyperlinks from an html document
+	Input:		$document	document to strip.
+	Output:		$match		an array of the links
+\*======================================================================*/
+
+	function _striplinks($document)
+	{	
+		preg_match_all("'<\s*a\s.*?href\s*=\s*			# find <a href=
+						([\"\'])?					# find single or double quote
+						(?(1) (.*?)\\1 | ([^\s\>]+))		# if quote found, match up to next matching
+													# quote, otherwise match up to next space
+						'isx",$document,$links);
+						
+
+		// catenate the non-empty matches from the conditional subpattern
+
+		while(list($key,$val) = each($links[2]))
+		{
+			if(!empty($val))
+				$match[] = $val;
+		}				
+		
+		while(list($key,$val) = each($links[3]))
+		{
+			if(!empty($val))
+				$match[] = $val;
+		}		
+		
+		// return the links
+		return $match;
+	}
+
+/*======================================================================*\
+	Function:	_stripform
+	Purpose:	strip the form elements from an html document
+	Input:		$document	document to strip.
+	Output:		$match		an array of the links
+\*======================================================================*/
+
+	function _stripform($document)
+	{	
+		preg_match_all("'<\/?(FORM|INPUT|SELECT|TEXTAREA|(OPTION))[^<>]*>(?(2)(.*(?=<\/?(option|select)[^<>]*>[\r\n]*)|(?=[\r\n]*))|(?=[\r\n]*))'Usi",$document,$elements);
+		
+		// catenate the matches
+		$match = implode("\r\n",$elements[0]);
+				
+		// return the links
+		return $match;
+	}
+
+	
+	
+/*======================================================================*\
+	Function:	_striptext
+	Purpose:	strip the text from an html document
+	Input:		$document	document to strip.
+	Output:		$text		the resulting text
+\*======================================================================*/
+
+	function _striptext($document)
+	{
+		
+		// I didn't use preg eval (//e) since that is only available in PHP 4.0.
+		// so, list your entities one by one here. I included some of the
+		// more common ones.
+								
+		$search = array("'<script[^>]*?>.*?</script>'si",	// strip out javascript
+						"'<[\/\!]*?[^<>]*?>'si",			// strip out html tags
+						"'([\r\n])[\s]+'",					// strip out white space
+						"'&(quot|#34|#034|#x22);'i",		// replace html entities
+						"'&(amp|#38|#038|#x26);'i",			// added hexadecimal values
+						"'&(lt|#60|#060|#x3c);'i",
+						"'&(gt|#62|#062|#x3e);'i",
+						"'&(nbsp|#160|#xa0);'i",
+						"'&(iexcl|#161);'i",
+						"'&(cent|#162);'i",
+						"'&(pound|#163);'i",
+						"'&(copy|#169);'i",
+						"'&(reg|#174);'i",
+						"'&(deg|#176);'i",
+						"'&(#39|#039|#x27);'",
+						"'&(euro|#8364);'i",				// europe
+						"'&a(uml|UML);'",					// german
+						"'&o(uml|UML);'",
+						"'&u(uml|UML);'",
+						"'&A(uml|UML);'",
+						"'&O(uml|UML);'",
+						"'&U(uml|UML);'",
+						"'&szlig;'i",
+						);
+		$replace = array(	"",
+							"",
+							"\\1",
+							"\"",
+							"&",
+							"<",
+							">",
+							" ",
+							chr(161),
+							chr(162),
+							chr(163),
+							chr(169),
+							chr(174),
+							chr(176),
+							chr(39),
+							chr(128),
+							chr(228),
+							chr(246),
+							chr(252),
+							chr(196),
+							chr(214),
+							chr(220),
+							chr(223),
+						);
+					
+		$text = preg_replace($search,$replace,$document);
+								
+		return $text;
+	}
+
+/*======================================================================*\
+	Function:	_expandlinks
+	Purpose:	expand each link into a fully qualified URL
+	Input:		$links			the links to qualify
+				$URI			the full URI to get the base from
+	Output:		$expandedLinks	the expanded links
+\*======================================================================*/
+
+	function _expandlinks($links,$URI)
+	{
+		
+		preg_match("/^[^\?]+/",$URI,$match);
+
+		$match = preg_replace("|/[^\/\.]+\.[^\/\.]+$|","",$match[0]);
+		$match = preg_replace("|/$|","",$match);
+		$match_part = parse_url($match);
+		$match_root =
+		$match_part["scheme"]."://".$match_part["host"];
+				
+		$search = array( 	"|^http://".preg_quote($this->host)."|i",
+							"|^(\/)|i",
+							"|^(?!http://)(?!mailto:)|i",
+							"|/\./|",
+							"|/[^\/]+/\.\./|"
+						);
+						
+		$replace = array(	"",
+							$match_root."/",
+							$match."/",
+							"/",
+							"/"
+						);			
+				
+		$expandedLinks = preg_replace($search,$replace,$links);
+
+		return $expandedLinks;
+	}
+
+/*======================================================================*\
+	Function:	_httprequest
+	Purpose:	go get the http data from the server
+	Input:		$url		the url to fetch
+				$fp			the current open file pointer
+				$URI		the full URI
+				$body		body contents to send if any (POST)
+	Output:		
+\*======================================================================*/
+	
+	function _httprequest($url,$fp,$URI,$http_method,$content_type="",$body="")
+	{
+		$cookie_headers = '';
+		if($this->passcookies && $this->_redirectaddr)
+			$this->setcookies();
+			
+		$URI_PARTS = parse_url($URI);
+		if(empty($url))
+			$url = "/";
+		$headers = $http_method." ".$url." ".$this->_httpversion."\r\n";		
+		if(!empty($this->agent))
+			$headers .= "User-Agent: ".$this->agent."\r\n";
+		if(!empty($this->host) && !isset($this->rawheaders['Host'])) {
+			$headers .= "Host: ".$this->host;
+			if(!empty($this->host_port))
+				$headers .= ":".$this->host_port;
+			$headers .= "\r\n";
+		}
+		if(!empty($this->accept))
+			$headers .= "Accept: ".$this->accept."\r\n";
+		if(!empty($this->referer))
+			$headers .= "Referer: ".$this->referer."\r\n";
+		if(!empty($this->cookies))
+		{			
+			if(!is_array($this->cookies))
+				$this->cookies = (array)$this->cookies;
+	
+			reset($this->cookies);
+			if ( count($this->cookies) > 0 ) {
+				$cookie_headers .= 'Cookie: ';
+				foreach ( $this->cookies as $cookieKey => $cookieVal ) {
+				$cookie_headers .= $cookieKey."=".urlencode($cookieVal)."; ";
+				}
+				$headers .= substr($cookie_headers,0,-2) . "\r\n";
+			} 
+		}
+		if(!empty($this->rawheaders))
+		{
+			if(!is_array($this->rawheaders))
+				$this->rawheaders = (array)$this->rawheaders;
+			while(list($headerKey,$headerVal) = each($this->rawheaders))
+				$headers .= $headerKey.": ".$headerVal."\r\n";
+		}
+		if(!empty($content_type)) {
+			$headers .= "Content-type: $content_type";
+			if ($content_type == "multipart/form-data")
+				$headers .= "; boundary=".$this->_mime_boundary;
+			$headers .= "\r\n";
+		}
+		if(!empty($body))	
+			$headers .= "Content-length: ".strlen($body)."\r\n";
+		if(!empty($this->user) || !empty($this->pass))	
+			$headers .= "Authorization: Basic ".base64_encode($this->user.":".$this->pass)."\r\n";
+		
+		//add proxy auth headers
+		if(!empty($this->proxy_user))	
+			$headers .= 'Proxy-Authorization: ' . 'Basic ' . base64_encode($this->proxy_user . ':' . $this->proxy_pass)."\r\n";
+
+
+		$headers .= "\r\n";
+		
+		// set the read timeout if needed
+		if ($this->read_timeout > 0)
+			socket_set_timeout($fp, $this->read_timeout);
+		$this->timed_out = false;
+		
+		fwrite($fp,$headers.$body,strlen($headers.$body));
+		
+		$this->_redirectaddr = false;
+		unset($this->headers);
+						
+		while($currentHeader = fgets($fp,$this->_maxlinelen))
+		{
+			if ($this->read_timeout > 0 && $this->_check_timeout($fp))
+			{
+				$this->status=-100;
+				return false;
+			}
+				
+			if($currentHeader == "\r\n")
+				break;
+						
+			// if a header begins with Location: or URI:, set the redirect
+			if(preg_match("/^(Location:|URI:)/i",$currentHeader))
+			{
+				// get URL portion of the redirect
+				preg_match("/^(Location:|URI:)[ ]+(.*)/i",chop($currentHeader),$matches);
+				// look for :// in the Location header to see if hostname is included
+				if(!preg_match("|\:\/\/|",$matches[2]))
+				{
+					// no host in the path, so prepend
+					$this->_redirectaddr = $URI_PARTS["scheme"]."://".$this->host;
+        			if(!empty($this->host_port))
+        			    $this->_redirectaddr .= ":".$this->host_port;
+					// eliminate double slash
+					if(!preg_match("|^/|",$matches[2]))
+							$this->_redirectaddr .= "/".$matches[2];
+					else
+							$this->_redirectaddr .= $matches[2];
+				}
+				else
+					$this->_redirectaddr = $matches[2];
+			}
+		
+			if(preg_match("|^HTTP/|",$currentHeader))
+			{
+                if(preg_match("|^HTTP/[^\s]*\s(.*?)\s|",$currentHeader, $status))
+				{
+					$this->status= $status[1];
+                }				
+				$this->response_code = $currentHeader;
+			}
+				
+			$this->headers[] = $currentHeader;
+		}
+
+		$results = '';
+		do {
+    		$_data = fread($fp, $this->maxlength);
+    		if (strlen($_data) == 0) {
+        		break;
+    		}
+    		$results .= $_data;
+		} while(true);
+
+		if ($this->read_timeout > 0 && $this->_check_timeout($fp))
+		{
+			$this->status=-100;
+			return false;
+		}
+		
+		// check if there is a a redirect meta tag
+		
+		if(preg_match("'<meta[\s]*http-equiv[^>]*?content[\s]*=[\s]*[\"\']?\d+;[\s]*URL[\s]*=[\s]*([^\"\']*?)[\"\']?>'i",$results,$match))
+
+		{
+			$this->_redirectaddr = $this->_expandlinks($match[1],$URI);	
+		}
+
+		// have we hit our frame depth and is there frame src to fetch?
+		if(($this->_framedepth < $this->maxframes) && preg_match_all("'<frame\s+.*src[\s]*=[\'\"]?([^\'\"\>]+)'i",$results,$match))
+		{
+			$this->results[] = $results;
+			for($x=0; $x<count($match[1]); $x++)
+				$this->_frameurls[] = $this->_expandlinks($match[1][$x],$URI_PARTS["scheme"]."://".$this->host);
+		}
+		// have we already fetched framed content?
+		elseif(is_array($this->results))
+			$this->results[] = $results;
+		// no framed content
+		else
+			$this->results = $results;
+		
+		return true;
+	}
+
+/*======================================================================*\
+	Function:	_httpsrequest
+	Purpose:	go get the https data from the server using curl
+	Input:		$url		the url to fetch
+				$URI		the full URI
+				$body		body contents to send if any (POST)
+	Output:		
+\*======================================================================*/
+	
+	function _httpsrequest($url,$URI,$http_method,$content_type="",$body="")
+	{
+		if($this->passcookies && $this->_redirectaddr)
+			$this->setcookies();
+
+		$headers = array();		
+					
+		$URI_PARTS = parse_url($URI);
+		if(empty($url))
+			$url = "/";
+		// GET ... header not needed for curl
+		//$headers[] = $http_method." ".$url." ".$this->_httpversion;		
+		if(!empty($this->agent))
+			$headers[] = "User-Agent: ".$this->agent;
+		if(!empty($this->host))
+			if(!empty($this->host_port))
+				$headers[] = "Host: ".$this->host.":".$this->host_port;
+			else
+				$headers[] = "Host: ".$this->host;
+		if(!empty($this->accept))
+			$headers[] = "Accept: ".$this->accept;
+		if(!empty($this->referer))
+			$headers[] = "Referer: ".$this->referer;
+		if(!empty($this->cookies))
+		{			
+			if(!is_array($this->cookies))
+				$this->cookies = (array)$this->cookies;
+	
+			reset($this->cookies);
+			if ( count($this->cookies) > 0 ) {
+				$cookie_str = 'Cookie: ';
+				foreach ( $this->cookies as $cookieKey => $cookieVal ) {
+				$cookie_str .= $cookieKey."=".urlencode($cookieVal)."; ";
+				}
+				$headers[] = substr($cookie_str,0,-2);
+			}
+		}
+		if(!empty($this->rawheaders))
+		{
+			if(!is_array($this->rawheaders))
+				$this->rawheaders = (array)$this->rawheaders;
+			while(list($headerKey,$headerVal) = each($this->rawheaders))
+				$headers[] = $headerKey.": ".$headerVal;
+		}
+		if(!empty($content_type)) {
+			if ($content_type == "multipart/form-data")
+				$headers[] = "Content-type: $content_type; boundary=".$this->_mime_boundary;
+			else
+				$headers[] = "Content-type: $content_type";
+		}
+		if(!empty($body))	
+			$headers[] = "Content-length: ".strlen($body);
+		if(!empty($this->user) || !empty($this->pass))	
+			$headers[] = "Authorization: BASIC ".base64_encode($this->user.":".$this->pass);
+			
+		for($curr_header = 0; $curr_header < count($headers); $curr_header++) {
+			$safer_header = strtr( $headers[$curr_header], "\"", " " );
+			$cmdline_params .= " -H \"".$safer_header."\"";
+		}
+		
+		if(!empty($body))
+			$cmdline_params .= " -d \"$body\"";
+		
+		if($this->read_timeout > 0)
+			$cmdline_params .= " -m ".$this->read_timeout;
+		
+		$headerfile = tempnam($temp_dir, "sno");
+
+		$safer_URI = strtr( $URI, "\"", " " ); // strip quotes from the URI to avoid shell access
+		exec($this->curl_path." -D \"$headerfile\"".$cmdline_params." \"".$safer_URI."\"",$results,$return);
+		
+		if($return)
+		{
+			$this->error = "Error: cURL could not retrieve the document, error $return.";
+			return false;
+		}
+			
+			
+		$results = implode("\r\n",$results);
+		
+		$result_headers = file("$headerfile");
+						
+		$this->_redirectaddr = false;
+		unset($this->headers);
+						
+		for($currentHeader = 0; $currentHeader < count($result_headers); $currentHeader++)
+		{
+			
+			// if a header begins with Location: or URI:, set the redirect
+			if(preg_match("/^(Location: |URI: )/i",$result_headers[$currentHeader]))
+			{
+				// get URL portion of the redirect
+				preg_match("/^(Location: |URI:)\s+(.*)/",chop($result_headers[$currentHeader]),$matches);
+				// look for :// in the Location header to see if hostname is included
+				if(!preg_match("|\:\/\/|",$matches[2]))
+				{
+					// no host in the path, so prepend
+					$this->_redirectaddr = $URI_PARTS["scheme"]."://".$this->host;
+        			if(!empty($this->host_port))
+        			    $this->_redirectaddr .= ":".$this->host_port;
+					// eliminate double slash
+					if(!preg_match("|^/|",$matches[2]))
+							$this->_redirectaddr .= "/".$matches[2];
+					else
+							$this->_redirectaddr .= $matches[2];
+				}
+				else
+					$this->_redirectaddr = $matches[2];
+			}
+		
+			if(preg_match("|^HTTP/|",$result_headers[$currentHeader]))
+				$this->response_code = $result_headers[$currentHeader];
+
+			$this->headers[] = $result_headers[$currentHeader];
+		}
+
+		// check if there is a a redirect meta tag
+		
+		if(preg_match("'<meta[\s]*http-equiv[^>]*?content[\s]*=[\s]*[\"\']?\d+;[\s]*URL[\s]*=[\s]*([^\"\']*?)[\"\']?>'i",$results,$match))
+		{
+			$this->_redirectaddr = $this->_expandlinks($match[1],$URI);	
+		}
+
+		// have we hit our frame depth and is there frame src to fetch?
+		if(($this->_framedepth < $this->maxframes) && preg_match_all("'<frame\s+.*src[\s]*=[\'\"]?([^\'\"\>]+)'i",$results,$match))
+		{
+			$this->results[] = $results;
+			for($x=0; $x<count($match[1]); $x++)
+				$this->_frameurls[] = $this->_expandlinks($match[1][$x],$URI_PARTS["scheme"]."://".$this->host);
+		}
+		// have we already fetched framed content?
+		elseif(is_array($this->results))
+			$this->results[] = $results;
+		// no framed content
+		else
+			$this->results = $results;
+
+		unlink("$headerfile");
+		
+		return true;
+	}
+
+/*======================================================================*\
+	Function:	setcookies()
+	Purpose:	set cookies for a redirection
+\*======================================================================*/
+	
+	function setcookies()
+	{
+		for($x=0; $x<count($this->headers); $x++)
+		{
+		if(preg_match('/^set-cookie:[\s]+([^=]+)=([^;]+)/i', $this->headers[$x],$match))
+			$this->cookies[$match[1]] = urldecode($match[2]);
+		}
+	}
+
+	
+/*======================================================================*\
+	Function:	_check_timeout
+	Purpose:	checks whether timeout has occurred
+	Input:		$fp	file pointer
+\*======================================================================*/
+
+	function _check_timeout($fp)
+	{
+		if ($this->read_timeout > 0) {
+			$fp_status = socket_get_status($fp);
+			if ($fp_status["timed_out"]) {
+				$this->timed_out = true;
+				return true;
+			}
+		}
+		return false;
+	}
+
+/*======================================================================*\
+	Function:	_connect
+	Purpose:	make a socket connection
+	Input:		$fp	file pointer
+\*======================================================================*/
+	
+	function _connect(&$fp)
+	{
+		if(!empty($this->proxy_host) && !empty($this->proxy_port))
+			{
+				$this->_isproxy = true;
+				
+				$host = $this->proxy_host;
+				$port = $this->proxy_port;
+			}
+		else
+		{
+			$host = $this->host;
+			$port = $this->port;
+		}
+	
+		$this->status = 0;
+		
+		if($fp = fsockopen(
+					$host,
+					$port,
+					$errno,
+					$errstr,
+					$this->_fp_timeout
+					))
+		{
+			// socket connection succeeded
+
+			return true;
+		}
+		else
+		{
+			// socket connection failed
+			$this->status = $errno;
+			switch($errno)
+			{
+				case -3:
+					$this->error="socket creation failed (-3)";
+				case -4:
+					$this->error="dns lookup failure (-4)";
+				case -5:
+					$this->error="connection refused or timed out (-5)";
+				default:
+					$this->error="connection failed (".$errno.")";
+			}
+			return false;
+		}
+	}
+/*======================================================================*\
+	Function:	_disconnect
+	Purpose:	disconnect a socket connection
+	Input:		$fp	file pointer
+\*======================================================================*/
+	
+	function _disconnect($fp)
+	{
+		return(fclose($fp));
+	}
+
+	
+/*======================================================================*\
+	Function:	_prepare_post_body
+	Purpose:	Prepare post body according to encoding type
+	Input:		$formvars  - form variables
+				$formfiles - form upload files
+	Output:		post body
+\*======================================================================*/
+	
+	function _prepare_post_body($formvars, $formfiles)
+	{
+		settype($formvars, "array");
+		settype($formfiles, "array");
+		$postdata = '';
+
+		if (count($formvars) == 0 && count($formfiles) == 0)
+			return;
+		
+		switch ($this->_submit_type) {
+			case "application/x-www-form-urlencoded":
+				reset($formvars);
+				while(list($key,$val) = each($formvars)) {
+					if (is_array($val) || is_object($val)) {
+						while (list($cur_key, $cur_val) = each($val)) {
+							$postdata .= urlencode($key)."[]=".urlencode($cur_val)."&";
+						}
+					} else
+						$postdata .= urlencode($key)."=".urlencode($val)."&";
+				}
+				break;
+
+			case "multipart/form-data":
+				$this->_mime_boundary = "Snoopy".md5(uniqid(microtime()));
+				
+				reset($formvars);
+				while(list($key,$val) = each($formvars)) {
+					if (is_array($val) || is_object($val)) {
+						while (list($cur_key, $cur_val) = each($val)) {
+							$postdata .= "--".$this->_mime_boundary."\r\n";
+							$postdata .= "Content-Disposition: form-data; name=\"$key\[\]\"\r\n\r\n";
+							$postdata .= "$cur_val\r\n";
+						}
+					} else {
+						$postdata .= "--".$this->_mime_boundary."\r\n";
+						$postdata .= "Content-Disposition: form-data; name=\"$key\"\r\n\r\n";
+						$postdata .= "$val\r\n";
+					}
+				}
+				
+				reset($formfiles);
+				while (list($field_name, $file_names) = each($formfiles)) {
+					settype($file_names, "array");
+					while (list(, $file_name) = each($file_names)) {
+						if (!is_readable($file_name)) continue;
+
+						$fp = fopen($file_name, "r");
+						$file_content = fread($fp, filesize($file_name));
+						fclose($fp);
+						$base_name = basename($file_name);
+
+						$postdata .= "--".$this->_mime_boundary."\r\n";
+						$postdata .= "Content-Disposition: form-data; name=\"$field_name\"; filename=\"$base_name\"\r\n\r\n";
+						$postdata .= "$file_content\r\n";
+					}
+				}
+				$postdata .= "--".$this->_mime_boundary."--\r\n";
+				break;
+			// XOOPS2 Hack begin
+			// Added on March 4, 2003 by onokazu@xoops.org
+			case "text/xml":
+			default:
+				$postdata = $formvars[0];
+				break;
+			// XOOPS2 Hack end
+		}
+
+		return $postdata;
+	}
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/Config_File.class.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/Config_File.class.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/Config_File.class.php	(revision 405)
@@ -0,0 +1,389 @@
+<?php
+
+/**
+ * Config_File class.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * @link http://smarty.php.net/
+ * @version 2.6.12
+ * @copyright Copyright: 2001-2005 New Digital Group, Inc.
+ * @author Andrei Zmievski <andrei@php.net>
+ * @access public
+ * @package Smarty
+ */
+
+/* $Id: Config_File.class.php,v 1.3 2006/05/01 02:37:25 onokazu Exp $ */
+
+/**
+ * Config file reading class
+ * @package Smarty
+ */
+class Config_File {
+    /**#@+
+     * Options
+     * @var boolean
+     */
+    /**
+     * Controls whether variables with the same name overwrite each other.
+     */
+    var $overwrite        =    true;
+
+    /**
+     * Controls whether config values of on/true/yes and off/false/no get
+     * converted to boolean values automatically.
+     */
+    var $booleanize        =    true;
+
+    /**
+     * Controls whether hidden config sections/vars are read from the file.
+     */
+    var $read_hidden     =    true;
+
+    /**
+     * Controls whether or not to fix mac or dos formatted newlines.
+     * If set to true, \r or \r\n will be changed to \n.
+     */
+    var $fix_newlines =    true;
+    /**#@-*/
+
+    /** @access private */
+    var $_config_path    = "";
+    var $_config_data    = array();
+    /**#@-*/
+
+    /**
+     * Constructs a new config file class.
+     *
+     * @param string $config_path (optional) path to the config files
+     */
+    function Config_File($config_path = NULL)
+    {
+        if (isset($config_path))
+            $this->set_path($config_path);
+    }
+
+
+    /**
+     * Set the path where configuration files can be found.
+     *
+     * @param string $config_path path to the config files
+     */
+    function set_path($config_path)
+    {
+        if (!empty($config_path)) {
+            if (!is_string($config_path) || !file_exists($config_path) || !is_dir($config_path)) {
+                $this->_trigger_error_msg("Bad config file path '$config_path'");
+                return;
+            }
+            if(substr($config_path, -1) != DIRECTORY_SEPARATOR) {
+                $config_path .= DIRECTORY_SEPARATOR;
+            }
+
+            $this->_config_path = $config_path;
+        }
+    }
+
+
+    /**
+     * Retrieves config info based on the file, section, and variable name.
+     *
+     * @param string $file_name config file to get info for
+     * @param string $section_name (optional) section to get info for
+     * @param string $var_name (optional) variable to get info for
+     * @return string|array a value or array of values
+     */
+    function get($file_name, $section_name = NULL, $var_name = NULL)
+    {
+        if (empty($file_name)) {
+            $this->_trigger_error_msg('Empty config file name');
+            return;
+        } else {
+            $file_name = $this->_config_path . $file_name;
+            if (!isset($this->_config_data[$file_name]))
+                $this->load_file($file_name, false);
+        }
+
+        if (!empty($var_name)) {
+            if (empty($section_name)) {
+                return $this->_config_data[$file_name]["vars"][$var_name];
+            } else {
+                if(isset($this->_config_data[$file_name]["sections"][$section_name]["vars"][$var_name]))
+                    return $this->_config_data[$file_name]["sections"][$section_name]["vars"][$var_name];
+                else
+                    return array();
+            }
+        } else {
+            if (empty($section_name)) {
+                return (array)$this->_config_data[$file_name]["vars"];
+            } else {
+                if(isset($this->_config_data[$file_name]["sections"][$section_name]["vars"]))
+                    return (array)$this->_config_data[$file_name]["sections"][$section_name]["vars"];
+                else
+                    return array();
+            }
+        }
+    }
+
+
+    /**
+     * Retrieves config info based on the key.
+     *
+     * @param $file_name string config key (filename/section/var)
+     * @return string|array same as get()
+     * @uses get() retrieves information from config file and returns it
+     */
+    function &get_key($config_key)
+    {
+        list($file_name, $section_name, $var_name) = explode('/', $config_key, 3);
+        $result = &$this->get($file_name, $section_name, $var_name);
+        return $result;
+    }
+
+    /**
+     * Get all loaded config file names.
+     *
+     * @return array an array of loaded config file names
+     */
+    function get_file_names()
+    {
+        return array_keys($this->_config_data);
+    }
+
+
+    /**
+     * Get all section names from a loaded file.
+     *
+     * @param string $file_name config file to get section names from
+     * @return array an array of section names from the specified file
+     */
+    function get_section_names($file_name)
+    {
+        $file_name = $this->_config_path . $file_name;
+        if (!isset($this->_config_data[$file_name])) {
+            $this->_trigger_error_msg("Unknown config file '$file_name'");
+            return;
+        }
+
+        return array_keys($this->_config_data[$file_name]["sections"]);
+    }
+
+
+    /**
+     * Get all global or section variable names.
+     *
+     * @param string $file_name config file to get info for
+     * @param string $section_name (optional) section to get info for
+     * @return array an array of variables names from the specified file/section
+     */
+    function get_var_names($file_name, $section = NULL)
+    {
+        if (empty($file_name)) {
+            $this->_trigger_error_msg('Empty config file name');
+            return;
+        } else if (!isset($this->_config_data[$file_name])) {
+            $this->_trigger_error_msg("Unknown config file '$file_name'");
+            return;
+        }
+
+        if (empty($section))
+            return array_keys($this->_config_data[$file_name]["vars"]);
+        else
+            return array_keys($this->_config_data[$file_name]["sections"][$section]["vars"]);
+    }
+
+
+    /**
+     * Clear loaded config data for a certain file or all files.
+     *
+     * @param string $file_name file to clear config data for
+     */
+    function clear($file_name = NULL)
+    {
+        if ($file_name === NULL)
+            $this->_config_data = array();
+        else if (isset($this->_config_data[$file_name]))
+            $this->_config_data[$file_name] = array();
+    }
+
+
+    /**
+     * Load a configuration file manually.
+     *
+     * @param string $file_name file name to load
+     * @param boolean $prepend_path whether current config path should be
+     *                              prepended to the filename
+     */
+    function load_file($file_name, $prepend_path = true)
+    {
+        if ($prepend_path && $this->_config_path != "")
+            $config_file = $this->_config_path . $file_name;
+        else
+            $config_file = $file_name;
+
+        ini_set('track_errors', true);
+        $fp = @fopen($config_file, "r");
+        if (!is_resource($fp)) {
+            $this->_trigger_error_msg("Could not open config file '$config_file'");
+            return false;
+        }
+
+        $contents = ($size = filesize($config_file)) ? fread($fp, $size) : '';
+        fclose($fp);
+
+        $this->_config_data[$config_file] = $this->parse_contents($contents);
+        return true;
+    }
+
+    /**
+     * Store the contents of a file manually.
+     *
+     * @param string $config_file file name of the related contents
+     * @param string $contents the file-contents to parse
+     */
+    function set_file_contents($config_file, $contents)
+    {
+        $this->_config_data[$config_file] = $this->parse_contents($contents);
+        return true;
+    }
+
+    /**
+     * parse the source of a configuration file manually.
+     *
+     * @param string $contents the file-contents to parse
+     */
+    function parse_contents($contents)
+    {
+        if($this->fix_newlines) {
+            // fix mac/dos formatted newlines
+            $contents = preg_replace('!\r\n?!', "\n", $contents);
+        }
+
+        $config_data = array();
+        $config_data['sections'] = array();
+        $config_data['vars'] = array();
+
+        /* reference to fill with data */
+        $vars =& $config_data['vars'];
+
+        /* parse file line by line */
+        preg_match_all('!^.*\r?\n?!m', $contents, $match);
+        $lines = $match[0];
+        for ($i=0, $count=count($lines); $i<$count; $i++) {
+            $line = $lines[$i];
+            if (empty($line)) continue;
+
+            if ( substr($line, 0, 1) == '[' && preg_match('!^\[(.*?)\]!', $line, $match) ) {
+                /* section found */
+                if (substr($match[1], 0, 1) == '.') {
+                    /* hidden section */
+                    if ($this->read_hidden) {
+                        $section_name = substr($match[1], 1);
+                    } else {
+                        /* break reference to $vars to ignore hidden section */
+                        unset($vars);
+                        $vars = array();
+                        continue;
+                    }
+                } else {                    
+                    $section_name = $match[1];
+                }
+                if (!isset($config_data['sections'][$section_name]))
+                    $config_data['sections'][$section_name] = array('vars' => array());
+                $vars =& $config_data['sections'][$section_name]['vars'];
+                continue;
+            }
+
+            if (preg_match('/^\s*(\.?\w+)\s*=\s*(.*)/s', $line, $match)) {
+                /* variable found */
+                $var_name = rtrim($match[1]);
+                if (strpos($match[2], '"""') === 0) {
+                    /* handle multiline-value */
+                    $lines[$i] = substr($match[2], 3);
+                    $var_value = '';
+                    while ($i<$count) {
+                        if (($pos = strpos($lines[$i], '"""')) === false) {
+                            $var_value .= $lines[$i++];
+                        } else {
+                            /* end of multiline-value */
+                            $var_value .= substr($lines[$i], 0, $pos);
+                            break;
+                        }
+                    }
+                    $booleanize = false;
+
+                } else {
+                    /* handle simple value */
+                    $var_value = preg_replace('/^([\'"])(.*)\1$/', '\2', rtrim($match[2]));
+                    $booleanize = $this->booleanize;
+
+                }
+                $this->_set_config_var($vars, $var_name, $var_value, $booleanize);
+            }
+            /* else unparsable line / means it is a comment / means ignore it */
+        }
+        return $config_data;
+    }
+
+    /**#@+ @access private */
+    /**
+     * @param array &$container
+     * @param string $var_name
+     * @param mixed $var_value
+     * @param boolean $booleanize determines whether $var_value is converted to
+     *                            to true/false
+     */
+    function _set_config_var(&$container, $var_name, $var_value, $booleanize)
+    {
+        if (substr($var_name, 0, 1) == '.') {
+            if (!$this->read_hidden)
+                return;
+            else
+                $var_name = substr($var_name, 1);
+        }
+
+        if (!preg_match("/^[a-zA-Z_]\w*$/", $var_name)) {
+            $this->_trigger_error_msg("Bad variable name '$var_name'");
+            return;
+        }
+
+        if ($booleanize) {
+            if (preg_match("/^(on|true|yes)$/i", $var_value))
+                $var_value = true;
+            else if (preg_match("/^(off|false|no)$/i", $var_value))
+                $var_value = false;
+        }
+
+        if (!isset($container[$var_name]) || $this->overwrite)
+            $container[$var_name] = $var_value;
+        else {
+            settype($container[$var_name], 'array');
+            $container[$var_name][] = $var_value;
+        }
+    }
+
+    /**
+     * @uses trigger_error() creates a PHP warning/error
+     * @param string $error_msg
+     * @param integer $error_type one of
+     */
+    function _trigger_error_msg($error_msg, $error_type = E_USER_WARNING)
+    {
+        trigger_error("Config_File error: $error_msg", $error_type);
+    }
+    /**#@-*/
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/resource.db.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/resource.db.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/resource.db.php	(revision 405)
@@ -0,0 +1,123 @@
+<?php
+/*
+ * Smarty plugin
+ * ------------------------------------------------------------- 
+ * File:     resource.db.php
+ * Type:     resource
+ * Name:     db
+ * Purpose:  Fetches templates from a database
+ * -------------------------------------------------------------
+ */
+function smarty_resource_db_source($tpl_name, &$tpl_source, &$smarty)
+{
+    $tplfile_handler =& xoops_gethandler('tplfile');
+	$tplobj =& $tplfile_handler->find($GLOBALS['xoopsConfig']['template_set'], null, null, null, $tpl_name, true);
+	if (count($tplobj) > 0) {
+		if (false != $smarty->xoops_canUpdateFromFile()) {
+			$conf_theme = isset($GLOBALS['xoopsConfig']['theme_set']) ? $GLOBALS['xoopsConfig']['theme_set'] : 'default';
+			if ($conf_theme != 'default') {
+				switch ($tplobj[0]->getVar('tpl_type')) {
+					case 'module':
+						$filepath = XOOPS_THEME_PATH.'/'.$conf_theme.'/templates/'.$tplobj[0]->getVar('tpl_module').'/'.$tpl_name;
+						break;
+					case 'block':
+						$filepath = XOOPS_THEME_PATH.'/'.$conf_theme.'/templates/'.$tplobj[0]->getVar('tpl_module').'/blocks/'.$tpl_name;
+						break;
+					default:
+						$filepath = "";
+						break;
+				}
+			} else {
+				switch ($tplobj[0]->getVar('tpl_type')) {
+					case 'module':
+						$filepath = XOOPS_ROOT_PATH.'/modules/'.$tplobj[0]->getVar('tpl_module').'/templates/'.$tpl_name;
+						break;
+					case 'block':
+						$filepath = XOOPS_ROOT_PATH.'/modules/'.$tplobj[0]->getVar('tpl_module').'/templates/blocks/'.$tpl_name;
+						break;
+					default:
+						$filepath = "";
+						break;
+				}
+			}
+			if ($filepath != "" && file_exists($filepath)) {
+				$file_modified = filemtime($filepath);
+				if ($file_modified > $tplobj[0]->getVar('tpl_lastmodified')) {
+					if (false != $fp = fopen($filepath, 'r')) {
+						$filesource = fread($fp, filesize($filepath));
+    					fclose($fp);
+						$tplobj[0]->setVar('tpl_source', $filesource, true);
+						$tplobj[0]->setVar('tpl_lastmodified', time());
+						$tplobj[0]->setVar('tpl_lastimported', time());
+    					$tplfile_handler->forceUpdate($tplobj[0]);
+						$tpl_source = $filesource;
+        				return true;
+					}
+				}
+			}
+		}
+        $tpl_source = $tplobj[0]->getVar('tpl_source');
+        return true;
+    } else {
+		return false;
+	}
+}
+
+function smarty_resource_db_timestamp($tpl_name, &$tpl_timestamp, &$smarty)
+{
+    $tplfile_handler =& xoops_gethandler('tplfile');
+    $tplobj =& $tplfile_handler->find($GLOBALS['xoopsConfig']['template_set'], null, null, null, $tpl_name, false);
+	if (count($tplobj) > 0) {
+		if (false != $smarty->xoops_canUpdateFromFile()) {
+			$conf_theme = isset($GLOBALS['xoopsConfig']['theme_set']) ? $GLOBALS['xoopsConfig']['theme_set'] : 'default';
+			if ($conf_theme != 'default') {
+				switch ($tplobj[0]->getVar('tpl_type')) {
+					case 'module':
+						$filepath = XOOPS_THEME_PATH.'/'.$conf_theme.'/templates/'.$tplobj[0]->getVar('tpl_module').'/'.$tpl_name;
+						break;
+					case 'block':
+						$filepath = XOOPS_THEME_PATH.'/'.$conf_theme.'/templates/'.$tplobj[0]->getVar('tpl_module').'/blocks/'.$tpl_name;
+						break;
+					default:
+						$filepath = "";
+						break;
+				}
+			} else {
+				switch ($tplobj[0]->getVar('tpl_type')) {
+					case 'module':
+						$filepath = XOOPS_ROOT_PATH.'/modules/'.$tplobj[0]->getVar('tpl_module').'/templates/'.$tpl_name;
+						break;
+					case 'block':
+						$filepath = XOOPS_ROOT_PATH.'/modules/'.$tplobj[0]->getVar('tpl_module').'/templates/blocks/'.$tpl_name;
+						break;
+					default:
+						$filepath = "";
+						break;
+				}
+			}
+			if ($filepath != "" && file_exists($filepath)) {
+				$file_modified = filemtime($filepath);
+				if ($file_modified > $tplobj[0]->getVar('tpl_lastmodified')) {
+					$tpl_timestamp = $file_modified;
+					return true;
+				}
+			}
+		}
+        $tpl_timestamp = $tplobj[0]->getVar('tpl_lastmodified');
+        return true;
+    } else {
+		return false;
+	}
+}
+
+function smarty_resource_db_secure($tpl_name, &$smarty)
+{
+    // assume all templates are secure
+    return true;
+}
+
+function smarty_resource_db_trusted($tpl_name, &$smarty)
+{
+    // not used for templates
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.fetch.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.fetch.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.fetch.php	(revision 405)
@@ -0,0 +1,221 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty {fetch} plugin
+ *
+ * Type:     function<br>
+ * Name:     fetch<br>
+ * Purpose:  fetch file, web or ftp data and display results
+ * @link http://smarty.php.net/manual/en/language.function.fetch.php {fetch}
+ *       (Smarty online manual)
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @param array
+ * @param Smarty
+ * @return string|null if the assign parameter is passed, Smarty assigns the
+ *                     result to a template variable
+ */
+function smarty_function_fetch($params, &$smarty)
+{
+    if (empty($params['file'])) {
+        $smarty->_trigger_fatal_error("[plugin] parameter 'file' cannot be empty");
+        return;
+    }
+
+    $content = '';
+    if ($smarty->security && !preg_match('!^(http|ftp)://!i', $params['file'])) {
+        $_params = array('resource_type' => 'file', 'resource_name' => $params['file']);
+        require_once(SMARTY_CORE_DIR . 'core.is_secure.php');
+        if(!smarty_core_is_secure($_params, $smarty)) {
+            $smarty->_trigger_fatal_error('[plugin] (secure mode) fetch \'' . $params['file'] . '\' is not allowed');
+            return;
+        }
+        
+        // fetch the file
+        if($fp = @fopen($params['file'],'r')) {
+            while(!feof($fp)) {
+                $content .= fgets ($fp,4096);
+            }
+            fclose($fp);
+        } else {
+            $smarty->_trigger_fatal_error('[plugin] fetch cannot read file \'' . $params['file'] . '\'');
+            return;
+        }
+    } else {
+        // not a local file
+        if(preg_match('!^http://!i',$params['file'])) {
+            // http fetch
+            if($uri_parts = parse_url($params['file'])) {
+                // set defaults
+                $host = $server_name = $uri_parts['host'];
+                $timeout = 30;
+                $accept = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*";
+                $agent = "Smarty Template Engine ".$smarty->_version;
+                $referer = "";
+                $uri = !empty($uri_parts['path']) ? $uri_parts['path'] : '/';
+                $uri .= !empty($uri_parts['query']) ? '?' . $uri_parts['query'] : '';
+                $_is_proxy = false;
+                if(empty($uri_parts['port'])) {
+                    $port = 80;
+                } else {
+                    $port = $uri_parts['port'];
+                }
+                if(!empty($uri_parts['user'])) {
+                    $user = $uri_parts['user'];
+                }
+                if(!empty($uri_parts['pass'])) {
+                    $pass = $uri_parts['pass'];
+                }
+                // loop through parameters, setup headers
+                foreach($params as $param_key => $param_value) {
+                    switch($param_key) {
+                        case "file":
+                        case "assign":
+                        case "assign_headers":
+                            break;
+                        case "user":
+                            if(!empty($param_value)) {
+                                $user = $param_value;
+                            }
+                            break;
+                        case "pass":
+                            if(!empty($param_value)) {
+                                $pass = $param_value;
+                            }
+                            break;
+                        case "accept":
+                            if(!empty($param_value)) {
+                                $accept = $param_value;
+                            }
+                            break;
+                        case "header":
+                            if(!empty($param_value)) {
+                                if(!preg_match('![\w\d-]+: .+!',$param_value)) {
+                                    $smarty->_trigger_fatal_error("[plugin] invalid header format '".$param_value."'");
+                                    return;
+                                } else {
+                                    $extra_headers[] = $param_value;
+                                }
+                            }
+                            break;
+                        case "proxy_host":
+                            if(!empty($param_value)) {
+                                $proxy_host = $param_value;
+                            }
+                            break;
+                        case "proxy_port":
+                            if(!preg_match('!\D!', $param_value)) {
+                                $proxy_port = (int) $param_value;
+                            } else {
+                                $smarty->_trigger_fatal_error("[plugin] invalid value for attribute '".$param_key."'");
+                                return;
+                            }
+                            break;
+                        case "agent":
+                            if(!empty($param_value)) {
+                                $agent = $param_value;
+                            }
+                            break;
+                        case "referer":
+                            if(!empty($param_value)) {
+                                $referer = $param_value;
+                            }
+                            break;
+                        case "timeout":
+                            if(!preg_match('!\D!', $param_value)) {
+                                $timeout = (int) $param_value;
+                            } else {
+                                $smarty->_trigger_fatal_error("[plugin] invalid value for attribute '".$param_key."'");
+                                return;
+                            }
+                            break;
+                        default:
+                            $smarty->_trigger_fatal_error("[plugin] unrecognized attribute '".$param_key."'");
+                            return;
+                    }
+                }
+                if(!empty($proxy_host) && !empty($proxy_port)) {
+                    $_is_proxy = true;
+                    $fp = fsockopen($proxy_host,$proxy_port,$errno,$errstr,$timeout);
+                } else {
+                    $fp = fsockopen($server_name,$port,$errno,$errstr,$timeout);
+                }
+
+                if(!$fp) {
+                    $smarty->_trigger_fatal_error("[plugin] unable to fetch: $errstr ($errno)");
+                    return;
+                } else {
+                    if($_is_proxy) {
+                        fputs($fp, 'GET ' . $params['file'] . " HTTP/1.0\r\n");
+                    } else {
+                        fputs($fp, "GET $uri HTTP/1.0\r\n");
+                    }
+                    if(!empty($host)) {
+                        fputs($fp, "Host: $host\r\n");
+                    }
+                    if(!empty($accept)) {
+                        fputs($fp, "Accept: $accept\r\n");
+                    }
+                    if(!empty($agent)) {
+                        fputs($fp, "User-Agent: $agent\r\n");
+                    }
+                    if(!empty($referer)) {
+                        fputs($fp, "Referer: $referer\r\n");
+                    }
+                    if(isset($extra_headers) && is_array($extra_headers)) {
+                        foreach($extra_headers as $curr_header) {
+                            fputs($fp, $curr_header."\r\n");
+                        }
+                    }
+                    if(!empty($user) && !empty($pass)) {
+                        fputs($fp, "Authorization: BASIC ".base64_encode("$user:$pass")."\r\n");
+                    }
+
+                    fputs($fp, "\r\n");
+                    while(!feof($fp)) {
+                        $content .= fgets($fp,4096);
+                    }
+                    fclose($fp);
+                    $csplit = split("\r\n\r\n",$content,2);
+
+                    $content = $csplit[1];
+
+                    if(!empty($params['assign_headers'])) {
+                        $smarty->assign($params['assign_headers'],split("\r\n",$csplit[0]));
+                    }
+                }
+            } else {
+                $smarty->_trigger_fatal_error("[plugin] unable to parse URL, check syntax");
+                return;
+            }
+        } else {
+            // ftp fetch
+            if($fp = @fopen($params['file'],'r')) {
+                while(!feof($fp)) {
+                    $content .= fgets ($fp,4096);
+                }
+                fclose($fp);
+            } else {
+                $smarty->_trigger_fatal_error('[plugin] fetch cannot read file \'' . $params['file'] .'\'');
+                return;
+            }
+        }
+
+    }
+
+
+    if (!empty($params['assign'])) {
+        $smarty->assign($params['assign'],$content);
+    } else {
+        return $content;
+    }
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.math.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.math.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.math.php	(revision 405)
@@ -0,0 +1,84 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty {math} function plugin
+ *
+ * Type:     function<br>
+ * Name:     math<br>
+ * Purpose:  handle math computations in template<br>
+ * @link http://smarty.php.net/manual/en/language.function.math.php {math}
+ *          (Smarty online manual)
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @param array
+ * @param Smarty
+ * @return string
+ */
+function smarty_function_math($params, &$smarty)
+{
+    // be sure equation parameter is present
+    if (empty($params['equation'])) {
+        $smarty->trigger_error("math: missing equation parameter");
+        return;
+    }
+
+    $equation = $params['equation'];
+
+    // make sure parenthesis are balanced
+    if (substr_count($equation,"(") != substr_count($equation,")")) {
+        $smarty->trigger_error("math: unbalanced parenthesis");
+        return;
+    }
+
+    // match all vars in equation, make sure all are passed
+    preg_match_all("!(?:0x[a-fA-F0-9]+)|([a-zA-Z][a-zA-Z0-9_]+)!",$equation, $match);
+    $allowed_funcs = array('int','abs','ceil','cos','exp','floor','log','log10',
+                           'max','min','pi','pow','rand','round','sin','sqrt','srand','tan');
+    
+    foreach($match[1] as $curr_var) {
+        if ($curr_var && !in_array($curr_var, array_keys($params)) && !in_array($curr_var, $allowed_funcs)) {
+            $smarty->trigger_error("math: function call $curr_var not allowed");
+            return;
+        }
+    }
+
+    foreach($params as $key => $val) {
+        if ($key != "equation" && $key != "format" && $key != "assign") {
+            // make sure value is not empty
+            if (strlen($val)==0) {
+                $smarty->trigger_error("math: parameter $key is empty");
+                return;
+            }
+            if (!is_numeric($val)) {
+                $smarty->trigger_error("math: parameter $key: is not numeric");
+                return;
+            }
+            $equation = preg_replace("/\b$key\b/", " \$params['$key'] ", $equation);
+        }
+    }
+
+    eval("\$smarty_math_result = ".$equation.";");
+
+    if (empty($params['format'])) {
+        if (empty($params['assign'])) {
+            return $smarty_math_result;
+        } else {
+            $smarty->assign($params['assign'],$smarty_math_result);
+        }
+    } else {
+        if (empty($params['assign'])){
+            printf($params['format'],$smarty_math_result);
+        } else {
+            $smarty->assign($params['assign'],sprintf($params['format'],$smarty_math_result));
+        }
+    }
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.indent.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.indent.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.indent.php	(revision 405)
@@ -0,0 +1,28 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty indent modifier plugin
+ *
+ * Type:     modifier<br>
+ * Name:     indent<br>
+ * Purpose:  indent lines of text
+ * @link http://smarty.php.net/manual/en/language.modifier.indent.php
+ *          indent (Smarty online manual)
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @param string
+ * @param integer
+ * @param string
+ * @return string
+ */
+function smarty_modifier_indent($string,$chars=4,$char=" ")
+{
+    return preg_replace('!^!m',str_repeat($char,$chars),$string);
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.truncate.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.truncate.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.truncate.php	(revision 405)
@@ -0,0 +1,50 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty truncate modifier plugin
+ *
+ * Type:     modifier<br>
+ * Name:     truncate<br>
+ * Purpose:  Truncate a string to a certain length if necessary,
+ *           optionally splitting in the middle of a word, and
+ *           appending the $etc string or inserting $etc into the middle.
+ * @link http://smarty.php.net/manual/en/language.modifier.truncate.php
+ *          truncate (Smarty online manual)
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @param string
+ * @param integer
+ * @param string
+ * @param boolean
+ * @param boolean
+ * @return string
+ */
+function smarty_modifier_truncate($string, $length = 80, $etc = '...',
+                                  $break_words = false, $middle = false)
+{
+    if ($length == 0)
+        return '';
+
+    if (strlen($string) > $length) {
+        $length -= strlen($etc);
+        if (!$break_words && !$middle) {
+            $string = preg_replace('/\s+?(\S+)?$/', '', substr($string, 0, $length+1));
+        }
+        if(!$middle) {
+            return substr($string, 0, $length).$etc;
+        } else {
+            return substr($string, 0, $length/2) . $etc . substr($string, -$length/2);
+        }
+    } else {
+        return $string;
+    }
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.html_select_date.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.html_select_date.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.html_select_date.php	(revision 405)
@@ -0,0 +1,323 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Smarty {html_select_date} plugin
+ *
+ * Type:     function<br>
+ * Name:     html_select_date<br>
+ * Purpose:  Prints the dropdowns for date selection.
+ *
+ * ChangeLog:<br>
+ *           - 1.0 initial release
+ *           - 1.1 added support for +/- N syntax for begin
+ *                and end year values. (Monte)
+ *           - 1.2 added support for yyyy-mm-dd syntax for
+ *                time value. (Jan Rosier)
+ *           - 1.3 added support for choosing format for
+ *                month values (Gary Loescher)
+ *           - 1.3.1 added support for choosing format for
+ *                day values (Marcus Bointon)
+ *           - 1.3.2 suppport negative timestamps, force year
+ *             dropdown to include given date unless explicitly set (Monte)
+ * @link http://smarty.php.net/manual/en/language.function.html.select.date.php {html_select_date}
+ *      (Smarty online manual)
+ * @version 1.3.2
+ * @author Andrei Zmievski
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @param array
+ * @param Smarty
+ * @return string
+ */
+function smarty_function_html_select_date($params, &$smarty)
+{
+    require_once $smarty->_get_plugin_filepath('shared','escape_special_chars');
+    require_once $smarty->_get_plugin_filepath('shared','make_timestamp');
+    require_once $smarty->_get_plugin_filepath('function','html_options');
+    /* Default values. */
+    $prefix          = "Date_";
+    $start_year      = strftime("%Y");
+    $end_year        = $start_year;
+    $display_days    = true;
+    $display_months  = true;
+    $display_years   = true;
+    $month_format    = "%B";
+    /* Write months as numbers by default  GL */
+    $month_value_format = "%m";
+    $day_format      = "%02d";
+    /* Write day values using this format MB */
+    $day_value_format = "%d";
+    $year_as_text    = false;
+    /* Display years in reverse order? Ie. 2000,1999,.... */
+    $reverse_years   = false;
+    /* Should the select boxes be part of an array when returned from PHP?
+       e.g. setting it to "birthday", would create "birthday[Day]",
+       "birthday[Month]" & "birthday[Year]". Can be combined with prefix */
+    $field_array     = null;
+    /* <select size>'s of the different <select> tags.
+       If not set, uses default dropdown. */
+    $day_size        = null;
+    $month_size      = null;
+    $year_size       = null;
+    /* Unparsed attributes common to *ALL* the <select>/<input> tags.
+       An example might be in the template: all_extra ='class ="foo"'. */
+    $all_extra       = null;
+    /* Separate attributes for the tags. */
+    $day_extra       = null;
+    $month_extra     = null;
+    $year_extra      = null;
+    /* Order in which to display the fields.
+       "D" -> day, "M" -> month, "Y" -> year. */
+    $field_order     = 'MDY';
+    /* String printed between the different fields. */
+    $field_separator = "\n";
+    $time = time();
+    $all_empty       = null;
+    $day_empty       = null;
+    $month_empty     = null;
+    $year_empty      = null;
+    $extra_attrs     = '';
+
+    foreach ($params as $_key=>$_value) {
+        switch ($_key) {
+            case 'prefix':
+            case 'time':
+            case 'start_year':
+            case 'end_year':
+            case 'month_format':
+            case 'day_format':
+            case 'day_value_format':
+            case 'field_array':
+            case 'day_size':
+            case 'month_size':
+            case 'year_size':
+            case 'all_extra':
+            case 'day_extra':
+            case 'month_extra':
+            case 'year_extra':
+            case 'field_order':
+            case 'field_separator':
+            case 'month_value_format':
+            case 'month_empty':
+            case 'day_empty':
+            case 'year_empty':
+                $$_key = (string)$_value;
+                break;
+
+            case 'all_empty':
+                $$_key = (string)$_value;
+                $day_empty = $month_empty = $year_empty = $all_empty;
+                break;
+
+            case 'display_days':
+            case 'display_months':
+            case 'display_years':
+            case 'year_as_text':
+            case 'reverse_years':
+                $$_key = (bool)$_value;
+                break;
+
+            default:
+                if(!is_array($_value)) {
+                    $extra_attrs .= ' '.$_key.'="'.smarty_function_escape_special_chars($_value).'"';
+                } else {
+                    $smarty->trigger_error("html_select_date: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
+                }
+                break;
+        }
+    }
+
+    if(preg_match('!^-\d+$!',$time)) {
+        // negative timestamp, use date()
+        $time = date('Y-m-d',$time);
+    }
+    // If $time is not in format yyyy-mm-dd
+    if (!preg_match('/^\d{0,4}-\d{0,2}-\d{0,2}$/', $time)) {
+        // use smarty_make_timestamp to get an unix timestamp and
+        // strftime to make yyyy-mm-dd
+        $time = strftime('%Y-%m-%d', smarty_make_timestamp($time));
+    }
+    // Now split this in pieces, which later can be used to set the select
+    $time = explode("-", $time);
+    
+    // make syntax "+N" or "-N" work with start_year and end_year
+    if (preg_match('!^(\+|\-)\s*(\d+)$!', $end_year, $match)) {
+        if ($match[1] == '+') {
+            $end_year = strftime('%Y') + $match[2];
+        } else {
+            $end_year = strftime('%Y') - $match[2];
+        }
+    }
+    if (preg_match('!^(\+|\-)\s*(\d+)$!', $start_year, $match)) {
+        if ($match[1] == '+') {
+            $start_year = strftime('%Y') + $match[2];
+        } else {
+            $start_year = strftime('%Y') - $match[2];
+        }
+    }
+    if (strlen($time[0]) > 0) { 
+        if ($start_year > $time[0] && !isset($params['start_year'])) {
+            // force start year to include given date if not explicitly set
+            $start_year = $time[0];
+        }
+        if($end_year < $time[0] && !isset($params['end_year'])) {
+            // force end year to include given date if not explicitly set
+            $end_year = $time[0];
+        }
+    }
+
+    $field_order = strtoupper($field_order);
+
+    $html_result = $month_result = $day_result = $year_result = "";
+
+    if ($display_months) {
+        $month_names = array();
+        $month_values = array();
+        if(isset($month_empty)) {
+            $month_names[''] = $month_empty;
+            $month_values[''] = '';
+        }
+        for ($i = 1; $i <= 12; $i++) {
+            $month_names[$i] = strftime($month_format, mktime(0, 0, 0, $i, 1, 2000));
+            $month_values[$i] = strftime($month_value_format, mktime(0, 0, 0, $i, 1, 2000));
+        }
+
+        $month_result .= '<select name=';
+        if (null !== $field_array){
+            $month_result .= '"' . $field_array . '[' . $prefix . 'Month]"';
+        } else {
+            $month_result .= '"' . $prefix . 'Month"';
+        }
+        if (null !== $month_size){
+            $month_result .= ' size="' . $month_size . '"';
+        }
+        if (null !== $month_extra){
+            $month_result .= ' ' . $month_extra;
+        }
+        if (null !== $all_extra){
+            $month_result .= ' ' . $all_extra;
+        }
+        $month_result .= $extra_attrs . '>'."\n";
+
+        $month_result .= smarty_function_html_options(array('output'     => $month_names,
+                                                            'values'     => $month_values,
+                                                            'selected'   => (int)$time[1] ? strftime($month_value_format, mktime(0, 0, 0, (int)$time[1], 1, 2000)) : '',
+                                                            'print_result' => false),
+                                                      $smarty);
+        $month_result .= '</select>';
+    }
+
+    if ($display_days) {
+        $days = array();
+        if (isset($day_empty)) {
+            $days[''] = $day_empty;
+            $day_values[''] = '';
+        }
+        for ($i = 1; $i <= 31; $i++) {
+            $days[] = sprintf($day_format, $i);
+            $day_values[] = sprintf($day_value_format, $i);
+        }
+
+        $day_result .= '<select name=';
+        if (null !== $field_array){
+            $day_result .= '"' . $field_array . '[' . $prefix . 'Day]"';
+        } else {
+            $day_result .= '"' . $prefix . 'Day"';
+        }
+        if (null !== $day_size){
+            $day_result .= ' size="' . $day_size . '"';
+        }
+        if (null !== $all_extra){
+            $day_result .= ' ' . $all_extra;
+        }
+        if (null !== $day_extra){
+            $day_result .= ' ' . $day_extra;
+        }
+        $day_result .= $extra_attrs . '>'."\n";
+        $day_result .= smarty_function_html_options(array('output'     => $days,
+                                                          'values'     => $day_values,
+                                                          'selected'   => $time[2],
+                                                          'print_result' => false),
+                                                    $smarty);
+        $day_result .= '</select>';
+    }
+
+    if ($display_years) {
+        if (null !== $field_array){
+            $year_name = $field_array . '[' . $prefix . 'Year]';
+        } else {
+            $year_name = $prefix . 'Year';
+        }
+        if ($year_as_text) {
+            $year_result .= '<input type="text" name="' . $year_name . '" value="' . $time[0] . '" size="4" maxlength="4"';
+            if (null !== $all_extra){
+                $year_result .= ' ' . $all_extra;
+            }
+            if (null !== $year_extra){
+                $year_result .= ' ' . $year_extra;
+            }
+            $year_result .= ' />';
+        } else {
+            $years = range((int)$start_year, (int)$end_year);
+            if ($reverse_years) {
+                rsort($years, SORT_NUMERIC);
+            } else {
+                sort($years, SORT_NUMERIC);
+            }
+            $yearvals = $years;
+            if(isset($year_empty)) {
+                array_unshift($years, $year_empty);
+                array_unshift($yearvals, '');
+            }
+            $year_result .= '<select name="' . $year_name . '"';
+            if (null !== $year_size){
+                $year_result .= ' size="' . $year_size . '"';
+            }
+            if (null !== $all_extra){
+                $year_result .= ' ' . $all_extra;
+            }
+            if (null !== $year_extra){
+                $year_result .= ' ' . $year_extra;
+            }
+            $year_result .= $extra_attrs . '>'."\n";
+            $year_result .= smarty_function_html_options(array('output' => $years,
+                                                               'values' => $yearvals,
+                                                               'selected'   => $time[0],
+                                                               'print_result' => false),
+                                                         $smarty);
+            $year_result .= '</select>';
+        }
+    }
+
+    // Loop thru the field_order field
+    for ($i = 0; $i <= 2; $i++){
+        $c = substr($field_order, $i, 1);
+        switch ($c){
+            case 'D':
+                $html_result .= $day_result;
+                break;
+
+            case 'M':
+                $html_result .= $month_result;
+                break;
+
+            case 'Y':
+                $html_result .= $year_result;
+                break;
+        }
+        // Add the field seperator
+        if($i != 2) {
+            $html_result .= $field_separator;
+        }
+    }
+
+    return $html_result;
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/shared.escape_special_chars.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/shared.escape_special_chars.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/shared.escape_special_chars.php	(revision 405)
@@ -0,0 +1,31 @@
+<?php
+/**
+ * Smarty shared plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * escape_special_chars common function
+ *
+ * Function: smarty_function_escape_special_chars<br>
+ * Purpose:  used by other smarty functions to escape
+ *           special chars except for already escaped ones
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @param string
+ * @return string
+ */
+function smarty_function_escape_special_chars($string)
+{
+    if(!is_array($string)) {
+        $string = preg_replace('!&(#?\w+);!', '%%%SMARTY_START%%%\\1%%%SMARTY_END%%%', $string);
+        $string = htmlspecialchars($string);
+        $string = str_replace(array('%%%SMARTY_START%%%','%%%SMARTY_END%%%'), array('&',';'), $string);
+    }
+    return $string;
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.html_checkboxes.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.html_checkboxes.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.html_checkboxes.php	(revision 405)
@@ -0,0 +1,143 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty {html_checkboxes} function plugin
+ *
+ * File:       function.html_checkboxes.php<br>
+ * Type:       function<br>
+ * Name:       html_checkboxes<br>
+ * Date:       24.Feb.2003<br>
+ * Purpose:    Prints out a list of checkbox input types<br>
+ * Input:<br>
+ *           - name       (optional) - string default "checkbox"
+ *           - values     (required) - array
+ *           - options    (optional) - associative array
+ *           - checked    (optional) - array default not set
+ *           - separator  (optional) - ie <br> or &nbsp;
+ *           - output     (optional) - the output next to each checkbox
+ *           - assign     (optional) - assign the output as an array to this variable
+ * Examples:
+ * <pre>
+ * {html_checkboxes values=$ids output=$names}
+ * {html_checkboxes values=$ids name='box' separator='<br>' output=$names}
+ * {html_checkboxes values=$ids checked=$checked separator='<br>' output=$names}
+ * </pre>
+ * @link http://smarty.php.net/manual/en/language.function.html.checkboxes.php {html_checkboxes}
+ *      (Smarty online manual)
+ * @author     Christopher Kvarme <christopher.kvarme@flashjab.com>
+ * @author credits to Monte Ohrt <monte at ohrt dot com>
+ * @version    1.0
+ * @param array
+ * @param Smarty
+ * @return string
+ * @uses smarty_function_escape_special_chars()
+ */
+function smarty_function_html_checkboxes($params, &$smarty)
+{
+    require_once $smarty->_get_plugin_filepath('shared','escape_special_chars');
+
+    $name = 'checkbox';
+    $values = null;
+    $options = null;
+    $selected = null;
+    $separator = '';
+    $labels = true;
+    $output = null;
+
+    $extra = '';
+
+    foreach($params as $_key => $_val) {
+        switch($_key) {
+            case 'name':
+            case 'separator':
+                $$_key = $_val;
+                break;
+
+            case 'labels':
+                $$_key = (bool)$_val;
+                break;
+
+            case 'options':
+                $$_key = (array)$_val;
+                break;
+
+            case 'values':
+            case 'output':
+                $$_key = array_values((array)$_val);
+                break;
+
+            case 'checked':
+            case 'selected':
+                $selected = array_map('strval', array_values((array)$_val));
+                break;
+
+            case 'checkboxes':
+                $smarty->trigger_error('html_checkboxes: the use of the "checkboxes" attribute is deprecated, use "options" instead', E_USER_WARNING);
+                $options = (array)$_val;
+                break;
+
+            case 'assign':
+                break;
+
+            default:
+                if(!is_array($_val)) {
+                    $extra .= ' '.$_key.'="'.smarty_function_escape_special_chars($_val).'"';
+                } else {
+                    $smarty->trigger_error("html_checkboxes: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
+                }
+                break;
+        }
+    }
+
+    if (!isset($options) && !isset($values))
+        return ''; /* raise error here? */
+
+    settype($selected, 'array');
+    $_html_result = array();
+
+    if (isset($options)) {
+
+        foreach ($options as $_key=>$_val)
+            $_html_result[] = smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels);
+
+
+    } else {
+        foreach ($values as $_i=>$_key) {
+            $_val = isset($output[$_i]) ? $output[$_i] : '';
+            $_html_result[] = smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels);
+        }
+
+    }
+
+    if(!empty($params['assign'])) {
+        $smarty->assign($params['assign'], $_html_result);
+    } else {
+        return implode("\n",$_html_result);
+    }
+
+}
+
+function smarty_function_html_checkboxes_output($name, $value, $output, $selected, $extra, $separator, $labels) {
+    $_output = '';
+    if ($labels) $_output .= '<label>';
+    $_output .= '<input type="checkbox" name="'
+        . smarty_function_escape_special_chars($name) . '[]" value="'
+        . smarty_function_escape_special_chars($value) . '"';
+
+    if (in_array((string)$value, $selected)) {
+        $_output .= ' checked="checked"';
+    }
+    $_output .= $extra . ' />' . $output;
+    if ($labels) $_output .= '</label>';
+    $_output .=  $separator;
+
+    return $_output;
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.config_load.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.config_load.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.config_load.php	(revision 405)
@@ -0,0 +1,142 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Smarty {config_load} function plugin
+ *
+ * Type:     function<br>
+ * Name:     config_load<br>
+ * Purpose:  load config file vars
+ * @link http://smarty.php.net/manual/en/language.function.config.load.php {config_load}
+ *       (Smarty online manual)
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @author messju mohr <messju at lammfellpuschen dot de> (added use of resources)
+ * @param array Format:
+ * <pre>
+ * array('file' => required config file name,
+ *       'section' => optional config file section to load
+ *       'scope' => local/parent/global
+ *       'global' => overrides scope, setting to parent if true)
+ * </pre>
+ * @param Smarty
+ */
+function smarty_function_config_load($params, &$smarty)
+{
+        if ($smarty->debugging) {
+            $_params = array();
+            require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
+            $_debug_start_time = smarty_core_get_microtime($_params, $smarty);
+        }
+
+        $_file = isset($params['file']) ? $smarty->_dequote($params['file']) : null;
+        $_section = isset($params['section']) ? $smarty->_dequote($params['section']) : null;
+        $_scope = isset($params['scope']) ? $smarty->_dequote($params['scope']) : 'global';
+        $_global = isset($params['global']) ? $smarty->_dequote($params['global']) : false;
+
+        if (!isset($_file) || strlen($_file) == 0) {
+            $smarty->trigger_error("missing 'file' attribute in config_load tag", E_USER_ERROR, __FILE__, __LINE__);
+        }
+
+        if (isset($_scope)) {
+            if ($_scope != 'local' &&
+                $_scope != 'parent' &&
+                $_scope != 'global') {
+                $smarty->trigger_error("invalid 'scope' attribute value", E_USER_ERROR, __FILE__, __LINE__);
+            }
+        } else {
+            if ($_global) {
+                $_scope = 'parent';
+            } else {
+                $_scope = 'local';
+            }
+        }
+
+        $_params = array('resource_name' => $_file,
+                         'resource_base_path' => $smarty->config_dir,
+                         'get_source' => false);
+        $smarty->_parse_resource_name($_params);
+        $_file_path = $_params['resource_type'] . ':' . $_params['resource_name'];
+        if (isset($_section))
+            $_compile_file = $smarty->_get_compile_path($_file_path.'|'.$_section);
+        else
+            $_compile_file = $smarty->_get_compile_path($_file_path);
+
+        if($smarty->force_compile || !file_exists($_compile_file)) {
+            $_compile = true;
+        } elseif ($smarty->compile_check) {
+            $_params = array('resource_name' => $_file,
+                             'resource_base_path' => $smarty->config_dir,
+                             'get_source' => false);
+            $_compile = $smarty->_fetch_resource_info($_params) &&
+                $_params['resource_timestamp'] > filemtime($_compile_file);
+        } else {
+            $_compile = false;
+        }
+
+        if($_compile) {
+            // compile config file
+            if(!is_object($smarty->_conf_obj)) {
+                require_once SMARTY_DIR . $smarty->config_class . '.class.php';
+                $smarty->_conf_obj = new $smarty->config_class();
+                $smarty->_conf_obj->overwrite = $smarty->config_overwrite;
+                $smarty->_conf_obj->booleanize = $smarty->config_booleanize;
+                $smarty->_conf_obj->read_hidden = $smarty->config_read_hidden;
+                $smarty->_conf_obj->fix_newlines = $smarty->config_fix_newlines;
+            }
+
+            $_params = array('resource_name' => $_file,
+                             'resource_base_path' => $smarty->config_dir,
+                             $_params['get_source'] = true);
+            if (!$smarty->_fetch_resource_info($_params)) {
+                return;
+            }
+            $smarty->_conf_obj->set_file_contents($_file, $_params['source_content']);
+            $_config_vars = array_merge($smarty->_conf_obj->get($_file),
+                    $smarty->_conf_obj->get($_file, $_section));
+            if(function_exists('var_export')) {
+                $_output = '<?php $_config_vars = ' . var_export($_config_vars, true) . '; ?>';
+            } else {
+                $_output = '<?php $_config_vars = unserialize(\'' . strtr(serialize($_config_vars),array('\''=>'\\\'', '\\'=>'\\\\')) . '\'); ?>';
+            }
+            $_params = (array('compile_path' => $_compile_file, 'compiled_content' => $_output, 'resource_timestamp' => $_params['resource_timestamp']));
+            require_once(SMARTY_CORE_DIR . 'core.write_compiled_resource.php');
+            smarty_core_write_compiled_resource($_params, $smarty);
+        } else {
+            include($_compile_file);
+        }
+
+        if ($smarty->caching) {
+            $smarty->_cache_info['config'][$_file] = true;
+        }
+
+        $smarty->_config[0]['vars'] = @array_merge($smarty->_config[0]['vars'], $_config_vars);
+        $smarty->_config[0]['files'][$_file] = true;
+
+        if ($_scope == 'parent') {
+                $smarty->_config[1]['vars'] = @array_merge($smarty->_config[1]['vars'], $_config_vars);
+                $smarty->_config[1]['files'][$_file] = true;
+        } else if ($_scope == 'global') {
+            for ($i = 1, $for_max = count($smarty->_config); $i < $for_max; $i++) {
+                $smarty->_config[$i]['vars'] = @array_merge($smarty->_config[$i]['vars'], $_config_vars);
+                $smarty->_config[$i]['files'][$_file] = true;
+            }
+        }
+
+        if ($smarty->debugging) {
+            $_params = array();
+            require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
+            $smarty->_smarty_debug_info[] = array('type'      => 'config',
+                                                'filename'  => $_file.' ['.$_section.'] '.$_scope,
+                                                'depth'     => $smarty->_inclusion_depth,
+                                                'exec_time' => smarty_core_get_microtime($_params, $smarty) - $_debug_start_time);
+        }
+
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.upper.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.upper.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.upper.php	(revision 405)
@@ -0,0 +1,26 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty upper modifier plugin
+ *
+ * Type:     modifier<br>
+ * Name:     upper<br>
+ * Purpose:  convert string to uppercase
+ * @link http://smarty.php.net/manual/en/language.modifier.upper.php
+ *          upper (Smarty online manual)
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @param string
+ * @return string
+ */
+function smarty_modifier_upper($string)
+{
+    return strtoupper($string);
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.html_image.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.html_image.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.html_image.php	(revision 405)
@@ -0,0 +1,142 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty {html_image} function plugin
+ *
+ * Type:     function<br>
+ * Name:     html_image<br>
+ * Date:     Feb 24, 2003<br>
+ * Purpose:  format HTML tags for the image<br>
+ * Input:<br>
+ *         - file = file (and path) of image (required)
+ *         - height = image height (optional, default actual height)
+ *         - width = image width (optional, default actual width)
+ *         - basedir = base directory for absolute paths, default
+ *                     is environment variable DOCUMENT_ROOT
+ *         - path_prefix = prefix for path output (optional, default empty)
+ *
+ * Examples: {html_image file="/images/masthead.gif"}
+ * Output:   <img src="/images/masthead.gif" width=400 height=23>
+ * @link http://smarty.php.net/manual/en/language.function.html.image.php {html_image}
+ *      (Smarty online manual)
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @author credits to Duda <duda@big.hu> - wrote first image function
+ *           in repository, helped with lots of functionality
+ * @version  1.0
+ * @param array
+ * @param Smarty
+ * @return string
+ * @uses smarty_function_escape_special_chars()
+ */
+function smarty_function_html_image($params, &$smarty)
+{
+    require_once $smarty->_get_plugin_filepath('shared','escape_special_chars');
+    
+    $alt = '';
+    $file = '';
+    $height = '';
+    $width = '';
+    $extra = '';
+    $prefix = '';
+    $suffix = '';
+    $path_prefix = '';
+    $server_vars = ($smarty->request_use_auto_globals) ? $_SERVER : $GLOBALS['HTTP_SERVER_VARS'];
+    $basedir = isset($server_vars['DOCUMENT_ROOT']) ? $server_vars['DOCUMENT_ROOT'] : '';
+    foreach($params as $_key => $_val) {
+        switch($_key) {
+            case 'file':
+            case 'height':
+            case 'width':
+            case 'dpi':
+            case 'path_prefix':
+            case 'basedir':
+                $$_key = $_val;
+                break;
+
+            case 'alt':
+                if(!is_array($_val)) {
+                    $$_key = smarty_function_escape_special_chars($_val);
+                } else {
+                    $smarty->trigger_error("html_image: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
+                }
+                break;
+
+            case 'link':
+            case 'href':
+                $prefix = '<a href="' . $_val . '">';
+                $suffix = '</a>';
+                break;
+
+            default:
+                if(!is_array($_val)) {
+                    $extra .= ' '.$_key.'="'.smarty_function_escape_special_chars($_val).'"';
+                } else {
+                    $smarty->trigger_error("html_image: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
+                }
+                break;
+        }
+    }
+
+    if (empty($file)) {
+        $smarty->trigger_error("html_image: missing 'file' parameter", E_USER_NOTICE);
+        return;
+    }
+
+    if (substr($file,0,1) == '/') {
+        $_image_path = $basedir . $file;
+    } else {
+        $_image_path = $file;
+    }
+    
+    if(!isset($params['width']) || !isset($params['height'])) {
+        if(!$_image_data = @getimagesize($_image_path)) {
+            if(!file_exists($_image_path)) {
+                $smarty->trigger_error("html_image: unable to find '$_image_path'", E_USER_NOTICE);
+                return;
+            } else if(!is_readable($_image_path)) {
+                $smarty->trigger_error("html_image: unable to read '$_image_path'", E_USER_NOTICE);
+                return;
+            } else {
+                $smarty->trigger_error("html_image: '$_image_path' is not a valid image file", E_USER_NOTICE);
+                return;
+            }
+        }
+        if ($smarty->security &&
+            ($_params = array('resource_type' => 'file', 'resource_name' => $_image_path)) &&
+            (require_once(SMARTY_CORE_DIR . 'core.is_secure.php')) &&
+            (!smarty_core_is_secure($_params, $smarty)) ) {
+            $smarty->trigger_error("html_image: (secure) '$_image_path' not in secure directory", E_USER_NOTICE);
+        }        
+        
+        if(!isset($params['width'])) {
+            $width = $_image_data[0];
+        }
+        if(!isset($params['height'])) {
+            $height = $_image_data[1];
+        }
+
+    }
+
+    if(isset($params['dpi'])) {
+        if(strstr($server_vars['HTTP_USER_AGENT'], 'Mac')) {
+            $dpi_default = 72;
+        } else {
+            $dpi_default = 96;
+        }
+        $_resize = $dpi_default/$params['dpi'];
+        $width = round($width * $_resize);
+        $height = round($height * $_resize);
+    }
+
+    return $prefix . '<img src="'.$path_prefix.$file.'" alt="'.$alt.'" width="'.$width.'" height="'.$height.'"'.$extra.' />' . $suffix;
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.spacify.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.spacify.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.spacify.php	(revision 405)
@@ -0,0 +1,30 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty spacify modifier plugin
+ *
+ * Type:     modifier<br>
+ * Name:     spacify<br>
+ * Purpose:  add spaces between characters in a string
+ * @link http://smarty.php.net/manual/en/language.modifier.spacify.php
+ *          spacify (Smarty online manual)
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @param string
+ * @param string
+ * @return string
+ */
+function smarty_modifier_spacify($string, $spacify_char = ' ')
+{
+    return implode($spacify_char,
+                   preg_split('//', $string, -1, PREG_SPLIT_NO_EMPTY));
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.count_sentences.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.count_sentences.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.count_sentences.php	(revision 405)
@@ -0,0 +1,29 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty count_sentences modifier plugin
+ *
+ * Type:     modifier<br>
+ * Name:     count_sentences
+ * Purpose:  count the number of sentences in a text
+ * @link http://smarty.php.net/manual/en/language.modifier.count.paragraphs.php
+ *          count_sentences (Smarty online manual)
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @param string
+ * @return integer
+ */
+function smarty_modifier_count_sentences($string)
+{
+    // find periods with a word before but not after.
+    return preg_match_all('/[^\s]\.(?!\w)/', $string, $match);
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.escape.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.escape.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.escape.php	(revision 405)
@@ -0,0 +1,93 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty escape modifier plugin
+ *
+ * Type:     modifier<br>
+ * Name:     escape<br>
+ * Purpose:  Escape the string according to escapement type
+ * @link http://smarty.php.net/manual/en/language.modifier.escape.php
+ *          escape (Smarty online manual)
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @param string
+ * @param html|htmlall|url|quotes|hex|hexentity|javascript
+ * @return string
+ */
+function smarty_modifier_escape($string, $esc_type = 'html', $char_set = 'ISO-8859-1')
+{
+    switch ($esc_type) {
+        case 'html':
+            return htmlspecialchars($string, ENT_QUOTES, $char_set);
+
+        case 'htmlall':
+            return htmlentities($string, ENT_QUOTES, $char_set);
+
+        case 'url':
+            return rawurlencode($string);
+
+        case 'urlpathinfo':
+            return str_replace('%2F','/',rawurlencode($string));
+            
+        case 'quotes':
+            // escape unescaped single quotes
+            return preg_replace("%(?<!\\\\)'%", "\\'", $string);
+
+        case 'hex':
+            // escape every character into hex
+            $return = '';
+            for ($x=0; $x < strlen($string); $x++) {
+                $return .= '%' . bin2hex($string[$x]);
+            }
+            return $return;
+            
+        case 'hexentity':
+            $return = '';
+            for ($x=0; $x < strlen($string); $x++) {
+                $return .= '&#x' . bin2hex($string[$x]) . ';';
+            }
+            return $return;
+
+        case 'decentity':
+            $return = '';
+            for ($x=0; $x < strlen($string); $x++) {
+                $return .= '&#' . ord($string[$x]) . ';';
+            }
+            return $return;
+
+        case 'javascript':
+            // escape quotes and backslashes, newlines, etc.
+            return strtr($string, array('\\'=>'\\\\',"'"=>"\\'",'"'=>'\\"',"\r"=>'\\r',"\n"=>'\\n','</'=>'<\/'));
+            
+        case 'mail':
+            // safe way to display e-mail address on a web page
+            return str_replace(array('@', '.'),array(' [AT] ', ' [DOT] '), $string);
+            
+        case 'nonstd':
+           // escape non-standard chars, such as ms document quotes
+           $_res = '';
+           for($_i = 0, $_len = strlen($string); $_i < $_len; $_i++) {
+               $_ord = ord(substr($string, $_i, 1));
+               // non-standard char, escape it
+               if($_ord >= 126){
+                   $_res .= '&#' . $_ord . ';';
+               }
+               else {
+                   $_res .= substr($string, $_i, 1);
+               }
+           }
+           return $_res;
+
+        default:
+            return $string;
+    }
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.count_paragraphs.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.count_paragraphs.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.count_paragraphs.php	(revision 405)
@@ -0,0 +1,29 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty count_paragraphs modifier plugin
+ *
+ * Type:     modifier<br>
+ * Name:     count_paragraphs<br>
+ * Purpose:  count the number of paragraphs in a text
+ * @link http://smarty.php.net/manual/en/language.modifier.count.paragraphs.php
+ *          count_paragraphs (Smarty online manual)
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @param string
+ * @return integer
+ */
+function smarty_modifier_count_paragraphs($string)
+{
+    // count \r or \n characters
+    return count(preg_split('/[\r\n]+/', $string));
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/compiler.assign.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/compiler.assign.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/compiler.assign.php	(revision 405)
@@ -0,0 +1,40 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Smarty {assign} compiler function plugin
+ *
+ * Type:     compiler function<br>
+ * Name:     assign<br>
+ * Purpose:  assign a value to a template variable
+ * @link http://smarty.php.net/manual/en/language.custom.functions.php#LANGUAGE.FUNCTION.ASSIGN {assign}
+ *       (Smarty online manual)
+ * @author Monte Ohrt <monte at ohrt dot com> (initial author)
+ * @auther messju mohr <messju at lammfellpuschen dot de> (conversion to compiler function)
+ * @param string containing var-attribute and value-attribute
+ * @param Smarty_Compiler
+ */
+function smarty_compiler_assign($tag_attrs, &$compiler)
+{
+    $_params = $compiler->_parse_attrs($tag_attrs);
+
+    if (!isset($_params['var'])) {
+        $compiler->_syntax_error("assign: missing 'var' parameter", E_USER_WARNING);
+        return;
+    }
+
+    if (!isset($_params['value'])) {
+        $compiler->_syntax_error("assign: missing 'value' parameter", E_USER_WARNING);
+        return;
+    }
+
+    return "\$this->assign({$_params['var']}, {$_params['value']});";
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.strip.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.strip.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.strip.php	(revision 405)
@@ -0,0 +1,33 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty strip modifier plugin
+ *
+ * Type:     modifier<br>
+ * Name:     strip<br>
+ * Purpose:  Replace all repeated spaces, newlines, tabs
+ *           with a single space or supplied replacement string.<br>
+ * Example:  {$var|strip} {$var|strip:"&nbsp;"}
+ * Date:     September 25th, 2002
+ * @link http://smarty.php.net/manual/en/language.modifier.strip.php
+ *          strip (Smarty online manual)
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @version  1.0
+ * @param string
+ * @param string
+ * @return string
+ */
+function smarty_modifier_strip($text, $replace = ' ')
+{
+    return preg_replace('!\s+!', $replace, $text);
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.count_words.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.count_words.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.count_words.php	(revision 405)
@@ -0,0 +1,33 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty count_words modifier plugin
+ *
+ * Type:     modifier<br>
+ * Name:     count_words<br>
+ * Purpose:  count the number of words in a text
+ * @link http://smarty.php.net/manual/en/language.modifier.count.words.php
+ *          count_words (Smarty online manual)
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @param string
+ * @return integer
+ */
+function smarty_modifier_count_words($string)
+{
+    // split text by ' ',\r,\n,\f,\t
+    $split_array = preg_split('/\s+/',$string);
+    // count matches that contain alphanumerics
+    $word_count = preg_grep('/[a-zA-Z0-9\\x80-\\xff]/', $split_array);
+
+    return count($word_count);
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.cat.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.cat.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.cat.php	(revision 405)
@@ -0,0 +1,33 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty cat modifier plugin
+ *
+ * Type:     modifier<br>
+ * Name:     cat<br>
+ * Date:     Feb 24, 2003
+ * Purpose:  catenate a value to a variable
+ * Input:    string to catenate
+ * Example:  {$var|cat:"foo"}
+ * @link http://smarty.php.net/manual/en/language.modifier.cat.php cat
+ *          (Smarty online manual)
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @version 1.0
+ * @param string
+ * @param string
+ * @return string
+ */
+function smarty_modifier_cat($string, $cat)
+{
+    return $string . $cat;
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.debug_print_var.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.debug_print_var.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.debug_print_var.php	(revision 405)
@@ -0,0 +1,57 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty debug_print_var modifier plugin
+ *
+ * Type:     modifier<br>
+ * Name:     debug_print_var<br>
+ * Purpose:  formats variable contents for display in the console
+ * @link http://smarty.php.net/manual/en/language.modifier.debug.print.var.php
+ *          debug_print_var (Smarty online manual)
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @param array|object
+ * @param integer
+ * @param integer
+ * @return string
+ */
+function smarty_modifier_debug_print_var($var, $depth = 0, $length = 40)
+{
+    $_replace = array("\n"=>'<i>&#92;n</i>', "\r"=>'<i>&#92;r</i>', "\t"=>'<i>&#92;t</i>');
+    if (is_array($var)) {
+        $results = "<b>Array (".count($var).")</b>";
+        foreach ($var as $curr_key => $curr_val) {
+            $return = smarty_modifier_debug_print_var($curr_val, $depth+1, $length);
+            $results .= "<br>".str_repeat('&nbsp;', $depth*2)."<b>".strtr($curr_key, $_replace)."</b> =&gt; $return";
+        }
+    } else if (is_object($var)) {
+        $object_vars = get_object_vars($var);
+        $results = "<b>".get_class($var)." Object (".count($object_vars).")</b>";
+        foreach ($object_vars as $curr_key => $curr_val) {
+            $return = smarty_modifier_debug_print_var($curr_val, $depth+1, $length);
+            $results .= "<br>".str_repeat('&nbsp;', $depth*2)."<b>$curr_key</b> =&gt; $return";
+        }
+    } else if (is_resource($var)) {
+        $results = '<i>'.(string)$var.'</i>';
+    } else if (empty($var) && $var != "0") {
+        $results = '<i>empty</i>';
+    } else {
+        if (strlen($var) > $length ) {
+            $results = substr($var, 0, $length-3).'...';
+        } else {
+            $results = $var;
+        }
+        $results = htmlspecialchars($results);
+        $results = strtr($results, $_replace);
+    }
+    return $results;
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.assign.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.assign.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.assign.php	(revision 405)
@@ -0,0 +1,30 @@
+<?php
+
+/*
+ * Smarty plugin
+ * -------------------------------------------------------------
+ * Type:     function
+ * Name:     assign
+ * Purpose:  assign a value to a template variable
+ * -------------------------------------------------------------
+ */
+function smarty_function_assign($params, &$smarty)
+{
+    extract($params);
+
+    if (empty($var)) {
+        $smarty->trigger_error("assign: missing 'var' parameter");
+        return;
+    }
+
+    if (!in_array('value', array_keys($params))) {
+        $smarty->trigger_error("assign: missing 'value' parameter");
+        return;
+    }
+
+    $smarty->assign($var, $value);
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.replace.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.replace.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.replace.php	(revision 405)
@@ -0,0 +1,30 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty replace modifier plugin
+ *
+ * Type:     modifier<br>
+ * Name:     replace<br>
+ * Purpose:  simple search/replace
+ * @link http://smarty.php.net/manual/en/language.modifier.replace.php
+ *          replace (Smarty online manual)
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @param string
+ * @param string
+ * @param string
+ * @return string
+ */
+function smarty_modifier_replace($string, $search, $replace)
+{
+    return str_replace($search, $replace, $string);
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.eval.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.eval.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.eval.php	(revision 405)
@@ -0,0 +1,49 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty {eval} function plugin
+ *
+ * Type:     function<br>
+ * Name:     eval<br>
+ * Purpose:  evaluate a template variable as a template<br>
+ * @link http://smarty.php.net/manual/en/language.function.eval.php {eval}
+ *       (Smarty online manual)
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @param array
+ * @param Smarty
+ */
+function smarty_function_eval($params, &$smarty)
+{
+
+    if (!isset($params['var'])) {
+        $smarty->trigger_error("eval: missing 'var' parameter");
+        return;
+    }
+
+    if($params['var'] == '') {
+        return;
+    }
+
+    $smarty->_compile_source('evaluated template', $params['var'], $_var_compiled);
+
+    ob_start();
+    $smarty->_eval('?>' . $_var_compiled);
+    $_contents = ob_get_contents();
+    ob_end_clean();
+
+    if (!empty($params['assign'])) {
+        $smarty->assign($params['assign'], $_contents);
+    } else {
+        return $_contents;
+    }
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.string_format.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.string_format.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.string_format.php	(revision 405)
@@ -0,0 +1,29 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty string_format modifier plugin
+ *
+ * Type:     modifier<br>
+ * Name:     string_format<br>
+ * Purpose:  format strings via sprintf
+ * @link http://smarty.php.net/manual/en/language.modifier.string.format.php
+ *          string_format (Smarty online manual)
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @param string
+ * @param string
+ * @return string
+ */
+function smarty_modifier_string_format($string, $format)
+{
+    return sprintf($format, $string);
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.nl2br.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.nl2br.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.nl2br.php	(revision 405)
@@ -0,0 +1,35 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty plugin
+ *
+ * Type:     modifier<br>
+ * Name:     nl2br<br>
+ * Date:     Feb 26, 2003
+ * Purpose:  convert \r\n, \r or \n to <<br>>
+ * Input:<br>
+ *         - contents = contents to replace
+ *         - preceed_test = if true, includes preceeding break tags
+ *           in replacement
+ * Example:  {$text|nl2br}
+ * @link http://smarty.php.net/manual/en/language.modifier.nl2br.php
+ *          nl2br (Smarty online manual)
+ * @version  1.0
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @param string
+ * @return string
+ */
+function smarty_modifier_nl2br($string)
+{
+    return nl2br($string);
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.strip_tags.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.strip_tags.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.strip_tags.php	(revision 405)
@@ -0,0 +1,32 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty strip_tags modifier plugin
+ *
+ * Type:     modifier<br>
+ * Name:     strip_tags<br>
+ * Purpose:  strip html tags from text
+ * @link http://smarty.php.net/manual/en/language.modifier.strip.tags.php
+ *          strip_tags (Smarty online manual)
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @param string
+ * @param boolean
+ * @return string
+ */
+function smarty_modifier_strip_tags($string, $replace_with_space = true)
+{
+    if ($replace_with_space)
+        return preg_replace('!<[^>]*?>!', ' ', $string);
+    else
+        return strip_tags($string);
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.default.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.default.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.default.php	(revision 405)
@@ -0,0 +1,32 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty default modifier plugin
+ *
+ * Type:     modifier<br>
+ * Name:     default<br>
+ * Purpose:  designate default value for empty variables
+ * @link http://smarty.php.net/manual/en/language.modifier.default.php
+ *          default (Smarty online manual)
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @param string
+ * @param string
+ * @return string
+ */
+function smarty_modifier_default($string, $default = '')
+{
+    if (!isset($string) || $string === '')
+        return $default;
+    else
+        return $string;
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.date_format.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.date_format.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.date_format.php	(revision 405)
@@ -0,0 +1,49 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Include the {@link shared.make_timestamp.php} plugin
+ */
+require_once $smarty->_get_plugin_filepath('shared','make_timestamp');
+/**
+ * Smarty date_format modifier plugin
+ *
+ * Type:     modifier<br>
+ * Name:     date_format<br>
+ * Purpose:  format datestamps via strftime<br>
+ * Input:<br>
+ *         - string: input date string
+ *         - format: strftime format for output
+ *         - default_date: default date if $string is empty
+ * @link http://smarty.php.net/manual/en/language.modifier.date.format.php
+ *          date_format (Smarty online manual)
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @param string
+ * @param string
+ * @param string
+ * @return string|void
+ * @uses smarty_make_timestamp()
+ */
+function smarty_modifier_date_format($string, $format="%b %e, %Y", $default_date=null)
+{
+    if (substr(PHP_OS,0,3) == 'WIN') {
+           $_win_from = array ('%e',  '%T',       '%D');
+           $_win_to   = array ('%#d', '%H:%M:%S', '%m/%d/%y');
+           $format = str_replace($_win_from, $_win_to, $format);
+    }
+    if($string != '') {
+        return strftime($format, smarty_make_timestamp($string));
+    } elseif (isset($default_date) && $default_date != '') {
+        return strftime($format, smarty_make_timestamp($default_date));
+    } else {
+        return;
+    }
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.capitalize.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.capitalize.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.capitalize.php	(revision 405)
@@ -0,0 +1,43 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty capitalize modifier plugin
+ *
+ * Type:     modifier<br>
+ * Name:     capitalize<br>
+ * Purpose:  capitalize words in the string
+ * @link http://smarty.php.net/manual/en/language.modifiers.php#LANGUAGE.MODIFIER.CAPITALIZE
+ *      capitalize (Smarty online manual)
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @param string
+ * @return string
+ */
+function smarty_modifier_capitalize($string, $uc_digits = false)
+{
+    smarty_modifier_capitalize_ucfirst(null, $uc_digits);
+    return preg_replace_callback('!\b\w+\b!', 'smarty_modifier_capitalize_ucfirst', $string);
+}
+
+function smarty_modifier_capitalize_ucfirst($string, $uc_digits = null)
+{
+    static $_uc_digits = false;
+    
+    if(isset($uc_digits)) {
+        $_uc_digits = $uc_digits;
+        return;
+    }
+    
+    if(!preg_match('!\d!',$string[0]) || $_uc_digits)
+        return ucfirst($string[0]);
+    else
+        return $string[0];
+}
+
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.cycle.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.cycle.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.cycle.php	(revision 405)
@@ -0,0 +1,102 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Smarty {cycle} function plugin
+ *
+ * Type:     function<br>
+ * Name:     cycle<br>
+ * Date:     May 3, 2002<br>
+ * Purpose:  cycle through given values<br>
+ * Input:
+ *         - name = name of cycle (optional)
+ *         - values = comma separated list of values to cycle,
+ *                    or an array of values to cycle
+ *                    (this can be left out for subsequent calls)
+ *         - reset = boolean - resets given var to true
+ *         - print = boolean - print var or not. default is true
+ *         - advance = boolean - whether or not to advance the cycle
+ *         - delimiter = the value delimiter, default is ","
+ *         - assign = boolean, assigns to template var instead of
+ *                    printed.
+ *
+ * Examples:<br>
+ * <pre>
+ * {cycle values="#eeeeee,#d0d0d0d"}
+ * {cycle name=row values="one,two,three" reset=true}
+ * {cycle name=row}
+ * </pre>
+ * @link http://smarty.php.net/manual/en/language.function.cycle.php {cycle}
+ *       (Smarty online manual)
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @author credit to Mark Priatel <mpriatel@rogers.com>
+ * @author credit to Gerard <gerard@interfold.com>
+ * @author credit to Jason Sweat <jsweat_php@yahoo.com>
+ * @version  1.3
+ * @param array
+ * @param Smarty
+ * @return string|null
+ */
+function smarty_function_cycle($params, &$smarty)
+{
+    static $cycle_vars;
+    
+    $name = (empty($params['name'])) ? 'default' : $params['name'];
+    $print = (isset($params['print'])) ? (bool)$params['print'] : true;
+    $advance = (isset($params['advance'])) ? (bool)$params['advance'] : true;
+    $reset = (isset($params['reset'])) ? (bool)$params['reset'] : false;
+            
+    if (!in_array('values', array_keys($params))) {
+        if(!isset($cycle_vars[$name]['values'])) {
+            $smarty->trigger_error("cycle: missing 'values' parameter");
+            return;
+        }
+    } else {
+        if(isset($cycle_vars[$name]['values'])
+            && $cycle_vars[$name]['values'] != $params['values'] ) {
+            $cycle_vars[$name]['index'] = 0;
+        }
+        $cycle_vars[$name]['values'] = $params['values'];
+    }
+
+    $cycle_vars[$name]['delimiter'] = (isset($params['delimiter'])) ? $params['delimiter'] : ',';
+    
+    if(is_array($cycle_vars[$name]['values'])) {
+        $cycle_array = $cycle_vars[$name]['values'];
+    } else {
+        $cycle_array = explode($cycle_vars[$name]['delimiter'],$cycle_vars[$name]['values']);
+    }
+    
+    if(!isset($cycle_vars[$name]['index']) || $reset ) {
+        $cycle_vars[$name]['index'] = 0;
+    }
+    
+    if (isset($params['assign'])) {
+        $print = false;
+        $smarty->assign($params['assign'], $cycle_array[$cycle_vars[$name]['index']]);
+    }
+        
+    if($print) {
+        $retval = $cycle_array[$cycle_vars[$name]['index']];
+    } else {
+        $retval = null;
+    }
+
+    if($advance) {
+        if ( $cycle_vars[$name]['index'] >= count($cycle_array) -1 ) {
+            $cycle_vars[$name]['index'] = 0;
+        } else {
+            $cycle_vars[$name]['index']++;
+        }
+    }
+    
+    return $retval;
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.count_characters.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.count_characters.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.count_characters.php	(revision 405)
@@ -0,0 +1,32 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty count_characters modifier plugin
+ *
+ * Type:     modifier<br>
+ * Name:     count_characteres<br>
+ * Purpose:  count the number of characters in a text
+ * @link http://smarty.php.net/manual/en/language.modifier.count.characters.php
+ *          count_characters (Smarty online manual)
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @param string
+ * @param boolean include whitespace in the character count
+ * @return integer
+ */
+function smarty_modifier_count_characters($string, $include_spaces = false)
+{
+    if ($include_spaces)
+       return(strlen($string));
+
+    return preg_match_all("/[^\s]/",$string, $match);
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.lower.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.lower.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.lower.php	(revision 405)
@@ -0,0 +1,26 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty lower modifier plugin
+ *
+ * Type:     modifier<br>
+ * Name:     lower<br>
+ * Purpose:  convert string to lowercase
+ * @link http://smarty.php.net/manual/en/language.modifier.lower.php
+ *          lower (Smarty online manual)
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @param string
+ * @return string
+ */
+function smarty_modifier_lower($string)
+{
+    return strtolower($string);
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/block.textformat.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/block.textformat.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/block.textformat.php	(revision 405)
@@ -0,0 +1,103 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Smarty {textformat}{/textformat} block plugin
+ *
+ * Type:     block function<br>
+ * Name:     textformat<br>
+ * Purpose:  format text a certain way with preset styles
+ *           or custom wrap/indent settings<br>
+ * @link http://smarty.php.net/manual/en/language.function.textformat.php {textformat}
+ *       (Smarty online manual)
+ * @param array
+ * <pre>
+ * Params:   style: string (email)
+ *           indent: integer (0)
+ *           wrap: integer (80)
+ *           wrap_char string ("\n")
+ *           indent_char: string (" ")
+ *           wrap_boundary: boolean (true)
+ * </pre>
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @param string contents of the block
+ * @param Smarty clever simulation of a method
+ * @return string string $content re-formatted
+ */
+function smarty_block_textformat($params, $content, &$smarty)
+{
+    if (is_null($content)) {
+        return;
+    }
+
+    $style = null;
+    $indent = 0;
+    $indent_first = 0;
+    $indent_char = ' ';
+    $wrap = 80;
+    $wrap_char = "\n";
+    $wrap_cut = false;
+    $assign = null;
+    
+    foreach ($params as $_key => $_val) {
+        switch ($_key) {
+            case 'style':
+            case 'indent_char':
+            case 'wrap_char':
+            case 'assign':
+                $$_key = (string)$_val;
+                break;
+
+            case 'indent':
+            case 'indent_first':
+            case 'wrap':
+                $$_key = (int)$_val;
+                break;
+
+            case 'wrap_cut':
+                $$_key = (bool)$_val;
+                break;
+
+            default:
+                $smarty->trigger_error("textformat: unknown attribute '$_key'");
+        }
+    }
+
+    if ($style == 'email') {
+        $wrap = 72;
+    }
+
+    // split into paragraphs
+    $_paragraphs = preg_split('![\r\n][\r\n]!',$content);
+    $_output = '';
+
+    for($_x = 0, $_y = count($_paragraphs); $_x < $_y; $_x++) {
+        if ($_paragraphs[$_x] == '') {
+            continue;
+        }
+        // convert mult. spaces & special chars to single space
+        $_paragraphs[$_x] = preg_replace(array('!\s+!','!(^\s+)|(\s+$)!'), array(' ',''), $_paragraphs[$_x]);
+        // indent first line
+        if($indent_first > 0) {
+            $_paragraphs[$_x] = str_repeat($indent_char, $indent_first) . $_paragraphs[$_x];
+        }
+        // wordwrap sentences
+        $_paragraphs[$_x] = wordwrap($_paragraphs[$_x], $wrap - $indent, $wrap_char, $wrap_cut);
+        // indent lines
+        if($indent > 0) {
+            $_paragraphs[$_x] = preg_replace('!^!m', str_repeat($indent_char, $indent), $_paragraphs[$_x]);
+        }
+    }
+    $_output = implode($wrap_char . $wrap_char, $_paragraphs);
+
+    return $assign ? $smarty->assign($assign, $_output) : $_output;
+
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.popup.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.popup.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.popup.php	(revision 405)
@@ -0,0 +1,119 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty {popup} function plugin
+ *
+ * Type:     function<br>
+ * Name:     popup<br>
+ * Purpose:  make text pop up in windows via overlib
+ * @link http://smarty.php.net/manual/en/language.function.popup.php {popup}
+ *          (Smarty online manual)
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @param array
+ * @param Smarty
+ * @return string
+ */
+function smarty_function_popup($params, &$smarty)
+{
+    $append = '';
+    foreach ($params as $_key=>$_value) {
+        switch ($_key) {
+            case 'text':
+            case 'trigger':
+            case 'function':
+            case 'inarray':
+                $$_key = (string)$_value;
+                if ($_key == 'function' || $_key == 'inarray')
+                    $append .= ',' . strtoupper($_key) . ",'$_value'";
+                break;
+
+            case 'caption':
+            case 'closetext':
+            case 'status':
+                $append .= ',' . strtoupper($_key) . ",'" . str_replace("'","\'",$_value) . "'";
+                break;
+
+            case 'fgcolor':
+            case 'bgcolor':
+            case 'textcolor':
+            case 'capcolor':
+            case 'closecolor':
+            case 'textfont':
+            case 'captionfont':
+            case 'closefont':
+            case 'fgbackground':
+            case 'bgbackground':
+            case 'caparray':
+            case 'capicon':
+            case 'background':
+            case 'frame':
+                $append .= ',' . strtoupper($_key) . ",'$_value'";
+                break;
+
+            case 'textsize':
+            case 'captionsize':
+            case 'closesize':
+            case 'width':
+            case 'height':
+            case 'border':
+            case 'offsetx':
+            case 'offsety':
+            case 'snapx':
+            case 'snapy':
+            case 'fixx':
+            case 'fixy':
+            case 'padx':
+            case 'pady':
+            case 'timeout':
+            case 'delay':
+                $append .= ',' . strtoupper($_key) . ",$_value";
+                break;
+
+            case 'sticky':
+            case 'left':
+            case 'right':
+            case 'center':
+            case 'above':
+            case 'below':
+            case 'noclose':
+            case 'autostatus':
+            case 'autostatuscap':
+            case 'fullhtml':
+            case 'hauto':
+            case 'vauto':
+            case 'mouseoff':
+            case 'followmouse':
+            case 'closeclick':
+                if ($_value) $append .= ',' . strtoupper($_key);
+                break;
+
+            default:
+                $smarty->trigger_error("[popup] unknown parameter $_key", E_USER_WARNING);
+        }
+    }
+
+    if (empty($text) && !isset($inarray) && empty($function)) {
+        $smarty->trigger_error("overlib: attribute 'text' or 'inarray' or 'function' required");
+        return false;
+    }
+
+    if (empty($trigger)) { $trigger = "onmouseover"; }
+
+    $retval = $trigger . '="return overlib(\''.preg_replace(array("!'!","![\r\n]!"),array("\'",'\r'),$text).'\'';
+    $retval .= $append . ');"';
+    if ($trigger == 'onmouseover')
+       $retval .= ' onmouseout="nd();"';
+
+
+    return $retval;
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.assign_debug_info.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.assign_debug_info.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.assign_debug_info.php	(revision 405)
@@ -0,0 +1,40 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Smarty {assign_debug_info} function plugin
+ *
+ * Type:     function<br>
+ * Name:     assign_debug_info<br>
+ * Purpose:  assign debug info to the template<br>
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @param array unused in this plugin, this plugin uses {@link Smarty::$_config},
+ *              {@link Smarty::$_tpl_vars} and {@link Smarty::$_smarty_debug_info}
+ * @param Smarty
+ */
+function smarty_function_assign_debug_info($params, &$smarty)
+{
+    $assigned_vars = $smarty->_tpl_vars;
+    ksort($assigned_vars);
+    if (@is_array($smarty->_config[0])) {
+        $config_vars = $smarty->_config[0];
+        ksort($config_vars);
+        $smarty->assign("_debug_config_keys", array_keys($config_vars));
+        $smarty->assign("_debug_config_vals", array_values($config_vars));
+    }
+    
+    $included_templates = $smarty->_smarty_debug_info;
+    
+    $smarty->assign("_debug_keys", array_keys($assigned_vars));
+    $smarty->assign("_debug_vals", array_values($assigned_vars));
+    
+    $smarty->assign("_debug_tpls", $included_templates);
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.html_radios.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.html_radios.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.html_radios.php	(revision 405)
@@ -0,0 +1,156 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty {html_radios} function plugin
+ *
+ * File:       function.html_radios.php<br>
+ * Type:       function<br>
+ * Name:       html_radios<br>
+ * Date:       24.Feb.2003<br>
+ * Purpose:    Prints out a list of radio input types<br>
+ * Input:<br>
+ *           - name       (optional) - string default "radio"
+ *           - values     (required) - array
+ *           - options    (optional) - associative array
+ *           - checked    (optional) - array default not set
+ *           - separator  (optional) - ie <br> or &nbsp;
+ *           - output     (optional) - the output next to each radio button
+ *           - assign     (optional) - assign the output as an array to this variable
+ * Examples:
+ * <pre>
+ * {html_radios values=$ids output=$names}
+ * {html_radios values=$ids name='box' separator='<br>' output=$names}
+ * {html_radios values=$ids checked=$checked separator='<br>' output=$names}
+ * </pre>
+ * @link http://smarty.php.net/manual/en/language.function.html.radios.php {html_radios}
+ *      (Smarty online manual)
+ * @author     Christopher Kvarme <christopher.kvarme@flashjab.com>
+ * @author credits to Monte Ohrt <monte at ohrt dot com>
+ * @version    1.0
+ * @param array
+ * @param Smarty
+ * @return string
+ * @uses smarty_function_escape_special_chars()
+ */
+function smarty_function_html_radios($params, &$smarty)
+{
+    require_once $smarty->_get_plugin_filepath('shared','escape_special_chars');
+   
+    $name = 'radio';
+    $values = null;
+    $options = null;
+    $selected = null;
+    $separator = '';
+    $labels = true;
+    $label_ids = false;
+    $output = null;
+    $extra = '';
+
+    foreach($params as $_key => $_val) {
+        switch($_key) {
+            case 'name':
+            case 'separator':
+                $$_key = (string)$_val;
+                break;
+
+            case 'checked':
+            case 'selected':
+                if(is_array($_val)) {
+                    $smarty->trigger_error('html_radios: the "' . $_key . '" attribute cannot be an array', E_USER_WARNING);
+                } else {
+                    $selected = (string)$_val;
+                }
+                break;
+
+            case 'labels':
+            case 'label_ids':
+                $$_key = (bool)$_val;
+                break;
+
+            case 'options':
+                $$_key = (array)$_val;
+                break;
+
+            case 'values':
+            case 'output':
+                $$_key = array_values((array)$_val);
+                break;
+
+            case 'radios':
+                $smarty->trigger_error('html_radios: the use of the "radios" attribute is deprecated, use "options" instead', E_USER_WARNING);
+                $options = (array)$_val;
+                break;
+
+            case 'assign':
+                break;
+
+            default:
+                if(!is_array($_val)) {
+                    $extra .= ' '.$_key.'="'.smarty_function_escape_special_chars($_val).'"';
+                } else {
+                    $smarty->trigger_error("html_radios: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
+                }
+                break;
+        }
+    }
+
+    if (!isset($options) && !isset($values))
+        return ''; /* raise error here? */
+
+    $_html_result = array();
+
+    if (isset($options)) {
+
+        foreach ($options as $_key=>$_val)
+            $_html_result[] = smarty_function_html_radios_output($name, $_key, $_val, $selected, $extra, $separator, $labels, $label_ids);
+
+    } else {
+
+        foreach ($values as $_i=>$_key) {
+            $_val = isset($output[$_i]) ? $output[$_i] : '';
+            $_html_result[] = smarty_function_html_radios_output($name, $_key, $_val, $selected, $extra, $separator, $labels, $label_ids);
+        }
+
+    }
+
+    if(!empty($params['assign'])) {
+        $smarty->assign($params['assign'], $_html_result);
+    } else {
+        return implode("\n",$_html_result);
+    }
+
+}
+
+function smarty_function_html_radios_output($name, $value, $output, $selected, $extra, $separator, $labels, $label_ids) {
+    $_output = '';
+    if ($labels) {
+      if($label_ids) {
+          $_id = smarty_function_escape_special_chars(preg_replace('![^\w\-\.]!', '_', $name . '_' . $value));
+          $_output .= '<label for="' . $_id . '">';
+      } else {
+          $_output .= '<label>';           
+      }
+   }
+   $_output .= '<input type="radio" name="'
+        . smarty_function_escape_special_chars($name) . '" value="'
+        . smarty_function_escape_special_chars($value) . '"';
+
+   if ($labels && $label_ids) $_output .= ' id="' . $_id . '"';
+
+    if ((string)$value==$selected) {
+        $_output .= ' checked="checked"';
+    }
+    $_output .= $extra . ' />' . $output;
+    if ($labels) $_output .= '</label>';
+    $_output .=  $separator;
+
+    return $_output;
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/outputfilter.trimwhitespace.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/outputfilter.trimwhitespace.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/outputfilter.trimwhitespace.php	(revision 405)
@@ -0,0 +1,75 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Smarty trimwhitespace outputfilter plugin
+ *
+ * File:     outputfilter.trimwhitespace.php<br>
+ * Type:     outputfilter<br>
+ * Name:     trimwhitespace<br>
+ * Date:     Jan 25, 2003<br>
+ * Purpose:  trim leading white space and blank lines from
+ *           template source after it gets interpreted, cleaning
+ *           up code and saving bandwidth. Does not affect
+ *           <<PRE>></PRE> and <SCRIPT></SCRIPT> blocks.<br>
+ * Install:  Drop into the plugin directory, call
+ *           <code>$smarty->load_filter('output','trimwhitespace');</code>
+ *           from application.
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @author Contributions from Lars Noschinski <lars@usenet.noschinski.de>
+ * @version  1.3
+ * @param string
+ * @param Smarty
+ */
+function smarty_outputfilter_trimwhitespace($source, &$smarty)
+{
+    // Pull out the script blocks
+    preg_match_all("!<script[^>]+>.*?</script>!is", $source, $match);
+    $_script_blocks = $match[0];
+    $source = preg_replace("!<script[^>]+>.*?</script>!is",
+                           '@@@SMARTY:TRIM:SCRIPT@@@', $source);
+
+    // Pull out the pre blocks
+    preg_match_all("!<pre>.*?</pre>!is", $source, $match);
+    $_pre_blocks = $match[0];
+    $source = preg_replace("!<pre>.*?</pre>!is",
+                           '@@@SMARTY:TRIM:PRE@@@', $source);
+
+    // Pull out the textarea blocks
+    preg_match_all("!<textarea[^>]+>.*?</textarea>!is", $source, $match);
+    $_textarea_blocks = $match[0];
+    $source = preg_replace("!<textarea[^>]+>.*?</textarea>!is",
+                           '@@@SMARTY:TRIM:TEXTAREA@@@', $source);
+
+    // remove all leading spaces, tabs and carriage returns NOT
+    // preceeded by a php close tag.
+    $source = trim(preg_replace('/((?<!\?>)\n)[\s]+/m', '\1', $source));
+
+    // replace script blocks
+    smarty_outputfilter_trimwhitespace_replace("@@@SMARTY:TRIM:SCRIPT@@@",$_script_blocks, $source);
+
+    // replace pre blocks
+    smarty_outputfilter_trimwhitespace_replace("@@@SMARTY:TRIM:PRE@@@",$_pre_blocks, $source);
+
+    // replace textarea blocks
+    smarty_outputfilter_trimwhitespace_replace("@@@SMARTY:TRIM:TEXTAREA@@@",$_textarea_blocks, $source);
+
+    return $source;
+}
+
+function smarty_outputfilter_trimwhitespace_replace($search_str, $replace, &$subject) {
+    $_len = strlen($search_str);
+    $_pos = 0;
+    for ($_i=0, $_count=count($replace); $_i<$_count; $_i++)
+        if (($_pos=strpos($subject, $search_str, $_pos))!==false)
+            $subject = substr_replace($subject, $replace[$_i], $_pos, $_len);
+        else
+            break;
+
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.html_table.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.html_table.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.html_table.php	(revision 405)
@@ -0,0 +1,137 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty {html_table} function plugin
+ *
+ * Type:     function<br>
+ * Name:     html_table<br>
+ * Date:     Feb 17, 2003<br>
+ * Purpose:  make an html table from an array of data<br>
+ * Input:<br>
+ *         - loop = array to loop through
+ *         - cols = number of columns
+ *         - rows = number of rows
+ *         - table_attr = table attributes
+ *         - tr_attr = table row attributes (arrays are cycled)
+ *         - td_attr = table cell attributes (arrays are cycled)
+ *         - trailpad = value to pad trailing cells with
+ *         - vdir = vertical direction (default: "down", means top-to-bottom)
+ *         - hdir = horizontal direction (default: "right", means left-to-right)
+ *         - inner = inner loop (default "cols": print $loop line by line,
+ *                   $loop will be printed column by column otherwise)
+ *
+ *
+ * Examples:
+ * <pre>
+ * {table loop=$data}
+ * {table loop=$data cols=4 tr_attr='"bgcolor=red"'}
+ * {table loop=$data cols=4 tr_attr=$colors}
+ * </pre>
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @version  1.0
+ * @link http://smarty.php.net/manual/en/language.function.html.table.php {html_table}
+ *          (Smarty online manual)
+ * @param array
+ * @param Smarty
+ * @return string
+ */
+function smarty_function_html_table($params, &$smarty)
+{
+    $table_attr = 'border="1"';
+    $tr_attr = '';
+    $td_attr = '';
+    $cols = 3;
+    $rows = 3;
+    $trailpad = '&nbsp;';
+    $vdir = 'down';
+    $hdir = 'right';
+    $inner = 'cols';
+
+    if (!isset($params['loop'])) {
+        $smarty->trigger_error("html_table: missing 'loop' parameter");
+        return;
+    }
+
+    foreach ($params as $_key=>$_value) {
+        switch ($_key) {
+            case 'loop':
+                $$_key = (array)$_value;
+                break;
+
+            case 'cols':
+            case 'rows':
+                $$_key = (int)$_value;
+                break;
+
+            case 'table_attr':
+            case 'trailpad':
+            case 'hdir':
+            case 'vdir':
+            case 'inner':
+                $$_key = (string)$_value;
+                break;
+
+            case 'tr_attr':
+            case 'td_attr':
+                $$_key = $_value;
+                break;
+        }
+    }
+
+    $loop_count = count($loop);
+    if (empty($params['rows'])) {
+        /* no rows specified */
+        $rows = ceil($loop_count/$cols);
+    } elseif (empty($params['cols'])) {
+        if (!empty($params['rows'])) {
+            /* no cols specified, but rows */
+            $cols = ceil($loop_count/$rows);
+        }
+    }
+
+    $output = "<table $table_attr>\n";
+
+    for ($r=0; $r<$rows; $r++) {
+        $output .= "<tr" . smarty_function_html_table_cycle('tr', $tr_attr, $r) . ">\n";
+        $rx =  ($vdir == 'down') ? $r*$cols : ($rows-1-$r)*$cols;
+
+        for ($c=0; $c<$cols; $c++) {
+            $x =  ($hdir == 'right') ? $rx+$c : $rx+$cols-1-$c;
+            if ($inner!='cols') {
+                /* shuffle x to loop over rows*/
+                $x = floor($x/$cols) + ($x%$cols)*$rows;
+            }
+
+            if ($x<$loop_count) {
+                $output .= "<td" . smarty_function_html_table_cycle('td', $td_attr, $c) . ">" . $loop[$x] . "</td>\n";
+            } else {
+                $output .= "<td" . smarty_function_html_table_cycle('td', $td_attr, $c) . ">$trailpad</td>\n";
+            }
+        }
+        $output .= "</tr>\n";
+    }
+    $output .= "</table>\n";
+    
+    return $output;
+}
+
+function smarty_function_html_table_cycle($name, $var, $no) {
+    if(!is_array($var)) {
+        $ret = $var;
+    } else {
+        $ret = $var[$no % count($var)];
+    }
+    
+    return ($ret) ? ' '.$ret : '';
+}
+
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.wordwrap.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.wordwrap.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.wordwrap.php	(revision 405)
@@ -0,0 +1,29 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty wordwrap modifier plugin
+ *
+ * Type:     modifier<br>
+ * Name:     wordwrap<br>
+ * Purpose:  wrap a string of text at a given length
+ * @link http://smarty.php.net/manual/en/language.modifier.wordwrap.php
+ *          wordwrap (Smarty online manual)
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @param string
+ * @param integer
+ * @param string
+ * @param boolean
+ * @return string
+ */
+function smarty_modifier_wordwrap($string,$length=80,$break="\n",$cut=false)
+{
+    return wordwrap($string,$length,$break,$cut);
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.regex_replace.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.regex_replace.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/modifier.regex_replace.php	(revision 405)
@@ -0,0 +1,34 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty regex_replace modifier plugin
+ *
+ * Type:     modifier<br>
+ * Name:     regex_replace<br>
+ * Purpose:  regular epxression search/replace
+ * @link http://smarty.php.net/manual/en/language.modifier.regex.replace.php
+ *          regex_replace (Smarty online manual)
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @param string
+ * @param string|array
+ * @param string|array
+ * @return string
+ */
+function smarty_modifier_regex_replace($string, $search, $replace)
+{
+    if (preg_match('!\W(\w+)$!s', $search, $match) && (strpos($match[1], 'e') !== false)) {
+        /* remove eval-modifier from $search */
+        $search = substr($search, 0, -strlen($match[1])) . str_replace('e', '', $match[1]);
+    }
+    return preg_replace($search, $replace, $string);
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.html_options.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.html_options.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.html_options.php	(revision 405)
@@ -0,0 +1,122 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty {html_options} function plugin
+ *
+ * Type:     function<br>
+ * Name:     html_options<br>
+ * Input:<br>
+ *           - name       (optional) - string default "select"
+ *           - values     (required if no options supplied) - array
+ *           - options    (required if no values supplied) - associative array
+ *           - selected   (optional) - string default not set
+ *           - output     (required if not options supplied) - array
+ * Purpose:  Prints the list of <option> tags generated from
+ *           the passed parameters
+ * @link http://smarty.php.net/manual/en/language.function.html.options.php {html_image}
+ *      (Smarty online manual)
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @param array
+ * @param Smarty
+ * @return string
+ * @uses smarty_function_escape_special_chars()
+ */
+function smarty_function_html_options($params, &$smarty)
+{
+    require_once $smarty->_get_plugin_filepath('shared','escape_special_chars');
+    
+    $name = null;
+    $values = null;
+    $options = null;
+    $selected = array();
+    $output = null;
+    
+    $extra = '';
+    
+    foreach($params as $_key => $_val) {
+        switch($_key) {
+            case 'name':
+                $$_key = (string)$_val;
+                break;
+            
+            case 'options':
+                $$_key = (array)$_val;
+                break;
+                
+            case 'values':
+            case 'output':
+                $$_key = array_values((array)$_val);
+                break;
+
+            case 'selected':
+                $$_key = array_map('strval', array_values((array)$_val));
+                break;
+                
+            default:
+                if(!is_array($_val)) {
+                    $extra .= ' '.$_key.'="'.smarty_function_escape_special_chars($_val).'"';
+                } else {
+                    $smarty->trigger_error("html_options: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
+                }
+                break;
+        }
+    }
+
+    if (!isset($options) && !isset($values))
+        return ''; /* raise error here? */
+
+    $_html_result = '';
+
+    if (isset($options)) {
+        
+        foreach ($options as $_key=>$_val)
+            $_html_result .= smarty_function_html_options_optoutput($_key, $_val, $selected);
+
+    } else {
+        
+        foreach ($values as $_i=>$_key) {
+            $_val = isset($output[$_i]) ? $output[$_i] : '';
+            $_html_result .= smarty_function_html_options_optoutput($_key, $_val, $selected);
+        }
+
+    }
+
+    if(!empty($name)) {
+        $_html_result = '<select name="' . $name . '"' . $extra . '>' . "\n" . $_html_result . '</select>' . "\n";
+    }
+
+    return $_html_result;
+
+}
+
+function smarty_function_html_options_optoutput($key, $value, $selected) {
+    if(!is_array($value)) {
+        $_html_result = '<option label="' . smarty_function_escape_special_chars($value) . '" value="' .
+            smarty_function_escape_special_chars($key) . '"';
+        if (in_array((string)$key, $selected))
+            $_html_result .= ' selected="selected"';
+        $_html_result .= '>' . smarty_function_escape_special_chars($value) . '</option>' . "\n";
+    } else {
+        $_html_result = smarty_function_html_options_optgroup($key, $value, $selected);
+    }
+    return $_html_result;
+}
+
+function smarty_function_html_options_optgroup($key, $values, $selected) {
+    $optgroup_html = '<optgroup label="' . smarty_function_escape_special_chars($key) . '">' . "\n";
+    foreach ($values as $key => $value) {
+        $optgroup_html .= smarty_function_html_options_optoutput($key, $value, $selected);
+    }
+    $optgroup_html .= "</optgroup>\n";
+    return $optgroup_html;
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.counter.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.counter.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.counter.php	(revision 405)
@@ -0,0 +1,80 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty {counter} function plugin
+ *
+ * Type:     function<br>
+ * Name:     counter<br>
+ * Purpose:  print out a counter value
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @link http://smarty.php.net/manual/en/language.function.counter.php {counter}
+ *       (Smarty online manual)
+ * @param array parameters
+ * @param Smarty
+ * @return string|null
+ */
+function smarty_function_counter($params, &$smarty)
+{
+    static $counters = array();
+
+    $name = (isset($params['name'])) ? $params['name'] : 'default';
+    if (!isset($counters[$name])) {
+        $counters[$name] = array(
+            'start'=>1,
+            'skip'=>1,
+            'direction'=>'up',
+            'count'=>1
+            );
+    }
+    $counter =& $counters[$name];
+
+    if (isset($params['start'])) {
+        $counter['start'] = $counter['count'] = (int)$params['start'];
+    }
+
+    if (!empty($params['assign'])) {
+        $counter['assign'] = $params['assign'];
+    }
+
+    if (isset($counter['assign'])) {
+        $smarty->assign($counter['assign'], $counter['count']);
+    }
+    
+    if (isset($params['print'])) {
+        $print = (bool)$params['print'];
+    } else {
+        $print = empty($counter['assign']);
+    }
+
+    if ($print) {
+        $retval = $counter['count'];
+    } else {
+        $retval = null;
+    }
+
+    if (isset($params['skip'])) {
+        $counter['skip'] = $params['skip'];
+    }
+    
+    if (isset($params['direction'])) {
+        $counter['direction'] = $params['direction'];
+    }
+
+    if ($counter['direction'] == "down")
+        $counter['count'] -= $counter['skip'];
+    else
+        $counter['count'] += $counter['skip'];
+    
+    return $retval;
+    
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/shared.make_timestamp.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/shared.make_timestamp.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/shared.make_timestamp.php	(revision 405)
@@ -0,0 +1,46 @@
+<?php
+/**
+ * Smarty shared plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Function: smarty_make_timestamp<br>
+ * Purpose:  used by other smarty functions to make a timestamp
+ *           from a string.
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @param string
+ * @return string
+ */
+function smarty_make_timestamp($string)
+{
+    if(empty($string)) {
+        // use "now":
+        $time = time();
+
+    } elseif (preg_match('/^\d{14}$/', $string)) {
+        // it is mysql timestamp format of YYYYMMDDHHMMSS?            
+        $time = mktime(substr($string, 8, 2),substr($string, 10, 2),substr($string, 12, 2),
+                       substr($string, 4, 2),substr($string, 6, 2),substr($string, 0, 4));
+        
+    } elseif (is_numeric($string)) {
+        // it is a numeric string, we handle it as timestamp
+        $time = (int)$string;
+        
+    } else {
+        // strtotime should handle it
+        $time = strtotime($string);
+        if ($time == -1 || $time === false) {
+            // strtotime() was not able to parse $string, use "now":
+            $time = time();
+        }
+    }
+    return $time;
+
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.html_select_time.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.html_select_time.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.html_select_time.php	(revision 405)
@@ -0,0 +1,194 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty {html_select_time} function plugin
+ *
+ * Type:     function<br>
+ * Name:     html_select_time<br>
+ * Purpose:  Prints the dropdowns for time selection
+ * @link http://smarty.php.net/manual/en/language.function.html.select.time.php {html_select_time}
+ *          (Smarty online manual)
+ * @author Roberto Berto <roberto@berto.net>
+ * @credits Monte Ohrt <monte AT ohrt DOT com>
+ * @param array
+ * @param Smarty
+ * @return string
+ * @uses smarty_make_timestamp()
+ */
+function smarty_function_html_select_time($params, &$smarty)
+{
+    require_once $smarty->_get_plugin_filepath('shared','make_timestamp');
+    require_once $smarty->_get_plugin_filepath('function','html_options');
+    /* Default values. */
+    $prefix             = "Time_";
+    $time               = time();
+    $display_hours      = true;
+    $display_minutes    = true;
+    $display_seconds    = true;
+    $display_meridian   = true;
+    $use_24_hours       = true;
+    $minute_interval    = 1;
+    $second_interval    = 1;
+    /* Should the select boxes be part of an array when returned from PHP?
+       e.g. setting it to "birthday", would create "birthday[Hour]",
+       "birthday[Minute]", "birthday[Seconds]" & "birthday[Meridian]".
+       Can be combined with prefix. */
+    $field_array        = null;
+    $all_extra          = null;
+    $hour_extra         = null;
+    $minute_extra       = null;
+    $second_extra       = null;
+    $meridian_extra     = null;
+
+    foreach ($params as $_key=>$_value) {
+        switch ($_key) {
+            case 'prefix':
+            case 'time':
+            case 'field_array':
+            case 'all_extra':
+            case 'hour_extra':
+            case 'minute_extra':
+            case 'second_extra':
+            case 'meridian_extra':
+                $$_key = (string)$_value;
+                break;
+
+            case 'display_hours':
+            case 'display_minutes':
+            case 'display_seconds':
+            case 'display_meridian':
+            case 'use_24_hours':
+                $$_key = (bool)$_value;
+                break;
+
+            case 'minute_interval':
+            case 'second_interval':
+                $$_key = (int)$_value;
+                break;
+
+            default:
+                $smarty->trigger_error("[html_select_time] unknown parameter $_key", E_USER_WARNING);
+        }
+    }
+
+    $time = smarty_make_timestamp($time);
+
+    $html_result = '';
+
+    if ($display_hours) {
+        $hours       = $use_24_hours ? range(0, 23) : range(1, 12);
+        $hour_fmt = $use_24_hours ? '%H' : '%I';
+        for ($i = 0, $for_max = count($hours); $i < $for_max; $i++)
+            $hours[$i] = sprintf('%02d', $hours[$i]);
+        $html_result .= '<select name=';
+        if (null !== $field_array) {
+            $html_result .= '"' . $field_array . '[' . $prefix . 'Hour]"';
+        } else {
+            $html_result .= '"' . $prefix . 'Hour"';
+        }
+        if (null !== $hour_extra){
+            $html_result .= ' ' . $hour_extra;
+        }
+        if (null !== $all_extra){
+            $html_result .= ' ' . $all_extra;
+        }
+        $html_result .= '>'."\n";
+        $html_result .= smarty_function_html_options(array('output'          => $hours,
+                                                           'values'          => $hours,
+                                                           'selected'      => strftime($hour_fmt, $time),
+                                                           'print_result' => false),
+                                                     $smarty);
+        $html_result .= "</select>\n";
+    }
+
+    if ($display_minutes) {
+        $all_minutes = range(0, 59);
+        for ($i = 0, $for_max = count($all_minutes); $i < $for_max; $i+= $minute_interval)
+            $minutes[] = sprintf('%02d', $all_minutes[$i]);
+        $selected = intval(floor(strftime('%M', $time) / $minute_interval) * $minute_interval);
+        $html_result .= '<select name=';
+        if (null !== $field_array) {
+            $html_result .= '"' . $field_array . '[' . $prefix . 'Minute]"';
+        } else {
+            $html_result .= '"' . $prefix . 'Minute"';
+        }
+        if (null !== $minute_extra){
+            $html_result .= ' ' . $minute_extra;
+        }
+        if (null !== $all_extra){
+            $html_result .= ' ' . $all_extra;
+        }
+        $html_result .= '>'."\n";
+        
+        $html_result .= smarty_function_html_options(array('output'          => $minutes,
+                                                           'values'          => $minutes,
+                                                           'selected'      => $selected,
+                                                           'print_result' => false),
+                                                     $smarty);
+        $html_result .= "</select>\n";
+    }
+
+    if ($display_seconds) {
+        $all_seconds = range(0, 59);
+        for ($i = 0, $for_max = count($all_seconds); $i < $for_max; $i+= $second_interval)
+            $seconds[] = sprintf('%02d', $all_seconds[$i]);
+        $selected = intval(floor(strftime('%S', $time) / $second_interval) * $second_interval);
+        $html_result .= '<select name=';
+        if (null !== $field_array) {
+            $html_result .= '"' . $field_array . '[' . $prefix . 'Second]"';
+        } else {
+            $html_result .= '"' . $prefix . 'Second"';
+        }
+        
+        if (null !== $second_extra){
+            $html_result .= ' ' . $second_extra;
+        }
+        if (null !== $all_extra){
+            $html_result .= ' ' . $all_extra;
+        }
+        $html_result .= '>'."\n";
+        
+        $html_result .= smarty_function_html_options(array('output'          => $seconds,
+                                                           'values'          => $seconds,
+                                                           'selected'      => $selected,
+                                                           'print_result' => false),
+                                                     $smarty);
+        $html_result .= "</select>\n";
+    }
+
+    if ($display_meridian && !$use_24_hours) {
+        $html_result .= '<select name=';
+        if (null !== $field_array) {
+            $html_result .= '"' . $field_array . '[' . $prefix . 'Meridian]"';
+        } else {
+            $html_result .= '"' . $prefix . 'Meridian"';
+        }
+        
+        if (null !== $meridian_extra){
+            $html_result .= ' ' . $meridian_extra;
+        }
+        if (null !== $all_extra){
+            $html_result .= ' ' . $all_extra;
+        }
+        $html_result .= '>'."\n";
+        
+        $html_result .= smarty_function_html_options(array('output'          => array('AM', 'PM'),
+                                                           'values'          => array('am', 'pm'),
+                                                           'selected'      => strtolower(strftime('%p', $time)),
+                                                           'print_result' => false),
+                                                     $smarty);
+        $html_result .= "</select>\n";
+    }
+
+    return $html_result;
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.mailto.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.mailto.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.mailto.php	(revision 405)
@@ -0,0 +1,163 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty {mailto} function plugin
+ *
+ * Type:     function<br>
+ * Name:     mailto<br>
+ * Date:     May 21, 2002
+ * Purpose:  automate mailto address link creation, and optionally
+ *           encode them.<br>
+ * Input:<br>
+ *         - address = e-mail address
+ *         - text = (optional) text to display, default is address
+ *         - encode = (optional) can be one of:
+ *                * none : no encoding (default)
+ *                * javascript : encode with javascript
+ *                * javascript_charcode : encode with javascript charcode
+ *                * hex : encode with hexidecimal (no javascript)
+ *         - cc = (optional) address(es) to carbon copy
+ *         - bcc = (optional) address(es) to blind carbon copy
+ *         - subject = (optional) e-mail subject
+ *         - newsgroups = (optional) newsgroup(s) to post to
+ *         - followupto = (optional) address(es) to follow up to
+ *         - extra = (optional) extra tags for the href link
+ *
+ * Examples:
+ * <pre>
+ * {mailto address="me@domain.com"}
+ * {mailto address="me@domain.com" encode="javascript"}
+ * {mailto address="me@domain.com" encode="hex"}
+ * {mailto address="me@domain.com" subject="Hello to you!"}
+ * {mailto address="me@domain.com" cc="you@domain.com,they@domain.com"}
+ * {mailto address="me@domain.com" extra='class="mailto"'}
+ * </pre>
+ * @link http://smarty.php.net/manual/en/language.function.mailto.php {mailto}
+ *          (Smarty online manual)
+ * @version  1.2
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @author   credits to Jason Sweat (added cc, bcc and subject functionality)
+ * @param    array
+ * @param    Smarty
+ * @return   string
+ */
+function smarty_function_mailto($params, &$smarty)
+{
+    $extra = '';
+
+    if (empty($params['address'])) {
+        $smarty->trigger_error("mailto: missing 'address' parameter");
+        return;
+    } else {
+        $address = $params['address'];
+    }
+
+    $text = $address;
+
+    // netscape and mozilla do not decode %40 (@) in BCC field (bug?)
+    // so, don't encode it.
+    $mail_parms = array();
+    foreach ($params as $var=>$value) {
+        switch ($var) {
+            case 'cc':
+            case 'bcc':
+            case 'followupto':
+                if (!empty($value))
+                    $mail_parms[] = $var.'='.str_replace('%40','@',rawurlencode($value));
+                break;
+                
+            case 'subject':
+            case 'newsgroups':
+                $mail_parms[] = $var.'='.rawurlencode($value);
+                break;
+
+            case 'extra':
+            case 'text':
+                $$var = $value;
+
+            default:
+        }
+    }
+
+    $mail_parm_vals = '';
+    for ($i=0; $i<count($mail_parms); $i++) {
+        $mail_parm_vals .= (0==$i) ? '?' : '&';
+        $mail_parm_vals .= $mail_parms[$i];
+    }
+    $address .= $mail_parm_vals;
+
+    $encode = (empty($params['encode'])) ? 'none' : $params['encode'];
+    if (!in_array($encode,array('javascript','javascript_charcode','hex','none')) ) {
+        $smarty->trigger_error("mailto: 'encode' parameter must be none, javascript or hex");
+        return;
+    }
+
+    if ($encode == 'javascript' ) {
+        $string = 'document.write(\'<a href="mailto:'.$address.'" '.$extra.'>'.$text.'</a>\');';
+
+        $js_encode = '';
+        for ($x=0; $x < strlen($string); $x++) {
+            $js_encode .= '%' . bin2hex($string[$x]);
+        }
+
+        return '<script type="text/javascript">eval(unescape(\''.$js_encode.'\'))</script>';
+
+    } elseif ($encode == 'javascript_charcode' ) {
+        $string = '<a href="mailto:'.$address.'" '.$extra.'>'.$text.'</a>';
+
+        for($x = 0, $y = strlen($string); $x < $y; $x++ ) {
+            $ord[] = ord($string[$x]);   
+        }
+
+        $_ret = "<script type=\"text/javascript\" language=\"javascript\">\n";
+        $_ret .= "<!--\n";
+        $_ret .= "{document.write(String.fromCharCode(";
+        $_ret .= implode(',',$ord);
+        $_ret .= "))";
+        $_ret .= "}\n";
+        $_ret .= "//-->\n";
+        $_ret .= "</script>\n";
+        
+        return $_ret;
+        
+        
+    } elseif ($encode == 'hex') {
+
+        preg_match('!^(.*)(\?.*)$!',$address,$match);
+        if(!empty($match[2])) {
+            $smarty->trigger_error("mailto: hex encoding does not work with extra attributes. Try javascript.");
+            return;
+        }
+        $address_encode = '';
+        for ($x=0; $x < strlen($address); $x++) {
+            if(preg_match('!\w!',$address[$x])) {
+                $address_encode .= '%' . bin2hex($address[$x]);
+            } else {
+                $address_encode .= $address[$x];
+            }
+        }
+        $text_encode = '';
+        for ($x=0; $x < strlen($text); $x++) {
+            $text_encode .= '&#x' . bin2hex($text[$x]).';';
+        }
+
+        $mailto = "&#109;&#97;&#105;&#108;&#116;&#111;&#58;";
+        return '<a href="'.$mailto.$address_encode.'" '.$extra.'>'.$text_encode.'</a>';
+
+    } else {
+        // no encoding
+        return '<a href="mailto:'.$address.'" '.$extra.'>'.$text.'</a>';
+
+    }
+
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.xoops_link.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.xoops_link.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.xoops_link.php	(revision 405)
@@ -0,0 +1,102 @@
+<?php
+// $Id: function.xoops_link.php,v 1.3 2005/09/04 20:46:08 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+/*
+ * Smarty plugin
+ * -------------------------------------------------------------
+ * Type:     function
+ * Name:     xoops_link
+ * Version:  1.0
+ * Author:	 Skalpa Keo <skalpa@xoops.org>
+ * Purpose:  format URL for linking to specific Xoops page
+ * Input:    module	= module to link to (optional, default to current module)
+ *           page	= page to link to (optional, default to current page)
+ *           params	= query string parameters (optional, default to empty)
+ *					ex: urlparm1=,urlparm2,urlparm3=val3, etc.....
+ *						urlparm3 value will be set to val3
+ *						urlparm2 value will keep current one (no = sign)
+ *						urlparm1 value will be set to empty ( = sign, but nothing after)
+ *
+ *			I.e: The template called by 'index.php?cid=5' calls this function with
+ *				{xoops_link page="viewcat.php" urlvars="cid,orderby=titleA"}>
+ *			Then the generated URL will be:
+ *				XOOPS_URL/modules/MODULENAME/viewcat.php?cid=5&orderby=titleA
+ * -------------------------------------------------------------
+ */
+
+function smarty_function_xoops_link($params, $smarty) {
+	$urlstr='';
+	if (isset($params['urlvars'])) {
+		$szvars=explode( '&', $params['urlvars'] );
+		$vars=array();
+		// Split the string making an array from the ('name','value') pairs
+		foreach ($szvars as $szvar) {
+			$pos=strpos($szvar,'=');
+			if ( $pos != false ) {			// If a value is specified, use it
+				$vars[] = array( 'name' => substr($szvar,0,$pos), 'value' => substr($szvar,$pos+1) );
+			} else {						// Otherwise use current one (if any)
+				if ( isset($_POST[$szvar]) ) {
+					$vars[] = array( 'name' => $szvar, 'value' => $_POST[$szvar] );
+				} elseif ( isset($_GET[$szvar]) ) {
+					$vars[] = array( 'name' => $szvar, 'value' => $_GET[$szvar] );
+				}
+			}
+		}
+		// Now reconstruct query string from specified variables
+		foreach ($vars as $var) {
+			$urlstr = "$urlstr&{$var['name']}={$var['value']}";
+		}
+		if ( strlen($urlstr) > 0 ) {
+			$urlstr = '?' . substr( $urlstr, 1 );
+		}
+	}
+
+	// Get default module/page from current ones if necessary
+	$module='';
+	$page='';
+	if ( !isset($params['module']) ) {
+		if ( isset($GLOBALS['xoopsModule']) && is_object($GLOBALS['xoopsModule']) ) {
+			$module = $GLOBALS['xoopsModule']->getVar('dirname');
+		}
+	} else {
+		$module = $params['module'];
+	}
+	if ( !isset($params['page']) ) {
+		$cur = xoops_getenv('PHP_SELF');
+		$page = substr( $cur, strrpos( $cur, '/' ) + 1 );
+	} else {
+		$page = $params['page'];
+	}
+	// Now, return entire link URL :-)
+	if ( empty($module) ) {
+		echo XOOPS_URL . "/$page" . $urlstr;
+	} else {
+		echo XOOPS_URL . "/modules/$module/$page" . $urlstr;
+	}
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.debug.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.debug.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.debug.php	(revision 405)
@@ -0,0 +1,35 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty {debug} function plugin
+ *
+ * Type:     function<br>
+ * Name:     debug<br>
+ * Date:     July 1, 2002<br>
+ * Purpose:  popup debug window
+ * @link http://smarty.php.net/manual/en/language.function.debug.php {debug}
+ *       (Smarty online manual)
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @version  1.0
+ * @param array
+ * @param Smarty
+ * @return string output from {@link Smarty::_generate_debug_output()}
+ */
+function smarty_function_debug($params, &$smarty)
+{
+    if (isset($params['output'])) {
+        $smarty->assign('_smarty_debug_output', $params['output']);
+    }
+    require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');
+    return smarty_core_display_debug_console(null, $smarty);
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.popup_init.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.popup_init.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/plugins/function.popup_init.php	(revision 405)
@@ -0,0 +1,40 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty {popup_init} function plugin
+ *
+ * Type:     function<br>
+ * Name:     popup_init<br>
+ * Purpose:  initialize overlib
+ * @link http://smarty.php.net/manual/en/language.function.popup.init.php {popup_init}
+ *          (Smarty online manual)
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @param array
+ * @param Smarty
+ * @return string
+ */
+function smarty_function_popup_init($params, &$smarty)
+{
+    $zindex = 1000;
+    
+    if (!empty($params['zindex'])) {
+        $zindex = $params['zindex'];
+    }
+    
+    if (!empty($params['src'])) {
+        return '<div id="overDiv" style="position:absolute; visibility:hidden; z-index:'.$zindex.';"></div>' . "\n"
+         . '<script type="text/javascript" language="JavaScript" src="'.$params['src'].'"></script>' . "\n";
+    } else {
+        $smarty->trigger_error("popup_init: missing src parameter");
+    }
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/Smarty_Compiler.class.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/Smarty_Compiler.class.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/Smarty_Compiler.class.php	(revision 405)
@@ -0,0 +1,2313 @@
+<?php
+
+/**
+ * Project:     Smarty: the PHP compiling template engine
+ * File:        Smarty_Compiler.class.php
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * @link http://smarty.php.net/
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @author Andrei Zmievski <andrei@php.net>
+ * @version 2.6.12
+ * @copyright 2001-2005 New Digital Group, Inc.
+ * @package Smarty
+ */
+
+/* $Id: Smarty_Compiler.class.php,v 1.3 2006/05/01 02:37:25 onokazu Exp $ */
+
+/**
+ * Template compiling class
+ * @package Smarty
+ */
+class Smarty_Compiler extends Smarty {
+
+    // internal vars
+    /**#@+
+     * @access private
+     */
+    var $_folded_blocks         =   array();    // keeps folded template blocks
+    var $_current_file          =   null;       // the current template being compiled
+    var $_current_line_no       =   1;          // line number for error messages
+    var $_capture_stack         =   array();    // keeps track of nested capture buffers
+    var $_plugin_info           =   array();    // keeps track of plugins to load
+    var $_init_smarty_vars      =   false;
+    var $_permitted_tokens      =   array('true','false','yes','no','on','off','null');
+    var $_db_qstr_regexp        =   null;        // regexps are setup in the constructor
+    var $_si_qstr_regexp        =   null;
+    var $_qstr_regexp           =   null;
+    var $_func_regexp           =   null;
+    var $_reg_obj_regexp        =   null;
+    var $_var_bracket_regexp    =   null;
+    var $_num_const_regexp      =   null;
+    var $_dvar_guts_regexp      =   null;
+    var $_dvar_regexp           =   null;
+    var $_cvar_regexp           =   null;
+    var $_svar_regexp           =   null;
+    var $_avar_regexp           =   null;
+    var $_mod_regexp            =   null;
+    var $_var_regexp            =   null;
+    var $_parenth_param_regexp  =   null;
+    var $_func_call_regexp      =   null;
+    var $_obj_ext_regexp        =   null;
+    var $_obj_start_regexp      =   null;
+    var $_obj_params_regexp     =   null;
+    var $_obj_call_regexp       =   null;
+    var $_cacheable_state       =   0;
+    var $_cache_attrs_count     =   0;
+    var $_nocache_count         =   0;
+    var $_cache_serial          =   null;
+    var $_cache_include         =   null;
+
+    var $_strip_depth           =   0;
+    var $_additional_newline    =   "\n";
+
+    /**#@-*/
+    /**
+     * The class constructor.
+     */
+    function Smarty_Compiler()
+    {
+        // matches double quoted strings:
+        // "foobar"
+        // "foo\"bar"
+        $this->_db_qstr_regexp = '"[^"\\\\]*(?:\\\\.[^"\\\\]*)*"';
+
+        // matches single quoted strings:
+        // 'foobar'
+        // 'foo\'bar'
+        $this->_si_qstr_regexp = '\'[^\'\\\\]*(?:\\\\.[^\'\\\\]*)*\'';
+
+        // matches single or double quoted strings
+        $this->_qstr_regexp = '(?:' . $this->_db_qstr_regexp . '|' . $this->_si_qstr_regexp . ')';
+
+        // matches bracket portion of vars
+        // [0]
+        // [foo]
+        // [$bar]
+        $this->_var_bracket_regexp = '\[\$?[\w\.]+\]';
+
+        // matches numerical constants
+        // 30
+        // -12
+        // 13.22
+        $this->_num_const_regexp = '(?:\-?\d+(?:\.\d+)?)';
+
+        // matches $ vars (not objects):
+        // $foo
+        // $foo.bar
+        // $foo.bar.foobar
+        // $foo[0]
+        // $foo[$bar]
+        // $foo[5][blah]
+        // $foo[5].bar[$foobar][4]
+        $this->_dvar_math_regexp = '(?:[\+\*\/\%]|(?:-(?!>)))';
+        $this->_dvar_math_var_regexp = '[\$\w\.\+\-\*\/\%\d\>\[\]]';
+        $this->_dvar_guts_regexp = '\w+(?:' . $this->_var_bracket_regexp
+                . ')*(?:\.\$?\w+(?:' . $this->_var_bracket_regexp . ')*)*(?:' . $this->_dvar_math_regexp . '(?:' . $this->_num_const_regexp . '|' . $this->_dvar_math_var_regexp . ')*)?';
+        $this->_dvar_regexp = '\$' . $this->_dvar_guts_regexp;
+
+        // matches config vars:
+        // #foo#
+        // #foobar123_foo#
+        $this->_cvar_regexp = '\#\w+\#';
+
+        // matches section vars:
+        // %foo.bar%
+        $this->_svar_regexp = '\%\w+\.\w+\%';
+
+        // matches all valid variables (no quotes, no modifiers)
+        $this->_avar_regexp = '(?:' . $this->_dvar_regexp . '|'
+           . $this->_cvar_regexp . '|' . $this->_svar_regexp . ')';
+
+        // matches valid variable syntax:
+        // $foo
+        // $foo
+        // #foo#
+        // #foo#
+        // "text"
+        // "text"
+        $this->_var_regexp = '(?:' . $this->_avar_regexp . '|' . $this->_qstr_regexp . ')';
+
+        // matches valid object call (one level of object nesting allowed in parameters):
+        // $foo->bar
+        // $foo->bar()
+        // $foo->bar("text")
+        // $foo->bar($foo, $bar, "text")
+        // $foo->bar($foo, "foo")
+        // $foo->bar->foo()
+        // $foo->bar->foo->bar()
+        // $foo->bar($foo->bar)
+        // $foo->bar($foo->bar())
+        // $foo->bar($foo->bar($blah,$foo,44,"foo",$foo[0].bar))
+        $this->_obj_ext_regexp = '\->(?:\$?' . $this->_dvar_guts_regexp . ')';
+        $this->_obj_restricted_param_regexp = '(?:'
+                . '(?:' . $this->_var_regexp . '|' . $this->_num_const_regexp . ')(?:' . $this->_obj_ext_regexp . '(?:\((?:(?:' . $this->_var_regexp . '|' . $this->_num_const_regexp . ')'
+                . '(?:\s*,\s*(?:' . $this->_var_regexp . '|' . $this->_num_const_regexp . '))*)?\))?)*)';
+        $this->_obj_single_param_regexp = '(?:\w+|' . $this->_obj_restricted_param_regexp . '(?:\s*,\s*(?:(?:\w+|'
+                . $this->_var_regexp . $this->_obj_restricted_param_regexp . ')))*)';
+        $this->_obj_params_regexp = '\((?:' . $this->_obj_single_param_regexp
+                . '(?:\s*,\s*' . $this->_obj_single_param_regexp . ')*)?\)';
+        $this->_obj_start_regexp = '(?:' . $this->_dvar_regexp . '(?:' . $this->_obj_ext_regexp . ')+)';
+        $this->_obj_call_regexp = '(?:' . $this->_obj_start_regexp . '(?:' . $this->_obj_params_regexp . ')?(?:' . $this->_dvar_math_regexp . '(?:' . $this->_num_const_regexp . '|' . $this->_dvar_math_var_regexp . ')*)?)';
+        
+        // matches valid modifier syntax:
+        // |foo
+        // |@foo
+        // |foo:"bar"
+        // |foo:$bar
+        // |foo:"bar":$foobar
+        // |foo|bar
+        // |foo:$foo->bar
+        $this->_mod_regexp = '(?:\|@?\w+(?::(?:\w+|' . $this->_num_const_regexp . '|'
+           . $this->_obj_call_regexp . '|' . $this->_avar_regexp . '|' . $this->_qstr_regexp .'))*)';
+
+        // matches valid function name:
+        // foo123
+        // _foo_bar
+        $this->_func_regexp = '[a-zA-Z_]\w*';
+
+        // matches valid registered object:
+        // foo->bar
+        $this->_reg_obj_regexp = '[a-zA-Z_]\w*->[a-zA-Z_]\w*';
+
+        // matches valid parameter values:
+        // true
+        // $foo
+        // $foo|bar
+        // #foo#
+        // #foo#|bar
+        // "text"
+        // "text"|bar
+        // $foo->bar
+        $this->_param_regexp = '(?:\s*(?:' . $this->_obj_call_regexp . '|'
+           . $this->_var_regexp . '|' . $this->_num_const_regexp  . '|\w+)(?>' . $this->_mod_regexp . '*)\s*)';
+
+        // matches valid parenthesised function parameters:
+        //
+        // "text"
+        //    $foo, $bar, "text"
+        // $foo|bar, "foo"|bar, $foo->bar($foo)|bar
+        $this->_parenth_param_regexp = '(?:\((?:\w+|'
+                . $this->_param_regexp . '(?:\s*,\s*(?:(?:\w+|'
+                . $this->_param_regexp . ')))*)?\))';
+
+        // matches valid function call:
+        // foo()
+        // foo_bar($foo)
+        // _foo_bar($foo,"bar")
+        // foo123($foo,$foo->bar(),"foo")
+        $this->_func_call_regexp = '(?:' . $this->_func_regexp . '\s*(?:'
+           . $this->_parenth_param_regexp . '))';
+    }
+
+    /**
+     * compile a resource
+     *
+     * sets $compiled_content to the compiled source
+     * @param string $resource_name
+     * @param string $source_content
+     * @param string $compiled_content
+     * @return true
+     */
+    function _compile_file($resource_name, $source_content, &$compiled_content)
+    {
+
+        if ($this->security) {
+            // do not allow php syntax to be executed unless specified
+            if ($this->php_handling == SMARTY_PHP_ALLOW &&
+                !$this->security_settings['PHP_HANDLING']) {
+                $this->php_handling = SMARTY_PHP_PASSTHRU;
+            }
+        }
+
+        $this->_load_filters();
+
+        $this->_current_file = $resource_name;
+        $this->_current_line_no = 1;
+        $ldq = preg_quote($this->left_delimiter, '~');
+        $rdq = preg_quote($this->right_delimiter, '~');
+
+        // run template source through prefilter functions
+        if (count($this->_plugins['prefilter']) > 0) {
+            foreach ($this->_plugins['prefilter'] as $filter_name => $prefilter) {
+                if ($prefilter === false) continue;
+                if ($prefilter[3] || is_callable($prefilter[0])) {
+                    $source_content = call_user_func_array($prefilter[0],
+                                                            array($source_content, &$this));
+                    $this->_plugins['prefilter'][$filter_name][3] = true;
+                } else {
+                    $this->_trigger_fatal_error("[plugin] prefilter '$filter_name' is not implemented");
+                }
+            }
+        }
+
+        /* fetch all special blocks */
+        $search = "~{$ldq}\*(.*?)\*{$rdq}|{$ldq}\s*literal\s*{$rdq}(.*?){$ldq}\s*/literal\s*{$rdq}|{$ldq}\s*php\s*{$rdq}(.*?){$ldq}\s*/php\s*{$rdq}~s";
+
+        preg_match_all($search, $source_content, $match,  PREG_SET_ORDER);
+        $this->_folded_blocks = $match;
+        reset($this->_folded_blocks);
+
+        /* replace special blocks by "{php}" */
+        $source_content = preg_replace($search.'e', "'"
+                                       . $this->_quote_replace($this->left_delimiter) . 'php'
+                                       . "' . str_repeat(\"\n\", substr_count('\\0', \"\n\")) .'"
+                                       . $this->_quote_replace($this->right_delimiter)
+                                       . "'"
+                                       , $source_content);
+
+        /* Gather all template tags. */
+        preg_match_all("~{$ldq}\s*(.*?)\s*{$rdq}~s", $source_content, $_match);
+        $template_tags = $_match[1];
+        /* Split content by template tags to obtain non-template content. */
+        $text_blocks = preg_split("~{$ldq}.*?{$rdq}~s", $source_content);
+
+        /* loop through text blocks */
+        for ($curr_tb = 0, $for_max = count($text_blocks); $curr_tb < $for_max; $curr_tb++) {
+            /* match anything resembling php tags */
+            if (preg_match_all('~(<\?(?:\w+|=)?|\?>|language\s*=\s*[\"\']?php[\"\']?)~is', $text_blocks[$curr_tb], $sp_match)) {
+                /* replace tags with placeholders to prevent recursive replacements */
+                $sp_match[1] = array_unique($sp_match[1]);
+                usort($sp_match[1], '_smarty_sort_length');
+                for ($curr_sp = 0, $for_max2 = count($sp_match[1]); $curr_sp < $for_max2; $curr_sp++) {
+                    $text_blocks[$curr_tb] = str_replace($sp_match[1][$curr_sp],'%%%SMARTYSP'.$curr_sp.'%%%',$text_blocks[$curr_tb]);
+                }
+                /* process each one */
+                for ($curr_sp = 0, $for_max2 = count($sp_match[1]); $curr_sp < $for_max2; $curr_sp++) {
+                    if ($this->php_handling == SMARTY_PHP_PASSTHRU) {
+                        /* echo php contents */
+                        $text_blocks[$curr_tb] = str_replace('%%%SMARTYSP'.$curr_sp.'%%%', '<?php echo \''.str_replace("'", "\'", $sp_match[1][$curr_sp]).'\'; ?>'."\n", $text_blocks[$curr_tb]);
+                    } else if ($this->php_handling == SMARTY_PHP_QUOTE) {
+                        /* quote php tags */
+                        $text_blocks[$curr_tb] = str_replace('%%%SMARTYSP'.$curr_sp.'%%%', htmlspecialchars($sp_match[1][$curr_sp]), $text_blocks[$curr_tb]);
+                    } else if ($this->php_handling == SMARTY_PHP_REMOVE) {
+                        /* remove php tags */
+                        $text_blocks[$curr_tb] = str_replace('%%%SMARTYSP'.$curr_sp.'%%%', '', $text_blocks[$curr_tb]);
+                    } else {
+                        /* SMARTY_PHP_ALLOW, but echo non php starting tags */
+                        $sp_match[1][$curr_sp] = preg_replace('~(<\?(?!php|=|$))~i', '<?php echo \'\\1\'?>'."\n", $sp_match[1][$curr_sp]);
+                        $text_blocks[$curr_tb] = str_replace('%%%SMARTYSP'.$curr_sp.'%%%', $sp_match[1][$curr_sp], $text_blocks[$curr_tb]);
+                    }
+                }
+            }
+        }
+
+        /* Compile the template tags into PHP code. */
+        $compiled_tags = array();
+        for ($i = 0, $for_max = count($template_tags); $i < $for_max; $i++) {
+            $this->_current_line_no += substr_count($text_blocks[$i], "\n");
+            $compiled_tags[] = $this->_compile_tag($template_tags[$i]);
+            $this->_current_line_no += substr_count($template_tags[$i], "\n");
+        }
+        if (count($this->_tag_stack)>0) {
+            list($_open_tag, $_line_no) = end($this->_tag_stack);
+            $this->_syntax_error("unclosed tag \{$_open_tag} (opened line $_line_no).", E_USER_ERROR, __FILE__, __LINE__);
+            return;
+        }
+
+        /* Reformat $text_blocks between 'strip' and '/strip' tags,
+           removing spaces, tabs and newlines. */
+        $strip = false;
+        for ($i = 0, $for_max = count($compiled_tags); $i < $for_max; $i++) {
+            if ($compiled_tags[$i] == '{strip}') {
+                $compiled_tags[$i] = '';
+                $strip = true;
+                /* remove leading whitespaces */
+                $text_blocks[$i + 1] = ltrim($text_blocks[$i + 1]);
+            }
+            if ($strip) {
+                /* strip all $text_blocks before the next '/strip' */
+                for ($j = $i + 1; $j < $for_max; $j++) {
+                    /* remove leading and trailing whitespaces of each line */
+                    $text_blocks[$j] = preg_replace('![\t ]*[\r\n]+[\t ]*!', '', $text_blocks[$j]);
+                    if ($compiled_tags[$j] == '{/strip}') {                       
+                        /* remove trailing whitespaces from the last text_block */
+                        $text_blocks[$j] = rtrim($text_blocks[$j]);
+                    }
+                    $text_blocks[$j] = "<?php echo '" . strtr($text_blocks[$j], array("'"=>"\'", "\\"=>"\\\\")) . "'; ?>";
+                    if ($compiled_tags[$j] == '{/strip}') {
+                        $compiled_tags[$j] = "\n"; /* slurped by php, but necessary
+                                    if a newline is following the closing strip-tag */
+                        $strip = false;
+                        $i = $j;
+                        break;
+                    }
+                }
+            }
+        }
+        $compiled_content = '';
+
+        /* Interleave the compiled contents and text blocks to get the final result. */
+        for ($i = 0, $for_max = count($compiled_tags); $i < $for_max; $i++) {
+            if ($compiled_tags[$i] == '') {
+                // tag result empty, remove first newline from following text block
+                $text_blocks[$i+1] = preg_replace('~^(\r\n|\r|\n)~', '', $text_blocks[$i+1]);
+            }
+            $compiled_content .= $text_blocks[$i].$compiled_tags[$i];
+        }
+        $compiled_content .= $text_blocks[$i];
+
+        // remove \n from the end of the file, if any
+        if (strlen($compiled_content) && (substr($compiled_content, -1) == "\n") ) {
+            $compiled_content = substr($compiled_content, 0, -1);
+        }
+
+        if (!empty($this->_cache_serial)) {
+            $compiled_content = "<?php \$this->_cache_serials['".$this->_cache_include."'] = '".$this->_cache_serial."'; ?>" . $compiled_content;
+        }
+
+        // remove unnecessary close/open tags
+        $compiled_content = preg_replace('~\?>\n?<\?php~', '', $compiled_content);
+
+        // run compiled template through postfilter functions
+        if (count($this->_plugins['postfilter']) > 0) {
+            foreach ($this->_plugins['postfilter'] as $filter_name => $postfilter) {
+                if ($postfilter === false) continue;
+                if ($postfilter[3] || is_callable($postfilter[0])) {
+                    $compiled_content = call_user_func_array($postfilter[0],
+                                                              array($compiled_content, &$this));
+                    $this->_plugins['postfilter'][$filter_name][3] = true;
+                } else {
+                    $this->_trigger_fatal_error("Smarty plugin error: postfilter '$filter_name' is not implemented");
+                }
+            }
+        }
+
+        // put header at the top of the compiled template
+        $template_header = "<?php /* Smarty version ".$this->_version.", created on ".strftime("%Y-%m-%d %H:%M:%S")."\n";
+        $template_header .= "         compiled from ".strtr(urlencode($resource_name), array('%2F'=>'/', '%3A'=>':'))." */ ?>\n";
+
+        /* Emit code to load needed plugins. */
+        $this->_plugins_code = '';
+        if (count($this->_plugin_info)) {
+            $_plugins_params = "array('plugins' => array(";
+            foreach ($this->_plugin_info as $plugin_type => $plugins) {
+                foreach ($plugins as $plugin_name => $plugin_info) {
+                    $_plugins_params .= "array('$plugin_type', '$plugin_name', '" . strtr($plugin_info[0], array("'" => "\\'", "\\" => "\\\\")) . "', $plugin_info[1], ";
+                    $_plugins_params .= $plugin_info[2] ? 'true),' : 'false),';
+                }
+            }
+            $_plugins_params .= '))';
+            $plugins_code = "<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');\nsmarty_core_load_plugins($_plugins_params, \$this); ?>\n";
+            $template_header .= $plugins_code;
+            $this->_plugin_info = array();
+            $this->_plugins_code = $plugins_code;
+        }
+
+        if ($this->_init_smarty_vars) {
+            $template_header .= "<?php require_once(SMARTY_CORE_DIR . 'core.assign_smarty_interface.php');\nsmarty_core_assign_smarty_interface(null, \$this); ?>\n";
+            $this->_init_smarty_vars = false;
+        }
+
+        $compiled_content = $template_header . $compiled_content;
+        return true;
+    }
+
+    /**
+     * Compile a template tag
+     *
+     * @param string $template_tag
+     * @return string
+     */
+    function _compile_tag($template_tag)
+    {
+        /* Matched comment. */
+        if (substr($template_tag, 0, 1) == '*' && substr($template_tag, -1) == '*')
+            return '';
+        
+        /* Split tag into two three parts: command, command modifiers and the arguments. */
+        if(! preg_match('~^(?:(' . $this->_num_const_regexp . '|' . $this->_obj_call_regexp . '|' . $this->_var_regexp
+                . '|\/?' . $this->_reg_obj_regexp . '|\/?' . $this->_func_regexp . ')(' . $this->_mod_regexp . '*))
+                      (?:\s+(.*))?$
+                    ~xs', $template_tag, $match)) {
+            $this->_syntax_error("unrecognized tag: $template_tag", E_USER_ERROR, __FILE__, __LINE__);
+        }
+        
+        $tag_command = $match[1];
+        $tag_modifier = isset($match[2]) ? $match[2] : null;
+        $tag_args = isset($match[3]) ? $match[3] : null;
+
+        if (preg_match('~^' . $this->_num_const_regexp . '|' . $this->_obj_call_regexp . '|' . $this->_var_regexp . '$~', $tag_command)) {
+            /* tag name is a variable or object */
+            $_return = $this->_parse_var_props($tag_command . $tag_modifier);
+            return "<?php echo $_return; ?>" . $this->_additional_newline;
+        }
+
+        /* If the tag name is a registered object, we process it. */
+        if (preg_match('~^\/?' . $this->_reg_obj_regexp . '$~', $tag_command)) {
+            return $this->_compile_registered_object_tag($tag_command, $this->_parse_attrs($tag_args), $tag_modifier);
+        }
+
+        switch ($tag_command) {
+            case 'include':
+                return $this->_compile_include_tag($tag_args);
+
+            case 'include_php':
+                return $this->_compile_include_php_tag($tag_args);
+
+            case 'if':
+                $this->_push_tag('if');
+                return $this->_compile_if_tag($tag_args);
+
+            case 'else':
+                list($_open_tag) = end($this->_tag_stack);
+                if ($_open_tag != 'if' && $_open_tag != 'elseif')
+                    $this->_syntax_error('unexpected {else}', E_USER_ERROR, __FILE__, __LINE__);
+                else
+                    $this->_push_tag('else');
+                return '<?php else: ?>';
+
+            case 'elseif':
+                list($_open_tag) = end($this->_tag_stack);
+                if ($_open_tag != 'if' && $_open_tag != 'elseif')
+                    $this->_syntax_error('unexpected {elseif}', E_USER_ERROR, __FILE__, __LINE__);
+                if ($_open_tag == 'if')
+                    $this->_push_tag('elseif');
+                return $this->_compile_if_tag($tag_args, true);
+
+            case '/if':
+                $this->_pop_tag('if');
+                return '<?php endif; ?>';
+
+            case 'capture':
+                return $this->_compile_capture_tag(true, $tag_args);
+
+            case '/capture':
+                return $this->_compile_capture_tag(false);
+
+            case 'ldelim':
+                return $this->left_delimiter;
+
+            case 'rdelim':
+                return $this->right_delimiter;
+
+            case 'section':
+                $this->_push_tag('section');
+                return $this->_compile_section_start($tag_args);
+
+            case 'sectionelse':
+                $this->_push_tag('sectionelse');
+                return "<?php endfor; else: ?>";
+                break;
+
+            case '/section':
+                $_open_tag = $this->_pop_tag('section');
+                if ($_open_tag == 'sectionelse')
+                    return "<?php endif; ?>";
+                else
+                    return "<?php endfor; endif; ?>";
+
+            case 'foreach':
+                $this->_push_tag('foreach');
+                return $this->_compile_foreach_start($tag_args);
+                break;
+
+            case 'foreachelse':
+                $this->_push_tag('foreachelse');
+                return "<?php endforeach; else: ?>";
+
+            case '/foreach':
+                $_open_tag = $this->_pop_tag('foreach');
+                if ($_open_tag == 'foreachelse')
+                    return "<?php endif; unset(\$_from); ?>";
+                else
+                    return "<?php endforeach; endif; unset(\$_from); ?>";
+                break;
+
+            case 'strip':
+            case '/strip':
+                if (substr($tag_command, 0, 1)=='/') {
+                    $this->_pop_tag('strip');
+                    if (--$this->_strip_depth==0) { /* outermost closing {/strip} */
+                        $this->_additional_newline = "\n";
+                        return '{' . $tag_command . '}';
+                    }
+                } else {
+                    $this->_push_tag('strip');
+                    if ($this->_strip_depth++==0) { /* outermost opening {strip} */
+                        $this->_additional_newline = "";
+                        return '{' . $tag_command . '}';
+                    }
+                }
+                return '';
+
+            case 'php':
+                /* handle folded tags replaced by {php} */
+                list(, $block) = each($this->_folded_blocks);
+                $this->_current_line_no += substr_count($block[0], "\n");
+                /* the number of matched elements in the regexp in _compile_file()
+                   determins the type of folded tag that was found */
+                switch (count($block)) {
+                    case 2: /* comment */
+                        return '';
+
+                    case 3: /* literal */
+                        return "<?php echo '" . strtr($block[2], array("'"=>"\'", "\\"=>"\\\\")) . "'; ?>" . $this->_additional_newline;
+
+                    case 4: /* php */
+                        if ($this->security && !$this->security_settings['PHP_TAGS']) {
+                            $this->_syntax_error("(secure mode) php tags not permitted", E_USER_WARNING, __FILE__, __LINE__);
+                            return;
+                        }
+                        return '<?php ' . $block[3] .' ?>';
+                }
+                break;
+
+            case 'insert':
+                return $this->_compile_insert_tag($tag_args);
+
+            default:
+                if ($this->_compile_compiler_tag($tag_command, $tag_args, $output)) {
+                    return $output;
+                } else if ($this->_compile_block_tag($tag_command, $tag_args, $tag_modifier, $output)) {
+                    return $output;
+                } else if ($this->_compile_custom_tag($tag_command, $tag_args, $tag_modifier, $output)) {
+                    return $output;                    
+                } else {
+                    $this->_syntax_error("unrecognized tag '$tag_command'", E_USER_ERROR, __FILE__, __LINE__);
+                }
+
+        }
+    }
+
+
+    /**
+     * compile the custom compiler tag
+     *
+     * sets $output to the compiled custom compiler tag
+     * @param string $tag_command
+     * @param string $tag_args
+     * @param string $output
+     * @return boolean
+     */
+    function _compile_compiler_tag($tag_command, $tag_args, &$output)
+    {
+        $found = false;
+        $have_function = true;
+
+        /*
+         * First we check if the compiler function has already been registered
+         * or loaded from a plugin file.
+         */
+        if (isset($this->_plugins['compiler'][$tag_command])) {
+            $found = true;
+            $plugin_func = $this->_plugins['compiler'][$tag_command][0];
+            if (!is_callable($plugin_func)) {
+                $message = "compiler function '$tag_command' is not implemented";
+                $have_function = false;
+            }
+        }
+        /*
+         * Otherwise we need to load plugin file and look for the function
+         * inside it.
+         */
+        else if ($plugin_file = $this->_get_plugin_filepath('compiler', $tag_command)) {
+            $found = true;
+
+            include_once $plugin_file;
+
+            $plugin_func = 'smarty_compiler_' . $tag_command;
+            if (!is_callable($plugin_func)) {
+                $message = "plugin function $plugin_func() not found in $plugin_file\n";
+                $have_function = false;
+            } else {
+                $this->_plugins['compiler'][$tag_command] = array($plugin_func, null, null, null, true);
+            }
+        }
+
+        /*
+         * True return value means that we either found a plugin or a
+         * dynamically registered function. False means that we didn't and the
+         * compiler should now emit code to load custom function plugin for this
+         * tag.
+         */
+        if ($found) {
+            if ($have_function) {
+                $output = call_user_func_array($plugin_func, array($tag_args, &$this));
+                if($output != '') {
+                $output = '<?php ' . $this->_push_cacheable_state('compiler', $tag_command)
+                                   . $output
+                                   . $this->_pop_cacheable_state('compiler', $tag_command) . ' ?>';
+                }
+            } else {
+                $this->_syntax_error($message, E_USER_WARNING, __FILE__, __LINE__);
+            }
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+
+    /**
+     * compile block function tag
+     *
+     * sets $output to compiled block function tag
+     * @param string $tag_command
+     * @param string $tag_args
+     * @param string $tag_modifier
+     * @param string $output
+     * @return boolean
+     */
+    function _compile_block_tag($tag_command, $tag_args, $tag_modifier, &$output)
+    {
+        if (substr($tag_command, 0, 1) == '/') {
+            $start_tag = false;
+            $tag_command = substr($tag_command, 1);
+        } else
+            $start_tag = true;
+
+        $found = false;
+        $have_function = true;
+
+        /*
+         * First we check if the block function has already been registered
+         * or loaded from a plugin file.
+         */
+        if (isset($this->_plugins['block'][$tag_command])) {
+            $found = true;
+            $plugin_func = $this->_plugins['block'][$tag_command][0];
+            if (!is_callable($plugin_func)) {
+                $message = "block function '$tag_command' is not implemented";
+                $have_function = false;
+            }
+        }
+        /*
+         * Otherwise we need to load plugin file and look for the function
+         * inside it.
+         */
+        else if ($plugin_file = $this->_get_plugin_filepath('block', $tag_command)) {
+            $found = true;
+
+            include_once $plugin_file;
+
+            $plugin_func = 'smarty_block_' . $tag_command;
+            if (!function_exists($plugin_func)) {
+                $message = "plugin function $plugin_func() not found in $plugin_file\n";
+                $have_function = false;
+            } else {
+                $this->_plugins['block'][$tag_command] = array($plugin_func, null, null, null, true);
+
+            }
+        }
+
+        if (!$found) {
+            return false;
+        } else if (!$have_function) {
+            $this->_syntax_error($message, E_USER_WARNING, __FILE__, __LINE__);
+            return true;
+        }
+
+        /*
+         * Even though we've located the plugin function, compilation
+         * happens only once, so the plugin will still need to be loaded
+         * at runtime for future requests.
+         */
+        $this->_add_plugin('block', $tag_command);
+
+        if ($start_tag)
+            $this->_push_tag($tag_command);
+        else
+            $this->_pop_tag($tag_command);
+
+        if ($start_tag) {
+            $output = '<?php ' . $this->_push_cacheable_state('block', $tag_command);
+            $attrs = $this->_parse_attrs($tag_args);
+            $_cache_attrs='';
+            $arg_list = $this->_compile_arg_list('block', $tag_command, $attrs, $_cache_attrs);
+            $output .= "$_cache_attrs\$this->_tag_stack[] = array('$tag_command', array(".implode(',', $arg_list).')); ';
+            $output .= '$_block_repeat=true;' . $this->_compile_plugin_call('block', $tag_command).'($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);';
+            $output .= 'while ($_block_repeat) { ob_start(); ?>';
+        } else {
+            $output = '<?php $_block_content = ob_get_contents(); ob_end_clean(); ';
+            $_out_tag_text = $this->_compile_plugin_call('block', $tag_command).'($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat)';
+            if ($tag_modifier != '') {
+                $this->_parse_modifiers($_out_tag_text, $tag_modifier);
+            }
+            $output .= '$_block_repeat=false;echo ' . $_out_tag_text . '; } ';
+            $output .= " array_pop(\$this->_tag_stack); " . $this->_pop_cacheable_state('block', $tag_command) . '?>';
+        }
+
+        return true;
+    }
+
+
+    /**
+     * compile custom function tag
+     *
+     * @param string $tag_command
+     * @param string $tag_args
+     * @param string $tag_modifier
+     * @return string
+     */
+    function _compile_custom_tag($tag_command, $tag_args, $tag_modifier, &$output)
+    {
+        $found = false;
+        $have_function = true;
+
+        /*
+         * First we check if the custom function has already been registered
+         * or loaded from a plugin file.
+         */
+        if (isset($this->_plugins['function'][$tag_command])) {
+            $found = true;
+            $plugin_func = $this->_plugins['function'][$tag_command][0];
+            if (!is_callable($plugin_func)) {
+                $message = "custom function '$tag_command' is not implemented";
+                $have_function = false;
+            }
+        }
+        /*
+         * Otherwise we need to load plugin file and look for the function
+         * inside it.
+         */
+        else if ($plugin_file = $this->_get_plugin_filepath('function', $tag_command)) {
+            $found = true;
+
+            include_once $plugin_file;
+
+            $plugin_func = 'smarty_function_' . $tag_command;
+            if (!function_exists($plugin_func)) {
+                $message = "plugin function $plugin_func() not found in $plugin_file\n";
+                $have_function = false;
+            } else {
+                $this->_plugins['function'][$tag_command] = array($plugin_func, null, null, null, true);
+
+            }
+        }
+
+        if (!$found) {
+            return false;
+        } else if (!$have_function) {
+            $this->_syntax_error($message, E_USER_WARNING, __FILE__, __LINE__);
+            return true;
+        }
+
+        /* declare plugin to be loaded on display of the template that
+           we compile right now */
+        $this->_add_plugin('function', $tag_command);
+
+        $_cacheable_state = $this->_push_cacheable_state('function', $tag_command);
+        $attrs = $this->_parse_attrs($tag_args);
+        $_cache_attrs = '';
+        $arg_list = $this->_compile_arg_list('function', $tag_command, $attrs, $_cache_attrs);
+
+        $output = $this->_compile_plugin_call('function', $tag_command).'(array('.implode(',', $arg_list)."), \$this)";
+        if($tag_modifier != '') {
+            $this->_parse_modifiers($output, $tag_modifier);
+        }
+
+        if($output != '') {
+            $output =  '<?php ' . $_cacheable_state . $_cache_attrs . 'echo ' . $output . ';'
+                . $this->_pop_cacheable_state('function', $tag_command) . "?>" . $this->_additional_newline;
+        }
+
+        return true;
+    }
+
+    /**
+     * compile a registered object tag
+     *
+     * @param string $tag_command
+     * @param array $attrs
+     * @param string $tag_modifier
+     * @return string
+     */
+    function _compile_registered_object_tag($tag_command, $attrs, $tag_modifier)
+    {
+        if (substr($tag_command, 0, 1) == '/') {
+            $start_tag = false;
+            $tag_command = substr($tag_command, 1);
+        } else {
+            $start_tag = true;
+        }
+
+        list($object, $obj_comp) = explode('->', $tag_command);
+
+        $arg_list = array();
+        if(count($attrs)) {
+            $_assign_var = false;
+            foreach ($attrs as $arg_name => $arg_value) {
+                if($arg_name == 'assign') {
+                    $_assign_var = $arg_value;
+                    unset($attrs['assign']);
+                    continue;
+                }
+                if (is_bool($arg_value))
+                    $arg_value = $arg_value ? 'true' : 'false';
+                $arg_list[] = "'$arg_name' => $arg_value";
+            }
+        }
+
+        if($this->_reg_objects[$object][2]) {
+            // smarty object argument format
+            $args = "array(".implode(',', (array)$arg_list)."), \$this";
+        } else {
+            // traditional argument format
+            $args = implode(',', array_values($attrs));
+            if (empty($args)) {
+                $args = 'null';
+            }
+        }
+
+        $prefix = '';
+        $postfix = '';
+        $newline = '';
+        if(!is_object($this->_reg_objects[$object][0])) {
+            $this->_trigger_fatal_error("registered '$object' is not an object" , $this->_current_file, $this->_current_line_no, __FILE__, __LINE__);
+        } elseif(!empty($this->_reg_objects[$object][1]) && !in_array($obj_comp, $this->_reg_objects[$object][1])) {
+            $this->_trigger_fatal_error("'$obj_comp' is not a registered component of object '$object'", $this->_current_file, $this->_current_line_no, __FILE__, __LINE__);
+        } elseif(method_exists($this->_reg_objects[$object][0], $obj_comp)) {
+            // method
+            if(in_array($obj_comp, $this->_reg_objects[$object][3])) {
+                // block method
+                if ($start_tag) {
+                    $prefix = "\$this->_tag_stack[] = array('$obj_comp', $args); ";
+                    $prefix .= "\$_block_repeat=true; \$this->_reg_objects['$object'][0]->$obj_comp(\$this->_tag_stack[count(\$this->_tag_stack)-1][1], null, \$this, \$_block_repeat); ";
+                    $prefix .= "while (\$_block_repeat) { ob_start();";
+                    $return = null;
+                    $postfix = '';
+            } else {
+                    $prefix = "\$_obj_block_content = ob_get_contents(); ob_end_clean(); ";
+                    $return = "\$_block_repeat=false; \$this->_reg_objects['$object'][0]->$obj_comp(\$this->_tag_stack[count(\$this->_tag_stack)-1][1], \$_obj_block_content, \$this, \$_block_repeat)";
+                    $postfix = "} array_pop(\$this->_tag_stack);";
+                }
+            } else {
+                // non-block method
+                $return = "\$this->_reg_objects['$object'][0]->$obj_comp($args)";
+            }
+        } else {
+            // property
+            $return = "\$this->_reg_objects['$object'][0]->$obj_comp";
+        }
+
+        if($return != null) {
+            if($tag_modifier != '') {
+                $this->_parse_modifiers($return, $tag_modifier);
+            }
+
+            if(!empty($_assign_var)) {
+                $output = "\$this->assign('" . $this->_dequote($_assign_var) ."',  $return);";
+            } else {
+                $output = 'echo ' . $return . ';';
+                $newline = $this->_additional_newline;
+            }
+        } else {
+            $output = '';
+        }
+
+        return '<?php ' . $prefix . $output . $postfix . "?>" . $newline;
+    }
+
+    /**
+     * Compile {insert ...} tag
+     *
+     * @param string $tag_args
+     * @return string
+     */
+    function _compile_insert_tag($tag_args)
+    {
+        $attrs = $this->_parse_attrs($tag_args);
+        $name = $this->_dequote($attrs['name']);
+
+        if (empty($name)) {
+            $this->_syntax_error("missing insert name", E_USER_ERROR, __FILE__, __LINE__);
+        }
+
+        if (!empty($attrs['script'])) {
+            $delayed_loading = true;
+        } else {
+            $delayed_loading = false;
+        }
+
+        foreach ($attrs as $arg_name => $arg_value) {
+            if (is_bool($arg_value))
+                $arg_value = $arg_value ? 'true' : 'false';
+            $arg_list[] = "'$arg_name' => $arg_value";
+        }
+
+        $this->_add_plugin('insert', $name, $delayed_loading);
+
+        $_params = "array('args' => array(".implode(', ', (array)$arg_list)."))";
+
+        return "<?php require_once(SMARTY_CORE_DIR . 'core.run_insert_handler.php');\necho smarty_core_run_insert_handler($_params, \$this); ?>" . $this->_additional_newline;
+    }
+
+    /**
+     * Compile {include ...} tag
+     *
+     * @param string $tag_args
+     * @return string
+     */
+    function _compile_include_tag($tag_args)
+    {
+        $attrs = $this->_parse_attrs($tag_args);
+        $arg_list = array();
+
+        if (empty($attrs['file'])) {
+            $this->_syntax_error("missing 'file' attribute in include tag", E_USER_ERROR, __FILE__, __LINE__);
+        }
+
+        foreach ($attrs as $arg_name => $arg_value) {
+            if ($arg_name == 'file') {
+                $include_file = $arg_value;
+                continue;
+            } else if ($arg_name == 'assign') {
+                $assign_var = $arg_value;
+                continue;
+            }
+            if (is_bool($arg_value))
+                $arg_value = $arg_value ? 'true' : 'false';
+            $arg_list[] = "'$arg_name' => $arg_value";
+        }
+
+        $output = '<?php ';
+
+        if (isset($assign_var)) {
+            $output .= "ob_start();\n";
+        }
+
+        $output .=
+            "\$_smarty_tpl_vars = \$this->_tpl_vars;\n";
+
+
+        $_params = "array('smarty_include_tpl_file' => " . $include_file . ", 'smarty_include_vars' => array(".implode(',', (array)$arg_list)."))";
+        $output .= "\$this->_smarty_include($_params);\n" .
+        "\$this->_tpl_vars = \$_smarty_tpl_vars;\n" .
+        "unset(\$_smarty_tpl_vars);\n";
+
+        if (isset($assign_var)) {
+            $output .= "\$this->assign(" . $assign_var . ", ob_get_contents()); ob_end_clean();\n";
+        }
+
+        $output .= ' ?>';
+
+        return $output;
+
+    }
+
+    /**
+     * Compile {include ...} tag
+     *
+     * @param string $tag_args
+     * @return string
+     */
+    function _compile_include_php_tag($tag_args)
+    {
+        $attrs = $this->_parse_attrs($tag_args);
+
+        if (empty($attrs['file'])) {
+            $this->_syntax_error("missing 'file' attribute in include_php tag", E_USER_ERROR, __FILE__, __LINE__);
+        }
+
+        $assign_var = (empty($attrs['assign'])) ? '' : $this->_dequote($attrs['assign']);
+        $once_var = (empty($attrs['once']) || $attrs['once']=='false') ? 'false' : 'true';
+
+        $arg_list = array();
+        foreach($attrs as $arg_name => $arg_value) {
+            if($arg_name != 'file' AND $arg_name != 'once' AND $arg_name != 'assign') {
+                if(is_bool($arg_value))
+                    $arg_value = $arg_value ? 'true' : 'false';
+                $arg_list[] = "'$arg_name' => $arg_value";
+            }
+        }
+
+        $_params = "array('smarty_file' => " . $attrs['file'] . ", 'smarty_assign' => '$assign_var', 'smarty_once' => $once_var, 'smarty_include_vars' => array(".implode(',', $arg_list)."))";
+
+        return "<?php require_once(SMARTY_CORE_DIR . 'core.smarty_include_php.php');\nsmarty_core_smarty_include_php($_params, \$this); ?>" . $this->_additional_newline;
+    }
+
+
+    /**
+     * Compile {section ...} tag
+     *
+     * @param string $tag_args
+     * @return string
+     */
+    function _compile_section_start($tag_args)
+    {
+        $attrs = $this->_parse_attrs($tag_args);
+        $arg_list = array();
+
+        $output = '<?php ';
+        $section_name = $attrs['name'];
+        if (empty($section_name)) {
+            $this->_syntax_error("missing section name", E_USER_ERROR, __FILE__, __LINE__);
+        }
+
+        $output .= "unset(\$this->_sections[$section_name]);\n";
+        $section_props = "\$this->_sections[$section_name]";
+
+        foreach ($attrs as $attr_name => $attr_value) {
+            switch ($attr_name) {
+                case 'loop':
+                    $output .= "{$section_props}['loop'] = is_array(\$_loop=$attr_value) ? count(\$_loop) : max(0, (int)\$_loop); unset(\$_loop);\n";
+                    break;
+
+                case 'show':
+                    if (is_bool($attr_value))
+                        $show_attr_value = $attr_value ? 'true' : 'false';
+                    else
+                        $show_attr_value = "(bool)$attr_value";
+                    $output .= "{$section_props}['show'] = $show_attr_value;\n";
+                    break;
+
+                case 'name':
+                    $output .= "{$section_props}['$attr_name'] = $attr_value;\n";
+                    break;
+
+                case 'max':
+                case 'start':
+                    $output .= "{$section_props}['$attr_name'] = (int)$attr_value;\n";
+                    break;
+
+                case 'step':
+                    $output .= "{$section_props}['$attr_name'] = ((int)$attr_value) == 0 ? 1 : (int)$attr_value;\n";
+                    break;
+
+                default:
+                    $this->_syntax_error("unknown section attribute - '$attr_name'", E_USER_ERROR, __FILE__, __LINE__);
+                    break;
+            }
+        }
+
+        if (!isset($attrs['show']))
+            $output .= "{$section_props}['show'] = true;\n";
+
+        if (!isset($attrs['loop']))
+            $output .= "{$section_props}['loop'] = 1;\n";
+
+        if (!isset($attrs['max']))
+            $output .= "{$section_props}['max'] = {$section_props}['loop'];\n";
+        else
+            $output .= "if ({$section_props}['max'] < 0)\n" .
+                       "    {$section_props}['max'] = {$section_props}['loop'];\n";
+
+        if (!isset($attrs['step']))
+            $output .= "{$section_props}['step'] = 1;\n";
+
+        if (!isset($attrs['start']))
+            $output .= "{$section_props}['start'] = {$section_props}['step'] > 0 ? 0 : {$section_props}['loop']-1;\n";
+        else {
+            $output .= "if ({$section_props}['start'] < 0)\n" .
+                       "    {$section_props}['start'] = max({$section_props}['step'] > 0 ? 0 : -1, {$section_props}['loop'] + {$section_props}['start']);\n" .
+                       "else\n" .
+                       "    {$section_props}['start'] = min({$section_props}['start'], {$section_props}['step'] > 0 ? {$section_props}['loop'] : {$section_props}['loop']-1);\n";
+        }
+
+        $output .= "if ({$section_props}['show']) {\n";
+        if (!isset($attrs['start']) && !isset($attrs['step']) && !isset($attrs['max'])) {
+            $output .= "    {$section_props}['total'] = {$section_props}['loop'];\n";
+        } else {
+            $output .= "    {$section_props}['total'] = min(ceil(({$section_props}['step'] > 0 ? {$section_props}['loop'] - {$section_props}['start'] : {$section_props}['start']+1)/abs({$section_props}['step'])), {$section_props}['max']);\n";
+        }
+        $output .= "    if ({$section_props}['total'] == 0)\n" .
+                   "        {$section_props}['show'] = false;\n" .
+                   "} else\n" .
+                   "    {$section_props}['total'] = 0;\n";
+
+        $output .= "if ({$section_props}['show']):\n";
+        $output .= "
+            for ({$section_props}['index'] = {$section_props}['start'], {$section_props}['iteration'] = 1;
+                 {$section_props}['iteration'] <= {$section_props}['total'];
+                 {$section_props}['index'] += {$section_props}['step'], {$section_props}['iteration']++):\n";
+        $output .= "{$section_props}['rownum'] = {$section_props}['iteration'];\n";
+        $output .= "{$section_props}['index_prev'] = {$section_props}['index'] - {$section_props}['step'];\n";
+        $output .= "{$section_props}['index_next'] = {$section_props}['index'] + {$section_props}['step'];\n";
+        $output .= "{$section_props}['first']      = ({$section_props}['iteration'] == 1);\n";
+        $output .= "{$section_props}['last']       = ({$section_props}['iteration'] == {$section_props}['total']);\n";
+
+        $output .= "?>";
+
+        return $output;
+    }
+
+
+    /**
+     * Compile {foreach ...} tag.
+     *
+     * @param string $tag_args
+     * @return string
+     */
+    function _compile_foreach_start($tag_args)
+    {
+        $attrs = $this->_parse_attrs($tag_args);
+        $arg_list = array();
+
+        if (empty($attrs['from'])) {
+            return $this->_syntax_error("foreach: missing 'from' attribute", E_USER_ERROR, __FILE__, __LINE__);
+        }
+        $from = $attrs['from'];
+
+        if (empty($attrs['item'])) {
+            return $this->_syntax_error("foreach: missing 'item' attribute", E_USER_ERROR, __FILE__, __LINE__);
+        }
+        $item = $this->_dequote($attrs['item']);
+        if (!preg_match('~^\w+$~', $item)) {
+            return $this->_syntax_error("'foreach: item' must be a variable name (literal string)", E_USER_ERROR, __FILE__, __LINE__);
+        }
+
+        if (isset($attrs['key'])) {
+            $key  = $this->_dequote($attrs['key']);
+            if (!preg_match('~^\w+$~', $key)) {
+                return $this->_syntax_error("foreach: 'key' must to be a variable name (literal string)", E_USER_ERROR, __FILE__, __LINE__);
+            }
+            $key_part = "\$this->_tpl_vars['$key'] => ";
+        } else {
+            $key = null;
+            $key_part = '';
+        }
+
+        if (isset($attrs['name'])) {
+            $name = $attrs['name'];
+        } else {
+            $name = null;
+        }
+
+        $output = '<?php ';
+        $output .= "\$_from = $from; if (!is_array(\$_from) && !is_object(\$_from)) { settype(\$_from, 'array'); }";
+        if (isset($name)) {
+            $foreach_props = "\$this->_foreach[$name]";
+            $output .= "{$foreach_props} = array('total' => count(\$_from), 'iteration' => 0);\n";
+            $output .= "if ({$foreach_props}['total'] > 0):\n";
+            $output .= "    foreach (\$_from as $key_part\$this->_tpl_vars['$item']):\n";
+            $output .= "        {$foreach_props}['iteration']++;\n";
+        } else {
+            $output .= "if (count(\$_from)):\n";
+            $output .= "    foreach (\$_from as $key_part\$this->_tpl_vars['$item']):\n";
+        }
+        $output .= '?>';
+
+        return $output;
+    }
+
+
+    /**
+     * Compile {capture} .. {/capture} tags
+     *
+     * @param boolean $start true if this is the {capture} tag
+     * @param string $tag_args
+     * @return string
+     */
+
+    function _compile_capture_tag($start, $tag_args = '')
+    {
+        $attrs = $this->_parse_attrs($tag_args);
+
+        if ($start) {
+            if (isset($attrs['name']))
+                $buffer = $attrs['name'];
+            else
+                $buffer = "'default'";
+
+            if (isset($attrs['assign']))
+                $assign = $attrs['assign'];
+            else
+                $assign = null;
+            $output = "<?php ob_start(); ?>";
+            $this->_capture_stack[] = array($buffer, $assign);
+        } else {
+            list($buffer, $assign) = array_pop($this->_capture_stack);
+            $output = "<?php \$this->_smarty_vars['capture'][$buffer] = ob_get_contents(); ";
+            if (isset($assign)) {
+                $output .= " \$this->assign($assign, ob_get_contents());";
+            }
+            $output .= "ob_end_clean(); ?>";
+        }
+
+        return $output;
+    }
+
+    /**
+     * Compile {if ...} tag
+     *
+     * @param string $tag_args
+     * @param boolean $elseif if true, uses elseif instead of if
+     * @return string
+     */
+    function _compile_if_tag($tag_args, $elseif = false)
+    {
+
+        /* Tokenize args for 'if' tag. */
+        preg_match_all('~(?>
+                ' . $this->_obj_call_regexp . '(?:' . $this->_mod_regexp . '*)? | # valid object call
+                ' . $this->_var_regexp . '(?:' . $this->_mod_regexp . '*)?    | # var or quoted string
+                \-?0[xX][0-9a-fA-F]+|\-?\d+(?:\.\d+)?|\.\d+|!==|===|==|!=|<>|<<|>>|<=|>=|\&\&|\|\||\(|\)|,|\!|\^|=|\&|\~|<|>|\||\%|\+|\-|\/|\*|\@    | # valid non-word token
+                \b\w+\b                                                        | # valid word token
+                \S+                                                           # anything else
+                )~x', $tag_args, $match);
+
+        $tokens = $match[0];
+
+        if(empty($tokens)) {
+            $_error_msg .= $elseif ? "'elseif'" : "'if'";
+            $_error_msg .= ' statement requires arguments'; 
+            $this->_syntax_error($_error_msg, E_USER_ERROR, __FILE__, __LINE__);
+        }
+            
+                
+        // make sure we have balanced parenthesis
+        $token_count = array_count_values($tokens);
+        if(isset($token_count['(']) && $token_count['('] != $token_count[')']) {
+            $this->_syntax_error("unbalanced parenthesis in if statement", E_USER_ERROR, __FILE__, __LINE__);
+        }
+
+        $is_arg_stack = array();
+
+        for ($i = 0; $i < count($tokens); $i++) {
+
+            $token = &$tokens[$i];
+
+            switch (strtolower($token)) {
+                case '!':
+                case '%':
+                case '!==':
+                case '==':
+                case '===':
+                case '>':
+                case '<':
+                case '!=':
+                case '<>':
+                case '<<':
+                case '>>':
+                case '<=':
+                case '>=':
+                case '&&':
+                case '||':
+                case '|':
+                case '^':
+                case '&':
+                case '~':
+                case ')':
+                case ',':
+                case '+':
+                case '-':
+                case '*':
+                case '/':
+                case '@':
+                    break;
+
+                case 'eq':
+                    $token = '==';
+                    break;
+
+                case 'ne':
+                case 'neq':
+                    $token = '!=';
+                    break;
+
+                case 'lt':
+                    $token = '<';
+                    break;
+
+                case 'le':
+                case 'lte':
+                    $token = '<=';
+                    break;
+
+                case 'gt':
+                    $token = '>';
+                    break;
+
+                case 'ge':
+                case 'gte':
+                    $token = '>=';
+                    break;
+
+                case 'and':
+                    $token = '&&';
+                    break;
+
+                case 'or':
+                    $token = '||';
+                    break;
+
+                case 'not':
+                    $token = '!';
+                    break;
+
+                case 'mod':
+                    $token = '%';
+                    break;
+
+                case '(':
+                    array_push($is_arg_stack, $i);
+                    break;
+
+                case 'is':
+                    /* If last token was a ')', we operate on the parenthesized
+                       expression. The start of the expression is on the stack.
+                       Otherwise, we operate on the last encountered token. */
+                    if ($tokens[$i-1] == ')')
+                        $is_arg_start = array_pop($is_arg_stack);
+                    else
+                        $is_arg_start = $i-1;
+                    /* Construct the argument for 'is' expression, so it knows
+                       what to operate on. */
+                    $is_arg = implode(' ', array_slice($tokens, $is_arg_start, $i - $is_arg_start));
+
+                    /* Pass all tokens from next one until the end to the
+                       'is' expression parsing function. The function will
+                       return modified tokens, where the first one is the result
+                       of the 'is' expression and the rest are the tokens it
+                       didn't touch. */
+                    $new_tokens = $this->_parse_is_expr($is_arg, array_slice($tokens, $i+1));
+
+                    /* Replace the old tokens with the new ones. */
+                    array_splice($tokens, $is_arg_start, count($tokens), $new_tokens);
+
+                    /* Adjust argument start so that it won't change from the
+                       current position for the next iteration. */
+                    $i = $is_arg_start;
+                    break;
+
+                default:
+                    if(preg_match('~^' . $this->_func_regexp . '$~', $token) ) {
+                            // function call
+                            if($this->security &&
+                               !in_array($token, $this->security_settings['IF_FUNCS'])) {
+                                $this->_syntax_error("(secure mode) '$token' not allowed in if statement", E_USER_ERROR, __FILE__, __LINE__);
+                            }
+                    } elseif(preg_match('~^' . $this->_var_regexp . '$~', $token) && (strpos('+-*/^%&|', substr($token, -1)) === false) && isset($tokens[$i+1]) && $tokens[$i+1] == '(') {
+                        // variable function call
+                        $this->_syntax_error("variable function call '$token' not allowed in if statement", E_USER_ERROR, __FILE__, __LINE__);                      
+                    } elseif(preg_match('~^' . $this->_obj_call_regexp . '|' . $this->_var_regexp . '(?:' . $this->_mod_regexp . '*)$~', $token)) {
+                        // object or variable
+                        $token = $this->_parse_var_props($token);
+                    } elseif(is_numeric($token)) {
+                        // number, skip it
+                    } else {
+                        $this->_syntax_error("unidentified token '$token'", E_USER_ERROR, __FILE__, __LINE__);
+                    }
+                    break;
+            }
+        }
+
+        if ($elseif)
+            return '<?php elseif ('.implode(' ', $tokens).'): ?>';
+        else
+            return '<?php if ('.implode(' ', $tokens).'): ?>';
+    }
+
+
+    function _compile_arg_list($type, $name, $attrs, &$cache_code) {
+        $arg_list = array();
+
+        if (isset($type) && isset($name)
+            && isset($this->_plugins[$type])
+            && isset($this->_plugins[$type][$name])
+            && empty($this->_plugins[$type][$name][4])
+            && is_array($this->_plugins[$type][$name][5])
+            ) {
+            /* we have a list of parameters that should be cached */
+            $_cache_attrs = $this->_plugins[$type][$name][5];
+            $_count = $this->_cache_attrs_count++;
+            $cache_code = "\$_cache_attrs =& \$this->_smarty_cache_attrs('$this->_cache_serial','$_count');";
+
+        } else {
+            /* no parameters are cached */
+            $_cache_attrs = null;
+        }
+
+        foreach ($attrs as $arg_name => $arg_value) {
+            if (is_bool($arg_value))
+                $arg_value = $arg_value ? 'true' : 'false';
+            if (is_null($arg_value))
+                $arg_value = 'null';
+            if ($_cache_attrs && in_array($arg_name, $_cache_attrs)) {
+                $arg_list[] = "'$arg_name' => (\$this->_cache_including) ? \$_cache_attrs['$arg_name'] : (\$_cache_attrs['$arg_name']=$arg_value)";
+            } else {
+                $arg_list[] = "'$arg_name' => $arg_value";
+            }
+        }
+        return $arg_list;
+    }
+
+    /**
+     * Parse is expression
+     *
+     * @param string $is_arg
+     * @param array $tokens
+     * @return array
+     */
+    function _parse_is_expr($is_arg, $tokens)
+    {
+        $expr_end = 0;
+        $negate_expr = false;
+
+        if (($first_token = array_shift($tokens)) == 'not') {
+            $negate_expr = true;
+            $expr_type = array_shift($tokens);
+        } else
+            $expr_type = $first_token;
+
+        switch ($expr_type) {
+            case 'even':
+                if (isset($tokens[$expr_end]) && $tokens[$expr_end] == 'by') {
+                    $expr_end++;
+                    $expr_arg = $tokens[$expr_end++];
+                    $expr = "!(1 & ($is_arg / " . $this->_parse_var_props($expr_arg) . "))";
+                } else
+                    $expr = "!(1 & $is_arg)";
+                break;
+
+            case 'odd':
+                if (isset($tokens[$expr_end]) && $tokens[$expr_end] == 'by') {
+                    $expr_end++;
+                    $expr_arg = $tokens[$expr_end++];
+                    $expr = "(1 & ($is_arg / " . $this->_parse_var_props($expr_arg) . "))";
+                } else
+                    $expr = "(1 & $is_arg)";
+                break;
+
+            case 'div':
+                if (@$tokens[$expr_end] == 'by') {
+                    $expr_end++;
+                    $expr_arg = $tokens[$expr_end++];
+                    $expr = "!($is_arg % " . $this->_parse_var_props($expr_arg) . ")";
+                } else {
+                    $this->_syntax_error("expecting 'by' after 'div'", E_USER_ERROR, __FILE__, __LINE__);
+                }
+                break;
+
+            default:
+                $this->_syntax_error("unknown 'is' expression - '$expr_type'", E_USER_ERROR, __FILE__, __LINE__);
+                break;
+        }
+
+        if ($negate_expr) {
+            $expr = "!($expr)";
+        }
+
+        array_splice($tokens, 0, $expr_end, $expr);
+
+        return $tokens;
+    }
+
+
+    /**
+     * Parse attribute string
+     *
+     * @param string $tag_args
+     * @return array
+     */
+    function _parse_attrs($tag_args)
+    {
+
+        /* Tokenize tag attributes. */
+        preg_match_all('~(?:' . $this->_obj_call_regexp . '|' . $this->_qstr_regexp . ' | (?>[^"\'=\s]+)
+                         )+ |
+                         [=]
+                        ~x', $tag_args, $match);
+        $tokens       = $match[0];
+
+        $attrs = array();
+        /* Parse state:
+            0 - expecting attribute name
+            1 - expecting '='
+            2 - expecting attribute value (not '=') */
+        $state = 0;
+
+        foreach ($tokens as $token) {
+            switch ($state) {
+                case 0:
+                    /* If the token is a valid identifier, we set attribute name
+                       and go to state 1. */
+                    if (preg_match('~^\w+$~', $token)) {
+                        $attr_name = $token;
+                        $state = 1;
+                    } else
+                        $this->_syntax_error("invalid attribute name: '$token'", E_USER_ERROR, __FILE__, __LINE__);
+                    break;
+
+                case 1:
+                    /* If the token is '=', then we go to state 2. */
+                    if ($token == '=') {
+                        $state = 2;
+                    } else
+                        $this->_syntax_error("expecting '=' after attribute name '$last_token'", E_USER_ERROR, __FILE__, __LINE__);
+                    break;
+
+                case 2:
+                    /* If token is not '=', we set the attribute value and go to
+                       state 0. */
+                    if ($token != '=') {
+                        /* We booleanize the token if it's a non-quoted possible
+                           boolean value. */
+                        if (preg_match('~^(on|yes|true)$~', $token)) {
+                            $token = 'true';
+                        } else if (preg_match('~^(off|no|false)$~', $token)) {
+                            $token = 'false';
+                        } else if ($token == 'null') {
+                            $token = 'null';
+                        } else if (preg_match('~^' . $this->_num_const_regexp . '|0[xX][0-9a-fA-F]+$~', $token)) {
+                            /* treat integer literally */
+                        } else if (!preg_match('~^' . $this->_obj_call_regexp . '|' . $this->_var_regexp . '(?:' . $this->_mod_regexp . ')*$~', $token)) {
+                            /* treat as a string, double-quote it escaping quotes */
+                            $token = '"'.addslashes($token).'"';
+                        }
+
+                        $attrs[$attr_name] = $token;
+                        $state = 0;
+                    } else
+                        $this->_syntax_error("'=' cannot be an attribute value", E_USER_ERROR, __FILE__, __LINE__);
+                    break;
+            }
+            $last_token = $token;
+        }
+
+        if($state != 0) {
+            if($state == 1) {
+                $this->_syntax_error("expecting '=' after attribute name '$last_token'", E_USER_ERROR, __FILE__, __LINE__);
+            } else {
+                $this->_syntax_error("missing attribute value", E_USER_ERROR, __FILE__, __LINE__);
+            }
+        }
+
+        $this->_parse_vars_props($attrs);
+
+        return $attrs;
+    }
+
+    /**
+     * compile multiple variables and section properties tokens into
+     * PHP code
+     *
+     * @param array $tokens
+     */
+    function _parse_vars_props(&$tokens)
+    {
+        foreach($tokens as $key => $val) {
+            $tokens[$key] = $this->_parse_var_props($val);
+        }
+    }
+
+    /**
+     * compile single variable and section properties token into
+     * PHP code
+     *
+     * @param string $val
+     * @param string $tag_attrs
+     * @return string
+     */
+    function _parse_var_props($val)
+    {
+        $val = trim($val);
+
+        if(preg_match('~^(' . $this->_obj_call_regexp . '|' . $this->_dvar_regexp . ')(' . $this->_mod_regexp . '*)$~', $val, $match)) {
+            // $ variable or object
+            $return = $this->_parse_var($match[1]);
+            $modifiers = $match[2];
+            if (!empty($this->default_modifiers) && !preg_match('~(^|\|)smarty:nodefaults($|\|)~',$modifiers)) {
+                $_default_mod_string = implode('|',(array)$this->default_modifiers);
+                $modifiers = empty($modifiers) ? $_default_mod_string : $_default_mod_string . '|' . $modifiers;
+            }
+            $this->_parse_modifiers($return, $modifiers);
+            return $return;
+        } elseif (preg_match('~^' . $this->_db_qstr_regexp . '(?:' . $this->_mod_regexp . '*)$~', $val)) {
+                // double quoted text
+                preg_match('~^(' . $this->_db_qstr_regexp . ')('. $this->_mod_regexp . '*)$~', $val, $match);
+                $return = $this->_expand_quoted_text($match[1]);
+                if($match[2] != '') {
+                    $this->_parse_modifiers($return, $match[2]);
+                }
+                return $return;
+            }
+        elseif(preg_match('~^' . $this->_num_const_regexp . '(?:' . $this->_mod_regexp . '*)$~', $val)) {
+                // numerical constant
+                preg_match('~^(' . $this->_num_const_regexp . ')('. $this->_mod_regexp . '*)$~', $val, $match);
+                if($match[2] != '') {
+                    $this->_parse_modifiers($match[1], $match[2]);
+                    return $match[1];
+                }
+            }
+        elseif(preg_match('~^' . $this->_si_qstr_regexp . '(?:' . $this->_mod_regexp . '*)$~', $val)) {
+                // single quoted text
+                preg_match('~^(' . $this->_si_qstr_regexp . ')('. $this->_mod_regexp . '*)$~', $val, $match);
+                if($match[2] != '') {
+                    $this->_parse_modifiers($match[1], $match[2]);
+                    return $match[1];
+                }
+            }
+        elseif(preg_match('~^' . $this->_cvar_regexp . '(?:' . $this->_mod_regexp . '*)$~', $val)) {
+                // config var
+                return $this->_parse_conf_var($val);
+            }
+        elseif(preg_match('~^' . $this->_svar_regexp . '(?:' . $this->_mod_regexp . '*)$~', $val)) {
+                // section var
+                return $this->_parse_section_prop($val);
+            }
+        elseif(!in_array($val, $this->_permitted_tokens) && !is_numeric($val)) {
+            // literal string
+            return $this->_expand_quoted_text('"' . strtr($val, array('\\' => '\\\\', '"' => '\\"')) .'"');
+        }
+        return $val;
+    }
+
+    /**
+     * expand quoted text with embedded variables
+     *
+     * @param string $var_expr
+     * @return string
+     */
+    function _expand_quoted_text($var_expr)
+    {
+        // if contains unescaped $, expand it
+        if(preg_match_all('~(?:\`(?<!\\\\)\$' . $this->_dvar_guts_regexp . '(?:' . $this->_obj_ext_regexp . ')*\`)|(?:(?<!\\\\)\$\w+(\[[a-zA-Z0-9]+\])*)~', $var_expr, $_match)) {
+            $_match = $_match[0];
+            rsort($_match);
+            reset($_match);
+            foreach($_match as $_var) {
+                $var_expr = str_replace ($_var, '".(' . $this->_parse_var(str_replace('`','',$_var)) . ')."', $var_expr);
+            }
+            $_return = preg_replace('~\.""|(?<!\\\\)""\.~', '', $var_expr);
+        } else {
+            $_return = $var_expr;
+        }
+        // replace double quoted literal string with single quotes
+        $_return = preg_replace('~^"([\s\w]+)"$~',"'\\1'",$_return);
+        return $_return;
+    }
+
+    /**
+     * parse variable expression into PHP code
+     *
+     * @param string $var_expr
+     * @param string $output
+     * @return string
+     */
+    function _parse_var($var_expr)
+    {
+        $_has_math = false;
+        $_math_vars = preg_split('~('.$this->_dvar_math_regexp.'|'.$this->_qstr_regexp.')~', $var_expr, -1, PREG_SPLIT_DELIM_CAPTURE);
+
+        if(count($_math_vars) > 1) {
+            $_first_var = "";
+            $_complete_var = "";
+            $_output = "";
+            // simple check if there is any math, to stop recursion (due to modifiers with "xx % yy" as parameter)
+            foreach($_math_vars as $_k => $_math_var) {
+                $_math_var = $_math_vars[$_k];
+
+                if(!empty($_math_var) || is_numeric($_math_var)) {
+                    // hit a math operator, so process the stuff which came before it
+                    if(preg_match('~^' . $this->_dvar_math_regexp . '$~', $_math_var)) {
+                        $_has_math = true;
+                        if(!empty($_complete_var) || is_numeric($_complete_var)) {
+                            $_output .= $this->_parse_var($_complete_var);
+                        }
+
+                        // just output the math operator to php
+                        $_output .= $_math_var;
+
+                        if(empty($_first_var))
+                            $_first_var = $_complete_var;
+
+                        $_complete_var = "";
+                    } else {
+                        $_complete_var .= $_math_var;
+                    }
+                }
+            }
+            if($_has_math) {
+                if(!empty($_complete_var) || is_numeric($_complete_var))
+                    $_output .= $this->_parse_var($_complete_var);
+
+                // get the modifiers working (only the last var from math + modifier is left)
+                $var_expr = $_complete_var;
+            }
+        }
+
+        // prevent cutting of first digit in the number (we _definitly_ got a number if the first char is a digit)
+        if(is_numeric(substr($var_expr, 0, 1)))
+            $_var_ref = $var_expr;
+        else
+            $_var_ref = substr($var_expr, 1);
+        
+        if(!$_has_math) {
+            
+            // get [foo] and .foo and ->foo and (...) pieces
+            preg_match_all('~(?:^\w+)|' . $this->_obj_params_regexp . '|(?:' . $this->_var_bracket_regexp . ')|->\$?\w+|\.\$?\w+|\S+~', $_var_ref, $match);
+                        
+            $_indexes = $match[0];
+            $_var_name = array_shift($_indexes);
+
+            /* Handle $smarty.* variable references as a special case. */
+            if ($_var_name == 'smarty') {
+                /*
+                 * If the reference could be compiled, use the compiled output;
+                 * otherwise, fall back on the $smarty variable generated at
+                 * run-time.
+                 */
+                if (($smarty_ref = $this->_compile_smarty_ref($_indexes)) !== null) {
+                    $_output = $smarty_ref;
+                } else {
+                    $_var_name = substr(array_shift($_indexes), 1);
+                    $_output = "\$this->_smarty_vars['$_var_name']";
+                }
+            } elseif(is_numeric($_var_name) && is_numeric(substr($var_expr, 0, 1))) {
+                // because . is the operator for accessing arrays thru inidizes we need to put it together again for floating point numbers
+                if(count($_indexes) > 0)
+                {
+                    $_var_name .= implode("", $_indexes);
+                    $_indexes = array();
+                }
+                $_output = $_var_name;
+            } else {
+                $_output = "\$this->_tpl_vars['$_var_name']";
+            }
+
+            foreach ($_indexes as $_index) {
+                if (substr($_index, 0, 1) == '[') {
+                    $_index = substr($_index, 1, -1);
+                    if (is_numeric($_index)) {
+                        $_output .= "[$_index]";
+                    } elseif (substr($_index, 0, 1) == '$') {
+                        if (strpos($_index, '.') !== false) {
+                            $_output .= '[' . $this->_parse_var($_index) . ']';
+                        } else {
+                            $_output .= "[\$this->_tpl_vars['" . substr($_index, 1) . "']]";
+                        }
+                    } else {
+                        $_var_parts = explode('.', $_index);
+                        $_var_section = $_var_parts[0];
+                        $_var_section_prop = isset($_var_parts[1]) ? $_var_parts[1] : 'index';
+                        $_output .= "[\$this->_sections['$_var_section']['$_var_section_prop']]";
+                    }
+                } else if (substr($_index, 0, 1) == '.') {
+                    if (substr($_index, 1, 1) == '$')
+                        $_output .= "[\$this->_tpl_vars['" . substr($_index, 2) . "']]";
+                    else
+                        $_output .= "['" . substr($_index, 1) . "']";
+                } else if (substr($_index,0,2) == '->') {
+                    if(substr($_index,2,2) == '__') {
+                        $this->_syntax_error('call to internal object members is not allowed', E_USER_ERROR, __FILE__, __LINE__);
+                    } elseif($this->security && substr($_index, 2, 1) == '_') {
+                        $this->_syntax_error('(secure) call to private object member is not allowed', E_USER_ERROR, __FILE__, __LINE__);
+                    } elseif (substr($_index, 2, 1) == '$') {
+                        if ($this->security) {
+                            $this->_syntax_error('(secure) call to dynamic object member is not allowed', E_USER_ERROR, __FILE__, __LINE__);
+                        } else {
+                            $_output .= '->{(($_var=$this->_tpl_vars[\''.substr($_index,3).'\']) && substr($_var,0,2)!=\'__\') ? $_var : $this->trigger_error("cannot access property \\"$_var\\"")}';
+                        }
+                    } else {
+                        $_output .= $_index;
+                    }
+                } elseif (substr($_index, 0, 1) == '(') {
+                    $_index = $this->_parse_parenth_args($_index);
+                    $_output .= $_index;
+                } else {
+                    $_output .= $_index;
+                }
+            }
+        }
+
+        return $_output;
+    }
+
+    /**
+     * parse arguments in function call parenthesis
+     *
+     * @param string $parenth_args
+     * @return string
+     */
+    function _parse_parenth_args($parenth_args)
+    {
+        preg_match_all('~' . $this->_param_regexp . '~',$parenth_args, $match);
+        $orig_vals = $match = $match[0];
+        $this->_parse_vars_props($match);
+        $replace = array();
+        for ($i = 0, $count = count($match); $i < $count; $i++) {
+            $replace[$orig_vals[$i]] = $match[$i];
+        }
+        return strtr($parenth_args, $replace);
+    }
+
+    /**
+     * parse configuration variable expression into PHP code
+     *
+     * @param string $conf_var_expr
+     */
+    function _parse_conf_var($conf_var_expr)
+    {
+        $parts = explode('|', $conf_var_expr, 2);
+        $var_ref = $parts[0];
+        $modifiers = isset($parts[1]) ? $parts[1] : '';
+
+        $var_name = substr($var_ref, 1, -1);
+
+        $output = "\$this->_config[0]['vars']['$var_name']";
+
+        $this->_parse_modifiers($output, $modifiers);
+
+        return $output;
+    }
+
+    /**
+     * parse section property expression into PHP code
+     *
+     * @param string $section_prop_expr
+     * @return string
+     */
+    function _parse_section_prop($section_prop_expr)
+    {
+        $parts = explode('|', $section_prop_expr, 2);
+        $var_ref = $parts[0];
+        $modifiers = isset($parts[1]) ? $parts[1] : '';
+
+        preg_match('!%(\w+)\.(\w+)%!', $var_ref, $match);
+        $section_name = $match[1];
+        $prop_name = $match[2];
+
+        $output = "\$this->_sections['$section_name']['$prop_name']";
+
+        $this->_parse_modifiers($output, $modifiers);
+
+        return $output;
+    }
+
+
+    /**
+     * parse modifier chain into PHP code
+     *
+     * sets $output to parsed modified chain
+     * @param string $output
+     * @param string $modifier_string
+     */
+    function _parse_modifiers(&$output, $modifier_string)
+    {
+        preg_match_all('~\|(@?\w+)((?>:(?:'. $this->_qstr_regexp . '|[^|]+))*)~', '|' . $modifier_string, $_match);
+        list(, $_modifiers, $modifier_arg_strings) = $_match;
+
+        for ($_i = 0, $_for_max = count($_modifiers); $_i < $_for_max; $_i++) {
+            $_modifier_name = $_modifiers[$_i];
+
+            if($_modifier_name == 'smarty') {
+                // skip smarty modifier
+                continue;
+            }
+
+            preg_match_all('~:(' . $this->_qstr_regexp . '|[^:]+)~', $modifier_arg_strings[$_i], $_match);
+            $_modifier_args = $_match[1];
+
+            if (substr($_modifier_name, 0, 1) == '@') {
+                $_map_array = false;
+                $_modifier_name = substr($_modifier_name, 1);
+            } else {
+                $_map_array = true;
+            }
+
+            if (empty($this->_plugins['modifier'][$_modifier_name])
+                && !$this->_get_plugin_filepath('modifier', $_modifier_name)
+                && function_exists($_modifier_name)) {
+                if ($this->security && !in_array($_modifier_name, $this->security_settings['MODIFIER_FUNCS'])) {
+                    $this->_trigger_fatal_error("[plugin] (secure mode) modifier '$_modifier_name' is not allowed" , $this->_current_file, $this->_current_line_no, __FILE__, __LINE__);
+                } else {
+                    $this->_plugins['modifier'][$_modifier_name] = array($_modifier_name,  null, null, false);
+                }
+            }
+            $this->_add_plugin('modifier', $_modifier_name);
+
+            $this->_parse_vars_props($_modifier_args);
+
+            if($_modifier_name == 'default') {
+                // supress notifications of default modifier vars and args
+                if(substr($output, 0, 1) == '$') {
+                    $output = '@' . $output;
+                }
+                if(isset($_modifier_args[0]) && substr($_modifier_args[0], 0, 1) == '$') {
+                    $_modifier_args[0] = '@' . $_modifier_args[0];
+                }
+            }
+            if (count($_modifier_args) > 0)
+                $_modifier_args = ', '.implode(', ', $_modifier_args);
+            else
+                $_modifier_args = '';
+
+            if ($_map_array) {
+                $output = "((is_array(\$_tmp=$output)) ? \$this->_run_mod_handler('$_modifier_name', true, \$_tmp$_modifier_args) : " . $this->_compile_plugin_call('modifier', $_modifier_name) . "(\$_tmp$_modifier_args))";
+
+            } else {
+
+                $output = $this->_compile_plugin_call('modifier', $_modifier_name)."($output$_modifier_args)";
+
+            }
+        }
+    }
+
+
+    /**
+     * add plugin
+     *
+     * @param string $type
+     * @param string $name
+     * @param boolean? $delayed_loading
+     */
+    function _add_plugin($type, $name, $delayed_loading = null)
+    {
+        if (!isset($this->_plugin_info[$type])) {
+            $this->_plugin_info[$type] = array();
+        }
+        if (!isset($this->_plugin_info[$type][$name])) {
+            $this->_plugin_info[$type][$name] = array($this->_current_file,
+                                                      $this->_current_line_no,
+                                                      $delayed_loading);
+        }
+    }
+
+
+    /**
+     * Compiles references of type $smarty.foo
+     *
+     * @param string $indexes
+     * @return string
+     */
+    function _compile_smarty_ref(&$indexes)
+    {
+        /* Extract the reference name. */
+        $_ref = substr($indexes[0], 1);
+        foreach($indexes as $_index_no=>$_index) {
+            if (substr($_index, 0, 1) != '.' && $_index_no<2 || !preg_match('~^(\.|\[|->)~', $_index)) {
+                $this->_syntax_error('$smarty' . implode('', array_slice($indexes, 0, 2)) . ' is an invalid reference', E_USER_ERROR, __FILE__, __LINE__);
+            }
+        }
+
+        switch ($_ref) {
+            case 'now':
+                $compiled_ref = 'time()';
+                $_max_index = 1;
+                break;
+
+            case 'foreach':
+                array_shift($indexes);
+                $_var = $this->_parse_var_props(substr($indexes[0], 1));
+                $_propname = substr($indexes[1], 1);
+                $_max_index = 1;
+                switch ($_propname) {
+                    case 'index':
+                        array_shift($indexes);
+                        $compiled_ref = "(\$this->_foreach[$_var]['iteration']-1)";
+                        break;
+                        
+                    case 'first':
+                        array_shift($indexes);
+                        $compiled_ref = "(\$this->_foreach[$_var]['iteration'] <= 1)";
+                        break;
+
+                    case 'last':
+                        array_shift($indexes);
+                        $compiled_ref = "(\$this->_foreach[$_var]['iteration'] == \$this->_foreach[$_var]['total'])";
+                        break;
+                        
+                    case 'show':
+                        array_shift($indexes);
+                        $compiled_ref = "(\$this->_foreach[$_var]['total'] > 0)";
+                        break;
+                        
+                    default:
+                        unset($_max_index);
+                        $compiled_ref = "\$this->_foreach[$_var]";
+                }
+                break;
+
+            case 'section':
+                array_shift($indexes);
+                $_var = $this->_parse_var_props(substr($indexes[0], 1));
+                $compiled_ref = "\$this->_sections[$_var]";
+                break;
+
+            case 'get':
+                $compiled_ref = ($this->request_use_auto_globals) ? '$_GET' : "\$GLOBALS['HTTP_GET_VARS']";
+                break;
+
+            case 'post':
+                $compiled_ref = ($this->request_use_auto_globals) ? '$_POST' : "\$GLOBALS['HTTP_POST_VARS']";
+                break;
+
+            case 'cookies':
+                $compiled_ref = ($this->request_use_auto_globals) ? '$_COOKIE' : "\$GLOBALS['HTTP_COOKIE_VARS']";
+                break;
+
+            case 'env':
+                $compiled_ref = ($this->request_use_auto_globals) ? '$_ENV' : "\$GLOBALS['HTTP_ENV_VARS']";
+                break;
+
+            case 'server':
+                $compiled_ref = ($this->request_use_auto_globals) ? '$_SERVER' : "\$GLOBALS['HTTP_SERVER_VARS']";
+                break;
+
+            case 'session':
+                $compiled_ref = ($this->request_use_auto_globals) ? '$_SESSION' : "\$GLOBALS['HTTP_SESSION_VARS']";
+                break;
+
+            /*
+             * These cases are handled either at run-time or elsewhere in the
+             * compiler.
+             */
+            case 'request':
+                if ($this->request_use_auto_globals) {
+                    $compiled_ref = '$_REQUEST';
+                    break;
+                } else {
+                    $this->_init_smarty_vars = true;
+                }
+                return null;
+
+            case 'capture':
+                return null;
+
+            case 'template':
+                $compiled_ref = "'$this->_current_file'";
+                $_max_index = 1;
+                break;
+
+            case 'version':
+                $compiled_ref = "'$this->_version'";
+                $_max_index = 1;
+                break;
+
+            case 'const':
+                if ($this->security && !$this->security_settings['ALLOW_CONSTANTS']) {
+                    $this->_syntax_error("(secure mode) constants not permitted",
+                                         E_USER_WARNING, __FILE__, __LINE__);
+                    return;
+                }
+                array_shift($indexes);
+                if (preg_match('!^\.\w+$!', $indexes[0])) {
+                    $compiled_ref = '@' . substr($indexes[0], 1);
+                } else {
+                    $_val = $this->_parse_var_props(substr($indexes[0], 1));
+                    $compiled_ref = '@constant(' . $_val . ')';
+                }
+                $_max_index = 1;
+                break;
+
+            case 'config':
+                $compiled_ref = "\$this->_config[0]['vars']";
+                $_max_index = 3;
+                break;
+
+            case 'ldelim':
+                $compiled_ref = "'$this->left_delimiter'";
+                break;
+
+            case 'rdelim':
+                $compiled_ref = "'$this->right_delimiter'";
+                break;
+                
+            default:
+                $this->_syntax_error('$smarty.' . $_ref . ' is an unknown reference', E_USER_ERROR, __FILE__, __LINE__);
+                break;
+        }
+
+        if (isset($_max_index) && count($indexes) > $_max_index) {
+            $this->_syntax_error('$smarty' . implode('', $indexes) .' is an invalid reference', E_USER_ERROR, __FILE__, __LINE__);
+        }
+
+        array_shift($indexes);
+        return $compiled_ref;
+    }
+
+    /**
+     * compiles call to plugin of type $type with name $name
+     * returns a string containing the function-name or method call
+     * without the paramter-list that would have follow to make the
+     * call valid php-syntax
+     *
+     * @param string $type
+     * @param string $name
+     * @return string
+     */
+    function _compile_plugin_call($type, $name) {
+        if (isset($this->_plugins[$type][$name])) {
+            /* plugin loaded */
+            if (is_array($this->_plugins[$type][$name][0])) {
+                return ((is_object($this->_plugins[$type][$name][0][0])) ?
+                        "\$this->_plugins['$type']['$name'][0][0]->"    /* method callback */
+                        : (string)($this->_plugins[$type][$name][0][0]).'::'    /* class callback */
+                       ). $this->_plugins[$type][$name][0][1];
+
+            } else {
+                /* function callback */
+                return $this->_plugins[$type][$name][0];
+
+            }
+        } else {
+            /* plugin not loaded -> auto-loadable-plugin */
+            return 'smarty_'.$type.'_'.$name;
+
+        }
+    }
+
+    /**
+     * load pre- and post-filters
+     */
+    function _load_filters()
+    {
+        if (count($this->_plugins['prefilter']) > 0) {
+            foreach ($this->_plugins['prefilter'] as $filter_name => $prefilter) {
+                if ($prefilter === false) {
+                    unset($this->_plugins['prefilter'][$filter_name]);
+                    $_params = array('plugins' => array(array('prefilter', $filter_name, null, null, false)));
+                    require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
+                    smarty_core_load_plugins($_params, $this);
+                }
+            }
+        }
+        if (count($this->_plugins['postfilter']) > 0) {
+            foreach ($this->_plugins['postfilter'] as $filter_name => $postfilter) {
+                if ($postfilter === false) {
+                    unset($this->_plugins['postfilter'][$filter_name]);
+                    $_params = array('plugins' => array(array('postfilter', $filter_name, null, null, false)));
+                    require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
+                    smarty_core_load_plugins($_params, $this);
+                }
+            }
+        }
+    }
+
+
+    /**
+     * Quote subpattern references
+     *
+     * @param string $string
+     * @return string
+     */
+    function _quote_replace($string)
+    {
+        return strtr($string, array('\\' => '\\\\', '$' => '\\$'));
+    }
+
+    /**
+     * display Smarty syntax error
+     *
+     * @param string $error_msg
+     * @param integer $error_type
+     * @param string $file
+     * @param integer $line
+     */
+    function _syntax_error($error_msg, $error_type = E_USER_ERROR, $file=null, $line=null)
+    {
+        $this->_trigger_fatal_error("syntax error: $error_msg", $this->_current_file, $this->_current_line_no, $file, $line, $error_type);
+    }
+
+
+    /**
+     * check if the compilation changes from cacheable to
+     * non-cacheable state with the beginning of the current
+     * plugin. return php-code to reflect the transition.
+     * @return string
+     */
+    function _push_cacheable_state($type, $name) {
+        $_cacheable = !isset($this->_plugins[$type][$name]) || $this->_plugins[$type][$name][4];
+        if ($_cacheable
+            || 0<$this->_cacheable_state++) return '';
+        if (!isset($this->_cache_serial)) $this->_cache_serial = md5(uniqid('Smarty'));
+        $_ret = 'if ($this->caching && !$this->_cache_including) { echo \'{nocache:'
+            . $this->_cache_serial . '#' . $this->_nocache_count
+            . '}\'; };';
+        return $_ret;
+    }
+
+
+    /**
+     * check if the compilation changes from non-cacheable to
+     * cacheable state with the end of the current plugin return
+     * php-code to reflect the transition.
+     * @return string
+     */
+    function _pop_cacheable_state($type, $name) {
+        $_cacheable = !isset($this->_plugins[$type][$name]) || $this->_plugins[$type][$name][4];
+        if ($_cacheable
+            || --$this->_cacheable_state>0) return '';
+        return 'if ($this->caching && !$this->_cache_including) { echo \'{/nocache:'
+            . $this->_cache_serial . '#' . ($this->_nocache_count++)
+            . '}\'; };';
+    }
+
+
+    /**
+     * push opening tag-name, file-name and line-number on the tag-stack
+     * @param string the opening tag's name
+     */
+    function _push_tag($open_tag)
+    {
+        array_push($this->_tag_stack, array($open_tag, $this->_current_line_no));
+    }
+
+    /**
+     * pop closing tag-name
+     * raise an error if this stack-top doesn't match with the closing tag
+     * @param string the closing tag's name
+     * @return string the opening tag's name
+     */
+    function _pop_tag($close_tag)
+    {
+        $message = '';
+        if (count($this->_tag_stack)>0) {
+            list($_open_tag, $_line_no) = array_pop($this->_tag_stack);
+            if ($close_tag == $_open_tag) {
+                return $_open_tag;
+            }
+            if ($close_tag == 'if' && ($_open_tag == 'else' || $_open_tag == 'elseif' )) {
+                return $this->_pop_tag($close_tag);
+            }
+            if ($close_tag == 'section' && $_open_tag == 'sectionelse') {
+                $this->_pop_tag($close_tag);
+                return $_open_tag;
+            }
+            if ($close_tag == 'foreach' && $_open_tag == 'foreachelse') {
+                $this->_pop_tag($close_tag);
+                return $_open_tag;
+            }
+            if ($_open_tag == 'else' || $_open_tag == 'elseif') {
+                $_open_tag = 'if';
+            } elseif ($_open_tag == 'sectionelse') {
+                $_open_tag = 'section';
+            } elseif ($_open_tag == 'foreachelse') {
+                $_open_tag = 'foreach';
+            }
+            $message = " expected {/$_open_tag} (opened line $_line_no).";
+        }
+        $this->_syntax_error("mismatched tag {/$close_tag}.$message",
+                             E_USER_ERROR, __FILE__, __LINE__);
+    }
+
+}
+
+/**
+ * compare to values by their string length
+ *
+ * @access private
+ * @param string $a
+ * @param string $b
+ * @return 0|-1|1
+ */
+function _smarty_sort_length($a, $b)
+{
+    if($a == $b)
+        return 0;
+
+    if(strlen($a) == strlen($b))
+        return ($a > $b) ? -1 : 1;
+
+    return (strlen($a) > strlen($b)) ? -1 : 1;
+}
+
+
+/* vim: set et: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/debug.tpl
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/debug.tpl	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/debug.tpl	(revision 405)
@@ -0,0 +1,64 @@
+{* Smarty *}
+
+{* debug.tpl, last updated version 2.0.1 *}
+
+{assign_debug_info}
+
+{if isset($_smarty_debug_output) and $_smarty_debug_output eq "html"}
+	<table border=0 width=100%>
+	<tr bgcolor=#cccccc><th colspan=2>Smarty Debug Console</th></tr>
+	<tr bgcolor=#cccccc><td colspan=2><b>included templates & config files (load time in seconds):</b></td></tr>
+	{section name=templates loop=$_debug_tpls}
+		<tr bgcolor={if %templates.index% is even}#eeeeee{else}#fafafa{/if}><td colspan=2><tt>{section name=indent loop=$_debug_tpls[templates].depth}&nbsp;&nbsp;&nbsp;{/section}<font color={if $_debug_tpls[templates].type eq "template"}brown{elseif $_debug_tpls[templates].type eq "insert"}black{else}green{/if}>{$_debug_tpls[templates].filename|escape:html}</font>{if isset($_debug_tpls[templates].exec_time)} <font size=-1><i>({$_debug_tpls[templates].exec_time|string_format:"%.5f"}){if %templates.index% eq 0} (total){/if}</i></font>{/if}</tt></td></tr>
+	{sectionelse}
+		<tr bgcolor=#eeeeee><td colspan=2><tt><i>no templates included</i></tt></td></tr>	
+	{/section}
+	<tr bgcolor=#cccccc><td colspan=2><b>assigned template variables:</b></td></tr>
+	{section name=vars loop=$_debug_keys}
+		<tr bgcolor={if %vars.index% is even}#eeeeee{else}#fafafa{/if}><td valign=top><tt><font color=blue>{ldelim}${$_debug_keys[vars]}{rdelim}</font></tt></td><td nowrap><tt><font color=green>{$_debug_vals[vars]|@debug_print_var}</font></tt></td></tr>
+	{sectionelse}
+		<tr bgcolor=#eeeeee><td colspan=2><tt><i>no template variables assigned</i></tt></td></tr>	
+	{/section}
+	<tr bgcolor=#cccccc><td colspan=2><b>assigned config file variables (outer template scope):</b></td></tr>
+	{section name=config_vars loop=$_debug_config_keys}
+		<tr bgcolor={if %config_vars.index% is even}#eeeeee{else}#fafafa{/if}><td valign=top><tt><font color=maroon>{ldelim}#{$_debug_config_keys[config_vars]}#{rdelim}</font></tt></td><td><tt><font color=green>{$_debug_config_vals[config_vars]|@debug_print_var}</font></tt></td></tr>
+	{sectionelse}
+		<tr bgcolor=#eeeeee><td colspan=2><tt><i>no config vars assigned</i></tt></td></tr>	
+	{/section}
+	</table>
+</BODY></HTML>
+{else}
+<SCRIPT language=javascript>
+	if( self.name == '' ) {ldelim}
+	   var title = 'Console';
+	{rdelim}
+	else {ldelim}
+	   var title = 'Console_' + self.name;
+	{rdelim}
+	_smarty_console = window.open("",title.value,"width=680,height=600,resizable,scrollbars=yes");
+	_smarty_console.document.write("<HTML><HEAD><TITLE>Smarty Debug Console_"+self.name+"</TITLE></HEAD><BODY bgcolor=#ffffff>");
+	_smarty_console.document.write("<table border=0 width=100%>");
+	_smarty_console.document.write("<tr bgcolor=#cccccc><th colspan=2>Smarty Debug Console</th></tr>");
+	_smarty_console.document.write("<tr bgcolor=#cccccc><td colspan=2><b>included templates & config files (load time in seconds):</b></td></tr>");
+	{section name=templates loop=$_debug_tpls}
+		_smarty_console.document.write("<tr bgcolor={if %templates.index% is even}#eeeeee{else}#fafafa{/if}><td colspan=2><tt>{section name=indent loop=$_debug_tpls[templates].depth}&nbsp;&nbsp;&nbsp;{/section}<font color={if $_debug_tpls[templates].type eq "template"}brown{elseif $_debug_tpls[templates].type eq "insert"}black{else}green{/if}>{$_debug_tpls[templates].filename|escape:html|escape:javascript}</font>{if isset($_debug_tpls[templates].exec_time)} <font size=-1><i>({$_debug_tpls[templates].exec_time|string_format:"%.5f"}){if %templates.index% eq 0} (total){/if}</i></font>{/if}</tt></td></tr>");
+	{sectionelse}
+		_smarty_console.document.write("<tr bgcolor=#eeeeee><td colspan=2><tt><i>no templates included</i></tt></td></tr>");	
+	{/section}
+	_smarty_console.document.write("<tr bgcolor=#cccccc><td colspan=2><b>assigned template variables:</b></td></tr>");
+	{section name=vars loop=$_debug_keys}
+		_smarty_console.document.write("<tr bgcolor={if %vars.index% is even}#eeeeee{else}#fafafa{/if}><td valign=top><tt><font color=blue>{ldelim}${$_debug_keys[vars]}{rdelim}</font></tt></td><td nowrap><tt><font color=green>{$_debug_vals[vars]|@debug_print_var|escape:javascript}</font></tt></td></tr>");
+	{sectionelse}
+		_smarty_console.document.write("<tr bgcolor=#eeeeee><td colspan=2><tt><i>no template variables assigned</i></tt></td></tr>");	
+	{/section}
+	_smarty_console.document.write("<tr bgcolor=#cccccc><td colspan=2><b>assigned config file variables (outer template scope):</b></td></tr>");
+	{section name=config_vars loop=$_debug_config_keys}
+		_smarty_console.document.write("<tr bgcolor={if %config_vars.index% is even}#eeeeee{else}#fafafa{/if}><td valign=top><tt><font color=maroon>{ldelim}#{$_debug_config_keys[config_vars]}#{rdelim}</font></tt></td><td><tt><font color=green>{$_debug_config_vals[config_vars]|@debug_print_var|escape:javascript}</font></tt></td></tr>");
+	{sectionelse}
+		_smarty_console.document.write("<tr bgcolor=#eeeeee><td colspan=2><tt><i>no config vars assigned</i></tt></td></tr>");	
+	{/section}
+	_smarty_console.document.write("</table>");
+	_smarty_console.document.write("</BODY></HTML>");
+	_smarty_console.document.close();
+</SCRIPT>
+{/if}
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/configs/test.conf
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/configs/test.conf	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/configs/test.conf	(revision 405)
@@ -0,0 +1,5 @@
+title = Welcome to Smarty!
+cutoff_size = 40
+
+[setup]
+bold = true
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.process_cached_inserts.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.process_cached_inserts.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.process_cached_inserts.php	(revision 405)
@@ -0,0 +1,71 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Replace cached inserts with the actual results
+ *
+ * @param string $results
+ * @return string
+ */
+function smarty_core_process_cached_inserts($params, &$smarty)
+{
+    preg_match_all('!'.$smarty->_smarty_md5.'{insert_cache (.*)}'.$smarty->_smarty_md5.'!Uis',
+                   $params['results'], $match);
+    list($cached_inserts, $insert_args) = $match;
+
+    for ($i = 0, $for_max = count($cached_inserts); $i < $for_max; $i++) {
+        if ($smarty->debugging) {
+            $_params = array();
+            require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
+            $debug_start_time = smarty_core_get_microtime($_params, $smarty);
+        }
+
+        $args = unserialize($insert_args[$i]);
+        $name = $args['name'];
+
+        if (isset($args['script'])) {
+            $_params = array('resource_name' => $smarty->_dequote($args['script']));
+            require_once(SMARTY_CORE_DIR . 'core.get_php_resource.php');
+            if(!smarty_core_get_php_resource($_params, $smarty)) {
+                return false;
+            }
+            $resource_type = $_params['resource_type'];
+            $php_resource = $_params['php_resource'];
+
+
+            if ($resource_type == 'file') {
+                $smarty->_include($php_resource, true);
+            } else {
+                $smarty->_eval($php_resource);
+            }
+        }
+
+        $function_name = $smarty->_plugins['insert'][$name][0];
+        if (empty($args['assign'])) {
+            $replace = $function_name($args, $smarty);
+        } else {
+            $smarty->assign($args['assign'], $function_name($args, $smarty));
+            $replace = '';
+        }
+
+        $params['results'] = substr_replace($params['results'], $replace, strpos($params['results'], $cached_inserts[$i]), strlen($cached_inserts[$i]));
+        if ($smarty->debugging) {
+            $_params = array();
+            require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
+            $smarty->_smarty_debug_info[] = array('type'      => 'insert',
+                                                'filename'  => 'insert_'.$name,
+                                                'depth'     => $smarty->_inclusion_depth,
+                                                'exec_time' => smarty_core_get_microtime($_params, $smarty) - $debug_start_time);
+        }
+    }
+
+    return $params['results'];
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.write_cache_file.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.write_cache_file.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.write_cache_file.php	(revision 405)
@@ -0,0 +1,96 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Prepend the cache information to the cache file
+ * and write it
+ *
+ * @param string $tpl_file
+ * @param string $cache_id
+ * @param string $compile_id
+ * @param string $results
+ * @return true|null
+ */
+
+ // $tpl_file, $cache_id, $compile_id, $results
+
+function smarty_core_write_cache_file($params, &$smarty)
+{
+
+    // put timestamp in cache header
+    $smarty->_cache_info['timestamp'] = time();
+    if ($smarty->cache_lifetime > -1){
+        // expiration set
+        $smarty->_cache_info['expires'] = $smarty->_cache_info['timestamp'] + $smarty->cache_lifetime;
+    } else {
+        // cache will never expire
+        $smarty->_cache_info['expires'] = -1;
+    }
+
+    // collapse nocache.../nocache-tags
+    if (preg_match_all('!\{(/?)nocache\:[0-9a-f]{32}#\d+\}!', $params['results'], $match, PREG_PATTERN_ORDER)) {
+        // remove everything between every pair of outermost noache.../nocache-tags
+        // and replace it by a single nocache-tag
+        // this new nocache-tag will be replaced by dynamic contents in
+        // smarty_core_process_compiled_includes() on a cache-read
+        
+        $match_count = count($match[0]);
+        $results = preg_split('!(\{/?nocache\:[0-9a-f]{32}#\d+\})!', $params['results'], -1, PREG_SPLIT_DELIM_CAPTURE);
+        
+        $level = 0;
+        $j = 0;
+        for ($i=0, $results_count = count($results); $i < $results_count && $j < $match_count; $i++) {
+            if ($results[$i] == $match[0][$j]) {
+                // nocache tag
+                if ($match[1][$j]) { // closing tag
+                    $level--;
+                    unset($results[$i]);
+                } else { // opening tag
+                    if ($level++ > 0) unset($results[$i]);
+                }
+                $j++;
+            } elseif ($level > 0) {
+                unset($results[$i]);
+            }
+        }
+        $params['results'] = implode('', $results);
+    }
+    $smarty->_cache_info['cache_serials'] = $smarty->_cache_serials;
+
+    // prepend the cache header info into cache file
+    $_cache_info = serialize($smarty->_cache_info);
+    $params['results'] = strlen($_cache_info) . "\n" . $_cache_info . $params['results'];
+
+    if (!empty($smarty->cache_handler_func)) {
+        // use cache_handler function
+        call_user_func_array($smarty->cache_handler_func,
+                             array('write', &$smarty, &$params['results'], $params['tpl_file'], $params['cache_id'], $params['compile_id'], null));
+    } else {
+        // use local cache file
+
+        if(!@is_writable($smarty->cache_dir)) {
+            // cache_dir not writable, see if it exists
+            if(!@is_dir($smarty->cache_dir)) {
+                $smarty->trigger_error('the $cache_dir \'' . $smarty->cache_dir . '\' does not exist, or is not a directory.', E_USER_ERROR);
+                return false;
+            }
+            $smarty->trigger_error('unable to write to $cache_dir \'' . realpath($smarty->cache_dir) . '\'. Be sure $cache_dir is writable by the web server user.', E_USER_ERROR);
+            return false;
+        }
+
+        $_auto_id = $smarty->_get_auto_id($params['cache_id'], $params['compile_id']);
+        $_cache_file = $smarty->_get_auto_filename($smarty->cache_dir, $params['tpl_file'], $_auto_id);
+        $_params = array('filename' => $_cache_file, 'contents' => $params['results'], 'create_dirs' => true);
+        require_once(SMARTY_CORE_DIR . 'core.write_file.php');
+        smarty_core_write_file($_params, $smarty);
+        return true;
+    }
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.rmdir.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.rmdir.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.rmdir.php	(revision 405)
@@ -0,0 +1,54 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * delete a dir recursively (level=0 -> keep root)
+ * WARNING: no tests, it will try to remove what you tell it!
+ *
+ * @param string $dirname
+ * @param integer $level
+ * @param integer $exp_time
+ * @return boolean
+ */
+
+//  $dirname, $level = 1, $exp_time = null
+
+function smarty_core_rmdir($params, &$smarty)
+{
+   if(!isset($params['level'])) { $params['level'] = 1; }
+   if(!isset($params['exp_time'])) { $params['exp_time'] = null; }
+
+   if($_handle = @opendir($params['dirname'])) {
+
+        while (false !== ($_entry = readdir($_handle))) {
+            if ($_entry != '.' && $_entry != '..') {
+                if (@is_dir($params['dirname'] . DIRECTORY_SEPARATOR . $_entry)) {
+                    $_params = array(
+                        'dirname' => $params['dirname'] . DIRECTORY_SEPARATOR . $_entry,
+                        'level' => $params['level'] + 1,
+                        'exp_time' => $params['exp_time']
+                    );
+                    smarty_core_rmdir($_params, $smarty);
+                }
+                else {
+                    $smarty->_unlink($params['dirname'] . DIRECTORY_SEPARATOR . $_entry, $params['exp_time']);
+                }
+            }
+        }
+        closedir($_handle);
+   }
+
+   if ($params['level']) {
+       return @rmdir($params['dirname']);
+   }
+   return (bool)$_handle;
+
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.write_compiled_resource.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.write_compiled_resource.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.write_compiled_resource.php	(revision 405)
@@ -0,0 +1,35 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * write the compiled resource
+ *
+ * @param string $compile_path
+ * @param string $compiled_content
+ * @return true
+ */
+function smarty_core_write_compiled_resource($params, &$smarty)
+{
+    if(!@is_writable($smarty->compile_dir)) {
+        // compile_dir not writable, see if it exists
+        if(!@is_dir($smarty->compile_dir)) {
+            $smarty->trigger_error('the $compile_dir \'' . $smarty->compile_dir . '\' does not exist, or is not a directory.', E_USER_ERROR);
+            return false;
+        }
+        $smarty->trigger_error('unable to write to $compile_dir \'' . realpath($smarty->compile_dir) . '\'. Be sure $compile_dir is writable by the web server user.', E_USER_ERROR);
+        return false;
+    }
+
+    $_params = array('filename' => $params['compile_path'], 'contents' => $params['compiled_content'], 'create_dirs' => true);
+    require_once(SMARTY_CORE_DIR . 'core.write_file.php');
+    smarty_core_write_file($_params, $smarty);
+    return true;
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.load_plugins.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.load_plugins.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.load_plugins.php	(revision 405)
@@ -0,0 +1,125 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Load requested plugins
+ *
+ * @param array $plugins
+ */
+
+// $plugins
+
+function smarty_core_load_plugins($params, &$smarty)
+{
+
+    foreach ($params['plugins'] as $_plugin_info) {
+        list($_type, $_name, $_tpl_file, $_tpl_line, $_delayed_loading) = $_plugin_info;
+        $_plugin = &$smarty->_plugins[$_type][$_name];
+
+        /*
+         * We do not load plugin more than once for each instance of Smarty.
+         * The following code checks for that. The plugin can also be
+         * registered dynamically at runtime, in which case template file
+         * and line number will be unknown, so we fill them in.
+         *
+         * The final element of the info array is a flag that indicates
+         * whether the dynamically registered plugin function has been
+         * checked for existence yet or not.
+         */
+        if (isset($_plugin)) {
+            if (empty($_plugin[3])) {
+                if (!is_callable($_plugin[0])) {
+                    $smarty->_trigger_fatal_error("[plugin] $_type '$_name' is not implemented", $_tpl_file, $_tpl_line, __FILE__, __LINE__);
+                } else {
+                    $_plugin[1] = $_tpl_file;
+                    $_plugin[2] = $_tpl_line;
+                    $_plugin[3] = true;
+                    if (!isset($_plugin[4])) $_plugin[4] = true; /* cacheable */
+                }
+            }
+            continue;
+        } else if ($_type == 'insert') {
+            /*
+             * For backwards compatibility, we check for insert functions in
+             * the symbol table before trying to load them as a plugin.
+             */
+            $_plugin_func = 'insert_' . $_name;
+            if (function_exists($_plugin_func)) {
+                $_plugin = array($_plugin_func, $_tpl_file, $_tpl_line, true, false);
+                continue;
+            }
+        }
+
+        $_plugin_file = $smarty->_get_plugin_filepath($_type, $_name);
+
+        if (! $_found = ($_plugin_file != false)) {
+            $_message = "could not load plugin file '$_type.$_name.php'\n";
+        }
+
+        /*
+         * If plugin file is found, it -must- provide the properly named
+         * plugin function. In case it doesn't, simply output the error and
+         * do not fall back on any other method.
+         */
+        if ($_found) {
+            include_once $_plugin_file;
+
+            $_plugin_func = 'smarty_' . $_type . '_' . $_name;
+            if (!function_exists($_plugin_func)) {
+                $smarty->_trigger_fatal_error("[plugin] function $_plugin_func() not found in $_plugin_file", $_tpl_file, $_tpl_line, __FILE__, __LINE__);
+                continue;
+            }
+        }
+        /*
+         * In case of insert plugins, their code may be loaded later via
+         * 'script' attribute.
+         */
+        else if ($_type == 'insert' && $_delayed_loading) {
+            $_plugin_func = 'smarty_' . $_type . '_' . $_name;
+            $_found = true;
+        }
+
+        /*
+         * Plugin specific processing and error checking.
+         */
+        if (!$_found) {
+            if ($_type == 'modifier') {
+                /*
+                 * In case modifier falls back on using PHP functions
+                 * directly, we only allow those specified in the security
+                 * context.
+                 */
+                if ($smarty->security && !in_array($_name, $smarty->security_settings['MODIFIER_FUNCS'])) {
+                    $_message = "(secure mode) modifier '$_name' is not allowed";
+                } else {
+                    if (!function_exists($_name)) {
+                        $_message = "modifier '$_name' is not implemented";
+                    } else {
+                        $_plugin_func = $_name;
+                        $_found = true;
+                    }
+                }
+            } else if ($_type == 'function') {
+                /*
+                 * This is a catch-all situation.
+                 */
+                $_message = "unknown tag - '$_name'";
+            }
+        }
+
+        if ($_found) {
+            $smarty->_plugins[$_type][$_name] = array($_plugin_func, $_tpl_file, $_tpl_line, true, true);
+        } else {
+            // output error
+            $smarty->_trigger_fatal_error('[plugin] ' . $_message, $_tpl_file, $_tpl_line, __FILE__, __LINE__);
+        }
+    }
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.is_secure.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.is_secure.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.is_secure.php	(revision 405)
@@ -0,0 +1,59 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * determines if a resource is secure or not.
+ *
+ * @param string $resource_type
+ * @param string $resource_name
+ * @return boolean
+ */
+
+//  $resource_type, $resource_name
+
+function smarty_core_is_secure($params, &$smarty)
+{
+    if (!$smarty->security || $smarty->security_settings['INCLUDE_ANY']) {
+        return true;
+    }
+
+    if ($params['resource_type'] == 'file') {
+        $_rp = realpath($params['resource_name']);
+        if (isset($params['resource_base_path'])) {
+            foreach ((array)$params['resource_base_path'] as $curr_dir) {
+                if ( ($_cd = realpath($curr_dir)) !== false &&
+                     strncmp($_rp, $_cd, strlen($_cd)) == 0 &&
+                     substr($_rp, strlen($_cd), 1) == DIRECTORY_SEPARATOR ) {
+                    return true;
+                }
+            }
+        }
+        if (!empty($smarty->secure_dir)) {
+            foreach ((array)$smarty->secure_dir as $curr_dir) {
+                if ( ($_cd = realpath($curr_dir)) !== false) {
+                    if($_cd == $_rp) {
+                        return true;
+                    } elseif (strncmp($_rp, $_cd, strlen($_cd)) == 0 &&
+                        substr($_rp, strlen($_cd), 1) == DIRECTORY_SEPARATOR) {
+                        return true;
+                    }
+                }
+            }
+        }
+    } else {
+        // resource is not on local file system
+        return call_user_func_array(
+            $smarty->_plugins['resource'][$params['resource_type']][0][2],
+            array($params['resource_name'], &$smarty));
+    }
+
+    return false;
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.create_dir_structure.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.create_dir_structure.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.create_dir_structure.php	(revision 405)
@@ -0,0 +1,79 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * create full directory structure
+ *
+ * @param string $dir
+ */
+
+// $dir
+
+function smarty_core_create_dir_structure($params, &$smarty)
+{
+    if (!file_exists($params['dir'])) {
+        $_open_basedir_ini = ini_get('open_basedir');
+
+        if (DIRECTORY_SEPARATOR=='/') {
+            /* unix-style paths */
+            $_dir = $params['dir'];
+            $_dir_parts = preg_split('!/+!', $_dir, -1, PREG_SPLIT_NO_EMPTY);
+            $_new_dir = (substr($_dir, 0, 1)=='/') ? '/' : getcwd().'/';
+            if($_use_open_basedir = !empty($_open_basedir_ini)) {
+                $_open_basedirs = explode(':', $_open_basedir_ini);
+            }
+
+        } else {
+            /* other-style paths */
+            $_dir = str_replace('\\','/', $params['dir']);
+            $_dir_parts = preg_split('!/+!', $_dir, -1, PREG_SPLIT_NO_EMPTY);
+            if (preg_match('!^((//)|([a-zA-Z]:/))!', $_dir, $_root_dir)) {
+                /* leading "//" for network volume, or "[letter]:/" for full path */
+                $_new_dir = $_root_dir[1];
+                /* remove drive-letter from _dir_parts */
+                if (isset($_root_dir[3])) array_shift($_dir_parts);
+
+            } else {
+                $_new_dir = str_replace('\\', '/', getcwd()).'/';
+
+            }
+
+            if($_use_open_basedir = !empty($_open_basedir_ini)) {
+                $_open_basedirs = explode(';', str_replace('\\', '/', $_open_basedir_ini));
+            }
+
+        }
+
+        /* all paths use "/" only from here */
+        foreach ($_dir_parts as $_dir_part) {
+            $_new_dir .= $_dir_part;
+
+            if ($_use_open_basedir) {
+                // do not attempt to test or make directories outside of open_basedir
+                $_make_new_dir = false;
+                foreach ($_open_basedirs as $_open_basedir) {
+                    if (substr($_new_dir, 0, strlen($_open_basedir)) == $_open_basedir) {
+                        $_make_new_dir = true;
+                        break;
+                    }
+                }
+            } else {
+                $_make_new_dir = true;
+            }
+
+            if ($_make_new_dir && !file_exists($_new_dir) && !@mkdir($_new_dir, $smarty->_dir_perms) && !is_dir($_new_dir)) {
+                $smarty->trigger_error("problem creating directory '" . $_new_dir . "'");
+                return false;
+            }
+            $_new_dir .= '/';
+        }
+    }
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.run_insert_handler.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.run_insert_handler.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.run_insert_handler.php	(revision 405)
@@ -0,0 +1,71 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Handle insert tags
+ *
+ * @param array $args
+ * @return string
+ */
+function smarty_core_run_insert_handler($params, &$smarty)
+{
+
+    require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
+    if ($smarty->debugging) {
+        $_params = array();
+        $_debug_start_time = smarty_core_get_microtime($_params, $smarty);
+    }
+
+    if ($smarty->caching) {
+        $_arg_string = serialize($params['args']);
+        $_name = $params['args']['name'];
+        if (!isset($smarty->_cache_info['insert_tags'][$_name])) {
+            $smarty->_cache_info['insert_tags'][$_name] = array('insert',
+                                                             $_name,
+                                                             $smarty->_plugins['insert'][$_name][1],
+                                                             $smarty->_plugins['insert'][$_name][2],
+                                                             !empty($params['args']['script']) ? true : false);
+        }
+        return $smarty->_smarty_md5."{insert_cache $_arg_string}".$smarty->_smarty_md5;
+    } else {
+        if (isset($params['args']['script'])) {
+            $_params = array('resource_name' => $smarty->_dequote($params['args']['script']));
+            require_once(SMARTY_CORE_DIR . 'core.get_php_resource.php');
+            if(!smarty_core_get_php_resource($_params, $smarty)) {
+                return false;
+            }
+
+            if ($_params['resource_type'] == 'file') {
+                $smarty->_include($_params['php_resource'], true);
+            } else {
+                $smarty->_eval($_params['php_resource']);
+            }
+            unset($params['args']['script']);
+        }
+
+        $_funcname = $smarty->_plugins['insert'][$params['args']['name']][0];
+        $_content = $_funcname($params['args'], $smarty);
+        if ($smarty->debugging) {
+            $_params = array();
+            require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
+            $smarty->_smarty_debug_info[] = array('type'      => 'insert',
+                                                'filename'  => 'insert_'.$params['args']['name'],
+                                                'depth'     => $smarty->_inclusion_depth,
+                                                'exec_time' => smarty_core_get_microtime($_params, $smarty) - $_debug_start_time);
+        }
+
+        if (!empty($params['args']["assign"])) {
+            $smarty->assign($params['args']["assign"], $_content);
+        } else {
+            return $_content;
+        }
+    }
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.assemble_plugin_filepath.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.assemble_plugin_filepath.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.assemble_plugin_filepath.php	(revision 405)
@@ -0,0 +1,67 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * assemble filepath of requested plugin
+ *
+ * @param string $type
+ * @param string $name
+ * @return string|false
+ */
+function smarty_core_assemble_plugin_filepath($params, &$smarty)
+{
+    static $_filepaths_cache = array();
+
+    $_plugin_filename = $params['type'] . '.' . $params['name'] . '.php';
+    if (isset($_filepaths_cache[$_plugin_filename])) {
+        return $_filepaths_cache[$_plugin_filename];
+    }
+    $_return = false;
+
+    foreach ((array)$smarty->plugins_dir as $_plugin_dir) {
+
+        $_plugin_filepath = $_plugin_dir . DIRECTORY_SEPARATOR . $_plugin_filename;
+
+        // see if path is relative
+        if (!preg_match("/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/", $_plugin_dir)) {
+            $_relative_paths[] = $_plugin_dir;
+            // relative path, see if it is in the SMARTY_DIR
+            if (@is_readable(SMARTY_DIR . $_plugin_filepath)) {
+                $_return = SMARTY_DIR . $_plugin_filepath;
+                break;
+            }
+        }
+        // try relative to cwd (or absolute)
+        if (@is_readable($_plugin_filepath)) {
+            $_return = $_plugin_filepath;
+            break;
+        }
+    }
+
+    if($_return === false) {
+        // still not found, try PHP include_path
+        if(isset($_relative_paths)) {
+            foreach ((array)$_relative_paths as $_plugin_dir) {
+
+                $_plugin_filepath = $_plugin_dir . DIRECTORY_SEPARATOR . $_plugin_filename;
+
+                $_params = array('file_path' => $_plugin_filepath);
+                require_once(SMARTY_CORE_DIR . 'core.get_include_path.php');
+                if(smarty_core_get_include_path($_params, $smarty)) {
+                    $_return = $_params['new_file_path'];
+                    break;
+                }
+            }
+        }
+    }
+    $_filepaths_cache[$_plugin_filename] = $_return;
+    return $_return;
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.is_trusted.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.is_trusted.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.is_trusted.php	(revision 405)
@@ -0,0 +1,47 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * determines if a resource is trusted or not
+ *
+ * @param string $resource_type
+ * @param string $resource_name
+ * @return boolean
+ */
+
+ // $resource_type, $resource_name
+
+function smarty_core_is_trusted($params, &$smarty)
+{
+    $_smarty_trusted = false;
+    if ($params['resource_type'] == 'file') {
+        if (!empty($smarty->trusted_dir)) {
+            $_rp = realpath($params['resource_name']);
+            foreach ((array)$smarty->trusted_dir as $curr_dir) {
+                if (!empty($curr_dir) && is_readable ($curr_dir)) {
+                    $_cd = realpath($curr_dir);
+                    if (strncmp($_rp, $_cd, strlen($_cd)) == 0
+                        && substr($_rp, strlen($_cd), 1) == DIRECTORY_SEPARATOR ) {
+                        $_smarty_trusted = true;
+                        break;
+                    }
+                }
+            }
+        }
+
+    } else {
+        // resource is not on local file system
+        $_smarty_trusted = call_user_func_array($smarty->_plugins['resource'][$params['resource_type']][0][3],
+                                                array($params['resource_name'], $smarty));
+    }
+
+    return $_smarty_trusted;
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.get_microtime.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.get_microtime.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.get_microtime.php	(revision 405)
@@ -0,0 +1,23 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Get seconds and microseconds
+ * @return double
+ */
+function smarty_core_get_microtime($params, &$smarty)
+{
+    $mtime = microtime();
+    $mtime = explode(" ", $mtime);
+    $mtime = (double)($mtime[1]) + (double)($mtime[0]);
+    return ($mtime);
+}
+
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.write_file.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.write_file.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.write_file.php	(revision 405)
@@ -0,0 +1,54 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * write out a file to disk
+ *
+ * @param string $filename
+ * @param string $contents
+ * @param boolean $create_dirs
+ * @return boolean
+ */
+function smarty_core_write_file($params, &$smarty)
+{
+    $_dirname = dirname($params['filename']);
+
+    if ($params['create_dirs']) {
+        $_params = array('dir' => $_dirname);
+        require_once(SMARTY_CORE_DIR . 'core.create_dir_structure.php');
+        smarty_core_create_dir_structure($_params, $smarty);
+    }
+
+    // write to tmp file, then rename it to avoid
+    // file locking race condition
+    $_tmp_file = tempnam($_dirname, 'wrt');
+
+    if (!($fd = @fopen($_tmp_file, 'wb'))) {
+        $_tmp_file = $_dirname . DIRECTORY_SEPARATOR . uniqid('wrt');
+        if (!($fd = @fopen($_tmp_file, 'wb'))) {
+            $smarty->trigger_error("problem writing temporary file '$_tmp_file'");
+            return false;
+        }
+    }
+
+    fwrite($fd, $params['contents']);
+    fclose($fd);
+
+    // Delete the file if it allready exists (this is needed on Win,
+    // because it cannot overwrite files with rename()
+    if (file_exists($params['filename'])) {
+        @unlink($params['filename']);
+    }
+    @rename($_tmp_file, $params['filename']);
+    @chmod($params['filename'], $smarty->_file_perms);
+
+    return true;
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.smarty_include_php.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.smarty_include_php.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.smarty_include_php.php	(revision 405)
@@ -0,0 +1,50 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * called for included php files within templates
+ *
+ * @param string $smarty_file
+ * @param string $smarty_assign variable to assign the included template's
+ *               output into
+ * @param boolean $smarty_once uses include_once if this is true
+ * @param array $smarty_include_vars associative array of vars from
+ *              {include file="blah" var=$var}
+ */
+
+//  $file, $assign, $once, $_smarty_include_vars
+
+function smarty_core_smarty_include_php($params, &$smarty)
+{
+    $_params = array('resource_name' => $params['smarty_file']);
+    require_once(SMARTY_CORE_DIR . 'core.get_php_resource.php');
+    smarty_core_get_php_resource($_params, $smarty);
+    $_smarty_resource_type = $_params['resource_type'];
+    $_smarty_php_resource = $_params['php_resource'];
+
+    if (!empty($params['smarty_assign'])) {
+        ob_start();
+        if ($_smarty_resource_type == 'file') {
+            $smarty->_include($_smarty_php_resource, $params['smarty_once'], $params['smarty_include_vars']);
+        } else {
+            $smarty->_eval($_smarty_php_resource, $params['smarty_include_vars']);
+        }
+        $smarty->assign($params['smarty_assign'], ob_get_contents());
+        ob_end_clean();
+    } else {
+        if ($_smarty_resource_type == 'file') {
+            $smarty->_include($_smarty_php_resource, $params['smarty_once'], $params['smarty_include_vars']);
+        } else {
+            $smarty->_eval($_smarty_php_resource, $params['smarty_include_vars']);
+        }
+    }
+}
+
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.display_debug_console.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.display_debug_console.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.display_debug_console.php	(revision 405)
@@ -0,0 +1,61 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Smarty debug_console function plugin
+ *
+ * Type:     core<br>
+ * Name:     display_debug_console<br>
+ * Purpose:  display the javascript debug console window
+ * @param array Format: null
+ * @param Smarty
+ */
+function smarty_core_display_debug_console($params, &$smarty)
+{
+    // we must force compile the debug template in case the environment
+    // changed between separate applications.
+
+    if(empty($smarty->debug_tpl)) {
+        // set path to debug template from SMARTY_DIR
+        $smarty->debug_tpl = SMARTY_DIR . 'debug.tpl';
+        if($smarty->security && is_file($smarty->debug_tpl)) {
+            $smarty->secure_dir[] = realpath($smarty->debug_tpl);
+        }
+        $smarty->debug_tpl = 'file:' . SMARTY_DIR . 'debug.tpl';
+    }
+
+    $_ldelim_orig = $smarty->left_delimiter;
+    $_rdelim_orig = $smarty->right_delimiter;
+
+    $smarty->left_delimiter = '{';
+    $smarty->right_delimiter = '}';
+
+    $_compile_id_orig = $smarty->_compile_id;
+    $smarty->_compile_id = null;
+
+    $_compile_path = $smarty->_get_compile_path($smarty->debug_tpl);
+    if ($smarty->_compile_resource($smarty->debug_tpl, $_compile_path))
+    {
+        ob_start();
+        $smarty->_include($_compile_path);
+        $_results = ob_get_contents();
+        ob_end_clean();
+    } else {
+        $_results = '';
+    }
+
+    $smarty->_compile_id = $_compile_id_orig;
+
+    $smarty->left_delimiter = $_ldelim_orig;
+    $smarty->right_delimiter = $_rdelim_orig;
+
+    return $_results;
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.get_php_resource.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.get_php_resource.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.get_php_resource.php	(revision 405)
@@ -0,0 +1,80 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Retrieves PHP script resource
+ *
+ * sets $php_resource to the returned resource
+ * @param string $resource
+ * @param string $resource_type
+ * @param  $php_resource
+ * @return boolean
+ */
+
+function smarty_core_get_php_resource(&$params, &$smarty)
+{
+
+    $params['resource_base_path'] = $smarty->trusted_dir;
+    $smarty->_parse_resource_name($params, $smarty);
+
+    /*
+     * Find out if the resource exists.
+     */
+
+    if ($params['resource_type'] == 'file') {
+        $_readable = false;
+        if(file_exists($params['resource_name']) && is_readable($params['resource_name'])) {
+            $_readable = true;
+        } else {
+            // test for file in include_path
+            $_params = array('file_path' => $params['resource_name']);
+            require_once(SMARTY_CORE_DIR . 'core.get_include_path.php');
+            if(smarty_core_get_include_path($_params, $smarty)) {
+                $_include_path = $_params['new_file_path'];
+                $_readable = true;
+            }
+        }
+    } else if ($params['resource_type'] != 'file') {
+        $_template_source = null;
+        $_readable = is_callable($smarty->_plugins['resource'][$params['resource_type']][0][0])
+            && call_user_func_array($smarty->_plugins['resource'][$params['resource_type']][0][0],
+                                    array($params['resource_name'], &$_template_source, &$smarty));
+    }
+
+    /*
+     * Set the error function, depending on which class calls us.
+     */
+    if (method_exists($smarty, '_syntax_error')) {
+        $_error_funcc = '_syntax_error';
+    } else {
+        $_error_funcc = 'trigger_error';
+    }
+
+    if ($_readable) {
+        if ($smarty->security) {
+            require_once(SMARTY_CORE_DIR . 'core.is_trusted.php');
+            if (!smarty_core_is_trusted($params, $smarty)) {
+                $smarty->$_error_funcc('(secure mode) ' . $params['resource_type'] . ':' . $params['resource_name'] . ' is not trusted');
+                return false;
+            }
+        }
+    } else {
+        $smarty->$_error_funcc($params['resource_type'] . ':' . $params['resource_name'] . ' is not readable');
+        return false;
+    }
+
+    if ($params['resource_type'] == 'file') {
+        $params['php_resource'] = $params['resource_name'];
+    } else {
+        $params['php_resource'] = $_template_source;
+    }
+    return true;
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.process_compiled_include.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.process_compiled_include.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.process_compiled_include.php	(revision 405)
@@ -0,0 +1,37 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Replace nocache-tags by results of the corresponding non-cacheable
+ * functions and return it
+ *
+ * @param string $compiled_tpl
+ * @param string $cached_source
+ * @return string
+ */
+
+function smarty_core_process_compiled_include($params, &$smarty)
+{
+    $_cache_including = $smarty->_cache_including;
+    $smarty->_cache_including = true;
+
+    $_return = $params['results'];
+
+    foreach ($smarty->_cache_info['cache_serials'] as $_include_file_path=>$_cache_serial) {
+        $smarty->_include($_include_file_path, true);
+    }
+
+    foreach ($smarty->_cache_serials as $_include_file_path=>$_cache_serial) {
+        $_return = preg_replace_callback('!(\{nocache\:('.$_cache_serial.')#(\d+)\})!s',
+                                         array(&$smarty, '_process_compiled_include_callback'),
+                                         $_return);
+    }
+    $smarty->_cache_including = $_cache_including;
+    return $_return;
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.read_cache_file.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.read_cache_file.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.read_cache_file.php	(revision 405)
@@ -0,0 +1,101 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * read a cache file, determine if it needs to be
+ * regenerated or not
+ *
+ * @param string $tpl_file
+ * @param string $cache_id
+ * @param string $compile_id
+ * @param string $results
+ * @return boolean
+ */
+
+//  $tpl_file, $cache_id, $compile_id, &$results
+
+function smarty_core_read_cache_file(&$params, &$smarty)
+{
+    static  $content_cache = array();
+
+    if ($smarty->force_compile) {
+        // force compile enabled, always regenerate
+        return false;
+    }
+
+    if (isset($content_cache[$params['tpl_file'].','.$params['cache_id'].','.$params['compile_id']])) {
+        list($params['results'], $smarty->_cache_info) = $content_cache[$params['tpl_file'].','.$params['cache_id'].','.$params['compile_id']];
+        return true;
+    }
+
+    if (!empty($smarty->cache_handler_func)) {
+        // use cache_handler function
+        call_user_func_array($smarty->cache_handler_func,
+                             array('read', &$smarty, &$params['results'], $params['tpl_file'], $params['cache_id'], $params['compile_id'], null));
+    } else {
+        // use local cache file
+        $_auto_id = $smarty->_get_auto_id($params['cache_id'], $params['compile_id']);
+        $_cache_file = $smarty->_get_auto_filename($smarty->cache_dir, $params['tpl_file'], $_auto_id);
+        $params['results'] = $smarty->_read_file($_cache_file);
+    }
+
+    if (empty($params['results'])) {
+        // nothing to parse (error?), regenerate cache
+        return false;
+    }
+
+    $_contents = $params['results'];
+    $_info_start = strpos($_contents, "\n") + 1;
+    $_info_len = (int)substr($_contents, 0, $_info_start - 1);
+    $_cache_info = unserialize(substr($_contents, $_info_start, $_info_len));
+    $params['results'] = substr($_contents, $_info_start + $_info_len);
+
+    if ($smarty->caching == 2 && isset ($_cache_info['expires'])){
+        // caching by expiration time
+        if ($_cache_info['expires'] > -1 && (time() > $_cache_info['expires'])) {
+            // cache expired, regenerate
+            return false;
+        }
+    } else {
+        // caching by lifetime
+        if ($smarty->cache_lifetime > -1 && (time() - $_cache_info['timestamp'] > $smarty->cache_lifetime)) {
+            // cache expired, regenerate
+            return false;
+        }
+    }
+
+    if ($smarty->compile_check) {
+        $_params = array('get_source' => false, 'quiet'=>true);
+        foreach (array_keys($_cache_info['template']) as $_template_dep) {
+            $_params['resource_name'] = $_template_dep;
+            if (!$smarty->_fetch_resource_info($_params) || $_cache_info['timestamp'] < $_params['resource_timestamp']) {
+                // template file has changed, regenerate cache
+                return false;
+            }
+        }
+
+        if (isset($_cache_info['config'])) {
+            $_params = array('resource_base_path' => $smarty->config_dir, 'get_source' => false, 'quiet'=>true);
+            foreach (array_keys($_cache_info['config']) as $_config_dep) {
+                $_params['resource_name'] = $_config_dep;
+                if (!$smarty->_fetch_resource_info($_params) || $_cache_info['timestamp'] < $_params['resource_timestamp']) {
+                    // config file has changed, regenerate cache
+                    return false;
+                }
+            }
+        }
+    }
+
+    $content_cache[$params['tpl_file'].','.$params['cache_id'].','.$params['compile_id']] = array($params['results'], $_cache_info);
+
+    $smarty->_cache_info = $_cache_info;
+    return true;
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.get_include_path.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.get_include_path.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.get_include_path.php	(revision 405)
@@ -0,0 +1,44 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Get path to file from include_path
+ *
+ * @param string $file_path
+ * @param string $new_file_path
+ * @return boolean
+ * @staticvar array|null
+ */
+
+//  $file_path, &$new_file_path
+
+function smarty_core_get_include_path(&$params, &$smarty)
+{
+    static $_path_array = null;
+
+    if(!isset($_path_array)) {
+        $_ini_include_path = ini_get('include_path');
+
+        if(strstr($_ini_include_path,';')) {
+            // windows pathnames
+            $_path_array = explode(';',$_ini_include_path);
+        } else {
+            $_path_array = explode(':',$_ini_include_path);
+        }
+    }
+    foreach ($_path_array as $_include_path) {
+        if (@is_readable($_include_path . DIRECTORY_SEPARATOR . $params['file_path'])) {
+               $params['new_file_path'] = $_include_path . DIRECTORY_SEPARATOR . $params['file_path'];
+            return true;
+        }
+    }
+    return false;
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.assign_smarty_interface.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.assign_smarty_interface.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.assign_smarty_interface.php	(revision 405)
@@ -0,0 +1,43 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Smarty assign_smarty_interface core plugin
+ *
+ * Type:     core<br>
+ * Name:     assign_smarty_interface<br>
+ * Purpose:  assign the $smarty interface variable
+ * @param array Format: null
+ * @param Smarty
+ */
+function smarty_core_assign_smarty_interface($params, &$smarty)
+{
+        if (isset($smarty->_smarty_vars) && isset($smarty->_smarty_vars['request'])) {
+            return;
+        }
+
+        $_globals_map = array('g'  => 'HTTP_GET_VARS',
+                             'p'  => 'HTTP_POST_VARS',
+                             'c'  => 'HTTP_COOKIE_VARS',
+                             's'  => 'HTTP_SERVER_VARS',
+                             'e'  => 'HTTP_ENV_VARS');
+
+        $_smarty_vars_request  = array();
+
+        foreach (preg_split('!!', strtolower($smarty->request_vars_order)) as $_c) {
+            if (isset($_globals_map[$_c])) {
+                $_smarty_vars_request = array_merge($_smarty_vars_request, $GLOBALS[$_globals_map[$_c]]);
+            }
+        }
+        $_smarty_vars_request = @array_merge($_smarty_vars_request, $GLOBALS['HTTP_SESSION_VARS']);
+
+        $smarty->_smarty_vars['request'] = $_smarty_vars_request;
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.load_resource_plugin.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.load_resource_plugin.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.load_resource_plugin.php	(revision 405)
@@ -0,0 +1,74 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * load a resource plugin
+ *
+ * @param string $type
+ */
+
+// $type
+
+function smarty_core_load_resource_plugin($params, &$smarty)
+{
+    /*
+     * Resource plugins are not quite like the other ones, so they are
+     * handled differently. The first element of plugin info is the array of
+     * functions provided by the plugin, the second one indicates whether
+     * all of them exist or not.
+     */
+
+    $_plugin = &$smarty->_plugins['resource'][$params['type']];
+    if (isset($_plugin)) {
+        if (!$_plugin[1] && count($_plugin[0])) {
+            $_plugin[1] = true;
+            foreach ($_plugin[0] as $_plugin_func) {
+                if (!is_callable($_plugin_func)) {
+                    $_plugin[1] = false;
+                    break;
+                }
+            }
+        }
+
+        if (!$_plugin[1]) {
+            $smarty->_trigger_fatal_error("[plugin] resource '" . $params['type'] . "' is not implemented", null, null, __FILE__, __LINE__);
+        }
+
+        return;
+    }
+
+    $_plugin_file = $smarty->_get_plugin_filepath('resource', $params['type']);
+    $_found = ($_plugin_file != false);
+
+    if ($_found) {            /*
+         * If the plugin file is found, it -must- provide the properly named
+         * plugin functions.
+         */
+        include_once($_plugin_file);
+
+        /*
+         * Locate functions that we require the plugin to provide.
+         */
+        $_resource_ops = array('source', 'timestamp', 'secure', 'trusted');
+        $_resource_funcs = array();
+        foreach ($_resource_ops as $_op) {
+            $_plugin_func = 'smarty_resource_' . $params['type'] . '_' . $_op;
+            if (!function_exists($_plugin_func)) {
+                $smarty->_trigger_fatal_error("[plugin] function $_plugin_func() not found in $_plugin_file", null, null, __FILE__, __LINE__);
+                return;
+            } else {
+                $_resource_funcs[] = $_plugin_func;
+            }
+        }
+
+        $smarty->_plugins['resource'][$params['type']] = array($_resource_funcs, true);
+    }
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.rm_auto.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.rm_auto.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.rm_auto.php	(revision 405)
@@ -0,0 +1,71 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * delete an automagically created file by name and id
+ *
+ * @param string $auto_base
+ * @param string $auto_source
+ * @param string $auto_id
+ * @param integer $exp_time
+ * @return boolean
+ */
+
+// $auto_base, $auto_source = null, $auto_id = null, $exp_time = null
+
+function smarty_core_rm_auto($params, &$smarty)
+{
+    if (!@is_dir($params['auto_base']))
+      return false;
+
+    if(!isset($params['auto_id']) && !isset($params['auto_source'])) {
+        $_params = array(
+            'dirname' => $params['auto_base'],
+            'level' => 0,
+            'exp_time' => $params['exp_time']
+        );
+        require_once(SMARTY_CORE_DIR . 'core.rmdir.php');
+        $_res = smarty_core_rmdir($_params, $smarty);
+    } else {
+        $_tname = $smarty->_get_auto_filename($params['auto_base'], $params['auto_source'], $params['auto_id']);
+
+        if(isset($params['auto_source'])) {
+            if (isset($params['extensions'])) {
+                $_res = false;
+                foreach ((array)$params['extensions'] as $_extension)
+                    $_res |= $smarty->_unlink($_tname.$_extension, $params['exp_time']);
+            } else {
+                $_res = $smarty->_unlink($_tname, $params['exp_time']);
+            }
+        } elseif ($smarty->use_sub_dirs) {
+            $_params = array(
+                'dirname' => $_tname,
+                'level' => 1,
+                'exp_time' => $params['exp_time']
+            );
+            require_once(SMARTY_CORE_DIR . 'core.rmdir.php');
+            $_res = smarty_core_rmdir($_params, $smarty);
+        } else {
+            // remove matching file names
+            $_handle = opendir($params['auto_base']);
+            $_res = true;
+            while (false !== ($_filename = readdir($_handle))) {
+                if($_filename == '.' || $_filename == '..') {
+                    continue;
+                } elseif (substr($params['auto_base'] . DIRECTORY_SEPARATOR . $_filename, 0, strlen($_tname)) == $_tname) {
+                    $_res &= (bool)$smarty->_unlink($params['auto_base'] . DIRECTORY_SEPARATOR . $_filename, $params['exp_time']);
+                }
+            }
+        }
+    }
+
+    return $_res;
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.write_compiled_include.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.write_compiled_include.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/core/core.write_compiled_include.php	(revision 405)
@@ -0,0 +1,91 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Extract non-cacheable parts out of compiled template and write it
+ *
+ * @param string $compile_path
+ * @param string $template_compiled
+ * @return boolean
+ */
+
+function smarty_core_write_compiled_include($params, &$smarty)
+{
+    $_tag_start = 'if \(\$this->caching && \!\$this->_cache_including\) \{ echo \'\{nocache\:('.$params['cache_serial'].')#(\d+)\}\'; \};';
+    $_tag_end   = 'if \(\$this->caching && \!\$this->_cache_including\) \{ echo \'\{/nocache\:(\\2)#(\\3)\}\'; \};';
+
+    preg_match_all('!('.$_tag_start.'(.*)'.$_tag_end.')!Us',
+                   $params['compiled_content'], $_match_source, PREG_SET_ORDER);
+
+    // no nocache-parts found: done
+    if (count($_match_source)==0) return;
+
+    // convert the matched php-code to functions
+    $_include_compiled =  "<?php /* Smarty version ".$smarty->_version.", created on ".strftime("%Y-%m-%d %H:%M:%S")."\n";
+    $_include_compiled .= "         compiled from " . strtr(urlencode($params['resource_name']), array('%2F'=>'/', '%3A'=>':')) . " */\n\n";
+
+    $_compile_path = $params['include_file_path'];
+
+    $smarty->_cache_serials[$_compile_path] = $params['cache_serial'];
+    $_include_compiled .= "\$this->_cache_serials['".$_compile_path."'] = '".$params['cache_serial']."';\n\n?>";
+
+    $_include_compiled .= $params['plugins_code'];
+    $_include_compiled .= "<?php";
+
+    $this_varname = ((double)phpversion() >= 5.0) ? '_smarty' : 'this';
+    for ($_i = 0, $_for_max = count($_match_source); $_i < $_for_max; $_i++) {
+        $_match =& $_match_source[$_i];
+        $source = $_match[4];
+        if ($this_varname == '_smarty') {
+            /* rename $this to $_smarty in the sourcecode */
+            $tokens = token_get_all('<?php ' . $_match[4]);
+
+            /* remove trailing <?php */
+            $open_tag = '';
+            while ($tokens) {
+                $token = array_shift($tokens);
+                if (is_array($token)) {
+                    $open_tag .= $token[1];
+                } else {
+                    $open_tag .= $token;
+                }
+                if ($open_tag == '<?php ') break;
+            }
+
+            for ($i=0, $count = count($tokens); $i < $count; $i++) {
+                if (is_array($tokens[$i])) {
+                    if ($tokens[$i][0] == T_VARIABLE && $tokens[$i][1] == '$this') {
+                        $tokens[$i] = '$' . $this_varname;
+                    } else {
+                        $tokens[$i] = $tokens[$i][1];
+                    }                   
+                }
+            }
+            $source = implode('', $tokens);
+        }
+
+        /* add function to compiled include */
+        $_include_compiled .= "
+function _smarty_tplfunc_$_match[2]_$_match[3](&\$$this_varname)
+{
+$source
+}
+
+";
+    }
+    $_include_compiled .= "\n\n?>\n";
+
+    $_params = array('filename' => $_compile_path,
+                     'contents' => $_include_compiled, 'create_dirs' => true);
+
+    require_once(SMARTY_CORE_DIR . 'core.write_file.php');
+    smarty_core_write_file($_params, $smarty);
+    return true;
+}
+
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/smarty/Smarty.class.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/smarty/Smarty.class.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/smarty/Smarty.class.php	(revision 405)
@@ -0,0 +1,1944 @@
+<?php
+
+/**
+ * Project:     Smarty: the PHP compiling template engine
+ * File:        Smarty.class.php
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * For questions, help, comments, discussion, etc., please join the
+ * Smarty mailing list. Send a blank e-mail to
+ * smarty-general-subscribe@lists.php.net
+ *
+ * @link http://smarty.php.net/
+ * @copyright 2001-2005 New Digital Group, Inc.
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @author Andrei Zmievski <andrei@php.net>
+ * @package Smarty
+ * @version 2.6.12
+ */
+
+/* $Id: Smarty.class.php,v 1.3 2006/05/01 02:37:25 onokazu Exp $ */
+
+/**
+ * DIR_SEP isn't used anymore, but third party apps might
+ */
+if(!defined('DIR_SEP')) {
+    define('DIR_SEP', DIRECTORY_SEPARATOR);
+}
+
+/**
+ * set SMARTY_DIR to absolute path to Smarty library files.
+ * if not defined, include_path will be used. Sets SMARTY_DIR only if user
+ * application has not already defined it.
+ */
+
+if (!defined('SMARTY_DIR')) {
+    define('SMARTY_DIR', dirname(__FILE__) . DIRECTORY_SEPARATOR);
+}
+
+if (!defined('SMARTY_CORE_DIR')) {
+    define('SMARTY_CORE_DIR', SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR);
+}
+
+define('SMARTY_PHP_PASSTHRU',   0);
+define('SMARTY_PHP_QUOTE',      1);
+define('SMARTY_PHP_REMOVE',     2);
+define('SMARTY_PHP_ALLOW',      3);
+
+/**
+ * @package Smarty
+ */
+class Smarty
+{
+    /**#@+
+     * Smarty Configuration Section
+     */
+
+    /**
+     * The name of the directory where templates are located.
+     *
+     * @var string
+     */
+    var $template_dir    =  'templates';
+
+    /**
+     * The directory where compiled templates are located.
+     *
+     * @var string
+     */
+    var $compile_dir     =  'templates_c';
+
+    /**
+     * The directory where config files are located.
+     *
+     * @var string
+     */
+    var $config_dir      =  'configs';
+
+    /**
+     * An array of directories searched for plugins.
+     *
+     * @var array
+     */
+    var $plugins_dir     =  array('plugins');
+
+    /**
+     * If debugging is enabled, a debug console window will display
+     * when the page loads (make sure your browser allows unrequested
+     * popup windows)
+     *
+     * @var boolean
+     */
+    var $debugging       =  false;
+
+    /**
+     * When set, smarty does uses this value as error_reporting-level.
+     *
+     * @var boolean
+     */
+    var $error_reporting  =  null;
+
+    /**
+     * This is the path to the debug console template. If not set,
+     * the default one will be used.
+     *
+     * @var string
+     */
+    var $debug_tpl       =  '';
+
+    /**
+     * This determines if debugging is enable-able from the browser.
+     * <ul>
+     *  <li>NONE => no debugging control allowed</li>
+     *  <li>URL => enable debugging when SMARTY_DEBUG is found in the URL.</li>
+     * </ul>
+     * @link http://www.foo.dom/index.php?SMARTY_DEBUG
+     * @var string
+     */
+    var $debugging_ctrl  =  'NONE';
+
+    /**
+     * This tells Smarty whether to check for recompiling or not. Recompiling
+     * does not need to happen unless a template or config file is changed.
+     * Typically you enable this during development, and disable for
+     * production.
+     *
+     * @var boolean
+     */
+    var $compile_check   =  true;
+
+    /**
+     * This forces templates to compile every time. Useful for development
+     * or debugging.
+     *
+     * @var boolean
+     */
+    var $force_compile   =  false;
+
+    /**
+     * This enables template caching.
+     * <ul>
+     *  <li>0 = no caching</li>
+     *  <li>1 = use class cache_lifetime value</li>
+     *  <li>2 = use cache_lifetime in cache file</li>
+     * </ul>
+     * @var integer
+     */
+    var $caching         =  0;
+
+    /**
+     * The name of the directory for cache files.
+     *
+     * @var string
+     */
+    var $cache_dir       =  'cache';
+
+    /**
+     * This is the number of seconds cached content will persist.
+     * <ul>
+     *  <li>0 = always regenerate cache</li>
+     *  <li>-1 = never expires</li>
+     * </ul>
+     *
+     * @var integer
+     */
+    var $cache_lifetime  =  3600;
+
+    /**
+     * Only used when $caching is enabled. If true, then If-Modified-Since headers
+     * are respected with cached content, and appropriate HTTP headers are sent.
+     * This way repeated hits to a cached page do not send the entire page to the
+     * client every time.
+     *
+     * @var boolean
+     */
+    var $cache_modified_check = false;
+
+    /**
+     * This determines how Smarty handles "<?php ... ?>" tags in templates.
+     * possible values:
+     * <ul>
+     *  <li>SMARTY_PHP_PASSTHRU -> print tags as plain text</li>
+     *  <li>SMARTY_PHP_QUOTE    -> escape tags as entities</li>
+     *  <li>SMARTY_PHP_REMOVE   -> remove php tags</li>
+     *  <li>SMARTY_PHP_ALLOW    -> execute php tags</li>
+     * </ul>
+     *
+     * @var integer
+     */
+    var $php_handling    =  SMARTY_PHP_PASSTHRU;
+
+    /**
+     * This enables template security. When enabled, many things are restricted
+     * in the templates that normally would go unchecked. This is useful when
+     * untrusted parties are editing templates and you want a reasonable level
+     * of security. (no direct execution of PHP in templates for example)
+     *
+     * @var boolean
+     */
+    var $security       =   false;
+
+    /**
+     * This is the list of template directories that are considered secure. This
+     * is used only if {@link $security} is enabled. One directory per array
+     * element.  {@link $template_dir} is in this list implicitly.
+     *
+     * @var array
+     */
+    var $secure_dir     =   array();
+
+    /**
+     * These are the security settings for Smarty. They are used only when
+     * {@link $security} is enabled.
+     *
+     * @var array
+     */
+    var $security_settings  = array(
+                                    'PHP_HANDLING'    => false,
+                                    'IF_FUNCS'        => array('array', 'list',
+                                                               'isset', 'empty',
+                                                               'count', 'sizeof',
+                                                               'in_array', 'is_array',
+                                                               'true', 'false', 'null'),
+                                    'INCLUDE_ANY'     => false,
+                                    'PHP_TAGS'        => false,
+                                    'MODIFIER_FUNCS'  => array('count'),
+                                    'ALLOW_CONSTANTS'  => false
+                                   );
+
+    /**
+     * This is an array of directories where trusted php scripts reside.
+     * {@link $security} is disabled during their inclusion/execution.
+     *
+     * @var array
+     */
+    var $trusted_dir        = array();
+
+    /**
+     * The left delimiter used for the template tags.
+     *
+     * @var string
+     */
+    var $left_delimiter  =  '{';
+
+    /**
+     * The right delimiter used for the template tags.
+     *
+     * @var string
+     */
+    var $right_delimiter =  '}';
+
+    /**
+     * The order in which request variables are registered, similar to
+     * variables_order in php.ini E = Environment, G = GET, P = POST,
+     * C = Cookies, S = Server
+     *
+     * @var string
+     */
+    var $request_vars_order    = 'EGPCS';
+
+    /**
+     * Indicates wether $HTTP_*_VARS[] (request_use_auto_globals=false)
+     * are uses as request-vars or $_*[]-vars. note: if
+     * request_use_auto_globals is true, then $request_vars_order has
+     * no effect, but the php-ini-value "gpc_order"
+     *
+     * @var boolean
+     */
+    var $request_use_auto_globals      = true;
+
+    /**
+     * Set this if you want different sets of compiled files for the same
+     * templates. This is useful for things like different languages.
+     * Instead of creating separate sets of templates per language, you
+     * set different compile_ids like 'en' and 'de'.
+     *
+     * @var string
+     */
+    var $compile_id            = null;
+
+    /**
+     * This tells Smarty whether or not to use sub dirs in the cache/ and
+     * templates_c/ directories. sub directories better organized, but
+     * may not work well with PHP safe mode enabled.
+     *
+     * @var boolean
+     *
+     */
+    var $use_sub_dirs          = false;
+
+    /**
+     * This is a list of the modifiers to apply to all template variables.
+     * Put each modifier in a separate array element in the order you want
+     * them applied. example: <code>array('escape:"htmlall"');</code>
+     *
+     * @var array
+     */
+    var $default_modifiers        = array();
+
+    /**
+     * This is the resource type to be used when not specified
+     * at the beginning of the resource path. examples:
+     * $smarty->display('file:index.tpl');
+     * $smarty->display('db:index.tpl');
+     * $smarty->display('index.tpl'); // will use default resource type
+     * {include file="file:index.tpl"}
+     * {include file="db:index.tpl"}
+     * {include file="index.tpl"} {* will use default resource type *}
+     *
+     * @var array
+     */
+    var $default_resource_type    = 'file';
+
+    /**
+     * The function used for cache file handling. If not set, built-in caching is used.
+     *
+     * @var null|string function name
+     */
+    var $cache_handler_func   = null;
+
+    /**
+     * This indicates which filters are automatically loaded into Smarty.
+     *
+     * @var array array of filter names
+     */
+    var $autoload_filters = array();
+
+    /**#@+
+     * @var boolean
+     */
+    /**
+     * This tells if config file vars of the same name overwrite each other or not.
+     * if disabled, same name variables are accumulated in an array.
+     */
+    var $config_overwrite = true;
+
+    /**
+     * This tells whether or not to automatically booleanize config file variables.
+     * If enabled, then the strings "on", "true", and "yes" are treated as boolean
+     * true, and "off", "false" and "no" are treated as boolean false.
+     */
+    var $config_booleanize = true;
+
+    /**
+     * This tells whether hidden sections [.foobar] are readable from the
+     * tempalates or not. Normally you would never allow this since that is
+     * the point behind hidden sections: the application can access them, but
+     * the templates cannot.
+     */
+    var $config_read_hidden = false;
+
+    /**
+     * This tells whether or not automatically fix newlines in config files.
+     * It basically converts \r (mac) or \r\n (dos) to \n
+     */
+    var $config_fix_newlines = true;
+    /**#@-*/
+
+    /**
+     * If a template cannot be found, this PHP function will be executed.
+     * Useful for creating templates on-the-fly or other special action.
+     *
+     * @var string function name
+     */
+    var $default_template_handler_func = '';
+
+    /**
+     * The file that contains the compiler class. This can a full
+     * pathname, or relative to the php_include path.
+     *
+     * @var string
+     */
+    var $compiler_file        =    'Smarty_Compiler.class.php';
+
+    /**
+     * The class used for compiling templates.
+     *
+     * @var string
+     */
+    var $compiler_class        =   'Smarty_Compiler';
+
+    /**
+     * The class used to load config vars.
+     *
+     * @var string
+     */
+    var $config_class          =   'Config_File';
+
+/**#@+
+ * END Smarty Configuration Section
+ * There should be no need to touch anything below this line.
+ * @access private
+ */
+    /**
+     * where assigned template vars are kept
+     *
+     * @var array
+     */
+    var $_tpl_vars             = array();
+
+    /**
+     * stores run-time $smarty.* vars
+     *
+     * @var null|array
+     */
+    var $_smarty_vars          = null;
+
+    /**
+     * keeps track of sections
+     *
+     * @var array
+     */
+    var $_sections             = array();
+
+    /**
+     * keeps track of foreach blocks
+     *
+     * @var array
+     */
+    var $_foreach              = array();
+
+    /**
+     * keeps track of tag hierarchy
+     *
+     * @var array
+     */
+    var $_tag_stack            = array();
+
+    /**
+     * configuration object
+     *
+     * @var Config_file
+     */
+    var $_conf_obj             = null;
+
+    /**
+     * loaded configuration settings
+     *
+     * @var array
+     */
+    var $_config               = array(array('vars'  => array(), 'files' => array()));
+
+    /**
+     * md5 checksum of the string 'Smarty'
+     *
+     * @var string
+     */
+    var $_smarty_md5           = 'f8d698aea36fcbead2b9d5359ffca76f';
+
+    /**
+     * Smarty version number
+     *
+     * @var string
+     */
+    var $_version              = '2.6.12';
+
+    /**
+     * current template inclusion depth
+     *
+     * @var integer
+     */
+    var $_inclusion_depth      = 0;
+
+    /**
+     * for different compiled templates
+     *
+     * @var string
+     */
+    var $_compile_id           = null;
+
+    /**
+     * text in URL to enable debug mode
+     *
+     * @var string
+     */
+    var $_smarty_debug_id      = 'SMARTY_DEBUG';
+
+    /**
+     * debugging information for debug console
+     *
+     * @var array
+     */
+    var $_smarty_debug_info    = array();
+
+    /**
+     * info that makes up a cache file
+     *
+     * @var array
+     */
+    var $_cache_info           = array();
+
+    /**
+     * default file permissions
+     *
+     * @var integer
+     */
+    var $_file_perms           = 0644;
+
+    /**
+     * default dir permissions
+     *
+     * @var integer
+     */
+    var $_dir_perms               = 0771;
+
+    /**
+     * registered objects
+     *
+     * @var array
+     */
+    var $_reg_objects           = array();
+
+    /**
+     * table keeping track of plugins
+     *
+     * @var array
+     */
+    var $_plugins              = array(
+                                       'modifier'      => array(),
+                                       'function'      => array(),
+                                       'block'         => array(),
+                                       'compiler'      => array(),
+                                       'prefilter'     => array(),
+                                       'postfilter'    => array(),
+                                       'outputfilter'  => array(),
+                                       'resource'      => array(),
+                                       'insert'        => array());
+
+
+    /**
+     * cache serials
+     *
+     * @var array
+     */
+    var $_cache_serials = array();
+
+    /**
+     * name of optional cache include file
+     *
+     * @var string
+     */
+    var $_cache_include = null;
+
+    /**
+     * indicate if the current code is used in a compiled
+     * include
+     *
+     * @var string
+     */
+    var $_cache_including = false;
+
+    /**#@-*/
+    /**
+     * The class constructor.
+     */
+    function Smarty()
+    {
+      $this->assign('SCRIPT_NAME', isset($_SERVER['SCRIPT_NAME']) ? $_SERVER['SCRIPT_NAME']
+                    : @$GLOBALS['HTTP_SERVER_VARS']['SCRIPT_NAME']);
+    }
+
+    /**
+     * assigns values to template variables
+     *
+     * @param array|string $tpl_var the template variable name(s)
+     * @param mixed $value the value to assign
+     */
+    function assign($tpl_var, $value = null)
+    {
+        if (is_array($tpl_var)){
+            foreach ($tpl_var as $key => $val) {
+                if ($key != '') {
+                    $this->_tpl_vars[$key] = $val;
+                }
+            }
+        } else {
+            if ($tpl_var != '')
+                $this->_tpl_vars[$tpl_var] = $value;
+        }
+    }
+
+    /**
+     * assigns values to template variables by reference
+     *
+     * @param string $tpl_var the template variable name
+     * @param mixed $value the referenced value to assign
+     */
+    function assign_by_ref($tpl_var, &$value)
+    {
+        if ($tpl_var != '')
+            $this->_tpl_vars[$tpl_var] = &$value;
+    }
+
+    /**
+     * appends values to template variables
+     *
+     * @param array|string $tpl_var the template variable name(s)
+     * @param mixed $value the value to append
+     */
+    function append($tpl_var, $value=null, $merge=false)
+    {
+        if (is_array($tpl_var)) {
+            // $tpl_var is an array, ignore $value
+            foreach ($tpl_var as $_key => $_val) {
+                if ($_key != '') {
+                    if(!@is_array($this->_tpl_vars[$_key])) {
+                        settype($this->_tpl_vars[$_key],'array');
+                    }
+                    if($merge && is_array($_val)) {
+                        foreach($_val as $_mkey => $_mval) {
+                            $this->_tpl_vars[$_key][$_mkey] = $_mval;
+                        }
+                    } else {
+                        $this->_tpl_vars[$_key][] = $_val;
+                    }
+                }
+            }
+        } else {
+            if ($tpl_var != '' && isset($value)) {
+                if(!@is_array($this->_tpl_vars[$tpl_var])) {
+                    settype($this->_tpl_vars[$tpl_var],'array');
+                }
+                if($merge && is_array($value)) {
+                    foreach($value as $_mkey => $_mval) {
+                        $this->_tpl_vars[$tpl_var][$_mkey] = $_mval;
+                    }
+                } else {
+                    $this->_tpl_vars[$tpl_var][] = $value;
+                }
+            }
+        }
+    }
+
+    /**
+     * appends values to template variables by reference
+     *
+     * @param string $tpl_var the template variable name
+     * @param mixed $value the referenced value to append
+     */
+    function append_by_ref($tpl_var, &$value, $merge=false)
+    {
+        if ($tpl_var != '' && isset($value)) {
+            if(!@is_array($this->_tpl_vars[$tpl_var])) {
+             settype($this->_tpl_vars[$tpl_var],'array');
+            }
+            if ($merge && is_array($value)) {
+                foreach($value as $_key => $_val) {
+                    $this->_tpl_vars[$tpl_var][$_key] = &$value[$_key];
+                }
+            } else {
+                $this->_tpl_vars[$tpl_var][] = &$value;
+            }
+        }
+    }
+
+
+    /**
+     * clear the given assigned template variable.
+     *
+     * @param string $tpl_var the template variable to clear
+     */
+    function clear_assign($tpl_var)
+    {
+        if (is_array($tpl_var))
+            foreach ($tpl_var as $curr_var)
+                unset($this->_tpl_vars[$curr_var]);
+        else
+            unset($this->_tpl_vars[$tpl_var]);
+    }
+
+
+    /**
+     * Registers custom function to be used in templates
+     *
+     * @param string $function the name of the template function
+     * @param string $function_impl the name of the PHP function to register
+     */
+    function register_function($function, $function_impl, $cacheable=true, $cache_attrs=null)
+    {
+        $this->_plugins['function'][$function] =
+            array($function_impl, null, null, false, $cacheable, $cache_attrs);
+
+    }
+
+    /**
+     * Unregisters custom function
+     *
+     * @param string $function name of template function
+     */
+    function unregister_function($function)
+    {
+        unset($this->_plugins['function'][$function]);
+    }
+
+    /**
+     * Registers object to be used in templates
+     *
+     * @param string $object name of template object
+     * @param object &$object_impl the referenced PHP object to register
+     * @param null|array $allowed list of allowed methods (empty = all)
+     * @param boolean $smarty_args smarty argument format, else traditional
+     * @param null|array $block_functs list of methods that are block format
+     */
+    function register_object($object, &$object_impl, $allowed = array(), $smarty_args = true, $block_methods = array())
+    {
+        settype($allowed, 'array');
+        settype($smarty_args, 'boolean');
+        $this->_reg_objects[$object] =
+            array(&$object_impl, $allowed, $smarty_args, $block_methods);
+    }
+
+    /**
+     * Unregisters object
+     *
+     * @param string $object name of template object
+     */
+    function unregister_object($object)
+    {
+        unset($this->_reg_objects[$object]);
+    }
+
+
+    /**
+     * Registers block function to be used in templates
+     *
+     * @param string $block name of template block
+     * @param string $block_impl PHP function to register
+     */
+    function register_block($block, $block_impl, $cacheable=true, $cache_attrs=null)
+    {
+        $this->_plugins['block'][$block] =
+            array($block_impl, null, null, false, $cacheable, $cache_attrs);
+    }
+
+    /**
+     * Unregisters block function
+     *
+     * @param string $block name of template function
+     */
+    function unregister_block($block)
+    {
+        unset($this->_plugins['block'][$block]);
+    }
+
+    /**
+     * Registers compiler function
+     *
+     * @param string $function name of template function
+     * @param string $function_impl name of PHP function to register
+     */
+    function register_compiler_function($function, $function_impl, $cacheable=true)
+    {
+        $this->_plugins['compiler'][$function] =
+            array($function_impl, null, null, false, $cacheable);
+    }
+
+    /**
+     * Unregisters compiler function
+     *
+     * @param string $function name of template function
+     */
+    function unregister_compiler_function($function)
+    {
+        unset($this->_plugins['compiler'][$function]);
+    }
+
+    /**
+     * Registers modifier to be used in templates
+     *
+     * @param string $modifier name of template modifier
+     * @param string $modifier_impl name of PHP function to register
+     */
+    function register_modifier($modifier, $modifier_impl)
+    {
+        $this->_plugins['modifier'][$modifier] =
+            array($modifier_impl, null, null, false);
+    }
+
+    /**
+     * Unregisters modifier
+     *
+     * @param string $modifier name of template modifier
+     */
+    function unregister_modifier($modifier)
+    {
+        unset($this->_plugins['modifier'][$modifier]);
+    }
+
+    /**
+     * Registers a resource to fetch a template
+     *
+     * @param string $type name of resource
+     * @param array $functions array of functions to handle resource
+     */
+    function register_resource($type, $functions)
+    {
+        if (count($functions)==4) {
+            $this->_plugins['resource'][$type] =
+                array($functions, false);
+
+        } elseif (count($functions)==5) {
+            $this->_plugins['resource'][$type] =
+                array(array(array(&$functions[0], $functions[1])
+                            ,array(&$functions[0], $functions[2])
+                            ,array(&$functions[0], $functions[3])
+                            ,array(&$functions[0], $functions[4]))
+                      ,false);
+
+        } else {
+            $this->trigger_error("malformed function-list for '$type' in register_resource");
+
+        }
+    }
+
+    /**
+     * Unregisters a resource
+     *
+     * @param string $type name of resource
+     */
+    function unregister_resource($type)
+    {
+        unset($this->_plugins['resource'][$type]);
+    }
+
+    /**
+     * Registers a prefilter function to apply
+     * to a template before compiling
+     *
+     * @param string $function name of PHP function to register
+     */
+    function register_prefilter($function)
+    {
+    $_name = (is_array($function)) ? $function[1] : $function;
+        $this->_plugins['prefilter'][$_name]
+            = array($function, null, null, false);
+    }
+
+    /**
+     * Unregisters a prefilter function
+     *
+     * @param string $function name of PHP function
+     */
+    function unregister_prefilter($function)
+    {
+        unset($this->_plugins['prefilter'][$function]);
+    }
+
+    /**
+     * Registers a postfilter function to apply
+     * to a compiled template after compilation
+     *
+     * @param string $function name of PHP function to register
+     */
+    function register_postfilter($function)
+    {
+    $_name = (is_array($function)) ? $function[1] : $function;
+        $this->_plugins['postfilter'][$_name]
+            = array($function, null, null, false);
+    }
+
+    /**
+     * Unregisters a postfilter function
+     *
+     * @param string $function name of PHP function
+     */
+    function unregister_postfilter($function)
+    {
+        unset($this->_plugins['postfilter'][$function]);
+    }
+
+    /**
+     * Registers an output filter function to apply
+     * to a template output
+     *
+     * @param string $function name of PHP function
+     */
+    function register_outputfilter($function)
+    {
+    $_name = (is_array($function)) ? $function[1] : $function;
+        $this->_plugins['outputfilter'][$_name]
+            = array($function, null, null, false);
+    }
+
+    /**
+     * Unregisters an outputfilter function
+     *
+     * @param string $function name of PHP function
+     */
+    function unregister_outputfilter($function)
+    {
+        unset($this->_plugins['outputfilter'][$function]);
+    }
+
+    /**
+     * load a filter of specified type and name
+     *
+     * @param string $type filter type
+     * @param string $name filter name
+     */
+    function load_filter($type, $name)
+    {
+        switch ($type) {
+            case 'output':
+                $_params = array('plugins' => array(array($type . 'filter', $name, null, null, false)));
+                require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
+                smarty_core_load_plugins($_params, $this);
+                break;
+
+            case 'pre':
+            case 'post':
+                if (!isset($this->_plugins[$type . 'filter'][$name]))
+                    $this->_plugins[$type . 'filter'][$name] = false;
+                break;
+        }
+    }
+
+    /**
+     * clear cached content for the given template and cache id
+     *
+     * @param string $tpl_file name of template file
+     * @param string $cache_id name of cache_id
+     * @param string $compile_id name of compile_id
+     * @param string $exp_time expiration time
+     * @return boolean
+     */
+    function clear_cache($tpl_file = null, $cache_id = null, $compile_id = null, $exp_time = null)
+    {
+
+        if (!isset($compile_id))
+            $compile_id = $this->compile_id;
+
+        if (!isset($tpl_file))
+            $compile_id = null;
+
+        $_auto_id = $this->_get_auto_id($cache_id, $compile_id);
+
+        if (!empty($this->cache_handler_func)) {
+            return call_user_func_array($this->cache_handler_func,
+                                  array('clear', &$this, &$dummy, $tpl_file, $cache_id, $compile_id, $exp_time));
+        } else {
+            $_params = array('auto_base' => $this->cache_dir,
+                            'auto_source' => $tpl_file,
+                            'auto_id' => $_auto_id,
+                            'exp_time' => $exp_time);
+            require_once(SMARTY_CORE_DIR . 'core.rm_auto.php');
+            return smarty_core_rm_auto($_params, $this);
+        }
+
+    }
+
+
+    /**
+     * clear the entire contents of cache (all templates)
+     *
+     * @param string $exp_time expire time
+     * @return boolean results of {@link smarty_core_rm_auto()}
+     */
+    function clear_all_cache($exp_time = null)
+    {
+        return $this->clear_cache(null, null, null, $exp_time);
+    }
+
+
+    /**
+     * test to see if valid cache exists for this template
+     *
+     * @param string $tpl_file name of template file
+     * @param string $cache_id
+     * @param string $compile_id
+     * @return string|false results of {@link _read_cache_file()}
+     */
+    function is_cached($tpl_file, $cache_id = null, $compile_id = null)
+    {
+        if (!$this->caching)
+            return false;
+
+        if (!isset($compile_id))
+            $compile_id = $this->compile_id;
+
+        $_params = array(
+            'tpl_file' => $tpl_file,
+            'cache_id' => $cache_id,
+            'compile_id' => $compile_id
+        );
+        require_once(SMARTY_CORE_DIR . 'core.read_cache_file.php');
+        return smarty_core_read_cache_file($_params, $this);
+    }
+
+
+    /**
+     * clear all the assigned template variables.
+     *
+     */
+    function clear_all_assign()
+    {
+        $this->_tpl_vars = array();
+    }
+
+    /**
+     * clears compiled version of specified template resource,
+     * or all compiled template files if one is not specified.
+     * This function is for advanced use only, not normally needed.
+     *
+     * @param string $tpl_file
+     * @param string $compile_id
+     * @param string $exp_time
+     * @return boolean results of {@link smarty_core_rm_auto()}
+     */
+    function clear_compiled_tpl($tpl_file = null, $compile_id = null, $exp_time = null)
+    {
+        if (!isset($compile_id)) {
+            $compile_id = $this->compile_id;
+        }
+        $_params = array('auto_base' => $this->compile_dir,
+                        'auto_source' => $tpl_file,
+                        'auto_id' => $compile_id,
+                        'exp_time' => $exp_time,
+                        'extensions' => array('.inc', '.php'));
+        require_once(SMARTY_CORE_DIR . 'core.rm_auto.php');
+        return smarty_core_rm_auto($_params, $this);
+    }
+
+    /**
+     * Checks whether requested template exists.
+     *
+     * @param string $tpl_file
+     * @return boolean
+     */
+    function template_exists($tpl_file)
+    {
+        $_params = array('resource_name' => $tpl_file, 'quiet'=>true, 'get_source'=>false);
+        return $this->_fetch_resource_info($_params);
+    }
+
+    /**
+     * Returns an array containing template variables
+     *
+     * @param string $name
+     * @param string $type
+     * @return array
+     */
+    function &get_template_vars($name=null)
+    {
+        if(!isset($name)) {
+            return $this->_tpl_vars;
+        } elseif(isset($this->_tpl_vars[$name])) {
+            return $this->_tpl_vars[$name];
+        } else {
+            // var non-existant, return valid reference
+            $_tmp = null;
+            return $_tmp;   
+        }
+    }
+
+    /**
+     * Returns an array containing config variables
+     *
+     * @param string $name
+     * @param string $type
+     * @return array
+     */
+    function &get_config_vars($name=null)
+    {
+        if(!isset($name) && is_array($this->_config[0])) {
+            return $this->_config[0]['vars'];
+        } else if(isset($this->_config[0]['vars'][$name])) {
+            return $this->_config[0]['vars'][$name];
+        } else {
+            // var non-existant, return valid reference
+            $_tmp = null;
+            return $_tmp;
+        }
+    }
+
+    /**
+     * trigger Smarty error
+     *
+     * @param string $error_msg
+     * @param integer $error_type
+     */
+    function trigger_error($error_msg, $error_type = E_USER_WARNING)
+    {
+        trigger_error("Smarty error: $error_msg", $error_type);
+    }
+
+
+    /**
+     * executes & displays the template results
+     *
+     * @param string $resource_name
+     * @param string $cache_id
+     * @param string $compile_id
+     */
+    function display($resource_name, $cache_id = null, $compile_id = null)
+    {
+        $this->fetch($resource_name, $cache_id, $compile_id, true);
+    }
+
+    /**
+     * executes & returns or displays the template results
+     *
+     * @param string $resource_name
+     * @param string $cache_id
+     * @param string $compile_id
+     * @param boolean $display
+     */
+    function fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)
+    {
+        static $_cache_info = array();
+        
+        $_smarty_old_error_level = $this->debugging ? error_reporting() : error_reporting(isset($this->error_reporting)
+               ? $this->error_reporting : error_reporting() & ~E_NOTICE);
+
+        if (!$this->debugging && $this->debugging_ctrl == 'URL') {
+            $_query_string = $this->request_use_auto_globals ? $_SERVER['QUERY_STRING'] : $GLOBALS['HTTP_SERVER_VARS']['QUERY_STRING'];
+            if (@strstr($_query_string, $this->_smarty_debug_id)) {
+                if (@strstr($_query_string, $this->_smarty_debug_id . '=on')) {
+                    // enable debugging for this browser session
+                    @setcookie('SMARTY_DEBUG', true);
+                    $this->debugging = true;
+                } elseif (@strstr($_query_string, $this->_smarty_debug_id . '=off')) {
+                    // disable debugging for this browser session
+                    @setcookie('SMARTY_DEBUG', false);
+                    $this->debugging = false;
+                } else {
+                    // enable debugging for this page
+                    $this->debugging = true;
+                }
+            } else {
+                $this->debugging = (bool)($this->request_use_auto_globals ? @$_COOKIE['SMARTY_DEBUG'] : @$GLOBALS['HTTP_COOKIE_VARS']['SMARTY_DEBUG']);
+            }
+        }
+
+        if ($this->debugging) {
+            // capture time for debugging info
+            $_params = array();
+            require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
+            $_debug_start_time = smarty_core_get_microtime($_params, $this);
+            $this->_smarty_debug_info[] = array('type'      => 'template',
+                                                'filename'  => $resource_name,
+                                                'depth'     => 0);
+            $_included_tpls_idx = count($this->_smarty_debug_info) - 1;
+        }
+
+        if (!isset($compile_id)) {
+            $compile_id = $this->compile_id;
+        }
+
+        $this->_compile_id = $compile_id;
+        $this->_inclusion_depth = 0;
+
+        if ($this->caching) {
+            // save old cache_info, initialize cache_info
+            array_push($_cache_info, $this->_cache_info);
+            $this->_cache_info = array();
+            $_params = array(
+                'tpl_file' => $resource_name,
+                'cache_id' => $cache_id,
+                'compile_id' => $compile_id,
+                'results' => null
+            );
+            require_once(SMARTY_CORE_DIR . 'core.read_cache_file.php');
+            if (smarty_core_read_cache_file($_params, $this)) {
+                $_smarty_results = $_params['results'];
+                if (!empty($this->_cache_info['insert_tags'])) {
+                    $_params = array('plugins' => $this->_cache_info['insert_tags']);
+                    require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
+                    smarty_core_load_plugins($_params, $this);
+                    $_params = array('results' => $_smarty_results);
+                    require_once(SMARTY_CORE_DIR . 'core.process_cached_inserts.php');
+                    $_smarty_results = smarty_core_process_cached_inserts($_params, $this);
+                }
+                if (!empty($this->_cache_info['cache_serials'])) {
+                    $_params = array('results' => $_smarty_results);
+                    require_once(SMARTY_CORE_DIR . 'core.process_compiled_include.php');
+                    $_smarty_results = smarty_core_process_compiled_include($_params, $this);
+                }
+
+
+                if ($display) {
+                    if ($this->debugging)
+                    {
+                        // capture time for debugging info
+                        $_params = array();
+                        require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
+                        $this->_smarty_debug_info[$_included_tpls_idx]['exec_time'] = smarty_core_get_microtime($_params, $this) - $_debug_start_time;
+                        require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');
+                        $_smarty_results .= smarty_core_display_debug_console($_params, $this);
+                    }
+                    if ($this->cache_modified_check) {
+                        $_server_vars = ($this->request_use_auto_globals) ? $_SERVER : $GLOBALS['HTTP_SERVER_VARS'];
+                        $_last_modified_date = @substr($_server_vars['HTTP_IF_MODIFIED_SINCE'], 0, strpos($_server_vars['HTTP_IF_MODIFIED_SINCE'], 'GMT') + 3);
+                        $_gmt_mtime = gmdate('D, d M Y H:i:s', $this->_cache_info['timestamp']).' GMT';
+                        if (@count($this->_cache_info['insert_tags']) == 0
+                            && !$this->_cache_serials
+                            && $_gmt_mtime == $_last_modified_date) {
+                            if (php_sapi_name()=='cgi')
+                                header('Status: 304 Not Modified');
+                            else
+                                header('HTTP/1.1 304 Not Modified');
+
+                        } else {
+                            header('Last-Modified: '.$_gmt_mtime);
+                            echo $_smarty_results;
+                        }
+                    } else {
+                            echo $_smarty_results;
+                    }
+                    error_reporting($_smarty_old_error_level);
+                    // restore initial cache_info
+                    $this->_cache_info = array_pop($_cache_info);
+                    return true;
+                } else {
+                    error_reporting($_smarty_old_error_level);
+                    // restore initial cache_info
+                    $this->_cache_info = array_pop($_cache_info);
+                    return $_smarty_results;
+                }
+            } else {
+                $this->_cache_info['template'][$resource_name] = true;
+                if ($this->cache_modified_check && $display) {
+                    header('Last-Modified: '.gmdate('D, d M Y H:i:s', time()).' GMT');
+                }
+            }
+        }
+
+        // load filters that are marked as autoload
+        if (count($this->autoload_filters)) {
+            foreach ($this->autoload_filters as $_filter_type => $_filters) {
+                foreach ($_filters as $_filter) {
+                    $this->load_filter($_filter_type, $_filter);
+                }
+            }
+        }
+
+        $_smarty_compile_path = $this->_get_compile_path($resource_name);
+
+        // if we just need to display the results, don't perform output
+        // buffering - for speed
+        $_cache_including = $this->_cache_including;
+        $this->_cache_including = false;
+        if ($display && !$this->caching && count($this->_plugins['outputfilter']) == 0) {
+            if ($this->_is_compiled($resource_name, $_smarty_compile_path)
+                    || $this->_compile_resource($resource_name, $_smarty_compile_path))
+            {
+                include($_smarty_compile_path);
+            }
+        } else {
+            ob_start();
+            if ($this->_is_compiled($resource_name, $_smarty_compile_path)
+                    || $this->_compile_resource($resource_name, $_smarty_compile_path))
+            {
+                include($_smarty_compile_path);
+            }
+            $_smarty_results = ob_get_contents();
+            ob_end_clean();
+
+            foreach ((array)$this->_plugins['outputfilter'] as $_output_filter) {
+                $_smarty_results = call_user_func_array($_output_filter[0], array($_smarty_results, &$this));
+            }
+        }
+
+        if ($this->caching) {
+            $_params = array('tpl_file' => $resource_name,
+                        'cache_id' => $cache_id,
+                        'compile_id' => $compile_id,
+                        'results' => $_smarty_results);
+            require_once(SMARTY_CORE_DIR . 'core.write_cache_file.php');
+            smarty_core_write_cache_file($_params, $this);
+            require_once(SMARTY_CORE_DIR . 'core.process_cached_inserts.php');
+            $_smarty_results = smarty_core_process_cached_inserts($_params, $this);
+
+            if ($this->_cache_serials) {
+                // strip nocache-tags from output
+                $_smarty_results = preg_replace('!(\{/?nocache\:[0-9a-f]{32}#\d+\})!s'
+                                                ,''
+                                                ,$_smarty_results);
+            }
+            // restore initial cache_info
+            $this->_cache_info = array_pop($_cache_info);
+        }
+        $this->_cache_including = $_cache_including;
+
+        if ($display) {
+            if (isset($_smarty_results)) { echo $_smarty_results; }
+            if ($this->debugging) {
+                // capture time for debugging info
+                $_params = array();
+                require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
+                $this->_smarty_debug_info[$_included_tpls_idx]['exec_time'] = (smarty_core_get_microtime($_params, $this) - $_debug_start_time);
+                require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');
+                echo smarty_core_display_debug_console($_params, $this);
+            }
+            error_reporting($_smarty_old_error_level);
+            return;
+        } else {
+            error_reporting($_smarty_old_error_level);
+            if (isset($_smarty_results)) { return $_smarty_results; }
+        }
+    }
+
+    /**
+     * load configuration values
+     *
+     * @param string $file
+     * @param string $section
+     * @param string $scope
+     */
+    function config_load($file, $section = null, $scope = 'global')
+    {
+        require_once($this->_get_plugin_filepath('function', 'config_load'));
+        smarty_function_config_load(array('file' => $file, 'section' => $section, 'scope' => $scope), $this);
+    }
+
+    /**
+     * return a reference to a registered object
+     *
+     * @param string $name
+     * @return object
+     */
+    function &get_registered_object($name) {
+        if (!isset($this->_reg_objects[$name]))
+        $this->_trigger_fatal_error("'$name' is not a registered object");
+
+        if (!is_object($this->_reg_objects[$name][0]))
+        $this->_trigger_fatal_error("registered '$name' is not an object");
+
+        return $this->_reg_objects[$name][0];
+    }
+
+    /**
+     * clear configuration values
+     *
+     * @param string $var
+     */
+    function clear_config($var = null)
+    {
+        if(!isset($var)) {
+            // clear all values
+            $this->_config = array(array('vars'  => array(),
+                                         'files' => array()));
+        } else {
+            unset($this->_config[0]['vars'][$var]);
+        }
+    }
+
+    /**
+     * get filepath of requested plugin
+     *
+     * @param string $type
+     * @param string $name
+     * @return string|false
+     */
+    function _get_plugin_filepath($type, $name)
+    {
+        $_params = array('type' => $type, 'name' => $name);
+        require_once(SMARTY_CORE_DIR . 'core.assemble_plugin_filepath.php');
+        return smarty_core_assemble_plugin_filepath($_params, $this);
+    }
+
+   /**
+     * test if resource needs compiling
+     *
+     * @param string $resource_name
+     * @param string $compile_path
+     * @return boolean
+     */
+    function _is_compiled($resource_name, $compile_path)
+    {
+        if (!$this->force_compile && file_exists($compile_path)) {
+            if (!$this->compile_check) {
+                // no need to check compiled file
+                return true;
+            } else {
+                // get file source and timestamp
+                $_params = array('resource_name' => $resource_name, 'get_source'=>false);
+                if (!$this->_fetch_resource_info($_params)) {
+                    return false;
+                }
+                if ($_params['resource_timestamp'] <= filemtime($compile_path)) {
+                    // template not expired, no recompile
+                    return true;
+                } else {
+                    // compile template
+                    return false;
+                }
+            }
+        } else {
+            // compiled template does not exist, or forced compile
+            return false;
+        }
+    }
+
+   /**
+     * compile the template
+     *
+     * @param string $resource_name
+     * @param string $compile_path
+     * @return boolean
+     */
+    function _compile_resource($resource_name, $compile_path)
+    {
+
+        $_params = array('resource_name' => $resource_name);
+        if (!$this->_fetch_resource_info($_params)) {
+            return false;
+        }
+
+        $_source_content = $_params['source_content'];
+        $_cache_include    = substr($compile_path, 0, -4).'.inc';
+
+        if ($this->_compile_source($resource_name, $_source_content, $_compiled_content, $_cache_include)) {
+            // if a _cache_serial was set, we also have to write an include-file:
+            if ($this->_cache_include_info) {
+                require_once(SMARTY_CORE_DIR . 'core.write_compiled_include.php');
+                smarty_core_write_compiled_include(array_merge($this->_cache_include_info, array('compiled_content'=>$_compiled_content, 'resource_name'=>$resource_name)),  $this);
+            }
+
+            $_params = array('compile_path'=>$compile_path, 'compiled_content' => $_compiled_content);
+            require_once(SMARTY_CORE_DIR . 'core.write_compiled_resource.php');
+            smarty_core_write_compiled_resource($_params, $this);
+
+            return true;
+        } else {
+            return false;
+        }
+
+    }
+
+   /**
+     * compile the given source
+     *
+     * @param string $resource_name
+     * @param string $source_content
+     * @param string $compiled_content
+     * @return boolean
+     */
+    function _compile_source($resource_name, &$source_content, &$compiled_content, $cache_include_path=null)
+    {
+        if (file_exists(SMARTY_DIR . $this->compiler_file)) {
+            require_once(SMARTY_DIR . $this->compiler_file);
+        } else {
+            // use include_path
+            require_once($this->compiler_file);
+        }
+
+
+        $smarty_compiler = new $this->compiler_class;
+
+        $smarty_compiler->template_dir      = $this->template_dir;
+        $smarty_compiler->compile_dir       = $this->compile_dir;
+        $smarty_compiler->plugins_dir       = $this->plugins_dir;
+        $smarty_compiler->config_dir        = $this->config_dir;
+        $smarty_compiler->force_compile     = $this->force_compile;
+        $smarty_compiler->caching           = $this->caching;
+        $smarty_compiler->php_handling      = $this->php_handling;
+        $smarty_compiler->left_delimiter    = $this->left_delimiter;
+        $smarty_compiler->right_delimiter   = $this->right_delimiter;
+        $smarty_compiler->_version          = $this->_version;
+        $smarty_compiler->security          = $this->security;
+        $smarty_compiler->secure_dir        = $this->secure_dir;
+        $smarty_compiler->security_settings = $this->security_settings;
+        $smarty_compiler->trusted_dir       = $this->trusted_dir;
+        $smarty_compiler->use_sub_dirs      = $this->use_sub_dirs;
+        $smarty_compiler->_reg_objects      = &$this->_reg_objects;
+        $smarty_compiler->_plugins          = &$this->_plugins;
+        $smarty_compiler->_tpl_vars         = &$this->_tpl_vars;
+        $smarty_compiler->default_modifiers = $this->default_modifiers;
+        $smarty_compiler->compile_id        = $this->_compile_id;
+        $smarty_compiler->_config            = $this->_config;
+        $smarty_compiler->request_use_auto_globals  = $this->request_use_auto_globals;
+
+        if (isset($cache_include_path) && isset($this->_cache_serials[$cache_include_path])) {
+            $smarty_compiler->_cache_serial = $this->_cache_serials[$cache_include_path];
+        }
+        $smarty_compiler->_cache_include = $cache_include_path;
+
+
+        $_results = $smarty_compiler->_compile_file($resource_name, $source_content, $compiled_content);
+
+        if ($smarty_compiler->_cache_serial) {
+            $this->_cache_include_info = array(
+                'cache_serial'=>$smarty_compiler->_cache_serial
+                ,'plugins_code'=>$smarty_compiler->_plugins_code
+                ,'include_file_path' => $cache_include_path);
+
+        } else {
+            $this->_cache_include_info = null;
+
+        }
+
+        return $_results;
+    }
+
+    /**
+     * Get the compile path for this resource
+     *
+     * @param string $resource_name
+     * @return string results of {@link _get_auto_filename()}
+     */
+    function _get_compile_path($resource_name)
+    {
+        return $this->_get_auto_filename($this->compile_dir, $resource_name,
+                                         $this->_compile_id) . '.php';
+    }
+
+    /**
+     * fetch the template info. Gets timestamp, and source
+     * if get_source is true
+     *
+     * sets $source_content to the source of the template, and
+     * $resource_timestamp to its time stamp
+     * @param string $resource_name
+     * @param string $source_content
+     * @param integer $resource_timestamp
+     * @param boolean $get_source
+     * @param boolean $quiet
+     * @return boolean
+     */
+
+    function _fetch_resource_info(&$params)
+    {
+        if(!isset($params['get_source'])) { $params['get_source'] = true; }
+        if(!isset($params['quiet'])) { $params['quiet'] = false; }
+
+        $_return = false;
+        $_params = array('resource_name' => $params['resource_name']) ;
+        if (isset($params['resource_base_path']))
+            $_params['resource_base_path'] = $params['resource_base_path'];
+        else
+            $_params['resource_base_path'] = $this->template_dir;
+
+        if ($this->_parse_resource_name($_params)) {
+            $_resource_type = $_params['resource_type'];
+            $_resource_name = $_params['resource_name'];
+            switch ($_resource_type) {
+                case 'file':
+                    if ($params['get_source']) {
+                        $params['source_content'] = $this->_read_file($_resource_name);
+                    }
+                    $params['resource_timestamp'] = filemtime($_resource_name);
+                    $_return = is_file($_resource_name);
+                    break;
+
+                default:
+                    // call resource functions to fetch the template source and timestamp
+                    if ($params['get_source']) {
+                        $_source_return = isset($this->_plugins['resource'][$_resource_type]) &&
+                            call_user_func_array($this->_plugins['resource'][$_resource_type][0][0],
+                                                 array($_resource_name, &$params['source_content'], &$this));
+                    } else {
+                        $_source_return = true;
+                    }
+
+                    $_timestamp_return = isset($this->_plugins['resource'][$_resource_type]) &&
+                        call_user_func_array($this->_plugins['resource'][$_resource_type][0][1],
+                                             array($_resource_name, &$params['resource_timestamp'], &$this));
+
+                    $_return = $_source_return && $_timestamp_return;
+                    break;
+            }
+        }
+
+        if (!$_return) {
+            // see if we can get a template with the default template handler
+            if (!empty($this->default_template_handler_func)) {
+                if (!is_callable($this->default_template_handler_func)) {
+                    $this->trigger_error("default template handler function \"$this->default_template_handler_func\" doesn't exist.");
+                } else {
+                    $_return = call_user_func_array(
+                        $this->default_template_handler_func,
+                        array($_params['resource_type'], $_params['resource_name'], &$params['source_content'], &$params['resource_timestamp'], &$this));
+                }
+            }
+        }
+
+        if (!$_return) {
+            if (!$params['quiet']) {
+                $this->trigger_error('unable to read resource: "' . $params['resource_name'] . '"');
+            }
+        } else if ($_return && $this->security) {
+            require_once(SMARTY_CORE_DIR . 'core.is_secure.php');
+            if (!smarty_core_is_secure($_params, $this)) {
+                if (!$params['quiet'])
+                    $this->trigger_error('(secure mode) accessing "' . $params['resource_name'] . '" is not allowed');
+                $params['source_content'] = null;
+                $params['resource_timestamp'] = null;
+                return false;
+            }
+        }
+        return $_return;
+    }
+
+
+    /**
+     * parse out the type and name from the resource
+     *
+     * @param string $resource_base_path
+     * @param string $resource_name
+     * @param string $resource_type
+     * @param string $resource_name
+     * @return boolean
+     */
+
+    function _parse_resource_name(&$params)
+    {
+
+        // split tpl_path by the first colon
+        $_resource_name_parts = explode(':', $params['resource_name'], 2);
+
+        if (count($_resource_name_parts) == 1) {
+            // no resource type given
+            $params['resource_type'] = $this->default_resource_type;
+            $params['resource_name'] = $_resource_name_parts[0];
+        } else {
+            if(strlen($_resource_name_parts[0]) == 1) {
+                // 1 char is not resource type, but part of filepath
+                $params['resource_type'] = $this->default_resource_type;
+                $params['resource_name'] = $params['resource_name'];
+            } else {
+                $params['resource_type'] = $_resource_name_parts[0];
+                $params['resource_name'] = $_resource_name_parts[1];
+            }
+        }
+
+        if ($params['resource_type'] == 'file') {
+            if (!preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $params['resource_name'])) {
+                // relative pathname to $params['resource_base_path']
+                // use the first directory where the file is found
+                foreach ((array)$params['resource_base_path'] as $_curr_path) {
+                    $_fullpath = $_curr_path . DIRECTORY_SEPARATOR . $params['resource_name'];
+                    if (file_exists($_fullpath) && is_file($_fullpath)) {
+                        $params['resource_name'] = $_fullpath;
+                        return true;
+                    }
+                    // didn't find the file, try include_path
+                    $_params = array('file_path' => $_fullpath);
+                    require_once(SMARTY_CORE_DIR . 'core.get_include_path.php');
+                    if(smarty_core_get_include_path($_params, $this)) {
+                        $params['resource_name'] = $_params['new_file_path'];
+                        return true;
+                    }
+                }
+                return false;
+            } else {
+                /* absolute path */
+                return file_exists($params['resource_name']);
+            }
+        } elseif (empty($this->_plugins['resource'][$params['resource_type']])) {
+            $_params = array('type' => $params['resource_type']);
+            require_once(SMARTY_CORE_DIR . 'core.load_resource_plugin.php');
+            smarty_core_load_resource_plugin($_params, $this);
+        }
+
+        return true;
+    }
+
+
+    /**
+     * Handle modifiers
+     *
+     * @param string|null $modifier_name
+     * @param array|null $map_array
+     * @return string result of modifiers
+     */
+    function _run_mod_handler()
+    {
+        $_args = func_get_args();
+        list($_modifier_name, $_map_array) = array_splice($_args, 0, 2);
+        list($_func_name, $_tpl_file, $_tpl_line) =
+            $this->_plugins['modifier'][$_modifier_name];
+
+        $_var = $_args[0];
+        foreach ($_var as $_key => $_val) {
+            $_args[0] = $_val;
+            $_var[$_key] = call_user_func_array($_func_name, $_args);
+        }
+        return $_var;
+    }
+
+    /**
+     * Remove starting and ending quotes from the string
+     *
+     * @param string $string
+     * @return string
+     */
+    function _dequote($string)
+    {
+        if ((substr($string, 0, 1) == "'" || substr($string, 0, 1) == '"') &&
+            substr($string, -1) == substr($string, 0, 1))
+            return substr($string, 1, -1);
+        else
+            return $string;
+    }
+
+
+    /**
+     * read in a file
+     *
+     * @param string $filename
+     * @return string
+     */
+    function _read_file($filename)
+    {
+        if ( file_exists($filename) && ($fd = @fopen($filename, 'rb')) ) {
+            $contents = '';
+            while (!feof($fd)) {
+                $contents .= fread($fd, 8192);
+            }
+            fclose($fd);
+            return $contents;
+        } else {
+            return false;
+        }
+    }
+
+    /**
+     * get a concrete filename for automagically created content
+     *
+     * @param string $auto_base
+     * @param string $auto_source
+     * @param string $auto_id
+     * @return string
+     * @staticvar string|null
+     * @staticvar string|null
+     */
+    function _get_auto_filename($auto_base, $auto_source = null, $auto_id = null)
+    {
+        $_compile_dir_sep =  $this->use_sub_dirs ? DIRECTORY_SEPARATOR : '^';
+        $_return = $auto_base . DIRECTORY_SEPARATOR;
+
+        if(isset($auto_id)) {
+            // make auto_id safe for directory names
+            $auto_id = str_replace('%7C',$_compile_dir_sep,(urlencode($auto_id)));
+            // split into separate directories
+            $_return .= $auto_id . $_compile_dir_sep;
+        }
+
+        if(isset($auto_source)) {
+            // make source name safe for filename
+            $_filename = urlencode(basename($auto_source));
+            $_crc32 = sprintf('%08X', crc32($auto_source));
+            // prepend %% to avoid name conflicts with
+            // with $params['auto_id'] names
+            $_crc32 = substr($_crc32, 0, 2) . $_compile_dir_sep .
+                      substr($_crc32, 0, 3) . $_compile_dir_sep . $_crc32;
+            $_return .= '%%' . $_crc32 . '%%' . $_filename;
+        }
+
+        return $_return;
+    }
+
+    /**
+     * unlink a file, possibly using expiration time
+     *
+     * @param string $resource
+     * @param integer $exp_time
+     */
+    function _unlink($resource, $exp_time = null)
+    {
+        if(isset($exp_time)) {
+            if(time() - @filemtime($resource) >= $exp_time) {
+                return @unlink($resource);
+            }
+        } else {
+            return @unlink($resource);
+        }
+    }
+
+    /**
+     * returns an auto_id for auto-file-functions
+     *
+     * @param string $cache_id
+     * @param string $compile_id
+     * @return string|null
+     */
+    function _get_auto_id($cache_id=null, $compile_id=null) {
+    if (isset($cache_id))
+        return (isset($compile_id)) ? $cache_id . '|' . $compile_id  : $cache_id;
+    elseif(isset($compile_id))
+        return $compile_id;
+    else
+        return null;
+    }
+
+    /**
+     * trigger Smarty plugin error
+     *
+     * @param string $error_msg
+     * @param string $tpl_file
+     * @param integer $tpl_line
+     * @param string $file
+     * @param integer $line
+     * @param integer $error_type
+     */
+    function _trigger_fatal_error($error_msg, $tpl_file = null, $tpl_line = null,
+            $file = null, $line = null, $error_type = E_USER_ERROR)
+    {
+        if(isset($file) && isset($line)) {
+            $info = ' ('.basename($file).", line $line)";
+        } else {
+            $info = '';
+        }
+        if (isset($tpl_line) && isset($tpl_file)) {
+            $this->trigger_error('[in ' . $tpl_file . ' line ' . $tpl_line . "]: $error_msg$info", $error_type);
+        } else {
+            $this->trigger_error($error_msg . $info, $error_type);
+        }
+    }
+
+
+    /**
+     * callback function for preg_replace, to call a non-cacheable block
+     * @return string
+     */
+    function _process_compiled_include_callback($match) {
+        $_func = '_smarty_tplfunc_'.$match[2].'_'.$match[3];
+        ob_start();
+        $_func($this);
+        $_ret = ob_get_contents();
+        ob_end_clean();
+        return $_ret;
+    }
+
+
+    /**
+     * called for included templates
+     *
+     * @param string $_smarty_include_tpl_file
+     * @param string $_smarty_include_vars
+     */
+
+    // $_smarty_include_tpl_file, $_smarty_include_vars
+
+    function _smarty_include($params)
+    {
+        if ($this->debugging) {
+            $_params = array();
+            require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
+            $debug_start_time = smarty_core_get_microtime($_params, $this);
+            $this->_smarty_debug_info[] = array('type'      => 'template',
+                                                  'filename'  => $params['smarty_include_tpl_file'],
+                                                  'depth'     => ++$this->_inclusion_depth);
+            $included_tpls_idx = count($this->_smarty_debug_info) - 1;
+        }
+
+        $this->_tpl_vars = array_merge($this->_tpl_vars, $params['smarty_include_vars']);
+
+        // config vars are treated as local, so push a copy of the
+        // current ones onto the front of the stack
+        array_unshift($this->_config, $this->_config[0]);
+
+        $_smarty_compile_path = $this->_get_compile_path($params['smarty_include_tpl_file']);
+
+
+        if ($this->_is_compiled($params['smarty_include_tpl_file'], $_smarty_compile_path)
+            || $this->_compile_resource($params['smarty_include_tpl_file'], $_smarty_compile_path))
+        {
+            include($_smarty_compile_path);
+        }
+
+        // pop the local vars off the front of the stack
+        array_shift($this->_config);
+
+        $this->_inclusion_depth--;
+
+        if ($this->debugging) {
+            // capture time for debugging info
+            $_params = array();
+            require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
+            $this->_smarty_debug_info[$included_tpls_idx]['exec_time'] = smarty_core_get_microtime($_params, $this) - $debug_start_time;
+        }
+
+        if ($this->caching) {
+            $this->_cache_info['template'][$params['smarty_include_tpl_file']] = true;
+        }
+    }
+
+
+    /**
+     * get or set an array of cached attributes for function that is
+     * not cacheable
+     * @return array
+     */
+    function &_smarty_cache_attrs($cache_serial, $count) {
+        $_cache_attrs =& $this->_cache_info['cache_attrs'][$cache_serial][$count];
+
+        if ($this->_cache_including) {
+            /* return next set of cache_attrs */
+            $_return = current($_cache_attrs);
+            next($_cache_attrs);
+            return $_return;
+
+        } else {
+            /* add a reference to a new set of cache_attrs */
+            $_cache_attrs[] = array();
+            return $_cache_attrs[count($_cache_attrs)-1];
+
+        }
+
+    }
+
+
+    /**
+     * wrapper for include() retaining $this
+     * @return mixed
+     */
+    function _include($filename, $once=false, $params=null)
+    {
+        if ($once) {
+            return include_once($filename);
+        } else {
+            return include($filename);
+        }
+    }
+
+
+    /**
+     * wrapper for eval() retaining $this
+     * @return mixed
+     */
+    function _eval($code, $params=null)
+    {
+        return eval($code);
+    }
+    /**#@-*/
+
+}
+
+/* vim: set expandtab: */
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/commentrenderer.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/commentrenderer.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/commentrenderer.php	(revision 405)
@@ -0,0 +1,427 @@
+<?php
+// $Id: commentrenderer.php,v 1.3 2005/10/24 11:44:16 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.xoops.org/ http://jp.xoops.org/  http://www.myweb.ne.jp/  //
+// Project: The XOOPS Project (http://www.xoops.org/)                        //
+// ------------------------------------------------------------------------- //
+/**
+ * Display comments
+ *
+ * @package     kernel
+ * @subpackage  comment
+ *
+ * @author      Kazumi Ono  <onokazu@xoops.org>
+ * @copyright   (c) 2000-2003 The Xoops Project - www.xoops.org
+ */
+class XoopsCommentRenderer {
+
+    /**#@+
+     * @access  private
+     */
+    var $_tpl;
+    var $_comments = null;
+    var $_useIcons = true;
+    var $_doIconCheck = false;
+    var $_memberHandler;
+    var $_statusText;
+    /**#@-*/
+
+    /**
+     * Constructor
+     *
+     * @param   object  &$tpl
+     * @param   boolean $use_icons
+     * @param   boolean $do_iconcheck
+     **/
+    function XoopsCommentRenderer(&$tpl, $use_icons = true, $do_iconcheck = false)
+    {
+        $this->_tpl =& $tpl;
+        $this->_useIcons = $use_icons;
+        $this->_doIconCheck = $do_iconcheck;
+        $this->_memberHandler =& xoops_gethandler('member');
+        $this->_statusText = array(XOOPS_COMMENT_PENDING => '<span style="text-decoration: none; font-weight: bold; color: #00ff00;">'._CM_PENDING.'</span>', XOOPS_COMMENT_ACTIVE => '<span style="text-decoration: none; font-weight: bold; color: #ff0000;">'._CM_ACTIVE.'</span>', XOOPS_COMMENT_HIDDEN => '<span style="text-decoration: none; font-weight: bold; color: #0000ff;">'._CM_HIDDEN.'</span>');
+    }
+
+    /**
+     * Access the only instance of this class
+     *
+     * @param   object  $tpl        reference to a {@link Smarty} object
+     * @param   boolean $use_icons
+     * @param   boolean $do_iconcheck
+     * @return
+     **/
+    function &instance(&$tpl, $use_icons = true, $do_iconcheck = false)
+    {
+        static $instance;
+        if (!isset($instance)) {
+            $instance = new XoopsCommentRenderer($tpl, $use_icons, $do_iconcheck);
+        }
+        return $instance;
+    }
+
+    /**
+     * Accessor
+     *
+     * @param   object  &$comments_arr  array of {@link XoopsComment} objects
+     **/
+    function setComments(&$comments_arr)
+    {
+        if (isset($this->_comments)) {
+            unset($this->_comments);
+        }
+        $this->_comments =& $comments_arr;
+    }
+
+    /**
+     * Render the comments in flat view
+     *
+     * @param boolean $admin_view
+     **/
+    function renderFlatView($admin_view = false)
+    {
+        $count = count($this->_comments);
+        for ($i = 0; $i < $count; $i++) {
+            if (false != $this->_useIcons) {
+                $title = $this->_getTitleIcon($this->_comments[$i]->getVar('com_icon')).'&nbsp;'.$this->_comments[$i]->getVar('com_title');
+            } else {
+                $title = $this->_comments[$i]->getVar('com_title');
+            }
+
+			//Modified By viva(2005/12/13) --->
+            //$poster = $this->_getPosterArray($this->_comments[$i]->getVar('com_uid'));
+            $poster = $this->_getPosterArray($this->_comments[$i]->getVar('com_uid'), $this->_comments[$i]->getVar('com_poster_name'));
+			//Modified By viva(2005/12/13) <---
+
+            if (false != $admin_view) {
+                $text = $this->_comments[$i]->getVar('com_text').'<div style="text-align:right; margin-top: 2px; margin-bottom: 0px; margin-right: 2px;">'._CM_STATUS.': '.$this->_statusText[$this->_comments[$i]->getVar('com_status')].'<br />IP: <span style="font-weight: bold;">'.$this->_comments[$i]->getVar('com_ip').'</span></div>';
+            } else {
+                // hide comments that are not active
+                if (XOOPS_COMMENT_ACTIVE != $this->_comments[$i]->getVar('com_status')) {
+                    continue;
+                } else {
+                    $text = $this->_comments[$i]->getVar('com_text');
+                }
+            }
+            $this->_tpl->append('comments', array('id' => $this->_comments[$i]->getVar('com_id'), 'title' => $title, 'text' => $text, 'date_posted' => formatTimestamp($this->_comments[$i]->getVar('com_created'), 'm'), 'date_modified' => formatTimestamp($this->_comments[$i]->getVar('com_modified'), 'm'), 'poster' => $poster));
+        }
+    }
+
+    /**
+     * Render the comments in thread view
+     *
+     * This method calls itself recursively
+     *
+     * @param integer $comment_id   Should be "0" when called by client
+     * @param boolean $admin_view
+     * @param boolean $show_nav
+     **/
+    function renderThreadView($comment_id = 0, $admin_view = false, $show_nav = true)
+    {
+        include_once XOOPS_ROOT_PATH.'/class/tree.php';
+        // construct comment tree
+        $xot = new XoopsObjectTree($this->_comments, 'com_id', 'com_pid', 'com_rootid');
+        $tree =& $xot->getTree();
+
+        if (false != $this->_useIcons) {
+            $title = $this->_getTitleIcon($tree[$comment_id]['obj']->getVar('com_icon')).'&nbsp;'.$tree[$comment_id]['obj']->getVar('com_title');
+        } else {
+            $title = $tree[$comment_id]['obj']->getVar('com_title');
+        }
+        if (false != $show_nav && $tree[$comment_id]['obj']->getVar('com_pid') != 0) {
+            $this->_tpl->assign('lang_top', _CM_TOP);
+            $this->_tpl->assign('lang_parent', _CM_PARENT);
+            $this->_tpl->assign('show_threadnav', true);
+        } else {
+            $this->_tpl->assign('show_threadnav', false);
+        }
+        if (false != $admin_view) {
+            // admins can see all
+            $text = $tree[$comment_id]['obj']->getVar('com_text').'<div style="text-align:right; margin-top: 2px; margin-bottom: 0px; margin-right: 2px;">'._CM_STATUS.': '.$this->_statusText[$tree[$comment_id]['obj']->getVar('com_status')].'<br />IP: <span style="font-weight: bold;">'.$tree[$comment_id]['obj']->getVar('com_ip').'</span></div>';
+        } else {
+            // hide comments that are not active
+            if (XOOPS_COMMENT_ACTIVE != $tree[$comment_id]['obj']->getVar('com_status')) {
+                // if there are any child comments, display them as root comments
+                if (isset($tree[$comment_id]['child']) && !empty($tree[$comment_id]['child'])) {
+                    foreach ($tree[$comment_id]['child'] as $child_id) {
+                        $this->renderThreadView($child_id, $admin_view, false);
+                    }
+                }
+                return;
+            } else {
+                $text = $tree[$comment_id]['obj']->getVar('com_text');
+            }
+        }
+        $replies = array();
+        $this->_renderThreadReplies($tree, $comment_id, $replies, '&nbsp;&nbsp;', $admin_view);
+        $show_replies = (count($replies) > 0) ? true : false;
+
+		//Modified By viva(2005/12/13) --->
+        //$this->_tpl->append('comments', array('pid' => $tree[$comment_id]['obj']->getVar('com_pid'), 'id' => $tree[$comment_id]['obj']->getVar('com_id'), 'itemid' => $tree[$comment_id]['obj']->getVar('com_itemid'), 'rootid' => $tree[$comment_id]['obj']->getVar('com_rootid'), 'title' => $title, 'text' => $text, 'date_posted' => formatTimestamp($tree[$comment_id]['obj']->getVar('com_created'), 'm'), 'date_modified' => formatTimestamp($tree[$comment_id]['obj']->getVar('com_modified'), 'm'), 'poster' => $this->_getPosterArray($tree[$comment_id]['obj']->getVar('com_uid')), 'replies' => $replies, 'show_replies' => $show_replies));
+        $this->_tpl->append('comments', array('pid' => $tree[$comment_id]['obj']->getVar('com_pid'), 'id' => $tree[$comment_id]['obj']->getVar('com_id'), 'itemid' => $tree[$comment_id]['obj']->getVar('com_itemid'), 'rootid' => $tree[$comment_id]['obj']->getVar('com_rootid'), 'title' => $title, 'text' => $text, 'date_posted' => formatTimestamp($tree[$comment_id]['obj']->getVar('com_created'), 'm'), 'date_modified' => formatTimestamp($tree[$comment_id]['obj']->getVar('com_modified'), 'm'), 'poster' => $this->_getPosterArray($tree[$comment_id]['obj']->getVar('com_uid'), $tree[$comment_id]['obj']->getVar('com_poster_name')), 'replies' => $replies, 'show_replies' => $show_replies));
+		//Modified By viva(2005/12/13) <---
+    }
+
+    /**
+     * Render replies to a thread
+     *
+     * @param   array   &$thread
+     * @param   int     $key
+     * @param   array   $replies
+     * @param   string  $prefix
+     * @param   bool    $admin_view
+     * @param   integer $depth
+     * @param   string  $current_prefix
+     *
+     * @access  private
+     **/
+    function _renderThreadReplies(&$thread, $key, &$replies, $prefix, $admin_view, $depth = 0, $current_prefix = '')
+    {
+        if ($depth > 0) {
+            if (false != $this->_useIcons) {
+                $title = $this->_getTitleIcon($thread[$key]['obj']->getVar('com_icon')).'&nbsp;'.$thread[$key]['obj']->getVar('com_title');
+            } else {
+                $title = $thread[$key]['obj']->getVar('com_title');
+            }
+            $title = (false != $admin_view) ? $title.' '.$this->_statusText[$thread[$key]['obj']->getVar('com_status')] : $title;
+
+			//Modified By viva(2005/12/13) --->
+            //$replies[] = array('id' => $key, 'prefix' => $current_prefix, 'date_posted' => formatTimestamp($thread[$key]['obj']->getVar('com_created'), 'm'), 'title' => $title, 'root_id' => $thread[$key]['obj']->getVar('com_rootid'), 'status' => $this->_statusText[$thread[$key]['obj']->getVar('com_status')], 'poster' => $this->_getPosterName($thread[$key]['obj']->getVar('com_uid')));
+            $replies[] = array('id' => $key, 'prefix' => $current_prefix, 'date_posted' => formatTimestamp($thread[$key]['obj']->getVar('com_created'), 'm'), 'title' => $title, 'root_id' => $thread[$key]['obj']->getVar('com_rootid'), 'status' => $this->_statusText[$thread[$key]['obj']->getVar('com_status')], 'poster' => $this->_getPosterName($thread[$key]['obj']->getVar('com_uid'), $thread[$key]['obj']->getVar('com_poster_name')));
+			//Modified By viva(2005/12/13) <---
+
+            $current_prefix .= $prefix;
+        }
+        if (isset($thread[$key]['child']) && !empty($thread[$key]['child'])) {
+            $depth++;
+            foreach ($thread[$key]['child'] as $childkey) {
+                if (!$admin_view && $thread[$childkey]['obj']->getVar('com_status') != XOOPS_COMMENT_ACTIVE) {
+                    // skip this comment if it is not active and continue on processing its child comments instead
+                    if (isset($thread[$childkey]['child']) && !empty($thread[$childkey]['child'])) {
+                        foreach ($thread[$childkey]['child'] as $childchildkey) {
+                            $this->_renderThreadReplies($thread, $childchildkey, $replies, $prefix, $admin_view, $depth);
+                        }
+                    }
+                } else {
+                    $this->_renderThreadReplies($thread, $childkey, $replies, $prefix, $admin_view, $depth, $current_prefix);
+                }
+            }
+        }
+    }
+
+    /**
+     * Render comments in nested view
+     *
+     * Danger: Recursive!
+     *
+     * @param integer $comment_id   Always "0" when called by client.
+     * @param boolean $admin_view
+     **/
+    function renderNestView($comment_id = 0, $admin_view = false)
+    {
+        include_once XOOPS_ROOT_PATH.'/class/tree.php';
+        $xot = new XoopsObjectTree($this->_comments, 'com_id', 'com_pid', 'com_rootid');
+        $tree =& $xot->getTree();
+        if (false != $this->_useIcons) {
+            $title = $this->_getTitleIcon($tree[$comment_id]['obj']->getVar('com_icon')).'&nbsp;'.$tree[$comment_id]['obj']->getVar('com_title');
+        } else {
+            $title = $tree[$comment_id]['obj']->getVar('com_title');
+        }
+        if (false != $admin_view) {
+            $text = $tree[$comment_id]['obj']->getVar('com_text').'<div style="text-align:right; margin-top: 2px; margin-bottom: 0px; margin-right: 2px;">'._CM_STATUS.': '.$this->_statusText[$tree[$comment_id]['obj']->getVar('com_status')].'<br />IP: <span style="font-weight: bold;">'.$tree[$comment_id]['obj']->getVar('com_ip').'</span></div>';
+        } else {
+            // skip this comment if it is not active and continue on processing its child comments instead
+            if (XOOPS_COMMENT_ACTIVE != $tree[$comment_id]['obj']->getVar('com_status')) {
+                // if there are any child comments, display them as root comments
+                if (isset($tree[$comment_id]['child']) && !empty($tree[$comment_id]['child'])) {
+                    foreach ($tree[$comment_id]['child'] as $child_id) {
+                        $this->renderNestView($child_id, $admin_view);
+                    }
+                }
+                return;
+            } else {
+                $text = $tree[$comment_id]['obj']->getVar('com_text');
+            }
+        }
+        $replies = array();
+        $this->_renderNestReplies($tree, $comment_id, $replies, 25, $admin_view);
+
+		//Modified By viva(2005/12/13) --->
+        //$this->_tpl->append('comments', array('pid' => $tree[$comment_id]['obj']->getVar('com_pid'), 'id' => $tree[$comment_id]['obj']->getVar('com_id'), 'itemid' => $tree[$comment_id]['obj']->getVar('com_itemid'), 'rootid' => $tree[$comment_id]['obj']->getVar('com_rootid'), 'title' => $title, 'text' => $text, 'date_posted' => formatTimestamp($tree[$comment_id]['obj']->getVar('com_created'), 'm'), 'date_modified' => formatTimestamp($tree[$comment_id]['obj']->getVar('com_modified'), 'm'), 'poster' => $this->_getPosterArray($tree[$comment_id]['obj']->getVar('com_uid')), 'replies' => $replies));
+        $this->_tpl->append('comments', array('pid' => $tree[$comment_id]['obj']->getVar('com_pid'), 'id' => $tree[$comment_id]['obj']->getVar('com_id'), 'itemid' => $tree[$comment_id]['obj']->getVar('com_itemid'), 'rootid' => $tree[$comment_id]['obj']->getVar('com_rootid'), 'title' => $title, 'text' => $text, 'date_posted' => formatTimestamp($tree[$comment_id]['obj']->getVar('com_created'), 'm'), 'date_modified' => formatTimestamp($tree[$comment_id]['obj']->getVar('com_modified'), 'm'), 'poster' => $this->_getPosterArray($tree[$comment_id]['obj']->getVar('com_uid'), $tree[$comment_id]['obj']->getVar('com_poster_name')), 'replies' => $replies));
+		//Modified By viva(2005/12/13) <---
+    }
+
+    /**
+     * Render replies in nested view
+     *
+     * @param   array   $thread
+     * @param   int     $key
+     * @param   array   $replies
+     * @param   string  $prefix
+     * @param   bool    $admin_view
+     * @param   integer $depth
+     *
+     * @access  private
+     **/
+    function _renderNestReplies(&$thread, $key, &$replies, $prefix, $admin_view, $depth = 0)
+    {
+        if ($depth > 0) {
+            if (false != $this->_useIcons) {
+                $title = $this->_getTitleIcon($thread[$key]['obj']->getVar('com_icon')).'&nbsp;'.$thread[$key]['obj']->getVar('com_title');
+            } else {
+                $title = $thread[$key]['obj']->getVar('com_title');
+            }
+            $text = (false != $admin_view) ? $thread[$key]['obj']->getVar('com_text').'<div style="text-align:right; margin-top: 2px; margin-right: 2px;">'._CM_STATUS.': '.$this->_statusText[$thread[$key]['obj']->getVar('com_status')].'<br />IP: <span style="font-weight: bold;">'.$thread[$key]['obj']->getVar('com_ip').'</span></div>' : $thread[$key]['obj']->getVar('com_text');
+
+			//Modified By viva(2005/12/13) --->
+            //$replies[] = array('id' => $key, 'prefix' => $prefix, 'pid' => $thread[$key]['obj']->getVar('com_pid'), 'itemid' => $thread[$key]['obj']->getVar('com_itemid'), 'rootid' => $thread[$key]['obj']->getVar('com_rootid'), 'title' => $title, 'text' => $text, 'date_posted' => formatTimestamp($thread[$key]['obj']->getVar('com_created'), 'm'), 'date_modified' => formatTimestamp($thread[$key]['obj']->getVar('com_modified'), 'm'), 'poster' => $this->_getPosterArray($thread[$key]['obj']->getVar('com_uid')));
+            $replies[] = array('id' => $key, 'prefix' => $prefix, 'pid' => $thread[$key]['obj']->getVar('com_pid'), 'itemid' => $thread[$key]['obj']->getVar('com_itemid'), 'rootid' => $thread[$key]['obj']->getVar('com_rootid'), 'title' => $title, 'text' => $text, 'date_posted' => formatTimestamp($thread[$key]['obj']->getVar('com_created'), 'm'), 'date_modified' => formatTimestamp($thread[$key]['obj']->getVar('com_modified'), 'm'), 'poster' => $this->_getPosterArray($thread[$key]['obj']->getVar('com_uid'), $thread[$key]['obj']->getVar('com_poster_name')));
+			//Modified By viva(2005/12/13) <---
+
+            $prefix = $prefix + 25;
+        }
+        if (isset($thread[$key]['child']) && !empty($thread[$key]['child'])) {
+            $depth++;
+            foreach ($thread[$key]['child'] as $childkey) {
+                if (!$admin_view && $thread[$childkey]['obj']->getVar('com_status') != XOOPS_COMMENT_ACTIVE) {
+                    // skip this comment if it is not active and continue on processing its child comments instead
+                    if (isset($thread[$childkey]['child']) && !empty($thread[$childkey]['child'])) {
+                        foreach ($thread[$childkey]['child'] as $childchildkey) {
+                            $this->_renderNestReplies($thread, $childchildkey, $replies, $prefix, $admin_view, $depth);
+                        }
+                    }
+                } else {
+                    $this->_renderNestReplies($thread, $childkey, $replies, $prefix, $admin_view, $depth);
+                }
+            }
+        }
+    }
+
+
+    /**
+     * Get the name of the poster
+     *
+     * @param   int $poster_id
+     * @return  string
+     *
+     * @access  private
+     **/
+    //Modified By viva(2005/12/13) --->
+    //function _getPosterName($poster_id)
+    function _getPosterName($poster_id, $poster_name)
+    //Modified By viva(2005/12/13) <---
+    {
+        $poster['id'] = intval($poster_id);
+        if ($poster['id'] > 0) {
+            $com_poster =& $this->_memberHandler->getUser($poster_id);
+            if (is_object($com_poster)) {
+                $poster['uname'] = '<a href="'.XOOPS_URL.'/userinfo.php?uid='.$poster['id'].'">'.$com_poster->getVar('uname').'</a>';
+                return $poster;
+            }
+        }
+        $poster['id'] = 0; // to cope with deleted user accounts
+
+	    //Modified By viva(2005/12/13) --->
+        //$poster['uname'] = $GLOBALS['xoopsConfig']['anonymous'];
+        $poster['uname'] = $poster_name;
+	    //Modified By viva(2005/12/13) <---
+
+        return $poster;
+    }
+
+    /**
+     * Get an array with info about the poster
+     *
+     * @param   int $poster_id
+     * @return  array
+     *
+     * @access  private
+     **/
+    //Modified By viva(2005/12/13) --->
+    //function _getPosterArray($poster_id)
+    function _getPosterArray($poster_id, $poster_name)
+    //Modified By viva(2005/12/13) <---
+    {
+        $poster['id'] = intval($poster_id);
+        if ($poster['id'] > 0) {
+            $com_poster =& $this->_memberHandler->getUser($poster['id']);
+            if (is_object($com_poster)) {
+                $poster['uname'] = '<a href="'.XOOPS_URL.'/userinfo.php?uid='.$poster['id'].'">'.$com_poster->getVar('uname').'</a>';
+                $poster_rank = $com_poster->rank();
+                $poster['rank_image'] = ($poster_rank['image'] != '') ? $poster_rank['image'] : 'blank.gif';
+                $poster['rank_title'] = $poster_rank['title'];
+                $poster['avatar'] = $com_poster->getVar('user_avatar');
+                $poster['regdate'] = formatTimestamp($com_poster->getVar('user_regdate'), 's');
+                $poster['from'] = $com_poster->getVar('user_from');
+                $poster['postnum'] = $com_poster->getVar('posts');
+                $poster['status'] = $com_poster->isOnline() ? _CM_ONLINE : '';
+                return $poster;
+            }
+        }
+        $poster['id'] = 0; // to cope with deleted user accounts
+
+	    //Modified By viva(2005/12/13) --->
+        //$poster['uname'] = $GLOBALS['xoopsConfig']['anonymous'];
+        $poster['uname'] = $poster_name;
+	    //Modified By viva(2005/12/13) <---
+
+        $poster['rank_title'] = '';
+        $poster['avatar'] = 'blank.gif';
+        $poster['regdate'] = '';
+        $poster['from'] = '';
+        $poster['postnum'] = 0;
+        $poster['status'] = '';
+        return $poster;
+    }
+
+    /**
+     * Get the IMG tag for the title icon
+     *
+     * @param   string  $icon_image
+     * @return  string  HTML IMG tag
+     *
+     * @access  private
+     **/
+    function _getTitleIcon($icon_image)
+    {
+        $icon_image = trim($icon_image);
+        if ($icon_image != '') {
+            $icon_image = htmlspecialchars($icon_image);
+            if (false != $this->_doIconCheck) {
+                if (!file_exists(XOOPS_URL.'/images/subject/'.$icon_image)) {
+                    return '<img src="'.XOOPS_URL.'/images/icons/no_posticon.gif" alt="" />';
+                } else {
+                    return '<img src="'.XOOPS_URL.'/images/subject/'.$icon_image.'" alt="" />';
+                }
+            } else {
+                return '<img src="'.XOOPS_URL.'/images/subject/'.$icon_image.'" alt="" />';
+            }
+        }
+        return '<img src="'.XOOPS_URL.'/images/icons/no_posticon.gif" alt="" />';
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/class.tar.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/class.tar.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/class.tar.php	(revision 405)
@@ -0,0 +1,714 @@
+<?php
+// $Id: class.tar.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+/*
+	package::i.tools
+
+	php-downloader	v1.0	-	www.ipunkt.biz
+
+	(c)	2002 - www.ipunkt.biz (rok)
+*/
+
+/*
+=======================================================================
+Name:
+	tar Class
+
+Author:
+	Josh Barger <joshb@npt.com>
+
+Description:
+	This class reads and writes Tape-Archive (TAR) Files and Gzip
+	compressed TAR files, which are mainly used on UNIX systems.
+	This class works on both windows AND unix systems, and does
+	NOT rely on external applications!! Woohoo!
+
+Usage:
+	Copyright (C) 2002  Josh Barger
+
+	This library is free software; you can redistribute it and/or
+	modify it under the terms of the GNU Lesser General Public
+	License as published by the Free Software Foundation; either
+	version 2.1 of the License, or (at your option) any later version.
+
+	This library 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
+	Lesser General Public License for more details at:
+		http://www.gnu.org/copyleft/lesser.html
+
+	If you use this script in your application/website, please
+	send me an e-mail letting me know about it :)
+
+Bugs:
+	Please report any bugs you might find to my e-mail address
+	at joshb@npt.com.  If you have already created a fix/patch
+	for the bug, please do send it to me so I can incorporate it into my release.
+
+Version History:
+	1.0	04/10/2002	- InitialRelease
+
+	2.0	04/11/2002	- Merged both tarReader and tarWriter
+				  classes into one
+				- Added support for gzipped tar files
+				  Remember to name for .tar.gz or .tgz
+				  if you use gzip compression!
+				  :: THIS REQUIRES ZLIB EXTENSION ::
+				- Added additional comments to
+				  functions to help users
+				- Added ability to remove files and
+				  directories from archive
+	2.1	04/12/2002	- Fixed serious bug in generating tar
+				- Created another example file
+				- Added check to make sure ZLIB is
+				  installed before running GZIP
+				  compression on TAR
+	2.2	05/07/2002	- Added automatic detection of Gzipped
+				  tar files (Thanks go to Jidgen Falch
+				  for the idea)
+				- Changed "private" functions to have
+				  special function names beginning with
+				  two underscores
+=======================================================================
+XOOPS changes onokazu <webmaster@xoops.org>
+
+	12/25/2002 - Added flag to addFile() function for binary files
+
+=======================================================================
+*/
+
+/**
+ * tar Class
+ * 
+ * This class reads and writes Tape-Archive (TAR) Files and Gzip
+ * compressed TAR files, which are mainly used on UNIX systems.
+ * This class works on both windows AND unix systems, and does
+ * NOT rely on external applications!! Woohoo!
+ * 
+ * @author	Josh Barger <joshb@npt.com>
+ * @copyright	Copyright (C) 2002  Josh Barger
+ * 
+ * @package     kernel
+ * @subpackage  core
+ */
+class tar
+{
+	/**#@+
+	 * Unprocessed Archive Information
+	 */
+	var $filename;
+	var $isGzipped;
+	var $tar_file;
+    /**#@-*/
+
+	/**#@+
+	 * Processed Archive Information
+	 */
+	var $files;
+	var $directories;
+	var $numFiles;
+	var $numDirectories;
+    /**#@-*/
+
+
+	/**
+	 * Class Constructor -- Does nothing...
+	 */
+	function tar()
+	{
+		return true;
+	}
+
+	/**
+	 * Computes the unsigned Checksum of a file's header
+     * to try to ensure valid file
+     * 
+     * @param	string  $bytestring
+     * 
+     * @access	private
+	 */
+	function __computeUnsignedChecksum($bytestring)
+	{
+		$unsigned_chksum = '';
+		for($i=0; $i<512; $i++)
+			$unsigned_chksum += ord($bytestring[$i]);
+		for($i=0; $i<8; $i++)
+			$unsigned_chksum -= ord($bytestring[148 + $i]);
+		$unsigned_chksum += ord(" ") * 8;
+
+		return $unsigned_chksum;
+	}
+
+
+	/**
+	 * Converts a NULL padded string to a non-NULL padded string
+	 * 
+	 * @param   string  $string
+     * 
+	 * @return  string 
+     * 
+     * @access	private
+	 **/
+	function __parseNullPaddedString($string)
+	{
+		$position = strpos($string,chr(0));
+		return substr($string,0,$position);
+	}
+
+	/**
+	 * This function parses the current TAR file
+	 * 
+	 * @return  bool    always TRUE
+     * 
+     * @access	private
+	 **/
+	function __parseTar()
+	{
+		// Read Files from archive
+		$tar_length = strlen($this->tar_file);
+		$main_offset = 0;
+		$this->numFiles = 0;
+		while ( $main_offset < $tar_length ) {
+			// If we read a block of 512 nulls, we are at the end of the archive
+			if(substr($this->tar_file,$main_offset,512) == str_repeat(chr(0),512))
+				break;
+
+			// Parse file name
+			$file_name		= $this->__parseNullPaddedString(substr($this->tar_file,$main_offset,100));
+
+			// Parse the file mode
+			$file_mode		= substr($this->tar_file,$main_offset + 100,8);
+
+			// Parse the file user ID
+			$file_uid		= octdec(substr($this->tar_file,$main_offset + 108,8));
+
+			// Parse the file group ID
+			$file_gid		= octdec(substr($this->tar_file,$main_offset + 116,8));
+
+			// Parse the file size
+			$file_size		= octdec(substr($this->tar_file,$main_offset + 124,12));
+
+			// Parse the file update time - unix timestamp format
+			$file_time		= octdec(substr($this->tar_file,$main_offset + 136,12));
+
+			// Parse Checksum
+			$file_chksum		= octdec(substr($this->tar_file,$main_offset + 148,6));
+
+			// Parse user name
+			$file_uname		= $this->__parseNullPaddedString(substr($this->tar_file,$main_offset + 265,32));
+
+			// Parse Group name
+			$file_gname		= $this->__parseNullPaddedString(substr($this->tar_file,$main_offset + 297,32));
+
+			// Make sure our file is valid
+			if($this->__computeUnsignedChecksum(substr($this->tar_file,$main_offset,512)) != $file_chksum)
+				return false;
+
+			// Parse File Contents
+			$file_contents		= substr($this->tar_file,$main_offset + 512,$file_size);
+
+			/*	### Unused Header Information ###
+				$activeFile["typeflag"]		= substr($this->tar_file,$main_offset + 156,1);
+				$activeFile["linkname"]		= substr($this->tar_file,$main_offset + 157,100);
+				$activeFile["magic"]		= substr($this->tar_file,$main_offset + 257,6);
+				$activeFile["version"]		= substr($this->tar_file,$main_offset + 263,2);
+				$activeFile["devmajor"]		= substr($this->tar_file,$main_offset + 329,8);
+				$activeFile["devminor"]		= substr($this->tar_file,$main_offset + 337,8);
+				$activeFile["prefix"]		= substr($this->tar_file,$main_offset + 345,155);
+				$activeFile["endheader"]	= substr($this->tar_file,$main_offset + 500,12);
+			*/
+
+			if ( $file_size > 0 ) {
+				// Increment number of files
+				$this->numFiles++;
+
+				// Create us a new file in our array
+				$activeFile = &$this->files[];
+
+				// Asign Values
+				$activeFile["name"]		= $file_name;
+				$activeFile["mode"]		= $file_mode;
+				$activeFile["size"]		= $file_size;
+				$activeFile["time"]		= $file_time;
+				$activeFile["user_id"]		= $file_uid;
+				$activeFile["group_id"]		= $file_gid;
+				$activeFile["user_name"]	= $file_uname;
+				$activeFile["group_name"]	= $file_gname;
+				$activeFile["checksum"]		= $file_chksum;
+				$activeFile["file"]		= $file_contents;
+			} else {
+				// Increment number of directories
+				$this->numDirectories++;
+
+				// Create a new directory in our array
+				$activeDir = &$this->directories[];
+
+				// Assign values
+				$activeDir["name"]		= $file_name;
+				$activeDir["mode"]		= $file_mode;
+				$activeDir["time"]		= $file_time;
+				$activeDir["user_id"]		= $file_uid;
+				$activeDir["group_id"]		= $file_gid;
+				$activeDir["user_name"]		= $file_uname;
+				$activeDir["group_name"]	= $file_gname;
+				$activeDir["checksum"]		= $file_chksum;
+			}
+
+			// Move our offset the number of blocks we have processed
+			$main_offset += 512 + (ceil($file_size / 512) * 512);
+		}
+
+		return true;
+	}
+
+	/**
+	 * Read a non gzipped tar file in for processing.
+	 * 
+	 * @param   string  $filename   full filename
+	 * @return  bool    always TRUE
+     * 
+     * @access	private
+	 **/
+	function __readTar($filename='')
+	{
+		// Set the filename to load
+		if(!$filename)
+			$filename = $this->filename;
+
+		// Read in the TAR file
+		$fp = fopen($filename,"rb");
+		$this->tar_file = fread($fp,filesize($filename));
+		fclose($fp);
+
+		if($this->tar_file[0] == chr(31) && $this->tar_file[1] == chr(139) && $this->tar_file[2] == chr(8)) {
+			if(!function_exists("gzinflate"))
+				return false;
+
+			$this->isGzipped = true;
+
+			$this->tar_file = gzinflate(substr($this->tar_file,10,-4));
+		}
+
+		// Parse the TAR file
+		$this->__parseTar();
+
+		return true;
+	}
+
+	/**
+	 * Generates a TAR file from the processed data
+	 * 
+	 * @return  bool    always TRUE
+     * 
+     * @access	private
+	 **/
+	function __generateTAR()
+	{
+		// Clear any data currently in $this->tar_file
+		unset($this->tar_file);
+
+		// Generate Records for each directory, if we have directories
+		if($this->numDirectories > 0) {
+			foreach($this->directories as $key => $information) {
+				unset($header);
+
+				// Generate tar header for this directory
+				// Filename, Permissions, UID, GID, size, Time, checksum, typeflag, linkname, magic, version, user name, group name, devmajor, devminor, prefix, end
+				$header .= str_pad($information["name"],100,chr(0));
+				$header .= str_pad(decoct($information["mode"]),7,"0",STR_PAD_LEFT) . chr(0);
+				$header .= str_pad(decoct($information["user_id"]),7,"0",STR_PAD_LEFT) . chr(0);
+				$header .= str_pad(decoct($information["group_id"]),7,"0",STR_PAD_LEFT) . chr(0);
+				$header .= str_pad(decoct(0),11,"0",STR_PAD_LEFT) . chr(0);
+				$header .= str_pad(decoct($information["time"]),11,"0",STR_PAD_LEFT) . chr(0);
+				$header .= str_repeat(" ",8);
+				$header .= "5";
+				$header .= str_repeat(chr(0),100);
+				$header .= str_pad("ustar",6,chr(32));
+				$header .= chr(32) . chr(0);
+				$header .= str_pad("",32,chr(0));
+				$header .= str_pad("",32,chr(0));
+				$header .= str_repeat(chr(0),8);
+				$header .= str_repeat(chr(0),8);
+				$header .= str_repeat(chr(0),155);
+				$header .= str_repeat(chr(0),12);
+
+				// Compute header checksum
+				$checksum = str_pad(decoct($this->__computeUnsignedChecksum($header)),6,"0",STR_PAD_LEFT);
+				for($i=0; $i<6; $i++) {
+					$header[(148 + $i)] = substr($checksum,$i,1);
+				}
+				$header[154] = chr(0);
+				$header[155] = chr(32);
+
+				// Add new tar formatted data to tar file contents
+				$this->tar_file .= $header;
+			}
+		}
+
+		// Generate Records for each file, if we have files (We should...)
+		if($this->numFiles > 0) {
+			$this->tar_file = '';
+			foreach($this->files as $key => $information) {
+				unset($header);
+
+				// Generate the TAR header for this file
+				// Filename, Permissions, UID, GID, size, Time, checksum, typeflag, linkname, magic, version, user name, group name, devmajor, devminor, prefix, end
+				$header = str_pad($information["name"],100,chr(0));
+				$header .= str_pad(decoct($information["mode"]),7,"0",STR_PAD_LEFT) . chr(0);
+				$header .= str_pad(decoct($information["user_id"]),7,"0",STR_PAD_LEFT) . chr(0);
+				$header .= str_pad(decoct($information["group_id"]),7,"0",STR_PAD_LEFT) . chr(0);
+				$header .= str_pad(decoct($information["size"]),11,"0",STR_PAD_LEFT) . chr(0);
+				$header .= str_pad(decoct($information["time"]),11,"0",STR_PAD_LEFT) . chr(0);
+				$header .= str_repeat(" ",8);
+				$header .= "0";
+				$header .= str_repeat(chr(0),100);
+				$header .= str_pad("ustar",6,chr(32));
+				$header .= chr(32) . chr(0);
+				$header .= str_pad($information["user_name"],32,chr(0));	// How do I get a file's user name from PHP?
+				$header .= str_pad($information["group_name"],32,chr(0));	// How do I get a file's group name from PHP?
+				$header .= str_repeat(chr(0),8);
+				$header .= str_repeat(chr(0),8);
+				$header .= str_repeat(chr(0),155);
+				$header .= str_repeat(chr(0),12);
+
+				// Compute header checksum
+				$checksum = str_pad(decoct($this->__computeUnsignedChecksum($header)),6,"0",STR_PAD_LEFT);
+				for($i=0; $i<6; $i++) {
+					$header[(148 + $i)] = substr($checksum,$i,1);
+				}
+				$header[154] = chr(0);
+				$header[155] = chr(32);
+
+				// Pad file contents to byte count divisible by 512
+				$file_contents = str_pad($information["file"],(ceil($information["size"] / 512) * 512),chr(0));
+
+				// Add new tar formatted data to tar file contents
+				$this->tar_file .= $header . $file_contents;
+			}
+		}
+
+		// Add 512 bytes of NULLs to designate EOF
+		$this->tar_file .= str_repeat(chr(0),512);
+
+		return true;
+	}
+
+
+	/**
+	 * Open a TAR file
+	 * 
+	 * @param   string  $filename
+	 * @return  bool 
+	 **/
+	function openTAR($filename)
+	{
+		// Clear any values from previous tar archives
+		unset($this->filename);
+		unset($this->isGzipped);
+		unset($this->tar_file);
+		unset($this->files);
+		unset($this->directories);
+		unset($this->numFiles);
+		unset($this->numDirectories);
+
+		// If the tar file doesn't exist...
+		if(!file_exists($filename))
+			return false;
+
+		$this->filename = $filename;
+
+		// Parse this file
+		$this->__readTar();
+
+		return true;
+	}
+
+	/**
+	 * Appends a tar file to the end of the currently opened tar file.
+	 * 
+	 * @param   string  $filename
+	 * @return  bool
+	 **/
+	function appendTar($filename)
+	{
+		// If the tar file doesn't exist...
+		if(!file_exists($filename))
+			return false;
+
+		$this->__readTar($filename);
+
+		return true;
+	}
+
+	/**
+	 * Retrieves information about a file in the current tar archive
+	 * 
+	 * @param   string  $filename
+	 * @return  string  FALSE on fail
+	 **/
+	function getFile($filename)
+	{
+		if ( $this->numFiles > 0 ) {
+			foreach($this->files as $key => $information) {
+				if($information["name"] == $filename)
+					return $information;
+			}
+		}
+
+		return false;
+	}
+
+	/**
+	 * Retrieves information about a directory in the current tar archive
+	 * 
+	 * @param   string  $dirname
+	 * @return  string  FALSE on fail
+	 **/
+	function getDirectory($dirname)
+	{
+		if($this->numDirectories > 0) {
+			foreach($this->directories as $key => $information) {
+				if($information["name"] == $dirname)
+					return $information;
+			}
+		}
+
+		return false;
+	}
+
+	/**
+	 * Check if this tar archive contains a specific file
+	 * 
+	 * @param   string  $filename
+	 * @return  bool
+	 **/
+	function containsFile($filename)
+	{
+		if ( $this->numFiles > 0 ) {
+			foreach($this->files as $key => $information) {
+				if($information["name"] == $filename)
+					return true;
+			}
+		}
+		return false;
+	}
+
+	/**
+	 * Check if this tar archive contains a specific directory
+	 * 
+	 * @param   string  $dirname
+	 * @return  bool
+	 **/
+	function containsDirectory($dirname)
+	{
+		if ( $this->numDirectories > 0 ) {
+			foreach ( $this->directories as $key => $information ) {
+				if ( $information["name"] == $dirname ) {
+					return true;
+				}
+			}
+		}
+		return false;
+	}
+
+	/**
+	 * Add a directory to this tar archive
+	 * 
+	 * @param   string  $dirname
+	 * @return  bool
+	 **/
+	function addDirectory($dirname)
+	{
+		if ( !file_exists($dirname) ) {
+			return false;
+		}
+
+		// Get directory information
+		$file_information = stat($dirname);
+
+		// Add directory to processed data
+		$this->numDirectories++;
+		$activeDir		= &$this->directories[];
+		$activeDir["name"]	= $dirname;
+		$activeDir["mode"]	= $file_information["mode"];
+		$activeDir["time"]	= $file_information["time"];
+		$activeDir["user_id"]	= $file_information["uid"];
+		$activeDir["group_id"]	= $file_information["gid"];
+		$activeDir["checksum"]	= $checksum;
+
+		return true;
+	}
+
+	/**
+	 * Add a file to the tar archive
+	 * 
+	 * @param   string  $filename
+	 * @param   boolean $binary     Binary file?
+	 * @return  bool
+	 **/
+	function addFile($filename, $binary = false)
+	{
+		// Make sure the file we are adding exists!
+		if ( !file_exists($filename) ) {
+			return false;
+		}
+
+		// Make sure there are no other files in the archive that have this same filename
+		if ( $this->containsFile($filename) ) {
+			return false;
+		}
+
+		// Get file information
+		$file_information = stat($filename);
+
+		// Read in the file's contents
+		if (!$binary) {
+			$fp = fopen($filename, "r");
+		} else {
+			$fp = fopen($filename, "rb");
+		}
+		$file_contents = fread($fp,filesize($filename));
+		fclose($fp);
+
+		// Add file to processed data
+		$this->numFiles++;
+		$activeFile			= &$this->files[];
+		$activeFile["name"]		= $filename;
+		$activeFile["mode"]		= $file_information["mode"];
+		$activeFile["user_id"]		= $file_information["uid"];
+		$activeFile["group_id"]		= $file_information["gid"];
+		$activeFile["size"]		= $file_information["size"];
+		$activeFile["time"]		= $file_information["mtime"];
+		$activeFile["checksum"]		= isset($checksum) ? $checksum : '';
+		$activeFile["user_name"]	= "";
+		$activeFile["group_name"]	= "";
+		$activeFile["file"]		= trim($file_contents);
+
+		return true;
+	}
+
+	/**
+	 * Remove a file from the tar archive
+	 * 
+	 * @param   string  $filename
+	 * @return  bool
+	 **/
+	function removeFile($filename)
+	{
+		if ( $this->numFiles > 0 ) {
+			foreach ( $this->files as $key => $information ) {
+				if ( $information["name"] == $filename ) {
+					$this->numFiles--;
+					unset($this->files[$key]);
+					return true;
+				}
+			}
+		}
+		return false;
+	}
+
+	/**
+	 * Remove a directory from the tar archive
+	 * 
+	 * @param   string  $dirname
+	 * @return  bool
+	 **/
+	function removeDirectory($dirname)
+	{
+		if ( $this->numDirectories > 0 ) {
+			foreach ( $this->directories as $key => $information ) {
+				if ( $information["name"] == $dirname ) {
+					$this->numDirectories--;
+					unset($this->directories[$key]);
+					return true;
+				}
+			}
+		}
+		return false;
+	}
+
+	/**
+	 * Write the currently loaded tar archive to disk
+	 * 
+	 * @return  bool 
+	 **/
+	function saveTar()
+	{
+		if ( !$this->filename ) {
+			return false;
+		}
+
+		// Write tar to current file using specified gzip compression
+		$this->toTar($this->filename,$this->isGzipped);
+
+		return true;
+	}
+
+	/**
+	 * Saves tar archive to a different file than the current file
+	 * 
+	 * @param   string  $filename
+	 * @param   bool    $useGzip    Use GZ compression?
+	 * @return  bool
+	 **/
+	function toTar($filename,$useGzip)
+	{
+		if ( !$filename ) {
+			return false;
+		}
+
+		// Encode processed files into TAR file format
+		$this->__generateTar();
+
+		// GZ Compress the data if we need to
+		if ( $useGzip ) {
+			// Make sure we have gzip support
+			if ( !function_exists("gzencode") ) {
+				return false;
+			}
+
+			$file = gzencode($this->tar_file);
+		} else {
+			$file = $this->tar_file;
+		}
+
+		// Write the TAR file
+		$fp = fopen($filename,"wb");
+		fwrite($fp,$file);
+		fclose($fp);
+
+		return true;
+	}
+
+	/**
+	 * Sends tar archive to stdout
+	 * 
+	 * @param   string  $filename
+	 * @param   bool    $useGzip    Use GZ compression?
+	 * @return  string
+	 **/
+	function toTarOutput($filename,$useGzip)
+	{
+		if ( !$filename ) {
+			return false;
+		}
+
+		// Encode processed files into TAR file format
+		$this->__generateTar();
+
+		// GZ Compress the data if we need to
+		if ( $useGzip ) {
+			// Make sure we have gzip support
+			if ( !function_exists("gzencode") ) {
+				return false;
+			}
+
+			$file = gzencode($this->tar_file);
+		} else {
+			$file = $this->tar_file;
+		}
+
+		return $file;
+	}
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/mail/xoopsmultimailer.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/mail/xoopsmultimailer.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/mail/xoopsmultimailer.php	(revision 405)
@@ -0,0 +1,192 @@
+<?php
+// $Id: xoopsmultimailer.php,v 1.3 2006/05/01 02:37:24 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Jochen Büînagel (job@buennagel.com)                               //
+// URL:  http://www.xoops.org												 //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+/**
+ * @package		class
+ * @subpackage	mail
+ * 
+ * @filesource 
+ *
+ * @author		Jochen Büînagel	<jb@buennagel.com>
+ * @copyright	copyright (c) 2000-2003 The XOOPS Project (http://www.xoops.org)
+ *
+ * @version		$Revision: 1.3 $ - $Date: 2006/05/01 02:37:24 $
+ */
+
+/**
+ * load the base class
+ */
+require_once(XOOPS_ROOT_PATH.'/class/mail/phpmailer/class.phpmailer.php');
+
+/**
+ * Mailer Class.
+ * 
+ * At the moment, this does nothing but send email through PHP's "mail()" function,
+ * but it has the abiltiy to do much more.
+ * 
+ * If you have problems sending mail with "mail()", you can edit the member variables
+ * to suit your setting. Later this will be possible through the admin panel.
+ *
+ * @todo		Make a page in the admin panel for setting mailer preferences.
+ * 
+ * @package		class
+ * @subpackage	mail
+ *
+ * @author		Jochen Buennagel	<job@buennagel.com>
+ * @copyright	(c) 2000-2003 The Xoops Project - www.xoops.org
+ * @version		$Revision: 1.3 $ - changed by $Author: onokazu $ on $Date: 2006/05/01 02:37:24 $
+ */
+class XoopsMultiMailer extends PHPMailer {
+
+	/**
+	 * "from" address
+	 * @var 	string
+	 * @access	private
+	 */
+	var $From 		= "";
+	
+	/**
+	 * "from" name
+	 * @var 	string
+	 * @access	private
+	 */
+	var $FromName 	= "";
+
+	// can be "smtp", "sendmail", or "mail"
+	/**
+	 * Method to be used when sending the mail.
+	 * 
+	 * This can be:
+	 * <li>mail (standard PHP function "mail()") (default)
+	 * <li>smtp	(send through any SMTP server, SMTPAuth is supported.
+	 * You must set {@link $Host}, for SMTPAuth also {@link $SMTPAuth}, 
+	 * {@link $Username}, and {@link $Password}.)
+	 * <li>sendmail (manually set the path to your sendmail program 
+	 * to something different than "mail()" uses in {@link $Sendmail}) 
+	 * 
+	 * @var 	string
+	 * @access	private
+	 */
+	var $Mailer		= "mail";
+
+	/**
+	 * set if $Mailer is "sendmail"
+	 * 
+	 * Only used if {@link $Mailer} is set to "sendmail".
+	 * Contains the full path to your sendmail program or replacement.
+	 * @var 	string
+	 * @access	private
+	 */
+	var $Sendmail = "/usr/sbin/sendmail";
+
+	/**
+	 * SMTP Host.
+	 * 
+	 * Only used if {@link $Mailer} is set to "smtp"
+	 * @var 	string
+	 * @access	private
+	 */
+	var $Host		= "";
+
+	/**
+	 * Does your SMTP host require SMTPAuth authentication?
+	 * @var 	boolean
+	 * @access	private
+	 */
+	var $SMTPAuth	= FALSE;
+
+	/**
+	 * Username for authentication with your SMTP host.
+	 * 
+	 * Only used if {@link $Mailer} is "smtp" and {@link $SMTPAuth} is TRUE
+	 * @var 	string
+	 * @access	private
+	 */
+	var $Username	= "";
+
+	/**
+	 * Password for SMTPAuth.
+	 * 
+	 * Only used if {@link $Mailer} is "smtp" and {@link $SMTPAuth} is TRUE
+	 * @var 	string
+	 * @access	private
+	 */
+	var $Password	= "";
+	
+	/**
+	 * Constuctor
+	 * 
+	 * @access public
+	 * @return void 
+	 * 
+	 * @global	$xoopsConfig
+	 */
+	function XoopsMultiMailer(){
+		global $xoopsConfig;
+	
+		$config_handler =& xoops_gethandler('config');
+		$xoopsMailerConfig =& $config_handler->getConfigsByCat(XOOPS_CONF_MAILER);
+		$this->From = $xoopsMailerConfig['from'];
+		if ($this->From == '') {
+		    $this->From = $xoopsConfig['adminmail'];
+		}
+		// $this->Sender = $xoopsConfig['adminmail']; //TODO: This line is added in OTX by Marijuana. We must verify.
+		if ($xoopsMailerConfig["mailmethod"] == "smtpauth") {
+		    $this->Mailer = "smtp";
+			$this->SMTPAuth = TRUE;
+			$this->Host = implode(';',$xoopsMailerConfig['smtphost']);
+			$this->Username = $xoopsMailerConfig['smtpuser'];
+			$this->Password = $xoopsMailerConfig['smtppass'];
+		} else {
+			$this->Mailer = $xoopsMailerConfig['mailmethod'];
+			$this->SMTPAuth = FALSE;
+			$this->Sendmail = $xoopsMailerConfig['sendmailpath'];
+			$this->Host = implode(';',$xoopsMailerConfig['smtphost']);
+		}
+	}
+
+	/**
+     * Formats an address correctly. This overrides the default AddrFormat method
+     * which does not seem to encode $FromName correctly
+     * This method name is renamed from "addr_format", because method name in parent class is renamed.
+     * @access private
+     * @return string
+     */
+     //TODO: We must verify,whether we should prepare this method even now.(phpmailer is upgraded from 1.65 to 1.73)
+    function AddrFormat($addr) {
+        if(empty($addr[1]))
+            $formatted = $addr[0];
+        else
+            $formatted = sprintf('%s <%s>', '=?'.$this->CharSet.'?B?'.base64_encode($addr[1]).'?=', $addr[0]);
+
+        return $formatted;
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/mail/phpmailer/class.phpmailer.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/mail/phpmailer/class.phpmailer.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/mail/phpmailer/class.phpmailer.php	(revision 405)
@@ -0,0 +1,1499 @@
+<?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
+////////////////////////////////////////////////////
+
+/**
+ * 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           = "iso-8859-1";
+
+    /**
+     * 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.73";
+
+    /**
+     * 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 = "";
+        $result = true;
+
+        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->error_count = 0; // reset errors
+        $this->SetMessageType();
+        $header .= $this->CreateHeader();
+        $body = $this->CreateBody();
+
+        if($body == "") { return false; }
+
+        // Choose the mailer
+        switch($this->Mailer)
+        {
+            case "sendmail":
+                $result = $this->SendmailSend($header, $body);
+                break;
+            case "mail":
+                $result = $this->MailSend($header, $body);
+                break;
+            case "smtp":
+                $result = $this->SmtpSend($header, $body);
+                break;
+            default:
+            $this->SetError($this->Mailer . $this->Lang("mailer_not_supported"));
+                $result = false;
+                break;
+        }
+
+        return $result;
+    }
+    
+    /**
+     * 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_attachments":
+              $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 = md5(uniqid(time()));
+        $this->boundary[1] = "b1_" . $uniq_id;
+        $this->boundary[2] = "b2_" . $uniq_id;
+
+        $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 [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())
+                {
+                    $result .= sprintf("Content-Type: %s;%s\ttype=\"text/html\";%s\tboundary=\"%s\"%s", 
+                                    "multipart/related", $this->LE, $this->LE, 
+                                    $this->boundary[1], $this->LE);
+                }
+                else
+                {
+                    $result .= $this->HeaderLine("Content-Type", "multipart/mixed;");
+                    $result .= $this->TextLine("\tboundary=\"" . $this->boundary[1] . '"');
+                }
+                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":
+                $result .= $this->GetBoundary($this->boundary[1], "", "", "");
+                $result .= $this->EncodeString($this->Body, $this->Encoding);
+                $result .= $this->LE;
+     
+                $result .= $this->AttachAll();
+                break;
+            case "alt_attachments":
+                $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
+     */
+    function AttachAll() {
+        // Return text of body
+        $mime = array();
+
+        // Add all attachments
+        for($i = 0; $i < count($this->attachment); $i++)
+        {
+            // Check for string attachment
+            $bString = $this->attachment[$i][5];
+            if ($bString)
+                $string = $this->attachment[$i][0];
+            else
+                $path = $this->attachment[$i][0];
+
+            $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];
+            
+            $mime[] = sprintf("--%s%s", $this->boundary[1], $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", $this->boundary[1], $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 "";
+        }
+        $magic_quotes = get_magic_quotes_runtime();
+        set_magic_quotes_runtime(0);
+        $file_buffer = fread($fd, filesize($path));
+        $file_buffer = $this->EncodeString($file_buffer, $encoding);
+        fclose($fd);
+        set_magic_quotes_runtime($magic_quotes);
+
+        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;
+    }
+
+    /////////////////////////////////////////////////
+    // 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 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);
+    }
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/mail/phpmailer/README
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/mail/phpmailer/README	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/mail/phpmailer/README	(revision 405)
@@ -0,0 +1,102 @@
+PHPMailer
+Full Featured Email Transfer Class for PHP
+==========================================
+
+http://phpmailer.sourceforge.net/
+
+This software is licenced under the LGPL.  Please read LICENSE for information on the
+software availability and distribution.
+
+Class Features:
+- Send emails with multiple TOs, CCs, BCCs and REPLY-TOs
+- Redundant SMTP servers
+- Multipart/alternative emails for mail clients that do not read HTML email
+- Support for 8bit, base64, binary, and quoted-printable encoding
+- Uses the same methods as the very popular AspEmail active server (COM) component
+- SMTP authentication
+- Native language support
+- Word wrap, and more!
+
+Why you might need it:
+
+Many PHP developers utilize email in their code.  The only PHP function
+that supports this is the mail() function.  However, it does not expose
+any of the popular features that many email clients use nowadays like
+HTML-based emails and attachments. There are two proprietary
+development tools out there that have all the functionality built into
+easy to use classes: AspEmail(tm) and AspMail.  Both of these
+programs are COM components only available on Windows.  They are also a
+little pricey for smaller projects.
+
+Since I do Linux development Ive missed these tools for my PHP coding.
+So I built a version myself that implements the same methods (object
+calls) that the Windows-based components do. It is open source and the
+LGPL license allows you to place the class in your proprietary PHP
+projects.
+
+
+Installation:
+
+Copy class.phpmailer.php into your php.ini include_path. If you are
+using the SMTP mailer then place class.smtp.php in your path as well.
+In the language directory you will find several files like 
+phpmailer.lang-en.php.  If you look right before the .php extension 
+that there are two letters.  These represent the language type of the 
+translation file.  For instance "en" is the English file and "br" is 
+the Portuguese file.  Chose the file that best fits with your language 
+and place it in the PHP include path.  If your language is English 
+then you have nothing more to do.  If it is a different language then 
+you must point PHPMailer to the correct translation.  To do this, call 
+the PHPMailer SetLanguage method like so:
+
+// To load the Portuguese version
+$mail->SetLanguage("br", "/optional/path/to/language/directory/");
+
+That's it.  You should now be ready to use PHPMailer!
+
+
+A Simple Example:
+
+<?php
+require("class.phpmailer.php");
+
+$mail = new PHPMailer();
+
+$mail->IsSMTP();                                      // set mailer to use SMTP
+$mail->Host = "smtp1.example.com;smtp2.example.com";  // specify main and backup server
+$mail->SMTPAuth = true;     // turn on SMTP authentication
+$mail->Username = "jswan";  // SMTP username
+$mail->Password = "secret"; // SMTP password
+
+$mail->From = "from@example.com";
+$mail->FromName = "Mailer";
+$mail->AddAddress("josh@example.net", "Josh Adams");
+$mail->AddAddress("ellen@example.com");                  // name is optional
+$mail->AddReplyTo("info@example.com", "Information");
+
+$mail->WordWrap = 50;                                 // set word wrap to 50 characters
+$mail->AddAttachment("/var/tmp/file.tar.gz");         // add attachments
+$mail->AddAttachment("/tmp/image.jpg", "new.jpg");    // optional name
+$mail->IsHTML(true);                                  // set email format to HTML
+
+$mail->Subject = "Here is the subject";
+$mail->Body    = "This is the HTML message body <b>in bold!</b>";
+$mail->AltBody = "This is the body in plain text for non-HTML mail clients";
+
+if(!$mail->Send())
+{
+   echo "Message could not be sent. <p>";
+   echo "Mailer Error: " . $mail->ErrorInfo;
+   exit;
+}
+
+echo "Message has been sent";
+?>
+
+CHANGELOG
+
+See ChangeLog.txt
+
+Download: http://sourceforge.net/project/showfiles.php?group_id=26031
+
+Brent R. Matzelle
Index: /temp/test-xoops.ec-cube.net/html/class/mail/phpmailer/class.smtp.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/mail/phpmailer/class.smtp.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/mail/phpmailer/class.smtp.php	(revision 405)
@@ -0,0 +1,1045 @@
+<?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)," ");
+
+                # Patch to fix DOS attack
+                if(!$pos) {
+                    $pos = $max_line_length - 1;
+                }
+
+                $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;
+    }
+
+}
+
+
+ ?>
Index: /temp/test-xoops.ec-cube.net/html/class/mail/phpmailer/LICENSE
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/mail/phpmailer/LICENSE	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/mail/phpmailer/LICENSE	(revision 405)
@@ -0,0 +1,504 @@
+		  GNU LESSER GENERAL PUBLIC LICENSE
+		       Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 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.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it.  You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+  When we speak of free software, we are referring to freedom of use,
+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 and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+  To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights.  These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  To protect each distributor, we want to make it very clear that
+there is no warranty for the free library.  Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+  Finally, software patents pose a constant threat to the existence of
+any free program.  We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder.  Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+  Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License.  This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License.  We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+  When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library.  The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom.  The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+  We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License.  It also provides other free software developers Less
+of an advantage over competing non-free programs.  These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries.  However, the Lesser license provides advantages in certain
+special circumstances.
+
+  For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard.  To achieve this, non-free programs must be
+allowed to use the library.  A more frequent case is that a free
+library does the same job as widely used non-free libraries.  In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+  In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software.  For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+  Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+		  GNU LESSER GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, 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 library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+  
+  1. You may copy and distribute verbatim copies of the Library's
+complete 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 distribute a copy of this License along with the
+Library.
+
+  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 Library or any portion
+of it, thus forming a work based on the Library, 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) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+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 Library, 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 Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you 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.
+
+  If distribution of 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 satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+  6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Use a suitable shared library mechanism for linking with the
+    Library.  A suitable mechanism is one that (1) uses at run time a
+    copy of the library already present on the user's computer system,
+    rather than copying library functions into the executable, and (2)
+    will operate properly with a modified version of the library, if
+    the user installs one, as long as the modified version is
+    interface-compatible with the version that the work was made with.
+
+    c) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    d) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    e) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the materials to be 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.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library 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.
+
+  9. 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 Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+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 with
+this License.
+
+  11. 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 Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library 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 Library.
+
+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.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library 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.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser 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 Library
+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 Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+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
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "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
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. 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 LIBRARY 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
+LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), 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 Libraries
+
+  If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change.  You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+  To apply these terms, attach the following notices to the library.  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 library's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; 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.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+  <signature of Ty Coon>, 1 April 1990
+  Ty Coon, President of Vice
+
+That's all there is to it!
+
+
Index: /temp/test-xoops.ec-cube.net/html/class/mail/phpmailer/ChangeLog.txt
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/mail/phpmailer/ChangeLog.txt	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/mail/phpmailer/ChangeLog.txt	(revision 405)
@@ -0,0 +1,184 @@
+ChangeLog
+
+Version 1.73 (Sun, Jun 10 2005)
+* Fixed denial of service bug: http://www.cybsec.com/vuln/PHPMailer-DOS.pdf
+* Now has a total of 20 translations
+* Fixed alt attachments bug: http://tinyurl.com/98u9k
+
+Version 1.72 (Wed, May 25 2004)
+* Added Dutch, Swedish, Czech, Norwegian, and Turkish translations.
+* Received: Removed this method because spam filter programs like 
+SpamAssassin reject this header.
+* Fixed error count bug.
+* SetLanguage default is now "language/".
+* Fixed magic_quotes_runtime bug.
+
+Version 1.71 (Tue, Jul 28 2003)
+* Made several speed enhancements
+* Added German and Italian translation files
+* Fixed HELO/AUTH bugs on keep-alive connects
+* Now provides an error message if language file does not load
+* Fixed attachment EOL bug
+* Updated some unclear documentation
+* Added additional tests and improved others
+
+Version 1.70 (Mon, Jun 20 2003)
+* Added SMTP keep-alive support
+* Added IsError method for error detection
+* Added error message translation support (SetLanguage)
+* Refactored many methods to increase library performance
+* Hello now sends the newer EHLO message before HELO as per RFC 2821
+* Removed the boundary class and replaced it with GetBoundary
+* Removed queue support methods
+* New $Hostname variable
+* New Message-ID header
+* Received header reformat
+* Helo variable default changed to $Hostname
+* Removed extra spaces in Content-Type definition (#667182)
+* Return-Path should be set to Sender when set
+* Adds Q or B encoding to headers when necessary
+* quoted-encoding should now encode NULs \000
+* Fixed encoding of body/AltBody (#553370)
+* Adds "To: undisclosed-recipients:;" when all recipients are hidden (BCC)
+* Multiple bug fixes
+
+Version 1.65 (Fri, Aug 09 2002)
+* Fixed non-visible attachment bug (#585097) for Outlook
+* SMTP connections are now closed after each transaction
+* Fixed SMTP::Expand return value
+* Converted SMTP class documentation to phpDocumentor format
+
+Version 1.62 (Wed, Jun 26 2002)
+* Fixed multi-attach bug
+* Set proper word wrapping
+* Reduced memory use with attachments
+* Added more debugging
+* Changed documentation to phpDocumentor format
+
+Version 1.60 (Sat, Mar 30 2002)
+* Sendmail pipe and address patch (Christian Holtje)
+* Added embedded image and read confirmation support (A. Ognio)
+* Added unit tests
+* Added SMTP timeout support (*nix only)
+* Added possibly temporary PluginDir variable for SMTP class
+* Added LE message line ending variable
+* Refactored boundary and attachment code
+* Eliminated SMTP class warnings
+* Added SendToQueue method for future queuing support
+
+Version 1.54 (Wed, Dec 19 2001)
+* Add some queuing support code
+* Fixed a pesky multi/alt bug
+* Messages are no longer forced to have "To" addresses
+
+Version 1.50 (Thu, Nov 08 2001)
+* Fix extra lines when not using SMTP mailer
+* Set WordWrap variable to int with a zero default
+
+Version 1.47 (Tue, Oct 16 2001)
+* Fixed Received header code format
+* Fixed AltBody order error
+* Fixed alternate port warning
+
+Version 1.45 (Tue, Sep 25 2001)
+* Added enhanced SMTP debug support
+* Added support for multiple ports on SMTP
+* Added Received header for tracing
+* Fixed AddStringAttachment encoding
+* Fixed possible header name quote bug
+* Fixed wordwrap() trim bug
+* Couple other small bug fixes
+
+Version 1.41 (Wed, Aug 22 2001)
+* Fixed AltBody bug w/o attachments
+* Fixed rfc_date() for certain mail servers
+
+Version 1.40 (Sun, Aug 12 2001)
+* Added multipart/alternative support (AltBody)
+* Documentation update
+* Fixed bug in Mercury MTA
+
+Version 1.29 (Fri, Aug 03 2001)
+* Added AddStringAttachment() method
+* Added SMTP authentication support
+
+Version 1.28 (Mon, Jul 30 2001)
+* Fixed a typo in SMTP class
+* Fixed header issue with Imail (win32) SMTP server
+* Made fopen() calls for attachments use "rb" to fix win32 error
+
+Version 1.25 (Mon, Jul 02 2001)
+* Added RFC 822 date fix (Patrice)
+* Added improved error handling by adding a $ErrorInfo variable
+* Removed MailerDebug variable (obsolete with new error handler)
+
+Version 1.20 (Mon, Jun 25 2001)
+* Added quoted-printable encoding (Patrice)
+* Set Version as public and removed PrintVersion()
+* Changed phpdoc to only display public variables and methods
+
+Version 1.19 (Thu, Jun 21 2001)
+* Fixed MS Mail header bug
+* Added fix for Bcc problem with mail(). *Does not work on Win32*
+  (See PHP bug report: http://www.php.net/bugs.php?id=11616)
+* mail() no longer passes a fifth parameter when not needed
+
+Version 1.15 (Fri, Jun 15 2001)
+[Note: these changes contributed by Patrice Fournier]
+* Changed all remaining \n to \r\n
+* Bcc: header no longer writen to message except
+when sent directly to sendmail
+* Added a small message to non-MIME compliant mail reader
+* Added Sender variable to change the Sender email
+used in -f for sendmail/mail and in 'MAIL FROM' for smtp mode
+* Changed boundary setting to a place it will be set only once
+* Removed transfer encoding for whole message when using multipart
+* Message body now uses Encoding in multipart messages
+* Can set encoding and type to attachments 7bit, 8bit
+and binary attachment are sent as is, base64 are encoded
+* Can set Encoding to base64 to send 8 bits body
+through 7 bits servers
+
+Version 1.10 (Tue, Jun 12 2001)
+* Fixed win32 mail header bug (printed out headers in message body)
+
+Version 1.09 (Fri, Jun 08 2001)
+* Changed date header to work with Netscape mail programs
+* Altered phpdoc documentation
+
+Version 1.08 (Tue, Jun 05 2001)
+* Added enhanced error-checking
+* Added phpdoc documentation to source
+
+Version 1.06 (Fri, Jun 01 2001)
+* Added optional name for file attachments
+
+Version 1.05 (Tue, May 29 2001)
+* Code cleanup
+* Eliminated sendmail header warning message
+* Fixed possible SMTP error
+
+Version 1.03 (Thu, May 24 2001)
+* Fixed problem where qmail sends out duplicate messages
+
+Version 1.02 (Wed, May 23 2001)
+* Added multiple recipient and attachment Clear* methods
+* Added Sendmail public variable
+* Fixed problem with loading SMTP library multiple times
+
+Version 0.98 (Tue, May 22 2001)
+* Fixed problem with redundant mail hosts sending out multiple messages
+* Added additional error handler code
+* Added AddCustomHeader() function
+* Added support for Microsoft mail client headers (affects priority)
+* Fixed small bug with Mailer variable
+* Added PrintVersion() function
+
+Version 0.92 (Tue, May 15 2001)
+* Changed file names to class.phpmailer.php and class.smtp.php to match
+  current PHP class trend.
+* Fixed problem where body not being printed when a message is attached
+* Several small bug fixes
+
+Version 0.90 (Tue, April 17 2001)
+* Intial public release
Index: /temp/test-xoops.ec-cube.net/html/class/xoopsobject.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xoopsobject.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xoopsobject.php	(revision 405)
@@ -0,0 +1,14 @@
+<?php
+// $Id: xoopsobject.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+if (!defined('XOOPS_ROOT_PATH')) {
+	exit();
+}
+/**
+ * this file is for backward compatibility only
+ * @package kernel
+ **/
+/**
+ * Load the new object class 
+ **/
+require_once XOOPS_ROOT_PATH.'/kernel/object.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/xoopssecurity.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xoopssecurity.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xoopssecurity.php	(revision 405)
@@ -0,0 +1,66 @@
+<?php
+// $Id: xoopssecurity.php,v 1.1.2.9 2005/06/01 12:47:46 onokazu Exp $
+
+/**
+ * Class for xoops.org 2.0.10 compatibility
+ *
+ * @deprecated
+ */
+class XoopsSecurity
+{
+    var $errors;
+
+    function check($clearIfValid = true, $tokenValue = false) {
+        return $this->validateToken($tokenValue, $clearIfValid);
+    }
+
+    function createToken($timeout = XOOPS_TOKEN_TIMEOUT)
+    {
+        $token =& XoopsMultiTokenHandler::quickCreate(XOOPS_TOKEN_DEFAULT, $timeout);
+        return $token->getTokenValue();
+    }
+
+    function validateToken($tokenValue = false, $clearIfValid = true)
+    {
+        if (false !== $tokenValue) {
+            $handler = new XoopsSingleTokenHandler();
+            $token =& $handler->fetch(XOOPS_TOKEN_DEFAULT);
+            if($token->validate($tokenValue)) {
+                if ($clearIfValid) {
+                    $handler->unregister($token);
+                }
+                return true;
+            } else {
+                $this->setErrors('No token found');
+                return false;
+            }
+        }
+        return XoopsMultiTokenHandler::quickValidate(XOOPS_TOKEN_DEFAULT, $clearIfValid);
+    }
+
+    function getTokenHTML() {
+        $token =& XoopsMultiTokenHandler::quickCreate(XOOPS_TOKEN_DEFAULT);
+        return $token->getHtml();
+    }
+
+    function setErrors($error)
+    {
+        $this->errors[] = trim($error);
+    }
+
+    function &getErrors($ashtml = false)
+    {
+        if (!$ashtml) {
+            return $this->errors;
+        } else {
+            $ret = '';
+            if (count($this->errors) > 0) {
+                foreach ($this->errors as $error) {
+                    $ret .= $error.'<br />';
+                }
+            }
+            return $ret;
+        }
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/xoopsform/formtextdateselect.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xoopsform/formtextdateselect.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xoopsform/formtextdateselect.php	(revision 405)
@@ -0,0 +1,65 @@
+<?php
+// $Id: formtextdateselect.php,v 1.4 2005/08/03 12:39:11 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+/**
+ * @package     kernel
+ * @subpackage  form
+ *
+ * @author      Kazumi Ono  <onokazu@xoops.org>
+ * @copyright   copyright (c) 2000-2003 XOOPS.org
+ */
+
+/**
+ * A text field with calendar popup
+ *
+ * @package     kernel
+ * @subpackage  form
+ *
+ * @author      Kazumi Ono  <onokazu@xoops.org>
+ * @copyright   copyright (c) 2000-2003 XOOPS.org
+ */
+
+class XoopsFormTextDateSelect extends XoopsFormText
+{
+
+    function XoopsFormTextDateSelect($caption, $name, $size = 15, $value= 0)
+    {
+        $value = !is_numeric($value) ? time() : intval($value);
+        $this->XoopsFormText($caption, $name, $size, 25, $value);
+    }
+
+    function render()
+    {
+        $jstime = formatTimestamp($this->getValue(), '"F j, Y H:i:s"');
+        include_once XOOPS_ROOT_PATH.'/include/calendarjs.php';
+        return "<input type='text' name='".$this->getName()."' id='".$this->getName()."' size='".$this->getSize()."' maxlength='".$this->getMaxlength()."' value='".date("Y-m-d", $this->getValue())."'".$this->getExtra()." /><input type='reset' value=' ... ' onclick='return showCalendar(\"".$this->getName()."\");'>";
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/xoopsform/formtext.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xoopsform/formtext.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xoopsform/formtext.php	(revision 405)
@@ -0,0 +1,133 @@
+<?php
+// $Id: formtext.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+/**
+ * @package     kernel
+ * @subpackage  form
+ * 
+ * @author	    Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ */
+ 
+/**
+ * A simple text field
+ * 
+ * @package     kernel
+ * @subpackage  form
+ * 
+ * @author	    Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ */
+class XoopsFormText extends XoopsFormElement {
+
+	/**
+     * Size
+	 * @var	int 
+     * @access	private
+	 */
+	var $_size;
+
+	/**
+     * Maximum length of the text
+	 * @var	int 
+	 * @access	private
+	 */
+	var $_maxlength;
+
+	/**
+     * Initial text
+	 * @var	string  
+	 * @access	private
+	 */
+	var $_value;
+
+	/**
+	 * Constructor
+	 * 
+	 * @param	string	$caption	Caption
+	 * @param	string	$name       "name" attribute
+	 * @param	int		$size	    Size
+	 * @param	int		$maxlength	Maximum length of text
+     * @param	string  $value      Initial text
+	 */
+	function XoopsFormText($caption, $name, $size, $maxlength, $value=""){
+		$this->setCaption($caption);
+		$this->setName($name);
+		$this->_size = intval($size);
+		$this->_maxlength = intval($maxlength);
+		$this->setValue($value);
+	}
+
+	/**
+	 * Get size
+	 * 
+     * @return	int
+	 */
+	function getSize(){
+		return $this->_size;
+	}
+
+	/**
+	 * Get maximum text length
+	 * 
+     * @return	int
+	 */
+	function getMaxlength(){
+		return $this->_maxlength;
+	}
+
+	/**
+	 * Get initial text value
+	 * 
+     * @return  string
+	 */
+	function getValue(){
+		return $this->_value;
+	}
+
+	/**
+	 * Set initial text value
+	 * 
+     * @param	$value  string
+	 */
+	function setValue($value){
+		$this->_value = $value;
+	}
+
+	/**
+	 * Prepare HTML for output
+	 * 
+     * @return	string  HTML
+	 */
+	function render(){
+		return "<input type='text' name='".$this->getName()."' id='".$this->getName()."' size='".$this->getSize()."' maxlength='".$this->getMaxlength()."' value='".$this->getValue()."'".$this->getExtra()." />";
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/xoopsform/formselectmatchoption.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xoopsform/formselectmatchoption.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xoopsform/formselectmatchoption.php	(revision 405)
@@ -0,0 +1,73 @@
+<?php
+// $Id: formselectmatchoption.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+/**
+ * @package     kernel
+ * @subpackage  form
+ * 
+ * @author	    Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ */
+/**
+ * base class
+ */
+include_once XOOPS_ROOT_PATH."/class/xoopsform/formselect.php";
+
+/**
+ * A selection box with options for matching search terms.
+ * 
+ * @package     kernel
+ * @subpackage  form
+ * 
+ * @author	    Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ */
+class XoopsFormSelectMatchOption extends XoopsFormSelect
+{
+	/**
+	 * Constructor
+	 * 
+	 * @param	string	$caption
+	 * @param	string	$name
+	 * @param	mixed	$value	Pre-selected value (or array of them). 
+	 * 							Legal values are {@link XOOPS_MATCH_START}, {@link XOOPS_MATCH_END}, 
+	 * 							{@link XOOPS_MATCH_EQUAL}, and {@link XOOPS_MATCH_CONTAIN}
+	 * @param	int		$size	Number of rows. "1" makes a drop-down-list
+	 */
+	function XoopsFormSelectMatchOption($caption, $name, $value=null, $size=1)
+	{
+		$this->XoopsFormSelect($caption, $name, $value, $size, false);
+		$this->addOption(XOOPS_MATCH_START, _STARTSWITH);
+		$this->addOption(XOOPS_MATCH_END, _ENDSWITH);
+		$this->addOption(XOOPS_MATCH_EQUAL, _MATCHES);
+		$this->addOption(XOOPS_MATCH_CONTAIN, _CONTAINS);
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/xoopsform/formcheckbox.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xoopsform/formcheckbox.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xoopsform/formcheckbox.php	(revision 405)
@@ -0,0 +1,160 @@
+<?php
+// $Id: formcheckbox.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+/**
+ * @package     kernel
+ * @subpackage  form
+ * 
+ * @author	    Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ */
+/**
+ * One or more Checkbox(es)
+ * 
+ * @package     kernel
+ * @subpackage  form
+ * 
+ * @author	Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ */
+class XoopsFormCheckBox extends XoopsFormElement {
+
+	/**
+     * Availlable options
+	 * @var array   
+	 * @access	private
+	 */
+	var $_options = array();
+
+	/**
+     * pre-selected values in array
+	 * @var	array   
+	 * @access	private
+	 */
+	var $_value = array();
+
+	/**
+	 * Constructor
+	 * 
+     * @param	string  $caption
+     * @param	string  $name
+     * @param	mixed   $value  Either one value as a string or an array of them.   
+	 */
+	function XoopsFormCheckBox($caption, $name, $value = null){
+		$this->setCaption($caption);
+		$this->setName($name);
+		if (isset($value)) {
+			$this->setValue($value);
+		}
+	}
+
+	/**
+	 * Get the "value"
+	 * 
+     * @return	array
+	 */
+	function getValue(){
+		return $this->_value;
+	}
+
+	/**
+	 * Set the "value"
+	 * 
+     * @param	array
+	 */
+	function setValue($value){
+		$this->_value = array();
+		if (is_array($value)) {
+			foreach ($value as $v) {
+				$this->_value[] = $v;
+			}
+		} else {
+			$this->_value[] = $value;
+		}
+	}
+
+	/**
+	 * Add an option
+	 * 
+     * @param	string  $value  
+     * @param	string  $name   
+	 */
+	function addOption($value, $name=""){
+		if ($name != "") {
+			$this->_options[$value] = $name;
+		} else {
+			$this->_options[$value] = $value;
+		}
+	}
+
+	/**
+	 * Add multiple Options at once
+	 * 
+     * @param	array   $options    Associative array of value->name pairs
+	 */
+	function addOptionArray($options){
+		if ( is_array($options) ) {
+			foreach ( $options as $k=>$v ) {
+				$this->addOption($k, $v);
+			}
+		}
+	}
+
+	/**
+	 * Get an array with all the options
+	 * 
+     * @return	array   Associative array of value->name pairs
+	 */
+	function getOptions(){
+		return $this->_options;
+	}
+
+	/**
+	 * prepare HTML for output
+	 * 
+     * @return	string
+	 */
+	function render(){
+		$ret = "";
+		if ( count($this->getOptions()) > 1 && substr($this->getName(), -2, 2) != "[]" ) {
+			$newname = $this->getName()."[]";
+			$this->setName($newname);
+		}
+		foreach ( $this->getOptions() as $value => $name ) {
+			$ret .= "<input type='checkbox' name='".$this->getName()."' value='".$value."'";
+			if (count($this->getValue()) > 0 && in_array($value, $this->getValue())) {
+				$ret .= " checked='checked'";
+			}
+			$ret .= $this->getExtra()." />".$name."\n";
+		}
+		return $ret;
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/xoopsform/tableform.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xoopsform/tableform.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xoopsform/tableform.php	(revision 405)
@@ -0,0 +1,82 @@
+<?php
+// $Id: tableform.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+/**
+ * 
+ * 
+ * @package     kernel
+ * @subpackage  form
+ * 
+ * @author	    Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ */
+/**
+ * the base class
+ */
+include_once XOOPS_ROOT_PATH."/class/xoopsform/form.php";
+
+/**
+ * Form that will output formatted as a HTML table
+ * 
+ * No styles and no JavaScript to check for required fields.
+ * 
+ * @author	Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ * 
+ * @package     kernel
+ * @subpackage  form
+ */
+class XoopsTableForm extends XoopsForm
+{
+
+	/**
+	 * create HTML to output the form as a table
+	 * 
+     * @return	string
+	 */
+	function render()
+	{
+		$ret = $this->getTitle()."\n<form name='".$this->getName()."' id='".$this->getName()."' action='".$this->getAction()."' method='".$this->getMethod()."'".$this->getExtra().">\n<table border='0' width='100%'>\n";
+		foreach ( $this->getElements() as $ele ) {
+			if ( !$ele->isHidden() ) {
+				$ret .= "<tr valign='top' align='left'><td>".$ele->getCaption();
+				if ($ele->getDescription() != '') {
+					$ret .= '<br /><br /><span style="font-weight: normal;">'.$ele->getDescription().'</span>';
+				}
+				$ret .= "</td><td>".$ele->render()."</td></tr>";
+			} else {
+				$ret .= $ele->render()."\n";
+			}
+		}
+		$ret .= "</table>\n</form>\n";
+		return $ret;
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/xoopsform/formelementtray.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xoopsform/formelementtray.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xoopsform/formelementtray.php	(revision 405)
@@ -0,0 +1,184 @@
+<?php
+// $Id: formelementtray.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+/**
+ * 
+ * 
+ * @package     kernel
+ * @subpackage  form
+ * 
+ * @author	    Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ */
+ 
+/**
+ * A group of form elements
+ * 
+ * @author	Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ * 
+ * @package     kernel
+ * @subpackage  form
+ */
+class XoopsFormElementTray extends XoopsFormElement {
+
+	/**
+     * array of form element objects
+	 * @var array   
+     * @access  private
+	 */
+	var $_elements = array();
+
+	/**
+     * required elements
+	 * @var array   
+	 */
+	var $_required = array();
+
+	/**
+     * HTML to seperate the elements
+	 * @var	string  
+	 * @access  private
+	 */
+	var $_delimeter;
+
+	/**
+	 * constructor
+	 * 
+     * @param	string  $caption    Caption for the group.
+     * @param	string  $delimiter  HTML to separate the elements
+	 */
+	function XoopsFormElementTray($caption, $delimeter="&nbsp;", $name=""){
+	    $this->setName($name);
+		$this->setCaption($caption);
+		$this->_delimeter = $delimeter;
+	}
+
+	/**
+	 * Is this element a container of other elements?
+	 * 
+     * @return	bool true
+	 */	
+	function isContainer()
+	{
+		return true;
+	}
+
+	/**
+	 * Add an element to the group
+	 * 
+     * @param	object  &$element    {@link XoopsFormElement} to add
+	 */
+	function addElement(&$formElement, $required=false){
+		$this->_elements[] =& $formElement;
+		if ($required) {
+			if (!$formElement->isContainer()) {
+				$this->_required[] =& $formElement;
+			} else {
+				$required_elements =& $formElement->getElements(true);
+				$count = count($required_elements);
+				for ($i = 0 ; $i < $count; $i++) {
+					$this->_required[] =& $required_elements[$i];
+				}
+			}
+		}
+	}
+
+	/**
+	 * get an array of "required" form elements
+	 * 
+     * @return	array   array of {@link XoopsFormElement}s 
+	 */
+	function &getRequired()
+	{
+		return $this->_required;
+	}
+
+	/**
+	 * Get an array of the elements in this group
+	 * 
+	 * @param	bool	$recurse	get elements recursively?
+     * @return  array   Array of {@link XoopsFormElement} objects. 
+	 */
+	function &getElements($recurse = false){
+		if (!$recurse) {
+			return $this->_elements;
+		} else {
+			$ret = array();
+			$count = count($this->_elements);
+			for ($i = 0; $i < $count; $i++) {
+				if (!$this->_elements[$i]->isContainer()) {
+					$ret[] =& $this->_elements[$i];
+				} else {
+					$elements =& $this->_elements[$i]->getElements(true);
+					$count2 = count($elements);
+					for ($j = 0; $j < $count2; $j++) {
+						$ret[] =& $elements[$j];
+					}
+					unset($elements);
+				}
+			}
+			return $ret;
+		}
+	}
+
+	/**
+	 * Get the delimiter of this group
+	 * 
+     * @return	string  The delimiter
+	 */
+	function getDelimeter(){
+		return $this->_delimeter;
+	}
+
+	/**
+	 * prepare HTML to output this group
+	 * 
+     * @return	string  HTML output
+	 */
+	function render(){
+		$count = 0;
+		$ret = "";
+		foreach ( $this->getElements() as $ele ) {
+			if ($count > 0) {
+				$ret .= $this->getDelimeter();
+			}
+			if ($ele->getCaption() != '') {
+				$ret .= $ele->getCaption()."&nbsp;";
+			}
+			$ret .= $ele->render()."\n";
+			if (!$ele->isHidden()) {
+				$count++;
+			}
+		}
+		return $ret;
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/xoopsform/formelement.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xoopsform/formelement.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xoopsform/formelement.php	(revision 405)
@@ -0,0 +1,290 @@
+<?php
+// $Id: formelement.php,v 1.3 2005/09/04 20:46:08 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+/**
+ * 
+ * 
+ * @package     kernel
+ * @subpackage  form
+ * 
+ * @author	    Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ */
+
+
+/**
+ * Abstract base class for form elements
+ * 
+ * @author	Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ * 
+ * @package     kernel
+ * @subpackage  form
+ */
+class XoopsFormElement {
+
+	/**#@+
+	 * @access private
+	 */
+	/**
+     * "name" attribute of the element
+	 * @var string  
+	 */
+	var $_name;
+
+	/**
+	 * caption of the element
+	 * @var	string
+	 */
+	var $_caption;
+
+	/**
+	 * Accesskey for this element
+	 * @var	string
+	 */
+	var $_accesskey = '';
+
+	/**
+	 * HTML class for this element
+	 * @var	string
+	 */
+	var $_class = '';
+
+	/**
+	 * hidden?
+	 * @var	bool
+	 */
+	var $_hidden = false;
+
+	/**
+	 * extra attributes to go in the tag
+	 * @var	string
+	 */
+	var $_extra = "";
+
+	/**
+	 * required field?
+	 * @var	bool
+	 */
+	var $_required = false;
+
+	/**
+	 * description of the field
+	 * @var	string
+	 */
+	var $_description = "";
+	/**#@-*/
+
+
+	/**
+	 * constructor
+	 *
+	 */
+	function XoopsFormElement(){
+		exit("This class cannot be instantiated!");
+	}
+
+	/**
+	 * Is this element a container of other elements?
+	 *
+	 * @return	bool false
+	 */
+	function isContainer()
+	{
+		return false;
+	}
+
+	/**
+	 * set the "name" attribute for the element
+	 *
+	 * @param	string  $name   "name" attribute for the element
+	 */
+	function setName($name) {
+		$this->_name = trim($name);
+	}
+
+	/**
+	 * get the "name" attribute for the element
+	 *
+	 * @param	bool    encode?
+	 * @return	string  "name" attribute
+	 */
+	function getName($encode=true) {
+		if (false != $encode) {
+			return str_replace("&amp;", "&", str_replace("'","&#039;",htmlspecialchars($this->_name)));
+		}
+		return $this->_name;
+	}
+
+	/**
+	 * set the "accesskey" attribute for the element
+	 *
+	 * @param	string  $key   "accesskey" attribute for the element
+	 */
+	function setAccessKey($key) {
+		$this->_accesskey = trim($key);
+	}
+	/**
+	 * get the "accesskey" attribute for the element
+	 *
+	 * @return 	string  "accesskey" attribute value
+	 */
+	function getAccessKey() {
+		return $this->_accesskey;
+	}
+	/**
+	 * If the accesskey is found in the specified string, underlines it
+	 *
+	 * @param	string  $str   String where to search the accesskey occurence
+	 * @return 	string  Enhanced string with the 1st occurence of accesskey underlined
+	 */
+	function getAccessString( $str ) {
+		$access = $this->getAccessKey();
+		if ( !empty($access) && ( false !== ($pos = strpos($str, $access)) ) ) {
+			return substr($str, 0, $pos) . '<span style="text-decoration:underline">' . substr($str, $pos, 1) . '</span>' . substr($str, $pos+1);
+		}
+		return $str;
+	}
+
+	/**
+	 * set the "class" attribute for the element
+	 *
+	 * @param	string  $key   "class" attribute for the element
+	 */
+	function setClass($class) {
+		$class = trim($class);
+		if ( empty($class) ) {
+			$this->_class = '';
+		} else {
+			$this->_class .= (empty($this->_class) ? '' : ' ') . $class;
+		}
+	}
+	/**
+	 * get the "class" attribute for the element
+	 *
+	 * @return 	string  "class" attribute value
+	 */
+	function getClass() {
+		return $this->_class;
+	}
+
+	/**
+	 * set the caption for the element
+	 *
+	 * @param	string  $caption
+	 */
+	function setCaption($caption) {
+		$this->_caption = trim($caption);
+	}
+
+	/**
+	 * get the caption for the element
+	 *
+	 * @return	string
+	 */
+	function getCaption() {
+		return $this->_caption;
+	}
+
+	/**
+	 * set the element's description
+	 *
+	 * @param	string  $description
+	 */
+	function setDescription($description) {
+		$this->_description = trim($description);
+	}
+
+	/**
+	 * get the element's description
+	 *
+	 * @return	string
+	 */
+	function getDescription() {
+		return $this->_description;
+	}
+
+	/**
+	 * flag the element as "hidden"
+	 *
+	 */
+	function setHidden() {
+		$this->_hidden = true;
+	}
+
+	/**
+	 * Find out if an element is "hidden".
+	 *
+	 * @return	bool
+	 */
+	function isHidden() {
+		return $this->_hidden;
+	}
+
+	/**
+	 * Add extra attributes to the element.
+	 *
+	 * This string will be inserted verbatim and unvalidated in the
+	 * element's tag. Know what you are doing!
+	 *
+	 * @param	string  $extra
+	 * @param   string  $replace If true, passed string will replace current content otherwise it will be appended to it
+	 * @return	string New content of the extra string
+	 */
+	function setExtra($extra, $replace = false){
+		if ( $replace) {
+			$this->_extra = " " .trim($extra);
+		} else {
+			$this->_extra .= " " . trim($extra);
+		}
+		return $this->_extra;
+	}
+
+	/**
+	 * Get the extra attributes for the element
+	 *
+	 * @return	string
+	 */
+	function getExtra(){
+		if (isset($this->_extra)) {
+			return $this->_extra;
+		}
+	}
+
+	/**
+	 * Generates output for the element.
+	 *
+	 * This method is abstract and must be overwritten by the child classes.
+	 * @abstract
+	 */
+	function render(){
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/xoopsform/simpleform.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xoopsform/simpleform.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xoopsform/simpleform.php	(revision 405)
@@ -0,0 +1,76 @@
+<?php
+// $Id: simpleform.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+/**
+ * 
+ * 
+ * @package     kernel
+ * @subpackage  form
+ * 
+ * @author	    Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ */
+
+/**
+ * base class
+ */
+include_once XOOPS_ROOT_PATH."/class/xoopsform/form.php";
+
+/**
+ * Form that will output as a simple HTML form with minimum formatting
+ * 
+ * @author	Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ * 
+ * @package     kernel
+ * @subpackage  form
+ */
+class XoopsSimpleForm extends XoopsForm
+{
+	/**
+	 * create HTML to output the form with minimal formatting
+	 * 
+     * @return	string
+	 */
+	function render()
+	{
+		$ret = $this->getTitle()."\n<form name='".$this->getName()."' id='".$this->getName()."' action='".$this->getAction()."' method='".$this->getMethod()."'".$this->getExtra().">\n";
+		foreach ( $this->getElements() as $ele ) {
+			if ( !$ele->isHidden() ) {
+				$ret .= "<b>".$ele->getCaption()."</b><br />".$ele->render()."<br />\n";
+			} else {
+				$ret .= $ele->render()."\n";
+			}
+		}
+		$ret .= "</form>\n";
+		return $ret;
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/xoopsform/formselecttimezone.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xoopsform/formselecttimezone.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xoopsform/formselecttimezone.php	(revision 405)
@@ -0,0 +1,74 @@
+<?php
+// $Id: formselecttimezone.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+/**
+ * @package     kernel
+ * @subpackage  form
+ * 
+ * @author	    Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ */
+
+/**
+ * lists of values
+ */
+include_once XOOPS_ROOT_PATH."/class/xoopslists.php";
+/**
+ * base class
+ */
+include_once XOOPS_ROOT_PATH."/class/xoopsform/formselect.php";
+
+/**
+ * A select box with timezones
+ * 
+ * @package     kernel
+ * @subpackage  form
+ * 
+ * @author	    Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ */
+class XoopsFormSelectTimezone extends XoopsFormSelect
+{
+	/**
+	 * Constructor
+	 * 
+	 * @param	string	$caption
+	 * @param	string	$name
+	 * @param	mixed	$value	Pre-selected value (or array of them). 
+	 * 							Legal values are "-12" to "12" with some ".5"s strewn in ;-)
+	 * @param	int		$size	Number of rows. "1" makes a drop-down-box.
+	 */
+	function XoopsFormSelectTimezone($caption, $name, $value=null, $size=1)
+	{
+		$this->XoopsFormSelect($caption, $name, $value, $size);
+		$this->addOptionArray(XoopsLists::getTimeZoneList());
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/xoopsform/formhidden.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xoopsform/formhidden.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xoopsform/formhidden.php	(revision 405)
@@ -0,0 +1,96 @@
+<?php
+// $Id: formhidden.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+/**
+ * @package     kernel
+ * @subpackage  form
+ * 
+ * @author	    Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ */
+/**
+ * A hidden field
+ * 
+ * @package     kernel
+ * @subpackage  form
+ * 
+ * @author	    Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ */
+class XoopsFormHidden extends XoopsFormElement {
+
+	/**
+     * Value
+	 * @var	string	
+	 * @access	private
+	 */
+	var $_value;
+
+	/**
+	 * Constructor
+	 * 
+	 * @param	string	$name	"name" attribute
+	 * @param	string	$value	"value" attribute
+	 */
+	function XoopsFormHidden($name, $value){
+		$this->setName($name);
+		$this->setHidden();
+		$this->setValue($value);
+		$this->setCaption("");
+	}
+
+	/**
+	 * Get the "value" attribute
+	 * 
+	 * @return	string
+	 */
+	function getValue(){
+		return $this->_value;
+	}
+
+	/**
+	 * Sets the "value" attribute
+	 * 
+	 * @patam  $value	string
+	 */
+	function setValue($value){
+		$this->_value = $value;
+	}
+
+	/**
+	 * Prepare HTML for output
+	 * 
+	 * @return	string	HTML
+	 */
+	function render(){
+		return "<input type='hidden' name='".$this->getName()."' id='".$this->getName()."' value='".$this->getValue()."' />";
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/xoopsform/formhiddentoken.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xoopsform/formhiddentoken.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xoopsform/formhiddentoken.php	(revision 405)
@@ -0,0 +1,58 @@
+<?php
+// $Id: formhiddentoken.php,v 1.1.4.10 2005/06/01 10:30:04 onokazu Exp $ //  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 // //  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+/**
+ *
+ * @author      Kazumi Ono  <onokazu@xoops.org>
+ * @copyright   copyright (c) 2000-2005 XOOPS.org
+ */
+/**
+ * A hidden token field
+ *
+ *
+ * @author      Kazumi Ono  <onokazu@xoops.org>
+ * @copyright   copyright (c) 2000-2005 XOOPS.org
+ */
+class XoopsFormHiddenToken extends XoopsFormHidden {
+
+    /**
+     * Constructor
+     *
+     * @param   string  $name   "name" attribute
+     */
+    function XoopsFormHiddenToken($name = null, $timeout = 360){
+        if (empty($name)) {
+            $token =& XoopsMultiTokenHandler::quickCreate(XOOPS_TOKEN_DEFAULT);
+            $name = $token->getTokenName();
+        } else {
+            $token =& XoopsSingleTokenHandler::quickCreate(XOOPS_TOKEN_DEFAULT);
+        }
+        $this->XoopsFormHidden($name, $token->getTokenValue());
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/xoopsform/formdatetime.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xoopsform/formdatetime.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xoopsform/formdatetime.php	(revision 405)
@@ -0,0 +1,73 @@
+<?php
+// $Id: formdatetime.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+/**
+ * 
+ * 
+ * @package     kernel
+ * @subpackage  form
+ * 
+ * @author	    Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ */
+ 
+/**
+ * Date and time selection field
+ * 
+ * @author	Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ * 
+ * @package     kernel
+ * @subpackage  form
+ */
+class XoopsFormDateTime extends XoopsFormElementTray
+{
+
+	function XoopsFormDateTime($caption, $name, $size = 15, $value=0)
+	{
+		$this->XoopsFormElementTray($caption, '&nbsp;');
+		$value = intval($value);
+		$value = ($value > 0) ? $value : time();
+		$datetime = getDate($value);
+		$this->addElement(new XoopsFormTextDateSelect('', $name.'[date]', $size, $value));
+		$timearray = array();
+		for ($i = 0; $i < 24; $i++) {
+			for ($j = 0; $j < 60; $j = $j + 10) {
+				$key = ($i * 3600) + ($j * 60);
+				$timearray[$key] = ($j != 0) ? $i.':'.$j : $i.':0'.$j;
+			}
+		}
+		ksort($timearray);
+		$timeselect = new XoopsFormSelect('', $name.'[time]', $datetime['hours'] * 3600 + 600 * ceil($datetime['minutes'] / 10));
+		$timeselect->addOptionArray($timearray);
+		$this->addElement($timeselect);
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/xoopsform/formselectgroup.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xoopsform/formselectgroup.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xoopsform/formselectgroup.php	(revision 405)
@@ -0,0 +1,76 @@
+<?php
+// $Id: formselectgroup.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+/**
+ * @package     kernel
+ * @subpackage  form
+ * 
+ * @author	    Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ */
+
+/**
+ * Parent
+ */
+include_once XOOPS_ROOT_PATH."/class/xoopsform/formselect.php";
+
+/**
+ * A select field with a choice of available groups
+ * 
+ * @package     kernel
+ * @subpackage  form
+ * 
+ * @author	    Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ */
+class XoopsFormSelectGroup extends XoopsFormSelect
+{
+	/**
+	 * Constructor
+	 * 
+	 * @param	string	$caption	
+	 * @param	string	$name
+	 * @param	bool	$include_anon	Include group "anonymous"?
+	 * @param	mixed	$value	    	Pre-selected value (or array of them).
+	 * @param	int		$size	        Number or rows. "1" makes a drop-down-list.
+     * @param	bool    $multiple       Allow multiple selections?
+	 */
+	function XoopsFormSelectGroup($caption, $name, $include_anon=false, $value=null, $size=1, $multiple=false)
+	{
+	    $this->XoopsFormSelect($caption, $name, $value, $size, $multiple);
+		$member_handler =& xoops_gethandler('member');
+		if (!$include_anon) {
+			$this->addOptionArray($member_handler->getGroupList(new Criteria('groupid', XOOPS_GROUP_ANONYMOUS, '!=')));
+		} else {
+			$this->addOptionArray($member_handler->getGroupList());
+		}
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/xoopsform/formradio.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xoopsform/formradio.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xoopsform/formradio.php	(revision 405)
@@ -0,0 +1,152 @@
+<?php
+// $Id: formradio.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+/**
+ * 
+ * 
+ * @package     kernel
+ * @subpackage  form
+ * 
+ * @author	    Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ */
+/**
+ * A Group of radiobuttons
+ * 
+ * @author	Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ * 
+ * @package		kernel
+ * @subpackage	form
+ */
+class XoopsFormRadio extends XoopsFormElement {
+
+	/**
+     * Array of Options
+	 * @var	array	
+	 * @access	private
+	 */
+	var $_options = array();
+
+	/**
+     * Pre-selected value
+	 * @var	string	
+	 * @access	private
+	 */
+	var $_value;
+
+	/**
+	 * Constructor
+	 * 
+	 * @param	string	$caption	Caption
+	 * @param	string	$name		"name" attribute
+	 * @param	string	$value		Pre-selected value
+	 */
+	function XoopsFormRadio($caption, $name, $value = null){
+		$this->setCaption($caption);
+		$this->setName($name);
+		if (isset($value)) {
+			$this->setValue($value);
+		}
+	}
+
+	/**
+	 * Get the pre-selected value
+	 * 
+	 * @return	string
+	 */
+	function getValue(){
+		return $this->_value;
+	}
+
+	/**
+	 * Set the pre-selected value
+	 * 
+	 * @param	$value	string
+	 */
+	function setValue($value){
+		$this->_value = $value;
+	}
+
+	/**
+	 * Add an option
+	 * 
+	 * @param	string	$value	"value" attribute - This gets submitted as form-data.
+	 * @param	string	$name	"name" attribute - This is displayed. If empty, we use the "value" instead.
+	 */
+	function addOption($value, $name=""){
+		if ( $name != "" ) {
+			$this->_options[$value] = $name;
+		} else {
+			$this->_options[$value] = $value;
+		}
+	}
+
+	/**
+	 * Adds multiple options
+	 * 
+	 * @param	array	$options	Associative array of value->name pairs.
+	 */
+	function addOptionArray($options){
+		if ( is_array($options) ) {
+			foreach ( $options as $k=>$v ) {
+				$this->addOption($k, $v);
+			}
+		}
+	}
+
+	/**
+	 * Gets the options
+	 * 
+	 * @return	array	Associative array of value->name pairs.
+	 */
+	function getOptions(){
+		return $this->_options;
+	}
+
+	/**
+	 * Prepare HTML for output
+	 * 
+	 * @return	string	HTML
+	 */
+	function render(){
+		$ret = "";
+		foreach ( $this->getOptions() as $value => $name ) {
+			$ret .= "<input type='radio' name='".$this->getName()."' value='".$value."'";
+			$selected = $this->getValue();
+			if ( isset($selected) && ($value == $selected) ) {
+				$ret .= " checked='checked'";
+			}
+			$ret .= $this->getExtra()." />".$name."\n";
+		}
+		return $ret;
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/xoopsform/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xoopsform/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xoopsform/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/class/xoopsform/formpassword.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xoopsform/formpassword.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xoopsform/formpassword.php	(revision 405)
@@ -0,0 +1,135 @@
+<?php
+// $Id: formpassword.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+/**
+ * 
+ * 
+ * @package     kernel
+ * @subpackage  form
+ * 
+ * @author	    Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ */
+/**
+ * A password field
+ * 
+ * @author	Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ * 
+ * @package     kernel
+ * @subpackage  form
+ */
+class XoopsFormPassword extends XoopsFormElement {
+
+	/**
+     * Size of the field.
+	 * @var	int	
+	 * @access	private
+	 */
+	var $_size;
+
+	/**
+     * Maximum length of the text
+	 * @var	int	
+	 * @access	private
+	 */
+	var $_maxlength;
+
+	/**
+     * Initial content of the field.
+	 * @var	string	
+	 * @access	private
+	 */
+	var $_value;
+
+	/**
+	 * Constructor
+	 * 
+	 * @param	string	$caption	Caption
+	 * @param	string	$name		"name" attribute
+	 * @param	int		$size		Size of the field
+	 * @param	int		$maxlength	Maximum length of the text
+	 * @param	int		$value		Initial value of the field. 
+	 * 								<b>Warning:</b> this is readable in cleartext in the page's source!
+	 */
+	function XoopsFormPassword($caption, $name, $size, $maxlength, $value=""){
+		$this->setCaption($caption);
+		$this->setName($name);
+		$this->_size = intval($size);
+		$this->_maxlength = intval($maxlength);
+		$this->setValue($value);
+	}
+
+	/**
+	 * Get the field size
+	 * 
+	 * @return	int
+	 */
+	function getSize(){
+		return $this->_size;
+	}
+
+	/**
+	 * Get the max length
+	 * 
+	 * @return	int
+	 */
+	function getMaxlength(){
+		return $this->_maxlength;
+	}
+
+	/**
+	 * Get the initial value
+	 * 
+	 * @return	string
+	 */
+	function getValue(){
+		return $this->_value;
+	}
+
+	/**
+	 * Set the initial value
+	 * 
+	 * @patam	$value	string
+	 */
+	function setValue($value){
+		$this->_value = $value;
+	}
+
+	/**
+	 * Prepare HTML for output
+	 * 
+	 * @return	string	HTML
+	 */
+	function render(){
+		return "<input type='password' name='".$this->getName()."' id='".$this->getName()."' size='".$this->getSize()."' maxlength='".$this->getMaxlength()."' value='".$this->getValue()."'".$this->getExtra()." />";
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/xoopsform/formselecttheme.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xoopsform/formselecttheme.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xoopsform/formselecttheme.php	(revision 405)
@@ -0,0 +1,72 @@
+<?php
+// $Id: formselecttheme.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+/**
+ * @package     kernel
+ * @subpackage  form
+ * 
+ * @author	    Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ */
+/**
+ * lists of values
+ */
+include_once XOOPS_ROOT_PATH."/class/xoopslists.php";
+/**
+ * base class
+ */
+include_once XOOPS_ROOT_PATH."/class/xoopsform/formselect.php";
+
+/**
+ * A select box with available themes
+ * 
+ * @package     kernel
+ * @subpackage  form
+ * 
+ * @author	    Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ */
+class XoopsFormSelectTheme extends XoopsFormSelect
+{
+	/**
+	 * Constructor
+	 * 
+	 * @param	string	$caption	
+	 * @param	string	$name
+	 * @param	mixed	$value	Pre-selected value (or array of them).
+	 * @param	int		$size	Number or rows. "1" makes a drop-down-list
+	 */
+	function XoopsFormSelectTheme($caption, $name, $value=null, $size=1)
+	{
+		$this->XoopsFormSelect($caption, $name, $value, $size);
+		$this->addOptionArray(XoopsLists::getThemesList());
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/xoopsform/themeform.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xoopsform/themeform.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xoopsform/themeform.php	(revision 405)
@@ -0,0 +1,111 @@
+<?php
+// $Id: themeform.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+/**
+ * 
+ * 
+ * @package     kernel
+ * @subpackage  form
+ * 
+ * @author	    Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ */
+/**
+ * base class
+ */
+include_once XOOPS_ROOT_PATH."/class/xoopsform/form.php";
+
+/**
+ * Form that will output as a theme-enabled HTML table
+ * 
+ * Also adds JavaScript to validate required fields
+ * 
+ * @author	Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ * 
+ * @package     kernel
+ * @subpackage  form
+ */
+class XoopsThemeForm extends XoopsForm
+{
+	/**
+	 * Insert an empty row in the table to serve as a seperator.
+	 * 
+     * @param	string  $extra  HTML to be displayed in the empty row.
+	 * @param	string	$class	CSS class name for <td> tag
+	 */
+	function insertBreak($extra = '', $class= '')
+	{
+    	$class = ($class != '') ? " class='$class'" : '';
+     	//Fix for $extra tag not showing
+		if ($extra) {
+			$extra = "<tr><td colspan='2' $class>$extra</td></tr>";
+			$this->addElement($extra);
+		} else {
+			$extra = "<tr><td colspan='2' $class>&nbsp;</td></tr>";
+			$this->addElement($extra);
+		}
+	}
+	
+	/**
+	 * create HTML to output the form as a theme-enabled table with validation.
+     * 
+	 * @return	string
+	 */
+	function render()
+	{
+		$required =& $this->getRequired();
+		$ret = "<form name='".$this->getName()."' id='".$this->getName()."' action='".$this->getAction()."' method='".$this->getMethod()."' onsubmit='return xoopsFormValidate_".$this->getName()."();'".$this->getExtra().">\n<table width='100%' class='outer' cellspacing='1'><tr><th colspan='2'>".$this->getTitle()."</th></tr>";
+		//$count = 0;
+		foreach ( $this->getElements() as $ele ) {
+			if (!is_object($ele)) {
+				$ret .= $ele;
+			} elseif (!$ele->isHidden()) {
+				//if ($count % 2 == 0) {
+					$class = 'even';
+				//} else {
+				//	$class = 'odd';
+				//}
+				$ret .= "<tr valign='top' align='left'><td class='head'>".$ele->getCaption();
+				if ($ele->getDescription() != '') {
+					$ret .= '<br /><br /><span style="font-weight: normal;">'.$ele->getDescription().'</span>';
+				}
+				$ret .= "</td><td class='$class'>".$ele->render()."</td></tr>";
+				//$count++;
+			} else {
+				$ret .= $ele->render();
+			}
+		}
+		$ret .= "</table></form>\n";
+		$ret .= $this->renderValidationJS( true );
+		return $ret;
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/xoopsform/formselectcountry.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xoopsform/formselectcountry.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xoopsform/formselectcountry.php	(revision 405)
@@ -0,0 +1,75 @@
+<?php
+// $Id: formselectcountry.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+/**
+ * @package     kernel
+ * @subpackage  form
+ * 
+ * @author	    Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ */
+
+/**
+ * lists of values
+ */
+include_once XOOPS_ROOT_PATH."/class/xoopslists.php";
+
+/**
+ * Parent
+ */
+include_once XOOPS_ROOT_PATH."/class/xoopsform/formselect.php";
+
+/**
+ * A select field with countries
+ * 
+ * @package     kernel
+ * @subpackage  form
+ * 
+ * @author	    Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ */
+class XoopsFormSelectCountry extends XoopsFormSelect
+{
+	/**
+	 * Constructor
+	 * 
+	 * @param	string	$caption	Caption
+	 * @param	string	$name       "name" attribute
+	 * @param	mixed	$value	    Pre-selected value (or array of them).
+     *                              Legal are all 2-letter country codes (in capitals).
+	 * @param	int		$size	    Number or rows. "1" makes a drop-down-list
+	 */
+	function XoopsFormSelectCountry($caption, $name, $value=null, $size=1)
+	{
+		$this->XoopsFormSelect($caption, $name, $value, $size);
+		$this->addOptionArray(XoopsLists::getCountryList());
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/xoopsform/formradioyn.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xoopsform/formradioyn.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xoopsform/formradioyn.php	(revision 405)
@@ -0,0 +1,73 @@
+<?php
+// $Id: formradioyn.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+/**
+ * @package     kernel
+ * @subpackage  form
+ * 
+ * @author	    Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ */
+ 
+/**
+ * base class
+ */
+include_once XOOPS_ROOT_PATH."/class/xoopsform/formradio.php";
+
+/**
+ * Yes/No radio buttons.
+ * 
+ * A pair of radio buttons labelled _YES and _NO with values 1 and 0
+ * 
+ * @package     kernel
+ * @subpackage  form
+ * 
+ * @author	    Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ */
+class XoopsFormRadioYN extends XoopsFormRadio
+{
+	/**
+	 * Constructor
+	 * 
+	 * @param	string	$caption
+	 * @param	string	$name
+	 * @param	string	$value		Pre-selected value, can be "0" (No) or "1" (Yes)
+	 * @param	string	$yes		String for "Yes"
+	 * @param	string	$no			String for "No"
+	 */
+	function XoopsFormRadioYN($caption, $name, $value=null, $yes=_YES, $no=_NO)
+	{
+		$this->XoopsFormRadio($caption, $name, $value);
+		$this->addOption(1, $yes);
+		$this->addOption(0, $no);
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/xoopsform/formdhtmltextarea.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xoopsform/formdhtmltextarea.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xoopsform/formdhtmltextarea.php	(revision 405)
@@ -0,0 +1,150 @@
+<?php
+// $Id: formdhtmltextarea.php,v 1.5 2006/05/01 02:37:26 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+/**
+ *
+ *
+ * @package     kernel
+ * @subpackage  form
+ *
+ * @author      Kazumi Ono  <onokazu@xoops.org>
+ * @copyright   copyright (c) 2000-2003 XOOPS.org
+ */
+/**
+ * base class
+ */
+include_once XOOPS_ROOT_PATH."/class/xoopsform/formtextarea.php";
+
+// Make sure you have included /include/xoopscodes.php, otherwise DHTML will not work properly!
+
+/**
+ * A textarea with xoopsish formatting and smilie buttons
+ *
+ * @author  Kazumi Ono  <onokazu@xoops.org>
+ * @copyright   copyright (c) 2000-2003 XOOPS.org
+ *
+ * @package     kernel
+ * @subpackage  form
+ */
+class XoopsFormDhtmlTextArea extends XoopsFormTextArea
+{
+    /**
+     * Hidden text
+     * @var string
+     * @access  private
+     */
+    var $_hiddenText;
+
+    /**
+     * Constructor
+     *
+     * @param   string  $caption    Caption
+     * @param   string  $name       "name" attribute
+     * @param   string  $value      Initial text
+     * @param   int     $rows       Number of rows
+     * @param   int     $cols       Number of columns
+     * @param   string  $hiddentext Hidden Text
+     */
+    function XoopsFormDhtmlTextArea($caption, $name, $value, $rows=5, $cols=50, $hiddentext="xoopsHiddenText")
+    {
+        $this->XoopsFormTextArea($caption, $name, $value, $rows, $cols);
+        $this->_hiddenText = $hiddentext;
+    }
+
+    /**
+     * Prepare HTML for output
+     *
+     * @return  string  HTML
+     */
+    function render()
+    {
+        $ret = "<a name='moresmiley'></a><img onmouseover='style.cursor=\"hand\"' src='".XOOPS_URL."/images/url.gif' alt='url' onclick='xoopsCodeUrl(\"".$this->getName()."\", \"".htmlspecialchars(_ENTERURL, ENT_QUOTES)."\", \"".htmlspecialchars(_ENTERWEBTITLE, ENT_QUOTES)."\");' />&nbsp;<img onmouseover='style.cursor=\"hand\"' src='".XOOPS_URL."/images/email.gif' alt='email' onclick='javascript:xoopsCodeEmail(\"".$this->getName()."\", \"".htmlspecialchars(_ENTEREMAIL, ENT_QUOTES)."\");' />&nbsp;<img onclick='javascript:xoopsCodeImg(\"".$this->getName()."\", \"".htmlspecialchars(_ENTERIMGURL, ENT_QUOTES)."\", \"".htmlspecialchars(_ENTERIMGPOS, ENT_QUOTES)."\", \"".htmlspecialchars(_IMGPOSRORL, ENT_QUOTES)."\", \"".htmlspecialchars(_ERRORIMGPOS, ENT_QUOTES)."\");' onmouseover='style.cursor=\"hand\"' src='".XOOPS_URL."/images/imgsrc.gif' alt='imgsrc' />&nbsp;<img onmouseover='style.cursor=\"hand\"' onclick='javascript:openWithSelfMain(\"".XOOPS_URL."/imagemanager.php?target=".$this->getName()."\",\"imgmanager\",400,430);' src='".XOOPS_URL."/images/image.gif' alt='image' />&nbsp;<img src='".XOOPS_URL."/images/code.gif' onmouseover='style.cursor=\"hand\"' alt='code' onclick='javascript:xoopsCodeCode(\"".$this->getName()."\", \"".htmlspecialchars(_ENTERCODE, ENT_QUOTES)."\");' />&nbsp;<img onclick='javascript:xoopsCodeQuote(\"".$this->getName()."\", \"".htmlspecialchars(_ENTERQUOTE, ENT_QUOTES)."\");' onmouseover='style.cursor=\"hand\"' src='".XOOPS_URL."/images/quote.gif' alt='quote' /><br />\n";
+
+        $sizearray = array("xx-small", "x-small", "small", "medium", "large", "x-large", "xx-large");
+        $ret .= "<select id='".$this->getName()."Size' onchange='setVisible(\"".$this->_hiddenText."\");setElementSize(\"".$this->_hiddenText."\",this.options[this.selectedIndex].value);'>\n";
+        $ret .= "<option value='SIZE'>"._SIZE."</option>\n";
+        foreach ( $sizearray as $size ) {
+            $ret .=  "<option value='$size'>$size</option>\n";
+        }
+        $ret .= "</select>\n";
+        $fontarray = array("Arial", "Courier", "Georgia", "Helvetica", "Impact", "Verdana");
+        $ret .= "<select id='".$this->getName()."Font' onchange='setVisible(\"".$this->_hiddenText."\");setElementFont(\"".$this->_hiddenText."\",this.options[this.selectedIndex].value);'>\n";
+        $ret .= "<option value='FONT'>"._FONT."</option>\n";
+        foreach ( $fontarray as $font ) {
+            $ret .= "<option value='$font'>$font</option>\n";
+        }
+        $ret .= "</select>\n";
+        $colorarray = array("00", "33", "66", "99", "CC", "FF");
+        $ret .= "<select id='".$this->getName()."Color' onchange='setVisible(\"".$this->_hiddenText."\");setElementColor(\"".$this->_hiddenText."\",this.options[this.selectedIndex].value);'>\n";
+        $ret .= "<option value='COLOR'>"._COLOR."</option>\n";
+        foreach ( $colorarray as $color1 ) {
+            foreach ( $colorarray as $color2 ) {
+                foreach ( $colorarray as $color3 ) {
+                    $ret .= "<option value='".$color1.$color2.$color3."' style='background-color:#".$color1.$color2.$color3.";color:#".$color1.$color2.$color3.";'>#".$color1.$color2.$color3."</option>\n";
+                }
+            }
+        }
+        $ret .= "</select><span id='".$this->_hiddenText."'>"._EXAMPLE."</span>\n";
+        $ret .= "<br />\n";
+        $ret .= "<img onclick='javascript:setVisible(\"".$this->_hiddenText."\");makeBold(\"".$this->_hiddenText."\");' onmouseover='style.cursor=\"hand\"' src='".XOOPS_URL."/images/bold.gif' alt='bold' />&nbsp;<img onclick='javascript:setVisible(\"".$this->_hiddenText."\");makeItalic(\"".$this->_hiddenText."\");' onmouseover='style.cursor=\"hand\"' src='".XOOPS_URL."/images/italic.gif' alt='italic' />&nbsp;<img onclick='javascript:setVisible(\"".$this->_hiddenText."\");makeUnderline(\"".$this->_hiddenText."\");' onmouseover='style.cursor=\"hand\"' src='".XOOPS_URL."/images/underline.gif' alt='underline' />&nbsp;<img onclick='javascript:setVisible(\"".$this->_hiddenText."\");makeLineThrough(\"".$this->_hiddenText."\");' src='".XOOPS_URL."/images/linethrough.gif' alt='linethrough' onmouseover='style.cursor=\"hand\"' />&nbsp;&nbsp;<input type='text' id='".$this->getName()."Addtext' size='20' />&nbsp;<input type='button' onclick='xoopsCodeText(\"".$this->getName()."\", \"".$this->_hiddenText."\", \"".htmlspecialchars(_ENTERTEXTBOX, ENT_QUOTES)."\")' class='formButton' value='"._ADD."' /><br /><br /><textarea id='".$this->getName()."' name='".$this->getName()."' onselect=\"xoopsSavePosition('".$this->getName()."');\" onclick=\"xoopsSavePosition('".$this->getName()."');\" onkeyup=\"xoopsSavePosition('".$this->getName()."');\" cols='".$this->getCols()."' rows='".$this->getRows()."'".$this->getExtra().">".$this->getValue()."</textarea><br />\n";
+        $ret .= $this->_renderSmileys();
+        return $ret;
+    }
+
+    /**
+     * prepare HTML for output of the smiley list.
+     *
+     * @return  string HTML
+     */
+    function _renderSmileys()
+    {
+        $myts =& MyTextSanitizer::getInstance();
+        $smiles = $myts->getSmileys();
+        $ret = '';
+        if (empty($smiles)) {
+            $db =& Database::getInstance();
+            if ($result = $db->query('SELECT * FROM '.$db->prefix('smiles').' WHERE display=1')) {
+                while ($smiles = $db->fetchArray($result)) {
+                    $ret .= "<img onclick='xoopsCodeSmilie(\"".$this->getName()."\", \" ".$smiles['code']." \");' onmouseover='style.cursor=\"hand\"' src='".XOOPS_UPLOAD_URL."/".htmlspecialchars($smiles['smile_url'], ENT_QUOTES)."' alt='' />";
+                }
+            }
+        } else {
+            $count = count($smiles);
+            for ($i = 0; $i < $count; $i++) {
+                if ($smiles[$i]['display'] == 1) {
+                    $ret .= "<img onclick='xoopsCodeSmilie(\"".$this->getName()."\", \" ".$smiles[$i]['code']." \");' onmouseover='style.cursor=\"hand\"' src='".XOOPS_UPLOAD_URL."/".$myts->oopsHtmlSpecialChars($smiles[$i]['smile_url'])."' border='0' alt='' />";
+                }
+            }
+        }
+        $ret .= "&nbsp;[<a href='#moresmiley' onclick='javascript:openWithSelfMain(\"".XOOPS_URL."/misc.php?action=showpopups&amp;type=smilies&amp;target=".$this->getName()."\",\"smilies\",300,475);'>"._MORE."</a>]";
+        return $ret;
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/xoopsform/formbutton.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xoopsform/formbutton.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xoopsform/formbutton.php	(revision 405)
@@ -0,0 +1,117 @@
+<?php
+// $Id: formbutton.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+/**
+ *
+ *
+ * @package     kernel
+ * @subpackage  form
+ *
+ * @author	    Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ */
+/**
+ * A button
+ *
+ * @author	Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ *
+ * @package     kernel
+ * @subpackage  form
+ */
+class XoopsFormButton extends XoopsFormElement {
+
+	/**
+     * Value
+	 * @var	string
+	 * @access	private
+	 */
+	var $_value;
+
+	/**
+     * Type of the button. This could be either "button", "submit", or "reset"
+	 * @var	string
+	 * @access	private
+	 */
+	var $_type;
+
+	/**
+	 * Constructor
+     *
+	 * @param	string  $caption    Caption
+     * @param	string  $name
+     * @param	string  $value
+     * @param	string  $type       Type of the button.
+     * This could be either "button", "submit", or "reset"
+	 */
+	function XoopsFormButton($caption, $name, $value="", $type="button"){
+		$this->setCaption($caption);
+		$this->setName($name);
+		$this->_type = $type;
+		$this->setValue($value);
+	}
+
+	/**
+	 * Get the initial value
+	 *
+     * @return	string
+	 */
+	function getValue(){
+		return $this->_value;
+	}
+
+	/**
+	 * Set the initial value
+	 *
+     * @return	string
+	 */
+	function setValue($value){
+		$this->_value = $value;
+	}
+
+	/**
+	 * Get the type
+	 *
+     * @return	string
+	 */
+	function getType(){
+		return $this->_type;
+	}
+
+	/**
+	 * prepare HTML for output
+	 *
+     * @return	string
+	 */
+	function render(){
+		return "<input type='".$this->getType()."' class='formButton' name='".$this->getName()."'  id='".$this->getName()."' value='".$this->getValue()."'".$this->getExtra()." />";
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/xoopsform/formtextarea.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xoopsform/formtextarea.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xoopsform/formtextarea.php	(revision 405)
@@ -0,0 +1,133 @@
+<?php
+// $Id: formtextarea.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+/**
+ * 
+ * 
+ * @package     kernel
+ * @subpackage  form
+ * 
+ * @author	    Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ */
+/**
+ * A textarea
+ * 
+ * @author	Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ * 
+ * @package     kernel
+ * @subpackage  form
+ */
+class XoopsFormTextArea extends XoopsFormElement {
+	/**
+     * number of columns
+	 * @var	int 
+	 * @access  private
+	 */
+	var $_cols;
+
+	/**
+	 * number of rows
+     * @var	int 
+	 * @access  private
+	 */
+	var $_rows;
+
+	/**
+     * initial content
+	 * @var	string  
+	 * @access  private
+	 */
+	var $_value;
+
+	/**
+	 * Constuctor
+	 * 
+     * @param	string  $caption    caption
+     * @param	string  $name       name
+     * @param	string  $value      initial content
+     * @param	int     $rows       number of rows
+     * @param	int     $cols       number of columns   
+	 */
+	function XoopsFormTextArea($caption, $name, $value="", $rows=5, $cols=50){
+		$this->setCaption($caption);
+		$this->setName($name);
+		$this->_rows = intval($rows);
+		$this->_cols = intval($cols);
+		$this->setValue($value);
+	}
+
+	/**
+	 * get number of rows
+	 * 
+     * @return	int
+	 */
+	function getRows(){
+		return $this->_rows;
+	}
+
+	/**
+	 * Get number of columns
+	 * 
+     * @return	int
+	 */
+	function getCols(){
+		return $this->_cols;
+	}
+
+	/**
+	 * Get initial content
+	 * 
+     * @return	string
+	 */
+	function getValue(){
+		return $this->_value;
+	}
+
+	/**
+	 * Set initial content
+	 * 
+     * @param	$value	string
+	 */
+	function setValue($value){
+		$this->_value = $value;
+	}
+
+	/**
+	 * prepare HTML for output
+	 * 
+     * @return	sting HTML
+	 */
+	function render(){
+		return "<textarea name='".$this->getName()."' id='".$this->getName()."' rows='".$this->getRows()."' cols='".$this->getCols()."'".$this->getExtra().">".$this->getValue()."</textarea>";
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/xoopsform/formselectuser.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xoopsform/formselectuser.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xoopsform/formselectuser.php	(revision 405)
@@ -0,0 +1,78 @@
+<?php
+// $Id: formselectuser.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+/**
+ * @package     kernel
+ * @subpackage  form
+ * 
+ * @author	    Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ */
+
+/**
+ * Parent
+ */
+include_once XOOPS_ROOT_PATH."/class/xoopsform/formselect.php";
+
+// RMV-NOTIFY
+
+/**
+ * A select field with a choice of available users
+ * 
+ * @package     kernel
+ * @subpackage  form
+ * 
+ * @author	    Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ */
+class XoopsFormSelectUser extends XoopsFormSelect
+{
+	/**
+	 * Constructor
+	 * 
+	 * @param	string	$caption	
+	 * @param	string	$name
+	 * @param	bool	$include_anon	Include user "anonymous"?
+	 * @param	mixed	$value	    	Pre-selected value (or array of them).
+	 * @param	int		$size	        Number or rows. "1" makes a drop-down-list.
+     * @param	bool    $multiple       Allow multiple selections?
+	 */
+	function XoopsFormSelectUser($caption, $name, $include_anon=false, $value=null, $size=1, $multiple=false)
+	{
+	    $this->XoopsFormSelect($caption, $name, $value, $size, $multiple);
+		$member_handler =& xoops_gethandler('member');
+		if ($include_anon) {
+			global $xoopsConfig;
+			$this->addOption(0, $xoopsConfig['anonymous']);
+		}
+		$this->addOptionArray($member_handler->getUserList());
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/xoopsform/form.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xoopsform/form.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xoopsform/form.php	(revision 405)
@@ -0,0 +1,428 @@
+<?php
+// $Id: form.php,v 1.5 2006/05/01 02:37:26 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+// public abstruct
+/**
+ *
+ *
+ * @package     kernel
+ * @subpackage  form
+ *
+ * @author      Kazumi Ono  <onokazu@xoops.org>
+ * @copyright   copyright (c) 2000-2003 XOOPS.org
+ */
+
+
+/**
+ * Abstract base class for forms
+ *
+ * @author  Kazumi Ono  <onokazu@xoops.org>
+ * @copyright   copyright (c) 2000-2003 XOOPS.org
+ *
+ * @package     kernel
+ * @subpackage  form
+ */
+class XoopsForm {
+    /**#@+
+     * @access  private
+     */
+    /**
+     * "action" attribute for the html form
+     * @var string
+     */
+    var $_action;
+
+    /**
+     * "method" attribute for the form.
+     * @var string
+     */
+    var $_method;
+
+    /**
+     * "name" attribute of the form
+     * @var string
+     */
+    var $_name;
+
+    /**
+     * title for the form
+     * @var string
+     */
+    var $_title;
+
+    /**
+     * array of {@link XoopsFormElement} objects
+     * @var  array
+     */
+    var $_elements = array();
+
+    /**
+     * extra information for the <form> tag
+     * @var string
+     */
+    var $_extra;
+
+    /**
+     * required elements
+     * @var array
+     */
+    var $_required = array();
+
+    /**#@-*/
+
+    /**
+     * constructor
+     *
+     * @param   string  $title  title of the form
+     * @param   string  $name   "name" attribute for the <form> tag
+     * @param   string  $action "action" attribute for the <form> tag
+     * @param   string  $method "method" attribute for the <form> tag
+     * @param   bool    $addtoken whether to add a security token to the form
+     */
+    function XoopsForm($title, $name, $action, $method="post", $addtoken = false){
+        $this->_title = $title;
+        $this->_name = $name;
+        $this->_action = $action;
+        $this->_method = $method;
+        if ($addtoken != false) {
+            $this->addElement(new XoopsFormHiddenToken());
+        }
+    }
+
+    /**
+     * return the title of the form
+     *
+     * @return  string
+     */
+    function getTitle(){
+        return $this->_title;
+    }
+
+    /**
+     * get the "name" attribute for the <form> tag
+     *
+     * @return  string
+     */
+    function getName(){
+        return $this->_name;
+    }
+
+    /**
+     * get the "action" attribute for the <form> tag
+     *
+     * @return  string
+     */
+    function getAction(){
+        return $this->_action;
+    }
+
+    /**
+     * get the "method" attribute for the <form> tag
+     *
+     * @return  string
+     */
+    function getMethod(){
+        return $this->_method;
+    }
+
+    /**
+     * Add an element to the form
+     *
+     * @param   object  &$formElement    reference to a {@link XoopsFormElement}
+     * @param   bool    $required       is this a "required" element?
+     */
+    function addElement(&$formElement, $required=false){
+        if ( is_string( $formElement ) ) {
+            $this->_elements[] = $formElement;
+        } elseif ( is_subclass_of($formElement, 'xoopsformelement') ) {
+            $this->_elements[] =& $formElement;
+            if ($required) {
+                if (!$formElement->isContainer()) {
+                    $this->_required[] =& $formElement;
+                } else {
+                    $required_elements =& $formElement->getRequired();
+                    $count = count($required_elements);
+                    for ($i = 0 ; $i < $count; $i++) {
+                        $this->_required[] =& $required_elements[$i];
+                    }
+                }
+            }
+        }
+    }
+
+    /**
+     * get an array of forms elements
+     *
+     * @param   bool    get elements recursively?
+     * @return  array   array of {@link XoopsFormElement}s
+     */
+    function &getElements($recurse = false){
+        if (!$recurse) {
+            return $this->_elements;
+        } else {
+            $ret = array();
+            $count = count($this->_elements);
+            for ($i = 0; $i < $count; $i++) {
+                if (!$this->_elements[$i]->isContainer()) {
+                    $ret[] =& $this->_elements[$i];
+                } else {
+                    $elements =& $this->_elements[$i]->getElements(true);
+                    $count2 = count($elements);
+                    for ($j = 0; $j < $count2; $j++) {
+                        $ret[] =& $elements[$j];
+                    }
+                    unset($elements);
+                }
+            }
+            return $ret;
+        }
+    }
+
+    /**
+     * get an array of "name" attributes of form elements
+     *
+     * @return  array   array of form element names
+     */
+    function getElementNames()
+    {
+        $ret = array();
+        $elements =& $this->getElements(true);
+        $count = count($elements);
+        for ($i = 0; $i < $count; $i++) {
+            $ret[] = $elements[$i]->getName();
+        }
+        return $ret;
+    }
+
+    /**
+     * get a reference to a {@link XoopsFormElement} object by its "name"
+     *
+     * @param  string  $name    "name" attribute assigned to a {@link XoopsFormElement}
+     * @return object  reference to a {@link XoopsFormElement}, false if not found
+     */
+    function &getElementByName($name){
+        $elements =& $this->getElements(true);
+        $count = count($elements);
+        for ($i = 0; $i < $count; $i++) {
+            if ($name == $elements[$i]->getName()) {
+                return $elements[$i];
+            }
+        }
+        return false;
+    }
+
+    /**
+     * Sets the "value" attribute of a form element
+     *
+     * @param   string $name    the "name" attribute of a form element
+     * @param   string $value   the "value" attribute of a form element
+     */
+    function setElementValue($name, $value){
+        $ele =& $this->getElementByName($name);
+        if (is_object($ele) && method_exists($ele, 'setValue')) {
+            $ele->setValue($value);
+        }
+    }
+
+    /**
+     * Sets the "value" attribute of form elements in a batch
+     *
+     * @param   array $values   array of name/value pairs to be assigned to form elements
+     */
+    function setElementValues($values){
+        if (is_array($values) && !empty($values)) {
+            // will not use getElementByName() for performance..
+            $elements =& $this->getElements(true);
+            $count = count($elements);
+            for ($i = 0; $i < $count; $i++) {
+                $name = $elements[$i]->getName();
+                if ($name && isset($values[$name]) && method_exists($elements[$i], 'setValue')) {
+                    $elements[$i]->setValue($values[$name]);
+                }
+            }
+        }
+    }
+
+    /**
+     * Gets the "value" attribute of a form element
+     *
+     * @param   string  $name   the "name" attribute of a form element
+     * @return  string  the "value" attribute assigned to a form element, null if not set
+     */
+    function &getElementValue($name){
+        $ele =& $this->getElementByName($name);
+        if (is_object($ele) && method_exists($ele, 'getValue')) {
+            return $ele->getValue($value);
+        }
+        return;
+    }
+
+    /**
+     * gets the "value" attribute of all form elements
+     *
+     * @return  array   array of name/value pairs assigned to form elements
+     */
+    function &getElementValues(){
+        // will not use getElementByName() for performance..
+        $elements =& $this->getElements(true);
+        $count = count($elements);
+        $values = array();
+        for ($i = 0; $i < $count; $i++) {
+            $name = $elements[$i]->getName();
+            if ($name && method_exists($elements[$i], 'getValue')) {
+                $values[$name] =& $elements[$i]->getValue();
+            }
+        }
+        return $values;
+    }
+
+    /**
+     * set the extra attributes for the <form> tag
+     *
+     * @param   string  $extra  extra attributes for the <form> tag
+     */
+    function setExtra($extra){
+        $this->_extra = " ".$extra;
+    }
+
+    /**
+     * get the extra attributes for the <form> tag
+     *
+     * @return  string
+     */
+    function &getExtra(){
+        $ret = null;
+        if (isset($this->_extra)) {
+            $ret = $this->_extra;
+        }
+        return $ret;
+    }
+
+    /**
+     * make an element "required"
+     *
+     * @param   object  &$formElement    reference to a {@link XoopsFormElement}
+     */
+    function setRequired(&$formElement){
+        $this->_required[] =& $formElement;
+    }
+
+    /**
+     * get an array of "required" form elements
+     *
+     * @return  array   array of {@link XoopsFormElement}s
+     */
+    function &getRequired(){
+        return $this->_required;
+    }
+
+    /**
+     * insert a break in the form
+     *
+     * This method is abstract. It must be overwritten in the child classes.
+     *
+     * @param   string  $extra  extra information for the break
+     * @abstract
+     */
+    function insertBreak($extra = null){
+    }
+
+    /**
+     * returns renderered form
+     *
+     * This method is abstract. It must be overwritten in the child classes.
+     *
+     * @abstract
+     */
+    function render(){
+    }
+
+    /**
+     * displays rendered form
+     */
+    function display(){
+        echo $this->render();
+    }
+
+    /**
+     * Renders the Javascript function needed for client-side for validation
+     *
+     * @param       boolean  $withtags  Include the < javascript > tags in the returned string
+     */
+    function renderValidationJS( $withtags = true ) {
+        $js = "";
+        if ( $withtags ) {
+            $js .= "\n<!-- Start Form Vaidation JavaScript //-->\n<script type='text/javascript'>\n<!--//\n";
+        }
+        $myts =& MyTextSanitizer::getInstance();
+        $formname = $this->getName();
+        $required =& $this->getRequired();
+        $reqcount = count($required);
+        $js .= "function xoopsFormValidate_{$formname}() {
+    myform = window.document.$formname;\n";
+        for ($i = 0; $i < $reqcount; $i++) {
+            $eltname    = $required[$i]->getName();
+            $eltcaption = trim( $required[$i]->getCaption() );
+            $eltmsg = empty($eltcaption) ? sprintf( _FORM_ENTER, $eltname ) : sprintf( _FORM_ENTER, $eltcaption );
+            $eltmsg = str_replace('"', '\"', stripslashes($eltmsg));
+            $js .= "if ( myform.{$eltname}.value == \"\" ) "
+                . "{ window.alert(\"{$eltmsg}\"); myform.{$eltname}.focus(); return false; }\n";
+        }
+        $js .= "return true;\n}\n";
+        if ( $withtags ) {
+            $js .= "//--></script>\n<!-- End Form Vaidation JavaScript //-->\n";
+        }
+        return $js;
+    }
+    /**
+     * assign to smarty form template instead of displaying directly
+     *
+     * @param   object  &$tpl    reference to a {@link Smarty} object
+     * @see     Smarty
+     */
+    function assign(&$tpl){
+        $i = 0;
+        $elements = array();
+        foreach ( $this->getElements() as $ele ) {
+            $n = ($ele->getName() != "") ? $ele->getName() : $i;
+            $elements[$n]['name']     = $ele->getName();
+            $elements[$n]['caption']  = $ele->getCaption();
+            $elements[$n]['body']     = $ele->render();
+            $elements[$n]['hidden']   = $ele->isHidden();
+            if ($ele->getDescription() != '') {
+                $elements[$n]['description']  = $ele->getDescription();
+            }
+            $i++;
+        }
+        $js = $this->renderValidationJS();
+        $tpl->assign($this->getName(), array('title' => $this->getTitle(), 'name' => $this->getName(), 'action' => $this->getAction(),  'method' => $this->getMethod(), 'extra' => 'onsubmit="return xoopsFormValidate_'.$this->getName().'();"'.$this->getExtra(), 'javascript' => $js, 'elements' => $elements));
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/xoopsform/formfile.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xoopsform/formfile.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xoopsform/formfile.php	(revision 405)
@@ -0,0 +1,89 @@
+<?php
+// $Id: formfile.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+/**
+ * 
+ * 
+ * @package     kernel
+ * @subpackage  form
+ * 
+ * @author	    Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ */
+/**
+ * A file upload field
+ * 
+ * @author	Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ * 
+ * @package		kernel
+ * @subpackage	form
+ */
+class XoopsFormFile extends XoopsFormElement {
+
+	/**
+     * Maximum size for an uploaded file
+	 * @var	int	
+	 * @access	private
+	 */
+	var $_maxFileSize;
+
+	/**
+	 * Constructor
+	 * 
+	 * @param	string	$caption		Caption
+	 * @param	string	$name			"name" attribute
+	 * @param	int		$maxfilesize	Maximum size for an uploaded file
+	 */
+	function XoopsFormFile($caption, $name, $maxfilesize){
+		$this->setCaption($caption);
+		$this->setName($name);
+		$this->_maxFileSize = intval($maxfilesize);
+	}
+
+	/**
+	 * Get the maximum filesize
+	 * 
+	 * @return	int
+	 */
+	function getMaxFileSize(){
+		return $this->_maxFileSize;
+	}
+
+	/**
+	 * prepare HTML for output
+	 * 
+	 * @return	string	HTML
+	 */
+	function render(){
+		return "<input type='hidden' name='MAX_FILE_SIZE' value='".$this->getMaxFileSize()."' /><input type='file' name='".$this->getName()."' id='".$this->getName()."'".$this->getExtra()." /><input type='hidden' name='xoops_upload_file[]' id='xoops_upload_file[]' value='".$this->getName()."' />";
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/xoopsform/formlabel.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xoopsform/formlabel.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xoopsform/formlabel.php	(revision 405)
@@ -0,0 +1,85 @@
+<?php
+// $Id: formlabel.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+/**
+ * @package     kernel
+ * @subpackage  form
+ * 
+ * @author	    Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ */
+/**
+ * A text label
+ * 
+ * @package     kernel
+ * @subpackage  form
+ * 
+ * @author	    Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ */
+class XoopsFormLabel extends XoopsFormElement {
+
+	/**
+     * Text
+	 * @var	string	
+	 * @access	private
+	 */
+	var $_value;
+
+	/**
+	 * Constructor
+	 * 
+	 * @param	string	$caption	Caption
+	 * @param	string	$value		Text
+	 */
+	function XoopsFormLabel($caption="", $value=""){
+		$this->setCaption($caption);
+		$this->_value = $value;
+	}
+
+	/**
+	 * Get the text
+	 * 
+	 * @return	string
+	 */
+	function getValue(){
+		return $this->_value;
+	}
+
+	/**
+	 * Prepare HTML for output
+	 * 
+	 * @return	string
+	 */
+	function render(){
+		return $this->getValue();
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/xoopsform/formselect.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xoopsform/formselect.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xoopsform/formselect.php	(revision 405)
@@ -0,0 +1,198 @@
+<?php
+// $Id: formselect.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+/**
+ * @package     kernel
+ * @subpackage  form
+ * 
+ * @author	    Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ */
+
+/**
+ * A select field
+ * 
+ * @package     kernel
+ * @subpackage  form
+ * 
+ * @author	    Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ */
+class XoopsFormSelect extends XoopsFormElement {
+
+	/**
+     * Options
+	 * @var array   
+	 * @access	private
+	 */
+	var $_options = array();
+
+	/**
+     * Allow multiple selections?
+	 * @var	bool    
+	 * @access	private
+	 */
+	var $_multiple = false;
+
+	/**
+     * Number of rows. "1" makes a dropdown list.
+	 * @var	int 
+	 * @access	private
+	 */
+	var $_size;
+
+	/**
+     * Pre-selcted values
+	 * @var	array   
+	 * @access	private
+	 */
+	var $_value = array();
+
+	/**
+	 * Constructor
+	 * 
+	 * @param	string	$caption	Caption
+	 * @param	string	$name       "name" attribute
+	 * @param	mixed	$value	    Pre-selected value (or array of them).
+	 * @param	int		$size	    Number or rows. "1" makes a drop-down-list
+     * @param	bool    $multiple   Allow multiple selections?
+	 */
+	function XoopsFormSelect($caption, $name, $value=null, $size=1, $multiple=false){
+		$this->setCaption($caption);
+		$this->setName($name);
+		$this->_multiple = $multiple;
+		$this->_size = intval($size);
+		if (isset($value)) {
+			$this->setValue($value);
+		}
+	}
+
+	/**
+	 * Are multiple selections allowed?
+	 * 
+     * @return	bool
+	 */
+	function isMultiple(){
+		return $this->_multiple;
+	}
+
+	/**
+	 * Get the size
+	 * 
+     * @return	int
+	 */
+	function getSize(){
+		return $this->_size;
+	}
+
+	/**
+	 * Get an array of pre-selected values
+	 * 
+     * @return	array
+	 */
+	function getValue(){
+		return $this->_value;
+	}
+
+	/**
+	 * Set pre-selected values
+	 * 
+     * @param	$value	mixed
+	 */
+	function setValue($value){
+		if (is_array($value)) {
+			foreach ($value as $v) {
+				$this->_value[] = $v;
+			}
+		} else {
+			$this->_value[] = $value;
+		}
+	}
+
+	/**
+	 * Add an option
+     * 
+	 * @param	string  $value  "value" attribute
+     * @param	string  $name   "name" attribute
+	 */
+	function addOption($value, $name=""){
+		if ( $name != "" ) {
+			$this->_options[$value] = $name;
+		} else {
+			$this->_options[$value] = $value;
+		}
+	}
+
+	/**
+	 * Add multiple options
+	 * 
+     * @param	array   $options    Associative array of value->name pairs
+	 */
+	function addOptionArray($options){
+		if ( is_array($options) ) {
+			foreach ( $options as $k=>$v ) {
+				$this->addOption($k, $v);
+			}
+		}
+	}
+
+	/**
+	 * Get all options
+	 * 
+     * @return	array   Associative array of value->name pairs
+	 */
+	function getOptions(){
+		return $this->_options;
+	}
+
+	/**
+	 * Prepare HTML for output
+	 * 
+     * @return	string  HTML
+	 */
+	function render(){
+		$ret = "<select  size='".$this->getSize()."'".$this->getExtra()."";
+		if ($this->isMultiple() != false) {
+			$ret .= " name='".$this->getName()."[]' id='".$this->getName()."[]' multiple='multiple'>\n";
+		} else {
+			$ret .= " name='".$this->getName()."' id='".$this->getName()."'>\n";
+		}
+		foreach ( $this->getOptions() as $value => $name ) {
+			$ret .= "<option value='".htmlspecialchars($value, ENT_QUOTES)."'";
+			if (count($this->getValue()) > 0 && in_array($value, $this->getValue())) {
+					$ret .= " selected='selected'";
+			}
+			$ret .= ">".$name."</option>\n";
+		}
+		$ret .= "</select>";
+		return $ret;
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/xoopsform/grouppermform.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xoopsform/grouppermform.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xoopsform/grouppermform.php	(revision 405)
@@ -0,0 +1,319 @@
+<?php 
+// $Id: grouppermform.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+// ------------------------------------------------------------------------ //
+// XOOPS - PHP Content Management System                      //
+// Copyright (c) 2000-2003 XOOPS.org                           //
+// <http://www.xoops.org/>                             //
+// ------------------------------------------------------------------------ //
+// 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.                                      //
+// //
+// You may not change or alter any portion of this comment or credits       //
+// of supporting developers from this source code or any supporting         //
+// source code which is considered copyrighted (c) material of the          //
+// original comment or credit authors.                                      //
+// //
+// 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 //
+// ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+require_once XOOPS_ROOT_PATH . '/class/xoopsform/formelement.php';
+require_once XOOPS_ROOT_PATH . '/class/xoopsform/formhidden.php';
+require_once XOOPS_ROOT_PATH . '/class/xoopsform/formbutton.php';
+require_once XOOPS_ROOT_PATH . '/class/xoopsform/formelementtray.php';
+require_once XOOPS_ROOT_PATH . '/class/xoopsform/form.php';
+
+/**
+ * Renders a form for setting module specific group permissions
+ * 
+ * @author Kazumi Ono <onokazu@myweb.ne.jp> 
+ * @copyright copyright (c) 2000-2003 XOOPS.org
+ * @package kernel
+ * @subpackage form
+ */
+class XoopsGroupPermForm extends XoopsForm
+{
+    /**
+     * Module ID
+     * 
+     * @var int 
+     */
+    var $_modid;
+    /**
+     * Tree structure of items
+     * 
+     * @var array 
+     */
+    var $_itemTree;
+    /**
+     * Name of permission
+     * 
+     * @var string 
+     */
+    var $_permName;
+    /**
+     * Description of permission
+     * 
+     * @var string 
+     */
+    var $_permDesc;
+
+    /**
+     * Constructor
+     */
+    function XoopsGroupPermForm($title, $modid, $permname, $permdesc, $url = "")
+    {
+        $this->XoopsForm($title, 'groupperm_form', XOOPS_URL . '/modules/system/admin/groupperm.php', 'post');
+        $this->_modid = intval($modid);
+        $this->_permName = $permname;
+        $this->_permDesc = $permdesc;
+        $this->addElement(new XoopsFormHidden('modid', $this->_modid));
+        if ($url != "") {
+            $this->addElement(new XoopsFormHidden('redirect_url', $url));
+        }
+    } 
+
+    /**
+     * Adds an item to which permission will be assigned
+     * 
+     * @param string $itemName 
+     * @param int $itemId 
+     * @param int $itemParent 
+     * @access public 
+     */
+    function addItem($itemId, $itemName, $itemParent = 0)
+    {
+        $this->_itemTree[$itemParent]['children'][] = $itemId;
+        $this->_itemTree[$itemId]['parent'] = $itemParent;
+        $this->_itemTree[$itemId]['name'] = $itemName;
+        $this->_itemTree[$itemId]['id'] = $itemId;
+    } 
+
+    /**
+     * Loads all child ids for an item to be used in javascript
+     * 
+     * @param int $itemId 
+     * @param array $childIds 
+     * @access private 
+     */
+    function _loadAllChildItemIds($itemId, &$childIds)
+    {
+        if (!empty($this->_itemTree[$itemId]['children'])) {
+            $first_child = $this->_itemTree[$itemId]['children'];
+            foreach ($first_child as $fcid) {
+                array_push($childIds, $fcid);
+                if (!empty($this->_itemTree[$fcid]['children'])) {
+                    foreach ($this->_itemTree[$fcid]['children'] as $_fcid) {
+                        array_push($childIds, $_fcid);
+                        $this->_loadAllChildItemIds($_fcid, $childIds);
+                    }
+                }
+            }
+        }
+    }
+
+    /**
+     * Renders the form
+     * 
+     * @return string
+     * @access public
+     */
+    function render()
+    { 
+        // load all child ids for javascript codes
+        foreach (array_keys($this->_itemTree)as $item_id) {
+            $this->_itemTree[$item_id]['allchild'] = array();
+            $this->_loadAllChildItemIds($item_id, $this->_itemTree[$item_id]['allchild']);
+        }
+        $gperm_handler =& xoops_gethandler('groupperm');
+        $member_handler =& xoops_gethandler('member');
+        $glist =& $member_handler->getGroupList();
+        foreach (array_keys($glist) as $i) {
+            // get selected item id(s) for each group
+            $selected = $gperm_handler->getItemIds($this->_permName, $i, $this->_modid);
+            $ele = new XoopsGroupFormCheckBox($glist[$i], 'perms[' . $this->_permName . ']', $i, $selected);
+            $ele->setOptionTree($this->_itemTree);
+            $this->addElement($ele);
+            unset($ele);
+        } 
+        $tray = new XoopsFormElementTray('');
+        $tray->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
+        $tray->addElement(new XoopsFormButton('', 'reset', _CANCEL, 'reset'));
+        $this->addElement($tray);
+        $ret = '<h4>' . $this->getTitle() . '</h4>' . $this->_permDesc . '<br />';
+        $ret .= "<form name='" . $this->getName() . "' id='" . $this->getName() . "' action='" . $this->getAction() . "' method='" . $this->getMethod() . "'" . $this->getExtra() . ">\n<table width='100%' class='outer' cellspacing='1'>\n";
+        $elements =& $this->getElements();
+        foreach (array_keys($elements) as $i) {
+            if (!is_object($elements[$i])) {
+                $ret .= $elements[$i];
+            } elseif (!$elements[$i]->isHidden()) {
+                $ret .= "<tr valign='top' align='left'><td class='head'>" . $elements[$i]->getCaption();
+                if ($elements[$i]->getDescription() != '') {
+                    $ret .= '<br /><br /><span style="font-weight: normal;">' . $elements[$i]->getDescription() . '</span>';
+                }
+                $ret .= "</td>\n<td class='even'>\n" . $elements[$i]->render() . "\n</td></tr>\n";
+            } else {
+                $ret .= $elements[$i]->render();
+            }
+        }
+        $ret .= '</table></form>';
+        return $ret;
+    }
+}
+
+/**
+ * Renders checkbox options for a group permission form
+ * 
+ * @author Kazumi Ono <onokazu@myweb.ne.jp> 
+ * @copyright copyright (c) 2000-2003 XOOPS.org
+ * @package kernel
+ * @subpackage form
+ */
+class XoopsGroupFormCheckBox extends XoopsFormElement
+{
+    /**
+     * Pre-selected value(s)
+     * 
+     * @var array;
+     */
+    var $_value = array();
+    /**
+     * Group ID
+     * 
+     * @var int 
+     */
+    var $_groupId;
+    /**
+     * Option tree
+     * 
+     * @var array 
+     */
+    var $_optionTree;
+
+    /**
+     * Constructor
+     */
+    function XoopsGroupFormCheckBox($caption, $name, $groupId, $values = null)
+    {
+        $this->setCaption($caption);
+        $this->setName($name);
+        if (isset($values)) {
+            $this->setValue($values);
+        }
+        $this->_groupId = $groupId;
+    }
+
+    /**
+     * Sets pre-selected values
+     * 
+     * @param mixed $value A group ID or an array of group IDs
+     * @access public 
+     */
+    function setValue($value)
+    {
+        if (is_array($value)) {
+            foreach ($value as $v) {
+                $this->setValue($v);
+            }
+        } else {
+            $this->_value[] = $value;
+        }
+    }
+
+    /**
+     * Sets the tree structure of items
+     * 
+     * @param array $optionTree 
+     * @access public 
+     */
+    function setOptionTree(&$optionTree)
+    {
+        $this->_optionTree =& $optionTree;
+    }
+
+    /**
+     * Renders checkbox options for this group
+     * 
+     * @return string 
+     * @access public 
+     */
+    function render()
+    {
+		$ret = '<table class="outer"><tr><td class="odd"><table><tr>';
+		$cols = 1;
+		foreach ($this->_optionTree[0]['children'] as $topitem) {
+			if ($cols > 4) {
+				$ret .= '</tr><tr>';
+				$cols = 1;
+			}
+			$tree = '<td>';
+			$prefix = '';
+			$this->_renderOptionTree($tree, $this->_optionTree[$topitem], $prefix);
+			$ret .= $tree.'</td>';
+			$cols++;
+		}
+		$ret .= '</tr></table></td><td class="even">';
+		foreach (array_keys($this->_optionTree) as $id) {
+			if (!empty($id)) {
+				$option_ids[] = "'".$this->getName().'[groups]['.$this->_groupId.']['.$id.']'."'";
+			}
+		}
+		$checkallbtn_id = $this->getName().'[checkallbtn]['.$this->_groupId.']';
+		$option_ids_str = implode(', ', $option_ids);
+		$ret .= _ALL." <input id=\"".$checkallbtn_id."\" type=\"checkbox\" value=\"\" onclick=\"var optionids = new Array(".$option_ids_str."); xoopsCheckAllElements(optionids, '".$checkallbtn_id."');\" />";
+		$ret .= '</td></tr></table>';
+		return $ret;
+    } 
+
+    /**
+     * Renders checkbox options for an item tree
+     * 
+     * @param string $tree 
+     * @param array $option 
+     * @param string $prefix 
+     * @param array $parentIds 
+     * @access private 
+     */
+    function _renderOptionTree(&$tree, $option, $prefix, $parentIds = array())
+    {
+        $tree .= $prefix . "<input type=\"checkbox\" name=\"" . $this->getName() . "[groups][" . $this->_groupId . "][" . $option['id'] . "]\" id=\"" . $this->getName() . "[groups][" . $this->_groupId . "][" . $option['id'] . "]\" onclick=\""; 
+        // If there are parent elements, add javascript that will
+        // make them selecteded when this element is checked to make
+        // sure permissions to parent items are added as well.
+        foreach ($parentIds as $pid) {
+            $parent_ele = $this->getName() . '[groups][' . $this->_groupId . '][' . $pid . ']';
+            $tree .= "var ele = xoopsGetElementById('" . $parent_ele . "'); if(ele.checked != true) {ele.checked = this.checked;}";
+        } 
+        // If there are child elements, add javascript that will
+        // make them unchecked when this element is unchecked to make
+        // sure permissions to child items are not added when there
+        // is no permission to this item.
+        foreach ($option['allchild'] as $cid) {
+            $child_ele = $this->getName() . '[groups][' . $this->_groupId . '][' . $cid . ']';
+            $tree .= "var ele = xoopsGetElementById('" . $child_ele . "'); if(this.checked != true) {ele.checked = false;}";
+        } 
+        $tree .= '" value="1"';
+        if (in_array($option['id'], $this->_value)) {
+            $tree .= ' checked="checked"';
+        } 
+        $tree .= " />" . $option['name'] . "<input type=\"hidden\" name=\"" . $this->getName() . "[parents][" . $option['id'] . "]\" value=\"" . implode(':', $parentIds). "\" /><input type=\"hidden\" name=\"" . $this->getName() . "[itemname][" . $option['id'] . "]\" value=\"" . htmlspecialchars($option['name']). "\" /><br />\n";
+        if (isset($option['children'])) {
+            foreach ($option['children'] as $child) {
+                array_push($parentIds, $option['id']);
+                $this->_renderOptionTree($tree, $this->_optionTree[$child], $prefix . '&nbsp;-', $parentIds);
+            }
+        }
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/xoopsform/formtoken.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xoopsform/formtoken.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xoopsform/formtoken.php	(revision 405)
@@ -0,0 +1,49 @@
+<?php
+// $Id: formtoken.php,v 1.1.2.2 2005/05/13 10:25:39 minahito Exp $ //  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 // //  ------------------------------------------------------------------------ //
+
+/**
+ * A hidden token field by XoopsToken instance.
+ * This is a trial code.
+ *
+ * @author  minahito<minahito@users.sourceforge.jp>
+ * @copyright   copyright (c) 2000-2005 XOOPS.org
+*/
+class XoopsFormToken extends XoopsFormHidden {
+    /**
+     * Constructor
+     *
+     * @param object    $token  XoopsToken instance
+    */
+    function XoopsFormToken($token)
+    {
+        if(is_object($token)) {
+            parent::XoopsFormHidden($token->getTokenName(), $token->getTokenValue());
+        }
+        else {
+            parent::XoopsFormHidden('','');
+        }
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/xoopsform/formselectlang.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xoopsform/formselectlang.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xoopsform/formselectlang.php	(revision 405)
@@ -0,0 +1,73 @@
+<?php
+// $Id: formselectlang.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+/**
+ * @package     kernel
+ * @subpackage  form
+ * 
+ * @author	    Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ */
+/**
+ * lists of values
+ */
+include_once XOOPS_ROOT_PATH."/class/xoopslists.php";
+/**
+ * parent class
+ */
+include_once XOOPS_ROOT_PATH."/class/xoopsform/formselect.php";
+
+/**
+ * A select field with available languages
+ * 
+ * @package     kernel
+ * @subpackage  form
+ * 
+ * @author	    Kazumi Ono	<onokazu@xoops.org>
+ * @copyright	copyright (c) 2000-2003 XOOPS.org
+ */
+class XoopsFormSelectLang extends XoopsFormSelect
+{
+	/**
+	 * Constructor
+	 * 
+	 * @param	string	$caption
+	 * @param	string	$name
+	 * @param	mixed	$value	Pre-selected value (or array of them).
+	 * 							Legal is any name of a XOOPS_ROOT_PATH."/language/" subdirectory.
+	 * @param	int		$size	Number of rows. "1" makes a drop-down-list.
+	 */
+	function XoopsFormSelectLang($caption, $name, $value=null, $size=1)
+	{
+		$this->XoopsFormSelect($caption, $name, $value, $size);
+		$this->addOptionArray(XoopsLists::getLangList());
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/xoopsuser.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xoopsuser.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xoopsuser.php	(revision 405)
@@ -0,0 +1,8 @@
+<?php
+// $Id: xoopsuser.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+// this file is for backward compatibility only
+if (!defined('XOOPS_ROOT_PATH')) {
+	exit();
+}
+require_once XOOPS_ROOT_PATH.'/kernel/user.php';
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/xoopsstory.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xoopsstory.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xoopsstory.php	(revision 405)
@@ -0,0 +1,434 @@
+<?php
+// $Id: xoopsstory.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+if (!defined('XOOPS_ROOT_PATH')) {
+	exit();
+}
+include_once XOOPS_ROOT_PATH."/class/xoopstopic.php";
+include_once XOOPS_ROOT_PATH."/class/xoopsuser.php";
+
+class XoopsStory
+{
+    var $table;
+	var $storyid;
+	var $topicid;
+	var $uid;
+	var $title;
+	var $hometext;
+	var $bodytext="";
+	var $counter;
+	var $created;
+	var $published;
+	var $expired;
+	var $hostname;
+	var $nohtml=0;
+	var $nosmiley=0;
+	var $ihome=0;
+	var $notifypub=0;
+	var $type;
+	var $approved;
+	var $topicdisplay;
+	var $topicalign;
+	var $db;
+	var $topicstable;
+	var $comments;
+
+	function Story($storyid=-1)
+	{
+		$this->db =& Database::getInstance();
+		$this->table = "";
+		$this->topicstable = "";
+		if ( is_array($storyid) ) {
+			$this->makeStory($storyid);
+		} elseif ( $storyid != -1 ) {
+			$this->getStory(intval($storyid));
+		}
+	}
+
+	function setStoryId($value)
+	{
+		$this->storyid = intval($value);
+	}
+
+	function setTopicId($value)
+	{
+		$this->topicid = intval($value);
+	}
+
+	function setUid($value)
+	{
+		$this->uid = intval($value);
+	}
+
+	function setTitle($value)
+	{
+		$this->title = $value;
+	}
+
+	function setHometext($value)
+	{
+		$this->hometext = $value;
+	}
+
+	function setBodytext($value)
+	{
+		$this->bodytext = $value;
+	}
+
+	function setPublished($value)
+	{
+		$this->published = intval($value);
+	}
+
+	function setExpired($value)
+	{
+		$this->expired = intval($value);
+	}
+
+	function setHostname($value)
+	{
+		$this->hostname = $value;
+	}
+
+	function setNohtml($value=0)
+	{
+		$this->nohtml = $value;
+	}
+
+	function setNosmiley($value=0)
+	{
+		$this->nosmiley = $value;
+	}
+
+	function setIhome($value)
+	{
+		$this->ihome = $value;
+	}
+
+	function setNotifyPub($value)
+	{
+		$this->notifypub = $value;
+	}
+
+	function setType($value)
+	{
+		$this->type = $value;
+	}
+
+	function setApproved($value)
+	{
+		$this->approved = intval($value);
+	}
+
+	function setTopicdisplay($value)
+	{
+		$this->topicdisplay = $value;
+	}
+
+	function setTopicalign($value)
+	{
+		$this->topicalign = $value;
+	}
+
+	function setComments($value)
+	{
+		$this->comments = intval($value);
+	}
+
+	function store($approved=false)
+	{
+		//$newpost = 0;
+		$myts =& MyTextSanitizer::getInstance();
+		$title =$myts->censorString($this->title);
+		$hometext =$myts->censorString($this->hometext);
+		$bodytext =$myts->censorString($this->bodytext);
+		$title = $myts->makeTboxData4Save($title);
+		$hometext = $myts->makeTareaData4Save($hometext);
+		$bodytext = $myts->makeTareaData4Save($bodytext);
+		if ( !isset($this->nohtml) || $this->nohtml != 1 ) {
+			$this->nohtml = 0;
+		}
+		if ( !isset($this->nosmiley) || $this->nosmiley != 1 ) {
+			$this->nosmiley = 0;
+		}
+		if ( !isset($this->notifypub) || $this->notifypub != 1 ) {
+			$this->notifypub = 0;
+		}
+		if( !isset($this->topicdisplay) || $this->topicdisplay != 0 ) {
+			$this->topicdisplay = 1;
+		}
+		$expired = !empty($this->expired) ? $this->expired : 0;
+		if ( !isset($this->storyid) ) {
+			//$newpost = 1;
+			$newstoryid = $this->db->genId($this->table."_storyid_seq");
+			$created = time();
+			$published = ( $this->approved ) ? $this->published : 0;
+
+			$sql = sprintf("INSERT INTO %s (storyid, uid, title, created, published, expired, hostname, nohtml, nosmiley, hometext, bodytext, counter, topicid, ihome, notifypub, story_type, topicdisplay, topicalign, comments) VALUES (%u, %u, '%s', %u, %u, %u, '%s', %u, %u, '%s', '%s', %u, %u, %u, %u, '%s', %u, '%s', %u)", $this->table, $newstoryid, $this->uid, $title, $created, $published, $expired, $this->hostname, $this->nohtml, $this->nosmiley, $hometext, $bodytext, 0, $this->topicid, $this->ihome, $this->notifypub, $this->type, $this->topicdisplay, $this->topicalign, $this->comments);
+		} else {
+			if ( $this->approved ) {
+				$sql = sprintf("UPDATE %s SET title = '%s', published = %u, expired = %u, nohtml = %u, nosmiley = %u, hometext = '%s', bodytext = '%s', topicid = %u, ihome = %u, topicdisplay = %u, topicalign = '%s', comments = %u WHERE storyid = %u", $this->table, $title, $this->published, $expired, $this->nohtml, $this->nosmiley, $hometext, $bodytext, $this->topicid, $this->ihome, $this->topicdisplay, $this->topicalign, $this->comments, $this->storyid);
+			} else {
+				$sql = sprintf("UPDATE %s SET title = '%s', expired = %u, nohtml = %u, nosmiley = %u, hometext = '%s', bodytext = '%s', topicid = %u, ihome = %u, topicdisplay = %u, topicalign = '%s', comments = %u WHERE storyid = %u", $this->table, $title, $expired, $this->nohtml, $this->nosmiley, $hometext, $bodytext, $this->topicid, $this->ihome, $this->topicdisplay, $this->topicalign, $this->comments, $this->storyid);
+			}
+			$newstoryid = $this->storyid;
+		}
+		if (!$result = $this->db->query($sql)) {
+			return false;
+		}
+		if ( empty($newstoryid) ) {
+			$newstoryid = $this->db->getInsertId();
+			$this->storyid = $newstoryid;
+		}
+		return $newstoryid;
+	}
+
+	function getStory($storyid)
+	{
+		$sql = "SELECT * FROM ".$this->table." WHERE storyid=".$storyid."";
+		$array = $this->db->fetchArray($this->db->query($sql));
+		$this->makeStory($array);
+	}
+
+	function makeStory($array)
+	{
+		foreach ( $array as $key=>$value ){
+			$this->$key = $value;
+		}
+	}
+
+	function delete()
+	{
+		$sql = sprintf("DELETE FROM %s WHERE storyid = %u", $this->table, $this->storyid);
+		if( !$result = $this->db->query($sql) ) {
+			return false;
+		}
+		return true;
+	}
+
+	function updateCounter()
+	{
+		$sql = sprintf("UPDATE %s SET counter = counter+1 WHERE storyid = %u", $this->table, $this->storyid);
+		if ( !$result = $this->db->queryF($sql) ) {
+			return false;
+		}
+		return true;
+	}
+
+	function updateComments($total)
+	{
+		$sql = sprintf("UPDATE %s SET comments = %u WHERE storyid = %u", $this->table, $total, $this->storyid);
+		if ( !$result = $this->db->queryF($sql) ) {
+			return false;
+		}
+		return true;
+	}
+
+	function topicid()
+	{
+		return $this->topicid;
+	}
+
+	function topic()
+	{
+		return new XoopsTopic($this->topicstable, $this->topicid);
+	}
+
+	function uid()
+	{
+		return $this->uid;
+	}
+
+	function uname()
+	{
+		return XoopsUser::getUnameFromId($this->uid);
+	}
+
+	function title($format="Show")
+	{
+		$myts =& MyTextSanitizer::getInstance();
+		$smiley = 1;
+		if ( $this->nosmiley() ) {
+			$smiley = 0;
+		}
+		switch ( $format ) {
+		case "Show":
+			$title = $myts->makeTboxData4Show($this->title,$smiley);
+			break;
+		case "Edit":
+			$title = $myts->makeTboxData4Edit($this->title);
+			break;
+		case "Preview":
+			$title = $myts->makeTboxData4Preview($this->title,$smiley);
+			break;
+		case "InForm":
+			$title = $myts->makeTboxData4PreviewInForm($this->title);
+			break;
+		}
+		return $title;
+	}
+
+	function hometext($format="Show")
+	{
+		$myts =& MyTextSanitizer::getInstance();
+		$html = 1;
+		$smiley = 1;
+		$xcodes = 1;
+		if ( $this->nohtml() ) {
+			$html = 0;
+		}
+		if ( $this->nosmiley() ) {
+			$smiley = 0;
+		}
+		switch ( $format ) {
+		case "Show":
+			$hometext = $myts->makeTareaData4Show($this->hometext,$html,$smiley,$xcodes);
+			break;
+		case "Edit":
+			$hometext = $myts->makeTareaData4Edit($this->hometext);
+			break;
+		case "Preview":
+			$hometext = $myts->makeTareaData4Preview($this->hometext,$html,$smiley,$xcodes);
+			break;
+		case "InForm":
+			$hometext = $myts->makeTareaData4PreviewInForm($this->hometext);
+			break;
+		}
+		return $hometext;
+	}
+
+	function bodytext($format="Show")
+	{
+		$myts =& MyTextSanitizer::getInstance();
+		$html = 1;
+		$smiley = 1;
+		$xcodes = 1;
+		if ( $this->nohtml() ) {
+			$html = 0;
+		}
+		if ( $this->nosmiley() ) {
+			$smiley = 0;
+		}
+		switch ( $format ) {
+		case "Show":
+			$bodytext = $myts->makeTareaData4Show($this->bodytext,$html,$smiley,$xcodes);
+			break;
+		case "Edit":
+			$bodytext = $myts->makeTareaData4Edit($this->bodytext);
+			break;
+		case "Preview":
+			$bodytext = $myts->makeTareaData4Preview($this->bodytext,$html,$smiley, $xcodes);
+			break;
+		case "InForm":
+			$bodytext = $myts->makeTareaData4PreviewInForm($this->bodytext);
+			break;
+		}
+		return $bodytext;
+	}
+
+	function counter()
+	{
+		return $this->counter;
+	}
+
+	function created()
+	{
+		return $this->created;
+	}
+
+	function published()
+	{
+		return $this->published;
+	}
+
+	function expired()
+	{
+		return $this->expired;
+	}
+
+	function hostname()
+	{
+		return $this->hostname;
+	}
+
+	function storyid()
+	{
+		return $this->storyid;
+	}
+
+	function nohtml()
+	{
+		return $this->nohtml;
+	}
+
+	function nosmiley()
+	{
+		return $this->nosmiley;
+	}
+
+	function notifypub()
+	{
+		return $this->notifypub;
+	}
+
+	function type()
+	{
+		return $this->type;
+	}
+
+	function ihome()
+	{
+		return $this->ihome;
+	}
+
+	function topicdisplay()
+	{
+		return $this->topicdisplay;
+	}
+
+	function topicalign($astext=true)
+	{
+		if ( $astext ) {
+			if ( $this->topicalign == "R" ) {
+				$ret = "right";
+			} else {
+				$ret = "left";
+			}
+			return $ret;
+		}
+		return $this->topicalign;
+	}
+
+	function comments()
+	{
+		return $this->comments;
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/template.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/template.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/template.php	(revision 405)
@@ -0,0 +1,264 @@
+<?php
+// $Id: template.php,v 1.3 2005/10/24 11:44:16 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+if (!defined('SMARTY_DIR')) {
+	exit();
+}
+/**
+ * Base class: Smarty template engine
+ */
+require_once SMARTY_DIR.'Smarty.class.php';
+
+/**
+ * Template engine
+ *
+ * @package		kernel
+ * @subpackage	core
+ *
+ * @author		Kazumi Ono 	<onokazu@xoops.org>
+ * @copyright	(c) 2000-2003 The Xoops Project - www.xoops.org
+ */
+class XoopsTpl extends Smarty
+{
+
+	/**
+	 * Allow update of template files from the themes/ directory?
+     * This should be set to false on an active site to increase performance
+	 */
+	var $_canUpdateFromFile = false;
+
+	/**
+	 * Constructor
+	 **/
+	function XoopsTpl()
+	{
+		global $xoopsConfig;
+		$this->Smarty();
+		$this->compile_id = null;
+		if ($xoopsConfig['theme_fromfile'] == 1) {
+			$this->_canUpdateFromFile = true;
+			$this->compile_check = true;
+		} else {
+			$this->_canUpdateFromFile = false;
+			$this->compile_check = false;
+		}
+		$this->left_delimiter =  '<{';
+		$this->right_delimiter =  '}>';
+		$this->template_dir = XOOPS_THEME_PATH;
+		$this->cache_dir = XOOPS_CACHE_PATH;
+		$this->compile_dir = XOOPS_COMPILE_PATH;
+		$this->plugins_dir = array(XOOPS_ROOT_PATH.'/class/smarty/plugins');
+		$this->default_template_handler_func = 'xoops_template_create';
+		
+		// Added by goghs on 11-26 to deal with safe mode
+		//if (ini_get('safe_mode') == "1") {
+			$this->use_sub_dirs = false;
+		//} else {
+		//	$this->use_sub_dirs = true;
+		//}
+		// END
+
+		$this->assign(array('xoops_url' => XOOPS_URL, 'xoops_rootpath' => XOOPS_ROOT_PATH, 'xoops_langcode' => _LANGCODE, 'xoops_charset' => _CHARSET, 'xoops_version' => XOOPS_VERSION, 'xoops_upload_url' => XOOPS_UPLOAD_URL));
+	}
+
+	/**
+	 * Set the directory for templates
+     * 
+     * @param   string  $dirname    Directory path without a trailing slash
+	 **/
+	function xoops_setTemplateDir($dirname)
+	{
+		$this->template_dir = $dirname;
+	}
+
+	/**
+	 * Get the active template directory
+	 * 
+	 * @return  string
+	 **/
+	function xoops_getTemplateDir()
+	{
+		return $this->template_dir;
+	}
+
+	/**
+	 * Set debugging mode
+	 * 
+	 * @param   boolean     $flag
+	 **/
+	function xoops_setDebugging($flag=false)
+	{
+		$this->debugging = is_bool($flag) ? $flag : false;
+	}
+
+	/**
+	 * Set caching
+	 * 
+	 * @param   integer     $num
+	 **/
+	function xoops_setCaching($num=0)
+	{
+		$this->caching = (int)$num;
+	}
+
+	/**
+	 * Set cache lifetime
+	 * 
+	 * @param   integer     $num    Cache lifetime
+	 **/
+	function xoops_setCacheTime($num=0)
+	{
+		$num = (int)$num;
+		if ($num <= 0) {
+			$this->caching = 0;
+		} else {
+			$this->cache_lifetime = $num;
+		}
+	}
+
+	/**
+	 * Set directory for compiled template files
+	 * 
+	 * @param   string  $dirname    Full directory path without a trailing slash
+	 **/
+	function xoops_setCompileDir($dirname)
+	{
+		$this->compile_dir = $dirname;
+	}
+
+	/**
+	 * Set the directory for cached template files
+	 * 
+	 * @param   string  $dirname    Full directory path without a trailing slash
+	 **/
+	function xoops_setCacheDir($dirname)
+	{
+		$this->cache_dir = $dirname;
+	}
+
+	/**
+	 * Render output from template data
+	 * 
+	 * @param   string  $data
+	 * @return  string  Rendered output  
+	 **/
+	function xoops_fetchFromData(&$data)
+	{
+		$dummyfile = XOOPS_CACHE_PATH.'/dummy_'.time();
+		$fp = fopen($dummyfile, 'w');
+		fwrite($fp, $data);
+		fclose($fp);
+		$fetched = $this->fetch('file:'.$dummyfile);
+		unlink($dummyfile);
+		$this->clear_compiled_tpl('file:'.$dummyfile);
+		return $fetched;
+	}
+
+	/**
+	 * 
+	 **/
+	function xoops_canUpdateFromFile()
+	{
+		return $this->_canUpdateFromFile;
+	}
+}
+
+/**
+ * Smarty default template handler function
+ * 
+ * @param $resource_type
+ * @param $resource_name
+ * @param $template_source
+ * @param $template_timestamp
+ * @param $smarty_obj
+ * @return  bool
+ **/
+function xoops_template_create ($resource_type, $resource_name, &$template_source, &$template_timestamp, &$smarty_obj)
+{
+	if ( $resource_type == 'db' ) {
+		$file_handler =& xoops_gethandler('tplfile');
+		$tpl =& $file_handler->find('default', null, null, null, $resource_name, true);
+		if (count($tpl) > 0 && is_object($tpl[0])) {
+			$template_source = $tpl[0]->getSource();
+			$template_timestamp = $tpl[0]->getLastModified();
+			return true;
+		}
+	} else {
+	}
+	return false;
+}
+
+/**
+ * function to update compiled template file in templates_c folder
+ * 
+ * @param   string  $tpl_id
+ * @param   boolean $clear_old
+ * @return  boolean
+ **/
+function xoops_template_touch($tpl_id, $clear_old = true)
+{
+	$tpl = new XoopsTpl();
+	$tpl->force_compile = true;
+	$tplfile_handler =& xoops_gethandler('tplfile');
+	$tplfile =& $tplfile_handler->get($tpl_id);
+	if ( is_object($tplfile) ) {
+		$file = $tplfile->getVar('tpl_file');
+		if ($clear_old) {
+			$tpl->clear_cache('db:'.$file);
+			$tpl->clear_compiled_tpl('db:'.$file);
+		}
+		$tpl->fetch('db:'.$file);
+		return true;
+	}
+	return false;
+}
+
+/**
+ * Clear the module cache
+ * 
+ * @param   int $mid    Module ID
+ * @return 
+ **/
+function xoops_template_clear_module_cache($mid)
+{
+	$block_arr =& XoopsBlock::getByModule($mid);
+	$count = count($block_arr);
+	if ($count > 0) {
+		$xoopsTpl = new XoopsTpl();	
+		$xoopsTpl->xoops_setCaching(2);
+		for ($i = 0; $i < $count; $i++) {
+			if ($block_arr[$i]->getVar('template') != '') {
+				$xoopsTpl->clear_cache('db:'.$block_arr[$i]->getVar('template'), 'blk_'.$block_arr[$i]->getVar('bid'));
+			}
+		}
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/uploader.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/uploader.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/uploader.php	(revision 405)
@@ -0,0 +1,491 @@
+<?php
+// $Id: uploader.php,v 1.5 2005/10/24 11:44:16 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+/**
+ * Upload Media files
+ *
+ * Example of usage:
+ * <code>
+ * include_once 'uploader.php';
+ * $allowed_mimetypes = array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/x-png');
+ * $maxfilesize = 50000;
+ * $maxfilewidth = 120;
+ * $maxfileheight = 120;
+ * $uploader = new XoopsMediaUploader('/home/xoops/uploads', $allowed_mimetypes, $maxfilesize, $maxfilewidth, $maxfileheight);
+ * if ($uploader->fetchMedia($_POST['uploade_file_name'])) {
+ *   if (!$uploader->upload()) {
+ *      echo $uploader->getErrors();
+ *   } else {
+ *      echo '<h4>File uploaded successfully!</h4>'
+ *      echo 'Saved as: ' . $uploader->getSavedFileName() . '<br />';
+ *      echo 'Full path: ' . $uploader->getSavedDestination();
+ *   }
+ * } else {
+ *   echo $uploader->getErrors();
+ * }
+ * </code>
+ *
+ * @package        kernel
+ * @subpackage    core
+ *
+ * @author        Kazumi Ono     <onokazu@xoops.org>
+ * @copyright    (c) 2000-2003 The Xoops Project - www.xoops.org
+ */
+
+define("XCUBE_IMAGETYPE_ENUM_GIF",1);
+define("XCUBE_IMAGETYPE_ENUM_JPG",2);
+define("XCUBE_IMAGETYPE_ENUM_PNG",3);
+define("XCUBE_IMAGETYPE_ENUM_BMP",6);
+
+class XoopsMediaUploader
+{
+    /**
+    * Flag indicating if unrecognized mimetypes should be allowed (use with precaution ! may lead to security issues )
+    **/
+    var $allowUnknownTypes = false;
+    var $mediaName;
+    var $mediaType;
+    var $mediaSize;
+    var $mediaTmpName;
+    var $mediaError;
+    var $mediaRealType = '';
+    var $uploadDir = '';
+    var $allowedMimeTypes = array();
+    var $allowedExtensions = array();
+    var $maxFileSize = 0;
+    var $maxWidth;
+    var $maxHeight;
+    var $targetFileName;
+    var $prefix;
+    var $errors = array();
+    var $savedDestination;
+    var $savedFileName;
+    var $extensionToMime = array();
+
+	var $_strictCheckExtensions = array();
+
+    /**
+     * Constructor
+     *
+     * @param   string  $uploadDir
+     * @param   array   $allowedMimeTypes
+     * @param   int     $maxFileSize
+     * @param   int     $maxWidth
+     * @param   int     $maxHeight
+     * @param   int     $cmodvalue
+     **/
+    function XoopsMediaUploader($uploadDir, $allowedMimeTypes, $maxFileSize=0, $maxWidth=null, $maxHeight=null)
+    {
+        @$this->extensionToMime = include( XOOPS_ROOT_PATH . '/class/mimetypes.inc.php' );
+        if ( !is_array( $this->extensionToMime ) ) {
+            $this->extensionToMime = array();
+            return false;
+        }
+        if (is_array($allowedMimeTypes)) {
+            $this->allowedMimeTypes =& $allowedMimeTypes;
+        }
+        $this->uploadDir = $uploadDir;
+        $this->maxFileSize = intval($maxFileSize);
+        if(isset($maxWidth)) {
+            $this->maxWidth = intval($maxWidth);
+        }
+        if(isset($maxHeight)) {
+            $this->maxHeight = intval($maxHeight);
+        }
+
+		$this->_strictCheckExtensions = array("gif"=>XCUBE_IMAGETYPE_ENUM_GIF,
+                                               "jpg"=>XCUBE_IMAGETYPE_ENUM_JPG,
+                                               "jpeg"=>XCUBE_IMAGETYPE_ENUM_JPG,
+                                               "png"=>XCUBE_IMAGETYPE_ENUM_PNG,
+                                               "bmp"=>XCUBE_IMAGETYPE_ENUM_BMP); 
+    }
+
+    function setAllowedExtensions($extensions)
+    {
+        $this->allowedExtensions = is_array($extensions) ? $extensions : array();
+    }
+
+	function setStrictCheckExtensions($extensions)
+	{
+		$this->_strictCheckExtensions = $extensions;
+	}
+
+    /**
+     * Fetch the uploaded file
+     *
+     * @param   string  $media_name Name of the file field
+     * @param   int     $index      Index of the file (if more than one uploaded under that name)
+     * @return  bool
+     **/
+    function fetchMedia($media_name, $index = null)
+    {
+        if ( empty( $this->extensionToMime ) ) {
+            $this->setErrors( 'Error loading mimetypes definition' );
+            return false;
+        }
+        if (!isset($_FILES[$media_name])) {
+            $this->setErrors('File not found');
+            return false;
+        } elseif (is_array($_FILES[$media_name]['name']) && isset($index)) {
+            $index = intval($index);
+            $this->mediaName = (get_magic_quotes_gpc()) ? stripslashes($_FILES[$media_name]['name'][$index]) : $_FILES[$media_name]['name'][$index];
+            $this->mediaType = $_FILES[$media_name]['type'][$index];
+            $this->mediaSize = $_FILES[$media_name]['size'][$index];
+            $this->mediaTmpName = $_FILES[$media_name]['tmp_name'][$index];
+            $this->mediaError = !empty($_FILES[$media_name]['error'][$index]) ? $_FILES[$media_name]['errir'][$index] : 0;
+        } else {
+            $media_name =& $_FILES[$media_name];
+            $this->mediaName = (get_magic_quotes_gpc()) ? stripslashes($media_name['name']) : $media_name['name'];
+            $this->mediaName = $media_name['name'];
+            $this->mediaType = $media_name['type'];
+            $this->mediaSize = $media_name['size'];
+            $this->mediaTmpName = $media_name['tmp_name'];
+            $this->mediaError = !empty($media_name['error']) ? $media_name['error'] : 0;
+        }
+        if ( ($ext = strrpos( $this->mediaName, '.' )) !== false ) {
+            $this->ext = strtolower ( substr( $this->mediaName, $ext + 1 ) );
+            if ( isset( $this->extensionToMime[$this->ext] ) ) {
+                $this->mediaRealType = $this->extensionToMime[$this->ext];
+                //trigger_error( "XoopsMediaUploader: Set mediaRealType to {$this->mediaRealType} (file extension is ".$this->ext.")", E_USER_NOTICE );
+            }
+        } else {
+            $this->setErrors('Invalid Extension');
+            return false;
+        }
+        $this->errors = array();
+        if (intval($this->mediaSize) < 0) {
+            $this->setErrors('Invalid File Size');
+            return false;
+        }
+        if ($this->mediaName == '') {
+            $this->setErrors('Filename Is Empty');
+            return false;
+        }
+        if ($this->mediaTmpName == 'none' || !is_uploaded_file($this->mediaTmpName)) {
+            $this->setErrors('No file uploaded');
+            return false;
+        }
+        if ($this->mediaError > 0) {
+            $this->setErrors('Error occurred: Error #'.$this->mediaError);
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     * Set the target filename
+     *
+     * @param   string  $value
+     **/
+    function setTargetFileName($value){
+        $this->targetFileName = strval(trim($value));
+    }
+
+    /**
+     * Set the prefix
+     *
+     * @param   string  $value
+     **/
+    function setPrefix($value){
+        $this->prefix = strval(trim($value));
+    }
+
+    /**
+     * Get the uploaded filename
+     *
+     * @return  string
+     **/
+    function getMediaName()
+    {
+        return $this->mediaName;
+    }
+
+    /**
+     * Get the type of the uploaded file
+     *
+     * @return  string
+     **/
+    function getMediaType()
+    {
+        return $this->mediaType;
+    }
+
+    /**
+     * Get the size of the uploaded file
+     *
+     * @return  int
+     **/
+    function getMediaSize()
+    {
+        return $this->mediaSize;
+    }
+
+    /**
+     * Get the temporary name that the uploaded file was stored under
+     *
+     * @return  string
+     **/
+    function getMediaTmpName()
+    {
+        return $this->mediaTmpName;
+    }
+
+    /**
+     * Get the saved filename
+     *
+     * @return  string
+     **/
+    function getSavedFileName(){
+        return $this->savedFileName;
+    }
+
+    /**
+     * Get the destination the file is saved to
+     *
+     * @return  string
+     **/
+    function getSavedDestination(){
+        return $this->savedDestination;
+    }
+
+    /**
+     * Check the file and copy it to the destination
+     *
+     * @return  bool
+     **/
+    function upload($chmod = 0644)
+    {
+        if ($this->uploadDir == '') {
+            $this->setErrors('Upload directory not set');
+            return false;
+        }
+        if (!is_dir($this->uploadDir)) {
+            $this->setErrors('Failed opening directory: '.$this->uploadDir);
+        }
+        if (!is_writeable($this->uploadDir)) {
+            $this->setErrors('Failed opening directory with write permission: '.$this->uploadDir);
+        }
+        if (!$this->checkMaxFileSize()) {
+            $this->setErrors('File size too large: '.$this->mediaSize);
+        }
+        if (!$this->checkMaxWidth()) {
+            $this->setErrors(sprintf('File width must be smaller than %u', $this->maxWidth));
+        }
+        if (!$this->checkMaxHeight()) {
+            $this->setErrors(sprintf('File height must be smaller than %u', $this->maxHeight));
+        }
+        if (!$this->checkMimeType()) {
+            $this->setErrors("Invalid file type");
+        }
+        if (count($this->errors) > 0) {
+            return false;
+        }
+        if (!$this->_copyFile($chmod)) {
+            $this->setErrors('Failed uploading file: '.$this->mediaName);
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     * Copy the file to its destination
+     *
+     * @return  bool
+     **/
+    function _copyFile($chmod)
+    {
+        if (isset($this->targetFileName)) {
+            $this->savedFileName = $this->targetFileName;
+        } elseif (isset($this->prefix)) {
+            $this->savedFileName = uniqid($this->prefix).'.'.strtolower($this->ext);
+        } else {
+            $this->savedFileName = strtolower($this->mediaName);
+        }
+        $this->savedDestination = $this->uploadDir.'/'.$this->savedFileName;
+        if (!move_uploaded_file($this->mediaTmpName, $this->savedDestination)) {
+            return false;
+        }
+        @chmod($this->savedDestination, $chmod);
+        return true;
+    }
+
+    /**
+     * Is the file the right size?
+     *
+     * @return  bool
+     **/
+    function checkMaxFileSize()
+    {
+        if ($this->mediaSize > $this->maxFileSize) {
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     * Is the picture the right width?
+     *
+     * @return  bool
+     **/
+    function checkMaxWidth()
+    {
+        if (!isset($this->maxWidth)) {
+            return true;
+        }
+        if (false !== $dimension = getimagesize($this->mediaTmpName)) {
+            if ($dimension[0] > $this->maxWidth) {
+                return false;
+            }
+        } else {
+            trigger_error(sprintf('Failed fetching image size of %s, skipping max width check..', $this->mediaTmpName), E_USER_WARNING);
+        }
+        return true;
+    }
+
+    /**
+     * Is the picture the right height?
+     *
+     * @return  bool
+     **/
+    function checkMaxHeight()
+    {
+        if (!isset($this->maxHeight)) {
+            return true;
+        }
+        if (false !== $dimension = getimagesize($this->mediaTmpName)) {
+            if ($dimension[1] > $this->maxHeight) {
+                return false;
+            }
+        } else {
+            trigger_error(sprintf('Failed fetching image size of %s, skipping max height check..', $this->mediaTmpName), E_USER_WARNING);
+        }
+        return true;
+    }
+
+    /**
+     * Check whether or not the uploaded file type is allowed
+     *
+     * @return  bool
+     **/
+    function checkMimeType()
+    {
+        if (!empty($this->allowedExtensions)) {
+            if (!in_array($this->ext, $this->allowedExtensions)) {
+                $this->setErrors( 'File extension not allowed' );
+                return false;
+            }
+            // Since the file extension is already checked against
+            // allowed file extension values, it is safe to use
+            // $this->mediaType for the allowed mime type check as was in
+            // <= 2.0.9.2
+            if (!empty($this->allowedMimeTypes)&& !in_array($this->mediaType, $this->allowedMimeTypes)) {
+                $this->setErrors('Unexpected MIME Type');
+                return false;
+            }
+        } else {
+            // use $this->mediaRealType for the allowed mime type check to
+            // make it more restrictive/secure
+            if (empty( $this->mediaRealType ) && !$this->allowUnknownTypes) {
+                return false;
+            }
+            if (!empty($this->allowedMimeTypes)&& !in_array($this->mediaRealType, $this->allowedMimeTypes)) {
+                $this->setErrors('Unexpected MIME Type');
+                return false;
+            }
+        }
+
+		// If this extension need strict check, call method for it.
+		if(isset($this->_strictCheckExtensions[$this->ext])) {
+			return $this->_checkStrict();
+		}
+		else {
+	        return true;
+		}
+    }
+
+	function _checkStrict()
+	{
+		$parseValue = getimagesize($this->mediaTmpName);
+
+		if($parseValue===false)
+			return false;
+
+		return $parseValue[2]==$this->_strictCheckExtensions[$this->ext];
+	}
+
+    /**
+     * Check whether or not the uploaded file type is allowed
+     *
+     * @return  bool
+     **/
+    function checkExpectedMimeType()
+    {
+        if ( empty( $this->mediaRealType ) && !$this->allowUnknownTypes ) {
+            return false;
+        }
+
+        return ( empty($this->allowedMimeTypes) || in_array($this->mediaRealType, $this->allowedMimeTypes) );
+    }
+
+    /**
+     * Add an error
+     *
+     * @param   string  $error
+     **/
+    function setErrors($error)
+    {
+        $this->errors[] = trim($error);
+    }
+
+    /**
+     * Get generated errors
+     *
+     * @param    bool    $ashtml Format using HTML?
+     *
+     * @return    array|string    Array of array messages OR HTML string
+     */
+    function &getErrors($ashtml = true)
+    {
+        if (!$ashtml) {
+            return $this->errors;
+        } else {
+            $ret = '';
+            if (count($this->errors) > 0) {
+                $ret = '<h4>Errors Returned While Uploading</h4>';
+                foreach ($this->errors as $error) {
+                    $ret .= $error.'<br />';
+                }
+            }
+            return $ret;
+        }
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/xoopscomments.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/xoopscomments.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/xoopscomments.php	(revision 405)
@@ -0,0 +1,348 @@
+<?php
+// $Id: xoopscomments.php,v 1.4 2005/09/04 20:46:08 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+if (!defined('XOOPS_ROOT_PATH')) {
+	exit();
+}
+include_once XOOPS_ROOT_PATH."/class/xoopstree.php";
+require_once XOOPS_ROOT_PATH.'/class/xoopsobject.php';
+include_once XOOPS_ROOT_PATH.'/language/'.$GLOBALS['xoopsConfig']['language'].'/comment.php';
+
+class XoopsComments extends XoopsObject
+{
+	var $ctable;
+	var $db;
+
+	function XoopsComments($ctable, $id=null)
+	{
+		$this->ctable = $ctable;
+		$this->db =& Database::getInstance();
+		$this->XoopsObject();
+		$this->initVar('comment_id', XOBJ_DTYPE_INT, null, false);
+		$this->initVar('item_id', XOBJ_DTYPE_INT, null, false);
+		$this->initVar('order', XOBJ_DTYPE_INT, null, false);
+		$this->initVar('mode', XOBJ_DTYPE_OTHER, null, false);
+		$this->initVar('subject', XOBJ_DTYPE_TXTBOX, null, false, 255);
+		$this->initVar('comment', XOBJ_DTYPE_TXTAREA, null, false, null);
+		$this->initVar('ip', XOBJ_DTYPE_OTHER, null, false);
+		$this->initVar('pid', XOBJ_DTYPE_INT, 0, false);
+		$this->initVar('date', XOBJ_DTYPE_INT, null, false);
+		$this->initVar('nohtml', XOBJ_DTYPE_INT, 1, false);
+		$this->initVar('nosmiley', XOBJ_DTYPE_INT, 0, false);
+		$this->initVar('noxcode', XOBJ_DTYPE_INT, 0, false);
+		$this->initVar('user_id', XOBJ_DTYPE_INT, null, false);
+		$this->initVar('icon', XOBJ_DTYPE_OTHER, null, false);
+		$this->initVar('prefix', XOBJ_DTYPE_OTHER, null, false);
+		if ( !empty($id) ) {
+			if ( is_array($id) ) {
+				$this->assignVars($id);
+			} else {
+				$this->load(intval($id));
+			}
+		}
+	}
+
+	function load($id)
+	{
+		$sql = "SELECT * FROM ".$this->ctable." WHERE comment_id=".$id."";
+		$arr = $this->db->fetchArray($this->db->query($sql));
+		$this->assignVars($arr);
+	}
+
+	function store()
+	{
+		if ( !$this->cleanVars() ) {
+			return false;
+		}
+		foreach ( $this->cleanVars as $k=>$v ) {
+			$$k = $v;
+		}
+		$isnew = false;
+		if ( empty($comment_id ) ) {
+			$isnew = true;
+			$comment_id = $this->db->genId($this->ctable."_comment_id_seq");
+			$sql = sprintf("INSERT INTO %s (comment_id, pid, item_id, date, user_id, ip, subject, comment, nohtml, nosmiley, noxcode, icon) VALUES (%u, %u, %u, %u, %u, '%s', '%s', '%s', %u, %u, %u, '%s')", $this->ctable, $comment_id, $pid, $item_id, time(), $user_id, $ip, $subject, $comment, $nohtml, $nosmiley, $noxcode, $icon);
+		} else {
+			$sql = sprintf("UPDATE %s SET subject = '%s', comment = '%s', nohtml = %u, nosmiley = %u, noxcode = %u, icon = '%s'  WHERE comment_id = %u", $this->ctable, $subject, $comment, $nohtml, $nosmiley, $noxcode, $icon, $comment_id);
+		}
+		if ( !$result = $this->db->query($sql) ) {
+			//echo $sql;
+			return false;
+		}
+		if ( empty($comment_id) ) {
+			$comment_id = $this->db->getInsertId();
+		}
+		if ( $isnew != false ) {
+			$sql = sprintf("UPDATE %s SET posts = posts+1 WHERE uid = %u", $this->db->prefix("users"), $user_id);
+			if (!$result = $this->db->query($sql)) {
+				echo "Could not update user posts.";
+			}
+		}
+		return $comment_id;
+	}
+
+	function delete()
+	{
+		$sql = sprintf("DELETE FROM %s WHERE comment_id = %u", $this->ctable, $this->getVar('comment_id'));
+		if ( !$result = $this->db->query($sql) ) {
+			return false;
+		}
+		$sql = sprintf("UPDATE %s SET posts = posts-1 WHERE uid = %u", $this->db->prefix("users"), $this->getVar("user_id"));
+		if ( !$result = $this->db->query($sql) ) {
+			echo "Could not update user posts.";
+		}
+		$mytree = new XoopsTree($this->ctable, "comment_id", "pid");
+		$arr = $mytree->getAllChild($this->getVar("comment_id"), "comment_id");
+		$size = count($arr);
+		if ( $size > 0 ) {
+			for ( $i = 0; $i < $size; $i++ ) {
+				$sql = sprintf("DELETE FROM %s WHERE comment_bid = %u", $this->ctable, $arr[$i]['comment_id']);
+				if ( !$result = $this->db->query($sql) ) {
+					echo "Could not delete comment.";
+				}
+				$sql = sprintf("UPDATE %s SET posts = posts-1 WHERE uid = %u", $this->db->prefix("users"), $arr[$i]['user_id']);
+				if ( !$result = $this->db->query($sql) ) {
+					echo "Could not update user posts.";
+				}
+			}
+		}
+		return ($size + 1);
+	}
+
+	function &getCommentTree()
+	{
+		$mytree = new XoopsTree($this->ctable, "comment_id", "pid");
+		$ret = array();
+		$tarray = $mytree->getChildTreeArray($this->getVar("comment_id"), "comment_id");
+		foreach ( $tarray as $ele ) {
+			$ret[] = new XoopsComments($this->ctable,$ele);
+		}
+		return $ret;
+	}
+
+	function getAllComments($criteria=array(), $asobject=true, $orderby="comment_id ASC", $limit=0, $start=0)
+	{
+		$ret = array();
+		$where_query = "";
+		if ( is_array($criteria) && count($criteria) > 0 ) {
+			$where_query = " WHERE";
+			foreach ( $criteria as $c ) {
+				$where_query .= " $c AND";
+			}
+			$where_query = substr($where_query, 0, -4);
+		}
+		if ( !$asobject ) {
+			$sql = "SELECT comment_id FROM ".$this->ctable."$where_query ORDER BY $orderby";
+			$result = $this->db->query($sql,$limit,$start);
+			while ( $myrow = $this->db->fetchArray($result) ) {
+				$ret[] = $myrow['comment_id'];
+			}
+		} else {
+			$sql = "SELECT * FROM ".$this->ctable."".$where_query." ORDER BY $orderby";
+			$result = $this->db->query($sql,$limit,$start);
+			while ( $myrow = $this->db->fetchArray($result) ) {
+				$ret[] = new XoopsComments($this->ctable,$myrow);
+			}
+		}
+		//echo $sql;
+		return $ret;
+	}
+
+	/* Methods below will be moved to maybe another class? */
+	function printNavBar($item_id, $mode="flat", $order=1)
+	{
+		global $xoopsConfig, $xoopsUser;
+		echo "<form method='get' action='".xoops_getenv('PHP_SELF')."'><table width='100%' border='0' cellspacing='1' cellpadding='2'><tr><td class='bg1' align='center'><select name='mode'><option value='nocomments'";
+		if ( $mode == "nocomments" ) {
+			echo " selected='selected'";
+		}
+		echo ">". _NOCOMMENTS ."</option><option value='flat'";
+		if ($mode == 'flat') {
+			echo " selected='selected'";
+		}
+		echo ">". _FLAT ."</option><option value='thread'";
+		if ( $mode == "thread" || $mode == "" ) {
+			echo " selected='selected'";
+		}
+		echo ">". _THREADED ."</option></select><select name='order'><option value='0'";
+		if ( $order != 1 ) {
+			echo " selected='selected'";
+		}
+		echo ">". _OLDESTFIRST ."</option><option value='1'";
+		if ( $order == 1 ) {
+			echo " selected='selected'";
+		}
+		echo ">". _NEWESTFIRST ."</option></select><input type='hidden' name='item_id' value='".intval($item_id)."' /><input type='submit' value='". _CM_REFRESH ."' />";
+		if ( $xoopsConfig['anonpost'] == 1 || $xoopsUser ) {
+			if ($mode != "flat" || $mode != "nocomments" || $mode != "thread" ) {
+				$mode = "flat";
+			}
+			echo "&nbsp;<input type='button' onclick='location=\"newcomment.php?item_id=".intval($item_id)."&amp;order=".intval($order)."&amp;mode=".$mode."\"' value='"._CM_POSTCOMMENT."' />";
+		}
+		echo "</td></tr></table></form>";
+	}
+
+	function showThreadHead()
+	{
+		openThread();
+	}
+
+	function showThreadPost($order, $mode, $adminview=0, $color_num=1)
+	{
+		global $xoopsConfig, $xoopsUser;
+		$edit_image = "";
+		$reply_image = "";
+		$delete_image = "";
+		$post_date = formatTimestamp($this->getVar("date"),"m");
+		if ( $this->getVar("user_id") != 0 ) {
+			$poster = new XoopsUser($this->getVar("user_id"));
+			if ( !$poster->isActive() ) {
+				$poster = 0;
+			}
+		} else {
+			$poster = 0;
+		}
+		if ( $this->getVar("icon") != null && $this->getVar("icon") != "" ) {
+			$subject_image = "<a name='".$this->getVar("comment_id")."' id='".$this->getVar("comment_id")."'></a><img src='".XOOPS_URL."/images/subject/".$this->getVar("icon")."' alt='' />";
+		} else {
+			$subject_image =  "<a name='".$this->getVar("comment_id")."' id='".$this->getVar("comment_id")."'></a><img src='".XOOPS_URL."/images/icons/no_posticon.gif' alt='' />";
+		}
+		if ( $adminview ) {
+			$ip_image = "<img src='".XOOPS_URL."/images/icons/ip.gif' alt='".$this->getVar("ip")."' />";
+		} else {
+			$ip_image = "<img src='".XOOPS_URL."/images/icons/ip.gif' alt='' />";
+		}
+		if ( $adminview || ($xoopsUser && $this->getVar("user_id") == $xoopsUser->getVar("uid")) ) {
+			$edit_image = "<a href='editcomment.php?comment_id=".$this->getVar("comment_id")."&amp;mode=".$mode."&amp;order=".intval($order)."'><img src='".XOOPS_URL."/images/icons/edit.gif' alt='"._EDIT."' /></a>";
+		}
+		if ( $xoopsConfig['anonpost'] || $xoopsUser ) {
+			$reply_image = "<a href='replycomment.php?comment_id=".$this->getVar("comment_id")."&amp;mode=".$mode."&amp;order=".intval($order)."'><img src='".XOOPS_URL."/images/icons/reply.gif' alt='"._REPLY."' /></a>";
+		}
+		if ( $adminview ) {
+			$delete_image = "<a href='deletecomment.php?comment_id=".$this->getVar("comment_id")."&amp;mode=".$mode."&amp;order=".intval($order)."'><img src='".XOOPS_URL."/images/icons/delete.gif' alt='"._DELETE."' /></a>";
+		}
+
+		if ( $poster ) {
+			$text = $this->getVar("comment");
+			if ( $poster->getVar("attachsig") ) {
+				$text .= "<p><br />_________________<br />". $poster->user_sig()."</p>";
+			}
+			$reg_date = _CM_JOINED;
+			$reg_date .= formatTimestamp($poster->getVar("user_regdate"),"s");
+			$posts = _CM_POSTS;
+			$posts .= $poster->getVar("posts");
+			$user_from = _CM_FROM;
+			$user_from .= $poster->getVar("user_from");
+			$rank = $poster->rank();
+			if ( $rank['image'] != "" ) {
+				$rank['image'] = "<img src='".XOOPS_UPLOAD_URL."/".$rank['image']."' alt='' />";
+			}
+			$avatar_image = "<img src='".XOOPS_UPLOAD_URL."/".$poster->getVar("user_avatar")."' alt='' />";
+			if ( $poster->isOnline() ) {
+				$online_image = "<span style='color:#ee0000;font-weight:bold;'>"._ONLINE."</span>";
+			} else {
+				$online_image = "";
+			}
+			$profile_image = "<a href='".XOOPS_URL."/userinfo.php?uid=".$poster->getVar("uid")."'><img src='".XOOPS_URL."/images/icons/profile.gif' alt='"._PROFILE."' /></a>";
+			if ( $xoopsUser ) {
+				$pm_image =  "<a href='javascript:openWithSelfMain(\"".XOOPS_URL."/pmlite.php?send2=1&amp;to_userid=".$poster->getVar("uid")."\",\"pmlite\",450,370);'><img src='".XOOPS_URL."/images/icons/pm.gif' alt='".sprintf(_SENDPMTO,$poster->getVar("uname", "E"))."' /></a>";
+			} else {
+				$pm_image = "";
+			}
+   			if ( $poster->getVar("user_viewemail") ) {
+				$email_image = "<a href='mailto:".$poster->getVar("email", "E")."'><img src='".XOOPS_URL."/images/icons/email.gif' alt='".sprintf(_SENDEMAILTO,$poster->getVar("uname", "E"))."' /></a>";
+			} else {
+				$email_image = "";
+			}
+			$posterurl = $poster->getVar("url");
+   			if ( $posterurl != "" ) {
+				$www_image = "<a href='$posterurl' target='_blank'><img src='".XOOPS_URL."/images/icons/www.gif' alt='"._VISITWEBSITE."' /></a>";
+			} else {
+				$www_image = "";
+			}
+   			if ( $poster->getVar("user_icq") != "" ) {
+				$icq_image = "<a href='http://wwp.icq.com/scripts/search.dll?to=".$poster->getVar("user_icq", "E")."'><img src='".XOOPS_URL."/images/icons/icq_add.gif' alt='"._ADD."' /></a>";
+			} else {
+				$icq_image = "";
+			}
+			if ( $poster->getVar("user_aim") != "" ) {
+				$aim_image = "<a href='aim:goim?screenname=".$poster->getVar("user_aim", "E")."&amp;message=Hi+".$poster->getVar("user_aim")."+Are+you+there?'><img src='".XOOPS_URL."/images/icons/aim.gif' alt='aim' /></a>";
+			} else {
+				$aim_image = "";
+			}
+   			if ( $poster->getVar("user_yim") != "" ) {
+				$yim_image = "<a href='http://edit.yahoo.com/config/send_webmesg?.target=".$poster->getVar("user_yim", "E")."&amp;.src=pg'><img src='".XOOPS_URL."/images/icons/yim.gif' alt='yim' /></a>";
+			} else {
+				$yim_image = "";
+			}
+			if ( $poster->getVar("user_msnm") != "" ) {
+				$msnm_image = "<a href='".XOOPS_URL."/userinfo.php?uid=".$poster->getVar("uid")."'><img src='".XOOPS_URL."/images/icons/msnm.gif' alt='msnm' /></a>";
+			} else {
+				$msnm_image = "";
+			}
+			showThread($color_num, $subject_image, $this->getVar("subject"), $text, $post_date, $ip_image, $reply_image, $edit_image, $delete_image, $poster->getVar("uname"), $rank['title'], $rank['image'], $avatar_image, $reg_date, $posts, $user_from, $online_image, $profile_image, $pm_image, $email_image, $www_image, $icq_image, $aim_image, $yim_image, $msnm_image);
+		} else {
+			showThread($color_num, $subject_image, $this->getVar("subject"), $this->getVar("comment"), $post_date, $ip_image, $reply_image, $edit_image, $delete_image, $xoopsConfig['anonymous']);
+		}
+	}
+
+	function showThreadFoot()
+	{
+		closeThread();
+	}
+
+	function showTreeHead($width="100%")
+	{
+		echo "<table border='0' class='outer' cellpadding='0' cellspacing='0' align='center' width='$width'><tr class='bg3' align='center'><td colspan='3'>". _CM_REPLIES ."</td></tr><tr class='bg3' align='left'><td width='60%' class='fg2'>". _CM_TITLE ."</td><td width='20%' class='fg2'>". _CM_POSTER ."</td><td class='fg2'>". _CM_POSTED ."</td></tr>";
+	}
+
+	function showTreeItem($order, $mode, $color_num)
+	{
+		if ( $color_num == 1 ) {
+			$bg = 'even';
+		} else {
+			$bg = 'odd';
+		}
+		$prefix = str_replace(".", "&nbsp;&nbsp;&nbsp;&nbsp;", $this->getVar("prefix"));
+		$date = formatTimestamp($this->getVar("date"),"m");
+		if ( $this->getVar("icon") != "" ) {
+			$icon = "subject/".$this->getVar("icon", "E");
+		} else {
+			$icon = "icons/no_posticon.gif";
+		}
+		echo "<tr class='$bg' align='left'><td>".$prefix."<img src='".XOOPS_URL."/images/".$icon."'>&nbsp;<a href='".xoops_getenv('PHP_SELF')."?item_id=".$this->getVar("item_id")."&amp;comment_id=".$this->getVar("comment_id")."&amp;mode=".$mode."&amp;order=".$order."#".$this->getVar("comment_id")."'>".$this->getVar("subject")."</a></td><td><a href='".XOOPS_URL."/userinfo.php?uid=".$this->getVar("user_id")."'>".XoopsUser::getUnameFromId($this->getVar("user_id"))."</a></td><td>".$date."</td></tr>";
+	}
+
+	function showTreeFoot()
+	{
+		echo "</table><br />";
+	}
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/logger.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/logger.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/logger.php	(revision 405)
@@ -0,0 +1,238 @@
+<?php
+// $Id: logger.php,v 1.4 2005/08/03 12:39:11 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu)                                          //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project                                                //
+// ------------------------------------------------------------------------- //
+
+/**
+ * Collects information for a page request
+ *
+ * <b>Singelton:</b> There can be only one instance of this class and it must
+ * be accessed through the {@link instance()} method!
+ *
+ * records information about database queries, blocks, and execution time
+ * and can display it as HTML
+ *
+ * @author  Kazumi Ono  <onokazu@xoops.org>
+ * @copyright   copyright (c) 2000-2003 XOOPS.org
+ *
+ * @package kernel
+ */
+class XoopsLogger
+{
+    /**#@+
+     * @var array
+     */
+    var $queries = array();
+    var $blocks = array();
+    var $extra = array();
+    var $logstart = array();
+    var $logend = array();
+    /**#@-*/
+
+    /**
+     * constructor
+     *
+     * @access  private
+     */
+    function XoopsLogger()
+    {
+
+    }
+
+    /**
+     * get a reference to the only instance of this class
+     *
+     * @return  object XoopsLogger  reference to the only instance
+     */
+    function &instance()
+    {
+        static $instance;
+        if (!isset($instance)) {
+            $instance = new XoopsLogger();
+        }
+        return $instance;
+    }
+
+    /**
+     * start a timer
+     *
+     * @param   string  $name   name of the timer
+     *
+     */
+    function startTime($name = 'XOOPS')
+    {
+        $this->logstart[$name] = explode(' ', microtime());
+    }
+
+    /**
+     * stop a timer
+     *
+     * @param   string  $name   name of the timer
+     */
+    function stopTime($name = 'XOOPS')
+    {
+        $this->logend[$name] = explode(' ', microtime());
+    }
+
+    /**
+     * log a database query
+     *
+     * @param   string  $sql    SQL string
+     * @param   string  $error  error message (if any)
+     * @param   int     $errno  error number (if any)
+     */
+    function addQuery($sql, $error=null, $errno=null)
+    {
+        $this->queries[] = array('sql' => $sql, 'error' => $error, 'errno' => $errno);
+    }
+
+    /**
+     * log display of a block
+     *
+     * @param   string  $name       name of the block
+     * @param   bool    $cached     was the block cached?
+     * @param   int     $cachetime  cachetime of the block
+     */
+    function addBlock($name, $cached = false, $cachetime = 0)
+    {
+        $this->blocks[] = array('name' => $name, 'cached' => $cached, 'cachetime' => $cachetime);
+    }
+
+    /**
+     * log extra information
+     *
+     * @param   string  $name       name for the entry
+     * @param   int     $msg  text message for the entry
+     */
+    function addExtra($name, $msg)
+    {
+        $this->extra[] = array('name' => $name, 'msg' => $msg);
+    }
+
+    /**
+     * get the logged queries in a HTML table
+     *
+     * @return  string  HTML table with queries
+     */
+    function dumpQueries()
+    {
+        $ret = '<table class="outer" width="100%" cellspacing="1"><tr><th>Queries</th></tr>';
+        $class = 'even';
+        foreach ($this->queries as $q) {
+            if (isset($q['error'])) {
+                $ret .= '<tr class="'.$class.'"><td><span style="color:#ff0000;">'.htmlentities($q['sql']).'<br /><b>Error number:</b> '.$q['errno'].'<br /><b>Error message:</b> '.$q['error'].'</span></td></tr>';
+            } else {
+                $ret .= '<tr class="'.$class.'"><td>'.htmlentities($q['sql']).'</td></tr>';
+            }
+            $class = ($class == 'odd') ? 'even' : 'odd';
+        }
+        $ret .= '<tr class="foot"><td>Total: <span style="color:#ff0000;">'.count($this->queries).'</span> queries</td></tr></table><br />';
+        return $ret;
+    }
+
+    /**
+     * get the logged blocks in a HTML table
+     *
+     * @return  string  HTML table with blocks
+     */
+    function dumpBlocks()
+    {
+        $ret = '<table class="outer" width="100%" cellspacing="1"><tr><th colspan="2">Blocks</th></tr>';
+        $class = 'even';
+        foreach ($this->blocks as $b) {
+            if ($b['cached']) {
+                $ret .= '<tr><td class="'.$class.'"><b>'.htmlspecialchars($b['name']).':</b> Cached (regenerates every '.intval($b['cachetime']).' seconds)</td></tr>';
+            } else {
+                $ret .= '<tr><td class="'.$class.'"><b>'.htmlspecialchars($b['name']).':</b> No Cache</td></tr>';
+            }
+            $class = ($class == 'odd') ? 'even' : 'odd';
+        }
+        $ret .= '<tr class="foot"><td>Total: <span style="color:#ff0000;">'.count($this->blocks).'</span> blocks</td></tr></table><br />';
+        return $ret;
+    }
+
+    /**
+     * get the current execution time of a timer
+     *
+     * @param   string  $name   name of the counter
+     * @return  float   current execution time of the counter
+     */
+    function dumpTime($name = 'XOOPS')
+    {
+        if (!isset($this->logstart[$name])) {
+            return 0;
+        }
+        if (!isset($this->logend[$name])) {
+            $stop_time = explode(' ', microtime());
+        } else {
+            $stop_time = $this->logend[$name];
+        }
+        return ((float)$stop_time[1] + (float)$stop_time[0]) - ((float)$this->logstart[$name][1] + (float)$this->logstart[$name][0]);
+    }
+
+    /**
+     * get extra information in a HTML table
+     *
+     * @return  string  HTML table with extra information
+     */
+    function dumpExtra()
+    {
+        $ret = '<table class="outer" width="100%" cellspacing="1"><tr><th colspan="2">Extra</th></tr>';
+        $class = 'even';
+        foreach ($this->extra as $ex) {
+            $ret .= '<tr><td class="'.$class.'"><b>'.htmlspecialchars($ex['name']).':</b> '.htmlspecialchars($ex['msg']).'</td></tr>';
+            $class = ($class == 'odd') ? 'even' : 'odd';
+        }
+        $ret .= '</table><br />';
+        return $ret;
+    }
+
+    /**
+     * get all logged information formatted in HTML tables
+     *
+     * @return  string  HTML output
+     */
+    function dumpAll()
+    {
+        $ret = $this->dumpQueries();
+        $ret .= $this->dumpBlocks();
+        if (count($this->logstart) > 0) {
+            $ret .= '<table class="outer" width="100%" cellspacing="1"><tr><th>Execution Time</th></tr>';
+            $class = 'even';
+            foreach ($this->logstart as $k => $v) {
+                $ret .= '<tr><td class="'.$class.'"><b>'.htmlspecialchars($k).'</b> took <span style="color:#ff0000;">'.$this->dumpTime($k).'</span> seconds to load.</td></tr>';
+                $class = ($class == 'odd') ? 'even' : 'odd';
+            }
+            $ret .= '</table><br />';
+        }
+        $ret .= $this->dumpExtra();
+        return $ret;
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/class/token.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/class/token.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/class/token.php	(revision 405)
@@ -0,0 +1,409 @@
+<?php
+// $Id: token.php,v 1.1.2.8.2.1 2005/06/11 02:50:10 onokazu Exp $
+
+define ( 'XOOPS_TOKEN_TIMEOUT', 0 );
+define ( 'XOOPS_TOKEN_PREFIX', "XOOPS_TOKEN_" );
+
+if(!defined('XOOPS_SALT'))
+    define('XOOPS_SALT',substr(md5(XOOPS_DB_PREFIX.XOOPS_DB_USER.XOOPS_ROOT_PATH),5,8));
+
+define ( 'XOOPS_TOKEN_SESSION_STRING', "X2_TOKEN");
+define ( 'XOOPS_TOKEN_MULTI_SESSION_STRING', "X2_MULTI_TOKEN");
+
+define('XOOPS_TOKEN_DEFAULT', 'XOOPS_TOKEN_DEFAULT');
+
+/**
+ * This class express token. this has name, token's string for inquiry,
+ * lifetime, serial number. this does not have direct validation method,
+ * therefore this does not depend on $_Session and $_Request.
+ *
+ * You can refer to a handler class for this token. this token class
+ * means ticket, and handler class means ticket agent. there is a strict
+ * ticket agent type(XoopsSingleTokenHandler), and flexible ticket agent
+ * for the tab browser(XoopsMultiTokenHandler).
+ */
+class XoopsToken
+{
+    /**
+     * token's name. this is used for identification.
+     * @access protected
+     */
+    var $_name_;
+
+    /**
+     * token's string for inquiry. this should be a random code for security.
+     * @access private
+     */
+    var $_token_;
+
+    /**
+     * the unixtime when this token is effective.
+     *
+     * @access protected
+     */
+    var $_lifetime_;
+
+    /**
+     * unlimited flag. if this is true, this token is not limited in lifetime.
+     */
+    var $_unlimited_;
+
+    /**
+     * serial number. this used for identification of tokens of same name tokens.
+     *
+     * @access private
+     */
+    var $_number_=0;
+
+    /**
+     * @param   $name   this token's name string.
+     * @param   $timeout    effective time(if $timeout equal 0, this token will become unlimited)
+     */
+    function XoopsToken($name, $timeout = XOOPS_TOKEN_TIMEOUT)
+    {
+        $this->_name_ = $name;
+
+        if($timeout) {
+            $this->_lifetime_ = time() + $timeout;
+            $this->_unlimited_ = false;
+        }
+        else {
+            $this->_lifetime_ = 0;
+            $this->_unlimited_ = true;
+        }
+
+        $this->_token_ = $this->_generateToken();
+    }
+
+
+    /**
+     * Returns random string for token's string.
+     *
+     * @access protected
+     * @return string
+     */
+    function _generateToken()
+    {
+        srand(microtime()*100000);
+        return md5(XOOPS_SALT.$this->_name_.uniqid(rand(),true));
+    }
+
+    /**
+     * Returns this token's name.
+     *
+     * @access public
+     * @return string
+     */
+    function getTokenName()
+    {
+        return XOOPS_TOKEN_PREFIX.$this->_name_."_".$this->_number_;
+    }
+
+    /**
+     * Returns this token's string.
+     *
+     * @access public
+     * @return  string
+     */
+    function getTokenValue()
+    {
+        return $this->_token_;
+    }
+
+    /**
+     * Set this token's serial number.
+     *
+     * @access public
+     * @param   $serial_number  serial number
+     */
+    function setSerialNumber($serial_number)
+    {
+        $this->_number_ = $serial_number;
+    }
+
+    /**
+     * Returns this token's serial number.
+     *
+     * @access public
+     * @return  int
+     */
+    function getSerialNumber()
+    {
+        return $this->_number_;
+    }
+
+    /**
+     * Returns hidden tag string that includes this token. you can use it
+     * for <form> tag's member.
+     *
+     * @access public
+     * @return  string
+     */
+    function getHtml()
+    {
+        return @sprintf('<input type="hidden" name="%s" value="%s" />',$this->getTokenName(),$this->getTokenValue());
+    }
+
+    /**
+     * Returns url string that includes this token. you can use it for
+     * hyper link.
+     *
+     * @return  string
+     */
+    function getUrl()
+    {
+        return $this->getTokenName()."=".$this->getTokenValue();
+    }
+
+    /**
+     * If $token equals this token's string, true is returened.
+     *
+     * @return  bool
+    */
+    function validate($token=null)
+    {
+        return ($this->_token_==$token && ( $this->_unlimited_ || time()<=$this->_lifetime_));
+    }
+}
+
+/**
+ * This class express ticket agent and ticket collector. this publishes
+ * token, keeps a token to server to check it later(next request).
+ *
+ * You can create various agents by extending the derivative class. see
+ * default(sample) classes.
+ */
+class XoopsTokenHandler
+{
+    /**
+     * @access private
+     */
+    var $_prefix ="";
+
+
+    /**
+     * Create XoopsToken instance, regist(keep to server), and returns it.
+     *
+     * @access public
+     * @param   $name   this token's name string.
+     * @param   $timeout    effective time(if $timeout equal 0, this token will become unlimited)
+     */
+    function &create($name,$timeout = XOOPS_TOKEN_TIMEOUT)
+    {
+        $token =& new XoopsToken($name,$timeout);
+        $this->register($token);
+        return $token;
+    }
+
+    /**
+     * Fetches from server side, and returns it.
+     *
+     * @access public
+     * @param   $name   token's name string.
+     * @return XoopsToken
+     */
+    function &fetch($name)
+    {
+        $ret = null;
+        if(isset($_SESSION[XOOPS_TOKEN_SESSION_STRING][$this->_prefix.$name])) {
+            $ret =& $_SESSION[XOOPS_TOKEN_SESSION_STRING][$this->_prefix.$name];
+        }
+        return $ret;
+    }
+
+    /**
+     * Register token to session.
+     */
+    function register(&$token)
+    {
+        $_SESSION[XOOPS_TOKEN_SESSION_STRING][$this->_prefix.$token->_name_] = $token;
+    }
+
+    /**
+     * Unregister token to session.
+     */
+    function unregister(&$token)
+    {
+        unset($_SESSION[XOOPS_TOKEN_SESSION_STRING][$this->_prefix.$token->_name_]);
+    }
+
+    /**
+     * If a token of the name that equal $name is registered on session,
+     * this method will return true.
+     *
+     * @access  public
+     * @param   $name   token's name string.
+     * @return  bool
+     */
+    function isRegistered($name)
+    {
+        return isset($_SESSION[XOOPS_TOKEN_SESSION_STRING][$this->_prefix.$name]);
+    }
+
+    /**
+     * This method takes out token's string from Request, and validate
+     * token with it. if it passed validation, this method will return true.
+     *
+     * @access  public
+     * @param   $token  XoopsToken
+     * @param   $clearIfValid   If token passed validation, $token will be unregistered.
+     * @return  bool
+     */
+    function validate(&$token,$clearIfValid)
+    {
+        $req_token = isset($_REQUEST[ $token->getTokenName() ]) ?
+                trim($_REQUEST[ $token->getTokenName() ]) : null;
+
+        if($req_token) {
+            if($token->validate($req_token)) {
+                if($clearIfValid)
+                    $this->unregister($token);
+                return true;
+            }
+        }
+        return false;
+    }
+}
+
+class XoopsSingleTokenHandler extends XoopsTokenHandler
+{
+    function autoValidate($name,$clearIfValid=true)
+    {
+        if($token =& $this->fetch($name)) {
+            return $this->validate($token,$clearIfValid);
+        }
+        return false;
+    }
+
+    /**
+     * static method.
+     * This method was created for quick protection of default modules.
+     * this method will be deleted in the near future.
+     * @deprecated
+     * @return bool
+    */
+    function &quickCreate($name,$timeout = XOOPS_TOKEN_TIMEOUT)
+    {
+        $handler =& new XoopsSingleTokenHandler();
+        $ret =& $handler->create($name,$timeout);
+        return $ret;
+    }
+
+    /**
+     * static method.
+     * This method was created for quick protection of default modules.
+     * this method will be deleted in the near future.
+     * @deprecated
+     * @return bool
+    */
+    function quickValidate($name,$clearIfValid=true)
+    {
+        $handler = new XoopsSingleTokenHandler();
+        return $handler->autoValidate($name,$clearIfValid);
+    }
+}
+
+/**
+ * This class publish a token of the different same name of a serial number
+ * for the tab browser.
+ */
+class XoopsMultiTokenHandler extends XoopsTokenHandler
+{
+    function &create($name,$timeout=XOOPS_TOKEN_TIMEOUT)
+    {
+        $token =& new XoopsToken($name,$timeout);
+        $token->setSerialNumber($this->getUniqueSerial($name));
+        $this->register($token);
+        return $token;
+    }
+
+    function &fetch($name,$serial_number)
+    {
+        $ret = null;
+        if(isset($_SESSION[XOOPS_TOKEN_MULTI_SESSION_STRING][$this->_prefix.$name][$serial_number])) {
+            $ret =& $_SESSION[XOOPS_TOKEN_MULTI_SESSION_STRING][$this->_prefix.$name][$serial_number];
+        }
+        return $ret;
+    }
+
+    function register(&$token)
+    {
+        $_SESSION[XOOPS_TOKEN_MULTI_SESSION_STRING][$this->_prefix.$token->_name_][$token->getSerialNumber()] = $token;
+    }
+
+    function unregister(&$token)
+    {
+        unset($_SESSION[XOOPS_TOKEN_MULTI_SESSION_STRING][$this->_prefix.$token->_name_][$token->getSerialNumber()]);
+    }
+
+    function isRegistered($name,$serial_number)
+    {
+        return isset($_SESSION[XOOPS_TOKEN_MULTI_SESSION_STRING][$this->_prefix.$name][$serial_number]);
+    }
+
+    function autoValidate($name,$clearIfValid=true)
+    {
+        $serial_number = $this->getRequestNumber($name);
+        if($serial_number!==null) {
+            if($token =& $this->fetch($name,$serial_number)) {
+                return $this->validate($token,$clearIfValid);
+            }
+        }
+        return false;
+    }
+
+    /**
+     * static method.
+     * This method was created for quick protection of default modules.
+     * this method will be deleted in the near future.
+     * @deprecated
+     * @return bool
+    */
+    function &quickCreate($name,$timeout = XOOPS_TOKEN_TIMEOUT)
+    {
+        $handler =& new XoopsMultiTokenHandler();
+        $ret =& $handler->create($name,$timeout);
+        return $ret;
+    }
+
+    /**
+     * static method.
+     * This method was created for quick protection of default modules.
+     * this method will be deleted in the near future.
+     * @deprecated
+     * @return bool
+    */
+    function quickValidate($name,$clearIfValid=true)
+    {
+        $handler = new XoopsMultiTokenHandler();
+        return $handler->autoValidate($name,$clearIfValid);
+    }
+
+    /**
+     * @param   $name   string
+     * @return  int
+     */
+    function getRequestNumber($name)
+    {
+        $str = XOOPS_TOKEN_PREFIX.$name."_";
+        foreach($_REQUEST as $key=>$val) {
+            if(preg_match("/".$str."(\d+)/",$key,$match))
+                return intval($match[1]);
+        }
+
+        return null;
+    }
+
+    function getUniqueSerial($name)
+    {
+        if(isset($_SESSION[XOOPS_TOKEN_MULTI_SESSION_STRING][$name])) {
+            if(is_array($_SESSION[XOOPS_TOKEN_MULTI_SESSION_STRING][$name])) {
+                for($i=0;isset($_SESSION[XOOPS_TOKEN_MULTI_SESSION_STRING][$name][$i]);$i++);
+                return $i;
+            }
+        }
+
+        return 0;
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/images/subject/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/images/subject/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/images/subject/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/images/banners/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/images/banners/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/images/banners/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/images/index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/html/images/index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/images/index.html	(revision 405)
@@ -0,0 +1,1 @@
+ <script>history.go(-1);</script>
Index: /temp/test-xoops.ec-cube.net/html/image.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/image.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/image.php	(revision 405)
@@ -0,0 +1,66 @@
+<?php
+// $Id: image.php,v 1.4 2005/08/03 12:39:11 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+set_magic_quotes_runtime(0);
+if (function_exists('mb_http_output')) {
+    mb_http_output('pass');
+}
+$image_id = isset($_GET['id']) ? intval($_GET['id']) : 0;
+if (empty($image_id)) {
+    header('Content-type: image/gif');
+    readfile('./images/blank.gif');
+    exit();
+}
+$xoopsOption['nocommon'] = 1;
+include './mainfile.php';
+include XOOPS_ROOT_PATH.'/include/functions.php';
+include_once XOOPS_ROOT_PATH.'/class/logger.php';
+$xoopsLogger =& XoopsLogger::instance();
+$xoopsLogger->startTime();
+include_once XOOPS_ROOT_PATH.'/class/database/databasefactory.php';
+define('XOOPS_DB_PROXY', 1);
+$xoopsDB =& XoopsDatabaseFactory::getDatabaseConnection();
+// ################# Include class manager file ##############
+require_once XOOPS_ROOT_PATH.'/kernel/object.php';
+require_once XOOPS_ROOT_PATH.'/class/criteria.php';
+$imagehandler =& xoops_gethandler('image');
+$criteria = new CriteriaCompo(new Criteria('i.image_display', 1));
+$criteria->add(new Criteria('i.image_id', $image_id));
+$image =& $imagehandler->getObjects($criteria, false, true);
+if (count($image) > 0) {
+    header('Content-type: '.$image[0]->getVar('image_mimetype'));
+    header('Cache-control: max-age=31536000');
+    header('Expires: '.gmdate("D, d M Y H:i:s",time()+31536000).'GMT');
+    header('Content-disposition: filename='.$image[0]->getVar('image_name'));
+    header('Content-Length: '.strlen($image[0]->getVar('image_body')));
+    header('Last-Modified: '.gmdate("D, d M Y H:i:s",$image[0]->getVar('image_created')).'GMT');
+    echo $image[0]->getVar('image_body');
+} else {
+    header('Content-type: image/gif');
+    readfile('./images/blank.gif');
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/edituser.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/edituser.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/edituser.php	(revision 405)
@@ -0,0 +1,392 @@
+<?php
+// $Id: edituser.php,v 1.5 2006/05/01 02:37:26 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+$xoopsOption['pagetype'] = 'user';
+include 'mainfile.php';
+include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
+
+// If not a user, redirect
+if (!is_object($xoopsUser)) {
+    redirect_header('index.php',3,_US_NOEDITRIGHT);
+    exit();
+}
+
+// initialize $op variable
+$op = 'editprofile';
+if (!empty($_POST['op'])) {
+    $op = $_POST['op'];
+}
+if (!empty($_GET['op'])) {
+    $op = $_GET['op'];
+}
+
+$config_handler =& xoops_gethandler('config');
+$xoopsConfigUser =& $config_handler->getConfigsByCat(XOOPS_CONF_USER);
+
+if ($op == 'saveuser') {
+    if (!XoopsSingleTokenHandler::quickValidate('edituser')) {
+        redirect_header('index.php',3,_US_NOEDITRIGHT);
+        exit;
+    }
+    $uid = 0;
+    if (!empty($_POST['uid'])) {
+        $uid = intval($_POST['uid']);
+    }
+    if (empty($uid) || $xoopsUser->getVar('uid') != $uid) {
+        redirect_header('index.php',3,_US_NOEDITRIGHT);
+        exit();
+    }
+    $errors = array();
+    $myts =& MyTextSanitizer::getInstance();
+    if ($xoopsConfigUser['allow_chgmail'] == 1) {
+        $email = '';
+        if (!empty($_POST['email'])) {
+            $email = $myts->stripSlashesGPC(trim($_POST['email']));
+        }
+        if ($email == '' || !checkEmail($email)) {
+            $errors[] = _US_INVALIDMAIL;
+        }
+    }
+    $password = '';
+    if (!empty($_POST['password'])) {
+        $password = $myts->stripSlashesGPC(trim($_POST['password']));
+    }
+    if ($password != '') {
+        if (strlen($password) < $xoopsConfigUser['minpass']) {
+            $errors[] = sprintf(_US_PWDTOOSHORT,$xoopsConfigUser['minpass']);
+        }
+        $vpass = '';
+        if (!empty($_POST['vpass'])) {
+            $vpass = $myts->stripSlashesGPC(trim($_POST['vpass']));
+        }
+        if ($password != $vpass) {
+            $errors[] = _US_PASSNOTSAME;
+        }
+    }
+    if (count($errors) > 0) {
+        include XOOPS_ROOT_PATH.'/header.php';
+        echo '<div>';
+        foreach ($errors as $er) {
+            echo '<span style="color: #ff0000; font-weight: bold;">'.$er.'</span><br />';
+        }
+        echo '</div><br />';
+        $op = 'editprofile';
+    } else {
+        $member_handler =& xoops_gethandler('member');
+        $edituser =& $member_handler->getUser($uid);
+        $edituser->setVar('name', $_POST['name']);
+        if ($xoopsConfigUser['allow_chgmail'] == 1) {
+            $edituser->setVar('email', $email, true);
+        }
+        $edituser->setVar('url', formatURL($_POST['url']));
+        $edituser->setVar('user_icq', $_POST['user_icq']);
+        $edituser->setVar('user_from', $_POST['user_from']);
+        $edituser->setVar('user_sig', xoops_substr($_POST['user_sig'], 0, 255));
+        $user_viewemail = (!empty($_POST['user_viewemail'])) ? 1 : 0;
+        $edituser->setVar('user_viewemail', $user_viewemail);
+        $edituser->setVar('user_aim', $_POST['user_aim']);
+        $edituser->setVar('user_yim', $_POST['user_yim']);
+        $edituser->setVar('user_msnm', $_POST['user_msnm']);
+        if ($password != '') {
+            $edituser->setVar('pass', md5($password), true);
+        }
+        $attachsig = !empty($_POST['attachsig']) ? 1 : 0;
+        $edituser->setVar('attachsig', $attachsig);
+        //$edituser->setVar('timezone_offset', $_POST['timezone_offset']);
+        $edituser->setVar('uorder', $_POST['uorder']);
+        $edituser->setVar('umode', $_POST['umode']);
+        $edituser->setVar('notify_method', $_POST['notify_method']);
+        $edituser->setVar('notify_mode', $_POST['notify_mode']);
+        $edituser->setVar('bio', xoops_substr($_POST['bio'], 0, 255));
+        $edituser->setVar('user_occ', $_POST['user_occ']);
+        $edituser->setVar('user_intrest', $_POST['user_intrest']);
+        $edituser->setVar('user_mailok', $_POST['user_mailok']);
+        if (!empty($_POST['usecookie'])) {
+            setcookie($xoopsConfig['usercookie'], $xoopsUser->getVar('uname'), time()+ 31536000);
+        } else {
+            setcookie($xoopsConfig['usercookie']);
+        }
+        if (!$member_handler->insertUser($edituser)) {
+            include XOOPS_ROOT_PATH.'/header.php';
+            echo $edituser->getHtmlErrors();
+            include XOOPS_ROOT_PATH.'/footer.php';
+        } else {
+            redirect_header('userinfo.php?uid='.$uid, 1, _US_PROFUPDATED);
+        }
+        exit();
+    }
+}
+
+
+if ($op == 'editprofile') {
+    include_once XOOPS_ROOT_PATH.'/header.php';
+    include_once XOOPS_ROOT_PATH.'/include/comment_constants.php';
+    echo '<a href="userinfo.php?uid='.$xoopsUser->getVar('uid').'">'. _US_PROFILE .'</a>&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;'. _US_EDITPROFILE .'<br /><br />';
+    $form = new XoopsThemeForm(_US_EDITPROFILE, 'userinfo', 'edituser.php');
+    $uname_label = new XoopsFormLabel(_US_NICKNAME, $xoopsUser->getVar('uname'));
+    $form->addElement($uname_label);
+    $name_text = new XoopsFormText(_US_REALNAME, 'name', 30, 60, $xoopsUser->getVar('name', 'E'));
+    $form->addElement($name_text);
+    $email_tray = new XoopsFormElementTray(_US_EMAIL, '<br />');
+    if ($xoopsConfigUser['allow_chgmail'] == 1) {
+        $email_text = new XoopsFormText('', 'email', 30, 60, $xoopsUser->getVar('email'));
+    } else {
+        $email_text = new XoopsFormLabel('', $xoopsUser->getVar('email'));
+    }
+    $email_tray->addElement($email_text);
+    $email_cbox_value = $xoopsUser->user_viewemail() ? 1 : 0;
+    $email_cbox = new XoopsFormCheckBox('', 'user_viewemail', $email_cbox_value);
+    $email_cbox->addOption(1, _US_ALLOWVIEWEMAIL);
+    $email_tray->addElement($email_cbox);
+    $form->addElement($email_tray);
+    $url_text = new XoopsFormText(_US_WEBSITE, 'url', 30, 100, $xoopsUser->getVar('url', 'E'));
+    $form->addElement($url_text);
+
+    //$timezone_select = new XoopsFormSelectTimezone(_US_TIMEZONE, 'timezone_offset', $xoopsUser->getVar('timezone_offset'));
+    $icq_text = new XoopsFormText(_US_ICQ, 'user_icq', 15, 15, $xoopsUser->getVar('user_icq', 'E'));
+    $aim_text = new XoopsFormText(_US_AIM, 'user_aim', 18, 18, $xoopsUser->getVar('user_aim', 'E'));
+    $yim_text = new XoopsFormText(_US_YIM, 'user_yim', 25, 25, $xoopsUser->getVar('user_yim', 'E'));
+    $msnm_text = new XoopsFormText(_US_MSNM, 'user_msnm', 30, 100, $xoopsUser->getVar('user_msnm', 'E'));
+    $location_text = new XoopsFormText(_US_LOCATION, 'user_from', 30, 100, $xoopsUser->getVar('user_from', 'E'));
+    $occupation_text = new XoopsFormText(_US_OCCUPATION, 'user_occ', 30, 100, $xoopsUser->getVar('user_occ', 'E'));
+    $interest_text = new XoopsFormText(_US_INTEREST, 'user_intrest', 30, 150, $xoopsUser->getVar('user_intrest', 'E'));
+    $sig_tray = new XoopsFormElementTray(_US_SIGNATURE, '<br />');
+    include_once 'include/xoopscodes.php';
+    $sig_tarea = new XoopsFormDhtmlTextArea('', 'user_sig', $xoopsUser->getVar('user_sig', 'E'));
+    $sig_tray->addElement($sig_tarea);
+    $sig_cbox_value = $xoopsUser->getVar('attachsig') ? 1 : 0;
+    $sig_cbox = new XoopsFormCheckBox('', 'attachsig', $sig_cbox_value);
+    $sig_cbox->addOption(1, _US_SHOWSIG);
+    $sig_tray->addElement($sig_cbox);
+    $umode_select = new XoopsFormSelect(_US_CDISPLAYMODE, 'umode', $xoopsUser->getVar('umode'));
+    $umode_select->addOptionArray(array('nest'=>_NESTED, 'flat'=>_FLAT, 'thread'=>_THREADED));
+    $uorder_select = new XoopsFormSelect(_US_CSORTORDER, 'uorder', $xoopsUser->getVar('uorder'));
+    $uorder_select->addOptionArray(array(XOOPS_COMMENT_OLD1ST => _OLDESTFIRST, XOOPS_COMMENT_NEW1ST => _NEWESTFIRST));
+    // RMV-NOTIFY
+    // TODO: add this to admin user-edit functions...
+    include_once XOOPS_ROOT_PATH . "/language/" . $xoopsConfig['language'] . '/notification.php';
+    include_once XOOPS_ROOT_PATH . '/include/notification_constants.php';
+    $notify_method_select = new XoopsFormSelect(_NOT_NOTIFYMETHOD, 'notify_method', $xoopsUser->getVar('notify_method'));
+    $notify_method_select->addOptionArray(array(XOOPS_NOTIFICATION_METHOD_DISABLE=>_NOT_METHOD_DISABLE, XOOPS_NOTIFICATION_METHOD_PM=>_NOT_METHOD_PM, XOOPS_NOTIFICATION_METHOD_EMAIL=>_NOT_METHOD_EMAIL));
+    $notify_mode_select = new XoopsFormSelect(_NOT_NOTIFYMODE, 'notify_mode', $xoopsUser->getVar('notify_mode'));
+    $notify_mode_select->addOptionArray(array(XOOPS_NOTIFICATION_MODE_SENDALWAYS=>_NOT_MODE_SENDALWAYS, XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE=>_NOT_MODE_SENDONCE, XOOPS_NOTIFICATION_MODE_SENDONCETHENWAIT=>_NOT_MODE_SENDONCEPERLOGIN));
+    $bio_tarea = new XoopsFormTextArea(_US_EXTRAINFO, 'bio', $xoopsUser->getVar('bio', 'E'));
+    $cookie_radio_value = empty($_COOKIE[$xoopsConfig['usercookie']]) ? 0 : 1;
+    $cookie_radio = new XoopsFormRadioYN(_US_USECOOKIE, 'usecookie', $cookie_radio_value, _YES, _NO);
+    $pwd_text = new XoopsFormPassword('', 'password', 10, 32);
+    $pwd_text2 = new XoopsFormPassword('', 'vpass', 10, 32);
+    $pwd_tray = new XoopsFormElementTray(_US_PASSWORD.'<br />'._US_TYPEPASSTWICE);
+    $pwd_tray->addElement($pwd_text);
+    $pwd_tray->addElement($pwd_text2);
+    $mailok_radio = new XoopsFormRadioYN(_US_MAILOK, 'user_mailok', $xoopsUser->getVar('user_mailok'));
+    $uid_hidden = new XoopsFormHidden('uid', $xoopsUser->getVar('uid'));
+    $op_hidden = new XoopsFormHidden('op', 'saveuser');
+    $token_hidden = new XoopsFormToken(XoopsSingleTokenHandler::quickCreate('edituser'));
+    $submit_button = new XoopsFormButton('', 'submit', _US_SAVECHANGES, 'submit');
+
+    $form->addElement($timezone_select);
+    $form->addElement($icq_text);
+    $form->addElement($aim_text);
+    $form->addElement($yim_text);
+    $form->addElement($msnm_text);
+    $form->addElement($location_text);
+    $form->addElement($occupation_text);
+    $form->addElement($interest_text);
+    $form->addElement($sig_tray);
+    $form->addElement($umode_select);
+    $form->addElement($uorder_select);
+    $form->addElement($notify_method_select);
+    $form->addElement($notify_mode_select);
+    $form->addElement($bio_tarea);
+    $form->addElement($pwd_tray);
+    $form->addElement($cookie_radio);
+    $form->addElement($mailok_radio);
+    $form->addElement($uid_hidden);
+    $form->addElement($op_hidden);
+    $form->addElement($token_hidden);
+    $form->addElement($submit_button);
+    if ($xoopsConfigUser['allow_chgmail'] == 1) {
+        $form->setRequired($email_text);
+    }
+    $form->display();
+    include XOOPS_ROOT_PATH.'/footer.php';
+}
+
+
+if ($op == 'avatarform') {
+    include XOOPS_ROOT_PATH.'/header.php';
+    echo '<a href="userinfo.php?uid='.$xoopsUser->getVar('uid').'">'. _US_PROFILE .'</a>&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;'. _US_UPLOADMYAVATAR .'<br /><br />';
+    $oldavatar = $xoopsUser->getVar('user_avatar');
+    if (!empty($oldavatar) && $oldavatar != 'blank.gif') {
+        echo '<div style="text-align:center;"><h4 style="color:#ff0000; font-weight:bold;">'._US_OLDDELETED.'</h4>';
+        echo '<img src="'.XOOPS_UPLOAD_URL.'/'.$oldavatar.'" alt="" /></div>';
+    }
+    if ($xoopsConfigUser['avatar_allow_upload'] == 1 && $xoopsUser->getVar('posts') >= $xoopsConfigUser['avatar_minposts']) {
+        include_once 'class/xoopsformloader.php';
+        $form = new XoopsThemeForm(_US_UPLOADMYAVATAR, 'uploadavatar', 'edituser.php');
+        $form->setExtra('enctype="multipart/form-data"');
+        $form->addElement(new XoopsFormLabel(_US_MAXPIXEL, $xoopsConfigUser['avatar_width'].' x '.$xoopsConfigUser['avatar_height']));
+        $form->addElement(new XoopsFormLabel(_US_MAXIMGSZ, $xoopsConfigUser['avatar_maxsize']));
+        $form->addElement(new XoopsFormFile(_US_SELFILE, 'avatarfile', $xoopsConfigUser['avatar_maxsize']), true);
+        $form->addElement(new XoopsFormHidden('op', 'avatarupload'));
+        $form->addElement(new XoopsFormToken(XoopsSingleTokenHandler::quickCreate('avatarupload')));
+        $form->addElement(new XoopsFormHidden('uid', $xoopsUser->getVar('uid')));
+        $form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
+            $form->display();
+    }
+    $avatar_handler =& xoops_gethandler('avatar');
+    $form2 = new XoopsThemeForm(_US_CHOOSEAVT, 'uploadavatar', 'edituser.php');
+    $avatar_select = new XoopsFormSelect('', 'user_avatar', $xoopsUser->getVar('user_avatar'));
+    $avatar_select->addOptionArray($avatar_handler->getList('S'));
+    $avatar_select->setExtra("onchange='showImgSelected(\"avatar\", \"user_avatar\", \"uploads\", \"\", \"".XOOPS_URL."\")'");
+    $avatar_tray = new XoopsFormElementTray(_US_AVATAR, '&nbsp;');
+    $avatar_tray->addElement($avatar_select);
+    $avatar_tray->addElement(new XoopsFormLabel('', "<img src='".XOOPS_UPLOAD_URL."/".$xoopsUser->getVar("user_avatar", "E")."' name='avatar' id='avatar' alt='' /> <a href=\"javascript:openWithSelfMain('".XOOPS_URL."/misc.php?action=showpopups&amp;type=avatars','avatars',600,400);\">"._LIST."</a>"));
+    $form2->addElement($avatar_tray);
+    $form2->addElement(new XoopsFormHidden('uid', $xoopsUser->getVar('uid')));
+    $form2->addElement(new XoopsFormHidden('op', 'avatarchoose'));
+    $form2->addElement(new XoopsFormToken(XoopsSingleTokenHandler::quickCreate('avatarchoose')));
+    $form2->addElement(new XoopsFormButton('', 'submit2', _SUBMIT, 'submit'));
+    $form2->display();
+    include XOOPS_ROOT_PATH.'/footer.php';
+}
+
+if ($op == 'avatarupload') {
+    if (!XoopsSingleTokenHandler::quickValidate('avatarupload')) {
+        redirect_header('index.php',3,_US_NOEDITRIGHT);
+        exit;
+    }
+    $xoops_upload_file = array();
+    $uid = 0;
+    if (!empty($_POST['xoops_upload_file']) && is_array($_POST['xoops_upload_file'])){
+        $xoops_upload_file = $_POST['xoops_upload_file'];
+    }
+    if (!empty($_POST['uid'])) {
+        $uid = intval($_POST['uid']);
+    }
+    if (empty($uid) || $xoopsUser->getVar('uid') != $uid ) {
+        redirect_header('index.php',3,_US_NOEDITRIGHT);
+        exit();
+    }
+    if ($xoopsConfigUser['avatar_allow_upload'] == 1 && $xoopsUser->getVar('posts') >= $xoopsConfigUser['avatar_minposts']) {
+        include_once XOOPS_ROOT_PATH.'/class/uploader.php';
+        $uploader = new XoopsMediaUploader(XOOPS_UPLOAD_PATH, array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/x-png', 'image/png'), $xoopsConfigUser['avatar_maxsize'], $xoopsConfigUser['avatar_width'], $xoopsConfigUser['avatar_height']);
+        $uploader->setAllowedExtensions(array('gif', 'jpeg', 'jpg', 'png'));
+        if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
+            $uploader->setPrefix('cavt');
+            if ($uploader->upload()) {
+                $avt_handler =& xoops_gethandler('avatar');
+                $avatar =& $avt_handler->create();
+                $avatar->setVar('avatar_file', $uploader->getSavedFileName());
+                $avatar->setVar('avatar_name', $xoopsUser->getVar('uname'));
+                $avatar->setVar('avatar_mimetype', $uploader->getMediaType());
+                $avatar->setVar('avatar_display', 1);
+                $avatar->setVar('avatar_type', 'C');
+                if (!$avt_handler->insert($avatar)) {
+                    @unlink($uploader->getSavedDestination());
+                } else {
+                    $oldavatar = $xoopsUser->getVar('user_avatar');
+                    if (!empty($oldavatar) && $oldavatar != 'blank.gif' && !preg_match("/^savt/", strtolower($oldavatar))) {
+                        $avatars =& $avt_handler->getObjects(new Criteria('avatar_file', $oldavatar));
+                        $avt_handler->delete($avatars[0]);
+                        $oldavatar_path = str_replace("\\", "/", realpath(XOOPS_UPLOAD_PATH.'/'.$oldavatar));
+                        if (0 === strpos($oldavatar_path, XOOPS_UPLOAD_PATH) && is_file($oldavatar_path)) {
+                            unlink($oldavatar_path);
+                        }
+                    }
+                    $sql = sprintf("UPDATE %s SET user_avatar = %s WHERE uid = %u", $xoopsDB->prefix('users'), $xoopsDB->quoteString($uploader->getSavedFileName()), $xoopsUser->getVar('uid'));
+                    $xoopsDB->query($sql);
+                    $avt_handler->addUser($avatar->getVar('avatar_id'), $xoopsUser->getVar('uid'));
+                    redirect_header('userinfo.php?t='.time().'&amp;uid='.$xoopsUser->getVar('uid'),0, _US_PROFUPDATED);
+                }
+            }
+        }
+        include XOOPS_ROOT_PATH.'/header.php';
+        echo $uploader->getErrors();
+        include XOOPS_ROOT_PATH.'/footer.php';
+    }
+}
+
+if ($op == 'avatarchoose') {
+    if (!XoopsSingleTokenHandler::quickValidate('avatarchoose')) {
+        redirect_header('index.php',3,_US_NOEDITRIGHT);
+        exit;
+    }
+    $uid = 0;
+    if (!empty($_POST['uid'])) {
+        $uid = intval($_POST['uid']);
+    }
+    if (empty($uid) || $xoopsUser->getVar('uid') != $uid ) {
+        redirect_header('index.php', 3, _US_NOEDITRIGHT);
+        exit();
+    }
+    $avt_handler =& xoops_gethandler('avatar');
+    $user_avatar = 'blank.gif';
+    $user_avatar_object = false;
+    $myts =& MyTextSanitizer::getInstance();
+    if ($user_avatar_req = trim($myts->stripSlashesGPC($_POST['user_avatar']))) {
+        // allow system avatar selection only
+        if (preg_match("/^savt/", $user_avatar_req)) {
+            $criteria =& new CriteriaCompo(new Criteria('avatar_file', addslashes($user_avatar_req)));
+            $criteria->add(new Criteria('avatar_type', 'S'));
+            if ($avatars = $avt_handler->getObjects($criteria)) {
+                if (is_object($avatars[0])) {
+                    $user_avatar = $avatars[0]->getVar('avatar_file');
+                    $user_avatar_object =& $avatars[0];
+                }
+            }
+        }
+    }
+    $user_avatarpath = str_replace("\\", "/", realpath(XOOPS_UPLOAD_PATH.'/'.$user_avatar));
+    if (0 === strpos($user_avatarpath, XOOPS_UPLOAD_PATH) && is_file($user_avatarpath)) {
+        $oldavatar = $xoopsUser->getVar('user_avatar');
+        $xoopsUser->setVar('user_avatar', $user_avatar);
+        $member_handler =& xoops_gethandler('member');
+        if (!$member_handler->insertUser($xoopsUser)) {
+            include XOOPS_ROOT_PATH.'/header.php';
+            echo $xoopsUser->getHtmlErrors();
+            include XOOPS_ROOT_PATH.'/footer.php';
+            exit();
+        }
+        if ($oldavatar && $oldavatar != 'blank.gif' && preg_match("/^cavt/", strtolower($oldavatar))) {
+            $criteria =& new CriteriaCompo(new Criteria('avatar_file', addslashes($oldavatar)));
+            $criteria->add(new Criteria('avatar_type', 'C'));
+            $avatars =& $avt_handler->getObjects($criteria);
+            if (is_object($avatars[0])) {
+                $avt_handler->delete($avatars[0]);
+            }
+            $oldavatar_path = str_replace("\\", "/", realpath(XOOPS_UPLOAD_PATH.'/'.$oldavatar));
+            if (0 === strpos($oldavatar_path, XOOPS_UPLOAD_PATH) && is_file($oldavatar_path)) {
+                unlink($oldavatar_path);
+            }
+        }
+        if (is_object($user_avatar_object)) {
+            $avt_handler->addUser($user_avatar_object->getVar('avatar_id'), $xoopsUser->getVar('uid'));
+        }
+    }
+    redirect_header('userinfo.php?uid='.$uid, 0, _US_PROFUPDATED);
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/backend.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/backend.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/backend.php	(revision 405)
@@ -0,0 +1,71 @@
+<?php
+// $Id: backend.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+include 'mainfile.php';
+include_once XOOPS_ROOT_PATH.'/class/template.php';
+include_once XOOPS_ROOT_PATH.'/modules/news/class/class.newsstory.php';
+if (function_exists('mb_http_output')) {
+	mb_http_output('pass');
+}
+header ('Content-Type:text/xml; charset=utf-8');
+$tpl = new XoopsTpl();
+$tpl->xoops_setCaching(2);
+$tpl->xoops_setCacheTime(3600);
+if (!$tpl->is_cached('db:system_rss.html')) {
+	$sarray = NewsStory::getAllPublished(10, 0);
+	if (is_array($sarray)) {
+		$tpl->assign('channel_title', xoops_utf8_encode(htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES)));
+		$tpl->assign('channel_link', XOOPS_URL.'/');
+		$tpl->assign('channel_desc', xoops_utf8_encode(htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES)));
+		$tpl->assign('channel_lastbuild', formatTimestamp(time(), 'rss'));
+		$tpl->assign('channel_webmaster', $xoopsConfig['adminmail']);
+		$tpl->assign('channel_editor', $xoopsConfig['adminmail']);
+		$tpl->assign('channel_category', 'News');
+		$tpl->assign('channel_generator', 'XOOPS');
+		$tpl->assign('channel_language', _LANGCODE);
+		$tpl->assign('image_url', XOOPS_URL.'/images/logo.gif');
+		$dimention = getimagesize(XOOPS_ROOT_PATH.'/images/logo.gif');
+		if (empty($dimention[0])) {
+			$width = 88;
+		} else {
+			$width = ($dimention[0] > 144) ? 144 : $dimention[0];
+		}
+		if (empty($dimention[1])) {
+			$height = 31;
+		} else {
+			$height = ($dimention[1] > 400) ? 400 : $dimention[1];
+		}
+		$tpl->assign('image_width', $width);
+		$tpl->assign('image_height', $height);
+		$count = $sarray;
+		foreach ($sarray as $story) {
+			$tpl->append('items', array('title' => xoops_utf8_encode(htmlspecialchars($story->title(), ENT_QUOTES)), 'link' => XOOPS_URL.'/modules/news/article.php?storyid='.$story->storyid(), 'guid' => XOOPS_URL.'/modules/news/article.php?storyid='.$story->storyid(), 'pubdate' => formatTimestamp($story->published(), 'rss'), 'description' => xoops_utf8_encode(htmlspecialchars($story->hometext(), ENT_QUOTES))));
+		}
+	}
+}
+$tpl->display('db:system_rss.html');
+?>
Index: /temp/test-xoops.ec-cube.net/html/header.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/header.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/header.php	(revision 405)
@@ -0,0 +1,272 @@
+<?php
+// $Id: header.php,v 1.7 2006/07/27 00:17:17 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+if (!defined('XOOPS_ROOT_PATH')) {
+    exit();
+}
+include_once XOOPS_ROOT_PATH.'/class/xoopsblock.php';
+if ($xoopsConfig['theme_set'] != 'default' && file_exists(XOOPS_THEME_PATH.'/'.$xoopsConfig['theme_set'].'/theme.php')) {
+    //
+    // Fall back on simple protector of common.php by checking the constant that
+    // is defined in common.php
+    //
+    if (!defined("XOOPS_CACHE_PATH")) {
+        die();
+    }
+
+    // the old way..
+    $xoopsOption['theme_use_smarty'] = 0;
+    if (file_exists(XOOPS_THEME_PATH.'/'.$xoopsConfig['theme_set'].'/language/lang-'.$xoopsConfig['language'].'.php')) {
+        include XOOPS_THEME_PATH.'/'.$xoopsConfig['theme_set'].'/language/lang-'.$xoopsConfig['language'].'.php';
+    } elseif (file_exists(XOOPS_THEME_PATH.'/'.$xoopsConfig['theme_set'].'/language/lang-english.php')) {
+        include XOOPS_THEME_PATH.'/'.$xoopsConfig['theme_set'].'/language/lang-english.php';
+    }
+    $config_handler =& xoops_gethandler('config');
+    $xoopsConfigMetaFooter =& $config_handler->getConfigsByCat(XOOPS_CONF_METAFOOTER);
+    xoops_header(false);
+    include XOOPS_THEME_PATH.'/'.$xoopsConfig['theme_set'].'/theme.php';
+    $xoopsOption['show_rblock'] = (!empty($xoopsOption['show_rblock'])) ? $xoopsOption['show_rblock'] : 0;
+    // include Smarty template engine and initialize it
+    require_once XOOPS_ROOT_PATH.'/class/template.php';
+    $xoopsTpl = new XoopsTpl();
+    if ($xoopsConfig['debug_mode'] == 3) {
+        $xoopsTpl->xoops_setDebugging(true);
+    }
+    if ($xoopsUser != '') {
+        $xoopsTpl->assign(array('xoops_isuser' => true, 'xoops_userid' => $xoopsUser->getVar('uid'), 'xoops_uname' => $xoopsUser->getVar('uname'), 'xoops_isadmin' => $xoopsUserIsAdmin));
+    }
+    $xoopsTpl->assign('xoops_requesturi', htmlspecialchars($GLOBALS['xoopsRequestUri'], ENT_QUOTES));
+    include XOOPS_ROOT_PATH.'/include/old_functions.php';
+
+    if ($xoopsOption['show_cblock'] || (!empty($xoopsModule) && preg_match("/index\.php$/i", xoops_getenv('PHP_SELF')) && $xoopsConfig['startpage'] == $xoopsModule->getVar('dirname'))) {
+        $xoopsOption['show_rblock'] = $xoopsOption['show_cblock'] = 1;
+    }
+    themeheader($xoopsOption['show_rblock']);
+    if ($xoopsOption['show_cblock']) make_cblock();  //create center block
+} else {
+    $xoopsOption['theme_use_smarty'] = 1;
+    // include Smarty template engine and initialize it
+    require_once XOOPS_ROOT_PATH.'/class/template.php';
+    $xoopsTpl = new XoopsTpl();
+    $xoopsTpl->xoops_setCaching(2);
+    if ($xoopsConfig['debug_mode'] == 3) {
+        $xoopsTpl->xoops_setDebugging(true);
+    }
+    $xoopsTpl->assign(array('xoops_theme' => $xoopsConfig['theme_set'], 'xoops_imageurl' => XOOPS_THEME_URL.'/'.$xoopsConfig['theme_set'].'/', 'xoops_themecss'=> xoops_getcss($xoopsConfig['theme_set']), 'xoops_requesturi' => htmlspecialchars($GLOBALS['xoopsRequestUri'], ENT_QUOTES), 'xoops_sitename' => htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES), 'xoops_slogan' => htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES)));
+    // Meta tags
+    $config_handler =& xoops_gethandler('config');
+    $criteria = new CriteriaCompo(new Criteria('conf_modid', 0));
+    $criteria->add(new Criteria('conf_catid', XOOPS_CONF_METAFOOTER));
+    $config =& $config_handler->getConfigs($criteria, true);
+    foreach (array_keys($config) as $i) {
+        // prefix each tag with 'xoops_'
+        $xoopsTpl->assign('xoops_'.$config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput());
+    }
+    //unset($config);
+    // show banner?
+    if ($xoopsConfig['banners'] == 1) {
+        $xoopsTpl->assign('xoops_banner', xoops_getbanner());
+    } else {
+        $xoopsTpl->assign('xoops_banner', '&nbsp;');
+    }
+    // Weird, but need extra <script> tags for 2.0.x themes
+    $xoopsTpl->assign('xoops_js', '//--></script><script type="text/javascript" src="'.XOOPS_URL.'/include/xoops.js"></script><script type="text/javascript"><!--');
+    // get all blocks and assign to smarty
+    $xoopsblock = new XoopsBlock();
+    $block_arr = array();
+    if (is_object($xoopsUser)) {
+        $xoopsTpl->assign(array('xoops_isuser' => true, 'xoops_userid' => $xoopsUser->getVar('uid'), 'xoops_uname' => $xoopsUser->getVar('uname'), 'xoops_isadmin' => $xoopsUserIsAdmin));
+        if (!empty($xoopsModule)) {
+            // set page title
+            $xoopsTpl->assign(array('xoops_pagetitle' => $xoopsModule->getVar('name'), 'xoops_modulename' => $xoopsModule->getVar('name'), 'xoops_dirname' => $xoopsModule->getVar('dirname')));
+            if (preg_match("/index\.php$/i", xoops_getenv('PHP_SELF')) && $xoopsConfig['startpage'] == $xoopsModule->getVar('dirname')) {
+                $block_arr =& $xoopsblock->getAllByGroupModule($xoopsUser->getGroups(), $xoopsModule->getVar('mid'), true, XOOPS_BLOCK_VISIBLE);
+            } else {
+                $block_arr =& $xoopsblock->getAllByGroupModule($xoopsUser->getGroups(), $xoopsModule->getVar('mid'), false, XOOPS_BLOCK_VISIBLE);
+            }
+        } else {
+            $xoopsTpl->assign('xoops_pagetitle', htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES));
+            if (!empty($xoopsOption['show_cblock'])) {
+                $block_arr =& $xoopsblock->getAllByGroupModule($xoopsUser->getGroups(), 0, true, XOOPS_BLOCK_VISIBLE);
+            } else {
+                $block_arr =& $xoopsblock->getAllByGroupModule($xoopsUser->getGroups(), 0, false, XOOPS_BLOCK_VISIBLE);
+            }
+        }
+    } else {
+        $xoopsTpl->assign(array('xoops_isuser' => false, 'xoops_isadmin' => false));
+        if (!empty($xoopsModule)) {
+            // set page title
+            $xoopsTpl->assign(array('xoops_pagetitle' => $xoopsModule->getVar('name'), 'xoops_modulename' => $xoopsModule->getVar('name'), 'xoops_dirname' => $xoopsModule->getVar('dirname')));
+            if (preg_match("/index\.php$/i", xoops_getenv('PHP_SELF')) && $xoopsConfig['startpage'] == $xoopsModule->getVar('dirname')) {
+                $block_arr =& $xoopsblock->getAllByGroupModule(XOOPS_GROUP_ANONYMOUS, $xoopsModule->getVar('mid'), true, XOOPS_BLOCK_VISIBLE);
+            } else {
+                $block_arr =& $xoopsblock->getAllByGroupModule(XOOPS_GROUP_ANONYMOUS, $xoopsModule->getVar('mid'), false, XOOPS_BLOCK_VISIBLE);
+            }
+        } else {
+            $xoopsTpl->assign('xoops_pagetitle', htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES));
+            if (!empty($xoopsOption['show_cblock'])) {
+                $block_arr =& $xoopsblock->getAllByGroupModule(XOOPS_GROUP_ANONYMOUS, 0, true, XOOPS_BLOCK_VISIBLE);
+            } else {
+                $block_arr =& $xoopsblock->getAllByGroupModule(XOOPS_GROUP_ANONYMOUS, 0, false, XOOPS_BLOCK_VISIBLE);
+            }
+        }
+    }
+    foreach (array_keys($block_arr) as $i) {
+        $bcachetime = $block_arr[$i]->getVar('bcachetime');
+        if (empty($bcachetime)) {
+            $xoopsTpl->xoops_setCaching(0);
+        } else {
+            $xoopsTpl->xoops_setCaching(2);
+            $xoopsTpl->xoops_setCacheTime($bcachetime);
+        }
+        $btpl = $block_arr[$i]->getVar('template');
+        if ($btpl != '') {
+            if (empty($bcachetime) || !$xoopsTpl->is_cached('db:'.$btpl, 'blk_'.$block_arr[$i]->getVar('bid'))) {
+                $xoopsLogger->addBlock($block_arr[$i]->getVar('name'));
+                $bresult =& $block_arr[$i]->buildBlock();
+                if (!$bresult) {
+                    continue;
+                }
+                $xoopsTpl->assign_by_ref('block', $bresult);
+                $bcontent = $xoopsTpl->fetch('db:'.$btpl, 'blk_'.$block_arr[$i]->getVar('bid'));
+                $xoopsTpl->clear_assign('block');
+            } else {
+                $xoopsLogger->addBlock($block_arr[$i]->getVar('name'), true, $bcachetime);
+                $bcontent = $xoopsTpl->fetch('db:'.$btpl, 'blk_'.$block_arr[$i]->getVar('bid'));
+            }
+        } else {
+            $bid = $block_arr[$i]->getVar('bid');
+            if (empty($bcachetime) || !$xoopsTpl->is_cached('db:system_dummy.html', 'blk_'.$bid)) {
+                $xoopsLogger->addBlock($block_arr[$i]->getVar('name'));
+                $bresult =& $block_arr[$i]->buildBlock();
+                if (!$bresult) {
+                    continue;
+                }
+                $xoopsTpl->assign_by_ref('dummy_content', $bresult['content']);
+                $bcontent = $xoopsTpl->fetch('db:system_dummy.html', 'blk_'.$bid);
+                $xoopsTpl->clear_assign('block');
+            } else {
+                $xoopsLogger->addBlock($block_arr[$i]->getVar('name'), true, $bcachetime);
+                $bcontent = $xoopsTpl->fetch('db:system_dummy.html', 'blk_'.$bid);
+            }
+        }
+        switch ($block_arr[$i]->getVar('side')) {
+        case XOOPS_SIDEBLOCK_LEFT:
+            if (!isset($show_lblock)) {
+                $xoopsTpl->assign('xoops_showlblock', 1);
+                $show_lblock = 1;
+            }
+            $xoopsTpl->append('xoops_lblocks', array('title' => $block_arr[$i]->getVar('title'), 'content' => $bcontent, 'weight' => $block_arr[$i]->getVar('weight')));
+            break;
+        case XOOPS_CENTERBLOCK_LEFT:
+            if (!isset($show_cblock)) {
+                $xoopsTpl->assign('xoops_showcblock', 1);
+                $show_cblock = 1;
+            }
+            $xoopsTpl->append('xoops_clblocks', array('title' => $block_arr[$i]->getVar('title'), 'content' => $bcontent, 'weight' => $block_arr[$i]->getVar('weight')));
+            break;
+        case XOOPS_CENTERBLOCK_RIGHT:
+            if (!isset($show_cblock)) {
+                $xoopsTpl->assign('xoops_showcblock', 1);
+                $show_cblock = 1;
+            }
+            $xoopsTpl->append('xoops_crblocks', array('title' => $block_arr[$i]->getVar('title'), 'content' => $bcontent, 'weight' => $block_arr[$i]->getVar('weight')));
+            break;
+        case XOOPS_CENTERBLOCK_CENTER:
+            if (!isset($show_cblock)) {
+                $xoopsTpl->assign('xoops_showcblock', 1);
+                $show_cblock = 1;
+            }
+            $xoopsTpl->append('xoops_ccblocks', array('title' => $block_arr[$i]->getVar('title'), 'content' => $bcontent, 'weight' => $block_arr[$i]->getVar('weight')));
+            break;
+        case XOOPS_SIDEBLOCK_RIGHT:
+            if (!isset($show_rblock)) {
+                $xoopsTpl->assign('xoops_showrblock', 1);
+                $show_rblock = 1;
+            }
+            $xoopsTpl->append('xoops_rblocks', array('title' => $block_arr[$i]->getVar('title'), 'content' => $bcontent, 'weight' => $block_arr[$i]->getVar('weight')));
+            break;
+        }
+        unset($bcontent);
+    }
+    //unset($block_arr);
+    if (!isset($show_lblock)) {
+        $xoopsTpl->assign('xoops_showlblock', 0);
+    }
+    if (!isset($show_rblock)) {
+        $xoopsTpl->assign('xoops_showrblock', 0);
+    }
+    if (!isset($show_cblock)) {
+        $xoopsTpl->assign('xoops_showcblock', 0);
+    }
+    if (xoops_getenv('REQUEST_METHOD') != 'POST' && !empty($xoopsModule) && !empty($xoopsConfig['module_cache'][$xoopsModule->getVar('mid')])) {
+        $xoopsTpl->xoops_setCaching(2);
+        $xoopsTpl->xoops_setCacheTime($xoopsConfig['module_cache'][$xoopsModule->getVar('mid')]);
+        if (!isset($xoopsOption['template_main'])) {
+            $xoopsCachedTemplate = 'db:system_dummy.html';
+        } else {
+            $xoopsCachedTemplate = 'db:'.$xoopsOption['template_main'];
+        }
+        // generate safe cache Id
+        $xoopsCachedTemplateId = 'mod_'.$xoopsModule->getVar('dirname').'|'.md5(str_replace(XOOPS_URL, '', $GLOBALS['xoopsRequestUri']));
+        if ($xoopsTpl->is_cached($xoopsCachedTemplate, $xoopsCachedTemplateId)) {
+            $xoopsLogger->addExtra($xoopsCachedTemplate, $xoopsConfig['module_cache'][$xoopsModule->getVar('mid')]);
+            $xoopsTpl->assign('xoops_contents', $xoopsTpl->fetch($xoopsCachedTemplate, $xoopsCachedTemplateId));
+            $xoopsTpl->xoops_setCaching(0);
+            if (!headers_sent()) {
+                header ('Content-Type:text/html; charset='._CHARSET);
+            }
+            $xoopsTpl->display($xoopsConfig['theme_set'].'/theme.html');
+            if ($xoopsConfig['debug_mode'] == 2 && $xoopsUserIsAdmin) {
+                echo '<script type="text/javascript">
+                <!--//
+                debug_window = openWithSelfMain("", "xoops_debug", 680, 600, true);
+                ';
+                $content = '<html><head><meta http-equiv="content-type" content="text/html; charset='._CHARSET.'" /><meta http-equiv="content-language" content="'._LANGCODE.'" /><title>'.htmlspecialchars($xoopsConfig['sitename']).'</title><link rel="stylesheet" type="text/css" media="all" href="'.getcss($xoopsConfig['theme_set']).'" /></head><body>'.$xoopsLogger->dumpAll().'<div style="text-align:center;"><input class="formButton" value="'._CLOSE.'" type="button" onclick="javascript:window.close();" /></div></body></html>';
+                $lines = preg_split("/(\r\n|\r|\n)( *)/", $content);
+                foreach ($lines as $line) {
+                    echo 'debug_window.document.writeln("'.str_replace('"', '\"', $line).'");';
+                }
+                echo '
+                debug_window.document.close();
+                //-->
+                </script>';
+            }
+            exit();
+        }
+    } else {
+        $xoopsTpl->xoops_setCaching(0);
+    }
+    if (!isset($xoopsOption['template_main'])) {
+        // new themes using Smarty does not have old functions that are required in old modules, so include them now
+        include XOOPS_ROOT_PATH.'/include/old_theme_functions.php';
+        // need this also
+        $xoopsTheme['thename'] = $xoopsConfig['theme_set'];
+        ob_start();
+    }
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/banners.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/banners.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/banners.php	(revision 405)
@@ -0,0 +1,365 @@
+<?php
+// $Id: banners.php,v 1.4 2005/08/03 12:39:11 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+include "mainfile.php";
+
+/********************************************/
+/* Function to let your client login to see */
+/* the stats                                */
+/********************************************/
+function clientlogin()
+{
+    global $xoopsDB, $xoopsLogger, $xoopsConfig;
+    include("header.php");
+    echo "<style type='text/css'>
+                body {background-color : #fcfcfc;color: #000000;font-weight: normal;font-size: 12px;font-family: Trebuchet MS,Verdana, Arial, Helvetica, sans-serif;margin-left: 0px;margin-top: 0px;margin-right: 0px;margin-bottom: 0px;}
+                .redirect {width: 70%;margin: 110px;text-align: center;padding: 15px;text-align:center;border: #e0e0e0 1px solid;color: #666666;background-color: #f6f6f6;text-align: center;}
+                .redirect a:link {color: #666666;text-decoration: none;font-weight: bold;}
+                .redirect a:visited {color: #666666;text-decoration: none;font-weight: bold;}
+                .redirect a:hover {color: #999999;text-decoration: underline;font-weight: bold;}
+                hr {height: 3px;border: 3px #E18A00 solid;filter : Alpha(Opacity=100,FinishOpacity=10,Style=2);width: 95%;}
+                font.bigtext { font-size: 16px; font-weight: bold; }
+        </style>
+
+    <form action='banners.php' method='post'>
+    <table width='100%' class='redirect'>
+    <tr><td colspan='2' align='center'>
+    <b>Advertising Statistics</b><hr /></td></tr>
+    <tr><td align='right'><b>Login: </b></td>
+        <td><input class='textbox' type='text' name='login' size='12' maxlength='10' /></td></tr>
+    <tr><td align='right'><b>Password: </b></td>
+        <td><input class='textbox' type='password' name='pass' size='12' maxlength='10' /></td></tr>
+    <tr><td align='center' colspan='2'><input type='hidden' name='op' value='Ok' />";
+    $token =& XoopsMultiTokenHandler::quickCreate('banner_Ok');
+    echo $token->getHtml();
+    echo "
+        <input type='submit' value='Login' /></td></tr>
+    <tr><td colspan='2' align='center'><hr />Please type your client information</td></tr>
+    </table></form>";
+    include "footer.php";
+}
+
+/*********************************************/
+/* Function to display the banners stats for */
+/* each client                               */
+/*********************************************/
+function bannerstats($login, $pass)
+{
+    global $xoopsDB, $xoopsConfig, $xoopsLogger;
+    if ($login == "" || $pass == "") {
+        redirect_header("banners.php",2);
+        exit();
+    }
+    $result = $xoopsDB->query(sprintf("SELECT cid, name, passwd FROM %s WHERE login=%s", $xoopsDB->prefix("bannerclient"), $xoopsDB->quoteString($login)));
+    list($cid, $name, $passwd) = $xoopsDB->fetchRow($result);
+        if ( $pass==$passwd ) {
+            include "header.php";
+            echo "<style type='text/css'>
+                         .b_td {color: #ffffff; background-color: #2F5376; padding: 3px; text-align: center;}
+                  </style>
+            <h4 style='text-align:center;'><b>Current Active Banners for $name</b><br /></h4>
+            <table width='100%' border='0'><tr>
+                <td class='b_td'><b>ID</b></td>
+                <td class='b_td'><b>Imp. Made</b></td>
+                <td class='b_td'><b>Imp. Total</b></td>
+                <td class='b_td'><b>Imp. Left</b></td>
+                <td class='b_td'><b>Clicks</b></td>
+                <td class='b_td'><b>% Clicks</b></td>
+                <td class='b_td'><b>Functions</b></td></tr>";
+            $result = $xoopsDB->query("select bid, imptotal, impmade, clicks, date from ".$xoopsDB->prefix("banner")." where cid=$cid");
+            while ( list($bid, $imptotal, $impmade, $clicks, $date) = $xoopsDB->fetchRow($result) ) {
+                if ( $impmade == 0 ) {
+                    $percent = 0;
+                } else {
+                    $percent = substr(100 * $clicks / $impmade, 0, 5);
+                }
+                if ( $imptotal == 0 ) {
+                    $left = "Unlimited";
+                } else {
+                    $left = $imptotal-$impmade;
+                }
+                $token =& XoopsMultiTokenHandler::quickCreate('banner_EmailStats');
+                echo "<tr><td align='center'>$bid</td>
+                <td align='center'>$impmade</td>
+                <td align='center'>$imptotal</td>
+                <td align='center'>$left</td>
+                <td align='center'>$clicks</td>
+                <td align='center'>$percent%</td>
+                <td align='center'><a href='banners.php?op=EmailStats&amp;login=$login&amp;pass=$pass&amp;cid=$cid&amp;bid=$bid&amp;".$token->getUrl()."'>E-mail Stats</a></td></tr>";
+            }
+            echo "</table><br /><br /><div>Following are your running Banners in ".htmlspecialchars($xoopsConfig['sitename'])." </div><br /><br />";
+            $result = $xoopsDB->query("select bid, imageurl, clickurl, htmlbanner, htmlcode from ".$xoopsDB->prefix("banner")." where cid=$cid");
+            while ( list($bid, $imageurl, $clickurl,$htmlbanner, $htmlcode) = $xoopsDB->fetchRow($result) ) {
+                $numrows = $xoopsDB->getRowsNum($result);
+                if ($numrows>1) {
+                    echo "<hr /><br />";
+                }
+                if (!empty($htmlbanner) && !empty($htmlcode)){
+                    echo $myts->displayTarea($htmlcode);
+                }else{
+                    if(strtolower(substr($imageurl,strrpos($imageurl,".")))==".swf") {
+                        echo "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/ swflash.cab#version=6,0,40,0\"; width=\"468\" height=\"60\">";
+                        echo "<param name=movie value=\"$imageurl\" />";
+                        echo "<param name=quality value='high' />";
+                        echo "<embed src=\"$imageurl\" quality='high' pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\"; type=\"application/x-shockwave-flash\" width=\"468\" height=\"60\">";
+                        echo "</embed>";
+                        echo "</object>";
+                    } else {
+                        echo "<img src='$imageurl' border='1' alt='' />";
+                    }
+                }
+                $token =& XoopsMultiTokenHandler::quickCreate('banner_EmailStats');
+                echo"Banner ID: $bid<br />
+                Send <a href='banners.php?op=EmailStats&amp;login=$login&amp;cid=$cid&amp;bid=$bid&amp;pass=$pass&amp;".$token->getUrl()."'>E-Mail Stats</a> for this Banner<br />";
+                if (!$htmlbanner){
+                    $token =& XoopsMultiTokenHandler::quickCreate('banner_Change');
+                    $clickurl = htmlspecialchars($clickurl, ENT_QUOTES);
+                    echo "This Banner points to <a href='$clickurl'>this URL</a><br />
+                    <form action='banners.php' method='post'>
+                    Change URL: <input class='textbox' type='text' name='url' size='50' maxlength='200' value='$clickurl' />
+                    <input class='textbox' type='hidden' name='login' value='$login' />
+                    <input class='textbox' type='hidden' name='bid' value='$bid' />
+                    <input class='textbox' type='hidden' name='pass' value='$pass' />
+                    <input class='textbox' type='hidden' name='cid' value='$cid' />
+                    <input type='submit' name='op' value='Change' />";
+                    echo $token->getHtml();
+                    echo "</form>";
+                }
+            }
+
+            /* Finnished Banners */
+            echo "<br />";
+            if(!$result = $xoopsDB->query("select bid, impressions, clicks, datestart, dateend from ".$xoopsDB->prefix("bannerfinish")." where cid=$cid")){
+            echo "<h4 style='text-align:center;'>Banners Finished for $name</h4><br />
+            <table width='100%' border='0'><tr>
+            <td class='b_td'><b>ID</b></td>
+            <td class='b_td'><b>Impressions</b></td>
+            <td class='b_td'><b>Clicks</b></td>
+            <td class='b_td'><b>% Clicks</b></td>
+            <td class='b_td'><b>Start Date</b></td>
+            <td class='b_td'><b>End Date</b></td></tr>";
+            while ( list($bid, $impressions, $clicks, $datestart, $dateend) = $xoopsDB->fetchRow($result) ) {
+                $percent = substr(100 * $clicks / $impressions, 0, 5);
+                echo "<tr><td align='center'>$bid</td>
+                <td align='center'>$impressions</td>
+                <td align='center'>$clicks</td>
+                <td align='center'>$percent%</td>
+                <td align='center'>".formatTimestamp($datestart)."</td>
+                <td align='center'>".formatTimestamp($dateend)."</td></tr>";
+            }
+            echo "</table>";
+            }
+            include "footer.php";
+        } else {
+            redirect_header("banners.php",2);
+            exit();
+        }
+}
+
+/*********************************************/
+/* Function to let the client E-mail his     */
+/* banner Stats                              */
+/*********************************************/
+function EmailStats($login, $cid, $bid, $pass)
+{
+    global $xoopsDB, $xoopsConfig;
+    if ($login != "" && $pass != "") {
+        $cid = intval($cid);
+        $bid = intval($bid);
+        if ($result2 = $xoopsDB->query(sprintf("select name, email, passwd from %s where cid=%u AND login=%s", $xoopsDB->prefix("bannerclient"), $cid, $xoopsDB->quoteString($login)))) {
+            list($name, $email, $passwd) = $xoopsDB->fetchRow($result2);
+            if ($pass == $passwd) {
+                if ($email == "") {
+                    redirect_header("banners.php",3,"There isn't an email associated with client ".$name.".<br />Please contact the Administrator");
+                    exit();
+                } else {
+                    if ($result = $xoopsDB->query("select bid, imptotal, impmade, clicks, imageurl, clickurl, date from ".$xoopsDB->prefix("banner")." where bid=$bid and cid=$cid")) {
+                        list($bid, $imptotal, $impmade, $clicks, $imageurl, $clickurl, $date) = $xoopsDB->fetchRow($result);
+                        if ( $impmade == 0 ) {
+                            $percent = 0;
+                        } else {
+                            $percent = substr(100 * $clicks / $impmade, 0, 5);
+                        }
+                        if ( $imptotal == 0 ) {
+                            $left = "Unlimited";
+                            $imptotal = "Unlimited";
+                        } else {
+                            $left = $imptotal-$impmade;
+                        }
+                        $fecha = date("F jS Y, h:iA.");
+                        $subject = "Your Banner Statistics at ".$xoopsConfig['sitename'];
+                        $message = "Following are the complete stats for your advertising investment at ". $xoopsConfig['sitename']." :\n\n\nClient Name: $name\nBanner ID: $bid\nBanner Image: $imageurl\nBanner URL: $clickurl\n\nImpressions Purchased: $imptotal\nImpressions Made: $impmade\nImpressions Left: $left\nClicks Received: $clicks\nClicks Percent: $percent%\n\n\nReport Generated on: $fecha";
+                        $xoopsMailer =& getMailer();
+                        $xoopsMailer->useMail();
+                        $xoopsMailer->setToEmails($email);
+                        $xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
+                        $xoopsMailer->setFromName($xoopsConfig['sitename']);
+                        $xoopsMailer->setSubject($subject);
+                        $xoopsMailer->setBody($message);
+                        $xoopsMailer->send();
+                        $token =& XoopsMultiTokenHandler::quickCreate('banner_Ok');
+                        redirect_header("banners.php?op=Ok&amp;login=$login&amp;pass=$pass&amp;".$token->getUrl(), 3, "Statistics for your banner has been sent to your email address.");
+                        exit();
+                    }
+                }
+            }
+        }
+    }
+    redirect_header("banners.php",2);
+    exit();
+}
+
+/*********************************************/
+/* Function to let the client to change the  */
+/* url for his banner                        */
+/*********************************************/
+function change_banner_url_by_client($login, $pass, $cid, $bid, $url)
+{
+    global $xoopsDB;
+    if ($login != "" && $pass != "" && $url != "") {
+        $cid = intval($cid);
+        $bid = intval($bid);
+        $sql = sprintf("select passwd from %s where cid=%u and login=%s", $xoopsDB->prefix("bannerclient"), $cid, $xoopsDB->quoteString($login));
+        if ($result = $xoopsDB->query($sql)) {
+            list($passwd) = $xoopsDB->fetchRow($result);
+            if ( $pass == $passwd ) {
+                $sql = sprintf("update %s set clickurl=%s where bid=%u AND cid=%u", $xoopsDB->prefix("banner"), $xoopsDB->quoteString($url), $bid, $cid);
+                if ($xoopsDB->query($sql)) {
+                    $token =& XoopsMultiTokenHandler::quickCreate('banner_Ok');
+                    redirect_header("banners.php?op=Ok&amp;login=$login&amp;pass=$pass&amp;".$token->getUrl(), 3, "URL has been changed.");
+                    exit();
+                }
+            }
+        }
+    }
+    redirect_header("banners.php",2);
+    exit();
+}
+
+function clickbanner($bid)
+{
+    global $xoopsDB;
+    if (is_int($bid) && $bid > 0) {
+        if (xoops_refcheck()) {
+            if ($bresult = $xoopsDB->query("select clickurl from ".$xoopsDB->prefix("banner")." where bid=$bid")) {
+                list($clickurl) = $xoopsDB->fetchRow($bresult);
+                $xoopsDB->queryF("update ".$xoopsDB->prefix("banner")." set clicks=clicks+1 where bid=$bid");
+                header ('Location: '.$clickurl);
+            }
+        }
+    }
+    exit();
+}
+$op = '';
+if (!empty($_POST['op'])) {
+  $op = $_POST['op'];
+} elseif (!empty($_GET['op'])) {
+  $op = $_GET['op'];
+}
+$myts =& MyTextSanitizer::getInstance();
+switch ( $op ) {
+case "click":
+    $bid = 0;
+    if (!empty($_GET['bid'])) {
+        $bid = intval($_GET['bid']);
+    }
+    clickbanner($bid);
+    break;
+case "login":
+    clientlogin();
+    break;
+case "Ok":
+    if (!XoopsMultiTokenHandler::quickValidate('banner_Ok')) {
+        redirect_header("banners.php");
+        exit();
+    }
+    $login = $pass = '';
+    if (!empty($_GET['login'])) {
+        $login = $myts->stripslashesGPC(trim($_GET['login']));
+    }
+    if (!empty($_GET['pass'])) {
+        $pass = $myts->stripslashesGPC(trim($_GET['pass']));
+    }
+    if (!empty($_POST['login'])) {
+        $login = $myts->stripslashesGPC(trim($_POST['login']));
+    }
+    if (!empty($_POST['pass'])) {
+        $pass = $myts->stripslashesGPC(trim($_POST['pass']));
+    }
+    bannerstats($login, $pass);
+    break;
+case "Change":
+    if (!XoopsMultiTokenHandler::quickValidate('banner_Change')) {
+        redirect_header("banners.php");
+        exit();
+    }
+    $login = $pass = $url = '';
+    $bid = $cid = 0;
+    if (!empty($_POST['login'])) {
+        $login = $myts->stripslashesGPC(trim($_POST['login']));
+    }
+    if (!empty($_POST['pass'])) {
+        $pass = $myts->stripslashesGPC(trim($_POST['pass']));
+    }
+    if (!empty($_POST['url'])) {
+        $url = $myts->stripslashesGPC(trim($_POST['url']));
+    }
+    if (!empty($_POST['bid'])) {
+        $bid = intval($_POST['bid']);
+    }
+    if (!empty($_POST['cid'])) {
+        $cid = intval($_POST['cid']);
+    }
+    change_banner_url_by_client($login, $pass, $cid, $bid, $url);
+    break;
+case "EmailStats":
+    if (!XoopsMultiTokenHandler::quickValidate('banner_EmailStats')) {
+        redirect_header("banners.php");
+        exit();
+    }
+    $login = $pass = '';
+    $bid = $cid = 0;
+    if (!empty($_GET['login'])) {
+        $login = $myts->stripslashesGPC(trim($_GET['login']));
+    }
+    if (!empty($_GET['pass'])) {
+        $pass = $myts->stripslashesGPC(trim($_GET['pass']));
+    }
+    if (!empty($_GET['bid'])) {
+        $bid = intval($_GET['bid']);
+    }
+    if (!empty($_GET['cid'])) {
+        $cid = intval($_GET['cid']);
+    }
+    EmailStats($login, $cid, $bid, $pass);
+    break;
+default:
+    clientlogin();
+    break;
+}
+
+?>
Index: /temp/test-xoops.ec-cube.net/html/misc.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/misc.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/misc.php	(revision 405)
@@ -0,0 +1,268 @@
+<?php
+// $Id: misc.php,v 1.7 2006/07/27 00:17:17 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+include "mainfile.php";
+
+//
+// Fall back on simple protector of common.php by checking the constant that
+// is defined in common.php
+//
+if (!defined("XOOPS_CACHE_PATH")) {
+    die();
+}
+
+include_once XOOPS_ROOT_PATH.'/language/'.$xoopsConfig['language'].'/misc.php';
+
+
+$action = isset($_GET['action']) ? trim($_GET['action']) : '';
+$action = isset($_POST['action']) ? trim($_POST['action']) : $action;
+$type = isset($_GET['type']) ? trim($_GET['type']) : '';
+$type = isset($_POST['type']) ? trim($_POST['type']) : $type;
+
+if ( $action == "showpopups" ) {
+    xoops_header(false);
+    // show javascript close button?
+    $closebutton = 1;
+    switch ( $type ) {
+    case "smilies":
+        $target = isset($_GET['target']) ? trim($_GET['target']) : '';
+        if ($target == '' || !preg_match('/^[0-9a-z_]*$/i', $target)) {
+        } else {
+            echo "<script type=\"text/javascript\"><!--//
+            function doSmilie(addSmilie) {
+            var currentMessage = window.opener.xoopsGetElementById(\"".$target."\").value;
+            window.opener.xoopsGetElementById(\"".$target."\").value=currentMessage+addSmilie;
+            return;
+            }
+            //-->
+            </script>
+            ";
+            echo '</head><body>
+            <table width="100%" class="outer">
+            <tr><th colspan="3">'._MSC_SMILIES.'</th></tr>
+            <tr class="head"><td>'._MSC_CODE.'</td><td>'._MSC_EMOTION.'</td><td>'._IMAGE.'</td></tr>';
+            if ($getsmiles = $xoopsDB->query("SELECT * FROM ".$xoopsDB->prefix("smiles"))) {
+                $rcolor = 'even';
+                while ( $smile = $xoopsDB->fetchArray($getsmiles) ) {
+                    echo "<tr class='$rcolor'><td>".$smile['code']."</td><td>".$smile['emotion']."</td><td><img onmouseover='style.cursor=\"hand\"' onclick='doSmilie(\" ".$smile['code']." \");' src='".XOOPS_UPLOAD_URL."/".$smile['smile_url']."' alt='' /></td></tr>";
+                    $rcolor = ($rcolor == 'even') ? 'odd' : 'even';
+                }
+            } else {
+                echo "Could not retrieve data from the database.";
+            }
+            echo '</table>'._MSC_CLICKASMILIE;
+        }
+        break;
+    case "avatars":
+        ?>
+        <script language='javascript'>
+        <!--//
+        function myimage_onclick(counter){
+            window.opener.xoopsGetElementById("user_avatar").options[counter].selected = true;
+            showAvatar();
+            window.opener.xoopsGetElementById("user_avatar").focus();
+            window.close();
+        }
+        function showAvatar() {
+            window.opener.xoopsGetElementById("avatar").src='<?php echo XOOPS_UPLOAD_URL;?>/' + window.opener.xoopsGetElementById("user_avatar").options[window.opener.xoopsGetElementById("user_avatar").selectedIndex].value;
+        }
+        //-->
+        </script>
+        </head><body>
+        <h4><?php echo _MSC_AVAVATARS;?></h4>
+        <form name='avatars' action='<?php echo xoops_getenv('PHP_SELF');?>'>
+        <table width='100%'><tr>
+        <?php
+        $avatar_handler =& xoops_gethandler('avatar');
+        $avatarslist =& $avatar_handler->getList('S');
+        $cntavs = 0;
+        $counter = isset($_GET['start']) ? intval($_GET['start']) : 0;
+            foreach ($avatarslist as $file => $name) {
+            echo '<td><img src="uploads/'.$file.'" alt="'.$name.'" style="padding:10px; vertical-align:top;"  /><br />'.$name.'<br /><input name="myimage" type="button" value="'._SELECT.'" onclick="myimage_onclick('.$counter.')" /></td>';
+            $counter++;
+            $cntavs++;
+            if ($cntavs > 8) {
+                echo '</tr><tr>';
+                $cntavs=0;
+            }
+        }
+        echo '</tr></table></form></div>';
+        break;
+    case "friend":
+        if (!is_object($xoopsUser)) {
+            break;
+        }
+        if ( !isset($_POST['op']) || $_POST['op'] == "sendform" ) {
+            $token=&XoopsMultiTokenHandler::quickCreate('misc_sendform');
+            $yname = $xoopsUser->getVar("uname", 'e');
+            $ymail = $xoopsUser->getVar("email", 'e');
+            $fname = "";
+            $fmail = "";
+            printCheckForm();
+            echo '</head><body>
+            <form action="'.XOOPS_URL.'/misc.php" method="post" onsubmit="return checkForm();"><table  width="100%" class="outer" cellspacing="1"><tr><th colspan="2">'._MSC_RECOMMENDSITE.'</th></tr>';
+            echo $token->getHtml();
+            echo "<tr><td class='head'>
+                <input type='hidden' name='op' value='sendsite' />
+                <input type='hidden' name='action' value='showpopups' />
+                <input type='hidden' name='type' value='friend' />\n";
+            echo _MSC_YOURNAMEC."</td><td class='even'><input type='text' name='yname' value='$yname' id='yname' /></td></tr>
+                <tr><td class='head'>"._MSC_YOUREMAILC."</td><td class='odd'><input type='text' name='ymail' value='".$ymail."' id='ymail' /></td></tr>
+                <tr><td class='head'>"._MSC_FRIENDNAMEC."</td><td class='even'><input type='text' name='fname' value='$fname' id='fname' /></td></tr>
+                <tr><td class='head'>"._MSC_FRIENDEMAILC."</td><td class='odd'><input type='text' name='fmail' value='$fmail' id='fmail' /></td></tr>
+                <tr><td class='head'>&nbsp;</td><td class='even'><input type='submit' value='"._SEND."' />&nbsp;<input value='"._CLOSE."' type='button' onclick='javascript:window.close();' /></td></tr>
+                </table></form>\n";
+            $closebutton = 0;
+        } elseif ($_POST['op'] == "sendsite") {
+            if (!XoopsMultiTokenHandler::quickValidate('misc_sendform')) {
+                exit();
+            }
+            $myts =& MyTextsanitizer::getInstance();
+            $ymail = $xoopsUser->getVar("email");
+            if ( !isset($_POST['yname']) || trim($_POST['yname']) == "" || $ymail == '' || !isset($_POST['fname']) || trim($_POST['fname']) == ""  || !isset($_POST['fmail']) || trim($_POST['fmail']) == '' ) {
+                redirect_header(XOOPS_URL."/misc.php?action=showpopups&amp;type=friend&amp;op=sendform",2,_MSC_NEEDINFO);
+                exit();
+            }
+            $yname = $myts->stripSlashesGPC(trim($_POST['yname']));
+            $fname = $myts->stripSlashesGPC(trim($_POST['fname']));
+            $fmail = $myts->stripSlashesGPC(trim($_POST['fmail']));
+            if (!checkEmail($fmail) || !checkEmail($ymail) || preg_match("/[\\0-\\31]/",$yname)) {
+                $errormessage = _MSC_INVALIDEMAIL1."<br />"._MSC_INVALIDEMAIL2."";
+                redirect_header(XOOPS_URL."/misc.php?action=showpopups&amp;type=friend&amp;op=sendform",2,$errormessage);
+                exit();
+            }
+            $xoopsMailer =& getMailer();
+            $xoopsMailer->setTemplate("tellfriend.tpl");
+            $xoopsMailer->assign("SITENAME", $xoopsConfig['sitename']);
+            $xoopsMailer->assign("ADMINMAIL", $xoopsConfig['adminmail']);
+            $xoopsMailer->assign("SITEURL", XOOPS_URL."/");
+            $xoopsMailer->assign("YOUR_NAME", $yname);
+            $xoopsMailer->assign("FRIEND_NAME", $fname);
+            $xoopsMailer->setToEmails($fmail);
+            $xoopsMailer->setFromEmail($ymail);
+            $xoopsMailer->setFromName($yname);
+            $xoopsMailer->setSubject(sprintf(_MSC_INTSITE,$xoopsConfig['sitename']));
+            //OpenTable();
+            if ( !$xoopsMailer->send() ) {
+                echo $xoopsMailer->getErrors();
+            } else {
+                echo "<div><h4>"._MSC_REFERENCESENT."</h4></div>";
+            }
+            //CloseTable();
+        }
+        break;
+    case 'online':
+        $isadmin = $xoopsUserIsAdmin;
+        echo '<table  width="100%" cellspacing="1" class="outer"><tr><th colspan="3">'._WHOSONLINE.'</th></tr>';
+        $start = isset($_GET['start']) ? intval($_GET['start']) : 0;
+        $online_handler =& xoops_gethandler('online');
+        $online_total =& $online_handler->getCount();
+        $limit = ($online_total > 20) ? 20 : $online_total;
+        $criteria = new CriteriaCompo();
+        $criteria->setLimit($limit);
+        $criteria->setStart($start);
+        $onlines =& $online_handler->getAll($criteria);
+        $count = count($onlines);
+        $module_handler =& xoops_gethandler('module');
+        $modules =& $module_handler->getList(new Criteria('isactive', 1));
+        for ($i = 0; $i < $count; $i++) {
+            if ($onlines[$i]['online_uid'] == 0) {
+                $onlineUsers[$i]['user'] = '';
+            } else {
+                $onlineUsers[$i]['user'] =& new XoopsUser($onlines[$i]['online_uid']);
+            }
+            $onlineUsers[$i]['ip'] = $onlines[$i]['online_ip'];
+            $onlineUsers[$i]['updated'] = $onlines[$i]['online_updated'];
+            $onlineUsers[$i]['module'] = ($onlines[$i]['online_module'] > 0) ? $modules[$onlines[$i]['online_module']] : '';
+        }
+        $class = 'even';
+        for ($i = 0; $i < $count; $i++) {
+            $class = ($class == 'odd') ? 'even' : 'odd';
+            echo '<tr valign="middle" align="center" class="'.$class.'">';
+            if (is_object($onlineUsers[$i]['user'])) {
+                $avatar = $onlineUsers[$i]['user']->getVar('user_avatar') ? '<img src="'.XOOPS_UPLOAD_URL.'/'.$onlineUsers[$i]['user']->getVar('user_avatar').'" alt="" />' : '&nbsp;';
+                echo '<td>'.$avatar."</td><td><a href=\"javascript:window.opener.location='".XOOPS_URL."/userinfo.php?uid=".$onlineUsers[$i]['user']->getVar('uid')."';window.close();\">".$onlineUsers[$i]['user']->getVar('uname')."</a>";
+            } else {
+                echo '<td>&nbsp;</td><td>'.$xoopsConfig['anonymous'];
+            }
+            if ($isadmin == 1) {
+                echo '<br />('.$onlineUsers[$i]['ip'].')';
+            }
+            echo '</td><td>'.$onlineUsers[$i]['module'].'</td></tr>';
+        }
+        echo '</table><br />';
+        if ($online_total > 20) {
+            include_once XOOPS_ROOT_PATH.'/class/pagenav.php';
+            $nav = new XoopsPageNav($online_total, 20, $start, 'start', 'action=showpopups&amp;type=online');
+            echo '<div style="text-align: right;">'.$nav->renderNav().'</div>';
+        }
+        break;
+    case 'ssllogin':
+        if ($xoopsConfig['use_ssl'] && isset($_POST[$xoopsConfig['sslpost_name']]) && is_object($xoopsUser)) {
+            include_once XOOPS_ROOT_PATH.'/language/'.$xoopsConfig['language'].'/user.php';
+            echo sprintf(_US_LOGGINGU, $xoopsUser->getVar('uname'));
+            echo '<div style="text-align:center;"><input class="formButton" value="'._CLOSE.'" type="button" onclick="window.opener.location.reload();window.close();" /></div>';
+            $closebutton = false;
+        }
+        break;
+    default:
+        break;
+    }
+    if ($closebutton) {
+        echo '<div style="text-align:center;"><input class="formButton" value="'._CLOSE.'" type="button" onclick="javascript:window.close();" /></div>';
+    }
+    xoops_footer();
+}
+
+function printCheckForm()
+{
+    ?>
+    <script language='javascript'>
+        <!--//
+        function checkForm()
+        {
+            if ( xoopsGetElementById("yname").value == "" ){
+                alert( "<?php echo _MSC_ENTERYNAME;?>" );
+                xoopsGetElementById("yname").focus();
+                return false;
+            } else if ( xoopsGetElementById("fname").value == "" ){
+                alert( "<?php echo _MSC_ENTERFNAME;?>" );
+                xoopsGetElementById("fname").focus();
+                return false;
+            } else if ( xoopsGetElementById("fmail").value ==""){
+                alert( "<?php echo _MSC_ENTERFMAIL;?>" );
+                xoopsGetElementById("fmail").focus();
+                return false;
+            } else {
+                return true;
+            }
+        }
+        //-->
+    </script>
+    <?php
+}
+?>
Index: /temp/test-xoops.ec-cube.net/html/robots.txt
===================================================================
--- /temp/test-xoops.ec-cube.net/html/robots.txt	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/robots.txt	(revision 405)
@@ -0,0 +1,13 @@
+User-agent: *
+Disallow: /cgi-bin/
+Disallow: /tmp/
+Disallow: /cache/
+Disallow: /class/
+Disallow: /images/
+Disallow: /include/
+Disallow: /install/
+Disallow: /kernel/
+Disallow: /language/
+Disallow: /templates_c/
+Disallow: /themes/
+Disallow: /uploads/
Index: /temp/test-xoops.ec-cube.net/html/viewpmsg.php
===================================================================
--- /temp/test-xoops.ec-cube.net/html/viewpmsg.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/html/viewpmsg.php	(revision 405)
@@ -0,0 +1,92 @@
+<?php
+// $Id: viewpmsg.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
+//  ------------------------------------------------------------------------ //
+//                XOOPS - PHP Content Management System                      //
+//                    Copyright (c) 2000 XOOPS.org                           //
+//                       <http://www.xoops.org/>                             //
+//  ------------------------------------------------------------------------ //
+//  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.                                      //
+//                                                                           //
+//  You may not change or alter any portion of this comment or credits       //
+//  of supporting developers from this source code or any supporting         //
+//  source code which is considered copyrighted (c) material of the          //
+//  original comment or credit authors.                                      //
+//                                                                           //
+//  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 //
+//  ------------------------------------------------------------------------ //
+
+$xoopsOption['pagetype'] = "pmsg";
+include_once "mainfile.php";
+
+if ( !$xoopsUser ) {
+	$errormessage = _PM_SORRY."<br />"._PM_PLZREG."";
+   	redirect_header("user.php",2,$errormessage);
+} else {
+	$pm_handler =& xoops_gethandler('privmessage');
+	if (isset($_POST['delete_messages']) && isset($_POST['msg_id'])) {
+		$size = count($_POST['msg_id']);
+		$msg =& $_POST['msg_id'];
+        	for ( $i = 0; $i < $size; $i++ ) {
+			$pm =& $pm_handler->get($msg[$i]);
+			if ($pm->getVar('to_userid') == $xoopsUser->getVar('uid')) {
+				$pm_handler->delete($pm);
+			}
+			unset($pm);
+		}
+		redirect_header("viewpmsg.php",1,_PM_DELETED);
+		exit();
+	}
+	include XOOPS_ROOT_PATH.'/header.php';
+	$pm_arr =& $pm_handler->getObjects(new Criteria('to_userid', $xoopsUser->getVar('uid')));
+	echo "<h4 style='text-align:center;'>". _PM_PRIVATEMESSAGE ."</h4><br /><a href='userinfo.php?uid=". $xoopsUser->getVar("uid")."'>". _PM_PROFILE ."</a>&nbsp;<span style='font-weight:bold;'>&raquo;&raquo;</span>&nbsp;". _PM_INBOX ."<br /><br /><table border='0' cellspacing='1' cellpadding='4' width='100%' class='outer'>\n";
+	echo "<form name='prvmsg' method='post' action='viewpmsg.php'>";
+	echo "<tr align='center' valign='middle'><th><input name='allbox' id='allbox' onclick='xoopsCheckAll(\"prvmsg\", \"allbox\");' type='checkbox' value='Check All' /></th><th><img src='images/download.gif' alt='' border='0' /></th><th>&nbsp;</th><th>". _PM_FROM ."</th><th>". _PM_SUBJECT ."</th><th align='center'>". _PM_DATE ."</th></tr>\n";
+	$total_messages = count($pm_arr);
+	if ( $total_messages == 0 ) {
+		echo "<tr><td class='even' colspan='6' align='center'>"._PM_YOUDONTHAVE."</td></tr> ";
+		$display= 0;
+	} else {
+
+		$display = 1;
+	}
+    for ($i = 0; $i < $total_messages; $i++) {
+		$class = ($i % 2 == 0) ? 'even' : 'odd';
+		echo "<tr align='left' class='$class'><td valign='top' width='2%' align='center'><input type='checkbox' id='msg_id[]' name='msg_id[]' value='".$pm_arr[$i]->getVar("msg_id")."' /></td>\n";
+		if ($pm_arr[$i]->getVar('read_msg') == 1) {
+			echo "<td valign='top' width='5%' align='center'>&nbsp;</td>\n";
+		} else {
+			echo "<td valign='top' width='5%' align='center'><img src='images/read.gif' alt='"._PM_NOTREAD."' /></td>\n";
+		}
+		echo "<td valign='top' width='5%' align='center'><img src='images/subject/".$pm_arr[$i]->getVar("msg_image", "E")."' alt='' /></td>\n";
+		$postername = XoopsUser::getUnameFromId($pm_arr[$i]->getVar("from_userid"));
+		echo "<td valign='middle' width='10%'>";
+		// no need to show deleted users
+		if ($postername) {
+			echo "<a href='userinfo.php?uid=".$pm_arr[$i]->getVar("from_userid")."'>".$postername."</a>";
+		} else {
+			echo $xoopsConfig['anonymous'];
+		}
+		echo "</td>\n";
+		echo "<td valign='middle'><a href='readpmsg.php?start=$i&amp;total_messages=$total_messages'>".$pm_arr[$i]->getVar("subject")."</a></td>";
+		echo "<td valign='middle' align='center' width='20%'>".formatTimestamp($pm_arr[$i]->getVar("msg_time"))."</td></tr>";
+	}
+
+	if ( $display == 1 ) {
+		echo "<tr class='foot' align='left'><td colspan='6' align='left'><input type='button' class='formButton' onclick='javascript:openWithSelfMain(\"".XOOPS_URL."/pmlite.php?send=1\",\"pmlite\",450,380);' value='"._PM_SEND."' />&nbsp;<input type='submit' class='formButton' name='delete_messages' value='"._PM_DELETE."' /></td></tr></form>";
+	} else {
+		echo "<tr class='bg2' align='left'><td colspan='6' align='left'><input type='button' class='formButton' onclick='javascript:openWithSelfMain(\"".XOOPS_URL."/pmlite.php?send=1\",\"pmlite\",450,380);' value='"._PM_SEND."' /></td></tr></form>";
+	}
+	echo "</table>";
+	include "footer.php";
+}
+?>
Index: /temp/test-xoops.ec-cube.net/extras/login.php
===================================================================
--- /temp/test-xoops.ec-cube.net/extras/login.php	(revision 405)
+++ /temp/test-xoops.ec-cube.net/extras/login.php	(revision 405)
@@ -0,0 +1,108 @@
+<?php
+// This script displays a login screen in a popupbox when SSL is enabled in the preferences. You should use this script only when your server supports SSL. Place this file under your SSL directory
+
+// path to your xoops main directory
+$path = '/path/to/xoops/directory';
+
+include $path.'/mainfile.php';
+if (!defined('XOOPS_ROOT_PATH')) {
+    exit();
+}
+include_once XOOPS_ROOT_PATH.'/language/'.$xoopsConfig['language'].'/user.php';
+$op = (isset($_POST['op']) && $_POST['op'] == 'dologin') ? 'dologin' : 'login';
+
+$username = isset($_POST['username']) ? trim($_POST['username']) : '';
+$password = isset($_POST['userpass']) ? trim($_POST['userpass']) : '';
+if ($username == '' || $password == '') {
+    $op ='login';
+}
+
+echo '
+<html>
+  <head>
+    <meta http-equiv="content-type" content="text/html; charset='._CHARSET.'" />
+    <meta http-equiv="content-language" content="'._LANGCODE.'" />
+    <title>'.htmlspecialchars($xoopsConfig['sitename']).'</title>
+    <link rel="stylesheet" type="text/css" media="all" href="'.XOOPS_URL.'/xoops.css" />
+';
+$style = getcss($xoopsConfig['theme_set']);
+if ($style == '') {
+    $style = xoops_getcss($xoopsConfig['theme_set']);
+}
+if ($style != '') {
+    echo '<link rel="stylesheet" type="text/css" media="all" href="'.$style.'" />';
+}
+echo '
+  </head>
+  <body>
+';
+
+if ($op == 'dologin') {
+    $member_handler =& xoops_gethandler('member');
+    $myts =& MyTextsanitizer::getInstance();
+    $user =& $member_handler->loginUser(addslashes($myts->stripSlashesGPC($username)), $myts->stripSlashesGPC($password));
+    if (is_object($user)) {
+        if (0 == $user->getVar('level')) {
+            redirect_header(XOOPS_URL.'/index.php', 5, _US_NOACTTPADM);
+            exit();
+        }
+        if ($xoopsConfig['closesite'] == 1) {
+            $allowed = false;
+            foreach ($user->getGroups() as $group) {
+                if (in_array($group, $xoopsConfig['closesite_okgrp']) || XOOPS_GROUP_ADMIN == $group) {
+                    $allowed = true;
+                    break;
+                }
+            }
+            if (!$allowed) {
+                redirect_header(XOOPS_URL.'/index.php', 1, _NOPERM);
+                exit();
+            }
+        }
+        $user->setVar('last_login', time());
+        if (!$member_handler->insertUser($user)) {
+        }
+        require_once XOOPS_ROOT_PATH . '/include/session.php';
+        xoops_session_regenerate();
+        $_SESSION = array();
+        $_SESSION['xoopsUserId'] = $user->getVar('uid');
+        $_SESSION['xoopsUserGroups'] = $user->getGroups();
+        if (!empty($xoopsConfig['use_ssl'])) {
+            xoops_confirm(array($xoopsConfig['sslpost_name'] => session_id()), XOOPS_URL.'/misc.php?action=showpopups&amp;type=ssllogin', _US_PRESSLOGIN, _LOGIN);
+        } else {
+            echo sprintf(_US_LOGGINGU, $user->getVar('uname'));
+            echo '<div style="text-align:center;"><input value="'._CLOSE.'" type="button" onclick="document.window.opener.location.reload();document.window.close();" /></div>';
+        }
+    } else {
+        xoops_error(_US_INCORRECTLOGIN.'<br /><a href="login.php">'._BACK.'</a>');
+    }
+}
+
+if ($op == 'login') {
+    echo '
+    <div style="text-align: center; padding: 5; margin: 0">
+    <form action="login.php" method="post">
+      <table class="outer" width="95%">
+        <tr>
+          <td class="head">'._USERNAME.'</td>
+          <td class="even"><input type="text" name="username" value="" /></td>
+        </tr>
+        <tr>
+          <td class="head">'._PASSWORD.'</td>
+          <td class="even"><input type="password" name="userpass" value="" /></td>
+        </tr>
+        <tr>
+          <td class="head">&nbsp;</td>
+          <td class="even"><input type="hidden" name="op" value="dologin" /><input type="submit" name="submit" value="'._LOGIN.'" /></td>
+        </tr>
+      </table>
+    </form>
+    </div>
+    ';
+}
+
+echo '
+  </body>
+</html>
+';
+?>
Index: /temp/test-xoops.ec-cube.net/extras/theme_x2t/doc/readme.htm
===================================================================
--- /temp/test-xoops.ec-cube.net/extras/theme_x2t/doc/readme.htm	(revision 405)
+++ /temp/test-xoops.ec-cube.net/extras/theme_x2t/doc/readme.htm	(revision 405)
@@ -0,0 +1,222 @@
+<html>
+<head>
+<title>Info</title>
+<script language="JavaScript">
+if (document.layers)
+alert("This script works with Internet Explorer 4x only.\n\nSorry, Netscape-folks!")
+var now
+
+var second
+
+var timer
+var i_loop=0
+
+function initiate() {
+    firstObj.Scale(10,10,0)
+    secondObj.Scale(.01,.01,0)
+    enlarge()
+}
+
+function enlarge() {
+    if (i_loop<=100) {
+        firstObj.Rotate(0,0,-12)
+        firstObj.Scale(0.9,0.9,0)
+	    secondObj.Rotate(0,0,12)
+        secondObj.Scale(1.11,1.11,0)
+
+        timer=setTimeout("enlarge()",20)
+        i_loop++
+    }
+    else {
+        clearTimeout(timer)
+        i_loop=0
+        reduce()
+    }
+}
+
+function reduce() {
+    if (i_loop<=100) {
+        firstObj.Rotate(0,0,12)
+        firstObj.Scale(1.11,1.11,0)
+	    secondObj.Rotate(0,0,-12)
+        secondObj.Scale(0.9,0.9,0)
+        timer=setTimeout("reduce()",20)
+        i_loop++
+    }
+    else {
+        clearTimeout(timer)
+        i_loop=0
+        enlarge()
+    }
+}
+
+// - End of JavaScript - -->
+</script>
+<style type="text/css">
+<!--
+a {  text-decoration: none}
+-->
+</style>
+</head>
+<body bgcolor=000000 onLoad="if(document.all){initiate()}" link="#FFCC00" vlink="#FFCC00" alink="#FFFFCC">
+<DIV style="position:absolute;top:55px;left:563px; width: 56px; height: 200px">
+  <OBJECT ID="firstObj" STYLE="width:200px;height:200px" CLASSID="CLSID:369303C2-D7AC-11D0-89D5-00A0C90833E6">
+<PARAM NAME="Line0001" VALUE="SetLineColor(255,0,0)">
+<PARAM NAME="Line0002" VALUE="SetFillColor(255,0,0)">
+<PARAM NAME="Line0003" VALUE="SetLineStyle(0)">
+<PARAM NAME="Line0004" VALUE="Polygon(461,11,11,12,8,14,6,18,4,21,2,25,1,28,0,30,-1,31,-3,30,-4,30,-6,29,-8,28,-9,27,-11,26,-12,24,-13,21,-14,19,-14,18,-13,16,-13
+,14,-12,13,-11,11,-11,9,-12,7,-14,2,-19,-1,-21,-3,-22,-5,-21,-5,-19,-6,-17,-6,-13,-6,-9,-6,-6,-6,-4,-7,-3,-8,-2,-9,0,-10,2,-11,4
+,-11,7,-10,13,-10,18,-10,22,-10,26,-10,30,-9,33,-7,37,-4,40,-2,41,0,42,1,42,3,42,4,40,6,39,8,36,10,33,12,32,16,32,21,32
+,26,33,30,34,35,35,38,35,40,34,41,31,42,29,43,27,44,26,44,25,45,24,47,23,49,21,54,15,57,6,59,-4,59,-13,57,-22,53,-29,49,-33
+,44,-33,42,-33,39,-34,35,-35,31,-37,27,-39,23,-40,20,-42,18,-42,14,-44,12,-45,10,-47,8,-48,6,-50,4,-51,3,-53,2,-54,-1,-55,-4,-55,-7,-53
+,-11,-50,-14,-46,-17,-41,-19,-37,-21,-32,-22,-28,-25,-23,-28,-19,-32,-15,-36,-11,-39,-8,-41,-4,-42,-1,-42,6,-41,9,-39,15,-36,29,-34,40,-34,51,-32,59
+,-31,66,-29,71,-25,73,-19,73,-10,70,-5,68,1,67,9,67,18,67,27,66,37,65,47,64,57,62,65,58,73,53,79,46,84,37,87,25,87,11,85,-6
+,79,-26,78,-31,79,-34,80,-36,82,-37,85,-38,87,-39,88,-41,88,-44,86,-47,83,-50,80,-53,75,-56,71,-60,68,-64,65,-70,64,-77,63,-80,61,-81,58,-82
+,55,-82,51,-81,48,-81,44,-81,41,-81,37,-83,33,-84,29,-86,26,-87,23,-89,20,-90,17,-91,15,-92,12,-93,10,-93,7,-94,4,-94,1,-94,-2,-94,-5,-94
+,-9,-93,-12,-92,-15,-90,-18,-88,-21,-84,-24,-81,-27,-77,-31,-73,-34,-69,-37,-65,-40,-61,-44,-57,-48,-54,-51,-52,-55,-50,-60,-49,-64,-49,-67,-48,-69,-45,-69,-42
+,-69,-37,-68,-31,-68,-26,-68,-20,-70,-15,-75,-3,-78,7,-79,17,-79,25,-78,31,-77,36,-78,40,-80,42,-81,43,-82,43,-82,44,-82,46,-81,46,-79,47,-76,47
+,-75,48,-74,51,-74,54,-75,56,-77,58,-79,60,-82,60,-84,58,-86,56,-91,47,-95,41,-97,36,-98,30,-98,24,-94,17,-88,8,-78,-4,-75,-10,-75,-18,-76,-26
+,-77,-34,-79,-42,-78,-48,-75,-53,-69,-54,-65,-55,-61,-56,-57,-58,-54,-61,-51,-64,-48,-67,-46,-71,-43,-75,-41,-79,-38,-83,-36,-87,-34,-90,-31,-93,-28,-96,-26,-98
+,-23,-99,-19,-99,-14,-100,-9,-100,-5,-100,0,-100,5,-100,10,-100,16,-100,21,-99,26,-98,31,-97,37,-96,42,-95,47,-94,51,-92,56,-91,59,-90,62,-89,66,-88
+,69,-86,72,-85,74,-83,76,-80,77,-77,77,-70,79,-65,81,-61,83,-58,86,-55,88,-53,90,-50,91,-47,91,-41,89,-34,89,-27,90,-18,95,-2,97,12,98,25
+,97,36,94,45,90,53,85,60,79,65,72,70,64,73,56,75,47,77,38,77,29,77,20,76,11,75,6,74,1,73,-4,74,-8,74,-12,75,-16,75,-18,76
+,-21,77,-27,79,-32,78,-38,76,-42,72,-44,66,-46,59,-45,50,-43,39,-42,36,-43,33,-44,29,-45,25,-47,20,-48,15,-49,10,-49,4,-48,1,-46,-5,-43,-12
+,-40,-19,-36,-27,-33,-34,-30,-41,-29,-47,-28,-49,-27,-51,-25,-53,-23,-54,-21,-55,-19,-57,-16,-58,-14,-58,-11,-59,-8,-59,-6,-59,-3,-59,-1,-59,1,-59,3,-58
+,4,-57,5,-56,7,-54,8,-53,10,-51,12,-50,14,-49,17,-47,20,-46,23,-45,26,-45,30,-45,34,-46,38,-46,42,-46,45,-47,47,-47,52,-46,57,-40,62,-30
+,65,-18,67,-5,67,8,64,19,59,26,57,28,55,29,53,31,50,32,48,33,46,35,44,37,43,40,41,42,38,42,35,43,31,43,26,43,22,43,19,44
+,17,46,14,48,11,50,9,50,6,50,2,49,-1,48,-3,46,-5,44,-9,41,-12,37,-14,33,-15,28,-17,23,-18,18,-19,12,-20,6,-20,3,-19,0,-18,-2
+,-16,-5,-15,-7,-14,-9,-13,-12,-14,-15,-13,-19,-12,-23,-10,-27,-7,-30,-4,-32,0,-32,4,-30,10,-26,12,-24,15,-22,18,-21,21,-21,25,-20,28,-20,31,-19
+,33,-19,37,-16,37,-10,36,-4,36,0,35,2,34,3,32,4,30,5,28,6,25,7,23,8,22,11,20,13,18,15,17,16,15,16,13,15,12,14,11,12
+,11,11)">
+<PARAM NAME="Line0005" VALUE="Polygon(17,-69,75,-71,75,-73,75,-74,74,-76,72,-77,69,-76,66,-75,64,-72,64,-69,64,-67,64,-66,63,-65,64,-64,67,-65,71,-66,74,-69,75)">
+<PARAM NAME="Line0006" VALUE="Polygon(17,-64,88,-64,88,-65,87,-64,86,-64,85,-65,84,-65,82,-65,80,-64,80,-62,80,-60,81,-58,82,-57,84,-58,86,-60,87,-62,88,-64,88)">
+<PARAM NAME="Line0007" VALUE="Polygon(15,-50,100,-51,99,-52,99,-52,98,-52,97,-52,96,-52,96,-51,95,-50,95,-49,95,-49,96,-48,97,-48,97,-48,99,-50,100)">
+</OBJECT>
+</DIV>
+
+<DIV style="position:absolute;top:55px;left:563px; width: 179px; height: 200px">
+  <OBJECT ID="secondObj" STYLE="width:200px;height:200px" CLASSID="CLSID:369303C2-D7AC-11D0-89D5-00A0C90833E6" width="356" height="212">
+    <PARAM NAME="Line0001" VALUE="SetLineColor(255,255,0)">
+    <PARAM NAME="Line0002" VALUE="SetFillColor(255,255,0)">
+    <PARAM NAME="Line0003" VALUE="SetLineStyle(0)">
+    <PARAM NAME="Line0004" VALUE="Polygon(461,11,11,12,8,14,6,18,4,21,2,25,1,28,0,30,-1,31,-3,30,-4,30,-6,29,-8,28,-9,27,-11,26,-12,24,-13,21,-14,19,-14,18,-13,16,-13
+,14,-12,13,-11,11,-11,9,-12,7,-14,2,-19,-1,-21,-3,-22,-5,-21,-5,-19,-6,-17,-6,-13,-6,-9,-6,-6,-6,-4,-7,-3,-8,-2,-9,0,-10,2,-11,4
+,-11,7,-10,13,-10,18,-10,22,-10,26,-10,30,-9,33,-7,37,-4,40,-2,41,0,42,1,42,3,42,4,40,6,39,8,36,10,33,12,32,16,32,21,32
+,26,33,30,34,35,35,38,35,40,34,41,31,42,29,43,27,44,26,44,25,45,24,47,23,49,21,54,15,57,6,59,-4,59,-13,57,-22,53,-29,49,-33
+,44,-33,42,-33,39,-34,35,-35,31,-37,27,-39,23,-40,20,-42,18,-42,14,-44,12,-45,10,-47,8,-48,6,-50,4,-51,3,-53,2,-54,-1,-55,-4,-55,-7,-53
+,-11,-50,-14,-46,-17,-41,-19,-37,-21,-32,-22,-28,-25,-23,-28,-19,-32,-15,-36,-11,-39,-8,-41,-4,-42,-1,-42,6,-41,9,-39,15,-36,29,-34,40,-34,51,-32,59
+,-31,66,-29,71,-25,73,-19,73,-10,70,-5,68,1,67,9,67,18,67,27,66,37,65,47,64,57,62,65,58,73,53,79,46,84,37,87,25,87,11,85,-6
+,79,-26,78,-31,79,-34,80,-36,82,-37,85,-38,87,-39,88,-41,88,-44,86,-47,83,-50,80,-53,75,-56,71,-60,68,-64,65,-70,64,-77,63,-80,61,-81,58,-82
+,55,-82,51,-81,48,-81,44,-81,41,-81,37,-83,33,-84,29,-86,26,-87,23,-89,20,-90,17,-91,15,-92,12,-93,10,-93,7,-94,4,-94,1,-94,-2,-94,-5,-94
+,-9,-93,-12,-92,-15,-90,-18,-88,-21,-84,-24,-81,-27,-77,-31,-73,-34,-69,-37,-65,-40,-61,-44,-57,-48,-54,-51,-52,-55,-50,-60,-49,-64,-49,-67,-48,-69,-45,-69,-42
+,-69,-37,-68,-31,-68,-26,-68,-20,-70,-15,-75,-3,-78,7,-79,17,-79,25,-78,31,-77,36,-78,40,-80,42,-81,43,-82,43,-82,44,-82,46,-81,46,-79,47,-76,47
+,-75,48,-74,51,-74,54,-75,56,-77,58,-79,60,-82,60,-84,58,-86,56,-91,47,-95,41,-97,36,-98,30,-98,24,-94,17,-88,8,-78,-4,-75,-10,-75,-18,-76,-26
+,-77,-34,-79,-42,-78,-48,-75,-53,-69,-54,-65,-55,-61,-56,-57,-58,-54,-61,-51,-64,-48,-67,-46,-71,-43,-75,-41,-79,-38,-83,-36,-87,-34,-90,-31,-93,-28,-96,-26,-98
+,-23,-99,-19,-99,-14,-100,-9,-100,-5,-100,0,-100,5,-100,10,-100,16,-100,21,-99,26,-98,31,-97,37,-96,42,-95,47,-94,51,-92,56,-91,59,-90,62,-89,66,-88
+,69,-86,72,-85,74,-83,76,-80,77,-77,77,-70,79,-65,81,-61,83,-58,86,-55,88,-53,90,-50,91,-47,91,-41,89,-34,89,-27,90,-18,95,-2,97,12,98,25
+,97,36,94,45,90,53,85,60,79,65,72,70,64,73,56,75,47,77,38,77,29,77,20,76,11,75,6,74,1,73,-4,74,-8,74,-12,75,-16,75,-18,76
+,-21,77,-27,79,-32,78,-38,76,-42,72,-44,66,-46,59,-45,50,-43,39,-42,36,-43,33,-44,29,-45,25,-47,20,-48,15,-49,10,-49,4,-48,1,-46,-5,-43,-12
+,-40,-19,-36,-27,-33,-34,-30,-41,-29,-47,-28,-49,-27,-51,-25,-53,-23,-54,-21,-55,-19,-57,-16,-58,-14,-58,-11,-59,-8,-59,-6,-59,-3,-59,-1,-59,1,-59,3,-58
+,4,-57,5,-56,7,-54,8,-53,10,-51,12,-50,14,-49,17,-47,20,-46,23,-45,26,-45,30,-45,34,-46,38,-46,42,-46,45,-47,47,-47,52,-46,57,-40,62,-30
+,65,-18,67,-5,67,8,64,19,59,26,57,28,55,29,53,31,50,32,48,33,46,35,44,37,43,40,41,42,38,42,35,43,31,43,26,43,22,43,19,44
+,17,46,14,48,11,50,9,50,6,50,2,49,-1,48,-3,46,-5,44,-9,41,-12,37,-14,33,-15,28,-17,23,-18,18,-19,12,-20,6,-20,3,-19,0,-18,-2
+,-16,-5,-15,-7,-14,-9,-13,-12,-14,-15,-13,-19,-12,-23,-10,-27,-7,-30,-4,-32,0,-32,4,-30,10,-26,12,-24,15,-22,18,-21,21,-21,25,-20,28,-20,31,-19
+,33,-19,37,-16,37,-10,36,-4,36,0,35,2,34,3,32,4,30,5,28,6,25,7,23,8,22,11,20,13,18,15,17,16,15,16,13,15,12,14,11,12
+,11,11)">
+    <PARAM NAME="Line0005" VALUE="Polygon(17,-69,75,-71,75,-73,75,-74,74,-76,72,-77,69,-76,66,-75,64,-72,64,-69,64,-67,64,-66,63,-65,64,-64,67,-65,71,-66,74,-69,75)">
+    <PARAM NAME="Line0006" VALUE="Polygon(17,-64,88,-64,88,-65,87,-64,86,-64,85,-65,84,-65,82,-65,80,-64,80,-62,80,-60,81,-58,82,-57,84,-58,86,-60,87,-62,88,-64,88)">
+    <PARAM NAME="Line0007" VALUE="Polygon(15,-50,100,-51,99,-52,99,-52,98,-52,97,-52,96,-52,96,-51,95,-50,95,-49,95,-49,96,-48,97,-48,97,-48,99,-50,100)">
+  </OBJECT> </DIV>
+
+<DIV style="position:absolute;top:55px;left:553px;font-family:Verdana;font-size:8pt;color:444444;text-align:center;width:220px;letter-spacing:0.4em;line-height:170%;">
+  <p><span style="color:771111"><b><font color="#FFFFFF">XooPS</font></b></span><br />
+    <font color="#FFFFFF">eXtended object<br />
+    oriented<br />
+    Portal System</font></p>
+  <p><font color="#FFFFFF">...que más queres...</font></p>
+  </DIV>
+
+<table width="755" border="0" cellspacing="1" cellpadding="3" height="201" bgcolor="#CCCCCC">
+  <tr bgcolor="#CCCCCC">
+    <td colspan="2">
+      <div align="center"><font color="#333333" face="Tahoma" size="2"><b>X2 Theme for XooPS 2.0.x / Tema X2 para XooPS 2.0.x</b></font></div>
+    </td>
+  </tr>
+  <tr>
+    <td bgcolor="#333333" height="78" width="538"><font color="#CCCCCC" face="Tahoma" size="2">
+	<b>| Creators / Creadores </b>: w4z004 - Unfor<br />
+
+	<b>| E-mail / E-mail</b> : <a href="mailto:w4z004@hotmail.com">w4z004@hotmail.com</a><br />
+
+	<b>| This is a original work bassed in the ideas of </b>w4z004<br />
+	<b>| and the excelent and professional work of </b> Unfor<br />
+
+	<b>| Date / Fecha </b>: Feb. 2003<br />
+
+	<b>| Thanks to / Gracias a</b> : Chapi <b>for the graphic work colaboration </b><br />
+	<b>| </b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Aitor <b>for the enhancements into the theme </b><br />
+	<b>| </b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ralf57 <b> for the hidde/unhidde idea </b><br />
+	<b>| </b><br />
+
+	<b>| INSTALL:  upload the x2t.tar.gz file with the theme manager</b><br />
+	<b>| </b><br />
+
+	<b>| NEWS TWO COLUMNS: later of installed the theme with the theme manager into</b><br />
+	<b>| the news need upload or copy and paste the files </b> news_index.html <b>and </b><br />
+	<b>| </b> news_item.html <b> that are into the EXTRAS dir to the respective places and obtain</b><br />
+	<b>| a news with 2 columns.</b><br />
+	<b>| </b><br />
+
+	<b>| LAYOUT: into the EXTRAS dir too have a</b> theme.html<b> file that if you replace into</b><br />
+	<b>| the theme skin with copy and paste obtain that the center-center blocks</b><br />
+	<b>| appear in the top (now are changed to the bottom).  </b><br />
+	<b>| </b><br />
+
+	<b>| CHANGELOG:</b><br />
+	<b>| 27/02 - Removed the login in the headerbar.</b><br />
+	<b>|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Fixed the userinfo template</b><br />
+	<b>| </b><br />
+	<b>| 01/03 - Removed the skin changed to the new structure.</b><br />
+	<b>| </b><br />
+	<b>| 30/03 - Finished the notification templates, XHTML cleanup, </b><br />
+	<b>|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;and added scrolling to the top posters and new users blocks.</b><br />
+	<b>| </b><br />
+	<b>| 20/09 - Upgraded to xoops 2.0.4. </b><br />
+	<b>| </b><br />
+	<b>| 05/07/04 - Upgraded to xoops 2.0.6.</b><br />
+	<b>|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- Created the SmartFAQ module templates.</b><br />
+	<b>|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- Enhanced the CSS.</b><br />
+	<b>|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- Added the hidde/display effect for the notification system.</b><br />
+	<b>|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- Modified the main menu / user menu, and added graphics to this.</b><br />
+	<b>| </b><br />
+	<b>| 05/08/04 - Created the Liase module templates.</b><br />
+	<b>|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- Created the RSSfit module templates.</b><br />
+	<b>| </b><br />
+	<b>| 05/16/04 - Fixed the styleNN.css (thnx chapi).</b><br />
+	<b>|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- Cleaned to be 100% html transitional 1.0.</b><br />
+
+
+	<b>| </b><br />
+</font></td>
+
+    <td bgcolor="#333333" height="78" rowspan="4" width="202">&nbsp;</td>
+  </tr>
+  <tr>
+    <td bgcolor="#333333" width="538"><font color="#CCCCCC" face="Tahoma" size="2"><b>|</b>
+      Dedicated to all Xoops users.<br />
+      <b>|</b> Dedicado a todos los usuarios de Xoops.</font></td>
+  </tr>
+  <tr>
+    <td bgcolor="#333333" width="538"><font color="#CCCCCC" face="Tahoma" size="2"><b>|
+      ENGLISH SUPPORT :</b><br />
+      <b>|</b>&gt; <a href="http://www.xoops.org">http://www.xoops.org</a>
+      </font></td>
+  </tr>
+  <tr>
+    <td bgcolor="#333333" width="538"><font color="#CCCCCC" face="Tahoma" size="2"><b>|
+      SOPORTE EN CASTELLANO :</b><br />
+      <b>|</b>&gt; <a href="http://www.esxoops.com">http://www.esxoops.com</a><br />
+  </tr>
+</table>
+</body>
+</html>
Index: /temp/test-xoops.ec-cube.net/extras/theme_x2t/doc/readme.txt
===================================================================
--- /temp/test-xoops.ec-cube.net/extras/theme_x2t/doc/readme.txt	(revision 405)
+++ /temp/test-xoops.ec-cube.net/extras/theme_x2t/doc/readme.txt	(revision 405)
@@ -0,0 +1,57 @@
+X2 Theme for XooPS 2.0.x / Tema X2 para XooPS 2.0.x
+
+| Creators / Creadores : Unfor-w4z004
+
+| E-mail / E-mail : w4z004@hotmail.com
+
+| This is a original work bassed in the ideas of w4z004
+| and the excelent and professional work of Unfor
+
+| Date / Fecha : Feb. 2003
+
+| Thanks to / Gracias a : Chapi for the graphic work colaboration 
+|                         Aitor for the enhancements into the theme 
+|                         ralf57 for the hidde/unhidde idea
+ 
+| INSTALL: upload the x2t.tar.gz file with the theme manager
+
+| NEWS TWO COLUMNS: later of installed the theme with the theme manager into
+| the news need upload or copy and paste the files news_index.html and 
+| news_item.html that are into the EXTRAS dir to the respective places and obtain
+| a news with 2 columns.
+ 
+| LAYOUT: into the EXTRAS dir too have a theme.html file that if you replace into
+| the theme skin with copy and paste obtain that the center-center blocks
+| appear in the top (now are changed to the bottom). 
+
+| CHANGELOG:
+| 27/02 - Removed the login in the headerbar.
+|         Fixed the userinfo template
+
+| 01/03 - Removed the skin changed to the new structure
+
+| 30/03 - Finished the notification templates, XHTML cleanup, 
+|         and added scrolling to the top posters and new users blocks.
+
+| 20/09 - Upgraded to xoops 2.0.4.
+
+| 05/07/04 - Upgraded to xoops 2.0.6.
+|          - Created the SmartFAQ module templates.
+|          - Enhanced the CSS.
+|          - Added the hidde/display effect for the notification system.
+|          - Modified the main menu / user menu, and added graphics to this.
+
+| 05/08/04 - Created the Liase module templates.
+|          - Created the RSSfit module templates.
+
+| 05/16/04 - Fixed the styleNN.css (thnx chapi).
+|          - Cleaned to be 100% html transitional 1.0.
+
+| Dedicated to all Xoops users.
+| Dedicado a todos los usuarios de Xoops. 
+
+| ENGLISH SUPPORT :
+|> http://www.xoops.org  
+
+| SOPORTE EN CASTELLANO :
+|> http://www.esxoops.com
Index: /temp/test-xoops.ec-cube.net/extras/theme_x2t/extras/theme.html
===================================================================
--- /temp/test-xoops.ec-cube.net/extras/theme_x2t/extras/theme.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/extras/theme_x2t/extras/theme.html	(revision 405)
@@ -0,0 +1,146 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<{$xoops_langcode}>" lang="<{$xoops_langcode}>">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=<{$xoops_charset}>" />
+<meta http-equiv="content-language" content="<{$xoops_langcode}>" />
+<meta name="robots" content="<{$xoops_meta_robots}>" />
+<meta name="keywords" content="<{$xoops_meta_keywords}>" />
+<meta name="description" content="<{$xoops_meta_description}>" />
+<meta name="rating" content="<{$xoops_meta_rating}>" />
+<meta name="author" content="<{$xoops_meta_author}>" />
+<meta name="copyright" content="<{$xoops_meta_copyright}>" />
+<meta name="generator" content="XOOPS" />
+<title><{$xoops_sitename}> - <{$xoops_pagetitle}></title>
+<link href="<{$xoops_url}>/favicon.ico" rel="SHORTCUT ICON" />
+<link rel="stylesheet" type="text/css" media="all" href="<{$xoops_url}>/xoops.css" />
+<link rel="stylesheet" type="text/css" media="all" href="<{$xoops_themecss}>" />
+<script type="text/javascript">
+<!--
+<{$xoops_js}>
+//-->
+</script>
+</head>
+<body>
+<!-- Start Header -->
+<table cellspacing="0" cellpadding="0" width="100%" border="0" style="background-color : #2F5376; color: #ffffff">
+  <tr>
+    <td height="70" width="150" valign="middle" align="left" rowspan="2">
+    <a href="<{$xoops_url}>"><img src="<{$xoops_imageurl}>logo.gif" alt="" /></a></td>
+<td valign="middle" align="center" width="100%">
+<{$xoops_banner}>
+</td></tr><tr>
+    <td width="100%" valign="bottom" align="right" class="navbar" >
+	<table border="0" cellpadding="1" cellspacing="0">
+	   <tr>
+         <td class="tabOff" onmouseover="this.className='tabOn';" onmouseout="this.className='tabOff';"><a href="<{$xoops_url}>">Home</a></td>
+         <td class="tabOff" onmouseover="this.className='tabOn';" onmouseout="this.className='tabOff';"><a href="http://www.xoops.org/modules/newbb/">XOOPS Support</a></td>
+         <td class="tabOff" onmouseover="this.className='tabOn';" onmouseout="this.className='tabOff';"><a href="http://www.xoops.org/modules/xoopsfaq/">XOOPS FAQ</a></td>
+	   </tr>
+	</table>
+     </td>
+  </tr>
+</table>
+<!-- End Header -->
+<!-- Start Headerbar -->
+<table border='0' width='100%' cellspacing='0' cellpadding='0'>
+        <tr>
+          <td width='10'><img src='<{$xoops_imageurl}>hbar_left.gif' width='10' height='23' alt='' /></td>
+          <td style='background-image: url(<{$xoops_imageurl}>hbar_middle.gif);' align='left'>&nbsp;</td>
+<td width='15%' style='background-image: url(<{$xoops_imageurl}>hbar_middle.gif);' align='right'>
+<form action="<{$xoops_url}>/search.php" method="post">
+        <input type="text" name="query" class="navinput" /><input type="hidden" name="action" value="results" /> <input class="navinputImage" type="image" src="<{$xoops_imageurl}>searchButton.gif" name="searchSubmit" />
+    </form></td>
+          <td width='10'><img src='<{$xoops_imageurl}>hbar_right.gif' width='10' height='23' alt='' /></td>
+        </tr>
+</table>
+<!-- End Headerbar -->
+
+    <table width="100%"  cellspacing="0" cellpadding="0" border="0">
+  <tr>
+         <td class="leftcolumn" valign="top" style='background-image: url(<{$xoops_imageurl}>bg_left.gif);'><div class="leftcolumn">
+        <!-- Start left blocks loop -->
+        <{foreach item=block from=$xoops_lblocks}>
+          <{include file="x2t/theme_blockleft.html"}>
+        <{/foreach}>
+        <!-- End left blocks loop -->
+         </div></td>
+         <td width="100%" valign="top" class="contentbox">
+
+         <!-- Display center blocks if any -->
+         <{if $xoops_showcblock == 1}>
+<br />
+<table width="95%" border="0" cellpadding="0" cellspacing="0" align="center">
+<tr>
+<td class="bcenterleft">&nbsp;</td>
+<td class="bcenterbg">&nbsp;</td>
+<td class="bcenterright">&nbsp;</td>
+</tr>
+</table>
+
+         <table width="95%" cellpadding="3" cellspacing="0" align="center" style="border-left: #cccccc 1px solid;border-right: #cccccc 1px solid;border-bottom: #cccccc 1px solid;">
+              <tr>
+                <td class="centercolumn" valign="top" colspan="2">
+                <div class="centercolumn">
+              <!-- Start center-center blocks loop -->
+              <{foreach item=block from=$xoops_ccblocks}>
+              <{include file="x2t/theme_blockcenter_c.html"}>
+              <br />
+              <{/foreach}>
+              <!-- End center-center blocks loop -->
+                </div>
+                </td></tr>
+              <tr>
+                <td class="centerLcolumn" valign="top">
+                <div class="centerLcolumn">
+            <!-- Start center-left blocks loop -->
+              <{foreach item=block from=$xoops_clblocks}>
+                <{include file="x2t/theme_blockcenter_l.html"}>
+                <br />
+              <{/foreach}>
+            <!-- End center-left blocks loop -->
+                </div>
+               </td>
+                <td class="centerRcolumn" valign="top">
+                <div class="centerRcolumn">
+            <!-- Start center-right blocks loop -->
+              <{foreach item=block from=$xoops_crblocks}>
+                <{include file="x2t/theme_blockcenter_r.html"}>
+                <br />
+              <{/foreach}>
+            <!-- End center-right blocks loop -->
+                </div>
+       		   </td>
+              </tr>
+            </table>
+            <{/if}>
+            <!-- End display center blocks -->
+
+
+         <br />
+            <div class="content"><{$xoops_contents}></div>
+         </td>
+         <{if $xoops_showrblock == 1}>
+         <td class="rightcolumn" valign="top" align="right" style='background-image: url(<{$xoops_imageurl}>bg_right.gif);'><div class="rightcolumn">
+        <!-- Start right blocks loop -->
+        <{foreach item=block from=$xoops_rblocks}>
+          <{include file="x2t/theme_blockright.html"}>
+        <{/foreach}>
+        <!-- End right blocks loop -->
+         </div>
+         </td>
+<{else}>
+<td width='10' style='background-image: url(<{$xoops_imageurl}>bg_right2.gif);'><img src='<{$xoops_imageurl}>dummy.gif' width='10' height='10' alt='' /></td>
+<{/if}>
+   </tr>
+           <tr>
+          <td colspan="3" width="100%">
+
+<table border='0' width='100%' cellspacing='0' cellpadding='0'>
+        <tr>
+          <td width='10'><img src='<{$xoops_imageurl}>hbar_left.gif' width='10' height='23' alt='' /></td>
+          <td style='background-image: url(<{$xoops_imageurl}>hbar_middle.gif);' align='center'>&nbsp;<span class="copyright"><{$footer}></span></td>
+          <td width='10'><img src='<{$xoops_imageurl}>hbar_right.gif' width='10' height='23' alt='' /></td></tr>
+</table>
+</td></tr></table>
+</body>
+</html>
Index: /temp/test-xoops.ec-cube.net/extras/theme_x2t/extras/news_index.html
===================================================================
--- /temp/test-xoops.ec-cube.net/extras/theme_x2t/extras/news_index.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/extras/theme_x2t/extras/news_index.html	(revision 405)
@@ -0,0 +1,50 @@
+<{if $displaynav == true}>
+  <div style="text-align: center;">
+    <form name="form1" action="index.php" method="get">
+    <{$topic_select}> <select name="storynum"><{$storynum_options}></select> <input type="submit" value="<{$lang_go}>" class="formButton" /></form>
+  <hr />
+  </div>
+<{/if}>
+
+
+<{section name=i loop=$stories}>
+<{php}>
+global $totalarticulos;
+global $impar;
+$totalarticulos = $totalarticulos +1;
+<{/php}>
+<{/section}>
+
+<{php}>
+if (($totalarticulos % 2)==1){
+	$impar=true;
+	echo '<table width=100%><tr><td colspan=2 width="100%">';
+}else{
+	echo '<table width=100%><tr><td width="50%">';
+}
+<{/php}>
+<div style="text-align: right; margin: 10px;"><{$pagenav}></div>
+<br />
+<!-- start news item loop -->
+<{section name=i loop=$stories}>
+  <{include file="db:news_item.html" story=$stories[i]}>
+<{php}>
+global $contador;
+$contador = $contador +1;
+if ($contador && $impar && (!$arrancado)){
+	$arrancado = true;
+	$contador = 0;
+	echo "</td></tr><tr><td>";
+}else{
+	if (($contador % 2)==1){
+		echo "</td><td width='50%'>";
+	}else{
+		echo "</td></tr><tr><td width='50%'>";
+	}
+}
+<{/php}>
+<{/section}>
+</td></tr></table>
+<!-- end news item loop -->
+<div style="text-align: right; margin: 10px;"><{$pagenav}></div>
+<br />
Index: /temp/test-xoops.ec-cube.net/extras/theme_x2t/extras/news_item.html
===================================================================
--- /temp/test-xoops.ec-cube.net/extras/theme_x2t/extras/news_item.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/extras/theme_x2t/extras/news_item.html	(revision 405)
@@ -0,0 +1,44 @@
+<table width="100%" border="0" cellpadding="0" cellspacing="5" align="center">
+  <tr>
+    <td width="100%" valign="top" class="newsTitle" colspan="2"><img src="<{$xoops_imageurl}>/folder.gif" align="middle" alt="" /> <b><{$story.title}></b></td>
+  </tr>
+  <tr>
+    <td width="100%" colspan="2" class="newsPoster">  <{$lang_postedby}> <{$story.poster}> <span class="textPoster"><{$lang_on}> <{$story.posttime}> (<{$story.hits}> <{$lang_reads}>)</span></td>
+  </tr>
+  <tr>
+ <{if $story.align == "left" }>
+    <td width="17%" valign="top" class="newsMisc">
+    <table width="100%" border="0" cellpadding="0" cellspacing="0">
+    <tr>
+    <td width="100%" valign="top" align="center">
+    <{$story.imglink}></td>
+    <tr>
+    <td width="100%" valign="top" align="center" style="padding: 3px;">
+    <a href="print.php?storyid=<{$story.id}>" target="_BLANK"><{$lang_printerpage}></a>
+    <a target="_top" href="<{$story.mail_link}>"><{$lang_sendstory}></a>
+    </td></tr></table>
+    </td>
+    <td width="83%" class="newsContent" valign="top">
+    <{$story.text}>
+    </td>
+  <{else}>
+    <td width="83%" class="newsContent" valign="top">
+    <{$story.text}>
+    </td>
+    <td width="17%" valign="top" class="newsMisc">
+    <table width="100%" border="0" cellpadding="0" cellspacing="0">
+    <tr>
+    <tr>
+    <td width="100%" valign="top" align="center" style="padding: 3px;" class="newsPoster">
+   <a href="print.php?storyid=<{$story.id}>" target="_BLANK"><img src="images/print.gif" alt="<{$lang_printerpage}>" /></a>
+    <a target="_top" href="<{$story.mail_link}>"><img src="images/friend.gif" alt="<{$lang_sendstory}>" /></a>
+    </td></tr></table>
+
+    </td>
+  <{/if}>
+  </tr>
+  <tr>
+    <td width="100%" colspan="2" class="newsPoster" align="right"><span class="textPoster"><{$story.adminlink}> <{$story.morelink}>  </span></td>
+  </tr>
+</table>
+<br />
Index: /temp/test-xoops.ec-cube.net/docs/INSTALL.ja.html
===================================================================
--- /temp/test-xoops.ec-cube.net/docs/INSTALL.ja.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/docs/INSTALL.ja.html	(revision 405)
@@ -0,0 +1,254 @@
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=EUC-JP">
+<title>Xoops¥¤¥ó¥¹¥È¡¼¥ë¥¬¥¤¥É</title>
+  <meta name="keywords" content="XOOPS docs" />
+  <meta name="description" content="XOOPS" />
+  <style>
+    P, TD, LI, INPUT, BODY, SELECT, TEXTAREA { font-family: Verdana; font-size: 13px; line-height: 1.3 }
+    .error { color: #CC3333; font-weight: bold; }
+    UL { margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px; }
+    OL { margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px; }
+    .indent { margin-left: 40px; }
+    FORM { margin: 0px; padding: 0px; }
+    
+    H1, H2, H3, H4, H5 { margin: 0px; padding: 0px; }
+    
+    .additions { color: #008800; }
+    .deletions { color: #880000; }
+    
+	.header { padding: 10px; padding-top: 0px }
+    .page { background-color: #FFFFFF; padding: 10px; border: 1px inset;}
+	.footer { background-color: #DDDDDD; padding: 5px 10px; border: 1px inset; border-top: none; border-top: 1px solid #CCCCCC }
+	.code { background: #FFFFFF; border: solid #888888 2px; font-family: "Courier New"; color: black; font-size: 10pt; width: 100%; height: 400px; overflow: scroll; padding: 3px; }
+
+    .revisioninfo { color: #AAAAAA; padding-bottom: 20px; }
+	
+	.copyright { font-size: 11px; color: #AAAAAA; text-align: right; }
+	.copyright A { color: #AAAAAA; }
+</style>
+</head>
+
+<body bgcolor="#F8F8F8" text="#000000">
+<!-- ËÝÌõ¡¦¥­¥ã¥×¥Á¥ãEw111¡¢ÊÑ¹¹¡§haruki -->
+<div class="page">
+<h3>XOOPS¤Î¥¤¥ó¥¹¥È¡¼¥ëÊýË¡</h3>
+<hr noshade size="1" />
+<br />
+<h4>¤Ï¤¸¤á¤Æ¤Î¥¤¥ó¥¹¥È¡¼¥ë</h4>
+<br /><br />
+<h4>¤Ï¤¸¤á¤Ë</h4>
+<p>
+XOOPS¤Î¥¤¥ó¥¹¥È¡¼¥ë¤ò»Ï¤á¤ëÁ°¤Ë¡¢¥µ¡¼¥Ð¾å¤Ç²ÔÆ°¡¦±¿ÍÑ¤¹¤ë¥½¥Õ¥È¥¦¥¨¥¢¤Î¥¤¥ó¥¹¥È¡¼¥ë¤ä´ÉÍý¤Ë¤Ä¤¤¤Æ¤ÎÃÎ¼±¤ò½¬ÆÀ¤µ¤ì¤ë¤è¤¦¡¢¤ª¤¹¤¹¤á¤·¤Þ¤¹¡£
+¿ÍÀ¸¤ÈÆ±¤¸¤Ç¡¢´ÊÃ±¤ÊÊýË¡¤äÅú¤¨¤Ï¤¢¤ê¤Þ¤»¤ó¡£
+XOOPS¤Ï¥µ¡¼¥Ð¥Ù¡¼¥¹¤Î¥½¥Õ¥È¥¦¥¨¥¢¤Ç¡¢³§¤µ¤ó¤¬¤è¤¯¤´Â¸ÃÎ¤Î¥Ç¥¹¥¯¥È¥Ã¥×¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Û¤É´ÊÃ±¤Ë¤Ï¥¤¥ó¥¹¥È¡¼¥ë¤Ç¤­¤Þ¤»¤ó¤Î¤Ç¡¢
+°Ê²¼¤Ç¼¨¤¹¥½¥Õ¥È¥¦¥¨¥¢¤Î¥¤¥ó¥¹¥È¡¼¥ë¤äÀßÄê¤ò½¬ÆÀ¤·¤Æ¤¯¤À¤µ¤¤¡£
+¤³¤Îµ¡²ñ¤ËCGI¥¹¥¯¥ê¥×¥È¤ä¡¢HTTP¥µ¡¼¥Ð¤ÎÀßÄê¤Ë¾Ü¤·¤¯¤Ê¤Ã¤Æ¤·¤Þ¤¤¤Þ¤·¤ç¤¦¡£
+»ä¤¿¤Á¤Ë´ó¤»¤é¤ì¤ë¼ÁÌä¤Î£¸£°¡ó¤Ï¡¢¥µ¡¼¥ÐÀßÄê¤Î´Ö°ã¤¤¤ä¡¢¥µ¡¼¥Ð¥½¥Õ¥È¥¦¥¨¥¢Æ±»Î¤ÎÄÌ¿®¾×ÆÍ¤Ë¸¶°ø¤¬¤¢¤ê¤Þ¤¹¡£
+¤É¤ó¤Ê¥µ¡¼¥Ð¤Ç¤â¡¢¤Þ¤Ã¤¿¤¯Æ±¤¸¤è¤¦¤Ë¹½À®¤µ¤ì¤Æ¤¤¤ë¤â¤Î¤Ï£±¤Ä¤â¤Ê¤¯¡¢
+¼«Ê¬¤Î´Ä¶­¤Ë¹ç¤ï¤»¤ÆÅ¬ÀÚ¤Ë¹½À®¤·¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
+</p>
+
+<p>
+¤Ï¤¸¤á¤ÆXOOPS¤ò¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¾ì¹ç¡¢
+¾¯¤Ê¤¯¤È¤â°Ê²¼¤Î¥½¥Õ¥È¥¦¥¨¥¢¤ò¥µ¡¼¥Ð¥³¥ó¥Ô¥å¡¼¥¿¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤·¤Æ¤ª¤¯É¬Í×¤¬¤¢¤ê¤Þ¤¹¡£
+</p>
+<div class="indent">
+* HTTP¥µ¡¼¥Ð (<a href="http://www.apache.org">Apache</a> ¤Þ¤¿¤Ï IIS) Ãí¡§XOOPS¸ø¼°¥µ¥Ý¡¼¥ÈHTTP¥µ¡¼¥Ð¤ÏApache<br />
+* <a href="http://www.php.net">PHP</a> 4.1.0 °Ê¾å (4.1.1 °Ê¾å¤ò¿ä¾©)<br />
+* <a href="http://www.mysql.com">MySQL</a> ¥Ç¡¼¥¿¥Ù¡¼¥¹ 3.23.XX<br />
+</div>
+
+<p>¥¤¥ó¥¹¥È¡¼¥ë¤ò»Ï¤á¤ëÁ°¤Ë¼¡¤Î½àÈ÷¤ò¤·¤Æ¤¯¤À¤µ¤¤</p>
+<div class="indent">
+* HTTP¥µ¡¼¥Ð¡¢PHP¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¥µ¡¼¥Ð¤òÅ¬ÀÚ¤Ë¥»¥Ã¥È¥¢¥Ã¥×¤¹¤ë¡£<br />
+*  <a href="http://www.xoops.org">XOOPS</a>¤ò¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¥Ç¡¼¥¿¥Ù¡¼¥¹¤òºîÀ®¤¹¤ë¡£<br />
+<div class="indent">
+¡Ê¤â¤·¡¢ºîÀ®¤¹¤ë¸¢¸Â¤¬¤Ê¤¤¾ì¹ç¤Ï¡¢¥µ¡¼¥Ð´ÉÍý¼Ô¤«¥µ¡¼¥Ð¥Û¥¹¥Æ¥£¥ó¥°²ñ¼Ò¤Ë°ÍÍê¤·¤Æ¤¯¤À¤µ¤¤¡£¡Ë<br />
+</div>
+* ¾åµ­¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤ë¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¥µ¡¼¥Ð¤Î¥æ¡¼¥¶¥¢¥«¥¦¥ó¥È¤ò½àÈ÷¤¹¤ë¡£<br />
+* XOOPS¤Î¥Õ¥¡¥¤¥ë¤ò¥µ¡¼¥Ð¤Ë¥¢¥Ã¥×¥í¡¼¥É¤·¡¢¡Öuploads/¡×¡¢¡Öcache/¡×¡¢¡Ötemplates_c/¡×¥Ç¥£¥ì¥¯¥È¥ê¡¢
+¤ª¤è¤Ó¡Ömainfile.php¡×¥Õ¥¡¥¤¥ë¤Î¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤òPHP¤«¤é½ñ¤­¹þ¤ß²ÄÇ½¤ËÀßÄê¤¹¤ë¡£
+<br />
+* ¥Ö¥é¥¦¥¶¤Î¥¯¥Ã¥­¡¼¤È<span class="missingpage">JavaScript</span>¤òÍ­¸ú¤Ë¤¹¤ë¡£<br />
+</div>
+<br />
+
+<h4>¥í¡¼¥«¥ë´Ä¶­¤Ø¤Î¥¤¥ó¥¹¥È¡¼¥ë</h4>
+<p>
+³«È¯ºî¶È¤ä¥Æ¥¹¥È¤Î¤¿¤á¤ËXOOPS¤ò¥í¡¼¥«¥ë´Ä¶­¤Ç¼Â¹Ô¤µ¤»¤ë¾ì¹ç¤Ë¤Ï¡¢
+¤³¤ì¤Þ¤Ç¤Ë½Ò¤Ù¤¿ÄÌ¤ê¤Ë¥µ¡¼¥Ð¥½¥Õ¥È¥¦¥¨¥¢¤È¤½¤ÎÀßÄê¤¬½àÈ÷¤Ç¤­¤Æ¤¤¤ë¤«³ÎÇ§¤·¤Æ¤¯¤À¤µ¤¤¡£
+¼¡¤Ë¡¢XOOPS¤Î¥Ñ¥Ã¥±¡¼¥¸¤Ë´Þ¤Þ¤ì¤ë¡Öhtml¡×¥Ç¥£¥ì¥¯¥È¥ê¤Î¤¹¤Ù¤Æ¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ä¥Õ¥¡¥¤¥ë¤ò¡¢
+¥³¥ó¥Ô¥å¡¼¥¿¤Î¥É¥­¥å¥á¥ó¥È¥ë¡¼¥È°Ê²¼¤Ë¥³¥Ô¡¼¤·¤Þ¤¹¡£
+ ¥³¥Ô¡¼¸å¡¢¥Ö¥é¥¦¥¶¤Î¥¢¥É¥ì¥¹¤Ë¡Öhttp://¤¢¤Ê¤¿¤Î£Õ£Ò£Ì¡×¡Ê¤Þ¤¿¤Ï¡Öhttp://127.0.0.1¡×)¤ÈÆþÎÏ¤¹¤ë¤È¡¢
+¼«Æ°Åª¤Ë¥¤¥ó¥¹¥È¡¼¥ë¥¦¥£¥¶¡¼¥É¤¬³«»Ï¤µ¤ì¤Þ¤¹¡£
+</p>
+
+<h4>¥¤¥ó¥¿¡¼¥Í¥Ã¥È¾å¤Î¥µ¡¼¥Ð¤Ø¤Î¥¤¥ó¥¹¥È¡¼¥ë</h4>
+<p>
+¥¤¥ó¥¿¡¼¥Í¥Ã¥È¤ËÀÜÂ³¤µ¤ì¤¿¥µ¡¼¥Ð¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¤Ë¤Ï¡¢¤Þ¤ºXOOPS¥Õ¥¡¥¤¥ë¤ò¥í¡¼¥«¥ë¤Ê¼«Ê¬¤Î¥³¥ó¥Ô¥å¡¼¥¿¤Ç²òÅà¤·¤Þ¤¹¡£
+¤â¤·¡¢¥µ¡¼¥Ð¤Ø¤Îtelnet¤«SSH¥¢¥¯¥»¥¹¤òµö²Ä¤µ¤ì¤Æ¤¤¤ë¤Ê¤é¡¢¥µ¡¼¥Ð¤Ç²òÅà¤·¤Æ¤â¤«¤Þ¤¤¤Þ¤»¤ó¡£
+²òÅà¤¬ºÑ¤ó¤À¤éXOOPS¤Î¡Öhtml¡×Æâ¤Ë¤¢¤ë¤¹¤Ù¤Æ¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ä¥Õ¥¡¥¤¥ë¤ò¡¢
+¥Û¥¹¥È¥³¥ó¥Ô¥å¡¼¥¿¤Î¥É¥­¥å¥á¥ó¥È¥ë¡¼¥È¤Ë¡ÊFTP¤ò»È¤Ã¤Æ¡¢¤Þ¤¿¤Ï¡¢telnet¤«SSH¤ò»È¤Ã¤Æ¡Ë¥³¥Ô¡¼¡¦°ÜÆ°¤·¤Þ¤¹¡£
+¡Ê¤â¤·¡¢¥É¥­¥å¥á¥ó¥È¥ë¡¼¥È¤¬¤ï¤«¤é¤Ê¤¤¾ì¹ç¤Ï¡¢¥µ¡¼¥Ð´ÉÍý¼Ô¤«¡¢ÍøÍÑ¤·¤Æ¤¤¤ë¥µ¡¼¥Ð¥Û¥¹¥Æ¥£¥ó¥°²ñ¼Ò¤ËÌä¤¤¹ç¤ï¤»¤Æ¤¯¤À¤µ¤¤¡Ë¡£ 
+Å¾Á÷¸å¡¢¥Ö¥é¥¦¥¶¤Î¥¢¥É¥ì¥¹¤Ë¡Öhttp://¤¢¤Ê¤¿¤Î¥µ¥¤¥È¤Î£Õ£Ò£Ì¡×¤ÈÆþÎÏ¤¹¤ë¤È¡¢¥¤¥ó¥¹¥È¡¼¥ë¥¦¥£¥¶¡¼¥É¤¬³«»Ï¤µ¤ì¤Þ¤¹¡£
+¡Ê¤³¤Î¤È¤­¡¢É¬¤ººÇ½ªÅª¤Ë¥æ¡¼¥¶¤¬¥¢¥¯¥»¥¹¤¹¤ë£Õ£Ò£Ì¤Ç¥¢¥¯¥»¥¹¤·¤Æ¤¯¤À¤µ¤¤¡£
+IP¥¢¥É¥ì¥¹Åù¤Ç¥¢¥¯¥»¥¹¤¹¤ë¤È¤¦¤Þ¤¯¤¤¤­¤Þ¤»¤ó¡£
+</p>
+
+<h4>¥¤¥ó¥¹¥È¡¼¥ë¡¡¥¹¥Æ¥Ã¥×¡¦¥Ð¥¤¡¦¥¹¥Æ¥Ã¥×</h4>
+<p>
+¤³¤ì¤Þ¤Ç¤Ë½Ò¤Ù¤¿ÄÌ¤ê¤Ëºî¶È¤¹¤ë¤È¡¢¥¤¥ó¥¹¥È¡¼¥ë¥¦¥£¥¶¡¼¥É²èÌÌ¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£
+ºÇ½é¤Î¥¦¥£¥¶¡¼¥É²èÌÌ¤Ç¤Ï¥¤¥ó¥¹¥È¡¼¥é¤Î¸À¸ìÉ½¼¨¤Î¼ïÎà¤òÁªÂò¤·¤Þ¤¹¡£
+ÆüËÜ¸ìÉ½¼¨¤Ë¤¹¤ë¤Ë¤Ï¡¢¥ê¥¹¥È¥Ü¥Ã¥¯¥¹¤«¤é¡Öjapanese¡×¤òÁªÂò¤·¤Æ¡¢¡ÖNext¡×¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤Þ¤¹¡£
+<br /><br />
+<img src="images/japanese/install001.gif" width="778" height="325" border="0" alt="img2.gif">
+</p>
+
+<p>
+¡ÖXOOPS 2.0 ¥¤¥ó¥¹¥È¡¼¥ë¥¦¥£¥¶¡¼¥É¤Ø¤è¤¦¤³¤½¡×²èÌÌ¤¬É½¼¨¤µ¤ì¤Þ¤¹¤Î¤Ç¡¢ÆâÍÆ¤ò¤è¤¯ÆÉ¤ß¡Ö¼¡¤Ø¡×¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤Æ¿Ê¤ß¤Þ¤¹¡£
+¡ÊÆÃ¤Ë<b><u>½àÈ÷</u></b>¤ò¤â¤¦°ìÅÙ¤è¤¯ÆÉ¤ó¤Ç¡¢¥¤¥ó¥¹¥È¡¼¥ë¤Î½àÈ÷¤¬¤Ç¤­¤Æ¤¤¤ë¤«¤É¤¦¤«³ÎÇ§¤·¤Æ¤¯¤À¤µ¤¤¡£¡Ë
+<br /><br />
+<img src="images/japanese/install002.gif" width="778" height="705" border="0" alt="img3.gif">
+</p>
+
+<p>
+¼¡¤Î¥¦¥£¥¶¡¼¥É²èÌÌ¤Ë¤Ï¡¢¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤¬Àµ¤·¤¯ÀßÄê¤µ¤ì¤Æ¤¤¤ë¤«¤É¤¦¤«¤Î³ÎÇ§·ë²Ì¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£
+ÀèÆ¬¤ËÎÐ¿§¤Î¿®¹æ¤¬ÉÕ¤¤¤¿¥Ç¥£¥ì¥¯¥È¥ê¤È¥Õ¥¡¥¤¥ë¤Ï¡¢¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤¬Àµ¤·¤¯ÀßÄê¤µ¤ì¤Æ¤¤¤ë¤â¤Î¤Ç¤¹¡£
+ÀèÆ¬¤ËÀÖ¿§¤Î¿®¹æ¤¬ÉÕ¤¤¤¿¤â¤Î¤Ï¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤¬Àµ¤·¤¯ÀßÄê¤µ¤ì¤Æ¤¤¤Ê¤¤¤Î¤Ç¡¢
+¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤òPHP¤«¤é½ñ¤­¹þ¤ß²ÄÇ½¤ØÀßÄê¤·Ä¾¤·¤Æ¤¯¤À¤µ¤¤¡£
+¡Ê¤è¤¯Ê¬¤«¤é¤Ê¤¤¾ì¹ç¡¢ÄÌ¾ïchmod 777¤È¤·¤ÆÌäÂê¤¢¤ê¤Þ¤»¤ó¡£¡Ë
+Win32´Ä¶­¤Ç¥¤¥ó¥¹¥È¡¼¥ë¤ò¼Â¹Ô¤·¤Æ¤¤¤ë¾ì¹ç¤Ë¤ÏÄÌ¾ï¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤òÀßÄê¤¹¤ëÉ¬Í×¤Ï¤¢¤ê¤Þ¤»¤ó¤Î¤Ç¡¢
+¤¹¤Ù¤Æ¤Î¥Ç¥£¥ì¥¯¥È¥ê¤È¥Õ¥¡¥¤¥ë¤ËÎÐ¿§¤Î¿®¹æ¤¬É½¼¨¤µ¤ì¤ë¤Ï¤º¤Ç¤¹¡£
+Unix´Ä¶­¤Ç¥¤¥ó¥¹¥È¡¼¥ë¤ò¼Â¹Ô¤·¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢³Æ¥Ç¥£¥ì¥¯¥È¥ê¤È¥Õ¥¡¥¤¥ë¤ËÀµ¤·¤¤¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤òÀßÄê¤¹¤ëÉ¬Í×¤¬¤¢¤ê¤Þ¤¹¡£
+²èÌÌ¤Î¤è¤¦¤Ë¤¹¤Ù¤Æ¤¬ÎÐ¿§¤Î¿®¹æ¤ÇÉ½¼¨¤µ¤ì¤¿¤é¡¢¡Ö¼¡¤Ø¡×¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤Æ¿Ê¤ß¤Þ¤¹¡£ <br />
+<br />
+<img src="images/japanese/install003.gif" width="777" height="367" border="0" alt="img4.gif">
+</p>
+
+<p>
+¼¡¤Î¥¦¥£¥¶¡¼¥É²èÌÌ¤Ë¤Ï¡¢XOOPS¤ò¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê¤ä¥Ö¥é¥¦¥¶¤Ç¥¢¥¯¥»¥¹¤¹¤ë¤¿¤á¤ÎURL¤Ê¤É¡¢
+¡Ö¥Ç¡¼¥¿¥Ù¡¼¥¹¡¢¤ª¤è¤Ó¥Ñ¥¹¡¦URL¤ÎÀßÄê¡×¤ÎÆþÎÏ¥Õ¥©¡¼¥à¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£
+<br><br>
+¡Ö¥Ç¡¼¥¿¥Ù¡¼¥¹¥µ¡¼¥Ð¡×¤Ë¤Ï¡¢»ÈÍÑ¤¹¤ë¥Ç¡¼¥¿¥Ù¡¼¥¹¥µ¡¼¥Ð¤Î¼ïÎà¤ò»ØÄê¤·¤Þ¤¹¡£
+<br><br>
+¡Ö¥Ç¡¼¥¿¥Ù¡¼¥¹¥µ¡¼¥Ð¤Î¥Û¥¹¥ÈÌ¾¡×¤Ë¤Ï¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¥µ¡¼¥Ð¤Î¥Û¥¹¥ÈÌ¾¤òÆþÎÏ¤·¤Þ¤¹¡£
+¤Û¤È¤ó¤É¤Î¾ì¹ç¡¢localhost¤È¤¤¤¦Ì¾Á°¤Ç¤¹¤¬¡¢
+É¬¤º¥µ¥¤¥È´ÉÍý¼Ô¤ä¥µ¡¼¥Ð¤Î¥Û¥¹¥Æ¥£¥ó¥°²ñ¼Ò¤ËÌä¤¤¹ç¤ï¤»¤Æ¡¢Àµ¤·¤¤¥Ç¡¼¥¿¥Ù¡¼¥¹¥Û¥¹¥ÈÌ¾¤òÆþÎÏ¤·¤Þ¤¹¡£
+<br><br>
+¡Ö¥Ç¡¼¥¿¥Ù¡¼¥¹¥æ¡¼¥¶Ì¾¡×¤È¡Ö¥Ç¡¼¥¿¥Ù¡¼¥¹¥Ñ¥¹¥ï¡¼¥É¡×¤Ë¤Ï¡¢
+XOOPS¤¬¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÀÜÂ³¤¹¤ëºÝ¤Ë»ÈÍÑ¤¹¤ë¥æ¡¼¥¶Ì¾¤È¥Ñ¥¹¥ï¡¼¥É¤òÆþÎÏ¤·¤Þ¤¹¡£
+¡Ê¥Æ¥¹¥ÈÍÑ¤Î¥í¡¼¥«¥ë´Ä¶­°Ê³°¤Ç¤Ï¡¢¥»¥­¥å¥ê¥Æ¥£¡¼¾åroot¥æ¡¼¥¶¤È¤¹¤Ù¤­¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£
+¤Þ¤¿¡¢¥Û¥¹¥Æ¥£¥ó¥°¥µ¡¼¥Ó¥¹¤òÍøÍÑ¤Î¾ì¹ç¤Ï¡¢¥Û¥¹¥Æ¥£¥ó¥°²ñ¼Ò¤«¤é¤¢¤Ê¤¿¤¬»ÈÍÑ¤Ç¤­¤ë¥æ¡¼¥¶Ì¾¤¬ÃÎ¤é¤µ¤ì¤Æ¤¤¤ë¤Ï¤º¤Ç¤¹¡£¡Ë
+<br />
+¡Ö¥Ç¡¼¥¿¥Ù¡¼¥¹Ì¾¡×¤Ë¤Ï¡¢XOOPS¤Ç»È¤¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎÌ¾Á°¤òÆþÎÏ¤·¤Þ¤¹¡£
+¾åµ­¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¥æ¡¼¥¶¤Ï¡¢¤³¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥¢¥¯¥»¥¹¡¦Áàºî¸¢¸Â¤ò»ý¤ÄÉ¬Í×¤¬¤¢¤ê¤Þ¤¹¡£
+¥Û¥¹¥Æ¥£¥ó¥°¥µ¡¼¥Ó¥¹¤òÍøÍÑ¤Î¾ì¹ç¤Ï¡¢¥Û¥¹¥Æ¥£¥ó¥°²ñ¼Ò¤«¤é»ÈÍÑ¤Ç¤­¤ë¥Ç¡¼¥¿¥Ù¡¼¥¹Ì¾¤¬»ØÄê¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤¬¤¢¤ê¤Þ¤¹¡£
+<br><br>
+¡Ö¥Æ¡¼¥Ö¥ëÀÜÆ¬¸ì¡×¤Ë¤ÏXOOPS¤¬»È¤¦¥Æ¡¼¥Ö¥ëÌ¾¤ÎÀèÆ¬¤ËÉÕ¤±¤ëÀÜÆ¬¸ì¤òÆþÎÏ¤·¤Þ¤¹¡£
+¥Æ¡¼¥Ö¥ëÀÜÆ¬¸ì¤Ï¡¢¤Û¤«¤Î¥½¥Õ¥È¥¦¥¨¥¢¤¬»ÈÍÑ¤¹¤ë¥Æ¡¼¥Ö¥ëÌ¾¤È¤Î½ÅÊ£¤ò¤µ¤±¤ë¤¿¤á¤Î¤â¤Î¤Ç¤¹¡£
+¤¢¤Þ¤êÄ¹¤¤¤â¤Î¤Ë¤·¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¤³¤È¤¬Ë¾¤Þ¤·¤¤¤Ç¤¹¡£
+<br><br>
+¡Ö¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø»ýÂ³ÅªÀÜÂ³¡×¤Ï¡¢¤è¤¯Ê¬¤«¤é¤Ê¤¤¾ì¹ç¤Ï¡¢½é´üÀßÄê¤Î¤Þ¤Þ¡Ö¤¤¤¤¤¨¡×¤òÁªÂò¤·¤Þ¤¹¡£
+<br><br>
+¡ÖXOOPS¤Ø¤Î¥Ñ¥¹¡×¤Ë¤Ï¡¢¥Û¥¹¥È¥³¥ó¥Ô¥å¡¼¥¿¤Ë¤ª¤±¤ë¡¢XOOPS¤Þ¤Ç¤Î¥Õ¥ë¥Ñ¥¹¤òÆþÎÏ¤·¤Þ¤¹¡£<br>
+¡ÖXOOPS¤Ø¤ÎURL¡×¤Ë¤Ï¡¢¥Ö¥é¥¦¥¶¤ÇXOOPS¤Ë¥¢¥¯¥»¥¹¤¹¤ë¤¿¤á¤ÎURL¤òÆþÎÏ¤·¤Þ¤¹¡£<br>
+ÆþÎÏ¥Õ¥©¡¼¥à¤Ë¤Ï¼«Æ°¤ÇÇ§¼±¤µ¤ì¤¿ÃÍ¤¬Æþ¤Ã¤Æ¤¤¤Þ¤¹¤¬¡¢É¬¤ºÀµ¤·¤¤¤«¤É¤¦¤«³ÎÇ§¤·¤Æ¤¯¤À¤µ¤¤¡£
+ÉÔÌÀ¤Ê¾ì¹ç¤Ï¡¢¥µ¡¼¥Ð´ÉÍý¼Ô¤ä¥Û¥¹¥Æ¥£¥ó¥°²ñ¼Ò¤ËÌä¤¤¹ç¤ï¤»¤Æ¡¢Àµ¤·¤¯ÆþÎÏ¤·¤Æ¤¯¤À¤µ¤¤¡£
+¤Þ¤¿¡¢Windows¤Ç¤Ï¥Ñ¥¹¤Î¶èÀÚ¤êµ­¹æ¤Ë¡Ö¡ï¡×¤ò»È¤¤¤Þ¤¹¤¬¡¢¤³¤³¤Ç¤Ï¡Ö/¡×¤ò»È¤Ã¤Æ¤¯¤À¤µ¤¤¡£
+¤Þ¤¿¡¢ºÇ¸å¤Ø¡Ö.../htdocs/¡×¤Î¤è¤¦¤Ë¡Ö/¡×¤òÆþÎÏ¤·¤Ê¤¤¤Ç¤¯¤À¤µ¤¤¡£
+<br><br>
+¤¹¤Ù¤Æ¤Î¹àÌÜ¤òÆþÎÏ¤·¤¿¤é¡Ö¼¡¤Ø¡×¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤Æ¿Ê¤ß¤Þ¤¹¡£
+<br /><br />
+<img src="images/japanese/install004.gif" width="777" height="621" border="0" alt="img6.gif"><br />
+</p>
+
+<p>
+¼¡¤Î¥¦¥£¥¶¡¼¥É²èÌÌ¤Ë¤Ï¡¢Á°¤Î¥Õ¥©¡¼¥à¤ÇÆþÎÏ¤·¤¿¡Ö¥Ç¡¼¥¿¥Ù¡¼¥¹¡¢¤ª¤è¤Ó¥Ñ¥¹¡¦URL¤ÎÀßÄê¡×¤ÎÆâÍÆ¤¬°ìÍ÷·Á¼°¤ÇÉ½¼¨¤µ¤ì¤Þ¤¹¡£
+¥¤¥ó¥¹¥È¡¼¥ë¤¬¼ºÇÔ¤¹¤ë¸¶°ø¤Î¤Û¤È¤ó¤É¤Ï¡¢ÀßÄêÆâÍÆ¤òÃí°Õ¿¼¤¯³ÎÇ§¤·¤Æ¤¤¤Ê¤¤¤³¤È¤Ë¤è¤ë¤â¤Î¤Ç¤¹¡£
+¤â¤·¡¢´Ö°ã¤Ã¤Æ¤¤¤¿¤é¡ÖÌá¤ë¡×¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤ÆÆþÎÏ¤ò¤ä¤êÄ¾¤·¤Þ¤¹¡£
+°ìÍ÷¤¬Àµ¤·¤±¤ì¤Ð¡Ö¼¡¤Ø¡×¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤Æ¿Ê¤ß¤Þ¤¹¡£
+<br><br />
+<img src="images/japanese/install005.gif" width="779" height="459" border="0" alt="img7.gif">
+</p>
+
+<p>
+ÆþÎÏ¤·¤¿¡Ö¥Ç¡¼¥¿¥Ù¡¼¥¹¡¢¤ª¤è¤Ó¥Ñ¥¹¡¦URL¤ÎÀßÄê¡×¤ÎÆâÍÆ¤¬XOOPS¤ÎÀßÄê¥Õ¥¡¥¤¥ë¡Ömainfile.php¡×¤Ë½ñ¤­¹þ¤Þ¤ì¡¢
+¼¡¤Î¥¦¥£¥¶¡¼¥É²èÌÌ¤Ë½ñ¤­¹þ¤ß½èÍý¤Î·ë²Ì¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£
+ÀèÆ¬¤ËÎÐ¿§¤Î¿®¹æ¤¬ÉÕ¤¤¤¿½ñ¤­¹þ¤ß½èÍý¤ÏÀµ¾ï¤Ë¼Â¹Ô¤Ç¤­¤Æ¤¤¤Þ¤¹¡£
+¤¹¤Ù¤Æ¤¬Àµ¾ï¤Ë½ñ¤­¹þ¤ß½èÍý¤Ç¤­¤¿¤³¤È¤ò³ÎÇ§¤·¤¿¤é¡¢¡Ö¼¡¤Ø¡×¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤Æ¿Ê¤ß¤Þ¤¹¡£
+<br><br />
+<img src="images/japanese/install006.gif" width="777" height="504" border="0" alt="img9.gif">
+</p>
+
+<p>
+mainfile.php¤Ë½ñ¤­¹þ¤Þ¤ì¤¿XOOPS¥Ç¥£¥ì¥¯¥È¥ê¤Ø¤Î¥Ñ¥¹¤ÈXOOPS¤Ø¤ÎURL¤¬¥¦¥£¥¶¡¼¥É¤Ë¤è¤Ã¤Æ¸¡¾Ú¤µ¤ì¡¢
+¼¡¤Î¥¦¥£¥¶¡¼¥É²èÌÌ¤Ë¤½¤Î¸¡¾Ú·ë²Ì¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£
+ÀèÆ¬¤ËÎÐ¿§¤Î¿®¹æ¤¬ÉÕ¤¤¤¿¸¡¾Ú·ë²Ì¤ÏÀµ¾ï¤Ê¤Î¤Ç¡¢¡Ö¼¡¤Ø¡×¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤Æ¿Ê¤ß¤Þ¤¹¡£
+ÀèÆ¬¤ËÀÖ¿§¤Î¿®¹æ¤¬ÉÕ¤¤¤¿¾ì¹ç¤Ï¡¢¥¤¥ó¥¹¥È¡¼¥é¤¬¸¡½Ð¤·¤¿¥Ñ¥¹¤È£Õ£Ò£Ì¤¬¡¢ÀßÄê¤µ¤ì¤¿¤â¤Î¤ÈÈø°Û¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£
+¾åµ­¤ÇÀßÄê¤·¤¿¹àÌÜ¤¬Àµ¤·¤¤¤«³ÎÇ§¤·¤Æ¤¯¤À¤µ¤¤¡£
+´Ö°ã¤Ã¤Æ¤¤¤¿¾ì¹ç¤Ï¡¢¥¤¥ó¥¹¥È¡¼¥ë¤ò¤Ï¤¸¤á¤«¤é¤ä¤êÄ¾¤·¤Æ¤¯¤À¤µ¤¤¡£
+¡Ê¥µ¡¼¥Ð¤ÎÀßÄê¤Ë¤è¤Ã¤Æ¤Ï¡¢¤Þ¤ì¤Ë¡¢ÀßÄê¤¬Àµ¤·¤¯¤Æ¤â¥¨¥é¡¼¤È¤Ê¤ë¾ì¹ç¤¬¤¢¤ê¤Þ¤¹¡£¤½¤ÎºÝ¤Ï¡¢Ìµ»ë¤·¤Æ¼¡¤Ë¿Ê¤ó¤Ç¤¯¤À¤µ¤¤¡£¡Ë
+¡Ö¼¡¤Ø¡×¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤Æ¿Ê¤ß¤Þ¤¹¡£
+<br><br />
+<img src="images/japanese/install007.gif" width="779" height="417" border="0" alt="img10.gif">
+</p>
+
+<p>
+¼¡¤Î¥¦¥£¥¶¡¼¥É²èÌÌ¤Ë¤Ï¡¢¡Ö¥Ç¡¼¥¿¥Ù¡¼¥¹¡¢¤ª¤è¤Ó¥Ñ¥¹¡¦URL¤ÎÀßÄê¡×¤Ç¥Õ¥©¡¼¥à¤ËÆþÎÏ¤·¤¿¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎÆâÍÆ¤¬°ìÍ÷¤ÇÉ½¼¨¤µ¤ì¤Þ¤¹¡£
+ÀßÄê¤¬Àµ¤·¤±¤ì¤Ð¡Ö¼¡¤Ø¡×¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤Æ¿Ê¤ß¤Þ¤¹¡£
+´Ö°ã¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢¥¤¥ó¥¹¥È¡¼¥ë¤ò¤Ï¤¸¤á¤«¤é¤ä¤êÄ¾¤·¤Æ¤¯¤À¤µ¤¤¡£
+<img src="images/japanese/install008.gif" width="779" height="407" border="0" alt="img11.gif">
+</p>
+
+<p>
+¼¡¤Î¥¦¥£¥¶¡¼¥É²èÌÌ¤Ë¤Ï¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀÜÂ³¤È¡Ö¥Ç¡¼¥¿¥Ù¡¼¥¹¡¢¤ª¤è¤Ó¥Ñ¥¹¡¦URL¤ÎÀßÄê¡×¤ÇÆþÎÏ¤·¤¿¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬Â¸ºß¤¹¤ë¤«¤É¤¦¤«¤Î³ÎÇ§²èÌÌ¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£
+ÀèÆ¬¤ËÀÄ¿§¤Î¿®¹æ¤¬ÉÕ¤¤¤¿³ÎÇ§¤ËÌäÂê¤Ï¤¢¤ê¤Þ¤»¤ó¡£
+¡Ö¼¡¤Ø¡×¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤Æ¿Ê¤ß¤Þ¤¹¡£
+¡Ö¥Ç¡¼¥¿¥Ù¡¼¥¹¥µ¡¼¥Ð¤Ø...¡×¤ÎÀèÆ¬¤ËÀÖ¿§¤Î¿®¹æ¤¬¤¢¤ë¾ì¹ç¤Ï¡¢
+¡Ö¥Ç¡¼¥¿¥Ù¡¼¥¹¡¢¤ª¤è¤Ó¥Ñ¥¹¡¦URL¤ÎÀßÄê¡×¤ÇÆþÎÏ¤·¤¿¥Ç¡¼¥¿¥Ù¡¼¥¹¥æ¡¼¥¶¡¼Ì¾¡¦¥Ñ¥¹¥ï¡¼¥É¤Þ¤¿¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹Ì¾¤¬´Ö°ã¤Ã¤Æ¤¤¤ë¤«¡¢
+PHP¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¥µ¡¼¥Ð¤ÎÀßÄê¤¬´Ö°ã¤Ã¤Æ¤¤¤Þ¤¹¡£
+¥¤¥ó¥¹¥È¡¼¥ë¤ò¤Ï¤¸¤á¤«¤é¤ä¤êÄ¾¤·¤Æ¤¯¤À¤µ¤¤¡£<br />
+ <br />
+<img src="images/japanese/install009.gif" width="778" height="350" border="0" alt="img12.gif">
+</p>
+
+<p>
+¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËXOOPS¤Î¥Æ¡¼¥Ö¥ë¤¬ºîÀ®¤µ¤ì¡¢¼¡¤Î¥¦¥£¥¶¡¼¥É²èÌÌ¤ËºîÀ®·ë²Ì¤¬°ìÍ÷É½¼¨¤µ¤ì¤Þ¤¹¡£
+ÀèÆ¬¤ËÎÐ¿§¤ÎÉÕ¤¤¤¿¥Æ¡¼¥Ö¥ë¤ÏÀµ¾ï¤ËºîÀ®¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
+ÀèÆ¬¤ËÀÖ¿§¤ÎÉÕ¤¤¤¿¥Æ¡¼¥Ö¥ë¤ÏºîÀ®¤Ë¼ºÇÔ¤·¤Æ¤¤¤Þ¤¹¡£
+¤¹¤Ù¤Æ¤Î¥Æ¡¼¥Ö¥ë¤¬Àµ¤·¤¯ºîÀ®¤Ç¤­¤Æ¤¤¤¿¤é¡¢¡Ö¼¡¤Ø¡×¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤Æ¿Ê¤ß¤Þ¤¹¡£<br />
+<br />
+<img src="images/japanese/install010.gif" width="779" height="765" border="0" alt="img13.gif">
+</p>
+
+<p>
+¼¡¤Î¥¦¥£¥¶¡¼¥É²èÌÌ¤Ë¤Ï¡¢´ÉÍý¼Ô¥æ¡¼¥¶¤òºîÀ®¤¹¤ë¤¿¤á¤Î¥Õ¥©¡¼¥à¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£
+XOOPS¤Î¥¤¥ó¥¹¥È¡¼¥ë¤¬´°Î»¤·¤¿¤é¡¢¤³¤Î´ÉÍý¼Ô¥æ¡¼¥¶Ì¾¤Ç¥í¥°¥¤¥ó¤·¡¢XOOPS¤ò¥»¥Ã¥È¥¢¥Ã¥×¤·¤Þ¤¹¡£
+¥æ¡¼¥¶Ì¾¤È¥Ñ¥¹¥ï¡¼¥É¤Ï¡¢Ëº¤ì¤Ê¤¤¤è¤¦¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£
+¤Þ¤¿¡¢¡Ö´ÉÍý¼Ô¥æ¡¼¥¶¡¼Ì¾¡×¡Ö¥Ñ¥¹¥ï¡¼¥É¡×¤È¤â¡¢È¾³Ñ±Ñ¿ô»ú¤È¤·¡¢¥¹¥Ú¡¼¥¹¤ò´Þ¤á¤Ê¤¤¤³¤È¤ò¿ä¾©¤·¤Þ¤¹¡£
+¥Õ¥©¡¼¥à¤Î¤¹¤Ù¤Æ¤ËÆþÎÏ¤¬ºÑ¤ó¤À¤é¡Ö¼¡¤Ø¡×¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤Æ¿Ê¤ß¤Þ¤¹¡£
+<br /><br />
+<img src="images/japanese/install011.gif" width="779" height="312" border="0" alt="img14.gif">
+</p>
+
+<p>
+XOOPS¤Ç»È¤¦¥¢¥¤¥³¥ó¤ä½é´ü¥Ç¡¼¥¿¤¬³Æ¥Æ¡¼¥Ö¥ë¤ËºîÀ®¤µ¤ì¡¢¼¡¤Î¥¦¥£¥¶¡¼¥É²èÌÌ¤Ë¤½¤Î·ë²Ì¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£
+¤¹¤Ù¤Æ¤Î¥Ç¡¼¥¿¤ÎºîÀ®¤ä½ñ¤­¹þ¤ß¤ÎÀèÆ¬¤ËÎÐ¿§¤Î¿®¹æ¤¬ÉÕ¤¤¤Æ¤¤¤ë¤³¤È¤ò³ÎÇ§¤·¡¢
+¡Ö¼¡¤Ø¡×¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤Æ¥¤¥ó¥¹¥È¡¼¥ë¤ò´°Î»¤·¤Þ¤¹¡£
+<br><br>
+<img src="images/japanese/install012.gif" width="779" height="705" border="0" alt="img15.gif">
+</p>
+
+<h4>¥¤¥ó¥¹¥È¡¼¥ëÀ®¸ù¡ª</h4>
+<p>
+¤ªÈè¤ì¤µ¤Þ¤Ç¤·¤¿¡¢¤³¤ì¤ÇXOOPS¤Î¥¤¥ó¥¹¥È¡¼¥ëºî¶È¤Ï¤¹¤Ù¤Æ´°Î»¤·¤Þ¤·¤¿¡£
+<u><b>¥µ¥¤¥È</b></u>¤ËÅ½¤é¤ì¤¿¡Ö¤³¤³¡×¥ê¥ó¥¯¤ò¥¯¥ê¥Ã¥¯¤·¤Æ¡¢¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿XOOPS¤Î¥µ¥¤¥È¤Ë¥¢¥¯¥»¥¹¤·¡¢¤³¤Î´ÉÍý¼Ô¥æ¡¼¥¶Ì¾¤Ç¥í¥°¥¤¥ó¤·¡¢ÀöÎý¤µ¤ì¤¿¥Ý¡¼¥¿¥ë¥µ¥¤¥È¤ò¹½ÃÛ¤·¤Æ¤¯¤À¤µ¤¤¡£
+¤â¤·¡¢¤³¤Î¥¬¥¤¥É¤Ë½¾¤Ã¤Æ¤â¥¤¥ó¥¹¥È¡¼¥ë¤Ç¤­¤Ê¤¤¾ì¹ç¤Ï <a href="http://jp.xoops.org/wiki/pukiwiki.php?FrontPage">XOOPS¥µ¥¤¥È¤Ë¤¢¤ë¥Þ¥Ë¥å¥¢¥ë¡¦FAQ</a> ¤ÇÄ´¤Ù¤¿¤ê¡¢ 
+<a href="http://jp.xoops.org/">XOOPSÆüËÜ¸ì¸ø¼°¥µ¥¤¥È</a>¤Î¥Õ¥©¡¼¥é¥à¤Ç³«È¯¥Á¡¼¥à¤Î¥á¥ó¥Ð¡¼¤ä¤¿¤¯¤µ¤ó¤ÎXOOPS¥æ¡¼¥¶¡¼¤Ë·É°Õ¤òÊ§¤Ã¤Æ¼ÁÌä¤¹¤ì¤Ð¡¢
+¤­¤Ã¤È¥¤¥ó¥¹¥È¡¼¥ë¤òÀ®¸ù¤µ¤»¤ëÊýË¡¤ò¸«¤Ä¤±¤é¤ì¤ë¤³¤È¤Ç¤·¤ç¤¦¡£
+<br><br>
+<img src="images/japanese/install013.gif" width="779" height="435" border="0" alt="img16.gif"><br /><br />
+</p>
+</body>
+</html>
Index: /temp/test-xoops.ec-cube.net/docs/CHANGES.txt
===================================================================
--- /temp/test-xoops.ec-cube.net/docs/CHANGES.txt	(revision 405)
+++ /temp/test-xoops.ec-cube.net/docs/CHANGES.txt	(revision 405)
@@ -0,0 +1,532 @@
+XOOPS v2 Changelog
+============================
+
+2006/ 8/ 6: Version 2.0.16a JP
+===============================
+ - Fixed problem with the handling of $_SESSION in xoops_regenerate_session() not being able to login on some hosts
+
+2006/ 7/27: Version 2.0.16 JP
+===============================
+ - Added routine to regenerate session id after succeessful login (extras/login.php, html/include/checklogin.php, html/include/session.php)
+ - Fixed PHP notice error (html/install/class/settingmanager.php)
+
+
+2006/ 6/ 9: Version 2.0.15 JP
+===============================
+ - Fixed user message not being sent to PM when over 100 users to send(modules/system/mailusers/mailusers.php)
+ - Fixed port number always being added to the Host HTTP header(class/snoopy.php)
+ - Fixed some reference notice errors
+ - Fixed some typos
+ - Added patch for possible SQL injection attack(class/criteira.php)
+ - Added patch (of 2.0.14a) for local file inclusion vulnerability(header.php, index.php, misc.php)
+ - Added fix for mail encoding problems in PHP4.4.0/4.4.1(language/japanese/xoopsmailerlocal.php)
+
+
+2006/ 4/29: Version 2.0.14 JP
+===============================
+- Fixed installation failure problem with PHP 5.1.x
+- Removed xoops.org banner image files and data
+
+
+2006/ 4/21: Version 2.0.14 JP RC1
+===============================
+- Added fix for 4.4.x variable reference PHP notice errors
+- Updated 3rd party libraries
+   Snoopy v1.2.3
+   PHPMailer Ver 1.73
+   Smarty Ver 2.6.12
+- Fixed comment post URL in newbb/viewtopic.php
+- Fixed additional slashes in user password being md5()'d.
+- Fixed &amp; -> & in some mail template files
+- Bug Fix #7393: Fixed Smarty Template cycle plugin parameters
+- Added input validity checks for system avatar selection
+- Fixed many typo
+- Modified xoops.org links to xoopscube.org ;-)
+- Removed duplicate footer include()'s in mydownloads
+
+
+2005/10/25: Version 2.0.13a JP
+===============================
+- Re-applied the $HTTP_*_VARS to $_* fix to some files in newbb
+- Added fix for comment XSS vulnerability that was missing in the previous release
+
+
+2005/10/24: Version 2.0.13 JP
+===============================
+- Added several fixes for XSS vulnerabilities found in the core and newbb.
+- Added fix to prevent Spams via misc.php and contact module using PHPMailer
+- Added fix to prevent arbitrary code execution vulnerability in uploader.php
+
+
+2005/ 9/ 5: Version 2.0.12 JP
+===============================
+- Fixed display problem in system config preferences when conf_valuetype and conf_formtype are of textarea type
+
+
+2005/ 8/31: Version 2.0.12 JP Beta
+===============================
+- Changed $HTTP_XXX_VARS to $_XXX
+- Limit send to friend feature in siteinfo block to registered users only
+- Fixed bug in duplicate user name checking
+- Added sanitization to PHP_SELF variable
+- Fixed invalid usages of HTML
+- Fixed some bugs sending japanese mails
+- Fixed regex bug in module.textsanitizer.php
+
+
+2005/ 8/14: Version 2.0.11.1 JP
+===============================
+- Fixed full path disclosure vulnerability in several files
+
+
+2005/ 7/31: Version 2.0.11 JP
+===============================
+- Fixed infinite refresh of page in visit.php of mydownloads/mylinks
+
+
+2005/ 7/21: Version 2.0.11 JP RC2
+===============================
+- Added security patch to prevent SQL injection in xmlrpcapi.php
+- Added security patch for XSS vulnerability in comment post
+- Fixed minor display bugs in search result URLs
+- Fixed incorrect Smarty tag name being assigned in header.php
+- Fixed PHP notice errors in several parts
+
+
+2005/ 6/30: Version 2.0.10.2 JP
+===============================
+- Added security patch to prevent SQL injection in xmlrpcapi.php
+- Added security patch for XSS vulnerability in comment post
+
+
+2005/ 6/29: Version 2.0.11 JP RC1
+===============================
+- Merged CriteriaString with the original Cirteria class
+- Fixed bug in image admin section when register_globals off.
+- Code cleanup in headlinerender.php
+- Added missing language constant in the news module
+- Fixed bug in xoopspartners admin section when register_globals off.
+- Fixed smarty variable typo in common.php
+- Fixed invalid template path in template set admin section
+- Fixed comment delete button bug
+- Changed & to &amp; in some files
+- Added missing parameter to redirect URL of newbb/mydownload modules
+- Fixed invalid cache header in footer.php
+- Fixed bug not being able to send mails when over 200 registered users
+
+
+2005/ 6/28: Version 2.0.10.1 JP
+===============================
+- Added security patch to prevent login spoofing
+- Added several patches to fix some important bugs present in 2.0.10 JP
+  - Fixed bug not being able to add user from user admin page
+  - Fixed fatal error in admin page of sections module
+  - Fixed bug not being able to delete forum posts in newbb module
+  - Fixed typo: $xoopsConfig -> $xoopsModuleConfig in news module
+
+
+2005/ 6/15: Version 2.0.11 JP Beta
+===============================
+- Fixed parse error in the sections module
+- Fixed incorrect use of anonpost option variable in the news module
+- Fixed bug not being able to add users to group when active users over 200
+- Fixed bug not being able to add user from the user admin page
+- Fixed bug not being able to delete posts in the newbb module
+
+
+2005/ 6/10: Version 2.0.10 JP
+===============================
+- Added fix for better module version number handling
+- Fixed possible fatal error when using the template manager
+- Fixed more invalid usages of HTML
+- Fixed bug not being able to change password in user admin area
+- Changed <{$xoops_moduledir}> to <{$xoops_dirname}> for xoops.org 2.0.10 compatibility
+- Fixed <{$show_lblock}> not being assigned when no left blocks
+
+
+2005/ 6/2: Version 2.0.10 JP RC2
+===============================
+- Fixed Invalid usages of HTML
+- More fix to popup calendar bug fix added in beta
+- Fixed file/folder names starting with a . being listed as modules, themes, etc.
+- Added missing post_id variable in newbb search results
+- Fixed minor problem with IIS
+- Fixed phpmailer inifinite loop DOS vulnerability
+- Fixed module icons in admin menu and modulesadmin page to be displayed in order by weight
+- Fixed ticket system for improved compatibility with xoops.org 2.0.10
+
+
+2005/ 5/28: Version 2.0.10 JP RC1
+===============================
+- Temporarily disabled showing XOOPS News on admin top page
+- Changed the name of XoopsMediaUploader::checkFileType() to its original XoopsMediaUploader::checkFileType() to maintain compatibility
+- Fixed group name not showing in group admin error message
+- Fixed typo in /kernel/object.php, modules/system/admin/smiles/main.php, include/xoopscodes.php, class/xoopsform/dhtmltextarea.php
+- Changed token lifetime from 900 seconds to unlimited
+- Fixed invalid timestamp format in RSS news feed
+- Removed invalid links to unpublished news article
+- Fixed link to preference settings not being displayed in newbb admin menu
+- Fixed error messages being displayed when pointing to non-existent image file in image.php
+- Fixed ticket error in group admin page when users over 200 in a group
+- Fixed new user being added to all groups when created from the admin page
+- Fixed fatal error message being displayed when trying to browse uninstalled modules
+- Fixed file not found error in zipdownloader.php
+- Added support for 'NOT IN' type queries in Criteria class
+- Added <{$xoops_modulename}> <{$xoops_moduledir}> template vars
+- Added block weight value to each block template var
+
+
+2005/ 5/18: Version 2.0.10 JP Beta
+===============================
+- Implemented new token system for validating form origination and increased protection against CSRF
+- Security fix to avoid the usage of fopen and unlink when preview/debug
+- Fixed bug in header.php, assign $xoops_lblocks
+- Fixed bug #1157029 - Bug in include/checklogin.php
+- Fixed bug #1060061 - renderValidationJS showing htmlentities instead of intended characters
+- Removed <code>foreach ($_POST as $k => $v) {${$k} = $v;}</code> and similar ones which can be insecure under certain circumstances
+- Fixed CSRF vulnerability in block/template preview
+- Fixed CSRF vulnerability in news/newbb preview
+- Fixed arbitrary file deletion vulerability when custom avatar upload enabled
+- Security fix to prevent uploading of executable files
+- Fixed XSS vulerability in redirect_header() function
+- Fixed XSS vulerability in findusers section of system module
+- Fixed XSS vuleratility when displaying smiley popup window
+- Removed old autologin hack codes which can be insecure
+- Fixed arbitrary PHP code execution vulnerability in saxparser class
+- Fixed XOOPS news not being displayed when allow_url_fopen set to off
+- Fixed new user not being added to specified groups when creating new user from the admin section
+- Fixed many typos
+- Fixed many HTML misusages
+- Added more PHP5 compatibility fixes
+- Added fix for duplicated blocks created in 2.0.9
+- Added custom XoopsSecurity class for xoops.org 2.0.10 compatibility
+
+
+2004/12/30: Version 2.0.9.2
+===============================
+- Security fix to prevent session hijacking (thanks goes to GIJOE and the JP XOOPS community)
+- Fixed duplicated blocks bug on module update
+- phpmailer back to the version included in 2.0.7.3, as it is more stable (onokazu)
+
+
+2004/12/25: Version 2.0.9
+===============================
+- Security fix in the newbb module for PHP version < 4.3.10 (GIJOE & onokazu)
+- Security fix in the newbb module to prevent XSS attacks (minahito)
+- Fixed various problems related to XoopsUser::isAdmin() and $xoops_isadmin patch in 2.0.7.1 (bugs #1014203/#1014403) (onokazu)
+- Fixed incorrect parameters being passed to CriteriaCompo in modulesadmin.php (onokazu)
+- Fixed incorrect parameters being passed to XoopsXmlRpcStruct::add() in BloggerApi::getUserInfo() (onokazu)
+- Fixed Bug #1023022 - XoopsFormDhtmlTextArea and array_push() error (Mithrandir)
+- Fixed Bug #1013989 - Inbox title shoud be plural "Private Messages" (Mithrandir)
+- Fixed Bug #1004998 - readpmsg.php typo:</th> html tag of subject is nothing (Mithrandir)
+- Fixed Bug #1035707 - Enable array type options in blocks (Mithrandir)
+- Fixed a typo in include/comment_form.php, patch #1041993 (Dave_l)
+- Fixed Bug #1044957 - xoopsmultimailer.php Username typo when SMTP-Auth (Mithrandir)
+- Fixed RFE #900348 - Sort user list alphabetically in System -> Groups. Also changed the way it fetches the users in the group so it fetches all of them with 2 queries instead of 1 + (1 per user in the group) (Mithrandir
+)
+- Added patch #1048384 - mysql_field_name and others, added (Mithrandir)
+- Fixed bug #1049017 - Blocks sharing a template are cached wrong (Mithrandir)
+- Added patch #1048382 - Module onUpdate function (Mithrandir)
+- Fixed bug #989462 - Handler object caching not working (Mithrandir)
+- Added RFE #900345 - View/Edit group membership in Admin -> System -> Edit User (Mithrandir)
+- Fixed Bug #1055901 - group.php(IN phrase is used ,query) (Mithrandir)
+- Fixed bug #1052403 - block update in module update (Mithrandir)
+- More fixes for register_globals off in the top 10 page of mylinks/mydownloads modules
+- Fixed a typo in modules/xoopsheadline/admin/index.php (onokazu)
+- Fixed bug where 2 headline forms were using the same form name/id, causing JS error (onokazu)
+- Fixed some html problems in mylinks/mydownloads admin page (onokazu)
+- Secured mainfile.dist.php from disclosing paths (Mithrandir)
+- Fixed bug #1073029 (onokazu)
+- Fixed bug #1073532 (onokazu)
+- Fixed bug #1080791 (onokazu)
+- Fixed lang phrase _NOT_ACTIVENOTIFICATIONS not being assing to template (onokazu)
+- Some PHP5 fixes (Mithrandir)
+- Updated Smarty to version 2.6.5
+- Updated PHPMailer to version 1.72
+
+
+2004/09/11: Version 2.0.7.3
+===============================
+!! SECURITY FIX !! fixed more bugs that allowed session hijacking under a certain circumstance (onokazu)
+
+
+2004/09/10: Version 2.0.7.2
+===============================
+!! SECURITY FIX !! fixed bugs that allowed session hijacking under a certain circumstance (onokazu)
+
+
+2004/08/21: Version 2.0.7.1
+===============================
+Fixed bug #1006511 about $xoops_isadmin misuse (skalpa/the jp.xoops.org community):
+- Changed XoopsUser::isAdmin() behavior to prevent problems with modules that misuse this function
+- Fixed permission checking in user profile page, to only show admin links to people who are supposed to see them
+- Fixed permission checking in the comments system, to only show admin links to people who are supposed to see them
+Fixed incorrect escaping of configuration values in 2.0.7 (skalpa)
+Changed db proxy class error message from "Action not allowed" to "Database update not allowed during a GET request" (skalpa)
+Fixed bug #964084: if comment title is long multi-byte character.last byte loss (Mithrandir/domifara)
+Fixed bug #977360: Wrong icon in comment bloc (Mithrandir/zoullou)
+Fixed bug #976534: modules incompatibilities in 2.0.7 (Mithrandir/gijoe_peak)
+Fixed bug #975803: Typo in class/pagenav.php (Mithrandir/Dave_l)
+Fixed bug #974655: slogan variable with Xoops 2.0.7 (Mithrandir/brashquido)
+Fixed bug #987171: typo in edituser.php (Mithrandir)
+Applied patch #928503: Search results for modules with granted permissions optimised (Mithrandir/malanciault)
+Applied patch #988715: cp_header.php language (Mithrandir/phppp)
+Fixed MyTextSanitizer PHP notices (Mithrandir)
+Fixed XoopsForm PHP Notices about an unset _extra property (Mithrandir)
+
+
+2004/06/14: Version 2.0.7
+===============================
+!! SECURITY FIX !! preventing code injection in media uploader (skalpa)
+!! SECURITY FIX !! preventing execution of external scripts in shared environments (skalpa/ackbarr)
+
+Fixed bug #963937: Typo in modules/system/admin/findusers/main.php (mithrandir/tom_g3x)
+Fixed typo in x2t theme css colteaser class definition (w4z004)
+Set formButton class to Xoops popups buttons (w4z004)
+Fixed bug #960970: Incorrect display of the graphical pagenav (w4z004)
+Modified the Word Censoring fix (#962025) for MySQL 4.x compat (skalpa + quick thx 2 hervet 4 help)
+Ensured page title and slogan are escaped for HTML (onokazu)
+Fixed bug #961565: Search form keywords not checked by JS (mithrandir/tom_g3x)
+Fixed bug #961118 in XoopsFormElementTray::getElements() (mithrandir/luckec)
+Fixed bug #961311: Incorrect definition of headers var in XoopsMailer class (mithrandir/tom_g3x)
+XoopsForm::assign() now indexes elements by name if possible (mithrandir/kerkness)
+Fixed bug #963197: xoopsHiddenText is hardcoded in formdhtmlarea (mithrandir/tom_g3x)
+Fixed bug #963301: XoopsMediaUploader checkMaxHeight() doesn't work (skalpa/onokazu)
+Fixed bug #963327: XoopsImageHandler delete() keeps rows in imagebody table (skalpa/tom_g3x)
+Fixed bug #962025: Word censoring can mess db config options up (skalpa/tom_g3x)
+Fixed bug #961313: XoopsMailer custom headers are duplicated (skalpa/tom_g3x)
+Fixed bug #960683: [code] wrong translation (skalpa/ryuji+gi_joe)
+Fixed snoopy bug due to language specific characters (onokazu)
+Fixed a bug preventing deletion of users from the admin user search results (onokazu)
+Fixed a bug preventing deletion of admin users (onokazu)
+Fixed bug #915976: module onInstall feature doesn't display module messages correctly (skalpa/feugy+dave_l)
+Fixed bug #898776: Xoops module resolution for www.host.com and host.com (wulff_dk)
+Fixed bug #906282: XoopsGroupPermForm::render() - throws Undefined variable (mithrandir)
+Fixed bug #946621: Comments system extra_param not working with register_globals off (mithrandir/gstarrett)
+Fixed bug #932200: Admin > Edit user shows wrong username :-(mithrandir)
+Fixed bug #936753: $xoops_module_header not in all themes (w4z004)
+Fixed bug #921930: SQL queries with leading whitespace don't work (mithrandir)
+Fixed bug #920480: xoops_substr always adds three dots (skalpa)
+Fixed bug #921448: Undefined variable in xoopscodes.php (skalpa/dave_l)
+Applied patch #953063: js Calendar first popup date bug fix (mithrandir/venezia)
+Applied patch #953060: xoopstree.php selbox - subcategories not ordered (mithrandir/venezia)
+Applied patch #928503: Only show search results for modules with granted permissions (mithrandir/malanciault)
+Fixed bug #922152 preventing notifications to work with some Windows configurations (skalpa/robekras)
+Fixed bug #930351 preventing XoopsThemeForm::insertBreak() to work
+Corrected the content of $xoopsRequestUri on IIS fixing bug #895984 (skalpa)
+
+2/6/2004: Version 2.0.6
+===============================
+- Removed calls to XoopsHandlerRegistry class (onokazu)
+- Fixed loop problem after retrieving a lost password (onokazu)
+- Changed all include() calls to include_once() for xoopscodes.php (onokazu)
+- Added routines to remove users from the online member list when a user is deleted (onokazu)
+- Added parameters to the Critreria class constructor to allow the use of DB functions in SQL criteria (skalpa)
+- Added fetchBoth() method to the XoopsDatabase class (skalpa)
+- Fixed typos in class/smarty/plugins/resource.db.php (skalpa)
+- Refactoring in /class/xoopsform/form.php (skalpa)
+- Added some methods to /class/xoopsform/formelement.php to allow the use of accesskey and class attributes in form element tags (skalpa)
+- Fixed extra HTML tags not being displayed when using the XoopsThemeForm::insertBreak() method (Catzwolf)
+- Changed the default HTTP method of the search form to GET (onokazu)
+- Fixed notification constants not being included during installation (onokazu)
+- Fixed session data not being properly escaped before inserting to the database (onokazu)
+- Some useful changes to the group permission form (onokazu)
+- Fixed the block cachetime selection being reset after preview (onokazu)
+- Fixed invalid regex patterns used for username filtering, also added fix to allow the safe use of multi-byte characters in username (contributed by GIJOE)
+- Fixed bug where some blocks were not being displayed in block admin page on certain occasions (onokazu)
+- Fixed the problem of system admin icon disappearing on certain occasions (onokazu)
+- Fixed the errorhandler class to check the current error_reporting level before handleing errors (onokazu)
+- Re-activated the errorhandler class (onokazu)
+- Updated class/Snoopy.php to the latest version, v1.01 (onokazu)
+- Fixed a typo in kernel/online.php (onokazu)
+- Added some useful functions to include/xoops.js (skalpa)
+- Fix for Opera in include/xoops.js (onokazu)
+- Fixed user bio and signature values causing corruption in the edit profile form on certain occasions (onokazu)
+- Fixed the module name being reset to the default value after module update (onokazu)
+- Fixed invalid regex patterns in xoopslists.php (onokazu)
+- Fixed a few issues with register_globals setting
+- Fix for the auto-login feature (not activated)
+- Fixed image categories not being displayed in the order set by admin (onokazu)- Fixed a typo in kernel/config.php (onokazu)
+- Fixed comments not being displayed in the order as requested (onokazu)
+- Fixed the mailer class not setting some header values (onokazu)
+- Fixed chmod problem in class/uploader.php
+- Fixed magic_quotes related problems in class/uploader.php
+- Fixed notification routines causing a fatal error while trying to notify non-existent users (onokazu)
+- Added fix to convert &amp; to & within mail messages (onokazu)
+- Fixed html special characters causing problem when submitting a new module name (onokazu)
+- Fixed javascript error in mailuser form (onokazu)
+- Fixed javascript error in calendar date select form
+- Added a new Smarty function <{xoops_link}> (skalpa)
+- Added check to prevent webmaster user/group from being removed completely (contributed by Ryuji)
+
+newbb
+- Security fix in modules/newbb/viewtopic.php (onokazu)
+- Security fix in modules/newbb/viewforum.php (onokazu)
+- Added register_globals related fix to topicmanager.php (onokazu)
+- Fixed topic moderation icons not being displayed for moderators in templates/newbb_thread.html (onokazu)
+- Fixed topic time not being displayed in recent posts block on certain occasions in blocks/newbb_new.php (onokazu)
+- Added fix to correctly navigate to the requested post even when the post is not on the first page of flat view (contrib by GIJOE in class/forumpost.php, viewtopic.php, viewforum.php)
+
+sections
+- Added missing global variable declarations to index.php (onokazu)
+
+mydownloads
+- Added register_globals related fix to modfile.php (onokazu)
+
+news
+- Added fix to always display published date in each article (onokazu)
+- Added missing ?> at the end of file in xoops_version.php (onokazu)
+- Some fixes in admin/index.php
+
+xoopspolls
+- Fixed color bar selections not working when creating/editing a new poll (onokazu)
+
+xoopsmembers
+- Fixed 'more than X posts' not working when set to 0 (onokazu)
+- Added a new language constant to language/english/main.php (Catzwolf)
+- Removed invalid HTML tags in templates/xoopsmembers_searchresults.html (Catzwolf)
+
+
+1/5/2004: Version 2.0.5.2
+===============================
+- Security fix in modules/mylinks/myheader.php
+- Security fix in modules/mylinks/visit.php
+- Security fix in modules/mylinks/admin/index.php
+
+
+11/22/2003: Version 2.0.5.1
+===============================
+- Added $option parameter to xoops_gethandler function (skalpa)
+- Security fix in banners.php (onokazu)
+- Security fix in modules/newss/include/forumform.inc.php (onokazu)
+- Security fix in include/common.php (onokazu)
+- Temporarily disabled XoopsErrorHandler class (onokazu)
+- Security fix in include/functions.php (onokazu)
+- Removed XoopsHandlerRegistry class (onokazu)
+- Added fix for preventing users entering infinite loop when recovering a lost password (onokazu)
+
+
+10/8/2003: Version 2.0.5
+===============================
+- Fixed template files not being updated even when the 'allow update from themes directory' option was enabled in preferences
+- Fixed RSS channel title being cutoff at special characters
+- Minor bug fix in pagenav.php
+- Fixed blocks disappearing from the block admin page on certain occasion
+- Additional fixes to work with register_globals off
+- Fixed problem with XoopsCode Img button not working on certain occasion
+- Added missing SQL query in kernel/avatar.php
+- Fixed problem with the newbb module where users could post without a thread title on certain occasion
+- Fixed problem in banner admin page where banner edit form not being displayed on certain occasion
+- Fixed group selection option in the blocks admin page not being selected on certain occasion
+- Fixed poll option textbox forms not displaying the correct values
+- Fixed show all link in user profile page not working in 2.0.5RC
+- Additional phrases in language/english/global.php(_NOTITLE), language/english/search.php(_SR_IGNOREDWORDS), install/language/english/install.php(_INSTALL_L128, _INSTALL_L200)
+- Added check in install/index.php to read $HTTP_ACCEPT_LANGUAGE on initial load
+
+
+9/30/2003: Version 2.0.5 RC
+===============================
+- Fixed email checking bug mentioned in http://www.xoops.org/modules/newbb/viewtopic.php?topic_id=12288&forum=2 (mvandam)
+- Fixed a number of bugs in blocks admin page (onokazu)
+- More usability fix in blocks admin page (onokazu)
+- Fixed forum topic links to correctly use the # feature in url (onokazu)
+- Fixed password checking bug mentioned in http://www.xoops.org/modules/newbb/viewtopic.php?topic_id=12301&post_id=49369&order=0&viewmode=flat&pid=49203&forum=21#forumpost49369
+- Fixed database connection error when creating database during install (onokazu)
+- Fixed mb_output_handler causing problems in backend.php/image.php/downloader (onokazu)
+- Fixed search feature to use GET requests for prev/next/showall links (onokazu)
+- Register_globals related fix in /include/comment_post.php (contrib by gstarrett)
+- Added $xoopsUserIsAdmin global variable (onokazu)
+- Added xoops_getLinkedUnameById function to /include/functions.php (Catzwolf)
+- Fixed invalid Smarty tags in /modules/system/templates/system_siteclosed.html, /modules/system/templates/system_redirect.html, /modules/system/templates/system_imagemanager2.html (onokazu)
+
+
+9/19/2003: Version 2.0.4
+===============================
+- XOOPS_CACHE_PATH, XOOPS_UPLOAD_PATH, XOOPS_THEME_PATH", XOOPS_COMPILE_PATH, XOOPS_THEME_URL, XOOPS_UPLOAD_URL are now set in include/common.php (onokazu)
+- Added [siteurl][/siteurl] tag to XoopsCode (mvandam)
+- Fixed a typo in class/uploader.php (onokazu)
+- Fixed some redirect problems after login (onokazu)
+- registre_globals fix in include/comment_view.php (onokazu)
+- Xoops.org news is disabled by default in the admin section (onokazu)
+- Added a new error handler class (class/errorhandler.php) (mvandam)
+- Fixed XoopsGroupPermHandler returning duplicate permissions (onokazu)
+- Fixed block-disappearing problem in blocks admin (onokazu)
+- Fixed typo in kernel/notification.php (mvandam)
+- Added XoopsGuestUser class in kernel/user.php (onokazu)
+- Fixed newbb module to correctly use the # feature in URL (onokazu)
+- Improved usability in blocks admin section
+- Reduced number of users to display in group/edituser page to max 200 users (onokazu)
+- Fixed bug where admins could add users with a existing username (onokazu)
+- Added files for module developers to easily add group permisson feature (modules/system/groupperm.php, class/xoopsform/groupperm.php) (onokazu)
+- Fixed typo in register.php (onokazu)
+
+
+6/17/2003: Version 2.0.3
+===============================
+- fixed CSS related bug in global search page
+- register_globals bug fix in comments
+- Smarty updated to 2.5.0
+- fixed typo in kernel/object.php
+- fixed group permission bug
+- fixed bug where image categories were deleted after group permission update
+- fixed bug where user votes could not be deleted in the mylinks module
+- fixed some language typos
+- changed XoopsGroupPermHandler::getItemIds to accept an array fot the second parameter (gperm_groupid), which was required in certain places..
+- removed avatar image files
+
+
+4/25/2003: Version 2.0.2
+===============================
+- security fix to prevent malicious cross site scripting attacks (onokazu)
+- fixed character encoding problem for some languages when using the mailer class (onokazu)
+- fixed some major bugs in the xoopsheadline module (onokazu)
+- fixed some cookie related problems in the forums module (mvandam)
+
+
+4/18/2003: Version 2.0.1
+===============================
+- fixed bug where notification feature could not be turned on
+- fixed character encoding problem for some languages when using the mailer class (onokazu)
+- fixed the theme selection block to work again
+- fixed typo in kernel/module.php
+- fixed incorrect table name in xoops_version.php of the new headline module
+- changed max limit size of some columns in the configoption table
+- fixed image manager bug when using db store method
+- xoops.org can now be disabled by adding nonews=1
+
+
+4/16/2003: Version 2.0.0
+===============================
+- xoopsheadlines module replaced with xoopsheadline module to fix character encoding problems
+- numerous bug fixes
+
+
+3/19/2003: Version 2.0.0 RC3
+===============================
+- a major change in the handling of theme files, the detail of which you can read in this [url=http://www.xoops.org/modules/news/article.php?storyid=677]article[/url] (onokazu)
+- a new global notification feature that can easily be incorporated into modules (that use Smarty) by only modifying xoops_version.php and template files (mvandam)
+- SMTP support using phpMailer (bunny)
+- group permission tables merged into one table (onokazu)
+- code refactoring
+
+
+2/9/2003: Version 2.0.0 RC2
+===============================
+A bug fix release..
+- avatar upload bug
+- themeset image upload bug
+- register_globals fix
+- recommend us block error
+- error message displayed upon submit of news article
+- page navigation bug in some modules
+- blank page bug on some servers
+- SQL displayed in blocks admin
+
+
+1/31/2003: Version 2.0.0 RC1
+===============================
+The first public release of 2.0 series.
+For new features that have been added from 1.3.x, please refer to
+the articles listed below:
+http://www.xoops.org/modules/news/article.php?storyid=486
+http://www.xoops.org/modules/news/article.php?storyid=549
Index: /temp/test-xoops.ec-cube.net/docs/COPYING.txt
===================================================================
--- /temp/test-xoops.ec-cube.net/docs/COPYING.txt	(revision 405)
+++ /temp/test-xoops.ec-cube.net/docs/COPYING.txt	(revision 405)
@@ -0,0 +1,88 @@
+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
+
Index: /temp/test-xoops.ec-cube.net/docs/INSTALL.html
===================================================================
--- /temp/test-xoops.ec-cube.net/docs/INSTALL.html	(revision 405)
+++ /temp/test-xoops.ec-cube.net/docs/INSTALL.html	(revision 405)
@@ -0,0 +1,120 @@
+<html>
+<head>
+  <title>Xoops Install Guide</title>
+  <meta name="keywords" content="XOOPS docs" />
+  <meta name="description" content="XOOPS" />
+  <style>
+    P, TD, LI, INPUT, BODY, SELECT, TEXTAREA { font-family: Verdana; font-size: 13px; line-height: 1.3 }
+    .error { color: #CC3333; font-weight: bold; }
+    UL { margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px; }
+    OL { margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px; }
+    .indent { margin-left: 40px; }
+    FORM { margin: 0px; padding: 0px; }
+    
+    H1, H2, H3, H4, H5 { margin: 0px; padding: 0px; }
+    
+    .additions { color: #008800; }
+    .deletions { color: #880000; }
+    
+	.header { padding: 10px; padding-top: 0px }
+    .page { background-color: #FFFFFF; padding: 10px; border: 1px inset;}
+	.footer { background-color: #DDDDDD; padding: 5px 10px; border: 1px inset; border-top: none; border-top: 1px solid #CCCCCC }
+	.code { background: #FFFFFF; border: solid #888888 2px; font-family: "Courier New"; color: black; font-size: 10pt; width: 100%; height: 400px; overflow: scroll; padding: 3px; }
+
+    .revisioninfo { color: #AAAAAA; padding-bottom: 20px; }
+	
+	.copyright { font-size: 11px; color: #AAAAAA; text-align: right; }
+	.copyright A { color: #AAAAAA; }
+</style>
+</head>
+
+<body
+	bgcolor="#F8F8F8" text="#000000">
+
+<div class="page">
+<h3>Installing XOOPS</h3>
+<hr noshade size="1" />
+<br />
+<h4>First time installation</h4>
+<br />
+<h4>Preface:</h4>
+Before begining the install process, we (the XOOPS team) ask that you have a good understanding of how to install and support server/hosted based software.  As with anything in life, there's no easy answer or way.  Sinice XOOPS is server based, it's not as easy to install as normal desktop software which in itself can be daunting to install so, please be familiar with setting up and installing the software listed below.  Be familiar with how to configure CGI scripts and HTTP server software.  It can easily be demonstrated that 80% of our support questions wind up being improper configurations with the server componenets or two pieces of software conflict. No two servers are configured alike.<br />
+<br />
+<br />
+To install XOOPS for the first time, you'll need to have the minimum following server software pre-installed:<br />
+<div class="indent">* HTTP Server (<a href="http://www.apache.org">Apache</a> or IIS)  "Note, XOOPS only officially supports Apache"<br />
+* <a href="http://www.php.net">PHP</a> 4.1.0 and higher (4.1.1 or higher recommended)<br />
+* <a href="http://www.mysql.com">MySQL</a> Database 3.23.XX</div>
+<br />
+Before starting the install, be sure to have:<br />
+<div class="indent">* Setup the HTTP, PHP and database server properly.<br />
+* Create a database for your <a href="http://www.xoops.org">XOOPS 2</a> installation <br />
+<div class="indent">(Have your hosting company create one if you can't. The install script does provide this capability with the proper privileges).<br />
+</div>* A user account with the proper database permissions.<br />
+* The ability to set the following directories and files world writeable: uploads/, cache/ and templates_c/ and the file mainfile.php<br />
+* Turn cookie and <span class="missingpage">JavaScript</span><a href="http://wiki.xoops.org/wakka.php?wakka=JavaScript/edit">?</a> support in your browser on.</div>
+<br />
+<br />
+<h4>Installing locally</h4>
+If your running a local environment for development or testing, make sure that you have the previous requirements met.  Once this is done, copy the contents of the HTML directory (from the XOOPS 2 distribution file or CVS) to the root document path of your web environment. Once the files are copied there, you can start the install by typing <a href="http://yoursite.com">http://yoursite.com</a>.  This will start the install process.<br />
+<br />
+<h4>Installing on a hosted platform</h4>
+If your running in a hosted environment, unpack the XOOPS 2 files locally or on the server if you have telnet or SSH access. Once you done this, make sure to move or copy all XOOPS 2 files from the HTML directory to your root web directory (your provider usually provides this location with directions).  Once the files are copied there, you can start the install by typing <a href="http://yoursite.com">http://yoursite.com</a>.  This will start the install process.<br />
+<br />
+<h4>Continuing the install</h4>
+<img src="images/install001.gif" /><br />
+<br />
+After performing the above procedures, your ready to continue installing XOOPS 2 with the Install Wizard.  The first screen in the install Wizard takes you to will be the welcome screen. <br />
+<br />
+<img src="images/install002.gif" /><br />
+<br />
+Click the Next button to continue on to the next screen.  <br />
+<br />
+The next part of the install Wizard is designed to check your file and directory permissions. If your running in a <span class="missingpage">Win32</span><a href="http://wiki.xoops.org/wakka.php?wakka=Win32/edit">?</a> environment, this should be a pretty painless install.  If you running in a UNIX environment, the Wizard will display any problems and the corrective actions to take if there are problems.  <br />
+<br />
+<img src="images/install003.gif" /><br />
+<br />
+If all lights are green on the Wizard, click Next to continue. If not, please read the screen and perform the necessary actions recommended by the Wizard<br />
+<br />
+The next part of the Wizard is for writing the settings to the mainfile.php file. <br />
+<br />
+<img src="images/install004.gif" /><br />
+<br />
+The General Settings screen is self explanatory so, input the required information into the files and click next. <br />
+<br />
+The next four Wizard screens are informational displaying the settings from the General Settings screen for your confirmation and to show that the values were written correctly. <br />
+<br />
+<img src="images/install005.gif" /><br />
+<br />
+<img src="images/install006.gif" /><br />
+<br />
+<img src="images/install007.gif" /><br />
+<br />
+<img src="images/install008.gif" /><br />
+<br />
+If you seen any Red lights, please click the Back button to make the proper corrections.<br />
+<br />
+The next Wizard screen is will be to show the progress for accessing the database.<br />
+ <br />
+<img src="images/install009.gif" /><br />
+<br />
+If your in a hosted environment with out the proper access to create databases, please check with your provider for help in getting a database.  If your provider (or you) created the database, all  lights should be green.  If you get a red light stating the DB does not exist and your user name has the ability to create databases, then click next and the install Wizard will attempt to create the database for you.  If your user id does not have the rights to create a database, please correct this and continue the install.  The next two screens are informational on trying to create and access the database.  Click Next or Back depending on the Wizard screen.<br />
+<br />
+After clicking next a couple of times, you will come to an informational screen showing the results of table creation. If there is a problem, please refer to the <a href="http://wiki.xoops.org/wakka.php?wakka=Installation">FAQ</a> or <a href="http://www.xoops.org">XOOPS Forums</a> for further assistance. <br />
+<br />
+<img src="images/install011.gif" /><br />
+<br />
+ If all lights are green, your ready to proceed by clicking Next.<br />
+<br />
+The next Wizard screen is for inputting site administrative information. <br />
+<br />
+<img src="images/install024.gif" /><br />
+<br />
+Please be careful here and write down or remember your administrative password. You'll need this after the install to continue setting up your XOOPS 2 site.  Once you have completed inputting the correct information, click Next to continue.   * Note, try to refrain from using names with spaces for the Admin name. *<br />
+<br />
+The next screen is informational. If all the lights are green, click Next to continue.
+<br /><br />
+<h4>Congratulations!</h4>
+Your installation should now be complete.  You can check the site out by clicking the "HERE" text on the last screen. If all went well, then your new site should be up and running. If not, please refer to the <a href="http://wiki.xoops.org/wakka.php?wakka=Installation">FAQ</a> or <a href="http://www.xoops.org">XOOPS Forums</a> for further assistance.</div>
+</body>
+</html>
Index: /temp/test-xoops.ec-cube.net/.htpasswd
===================================================================
--- /temp/test-xoops.ec-cube.net/.htpasswd	(revision 405)
+++ /temp/test-xoops.ec-cube.net/.htpasswd	(revision 405)
@@ -0,0 +1,1 @@
+04:yaSrNCkpmXeHE
