diff -x .svn -aruN 3.33.src/benchmark.inc 3.40.src/benchmark.inc
--- 3.33.src/benchmark.inc	2008-10-06 07:43:46.000000000 -0500
+++ 3.40.src/benchmark.inc	2009-02-14 19:36:52.000000000 -0600
@@ -10,8 +10,6 @@
 }
 
 // For benchmarking
-global $StartTime, $SQLQCount;
+global $StartTime;
 $StartTime = getmtime();
-$SQLCount = 0;
-
 ?>
diff -x .svn -aruN 3.33.src/createaccount.php 3.40.src/createaccount.php
--- 3.33.src/createaccount.php	2008-10-06 07:43:46.000000000 -0500
+++ 3.40.src/createaccount.php	2009-02-14 19:36:52.000000000 -0600
@@ -35,7 +35,7 @@
 	
 		Login Name (required): 
 		<br />
-		<input name="name" size="20" /> <small>(only a-z, 0-9)</small>
+		<input name="name" size="20" maxlength="16" /> <small>(only a-z, 0-9)</small>
 		<br />
 		<br />		
 		Real Name (required): 
@@ -53,6 +53,8 @@
 		<input name="url" size="60" />
 		<br />
 		<?php
+		// add extra fields from Plugins, like NP_Profile
+		$manager->notify('RegistrationFormExtraFields', array('type' => 'createaccount.php', 'prelabel' => '', 'postlabel' => '<br />', 'prefield' => '', 'postfield' => '<br /><br />'));
 		// add a Captcha challenge or something else
 		global $manager;
 		$manager->notify('FormExtra', array('type' => 'membermailform-notloggedin'));
@@ -85,7 +87,7 @@
 	
 		Login Name (required): 
 		<br />
-		<input name="name" size="20" <?php if(isset($_POST['name'])){echo 'value="'.$_POST['name'].'"';}?>/> <small>(only a-z, 0-9)</small>
+		<input name="name" size="20" maxlength="16" <?php if(isset($_POST['name'])){echo 'value="'.$_POST['name'].'"';}?>/> <small>(only a-z, 0-9)</small>
 		<br />
 		<br />		
 		Real Name (required): 
@@ -103,6 +105,8 @@
 		<input name="url" size="60" <?php if(isset($_POST['url'])){echo 'value="'.$_POST['url'].'"';}?>/>
 		<br />
 		<?php
+		// add extra fields from plugin, like NP_Profile
+		$manager->notify('RegistrationFormExtraFields', array('type' => 'createaccount.php', 'prelabel' => '', 'postlabel' => '<br />', 'prefield' => '', 'postfield' => '<br /><br />'));
 		// add a Captcha challenge or something else
 		global $manager;
 		$manager->notify('FormExtra', array('type' => 'membermailform-notloggedin'));
diff -x .svn -aruN 3.33.src/extra/media/media.htaccess 3.40.src/extra/media/media.htaccess
--- 3.33.src/extra/media/media.htaccess	1969-12-31 18:00:00.000000000 -0600
+++ 3.40.src/extra/media/media.htaccess	2009-02-14 19:36:30.000000000 -0600
@@ -0,0 +1,5 @@
+# You may modify following line to avoid script execution completely.
+# In environment where multiple users are using Nucleus,
+# be sure that any script cannot be executed due to your server setting.
+# Note that this isn't needed when all members are super-admin.
+RemoveHandler php cgi pl py rb shtml
\ No newline at end of file
diff -x .svn -aruN 3.33.src/extra/media/readme.txt 3.40.src/extra/media/readme.txt
--- 3.33.src/extra/media/readme.txt	1969-12-31 18:00:00.000000000 -0600
+++ 3.40.src/extra/media/readme.txt	2009-02-14 19:36:30.000000000 -0600
@@ -0,0 +1,10 @@
+PLEASE NOTE: The media.htaccess file in this directory is intended to enhance security of your server by disallowing the running of scripts from the media folder. This will protect against rogue members, or external exploits, that rely on uploading script files to this folder for execution at a later time. Depending on the configuration of your web server, this code may not run as intended. 
+
+To apply it, follow these instructions:
+
+1. Be sure that another .htaccess file does not exist in the /media folder
+2. Copy the media.htaccess file into the media folder of your Nucleus CMS installation
+3. Rename the file to .htaccess
+4. If you have an existing .htaccess file in your media folder, copy the contents from the media.htaccess file into the existing .htacces file.
+
+You can disable after installing it by renaming the file to something else, or by removing the file from that folder.
\ No newline at end of file
diff -x .svn -aruN 3.33.src/extra/skins/readme.txt 3.40.src/extra/skins/readme.txt
--- 3.33.src/extra/skins/readme.txt	1969-12-31 18:00:00.000000000 -0600
+++ 3.40.src/extra/skins/readme.txt	2009-02-14 19:36:30.000000000 -0600
@@ -0,0 +1,10 @@
+PLEASE NOTE: the skins.htaccess file in this directory is intended to prohibit, for enhanced security, direct access .inc and .php files in the skin folders. Depending on the web server configuration, the code in this .htaccess file may not work as intended. In this case, your site will be displayed incorrectly, with missing content or style. Renaming the .htaccess file should fix the problem.
+
+To apply it, follow these instructions:
+
+1. Be sure that another .htaccess file does not exist in the /skins folder
+2. Copy the skins.htaccess file into the skins folder of your Nucleus CMS installation
+3. Rename the file to .htaccess
+4. If you have an existing .htaccess file in your skins folder, copy the contents from the skins.htaccess file into the existing .htacces file.
+
+You can disable after installing it by renaming the file to something else, or by removing the file from that folder.
\ No newline at end of file
diff -x .svn -aruN 3.33.src/extra/skins/skins.htaccess 3.40.src/extra/skins/skins.htaccess
--- 3.33.src/extra/skins/skins.htaccess	1969-12-31 18:00:00.000000000 -0600
+++ 3.40.src/extra/skins/skins.htaccess	2009-02-14 19:36:30.000000000 -0600
@@ -0,0 +1,4 @@
+<FilesMatch "\.(php|inc)$">
+Order allow,deny
+Deny from all
+</FilesMatch>
\ No newline at end of file
diff -x .svn -aruN 3.33.src/install_lang_english.php 3.40.src/install_lang_english.php
--- 3.33.src/install_lang_english.php	1969-12-31 18:00:00.000000000 -0600
+++ 3.40.src/install_lang_english.php	2009-02-14 19:36:52.000000000 -0600
@@ -0,0 +1,155 @@
+<?php
+/*
+ * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)
+ * Copyright (C) 2002-2007 The Nucleus Group
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ * (see nucleus/documentation/index.html#license for more info)
+ */
+
+/**
+ * @license http://nucleuscms.org/license.txt GNU General Public License
+ * @copyright Copyright (C) 2002-2007 The Nucleus Group
+ * @version $Id: install.php 1227 2007-12-14 16:48:40Z ehui $
+ */
+
+define('_ERROR1',	'Your PHP version does not have support for MySQL :(');
+define('_ERROR2',	'mySQL database name missing');
+define('_ERROR3',	'mySQL prefix was selected, but prefix is empty');
+define('_ERROR4',	'mySQL prefix should only contain characters from the ranges A-Z, a-z, 0-9 or underscores');
+define('_ERROR5',	'One of the URLs does not end with a slash, or action url does not end with \'action.php\'');
+define('_ERROR6',	'The path of the administration area does not end with a slash');
+define('_ERROR7',	'The media path does not end with a slash');
+define('_ERROR8',	'The skins path does not end with a slash');
+define('_ERROR9',	'The path of the administration area does not exist on your server');
+define('_ERROR10',	'Invalid e-mail address given for user');
+define('_ERROR11',	'User name is not a valid display name (allowed chars: a-zA-Z0-9 and spaces)');
+define('_ERROR12',	'User password is empty');
+define('_ERROR13',	'User password do not match');
+define('_ERROR14',	'Invalid short name given for blog (allowed chars: a-z0-9, no spaces)');
+define('_ERROR15',	'Could not connect to mySQL server');
+define('_ERROR16',	'Could not create database. Make sure you have the rights to do so. SQL error was');
+define('_ERROR17',	'Could not select database. Make sure it exists');
+define('_ERROR18',	'Error while executing query');
+define('_ERROR19',	'Error while setting member settings');
+define('_ERROR20',	'Error while setting weblog settings');
+define('_ERROR21',	'Error with query');
+define('_ERROR22',	'Unable to install plugin ');
+define('_ERROR23_1',	'Unable to import ');
+define('_ERROR23_2',	'file does not exist');
+define('_ERROR24',	'Unable to import ');
+define('_ERROR25_1',	'File <b>');
+define('_ERROR25_2',	'</b> is missing or not readable.');
+define('_ERROR26',	'Query error while trying to update config');
+define('_ERROR27',	'Error!');
+define('_ERROR28',	'Error message was');
+define('_ERROR29',	'Error message were');
+define('_ERROR30',	'Error while executing query');
+
+define('_NOTIFICATION1',	'Not available');
+
+define('_TITLE',	'Nuclues Install');
+define('_TITLE2',	'Skin/Plugin Install Errors');
+define('_TITLE3',	'Installation Almost Complete!');
+define('_TITLE4',	'Installation complete!');
+define('_TITLE5',	'Fight against Spam');
+
+define('_HEADER1', 	'Install Nucleus');
+define('_TEXT1',	'<p>This script will help you to install Nucleus. It will set up your MySQL database tables and provide you with the information you need to enter in <i>config.php</i>. In order to do all this, you need to enter some information.</p><p>All fields are mandatory. Optional information can be set from the Nucleus admin-area when installation is completed.</p>');
+
+define('_HEADER2',	'PHP &amp; MySQL Versions');
+define('_TEXT2',	'<p>Below are the version numbers of the PHP interpreter and the MySQL server on your webhost. When reporting problems on the Nucleus Support Forum, please include this information.</p>');
+define('_TEXT2_WARN',	'WARNING: Nucleus requires at least PHP ');
+define('_TEXT2_WARN2',	'INFORMATION: Nucleus requires at least MySQL ');
+define('_TEXT2_WARN3',	'WARNING: You are installing NucleusCMS on a older version of PHP. PHP4 support will be depreciated in the next release, please consider upgrade to PHP5!');
+
+define('_HEADER3',	'Automatic <i>config.php</i> Update');
+define('_TEXT3',	'<p>If you want Nucleus to automatically update the <em>config.php</em> file, you\'ll need to make it writable. You can do this by changing the file permissions to <strong>666</strong>. After Nucleus is successfully installed, you can change the permissions back to <strong>444</strong> (<a href="nucleus/documentation/tips.html#filepermissions">Quick guide on how to change file permissions</a>).</p> <p>If you choose not to make your file writable (or are unable to do so): don\'t worry. The installation process will provide you with the contents of the <em>config.php</em> file so you can upload it yourself.</p>');
+
+define('_HEADER4',	'MySQL Login Data');
+define('_TEXT4',	'<p>Enter your MySQL data below. This install script needs it to be able to create and fill your database tables. Afterwards, you\'ll also need to fill it out in <i>config.php</i>.</p> <p>If you don\'t know this information, contact your system administrator for more info. Often, the hostname will be \'localhost\'. If Nucleus found a \'default MySQL host\' in the PHP settings of your server, this host is already listed in the \'hostname\' field. There\'s no guarantee that this information is correct, though.</p>');
+define('_TEXT4_TAB_HEAD',	'General Database Settings');
+define('_TEXT4_TAB_FIELD1',	'Hostname');
+define('_TEXT4_TAB_FIELD2',	'Username');
+define('_TEXT4_TAB_FIELD3',	'Password');
+define('_TEXT4_TAB_FIELD4',	'Database');
+define('_TEXT4_TAB_FIELD4_ADD',	'needs to be created');
+
+define('_TEXT4_TAB2_HEAD',	'Advanced Database Settings');
+define('_TEXT4_TAB2_FIELD',	'Use table prefix');
+define('_TEXT4_TAB2_ADD',	'<p>Unless you\'re installing multiple Nucleus installations in one single database and know what you\'re doing, <strong>you really shouldn\'t change this</strong>.</p> <p>All database tables generated by Nucleus will start with this prefix.</p>');
+
+define('_HEADER5',	'Directories and URLs');
+define('_TEXT5',	'<p>This install script has attempted to find out the directories and URLs in which Nucleus is installed. Please check the values below and correct if necessary. The URLs and file paths should end with a slash.</p>');
+
+define('_TEXT5_TAB_HEAD',	'URLs and directories');
+define('_TEXT5_TAB_FIELD1',	'Site <strong>URL</strong>');
+define('_TEXT5_TAB_FIELD2',	'Admin-area <strong>URL</strong>');
+define('_TEXT5_TAB_FIELD3',	'Admin-area <strong>path</strong>');
+define('_TEXT5_TAB_FIELD4',	'Media files <strong>URL</strong>');
+define('_TEXT5_TAB_FIELD5',	'Media directory <strong>path</strong>');
+define('_TEXT5_TAB_FIELD6',	'Extra skin files <strong>URL</strong>');
+define('_TEXT5_TAB_FIELD7',	'Extra skin files directory <strong>path</strong>');
+define('_TEXT5_TAB_FIELD7_2',	'this is where imported skins can place their extra files');
+define('_TEXT5_TAB_FIELD8',	'Plugin files <strong>URL</strong>');
+define('_TEXT5_TAB_FIELD9',	'Action <strong>URL</strong>');
+define('_TEXT5_TAB_FIELD9_2',	'absolute location of the <tt>action.php</tt> file');
+define('_TEXT5_2',	'<p class="note"><strong>Note: Use absolute paths</strong> instead of relative paths. Usually, an absolute path will start with something like <tt>/home/username/public_html/</tt>. On Unix systems (most servers), paths should start with a slash. If you have trouble filling out this information, you should ask your administrator what to fill out.</p>');
+
+define('_HEADER6',	'Administrator User');
+define('_TEXT6',	'<p>Below, you need to enter some information to create the first user of your site.</p>');
+define('_TEXT6_TAB_HEAD',	'Administrator User');
+define('_TEXT6_TAB_FIELD1',	'Display Name');
+define('_TEXT6_TAB_FIELD1_2',	'allowed characters: a-z and 0-9, spaces allowed inside');
+define('_TEXT6_TAB_FIELD2',	'Real Name');
+define('_TEXT6_TAB_FIELD3',	'Password');
+define('_TEXT6_TAB_FIELD4',	'Password Again');
+define('_TEXT6_TAB_FIELD5',	'E-mail Address');
+define('_TEXT6_TAB_FIELD5_2',	'needs to be a valid e-mail address');
+
+define('_HEADER7',	'Weblog Data');
+define('_TEXT7',	'<p>Below, you need to enter some information to create a default weblog. The name of this weblog will also be used as name for your site</p>');
+define('_TEXT7_TAB_HEAD',	'Weblog Data');
+define('_TEXT7_TAB_FIELD1',	'Blog Name');
+define('_TEXT7_TAB_FIELD2',	'Blog Short Name');
+define('_TEXT7_TAB_FIELD2_2',	'allowed characters: a-z and 0-9, no spaces allowed');
+
+define('_HEADER8',	'Weblog Ping');
+define('_TEXT8_TAB_HEADER',	'Weblog Ping');
+define('_TEXT8_TAB_FIELD1',	'Install NP_Ping weblog pinging plugin');
+
+define('_HEADER9',	'Submit');
+define('_TEXT9',	'<p>Verify the data above, and click the button below to set up your database tables and initial data. This can take a while, so have patience. <strong>ONLY CLICK THE BUTTON ONCE !</strong></p>');
+
+define('_TEXT10',	'<p>The database tables have been initialized successfully. What still needs to be done is to change the contents of <i>config.php</i>. Below is how it should look like (the mysql password is masked, so you\'ll have to fill that out yourself)</p>');
+define('_TEXT11',	'<p>After you changed the file on your computer, upload it to your web server using FTP. Make sure you use ASCII mode to send over the files.</p>');
+define('_TEXT12',	'<b>Note:</b> Make sure that you have no spaces at the beginning or end of the <i>config.php</i> file. These would cause errors to happen when performing certain actions.<br /> Thus, the first character of config.php should be "&lt;", and the last character should be "&gt;".');
+define('_TEXT13',	'<p>Nucleus has been installed, and your <code>config.php</code> has been updated for you.</p> <p>Don\'t forget to change the permissions on <code>config.php</code> back to 444 for security (<a href="nucleus/documentation/tips.html#filepermissions">Quick guide on how to change file permissions</a>).</p>');
+define('_TEXT14',	'<p>Nucleus CMS allows every visitor to write comments in blogs. So there is a high risk that spammers abuse this function. We recommend that you protect your blog with one of the following methods:</p>');
+define('_TEXT14_L1',	'If you don\\\'t want comments you can disable them individually for each blog: Go to the hompage of the Admin area and choose <b>Your Weblog > Settings > Comments enabled > No</b>.');
+define('_TEXT14_L2',	'Install one of serveral plugins that help to avoid spam comments: <a href="http://faq.nucleuscms.org/item/45">How can I stop comment and trackback spam?</a> (you could bookmark this page to read it later).');
+define('_HEADER10',	'Delete your install files');
+define('_TEXT15',	'<p>Files you should delete from your web server:</p>');
+define('_TEXT15_L1',	'<b>install.sql</b>: file containing table structures');
+define('_TEXT15_L2',	'<b>install.php</b>: this file');
+
+define('_TEXT16',	'<p>If you don\\\'t delete these files, you won\\\'t be able to open the admin area</p>');
+
+define('_HEADER11',	'Visit your web site');
+define('_TEXT16',	'Your web site is now ready to use.');
+define('_TEXT16_L1',	'Login to the admin area to configure your site');
+define('_TEXT16_L2',	'Visit your site now');
+
+define('_TEXT17',	'Go Back');
+
+define('_BUTTON1',	'Install Nucleus');
+
+define('_1ST_POST_TITLE',	'Welcome to Nucleus CMS v3.4');
+define('_1ST_POST',	'This is the first post on your Nucleus CMS. Nucleus offers you the building blocks you need to create a web presence. Whether you want to
+create a personal blog, a family page, or an online business site, Nucleus CMS can help you achieve your goals.<br /> <br /> We\\\'ve loaded this first entry with links and information to get you started. Though you can delete this entry, it will eventually scroll off the main page as you add content to your site. Add your comments while you learn to work with Nucleus CMS, or bookmark this page so you can come back to it when you need to.');
+define('_1ST_POST2',	'<b>Home - <a href=\"http://nucleuscms.org/\" title=\"Nucleus CMS home\">nucleuscms.org</a></b><br /> Welcome to the world of Nucleus CMS. In 2001 a set of PHP scripts were let loose on the open Internet. Those scripts, which took user-generated data and used it to dynamically create html pages, contained the ideas and the algorithms that are the core of today\\\'s Nucleus CMS. Though Nucleus CMS 3.4 is far more flexible and powerful than the scripts from which it emerged, it still expresses the values that guided its birth: flexibility, security, and computational elegance.<br /> <br /> Thanks to an international community of sophisticated developers and designers, Nucleus CMS remains simple enough for anyone to learn, and expandable enough to allow you to build almost any website you can imagine. Nucleus CMS lets you integrate text, images, and user comments in a seamless package that will make your web presence as serious, professional, personal, or fun as you want it to be. We hope you enjoy its power.<br /> <br /> <b>Documentation - <a href=\"http://docs.nucleuscms.org/\" title=\"Nucleus CMS Documentation\">docs.nucleuscms.org</a></b><br /> The install process places a <a href=\"nucleus/documentation/\">user</a> and a <a href=\"nucleus/documentation/devdocs/\">developer</a> documentation on your web server. Pop-up <a href=\"/nucleus/documentation/help.html\">help</a> is available throughout the administration area to assist you in maintaining and customizing your site. When in the Nucleus CMS admin area, click on this symbol <img src=\"nucleus/documentation/icon-help.gif\" width=\"15\" height=\"15\" alt=\"help icon\" /> for context-sensitive help. You can also read this documentation online under <a href=\"http://docs.nucleuscms.org/\" title=\"Nucleus CMS Documentation\">docs.nucleuscms.org</a>.<br /> <br /> <b>Frequently Asked Questions - <a nicetitle=\"Nucleus CMS FAQ\" href=\"http://faq.nucleuscms.org/\">faq.nucleuscms.org</a></b><br /> If you need more information about managing, extending or troubleshooting your Nucleus CMS the Nucleus FAQ is the first place to search information. Over 170 frequently asked questions are answered from experienced Nucleus users.<br /> <br /> <b>Support - <a href=\"http://forum.nucleuscms.org/\" title=\"Nucleus CMS Support Forum\">forum.nucleuscms.org</a></b><br /> Should you require assistance, please don\\\'t hesitate to <a href=\"http://forum.nucleuscms.org/faq.php\">join</a> the 6,800+ registered users on our forums. With its built-in search capability of the 73,000+ posted articles, your answers are just a few clicks away. Remember: almost any question you think of has already been asked on the forums, and almost anything you want to do with Nucleus has been tried and explained there. Be sure to check them out.<br /> <br /> <b>Demonstration - <a href=\"http://demo.nucleuscms.org/\" title=\"Nucleus CMS Demonstration\">demo.nucleuscms.org</a></b><br /> Want to play around, test changes or tell a friend or relative about Nucleus CMS? Visit our live <a href=\"http://demo.nucleuscms.org/\">demo site</a>.<br /> <br /> <b>Skins - <a href=\"http://skins.nucleuscms.org/\" title=\"Nucleus CMS Skins\">skins.nucleuscms.org</a></b><br /> The combination of multi-weblogs and skins/templates make for a powerful duo in personalizing your site or designing one for a friend, relative or business client. Import new skins to change the look of your website, or create your own skins and share them with the Nucleus community! Help designing or modifying skins is only a few clicks away in the Nucleus forums.<br /> <br /> <b>Plugins - <a href=\"http://plugins.nucleuscms.org/\" title=\"Nucleus plugins\">plugins.nucleuscms.org</a></b><br /> Looking to add some extra functionality to the base Nucleus CMS package? Our <a href=\"http://wiki.nucleuscms.org/plugin\">plugin repository</a> gives you plenty of ways to extend and expand what Nucleus CMS can do; your imagination and creativity are the only limit on how Nucleus CMS can work for you.<br /> <br /> <b>Development - <a href=\"http://dev.nucleuscms.org/\" title=\"Nucleus Development\">dev.nucleuscms.org</a></b><br /> If you need more information about the Nucleus development you can find Informations in the developer documents at <a href=\"http://dev.nucleuscms.org/\" title=\"Nucleus Development\">dev.nucleuscms.org</a> or in the <a href=\"http://forum.nucleuscms.org/\">Support Forum</a>. Sourceforge.net graciously hosts our <a href=\"http://sourceforge.net/projects/nucleuscms/\">Open Source project page</a> which contains our software downloads and CVS repository.<br /> <br /> <b>Donators</b><br /> We would like to thank these <a href=\"http://nucleuscms.org/donators.php\">nice people</a> for their <a href=\"http://nucleuscms.org/donate.php\">support</a>. <em>Thanks all!</em><br /> <br /> <b>Vote for Nucleus CMS</b><br /> Like Nucleus CMS? Vote for us at <a href=\"http://www.hotscripts.com/Detailed/13368.html?RID=nucleus@demuynck.org\">HotScripts</a> and <a href=\"http://www.opensourcecms.com/index.php?option=content&task=view&id=145\">opensourceCMS</a>.<br /> <br /> <b>License</b><br /> When we speak of free software, we are referring to freedom, not price. Our <a href=\"http://www.gnu.org/licenses/gpl.html\">General Public Licenses</a> 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.');
+
+?>
diff -x .svn -aruN 3.33.src/media/.htaccess 3.40.src/media/.htaccess
--- 3.33.src/media/.htaccess	1969-12-31 18:00:00.000000000 -0600
+++ 3.40.src/media/.htaccess	2009-02-14 19:36:28.000000000 -0600
@@ -0,0 +1,5 @@
+# You may modify following line to avoid script execution completely.
+# In environment where multiple users are using Nucleus,
+# be sure that any script cannot be executed due to your server setting.
+# Note that this isn't needed when all members are super-admin.
+RemoveHandler php cgi pl py rb shtml
\ No newline at end of file
diff -x .svn -aruN 3.33.src/media/readme.txt 3.40.src/media/readme.txt
--- 3.33.src/media/readme.txt	2008-10-06 07:43:45.000000000 -0500
+++ 3.40.src/media/readme.txt	2009-02-14 19:36:28.000000000 -0600
@@ -13,3 +13,4 @@
 
 Global media collections that can be used by any member that is on a team. In order to create a new collection, simply create a new directory and assure write access is enabled for it.
 
+PLEASE NOTE: The .htaccess file in this directory is intended to enhance security of your server by disallowing the running of scripts from the media folder. This will protect against rogue members, or external exploits, that rely on uploading script files to this folder for execution at a later time. Depending on the configuration of your web server, this code may not run as intended. it can be disabled by renaming the .htaccess file.
\ No newline at end of file
diff -x .svn -aruN 3.33.src/nucleus/bookmarklet.php 3.40.src/nucleus/bookmarklet.php
--- 3.33.src/nucleus/bookmarklet.php	2008-10-06 07:43:46.000000000 -0500
+++ 3.40.src/nucleus/bookmarklet.php	2009-02-14 19:36:50.000000000 -0600
@@ -15,7 +15,7 @@
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: bookmarklet.php 1130 2007-03-13 14:42:38Z ehui $
+ * @version $Id: bookmarklet.php 1281 2008-10-24 06:01:23Z shizuki $
  */
 
 // bookmarklet is part of admin area (might need XML-RPC)
@@ -46,7 +46,7 @@
 	$action = 'add';
 }
 
-sendContentType('application/xhtml+xml', 'bookmarklet-' . $action);
+sendContentType('text/html', 'bookmarklet-' . $action);
 
 // check ticket
 $action = strtolower($action);
@@ -161,13 +161,18 @@
 		case 'changedate':
 			$publish = 1;
 			$wasdraft = 0;
-			$timestamp = mktime(postVar('hour'), postVar('minutes'), 0, postVar('month'), postVar('day'), postVar('year') );
+			$timestamp = mktime(intPostVar('hour'), intPostVar('minutes'), 0, intPostVar('month'), intPostVar('day'), intPostVar('year') );
 			break;
 		case 'edit':
 			$publish = 1;
 			$wasdraft = 0;
 			$timestamp = 0;
 			break;
+		case 'backtodrafts':
+			$publish = 0;
+			$wasdraft = 0;
+			$timestamp = 0;
+			break;
 		default:
 			bm_doError('Something went wrong');
 	}
@@ -306,7 +311,7 @@
 	<body>
 	<h1><?php echo $head; ?></h1>
 	<p><?php echo $msg; ?></p>
-	<p><a href="bookmarklet.php" onclick="window.close();"><?php echo _POPUP_CLOSE ?></a></p>
+	<p><a href="bookmarklet.php" onclick="window.close();window.opener.location.reload();"><?php echo _POPUP_CLOSE ?></a></p>
 	</body>
 	</html>
 
diff -x .svn -aruN 3.33.src/nucleus/documentation/devdocs/plugins.html 3.40.src/nucleus/documentation/devdocs/plugins.html
--- 3.33.src/nucleus/documentation/devdocs/plugins.html	2008-10-06 07:43:46.000000000 -0500
+++ 3.40.src/nucleus/documentation/devdocs/plugins.html	2009-02-14 19:36:50.000000000 -0600
@@ -1,7 +1,7 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
 <head>
-	<!-- $Id: plugins.html 1177 2007-06-22 12:37:32Z kaigreve $ -->
+	<!-- $Id: plugins.html 1304 2009-01-20 20:36:52Z ftruscot $ -->
 	<title>Nucleus - Plugin API</title>
 	<link rel="stylesheet" type="text/css" href="styles/manual.css" />
 	<style type="text/css">
@@ -30,7 +30,7 @@
 
 <div class="heading">
 Plugin API
-<i>June 16, 2007</i>
+<i>January 20, 2008</i>
 </div>
 
 <div class="note"><strong>Notes:</strong>
@@ -66,8 +66,10 @@
 	<li><a href="#admin">Providing an admin area</a></li>
 	<li><a href="#help">Providing a helppage</a></li>
 	<li><a href="#dependency">Plugin Dependency Check</a></li>
-<!--	<li><a href="#parser">Using the <code>PARSER</code> class</a></li>
-	<li><a href="#"></a></li>
+	<li><a href="#internationalization">Internationalizing a Plugin</a></li>
+	<li><a href="#skinvar-formatting">Formatting Output of SkinVars</a></li>
+	<li><a href="#additional-reading">Additional Reading</a></li>
+<!--	<li><a href="#parser">Using the <code>PARSER</code> class</a></li>	
 	<li><a href="#"></a></li>
 	<li><a href="#"></a></li>
 	<li><a href="#"></a></li>-->
@@ -239,6 +241,14 @@
 		<td>(v2.0b) Basically the same as <code>doSkinVar</code>, but this time for calls of the &lt;%plugin(...)%&gt;-var in <i>templates</i> (comments-related parts). By default, this method forwards the handling to the <code>doSkinVar</code>-method, using <code>template</code> as skintype. <a href="#templatevars">More information on implementing the <code>doTemplateCommentsVar</code> method</a></td>
 	</tr>
 	<tr>
+		<td><code>doItemVar(&amp;$item, &amp;$param)</code></td>
+		<td>(v3.30) Basically the same as <code>doSkinVar</code>, but this time for calls of the &lt;%plugin(...)%&gt;-var in an <i>item</i>. <code>&amp;$item</code> provides the full item object of the item in which the ItemVar appears and <code>&amp;$param</code> the parameters of the ItemVar.</td>
+	</tr>
+	<tr>
+		<td><code>doIf($key, $value)</code></td>
+		<td>(v3.30) Evaluates a custom conditional statement for the <code>if/ifnot/elseif/elseifnot</code> skin variables. Must return either <code>true</code> or <code>false</code>. $key and $value are strings passed from the <code>if/ifnot/elseif/elseifnot</code> skin variable. Normally, the plugin should check whether <code>$key</code> has the value of <code>$value</code>, but other uses are possible. Plugins that make use of this method, should document its use for users of the plugin.</td>
+	</tr>
+	<tr>
 		<td><code>doAction($type)</code></td>
 		<td>When a plugin wants to allow user interaction, it can allow actions through <code>action.php</code>. This is the script that Nucleus uses itself to handle new comments and karma votes. Called with the correct parameters, the <code>doAction</code>-method from a plugin can be called. The <code>$type</code> contains an optional message type. Extra variables from the request can be accessed from within the <code>doAction</code> method. By default, this method returns a string <q>No Such Action</q> which will trigger an error message. <a href="#actions">More info on <code>doAction</code>.</a></td>
 	</tr>
@@ -1488,6 +1498,76 @@
 			<dd>ID of the blog</dd>
 		</dl></td>
 	</tr>
+	<tr>
+		<td>RegistrationFormExtraFields</td>
+		<td>(v3.40) Called from createaccount.php after basic account fields, but before FormExtra event. This event can be used by plugins to add custom fields to the registration form. Plugins that subscribe to this event should also subscribe to PostRegister event to process the added fields. The parameters should be used to fit custom fields into existing format of registration form. Plugins should output the html code needed for their extra fields. For an example of using this event, see the NP_Profile plugin.</td>
+		<td><dl>
+			<dt class="ro">type</dt>
+			<dd>String. Type of registration form. Normally, <code>createaccount.php</code>.</dd>
+			<dt class="ro">prelabel</dt>
+			<dd>HTML code or string that should be inserted <strong>before</strong> the field label.</dd>
+			<dt class="ro">postlabel</dt>
+			<dd>HTML code or string that should be inserted <strong>after</strong> the field label.</dd>
+			<dt class="ro">prefield</dt>
+			<dd>HTML code or string that should be inserted <strong>before</strong> the input field.</dd>
+			<dt class="ro">postfield</dt>
+			<dd>HTML code or string that should be inserted <strong>after</strong> the input field.</dd>
+		</dl></td>
+	</tr>
+	<tr>
+		<td>TemplateExtraFields</td>
+		<td>(v3.40) Called when templates are edited and updated from the admin area. Allows plugin developers to add fields to existing templates to encourage the use of the core template storage system to provide formatting for their output. It is the responsibility of the plugin authors to use the template fields they add and to provide the variables used in those fields. Plugins should also document their variables and provide for a default, either in the code or through a plugin option. <a href="http://forum.nucleuscms.org/viewtopic.php?p=87672#87672" title="Sample">Sample plugin using this event.</a></td>
+		<td><dl>
+			<dt class="ref">fields</dt>
+			<dd>Associative Array. Key should be name of the plugin, i.e. <code>NP_TemplateTest</code>, and value should be an associative array with keys designating the template field name, and values designating the label used for the field. Template field names should be lowercase and incorporate the plugin name to avoid duplication of template field names.</dd>
+		</dl></td>
+	</tr>
+	<tr>
+		<td>PreArchiveListItem</td>
+		<td>(v3.40) Called right before the archive list is displayed. Allows plugin developers to add/modify template variables in the Archive List Item field of the template used for displaying archive lists. Plugins should document the variables added. </td>
+		<td><dl>
+			<dt class="ref">listitem</dt>
+			<dd>Associative Array. The key represents the template variable, i.e. <code>month</code>, and the value of the array element is a string representing the value of the template variable. To add a variable, simply add an element to this array with a key-value pair representing the new variable.</dd>
+		</dl></td>
+	</tr>
+	<tr>
+		<td>PreCategoryListItem</td>
+		<td>(v3.40) Called right before the category list is displayed. Allows plugin developers to add/modify template variables in the Category List Item field of the template used for displaying category lists. Plugins should document the variables added. </td>
+		<td><dl>
+			<dt class="ref">listitem</dt>
+			<dd>Associative Array. The key represents the template variable, i.e. <code>catname</code>, and the value of the array element is a string representing the value of the template variable. To add a variable, simply add an element to this array with a key-value pair representing the new variable.</dd>
+		</dl></td>
+	</tr>
+	<tr>
+		<td>PreBlogListItem</td>
+		<td>(v3.40) Called right before the blog list is displayed. Allows plugin developers to add/modify template variables in the Blog List Item field of the template used for displaying blog lists. Plugins should document the variables added. </td>
+		<td><dl>
+			<dt class="ref">listitem</dt>
+			<dd>Associative Array. The key represents the template variable, i.e. <code>blogname</code>, and the value of the array element is a string representing the value of the template variable. To add a variable, simply add an element to this array with a key-value pair representing the new variable.</dd>
+		</dl></td>
+	</tr>
+	<tr>
+		<td>PreTemplateRead</td>
+		<td>(v3.40) Called right before a template is read and its parts returned. Allows plugin developers to change the name of the template being used. NP_MultiLanguage makes use of this event. </td>
+		<td><dl>
+			<dt class="ref">name</dt>
+			<dd>String containing the name of the template being called.</dd>
+		</dl></td>
+	</tr>
+	<tr>
+		<td>CustomLogin</td>
+		<td>(v3.40) Called right before local (Nucleus) login. Allows plugin developers to customize the login process. This simplifies external authentication and permits using something beside the displayname, i.e. email address, to be used for the login name. </td>
+		<td><dl>
+			<dt class="ref">login</dt>
+			<dd>String containing the name entered by user in login field. If this is other than the Nucleus mname (display name), it should be mapped by the plugin, after a successful authentication, to a valid mname corresponding to the authenticated member. Otherwise the authentication will last only one page and no cookies will be set.</dd>
+			<dt class="ref">password</dt>
+			<dd>String containing the password entered by user in password field.</dd>
+			<dt class="ref">success</dt>
+			<dd>Integer indicating whether the login is successful. 1 means success, 0 means unsuccessful. 0 is the default. The plugin should set this.</dd>
+			<dt class="ref">allowlocal</dt>
+			<dd>Integer indicating whether local authentication should be tried after an unsuccessful authentication by your plugin. 1 means yes, 0 means no. 1 is the default.</dd>
+		</dl></td>
+	</tr>
 <!--
 	<tr>
 		<td></td>
@@ -1833,14 +1913,22 @@
 
 <h2>Your own tables</h2>
 
-<p>If your plugin needs database tables of it's own, you should create then in the <code>install</code> method and remove them in the <code>unInstall</code> method.</p>
+<p>If your plugin needs database tables of it's own, you should create them in the <code>install</code> method and remove them in the <code>unInstall</code> method.</p>
 
 <p>Some pointers</p>
 <ul>
 	<li>Consider using a table name like <code>nucleus_plug_<i>plugname</i></code> to avoid conflicts with other plugins. Generate them through <code>sql_table('plug_plugname')</code> to make it work with custom prefixes</li>
-	<li>You don't need to make a database connection yourself. You can execute queries using the PHP command <code>mysql_query()</code></li>
+	<li>You don't need to make a database connection yourself. You can execute queries using the Nucleus function <code>sql_query()</code> which is a wrapper for the PHP command <code>mysql_query()</code></li>
 	<li>If you do make a database connection yourself, make sure to restore the connection with the Nucleus database afterwards. You can do this by calling <code>sql_connect()</code> at the end of your function. It might also be good to do this from the constructor, to avoid reconnecting constantly. You could then save your link identifier in <code>$this->db</code> and pass that along with every query.</li>
-	<li>Also redefine the <code>getTableList()</code> method to make sure your table gets backupped when using the backup function.</li>
+	<li>Also redefine the <code>getTableList()</code> method to make sure your table gets backed up when using the backup function.</li>
+	<li>It's a good idea to make the removal of your database tables optional. This will allow your users to temporarily remove your plugin without losing the data. For instance, you may need to make changes to options or database tables requiring that the install() method be run to execute code neccessary to modify existing tables or options. This will require that your users uninstall the old version and then install the new version and losing their data in the process. To make the deletion of your tables optional, you can add an option like this in install():
+	<pre class="example"><code>$this->createOption('del_uninstall', 'Delete NP_MyPlugin data tables on uninstall?', 'yesno','no');</code></pre>
+	and this snippet in uninstall():
+	<pre class="example"><code>if ($this->getOption('del_uninstall') == 'yes')	{
+	foreach ($this->getTableList() as $table) {
+		sql_query("DROP TABLE $table");
+	}
+}</code></pre></li>
 </ul>
 
 
@@ -1851,7 +1939,7 @@
 
 <h2>Basics</h2>
 
-<p>To provide an admin area, you'll need take these steps:</p>
+<p>To provide an admin area, you'll need to take these steps:</p>
 
 <ol>
   <li>Create a subdirectory of the plugins directory, and name it <strong>pluginname</strong> if your plugin is <code>NP_PluginName</code>. Note that the name should be <strong>lowercase</strong>!</li>
@@ -1902,6 +1990,18 @@
 	return 1;
 }</code></pre>
   </li>
+  <li> Optional. Make the <code>QuickMenu</code> entry optional, and restrict who sees it. The following assumes that an option, of type <code>yesno</code> and called <code>quickmenu</code>, exists in install(). It also will restrict viewing of the <code>QuickMenu</code> entry to super-admins and to blog-admins.
+	<pre class="example"><code>function event_QuickMenu(&$data) {
+    // only show when option enabled
+    if ($this->getOption('quickmenu') != 'yes') return;
+    global $member;
+    if (!$member->isAdmin() && !count($member->getAdminBlogs())) return;
+    array_push($data['options'],
+      	array('title' => 'PluginName',
+       	'url' => $this->getAdminURL(),
+       	'tooltip' => 'Administer NP_PluginName'));
+}</code></pre>
+  </li>
 </ol>
 
 <h2>Considerations</h2>
@@ -1970,24 +2070,345 @@
 <p>Starting from 3.2, a new plugin interface is added to allow one to declare any dependency on other plugin(s). This is useful for any
 plugin that requires another plugin to function. It is particularly useful for a plugin to detect broken dependencies that prevent if from functioning properly.</p>
 
-<h2>How to write a plugin that utilize this function</h2>
+<h2>How to write a plugin that utilizes this function</h2>
 
-<p>Let start from a real world example:</p>
+<p>Let's start from a real world example:</p>
 
-<p>NP_PageLinkList depends on NP_BlogWithOffset to function, so we want to make sure if a user install NP_PageLinkList whithout first install
+<p>NP_PageLinkList depends on NP_BlogWithOffset to function, so we want to make sure a user cannot install NP_PageLinkList whithout first installing
 NP_BlogWithOffset. With this API, Nucleus offers a way for a plugin to detect any missing dependency before it is installed.</p>
 
 <p>In this case, we want to code into NP_PageLinkList to mark that it requires NP_BlogWithOffset. When the plugin is installed, the core calls a
 function in the plugin called <code>getPluginDep()</code>. This function returns a list of plugin it requires, and the core will check against all installed plugins and
 refuse to install the plugin if a dependency is missing.</p>
 
-<p>All we have to do is added this function to NP_PageLinkList:</p>
+<p>All we have to do is add this function to NP_PageLinkList:</p>
 
 <pre><code>function getPluginDep() {
 	 return array('NP_BlogWithOffset');
 }</code></pre>
 
-<p>The plugin dependency check also prevents plugins from being uninstalled if other plugins have a dependancy on it.</p>
+<p>The plugin dependency check also prevent a plugin from being uninstalled if other plugins have a dependancy on it.</p>
+
+<h1>Internationalizing Your Plugin <a name="internationalization" href="#top" class="toplink"><img src="../icon-up.gif" width="15" height="15" alt="back to top" /></a></h1>
+
+<p>Internationalization of a plugin allows your plugin to be easily used by people all over the world, people who do not 
+speak the same language as you do. It requires a little additional work for you, but makes translating the output of your plugin 
+as easy as translating a few phrases in a text file. Below is a description of the standard method suggested for use by Nucleus plugins. 
+Thanks to Andy Matsubara for the instructions.</p>
+
+<ol>
+	<li><strong>Develop your plugin</strong>
+
+At first, it is easier to develop it in your language. Use of language files is recommended after the plugin becomes stable.</li>
+	<li><strong>Create plugin directory</strong>
+
+If your plugin name is NP_AbcDef, the plugin directory name is abcdef (always lower case).</li>
+	<li><strong>Create language files</strong>
+
+Create the language files in the directory of your plugin. The name of the language file must be the same as that of the Nucleus language file name. For example, english.php is for English and default use. japanese-utf8.php for Japanese(UTF-Cool,japanese-euc.php for Japanese(EUC-JP).</li>
+	<li><strong>Define strings</strong>
+
+Define strings like below in the language file:
+
+<pre class="example"><code>&lt;?php
+define('_ABCDEF_MESSAGENAME',                  'actual strings in the language');
+  . . .
+?&gt;</code></pre>
+
+You have to define them for all static strings in your plugin. As defined name is used globally in the environment, it is recommended to have a prefix derived from the plugin name(in this case _ABCDEF).</li>
+	<li><strong>Replace static strings</strong>
+
+Replace static strings in your plugin with the defined names so they will change according to the language file.</li>
+	<li><strong>Create init method</strong>
+
+Make the init method in the plugin like below
+
+<pre class="example"><code>   function init() {
+      // include language file for this plugin
+      $language = ereg_replace( '[\\|/]', '', getLanguageName());
+      if (file_exists($this->getDirectory().$language.'.php'))
+         include_once($this->getDirectory().$language.'.php');
+      else
+         include_once($this->getDirectory().'english.php');
+   }</code></pre>
+</li>
+This logic is same as Nucleus language file setting.
+	<li><strong>Add language files</strong>
+
+As English is the default language, it is recommended to have at least the English version.	</li>
+</ol>
+
+
+
+<h1>Formatting your SkinVar output <a name="skinvar-formatting" href="#top" class="toplink"><img src="../icon-up.gif" width="15" height="15" alt="back to top" /></a></h1>
+
+<p>Some great plugin ideas never receive general use simply because the output generated by the <code>doSkinVar()</code> method is not flexible enough to meet the needs of 
+different skins or URL schemes. Nucleus provides some tools to help you generalize your output in ways that allow each user to fit it to his or her needs.</p>
+
+<p>To create links to Nucleus pages, such as blogs, categories, items, member details, action.php, admin area, or the plugin admin page, use the built in Nucleus functions 
+and global variables described below:</p>
+
+<table summary="An overview of functions and variables useful in creating links to Nucleus pages">
+	<caption>Functions and variables useful in creating links to Nucleus pages</caption>
+	<tr>
+		<th>Name</th><th>What</th><th>Parameters</th><th>Description</th>
+	</tr>
+	<tr>
+		<td><code>$CONF['AdminURL']</code></td>
+		<td>Global variable</td>
+		<td>None</td>
+		<td>Full URL to the Nucleus Admin Area</td>
+	</tr>
+	<tr>
+		<td><code>$CONF['PluginURL']</code></td>
+		<td>Global variable</td>
+		<td>None</td>
+		<td>Full URL to the Nucleus plugins directory. Use it to link to a plugin's admin page, like this <code>$CONF['PluginURL'].'pluginname/'</code></td>
+	</tr>
+	<tr>
+		<td><code>$CONF['ActionURL']</code></td>
+		<td>Global variable</td>
+		<td>None</td>
+		<td>Full URL to the Nucleus action.php file</td>
+	</tr>
+	<tr>
+		<td><code>$CONF['MediaURL']</code></td>
+		<td>Global variable</td>
+		<td>None</td>
+		<td>Full URL to the Nucleus media folder</td>
+	</tr>
+	<tr>
+		<td><code>$CONF['SkinsURL']</code></td>
+		<td>Global variable</td>
+		<td>None</td>
+		<td>Full URL to the Nucleus skins folder</td>
+	</tr>
+	<tr>
+		<td><code>$CONF['IndexURL']</code></td>
+		<td>Global variable</td>
+		<td>None</td>
+		<td>Full URL to the main Nucleus directory.</td>
+	</tr>
+	<tr>
+		<td><code>$DIR_NUCLEUS</code></td>
+		<td>Global variable</td>
+		<td>None</td>
+		<td>Full system path to the Nucleus Admin folder</td>
+	</tr>
+	<tr>
+		<td><code>$DIR_SKINS</code></td>
+		<td>Global variable</td>
+		<td>None</td>
+		<td>Full system path to the Nucleus skins folder</td>
+	</tr>
+	<tr>
+		<td><code>$DIR_MEDIA</code></td>
+		<td>Global variable</td>
+		<td>None</td>
+		<td>Full system path to the Nucleus media folder</td>
+	</tr>
+	<tr>
+		<td><code>$DIR_PLUGINS</code></td>
+		<td>Global variable</td>
+		<td>None</td>
+		<td>Full system path to the Nucleus plugins folder</td>
+	</tr>
+	<tr>
+		<td><code>$DIR_LANG</code></td>
+		<td>Global variable</td>
+		<td>None</td>
+		<td>Full system path to the Nucleus language folder</td>
+	</tr>
+	<tr>
+		<td><code>$DIR_LIBS</code></td>
+		<td>Global variable</td>
+		<td>None</td>
+		<td>Full system path to the Nucleus libs folder</td>
+	</tr>
+	<tr>
+		<td><code>getAdminURL()</code></td>
+		<td>method, PLUGIN class</td>
+		<td>None</td>
+		<td>Returns the URL of where the admin area of the plugin is located (if there is no such admin area, this information is invalid)</td>
+	</tr>
+	<tr>
+		<td><code>getDirectory()</code></td>
+		<td>method, PLUGIN class</td>
+		<td>None</td>
+		<td>Returns the full system path where the extra files for the plugin are stored (if there are no such files, this information makes no sense). The result is something like ".../nucleus/plugins/plugname/"</td>
+	</tr>
+	<tr>
+		<td><code>createItemLink($itemid, $extra = '')</code></td>
+		<td>Global function</td>
+		<td><code>$itemid</code> Integer. ID of item being linked.<br />
+			<code>$extra</code> Associative Array. Containing key-value pairs corresponding to additional parameters-values that should appear in the link.
+		</td>
+		<td>Returns the full URL, in scheme chosen by user, of item indicated by <code>$itemid</code></td>
+	</tr>
+	<tr>
+		<td><code>createMemberLink($memberid, $extra = '')</code></td>
+		<td>Global function</td>
+		<td><code>$memberid</code> Integer. ID of member being linked.<br />
+			<code>$extra</code> Associative Array. Containing key-value pairs corresponding to additional parameters-values that should appear in the link.
+		</td>
+		<td>Returns the full URL, in scheme chosen by user, of member page indicated by <code>$memberid</code></td>
+	</tr>
+	<tr>
+		<td><code>createCategoryLink($catid, $extra = '')</code></td>
+		<td>Global function</td>
+		<td><code>$catid</code> Integer. ID of category being linked.<br />
+			<code>$extra</code> Associative Array. Containing key-value pairs corresponding to additional parameters-values that should appear in the link.
+		</td>
+		<td>Returns the full URL, in scheme chosen by user, of category index page indicated by <code>$catid</code></td>
+	</tr>
+	<tr>
+		<td><code>createArchiveListLink($blogid = '', $extra = '')</code></td>
+		<td>Global function</td>
+		<td><code>$blogid</code> Integer. ID of blog whose archivelist is being linked.<br />
+			<code>$extra</code> Associative Array. Containing key-value pairs corresponding to additional parameters-values that should appear in the link.
+		</td>
+		<td>Returns the full URL, in scheme chosen by user, of archivelist page indicated by <code>$blogid</code></td>
+	</tr>
+	<tr>
+		<td><code>createArchiveLink($blogid, $archive, $extra = '')</code></td>
+		<td>Global function</td>
+		<td><code>$blogid</code> Integer. ID of blog whose archive is being linked.<br />
+			<code>$archive</code> String. Valid archive parameter for date (year-month) being linked.<br />
+			<code>$extra</code> Associative Array. Containing key-value pairs corresponding to additional parameters-values that should appear in the link.
+		</td>
+		<td>Returns the full URL, in scheme chosen by user, of archive page indicated by <code>$blogid</code> and <code>$archive</code></td>
+	</tr>
+	<tr>
+		<td><code>createBlogidLink($blogid, $extra = '')</code></td>
+		<td>Global function</td>
+		<td><code>$blogid</code> Integer. ID of blog being linked.<br />
+			<code>$extra</code> Associative Array. Containing key-value pairs corresponding to additional parameters-values that should appear in the link.
+		</td>
+		<td>Returns the full URL, in scheme chosen by user, of main index page indicated by <code>$blogid</code></td>
+	</tr>
+</table>
+
+<p>Using a template to format your output is always a good idea. You may want to output an unordered list, but another user may want the same data 
+separated by a simple character, or other unique format. Nucleus provides two ways to create and store the template data. In both 
+examples below, we will be creating a template with 2 variables, <code>&lt;%foo%&gt;</code> and <code>&lt;%bar%&gt;</code>.</p>
+
+<ol>
+	<li><strong>Using Plugin Options</strong>. This method may be the simplest and will work on all versions 3.2 and higher. It's 
+	big disadvantage is that plugin options are deleted during an uninstall, so your users may lose customizations during an upgrade of 
+	your plugin. Simply create an option in the <code>install()</code> method like the following:
+	<pre class="example"><code>$this->createOption('my_template', 
+		'Template used to format output of plugin.', 
+		'textarea', 
+		'&lt;li&gt;&lt;%foo%&gt; loves &lt;%bar%&gt;&lt;/li&gt;');</code></pre>
+	Then in the <code>doSkinVar()</code> method, determine the values of <code>foo</code> and <code>bar</code> and fill the template like this:
+	<pre class="example"><code>$mytemplate = $this->getOption('my_template');
+$couples = array(
+			array(
+				'foo'=>'Ricky',
+				'bar'=>'Lucy'),
+			array(
+				'foo'=>'Sid',
+				'bar'=>'Nancy'),
+			array(
+				'foo'=>'Mickey',
+				'bar'=>'Minnie')
+			);
+foreach ($couples as $values) {
+	echo TEMPLATE::fill($mytemplate,$values);
+}</code></pre>
+	Now the skinvar for our plugin <code>&lt;%TemplateTest%&gt;</code> will output three lines like this:
+	<pre class="example"><code>&lt;li&gt;Ricky loves Lucy&lt;/li&gt;
+&lt;li&gt;Sid loves Nancy&lt;/li&gt;
+&lt;li&gt;Mickey loves Minnie&lt;/li&gt;</code></pre>
+	</li>
+	
+	<li><strong>Using Nucleus Core Template System</strong>. This method will only work with versions 3.4 and higher. It has the advantage of 
+	being using the database-stored template system and can be exported like other template fields. For a full sample plugin using this method, 
+	see this <a href="http://forum.nucleuscms.org/viewtopic.php?p=87672#87672" title="Sample">thread from the support forum</a>. A summary is given here. 
+	First, create the option in <code>install()</code> as in method 1, but now we will use it as a default.
+	<pre class="example"><code>$this->createOption('my_template', 
+		'Template used to format output of plugin.', 
+		'textarea', 
+		'&lt;li&gt;&lt;%foo%&gt; loves &lt;%bar%&gt;&lt;/li&gt;');</code></pre>
+	Then, subscribe to the <code>TemplateExtraFields</code> event like this:
+	<pre class="example"><code>function getEventList() { return array('TemplateExtraFields'); }</code></pre>
+	Then, create a <code>event_TemplateExtraFields</code> method in your plugin, like this:
+	<pre class="example"><code>function event_TemplateExtraFields(&$data) {
+    /* Add an element in the $data['fields'] array using your plugin name as the key 
+	and an associative array containing the field name and field label*/
+    /* note that your field names should be lowercase and include the name 
+	of your template as shown below. This will ensure that all template field names are unique. */
+    $data['fields']['NP_TemplateTest'] = array(
+        'templatetest_body'=>'TemplateTest Body'
+    );
+}</code></pre>
+	Then, in the <code>doSkinVar()</code> method, you need to retrieve the template and fill it. Note the skinvar now needs to take 
+	the template name as a parameter.
+	<pre class="example"><code>function doSkinVar($skinType,$template = '') {
+	global $blog, $CONF, $manager,$member;
+
+	$template =& $manager->getTemplate($template);
+	if (trim($template['templatetest_body']) == '')
+		$template['templatetest_body'] = $this->getOption('my_template');
+		
+	$couples = array(
+			array(
+				'foo'=>'Ricky',
+				'bar'=>'Lucy'),
+			array(
+				'foo'=>'Sid',
+				'bar'=>'Nancy'),
+			array(
+				'foo'=>'Mickey',
+				'bar'=>'Minnie')
+			);
+	foreach ($couples as $values) {
+		echo TEMPLATE::fill($template['templatetest_body'],$values);
+	}	
+}</code></pre>
+	Here, the user needs to go to the template he wants to use and enter the formatting he desires into the TemplateTest Body field. 
+	For our purposes, we are using the default/index template. He may enter something like this:
+	<pre class="example"><code>&lt;li&gt;&lt;%foo%&gt; loves &lt;%bar%&gt;!!!&lt;/li&gt;</code></pre>
+	And using a SkinVar like <code>&lt;%TemplateTest(default/index)%&gt;</code> will output this:
+	<pre class="example"><code>&lt;li&gt;Ricky loves Lucy!!!&lt;/li&gt;
+&lt;li&gt;Sid loves Nancy!!!&lt;/li&gt;
+&lt;li&gt;Mickey loves Minnie!!!&lt;/li&gt;</code></pre>
+	</li>
+	
+	<li><strong>Formatting Items Using Regular Template</strong>. This applies only to versions 3.40 and higher and for 
+	plugins which output items. It has the advantage of using the existing Item fields in the core template system, 
+	just like the <code>&lt;%blog%&gt;</code> SkinVar does. This requires the use of a method in the BLOG class called 
+	<code>readLogFromList()</code> and requires that you input an array of itemids and a template name. If you need to 
+	add variables to the template, you can do so using the <code>doTemplateVar()</code> method. Here is an example of 
+	a <code>doSkinVar()</code> method that uses this technique. It takes 4 itemids as parameters, then outputs those four 
+	items using the default/index template
+	<pre class="example"><code>function doSkinVar($skinType,$item1 = 0,$item2 = 0,$item3 = 0,$item4 = 0) {
+	global $blog;
+	$highlight = '';
+	$template = 'default/index';
+	$item_array = array($item1,$item2,$item3,$item4);
+	$blog->readLogFromList($item_array, $template);
+}</code></pre>
+	
+	</li>
+</ol>
+
+
+<h1>Additional Reading <a name="additional-reading" href="#top" class="toplink"><img src="../icon-up.gif" width="15" height="15" alt="back to top" /></a></h1>
+
+<p>As this document is intended to get you started, there are other resources available that offer additional insight.</p>
+<ul>
+<li><a href="http://wiki.nucleuscms.org/plugindev:index" title="Development Wiki">Development Wiki</a></li>
+<li><a href="sqltables.html" title="Database Tables">Nucleus Database Table Structure</a></li>
+<!-- <li><a href="" title=""></a></li> -->
+</ul>
+
+<!--
+<pre class="example"><code></code></pre>
+<pre class="example"><code></code></pre>
+<pre class="example"><code></code></pre>
+<pre class="example"><code></code></pre>
+-->
 
 </body>
 </html>
diff -x .svn -aruN 3.33.src/nucleus/documentation/devdocs/sqltables.html 3.40.src/nucleus/documentation/devdocs/sqltables.html
--- 3.33.src/nucleus/documentation/devdocs/sqltables.html	2008-10-06 07:43:46.000000000 -0500
+++ 3.40.src/nucleus/documentation/devdocs/sqltables.html	2009-02-14 19:36:50.000000000 -0600
@@ -1,7 +1,7 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
 <head>
-	<!-- $Id: sqltables.html 1177 2007-06-22 12:37:32Z kaigreve $ -->
+	<!-- $Id: sqltables.html 1296 2009-01-13 20:27:04Z ftruscot $ -->
 	<title>Nucleus - SQL Table Structure</title>
 	<link rel="stylesheet" type="text/css" href="styles/manual.css" />
 	<style type="text/css">
@@ -52,7 +52,7 @@
 
 <div class="heading">
 SQL Table Reference
-<i>March 13, 2007</i>
+<i>January 15, 2009</i>
 </div>
 
 <h1>Introduction</h1>
@@ -65,7 +65,7 @@
 This document contains information on the fields inside the Nucleus database tables.
 </p>
 
-<p class="note">The structure as presented here is for <strong>Nucleus v3.2</strong>.</p>
+<p class="note">The structure as presented here is for <strong>Nucleus v3.4</strong>.</p>
 
 <h1><a name="toc" id="toc"></a>Table Of Contents</h1>
 
@@ -271,7 +271,20 @@
 	<td>tinyint(2)</td>
 	<td>'0'</td>
 	<td>Always include in search queries, even if the query is on another blog (1=true/0=false)</td>
-</tr></table>
+
+</tr><tr>
+	<td class="notnull">breqemail</td>
+	<td>tinyint(2)</td>
+	<td>'0'</td>
+	<td>Require non-members to supply an email address when adding comments (1=true/0=false)</td>
+	
+</tr><tr>
+	<td class="notnull">bfuturepost</td>
+	<td>tinyint(2)</td>
+	<td>'0'</td>
+	<td>Whether blog has future posts awaiting publishing (1=true/0=false)</td>
+</tr>
+</table>
 
 
 <a id="nucleus_category" name="nucleus_category"></a>
@@ -388,6 +401,12 @@
 	<td>NULL</td>
 	<td>Category to which the item belongs</td>
 
+</tr><tr>
+	<td class="notnull">iposted</td>
+	<td>tinyint(2)</td>
+	<td>'1'</td>
+	<td>Is the item posted? 0 means it is awaiting publication on a future date.</td>
+
 </tr></table>
 
 
@@ -421,7 +440,13 @@
 	<td>cmail</td>
 	<td>varchar(100)</td>
 	<td>NULL</td>
-	<td>E-mail address or URL (only used when comment was placed by a non-member. For members, see <code>cmember</code>)</td>
+	<td>URL or, pre-3.3, E-mail address (only used when comment was placed by a non-member. For members, see <code>cmember</code>)</td>
+
+</tr><tr>
+	<td>cemail</td>
+	<td>varchar(100)</td>
+	<td>NULL</td>
+	<td>E-mail address (only used when comment was placed by a non-member. For members, see <code>cmember</code>)</td>
 
 </tr><tr>
 	<td class="foreign"><a href="#nucleus_member">cmember</a></td>
@@ -825,7 +850,7 @@
 
 </tr><tr>
 	<td class="notnull primary">tpartname</td>
-	<td>varchar(20)</td>
+	<td>varchar(64)</td>
 	<td>''</td>
 	<td>
 		Name of template part
@@ -833,26 +858,38 @@
 			<li>ARCHIVELIST_FOOTER</li>
 			<li>ARCHIVELIST_HEADER</li>
 			<li>ARCHIVELIST_LISTITEM</li>
+			<li>BLOGLIST_FOOTER</li>
+			<li>BLOGLIST_HEADER</li>
+			<li>BLOGLIST_LISTITEM</li>
 			<li>CATLIST_FOOTER</li>
 			<li>CATLIST_HEADER</li>
 			<li>CATLIST_LISTITEM</li>
+			<li>COMMENTS_AUTH</li>
 			<li>COMMENTS_BODY</li>
+			<li>COMMENTS_CONTINUED</li>
+			<li>COMMENTS_FOOTER</li>
+			<li>COMMENTS_HEADER</li>
 			<li>COMMENTS_MANY</li>
 			<li>COMMENTS_NONE</li>
 			<li>COMMENTS_ONE</li>
 			<li>COMMENTS_TOOMUCH</li>
+			<li>DATE_FOOTER</li>
 			<li>DATE_HEADER</li>
 			<li>EDITLINK</li>
 			<li>FORMAT_DATE</li>
 			<li>FORMAT_TIME</li>
 			<li>IMAGE_CODE</li>
+			<li>ITEM_FOOTER</li>
+			<li>ITEM_HEADER</li>
 			<li>ITEM</li>
 			<li>LOCALE</li>
 			<li>MEDIA_CODE</li>
 			<li>MORELINK</li>
+			<li>NEW</li>
 			<li>POPUP_CODE</li>
 			<li>SEARCH_HIGHLIGHT</li>
 			<li>SEARCH_NOTHINGFOUND</li>
+			<li>other template fields as added by plugins using TemplateExtraFields event</li>
 		</ul>
 	</td>
 
@@ -880,7 +917,7 @@
 
 </tr><tr>
 	<td class="notnull unique">tdname</td>
-	<td>varchar(20)</td>
+	<td>varchar(64)</td>
 	<td>''</td>
 	<td>Name of template</td>
 
@@ -1085,6 +1122,14 @@
 	<td>DatabaseVersion</td>
 	<td>250</td>
 	<td>Last Nucleus version for which the database structure has been updated (introduced in Nucleus v2.5)</td>
+</tr><tr>
+	<td>DebugVars</td>
+	<td>0</td>
+	<td>Whether unresolved variables should be displayed in skins (introduced in Nucleus v3.4)</td>
+</tr><tr>
+	<td>DefaultListSize</td>
+	<td>10</td>
+	<td>Set the size of lists in the admin area (introduced in Nucleus v3.4)</td>
 </tr></table
 
 <a id="nucleus_tickets" name="nucleus_tickets"></a>
diff -x .svn -aruN 3.33.src/nucleus/documentation/help.html 3.40.src/nucleus/documentation/help.html
--- 3.33.src/nucleus/documentation/help.html	2008-10-06 07:43:46.000000000 -0500
+++ 3.40.src/nucleus/documentation/help.html	2009-02-14 19:36:50.000000000 -0600
@@ -1,7 +1,7 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
-	<!-- $Id: help.html 1175 2007-06-16 22:14:16Z kaigreve $ -->
+	<!-- $Id: help.html 1317 2009-02-06 19:11:24Z ftruscot $ -->
 
 	<title>Nucleus Admin Help</title>
 	<style type="text/css">
@@ -26,7 +26,7 @@
 		}
 
 		.page {
-			height: 800px;
+			height: 2400px;
 			text-align: justify;
 			margin-bottom: 100px;
 		}
@@ -120,6 +120,14 @@
 </div>
 
 
+<div class="page"><a name="autosave"></a>
+<h1>Autosave</h1>
+<p>The Autosave function saves an item as a <a href="#draft">draft</a> after 10 minutes editing. It should avoid that unsaved changes get lost. It is usefull for users that work for a long time on an item and often forget to save their work.</p>
+<p>If you want to invoke Autosave before the 10 minutes are past, you can press the '<strong>Auto save now</strong>' button at the end of the form.</p>
+<p>The Autosave function can be enabled and disabled in the member options.</p>
+</div>
+
+
 <div class="page"><a name="draft"></a>
 <h1>Drafts</h1>
 <p>
@@ -372,6 +380,16 @@
 
 </div>
 
+<div class="page"><a name="defaultlistsize"></a>
+<h1>Default List Size</h1>
+<p>(3.40) Using this option, you can set the default size of lists in the Admin Area. Value should be an integer. 10 is a good default for most users.</p>
+</div>
+
+<div class="page"><a name="debugvars"></a>
+<h1>Debug Vars</h1>
+<p>(3.40) Using this option, you can set whether unresolved Vars (SkinVars, TemplateVars, ItemVars) are shown on the blog. Default is <code>No</code>.</p>
+</div>
+
 <div class="page"><a name="templateitems"></a>
 <h1>Templates: Items</h1>
 <p>
@@ -617,6 +635,77 @@
 
 </div>
 
+<div class="page"><a name="templatebloglists"></a>
+<h1>Templates: Blog Lists</h1>
+
+<p>The blog lists are formatted as listed below:</p>
+
+<pre>bloglist header
+  bloglist listitem (repeated)
+bloglist footer</pre>
+
+<p>Available variables in list item field: </p>
+
+<table><tr>
+	<th>Name</th>
+	<th>Description</th>
+</tr><tr>
+	<td>bloglink</td>
+	<td>URL of the blog (as generated by createBlogIdLink() function)</td>
+</tr><tr>
+	<td>blogurl</td>
+	<td>URL of the blog (as defined in blogsettings)</td>
+</tr><tr>
+	<td>blogdesc</td>
+	<td>Description of the blog</td>
+</tr><tr>
+	<td>blogname</td>
+	<td>Name of the blog (either full or short, depending on skinvar parameter).</td>
+</tr></table>
+
+<p>Available variables in header and footer fields: </p>
+
+<table><tr>
+	<th>Name</th>
+	<th>Description</th>
+</tr><tr>
+	<td>siteurl</td>
+	<td>URL of the site (as defined in global settings)</td>
+</tr><tr>
+	<td>sitename</td>
+	<td>Name of the site (as defined in global settings).</td>
+</tr></table>
+
+<p><a href="#bloglistexample">View an example</a></p>
+
+</div>
+
+<div class="page"><a name="bloglistexample"></a>
+<h1>Templates: Blog Lists Example</h1>
+<p>
+<a href="#templatebloglists">(go back)</a>
+</p>
+
+<h2>Header</h2>
+<pre><code>&lt;ul&gt;
+  &lt;li&gt;&lt;a href="&lt;siteurl%&gt;"&gt;&lt;sitename%&gt;&lt;/a&gt;&lt;/li&gt;</code></pre>
+
+<h2>List Item</h2>
+<pre><code>&lt;li&gt;&lt;a href="&lt;%bloglink%&gt;"&gt;&lt;%blogname%&gt;&lt;/a&gt;&lt;/li&gt;</code></pre>
+
+<h2>Footer</h2>
+<pre><code>&lt;/ul&gt;</code></pre>
+
+<h2>Results in:</h2>
+
+<ul class="example">
+	<li><a href="#bloglistexample">My Site</a></li>
+	<li><a href="#bloglistexample">mainblog</a></li>
+	<li><a href="#bloglistexample">newsblog</a></li>
+</ul>
+
+</div>
+
 
 
 
@@ -1157,6 +1246,46 @@
 </div>
 
 
+<div class="page"><a name="skinpartspecial"></a>
+<h1>Skins: Main Index</h1>
+<p>
+This skinpart is used to show special, non-blog, content on your site. It can be used to show static content, or to wrap other 
+dynamic applications, like forms, inside the skin of your blog. It is accessed by the name of the special skin part, in this way 
+(assuming the special skin part is named <code>fred</code>):
+</p>
+<code>http://www.yoursite.tld/index.php?special=fred</code>
+
+<p>Further discussion of the use of this feature can be found on the support forum: 
+<a href="http://forum.nucleuscms.org/viewtopic.php?t=16501" title="Special Skin Parts">Nucleus 3.31 and Static Pages</a>
+</p>
+
+<p>
+Very basic buildup for a special skin part:
+</p>
+
+<pre>
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;title&gt;My Weblog&lt;/title&gt;
+  &lt;/head&gt;
+  &lt;body&gt;
+
+    &lt;h1&gt;About My Site&lt;/h1&gt;
+    &lt;p&gt;This page was published in order 
+	to provide a platform to publicize the plight 
+	of the peeping-polly parrot whose present 
+	prognosis is perturbingly pessimistic.&lt;/p&gt;
+
+  &lt;/body&gt;
+&lt;/html&gt;
+</pre>
+
+<p>
+	This will show the text of the body as indicated above. Also, many SkinVars work on special pages, so you can make 
+	the page look just like the other pages and use SkinVars to show an index of the whole site, or a list of members, etc...
+</p>
+</div>
+
 
 
 
@@ -1482,6 +1611,12 @@
 	<ul>
 		<li><strong>bnametype</strong>: whether the Blog Name (<code>name</code>) or the Short Blog Name (<code>shortname</code>) of the Blog is used. Default setting is the Blog name (<code>name</code>).</li>
 	</ul>
+	<ul>
+		<li><strong>orderby</strong>: (3.40) Attribute of the blog used for determinig the order in which the blogs are listed. Supported values are <code>number</code>, <code>name</code>, <code>shortname</code>, <code>description</code>. Default is <code>number</code>.</li>
+	</ul>
+	<ul>
+		<li><strong>direction</strong>: (3.40) Direction of the sorting, <code>asc</code> for ascending order, or <code>desc</code> for descending order. Default is <code>asc</code>.
+	</ul>
 </p>
 
 <h2>Skintypes</h2>
@@ -1496,6 +1631,7 @@
 &lt;%bloglist(default/index)%&gt;
 &lt;%bloglist(default/index,name)%&gt; 
 &lt;%bloglist(default/index,shortname)%&gt;
+&lt;%bloglist(default/index,name,name,asc)%&gt; 
 </pre>
 
 </div>
@@ -2081,7 +2217,31 @@
 </div>
 
 
+<div class="page">
+<a name="skinvar-charset"></a>
+<h1>Skinvar: charset</h1>
 
+<p>Inserts the character set encoding used by the current language file.</p>
+
+<h2>Arguments</h2>
+
+<p>
+None
+</p>
+
+<h2>Skintypes</h2>
+
+<p>
+all
+</p>
+
+<h2>Examples</h2>
+
+<pre>
+&lt;%charset%&gt;
+</pre>
+
+</div>
 
 
 
@@ -3136,12 +3296,15 @@
 <a name="skinvar-if"></a>
 <a name="skinvar-else"></a>
 <a name="skinvar-endif"></a>
-<h1>Skinvars: if/else/endif</h1>
+<a name="skinvar-ifnot"></a>
+<a name="skinvar-elseifnot"></a>
+<a name="skinvar-elseif"></a>
+<h1>Skinvars: if/ifnot/else/elseif/elseifnot/endif</h1>
 
 <p>Inserts a content block only when certain conditions are fullfilled</p>
 
 <h2>Arguments</h2>
-<p>Only the <code>if</code> skinvar has options</p>
+<p>Only the <code>if</code>, <code>ifnot</code>, <code>elseif</code>, and <code>elseifnot</code> skinvars have options</p>
 
 
 <ul>
@@ -3163,9 +3326,12 @@
 	<li><strong>blogsetting</strong>: checks if the value <em>name</em> blogsetting equals <em>value</em> (the name is the column name from the nucleus_blog sql table)</li>
 	<li><strong>loggedin</strong>: condition is fullfilled if visiting member is currently logged in</li>
 	<li><strong>onteam</strong>: condition is fullfilled if visiting member is currently logged in &amp; member of the blog team of the current blog (or the blog given in the <em>name</em> parameter)</li>
+	<li><strong>admin</strong>: condition is fullfilled if visiting member is currently logged in &amp; member with blog admin rights to the current blog (or the blog given in the <em>name</em> parameter)</li>
 	<li><strong>nextitem</strong>: true if there is a more recent item available for the current weblog (item skintype)</li>
-	<li><strong>nextitem</strong>: true if there is an older item available for the current weblog (item skintype)</li>
-	<li><strong>skintype</strong>: checks if the current skin type is equal to <em>value</em> (index, search, item, archive, archivelist, ...)</li>
+	<li><strong>previtem</strong>: true if there is an older item available for the current weblog (item skintype)</li>
+	<li><strong>archivenextexists</strong>: true if there is a more recent archive available for the current weblog (archive skintype)</li>
+	<li><strong>archiveprevexists</strong>: true if there is an older archive available for the current weblog (archive skintype)</li>
+	<li><strong>skintype</strong>: checks if the current skin type is equal to <em>value</em> (index, search, item, archive, archivelist, ...). For special skin parts, the skin type is the name of the special skin part.</li>
 	<li><strong>hasplugin</strong>: checks if the a plugin is installed, or if a plugin option has been set to a specific value
 		<ul>
 			<li><strong>hasplugin,<em>PluginName</em></strong>: checks if plugin is available</li>
@@ -3173,6 +3339,12 @@
 			<li><strong>hasplugin,<em>PluginName</em>,<em>OptionName=value</em></strong>: checks if a plugin option is set to a specific value</li>
 		</ul>
 	</li>
+	<li><strong><em>PluginName</em></strong>: checks if the a plugin is installed, and executes doIf() method of plugin to check condition of name/value pair. This allows plugins to do conditional checks in a skin. See documentation for your plugin to determine what conditionals it can perform and the syntax required for its use.
+		<ul>
+			<li><strong><em>PluginName</em>,<em>AttributeName</em></strong>: uses <em>PluginName</em> plugin to check if <em>AttributeName</em> has empty value</li>
+			<li><strong><em>PluginName</em>,<em>AttributeName</em>,<em>AttributeValue</em></strong>: uses <em>PluginName</em> plugin to check if <em>AttributeName</em> is <em>AttributeValue</em></li>
+		</ul>
+	</li>
 </ul>
 
 <h2>Skintypes</h2>
@@ -3197,12 +3369,24 @@
 &lt;%endif%&gt;
 </pre>
 
+<pre>
+&lt;%ifnot(loggedin)%&gt;
+Access Denied!
+&lt;%elseif(admin)%&gt;
+Welcome O Mighty Admin of this Blog!
+&lt;%elseif(onteam)%&gt;
+Welcome O Worthy Blog Team Member!
+&lt;%else%&gt;
+Welcome O Humble Site Member!
+&lt;%endif%&gt;
+</pre>
+
 <h2>Notes</h2>
 
 <p>If you want something to be displayed only if a condition is not fullfilled, you can use a construct like this:</p>
 
 <pre>
-&lt;%if(skintype,error)%&gt;&lt;%else%&gt;
+&lt;%ifnot(skintype,error)%&gt;
 &lt;%blogsetting(name)%&gt;
 &lt;%endif%&gt;
 </pre>
@@ -3352,9 +3536,55 @@
 </div>
 
 
+<div class="page">
+<a name="skinvar-addlink"></a>
+<h1>Skinvar: addlink</h1>
 
+<p>
+Inserts a URL to the new item bookmarklet form. Only shown for members who have rights on the current blog.
+</p>
+
+<h2>Arguments</h2>
+<p>None</p>
+
+<h2>Skintypes</h2>
+
+<p>
+all
+</p>
+
+<h2>Examples</h2>
+
+<pre>
+&lt;dd&gt;&lt;a href="&lt;%addlink%&gt;" onclick="&lt;%addpopupcode%&gt;" title="Add an item to your blog"&gt;Add an item&lt;/a&gt;&lt;/dd&gt;
+</pre>
+
+</div>
+
+<div class="page">
+<a name="skinvar-addpopupcode"></a>
+<h1>Skinvar: addpopupcode</h1>
+
+<p>
+Inserts javascript code to open a bookmarklet in an popup window. Use with <code>&lt;%addlink%&gt;</code>
+</p>
+
+<h2>Arguments</h2>
+<p>None</p>
+
+<h2>Skintypes</h2>
 
+<p>
+all
+</p>
+
+<h2>Examples</h2>
 
+<pre>
+&lt;dd&gt;&lt;a href="&lt;%addlink%&gt;" onclick="&lt;%addpopupcode%&gt;" title="Add an item to your blog"&gt;Add an item&lt;/a&gt;&lt;/dd&gt;
+</pre>
+
+</div>
 
 
 
diff -x .svn -aruN 3.33.src/nucleus/documentation/history.html 3.40.src/nucleus/documentation/history.html
--- 3.33.src/nucleus/documentation/history.html	2008-10-06 07:43:46.000000000 -0500
+++ 3.40.src/nucleus/documentation/history.html	2009-02-14 19:36:50.000000000 -0600
@@ -1,9 +1,22 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en-us" xml:lang="en-us">
 <head>
-	<!-- $Id: history.html 1213 2007-10-22 17:21:23Z kaigreve $ -->
+	<!-- $Id: history.html 1324 2009-02-13 05:04:30Z shizuki $ -->
+    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+    <meta http-equiv="Content-Style-Type" content="text/css" />
+    <meta http-equiv="Content-Script-Type" content="text/javascript" />
+    <link rel="index" href="./index.html" />
 	<title>Nucleus - History</title>
 	<link rel="stylesheet" type="text/css" href="styles/manual.css" />
+    <style type="text/css">
+        strong {
+            font-weight: bold;
+        }
+        em {
+            font-style: italic;
+        }
+    </style>
 </head>
 <body>
 
@@ -15,19 +28,102 @@
 
 <ul>
 	<li>
-		<b>Nucleus v3.33 (August 20, 2008)</b>
+		<strong>Nucleus v3.40 (February 14, 2009)</strong>
+		<ul>
+			<li>ADDED: check cmail column to separate to URL and cemail when Nucleus upgrade to 3.3 or later. (kimitake/katsumi)(added by shizuki from Ver.jp)</li>
+			<li>CHANGED: Comment count at items list display via 'sprintf()'. (shizuki)</li>
+			<li>ADDED: instructions for manually adding .htaccess files to media and skins folder after upgrade. (ftruscot)</li>
+			<li>FIXED: the unwished ping after adding an item to a new category (what you have written here: http://forum.nucleuscms.org/viewtopic.php?p=89142#89142)(shizuki)</li>
+			<li>FIXED: Few hardcoded strings moved to langage file(shizuki)</li>
+			<li>CHANGED: Ease the solution for the new member option for autosave draft(kaigreve)</li>
+			<li>CHANGED: Move System overview in the menu of the admin area under the entry for the configuration (ADMIN.php)</li>
+			<li>CHANGED: Shorten menu entry to 'System info' and correct 'enable' to 'enabled' (english.php)</li>
+			<li>CHANGED: height of page class in help.html to avoid overlaps on long help topics. (ftruscot)</li>
+			<li>ADDED: .htaccess file in skins/ and nucleus/libs/ to fight possible script execution due to certain apache configurations. (Code recommended by Katsumi, added to svn by ftruscot)</li>
+			<li>ADDED: .htaccess file in media/ to fight possible script execution due to certain apache configurations. (Code recommended by Katsumi, added to svn by ftruscot)</li>
+			<li>ADDED: New member option to decide whether the autosave draft function is used or not (kaigreve)</li>
+			<li>CHANGED: Additional improvements and updates in devdocs and help.html (ftruscot)</li>
+			<li>ADDED: Warning for PHP 4.x depreciated during upgrade(admun)</li>
+			<li>ADDED: Documentation, as needed, for changes below. (ftruscot)</li>
+			<li>ADDED: BLOG::readLogFromList() and BLOG::getSqlItemList() to allow using the core item display mechanisms for customized lists of items. Will be used primarily by plugins. (ftruscot)</li>
+			<li>CHANGED: MEMBER::login() to add CustomLogin event. Provides hook for plugins to perform authentication from external sources. (ftruscot)</li>
+			<li>ADDED: Upgrade scripts for version 3.40. Lengthen nucleus_template.tpartname column to 64. Lengthen nucleus_template_desc.tdname to 64. (ftruscot)</li>
+			<li>ADDED: Warning for PHP 4.x depreciated (admun)</li>
+			<li>FIXED: MySQL version check failure in install.php (admun)</li>
+			<li>FIXED: bugs in last fix of directory traversal vulnerability in Nucleus media manager. Fix code providedby kmorimatsu inserted by ftruscot.</li>
+			<li>FIXED: directory traversal vulnerability in Nucleus media manager. Fix code provided by kmorimatsu inserted by ftruscot.</li>
+			<li>FIXED: cuser field of non-member comments being blanked out intermittently<a href="http://forum.nucleuscms.org/viewtopic.php?t=18059">Old comments from field is gone.</a> Caused by registration with names longer than 16 characters. Enforce 16 character limit in createaccount.php, ADMIN.php, ACTION.php (ftruscot)</li>
+			<li>ADDED: Add delete permission check (katsumi/admun)</li>
+			<li>ADDED: Add ATOM1.0 autodiscovery for default skin. (shizuki)</li>
+			<li>FIXED: Fix short open tag on skins/default/show_benchmark.inc. (shizuki)</li>
+			<li>FIXED: Fix broken XML for Skins. (shizuki)</li>
+			<li>ADDED: <a href="http://japan.nucleuscms.org/bb/viewtopic.php?t=3231">Japanese forum:Special skin parts are used as a skin part.</a> (Andy/shizuki)</li>
+			<li>ADDED: The number of comments is indicated on the item list screen. <a href="http://japan.nucleuscms.org/bb/viewtopic.php?t=2231">Japanese forum(The confirmation and the elimination which are a comment every item.)</a> (shizuki)</li>
+			<li>ADDED: Automatic re loading after an item renewal. <a href="http://blog.bitocean.net/item/40/catid/2">Bibou-Nikki/Automatic re loading after an item renewal.</a> (shizuki)</li>
+			<li>ADDED: Prevention of comment double contribution. <a href="http://blog.bitocean.net/item/35/catid/2">Bibou-Nikki/Prevention of comment double contribution.</a> (shizuki)</li>
+			<li>ADDED: Addition of an item  The hack which checks a radio button of "of the date and time, designation" automatically if the item of the date is changed at the time of edit. <a href="http://japan.nucleuscms.org/bb/viewtopic.php?t=2285">Japanese forum(Check box of "later, addition" and "of a time stamp, renewal")</a> (shizuki)</li>
+			<li>FIXED: (<a href="http://nucleus-jp.sourceforge.jp/tracker/index.php?do=details&amp;task_id=110">#110(JP)</a>): When an item is added by "new category", a SendPing event doesn't occur. (shizuki)</li>
+			<li>FIXED: (<a href="http://nucleus-jp.sourceforge.jp/tracker/index.php?do=details&amp;task_id=58">#58(JP)</a>): When database backup, table name and a column name are bound up with back quotat. (shizuki)</li>
+			<li>CHANGED: Eliminate few hardcoded language (shizuki)</li>
+			<li>FIXED: (<a href="http://nucleus-jp.sourceforge.jp/tracker/index.php?do=details&amp;task_id=94">#94(JP)</a>): A plugin option isn't generated. (kimitake/shizuki)</li>
+			<li>FIXED: (<a href="http://nucleus-jp.sourceforge.jp/tracker/index.php?do=details&amp;task_id=79">#79(JP)</a>): Permission setting of upload isn't effective. (shizuki/yu)</li>
+			<li>FIXED: (<a href="http://nucleus-jp.sourceforge.jp/tracker/index.php?do=details&amp;task_id=77">#77(JP)</a>): [XHTML] When the attribute of the option is hidden,&lt;tr&gt; isn't output. (shizuki)</li>
+			<li>FIXED: (<a href="http://nucleus-jp.sourceforge.jp/tracker/index.php?do=details&amp;task_id=76">#76(JP)</a>): [XHTML] Validate admin-area. (shizuki)</li>
+			<li>FIXED: (<a href="http://nucleus-jp.sourceforge.jp/tracker/index.php?do=details&amp;task_id=67">#67(JP)</a>): Change isn't reflected on ValidateForm event. (shizuki)</li>
+			<li>FIXED: (<a href="http://nucleus-jp.sourceforge.jp/tracker/index.php?do=details&amp;task_id=107">#107(JP)</a>): When editing an item, time generation will be an error. (kotorisan/yu/shizuki)</li>
+			<li>FIXED: (<a href="http://nucleus-jp.sourceforge.jp/tracker/index.php?do=details&amp;task_id=108">#108(JP)</a>): Pop-up, for if a character string is empty, nothing is indicated. (sato-na/shizuki)</li>
+			<li>FIXED: Fix history. (shizuki)</li>
+			<li>FIXED: "history.html" is XHTML 1.0 Strict. (shizuki)</li>
+			<li>FIXED: (<a href="http://dev.nucleuscms.org/tracker/index.php?id=142&amp;do=details">#142</a>): Plugin API: Incorrect operation order. (shizuki/Andrew Black)</li>
+			<li>ADDED: <a href="http://japan.nucleuscms.org/bb/viewtopic.php?p=22675#22675">Add tool tip for "MEDIA" button</a> (shizuki/kyasya)</li>
+			<li>FIXED: (<a href="http://nucleus-jp.sourceforge.jp/tracker/?do=details&amp;task_id=82">#82(JP)</a>): fix &lt;%itemtitle%&gt; on COMMENT_HEADER COMMENT_BODY COMMENT_FOOTER (shizuki)</li>
+			<li>CHANGED: (<a href="http://nucleus-jp.sourceforge.jp/tracker/?do=details&amp;task_id=83">#83(JP)</a>): Change bookmarklet height. Add 50pix. (kmorimatsu)</li>
+			<li>CHANGED: (<a href="http://nucleus-jp.sourceforge.jp/tracker/?do=details&amp;task_id=84">#84(JP)</a>): To avoid showing ticket in the URL, redirect to pluginlist, instead. (kmorimatsu)</li>
+			<li>CHANGED: make ItemVars case insentive to ease the usage (work with plugins that use the function doItemVar) (kaigreve)</li>
+			<li>ADDED: new event in TEMPLATE.php called PreTemplateRead to allow plugin developers to change name of template being used. This is obscure and probably won't be publicized, but I need it for NP_MultiLanguage to allow mapping of templates depending on language being viewed, permitting translations of all parts of a template and localization of dates. (ftruscot)</li>
+			<li>ADDED: three new events in BLOG.php called PreArchiveListItem, PreCategoryListItem, and PreBlogListItem to allow plugin developers to modify or add template variables to the ArchiveList Item, Category List Item and Blog List Item template fields (ftruscot)</li>
+			<li>FIXED: fix redirect function in globalfunctions so that it does not strip out the permitted "*" character. See <a href="http://forum.nucleuscms.org/viewtopic.php?p=86007#86007">forum(Trying to get a create an account link)</a> (ftruscot)</li>
+			<li>ADDED: add description of the doIf function to the plugin documentation (ftruscot)</li>
+			<li>FIXED: fix description of if/else/endif skin variables to documentation, inlcuding ifnot, elseif, and elseifnot (ftruscot)</li>
+			<li>ADDED: add description of charset skin variable to documentation. (ftruscot)</li>
+			<li>ADDED: add global configuration, DefaultListSize, which sets and maintains a custom value for length of item/comment lists in the admin area (ftruscot)</li>
+			<li>FIXED: fix content type of bookmarklet.php file to text/html to conform with other pages (ftruscot)</li>
+			<li>ADDED: new event in createaccount.php called RegistrationFormExtraFields to allow fields from plugins onto registration form (ftruscot)</li>
+			<li>FIXED: CONF['Self'] fix (admun)</li>
+			<li>ADDED: Add a link to the front end that allows to add an item in a bookmarklet popup window (two new skinvars addlink and addpopupcode needed) (kaigreve)</li>
+			<li>ADDED: add a cancel button to the bookmarklet add and edit forms (kaigreve)</li>
+			<li>CHANGED: Move the submit button in the bookmarklet edit from to the end of the button bar (logical order) (kaigreve)</li>
+			<li>ADDED: Add the possibility to move a published item back to drafts (kaigreve)</li>
+			<li>ADDED: more and improved comments in classes NucleusPlugin, BACKUP, ITEM and ITEMACTIONS (kaigreve)</li>
+			<li>CHANGED: Use ISO date for backup filename and add hour, minute and second  (kaigreve)</li>
+			<li>CHANGED: Put backup functions in an own class Backup (kaigreve)</li>
+			<li>FIXED: add default values for the parse_bloglist function to avoid warnings (kaigreve)</li>
+			<li>FIXED: fix case sensitive function name createDraftFromRequest in class ACTION (admun)</li>
+			<li>ADDED: add description of the doItemVar function to the plugin documentation (kaigreve)</li>
+			<li>ADDED: add language file install_lang_english.php to install process (admun)</li>
+			<li>ADDED: add option to install NP_Ping during installation (admun)</li>
+			<li>FIXED: remove bug in the plugin api: function clearOptionValueCache hasn't worked correct with the getOption function (kaigreve)</li>
+			<li>ADDED: add global configuration DebugVars which decides if unresolved Vars (SkinVars, TemplateVars, ItemVars) are shown on the blog (kaigreve)</li>
+			<li>FIXED: Fix getNotifyFromMailAddress to use email field now that we've separated email/url fields (gregorlove)</li>
+			<li>CHANGED: extend skinvar Bloglist with parameters to specify the sort order (kaigreve)</li>
+			<li>ADDED: add comment URL and email to "edit comment" form and make them editable (gregorlove)</li>
+			<li>ADDED: new event in ADMIN.php called TemplateExtraFields to allow plugin developers to add fields to templates. This should encourage plugin authors to make use of the core template storage to provide formatting for their output. This event just presents the extra fields on the template edit form and stores data entered there into the nucleus_template table. It is the responsibility of the plugin authors to use the template fields they add and to provide the variables used in those fields. Plugins should also document their variables and provide for a default, either in the code or through a plugin option. (ftruscot)</li>
+		</ul>
+	</li>
+	<li>
+		<strong>Nucleus v3.33 (August 20, 2008)</strong>
 		<ul>
 			<li>FIXED: Security issue (Thanks to Bradley Bell)</li>
 		</ul>
 	</li>
 	<li>
-		<b>Nucleus v3.32 (January 26, 2008)</b>
+		<strong>Nucleus v3.32 (January 26, 2008)</strong>
 		<ul>
 			<li>FIXED: An XSS issue</li>
 		</ul>
 	</li>
 	<li>
-		<b>Nucleus v3.31 (October 22, 2007)</b>
+		<strong>Nucleus v3.31 (October 22, 2007)</strong>
 		<ul>
 			<li>ADDED: add <code>createaccount.html</code> with a redirect to <code>createaccount.php</code> for backward compatibility with the old location of the form</li>
 			<li>CHANGED: protect the 'create account form' against abuse: show the form only if needed and add FormExtra (e.g. Captcha) and ValidateForm (to validate input) events (ftruscot and kaigreve)</li>
@@ -39,18 +135,32 @@
 		</ul>
 	</li>
 	<li>
-		<b>Nucleus v3.3 (August 7, 2007)</b>
+		<strong>Nucleus v3.3 (August 7, 2007)</strong>
 		<ul>
 			<li>ADDED: NP_Ping sends ping for future post via JustPosted event (admun)</li>
 			<li>ADDED: JustPosted event (admun)</li>
 			<li>ADDED: move weblogs.com ping function into plugin (admun)</li>
-			<li>ADDED: Serveral changes and fixes from Nucleus Japan (details in the log files of the <a href="http://sourceforge.net/svn/?group_id=66479">Nucleus repository</a> at sourceforge.net)</li>
+			<li>
+				ADDED: Serveral changes and fixes from Nucleus Japan (details in the log files of the <a href="http://sourceforge.net/svn/?group_id=66479">Nucleus repository</a> at sourceforge.net)
+				<ul>
+					<li>ADDED(JP): (<a href="http://nucleus-jp.sourceforge.jp/tracker/?do=details&amp;task_id=68">#68(JP)</a>): Encrypted cookie key. (Katsumi)</li>
+					<li>FIXED(JP): (<a href="http://nucleus-jp.sourceforge.jp/tracker/?do=details&amp;task_id=60">#60(JP)</a>): Item link in notification email is wrong. (shizuki)</li>
+					<li>FIXED(JP): (<a href="http://nucleus-jp.sourceforge.jp/tracker/?do=details&amp;task_id=62">#62(JP)</a>): email address is not referred in &lt;%usermail%&gt;. (shizuki)</li>
+					<li>FIXED(JP): (<a href="http://nucleus-jp.sourceforge.jp/tracker/?do=details&amp;task_id=66">#66(JP)</a>): Even if calling PostPluginOptionsUpdate, getOption does not returns correct value. (Katsumi)</li>
+					<li>FIXED(JP): (<a href="http://nucleus-jp.sourceforge.jp/tracker/?do=details&amp;task_id=49">#49(JP)</a>): PLUGIN::getAllItemOptions does not work correctly. (NKJG)</li>
+					<li>FIXED(JP): (<a href="http://nucleus-jp.sourceforge.jp/tracker/?do=details&amp;task_id=57">#57(JP)</a>): SQL error happens when updating plugin option. (Katsumi)</li>
+					<li>FIXED(JP): (<a href="http://nucleus-jp.sourceforge.jp/tracker/?do=details&amp;task_id=56">#56(JP)</a>): When creating db backup, the key length drops (Katsumi)</li>
+					<li>FIXED(JP): (<a href="http://nucleus-jp.sourceforge.jp/tracker/?do=details&amp;task_id=41">#41(JP)</a>): fixed dropped info during backing up (Katsumi)</li>
+					<li>FIXED(JP): (<a href="http://nucleus-jp.sourceforge.jp/tracker/?do=details&amp;task_id=40">#40(JP)</a>): fixed PostAddCategory event (Kimitake)</li>
+					<li>CHANGED(JP): (<a href="http://nucleus-jp.sourceforge.jp/tracker/?do=details&amp;task_id=48">#48(JP)</a>): Super-admin always can login to admin page (Kimitake)</li>
+					<li>ADDED: (<a href="http://nucleus-jp.sourceforge.jp/tracker/?do=details&amp;task_id=45">#45</a>  from the Japanese Tracker): include code from NP_0TicketForPlugin in the core (Changes from Nucleus Japan)(Katsumi)</li>
+				</ul>
+			</li>
 			<li>ADDED: Sanitize parameters such as $_GET and $_SERVER['REQUEST_URI'] etc. to avoid XSS (from Nucleus Japan)</li>
-			<li>ADDED: (<a href="http://nucleus-jp.sourceforge.jp/tracker/?do=details&id=45">#45</a>  from the Japanese Tracker): include code from NP_0TicketForPlugin in the core (Changes from Nucleus Japan)
 			<li>ADDED: new events for Media upload: PreMediaUpload and PostMediaUpload (kaigreve)</li>
 			<li>ADDED: new skinvar bloglist (kaigreve)</li>
-			<li>ADDED: new method for URL rewriting with the global variable virtualpath, new .htaccess file can be found in the folder extra/fancyurl-2, more information <a href="http://forum.nucleuscms.org/viewtopic.php?t=12241">here</a> (kaigreve and Legolas)</li>
-			<li>FIXED: allow + in email address, see <a href="http://forum.nucleuscms.org/viewtopic.php?t=14207">here</a> (wgroleau)</li>
+			<li>ADDED: new method for URL rewriting with the global variable virtualpath, new .htaccess file can be found in the folder extra/fancyurl-2, more information <a href="http://forum.nucleuscms.org/viewtopic.php?t=12241">forum(Another approach to Fancy URLs)</a> (kaigreve and Legolas)</li>
+			<li>FIXED: allow + in email address, see <a href="http://forum.nucleuscms.org/viewtopic.php?t=14207">forum(Minor bug fix in globalfunctions.php)</a> (wgroleau)</li>
 			<li>FIXED: XHTML compliance in default skin (admun)</li>
 			<li>FIXED (<a href="http://dev.nucleuscms.org/tracker/index.php?id=80&amp;do=details">#80</a>): Atom 1.0 support (rakaz)</li>
 			<li>FIXED (<a href="http://dev.nucleuscms.org/tracker/index.php?id=129&amp;do=details">#129</a>): Plugin API: SpamCheck event called from core. (rakaz)</li>
@@ -79,19 +189,19 @@
 		</ul>
 	</li>
 	<li>
-		<b>Nucleus v3.24 (November 11, 2006)</b>
+		<strong>Nucleus v3.24 (November 11, 2006)</strong>
 		<ul>
 			<li>FIXED: XSS issue (reported by <a href="http://www.jpcert.or.jp/">JPCERT/CC</a>).</li>
 		</ul>
 	</li>
 	<li>
-		<b>Nucleus v3.23 (May 23, 2006)</b>
+		<strong>Nucleus v3.23 (May 23, 2006)</strong>
 		<ul>
 			<li>FIXED: Remote code execution vulnerability (reported by rgod).</li>
 		</ul>
 	</li>
 	<li>
-		<b>Nucleus v3.22 (August 21, 2005)</b>
+		<strong>Nucleus v3.22 (August 21, 2005)</strong>
 		<ul>
 			<li>FIXED: Major security vulnerability in the phpxmlrpc library.</li>
 			<li>FIXED: New NP_SkinFiles version, fixing a minor security issue. (rakaz)</li>
@@ -103,7 +213,7 @@
 			<li>FIXED (<a href="http://dev.nucleuscms.org/tracker/index.php?do=details&amp;id=49">#49</a>): 'name clashes' warning on skin import no longer displayed when no clashes detected (karma)</li>
 			<li>FIXED (<a href="http://dev.nucleuscms.org/tracker/index.php?do=details&amp;id=67">#67</a>): Add resilency to upgrade scripts (Frankenstein)</li>
 			<li>FIXED (<a href="http://dev.nucleuscms.org/tracker/index.php?do=details&amp;id=88">#88</a>): PHP5.1: "Fatal error: Only variables can be passed by reference" (karma)</li>
-			<li>FIXED (<a href="http://dev.nucleuscms.org/tracker/index.php?do=details&amp;id=87">#87</a>): Translate &amp; -> &amp;amp; when links added via toolbar (karma)</li>
+			<li>FIXED (<a href="http://dev.nucleuscms.org/tracker/index.php?do=details&amp;id=87">#87</a>): Translate &amp; -&gt; &amp;amp; when links added via toolbar (karma)</li>
 			<li>FIXED (<a href="http://dev.nucleuscms.org/tracker/index.php?do=details&amp;id=42">#42</a>): <code>formatDate</code> didn't always use the correct timezone (karma)</li>
 			<li>FIXED (<a href="http://dev.nucleuscms.org/tracker/index.php?do=details&amp;id=43">#43</a>): Only load user language file when logged in (karma).</li>
 			<li>FIXED (<a href="http://dev.nucleuscms.org/tracker/index.php?do=details&amp;id=76">#76</a>): Disabling site blocked admin menu access (karma).</li>
@@ -124,13 +234,13 @@
 		</ul>
 	</li>
 	<li>
-		<b>Nucleus v3.21 (June 30, 2005)</b>
+		<strong>Nucleus v3.21 (June 30, 2005)</strong>
 		<ul>
 			<li>FIXED: <a href="http://secunia.com/advisories/15852/">XML-RPC for PHP Unspecified PHP Code Execution Vulnerability</a></li>
 		</ul>
 	</li>
 	<li>
-		<b>Nucleus v3.2 (March 7, 2005)</b>
+		<strong>Nucleus v3.2 (March 7, 2005)</strong>
 		<ul>
 			<li>ADDED: <a href="http://wiki.gednet.com/NPSkinFiles">NP_SkinFiles</a> plugin installed on full install</li>
 			<li>FIXED: Installing plugins through install.php failed (karma)</li>
@@ -166,7 +276,7 @@
 		</ul>
 	</li>
 	<li>
-		<b>Nucleus v3.15 (November 14, 2004)</b>
+		<strong>Nucleus v3.15 (November 14, 2004)</strong>
 		<ul>
 			<li>FIXED: Some XSS issues, as reported by Alexander Antipov</li>
 			<li>FIXED: Validate data that is sent as HTTP headers (redirects etc) (karma)</li>
@@ -193,7 +303,7 @@
 		</ul>
 	</li>
 	<li>
-		<b>Nucleus v3.1 (July 28, 2004)</b>
+		<strong>Nucleus v3.1 (July 28, 2004)</strong>
 		<ul>
 			<li>FIXED: Nucleus v3.01 was missing a fix in <code>backup.php</code>, which could cause fulltext key info not to be backed up correctly</li>
 			<li>ADDED: support for patch levels, so plugin API enhancements can be distributed to power users earlier (<a href="http://forum.nucleuscms.org/viewtopic.php?t=4142" title="More info...">suggested</a> by TeRanEX)</li>
@@ -215,7 +325,7 @@
 		</ul>
 	</li>
 	<li>
-		<b>Nucleus v3.01 (July 13, 2004)</b>
+		<strong>Nucleus v3.01 (July 13, 2004)</strong>
 		<ul>
 			<li>FIXED: PHP5: Links to plugin admin area broken (radekradek)</li>
 			<li>FIXED: bug 966011, skins created with v2.0 could not be imported (karma)</li>
@@ -223,7 +333,7 @@
 		</ul>
 	</li>
 	<li>
-		<b>Nucleus v3.0 (May 30, 2004)</b>
+		<strong>Nucleus v3.0 (May 30, 2004)</strong>
 		<ul>
 			<li>FIXED: When adding a weblog, select globally defined default skin by default (TeRanEX)</li>
 			<li>FIXED: CSS conflict in default skin (moraes)</li>
@@ -253,7 +363,7 @@
 		</ul>
 	</li>
 	<li>
-		<b>Nucleus v3.0 RC (April 27, 2004)</b>
+		<strong>Nucleus v3.0 RC (April 27, 2004)</strong>
 		<ul>
 			<li>CHANGED: Labeled it v3.0, since users started believing "2.5 beta == 25 final"</li>
 			<li>FIXED: XML-RPC: <code>metaWeblog.editPost</code> assigned the default category again when no categories were passed along (karma).</li>
@@ -299,7 +409,7 @@
 		</ul>
 	</li>
 	<li>
-		<b>Nucleus v2.5 beta (October 11, 2003)</b>
+		<strong>Nucleus v2.5 beta (October 11, 2003)</strong>
 		<ul>
 			<li>ADDED: <code>if(previtem)</code>, <code>if(nextitem)</code> and <code>if(skintype,<em>typename</em>)</code> skinvars.</li>
 			<li>FIXED: RSS conditional GET wasn't working correctly (Visa Kopu)</li>
@@ -348,7 +458,7 @@
 		</ul>
 	</li>
 	<li>
-		<b>Nucleus v2.0 Final (April 3, 2003)</b>
+		<strong>Nucleus v2.0 Final (April 3, 2003)</strong>
 		<ul>
 			<li>FIXED: renamed the <code>xmlrpc_encode</code> and <code>xmlrpc_decode</code> methods in <code>xmlrpc.inc.php</code>, avoiding naming conflicts on some PHP configurations that are compiled with XMLRPC support</li>
 			<li>FIXED: restore did not work on some PHP configurations, and did not correctly recognize <code>application/x-gzip</code> encoding type</li>
@@ -378,7 +488,7 @@
 		</ul>
 	</li>
 	<li>
-		<b>Nucleus v2.0 beta (January 18, 2003)</b>
+		<strong>Nucleus v2.0 beta (January 18, 2003)</strong>
 		<ul>
 			<li>FIXED: Highlighted text no longer has &lt;!--h--&gt; in it</li>
 			<li>ADDED; Plugin hook: PostAuthentication</li>
@@ -447,7 +557,7 @@
 		</ul>
 	</li>
 	<li>
-		<b>Nucleus v1.55 (August 26, 2002)</b>
+		<strong>Nucleus v1.55 (August 26, 2002)</strong>
 		<ul>
 			<li>ADDED: &lt;%archivedaylist%&gt; and &lt;%otherarchivedaylist%&gt; skinvars (to show archives by day instead of by month)</li>
 			<li>FIXED: PHP error on createAccount through action.php</li>
@@ -478,11 +588,11 @@
 		</ul>
 	</li>
 	<li>
-		<b>Nucleus v1.5 (August 13, 2002)</b>
+		<strong>Nucleus v1.5 (August 13, 2002)</strong>
 		<ul>
 			<li>ADDED: Introducing plugins (define your own skinvars and templatevars, add event listeners, ...)</li>
 			<li>CHANGED: simpler and more accessible default templates/skins</li>
-			<li>FIXED: GreyMatter convert now works when the <tt>asp_tags</tt> option in PHP is enabled</li>
+			<li>FIXED: GreyMatter convert now works when the <code>asp_tags</code> option in PHP is enabled</li>
 			<li>ADDED: title and authorName fields in Blogger API getRecentItems call</li>
 			<li>ADDED: HTML label tags for radio buttons and checkboxes (this way you can click anywhere on the text instead of only on the radio button/checkbox itself)</li>
 			<li>FIXED: deleting a comment you made in a blog that's not your own resulted in a 'disallowed action' error (thanks moraes)</li>
@@ -504,7 +614,7 @@
 			<li>ADDED: PHP and MySQL versions are listed during the installation proces, with warnings when those version numbers are lower than what Nucleus requires</li>
 			<li>CHANGED: item parsing method changed, so it's more easily extensible. plugin, parsedinclude, include and phpinclude are now also allowed in some templates. Inside items, there are also 3 allowed variables: 'image', 'media' and 'popup'</li>
 			<li>FIXED: image popups didn't work with register_globals disabled</li>
-			<li>CHANGED: renamed method: getBlogidFromName -> getBlogIDFromName (consistency)</li>
+			<li>CHANGED: renamed method: getBlogidFromName -&gt; getBlogIDFromName (consistency)</li>
 			<li>ADDED: method selectCategory($name)</li>
 			<li>FIXED: Nucleus now handles data correctly when magic_quotes_gpc is disabled (solves some problems with template editing)</li>
 			<li>CHANGED: categories in selection box are now sorted by name (tip from katatonik)</li>
@@ -523,7 +633,7 @@
 			<li>ADDED: left and right box buttons on JS toolbar</li>
 			<li>FIXED: truncated entry when login is requested after adding (data didn't get passed on correctly)</li>
 			<li>ADDED: &lt;%authorlink%&gt; to template vars for item templates (this one can take catid into account)</li>
-			<li>ADDED: $CONF['Self'] => $CONF['ItemURL'], $CONF['IndexURL'], ... to optionally allow people to use different files for items/archives/...</li>
+			<li>ADDED: $CONF['Self'] =&gt; $CONF['ItemURL'], $CONF['IndexURL'], ... to optionally allow people to use different files for items/archives/...</li>
 			<li>CHANGED: Now using mysql_fetch_assoc instead of mysql_fetch_array (efficiency)</li>
 			<li>CHANGED: The &lt;%searchresults%&gt; and &lt;%othersearchresults%&gt; skintags got an extra parameter to limit the number of results (defaults to 50)</li>
 			<li>FIXED: doError did not take into account chosen skin</li>
@@ -543,7 +653,7 @@
 		</ul>
 	</li>
 	<li>
-		<b>Nucleus v1.1 (April 30, 2002)</b>
+		<strong>Nucleus v1.1 (April 30, 2002)</strong>
 		<ul>
 			<li>Started assuming that at least PHP 4.0.5 is available. (for older PHP versions, some small code-changes should do the trick)</li>
 			<li>Added bookmarklets for Mac/IE5 users and Mozilla. Also, made the title of the page also show up in the title field of the new item. Makes more sense. <small>(thanks to <a href="http://www.35mm.org">Ricardo Lamego</a>)</small></li>
@@ -634,7 +744,7 @@
 		</ul>
 	</li>
 	<li>
-		<b>Nucleus v1.0 (March 6, 2002)</b>
+		<strong>Nucleus v1.0 (March 6, 2002)</strong>
 		<ul>
 			<li>Fixed: width &amp; height of &lt;%image()%&gt; construct</li>
 			<li>Changed: windows in popup windows don't have a white border anymore <small>(<a href="http://www.nucleuscms.org/forum/viewtopic.php?t=3">see forum</a>)</small>
@@ -672,7 +782,7 @@
 		</ul>
 	</li>
 	<li>
-		<b>Nucleus v0.96 (December 13, 2001)</b>
+		<strong>Nucleus v0.96 (December 13, 2001)</strong>
 		<ul>
 			<li>Added: add-item-preview now also in admin area</li>
 			<li>Added: action log</li>
@@ -699,7 +809,7 @@
 		</ul>
 	</li>
 	<li>
-		<b>Nucleus v0.95 (October 10, 2001)</b>
+		<strong>Nucleus v0.95 (October 10, 2001)</strong>
 		<ul>
 			<li>Added: per-blog setting to enable/disable line break conversion</li>
 			<li>Added: per-blog setting to send a ping to Userland (weblogs.com) when you update your blog. This way, you'll be able to end up in the weblogs.com update-list</li>
@@ -710,10 +820,10 @@
 		</ul>
 	</li>
 	<li>
-		<b>Nucleus v0.94 (September 27, 2001)</b>
+		<strong>Nucleus v0.94 (September 27, 2001)</strong>
 		<ul>
 			<li>Changed: 'Add Item' in admin-area now redirects to blog url (if available)</li>
-			<li>Changed: <i>headlines.php</i> and <i>xml-rss.php</i> adapted to behave better in disabled-site situations</li>
+			<li>Changed: <em>headlines.php</em> and <em>xml-rss.php</em> adapted to behave better in disabled-site situations</li>
 			<li>Changed: &lt;%userlink%&gt; got smarter in recognizing e-mail addresses</li>
 			<li>Added: tabindices in forms to make traversal with the TAB-button more natural</li>
 			<li>Fixed: bookmarklet login did not pass data correctly</li>
@@ -727,7 +837,7 @@
 		</ul>
 	</li>
 	<li>
-		<b>Nucleus v0.93 (September 19, 2001)</b>
+		<strong>Nucleus v0.93 (September 19, 2001)</strong>
 		<ul>
 			<li>Added: friendly error message on error with nucleusdir definition in config.php</li>
 			<li>Changed: call_user_func instead of eval</li>
@@ -742,7 +852,7 @@
 		</ul>
 	</li>
 	<li>
-		<b>Nucleus v0.92 (September 18, 2001)</b>
+		<strong>Nucleus v0.92 (September 18, 2001)</strong>
 		<ul>
 			<li>GM conversion: {{linkmo and {{emailmo conversion now also works with PHP versions &lt; 4.0.4</li>
 			<li>GM conversion: Fixed occasional JavaScript errors with {{linkmo and {{emailmo</li>
@@ -759,13 +869,13 @@
 		</ul>
 	</li>
 	<li>
-		<b>Nucleus v0.91 (September 15, 2001)</b>
+		<strong>Nucleus v0.91 (September 15, 2001)</strong>
 		<ul>
 			<li>Improved conversion for GreyMatter blogs. Special markup commands are now recognized. (thanks to <a href="http://www.elrado.nl/">Raoul</a> for pointing this out)</li>
 		</ul>
 	</li>
 	<li>
-		<b>Nucleus v0.90 [beta 2 release] (September 14, 2001)</b>
+		<strong>Nucleus v0.90 [beta 2 release] (September 14, 2001)</strong>
 		<ul>
 			<li>an install-script is now available, no more messing around in shells</li>
 			<li>created default skins/templates for a release version</li>
@@ -788,7 +898,7 @@
 		</ul>
 	</li>
 	<li>
-		<b>Nucleus v0.80 [beta 1 release] (September 2, 2001)</b>
+		<strong>Nucleus v0.80 [beta 1 release] (September 2, 2001)</strong>
 		<ul>
 			<li>XML-RPC Interface implementing the blogger methods</li>
 			<li>fixes and code-reorganisation</li>
@@ -798,7 +908,7 @@
 		</ul>
 	</li>
 	<li>
-		<b>Nucleus v0.70 [not released] (August 20, 2001)</b>
+		<strong>Nucleus v0.70 [not released] (August 20, 2001)</strong>
 		<ul>
 			<li>mySQL instead of XML</li>
 			<li>extensive admin area</li>
@@ -811,7 +921,7 @@
 		</ul>
 	</li>
 	<li>
-		<b>Nucleus v0.60 and earlier (since February 2001)</b>
+		<strong>Nucleus v0.60 and earlier (since February 2001)</strong>
 		<br />
 		no history (XML versions with limited functions)
 	</li>
diff -x .svn -aruN 3.33.src/nucleus/index.php 3.40.src/nucleus/index.php
--- 3.33.src/nucleus/index.php	2008-10-06 07:43:46.000000000 -0500
+++ 3.40.src/nucleus/index.php	2009-02-14 19:36:50.000000000 -0600
@@ -12,7 +12,7 @@
 /**
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: index.php 1176 2007-06-16 22:27:17Z kaigreve $
+ * @version $Id: index.php 1279 2008-10-23 08:18:26Z shizuki $
  */
 	// we are using admin stuff:
 	$CONF = array();
@@ -25,10 +25,10 @@
 	{
 		// check if files exist and generate an error if so
 		$aFiles = array(
-			'../install.sql' => 'install.sql should be deleted',
-			'../install.php' => 'install.php should be deleted',
-			'upgrades' => 'nucleus/upgrades directory should be deleted',
-			'convert' => 'nucleus/convert directory should be deleted'
+			'../install.sql' => _ERRORS_INSTALLSQL,
+			'../install.php' => _ERRORS_INSTALLPHP,
+			'upgrades' => _ERRORS_UPGRADESDIR,
+			'convert' => _ERRORS_CONVERTDIR
 		);
 		$aFound = array();
 		foreach($aFiles as $fileName => $fileDesc)
@@ -37,13 +37,13 @@
 				array_push($aFound, $fileDesc);
 		}
 		if (@is_writable('../config.php')) {
-			array_push($aFound, 'config.php should be non-writable (chmod to 444)');
+			array_push($aFound, _ERRORS_CONFIGPHP);
 		}
 		if (sizeof($aFound) > 0)
 		{
 			startUpError(
-				'<p>One or more of the Nucleus installation files are still present on the webserver, or are writable.</p><p>You should remove these files or change their permissions to ensure security. Here are the files that were found by Nucleus</p> <ul><li>'. implode($aFound, '</li><li>').'</li></ul><p>If you don\'t want to see this error message again, without solving the problem, set <code>$CONF[\'alertOnSecurityRisk\']</code> in <code>globalfunctions.php</code> to <code>0</code>, or do this at the end of <code>config.php</code>.</p>',
-				'Security Risk'
+				_ERRORS_STARTUPERROR1. implode($aFound, '</li><li>')._ERRORS_STARTUPERROR2,
+				_ERRORS_STARTUPERROR3
 			);
 		}
 	}
diff -x .svn -aruN 3.33.src/nucleus/javascript/edit.js 3.40.src/nucleus/javascript/edit.js
--- 3.33.src/nucleus/javascript/edit.js	2008-10-06 07:43:46.000000000 -0500
+++ 3.40.src/nucleus/javascript/edit.js	2009-02-14 19:36:48.000000000 -0600
@@ -11,7 +11,7 @@
   * This file contains functions to allow adding items from inside the weblog.
   * Also contains code to avoid submitting form data twice.
   *
-  * $Id: edit.js 1116 2007-02-03 08:24:29Z kimitake $
+  * $Id: edit.js 1278 2008-10-23 04:54:08Z shizuki $
   */
 
 var nucleusConvertBreaks = true;
@@ -151,7 +151,7 @@
 
 function includeImage(collection, filename, type, width, height) {
 	if (isCaretEmpty()) {
-		text = prompt("Text to display ?","");
+		text = prompt("Text to display ?",filename);
 	} else {
 		text = getCaretText();
 	}
@@ -183,7 +183,7 @@
 
 function includeOtherMedia(collection, filename) {
 	if (isCaretEmpty()) {
-		text = prompt("Text to display ?","");
+		text = prompt("Text to display ?",filename);
 	} else {
 		text = getCaretText();
 	}
diff -x .svn -aruN 3.33.src/nucleus/language/english-utf8.php 3.40.src/nucleus/language/english-utf8.php
--- 3.33.src/nucleus/language/english-utf8.php	2008-10-06 07:43:45.000000000 -0500
+++ 3.40.src/nucleus/language/english-utf8.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,976 +0,0 @@
-<?php
-// English Nucleus Language File
-// 
-// Author: Wouter Demuynck
-// Nucleus version: v1.0-v3.2
-//
-// Please note: if you want to translate this file to your own language, be aware
-// that in a next Nucleus version, new variables might be added and some other ones
-// might be deleted. Therefor, it's important to list the Nucleus version for which 
-// the file was written in your document.
-//
-// Fully translated language file can be sent to us and will be made
-// available for download (with proper credit to the author, of course)
-
-// START changed/added after 3.3 START
-define('_AUTOSAVEDRAFT',                'Auto save draft');
-define('_AUTOSAVEDRAFT_LASTSAVED',      'Last saved: ');
-define('_AUTOSAVEDRAFT_NOTYETSAVED',    'No saves have been made yet');
-define('_AUTOSAVEDRAFT_NOW',            'Auto save now');
-define('_SKIN_PARTS_SPECIAL',           'Special skin parts');
-define('_ERROR_SKIN_PARTS_SPECIAL_FORMAT',              'You must enter a name that exists only out of lowercase letters and digits');
-define('_ERROR_SKIN_PARTS_SPECIAL_DELETE',              'Can\'t delete this skin part');
-define('_CONFIRMTXT_SKIN_PARTS_SPECIAL',                'Do you really want to delete this special skin part?');
-define('_ERROR_PLUGIN_LOAD',            'Plugin could not be loaded, or does not support certain features that are required for it to run on your
-Nucleus installation (you might want to check the <a href="?action=actionlog">actionlog</a> for more info)');
-// END changed/added after 3.3 END
-
-// START changed/added after 3.22 START
-define('_SEARCHFORM_QUERY',                     'Keywords to search');
-define('_ERROR_EMAIL_REQUIRED',         'Email address is required');
-define('_COMMENTFORM_MAIL',                     'Website:');
-define('_COMMENTFORM_EMAIL',            'E-mail:');
-define('_EBLOG_REQUIREDEMAIL',          'Require E-mail address with comments?');
-define('_ERROR_COMMENTS_SPAM',      'Your comment was rejected because it did not pass the spam test');
-// END changed/added after 3.22 END
-
-// START changed/added after 3.15 START
-
-define('_LIST_PLUG_SUBS_NEEDUPDATE','Please use the \'Update Subscription list\'-button to update the plugin\'s subscription list.');
-define('_LIST_PLUGS_DEP',			'Plugin(s) requires:');
-
-// END changed/added after 3.15
-
-// START changed/added after 3.1 START
-
-// comments list per weblog
-define('_COMMENTS_BLOG',			'All Comments for blog');
-define('_NOCOMMENTS_BLOG',			'No comments were made on items of this blog');
-define('_BLOGLIST_COMMENTS',		'Comments');
-define('_BLOGLIST_TT_COMMENTS',		'A list of all comments made on items of this blog');
-
-
-// for use in archivetype-skinvar
-define('_ARCHIVETYPE_DAY',			'day');
-define('_ARCHIVETYPE_MONTH',		'month');
-
-// tickets (prevents malicious users to trick an admin to perform actions he doesn't want)
-define('_ERROR_BADTICKET',			'Invalid or expired ticket.');
-
-// plugin dependency
-define('_ERROR_INSREQPLUGIN',		'Plugin installation failed, requires ');
-define('_ERROR_DELREQPLUGIN',		'Plugin deletion failed, required by ');
-
-// cookie prefix
-define('_SETTINGS_COOKIEPREFIX',	'Cookie Prefix');
-
-// account activation
-define('_ERROR_NOLOGON_NOACTIVATE',	'Cannot send activation link. You\'re not allowed to log in.');
-define('_ERROR_ACTIVATE',			'Activation key does not exist, is invalid, or has expired.');
-define('_ACTIONLOG_ACTIVATIONLINK', 'Activation link sent');
-define('_MSG_ACTIVATION_SENT',		'An activation link has been sent by e-mail.');
-
-// activation link emails
-define('_ACTIVATE_REGISTER_MAIL',	"Hi <%memberName%>,\n\nYou need to activate your account at <%siteName%> (<%siteUrl%>).\nYou can do this by visiting the link below: \n\n\t<%activationUrl%>\n\nYou have 2 days to do this. After this, the activation link becomes invalid.");
-define('_ACTIVATE_REGISTER_MAILTITLE',	"Activate your '<%memberName%>' account");
-define('_ACTIVATE_REGISTER_TITLE',	'Welcome <%memberName%>');
-define('_ACTIVATE_REGISTER_TEXT',	'You\'re almost there. Please choose a password for your account below.');
-define('_ACTIVATE_FORGOT_MAIL',		"Hi <%memberName%>,\n\nUsing the link below, you can choose a new password for your account at <%siteName%> (<%siteUrl%>) by choosing a new password.\n\n\t<%activationUrl%>\n\nYou have 2 days to do this. After this, the activation link becomes invalid.");
-define('_ACTIVATE_FORGOT_MAILTITLE',"Re-activate your '<%memberName%>' account");
-define('_ACTIVATE_FORGOT_TITLE',	'Welcome <%memberName%>');
-define('_ACTIVATE_FORGOT_TEXT',		'You can choose a new password for your account below:');
-define('_ACTIVATE_CHANGE_MAIL',		"Hi <%memberName%>,\n\nSince your e-mail address has changed, you'll need to re-activate your account at <%siteName%> (<%siteUrl%>).\nYou can do this by visiting the link below: \n\n\t<%activationUrl%>\n\nYou have 2 days to do this. After this, the activation link becomes invalid.");
-define('_ACTIVATE_CHANGE_MAILTITLE',"Re-activate your '<%memberName%>' account");
-define('_ACTIVATE_CHANGE_TITLE',	'Welcome <%memberName%>');
-define('_ACTIVATE_CHANGE_TEXT',		'Your address change has been verified. Thanks!');
-define('_ACTIVATE_SUCCESS_TITLE',	'Activation Succeeded');
-define('_ACTIVATE_SUCCESS_TEXT',	'Your account has been successfully activated.');
-define('_MEMBERS_SETPWD',			'Set Password');
-define('_MEMBERS_SETPWD_BTN',		'Set Password');
-define('_QMENU_ACTIVATE',			'Account Activation');
-define('_QMENU_ACTIVATE_TEXT',		'<p>After you have activated your account, you can start using it by <a href="index.php?action=showlogin">logging in</a>.</p>');
-
-define('_PLUGS_BTN_UPDATE',			'Update subscription list');
-
-// global settings
-define('_SETTINGS_JSTOOLBAR',		'Javascript Toolbar Style');
-define('_SETTINGS_JSTOOLBAR_FULL',	'Full Toolbar (IE)');
-define('_SETTINGS_JSTOOLBAR_SIMPLE','Simple Toolbar (Non-IE)');
-define('_SETTINGS_JSTOOLBAR_NONE',	'Disable Toolbar');
-define('_SETTINGS_URLMODE_HELP',	'(Info: <a href="documentation/tips.html#searchengines-fancyurls">How to activate fancy URLs</a>)');
-
-// extra plugin settings part when editing categories/members/blogs/...
-define('_PLUGINS_EXTRA',			'Extra Plugin Settings');
-
-// itemlist info column keys
-define('_LIST_ITEM_BLOG',			'blog:');
-define('_LIST_ITEM_CAT',			'cat:');
-define('_LIST_ITEM_AUTHOR',			'author:');
-define('_LIST_ITEM_DATE',			'date:');
-define('_LIST_ITEM_TIME',			'time:');
-
-// indication of registered members in comments list
-define('_LIST_COMMENTS_MEMBER', 	'(member)');
-
-// batch operations
-define('_BATCH_WITH_SEL',			'With selected:');
-define('_BATCH_EXEC',				'Execute');
-
-// quickmenu
-define('_QMENU_HOME',				'Home');
-define('_QMENU_ADD',				'Add Item');
-define('_QMENU_ADD_SELECT',			'-- select --');
-define('_QMENU_USER_SETTINGS',		'Settings');
-define('_QMENU_USER_ITEMS',			'Items');
-define('_QMENU_USER_COMMENTS',		'Comments');
-define('_QMENU_MANAGE',				'Management');
-define('_QMENU_MANAGE_LOG',			'Action Log');
-define('_QMENU_MANAGE_SETTINGS',	'Global Settings');
-define('_QMENU_MANAGE_MEMBERS',		'Members');
-define('_QMENU_MANAGE_NEWBLOG',		'New Weblog');
-define('_QMENU_MANAGE_BACKUPS',		'Backups');
-define('_QMENU_MANAGE_PLUGINS',		'Plugins');
-define('_QMENU_LAYOUT',				'Layout');
-define('_QMENU_LAYOUT_SKINS',		'Skins');
-define('_QMENU_LAYOUT_TEMPL',		'Templates');
-define('_QMENU_LAYOUT_IEXPORT',		'Import/Export');
-define('_QMENU_PLUGINS',			'Plugins');
-
-// quickmenu on logon screen
-define('_QMENU_INTRO',				'Introduction');
-define('_QMENU_INTRO_TEXT',			'<p>This is the logon screen for Nucleus CMS, the content management system that\'s being used to maintain this website.</p><p>If you have an account, you can log on and start posting new items.</p>');
-
-// helppages for plugins
-define('_ERROR_PLUGNOHELPFILE',		'The helpfile for this plugin can not be found');
-define('_PLUGS_HELP_TITLE',			'Helppage for plugin');
-define('_LIST_PLUGS_HELP', 			'help');
-
-
-// END changed/started after 3.1
-
-// START changed/added after v2.5beta START
-
-// general settings (security)
-define('_SETTINGS_EXTAUTH',			'Enable External Authentication');
-define('_WARNING_EXTAUTH',			'Warning: Enable only if needed.');
-
-// member profile
-define('_MEMBERS_BYPASS',			'Use External Authentication');
-
-// 'always include in search' blog setting (yes/no) [in v2.5beta, the 'always' part wasn't clear]
-define('_EBLOG_SEARCH',				'<em>Always</em> include in search');
-
-// END changed/added after v2.5beta
-
-// START introduced after v2.0 START
-
-// media library
-define('_MEDIA_VIEW',				'view');
-define('_MEDIA_VIEW_TT',			'View file (opens in new window)');
-define('_MEDIA_FILTER_APPLY',		'Apply Filter');
-define('_MEDIA_FILTER_LABEL',		'Filter: ');
-define('_MEDIA_UPLOAD_TO',			'Upload to...');
-define('_MEDIA_UPLOAD_NEW',			'Upload new file...');
-define('_MEDIA_COLLECTION_SELECT',	'Select');
-define('_MEDIA_COLLECTION_TT',		'Switch to this category');
-define('_MEDIA_COLLECTION_LABEL',	'Current collection: ');
-
-// tooltips on toolbar
-define('_ADD_ALIGNLEFT_TT',			'Align Left');
-define('_ADD_ALIGNRIGHT_TT',		'Align Right');
-define('_ADD_ALIGNCENTER_TT',		'Align Center');
-
-
-// generic upload failure
-define('_ERROR_UPLOADFAILED',		'Upload failed');
-
-// END introduced after v2.0 END
-
-// START introduced after v1.5 START
-
-// posting to the past/edit timestamps
-define('_EBLOG_ALLOWPASTPOSTING',	'Allow posting to the past');
-define('_ADD_CHANGEDATE',			'Update timestamp');
-define('_BMLET_CHANGEDATE',			'Update timestamp');
-
-// skin import/export
-define('_OVERVIEW_SKINIMPORT',		'Skin import/export...');
-
-// skin settings
-define('_PARSER_INCMODE_NORMAL',	'Normal');
-define('_PARSER_INCMODE_SKINDIR',	'Use skin dir');
-define('_SKIN_INCLUDE_MODE',		'Include mode');
-define('_SKIN_INCLUDE_PREFIX',		'Include prefix');
-
-// global settings
-define('_SETTINGS_BASESKIN',		'Base Skin');
-define('_SETTINGS_SKINSURL',		'Skins URL');
-define('_SETTINGS_ACTIONSURL',		'Full URL to action.php');
-
-// category moves (batch)
-define('_ERROR_MOVEDEFCATEGORY',	'Cannot move default category');
-define('_ERROR_MOVETOSELF',			'Cannot move category (destination blog is the same as source blog)');
-define('_MOVECAT_TITLE',			'Select blog to move category to');
-define('_MOVECAT_BTN',				'Move category');
-
-// URLMode setting
-define('_SETTINGS_URLMODE',			'URL Mode');
-define('_SETTINGS_URLMODE_NORMAL',	'Normal');
-define('_SETTINGS_URLMODE_PATHINFO','Fancy');
-
-// Batch operations
-define('_BATCH_NOSELECTION',		'Nothing selected to perform actions on');
-define('_BATCH_ITEMS',				'Batch operation on items');
-define('_BATCH_CATEGORIES',			'Batch operation on categories');
-define('_BATCH_MEMBERS',			'Batch operation on members');
-define('_BATCH_TEAM',				'Batch operation on team members');
-define('_BATCH_COMMENTS',			'Batch operation on comments');
-define('_BATCH_UNKNOWN',			'Unknown batch operation: ');
-define('_BATCH_EXECUTING',			'Executing');
-define('_BATCH_ONCATEGORY',			'on category');
-define('_BATCH_ONITEM',				'on item');
-define('_BATCH_ONCOMMENT',			'on comment');
-define('_BATCH_ONMEMBER',			'on member');
-define('_BATCH_ONTEAM',				'on team member');
-define('_BATCH_SUCCESS',			'Success!');
-define('_BATCH_DONE',				'Done!');
-define('_BATCH_DELETE_CONFIRM',		'Confirm Batch Deletion');
-define('_BATCH_DELETE_CONFIRM_BTN',	'Confirm Batch Deletion');
-define('_BATCH_SELECTALL',			'select all');
-define('_BATCH_DESELECTALL',		'deselect all');
-
-// batch operations: options in dropdowns
-define('_BATCH_ITEM_DELETE',		'Delete');
-define('_BATCH_ITEM_MOVE',			'Move');
-define('_BATCH_MEMBER_DELETE',		'Delete');
-define('_BATCH_MEMBER_SET_ADM',		'Give admin rights');
-define('_BATCH_MEMBER_UNSET_ADM',	'Take away admin rights');
-define('_BATCH_TEAM_DELETE',		'Delete from team');
-define('_BATCH_TEAM_SET_ADM',		'Give admin rights');
-define('_BATCH_TEAM_UNSET_ADM',		'Take away admin rights');
-define('_BATCH_CAT_DELETE',			'Delete');
-define('_BATCH_CAT_MOVE',			'Move to other blog');
-define('_BATCH_COMMENT_DELETE',		'Delete');
-
-// itemlist: Add new item...
-define('_ITEMLIST_ADDNEW',			'Add new item...');
-define('_ADD_PLUGIN_EXTRAS',		'Extra Plugin Options');
-
-// errors
-define('_ERROR_CATCREATEFAIL',		'Could not create new category');
-define('_ERROR_NUCLEUSVERSIONREQ',	'This plugin requires a newer Nucleus version: ');
-
-// backlinks
-define('_BACK_TO_BLOGSETTINGS',		'Back to blogsettings');
-
-// skin import export
-define('_SKINIE_TITLE_IMPORT',		'Import');
-define('_SKINIE_TITLE_EXPORT',		'Export');
-define('_SKINIE_BTN_IMPORT',		'Import');
-define('_SKINIE_BTN_EXPORT',		'Export selected skins/templates');
-define('_SKINIE_LOCAL',				'Import from local file:');
-define('_SKINIE_NOCANDIDATES',		'No candidates for import found in the skins directory');
-define('_SKINIE_FROMURL',			'Import from URL:');
-define('_SKINIE_EXPORT_INTRO',		'Select the skins and templates you want to export below');
-define('_SKINIE_EXPORT_SKINS',		'Skins');
-define('_SKINIE_EXPORT_TEMPLATES',	'Templates');
-define('_SKINIE_EXPORT_EXTRA',		'Extra Info');
-define('_SKINIE_CONFIRM_OVERWRITE',	'Overwrite skins that already exists (see nameclashes)');
-define('_SKINIE_CONFIRM_IMPORT',	'Yes, I want to import this');
-define('_SKINIE_CONFIRM_TITLE',		'About to import skins and templates');
-define('_SKINIE_INFO_SKINS',		'Skins in file:');
-define('_SKINIE_INFO_TEMPLATES',	'Templates in file:');
-define('_SKINIE_INFO_GENERAL',		'Info:');
-define('_SKINIE_INFO_SKINCLASH',	'Skin name clashes:');
-define('_SKINIE_INFO_TEMPLCLASH',	'Template name clashes:');
-define('_SKINIE_INFO_IMPORTEDSKINS','Imported skins:');
-define('_SKINIE_INFO_IMPORTEDTEMPLS','Imported templates:');
-define('_SKINIE_DONE',				'Done Importing');
-
-define('_AND',						'and');
-define('_OR',						'or');
-
-// empty fields on template edit
-define('_EDITTEMPLATE_EMPTY',		'empty field (click to edit)');
-
-// skin overview list
-define('_LIST_SKINS_INCMODE',		'IncludeMode:');
-define('_LIST_SKINS_INCPREFIX',		'IncludePrefix:');
-define('_LIST_SKINS_DEFINED',		'Defined parts:');
-
-// backup
-define('_BACKUPS_TITLE',			'Backup / Restore');
-define('_BACKUP_TITLE',				'Backup');
-define('_BACKUP_INTRO',				'Click the button below to create a backup of your Nucleus database. You\'ll be prompted to save a backup file. Store it in a safe place.');
-define('_BACKUP_ZIP_YES',			'Try to use compression');
-define('_BACKUP_ZIP_NO',			'Do not use compression');
-define('_BACKUP_BTN',				'Create Backup');
-define('_BACKUP_NOTE',				'<b>Note:</b> Only the database contents is stored in the backup. Media files and settings in config.php are thus <b>NOT</b> included in the backup.');
-define('_RESTORE_TITLE',			'Restore');
-define('_RESTORE_NOTE',				'<b>WARNING:</b> Restoring from a backup will <b>ERASE</b> all current Nucleus data in the database! Only do this when you\'re really sure!	<br />	<b>Note:</b> Make sure that the version of Nucleus in which you created the backup should be the same as the version you\'re running right now! It won\'t work otherwise');
-define('_RESTORE_INTRO',			'Select the backup file below (it\'ll be uploaded to the server) and click the "Restore" button to start.');
-define('_RESTORE_IMSURE',			'Yes, I\'m sure I want to do this!');
-define('_RESTORE_BTN',				'Restore From File');
-define('_RESTORE_WARNING',			'(make sure you\'re restoring the correct backup, maybe make a new backup before you start)');
-define('_ERROR_BACKUP_NOTSURE',		'You\'ll need to check the \'I\'m sure\' testbox');
-define('_RESTORE_COMPLETE',			'Restore Complete');
-
-// new item notification
-define('_NOTIFY_NI_MSG',			'A new item has been posted:');
-define('_NOTIFY_NI_TITLE',			'New Item!');
-define('_NOTIFY_KV_MSG',			'Karma vote on item:');
-define('_NOTIFY_KV_TITLE',			'Nucleus karma:');
-define('_NOTIFY_NC_MSG',			'Comment on item:');
-define('_NOTIFY_NC_TITLE',			'Nucleus comment:');
-define('_NOTIFY_USERID',			'User ID:');
-define('_NOTIFY_USER',				'User:');
-define('_NOTIFY_COMMENT',			'Comment:');
-define('_NOTIFY_VOTE',				'Vote:');
-define('_NOTIFY_HOST',				'Host:');
-define('_NOTIFY_IP',				'IP:');
-define('_NOTIFY_MEMBER',			'Member:');
-define('_NOTIFY_TITLE',				'Title:');
-define('_NOTIFY_CONTENTS',			'Contents:');
-
-// member mail message
-define('_MMAIL_MSG',				'A message sent to you by');
-define('_MMAIL_FROMANON',			'an anonymous visitor');
-define('_MMAIL_FROMNUC',			'Posted from a Nucleus weblog at');
-define('_MMAIL_TITLE',				'A message from');
-define('_MMAIL_MAIL',				'Message:');
-
-// END introduced after v1.5 END
-
-
-// START introduced after v1.1 START
-
-// bookmarklet buttons
-define('_BMLET_ADD',				'Add Item');
-define('_BMLET_EDIT',				'Edit Item');
-define('_BMLET_DELETE',				'Delete Item');
-define('_BMLET_BODY',				'Body');
-define('_BMLET_MORE',				'Extended');
-define('_BMLET_OPTIONS',			'Options');
-define('_BMLET_PREVIEW',			'Preview');
-
-// used in bookmarklet
-define('_ITEM_UPDATED',				'Item was updated');
-define('_ITEM_DELETED',				'Item was deleted');
-
-// plugins
-define('_CONFIRMTXT_PLUGIN',		'Are you sure you want to delete the plugin named');
-define('_ERROR_NOSUCHPLUGIN',		'No such plugin');
-define('_ERROR_DUPPLUGIN',			'Sorry, this plugin is already installed');
-define('_ERROR_PLUGFILEERROR',		'No such plugin exists, or the permissions are set incorrectly');
-define('_PLUGS_NOCANDIDATES',		'No plugin candidates found');
-
-define('_PLUGS_TITLE_MANAGE',		'Manage Plugins');
-define('_PLUGS_TITLE_INSTALLED',	'Currently Installed');
-define('_PLUGS_TITLE_UPDATE',		'Update subscription list');
-define('_PLUGS_TEXT_UPDATE',		'Nucleus keeps a cache of the event subscriptions of the plugins. When you upgrade a plugin by replacing it\'s file, you should run this update to make sure that the correct subscriptions are cached');
-define('_PLUGS_TITLE_NEW',			'Install New Plugin');
-define('_PLUGS_ADD_TEXT',			'Below is a list of all the files in your plugins directory, that might be non-installed plugins. Make sure you are <strong>really sure</strong> that it\'s a plugin before adding it.');
-define('_PLUGS_BTN_INSTALL',		'Install Plugin');
-define('_BACKTOOVERVIEW',			'Back to overview');
-
-// editlink
-define('_TEMPLATE_EDITLINK',		'Edit Item Link');
-
-// add left / add right tooltips
-define('_ADD_LEFT_TT',				'Add left box');
-define('_ADD_RIGHT_TT',				'Add right box');
-
-// add/edit item: new category (in dropdown box)
-define('_ADD_NEWCAT',				'New Category...');
-
-// new settings
-define('_SETTINGS_PLUGINURL',		'Plugin URL');
-define('_SETTINGS_MAXUPLOADSIZE',	'Max. upload file size (bytes)');
-define('_SETTINGS_NONMEMBERMSGS',	'Allow non-members to send messages');
-define('_SETTINGS_PROTECTMEMNAMES',	'Protect member names');
-
-// overview screen
-define('_OVERVIEW_PLUGINS',			'Manage Plugins...');
-
-// actionlog
-define('_ACTIONLOG_NEWMEMBER',		'New member registration:');
-
-// membermail (when not logged in)
-define('_MEMBERMAIL_MAIL',			'Your email address:');
-
-// file upload
-define('_ERROR_DISALLOWEDUPLOAD2',	'You do not have admin rights on any of the blogs that have the destination member on the teamlist. Therefor, you\'re not allowed to upload files to this member\'s media directory');
-
-// plugin list
-define('_LISTS_INFO',				'Information');
-define('_LIST_PLUGS_AUTHOR',		'By:');
-define('_LIST_PLUGS_VER',			'Version:');
-define('_LIST_PLUGS_SITE',			'Visit site');
-define('_LIST_PLUGS_DESC',			'Description:');
-define('_LIST_PLUGS_SUBS',			'Subscribes to the following events:');
-define('_LIST_PLUGS_UP',			'move up');
-define('_LIST_PLUGS_DOWN',			'move down');
-define('_LIST_PLUGS_UNINSTALL',		'uninstall');
-define('_LIST_PLUGS_ADMIN',			'admin');
-define('_LIST_PLUGS_OPTIONS',		'edit&nbsp;options');
-
-// plugin option list
-define('_LISTS_VALUE',				'Value');
-
-// plugin options
-define('_ERROR_NOPLUGOPTIONS',		'this plugin does not have any options set');
-define('_PLUGS_BACK',				'Back to Plugin Overview');
-define('_PLUGS_SAVE',				'Save Options');
-define('_PLUGS_OPTIONS_UPDATED',	'Plugin options updated');
-
-define('_OVERVIEW_MANAGEMENT',		'Management');
-define('_OVERVIEW_MANAGE',			'Nucleus management...');
-define('_MANAGE_GENERAL',			'General Management');
-define('_MANAGE_SKINS',				'Skin and Templates');
-define('_MANAGE_EXTRA',				'Extra features');
-
-define('_BACKTOMANAGE',				'Back to Nucleus management');
-
-
-// END introduced after v1.1 END
-
-
-
-
-// charset to use 
-define('_CHARSET',					'UTF-8');
-
-// global stuff
-define('_LOGOUT',					'Log Out');
-define('_LOGIN',					'Log In');
-define('_YES',						'Yes');
-define('_NO',						'No');
-define('_SUBMIT',					'Submit');
-define('_ERROR',					'Error');
-define('_ERRORMSG',					'An error has occurred!');
-define('_BACK',						'Go Back');
-define('_NOTLOGGEDIN',				'Not logged in');
-define('_LOGGEDINAS',				'Logged in as');
-define('_ADMINHOME',				'Admin Home');
-define('_NAME',						'Name');
-define('_BACKHOME',					'Back to Admin Home');
-define('_BADACTION',				'Non existing action requested');
-define('_MESSAGE',					'Message');
-define('_HELP_TT',					'Help!');
-define('_YOURSITE',					'Your site');
-
-
-define('_POPUP_CLOSE',				'Close Window');
-
-define('_LOGIN_PLEASE',				'Please Log in First');
-
-// commentform
-define('_COMMENTFORM_YOUARE',		'You are');
-define('_COMMENTFORM_SUBMIT',		'Add Comment');
-define('_COMMENTFORM_COMMENT',		'Your comment');
-define('_COMMENTFORM_NAME',			'Name');
-define('_COMMENTFORM_MAIL',			'E-mail/HTTP');
-define('_COMMENTFORM_REMEMBER',		'Remember Me');
-
-// loginform
-define('_LOGINFORM_NAME',			'Username');
-define('_LOGINFORM_PWD',			'Password');
-define('_LOGINFORM_YOUARE',			'Logged in as');
-define('_LOGINFORM_SHARED',			'Shared Computer');
-
-// member mailform
-define('_MEMBERMAIL_SUBMIT',		'Send Message');
-
-// search form
-define('_SEARCHFORM_SUBMIT',		'Search');
-
-// add item form
-define('_ADD_ADDTO',				'Add new item to');
-define('_ADD_CREATENEW',			'Create new item');
-define('_ADD_BODY',					'Body');
-define('_ADD_TITLE',				'Title');
-define('_ADD_MORE',					'Extended (optional)');
-define('_ADD_CATEGORY',				'Category');
-define('_ADD_PREVIEW',				'Preview');
-define('_ADD_DISABLE_COMMENTS',		'Disable comments?');
-define('_ADD_DRAFTNFUTURE',			'Draft &amp; Future Items');
-define('_ADD_ADDITEM',				'Add Item');
-define('_ADD_ADDNOW',				'Add Now');
-define('_ADD_ADDLATER',				'Add Later');
-define('_ADD_PLACE_ON',				'Place on');
-define('_ADD_ADDDRAFT',				'Add to drafts');
-define('_ADD_NOPASTDATES',			'(dates and times in the past are NOT valid, the current time will be used in that case)');
-define('_ADD_BOLD_TT',				'Bold');
-define('_ADD_ITALIC_TT',			'Italic');
-define('_ADD_HREF_TT',				'Make Link');
-define('_ADD_MEDIA_TT',				'Add Media');
-define('_ADD_PREVIEW_TT',			'Show/Hide Preview');
-define('_ADD_CUT_TT',				'Cut');
-define('_ADD_COPY_TT',				'Copy');
-define('_ADD_PASTE_TT',				'Paste');
-
-
-// edit item form
-define('_EDIT_ITEM',				'Edit Item');
-define('_EDIT_SUBMIT',				'Edit Item');
-define('_EDIT_ORIG_AUTHOR',			'Original author');
-define('_EDIT_BACKTODRAFTS',		'Add back to drafts');
-define('_EDIT_COMMENTSNOTE',		'(note: disabling comments will _not_ hide previously added comments)');
-
-// used on delete screens
-define('_DELETE_CONFIRM',			'Please confirm deletion');
-define('_DELETE_CONFIRM_BTN',		'Confirm Deletion');
-define('_CONFIRMTXT_ITEM',			'You\'re about to delete the item following item:');
-define('_CONFIRMTXT_COMMENT',		'You\'re about to delete the following comment:');
-define('_CONFIRMTXT_TEAM1',			'You\'re about to delete ');
-define('_CONFIRMTXT_TEAM2',			' from the teamlist for blog ');
-define('_CONFIRMTXT_BLOG',			'The blog you are going to delete is: ');
-define('_WARNINGTXT_BLOGDEL',		'Warning! Deleting a blog will delete ALL items of that blog, and all comments. Please confirm to make clear that you are CERTAIN of what you\'re doing!<br />Also, don\'t interrupt Nucleus while removing your blog.');
-define('_CONFIRMTXT_MEMBER',		'You\'re about to delete the following member profile: ');
-define('_CONFIRMTXT_TEMPLATE',		'You\'re about to delete the template named ');
-define('_CONFIRMTXT_SKIN',			'You\'re about to delete the skin named ');
-define('_CONFIRMTXT_BAN',			'You\'re about to delete the ban for the ip range');
-define('_CONFIRMTXT_CATEGORY',		'You\'re about to delete the category ');
-
-// some status messages
-define('_DELETED_ITEM',				'Item Deleted');
-define('_DELETED_MEMBER',			'Member Deleted');
-define('_DELETED_COMMENT',			'Comment Deleted');
-define('_DELETED_BLOG',				'Blog Deleted');
-define('_DELETED_CATEGORY',			'Category Deleted');
-define('_ITEM_MOVED',				'Item Moved');
-define('_ITEM_ADDED',				'Item Added');
-define('_COMMENT_UPDATED',			'Comment updated');
-define('_SKIN_UPDATED',				'Skin data has been saved');
-define('_TEMPLATE_UPDATED',			'Template data has been saved');
-
-// errors
-define('_ERROR_COMMENT_LONGWORD',	'Please don\'t use words of lengths higher than 90 in your comments');
-define('_ERROR_COMMENT_NOCOMMENT',	'Please enter a comment');
-define('_ERROR_COMMENT_NOUSERNAME',	'Bad username');
-define('_ERROR_COMMENT_TOOLONG',	'Your comments are too long (max. 5000 chars)');
-define('_ERROR_COMMENTS_DISABLED',	'Comments for this blog are currently disabled.');
-define('_ERROR_COMMENTS_NONPUBLIC',	'You must be logged in as a member to add comment to this blog');
-define('_ERROR_COMMENTS_MEMBERNICK','The name you want to use to post comments is in use by a site member. Choose something else.');
-define('_ERROR_SKIN',				'Skin error');
-define('_ERROR_ITEMCLOSED',			'This item is closed, it\'s not possible to add new comments to it or to vote on it');
-define('_ERROR_NOSUCHITEM',			'No such item exists');
-define('_ERROR_NOSUCHBLOG',			'No such blog');
-define('_ERROR_NOSUCHSKIN',			'No such skin');
-define('_ERROR_NOSUCHMEMBER',		'No such member');
-define('_ERROR_NOTONTEAM',			'You\'re not on the teamlist of this weblog.');
-define('_ERROR_BADDESTBLOG',		'Destination blog does not exist');
-define('_ERROR_NOTONDESTTEAM',		'Cannot move item, since you\'re not on the teamlist of the destination blog');
-define('_ERROR_NOEMPTYITEMS',		'Cannot add empty items!');
-define('_ERROR_BADMAILADDRESS',		'Email address is not valid');
-define('_ERROR_BADNOTIFY',			'One or more of the given notify addresses is not a valid email address');
-define('_ERROR_BADNAME',			'Name is not valid (only a-z and 0-9 allowed, no spaces at start/end)');
-define('_ERROR_NICKNAMEINUSE',		'Another member is already using that nickname');
-define('_ERROR_PASSWORDMISMATCH',	'Passwords must match');
-define('_ERROR_PASSWORDTOOSHORT',	'Password should be at least 6 characters');
-define('_ERROR_PASSWORDMISSING',	'Password cannot be empty');
-define('_ERROR_REALNAMEMISSING',	'You must enter a real name');
-define('_ERROR_ATLEASTONEADMIN',	'There should always be at least one super-admin that can login to the admin area.');
-define('_ERROR_ATLEASTONEBLOGADMIN','Performing this action would leave your weblog unmaintainable. Please make sure there is always at least one admin.');
-define('_ERROR_ALREADYONTEAM',		'You can\'t add a member that is already on the team');
-define('_ERROR_BADSHORTBLOGNAME',	'The short blog name should only contain a-z and 0-9, without spaces');
-define('_ERROR_DUPSHORTBLOGNAME',	'Another blog already has the chosen short name. These names should be unique');
-define('_ERROR_UPDATEFILE',			'Cannot get write access to the update-file. Make sure the file permissions are set ok (try chmodding it to 666). Also note that the location is relative to the admin-area directory, so you might want to use an absolute path (something like /your/path/to/nucleus/)');
-define('_ERROR_DELDEFBLOG',			'Cannot delete the default blog');
-define('_ERROR_DELETEMEMBER',		'This member cannot be deleted, probably because she is the author of items or comments');
-define('_ERROR_BADTEMPLATENAME',	'Invalid name for template, use only a-z and 0-9, without spaces');
-define('_ERROR_DUPTEMPLATENAME',	'Another template with this name already exists');
-define('_ERROR_BADSKINNAME',		'Invalid name for skin (only a-z, 0-9 are allowed, no spaces)');
-define('_ERROR_DUPSKINNAME',		'Another skin with this name already exists');
-define('_ERROR_DEFAULTSKIN',		'There must at all times be a skin named "default"');
-define('_ERROR_SKINDEFDELETE',		'Cannot delete skin since it is the default skin for the following weblog: ');
-define('_ERROR_DISALLOWED',			'Sorry, you\'re not allowed to perform this action');
-define('_ERROR_DELETEBAN',			'Error while trying to delete ban (ban does not exist)');
-define('_ERROR_ADDBAN',				'Error while trying to add ban. Ban might not have been added correctly in all your blogs.');
-define('_ERROR_BADACTION',			'Required action does not exist');
-define('_ERROR_MEMBERMAILDISABLED',	'Member to Member mail messages are disabled');
-define('_ERROR_MEMBERCREATEDISABLED','Creation of member accounts is disabled');
-define('_ERROR_INCORRECTEMAIL',		'Incorrect mail address');
-define('_ERROR_VOTEDBEFORE',		'You have already voted for this item');
-define('_ERROR_BANNED1',			'Cannot perform action since you (ip range ');
-define('_ERROR_BANNED2',			') are banned from doing so. The message was: \'');
-define('_ERROR_BANNED3',			'\'');
-define('_ERROR_LOGINNEEDED',		'You must be logged in in order to perform this action');
-define('_ERROR_CONNECT',			'Connect Error');
-define('_ERROR_FILE_TOO_BIG',		'File is too big!');
-define('_ERROR_BADFILETYPE',		'Sorry, this filetype is not allowed');
-define('_ERROR_BADREQUEST',			'Bad upload request');
-define('_ERROR_DISALLOWEDUPLOAD',	'You are not on any weblogs teamlist. Hence, you are not allowed to upload files');
-define('_ERROR_BADPERMISSIONS',		'File/Dir permissions are not set correctly');
-define('_ERROR_UPLOADMOVEP',		'Error while moving uploaded file');
-define('_ERROR_UPLOADCOPY',			'Error while copying file');
-define('_ERROR_UPLOADDUPLICATE',	'Another file with that name already exists. Try to rename it before uploading.');
-define('_ERROR_LOGINDISALLOWED',	'Sorry, you\'re not allowed to log in to the admin area. You can log in as another user, though');
-define('_ERROR_DBCONNECT',			'Could not connect to mySQL server');
-define('_ERROR_DBSELECT',			'Could not select the nucleus database.');
-define('_ERROR_NOSUCHLANGUAGE',		'No such language file exists');
-define('_ERROR_NOSUCHCATEGORY',		'No such category exists');
-define('_ERROR_DELETELASTCATEGORY',	'There must at least be one category');
-define('_ERROR_DELETEDEFCATEGORY',	'Cannot delete default category');
-define('_ERROR_BADCATEGORYNAME',	'Bad category name');
-define('_ERROR_DUPCATEGORYNAME',	'Another category with this name already exists');
-
-// some warnings (used for mediadir setting)
-define('_WARNING_NOTADIR',			'Warning: Current value is not a directory!');
-define('_WARNING_NOTREADABLE',		'Warning: Current value is a non-readable directory!');
-define('_WARNING_NOTWRITABLE',		'Warning: Current value is NOT a writable directory!');
-
-// media and upload
-define('_MEDIA_UPLOADLINK',			'Upload a new file');
-define('_MEDIA_MODIFIED',			'modified');
-define('_MEDIA_FILENAME',			'filename');
-define('_MEDIA_DIMENSIONS',			'dimensions');
-define('_MEDIA_INLINE',				'Inline');
-define('_MEDIA_POPUP',				'Popup');
-define('_UPLOAD_TITLE',				'Choose File');
-define('_UPLOAD_MSG',				'Select the file you want to upload below, and hit the \'Upload\' button.');
-define('_UPLOAD_BUTTON',			'Upload');
-
-// some status messages
-//define('_MSG_ACCOUNTCREATED',		'Account created, password will be sent through email');
-//define('_MSG_PASSWORDSENT',			'Password has been sent by e-mail.');
-define('_MSG_LOGINAGAIN',			'You\'ll need to login again, because your info changed');
-define('_MSG_SETTINGSCHANGED',		'Settings Changed');
-define('_MSG_ADMINCHANGED',			'Admin Changed');
-define('_MSG_NEWBLOG',				'New Blog Created');
-define('_MSG_ACTIONLOGCLEARED',		'Action Log Cleared');
-
-// actionlog in admin area
-define('_ACTIONLOG_DISALLOWED',		'Disallowed action: ');
-define('_ACTIONLOG_PWDREMINDERSENT','New password sent for ');
-define('_ACTIONLOG_TITLE',			'Action Log');
-define('_ACTIONLOG_CLEAR_TITLE',	'Clear Action Log');
-define('_ACTIONLOG_CLEAR_TEXT',		'Clear action log now');
-
-// team management
-define('_TEAM_TITLE',				'Manage team for blog ');
-define('_TEAM_CURRENT',				'Current team');
-define('_TEAM_ADDNEW',				'Add new member to team');
-define('_TEAM_CHOOSEMEMBER',		'Choose member');
-define('_TEAM_ADMIN',				'Admin privileges? ');
-define('_TEAM_ADD',					'Add to team');
-define('_TEAM_ADD_BTN',				'Add to team');
-
-// blogsettings
-define('_EBLOG_TITLE',				'Edit Blog Settings');
-define('_EBLOG_TEAM_TITLE',			'Edit Team');
-define('_EBLOG_TEAM_TEXT',			'Click here to edit your team...');
-define('_EBLOG_SETTINGS_TITLE',		'Blog settings');
-define('_EBLOG_NAME',				'Blog Name');
-define('_EBLOG_SHORTNAME',			'Short Blog Name');
-define('_EBLOG_SHORTNAME_EXTRA',	'<br />(should only contain a-z and no spaces)');
-define('_EBLOG_DESC',				'Blog Description');
-define('_EBLOG_URL',				'URL');
-define('_EBLOG_DEFSKIN',			'Default Skin');
-define('_EBLOG_DEFCAT',				'Default Category');
-define('_EBLOG_LINEBREAKS',			'Convert line breaks');
-define('_EBLOG_DISABLECOMMENTS',	'Comments enabled?<br /><small>(Disabling comments means that adding comments is not possible.)</small>');
-define('_EBLOG_ANONYMOUS',			'Allow comments by non-members?');
-define('_EBLOG_NOTIFY',				'Notify Address(es) (use ; as separator)');
-define('_EBLOG_NOTIFY_ON',			'Notify on');
-define('_EBLOG_NOTIFY_COMMENT',		'New comments');
-define('_EBLOG_NOTIFY_KARMA',		'New karma votes');
-define('_EBLOG_NOTIFY_ITEM',		'New weblog items');
-define('_EBLOG_PING',				'Ping Weblogs.com on update?');
-define('_EBLOG_MAXCOMMENTS',		'Max Amount of comments');
-define('_EBLOG_UPDATE',				'Update file');
-define('_EBLOG_OFFSET',				'Time Offset');
-define('_EBLOG_STIME',				'Current server time is');
-define('_EBLOG_BTIME',				'Current blog time is');
-define('_EBLOG_CHANGE',				'Change Settings');
-define('_EBLOG_CHANGE_BTN',			'Change Settings');
-define('_EBLOG_ADMIN',				'Blog Admin');
-define('_EBLOG_ADMIN_MSG',			'You will be assigned admin privileges');
-define('_EBLOG_CREATE_TITLE',		'Create new weblog');
-define('_EBLOG_CREATE_TEXT',		'Fill out the form below to create a new weblog. <br /><br /> <b>Note:</b> Only the necessary options are listed. If you want to set extra options, enter the blogsettings page after creating the weblog.');
-define('_EBLOG_CREATE',				'Create!');
-define('_EBLOG_CREATE_BTN',			'Create Weblog');
-define('_EBLOG_CAT_TITLE',			'Categories');
-define('_EBLOG_CAT_NAME',			'Category Name');
-define('_EBLOG_CAT_DESC',			'Category Description');
-define('_EBLOG_CAT_CREATE',			'Create New Category');
-define('_EBLOG_CAT_UPDATE',			'Update Category');
-define('_EBLOG_CAT_UPDATE_BTN',		'Update Category');
-
-// templates
-define('_TEMPLATE_TITLE',			'Edit Templates');
-define('_TEMPLATE_AVAILABLE_TITLE',	'Available Templates');
-define('_TEMPLATE_NEW_TITLE',		'New Template');
-define('_TEMPLATE_NAME',			'Template Name');
-define('_TEMPLATE_DESC',			'Template Description');
-define('_TEMPLATE_CREATE',			'Create Template');
-define('_TEMPLATE_CREATE_BTN',		'Create Template');
-define('_TEMPLATE_EDIT_TITLE',		'Edit Template');
-define('_TEMPLATE_BACK',			'Back to Template Overview');
-define('_TEMPLATE_EDIT_MSG',		'Not all template parts are needed, leave empty those that are not needed.');
-define('_TEMPLATE_SETTINGS',		'Template Settings');
-define('_TEMPLATE_ITEMS',			'Items');
-define('_TEMPLATE_ITEMHEADER',		'Item Header');
-define('_TEMPLATE_ITEMBODY',		'Item Body');
-define('_TEMPLATE_ITEMFOOTER',		'Item Footer');
-define('_TEMPLATE_MORELINK',		'Link to extended entry');
-define('_TEMPLATE_NEW',				'Indication of new item');
-define('_TEMPLATE_COMMENTS_ANY',	'Comments (if any)');
-define('_TEMPLATE_CHEADER',			'Comments Header');
-define('_TEMPLATE_CBODY',			'Comments Body');
-define('_TEMPLATE_CFOOTER',			'Comments Footer');
-define('_TEMPLATE_CONE',			'One Comment');
-define('_TEMPLATE_CMANY',			'Two (or more) Comments');
-define('_TEMPLATE_CMORE',			'Comments Read More');
-define('_TEMPLATE_CMEXTRA',			'Member Extra');
-define('_TEMPLATE_COMMENTS_NONE',	'Comments (if none)');
-define('_TEMPLATE_CNONE',			'No Comments');
-define('_TEMPLATE_COMMENTS_TOOMUCH','Comments (if any, but too much to show inline)');
-define('_TEMPLATE_CTOOMUCH',		'Too Much Comments');
-define('_TEMPLATE_ARCHIVELIST',		'Archive Lists');
-define('_TEMPLATE_AHEADER',			'Archive List Header');
-define('_TEMPLATE_AITEM',			'Archive List Item');
-define('_TEMPLATE_AFOOTER',			'Archive List Footer');
-define('_TEMPLATE_DATETIME',		'Date and Time');
-define('_TEMPLATE_DHEADER',			'Date Header');
-define('_TEMPLATE_DFOOTER',			'Date Footer');
-define('_TEMPLATE_DFORMAT',			'Date Format');
-define('_TEMPLATE_TFORMAT',			'Time Format');
-define('_TEMPLATE_LOCALE',			'Locale');
-define('_TEMPLATE_IMAGE',			'Image popups');
-define('_TEMPLATE_PCODE',			'Popup Link Code');
-define('_TEMPLATE_ICODE',			'Inline Image Code');
-define('_TEMPLATE_MCODE',			'Media Object Link Code');
-define('_TEMPLATE_SEARCH',			'Search');
-define('_TEMPLATE_SHIGHLIGHT',		'Highlight');
-define('_TEMPLATE_SNOTFOUND',		'Nothing found in search');
-define('_TEMPLATE_UPDATE',			'Update');
-define('_TEMPLATE_UPDATE_BTN',		'Update Template');
-define('_TEMPLATE_RESET_BTN',		'Reset Data');
-define('_TEMPLATE_CATEGORYLIST',	'Category Lists');
-define('_TEMPLATE_CATHEADER',		'Category List Header');
-define('_TEMPLATE_CATITEM',			'Category List Item');
-define('_TEMPLATE_CATFOOTER',		'Category List Footer');
-
-// skins
-define('_SKIN_EDIT_TITLE',			'Edit Skins');
-define('_SKIN_AVAILABLE_TITLE',		'Available Skins');
-define('_SKIN_NEW_TITLE',			'New Skin');
-define('_SKIN_NAME',				'Name');
-define('_SKIN_DESC',				'Description');
-define('_SKIN_TYPE',				'Content Type');
-define('_SKIN_CREATE',				'Create');
-define('_SKIN_CREATE_BTN',			'Create Skin');
-define('_SKIN_EDITONE_TITLE',		'Edit skin');
-define('_SKIN_BACK',				'Back to Skin Overview');
-define('_SKIN_PARTS_TITLE',			'Skin Parts');
-define('_SKIN_PARTS_MSG',			'Not all types are needed for each skin. Leave empty those you don\'t need. Choose the skin type to edit below:');
-define('_SKIN_PART_MAIN',			'Main Index');
-define('_SKIN_PART_ITEM',			'Item Pages');
-define('_SKIN_PART_ALIST',			'Archive List');
-define('_SKIN_PART_ARCHIVE',		'Archive');
-define('_SKIN_PART_SEARCH',			'Search');
-define('_SKIN_PART_ERROR',			'Errors');
-define('_SKIN_PART_MEMBER',			'Member Details');
-define('_SKIN_PART_POPUP',			'Image Popups');
-define('_SKIN_GENSETTINGS_TITLE',	'General Settings');
-define('_SKIN_CHANGE',				'Change');
-define('_SKIN_CHANGE_BTN',			'Change these settings');
-define('_SKIN_UPDATE_BTN',			'Update Skin');
-define('_SKIN_RESET_BTN',			'Reset Data');
-define('_SKIN_EDITPART_TITLE',		'Edit Skin');
-define('_SKIN_GOBACK',				'Go Back');
-define('_SKIN_ALLOWEDVARS',			'Allowed Variables (click for info):');
-
-// global settings
-define('_SETTINGS_TITLE',			'General Settings');
-define('_SETTINGS_SUB_GENERAL',		'General Settings');
-define('_SETTINGS_DEFBLOG',			'Default Blog');
-define('_SETTINGS_ADMINMAIL',		'Administrator Email');
-define('_SETTINGS_SITENAME',		'Site Name');
-define('_SETTINGS_SITEURL',			'URL of Site (should end with a slash)');
-define('_SETTINGS_ADMINURL',		'URL of Admin Area (should end with a slash)');
-define('_SETTINGS_DIRS',			'Nucleus Directories');
-define('_SETTINGS_MEDIADIR',		'Media Directory');
-define('_SETTINGS_SEECONFIGPHP',	'(see config.php)');
-define('_SETTINGS_MEDIAURL',		'Media URL (should end with a slash)');
-define('_SETTINGS_ALLOWUPLOAD',		'Allow File Upload?');
-define('_SETTINGS_ALLOWUPLOADTYPES','Allow File Types for Upload');
-define('_SETTINGS_CHANGELOGIN',		'Allow Members to Change Login/Password');
-define('_SETTINGS_COOKIES_TITLE',	'Cookie Settings');
-define('_SETTINGS_COOKIELIFE',		'Login Cookie Lifetime');
-define('_SETTINGS_COOKIESESSION',	'Session Cookies');
-define('_SETTINGS_COOKIEMONTH',		'Lifetime of a Month');
-define('_SETTINGS_COOKIEPATH',		'Cookie Path (advanced)');
-define('_SETTINGS_COOKIEDOMAIN',	'Cookie Domain (advanced)');
-define('_SETTINGS_COOKIESECURE',	'Secure Cookie (advanced)');
-define('_SETTINGS_LASTVISIT',		'Save Last Visit Cookies');
-define('_SETTINGS_ALLOWCREATE',		'Allow Visitors to Create a Member Account');
-define('_SETTINGS_NEWLOGIN',		'Login Allowed for User-Created accounts');
-define('_SETTINGS_NEWLOGIN2',		'(only goes for newly created accounts)');
-define('_SETTINGS_MEMBERMSGS',		'Allow Member-2-Member Service');
-define('_SETTINGS_LANGUAGE',		'Default Language');
-define('_SETTINGS_DISABLESITE',		'Disable Site');
-define('_SETTINGS_DBLOGIN',			'mySQL Login &amp; Database');
-define('_SETTINGS_UPDATE',			'Update Settings');
-define('_SETTINGS_UPDATE_BTN',		'Update Settings');
-define('_SETTINGS_DISABLEJS',		'Disable JavaScript Toolbar');
-define('_SETTINGS_MEDIA',			'Media/Upload Settings');
-define('_SETTINGS_MEDIAPREFIX',		'Prefix uploaded files with date');
-define('_SETTINGS_MEMBERS',			'Member Settings');
-
-// bans
-define('_BAN_TITLE',				'Ban List for');
-define('_BAN_NONE',					'No bans for this weblog');
-define('_BAN_NEW_TITLE',			'Add New Ban');
-define('_BAN_NEW_TEXT',				'Add a new ban now');
-define('_BAN_REMOVE_TITLE',			'Remove Ban');
-define('_BAN_IPRANGE',				'IP Range');
-define('_BAN_BLOGS',				'Which blogs?');
-define('_BAN_DELETE_TITLE',			'Delete Ban');
-define('_BAN_ALLBLOGS',				'All blogs to which you have admin privileges.');
-define('_BAN_REMOVED_TITLE',		'Ban Removed');
-define('_BAN_REMOVED_TEXT',			'Ban was removed for the following blogs:');
-define('_BAN_ADD_TITLE',			'Add Ban');
-define('_BAN_IPRANGE_TEXT',			'Choose the IP range you want to block below. The less numbers in it, the more addresses will be blocked.');
-define('_BAN_BLOGS_TEXT',			'You can either select to ban the IP on one blog only, or you can select to block the IP on all blogs where you have administrator privileges. Make your choice below.');
-define('_BAN_REASON_TITLE',			'Reason');
-define('_BAN_REASON_TEXT',			'You can provide a reason for the ban, which will be displayed when the IP holder tries to add another comment or tries to cast a karma vote. Maximum length is 256 characters.');
-define('_BAN_ADD_BTN',				'Add Ban');
-
-// LOGIN screen
-define('_LOGIN_MESSAGE',			'Message');
-define('_LOGIN_NAME',				'Name');
-define('_LOGIN_PASSWORD',			'Password');
-define('_LOGIN_SHARED',				_LOGINFORM_SHARED);
-define('_LOGIN_FORGOT',				'Forgot your password?');
-
-// membermanagement
-define('_MEMBERS_TITLE',			'Member Management');
-define('_MEMBERS_CURRENT',			'Current Members');
-define('_MEMBERS_NEW',				'New Member');
-define('_MEMBERS_DISPLAY',			'Display Name');
-define('_MEMBERS_DISPLAY_INFO',		'(This is the name you use to login)');
-define('_MEMBERS_REALNAME',			'Real Name');
-define('_MEMBERS_PWD',				'Password');
-define('_MEMBERS_REPPWD',			'Repeat Password');
-define('_MEMBERS_EMAIL',			'Email address');
-define('_MEMBERS_EMAIL_EDIT',		'(When you change the email address, a new password will be automatically sent out to that address)');
-define('_MEMBERS_URL',				'Website Address (URL)');
-define('_MEMBERS_SUPERADMIN',		'Administrator privileges');
-define('_MEMBERS_CANLOGIN',			'Can login to admin area');
-define('_MEMBERS_NOTES',			'Notes');
-define('_MEMBERS_NEW_BTN',			'Add Member');
-define('_MEMBERS_EDIT',				'Edit Member');
-define('_MEMBERS_EDIT_BTN',			'Change Settings');
-define('_MEMBERS_BACKTOOVERVIEW',	'Back to Member Overview');
-define('_MEMBERS_DEFLANG',			'Language');
-define('_MEMBERS_USESITELANG',		'- use site settings -');
-
-// List of blogs (TT = tooltip)
-define('_BLOGLIST_TT_VISIT',		'Visit Site');
-define('_BLOGLIST_ADD',				'Add Item');
-define('_BLOGLIST_TT_ADD',			'Add a new item to this weblog');
-define('_BLOGLIST_EDIT',			'Edit/Delete Items');
-define('_BLOGLIST_TT_EDIT',			'');
-define('_BLOGLIST_BMLET',			'Bookmarklet');
-define('_BLOGLIST_TT_BMLET',		'');
-define('_BLOGLIST_SETTINGS',		'Settings');
-define('_BLOGLIST_TT_SETTINGS',		'Edit settings or manage team');
-define('_BLOGLIST_BANS',			'Bans');
-define('_BLOGLIST_TT_BANS',			'View, add or remove banned IPs');
-define('_BLOGLIST_DELETE',			'Delete All');
-define('_BLOGLIST_TT_DELETE',		'Delete this weblog');
-
-// OVERVIEW screen
-define('_OVERVIEW_YRBLOGS',			'Your weblogs');
-define('_OVERVIEW_YRDRAFTS',		'Your drafts');
-define('_OVERVIEW_YRSETTINGS',		'Your settings');
-define('_OVERVIEW_GSETTINGS',		'General settings');
-define('_OVERVIEW_NOBLOGS',			'You\'re not on any weblogs teamlist');
-define('_OVERVIEW_NODRAFTS',		'No drafts');
-define('_OVERVIEW_EDITSETTINGS',	'Edit Your Settings...');
-define('_OVERVIEW_BROWSEITEMS',		'Browse your items...');
-define('_OVERVIEW_BROWSECOMM',		'Browse your comments...');
-define('_OVERVIEW_VIEWLOG',			'View Action Log...');
-define('_OVERVIEW_MEMBERS',			'Manage Members...');
-define('_OVERVIEW_NEWLOG',			'Create New Weblog...');
-define('_OVERVIEW_SETTINGS',		'Edit Settings...');
-define('_OVERVIEW_TEMPLATES',		'Edit Templates...');
-define('_OVERVIEW_SKINS',			'Edit Skins...');
-define('_OVERVIEW_BACKUP',			'Backup/Restore...');
-
-// ITEMLIST
-define('_ITEMLIST_BLOG',			'Items for blog'); 
-define('_ITEMLIST_YOUR',			'Your items');
-
-// Comments
-define('_COMMENTS',					'Comments');
-define('_NOCOMMENTS',				'No comments for this item');
-define('_COMMENTS_YOUR',			'Your Comments');
-define('_NOCOMMENTS_YOUR',			'You didn\'t write any comments');
-
-// LISTS (general)
-define('_LISTS_NOMORE',				'No more results, or no results at all');
-define('_LISTS_PREV',				'Previous');
-define('_LISTS_NEXT',				'Next');
-define('_LISTS_SEARCH',				'Search');
-define('_LISTS_CHANGE',				'Change');
-define('_LISTS_PERPAGE',			'items/page');
-define('_LISTS_ACTIONS',			'Actions');
-define('_LISTS_DELETE',				'Delete');
-define('_LISTS_EDIT',				'Edit');
-define('_LISTS_MOVE',				'Move');
-define('_LISTS_CLONE',				'Clone');
-define('_LISTS_TITLE',				'Title');
-define('_LISTS_BLOG',				'Blog');
-define('_LISTS_NAME',				'Name');
-define('_LISTS_DESC',				'Description');
-define('_LISTS_TIME',				'Time');
-define('_LISTS_COMMENTS',			'Comments');
-define('_LISTS_TYPE',				'Type');
-
-
-// member list 
-define('_LIST_MEMBER_NAME',			'Display Name');
-define('_LIST_MEMBER_RNAME',		'Real Name');
-define('_LIST_MEMBER_ADMIN',		'Super-admin? ');
-define('_LIST_MEMBER_LOGIN',		'Can login? ');
-define('_LIST_MEMBER_URL',			'Website');
-
-// banlist
-define('_LIST_BAN_IPRANGE',			'IP Range');
-define('_LIST_BAN_REASON',			'Reason');
-
-// actionlist
-define('_LIST_ACTION_MSG',			'Message');
-
-// commentlist
-define('_LIST_COMMENT_BANIP',		'Ban IP');
-define('_LIST_COMMENT_WHO',			'Author');
-define('_LIST_COMMENT',				'Comment');
-define('_LIST_COMMENT_HOST',		'Host');
-
-// itemlist
-define('_LIST_ITEM_INFO',			'Info');
-define('_LIST_ITEM_CONTENT',		'Title and Text');
-
-
-// teamlist
-define('_LIST_TEAM_ADMIN',			'Admin ');
-define('_LIST_TEAM_CHADMIN',		'Change Admin');
-
-// edit comments
-define('_EDITC_TITLE',				'Edit Comments');
-define('_EDITC_WHO',				'Author');
-define('_EDITC_HOST',				'From Where?');
-define('_EDITC_WHEN',				'When?');
-define('_EDITC_TEXT',				'Text');
-define('_EDITC_EDIT',				'Edit Comment');
-define('_EDITC_MEMBER',				'member');
-define('_EDITC_NONMEMBER',			'non member');
-
-// move item
-define('_MOVE_TITLE',				'Move to which blog?');
-define('_MOVE_BTN',					'Move Item');
-?>
diff -x .svn -aruN 3.33.src/nucleus/language/english.php 3.40.src/nucleus/language/english.php
--- 3.33.src/nucleus/language/english.php	2008-10-06 07:43:45.000000000 -0500
+++ 3.40.src/nucleus/language/english.php	2009-02-14 19:36:42.000000000 -0600
@@ -2,16 +2,73 @@
 // English Nucleus Language File
 //
 // Author: Wouter Demuynck
-// Nucleus version: v1.0-v3.2
+// Nucleus version: v1.0-v3.4
 //
 // Please note: if you want to translate this file to your own language, be aware
 // that in a next Nucleus version, new variables might be added and some other ones
-// might be deleted. Therefor, it's important to list the Nucleus version for which
+// might be deleted. Therefore, it's important to list the Nucleus version for which
 // the file was written in your document.
 //
 // Fully translated language file can be sent to us and will be made
 // available for download (with proper credit to the author, of course)
 
+/**
+ * English Nucleus Language File
+ *
+ * @license http://nucleuscms.org/license.txt GNU General Public License
+ * @copyright Copyright (C) 2002-2009 The Nucleus Group
+ * @version $Id: english.php 1319 2009-02-11 11:27:15Z shizuki $
+ */
+
+// START changed/added after 3.33 START
+define('_MEMBERS_USEAUTOSAVE',						'Use the Autosave function?');
+// END changed/added after 3.33 END
+
+// START merge UTF-8 and EUC-JP
+
+// Create New blog
+define('_ADMIN_NOTABILIA',							'Some information');
+define('_ADMIN_PLEASE_READ',						"Before you start, here's some <strong>important information</strong>");
+define('_ADMIN_HOW_TO_ACCESS',						"After you've created a new weblog, you'll need to perform some actions to make your blog accessible. There are two possibilities:");
+define('_ADMIN_SIMPLE_WAY',							"<strong>Simple:</strong> Create a copy of <code>index.php</code> and modify it to display your new weblog. Further instructions on how to do this will be provided after you've submitted this first form.");
+define('_ADMIN_ADVANCED_WAY',						"<strong>Advanced:</strong> Insert the blog content into your current skins using skinvars like <code>&lt;%otherblog()&gt;</code>. This way, you can place multiple blogs on the same page.");
+define('_ADMIN_HOW_TO_CREATE',						'Create Weblog');
+
+
+define('_BOOKMARKLET_NEW_CATEGORY',					'Item was added, and a new category was created. ');
+define('_BOOKMARKLET_NEW_CATEGORY_EDIT',			'Click here to edit the name and description of the category.');
+define('_BOOKMARKLET_NEW_WINDOW',					'Opens in new window');
+define('_BOOKMARKLET_SEND_PING',					'Item was added successfully. Now pinging weblogs.com. Please hold on... (can take a while)');
+
+// END merge UTF-8 and EUC-JP
+
+// START changed/added for 3.34 START
+define('_TEMPLATE_PLUGIN_FIELDS',					'Custom Plugin Fields');
+define('_TEMPLATE_BLOGLIST',						'Template Blog List');
+define('_TEMPLATE_BLOGHEADER',						'Blog List Header');
+define('_TEMPLATE_BLOGITEM',						'Blog List Item');
+define('_TEMPLATE_BLOGFOOTER',						'Blog List Footer');
+define('_SETTINGS_DEFAULTLISTSIZE',					'Default Size of Lists in Admin Area');
+// END changed/added for 3.34 END
+
+// START changed/added after 3.31 START
+define('_CREATE_ACCOUNT_TITLE',						'Create Member Account');
+define('_CREATE_ACCOUNT0',							'Create Account');
+define('_CREATE_ACCOUNT1',							'Visitors are not allowed to create a Member Account.<br /><br />');
+define('_CREATE_ACCOUNT2',							'Please contact the website administrator for more information.');
+define('_CREATE_ACCOUNT_USER_DATA',					'Account Info.');
+define('_CREATE_ACCOUNT_LOGIN_NAME',				'Login Name (required):');
+define('_CREATE_ACCOUNT_LOGIN_NAME_VALID',			'only a-z and 0-9 allowed, no spaces at start/end');
+define('_CREATE_ACCOUNT_REAL_NAME',					'Real Name (required):');
+define('_CREATE_ACCOUNT_EMAIL',						'Email (required):');
+define('_CREATE_ACCOUNT_EMAIL2',					'(must be valid, because an activation link will be sent over there)');
+define('_CREATE_ACCOUNT_URL',						'URL:');
+define('_CREATE_ACCOUNT_SUBMIT',					'Create Account');
+
+// START changed/added for 3.32 START
+define('_SETTINGS_DEBUGVARS',		'Debug Vars');
+// END changed/added for 3.32 END
+
 // START changed/added after 3.3 START
 define('_AUTOSAVEDRAFT',		'Auto save draft');
 define('_AUTOSAVEDRAFT_LASTSAVED',	'Last saved: ');
@@ -57,8 +114,8 @@
 define('_ERROR_BADTICKET',			'Invalid or expired ticket.');
 
 // plugin dependency
-define('_ERROR_INSREQPLUGIN',		'Plugin installation failed, requires ');
-define('_ERROR_DELREQPLUGIN',		'Plugin deletion failed, required by ');
+define('_ERROR_INSREQPLUGIN',		'Plugin installation failed, requires %s');
+define('_ERROR_DELREQPLUGIN',		'Plugin deletion failed, required by %s');
 
 // cookie prefix
 define('_SETTINGS_COOKIEPREFIX',	'Cookie Prefix');
@@ -346,6 +403,8 @@
 // bookmarklet buttons
 define('_BMLET_ADD',				'Add Item');
 define('_BMLET_EDIT',				'Edit Item');
+define('_BMLET_BACKTODRAFTS',		'Move back to drafts');
+define('_BMLET_CANCEL',				'Cancel');
 define('_BMLET_DELETE',				'Delete Item');
 define('_BMLET_BODY',				'Body');
 define('_BMLET_MORE',				'Extended');
@@ -494,7 +553,8 @@
 define('_ADD_DRAFTNFUTURE',			'Draft &amp; Future Items');
 define('_ADD_ADDITEM',				'Add Item');
 define('_ADD_ADDNOW',				'Add Now');
-define('_ADD_ADDLATER',				'Add Later');
+//define('_ADD_ADDLATER',								'Add Later');
+define('_ADD_ADDLATER',								'Add the dates specified');
 define('_ADD_PLACE_ON',				'Place on');
 define('_ADD_ADDDRAFT',				'Add to drafts');
 define('_ADD_NOPASTDATES',			'(dates and times in the past are NOT valid, the current time will be used in that case)');
@@ -838,8 +898,8 @@
 
 // LOGIN screen
 define('_LOGIN_MESSAGE',			'Message');
-define('_LOGIN_NAME',				'Name');
-define('_LOGIN_PASSWORD',			'Password');
+define('_LOGIN_NAME',				'Name :');
+define('_LOGIN_PASSWORD',			'Password :');
 define('_LOGIN_SHARED',				_LOGINFORM_SHARED);
 define('_LOGIN_FORGOT',				'Forgot your password?');
 
@@ -952,6 +1012,8 @@
 // itemlist
 define('_LIST_ITEM_INFO',			'Info');
 define('_LIST_ITEM_CONTENT',		'Title and Text');
+define('_LIST_ITEM_NOCONTENT',						'No Comment');
+define('_LIST_ITEM_COMMENTS',						'%d Comments');
 
 
 // teamlist
@@ -963,6 +1025,8 @@
 define('_EDITC_WHO',				'Author');
 define('_EDITC_HOST',				'From Where?');
 define('_EDITC_WHEN',				'When?');
+define('_EDITC_URL',				'Web site');
+define('_EDITC_EMAIL',				'E-mail');
 define('_EDITC_TEXT',				'Text');
 define('_EDITC_EDIT',				'Edit Comment');
 define('_EDITC_MEMBER',				'member');
@@ -972,4 +1036,257 @@
 define('_MOVE_TITLE',				'Move to which blog?');
 define('_MOVE_BTN',					'Move Item');
 
+
+// <add by shizuki>
+// OVERVIEW screen
+define('_OVERVIEW_SHOWALL',							'Show all blogs');	// <add by shizuki />
+
+// Edit skins
+define('_SKINEDIT_ALLOWEDBLOGS',						'Short blog names:');			// <add by shizuki>
+define('_SKINEDIT_ALLOWEDTEMPLATESS',					'Template names:');		// <add by shizuki>
+
+// delete member
+define('_WARNINGTXT_NOTDELMEDIAFILES',				'Please note that media files will <b>NOT</b> be deleted. (At least not in this Nucleus version)');	// <add by shizuki />
+
+// send Weblogupdate.ping
+define('_UPDATEDPING_MESSAGE',						'<h2>Site Updated, Now pinging various weblog listing services...</h2><p>This can take a while...</p><p>If you aren\'t automatically passed through, ');
+define('_UPDATEDPING_GOPINGPAGE',					'try again');
+define('_UPDATEDPING_PINGING',						'Pinging services, please wait...');
+define('_UPDATEDPING_VIEWITEM',						'View list of recent items for ');
+define('_UPDATEDPING_VISITOWNSITE',					'Visit your own site');
+define('_UPDATEDPING_GOSENDPING',					'Send Update ping');
+
+// General category
+define('_EBLOGDEFAULTCATEGORY_NAME',				'General');
+define('_EBLOGDEFAULTCATEGORY_DESC',				'Items that do not fit in other categories');
+
+// First ITEM
+define('_EBLOG_FIRSTITEM_TITLE',					'First Item');
+define('_EBLOG_FIRSTITEM_BODY',						'This is the first item in your weblog. Feel free to delete it.');
+
+// New weblog was created
+define('_BLOGCREATED_TITLE',						'New weblog created');
+define('_BLOGCREATED_ADDEDTXT',						"Your new weblog (%s) has been created. To continue, choose the way you'll want to make it viewable:");
+define('_BLOGCREATED_SIMPLEWAY',					"Easiest: A copy of <code>%s.php</code>");
+define('_BLOGCREATED_ADVANCEDWAY',					"Advanced: Call the weblog from existing skins");
+define('_BLOGCREATED_SIMPLEDESC1',					"Method 1: Create an extra <code>%s.php</code> file");
+define('_BLOGCREATED_SIMPLEDESC2',					"Create a file called <code>%s.php</code>, and copy-paste the following code into it:");
+define('_BLOGCREATED_SIMPLEDESC3',					"Upload the file next to your existing <code>index.php</code> file, and you should be all set.");
+define('_BLOGCREATED_SIMPLEDESC4',					"To finish the weblog creation process, please fill out the final URL for your weblog (the proposed value is a <em>guess</em>, don't take it for granted):");
+define('_BLOGCREATED_ADVANCEDWAY2',					"Method 2: Call the weblog from existing skins");
+define('_BLOGCREATED_ADVANCEDWAY3',					"To finish the weblog creation process, simply please fill out the final URL for your weblog: (might be the same as another already existing weblog)");
+
+// Donate!
+define('_ADMINPAGEFOOT_OFFICIALURL',				'http://nucleuscms.org/');
+define('_ADMINPAGEFOOT_DONATEURL',					'http://nucleuscms.org/donate.php');
+define('_ADMINPAGEFOOT_DONATE',						'Donate!');
+define('_ADMINPAGEFOOT_COPYRIGHT',					'The Nucleus Group');
+
+// Quick menu
+define('_QMENU_MANAGE_SYSTEM',						'System info');
+
+// REG file
+define('_WINREGFILE_TEXT',							'Post To &Nucleus (%s)');
+
+// Bookmarklet
+define('_BOOKMARKLET_TITLE',						'Bookmarklet<!-- and Right Click Menu -->');
+define('_BOOKMARKLET_DESC1',						'Bookmarklets allow adding items to your weblog with just one single click. ');
+define('_BOOKMARKLET_DESC2',						'After installing these bookmarklets, you\'ll be able to click the \'add to weblog\' button on your browser toolbar, ');
+define('_BOOKMARKLET_DESC3',						'and a Nucleus add-item window will popup, ');
+define('_BOOKMARKLET_DESC4',						'containing the link and title of the page you were visiting, ');
+define('_BOOKMARKLET_DESC5',						'plus any text you might have selected.');
+define('_BOOKMARKLET_BOOKARKLET',					'bookmarklet');
+define('_BOOKMARKLET_ANCHOR',						'Add to %s');
+define('_BOOKMARKLET_BMARLFOLLOW',					' (Nearly all browsers)');
+define('_BOOKMARKLET_BMARKTEXT',					'You can drag the following link to your favorites, or your browsers toolbar: ');
+define('_BOOKMARKLET_BMARKTEST',					'(if you want to test the bookmarklet first, click the link)');
+define('_BOOKMARKLET_RIGHTCLICK',					'Right Click Menu Access (IE &amp; Windows)');
+define('_BOOKMARKLET_RIGHTLABEL',					'right click menu item');
+define('_BOOKMARKLET_RIGHTTEXT1',					'Or you can install the ');
+define('_BOOKMARKLET_RIGHTTEXT2',					' (choose \'open file\' and add to registry)');
+define('_BOOKMARKLET_RIGHTTEXT3',					'You\'ll have to restart Internet Explorer before the option shows up in the context menus.');
+define('_BOOKMARKLET_UNINSTALLTT',					'Uninstalling');
+define('_BOOKMARKLET_DELETEBAR',					'For the bookmarklet, you can just delete it.');
+define('_BOOKMARKLET_DELETERIGHTT',					'For the right click menu item, follow the procedure listed below:');
+define('_BOOKMARKLET_DELETERIGHT1',					'Select "Run..." from the Start Menu');
+define('_BOOKMARKLET_DELETERIGHT2',					'Type: "regedit"');
+define('_BOOKMARKLET_DELETERIGHT3',					'Click the "OK" button');
+define('_BOOKMARKLET_DELETERIGHT4',					'Search for "\HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt" in the tree');
+define('_BOOKMARKLET_DELETERIGHT5',					'Delete the "add to \'Your weblog\'" item');
+
+define('_BOOKMARKLET_ERROR_SOMETHINGWRONG',			'Something went wrong');
+define('_BOOKMARKLET_ERROR_COULDNTNEWCAT',			'Could not create new category');
+
+// BAN
+define('_BAN_EXAMPLE_TITLE',						'An example');
+define('_BAN_EXAMPLE_TEXT',							': "134.58.253.193" will only block one computer, while "134.58.253" will block 256 IP addresses, including the one from the first example.');
+define('_BAN_IP_CUSTOM',							'Custom: ');
+define('_BAN_BANBLOGNAME',							'Only blog %s');
+
+// Plugin Options
+define('_PLUGIN_OPTIONS_TITLE',							'Options for %s');
+
+// Plugin file loda error
+define('_PLUGINFILE_COULDNT_BELOADED',				'Error: plugin file <strong>%s.php</strong> could not be loaded, or it has been set inactive because it does not support some features (check the <a href="?action=actionlog">actionlog</a> for more info)');
+
+//ITEM add/edit template (for japanese only)
+define('_ITEM_ADDEDITTEMPLATE_FORMAT',				'Format :');
+define('_ITEM_ADDEDITTEMPLATE_YEAR',				'Year');
+define('_ITEM_ADDEDITTEMPLATE_MONTH',				'Month');
+define('_ITEM_ADDEDITTEMPLATE_DAY',					'Day');
+define('_ITEM_ADDEDITTEMPLATE_HOUR',				'Hour');
+define('_ITEM_ADDEDITTEMPLATE_MINUTE',				'Minute');
+
+// Errors
+define('_ERRORS_INSTALLSQL',						'install.sql should be deleted');
+define('_ERRORS_INSTALLDIR',						'install directory should be deleted');  // <add by shizuki />
+define('_ERRORS_INSTALLPHP',						'install.php should be deleted');
+define('_ERRORS_UPGRADESDIR',						'nucleus/upgrades directory should be deleted');
+define('_ERRORS_CONVERTDIR',						'nucleus/convert directory should be deleted');
+define('_ERRORS_CONFIGPHP',							'config.php should be non-writable (chmod to 444)');
+define('_ERRORS_STARTUPERROR1',						'<p>One or more of the Nucleus installation files are still present on the webserver, or are writable.</p><p>You should remove these files or change their permissions to ensure security. Here are the files that were found by Nucleus</p> <ul><li>');
+define('_ERRORS_STARTUPERROR2',						'</li></ul><p>If you don\'t want to see this error message again, without solving the problem, set <code>$CONF[\'alertOnSecurityRisk\']</code> in <code>globalfunctions.php</code> to <code>0</code>, or do this at the end of <code>config.php</code>.</p>');
+define('_ERRORS_STARTUPERROR3',						'Security Risk');
+
+// PluginAdmin tickets by javascript
+define('_PLUGINADMIN_TICKETS_JAVASCRIPT',			'<p><b>Error occured during automatic addition of tickets.</b></p>');
+
+// Global settings disablesite URL
+define('_SETTINGS_DISABLESITEURL',					'Redirect URL:');
+
+// Skin import/export
+define('_SKINIE_SEELEMENT_UNEXPECTEDTAG',			'UNEXPECTED TAG');
+define('_SKINIE_ERROR_FAILEDOPEN_FILEURL',			'Failed to open file/URL');
+define('_SKINIE_NAME_CLASHES_DETECTED',				'Name clashes detected, re-run with allowOverwrite = 1 to force overwrite');
+
+// ACTIONS.php parse_commentform
+define('_ACTIONURL_NOTLONGER_PARAMATER',			'actionurl is not longer a parameter on commentform skinvars. Moved to be a global setting instead.');
+
+// ADMIN.php addToTemplate 'Query error: '
+define('_ADMIN_SQLDIE_QUERYERROR',					'Query error: ');
+
+// backyp.php Backup WARNING
+define('_BACKUP_BACKUPFILE_TITLE',					'This is a backup file generated by Nucleus');
+define('_BACKUP_BACKUPFILE_BACKUPDATE',				'backup-date:');
+define('_BACKUP_BACKUPFILE_NUCLEUSVERSION',			'Nucleus CMS version:');
+define('_BACKUP_BACKUPFILE_DATABASE_NAME',			'Nucleus CMS Database name:');
+define('_BACKUP_BACKUPFILE_TABLE_NAME',				'TABLE:');
+define('_BACKUP_BACKUPFILE_TABLEDATAFOR',			'Table Data for %s');
+define('_BACKUP_WARNING_NUCLEUSVERSION',			'WARNING: Only try to restore on servers running the exact same version of Nucleus');
+define('_BACKUP_RESTOR_NOFILEUPLOADED',				'No file uploaded');
+define('_BACKUP_RESTOR_UPLOAD_ERROR',				'File Upload Error');
+define('_BACKUP_RESTOR_UPLOAD_NOCORRECTTYPE',		'The uploaded file is not of the correct type');
+define('_BACKUP_RESTOR_UPLOAD_NOZLIB',				'Cannot decompress gzipped backup (zlib package not installed)');
+define('_BACKUP_RESTOR_SQL_ERROR',					'SQL Error: ');
+
+// BLOG.php addTeamMember
+define('_TEAM_ADD_NEWTEAMMEMBER',					'Added %s (ID=%d) to the team of blog "%s"');
+
+// ADMIN.php systemoverview()
+define('_ADMIN_SYSTEMOVERVIEW_HEADING',				'System Overview');
+define('_ADMIN_SYSTEMOVERVIEW_PHPANDMYSQL',			'PHP and MySQL');
+define('_ADMIN_SYSTEMOVERVIEW_VERSIONS',			'Versions');
+define('_ADMIN_SYSTEMOVERVIEW_PHPVERSION',			'PHP version');
+define('_ADMIN_SYSTEMOVERVIEW_MYSQLVERSION',		'MySQL version');
+define('_ADMIN_SYSTEMOVERVIEW_SETTINGS',			'Settings');
+define('_ADMIN_SYSTEMOVERVIEW_GDLIBRALY',			'GD Libraly');
+define('_ADMIN_SYSTEMOVERVIEW_MODULES',				'Modules');
+define('_ADMIN_SYSTEMOVERVIEW_ENABLE',				'enabled');
+define('_ADMIN_SYSTEMOVERVIEW_DISABLE',				'disabled');
+define('_ADMIN_SYSTEMOVERVIEW_NUCLEUSSYSTEM',		'Your Nucleus CMS System');
+define('_ADMIN_SYSTEMOVERVIEW_NUCLEUSVERSION',		'Nucleus CMS version');
+define('_ADMIN_SYSTEMOVERVIEW_NUCLEUSPATCHLEVEL',	'Nucleus CMS patch level');
+define('_ADMIN_SYSTEMOVERVIEW_NUCLEUSSETTINGS',		'Important settings');
+define('_ADMIN_SYSTEMOVERVIEW_VERSIONCHECK',		'Check for a new version');
+define('_ADMIN_SYSTEMOVERVIEW_VERSIONCHECK_TXT',	'Check on nucleuscms.org if a new version is available: ');
+define('_ADMIN_SYSTEMOVERVIEW_VERSIONCHECK_URL',	'http://nucleuscms.org/version.php?v=%d&amp;pl=%d');
+define('_ADMIN_SYSTEMOVERVIEW_VERSIONCHECK_TITLE',	'Check for upgrade');
+define('_ADMIN_SYSTEMOVERVIEW_NOT_ADMIN',			"You haven't enough rights to see the system informations.");
+
+// ENCAPSULATE.php
+define('_ENCAPSULATE_ENCAPSULATE_NOENTRY',			'No entries');
+
+// globalfunctions.php
+define('_GFUNCTIONS_LOGINPCSHARED_YES',				'on shared PC');
+define('_GFUNCTIONS_LOGINPCSHARED_NO',				'on not shared PC');
+define('_GFUNCTIONS_LOGINSUCCESSFUL_TXT',			'Login successful for %s (%s)');
+define('_GFUNCTIONS_LOGINFAILED_TXT',				'Login failed for %s');
+define('_GFUNCTIONS_LOGOUT_TXT',					'%s is logouted');
+define('_GFUNCTIONS_HEADERSALREADYSENT_FILE',		' in <code>%s</code> line <code>%s</code>');
+define('_GFUNCTIONS_HEADERSALREADYSENT_TITLE',		' Page headers already sent');
+define('_GFUNCTIONS_HEADERSALREADYSENT_TXT',		'<p>The page headers have already been sent out%s. This could cause Nucleus not to work in the expected way.</p><p>Usually, this is caused by spaces or newlines at the end of the <code>config.php</code> file, at the end of the language file or at the end of a plugin file. Please check this and try again.</p><p>If you don\'t want to see this error message again, without solving the problem, set <code>$CONF[\'alertOnHeadersSent\']</code> in <code>globalfunctions.php</code> to <code>0</code></p>');
+define('_GFUNCTIONS_PARSEFILE_FILEMISSING',			'A file is missing');
+define('_GFUNCTIONS_AN_ERROR_OCCURRED',				'Sorry. An error occurred.');
+define('_GFUNCTIONS_YOU_AERNT_LOGGEDIN',			"You aren't logged in.");
+
+// MANAGER.php
+define('_MANAGER_PLUGINFILE_NOTFOUND',				"Plugin %s was not loaded (File not found)");
+define('_MANAGER_PLUGINFILE_NOCLASS',				"Plugin %s was not loaded (Class not found in file, possible parse error)");
+define('_MANAGER_PLUGINTABLEPREFIX_NOTSUPPORT',		"Plugin %s was not loaded (does not support SqlTablePrefix)");
+
+// mysql.php
+define('_NO_SUITABLE_MYSQL_LIBRARY',				"<p>No suitable mySQL library was found to run Nucleus</p>");
+
+// PLUGIN.php
+define('_ERROR_PLUGIN_NOSUCHACTION',				'No Such Action');
+
+// PLUGINADMIN.php
+define('_ERROR_INVALID_PLUGIN',						'Invalid plugin');
+
+// showlist.php
+define('_LIST_PLUGS_DEPREQ',						'Plugin(s) requires:');
+define('_LIST_SKIN_PREVIEW',						"Preview for '%s' skin");
+define('_LIST_SKIN_PREVIEW_VIEWLARGER',				"View larger");
+define('_LIST_SKIN_README',							"More info on the '%s' skin");
+define('_LIST_SKIN_README_TXT',						'Read me');
+
+// BLOG.php createNewCategory()
+define('_CREATED_NEW_CATEGORY_NAME',				'newcat');
+define('_CREATED_NEW_CATEGORY_DESC',				'New category');
+
+// ADMIN.php blog settings
+define('_EBLOG_CURRENT_TEAM_MEMBER',				'Members currently on your team:');
+
+// HTML outputs
+define('_HTML_XML_NAME_SPACE_AND_LANG_CODE',		'xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us" lang="en-us"');
+
+// Language Files
+define('_LANGUAGEFILES_JAPANESE-UTF8',				'Japanese - &#26085;&#26412;&#35486; (UTF-8)');
+define('_LANGUAGEFILES_JAPANESE-EUC',				'Japanese - &#26085;&#26412;&#35486; (EUC)');
+define('_LANGUAGEFILES_JAPANESE-SJIS',				'Japanese - &#26085;&#26412;&#35486; (Shift-JIS)');
+define('_LANGUAGEFILES_ENGLISH-UTF8',				'English - English (UTF-8)');
+define('_LANGUAGEFILES_ENGLISH',					'English - English (iso-8859-1)');
+/*
+define('_LANGUAGEFILES_BULGARIAN',					'Bulgarian - &#1041;&#1098;&#1083;&#1075;&#1072;&#1088;&#1089;&#1082;&#1080; (iso-8859-5)');
+define('_LANGUAGEFILES_CATALAN',					'Catalan - Catal&agrave; (iso-8859-1)');
+define('_LANGUAGEFILES_CHINESE-GBK',				'Simplified Chinese - &#31777;&#20307;&#23383;&#20013;&#25991; (gbk)');
+define('_LANGUAGEFILES_SIMCHINESE',					'Simplified Chinese - &#31777;&#20307;&#23383;&#20013;&#25991; (gb2312)');
+define('_LANGUAGEFILES_CHINESE-UTF8',				'Simplified Chinese - &#31777;&#20307;&#23383;&#20013;&#25991; (utf-8)');
+define('_LANGUAGEFILES_CHINESEB5',					'Tranditional Chinese - &#32321;&#20307;&#23383;&#20013;&#25991; (big5)');
+define('_LANGUAGEFILES_CHINESEB5-UTF8',				'Tranditional Chinese - &#32321;&#20307;&#23383;&#20013;&#25991; (utf-8)');
+define('_LANGUAGEFILES_TRADITIONAL_CHINESE',		'Tranditional Chinese - &#32321;&#20307;&#23383;&#20013;&#25991; (big5)');
+define('_LANGUAGEFILES_TRADITIONAL_CHINESE-UTF-8',	'Tranditional Chinese - &#32321;&#20307;&#23383;&#20013;&#25991; (utf-8)');
+define('_LANGUAGEFILES_CZECH',						'Czech - &#268;esky (windows-1250)');
+define('_LANGUAGEFILES_FINNISH',					'Finnish - Suomi (iso-8859-1)');
+define('_LANGUAGEFILES_FRENCH',						'French - Fran&ccedil;ais (iso-8859-1)');
+define('_LANGUAGEFILES_GALEGO',						'Galego - Galego (iso-8859-1)');
+define('_LANGUAGEFILES_GERMAN',						'German - Deutsch (iso-8859-1)');
+define('_LANGUAGEFILES_HUNGARIAN',					'Hungarian - Magyar (iso-8859-2)');
+define('_LANGUAGEFILES_ITALIANO',					'Italiano - Italiano (iso-8859-1)');
+define('_LANGUAGEFILES_KOREAN-EUC-KR',				'Korean - &#54620;&#44397;&#50612; (euc-kr)');
+define('_LANGUAGEFILES_KOREAN-UTF',					'Korean - &#54620;&#44397;&#50612; (utf-8)');
+define('_LANGUAGEFILES_LATVIAN',					'Latvian - Latvie&scaron;u (windows-1257)');
+define('_LANGUAGEFILES_NEDERLANDS',					'Duch - Nederlands (iso-8859-15)');
+define('_LANGUAGEFILES_PERSIAN',					'Persian - &#1601;&#1575;&#1585;&#1587;&#1740; (utf-8)');
+define('_LANGUAGEFILES_PORTUGUESE_BRAZIL',			'Portuguese Brazil - Portugu&ecirc;s (iso-8859-1)');
+define('_LANGUAGEFILES_RUSSIAN',					'Russian - &#1056;&#1091;&#1089;&#1089;&#1082;&#1080;&#1081; (windows-1251)');
+define('_LANGUAGEFILES_SLOVAK',						'Slovak - Sloven&#269;ina (ISO-8859-2)');
+define('_LANGUAGEFILES_SPANISH-UTF8',				'Spanish - Espa&ntilde;ol (utf-8)');
+define('_LANGUAGEFILES_SPANISH',					'Spanish - Espa&ntilde;ol (iso-8859-1)');
+*/
+
+
+// </add by shizuki>
+
+
 ?>
diff -x .svn -aruN 3.33.src/nucleus/libs/.htaccess 3.40.src/nucleus/libs/.htaccess
--- 3.33.src/nucleus/libs/.htaccess	1969-12-31 18:00:00.000000000 -0600
+++ 3.40.src/nucleus/libs/.htaccess	2009-02-14 19:36:46.000000000 -0600
@@ -0,0 +1,2 @@
+Order allow,deny
+Deny from all
\ No newline at end of file
diff -x .svn -aruN 3.33.src/nucleus/libs/ACTION.php 3.40.src/nucleus/libs/ACTION.php
--- 3.33.src/nucleus/libs/ACTION.php	2008-10-06 07:43:46.000000000 -0500
+++ 3.40.src/nucleus/libs/ACTION.php	2009-02-14 19:36:46.000000000 -0600
@@ -15,7 +15,7 @@
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: ACTION.php 1209 2007-10-13 19:59:05Z kaigreve $
+ * @version $Id: ACTION.php 1287 2008-12-12 18:50:10Z ftruscot $
  */
 class ACTION
 {
@@ -210,7 +210,8 @@
 		$initialPwd = md5(uniqid(rand(), true));
 
 		// create member (non admin/can not login/no notes/random string as password)
-		$r = MEMBER::create(postVar('name'), postVar('realname'), $initialPwd, postVar('email'), postVar('url'), 0, 0, '');
+		$name = shorten(postVar('name'),16,'');
+		$r = MEMBER::create($name, postVar('realname'), $initialPwd, postVar('email'), postVar('url'), 0, 0, '');
 
 			if ($r != 1) {
 				return $r;
@@ -218,7 +219,7 @@
 
 		// send message containing password.
 		$newmem = new MEMBER();
-		$newmem->readFromName(postVar('name'));
+		$newmem->readFromName($name);
 		$newmem->sendActivationLink('register');
 
 		$manager->notify('PostRegister',array('member' => &$newmem));
@@ -391,7 +392,7 @@
 		global $manager;
 		if ($manager->checkTicket()) {
 			$manager->loadClass('ITEM');
-			$info = ITEM::CreateDraftFromRequest();
+			$info = ITEM::createDraftFromRequest();
 			if ($info['status'] == 'error') {
 				echo $info['message'];
 			}
@@ -408,4 +409,4 @@
 
 }
 
-?>
\ No newline at end of file
+?>
diff -x .svn -aruN 3.33.src/nucleus/libs/ACTIONS.php 3.40.src/nucleus/libs/ACTIONS.php
--- 3.33.src/nucleus/libs/ACTIONS.php	2008-10-06 07:43:46.000000000 -0500
+++ 3.40.src/nucleus/libs/ACTIONS.php	2009-02-14 19:36:46.000000000 -0600
@@ -18,7 +18,7 @@
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: ACTIONS.php 1141 2007-05-10 08:10:26Z kimitake $
+ * @version $Id: ACTIONS.php 1279 2008-10-23 08:18:26Z shizuki $
  */
 
 class ACTIONS extends BaseActions {
@@ -262,7 +262,7 @@
 	{
 		$u = htmlspecialchars($url);
 		$u = preg_replace("/&amp;amp;/",'&amp;',$u); // fix URLs that already had encoded ampersands
-		if ($linktext != '')
+		if ($linktext != '') 
 			$l = '<a href="' . $u .'">'.htmlspecialchars($linktext).'</a>';
 		else
 			$l = $u;
@@ -396,6 +396,25 @@
 	}
 	
 	/**
+	 * Parse skinvar addlink
+	 * A Link that allows to open a bookmarklet to add an item
+	 */
+	function parse_addlink() {
+		global $CONF, $member, $blog;
+		if ($member->isLoggedIn() && $member->isTeamMember($blog->blogid) ) {
+			echo $CONF['AdminURL'].'bookmarklet.php?blogid='.$blog->blogid;
+		}
+	}
+	
+	/**
+	 * Parse skinvar addpopupcode
+	 * Code that opens a bookmarklet in an popup window
+	 */
+	function parse_addpopupcode() {
+		echo "if (event &amp;&amp; event.preventDefault) event.preventDefault();winbm=window.open(this.href,'nucleusbm','scrollbars=yes,width=600,height=500,left=10,top=10,status=yes,resizable=yes');winbm.focus();return false;";
+	}
+	
+	/**
 	 * Parse skinvar adminurl
 	 * (shortcut for admin url)	 
 	 */
@@ -505,9 +524,11 @@
 	*	Parse skinvar bloglist
 	*	Shows a list of all blogs
 	*	bnametype: whether 'name' or 'shortname' is used for the link text 	  
+	*	orderby: order criteria
+	*	direction: order ascending or descending		  
 	*/
-	function parse_bloglist($template, $bnametype = '') {
-		BLOG::showBlogList($template, $bnametype);
+	function parse_bloglist($template, $bnametype = '', $orderby='number', $direction='asc') {
+		BLOG::showBlogList($template, $bnametype, $orderby, $direction);
 	}
 	
 	/**
@@ -599,7 +620,7 @@
 		if (stristr($destinationurl, 'action.php')) {
 			$args = func_get_args();
 			$destinationurl = $args[1];
-			ACTIONLOG::add(WARNING,'actionurl is not longer a parameter on commentform skinvars. Moved to be a global setting instead.');
+			ACTIONLOG::add(WARNING,_ACTIONURL_NOTLONGER_PARAMATER);
 		}
 
 		$actionurl = $CONF['ActionURL'];
@@ -1075,9 +1096,10 @@
 	function parse_plugin($pluginName) {
 		global $manager;
 
+		// should be already tested from the parser (PARSER.php)
 		// only continue when the plugin is really installed
-		if (!$manager->pluginInstalled('NP_' . $pluginName))
-			return;
+		/*if (!$manager->pluginInstalled('NP_' . $pluginName))
+			return;*/
 
 		$plugin =& $manager->getPlugin('NP_' . $pluginName);
 		if (!$plugin) return;
diff -x .svn -aruN 3.33.src/nucleus/libs/ADMIN.php 3.40.src/nucleus/libs/ADMIN.php
--- 3.33.src/nucleus/libs/ADMIN.php	2008-10-06 07:43:46.000000000 -0500
+++ 3.40.src/nucleus/libs/ADMIN.php	2009-02-14 19:36:46.000000000 -0600
@@ -14,7 +14,7 @@
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: ADMIN.php 1189 2007-08-06 15:30:51Z kaigreve $
+ * @version $Id: ADMIN.php 1319 2009-02-11 11:27:15Z shizuki $
  */
 
 if ( !function_exists('requestVar') ) exit;
@@ -61,7 +61,57 @@
 		// check ticket. All actions need a ticket, unless they are considered to be safe (a safe action
 		// is an action that requires user interaction before something is actually done)
 		// all safe actions are in this array:
-		$aActionsNotToCheck = array('showlogin', 'login', 'overview', 'itemlist', 'blogcommentlist', 'bookmarklet', 'blogsettings', 'banlist', 'deleteblog', 'editmembersettings', 'browseownitems', 'browseowncomments', 'createitem', 'itemedit', 'itemmove', 'categoryedit', 'categorydelete', 'manage', 'actionlog', 'settingsedit', 'backupoverview', 'pluginlist', 'createnewlog', 'usermanagement', 'skinoverview', 'templateoverview', 'skinieoverview', 'itemcommentlist', 'commentedit', 'commentdelete', 'banlistnewfromitem', 'banlistdelete', 'itemdelete', 'manageteam', 'teamdelete', 'banlistnew', 'memberedit', 'memberdelete', 'pluginhelp', 'pluginoptions', 'plugindelete', 'skinedittype', 'skinremovetype', 'skindelete', 'skinedit', 'templateedit', 'templatedelete', 'activate');
+		$aActionsNotToCheck = array(
+			'showlogin',
+			'login',
+			'overview',
+			'itemlist',
+			'blogcommentlist',
+			'bookmarklet',
+			'blogsettings',
+			'banlist',
+			'deleteblog',
+			'editmembersettings',
+			'browseownitems',
+			'browseowncomments',
+			'createitem',
+			'itemedit',
+			'itemmove',
+			'categoryedit',
+			'categorydelete',
+			'manage',
+			'actionlog',
+			'settingsedit',
+			'backupoverview',
+			'pluginlist',
+			'createnewlog',
+			'usermanagement',
+			'skinoverview',
+			'templateoverview',
+			'skinieoverview',
+			'itemcommentlist',
+			'commentedit',
+			'commentdelete',
+			'banlistnewfromitem',
+			'banlistdelete',
+			'itemdelete',
+			'manageteam',
+			'teamdelete',
+			'banlistnew',
+			'memberedit',
+			'memberdelete',
+			'pluginhelp',
+			'pluginoptions',
+			'plugindelete',
+			'skinedittype',
+			'skinremovetype',
+			'skindelete',
+			'skinedit',
+			'templateedit',
+			'templatedelete',
+			'activate',
+			'systemoverview'
+		);
 /*
 		// the rest of the actions needs to be checked
 		$aActionsToCheck = array('additem', 'itemupdate', 'itemmoveto', 'categoryupdate', 'categorydeleteconfirm', 'itemdeleteconfirm', 'commentdeleteconfirm', 'teamdeleteconfirm', 'memberdeleteconfirm', 'templatedeleteconfirm', 'skindeleteconfirm', 'banlistdeleteconfirm', 'plugindeleteconfirm', 'batchitem', 'batchcomment', 'batchmember', 'batchcategory', 'batchteam', 'regfile', 'commentupdate', 'banlistadd', 'changemembersettings', 'clearactionlog', 'settingsupdate', 'blogsettingsupdate', 'categorynew', 'teamchangeadmin', 'teamaddmember', 'memberadd', 'addnewlog', 'addnewlog2', 'backupcreate', 'backuprestore', 'pluginup', 'plugindown', 'pluginupdate', 'pluginadd', 'pluginoptionsupdate', 'skinupdate', 'skinclone', 'skineditgeneral', 'templateclone', 'templatenew', 'templateupdate', 'skinieimport', 'skinieexport', 'skiniedoimport', 'skinnew', 'deleteblogconfirm', 'sendping', 'rawping', 'activatesetpwd');
@@ -106,9 +156,9 @@
 		?>
 
 		<form action="index.php" method="post"><p>
-		<?php echo _LOGIN_NAME?>: <br /><input name="login"  tabindex="10" />
+		<?php echo _LOGIN_NAME; ?> <br /><input name="login"  tabindex="10" />
 		<br />
-		<?php echo _LOGIN_PASSWORD?>: <br /><input name="password"  tabindex="20" type="password" />
+		<?php echo _LOGIN_PASSWORD; ?> <br /><input name="password"  tabindex="20" type="password" />
 		<br />
 		<input name="action" value="login" type="hidden" />
 		<br />
@@ -167,7 +217,7 @@
 		if (($showAll != 'yes') && ($member->isAdmin())) {
 			$total = quickQuery('SELECT COUNT(*) as result FROM ' . sql_table('blog'));
 			if ($total > $amount)
-				echo '<p><a href="index.php?action=overview&amp;showall=yes">Show all blogs</a></p>';
+				echo '<p><a href="index.php?action=overview&amp;showall=yes">' . _OVERVIEW_SHOWALL . '</a></p>';
 		}
 
 		if ($amount == 0)
@@ -257,7 +307,7 @@
 	 * @todo document this
 	 */
 	function action_itemlist($blogid = '') {
-		global $member, $manager;
+		global $member, $manager, $CONF;
 
 		if ($blogid == '')
 			$blogid = intRequestVar('blogid');
@@ -282,8 +332,11 @@
 		// amount of items to show
 		if (postVar('amount'))
 			$amount = intPostVar('amount');
-		else
-			$amount = 10;
+		else {
+			$amount = intval($CONF['DefaultListSize']);
+			if ($amount < 1) 
+				$amount = 10;
+		}
 
 		$search = postVar('search');	// search through items
 
@@ -830,7 +883,7 @@
 	 * @todo document this
 	 */
 	function action_browseownitems() {
-		global $member, $manager;
+		global $member, $manager, $CONF;
 
 		$this->pagehead();
 
@@ -846,8 +899,11 @@
 		// amount of items to show
 		if (postVar('amount'))
 			$amount = intPostVar('amount');
-		else
-			$amount = 10;
+		else {
+			$amount = intval($CONF['DefaultListSize']);
+			if ($amount < 1) 
+				$amount = 10;
+		}
 
 		$search = postVar('search');	// search through items
 
@@ -877,7 +933,7 @@
 	 * @param int $itemid
 	 */
 	function action_itemcommentlist($itemid = '') {
-		global $member, $manager;
+		global $member, $manager, $CONF;
 
 		if ($itemid == '')
 			$itemid = intRequestVar('itemid');
@@ -898,15 +954,18 @@
 		// amount of items to show
 		if (postVar('amount'))
 			$amount = intPostVar('amount');
-		else
-			$amount = 10;
+		else {
+			$amount = intval($CONF['DefaultListSize']);
+			if ($amount < 1) 
+				$amount = 10;
+		}
 
 		$search = postVar('search');
 
 		echo '<p>(<a href="index.php?action=itemlist&amp;blogid=',$blogid,'">',_BACKTOOVERVIEW,'</a>)</p>';
 		echo '<h2>',_COMMENTS,'</h2>';
 
-		$query =  'SELECT cbody, cuser, cmail, mname, ctime, chost, cnumber, cip, citem FROM '.sql_table('comment').' LEFT OUTER JOIN '.sql_table('member').' ON mnumber=cmember WHERE citem=' . $itemid;
+		$query = 'SELECT cbody, cuser, cmail, cemail, mname, ctime, chost, cnumber, cip, citem FROM ' . sql_table('comment') . ' LEFT OUTER JOIN ' . sql_table('member') . ' ON mnumber = cmember WHERE citem = ' . $itemid;
 
 		if ($search)
 			$query .= ' and cbody LIKE "%' . addslashes($search) . '%"';
@@ -928,7 +987,7 @@
 	 * Browse own comments
 	 */
 	function action_browseowncomments() {
-		global $member, $manager;
+		global $member, $manager, $CONF;
 
 		// start index
 		if (postVar('start'))
@@ -939,8 +998,11 @@
 		// amount of items to show
 		if (postVar('amount'))
 			$amount = intPostVar('amount');
-		else
-			$amount = 10;
+		else {
+			$amount = intval($CONF['DefaultListSize']);
+			if ($amount < 1) 
+				$amount = 10;
+		}
 
 		$search = postVar('search');
 
@@ -974,7 +1036,7 @@
 	 */
 	function action_blogcommentlist($blogid = '')
 	{
-		global $member, $manager;
+		global $member, $manager, $CONF;
 
 		if ($blogid == '')
 			$blogid = intRequestVar('blogid');
@@ -992,8 +1054,11 @@
 		// amount of items to show
 		if (postVar('amount'))
 			$amount = intPostVar('amount');
-		else
-			$amount = 10;
+		else {
+			$amount = intval($CONF['DefaultListSize']);
+			if ($amount < 1) 
+				$amount = 10;
+		}
 
 		$search = postVar('search');		// search through comments
 
@@ -1133,6 +1198,7 @@
 				$wasdraft: set to 1 when the item used to be a draft item
 				$publish: set to 1 when the edited item is not a draft
 		*/
+/*<del by shizuki>
 		switch ($actiontype) {
 			case 'adddraft':
 				$publish = 0;
@@ -1142,7 +1208,7 @@
 			case 'addfuture':
 				$wasdraft = 1;
 				$publish = 1;
-				$timestamp = mktime(postVar('hour'), postVar('minutes'), 0, postVar('month'), postVar('day'), postVar('year'));
+				$timestamp = mktime(intPostVar('hour'), intPostVar('minutes'), 0, intPostVar('month'), intPostVar('day'), intPostVar('year'));
 				break;
 			case 'addnow':
 				$wasdraft = 1;
@@ -1150,20 +1216,41 @@
 				$timestamp = 0;
 				break;
 			case 'changedate':
-				$timestamp = mktime(postVar('hour'), postVar('minutes'), 0, postVar('month'), postVar('day'), postVar('year'));
+				$timestamp = mktime(intPostVar('hour'), intPostVar('minutes'), 0, intPostVar('month'), intPostVar('day'), intPostVar('year'));
 				$publish = 1;
 				$wasdraft = 0;
 				break;
+			case 'backtodrafts':
+				$wasdraft = 0;
+				$publish = 0;
+				$timestamp = 0;
+				break;			
 			case 'edit':
 			default:
 				$publish = 1;
 				$wasdraft = 0;
 				$timestamp = 0;
 		}
+</del by shizuki>*/
+// <add by shizuki>
+		$blogid =  getBlogIDFromItemID($itemid);
+		$blog   =& $manager->getBlog($blogid);
+
+		$wasdrafts = array('adddraft', 'addfuture', 'addnow');
+		$wasdraft  = in_array($actiontype, $wasdrafts) ? 1 : 0;
+		$publish   = ($actiontype != 'adddraft' && $actiontype != 'backtodrafts') ? 1 : 0;
+		if ($actiontype == 'addfuture' || $actiontype == 'changedate') {
+			$timestamp = mktime(intPostVar('hour'), intPostVar('minutes'), 0, intPostVar('month'), intPostVar('day'), intPostVar('year'));
+		} else {
+			$timestamp =0;
+		}
+		$doping = ($publish && $timestamp < $blog->getCorrectTime() && postVar('dosendping')) ? 1 : 0;
+// </add by shizuki>
 
 		// edit the item for real
 		ITEM::update($itemid, $catid, $title, $body, $more, $closed, $wasdraft, $publish, $timestamp);
 
+/* <del by shizuki>
 		$blogid = getBlogIDFromItemID($itemid);
 		$blog =& $manager->getBlog($blogid);
 
@@ -1172,13 +1259,16 @@
 			$isFuture = 1;
 		}
 
+</del by shizuki>*/
 		$this->updateFuturePosted($blogid);
 
-		if ($draftid > 0 && $member->canAlterItem($draftid)) {
+		if ($draftid > 0) {
+			// delete permission is checked inside ITEM::delete()
 			ITEM::delete($draftid);
 		}
 
-		if (!$closed && $publish && $wasdraft && $blog->sendPing() && numberOfEventSubscriber('SendPing') > 0 && !$isFuture) {
+//		if (!$closed && $publish && $wasdraft && $blog->sendPing() && numberOfEventSubscriber('SendPing') > 0 && !$isFuture) {
+		if (!$closed && $doping && $blog->sendPing() && numberOfEventSubscriber('SendPing') > 0) {		//<mod by shizuki />
 			$this->action_sendping($blogid);
 			return;
 		}
@@ -1403,7 +1493,7 @@
 
 		$blogid = getBlogIDFromItemID($result['itemid']);
 		$blog =& $manager->getBlog($blogid);
-
+/* <del by shizuki>
 		$pingUrl = $manager->addTicketToUrl($CONF['AdminURL'] . 'index.php?action=sendping&blogid=' . intval($blogid));
 
 		if ($result['status'] == 'newcategory')
@@ -1416,6 +1506,28 @@
 			$this->action_sendping($blogid);
 		else
 			$this->action_itemlist($blogid);
+</del by shizuki>*/
+// <add by shizuki>
+		$btimestamp = $blog->getCorrectTime();
+		$bPingInfo  = ($blog->sendPing() && numberOfEventSubscriber('SendPing') > 0);
+		$item       = $manager->getItem(intval($result['itemid']), 1, 1);
+		$iPingInfo  = (!$item['draft'] && postVar('dosendping') && $item['timestamp'] <= $btimestamp);
+		if ($iPingInfo && $bPingInfo) {
+			$nextAction = 'sendping';
+		} else {
+			$nextAction = 'itemlist';
+		}
+		if ($result['status'] == 'newcategory') {
+//			$distURI = ($nextAction == 'sendping') ? $manager->addTicketToUrl($CONF['AdminURL'] . 'index.php?action='
+//					 . $nextAction . '&blogid=' . intval($blogid)) : 
+//					   '';
+			$distURI = $manager->addTicketToUrl($CONF['AdminURL'] . 'index.php?action=' . $nextAction . '&blogid=' . intval($blogid));
+			$this->action_categoryedit($result['catid'], $blogid, $distURI);
+		} else {
+			$methodName = 'action_' . $nextAction;
+			call_user_func(array(&$this, $methodName), $blogid);
+		}
+//</add by shizuki>
 	}
 
 	/**
@@ -1436,17 +1548,12 @@
 		$rawPingUrl = $manager->addTicketToUrl('index.php?action=rawping&blogid=' . intval($blogid));
 
 		$this->pagehead('<meta http-equiv="refresh" content="1; url='.htmlspecialchars($rawPingUrl).'" />');
+		echo _UPDATEDPING_MESSAGE;
 		?>
-		<h2>Site Updated, Now pinging various weblog listing services...</h2>
-
-		<p>
-			This can take a while...
+		<a href="index.php?action=rawping&amp;blogid=<?php echo $blogid?>"><?php echo _UPDATEDPING_GOPINGPAGE ?></a>
 		</p>
-
-		<p>
-			If you aren't automatically passed through, <a href="index.php?action=rawping&amp;blogid=<?php echo $blogid?>">try again</a>
-		</p>
-		<?php		$this->pagefoot();
+		<?php
+		$this->pagefoot();
 	}
 
 	/**
@@ -1463,9 +1570,9 @@
 
 		?>
 
-		<h2>Pinging services, please wait...</h2>
+		<h2><?php echo _UPDATEDPING_PINGING ?></h2>
 		<div class='note'>
-                <?
+                <?php
 
 		// send sendPing event
 		$manager->notify('SendPing', array('blogid' => $blogid));
@@ -1474,8 +1581,8 @@
                 </div>
 
 		<ul>
-			<li><a href="index.php?action=itemlist&amp;blogid=<?php echo $blog->getID()?>">View list of recent items for <?php echo htmlspecialchars($blog->getName())?></a></li>
-			<li><a href="<?php echo $blog->getURL()?>">Visit your own site</a></li>
+			<li><a href="index.php?action=itemlist&amp;blogid=<?php echo $blog->getID()?>"><?php echo _UPDATEDPING_VIEWITEM . htmlspecialchars($blog->getName())?></a></li>
+			<li><a href="<?php echo $blog->getURL()?>"><?php echo _UPDATEDPING_VISITOWNSITE ?></a></li>
 		</ul>
 
 		<?php		$this->pagefoot();
@@ -1527,7 +1634,16 @@
 		</tr><tr>
 			<td><?php echo _EDITC_HOST?></td>
 			<td><?php echo  $comment['host']; ?></td>
-		</tr><tr>
+		</tr>
+		<tr>
+			<td><?php echo _EDITC_URL; ?></td>
+			<td><input type="text" name="url" size="30" tabindex="6" value="<?php echo $comment['userid']; ?>" /></td>
+		</tr>
+		<tr>
+			<td><?php echo _EDITC_EMAIL; ?></td>
+			<td><input type="text" name="email" size="30" tabindex="8" value="<?php echo $comment['email']; ?>" /></td>
+		</tr>
+		<tr>
 			<td><?php echo _EDITC_TEXT?></td>
 			<td>
 				<textarea name="body" tabindex="10" rows="10" cols="50"><?php					// htmlspecialchars not needed (things should be escaped already)
@@ -1554,6 +1670,8 @@
 
 		$member->canAlterComment($commentid) or $this->disallow();
 
+		$url = postVar('url');
+		$email = postVar('email');
 		$body = postVar('body');
 
 		// intercept words that are too long
@@ -1573,9 +1691,9 @@
 		// call plugins
 		$manager->notify('PreUpdateComment',array('body' => &$body));
 
-		$query =  'UPDATE '.sql_table('comment')
-			   . " SET cbody='" .addslashes($body). "'"
-			   . " WHERE cnumber=" . $commentid;
+		$query = 'UPDATE ' . sql_table('comment')
+			   . " SET cmail = '" . addslashes($url) . "', cemail = '" . addslashes($email) . "', cbody = '" . addslashes($body) . "'"
+			   . " WHERE cnumber = " . $commentid;
 		sql_query($query);
 
 		// get itemid
@@ -1866,6 +1984,10 @@
 
 			</td>
 		</tr>
+		<tr>
+			<td><?php echo _MEMBERS_USEAUTOSAVE?> <?php help('autosave'); ?></td>
+			<td><?php $this->input_yesno('autosave', $mem->getAutosave(), 87); ?></td>
+		</tr>
 		<?php
 			// plugin options
 			$this->_insertPluginOptions('member',$memberid);
@@ -1978,6 +2100,8 @@
 			$mem->setCanLogin($canlogin);
 		}
 
+		$autosave = postVar ('autosave'); 
+		$mem->setAutosave($autosave);
 
 		$mem->write();
 
@@ -2350,7 +2474,7 @@
 		//           - (there remains at least one team member)
 		$tmem = MEMBER::createFromID($memberid);
 
-		$manager->notify('PreDeleteTeamMember', array('member' => &$mem, 'blogid' => $blogid));
+		$manager->notify('PreDeleteTeamMember', array('member' => &$tmem, 'blogid' => $blogid));
 
 		if ($tmem->isBlogAdmin($blogid)) {
 			// check if there are more blog members left and at least one admin
@@ -2364,7 +2488,7 @@
 		$query = 'DELETE FROM '.sql_table('team')." WHERE tblog=$blogid and tmember=$memberid";
 		sql_query($query);
 
-		$manager->notify('PostDeleteTeamMember', array('member' => &$mem, 'blogid' => $blogid));
+		$manager->notify('PostDeleteTeamMember', array('member' => &$tmem, 'blogid' => $blogid));
 
 		return '';
 	}
@@ -2427,7 +2551,7 @@
 
 		<h3><?php echo _EBLOG_TEAM_TITLE?></h3>
 
-		<p>Members currently on your team:
+		<p><?php echo _EBLOG_CURRENT_TEAM_MEMBER; ?>
 		<?php
 			$res = sql_query('SELECT mname, mrealname FROM ' . sql_table('member') . ',' . sql_table('team') . ' WHERE mnumber=tmember AND tblog=' . intval($blogid));
 			$aMemberNames = array();
@@ -2518,13 +2642,13 @@
 				/><label for="notifyNewItem"><?php echo _EBLOG_NOTIFY_ITEM?></label>
 			</td>
 		</tr><tr>
-		<? 
+		<?php
 		if (numberOfEventSubscriber('SendPing') > 0) {
 		?>
 			<td><?php echo _EBLOG_PING?> <?php help('sendping'); ?></td>
 			<td><?php $this->input_yesno('sendping',$blog->sendPing(),85); ?></td>
 		</tr><tr>
-		<?
+		<?php
 		}
 		?>
 			<td><?php echo _EBLOG_MAXCOMMENTS?> <?php help('blogmaxcomments'); ?></td>
@@ -3110,7 +3234,7 @@
 			</p>
 
 			<p>
-			Please note that media files will <b>NOT</b> be deleted. (At least not in this Nucleus version)
+			<?php echo _WARNINGTXT_NOTDELMEDIAFILES ?>
 			</p>
 
 			<form method="post" action="index.php"><div>
@@ -3159,9 +3283,11 @@
 		$manager->notify('PreDeleteMember', array('member' => &$mem));
 
 		/* unlink comments from memberid */
-		$query = 'UPDATE ' . sql_table('comment') . ' SET cmember="0", cuser="'. addslashes($mem->getDisplayName())
-					.'" WHERE cmember='.$memberid;
-		sql_query($query);
+		if ($memberid) {
+			$query = 'UPDATE ' . sql_table('comment') . ' SET cmember="0", cuser="'. addslashes($mem->getDisplayName())
+						.'" WHERE cmember='.$memberid;
+			sql_query($query);
+		}
 
 		$query = 'DELETE FROM '.sql_table('member').' WHERE mnumber='.$memberid;
 		sql_query($query);
@@ -3195,18 +3321,18 @@
 		?>
 		<h2><?php echo _EBLOG_CREATE_TITLE?></h2>
 
-		<h3>Some information</h3>
+		<h3><?php echo _ADMIN_NOTABILIA ?></h3>
 
-		<p>Before you start, here's some <strong>important information</strong></p>
+		<p><?php echo _ADMIN_PLEASE_READ ?></p>
 
-		<p>After you've created a new weblog, you'll need to perform some actions to make your blog accessible. There are two possibilities:</p>
+		<p><?php echo _ADMIN_HOW_TO_ACCESS ?></p>
 
 		<ol>
-			<li><strong>Simple:</strong> Create a copy of <code>index.php</code> and modify it to display your new weblog. Further instructions on how to do this will be provided after you've submitted this first form.</li>
-			<li><strong>Advanced:</strong> Insert the blog content into your current skins using skinvars like <code>otherblog</code>. This way, you can place multiple blogs on the same page.</li>
+			<li><?php echo _ADMIN_SIMPLE_WAY ?></li>
+			<li><?php echo _ADMIN_ADVANCED_WAY ?></li>
 		</ol>
 
-		<h3>Create Weblog</h3>
+		<h3><?php echo _ADMIN_HOW_TO_CREATE ?></h3>
 
 		<p>
 		<?php echo _EBLOG_CREATE_TEXT?>
@@ -3291,7 +3417,7 @@
 				'name' => &$bname,
 				'shortname' => &$bshortname,
 				'timeoffset' => &$btimeoffset,
-				'description' => &$bdescription,
+				'description' => &$bdesc,
 				'defaultskin' => &$bdefskin
 			)
 		);
@@ -3311,7 +3437,7 @@
 		$blog	=& $manager->getBlog($blogid);
 
 		// create new category
-		sql_query('INSERT INTO '.sql_table('category')." (cblog, cname, cdesc) VALUES ($blogid, 'General','Items that do not fit in other categories')");
+		sql_query('INSERT INTO '.sql_table('category')." (cblog, cname, cdesc) VALUES ($blogid, _EBLOGDEFAULTCATEGORY_NAME, _EBLOGDEFAULTCATEGORY_DESC)");
 		$catid = mysql_insert_id();
 
 		// set as default category
@@ -3324,7 +3450,7 @@
 		sql_query($query);
 
 
-		$blog->additem($blog->getDefaultCategory(),'First Item','This is the first item in your weblog. Feel free to delete it.','',$blogid, $memberid,$blog->getCorrectTime(),0,0,0);
+		$blog->additem($blog->getDefaultCategory(),_EBLOG_FIRSTITEM_TITLE,_EBLOG_FIRSTITEM_BODY,'',$blogid, $memberid,$blog->getCorrectTime(),0,0,0);
 
 		$manager->notify(
 			'PostAddBlog',
@@ -3337,26 +3463,26 @@
 			'PostAddCategory',
 			array(
 				'blog' => &$blog,
-				'name' => 'General',
-				'description' => 'Items that do not fit in other categories',
+				'name' => _EBLOGDEFAULTCATEGORY_NAME,
+				'description' => _EBLOGDEFAULTCATEGORY_DESC,
 				'catid' => $catid
 			)
 		);
 
 		$this->pagehead();
 		?>
-		<h2>New weblog created</h2>
+		<h2><?php echo _BLOGCREATED_TITLE ?></h2>
 
-		<p>Your new weblog (<?php echo htmlspecialchars($bname)?>) has been created. To continue, choose the way you'll want to make it viewable:</p>
+		<p><?php echo sprintf(_BLOGCREATED_ADDEDTXT, htmlspecialchars($bname)) ?></p>
 
 		<ol>
-			<li><a href="#index_php">Easiest: A copy of <code><?php echo htmlspecialchars($bshortname)?>.php</code></a></li>
-			<li><a href="#skins">Advanced: Call the weblog from existing skins</a></li>
+			<li><a href="#index_php"><?php sprintf(_BLOGCREATED_SIMPLEWAY, htmlspecialchars($bshortname)) ?></code></a></li>
+			<li><a href="#skins"><?php _BLOGCREATED_ADVANCEDWAY ?></a></li>
 		</ol>
 
-		<h3><a id="index_php">Method 1: Create an extra <code><?php echo htmlspecialchars($bshortname)?>.php</code> file</a></h3>
+		<h3><a id="index_php"><?php sprintf(_BLOGCREATED_SIMPLEDESC1, htmlspecialchars($bshortname)) ?></a></h3>
 
-		<p>Create a file called <code><?php echo htmlspecialchars($bshortname)?>.php</code>, and copy-paste the following code into it:</p>
+		<p><?php sprintf(_BLOGCREATED_SIMPLEDESC2, htmlspecialchars($bshortname)) ?></p>
 <pre><code>&lt;?php
 
 $CONF['Self'] = '<b><?php echo htmlspecialchars($bshortname)?>.php</b>';
@@ -3368,9 +3494,9 @@
 
 ?&gt;</code></pre>
 
-		<p>Upload the file next to your existing <code>index.php</code> file, and you should be all set.</p>
+		<p><?php echo _BLOGCREATED_SIMPLEDESC3 ?></p>
 
-		<p>To finish the weblog creation process, please fill out the final URL for your weblog (the proposed value is a <em>guess</em>, don't take it for granted):</p>
+		<p><?php echo _BLOGCREATED_SIMPLEDESC4 ?></p>
 
 		<form action="index.php" method="post"><div>
 			<input type="hidden" name="action" value="addnewlog2" />
@@ -3385,9 +3511,9 @@
 			</tr></table>
 		</div></form>
 
-		<h3><a id="skins">Method 2: Call the weblog from existing skins</a></h3>
+		<h3><a id="skins"><?php echo _BLOGCREATED_ADVANCEDWAY2 ?></a></h3>
 
-		<p>To finish the weblog creation process, simply please fill out the final URL for your weblog: (might be the same as another already existing weblog)</p>
+		<p><?php echo _BLOGCREATED_ADVANCEDWAY3 ?></p>
 
 		<form action="index.php" method="post"><div>
 			<input type="hidden" name="action" value="addnewlog2" />
@@ -3840,36 +3966,51 @@
 ?>
 		</tr><tr>
 			<th colspan="2"><?php echo _TEMPLATE_CATEGORYLIST?> <?php help('templatecategorylists'); ?></th>
-<?php	$this->_templateEditRow($template, _TEMPLATE_CATHEADER, 'CATLIST_HEADER', '', 160);
-	$this->_templateEditRow($template, _TEMPLATE_CATITEM, 'CATLIST_LISTITEM', '', 170);
-	$this->_templateEditRow($template, _TEMPLATE_CATFOOTER, 'CATLIST_FOOTER', '', 180);
+<?php	$this->_templateEditRow($template, _TEMPLATE_CATHEADER, 'CATLIST_HEADER', '', 190);
+	$this->_templateEditRow($template, _TEMPLATE_CATITEM, 'CATLIST_LISTITEM', '', 200);
+	$this->_templateEditRow($template, _TEMPLATE_CATFOOTER, 'CATLIST_FOOTER', '', 210);
 ?>
 		</tr><tr>
 			<th colspan="2"><?php echo _TEMPLATE_DATETIME?></th>
-<?php	$this->_templateEditRow($template, _TEMPLATE_DHEADER, 'DATE_HEADER', 'dateheads', 190);
-	$this->_templateEditRow($template, _TEMPLATE_DFOOTER, 'DATE_FOOTER', 'dateheads', 200);
-	$this->_templateEditRow($template, _TEMPLATE_DFORMAT, 'FORMAT_DATE', 'datetime', 210);
-	$this->_templateEditRow($template, _TEMPLATE_TFORMAT, 'FORMAT_TIME', 'datetime', 220);
-	$this->_templateEditRow($template, _TEMPLATE_LOCALE, 'LOCALE', 'locale', 230);
+<?php	$this->_templateEditRow($template, _TEMPLATE_DHEADER, 'DATE_HEADER', 'dateheads', 220);
+	$this->_templateEditRow($template, _TEMPLATE_DFOOTER, 'DATE_FOOTER', 'dateheads', 230);
+	$this->_templateEditRow($template, _TEMPLATE_DFORMAT, 'FORMAT_DATE', 'datetime', 240);
+	$this->_templateEditRow($template, _TEMPLATE_TFORMAT, 'FORMAT_TIME', 'datetime', 250);
+	$this->_templateEditRow($template, _TEMPLATE_LOCALE, 'LOCALE', 'locale', 260);
 ?>
 		</tr><tr>
 			<th colspan="2"><?php echo _TEMPLATE_IMAGE?> <?php help('templatepopups'); ?></th>
-<?php	$this->_templateEditRow($template, _TEMPLATE_PCODE, 'POPUP_CODE', '', 240);
-	$this->_templateEditRow($template, _TEMPLATE_ICODE, 'IMAGE_CODE', '', 250);
-	$this->_templateEditRow($template, _TEMPLATE_MCODE, 'MEDIA_CODE', '', 260);
+<?php	$this->_templateEditRow($template, _TEMPLATE_PCODE, 'POPUP_CODE', '', 270);
+	$this->_templateEditRow($template, _TEMPLATE_ICODE, 'IMAGE_CODE', '', 280);
+	$this->_templateEditRow($template, _TEMPLATE_MCODE, 'MEDIA_CODE', '', 290);
 ?>
 		</tr><tr>
 			<th colspan="2"><?php echo _TEMPLATE_SEARCH?></th>
-<?php	$this->_templateEditRow($template, _TEMPLATE_SHIGHLIGHT, 'SEARCH_HIGHLIGHT', 'highlight',270);
-	$this->_templateEditRow($template, _TEMPLATE_SNOTFOUND, 'SEARCH_NOTHINGFOUND', 'nothingfound',280);
+<?php	$this->_templateEditRow($template, _TEMPLATE_SHIGHLIGHT, 'SEARCH_HIGHLIGHT', 'highlight',300);
+	$this->_templateEditRow($template, _TEMPLATE_SNOTFOUND, 'SEARCH_NOTHINGFOUND', 'nothingfound',310);
 ?>
 		</tr><tr>
+			<th colspan="2"><?php echo _TEMPLATE_PLUGIN_FIELDS?></th>
+<?php
+		$tab = 600;
+		$pluginfields = array();
+		$manager->notify('TemplateExtraFields',array('fields'=>&$pluginfields));
+
+		foreach ($pluginfields as $pfkey=>$pfvalue) {
+			echo "</tr><tr>\n";
+			echo '<th colspan="2">'.htmlentities($pfkey)."</th>\n";
+			foreach ($pfvalue as $pffield=>$pfdesc) {
+				$this->_templateEditRow($template, $pfdesc, $pffield, '',++$tab,0);
+			}
+		}
+?>			
+		</tr><tr>
 			<th colspan="2"><?php echo _TEMPLATE_UPDATE?></th>
 		</tr><tr>
 			<td><?php echo _TEMPLATE_UPDATE?></td>
 			<td>
-				<input type="submit" tabindex="290" value="<?php echo _TEMPLATE_UPDATE_BTN?>" onclick="return checkSubmit();" />
-				<input type="reset" tabindex="300" value="<?php echo _TEMPLATE_RESET_BTN?>" />
+				<input type="submit" tabindex="800" value="<?php echo _TEMPLATE_UPDATE_BTN?>" onclick="return checkSubmit();" />
+				<input type="reset" tabindex="810" value="<?php echo _TEMPLATE_RESET_BTN?>" />
 			</td>
 		</tr></table>
 
@@ -3895,7 +4036,7 @@
 	 * @todo document this
 	 */
 	function action_templateupdate() {
-		global $member;
+		global $member,$manager;
 
 		$templateid = intRequestVar('templateid');
 
@@ -3961,6 +4102,13 @@
 		$this->addToTemplate($templateid, 'MEDIA_CODE', postVar('MEDIA_CODE'));
 		$this->addToTemplate($templateid, 'IMAGE_CODE', postVar('IMAGE_CODE'));
 
+		$pluginfields = array();
+		$manager->notify('TemplateExtraFields',array('fields'=>&$pluginfields));
+		foreach ($pluginfields as $pfkey=>$pfvalue) {
+			foreach ($pfvalue as $pffield=>$pfdesc) {
+				$this->addToTemplate($templateid, $pffield, postVar($pffield));
+			}
+		}
 
 		// jump back to template edit
 		$this->action_templateedit(_TEMPLATE_UPDATED);
@@ -3981,7 +4129,7 @@
 
 		$query = 'INSERT INTO '.sql_table('template')." (tdesc, tpartname, tcontent) "
 			   . "VALUES ($id, '$partname', '$content')";
-		sql_query($query) or die("Query error: " . mysql_error());
+		sql_query($query) or exit(_ADMIN_SQLDIE_QUERYERROR . mysql_error());
 		return mysql_insert_id();
 	}
 
@@ -4368,25 +4516,14 @@
 				echo helplink('skinvar-' . $current) . "$current</a>";
 				if (count($actions) != 0) echo ", ";
 			}
-		?>
-		<br /><br />
-		Short blog names:
-		<?php			$query = 'SELECT bshortname, bname FROM '.sql_table('blog');
-			showlist($query,'table',array('content'=>'shortblognames'));
-		?>
-
-		<br />
-		Template names:
-		<?php			$query = 'SELECT tdname as name, tddesc as description FROM '.sql_table('template_desc');
-			showlist($query,'table',array('content'=>'shortnames'));
-		?>
-
-
-		</div>
-		</form>
-
-
-		<?php		$this->pagefoot();
+		echo '<br /><br />' . _SKINEDIT_ALLOWEDBLOGS;
+		$query = 'SELECT bshortname, bname FROM '.sql_table('blog');
+		showlist($query,'table',array('content'=>'shortblognames'));
+		echo '<br />' . _SKINEDIT_ALLOWEDTEMPLATESS;
+		$query = 'SELECT tdname as name, tddesc as description FROM '.sql_table('template_desc');
+		showlist($query,'table',array('content'=>'shortnames'));
+		echo '</div></form>';
+		$this->pagefoot();
 	}
 
 	/**
@@ -4721,7 +4858,7 @@
 			</td>
 			<td><?php $this->input_yesno('DisableSite',$CONF['DisableSite'],10060); ?>
 					<br />
-				URL: <input name="DisableSiteURL" tabindex="10070" size="40" value="<?php echo  htmlspecialchars($CONF['DisableSiteURL'])?>" />
+				<?php echo _SETTINGS_DISABLESITEURL ?> <input name="DisableSiteURL" tabindex="10070" size="40" value="<?php echo  htmlspecialchars($CONF['DisableSiteURL'])?>" />
 			</td>
 		</tr><tr>
 			<td><?php echo _SETTINGS_DIRS?></td>
@@ -4770,6 +4907,26 @@
 
 					   </td>
 		</tr><tr>
+			<td><?php echo _SETTINGS_DEBUGVARS?> <?php help('debugvars');?></td>
+					   <td><?php
+
+						$this->input_yesno('DebugVars',$CONF['DebugVars'],10078);
+						
+							 ?>
+
+					   </td>
+		</tr><tr>
+			<td><?php echo _SETTINGS_DEFAULTLISTSIZE?> <?php help('defaultlistsize');?></td>
+			<td>
+			<?php 
+				if (!array_key_exists('DefaultListSize',$CONF)) {
+					sql_query("INSERT INTO ".sql_table('config')." VALUES ('DefaultListSize', '10')");
+					$CONF['DefaultListSize'] = 10;
+				}
+			?>
+				<input name="DefaultListSize" tabindex="10079" size="40" value="<?php echo  htmlspecialchars((intval($CONF['DefaultListSize']) < 1 ? '10' : $CONF['DefaultListSize'])) ?>" />
+			</td>
+		</tr><tr>
 			<th colspan="2"><?php echo _SETTINGS_MEDIA?> <?php help('media'); ?></th>
 		</tr><tr>
 			<td><?php echo _SETTINGS_MEDIADIR?></td>
@@ -4934,6 +5091,8 @@
 		$this->updateConfig('CookieSecure',		postVar('CookieSecure'));
 		$this->updateConfig('URLMode',			postVar('URLMode'));
 		$this->updateConfig('CookiePrefix',		postVar('CookiePrefix'));
+		$this->updateConfig('DebugVars',			postVar('DebugVars'));
+		$this->updateConfig('DefaultListSize',			postVar('DefaultListSize'));
 
 		// load new config and redirect (this way, the new language will be used is necessary)
 		// note that when changing cookie settings, this redirect might cause the user
@@ -4943,6 +5102,143 @@
 		exit;
 
 	}
+	
+	/**
+	 *  Give an overview over the used system
+	 */	
+	function action_systemoverview() {
+		global $member, $nucleus, $CONF;
+
+		$this->pagehead();
+
+		echo '<h2>' . _ADMIN_SYSTEMOVERVIEW_HEADING . "</h2>\n";
+
+		if ($member->isLoggedIn() && $member->isAdmin()) {
+
+			// Information about the used PHP and MySQL installation
+			echo '<h3>' . _ADMIN_SYSTEMOVERVIEW_PHPANDMYSQL . "</h3>\n";
+
+			// Version of PHP MySQL
+			echo "<table>\n";
+			echo "\t<tr>\n";
+			echo "\t\t" . '<th colspan="2">' . _ADMIN_SYSTEMOVERVIEW_VERSIONS . "</th>\n";
+			echo "\t</tr><tr>\n";
+			echo "\t\t" . '<td width="50%">' . _ADMIN_SYSTEMOVERVIEW_PHPVERSION . "</td>\n";
+			echo "\t\t" . '<td>' . phpversion() . "</td>\n";
+			echo "\t</tr><tr>\n";
+			echo "\t\t" . '<td>' . _ADMIN_SYSTEMOVERVIEW_MYSQLVERSION . "</td>\n";
+			echo "\t\t" . '<td>' . mysql_get_server_info() . ' (' . mysql_get_client_info() . ')' . "</td>\n";
+			echo "\t</tr>";
+			echo "</table>\n";
+
+			// Important PHP settings
+			echo "<table>\n";
+			echo "\t<tr>\n";
+			echo "\t\t" . '<th colspan="2">' . _ADMIN_SYSTEMOVERVIEW_SETTINGS . "</th>\n";
+			echo "\t</tr><tr>\n";
+			echo "\t\t" . '<td width="50%">magic_quotes_gpc' . "</td>\n";
+			$mqg = get_magic_quotes_gpc() ? 'On' : 'Off';
+			echo "\t\t" . '<td>' . $mqg . "</td>\n";
+			echo "\t</tr><tr>\n";
+			echo "\t\t" . '<td>magic_quotes_runtime' . "</td>\n";
+			$mqr = get_magic_quotes_runtime() ? 'On' : 'Off';
+			echo "\t\t" . '<td>' . $mqr . "</td>\n";
+			echo "\t</tr><tr>\n";
+			echo "\t\t" . '<td>magic_quotes_runtime' . "</td>\n";
+			$rg = ini_get('register_globals') ? 'On' : 'Off';
+			echo "\t\t" . '<td>' . $rg . "</td>\n";
+			echo "\t</tr>";
+			echo "</table>\n";
+
+			// Information about GD library
+			$gdinfo = gd_info();
+			echo "<table>\n";
+			echo "\t<tr>";
+			echo "\t\t" . '<th colspan="2">' . _ADMIN_SYSTEMOVERVIEW_GDLIBRALY . "</th>\n";
+			echo "\t</tr>\n";
+			foreach ($gdinfo as $key=>$value) {
+				if (is_bool($value)) {
+					$value = $value ? _ADMIN_SYSTEMOVERVIEW_ENABLE : _ADMIN_SYSTEMOVERVIEW_DISABLE;
+				} else {
+					$value = htmlspecialchars($value, ENT_QUOTES);
+				}
+				echo "\t<tr>";
+				echo "\t\t" . '<td width="50%">' . $key . "</td>\n";
+				echo "\t\t" . '<td>' . $value . "</td>\n";
+				echo "\t</tr>\n";
+			}
+			echo "</table>\n";
+
+			// Check if special modules are loaded
+			ob_start();
+			phpinfo(INFO_MODULES);
+			$im = ob_get_contents();
+			ob_clean();
+			echo "<table>\n";
+			echo "\t<tr>";
+			echo "\t\t" . '<th colspan="2">' . _ADMIN_SYSTEMOVERVIEW_MODULES . "</th>\n";
+			echo "\t</tr><tr>\n";
+			echo "\t\t" . '<td width="50%">mod_rewrite' . "</td>\n";
+			$modrewrite = (strstr($im, 'mod_rewrite') != '') ? 
+						_ADMIN_SYSTEMOVERVIEW_ENABLE :
+						_ADMIN_SYSTEMOVERVIEW_DISABLE;
+			echo "\t\t" . '<td>' . $modrewrite . "</td>\n";
+			echo "\t</tr>\n";
+			echo "</table>\n";
+
+			// Information about the used Nucleus CMS 
+			echo '<h3>' . _ADMIN_SYSTEMOVERVIEW_NUCLEUSSYSTEM . "</h3>\n";
+			global $nucleus;
+			$nv = getNucleusVersion() / 100 . '(' . $nucleus['version'] . ')';
+			$np = getNucleusPatchLevel();
+			echo "<table>\n";
+			echo "\t<tr>";
+			echo "\t\t" . '<th colspan="2">Nucleus CMS' . "</th>\n";
+			echo "\t</tr><tr>\n";
+			echo "\t\t" . '<td width="50%">' . _ADMIN_SYSTEMOVERVIEW_NUCLEUSVERSION . "</td>\n";
+			echo "\t\t" . '<td>' . $nv . "</td>\n";
+			echo "\t</tr><tr>\n";
+			echo "\t\t" . '<td width="50%">' . _ADMIN_SYSTEMOVERVIEW_NUCLEUSPATCHLEVEL . "</td>\n";
+			echo "\t\t" . '<td>' . $np . "</td>\n";
+			echo "\t</tr>\n";
+			echo "</table>\n";
+
+			// Important settings of the installation
+			echo "<table>\n";
+			echo "\t<tr>";
+			echo "\t\t" . '<th colspan="2">' . _ADMIN_SYSTEMOVERVIEW_NUCLEUSSETTINGS . "</th>\n";
+			echo "\t</tr><tr>\n";
+			echo "\t\t" . '<td width="50%">' . '$CONF[' . "'Self']</td>\n";
+			echo "\t\t" . '<td>' . $CONF['Self'] . "</td>\n";
+			echo "\t</tr><tr>\n";
+			echo "\t\t" . '<td width="50%">' . '$CONF[' . "'alertOnHeadersSent']</td>\n";
+			$ohs = $CONF['alertOnHeadersSent'] ?
+						_ADMIN_SYSTEMOVERVIEW_ENABLE :
+						_ADMIN_SYSTEMOVERVIEW_DISABLE;
+			echo "\t\t" . '<td>' . $ohs . "</td>\n";
+			echo "\t</tr>\n";
+			echo "</table>\n";
+
+			// Link to the online version test at the Nucleus CMS website
+			echo '<h3>' . _ADMIN_SYSTEMOVERVIEW_VERSIONCHECK . "</h3>\n";
+			if ($nucleus['codename'] != '') {
+				$codenamestring = ' &quot;' . $nucleus['codename'] . '&quot;';
+			} else {
+				$codenamestring = '';
+			}
+			echo _ADMIN_SYSTEMOVERVIEW_VERSIONCHECK_TXT;
+			$checkURL = sprintf(_ADMIN_SYSTEMOVERVIEW_VERSIONCHECK_URL, getNucleusVersion(), getNucleusPatchLevel());
+			echo '<a href="' . $checkURL . '" title="' . _ADMIN_SYSTEMOVERVIEW_VERSIONCHECK_TITLE . '">';
+			echo 'Nucleus CMS ' . $nv . $codenamestring;
+			echo '</a>';
+		//echo '<br />';
+		}
+		else {
+			echo _ADMIN_SYSTEMOVERVIEW_NOT_ADMIN;
+		}
+		
+		$this->pagefoot();
+	}
 
 	/**
 	 * @todo document this
@@ -5001,8 +5297,9 @@
 
 		?>
 		<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-		<html xmlns="http://www.w3.org/1999/xhtml">
+		<html <?php echo _HTML_XML_NAME_SPACE_AND_LANG_CODE; ?>>
 		<head>
+			<meta http-equiv="Content-Type" content="text/html; charset=<?php echo _CHARSET ?>" />
 			<title><?php echo htmlspecialchars($CONF['SiteName'])?> - Admin</title>
 			<link rel="stylesheet" title="Nucleus Admin Default" type="text/css" href="<?php echo $baseUrl?>styles/admin.css" />
 			<link rel="stylesheet" title="Nucleus Admin Default" type="text/css"
@@ -5069,9 +5366,9 @@
 			<?php		}
 		?>
 			<div class="foot">
-				<a href="http://nucleuscms.org/">Nucleus CMS</a> &copy; 2002-<?php echo date('Y'); ?> The Nucleus Group
+				<a href="<?php echo _ADMINPAGEFOOT_OFFICIALURL ?>">Nucleus CMS</a> &copy; 2002-<?php echo date('Y') . ' ' . _ADMINPAGEFOOT_COPYRIGHT; ?>
 				-
-				<a href="http://nucleuscms.org/donate.php">Donate!</a>
+				<a href="<?php echo _ADMINPAGEFOOT_DONATEURL ?>"><?php echo _ADMINPAGEFOOT_DONATE ?></a>
 			</div>
 
 			</div><!-- content -->
@@ -5113,9 +5410,9 @@
 
 					echo '<h2>' . $member->getDisplayName(). '</h2>';
 					echo '<ul>';
-					echo '<li><a href="index.php?action=editmembersettings">',_QMENU_USER_SETTINGS,'</a></li>';
-					echo '<li><a href="index.php?action=browseownitems">',_QMENU_USER_ITEMS,'</a></li>';
-					echo '<li><a href="index.php?action=browseowncomments">',_QMENU_USER_COMMENTS,'</a></li>';
+					echo '<li><a href="index.php?action=editmembersettings">' . _QMENU_USER_SETTINGS . '</a></li>';
+					echo '<li><a href="index.php?action=browseownitems">' . _QMENU_USER_ITEMS . '</a></li>';
+					echo '<li><a href="index.php?action=browseowncomments">' . _QMENU_USER_COMMENTS . '</a></li>';
 					echo '</ul>';
 
 
@@ -5127,19 +5424,20 @@
 						echo '<h2>',_QMENU_MANAGE,'</h2>';
 
 						echo '<ul>';
-						echo '<li><a href="index.php?action=actionlog">',_QMENU_MANAGE_LOG,'</a></li>';
-						echo '<li><a href="index.php?action=settingsedit">',_QMENU_MANAGE_SETTINGS,'</a></li>';
-						echo '<li><a href="index.php?action=usermanagement">',_QMENU_MANAGE_MEMBERS,'</a></li>';
-						echo '<li><a href="index.php?action=createnewlog">',_QMENU_MANAGE_NEWBLOG,'</a></li>';
-						echo '<li><a href="index.php?action=backupoverview">',_QMENU_MANAGE_BACKUPS,'</a></li>';
-						echo '<li><a href="index.php?action=pluginlist">',_QMENU_MANAGE_PLUGINS,'</a></li>';
+						echo '<li><a href="index.php?action=actionlog">' . _QMENU_MANAGE_LOG . '</a></li>';
+						echo '<li><a href="index.php?action=settingsedit">' . _QMENU_MANAGE_SETTINGS . '</a></li>';
+						echo '<li><a href="index.php?action=systemoverview">' . _QMENU_MANAGE_SYSTEM . '</a></li>';
+						echo '<li><a href="index.php?action=usermanagement">' . _QMENU_MANAGE_MEMBERS . '</a></li>';
+						echo '<li><a href="index.php?action=createnewlog">' . _QMENU_MANAGE_NEWBLOG . '</a></li>';
+						echo '<li><a href="index.php?action=backupoverview">' . _QMENU_MANAGE_BACKUPS . '</a></li>';
+						echo '<li><a href="index.php?action=pluginlist">' . _QMENU_MANAGE_PLUGINS . '</a></li>';
 						echo '</ul>';
 
 						echo '<h2>',_QMENU_LAYOUT,'</h2>';
 						echo '<ul>';
-						echo '<li><a href="index.php?action=skinoverview">',_QMENU_LAYOUT_SKINS,'</a></li>';
-						echo '<li><a href="index.php?action=templateoverview">',_QMENU_LAYOUT_TEMPL,'</a></li>';
-						echo '<li><a href="index.php?action=skinieoverview">',_QMENU_LAYOUT_IEXPORT,'</a></li>';
+						echo '<li><a href="index.php?action=skinoverview">' . _QMENU_LAYOUT_SKINS . '</a></li>';
+						echo '<li><a href="index.php?action=templateoverview">' . _QMENU_LAYOUT_TEMPL . '</a></li>';
+						echo '<li><a href="index.php?action=skinieoverview">' . _QMENU_LAYOUT_IEXPORT . '</a></li>';
 						echo '</ul>';
 
 					}
@@ -5193,13 +5491,15 @@
 		// header-code stolen from phpMyAdmin
 		// REGEDIT and bookmarklet code stolen from GreyMatter
 
+		$sjisBlogName = sprintf(_WINREGFILE_TEXT, getBlogNameFromID($blogid));
+
 		header('Content-Type: application/octetstream');
 		header('Content-Disposition: filename="nucleus.reg"');
 		header('Pragma: no-cache');
 		header('Expires: 0');
 
 		echo "REGEDIT4\n";
-		echo "[HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\MenuExt\\Post To &Nucleus (".getBlogNameFromID($blogid).")]\n";
+		echo "[HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\MenuExt\\" . $sjisBlogName . "]\n";
 		echo '@="' . $CONF['AdminURL'] . "bookmarklet.php?action=contextmenucode&blogid=".intval($blogid)."\"\n";
 		echo '"contexts"=hex:31';
 	}
@@ -5223,48 +5523,48 @@
 
 		?>
 
-		<h2>Bookmarklet<!-- and Right Click Menu --></h2>
+		<h2><?php echo _BOOKMARKLET_TITLE ?></h2>
 
 		<p>
-		Bookmarklets allow adding items to your weblog with just one single click. After installing these bookmarklets, you'll be able to click the 'add to weblog' button on your browser toolbar, and a Nucleus add-item window will popup, containing the link and title of the page you were visiting, plus any text you might have selected.
+		<?php echo _BOOKMARKLET_DESC1 . _BOOKMARKLET_DESC2 . _BOOKMARKLET_DESC3 . _BOOKMARKLET_DESC4 . _BOOKMARKLET_DESC5 ?>
 		</p>
 
-		<h3>Bookmarklet</h3>
+		<h3><?php echo _BOOKMARKLET_BOOKARKLET ?></h3>
 		<p>
-			You can drag the following link to your favorites, or your browsers toolbar: <small>(if you want to test the bookmarklet first, click the link)</small>
+			<?php echo _BOOKMARKLET_BMARKTEXT ?><small><?php echo _BOOKMARKLET_BMARKTEST ?></small>
 			<br />
 			<br />
-			<a href="<?php echo htmlspecialchars($bm)?>">Add to <?php echo $blog->getShortName()?></a> (Nearly all browsers)
+			<?php echo '<a href="' . htmlspecialchars($bm, ENT_QUOTES) . '">' . sprintf(_BOOKMARKLET_ANCHOR, htmlspecialchars($blog->getName(), ENT_QUOTES)) . '</a>' . _BOOKMARKLET_BMARKFOLLOW; ?>
 		</p>
 
-		<h3>Right Click Menu Access (IE &amp; Windows)</h3>
+		<h3><?php echo _BOOKMARKLET_RIGHTCLICK ?></h3>
 		<p>
 			<?php
 				$url = 'index.php?action=regfile&blogid=' . intval($blogid);
 				$url = $manager->addTicketToUrl($url);
 			?>
-			Or you can install the <a href="<?php echo htmlspecialchars($url) ?>">right click menu item</a> (choose 'open file' and add to registry)
+			<?php echo _BOOKMARKLET_RIGHTTEXT1 . '<a href="' . htmlspecialchars($url, ENT_QUOTES, "SJIS") . '">' . _BOOKMARKLET_RIGHTLABEL . '</a>' . _BOOKMARKLET_RIGHTTEXT2; ?>
 		</p>
 
 		<p>
-			You'll have to restart Internet Explorer before the option shows up in the context menus.
+			<?php echo _BOOKMARKLET_RIGHTTEXT3 ?>
 		</p>
 
-		<h3>Uninstalling</h3>
+		<h3><?php echo _BOOKMARKLET_UNINSTALLTT ?></h3>
 		<p>
-			For the bookmarklet, you can just delete it.
+			<?php echo _BOOKMARKLET_DELETEBAR ?>
 		</p>
 
 		<p>
-			For the right click menu item, follow the procedure listed below:
+			<?php echo _BOOKMARKLET_DELETERIGHTT ?>
 		</p>
 
 		<ol>
-			<li>Select "Run..." from the Start Menu</li>
-			<li>Type: "regedit"</li>
-			<li>Click the "OK" button</li>
-			<li>Search for "\HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt" in the tree</li>
-			<li>Delete the "add to weblog" item</li>
+			<li><?php echo _BOOKMARKLET_DELETERIGHT1 ?></li>
+			<li><?php echo _BOOKMARKLET_DELETERIGHT2 ?></li>
+			<li><?php echo _BOOKMARKLET_DELETERIGHT3 ?></li>
+			<li><?php echo _BOOKMARKLET_DELETERIGHT4 ?></li>
+			<li><?php echo _BOOKMARKLET_DELETERIGHT5 ?></li>
 		</ol>
 
 		<?php
@@ -5345,6 +5645,7 @@
 		$member->blogAdminRights($blogid) or $this->disallow();
 
 		$blog =& $manager->getBlog($blogid);
+		$banBlogName =  htmlspecialchars($blog->getName(), ENT_QUOTES);
 
 		$this->pagehead();
 		?>
@@ -5363,7 +5664,8 @@
 
 			<div>
 				<input type="hidden" name="blogid" value="<?php echo $blogid?>" />
-				<input name="allblogs" type="radio" value="0" id="allblogs_one" /><label for="allblogs_one">Only blog '<?php echo htmlspecialchars($blog->getName())?>'</label>
+				<input name="allblogs" type="radio" value="0" id="allblogs_one" />
+				<label for="allblogs_one"><?php echo sprintf(_BAN_BANBLOGNAME, $banBlogName) ?></label>
 				<br />
 				<input name="allblogs" type="radio" value="1" checked="checked" id="allblogs_all" /><label for="allblogs_all"><?php echo _BAN_ALLBLOGS?></label>
 			</div>
@@ -5461,19 +5763,26 @@
 		<p><?php echo _BAN_IPRANGE_TEXT?></p>
 
 		<div class="note">
-		<b>An example</b>: "134.58.253.193" will only block one computer, while "134.58.253" will block 256 IP addresses, including the one from the first example.
+			<strong><?php echo _BAN_EXAMPLE_TITLE ?></strong>
+			<?php echo _BAN_EXAMPLE_TEXT ?>
 		</div>
 
 		<div>
-		<?php			if ($ip) {
+		<?php
+		if ($ip) {
+			$iprangeVal = htmlspecialchars($ip, ENT_QUOTES);
 		?>
-			<input name="iprange" type="radio" value="<?php echo htmlspecialchars($ip)?>" checked="checked" id="ip_fixed" /><label for="ip_fixed"><?php echo htmlspecialchars($ip)?></label>
+			<input name="iprange" type="radio" value="<?php echo $iprangeVal ?>" checked="checked" id="ip_fixed" />
+			<label for="ip_fixed"><?php echo $iprangeVal ?></label>
 			<br />
-			<input name="iprange" type="radio" value="custom" id="ip_custom" /><label for="ip_custom">Custom: </label><input name='customiprange' value='<?php echo htmlspecialchars($ip)?>' maxlength='15' size='15' />
-		<?php	} else {
-				echo "<input name='iprange' value='custom' type='hidden' />";
-				echo "<input name='customiprange' value='' maxlength='15' size='15' />";
-			}
+			<input name="iprange" type="radio" value="custom" id="ip_custom" />
+			<label for="ip_custom"><?php echo _BAN_IP_CUSTOM ?></label>
+			<input name='customiprange' value='<?php echo $iprangeVal ?>' maxlength='15' size='15' />
+		<?php
+		} else {
+			echo "<input name='iprange' value='custom' type='hidden' />";
+			echo "<input name='customiprange' value='' maxlength='15' size='15' />";
+		}
 		?>
 		</div>
 
@@ -5625,7 +5934,8 @@
 		// (creating/restoring dumps might take a while)
 		@set_time_limit(1200);
 
-		do_backup($useGzip);
+		$bu = new Backup();
+		$bu->do_backup($useGzip);
 		exit;
 	}
 
@@ -5646,7 +5956,8 @@
 		// (creating/restoring dumps might take a while)
 		@set_time_limit(1200);
 
-		$message = do_restore();
+		$bu = new Backup();
+		$message = $bu->do_restore();
 		if ($message != '')
 			$this->error($message);
 
@@ -5847,7 +6158,7 @@
 				// uninstall plugin again...
 				$this->deleteOnePlugin($plugin->getID());
 
-				$this->error(_ERROR_INSREQPLUGIN . htmlspecialchars($pluginName));
+				$this->error(sprintf(_ERROR_INSREQPLUGIN, htmlspecialchars($pluginName, ENT_QUOTES)));
 			}
 		}
 
@@ -5890,7 +6201,8 @@
 			}
 		}
 
-		$this->action_pluginlist();
+		redirect('?action=pluginlist');
+//		$this->action_pluginlist();
 	}
 
 	/**
@@ -5938,7 +6250,8 @@
 			$this->error($error);
 		}
 
-		$this->action_pluginlist();
+		redirect('?action=pluginlist');
+//		$this->action_pluginlist();
 	}
 
 	/**
@@ -5954,11 +6267,11 @@
 
 		$name = quickQuery('SELECT pfile as result FROM '.sql_table('plugin').' WHERE pid='.$pid);
 
-		// call the unInstall method of the plugin
+/*		// call the unInstall method of the plugin
 		if ($callUninstall) {
 			$plugin =& $manager->getPlugin($name);
 			if ($plugin) $plugin->unInstall();
-		}
+		}*/
 
 		// check dependency before delete
 		$res = sql_query('SELECT pfile FROM '.sql_table('plugin'));
@@ -5971,7 +6284,7 @@
 				{
 					if ($name == $depName)
 					{
-						return _ERROR_DELREQPLUGIN . $o->pfile;
+						return sprintf(_ERROR_DELREQPLUGIN, $o->pfile);
 					}
 				}
 			}
@@ -5979,6 +6292,12 @@
 
 		$manager->notify('PreDeletePlugin', array('plugid' => $pid));
 
+		// call the unInstall method of the plugin
+		if ($callUninstall) {
+			$plugin =& $manager->getPlugin($name);
+			if ($plugin) $plugin->unInstall();
+		}
+
 		// delete all subscriptions
 		sql_query('DELETE FROM '.sql_table('plugin_event').' WHERE pid=' . $pid);
 
@@ -6035,7 +6354,9 @@
 		sql_query('UPDATE '.sql_table('plugin').' SET porder='.$oldOrder.' WHERE porder='.$newOrder);
 		sql_query('UPDATE '.sql_table('plugin').' SET porder='.$newOrder.' WHERE pid='.$plugid);
 
-		$this->action_pluginlist();
+		//$this->action_pluginlist();
+		// To avoid showing ticket in the URL, redirect to pluginlist, instead.
+		redirect('?action=pluginlist');
 	}
 
 	/**
@@ -6066,7 +6387,9 @@
 		sql_query('UPDATE '.sql_table('plugin').' SET porder='.$oldOrder.' WHERE porder='.$newOrder);
 		sql_query('UPDATE '.sql_table('plugin').' SET porder='.$newOrder.' WHERE pid='.$plugid);
 
-		$this->action_pluginlist();
+		//$this->action_pluginlist();
+		// To avoid showing ticket in the URL, redirect to pluginlist, instead.
+		redirect('?action=pluginlist');
 	}
 
 	/**
@@ -6083,12 +6406,13 @@
 			$this->error(_ERROR_NOSUCHPLUGIN);
 
 		$extrahead = '<script type="text/javascript" src="javascript/numbercheck.js"></script>';
+		$pluginName = htmlspecialchars(getPluginNameFromPid($pid), ENT_QUOTES);
 		$this->pagehead($extrahead);
 
 		?>
 			<p><a href="index.php?action=pluginlist">(<?php echo _PLUGS_BACK?>)</a></p>
 
-			<h2>Options for <?php echo htmlspecialchars(getPluginNameFromPid($pid))?></h2>
+			<h2><?php echo sprintf(_PLUGIN_OPTIONS_TITLE, $pluginName) ?></h2>
 
 			<?php if  ($message) echo $message?>
 
@@ -6214,9 +6538,12 @@
 				echo '<tr><th colspan="2">Options for ', htmlspecialchars($aOption['pfile']),'</th></tr>';
 			}
 
-			echo '<tr>';
-			listplug_plugOptionRow($aOption);
-			echo '</tr>';
+			$meta = NucleusPlugin::getOptionMeta($current['typeinfo']);
+			if (@$meta['access'] != 'hidden') {
+				echo '<tr>';
+				listplug_plugOptionRow($aOption);
+				echo '</tr>';
+			}
 
 		}
 
@@ -6252,7 +6579,7 @@
 			if ($checkedval != $value1)
 				echo "tabindex='$tabindex' checked='checked'";
 			if ($isAdmin && $name=="canlogin")
-				echo " disabled='true'";
+				echo ' disabled="disabled"';
 			echo ' id="'.$id2.'" /><label for="'.$id2.'">' . $noval . '</label>';
 	}
 
diff -x .svn -aruN 3.33.src/nucleus/libs/BLOG.php 3.40.src/nucleus/libs/BLOG.php
--- 3.33.src/nucleus/libs/BLOG.php	2008-10-06 07:43:46.000000000 -0500
+++ 3.40.src/nucleus/libs/BLOG.php	2009-02-14 19:36:46.000000000 -0600
@@ -16,7 +16,7 @@
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: BLOG.php 1171 2007-06-14 03:36:49Z ehui $
+ * @version $Id: BLOG.php 1322 2009-02-12 23:30:26Z kaigreve $
  */
 
 if ( !function_exists('requestVar') ) exit;
@@ -186,7 +186,7 @@
 					if ($old_date != 0) {
 						$oldTS = strtotime($old_date);
 						$manager->notify('PreDateFoot',array('blog' => &$this, 'timestamp' => $oldTS));
-						$tmp_footer = strftime($template['DATE_FOOTER'], $oldTS);
+						$tmp_footer = strftime(isset($template['DATE_FOOTER'])?$template['DATE_FOOTER']:'', $oldTS);
 						$parser->parse($tmp_footer);
 						$manager->notify('PostDateFoot',array('blog' => &$this, 'timestamp' => $oldTS));
 					}
@@ -332,14 +332,14 @@
 	  *		the new category-id in case of success.
 	  *		0 on failure
 	  */
-	function createNewCategory($catName = '', $catDescription = 'New category') {
+	function createNewCategory($catName = '', $catDescription = _CREATED_NEW_CATEGORY_DESC) {
 		global $member, $manager;
 
 		if ($member->blogAdminRights($this->getID())) {
 			// generate
 			if ($catName == '')
 			{
-				$catName = 'newcat';
+				$catName = _CREATED_NEW_CATEGORY_NAME;
 				$i = 1;
 
 				$res = sql_query('SELECT * FROM '.sql_table('category')." WHERE cname='".$catName.$i."' and cblog=".$this->getID());
@@ -586,12 +586,20 @@
 			if ($mode == 'day') {
 				$archivedate = date('Y-m-d',$current->itime);
 				$archive['day'] = date('d',$current->itime);
+				$data['day'] = date('d',$current->itime);
 			} else {
 				$archivedate = date('Y-m',$current->itime);
 			}
 			$data['month'] = date('m',$current->itime);
 			$data['year'] = date('Y',$current->itime);
 			$data['archivelink'] = createArchiveLink($this->getID(),$archivedate,$linkparams);
+			
+			$manager->notify(
+				'PreArchiveListItem',
+				array(
+					'listitem' => &$data
+				)
+			);
 
 			$temp = TEMPLATE::fill($template['ARCHIVELIST_LISTITEM'],$data);
 			echo strftime($temp,$current->itime);
@@ -656,6 +664,13 @@
 							   );
 			$data['self'] = $CONF['Self'];
 
+			$manager->notify(
+				'PreCategoryListItem',
+				array(
+					'listitem' => &$data
+				)
+			);
+			
 			echo TEMPLATE::fill((isset($template['CATLIST_LISTITEM']) ? $template['CATLIST_LISTITEM'] : null), $data);
 			//$temp = TEMPLATE::fill((isset($template['CATLIST_LISTITEM']) ? $template['CATLIST_LISTITEM'] : null), $data);
 			//echo strftime($temp, $current->itime);
@@ -674,10 +689,27 @@
 	
 	/**
 	  * Shows a list of all blogs in the system using a given template
+	  * ordered by 	number, name, shortname or description
+	  * in ascending or descending order	    
 	  */
-	function showBlogList($template, $bnametype) {
+	function showBlogList($template, $bnametype, $orderby, $direction) {
 		global $CONF, $manager;
 		
+		switch ($orderby) {
+			case 'number': $orderby='bnumber'; break;
+			case 'name': $orderby='bname'; break;
+			case 'shortname': $orderby='bshortname'; break;
+			case 'description': $orderby='bdesc'; break;
+			default: $orderby='bnumber';	break;
+		}
+		
+		$direction=strtolower($direction);
+		switch ($direction) {
+			case 'asc': $direction='ASC';  break;
+			case 'desc': $direction='DESC'; break;
+			default: $direction='ASC';	break;
+		}
+		
 		$template =& $manager->getTemplate($template);
 		
 		echo TEMPLATE::fill((isset($template['BLOGLIST_HEADER']) ? $template['BLOGLIST_HEADER'] : null),
@@ -686,7 +718,7 @@
 								'siteurl' => $CONF['IndexURL']
 							));
 		
-		$query = 'SELECT bnumber, bname, bshortname, bdesc, burl FROM '.sql_table('blog').' ORDER BY bnumber ASC';
+		$query = 'SELECT bnumber, bname, bshortname, bdesc, burl FROM '.sql_table('blog').' ORDER BY '.$orderby.' '.$direction;
 		$res = sql_query($query);
 		
 		while ($data = mysql_fetch_assoc($res)) {
@@ -698,6 +730,8 @@
 		
 			$list['blogdesc'] = $data['bdesc'];
 			
+			$list['blogurl'] = $data['burl'];
+			
 			if ($bnametype=='shortname') {
 				$list['blogname'] = $data['bshortname'];
 			}
@@ -705,6 +739,13 @@
 				$list['blogname'] = $data['bname'];
 			}
 			
+			$manager->notify(
+				'PreBlogListItem',
+				array(
+					'listitem' => &$list
+				)
+			);
+			
 			echo TEMPLATE::fill((isset($template['BLOGLIST_LISTITEM']) ? $template['BLOGLIST_LISTITEM'] : null), $list);
 			
 		}
@@ -1040,9 +1081,9 @@
 
 		);
 
-		ACTIONLOG::add(INFO, 'Added ' . $tmem->getDisplayName() . ' (ID=' .
-					   $memberid .') to the team of blog "' . $this->getName() . '"');
-
+		$logMsg = sprintf(_TEAM_ADD_NEWTEAMMEMBER, $tmem->getDisplayName(), $memberid, $this->getName());
+		ACTIONLOG::add(INFO, $logMsg);
+		
 		return 1;
 	}
 
@@ -1107,6 +1148,71 @@
 			}
 		}
 	}
+	
+	/**
+	 * Shows the given list of items for this blog
+	 *
+	 * @param $itemarray
+	 *		array of item numbers to be displayed
+	 * @param $template
+	 *		String representing the template _NAME_ (!)	 
+	 * @param $highlight
+	 *		contains a query that should be highlighted
+	 * @param $comments
+	 *		1=show comments 0=don't show comments
+	 * @param $dateheads
+	 *		1=show dateheads 0=don't show dateheads
+	 * @returns int
+	 *		amount of items shown
+	 */
+	function readLogFromList($itemarray, $template, $highlight = '', $comments = 1, $dateheads = 1) {
+
+		$query = $this->getSqlItemList($itemarray);
+
+		return $this->showUsingQuery($template, $query, $highlight, $comments, $dateheads);
+	}
+	
+	/**
+	 * Returns the SQL query used to fill out templates for a list of items
+	 *
+	 * @param $itemarray
+	 *		an array holding the item numbers of the items to be displayed
+	 * @returns
+	 *		either a full SQL query, or an empty string
+	 * @note
+	 *		No LIMIT clause is added. (caller should add this if multiple pages are requested)
+	 */
+	function getSqlItemList($itemarray)
+	{
+		if (!is_array($itemarray)) return '';
+		$items = array();
+		foreach ($itemarray as $value) {
+			if (intval($value)) $items[] = intval($value);
+		}
+		if (!count($items)) return '';
+		//$itemlist = implode(',',$items);
+		$i = count($items);
+		$query = '';
+		foreach ($items as $value) {
+			$query .= '(SELECT i.inumber as itemid, i.ititle as title, i.ibody as body, m.mname as author, m.mrealname as authorname, i.itime, i.imore as more, m.mnumber as authorid, m.memail as authormail, m.murl as authorurl, c.cname as category, i.icat as catid, i.iclosed as closed';
+			
+			$query .= ' FROM '.sql_table('item').' as i, '.sql_table('member').' as m, '.sql_table('category').' as c'
+				   . ' WHERE i.iblog='.$this->blogid
+				   . ' and i.iauthor=m.mnumber'
+				   . ' and i.icat=c.catid'
+				   . ' and i.idraft=0'	// exclude drafts
+						// don't show future items
+				   . ' and i.itime<=' . mysqldate($this->getCorrectTime());
+
+			//$query .= ' and i.inumber IN ('.$itemlist.')';
+			$query .= ' and i.inumber='.intval($value);
+			$query .= ')';
+			$i--;
+			if ($i) $query .= ' UNION ';
+		}
+		
+		return $query;
+	}
 
 }
 
diff -x .svn -aruN 3.33.src/nucleus/libs/BODYACTIONS.php 3.40.src/nucleus/libs/BODYACTIONS.php
--- 3.33.src/nucleus/libs/BODYACTIONS.php	2008-10-06 07:43:46.000000000 -0500
+++ 3.40.src/nucleus/libs/BODYACTIONS.php	2009-02-14 19:36:46.000000000 -0600
@@ -15,7 +15,7 @@
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: BODYACTIONS.php 1147 2007-05-11 08:26:02Z kimitake $
+ * @version $Id: BODYACTIONS.php 1273 2008-10-15 21:34:56Z kaigreve $
  */
 
 class BODYACTIONS extends BaseActions {
@@ -43,10 +43,11 @@
 	function parse_plugin($pluginName) {
 		global $manager;
 
+		// should be already tested from the parser (PARSER.php)
 		// only continue when the plugin is really installed
-		if (!$manager->pluginInstalled('NP_' . $pluginName)) {
+		/*if (!$manager->pluginInstalled('NP_' . $pluginName)) {
 			return;
-		}
+		}*/
 
 		$plugin =& $manager->getPlugin('NP_' . $pluginName);
 		if (!$plugin) return;
diff -x .svn -aruN 3.33.src/nucleus/libs/BaseActions.php 3.40.src/nucleus/libs/BaseActions.php
--- 3.33.src/nucleus/libs/BaseActions.php	2008-10-06 07:43:46.000000000 -0500
+++ 3.40.src/nucleus/libs/BaseActions.php	2009-02-14 19:36:46.000000000 -0600
@@ -17,7 +17,7 @@
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: BaseActions.php 1116 2007-02-03 08:24:29Z kimitake $
+ * @version $Id: BaseActions.php 1282 2008-10-27 06:32:05Z shizuki $
  */
 
 class BaseActions {
@@ -75,21 +75,31 @@
 	function parse_parsedinclude($filename) {
 		// check current level
 		if ($this->level > 3) return;	// max. depth reached (avoid endless loop)
-		$filename = $this->getIncludeFileName($filename);
-		if (!file_exists($filename)) return '';
+		global $skinid;
+		$skin = new SKIN($skinid);
+		$file = $this->getIncludeFileName($filename);
+		if (!$skin->isValid && !file_exists($file)) {
+			return;
+		}
+		$parts = explode('|', $filename, 2);
+		if ($skin->getContent($parts[0])) {
+			$contents = $skin->getContent($parts[0]);
+		} else {
+			$filename = $this->getIncludeFileName($filename);
+			if (!file_exists($filename)) return '';
 
-		$fsize = filesize($filename);
+			$fsize = filesize($filename);
 
-		// nothing to include
-		if ($fsize <= 0)
-			return;
+			// nothing to include
+			if ($fsize <= 0) return;
 
-		$this->level = $this->level + 1;
+			$this->level = $this->level + 1;
 
-		// read file
-		$fd = fopen ($filename, 'r');
-		$contents = fread ($fd, $fsize);
-		fclose ($fd);
+			// read file
+			$fd = fopen ($filename, 'r');
+			$contents = fread ($fd, $fsize);
+			fclose ($fd);
+		}
 
 		// parse file contents
 		$this->parser->parse($contents);
diff -x .svn -aruN 3.33.src/nucleus/libs/COMMENT.php 3.40.src/nucleus/libs/COMMENT.php
--- 3.33.src/nucleus/libs/COMMENT.php	2008-10-06 07:43:46.000000000 -0500
+++ 3.40.src/nucleus/libs/COMMENT.php	2009-02-14 19:36:46.000000000 -0600
@@ -15,12 +15,14 @@
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: COMMENT.php 1116 2007-02-03 08:24:29Z kimitake $
+ * @version $Id: COMMENT.php 1252 2008-03-06 18:39:02Z kaigreve $
  */
 class COMMENT {
 
 	/**
-	  * Returns the requested comment (static)
+	  * Returns the requested comment
+	  * 
+	  * @static
 	  */
 	function getComment($commentid) {
 		$query =  'SELECT cnumber as commentid, cbody as body, cuser as user, cmail as userid, cemail as email, cmember as memberid, ctime, chost as host, mname as member, cip as ip, cblog as blogid'
@@ -37,8 +39,9 @@
 	}
 
 	/**
-	  * prepares a comment to be saved
-	  * (static)
+	  * Prepares a comment to be saved
+	  * 	  
+	  * @static
 	  */
 	function prepare($comment) {
 		$comment['user'] = strip_tags($comment['user']);
@@ -55,7 +58,11 @@
 		return $comment;
 	}
 
-	// prepares the body of a comment (static)
+	/**
+	 * Prepares the body of a comment
+	 *
+	 * @ static
+	 */	 	
 	function prepareBody($body) {
 
 		// remove newlines when too many in a row
@@ -89,6 +96,11 @@
 		return $body;
 	}
 
+	/**
+	 * Creates a link code for unlinked URLs with different protocols
+	 *
+	 * @ static
+	 */	
 	function createLinkCode($pre, $url, $protocol = 'http') {
 		$post = '';
 
diff -x .svn -aruN 3.33.src/nucleus/libs/COMMENTACTIONS.php 3.40.src/nucleus/libs/COMMENTACTIONS.php
--- 3.33.src/nucleus/libs/COMMENTACTIONS.php	2008-10-06 07:43:46.000000000 -0500
+++ 3.40.src/nucleus/libs/COMMENTACTIONS.php	2009-02-14 19:36:46.000000000 -0600
@@ -14,7 +14,7 @@
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: COMMENTACTIONS.php 1156 2007-05-20 23:47:36Z kaigreve $
+ * @version $Id: COMMENTACTIONS.php 1254 2008-03-08 17:17:52Z kaigreve $
  */
 
 class COMMENTACTIONS extends BaseActions {
@@ -128,6 +128,24 @@
 		$this->currentComment =& $comment;
 	}
 
+	/**
+	 * Parse templatevar authtext
+	 */
+	function parse_authtext() {
+		if ($this->currentComment['memberid'] != 0)
+			$this->parser->parse($this->template['COMMENTS_AUTH']);
+	}
+
+	/**
+	 * Parse templatevar blogid
+	 */
+	function parse_blogid() {
+		echo $this->currentComment['blogid'];
+	}
+
+	/**
+	 * Parse templatevar blogurl
+	 */
 	function parse_blogurl() {
 		global $manager;
 		$blogid = getBlogIDFromItemID($this->commentsObj->itemid);
@@ -135,10 +153,30 @@
 		echo $blog->getURL();
 	}
 
+	/**
+	 * Parse templatevar body
+	 */
+	function parse_body() {
+		echo $this->highlight($this->currentComment['body']);
+	}
+
+	/**
+	 * Parse templatevar commentcount
+	 */
 	function parse_commentcount() {
 			echo $this->commentsObj->commentcount;
 	}
 	
+	/**
+	 * Parse templatevar commentid
+	 */
+	function parse_commentid() {
+		echo $this->currentComment['commentid'];
+	}
+
+	/**
+	 * Parse templatevar commentword
+	 */
 	function parse_commentword() {
 		if ($this->commentsObj->commentcount == 1)
 			echo $this->template['COMMENTS_ONE'];
@@ -146,6 +184,54 @@
 			echo $this->template['COMMENTS_MANY'];
 	}
 
+	/**
+	 * Parse templatevar date
+	 */
+	function parse_date($format = '') {
+		echo formatDate($format, $this->currentComment['timestamp'], $this->template['FORMAT_DATE'], $this->commentsObj->itemActions->blog);
+	}
+
+	/**
+	 * Parse templatevar email
+	 */
+	function parse_email() {
+		$email = $this->currentComment['email'];
+		$email = str_replace('@', ' (at) ', $email);
+		$email = str_replace('.', ' (dot) ', $email);
+		echo $email;
+	}
+
+	/**
+	 * Parse templatevar excerpt
+	 */
+	function parse_excerpt() {
+		echo stringToXML(shorten($this->currentComment['body'], 60, '...'));
+	}
+	
+	/**
+	 * Parse templatevar host
+	 */
+	function parse_host() {
+		echo $this->currentComment['host'];
+	}
+
+	/**
+	 * Parse templatevar ip
+	 */
+	function parse_ip() {
+		echo $this->currentComment['ip'];
+	}
+
+	/**
+	 * Parse templatevar itemid
+	 */
+	function parse_itemid() {
+		echo $this->commentsObj->itemid;
+	}
+
+	/**
+	 * Parse templatevar itemlink
+	 */
 	function parse_itemlink() {
 		echo createLink(
 			'item',
@@ -157,11 +243,10 @@
 			)
 		);
 	}
-	
-	function parse_itemid() {
-		echo $this->commentsObj->itemid;
-	}
-	
+
+	/**
+	 * Parse templatevar itemtitle
+	 */
 	function parse_itemtitle($maxLength = 0) {
 		if ($maxLength == 0)
 			$this->commentsObj->itemActions->parse_title();
@@ -169,46 +254,74 @@
 			$this->commentsObj->itemActions->parse_syndicate_title($maxLength);
 	}
 
-	function parse_date($format = '') {
-		echo formatDate($format, $this->currentComment['timestamp'], $this->template['FORMAT_DATE'], $this->commentsObj->itemActions->blog);
+	/**
+	 * Parse templatevar memberid
+	 */
+	function parse_memberid() {
+		echo $this->currentComment['memberid'];
 	}
-	
+
+	/**
+	 * Parse templatevar short
+	 */
+	function parse_short() {
+		$tmp = strtok($this->currentComment['body'],"\n");
+		$tmp = str_replace('<br />','',$tmp);
+		echo $tmp;
+		if ($tmp != $this->currentComment['body'])
+			$this->parser->parse($this->template['COMMENTS_CONTINUED']);
+	}
+
+	/**
+	 * Parse templatevar time
+	 */
 	function parse_time($format = '') {
 		echo strftime(
 				($format == '') ? $this->template['FORMAT_TIME'] : $format,
 				$this->currentComment['timestamp']
 			);
 	}
-
-	function parse_commentid() {
-		echo $this->currentComment['commentid'];
-	}
-	
-	function parse_body() {
-		echo $this->highlight($this->currentComment['body']);
-	}
-	
-	function parse_memberid() {
-		echo $this->currentComment['memberid'];
-	}
 	
+	/**
+	 * Parse templatevar timestamp
+	 */
 	function parse_timestamp() {
 		echo $this->currentComment['timestamp'];
 	}
-	
-	function parse_host() {
-		echo $this->currentComment['host'];
-	}
-	
-	function parse_ip() {
-		echo $this->currentComment['ip'];
-	}
-	
-	function parse_blogid() {
-		echo $this->currentComment['blogid'];
+
+	/**
+	  * Executes a plugin templatevar
+	  *
+	  * @param pluginName name of plugin (without the NP_)
+	  *
+	  * extra parameters can be added
+	  */
+	function parse_plugin($pluginName) {
+		global $manager;
+
+		// only continue when the plugin is really installed
+		if (!$manager->pluginInstalled('NP_' . $pluginName))
+			return;
+
+		$plugin =& $manager->getPlugin('NP_' . $pluginName);
+		if (!$plugin) return;
+
+		// get arguments
+		$params = func_get_args();
+
+		// remove plugin name
+		array_shift($params);
+
+		// pass info on current item and current comment as well
+		$params = array_merge(array(&$this->currentComment),$params);
+		$params = array_merge(array(&$this->commentsObj->itemActions->currentItem),$params);
+
+		call_user_func_array(array(&$plugin,'doTemplateCommentsVar'), $params);
 	}
 
-//	function parse_user() {
+	/**
+	 * Parse templatevar user
+	 */
 	function parse_user($mode='') {
 		global $manager;
 		if ($mode == 'realname' && $this->currentComment['memberid'] > 0) {
@@ -216,32 +329,12 @@
 			echo $member->getRealName();
 		} else {
 			echo $this->currentComment['user'];
-	}
-	}
-	
-	function parse_userid() {
-			echo $this->currentComment['userid'];
-	}
-	
-	function parse_email() {
-		$email = $this->currentComment['email'];
-		$email = str_replace('@', ' (at) ', $email);
-		$email = str_replace('.', ' (dot) ', $email);
-		echo $email;
-	}
-	
-	function parse_userlinkraw() {
-		echo $this->currentComment['userlinkraw'];
-	}
-	
-	function parse_userlink() {
-		if ($this->currentComment['userlinkraw']) {
-			echo '<a href="'.$this->currentComment['userlinkraw'].'" rel="nofollow">'.$this->currentComment['user'].'</a>';
-		} else {
-			echo $this->currentComment['user'];
 		}
 	}
-
+	
+	/**
+	 * Parse templatevar useremail
+	 */
 	function parse_useremail() {
 		global $manager;
 		if ($this->currentComment['memberid'] > 0)
@@ -261,57 +354,40 @@
 //				echo str_replace('mailto:', '', $this->currentComment['userlinkraw']);
 		}
 	}
-
-	function parse_userwebsite() {
-		if (!(strpos($this->currentComment['userlinkraw'], 'http://') === false))
-			echo $this->currentComment['userlinkraw'];
-	}
-
-	function parse_excerpt() {
-		echo stringToXML(shorten($this->currentComment['body'], 60, '...'));
+	
+	/**
+	 * Parse templatevar userid
+	 */
+	function parse_userid() {
+			echo $this->currentComment['userid'];
 	}
 	
-	function parse_short() {
-		$tmp = strtok($this->currentComment['body'],"\n");
-		$tmp = str_replace('<br />','',$tmp);
-		echo $tmp;
-		if ($tmp != $this->currentComment['body'])
-			$this->parser->parse($this->template['COMMENTS_CONTINUED']);
+
+	/**
+	 * Parse templatevar userlink
+	 */
+	function parse_userlink() {
+		if ($this->currentComment['userlinkraw']) {
+			echo '<a href="'.$this->currentComment['userlinkraw'].'" rel="nofollow">'.$this->currentComment['user'].'</a>';
+		} else {
+			echo $this->currentComment['user'];
+		}
 	}
 	
-	function parse_authtext() {
-		if ($this->currentComment['memberid'] != 0)
-			$this->parser->parse($this->template['COMMENTS_AUTH']);
+	/**
+	 * Parse templatevar userlinkraw
+	 */
+	function parse_userlinkraw() {
+		echo $this->currentComment['userlinkraw'];
 	}
 
 	/**
-	  * Executes a plugin templatevar
-	  *
-	  * @param pluginName name of plugin (without the NP_)
-	  *
-	  * extra parameters can be added
-	  */
-	function parse_plugin($pluginName) {
-		global $manager;
-
-		// only continue when the plugin is really installed
-		if (!$manager->pluginInstalled('NP_' . $pluginName))
-			return;
-
-		$plugin =& $manager->getPlugin('NP_' . $pluginName);
-		if (!$plugin) return;
-
-		// get arguments
-		$params = func_get_args();
-
-		// remove plugin name
-		array_shift($params);
-
-		// pass info on current item and current comment as well
-		$params = array_merge(array(&$this->currentComment),$params);
-		$params = array_merge(array(&$this->commentsObj->itemActions->currentItem),$params);
-
-		call_user_func_array(array(&$plugin,'doTemplateCommentsVar'), $params);
+	 * Parse templatevar userwebsite
+	 */
+	function parse_userwebsite() {
+		if (!(strpos($this->currentComment['userlinkraw'], 'http://') === false))
+			echo $this->currentComment['userlinkraw'];
 	}
+
 }
 ?>
diff -x .svn -aruN 3.33.src/nucleus/libs/COMMENTS.php 3.40.src/nucleus/libs/COMMENTS.php
--- 3.33.src/nucleus/libs/COMMENTS.php	2008-10-06 07:43:46.000000000 -0500
+++ 3.40.src/nucleus/libs/COMMENTS.php	2009-02-14 19:36:46.000000000 -0600
@@ -15,7 +15,7 @@
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: COMMENTS.php 1155 2007-05-20 23:40:48Z kaigreve $
+ * @version $Id: COMMENTS.php 1281 2008-10-24 06:01:23Z shizuki $
  */
 
 if ( !function_exists('requestVar') ) exit;
@@ -41,6 +41,7 @@
 	function COMMENTS($itemid) {
 		$this->itemid = intval($itemid);
 	}
+	
 	/**
 	 * Used when parsing comments
 	 *
@@ -130,7 +131,9 @@
 		return $arr[0];
 	}
 
-
+	/**
+	 * Adds a new comment to the database
+	 */
 	function addComment($timestamp, $comment) {
 		global $CONF, $member, $manager;
 
@@ -245,7 +248,7 @@
 			$item =& $manager->getItem($this->itemid, 0, 0);
 			$mailto_title = _NOTIFY_NC_TITLE . ' ' . strip_tags($item['title']) . ' (' . $this->itemid . ')';
 
-			$frommail = $member->getNotifyFromMailAddress($comment['userid']);
+			$frommail = $member->getNotifyFromMailAddress($comment['email']);
 
 			$notify =& new NOTIFICATION($settings->getNotifyAddress());
 			$notify->notify($mailto_title, $mailto_msg , $frommail);
@@ -265,6 +268,19 @@
 		$timestamp	= date('Y-m-d H:i:s', $comment['timestamp']);
 		$itemid		= $this->itemid;
 
+		$qSql       = 'SELECT COUNT(*) AS result '
+					. 'FROM ' . sql_table('comment')
+					. ' WHERE '
+					.      'cmail   = "' . $url . '"'
+					. ' AND cmember = "' . $memberid . '"'
+					. ' AND cbody   = "' . $body . '"'
+					. ' AND citem   = "' . $itemid . '"'
+					. ' AND cblog   = "' . $blogid . '"';
+		$result     = (integer) quickQuery($qSql);
+		if ($result > 0) {
+			return _ERROR_BADACTION;
+		}
+
 		$query = 'INSERT INTO '.sql_table('comment').' (CUSER, CMAIL, CEMAIL, CMEMBER, CBODY, CITEM, CTIME, CHOST, CIP, CBLOG) '
 			   . "VALUES ('$name', '$url', '$email', $memberid, '$body', $itemid, '$timestamp', '$host', '$ip', '$blogid')";
 
@@ -278,8 +294,11 @@
 		return true;
 	}
 
-
-	function isValidComment($comment, & $spamcheck) {
+	/**
+	 * Checks if a comment is valid and call plugins
+	 * that can check if the comment is a spam comment	  
+	 */
+	function isValidComment(&$comment, &$spamcheck) {
 		global $member, $manager;
 
 		// check if there exists a item for this date
diff -x .svn -aruN 3.33.src/nucleus/libs/ENCAPSULATE.php 3.40.src/nucleus/libs/ENCAPSULATE.php
--- 3.33.src/nucleus/libs/ENCAPSULATE.php	2008-10-06 07:43:46.000000000 -0500
+++ 3.40.src/nucleus/libs/ENCAPSULATE.php	2009-02-14 19:36:46.000000000 -0600
@@ -15,7 +15,7 @@
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: ENCAPSULATE.php 1154 2007-05-20 23:24:09Z kaigreve $
+ * @version $Id: ENCAPSULATE.php 1279 2008-10-23 08:18:26Z shizuki $
  */
 
 class ENCAPSULATE {
@@ -27,7 +27,7 @@
 	  *
 	  * Passes on the amount of results found (for further encapsulation)
 	  */
-	function doEncapsulate($call, $params, $errorMessage = 'No entries') {
+	function doEncapsulate($call, $params, $errorMessage = _ENCAPSULATE_ENCAPSULATE_NOENTRY) {
 		// start output buffering
 		ob_start();
 
diff -x .svn -aruN 3.33.src/nucleus/libs/ITEM.php 3.40.src/nucleus/libs/ITEM.php
--- 3.33.src/nucleus/libs/ITEM.php	2008-10-06 07:43:46.000000000 -0500
+++ 3.40.src/nucleus/libs/ITEM.php	2009-02-14 19:36:46.000000000 -0600
@@ -15,19 +15,28 @@
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: ITEM.php 1195 2007-09-05 06:19:47Z kimitake $
+ * @version $Id: ITEM.php 1286 2008-12-01 09:01:37Z ehui $
  */
 class ITEM {
 
 	var $itemid;
 
+	/**
+	  * Constructor of an ITEM object
+	  * 
+	  * @param integer $itemid id of the item
+	  */
 	function ITEM($itemid) {
 		$this->itemid = $itemid;
 	}
 
 	/**
 	  * Returns one item with the specific itemid
-	  * (static)
+	  * 
+	  * @param integer $itemid id of the item
+	  * @param boolean $allowdraft
+	  * @param boolean $allowfuture	  	  	  	  
+	  * @static
 	  */
 	function getitem($itemid, $allowdraft, $allowfuture) {
 		global $manager;
@@ -70,9 +79,10 @@
 	 * Tries to create an item from the data in the current request (comes from
 	 * bookmarklet or admin area
 	 *
-	 * Returns an array with status info (status = 'added', 'error', 'newcategory')
+	 * Returns an array with status info:
+	 * status = 'added', 'error', 'newcategory'
 	 *
-	 * (static)
+	 * @static
 	 */
 	function createFromRequest() {
 		 global $member, $manager;
@@ -156,6 +166,7 @@
 		$manager->notify('PostPluginOptionsUpdate',array('context' => 'item', 'itemid' => $itemid, 'item' => array('title' => $i_title, 'body' => $i_body, 'more' => $i_more, 'closed' => $i_closed, 'catid' => $i_catid)));
 
 		if ($i_draftid > 0) {
+			// delete permission is checked inside ITEM::delete()
 			ITEM::delete($i_draftid);
 		}
 
@@ -168,7 +179,9 @@
 
 
 	/**
-	  * Updates an item (static)
+	  * Updates an item
+	  * 
+	  * @static
 	  */
 	function update($itemid, $catid, $title, $body, $more, $closed, $wasdraft, $publish, $timestamp = 0) {
 		global $manager;
@@ -232,6 +245,13 @@
 			if (!$isFuture && $blog->getNotifyAddress() && $blog->notifyOnNewItem())
 				$blog->sendNewItemNotification($itemid, $title, $body);
 		}
+		
+		// save back to drafts		
+		if (!$wasdraft && !$publish) {
+			$query .= ', idraft=1';
+			// set timestamp back to zero for a draft
+			$query .= ", itime=" . mysqldate($timestamp);
+		}
 
 		// update timestamp when needed
 		if ($timestamp != 0)
@@ -256,7 +276,11 @@
 
 	}
 
-	// move an item to another blog (no checks, static)
+	/**
+	 * Move an item to another blog (no checks)
+	 *
+	 * @static
+	 */	 	 	 	
 	function move($itemid, $new_catid) {
 		global $manager;
 
@@ -297,10 +321,17 @@
 	  * Deletes an item
 	  */
 	function delete($itemid) {
-		global $manager;
+		global $manager, $member;
 
 		$itemid = intval($itemid);
 
+		// check to ensure only those allow to alter the item can
+		// proceed
+		if (!$member->canAlterItem($itemid)) {
+			return 1;
+		}
+
+
 		$manager->notify('PreDeleteItem', array('itemid' => $itemid));
 
 		// delete item
@@ -315,9 +346,15 @@
 		NucleusPlugin::_deleteOptionValues('item', $itemid);
 
 		$manager->notify('PostDeleteItem', array('itemid' => $itemid));
+
+		return 0;
 	}
 
-	// returns true if there is an item with the given ID (static)
+	/**
+	 * Returns true if there is an item with the given ID
+	 *
+	 * @static
+	 */	 	 	
 	function exists($id,$future,$draft) {
 		global $manager;
 
@@ -342,9 +379,10 @@
 	 * Tries to create an draft from the data in the current request (comes from
 	 * bookmarklet or admin area
 	 *
-	 * Returns an array with status info (status = 'added', 'error', 'newcategory')
+	 * Returns an array with status info:
+	 * status = 'added', 'error', 'newcategory'
 	 *
-	 * (static)
+	 * @static
 	 *
 	 * Used by xmlHTTPRequest AutoDraft
 	 */
diff -x .svn -aruN 3.33.src/nucleus/libs/ITEMACTIONS.php 3.40.src/nucleus/libs/ITEMACTIONS.php
--- 3.33.src/nucleus/libs/ITEMACTIONS.php	2008-10-06 07:43:46.000000000 -0500
+++ 3.40.src/nucleus/libs/ITEMACTIONS.php	2009-02-14 19:36:46.000000000 -0600
@@ -10,11 +10,11 @@
  * (see nucleus/documentation/index.html#license for more info)
  */
 /**
- * This class to parse item templates
+ * This class is used to parse item templates
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: ITEMACTIONS.php 1149 2007-05-19 23:16:15Z kaigreve $
+ * @version $Id: ITEMACTIONS.php 1277 2008-10-22 08:43:59Z shizuki $
  */
 class ITEMACTIONS extends BaseActions {
 
@@ -55,6 +55,10 @@
 		$this->setBlog($blog);
 	}
 
+	/**
+	  * Returns an array with the actions that are defined
+	  * in the ITEMACTIONS class 
+	  */
 	function getDefinedActions() {
 		return array(
 			'blogid',
@@ -133,38 +137,66 @@
 
 	// methods used by parser to insert content
 
+
+	/**
+	 * Parse templatevar blogid
+	 */
 	function parse_blogid() {
 		echo $this->blog->getID();
 	}
 	
+	/**
+	 * Parse templatevar body
+	 */
 	function parse_body() {
 		$this->highlightAndParse($this->currentItem->body);
 	}
 	
+	/**
+	 * Parse templatevar more
+	 */
 	function parse_more() {
 		$this->highlightAndParse($this->currentItem->more);
 	}
 	
+	/**
+	 * Parse templatevar itemid
+	 */
 	function parse_itemid() {
 		echo $this->currentItem->itemid;
 	}
-	
+
+	/**
+	 * Parse templatevar category
+	 */	
 	function parse_category() {
 		echo $this->currentItem->category;
 	}
 	
+	/**
+	 * Parse templatevar categorylink
+	 */
 	function parse_categorylink() {
 		echo createLink('category', array('catid' => $this->currentItem->catid, 'name' => $this->currentItem->category));
 	}
 	
+	/**
+	 * Parse templatevar catid
+	 */
 	function parse_catid() {
 		echo $this->currentItem->catid;
 	}
 	
+	/**
+	 * Parse templatevar authorid
+	 */
 	function parse_authorid() {
 		echo $this->currentItem->authorid;
 	}
 	
+	/**
+	 * Parse templatevar authorlink
+	 */
 	function parse_authorlink() {
 		echo createLink(
 			'member',
@@ -176,10 +208,16 @@
 		);
 	}
 	
+	/**
+	 * Parse templatevar query
+	 */
 	function parse_query() {
 		echo $this->strHighlight;
 	}
 	
+	/**
+	 * Parse templatevar itemlink
+	 */
 	function parse_itemlink() {
 		echo createLink(
 			'item',
@@ -192,35 +230,61 @@
 		);
 	}
 	
+	/**
+	 * Parse templatevar blogurl
+	 */
 	function parse_blogurl() {
 		echo $this->blog->getURL();
 	}
 	
+	/**
+	 * Parse templatevar closed
+	 */
 	function parse_closed() {
 		echo $this->currentItem->closed;
 	}
 	
+	/**
+	 * Parse templatevar relevance
+	 */
 	function parse_relevance() {
 		echo round($this->currentItem->score,2);
 	}
 
+	/**
+	 * Parse templatevar title
+	 * 
+	 * @param string $format defines in which format the title is shown	 	 
+	 */
 	function parse_title($format = '') {
+		if (is_array($this->currentItem)) {
+			$itemtitle = $this->currentItem['title'];
+		} elseif (is_object($this->currentItem)) {
+			$itemtitle = $this->currentItem->title;
+		}
 		switch ($format) {
 			case 'xml':
-				echo stringToXML ($this->currentItem->title);
+//				echo stringToXML ($this->currentItem->title);
+				echo stringToXML ($itemtitle);
 				break;
 			case 'attribute':
-				echo stringToAttribute ($this->currentItem->title);
+//				echo stringToAttribute ($this->currentItem->title);
+				echo stringToAttribute ($itemtitle);
 				break;
 			case 'raw':
-				echo $this->currentItem->title;
+//				echo $this->currentItem->title;
+				echo $itemtitle;
 				break;
 			default:
-				$this->highlightAndParse($this->currentItem->title);
+//				$this->highlightAndParse($this->currentItem->title);
+				$this->highlightAndParse($itemtitle);
 				break;
 		}
 	}
 
+	/**
+	 * Parse templatevar karma
+	 */
 	function parse_karma($type = 'totalscore') {
 		global $manager;
 
@@ -253,6 +317,9 @@
 
 	}
 
+	/**
+	 * Parse templatevar author
+	 */
 	function parse_author($which = '') {
 		switch($which)
 		{
@@ -274,6 +341,9 @@
 		}
 	}
 
+	/**
+	 * Parse templatevar smartbody
+	 */
 	function parse_smartbody() {
 		if (!$this->currentItem->more) {
 			$this->highlightAndParse($this->currentItem->body);
@@ -282,16 +352,26 @@
 		}
 	}
 
+	/**
+	 * Parse templatevar morelink
+	 */
 	function parse_morelink() {
 		if ($this->currentItem->more)
 			$this->parser->parse($this->template['MORELINK']);
 	}
 
+	/**
+	 * Parse templatevar date
+	 * 
+	 * @param format optional strftime format	 	 
+	 */
 	function parse_date($format = '') {
 		echo formatDate($format, $this->currentItem->timestamp, $this->template['FORMAT_DATE'], $this->blog);
 	}
 
 	/**
+	  * Parse templatevar time
+	  * 	  
 	  * @param format optional strftime format
 	  */
 	function parse_time($format = '') {
@@ -299,6 +379,8 @@
 	}
 
 	/**
+	  * Parse templatevar syndicate_title
+	  *
 	  * @param maxLength optional maximum length
 	  */
 	function parse_syndicate_title($maxLength = 100) {
@@ -307,6 +389,8 @@
 	}
 
 	/**
+	  * Parse templatevar syndicate_description
+	  *
 	  * @param maxLength optional maximum length
 	  */
 	function parse_syndicate_description($maxLength = 250, $addHighlight = 0) {
@@ -319,28 +403,46 @@
 		}
 	}
 
+	/**
+	  * Parse templatevar karmaposlink
+	  *
+	  * @param string text
+	  */
 	function parse_karmaposlink($text = '') {
 		global $CONF;
 		$link = $CONF['ActionURL'] . '?action=votepositive&amp;itemid='.$this->currentItem->itemid;
 		echo $text ? '<a href="'.$link.'">'.$text.'</a>' : $link;
 	}
 
+	/**
+	  * Parse templatevar karmaneglink
+	  *
+	  * @param string text
+	  */
 	function parse_karmaneglink($text = '') {
 		global $CONF;
 		$link = $CONF['ActionURL'] . '?action=votenegative&amp;itemid='.$this->currentItem->itemid;
 		echo $text ? '<a href="'.$link.'">'.$text.'</a>' : $link;
 	}
 
+	/**
+	  * Parse templatevar new
+	  */
 	function parse_new() {
 		if (($this->lastVisit != 0) && ($this->currentItem->timestamp > $this->lastVisit))
 			echo $this->template['NEW'];
 	}
 
-
+	/**
+	  * Parse templatevar daylink
+	  */
 	function parse_daylink() {
 		echo createArchiveLink($this->blog->getID(), strftime('%Y-%m-%d',$this->currentItem->timestamp), $this->linkparams);
 	}
 
+	/**
+	  * Parse templatevar comments
+	  */
 	function parse_comments($maxToShow = 0) {
 		if ($maxToShow == 0)
 			$maxToShow = $this->blog->getMaxComments();
@@ -363,9 +465,10 @@
 	function parse_plugin($pluginName) {
 		global $manager;
 
+		// should be already tested from the parser (PARSER.php)
 		// only continue when the plugin is really installed
-		if (!$manager->pluginInstalled('NP_' . $pluginName))
-			return;
+		/*if (!$manager->pluginInstalled('NP_' . $pluginName))
+			return;*/
 
 		$plugin =& $manager->getPlugin('NP_' . $pluginName);
 		if (!$plugin) return;
@@ -382,6 +485,9 @@
 		call_user_func_array(array(&$plugin,'doTemplateVar'), $params);
 	}
 
+	/**
+	  * Parse templatevar edit
+	  */
 	function parse_edit() {
 		global $member, $CONF;
 		if ($this->allowEditAll || ($member->isLoggedIn() && ($member->getID() == $this->currentItem->authorid)) ) {
@@ -389,13 +495,19 @@
 		}
 	}
 
+	/**
+	  * Parse templatevar editlink
+	  */
 	function parse_editlink() {
 		global $CONF;
 		echo $CONF['AdminURL'],'bookmarklet.php?action=edit&amp;itemid=',$this->currentItem->itemid;
 	}
 
+	/**
+	  * Parse templatevar editpopupcode
+	  */
 	function parse_editpopupcode() {
-		echo "if (event &amp;&amp; event.preventDefault) event.preventDefault();winbm=window.open(this.href,'nucleusbm','scrollbars=yes,width=600,height=500,left=10,top=10,status=yes,resizable=yes');winbm.focus();return false;";
+		echo "if (event &amp;&amp; event.preventDefault) event.preventDefault();winbm=window.open(this.href,'nucleusbm','scrollbars=yes,width=600,height=550,left=10,top=10,status=yes,resizable=yes');winbm.focus();return false;";
 	}
 
 	// helper functions
diff -x .svn -aruN 3.33.src/nucleus/libs/MANAGER.php 3.40.src/nucleus/libs/MANAGER.php
--- 3.33.src/nucleus/libs/MANAGER.php	2008-10-06 07:43:46.000000000 -0500
+++ 3.40.src/nucleus/libs/MANAGER.php	2009-02-14 19:36:46.000000000 -0600
@@ -20,7 +20,7 @@
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: MANAGER.php 1150 2007-05-19 23:26:02Z kaigreve $
+ * @version $Id: MANAGER.php 1279 2008-10-23 08:18:26Z shizuki $
  */
 class MANAGER {
 
@@ -131,6 +131,9 @@
 		return (quickQuery('SELECT COUNT(*) as result FROM '.sql_table('category').' WHERE catid='.intval($id)) > 0);
 	}
 
+	/**
+	  * Returns the blog object for a given blogid
+	  */
 	function &getBlog($blogid) {
 		$blog =& $this->blogs[$blogid];
 
@@ -144,11 +147,17 @@
 		return $blog;
 	}
 
+	/**
+	  * Checks if a blog exists
+	  */
 	function existsBlog($name) {
 		$this->_loadClass('BLOG','BLOG.php');
 		return BLOG::exists($name);
 	}
 
+	/**
+	  * Checks if a blog id exists
+	  */
 	function existsBlogID($id) {
 		$this->_loadClass('BLOG','BLOG.php');
 		return BLOG::existsID($id);
@@ -200,17 +209,23 @@
 	}
 
 	/**
-	 * Global parser preferences
+	 * Set the global parser preferences
 	 */
 	function setParserProperty($name, $value) {
 		$this->parserPrefs[$name] = $value;
 	}
+	
+	/**
+	 * Get the global parser preferences
+	 */
 	function getParserProperty($name) {
 		return $this->parserPrefs[$name];
 	}
 
 	/**
-	  * A private helper class to load classes
+	  * A helper function to load a class
+	  * 
+	  *	private
 	  */
 	function _loadClass($name, $filename) {
 		if (!class_exists($name)) {
@@ -219,6 +234,11 @@
 		}
 	}
 
+	/**
+	  * A helper function to load a plugin
+	  * 
+	  *	private
+	  */
 	function _loadPlugin($name) {
 		if (!class_exists($name)) {
 				global $DIR_PLUGINS;
@@ -227,7 +247,7 @@
 
 				if (!file_exists($fileName))
 				{
-					ACTIONLOG::add(WARNING, 'Plugin ' . $name . ' was not loaded (File not found)');
+					ACTIONLOG::add(WARNING, sprintf(_MANAGER_PLUGINFILE_NOTFOUND, $name));
 					return 0;
 				}
 
@@ -237,7 +257,7 @@
 				// check if class exists (avoid errors in eval'd code)
 				if (!class_exists($name))
 				{
-					ACTIONLOG::add(WARNING, 'Plugin ' . $name . ' was not loaded (Class not found in file, possible parse error)');
+					ACTIONLOG::add(WARNING, sprintf(_MANAGER_PLUGINFILE_NOCLASS, $name));
 					return 0;
 				}
 
@@ -252,7 +272,7 @@
 				if (($MYSQL_PREFIX != '') && !$this->plugins[$name]->supportsFeature('SqlTablePrefix'))
 				{
 					unset($this->plugins[$name]);
-					ACTIONLOG::add(WARNING, 'Plugin ' . $name . ' was not loaded (does not support SqlTablePrefix)');
+					ACTIONLOG::add(WARNING, sprintf(_MANAGER_PLUGINTABLEPREFIX_NOTSUPPORT, $name));
 					return 0;
 				}
 
@@ -262,8 +282,14 @@
 		}
 	}
 
+	/**
+	 * Returns a PLUGIN object
+	 */
 	function &getPlugin($name) {
-		$plugin =& $this->plugins[$name];
+		// retrieve the name of the plugin in the right capitalisation
+		$name = $this->getUpperCaseName ($name);
+		// get the plugin	
+		$plugin =& $this->plugins[$name]; 
 
 		if (!$plugin) {
 			// load class if needed
@@ -274,12 +300,13 @@
 	}
 
 	/**
-	  * checks if the given plugin IS loaded or not
+	  * Checks if the given plugin IS loaded or not
 	  */
 	function &pluginLoaded($name) {
 		$plugin =& $this->plugins[$name];
 		return $plugin;
 	}
+		
 	function &pidLoaded($pid) {
 		$plugin=false;
 		reset($this->plugins);
@@ -298,19 +325,35 @@
 		$this->_initCacheInfo('installedPlugins');
 		return ($this->getPidFromName($name) != -1);
 	}
+
 	function pidInstalled($pid) {
 		$this->_initCacheInfo('installedPlugins');
 		return ($this->cachedInfo['installedPlugins'][$pid] != '');
 	}
+
 	function getPidFromName($name) {
 		$this->_initCacheInfo('installedPlugins');
 		foreach ($this->cachedInfo['installedPlugins'] as $pid => $pfile)
 		{
-			if ($pfile == $name)
+			if (strtolower($pfile) == strtolower($name))
 				return $pid;
 		}
 		return -1;
 	}
+
+	/**
+	  * Retrieve the name of a plugin in the right capitalisation
+	  */
+	function getUpperCaseName ($name) {
+		$this->_initCacheInfo('installedPlugins');
+		foreach ($this->cachedInfo['installedPlugins'] as $pid => $pfile)
+		{
+			if (strtolower($pfile) == strtolower($name))
+				return $pfile;
+		}
+		return -1;
+	}
+	
 	function clearCachedInfo($what) {
 		unset($this->cachedInfo[$what]);
 	}
diff -x .svn -aruN 3.33.src/nucleus/libs/MEDIA.php 3.40.src/nucleus/libs/MEDIA.php
--- 3.33.src/nucleus/libs/MEDIA.php	2008-10-06 07:43:46.000000000 -0500
+++ 3.40.src/nucleus/libs/MEDIA.php	2009-02-14 19:36:46.000000000 -0600
@@ -14,7 +14,7 @@
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: MEDIA.php 1116 2007-02-03 08:24:29Z kimitake $
+ * @version $Id: MEDIA.php 1288 2008-12-16 20:20:22Z ftruscot $
  */
 
 
@@ -100,15 +100,28 @@
 	  */
 	function isValidCollection($collectionName) {
 		global $member, $DIR_MEDIA;
-
+	  	 
+		// allow creating new private directory
+		if (preg_match('#^[0-9]+[/\\\\]?$#',$collectionName))
+			return ((int)$member->getID() == (int)$collectionName);
+	  	 
+		// avoid directory traversal
+		// note that preg_replace() is requred to remove the last "/" or "\" if exists
+		$media = realpath($DIR_MEDIA);
+		$media = preg_replace('#[/\\\\]+$#','',$media);
+		$collectionDir = realpath( $DIR_MEDIA . $collectionName );
+		$collectionDir = preg_replace('#[/\\\\]+$#','',$collectionDir);
+		if (strpos($collectionDir,$media)!==0 || $collectionDir == $media) return false;
+	  	 
 		// private collections only accept uploads from their owners
-		if (is_numeric($collectionName))
-			return ($member->getID() == $collectionName);
+		// The "+1" of "strlen($media)+1" corresponds to "/" or "\".
+		$collectionName=substr($collectionDir,strlen($media)+1);
+		if (preg_match('/^[0-9]+$/',$collectionName))
+		return ((int)$member->getID() == (int)$collectionName);
 
 		// other collections should exists and be writable
-		$collectionDir = $DIR_MEDIA . $collectionName;
-		return (@is_dir($collectionDir) || @is_writable($collectionDir));
-	}
+		return (@is_dir($collectionDir) && @is_writable($collectionDir));
+       }
 
 	/**
 	  * Adds an uploaded file to the media archive
diff -x .svn -aruN 3.33.src/nucleus/libs/MEMBER.php 3.40.src/nucleus/libs/MEMBER.php
--- 3.33.src/nucleus/libs/MEMBER.php	2008-10-06 07:43:46.000000000 -0500
+++ 3.40.src/nucleus/libs/MEMBER.php	2009-02-14 19:36:46.000000000 -0600
@@ -15,7 +15,7 @@
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: MEMBER.php 1116 2007-02-03 08:24:29Z kimitake $
+ * @version $Id: MEMBER.php 1299 2009-01-16 23:13:31Z kaigreve $
  */
 class MEMBER {
 
@@ -35,20 +35,31 @@
 	var $admin = 0;			// (either 0 or 1)
 	var $canlogin = 0;		// (either 0 or 1)
 	var $notes;
-
-	// (private)
+	var $autosave = 1;		// if the member use the autosave draft function
+	
+	/**
+	 * Constructor for a member object
+	 */	 	
 	function MEMBER() {
-
+		// do nothing
 	}
 
-	// (static)
+	/**
+	 * Create a member object for a given displayname
+	 *
+	 * @static	 	 
+	 */	 	
 	function &createFromName($displayname) {
 		$mem =& new MEMBER();
 		$mem->readFromName($displayname);
 		return $mem;
 	}
 
-	// (static)
+	/**
+	 * Create a member object for a given ID
+	 *
+	 * @static	 	 
+	 */	
 	function &createFromID($id) {
 		$mem =& new MEMBER();
 		$mem->readFromID($id);
@@ -64,20 +75,35 @@
 	}
 
 	/**
-	  * Tries to login as a given user. Returns true when succeeded,
-	  * returns false when failed
+	  * Tries to login as a given user.
+	  * Returns true when succeeded, returns false when failed
+	  * 3.40 adds CustomLogin event
 	  */
 	function login($login, $password) {
+		global $manager;
 		$this->loggedin = 0;
-		if (!$this->readFromName($login))
-			return 0;
-		if (!$this->checkPassword($password))
+		$success = 0;
+		$allowlocal = 1;
+		$manager->notify('CustomLogin', array('login' => &$login, 'password'=>&$password, 'success'=>&$success, 'allowlocal'=>&$allowlocal) );
+		if ($success && $this->readFromName($login)) {
+			$this->loggedin = 1;
+			return $this->isLoggedIn();
+		}
+		elseif (!$success && $allowlocal) {
+			if (!$this->readFromName($login))
+				return 0;
+			if (!$this->checkPassword($password))
+				return 0;
+			$this->loggedin = 1;
+			return $this->isLoggedIn();
+		}
+		else 
 			return 0;
-		$this->loggedin = 1;
-		return $this->isLoggedIn();
 	}
 
-	// login using cookie key
+	/**
+	 * Login using cookie key
+	 */	 	
 	function cookielogin($login, $cookiekey) {
 		$this->loggedin = 0;
 		if (!$this->readFromName($login))
@@ -96,6 +122,9 @@
 		return $this->loggedin;
 	}
 
+	/**
+	 * Read member information from the database 
+	 */	 	
 	function read($where) {
 		// read info
 		$query =  'SELECT * FROM '.sql_table('member') . ' WHERE ' . $where;
@@ -114,6 +143,7 @@
 		$this->setCanLogin($obj->mcanlogin);
 		$this->setNotes($obj->mnotes);
 		$this->setLanguage($obj->deflang);
+		$this->setAutosave($obj->mautosave);
 
 		return mysql_num_rows($res);
 	}
@@ -154,6 +184,30 @@
 		return (mysql_num_rows($res) != 0);
 	}
 
+	function canAddItem($catid) {
+		global $manager;
+
+		// if this is a 'newcat' style newcat
+		// no blog admin of destination blog -> NOK
+		// blog admin of destination blog -> OK
+		if (strstr($catid,'newcat')) {
+			// get blogid
+			list($blogid) = sscanf($catid,"newcat-%d");
+			return $this->blogAdminRights($blogid);
+		}
+
+		// category does not exist -> NOK
+		if (!$manager->existsCategory($catid)) return 0;
+
+		$blogid = getBlogIDFromCatID($catid);
+
+		// no team rights for blog -> NOK
+		if (!$this->teamRights($blogid)) return 0;
+
+		// all other cases: OK
+		return 1;
+	}
+
 	/**
 	  * Returns true if this member can edit/delete a commentitem. This can be in the
 	  * following cases:
@@ -190,6 +244,15 @@
 	}
 
 	/**
+	  * Return true if member can be deleted. This means that there are no items
+	  * posted by the member left
+	  */
+	function canBeDeleted() {
+		$res = sql_query('SELECT * FROM '.sql_table('item').' WHERE iauthor=' . $this->getID());
+		return (mysql_num_rows($res) == 0);
+	}
+
+	/**
 	  * returns true if this member can move/update an item to a given category,
 	  * false if not (see comments fot the tests that are executed)
 	  *
@@ -246,39 +309,6 @@
 
 	}
 
-	function canAddItem($catid) {
-		global $manager;
-
-		// if this is a 'newcat' style newcat
-		// no blog admin of destination blog -> NOK
-		// blog admin of destination blog -> OK
-		if (strstr($catid,'newcat')) {
-			// get blogid
-			list($blogid) = sscanf($catid,"newcat-%d");
-			return $this->blogAdminRights($blogid);
-		}
-
-		// category does not exist -> NOK
-		if (!$manager->existsCategory($catid)) return 0;
-
-		$blogid = getBlogIDFromCatID($catid);
-
-		// no team rights for blog -> NOK
-		if (!$this->teamRights($blogid)) return 0;
-
-		// all other cases: OK
-		return 1;
-	}
-
-	/**
-	  * Return true if member can be deleted. This means that there are no items
-	  * posted by the member left
-	  */
-	function canBeDeleted() {
-		$res = sql_query('SELECT * FROM '.sql_table('item').' WHERE iauthor=' . $this->getID());
-		return (mysql_num_rows($res) == 0);
-	}
-
 	/**
 	  * Sets the cookies for the member
 	  *
@@ -400,19 +430,20 @@
 			   . "     madmin=" . $this->isAdmin() . ","
 			   . "     mnotes='" . addslashes($this->getNotes()) . "',"
 			   . "     mcanlogin=" . $this->canLogin() . ","
-			   . "	   deflang='" . addslashes($this->getLanguage()) . "'"
+			   . "	   deflang='" . addslashes($this->getLanguage()) . "',"
+			   . "	   mautosave=" . addslashes($this->getAutosave()) . ""			   
 			   . " WHERE mnumber=" . $this->getID();
 		sql_query($query);
 	}
 
-	function checkPassword($pw) {
-		return (md5($pw) == $this->getPassword());
-	}
-
 	function checkCookieKey($key) {
 		return (($key != '') && ($key == $this->getCookieKey()));
 	}
 
+	function checkPassword($pw) {
+		return (md5($pw) == $this->getPassword());
+	}
+
 	function getRealName() {
 		return $this->realname;
 	}
@@ -502,24 +533,43 @@
 	function setNotes($val) {
 		$this->notes = $val;
 	}
+	
+	function getAutosave() {
+		return $this->autosave;
+	}
+
+	function setAutosave($val) {
+		$this->autosave = $val;
+	}
 
 	function getID() {
 		return $this->id;
 	}
 
-	// returns true if there is a member with the given login name (static)
+	/**
+	 * Returns true if there is a member with the given login name
+	 * 
+	 * @static
+	 */	 	
 	function exists($name) {
 		$r = sql_query('select * FROM '.sql_table('member')." WHERE mname='".addslashes($name)."'");
 		return (mysql_num_rows($r) != 0);
 	}
 
-	// returns true if there is a member with the given ID (static)
+	/**
+	 * Returns true if there is a member with the given ID
+	 *
+	 * @static
+	 */	 	 	
 	function existsID($id) {
 		$r = sql_query('select * FROM '.sql_table('member')." WHERE mnumber='".intval($id)."'");
 		return (mysql_num_rows($r) != 0);
 	}
 
-	// checks if a username is protected. If so, it can not be used on anonymous comments
+	/**
+	 *  Checks if a username is protected. 
+	 *  If so, it can not be used on anonymous comments
+	 */	 	 	
 	function isNameProtected($name) {
 
 		// extract name
@@ -529,7 +579,11 @@
 		return MEMBER::exists($name);
 	}
 
-	// adds a new member (static)
+	/**
+	 * Adds a new member
+	 * 
+	 * @static
+	 */	 	 	
 	function create($name, $realname, $password, $email, $url, $admin, $canlogin, $notes) {
 		if (!isValidMailAddress($email))
 			return _ERROR_BADMAILADDRESS;
diff -x .svn -aruN 3.33.src/nucleus/libs/PAGEFACTORY.php 3.40.src/nucleus/libs/PAGEFACTORY.php
--- 3.33.src/nucleus/libs/PAGEFACTORY.php	2008-10-06 07:43:46.000000000 -0500
+++ 3.40.src/nucleus/libs/PAGEFACTORY.php	2009-02-14 19:36:46.000000000 -0600
@@ -12,7 +12,7 @@
 /**
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: PAGEFACTORY.php 1187 2007-08-06 14:43:00Z kaigreve $
+ * @version $Id: PAGEFACTORY.php 1300 2009-01-17 16:49:43Z kaigreve $
  */
 
 /**
@@ -76,7 +76,10 @@
 			'pluginextras',
 			'itemoptions',
 			'extrahead',
-			'ticket'
+			'ticket',
+			'autosave',
+			'autosaveinfo',
+			'ifautosave'
 		);
 
 		// TODO: maybe add 'skin' later on?
@@ -207,6 +210,11 @@
 	function parse_ifitemproperty($name,$value=1) {
 		$this->_addIfCondition(($this->variables[$name] == $value));
 	}
+	
+	function parse_ifautosave($name,$value=1) {
+		global $member;
+		$this->_addIfCondition($member->getAutosave() == $value);
+	}
 
 	function parse_helplink($topic) {
 		help($topic);
@@ -229,7 +237,7 @@
 		$authorid = ($this->method == 'edit') ? $this->variables['authorid'] : '';
 		$this->blog->insertJavaScriptInfo($authorid);
 	}
-
+	
 	// on bookmarklets only: insert extra html header information (by plugins)
 	function parse_extrahead() {
 		global $manager;
@@ -339,9 +347,9 @@
 			case "2":
 				echo '<div class="jsbuttonbar">';
 
-					$this->_jsbutton('bold',"boldThis()",'');
-					$this->_jsbutton('italic',"italicThis()",'');
-					$this->_jsbutton('link',"ahrefThis()",'');
+					$this->_jsbutton('bold',"boldThis()",_ADD_BOLD_TT);
+					$this->_jsbutton('italic',"italicThis()",_ADD_ITALIC_TT);
+					$this->_jsbutton('link',"ahrefThis()",_ADD_HREF_TT);
 					$this->_jsbuttonspacer();
 					$this->_jsbutton('alignleft',"alignleftThis()",_ADD_ALIGNLEFT_TT);
 					$this->_jsbutton('alignright',"alignrightThis()",_ADD_ALIGNRIGHT_TT);
@@ -357,7 +365,7 @@
 						foreach ($btns as $button) {
 							switch($button) {
 								case "media":
-									$this->_jsbutton('media',"addMedia()",'');
+									$this->_jsbutton('media',"addMedia()",_ADD_MEDIA_TT);
 									break;
 							}
 						}
@@ -418,7 +426,7 @@
 				onmouseover="BtnHighlight(this);"
 				onmouseout="BtnNormal(this);"
 				onclick="<?php echo $code?>" >
-				<img src="images/button-<?php echo $type?>.gif" alt="<?php echo $tooltip?>" width="16" height="16"/>
+				<img src="images/button-<?php echo $type?>.gif" alt="<?php echo $tooltip?>" title="<?php echo $tooltip?>" width="16" height="16"/>
 			</span>
 	<?php	}
 
diff -x .svn -aruN 3.33.src/nucleus/libs/PARSER.php 3.40.src/nucleus/libs/PARSER.php
--- 3.33.src/nucleus/libs/PARSER.php	2008-10-06 07:43:46.000000000 -0500
+++ 3.40.src/nucleus/libs/PARSER.php	2009-02-14 19:36:46.000000000 -0600
@@ -12,7 +12,7 @@
 /**
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: PARSER.php 1148 2007-05-19 23:02:46Z kaigreve $
+ * @version $Id: PARSER.php 1224 2007-12-06 23:42:22Z kaigreve $
  */
 
 if ( !function_exists('requestVar') ) exit;
@@ -78,7 +78,7 @@
 	  * handle an action
 	  */
 	function doAction($action) {
-		global $manager;
+		global $manager, $CONF;
 
 		if (!$action) return;
 
@@ -113,11 +113,16 @@
 			call_user_func_array(array(&$this->handler,'parse_' . $actionlc), $params);
 		} else {
 			// redirect to plugin action if possible
-			if (in_array('plugin', $this->actions) && $manager->pluginInstalled('NP_'.$action))
+			if (in_array('plugin', $this->actions) && $manager->pluginInstalled('NP_'.$action)) {
 				$this->doAction('plugin('.$action.$this->pdelim.implode($this->pdelim,$params).')');
-			else
+			}
+			else {
+				if ($CONF['DebugVars']==true) {
 				echo '&lt;%' , $action , '(', implode($this->pdelim, $params), ')%&gt;';
 		}
+			}
+			
+		}
 
 	}
 
diff -x .svn -aruN 3.33.src/nucleus/libs/PLUGIN.php 3.40.src/nucleus/libs/PLUGIN.php
--- 3.33.src/nucleus/libs/PLUGIN.php	2008-10-06 07:43:46.000000000 -0500
+++ 3.40.src/nucleus/libs/PLUGIN.php	2009-02-14 19:36:46.000000000 -0600
@@ -17,7 +17,7 @@
 	 *
 	 * @license http://nucleuscms.org/license.txt GNU General Public License
 	 * @copyright Copyright (C) 2002-2007 The Nucleus Group
-	 * @version $Id: PLUGIN.php 1196 2007-09-05 07:39:40Z kimitake $
+	 * @version $Id: PLUGIN.php 1279 2008-10-23 08:18:26Z shizuki $
 	 */
 	class NucleusPlugin {
 
@@ -56,7 +56,7 @@
 			array_unshift($args, 'template');
 			call_user_func_array(array(&$this,'doSkinVar'),$args);
 		}
-		function doAction($type) { return 'No Such Action'; }
+		function doAction($type) { return _ERROR_PLUGIN_NOSUCHACTION; }
 		function doIf($key,$value) { return false; }
 		function doItemVar () {}
 
@@ -225,57 +225,19 @@
 		}
 
 		/**
-		 * Retrieves an array of the top (or bottom) of an option from a plugin.
-		 * @author TeRanEX
-		 * @param  string $context the context for the option: item, blog, member,...
-		 * @param  string $name    the name of the option
-		 * @param  int    $amount  how many rows must be returned
-		 * @param  string $sort    desc or asc
-		 * @return array           array with both values and contextid's
-		 * @access private
-		 */
-		function _getOptionTop($context, $name, $amount = 10, $sort = 'desc') {
-			if (($sort != 'desc') && ($sort != 'asc')) {
-				$sort= 'desc';
-			}
-
-			$oid = $this->_getOID($context, $name);
-
-			// retrieve the data and return
-			$q = 'SELECT otype, oextra FROM '.sql_table('plugin_option_desc').' WHERE oid = '.$oid;
-			$query = sql_query($q);
-
-			$o = mysql_fetch_array($query);
-
-			if (($this->optionCanBeNumeric($o['otype'])) && ($o['oextra'] == 'number' )) {
-				$orderby = 'CAST(ovalue AS SIGNED)';
-			} else {
-				$orderby = 'ovalue';
-			}
-			$q = 'SELECT ovalue value, ocontextid id FROM '.sql_table('plugin_option').' WHERE oid = '.$oid.' ORDER BY '.$orderby.' '.$sort.' LIMIT 0,'.intval($amount);
-			$query = sql_query($q);
-
-			// create the array
-			$i = 0;
-			$top = array();
-			while($row = mysql_fetch_array($query)) {
-				$top[$i++] = $row;
-			}
-
-			// return the array (duh!)
-			return $top;
-		}
-
-		/**
 		  * Returns the plugin ID
+		  * 
+		  * public		  		  
 		  */
 		function getID() {
 			return $this->plugid;
 		}
 
 		/**
-		  * returns the URL of the admin area for this plugin (in case there's
+		  * Returns the URL of the admin area for this plugin (in case there's
 		  * no such area, the returned information is invalid)
+		  * 
+		  * public		  		  
 		  */
 		function getAdminURL() {
 			global $CONF;
@@ -285,6 +247,8 @@
 		/**
 		  * Returns the directory where the admin directory is located and
 		  * where the plugin can maintain his extra files
+		  * 
+		  * public		  		  
 		  */
 		function getDirectory() {
 			global $DIR_PLUGINS;
@@ -292,30 +256,92 @@
 		}
 
 		/**
-		  * Derives the short name for the plugin from the classname (all lowercase)
+		  * Derives the short name for the plugin from the classname (all 
+		  * lowercase)
+		  * 
+		  * public		  		  
 		  */
 		function getShortName() {
 			return str_replace('np_','',strtolower(get_class($this)));
 		}
 
+		/**
+		 *	Clears the option value cache which saves the option values during
+		 *	the plugin execution. This function is usefull if the options has 
+		 *	changed during the plugin execution (especially in association with
+		 *	the PrePluginOptionsUpdate and the PostPluginOptionsUpdate events)
+		 *	
+		 *  public		 		 
+		 **/		 		
+		function clearOptionValueCache(){
+			$this->_aOptionValues = array();
+			$this->plugin_options = 0;
+		}
+
+		// internal functions of the class starts here
+
 		var $_aOptionValues;	// oid_contextid => value
 		var $_aOptionToInfo;	// context_name => array('oid' => ..., 'default' => ...)
 		var $plugin_options;	// see getOption()
 		var $plugid;			// plugin id
 
 
-		// constructor. Initializes some internal data
+		/**
+		 * Class constructor: Initializes some internal data
+		 */		 		 		
 		function NucleusPlugin() {
 			$this->_aOptionValues = array();	// oid_contextid => value
 			$this->_aOptionToInfo = array();	// context_name => array('oid' => ..., 'default' => ...)
 			$this->plugin_options = 0;
 		}
 
-		function clearOptionValueCache(){
-			$this->_aOptionValues = array();
+		/**
+		 * Retrieves an array of the top (or bottom) of an option from a plugin.
+		 * @author TeRanEX
+		 * @param  string $context the context for the option: item, blog, member,...
+		 * @param  string $name    the name of the option
+		 * @param  int    $amount  how many rows must be returned
+		 * @param  string $sort    desc or asc
+		 * @return array           array with both values and contextid's
+		 * @access private
+		 */
+		function _getOptionTop($context, $name, $amount = 10, $sort = 'desc') {
+			if (($sort != 'desc') && ($sort != 'asc')) {
+				$sort= 'desc';
+			}
+
+			$oid = $this->_getOID($context, $name);
+
+			// retrieve the data and return
+			$q = 'SELECT otype, oextra FROM '.sql_table('plugin_option_desc').' WHERE oid = '.$oid;
+			$query = sql_query($q);
+
+			$o = mysql_fetch_array($query);
+
+			if (($this->optionCanBeNumeric($o['otype'])) && ($o['oextra'] == 'number' )) {
+				$orderby = 'CAST(ovalue AS SIGNED)';
+			} else {
+				$orderby = 'ovalue';
+			}
+			$q = 'SELECT ovalue value, ocontextid id FROM '.sql_table('plugin_option').' WHERE oid = '.$oid.' ORDER BY '.$orderby.' '.$sort.' LIMIT 0,'.intval($amount);
+			$query = sql_query($q);
+
+			// create the array
+			$i = 0;
+			$top = array();
+			while($row = mysql_fetch_array($query)) {
+				$top[$i++] = $row;
+			}
+
+			// return the array (duh!)
+			return $top;
 		}
 
-		// private
+		/**
+		 * Creates an option in the database table plugin_option_desc
+		 *		 
+		 * private
+		 */		 		 		
 		function _createOption($context, $name, $desc, $type, $defValue, $typeExtras = '') {
 			// create in plugin_option_desc
 			$query = 'INSERT INTO ' . sql_table('plugin_option_desc')
@@ -336,7 +362,12 @@
 		}
 
 
-		// private
+		/**
+		 * Deletes an option from the database tables
+		 * plugin_option and plugin_option_desc 
+		 *
+		 * private		 
+		 */		 		 		
 		function _deleteOption($context, $name) {
 			$oid = $this->_getOID($context, $name);
 			if (!$oid) return 0; // no such option
@@ -354,8 +385,10 @@
 		}
 
 		/**
-		 * private
+		 * Update an option in the database table plugin_option
+		 * 		 
 		 * returns: 1 on success, 0 on failure
+		 * private
 		 */
 		function _setOption($context, $contextid, $name, $value) {
 			global $manager;
@@ -393,7 +426,13 @@
 			return 1;
 		}
 
-		// private
+		/**
+		 * Get an option from Cache or database
+		 * 	 - if not in the option Cache read it from the database
+		 *   - if not in the database write default values into the database
+		 *   		  
+		 * private		 
+		 */		 		 		
 		function _getOption($context, $contextid, $name) {
 			$oid = $this->_getOID($context, $name);
 			if (!$oid) return '';
@@ -425,8 +464,10 @@
 		}
 
 		/**
-		 * Returns assoc array with all values for a given option (one option per
-		 * possible context id)
+		 * Returns assoc array with all values for a given option 
+		 * (one option per possible context id)
+		 * 
+		 * private		 		 
 		 */
 		function _getAllOptions($context, $name) {
 			$oid = $this->_getOID($context, $name);
diff -x .svn -aruN 3.33.src/nucleus/libs/PLUGINADMIN.php 3.40.src/nucleus/libs/PLUGINADMIN.php
--- 3.33.src/nucleus/libs/PLUGINADMIN.php	2008-10-06 07:43:46.000000000 -0500
+++ 3.40.src/nucleus/libs/PLUGINADMIN.php	2009-02-14 19:36:46.000000000 -0600
@@ -15,7 +15,7 @@
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: PLUGINADMIN.php 1151 2007-05-19 23:38:50Z kaigreve $
+ * @version $Id: PLUGINADMIN.php 1279 2008-10-23 08:18:26Z shizuki $
  */
 
 global $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_COOKIE_VARS, $HTTP_ENV_VARS, $HTTP_POST_FILES, $HTTP_SESSION_VARS;
@@ -68,13 +68,13 @@
 
 		// check if plugin exists and is installed
 		if (!$manager->pluginInstalled($this->strFullName))
-			doError('Invalid plugin');
+			doError(_ERROR_INVALID_PLUGIN);
 
 		$this->plugin =& $manager->getPlugin($this->strFullName);
 		$this->bValid = $this->plugin;
 
 		if (!$this->bValid)
-			doError('Invalid plugin');
+			doError(_ERROR_INVALID_PLUGIN);
 
 		$this->admin = new ADMIN();
 		$this->admin->action = 'plugin_' . $pluginName;
@@ -140,7 +140,7 @@
       else document.forms[i].action+='&'+'ticket=<?php echo $ticket; ?>';
       continue;
     }
-    document.write('<p><b>Error occured druing automatic addition of tickets.</b></p>');
+    document.write('<?php echo _PLUGINADMIN_TICKETS_JAVASCRIPT ?>');
     j=document.forms[i].outerHTML;
     while (j!=j.replace('<','&lt;')) j=j.replace('<','&lt;');
     document.write('<p>'+j+'</p>');
diff -x .svn -aruN 3.33.src/nucleus/libs/SEARCH.php 3.40.src/nucleus/libs/SEARCH.php
--- 3.33.src/nucleus/libs/SEARCH.php	2008-10-06 07:43:46.000000000 -0500
+++ 3.40.src/nucleus/libs/SEARCH.php	2009-02-14 19:36:46.000000000 -0600
@@ -20,7 +20,7 @@
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: SEARCH.php 1116 2007-02-03 08:24:29Z kimitake $
+ * @version $Id: SEARCH.php 1266 2008-08-31 10:20:51Z dekarma $
  */
 
 
diff -x .svn -aruN 3.33.src/nucleus/libs/SKIN.php 3.40.src/nucleus/libs/SKIN.php
--- 3.33.src/nucleus/libs/SKIN.php	2008-10-06 07:43:46.000000000 -0500
+++ 3.40.src/nucleus/libs/SKIN.php	2009-02-14 19:36:46.000000000 -0600
@@ -14,7 +14,7 @@
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: SKIN.php 1198 2007-09-05 07:44:35Z kimitake $
+ * @version $Id: SKIN.php 1247 2008-02-11 14:28:05Z kaigreve $
  */
 
 if ( !function_exists('requestVar') ) exit;
@@ -297,7 +297,9 @@
 								'ifnot',
 								'elseifnot',
 								'charset',
-								'bloglist'
+								'bloglist',
+								'addlink',
+								'addpopupcode'
 								);
 
 		// extra actions specific for a certain skin type
diff -x .svn -aruN 3.33.src/nucleus/libs/TEMPLATE.php 3.40.src/nucleus/libs/TEMPLATE.php
--- 3.33.src/nucleus/libs/TEMPLATE.php	2008-10-06 07:43:46.000000000 -0500
+++ 3.40.src/nucleus/libs/TEMPLATE.php	2009-02-14 19:36:46.000000000 -0600
@@ -15,7 +15,7 @@
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: TEMPLATE.php 1116 2007-02-03 08:24:29Z kimitake $
+ * @version $Id: TEMPLATE.php 1269 2008-09-17 21:52:23Z ftruscot $
  */
 class TEMPLATE {
 
@@ -118,6 +118,14 @@
 	 * @param $name name of the template file
 	 */
 	function read($name) {
+		global $manager;
+		$manager->notify(
+			'PreTemplateRead',
+			array(
+				'template' => &$name
+			)
+		);
+			
 		$query = 'SELECT tpartname, tcontent'
 			   . ' FROM '.sql_table('template_desc').', '.sql_table('template')
 			   . ' WHERE tdesc=tdnumber and tdname="' . addslashes($name) . '"';
diff -x .svn -aruN 3.33.src/nucleus/libs/backup.php 3.40.src/nucleus/libs/backup.php
--- 3.33.src/nucleus/libs/backup.php	2008-10-06 07:43:46.000000000 -0500
+++ 3.40.src/nucleus/libs/backup.php	2009-02-14 19:36:46.000000000 -0600
@@ -16,485 +16,515 @@
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: backup.php 1183 2007-07-15 15:06:31Z kaigreve $
+ * @version $Id: backup.php 1281 2008-10-24 06:01:23Z shizuki $
  */
 
 
-/**
-  * This function creates an sql dump of the database and sends it to
-  * the user as a file (can be gzipped if they want)
-  *
-  * @requires
-  *		no output may have preceded (new headers are sent)
-  * @param gzip
-  *		1 = compress backup file, 0 = no compression (default)
-  */
-function do_backup($gzip = 0) {
-	global $manager;
-
-	// tables of which backup is needed
-	$tables = array(
-					sql_table('actionlog'),
-					sql_table('ban'),
-					sql_table('blog'),
-					sql_table('comment'),
-					sql_table('config'),
-					sql_table('item'),
-					sql_table('karma'),
-					sql_table('member'),
-					sql_table('skin'),
-					sql_table('skin_desc'),
-					sql_table('team'),
-					sql_table('template'),
-					sql_table('template_desc'),
-					sql_table('plugin'),
-					sql_table('plugin_event'),
-					sql_table('plugin_option'),
-					sql_table('plugin_option_desc'),
-					sql_table('category'),
-					sql_table('activation'),
-					sql_table('tickets'),
-			  );
-
-	// add tables that plugins want to backup to the list
-	// catch all output generated by plugins
-	ob_start();
-	$res = sql_query('SELECT pfile FROM '.sql_table('plugin'));
-	while ($plugName = mysql_fetch_object($res)) {
-		$plug =& $manager->getPlugin($plugName->pfile);
-		if ($plug) $tables = array_merge($tables, (array) $plug->getTableList());
-	}
-	ob_end_clean();
-
-	// remove duplicates
-	$tables = array_unique($tables);
-
-	// make sure browsers don't cache the backup
-	header("Pragma: no-cache");
-
-	// don't allow gzip compression when extension is not loaded
-	if (($gzip != 0) && !extension_loaded("zlib"))
-		$gzip = 0;
+class Backup
+{ 
 
-
-
-	if ($gzip) {
-		// use an output buffer
-		@ob_start();
-		@ob_implicit_flush(0);
-
-		// set filename
-		$filename = 'nucleus_db_backup_'.strftime("%Y%m%d", time()).".sql.gz";
-	} else {
-		$filename = 'nucleus_db_backup_'.strftime("%Y%m%d", time()).".sql";
-	}
-
-
-	// send headers that tell the browser a file is coming
-	header("Content-Type: text/x-delimtext; name=\"$filename\"");
-	header("Content-disposition: attachment; filename=$filename");
-
-	// dump header
-	echo "#\n";
-	echo "# This is a backup file generated by Nucleus \n";
-	echo "# http://www.nucleuscms.org/\n";
-	echo "#\n";
-	echo "# backup-date: " .  gmdate("d-m-Y H:i:s", time()) . " GMT\n";
-	global $nucleus;
-	echo "# Nucleus CMS version: " . $nucleus['version'] . "\n";
-	echo "#\n";
-	echo "# WARNING: Only try to restore on servers running the exact same version of Nucleus\n";
-	echo "#\n";
-
-	// dump all tables
-	reset($tables);
-	array_walk($tables, '_backup_dump_table');
-
-	if($gzip)
+	/**
+	 * Constructor
+	 */
+	function Backup()
 	{
-		$Size = ob_get_length();
-		$Crc = crc32(ob_get_contents());
-		$contents = gzcompress(ob_get_contents());
+		// do nothing
+	}
+	
+	
+	/**
+	  * This function creates an sql dump of the database and sends it to
+	  * the user as a file (can be gzipped if they want)
+	  *
+	  * @requires
+	  *		no output may have preceded (new headers are sent)
+	  * @param gzip
+	  *		1 = compress backup file, 0 = no compression (default)
+	  */
+	function do_backup($gzip = 0) {
+		global $manager;
+		
+		// tables of which backup is needed
+		$tables = array(
+						sql_table('actionlog'),
+						sql_table('ban'),
+						sql_table('blog'),
+						sql_table('comment'),
+						sql_table('config'),
+						sql_table('item'),
+						sql_table('karma'),
+						sql_table('member'),
+						sql_table('skin'),
+						sql_table('skin_desc'),
+						sql_table('team'),
+						sql_table('template'),
+						sql_table('template_desc'),
+						sql_table('plugin'),
+						sql_table('plugin_event'),
+						sql_table('plugin_option'),
+						sql_table('plugin_option_desc'),
+						sql_table('category'),
+						sql_table('activation'),
+						sql_table('tickets'),
+				  );
+		
+		// add tables that plugins want to backup to the list
+		// catch all output generated by plugins
+		ob_start();
+		$res = sql_query('SELECT pfile FROM '.sql_table('plugin'));
+		while ($plugName = mysql_fetch_object($res)) {
+			$plug =& $manager->getPlugin($plugName->pfile);
+			if ($plug) $tables = array_merge($tables, (array) $plug->getTableList());
+		}
 		ob_end_clean();
-		echo "\x1f\x8b\x08\x00\x00\x00\x00\x00".substr($contents, 0, strlen($contents) - 4).gzip_PrintFourChars($Crc).gzip_PrintFourChars($Size);
+		
+		// remove duplicates
+		$tables = array_unique($tables);
+		
+		// make sure browsers don't cache the backup
+		header("Pragma: no-cache");
+		
+		// don't allow gzip compression when extension is not loaded
+		if (($gzip != 0) && !extension_loaded("zlib")) {
+			$gzip = 0;
+		}
+		
+		if ($gzip) {
+			// use an output buffer
+			@ob_start();
+			@ob_implicit_flush(0);
+		
+		// set filename
+		$filename = 'nucleus_db_backup_'.strftime("%Y-%m-%d-%H-%M-%S", time()).".sql.gz";
+		} else {
+		$filename = 'nucleus_db_backup_'.strftime("%Y-%m-%d-%H-%M-%S", time()).".sql";
+		}
+		
+		
+		// send headers that tell the browser a file is coming
+		header("Content-Type: text/x-delimtext; name=\"$filename\"");
+		header("Content-disposition: attachment; filename=$filename");
+		
+		// dump header
+		echo "#\n";
+		echo "# This is a backup file generated by Nucleus \n";
+		echo "# http://www.nucleuscms.org/\n";
+		echo "#\n";
+		echo "# backup-date: " .  gmdate("d-m-Y H:i:s", time()) . " GMT\n";
+		global $nucleus;
+		echo "# Nucleus CMS version: " . $nucleus['version'] . "\n";
+		echo "#\n";
+		echo "# WARNING: Only try to restore on servers running the exact same version of Nucleus\n";
+		echo "#\n";
+		
+		// dump all tables
+		reset($tables);
+		array_walk($tables, array(&$this, '_backup_dump_table'));
+		
+		if($gzip) {
+			$Size = ob_get_length();
+			$Crc = crc32(ob_get_contents());
+			$contents = gzcompress(ob_get_contents());
+			ob_end_clean();
+			echo "\x1f\x8b\x08\x00\x00\x00\x00\x00".substr($contents, 0, strlen($contents) - 4).$this->gzip_PrintFourChars($Crc).$this->gzip_PrintFourChars($Size);
+		}
+		
+		exit;
+	
 	}
-
-	exit;
-
-}
-
-
-/**
-  * Creates a dump for a single table
-  * ($tablename and $key are filled in by array_walk)
-  */
-function _backup_dump_table($tablename, $key) {
-
-	echo "#\n";
-	echo "# TABLE: " . $tablename . "\n";
-	echo "#\n";
-
-	// dump table structure
-	_backup_dump_structure($tablename);
-
-	// dump table contents
-	_backup_dump_contents($tablename);
-}
-
-function _backup_dump_structure($tablename) {
-
-	// add command to drop table on restore
-	echo "DROP TABLE IF EXISTS $tablename;\n";
-	echo "CREATE TABLE $tablename(\n";
-
-	//
-	// Ok lets grab the fields...
-	//
-	$result = mysql_query("SHOW FIELDS FROM $tablename");
-	$row = mysql_fetch_array($result);
-	while ($row) {
-
-		echo '	' . $row['Field'] . ' ' . $row['Type'];
-
-		if(isset($row['Default']))
-			echo ' DEFAULT \'' . $row['Default'] . '\'';
-
-		if($row['Null'] != "YES")
-			echo ' NOT NULL';
-
-		if($row['Extra'] != "")
-			echo ' ' . $row['Extra'];
-
-		$row = mysql_fetch_array($result);
-
-		// add comma's except for last one
-		if ($row)
-			echo ",\n";
-	}
-
-	//
-	// Get any Indexed fields from the database...
-	//
-	$result = mysql_query("SHOW KEYS FROM $tablename");
-	while($row = mysql_fetch_array($result)) {
-		$kname = $row['Key_name'];
-
-		if(($kname != 'PRIMARY') && ($row['Non_unique'] == 0))
-			$kname = "UNIQUE|$kname";
-		if(($kname != 'PRIMARY') && ($row['Index_type'] == 'FULLTEXT'))
-			$kname = "FULLTEXT|$kname";
-
-		if(!is_array($index[$kname]))
-			$index[$kname] = array();
-
-		$index[$kname][] = $row['Column_name'] . ( ($row['Sub_part']) ? ' (' . $row['Sub_part'] . ')' : '');
-	}
-
-	while(list($x, $columns) = @each($index)) {
-		echo ", \n";
-
-		if($x == 'PRIMARY')
-			echo '	PRIMARY KEY (' . implode($columns, ', ') . ')';
-		elseif (substr($x,0,6) == 'UNIQUE')
-			echo '	UNIQUE KEY ' . substr($x,7) . ' (' . implode($columns, ', ') . ')';
-		elseif (substr($x,0,8) == 'FULLTEXT')
-			echo '	FULLTEXT KEY ' . substr($x,9) . ' (' . implode($columns, ', ') . ')';
-		elseif (($x == 'ibody') || ($x == 'cbody'))			// karma 2004-05-30 quick and dirty fix. fulltext keys were not in SQL correctly.
-			echo '	FULLTEXT KEY ' . substr($x,9) . ' (' . implode($columns, ', ') . ')';
-		else
-			echo "	KEY $x (" . implode($columns, ', ') . ')';
+	
+	
+	/**
+	  * Creates a dump for a single table
+	  * ($tablename and $key are filled in by array_walk)
+	  */
+	function _backup_dump_table($tablename, $key) {
+	
+		echo "#\n";
+		echo "# TABLE: " . $tablename . "\n";
+		echo "#\n";
+	
+		// dump table structure
+		$this->_backup_dump_structure($tablename);
+	
+		// dump table contents
+		$this->_backup_dump_contents($tablename);
 	}
 
-	echo "\n);\n\n";
-}
-
-/**
- * Returns the field named for the given table in the 
- * following format:
- *
- * (column1, column2, ..., columnn)
- */
-function _backup_get_field_names($result, $num_fields) {
-
-/*	if (function_exists('mysqli_fetch_fields') ) {
+	/**
+	  * Creates a dump of the table structure for one table
+	  */
+	function _backup_dump_structure($tablename) {
+	
+		// add command to drop table on restore
+		echo "DROP TABLE IF EXISTS $tablename;\n";
+		echo "CREATE TABLE $tablename(\n";
+	
+		//
+		// Ok lets grab the fields...
+		//
+		$result = mysql_query("SHOW FIELDS FROM $tablename");
+		$row = mysql_fetch_array($result);
+		while ($row) {
+	
+			echo '	`' . $row['Field'] . '` ' . $row['Type'];
+	
+			if(isset($row['Default']))
+				echo ' DEFAULT \'' . $row['Default'] . '\'';
+	
+			if($row['Null'] != "YES")
+				echo ' NOT NULL';
+	
+			if($row['Extra'] != "")
+				echo ' ' . $row['Extra'];
+	
+			$row = mysql_fetch_array($result);
+	
+			// add comma's except for last one
+			if ($row)
+				echo ",\n";
+		}
 		
-		$fields = mysqli_fetch_fields($result);
-		for ($j = 0; $j < $num_fields; $j++)
-			$fields[$j] = $fields[$j]->name;
-
-	} else {*/
-
-		$fields = array();
-		for ($j = 0; $j < $num_fields; $j++) {
-			$fields[] = mysql_field_name($result, $j);
+		//
+		// Get any Indexed fields from the database...
+		//
+		$result = mysql_query("SHOW KEYS FROM $tablename");
+		while($row = mysql_fetch_array($result)) {
+			$kname = $row['Key_name'];
+	
+			if(($kname != 'PRIMARY') && ($row['Non_unique'] == 0))
+				$kname = "UNIQUE|$kname";
+			if(($kname != 'PRIMARY') && ($row['Index_type'] == 'FULLTEXT'))
+				$kname = "FULLTEXT|$kname";
+	
+			if(!is_array($index[$kname]))
+				$index[$kname] = array();
+	
+			$index[$kname][] = $row['Column_name'] . ( ($row['Sub_part']) ? ' (' . $row['Sub_part'] . ')' : '');
 		}
 
-/*	}*/
+		while(list($x, $columns) = @each($index)) {
+			echo ", \n";
 	
-	return '(' . implode(', ', $fields) . ')';	
-}
-
-function _backup_dump_contents($tablename) {
-	//
-	// Grab the data from the table.
-	//
-	$result = mysql_query("SELECT * FROM $tablename");
-
-	if(mysql_num_rows($result) > 0)
-		echo "\n#\n# Table Data for $tablename\n#\n";
-		
-	$num_fields = mysql_num_fields($result);
-	
-	//
-	// Compose fieldname list
-	//
-	$tablename_list = _backup_get_field_names($result, $num_fields);
-		
-	//
-	// Loop through the resulting rows and build the sql statement.
-	//
-	while ($row = mysql_fetch_array($result))
-	{
-		// Start building the SQL statement.
-
-		echo "INSERT INTO $tablename $tablename_list VALUES(";
+			if($x == 'PRIMARY')
+				echo '	PRIMARY KEY (`' . implode($columns, '`, `') . '`)';
+			elseif (substr($x,0,6) == 'UNIQUE')
+				echo '	UNIQUE KEY ' . substr($x,7) . ' (`' . implode($columns, '`, `') . '`)';
+			elseif (substr($x,0,8) == 'FULLTEXT')
+				echo '	FULLTEXT KEY ' . substr($x,9) . ' (`' . implode($columns, '`, `') . '`)';
+			elseif (($x == 'ibody') || ($x == 'cbody'))			// karma 2004-05-30 quick and dirty fix. fulltext keys were not in SQL correctly.
+				echo '	FULLTEXT KEY ' . substr($x,9) . ' (`' . implode($columns, '`, `') . '`)';
+			else
+				echo "	KEY $x (`" . implode($columns, '`, `') . '`)';
+		}
+	
+		echo "\n);\n\n";
+	}
 
-		// Loop through the rows and fill in data for each column
-		for ($j = 0; $j < $num_fields; $j++) {
-			if(!isset($row[$j])) {
-				// no data for column
-				echo ' NULL';
-			} elseif ($row[$j] != '') {
-				// data
-				echo " '" . addslashes($row[$j]) . "'";
-			} else {
-				// empty column (!= no data!)
-				echo "''";
+	/**
+	 * Returns the field named for the given table in the 
+	 * following format:
+	 *
+	 * (column1, column2, ..., columnn)
+	 */
+	function _backup_get_field_names($result, $num_fields) {
+	
+	/*	if (function_exists('mysqli_fetch_fields') ) {
+			
+			$fields = mysqli_fetch_fields($result);
+			for ($j = 0; $j < $num_fields; $j++)
+				$fields[$j] = $fields[$j]->name;
+	
+		} else {*/
+	
+			$fields = array();
+			for ($j = 0; $j < $num_fields; $j++) {
+				$fields[] = mysql_field_name($result, $j);
 			}
+	
+	/*	}*/
+		
+		return '(`' . implode('`, `', $fields) . '`)';	
+	}
 
-			// only add comma when not last column
-			if ($j != ($num_fields - 1))
-				echo ",";
+	/**
+	  * Creates a dump of the table content for one table	  
+	  */
+	function _backup_dump_contents($tablename) {
+		//
+		// Grab the data from the table.
+		//
+		$result = mysql_query("SELECT * FROM $tablename");
+	
+		if(mysql_num_rows($result) > 0)
+			echo "\n#\n# Table Data for $tablename\n#\n";
+			
+		$num_fields = mysql_num_fields($result);
+		
+		//
+		// Compose fieldname list
+		//
+		$tablename_list = $this->_backup_get_field_names($result, $num_fields);
+			
+		//
+		// Loop through the resulting rows and build the sql statement.
+		//
+		while ($row = mysql_fetch_array($result))
+		{
+			// Start building the SQL statement.
+	
+			echo "INSERT INTO `".$tablename."` $tablename_list VALUES(";
+	
+			// Loop through the rows and fill in data for each column
+			for ($j = 0; $j < $num_fields; $j++) {
+				if(!isset($row[$j])) {
+					// no data for column
+					echo ' NULL';
+				} elseif ($row[$j] != '') {
+					// data
+					echo " '" . addslashes($row[$j]) . "'";
+				} else {
+					// empty column (!= no data!)
+					echo "''";
+				}
+	
+				// only add comma when not last column
+				if ($j != ($num_fields - 1))
+					echo ",";
+			}
+	
+			echo ");\n";
+	
 		}
-
-		echo ");\n";
-
+	
+	
+		echo "\n";
+	
 	}
 
-
-	echo "\n";
-
-}
-
-// copied from phpBB
-function gzip_PrintFourChars($Val)
-{
-	for ($i = 0; $i < 4; $i ++)
+	/**
+	 * copied from phpBB
+	 */	 	
+	function gzip_PrintFourChars($Val)
 	{
-		$return .= chr($Val % 256);
-		$Val = floor($Val / 256);
+		for ($i = 0; $i < 4; $i ++)
+		{
+			$return .= chr($Val % 256);
+			$Val = floor($Val / 256);
+		}
+		return $return;
 	}
-	return $return;
-}
 
-function do_restore() {
-
-	$uploadInfo = postFileInfo('backup_file');
-
-	// first of all: get uploaded file:
-	if (empty($uploadInfo['name']))
-		return 'No file uploaded';
-	if (!is_uploaded_file($uploadInfo['tmp_name']))
-		return 'No file uploaded';
-
-	$backup_file_name = $uploadInfo['name'];
-	$backup_file_tmpname = $uploadInfo['tmp_name'];
-	$backup_file_type = $uploadInfo['type'];
-
-	if (!file_exists($backup_file_tmpname))
-		return 'File Upload Error';
-
-	if (!preg_match("/^(text\/[a-zA-Z]+)|(application\/(x\-)?gzip(\-compressed)?)|(application\/octet-stream)$/is", $backup_file_type) )
-		return 'The uploaded file is not of the correct type';
-
-
-
-	if (preg_match("/\.gz/is",$backup_file_name))
-		$gzip = 1;
-	else
-		$gzip = 0;
-
-	if (!extension_loaded("zlib") && $gzip)
-		return "Cannot decompress gzipped backup (zlib package not installed)";
-
-	// get sql query according to gzip setting (either decompress, or not)
-	if($gzip)
-	{
-		// decompress and read
-		$gz_ptr = gzopen($backup_file_tmpname, 'rb');
-		$sql_query = "";
-		while( !gzeof($gz_ptr) )
-			$sql_query .= gzgets($gz_ptr, 100000);
-	} else {
-		// just read
-		$fsize = filesize($backup_file_tmpname);
-		if ($fsize <= 0)
-			$sql_query = '';
+	/**
+	 * Restores a database backup
+	 */	
+	function do_restore() {
+	
+		$uploadInfo = postFileInfo('backup_file');
+	
+		// first of all: get uploaded file:
+		if (empty($uploadInfo['name']))
+			return 'No file uploaded';
+		if (!is_uploaded_file($uploadInfo['tmp_name']))
+			return 'No file uploaded';
+	
+		$backup_file_name = $uploadInfo['name'];
+		$backup_file_tmpname = $uploadInfo['tmp_name'];
+		$backup_file_type = $uploadInfo['type'];
+	
+		if (!file_exists($backup_file_tmpname))
+			return 'File Upload Error';
+	
+		if (!preg_match("/^(text\/[a-zA-Z]+)|(application\/(x\-)?gzip(\-compressed)?)|(application\/octet-stream)$/is", $backup_file_type) )
+			return 'The uploaded file is not of the correct type';
+	
+	
+		if (preg_match("/\.gz/is",$backup_file_name))
+			$gzip = 1;
 		else
-			$sql_query = fread(fopen($backup_file_tmpname, 'r'), $fsize);
+			$gzip = 0;
+	
+		if (!extension_loaded("zlib") && $gzip)
+			return "Cannot decompress gzipped backup (zlib package not installed)";
+	
+		// get sql query according to gzip setting (either decompress, or not)
+		if($gzip)
+		{
+			// decompress and read
+			$gz_ptr = gzopen($backup_file_tmpname, 'rb');
+			$sql_query = "";
+			while( !gzeof($gz_ptr) )
+				$sql_query .= gzgets($gz_ptr, 100000);
+		} else {
+			// just read
+			$fsize = filesize($backup_file_tmpname);
+			if ($fsize <= 0)
+				$sql_query = '';
+			else
+				$sql_query = fread(fopen($backup_file_tmpname, 'r'), $fsize);
+		}
+	
+		// time to execute the query
+		$this->_execute_queries($sql_query);
 	}
 
-	// time to execute the query
-	_execute_queries($sql_query);
-}
-
-function _execute_queries($sql_query) {
-	if (!$sql_query) return;
-
-	// Strip out sql comments...
-	$sql_query = remove_remarks($sql_query);
-	$pieces = split_sql_file($sql_query);
-
-	$sql_count = count($pieces);
-	for($i = 0; $i < $sql_count; $i++)
-	{
-		$sql = trim($pieces[$i]);
-
-		if(!empty($sql) and $sql[0] != "#")
+	/**
+	 * Executes a SQL query
+	 */	
+	function _execute_queries($sql_query) {
+		if (!$sql_query) return;
+	
+		// Strip out sql comments...
+		$sql_query = $this->remove_remarks($sql_query);
+		$pieces = $this->split_sql_file($sql_query);
+	
+		$sql_count = count($pieces);
+		for($i = 0; $i < $sql_count; $i++)
 		{
-			// DEBUG
-//			debug("Executing: " . htmlspecialchars($sql) . "\n");
-
-			$result = mysql_query($sql);
-			if (!$result) debug('SQL Error: ' . mysql_error());
-
+			$sql = trim($pieces[$i]);
+	
+			if(!empty($sql) and $sql[0] != "#")
+			{
+				// DEBUG
+	//			debug("Executing: " . htmlspecialchars($sql) . "\n");
+	
+				$result = mysql_query($sql);
+				if (!$result) debug('SQL Error: ' . mysql_error());
+	
+			}
 		}
+	
 	}
 
-}
-
-//
-// remove_remarks will strip the sql comment lines out of an uploaded sql file
-//
-function remove_remarks($sql)
-{
-	$lines = explode("\n", $sql);
-
-	// try to keep mem. use down
-	$sql = "";
-
-	$linecount = count($lines);
-	$output = "";
-
-	for ($i = 0; $i < $linecount; $i++)
+	/**
+	 * remove_remarks will strip the sql comment lines
+	 * out of an uploaded sql file
+	 */	
+	function remove_remarks($sql)
 	{
-		if (($i != ($linecount - 1)) || (strlen($lines[$i]) > 0))
+		$lines = explode("\n", $sql);
+	
+		// try to keep mem. use down
+		$sql = "";
+	
+		$linecount = count($lines);
+		$output = "";
+	
+		for ($i = 0; $i < $linecount; $i++)
 		{
-			if ($lines[$i][0] != "#")
+			if (($i != ($linecount - 1)) || (strlen($lines[$i]) > 0))
 			{
-				$output .= $lines[$i] . "\n";
-			}
-			else
-			{
-				$output .= "\n";
+				if ($lines[$i][0] != "#")
+				{
+					$output .= $lines[$i] . "\n";
+				}
+				else
+				{
+					$output .= "\n";
+				}
+				// Trading a bit of speed for lower mem. use here.
+				$lines[$i] = "";
 			}
-			// Trading a bit of speed for lower mem. use here.
-			$lines[$i] = "";
 		}
+	
+		return $output;
+	
 	}
 
-	return $output;
-
-}
-
-
-//
-// split_sql_file will split an uploaded sql file into single sql statements.
-// Note: expects trim() to have already been run on $sql.
-//
-// taken from phpBB
-//
-function split_sql_file($sql)
-{
-	// Split up our string into "possible" SQL statements.
-	$tokens = explode( ";", $sql);
-
-	// try to save mem.
-	$sql = "";
-	$output = array();
-
-	// we don't actually care about the matches preg gives us.
-	$matches = array();
-
-	// this is faster than calling count($tokens) every time thru the loop.
-	$token_count = count($tokens);
-	for ($i = 0; $i < $token_count; $i++)
+	/**
+	 * split_sql_file will split an uploaded sql file
+	 * into single sql statements.
+	 * 	 
+	 * Note: expects trim() to have already been run on $sql.	 
+	 * taken from phpBB
+	 */	 
+	function split_sql_file($sql)
 	{
-		// Don't wanna add an empty string as the last thing in the array.
-		if (($i != ($token_count - 1)) || (strlen($tokens[$i] > 0)))
+		// Split up our string into "possible" SQL statements.
+		$tokens = explode( ";", $sql);
+	
+		// try to save mem.
+		$sql = "";
+		$output = array();
+	
+		// we don't actually care about the matches preg gives us.
+		$matches = array();
+	
+		// this is faster than calling count($tokens) every time thru the loop.
+		$token_count = count($tokens);
+		for ($i = 0; $i < $token_count; $i++)
 		{
-
-			// even number of quotes means a complete SQL statement
-			if (_evenNumberOfQuotes($tokens[$i]))
-			{
-				$output[] = $tokens[$i];
-				$tokens[$i] = ""; 	// save memory.
-			}
-			else
+			// Don't wanna add an empty string as the last thing in the array.
+			if (($i != ($token_count - 1)) || (strlen($tokens[$i] > 0)))
 			{
-				// incomplete sql statement. keep adding tokens until we have a complete one.
-				// $temp will hold what we have so far.
-				$temp = $tokens[$i] .  ";";
-				$tokens[$i] = "";	// save memory..
-
-				// Do we have a complete statement yet?
-				$complete_stmt = false;
-
-				for ($j = $i + 1; (!$complete_stmt && ($j < $token_count)); $j++)
+	
+				// even number of quotes means a complete SQL statement
+				if ($this->_evenNumberOfQuotes($tokens[$i]))
 				{
-					// odd number of quotes means a completed statement
-					// (in combination with the odd number we had already)
-					if (!_evenNumberOfQuotes($tokens[$j]))
-					{
-						$output[] = $temp . $tokens[$j];
-
-						// save memory.
-						$tokens[$j] = "";
-						$temp = "";
-
-						// exit the loop.
-						$complete_stmt = true;
-						// make sure the outer loop continues at the right point.
-						$i = $j;
-					}
-					else
+					$output[] = $tokens[$i];
+					$tokens[$i] = ""; 	// save memory.
+				}
+				else
+				{
+					// incomplete sql statement. keep adding tokens until we have a complete one.
+					// $temp will hold what we have so far.
+					$temp = $tokens[$i] .  ";";
+					$tokens[$i] = "";	// save memory..
+	
+					// Do we have a complete statement yet?
+					$complete_stmt = false;
+	
+					for ($j = $i + 1; (!$complete_stmt && ($j < $token_count)); $j++)
 					{
-						// even number of unescaped quotes. We still don't have a complete statement.
-						// (1 odd and 1 even always make an odd)
-						$temp .= $tokens[$j] .  ";";
-						// save memory.
-						$tokens[$j] = "";
-					}
-
-				} // for..
-			} // else
+						// odd number of quotes means a completed statement
+						// (in combination with the odd number we had already)
+						if (!$this->_evenNumberOfQuotes($tokens[$j]))
+						{
+							$output[] = $temp . $tokens[$j];
+	
+							// save memory.
+							$tokens[$j] = "";
+							$temp = "";
+	
+							// exit the loop.
+							$complete_stmt = true;
+							// make sure the outer loop continues at the right point.
+							$i = $j;
+						}
+						else
+						{
+							// even number of unescaped quotes. We still don't have a complete statement.
+							// (1 odd and 1 even always make an odd)
+							$temp .= $tokens[$j] .  ";";
+							// save memory.
+							$tokens[$j] = "";
+						}
+	
+					} // for..
+				} // else
+			}
 		}
+	
+		return $output;
 	}
 
-	return $output;
-}
-
+	/**
+	 * sub function of split_sql_file
+	 * 	 
+	 * taken from phpBB
+	 */	 
+	function _evenNumberOfQuotes($text) {
+			// This is the total number of single quotes in the token.
+			$total_quotes = preg_match_all("/'/", $text, $matches);
+			// Counts single quotes that are preceded by an odd number of backslashes,
+			// which means they're escaped quotes.
+			$escaped_quotes = preg_match_all("/(?<!\\\\)(\\\\\\\\)*\\\\'/", $text, $matches);
+	
+			$unescaped_quotes = $total_quotes - $escaped_quotes;
+	//		debug($total_quotes . "-" . $escaped_quotes . "-" . $unescaped_quotes);
+			return (($unescaped_quotes % 2) == 0);
+	}
 
-function _evenNumberOfQuotes($text) {
-		// This is the total number of single quotes in the token.
-		$total_quotes = preg_match_all("/'/", $text, $matches);
-		// Counts single quotes that are preceded by an odd number of backslashes,
-		// which means they're escaped quotes.
-		$escaped_quotes = preg_match_all("/(?<!\\\\)(\\\\\\\\)*\\\\'/", $text, $matches);
-
-		$unescaped_quotes = $total_quotes - $escaped_quotes;
-//		debug($total_quotes . "-" . $escaped_quotes . "-" . $unescaped_quotes);
-		return (($unescaped_quotes % 2) == 0);
 }
 
 ?>
diff -x .svn -aruN 3.33.src/nucleus/libs/globalfunctions.php 3.40.src/nucleus/libs/globalfunctions.php
--- 3.33.src/nucleus/libs/globalfunctions.php	2008-10-06 07:43:46.000000000 -0500
+++ 3.40.src/nucleus/libs/globalfunctions.php	2009-02-14 19:36:46.000000000 -0600
@@ -13,14 +13,14 @@
 /**
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: globalfunctions.php 1211 2007-10-21 17:43:27Z kaigreve $
+ * @version $Id: globalfunctions.php 1326 2009-02-14 18:21:46Z kaigreve $
 
  */
 
 // needed if we include globalfunctions from install.php
 global $nucleus, $CONF, $DIR_LIBS, $DIR_LANG, $manager, $member;
 
-$nucleus['version'] = 'v3.33';
+$nucleus['version'] = 'v3.40';
 $nucleus['codename'] = '';
 
 checkVars(array('nucleus', 'CONF', 'DIR_LIBS', 'MYSQL_HOST', 'MYSQL_USER', 'MYSQL_PASSWORD', 'MYSQL_DATABASE', 'DIR_LANG', 'DIR_PLUGINS', 'HTTP_GET_VARS', 'HTTP_POST_VARS', 'HTTP_COOKIE_VARS', 'HTTP_ENV_VARS', 'HTTP_SESSION_VARS', 'HTTP_POST_FILES', 'HTTP_SERVER_VARS', 'GLOBALS', 'argv', 'argc', '_GET', '_POST', '_COOKIE', '_ENV', '_SESSION', '_SERVER', '_FILES'));
@@ -32,11 +32,6 @@
 	error_reporting(E_ERROR | E_WARNING | E_PARSE);
 }
 
-// Avoid notices
-if (!isset($CONF['Self'])) {
-	$CONF['Self'] = htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES);
-}
-
 /*
 	Indicates when Nucleus should display startup errors. Set to 1 if you want
 	the error enabled (default), false otherwise
@@ -51,6 +46,12 @@
 		more of the installation files (install.php, install.sql, upgrades/
 		directory) are still on the server.
 */
+
+// Avoid notices
+if (!isset($CONF['Self'])) {
+	$CONF['Self'] = 'index.php';
+}
+
 $CONF['alertOnHeadersSent'] = 1;
 $CONF['alertOnSecurityRisk'] = 1;
 $CONF['ItemURL'] = $CONF['Self'];
@@ -161,6 +162,23 @@
 // read config
 getConfig();
 
+// Properly set $CONF['Self'] and others if it's not set... usually when we are access from admin menu
+if (!isset($CONF['Self'])) {
+	$CONF['Self'] = $CONF['IndexURL'];
+	// strip trailing /
+	if ($CONF['Self'][strlen($CONF['Self']) -1] == "/") {
+		$CONF['Self'] = substr($CONF['Self'], 0, strlen($CONF['Self']) -1);
+	}
+
+	$CONF['ItemURL'] = $CONF['Self'];
+	$CONF['ArchiveURL'] = $CONF['Self'];
+	$CONF['ArchiveListURL'] = $CONF['Self'];
+	$CONF['MemberURL'] = $CONF['Self'];
+	$CONF['SearchURL'] = $CONF['Self'];
+	$CONF['BlogURL'] = $CONF['Self'];
+	$CONF['CategoryURL'] = $CONF['Self'];
+}
+
 // automatically use simpler toolbar for mozilla
 if (($CONF['DisableJsTools'] == 0) && strstr(serverVar('HTTP_USER_AGENT'), 'Mozilla/5.0') && strstr(serverVar('HTTP_USER_AGENT'), 'Gecko') ) {
 	$CONF['DisableJsTools'] = 2;
@@ -331,31 +349,31 @@
 // decode path_info
 if ($CONF['URLMode'] == 'pathinfo') {
 	// initialize keywords if this hasn't been done before
-	if ($CONF['ItemKey'] == '') {
+	if (!isset($CONF['ItemKey']) || $CONF['ItemKey'] == '') {
 		$CONF['ItemKey'] = 'item';
 	}
 
-	if ($CONF['ArchiveKey'] == '') {
+	if (!isset($CONF['ArchiveKey']) || $CONF['ArchiveKey'] == '') {
 		$CONF['ArchiveKey'] = 'archive';
 	}
 
-	if ($CONF['ArchivesKey'] == '') {
+	if (!isset($CONF['ArchivesKey']) || $CONF['ArchivesKey'] == '') {
 		$CONF['ArchivesKey'] = 'archives';
 	}
 
-	if ($CONF['MemberKey'] == '') {
+	if (!isset($CONF['MemberKey']) || $CONF['MemberKey'] == '') {
 		$CONF['MemberKey'] = 'member';
 	}
 
-	if ($CONF['BlogKey'] == '') {
+	if (!isset($CONF['BlogKey']) || $CONF['BlogKey'] == '') {
 		$CONF['BlogKey'] = 'blog';
 	}
 
-	if ($CONF['CategoryKey'] == '') {
+	if (!isset($CONF['CategoryKey']) || $CONF['CategoryKey'] == '') {
 		$CONF['CategoryKey'] = 'category';
 	}
 
-	if ($CONF['SpecialskinKey'] == '') {
+	if (!isset($CONF['SpecialskinKey']) || $CONF['SpecialskinKey'] == '') {
 		$CONF['SpecialskinKey'] = 'special';
 	}
 
@@ -463,7 +481,7 @@
   * returns the currently used version (100 = 1.00, 101 = 1.01, etc...)
   */
 function getNucleusVersion() {
-	return 333;
+	return 340;
 }
 
 /**
@@ -783,6 +801,8 @@
 
 		if ($b->isValidCategory($catid) ) {
 			$catextra = ' and icat=' . $catid;
+		} else {
+			$catextra = '';
 		}
 
 		// get previous itemid and title
@@ -1808,7 +1828,7 @@
  * - the URL will be stripped of illegal or dangerous characters
  */
 function redirect($url) {
-	$url = preg_replace('|[^a-z0-9-~+_.?#=&;,/:@%]|i', '', $url);
+	$url = preg_replace('|[^a-z0-9-~+_.?#=&;,/:@%*]|i', '', $url);
 	header('Location: ' . $url);
 	exit;
 }
@@ -1926,7 +1946,7 @@
 	$document = 'document';
 	$bookmarkletline = "javascript:Q='';x=".$document.";y=window;if(x.selection){Q=x.selection.createRange().text;}else if(y.getSelection){Q=y.getSelection();}else if(x.getSelection){Q=x.getSelection();}wingm=window.open('";
 	$bookmarkletline .= $CONF['AdminURL'] . "bookmarklet.php?blogid=$blogid";
-	$bookmarkletline .="&logtext='+escape(Q)+'&loglink='+escape(x.location.href)+'&loglinktitle='+escape(x.title),'nucleusbm','scrollbars=yes,width=600,height=500,left=10,top=10,status=yes,resizable=yes');wingm.focus();";
+	$bookmarkletline .="&logtext='+escape(Q)+'&loglink='+escape(x.location.href)+'&loglinktitle='+escape(x.title),'nucleusbm','scrollbars=yes,width=600,height=550,left=10,top=10,status=yes,resizable=yes');wingm.focus();";
 
 	return $bookmarkletline;
 }
diff -x .svn -aruN 3.33.src/nucleus/libs/include/admin-add.template 3.40.src/nucleus/libs/include/admin-add.template
--- 3.33.src/nucleus/libs/include/admin-add.template	2008-10-06 07:43:46.000000000 -0500
+++ 3.40.src/nucleus/libs/include/admin-add.template	2009-02-14 19:36:46.000000000 -0600
@@ -2,7 +2,7 @@
 
 <%init%>
 <script type="text/javascript" src="javascript/numbercheck.js"></script>
-<script type="text/javascript" src="javascript/xmlhttprequest.js"></script>
+<%ifautosave()%><script type="text/javascript" src="javascript/xmlhttprequest.js"></script><%endif%>
 
 <form id="addform" method="post" action="index.php" >
 
@@ -16,10 +16,12 @@
 <table>
 	<tr>
 		<th colspan="2"><%text(_ADD_CREATENEW)%></th>
-	</tr><tr>
+	</tr>
+	<%ifautosave()%><tr>
 		<td><%text(_AUTOSAVEDRAFT)%></td>
 		<td><span id="info"><%text(_AUTOSAVEDRAFT_NOTYETSAVED)%></span></td>
-	</tr><tr>
+	</tr><%endif%>
+	<tr>
 		<td><%text(_ADD_TITLE)%></td>
 		<td><input 
 			<%jsinput(title)%>
@@ -73,12 +75,12 @@
 			<input name="actiontype" value="addfuture" type="radio" id="act_future" tabindex="61" /><label for="act_future" ><%text(_ADD_ADDLATER)%></label> <%helplink(future)%>
 			<div class="indent">
 				<%text(_ADD_PLACE_ON)%>
-				<input id="inputday" name="day" tabindex="63" size="2" value="<%currenttime(mday)%>" />/
-				<input id="inputmonth" name="month" tabindex="64" size="2" value="<%currenttime(mon)%>" />/
-				<input id="inputyear" name="year" tabindex="65" size="4" value="<%currenttime(year)%>" />
+				<input id="inputday" name="day" tabindex="63" size="2" value="<%currenttime(mday)%>" onchange="document.forms[0].act_future.checked=true;" />/
+				<input id="inputmonth" name="month" tabindex="64" size="2" value="<%currenttime(mon)%>" onchange="document.forms[0].act_future.checked=true;" />/
+				<input id="inputyear" name="year" tabindex="65" size="4" value="<%currenttime(year)%>" onchange="document.forms[0].act_future.checked=true;" />
 				at
-				<input id="inputhour" name="hour" tabindex="66" size="2" value="<%currenttime(hours)%>" />:
-				<input id="inputminutes" name="minutes" tabindex="67" size="2" value="<%currenttime(minutes)%>" />
+				<input id="inputhour" name="hour" tabindex="66" size="2" value="<%currenttime(hours)%>" onchange="document.forms[0].act_future.checked=true;" />:
+				<input id="inputminutes" name="minutes" tabindex="67" size="2" value="<%currenttime(minutes)%>" onchange="document.forms[0].act_future.checked=true;" />
 				(dd/mm/yyyy hh:mm)
 				
 				<%ifblogsetting(ballowpast,0)%>
@@ -87,6 +89,8 @@
 				<%endif%>
 			</div>
 			<input name="actiontype" tabindex="61" value="adddraft" type="radio" id="act_draft" /><label for="act_draft"><%text(_ADD_ADDDRAFT)%></label> <%helplink(draft)%>
+			<br />
+			<input id="dosendping" name="dosendping" value="1" type="checkbox" checked="checked"><label for="dosendping"><%text(_UPDATEDPING_GOSENDPING)%></label>
 		</td>
 	</tr><tr>
 		<td><%text(_ADD_PLUGIN_EXTRAS)%></td>
@@ -115,15 +119,17 @@
 		<td>
 			<input tabindex="60" type="submit" value="<%text(_ADD_ADDITEM)%>" 
 				onclick="return checkSubmit();" />
+			<%ifautosave()%>
 			<input tabindex="80" type="button" name="autosavenow" value="<%text(_AUTOSAVEDRAFT_NOW)%>"
 				onclick="autoSaveDraft();" />
+			<%endif%>
 		</td>
 	</tr>
 </table>
 
 </div>
 </form>
-
+<%ifautosave()%>
 <script type="text/javascript">
 	var xmlhttprequest = new Array();
 	xmlhttprequest[0] = createHTTPHandler(); // AutoDraft handler
@@ -135,4 +141,5 @@
 	var goalurl = '../action.php'; // The PHP file where the content must be posted to
 	var lastsavedtext = '<%text(_AUTOSAVEDRAFT_LASTSAVED)%>'; // The language variable for 'Last saved'
 	var formtype = 'add'; // Add or edit form
-</script>	
+</script>
+<%endif%>
diff -x .svn -aruN 3.33.src/nucleus/libs/include/admin-edit.template 3.40.src/nucleus/libs/include/admin-edit.template
--- 3.33.src/nucleus/libs/include/admin-edit.template	2008-10-06 07:43:46.000000000 -0500
+++ 3.40.src/nucleus/libs/include/admin-edit.template	2009-02-14 19:36:44.000000000 -0600
@@ -2,7 +2,7 @@
 
 <%init%>
 <script type="text/javascript" src="javascript/numbercheck.js"></script>
-<script type="text/javascript" src="javascript/xmlhttprequest.js"></script>
+<%ifautosave()%><script type="text/javascript" src="javascript/xmlhttprequest.js"></script><%endif%>
 
 <form id="editform" method="post" action="index.php">
 <div>
@@ -14,10 +14,12 @@
 
 <table><tr>
 	<th colspan="2"><%text(_EDIT_ITEM)%></th>
-</tr><tr>
+</tr>
+<%ifautosave()%><tr>
 	<td><%text(_AUTOSAVEDRAFT)%></td>
 	<td><span id="info"><%text(_AUTOSAVEDRAFT_NOTYETSAVED)%></span></td>
-</tr><tr>
+</tr><%endif%>
+<tr>
 	<td><%text(_EDIT_ORIG_AUTHOR)%></td>
 	<td><%contents(author)%></td>
 </tr><tr>
@@ -77,12 +79,12 @@
 		<input name="actiontype" value="addfuture" type="radio" id="act_future" tabindex="61" /><label for="act_future"><%text(_ADD_ADDLATER)%></label> <%helplink(future)%>
 		<div class="indent">
 			<%text(_ADD_PLACE_ON)%>
-			<input id="inputday" name="day" tabindex="71" size="2" value="<%currenttime(mday)%>" />/
-			<input id="inputmonth" name="month" tabindex="72" size="2" value="<%currenttime(mon)%>" />/
-			<input id="inputyear" name="year" tabindex="73" size="4" value="<%currenttime(year)%>" />
+			<input id="inputday" name="day" tabindex="71" size="2" value="<%currenttime(mday)%>" onchange="document.forms[0].act_future.checked=true;" />/
+			<input id="inputmonth" name="month" tabindex="72" size="2" value="<%currenttime(mon)%>" onchange="document.forms[0].act_future.checked=true;" />/
+			<input id="inputyear" name="year" tabindex="73" size="4" value="<%currenttime(year)%>" onchange="document.forms[0].act_future.checked=true;" />
 			at
-			<input id="inputhour" name="hour" tabindex="74" size="2" value="<%currenttime(hours)%>" />:
-			<input id="inputminutes" name="minutes" tabindex="75" size="2" value="<%currenttime(minutes)%>" />
+			<input id="inputhour" name="hour" tabindex="74" size="2" value="<%currenttime(hours)%>" onchange="document.forms[0].act_future.checked=true;" />:
+			<input id="inputminutes" name="minutes" tabindex="75" size="2" value="<%currenttime(minutes)%>" onchange="document.forms[0].act_future.checked=true;" />
 			(dd/mm/yyyy hh:mm)
 			<%ifblogsetting(ballowpast,0)%>
 				<br />
@@ -101,18 +103,21 @@
 		<br />
 		<input name="actiontype" value="changedate" type="radio" id="act_changedate" tabindex="70" /><label for="act_changedate"><%text(_ADD_CHANGEDATE)%></label> <%helplink(changedate)%>
 			<div class="indent">
-				<input id="inputday" name="day" tabindex="71" size="2" value="<%itemtime(mday)%>" />/
-				<input id="inputmonth" name="month" tabindex="72" size="2" value="<%itemtime(mon)%>" />/
-				<input id="inputyear" name="year" tabindex="73" size="4" value="<%itemtime(year)%>" />
+				<input id="inputday" name="day" tabindex="71" size="2" value="<%itemtime(mday)%>" onchange="document.forms[0].act_changedate.checked=true;" />/
+				<input id="inputmonth" name="month" tabindex="72" size="2" value="<%itemtime(mon)%>" onchange="document.forms[0].act_changedate.checked=true;" />/
+				<input id="inputyear" name="year" tabindex="73" size="4" value="<%itemtime(year)%>" onchange="document.forms[0].act_changedate.checked=true;" />
 				at
-				<input id="inputhour" name="hour" tabindex="74" size="2" value="<%itemtime(hours)%>" />:
-				<input id="inputminutes" name="minutes" tabindex="75" size="2" value="<%itemtime(minutes)%>" />
+				<input id="inputhour" name="hour" tabindex="74" size="2" value="<%itemtime(hours)%>" onchange="document.forms[0].act_changedate.checked=true;" />:
+				<input id="inputminutes" name="minutes" tabindex="75" size="2" value="<%itemtime(minutes)%>" onchange="document.forms[0].act_changedate.checked=true;" />
 				(dd/mm/yyyy hh:mm)
 			</div>
 	<%endif%>	
+	<input name="actiontype" value="backtodrafts" type="radio" id="act_backtodrafts" tabindex="71" /><label for="act_backtodrafts"><%text(_BMLET_BACKTODRAFTS)%></label> <%helplink(draft)%>
 	<br />
-	<input name="actiontype" value="delete" type="radio" id="act_delete" tabindex="61" /><label for="act_delete"><%text(_BMLET_DELETE)%></label>
+	<input name="actiontype" value="delete" type="radio" id="act_delete" tabindex="72" /><label for="act_delete"><%text(_BMLET_DELETE)%></label>
 <%endif%>
+	<br />
+	<input id="dosendping" name="dosendping" value="1" type="checkbox"><label for="dosendping"><%text(_UPDATEDPING_GOSENDPING)%></label>
 
 	</td>
 </tr><tr>
@@ -142,8 +147,8 @@
 		<td>
 			<input tabindex="60" type="submit" value="<%text(_EDIT_SUBMIT)%>" 
 				onclick="return checkSubmit();" />
-			<input tabindex="80" type="button" name="autosavenow" value="<%text(_AUTOSAVEDRAFT_NOW)%>"
-				onclick="autoSaveDraft();" />
+			<%ifautosave()%><input tabindex="80" type="button" name="autosavenow" value="<%text(_AUTOSAVEDRAFT_NOW)%>"
+				onclick="autoSaveDraft();" /><%endif%>
 		</td>
 	
 </tr></table>
@@ -151,7 +156,7 @@
 </div>
 </form>
 
-<script type="text/javascript">
+<%ifautosave()%><script type="text/javascript">
 	var xmlhttprequest = new Array();
 	xmlhttprequest[0] = createHTTPHandler(); // AutoDraft handler
 	xmlhttprequest[1] = createHTTPHandler(); // UpdateTicket handler
@@ -162,4 +167,4 @@
 	var goalurl = '../action.php'; // The PHP file where the content must be posted to
 	var lastsavedtext = '<%text(_AUTOSAVEDRAFT_LASTSAVED)%>'; // The language variable for 'Last saved'
 	var formtype = 'edit'; // Add or edit form
-</script>	
+</script><%endif%>
diff -x .svn -aruN 3.33.src/nucleus/libs/include/bookmarklet-add.template 3.40.src/nucleus/libs/include/bookmarklet-add.template
--- 3.33.src/nucleus/libs/include/bookmarklet-add.template	2008-10-06 07:43:46.000000000 -0500
+++ 3.40.src/nucleus/libs/include/bookmarklet-add.template	2009-02-14 19:36:46.000000000 -0600
@@ -7,7 +7,7 @@
 		<script type="text/javascript" src="javascript/bookmarklet.js"></script>
 		<script type="text/javascript" src="javascript/edit.js"></script>
 		<script type="text/javascript" src="javascript/numbercheck.js"></script>
-		<script type="text/javascript" src="javascript/xmlhttprequest.js"></script>
+		<%ifautosave()%><script type="text/javascript" src="javascript/xmlhttprequest.js"></script><%endif%>
 		<%init%>
 		<%extrahead%>
 		<script type="text/javascript">
@@ -33,22 +33,23 @@
 			<%ticket%>
 			
 			<div id="submit" class="buttonbar">
-				<input type="submit" value="<%text(_BMLET_ADD)%>" onclick="return checkSubmit();" />
 				<div id="switchbuttons">
 					<input type="button" onclick="flipBlock('body');" value="<%text(_BMLET_BODY)%> &gt;&gt;" />
 					<input type="button" onclick="flipBlock('more');" value="<%text(_BMLET_MORE)%> &gt;&gt;" />
 					<input type="button" onclick="flipBlock('options');" value="<%text(_BMLET_OPTIONS)%> &gt;&gt;" />
 					<input type="button" onclick="updAllPreviews(); flipBlock('preview');" value="<%text(_BMLET_PREVIEW)%> &gt;&gt;" />
 				</div>
+				<input type="submit" value="<%text(_BMLET_ADD)%>" onclick="return checkSubmit();" />
+				<input type="button" value="<%text(_BMLET_CANCEL)%>" onclick="window.close();" />
 			</div>
 
 			<div id="body" class="contentblock">
 
 				<table>
-				<tr>
+				<%ifautosave()%><tr>
 				<td><%text(_AUTOSAVEDRAFT)%></td>
 				<td><span id="info"><%text(_AUTOSAVEDRAFT_NOTYETSAVED)%></span></td>
-				</tr>
+				</tr><%endif%>
 				<tr>
 				<td><%text(_ADD_TITLE)%></td>
 				<td>
@@ -73,8 +74,8 @@
 				<td><%categories%></td>
 				</tr>
 				<tr>
-				<td><%text(_AUTOSAVEDRAFT_NOW)%></td>
-				<td><input tabindex="80" type="button" name="autosavenow" value="<%text(_AUTOSAVEDRAFT_NOW)%>" onclick="autoSaveDraft();" /></td>
+				<%ifautosave()%><td><%text(_AUTOSAVEDRAFT_NOW)%></td>
+				<td><input tabindex="80" type="button" name="autosavenow" value="<%text(_AUTOSAVEDRAFT_NOW)%>" onclick="autoSaveDraft();" /></td><%endif%>
 				</tr>
 				</table>
 
@@ -113,12 +114,12 @@
 					<input name="actiontype" value="addfuture" type="radio" id="act_future" /><label for="act_future"><%text(_ADD_ADDLATER)%></label> <%helplink(future)%>
 					<div class="indent">
 						<%text(_ADD_PLACE_ON)%>
-						<input id="inputday" name="day" size="2" value="<%currenttime(mday)%>" />/
-						<input id="inputmonth" name="month" size="2" value="<%currenttime(mon)%>" />/
-						<input id="inputyear" name="year" size="4" value="<%currenttime(year)%>" />
+						<input id="inputday" name="day" size="2" value="<%currenttime(mday)%>" onchange="document.forms[0].act_future.checked=true;" />/
+						<input id="inputmonth" name="month" size="2" value="<%currenttime(mon)%>" onchange="document.forms[0].act_future.checked=true;" />/
+						<input id="inputyear" name="year" size="4" value="<%currenttime(year)%>" onchange="document.forms[0].act_future.checked=true;" />
 						at
-						<input id="inputhour" name="hour" size="2" value="<%currenttime(hours)%>" />:
-						<input id="inputminutes" name="minutes" size="2" value="<%currenttime(minutes)%>" />
+						<input id="inputhour" name="hour" size="2" value="<%currenttime(hours)%>" onchange="document.forms[0].act_future.checked=true;" />:
+						<input id="inputminutes" name="minutes" size="2" value="<%currenttime(minutes)%>" onchange="document.forms[0].act_future.checked=true;" />
 						(dd/mm/yyyy hh:mm)
 						<%ifblogsetting(ballowpast,0)%>
 							<br />
@@ -126,6 +127,8 @@
 						<%endif%>
 					</div>
 					<input name="actiontype" value="adddraft" type="radio" id="act_draft" /><label for="act_draft"><%text(_ADD_ADDDRAFT)%></label> <%helplink(draft)%>
+					<br />
+					<input id="dosendping" name="dosendping" value="1" type="checkbox" checked="checked"><label for="dosendping"><%text(_UPDATEDPING_GOSENDPING)%></label>
 				</td>
 				</tr>
 				<tr>
@@ -153,7 +156,7 @@
 			
 		</div></form>
 
-	<script type="text/javascript">
+	<%ifautosave()%><script type="text/javascript">
 		var xmlhttprequest = new Array();
 		xmlhttprequest[0] = createHTTPHandler(); // AutoDraft handler
 		xmlhttprequest[1] = createHTTPHandler(); // UpdateTicket handler
@@ -164,7 +167,7 @@
 		var goalurl = '../action.php'; // The PHP file where the content must be posted to
 		var lastsavedtext = '<%text(_AUTOSAVEDRAFT_LASTSAVED)%>'; // The language variable for 'Last saved'
 		var formtype = 'add'; // Add or edit form
-	</script>
+	</script><%endif%>
 
 	</body>
 	</html>
diff -x .svn -aruN 3.33.src/nucleus/libs/include/bookmarklet-edit.template 3.40.src/nucleus/libs/include/bookmarklet-edit.template
--- 3.33.src/nucleus/libs/include/bookmarklet-edit.template	2008-10-06 07:43:46.000000000 -0500
+++ 3.40.src/nucleus/libs/include/bookmarklet-edit.template	2009-02-14 19:36:46.000000000 -0600
@@ -7,7 +7,7 @@
 		<script type="text/javascript" src="javascript/bookmarklet.js"></script>
 		<script type="text/javascript" src="javascript/edit.js"></script>
 		<script type="text/javascript" src="javascript/numbercheck.js"></script>
-		<script type="text/javascript" src="javascript/xmlhttprequest.js"></script>
+		<%ifautosave()%><script type="text/javascript" src="javascript/xmlhttprequest.js"></script><%endif%>
 		<%init%>
 		<%extrahead%>
 		<script type="text/javascript">
@@ -33,21 +33,22 @@
 			<%ticket%>
 			
 			<div id="submit" class="buttonbar">
-				<input type="submit" value="<%text(_BMLET_EDIT)%>" onclick="return checkSubmit();" />
 				<div id="switchbuttons">
 					<input type="button" onclick="flipBlock('body');" value="<%text(_BMLET_BODY)%> &gt;&gt;" />
 					<input type="button" onclick="flipBlock('more');" value="<%text(_BMLET_MORE)%> &gt;&gt;" />
 					<input type="button" onclick="flipBlock('options');" value="<%text(_BMLET_OPTIONS)%> &gt;&gt;" />
 					<input type="button" onclick="updAllPreviews(); flipBlock('preview');" value="<%text(_BMLET_PREVIEW)%> &gt;&gt;" />
 				</div>
+				<input type="submit" value="<%text(_BMLET_EDIT)%>" onclick="return checkSubmit();" />
+				<input type="button" value="<%text(_BMLET_CANCEL)%>" onclick="window.close();" />
 			</div>
 
 			<div id="body" class="contentblock">
 				<table>
-				<tr>
+				<%ifautosave()%><tr>
 				<td><%text(_AUTOSAVEDRAFT)%></td>
 				<td><span id="info"><%text(_AUTOSAVEDRAFT_NOTYETSAVED)%></span></td>
-				</tr>
+				</tr><%endif%>
 				<tr>
 				<td><%text(_ADD_TITLE)%></td>
 				<td><input 
@@ -71,8 +72,8 @@
 				<td><%categories%></td>
 				</tr>
 				<tr>
-				<td><%text(_AUTOSAVEDRAFT_NOW)%></td>
-				<td><input tabindex="80" type="button" name="autosavenow" value="<%text(_AUTOSAVEDRAFT_NOW)%>" onclick="autoSaveDraft();" /></td>
+				<%ifautosave()%><td><%text(_AUTOSAVEDRAFT_NOW)%></td>
+				<td><input tabindex="80" type="button" name="autosavenow" value="<%text(_AUTOSAVEDRAFT_NOW)%>" onclick="autoSaveDraft();" /></td><%endif%>
 				</tr>
 				</table>
 					
@@ -113,17 +114,21 @@
 						<li>
 							<input name="actiontype" value="changedate" type="radio" id="act_changedate" tabindex="70" /><label for="act_changedate"><%text(_BMLET_CHANGEDATE)%></label> <%helplink(changedate)%>
 									<div class="indent">
-										<input id="inputday" name="day" tabindex="71" size="2" value="<%itemtime(mday)%>" />/
-										<input id="inputmonth" name="month" tabindex="72" size="2" value="<%itemtime(mon)%>" />/
-										<input id="inputyear" name="year" tabindex="73" size="4" value="<%itemtime(year)%>" />
+										<input id="inputday" name="day" tabindex="71" size="2" value="<%itemtime(mday)%>" onchange="document.forms[0].act_changedate.checked=true;" />/
+										<input id="inputmonth" name="month" tabindex="72" size="2" value="<%itemtime(mon)%>" onchange="document.forms[0].act_changedate.checked=true;" />/
+										<input id="inputyear" name="year" tabindex="73" size="4" value="<%itemtime(year)%>" onchange="document.forms[0].act_changedate.checked=true;" />
 										at
-										<input id="inputhour" name="hour" tabindex="74" size="2" value="<%itemtime(hours)%>" />:
-										<input id="inputminutes" name="minutes" tabindex="75" size="2" value="<%itemtime(minutes)%>" />
+										<input id="inputhour" name="hour" tabindex="74" size="2" value="<%itemtime(hours)%>" onchange="document.forms[0].act_changedate.checked=true;" />:
+										<input id="inputminutes" name="minutes" tabindex="75" size="2" value="<%itemtime(minutes)%>" onchange="document.forms[0].act_changedate.checked=true;" />
 										(dd/mm/yyyy hh:mm)
 									</div>
 							</li>
+							<li>
+								<input name="actiontype" value="backtodrafts" type="radio" id="act_backtodrafts" tabindex="71" /><label for="act_backtodrafts"><%text(_BMLET_BACKTODRAFTS)%></label> <%helplink(draft)%>
+							</li>
 					<%endif%>						
 				</ul>
+				<input id="dosendping" name="dosendping" value="1" type="checkbox"><label for="dosendping"><%text(_UPDATEDPING_GOSENDPING)%></label>
 				</td></tr>
 				
 				<tr>
@@ -149,7 +154,7 @@
 			
 		</div></form>
 
-	<script type="text/javascript">
+	<%ifautosave()%><script type="text/javascript">
 		var xmlhttprequest = new Array();
 		xmlhttprequest[0] = createHTTPHandler(); // AutoDraft handler
 		xmlhttprequest[1] = createHTTPHandler(); // UpdateTicket handler
@@ -160,7 +165,7 @@
 		var goalurl = '../action.php'; // The PHP file where the content must be posted to
 		var lastsavedtext = '<%text(_AUTOSAVEDRAFT_LASTSAVED)%>'; // The language variable for 'Last saved'
 		var formtype = 'edit'; // Add or edit form
-	</script>
+	</script><%endif%>
 
 	</body>
 	</html>
diff -x .svn -aruN 3.33.src/nucleus/libs/mysql.php 3.40.src/nucleus/libs/mysql.php
--- 3.33.src/nucleus/libs/mysql.php	2008-10-06 07:43:46.000000000 -0500
+++ 3.40.src/nucleus/libs/mysql.php	2009-02-14 19:36:46.000000000 -0600
@@ -13,7 +13,7 @@
 /**
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: mysql.php 1116 2007-02-03 08:24:29Z kimitake $
+ * @version $Id: mysql.php 1279 2008-10-23 08:18:26Z shizuki $
  */
  
 /*
@@ -26,7 +26,7 @@
 {
 	if (!function_exists('mysqli_query') && function_exists('startUpError'))
 	{
-		startUpError('<p>No suitable mySQL library was found to run Nucleus</p>');
+		startUpError(_NO_SUITABLE_MYSQL_LIBRARY);
 	}
 	
 	function mysql_query($query) 
diff -x .svn -aruN 3.33.src/nucleus/libs/showlist.php 3.40.src/nucleus/libs/showlist.php
--- 3.33.src/nucleus/libs/showlist.php	2008-10-06 07:43:46.000000000 -0500
+++ 3.40.src/nucleus/libs/showlist.php	2009-02-14 19:36:46.000000000 -0600
@@ -14,7 +14,7 @@
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: showlist.php 1197 2007-09-05 07:42:15Z kimitake $
+ * @version $Id: showlist.php 1323 2009-02-13 00:56:29Z shizuki $
  */
 
 
@@ -195,11 +195,34 @@
 					if (!$plug->subscribtionListIsUptodate()) {
 						echo '<br /><br /><strong>',_LIST_PLUG_SUBS_NEEDUPDATE,'</strong>';
 					}
-					if (sizeof($plug->getPluginDep()) > 0)
+					if (sizeof($plug->getPluginDep()) > 0) {
 						echo '<br /><br />',_LIST_PLUGS_DEP,'<br />',htmlspecialchars(implode($plug->getPluginDep(),', '));
+					}
+// <add by shizuki>
+				// check dependency require
+				$req = array();
+				$res = sql_query('SELECT pfile FROM ' . sql_table('plugin'));
+				while($o = mysql_fetch_object($res)) {
+					$preq =& $manager->getPlugin($o->pfile);
+					if ($plug) {
+						$depList = $preq->getPluginDep();
+						foreach ($depList as $depName) {
+							if ($current->pfile == $depName) {
+								$req[] = $o->pfile;
+							}
+						}
+					}
+				}
+				if (count($req) > 0) {
+					echo '<h4 class="plugin_dependreq_title">' . _LIST_PLUGS_DEPREQ . "</h4>\n";
+					echo '<p class="plugin_dependreq_text">';
+					echo htmlspecialchars(implode(', ', $req), ENT_QUOTES);
+					echo "</p>\n";
+				}
+// </add by shizuki>
 				echo '</td>';
 			} else {
-				echo '<td colspan="2">Error: plugin file <b>',htmlspecialchars($current->pfile),'.php</b> could not be loaded, or it has been set inactive because it does not support some features (check the <a href="?action=actionlog">actionlog</a> for more info)</td>';
+				echo '<td colspan="2">' . sprintf(_PLUGINFILE_COULDNT_BELOADED, htmlspecialchars($current->pfile, ENT_QUOTES)) . '</td>';
 			}
 			echo '<td>';
 
@@ -334,10 +357,19 @@
 			$current->ibody = strip_tags($current->ibody);
 			$current->ibody = htmlspecialchars(shorten($current->ibody,300,'...'));
 
+			$COMMENTS = new COMMENTS($current->inumber);
 			echo "$current->ibody</td>";
 			echo "<td  style=\"white-space:nowrap\" $cssclass>";
 			echo 	"<a href='index.php?action=itemedit&amp;itemid=$current->inumber'>"._LISTS_EDIT."</a>";
-			echo    "<br /><a href='index.php?action=itemcommentlist&amp;itemid=$current->inumber'>"._LISTS_COMMENTS."</a>";
+			// evaluate amount of comments for the item
+			$camount = $COMMENTS->amountComments();
+			if ($camount>0) {
+				echo "<br /><a href='index.php?action=itemcommentlist&amp;itemid=$current->inumber'>";
+				echo "( " . sprintf(_LIST_ITEM_COMMENTS, $COMMENTS->amountComments())." )</a>";
+			}
+			else {
+				echo "<br />" . _LIST_ITEM_NOCONTENT;
+			}
 			echo    "<br /><a href='index.php?action=itemmove&amp;itemid=$current->inumber'>"._LISTS_MOVE."</a>";
 			echo    "<br /><a href='index.php?action=itemdelete&amp;itemid=$current->inumber'>"._LISTS_DELETE."</a>";
 			echo "</td>";
@@ -429,7 +461,7 @@
 function listplug_table_shortblognames($template, $type) {
 	switch($type) {
 		case 'HEAD':
-			echo "<th>" . _NAME . "</th><th>" . _NAME. "</th>";
+			echo "<th>" . _EBLOG_SHORTNAME . "</th><th>" . _EBLOG_NAME. "</th>";
 			break;
 		case 'BODY':
 			$current = $template['current'];
@@ -533,16 +565,19 @@
 
 				$hasEnlargement = @file_exists($DIR_SKINS . $current->sdincpref . 'preview-large.png');
 				if ($hasEnlargement)
-					echo '<a href="',$CONF['SkinsURL'], htmlspecialchars($current->sdincpref),'preview-large.png" title="View larger">';
+					echo '<a href="',$CONF['SkinsURL'], htmlspecialchars($current->sdincpref),'preview-large.png" title="' . _LIST_SKIN_PREVIEW_VIEWLARGER . '">';
 
-				echo '<img class="skinpreview" src="',$CONF['SkinsURL'], htmlspecialchars($current->sdincpref),'preview.png" width="100" height="75" alt="Preview for \'',htmlspecialchars($current->sdname),'\' skin" />';
+				$imgAlt = sprintf(_LIST_SKIN_PREVIEW, htmlspecialchars($current->sdname, ENT_QUOTES));
+				echo '<img class="skinpreview" src="',$CONF['SkinsURL'], htmlspecialchars($current->sdincpref),'preview.png" width="100" height="75" alt="' . $imgAlt . '" />';
 
 				if ($hasEnlargement)
 					echo '</a>';
 
 				if (@file_exists($DIR_SKINS . $current->sdincpref . 'readme.html'))
 				{
-					echo '<br /><a href="',$CONF['SkinsURL'], htmlspecialchars($current->sdincpref),'readme.html" title="More info on the \'',htmlspecialchars($current->sdname),'\' skin">Readme</a>';
+					$url         = $CONF['SkinsURL'] . htmlspecialchars($current->sdincpref, ENT_QUOTES) . 'readme.html';
+					$readmeTitle = sprintf(_LIST_SKIN_README, htmlspecialchars($current->sdname, ENT_QUOTES));
+					echo '<br /><a href="' . $url . '" title="' . $readmeTitle . '">' . _LIST_SKIN_README_TXT . '</a>';
 				}
 
 
diff -x .svn -aruN 3.33.src/nucleus/libs/skinie.php 3.40.src/nucleus/libs/skinie.php
--- 3.33.src/nucleus/libs/skinie.php	2008-10-06 07:43:46.000000000 -0500
+++ 3.40.src/nucleus/libs/skinie.php	2009-02-14 19:36:46.000000000 -0600
@@ -15,7 +15,7 @@
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: skinie.php 1159 2007-05-24 14:37:56Z kaigreve $
+ * @version $Id: skinie.php 1279 2008-10-23 08:18:26Z shizuki $
  */
 
 class SKINIMPORT {
@@ -113,7 +113,7 @@
 	function readFile($filename, $metaOnly = 0) {
 		// open file
 		$this->fp = @fopen($filename, 'r');
-		if (!$this->fp) return 'Failed to open file/URL';
+		if (!$this->fp) return _SKINIE_ERROR_FAILEDOPEN_FILEURL;
 
 		// here we go!
 		$this->inXml = 1;
@@ -192,7 +192,7 @@
 		// if not allowed to overwrite, check if any nameclashes exists
 		if (!$allowOverwrite) {
 			if ((sizeof($existingSkins) > 0) || (sizeof($existingTemplates) > 0))
-				return 'Name clashes detected, re-run with allowOverwrite = 1 to force overwrite';
+				return _SKINIE_NAME_CLASHES_DETECTED;
 		}
 
 		foreach ($this->skins as $skinName => $data) {
@@ -319,7 +319,7 @@
 				$this->currentPartName = $attrs['name'];
 				break;
 			default:
-				echo 'UNEXPECTED TAG: ' , htmlspecialchars($name) , '<br />';
+				echo _SKINIE_SEELEMENT_UNEXPECTEDTAG . htmlspecialchars($name) , '<br />';
 				break;
 		}
 
@@ -366,7 +366,7 @@
 				}
 				break;
 			default:
-				echo 'UNEXPECTED TAG: ' , htmlspecialchars($name), '<br />';
+				echo _SKINIE_SEELEMENT_UNEXPECTEDTAG . htmlspecialchars($name), '<br />';
 				break;
 		}
 		$this->clearCharacterData();
diff -x .svn -aruN 3.33.src/nucleus/media.php 3.40.src/nucleus/media.php
--- 3.33.src/nucleus/media.php	2008-10-06 07:43:46.000000000 -0500
+++ 3.40.src/nucleus/media.php	2009-02-14 19:36:50.000000000 -0600
@@ -21,7 +21,7 @@
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: media.php 1144 2007-05-11 08:12:43Z kimitake $
+ * @version $Id: media.php 1287 2008-12-12 18:50:10Z ftruscot $
  *
  */
 
@@ -68,10 +68,18 @@
 	case 'chooseupload':
 	case _MEDIA_UPLOAD_TO:
 	case _MEDIA_UPLOAD_NEW:
-		media_choose();
+		if (!$member->isAdmin() and $CONF['AllowUpload'] != true) {
+			media_doError(_ERROR_DISALLOWED);
+		} else {
+			media_choose();
+		}
 		break;
 	case 'uploadfile':
-		media_upload();
+		if (!$member->isAdmin() and $CONF['AllowUpload'] != true) {
+			media_doError(_ERROR_DISALLOWED);
+		} else {
+			media_upload();
+		}
 		break;
 	case _MEDIA_FILTER_APPLY:
 	case 'selectmedia':
@@ -85,8 +93,6 @@
 function media_select() {
 	global $member, $CONF, $DIR_MEDIA, $manager;
 
-	media_head();
-
 	// show 10 files + navigation buttons
 	// show msg when no files
 	// show upload form
@@ -97,6 +103,10 @@
 	if (!$currentCollection || !@is_dir($DIR_MEDIA . $currentCollection))
 		$currentCollection = $member->getID();
 
+	// avoid directory travarsal and accessing invalid directory
+	if (!MEDIA::isValidCollection($currentCollection)) media_doError(_ERROR_DISALLOWED);
+
+	media_head();
 
 	// get collection list
 	$collections = MEDIA::getCollectionList();
diff -x .svn -aruN 3.33.src/nucleus/styles/admin.css 3.40.src/nucleus/styles/admin.css
--- 3.33.src/nucleus/styles/admin.css	2008-10-06 07:43:45.000000000 -0500
+++ 3.40.src/nucleus/styles/admin.css	2009-02-14 19:36:42.000000000 -0600
@@ -1,33 +1,81 @@
 /*
 	admin area style
 	
-	$Id: admin.css 845 2005-12-26 17:23:01Z dekarma $
+	$Id: admin.css 1261 2008-05-22 20:32:43Z kaigreve $
 */
 
 body {
 	background: #ffffff; 
 }
+
 body, td, th, a, li, ul, textarea {
 	color: #000;
 	font-family: "Trebuchet MS", "Bitstream Vera Sans", verdana, lucida, arial, helvetica, sans-serif;
 }
 
+/* basic link appearance */
+a:link, a:visited {
+	color: #1D3565;
+	font-weight: bold;
+	text-decoration: none;
+}
+
+a:hover {
+	text-decoration: underline;
+}
+
+/* textareas */
 textarea {
-  font-size: small;
-  width: 95%;
+	font-size: small;
+	width: 95%;
 }
 
 /* textareas for skin/template editing have monospace fonts */
-textarea.skinedit, textarea.templateedit
-{
+textarea.skinedit, textarea.templateedit {
 	font-family: monospace;
 	font-size: medium;
 }
 
-img			{ border: none; }
-.skip 		{ display: none; }
-label		{ cursor: pointer; }
-.error 		{ color: red; font-size: 1.2em; }
+/* images */
+img	{
+	border: none;
+}
+
+img.skinpreview {
+	border: 1px solid #ccc;
+}
+
+/* forms */
+form {
+	margin-bottom: 0px;
+}
+
+label {
+	cursor: pointer;
+}
+
+input.transparent {
+	background-color: transparent;
+}
+
+/* preformatted text */
+pre {
+	margin-left: 10px;
+}
+
+/* a div that has an indent */
+div.indent {
+	margin-left: 40px;
+}
+
+.skip {
+	display: none;
+}
+
+.error {
+	color: red;
+	font-size: 1.2em;
+}
 
 /* header */
 h1 {
@@ -43,28 +91,6 @@
 
 }
 
-/* page content */
-#content {
-   margin-left:135px;
-	font-style: normal;
-	text-decoration: none;
-	color: black;
-	text-align: justify;
-	line-height: 13pt;
-
-	border-width: 1px;
-	border-style: solid;
-	border-color: black;
-	
-	/* rounded borders in gecko-based browsers? why not :) */
-	-moz-border-radius: 10px;	
-
-	padding: 10px 10px 0 10px;	
-	
-	background-color: white;
-	
-}
-
 /* quick menu on left */
 /* 
 	It's a real pain getting this absolute positioning to work correctly
@@ -97,17 +123,20 @@
 	margin: 0;
 	padding: 0;
 }
-#quickmenu p {
-	padding: 5px;
-	margin: 0px;
-	text-align: justify;
-}
+
 #quickmenu li {
 	padding: 0;
 	margin: 0;
 	text-align: center;
 	border-bottom: 1px solid #ccc;
 }
+
+#quickmenu p {
+	padding: 5px;
+	margin: 0px;
+	text-align: justify;
+}
+
 #quickmenu a {
 	display: block;
 	padding: 5px;
@@ -115,6 +144,7 @@
 	line-height: 1.5em;
 	text-decoration: none;
 }
+
 #quickmenu a:hover {
 	background: #ffffff url(quickb-hover.jpg) top left fixed repeat-y; 
 	color: #000;
@@ -130,11 +160,13 @@
 	background-color: #ddd;
 	color: #000;
 }
+
 #quickmenu form {
 	margin: 0;
 	padding: 5px;
 	text-align: center;
 }
+
 #quickmenu option {
 	font-size: 0.9em;
 }
@@ -148,6 +180,28 @@
 	background-color: white;
 }
 
+/* page content */
+#content {
+	margin-left: 135px;
+	font-style: normal;
+	text-decoration: none;
+	color: black;
+	text-align: justify;
+	line-height: 13pt;
+
+	border-width: 1px;
+	border-style: solid;
+	border-color: black;
+	
+	/* rounded borders in gecko-based browsers? why not :) */
+	-moz-border-radius: 10px;	
+
+	padding: 10px 10px 0 10px;	
+	
+	background-color: white;
+	
+}
+
 #content h2 {
 	color: #596d9d; 
 
@@ -160,7 +214,6 @@
 
 	text-decoration: none;
 	font-weight: bold; 
-
 }
 
 #content h3 {
@@ -180,10 +233,26 @@
 	padding: 5px;
 }
 
-pre {
-	margin-left: 10px;
+/* 
+	font size tricks, to make it work in all browsers
+	
+	See: 
+	http://diveintoaccessibility.org/day_26_using_relative_font_sizes.html
+
+	(netscape 4 trick is left out, Nucleus doesn't work anyway in that browser)	
+	#content should be 'small' (in standard-compliant browsers)
+	
+*/
+
+#content {
+  font-size: small;
+  voice-family: "\"}\"";
+  voice-family: inherit;
+  font-size: small;
 }
+html>body #content { font-size: small; }
 
+/* tables */
 table {
 	border: none;
 	width: 100%;
@@ -192,13 +261,6 @@
 	margin-top: 10px;	
 }
 
-.batchoperations {
-	background-color: #eef;
-	width: auto;
-	padding: 5px;
-	text-align: right;
-}
-
 th {
 	background-color: #bbc;
 	color: #000;
@@ -223,6 +285,7 @@
 	color: black;
 	font-weight: normal;
 }
+
 td a:hover {
 	color: #1D3565;
 	text-decoration: underline;
@@ -236,60 +299,20 @@
 	background-color: green;
 }
 
-a:link, a:visited {
-	color: #1D3565;
-	font-weight: bold;
-	text-decoration: none;
-}
-a:hover {
-	text-decoration: underline;
-}
-
 table.navigation td, table.navigation th {
 	border: none;
 }
 
-/* footer */
-.foot {
-
- padding: 2px 0px 2px 10px;
- margin:10px -10px 0 -10px;
- text-align: center;
-}
-
-form {
-	margin-bottom: 0px;
-}
-
-input.transparent {
-	background-color: transparent;
-}
-
-/* a div that has an indent */
-div.indent {
-	margin-left: 40px;
-}
-
-/* 
-	font size tricks, to make it work in all browsers
-	
-	See: 
-	http://diveintoaccessibility.org/day_26_using_relative_font_sizes.html
-
-	(netscape 4 trick is left out, Nucleus doesn't work anyway in that browser)	
-	#content should be 'small' (in standard-compliant browsers)
-	
-*/
-
-#content {
-  font-size: small;
-  voice-family: "\"}\"";
-  voice-family: inherit;
-  font-size: small;
+.batchoperations {
+	background-color: #eef;
+	width: auto;
+	padding: 5px;
+	text-align: right;
 }
-html>body #content { font-size: small; }
-
 
-img.skinpreview {
-	border: 1px solid #ccc;
+/* footer */
+.foot {
+	padding: 2px 0px 2px 10px;
+	margin:10px -10px 0 -10px;
+	text-align: center;
 }
diff -x .svn -aruN 3.33.src/nucleus/styles/bookmarklet.css 3.40.src/nucleus/styles/bookmarklet.css
--- 3.33.src/nucleus/styles/bookmarklet.css	2008-10-06 07:43:45.000000000 -0500
+++ 3.40.src/nucleus/styles/bookmarklet.css	2009-02-14 19:36:42.000000000 -0600
@@ -1,7 +1,7 @@
 /* 
 	style definitions for the bookmarklet 
 	
-	$Id: bookmarklet.css 757 2005-08-12 07:29:40Z dekarma $
+	$Id: bookmarklet.css 1277 2008-10-22 08:43:59Z shizuki $
 */
 
 body {
@@ -49,7 +49,8 @@
 
 .contentblock {
 	/*background: #ddd;*/
-	height: 400px;
+/*	height: 400px;*/
+	height: 450px;
 	overflow: auto; /* temporary removed, to make the select box work in Mozilla */
 	padding: 1px;
     margin: 0px;
diff -x .svn -aruN 3.33.src/skins/.htaccess 3.40.src/skins/.htaccess
--- 3.33.src/skins/.htaccess	1969-12-31 18:00:00.000000000 -0600
+++ 3.40.src/skins/.htaccess	2009-02-14 19:36:36.000000000 -0600
@@ -0,0 +1,4 @@
+<FilesMatch "\.(php|inc)$">
+Order allow,deny
+Deny from all
+</FilesMatch>
\ No newline at end of file
diff -x .svn -aruN 3.33.src/skins/atom/skinbackup.xml 3.40.src/skins/atom/skinbackup.xml
--- 3.33.src/skins/atom/skinbackup.xml	2008-10-06 07:43:45.000000000 -0500
+++ 3.40.src/skins/atom/skinbackup.xml	2009-02-14 19:36:30.000000000 -0600
@@ -3,41 +3,57 @@
 		<skin name="feeds/atom" />
 		<template name="feeds/atom/modified" />
 		<template name="feeds/atom/entries" />
-		<info><![CDATA[Atom 0.3 weblog syndication]]></info>
+		<info><![CDATA[Atom 1.0 weblog syndication]]></info>
 	</meta>
-	
+
+
 	<skin name="feeds/atom" type="application/atom+xml" includeMode="normal" includePrefix="">
-		<description>Atom 0.3 weblog syndication</description>
+		<description>Atom 1.0 weblog syndication</description>
 		<part name="index"><![CDATA[<?xml version="1.0" encoding="<%charset%>"?>
-<feed version="0.3" xmlns="http://purl.org/atom/ns#">
+
+<feed xml:lang="en-us" xmlns="http://www.w3.org/2005/Atom">
     <title><%blogsetting(name)%></title>
+    <id><%blogsetting(url)%>:<%blogsetting(id)%></id>
+
     <link rel="alternate" type="text/html" href="<%blogsetting(url)%>" />
-    <generator url="http://nucleuscms.org/"><%version%></generator>
-    <modified><%blog(feeds/atom/modified,1)%></modified>
+    <link rel="self" type="application/atom+xml" href="<%blogsetting(url)%><%self%>" />
+    <generator uri="http://nucleuscms.org/"><%version%></generator>
+    <updated><%blog(feeds/atom/modified,1)%></updated>
+
     <%blog(feeds/atom/entries,10)%>
 </feed>]]></part>
+
 	</skin>
 
+
 	<template name="feeds/atom/modified">
 		<description>Atom feeds: Inserts last modification date</description>
 		<part name="ITEM"><![CDATA[<%date(utc)%>]]></part>
+
 	</template>
 
+
 	<template name="feeds/atom/entries">
 		<description>Atom feeds: Feed items</description>
 		<part name="ITEM"><![CDATA[<entry>
- <title type="text/html" mode="escaped"><![CDATA[<%title%>]]></title>
- <link rel="alternate" type="text/html" href="<%blogurl%>index.php?itemid=<%itemid%>" />
- <author>
-  <name><%author%></name>
- </author>
- <modified><%date(utc)%></modified>
- <issued><%date(iso8601)%></issued>
- <content type="text/html" mode="escaped"><![CDATA[<%body%><%more%>]]></content>
- <id><%blogurl%>:<%blogid%>:<%itemid%></id>
+    <title type="html"><![CDATA[<%title%>]]]]><![CDATA[></title>
+    <link rel="alternate" type="text/html" href="<%itemlink%>" />
+    <author>
+        <name><%author%></name>
+    </author>
+    <updated><%date(utc)%></updated>
+    <published><%date(iso8601)%></published>
+    <content type="html"><![CDATA[<%body%><%more%>]]]]><![CDATA[></content>
+    <id><%blogurl%>:<%blogid%>:<%itemid%></id>
 </entry>]]></part>
+
+		<part name="POPUP_CODE"><![CDATA[<%media%>]]></part>
+
 		<part name="IMAGE_CODE"><![CDATA[<%image%>]]></part>
+
 		<part name="MEDIA_CODE"><![CDATA[<%media%>]]></part>
-		<part name="POPUP_CODE"><![CDATA[<%media%>]]></part>
+
 	</template>
+
+
 </nucleusskin>
\ No newline at end of file
diff -x .svn -aruN 3.33.src/skins/default/head.inc 3.40.src/skins/default/head.inc
--- 3.33.src/skins/default/head.inc	2008-10-06 07:43:45.000000000 -0500
+++ 3.40.src/skins/default/head.inc	2009-02-14 19:36:34.000000000 -0600
@@ -21,6 +21,9 @@
 <link rel="stylesheet" type="text/css" href="<%skinfile(nicetitle.css)%>" />
 <script type="text/javascript" src="<%skinfile(nicetitle.js)%>"></script>
 
+<!-- ATOM support --> 
+<link rel="alternate" type="application/atom+xml" title="ATOM" href="atom.php" /> 
+
 <!-- RSS 2.0 feed -->
 <link rel="alternate" type="application/rss+xml" title="RSS" href="xml-rss2.php" />
 
diff -x .svn -aruN 3.33.src/skins/default/show_benchmark.inc 3.40.src/skins/default/show_benchmark.inc
--- 3.33.src/skins/default/show_benchmark.inc	2008-10-06 07:43:45.000000000 -0500
+++ 3.40.src/skins/default/show_benchmark.inc	2009-02-14 19:36:34.000000000 -0600
@@ -1,9 +1,9 @@
-<?
+<?php
 if (!function_exists('getmtime'))
 {
   function getmtime()
   {
-    $a = explode (' ',microtime());
+    $a = explode (' ', microtime());
     return(double) $a[0] + $a[1];
   }
 }
diff -x .svn -aruN 3.33.src/skins/default/sidebar.inc 3.40.src/skins/default/sidebar.inc
--- 3.33.src/skins/default/sidebar.inc	2008-10-06 07:43:45.000000000 -0500
+++ 3.40.src/skins/default/sidebar.inc	2009-02-14 19:36:34.000000000 -0600
@@ -58,6 +58,7 @@
 <!-- admin link, only visible if logged in -->
 <%if(loggedin)%>
 <dd><a href="<%adminurl%>" title="Admin Area">Admin</a></dd>
+<dd><a href="<%addlink%>" onclick="<%addpopupcode%>" title="Add an item to your blog">Add an item</a></dd>
 <%endif%>
 </dl>
 </div>
diff -x .svn -aruN 3.33.src/skins/default/skinbackup.xml 3.40.src/skins/default/skinbackup.xml
--- 3.33.src/skins/default/skinbackup.xml	2008-10-06 07:43:45.000000000 -0500
+++ 3.40.src/skins/default/skinbackup.xml	2009-02-14 19:36:34.000000000 -0600
@@ -1,17 +1,15 @@
 <nucleusskin>
-<meta>
-	<skin name="default" />
-	<template name="default/index" />
-	<template name="default/item" />
-	<info><![CDATA[Nucleus CMS Default Skin]]></info>
-</meta>
+	<meta>
+		<skin name="default" />
+		<template name="default/index" />
+		<template name="default/item" />
+		<info><![CDATA[Nucleus CMS Default Skin]]></info>
+	</meta>
 
-<skin name="default" type="text/html" includeMode="skindir" includePrefix="default/">
 
-<description>Nucleus CMS default skin</description>
-
-
-	<part name="archive"><![CDATA[<%parsedinclude(head.inc)%>
+	<skin name="default" type="text/html" includeMode="skindir" includePrefix="default/">
+		<description>Nucleus CMS default skin</description>
+		<part name="archive"><![CDATA[<%parsedinclude(head.inc)%>
 
 <!-- page header -->
 <%parsedinclude(header.inc)%>
@@ -38,8 +36,7 @@
 <!-- page footer -->
 <%parsedinclude(footer.inc)%>]]></part>
 
-
-	<part name="archivelist"><![CDATA[<%parsedinclude(head.inc)%>
+		<part name="archivelist"><![CDATA[<%parsedinclude(head.inc)%>
 
 <!-- page header -->
 <%parsedinclude(header.inc)%>
@@ -66,8 +63,7 @@
 <!-- page footer -->
 <%parsedinclude(footer.inc)%>]]></part>
 
-
-	<part name="error"><![CDATA[<%parsedinclude(head.inc)%>
+		<part name="error"><![CDATA[<%parsedinclude(head.inc)%>
 
 <!-- page header -->
 <%parsedinclude(header.inc)%>
@@ -92,8 +88,7 @@
 <!-- page footer -->
 <%parsedinclude(footer.inc)%>]]></part>
 
-
-	<part name="imagepopup"><![CDATA[<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+		<part name="imagepopup"><![CDATA[<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 
 <html>
 <head>
@@ -111,8 +106,7 @@
 
 </html>]]></part>
 
-
-	<part name="index"><![CDATA[<%parsedinclude(head.inc)%>
+		<part name="index"><![CDATA[<%parsedinclude(head.inc)%>
 
 <!-- page header -->
 <%parsedinclude(header.inc)%>
@@ -133,8 +127,7 @@
 <!-- page footer -->
 <%parsedinclude(footer.inc)%>]]></part>
 
-
-	<part name="item"><![CDATA[<%parsedinclude(head.inc)%>
+		<part name="item"><![CDATA[<%parsedinclude(head.inc)%>
 
 <!-- page header -->
 <%parsedinclude(header.inc)%>
@@ -168,8 +161,7 @@
 <!-- page footer -->
 <%parsedinclude(footer.inc)%>]]></part>
 
-
-	<part name="member"><![CDATA[<%parsedinclude(head.inc)%>
+		<part name="member"><![CDATA[<%parsedinclude(head.inc)%>
 
 <!-- page header -->
 <%parsedinclude(header.inc)%>
@@ -201,8 +193,7 @@
 <!-- page footer -->
 <%parsedinclude(footer.inc)%>]]></part>
 
-
-	<part name="search"><![CDATA[<%parsedinclude(head.inc)%>
+		<part name="search"><![CDATA[<%parsedinclude(head.inc)%>
 
 <!-- page header -->
 <%parsedinclude(header.inc)%>
@@ -229,58 +220,13 @@
 <!-- page footer -->
 <%parsedinclude(footer.inc)%>]]></part>
 
-</skin>
+	</skin>
 
 
-<template name="default/index">
+	<template name="default/index">
+		<description>Nucleus CMS default index template</description>
 
-<description>Nucleus CMS default index template</description>
-
-	<part name="ARCHIVELIST_LISTITEM"><![CDATA[<dd>
-<a href="<%archivelink%>" title="Archive for %B, %Y">%B, %Y</a>
-</dd>]]></part>
-
-	<part name="BLOGLIST_LISTITEM"><![CDATA[<dd>
-<a href="<%bloglink%>" title="<%blogdesc%>"><%blogname%></a>
-</dd>]]></part>
-
-	<part name="CATLIST_HEADER"><![CDATA[<dd>
-<a href="<%blogurl%>" title="All categories">All</a>
-</dd>]]></part>
-
-	<part name="CATLIST_LISTITEM"><![CDATA[<dd>
-<a href="<%catlink%>" title="Category: <%catname%>"><%catname%></a>
-</dd>]]></part>
-
-	<part name="COMMENTS_MANY"><![CDATA[Comments]]></part>
-
-	<part name="COMMENTS_NONE"><![CDATA[<div class="contentitem3">
-<small class="contentitemcomments">
-<a href="<%itemlink%>#c" rel="bookmark" title="Add comment on '<%itemtitle(attribute)%>'">Add comment</a>
-</small>
-</div>]]></part>
-
-	<part name="COMMENTS_ONE"><![CDATA[Comment]]></part>
-
-	<part name="COMMENTS_TOOMUCH"><![CDATA[<div class="contentitem3">
-<small class="contentitemcomments">
-<a href="<%itemlink%>#c" rel="bookmark" title="Add comment on '<%itemtitle(attribute)%>'"><%commentcount%> <%commentword%></a>
-</small>
-</div>]]></part>
-
-	<part name="EDITLINK"><![CDATA[<div class="contentitem4">
-<small class="contentitemedit">
-<a href="<%editlink%>" title="Make changes to your entry" onclick="<%editpopupcode%>" >Edit item</a>
-</small>
-</div>]]></part>
-
-	<part name="FORMAT_DATE"><![CDATA[%d/%m]]></part>
-
-	<part name="FORMAT_TIME"><![CDATA[%X]]></part>
-
-	<part name="IMAGE_CODE"><![CDATA[<%image%>]]></part>
-
-	<part name="ITEM"><![CDATA[<div class="contenttitle">
+		<part name="ITEM"><![CDATA[<div class="contenttitle">
 <h2><%date%>: <a href="<%itemlink%>" title="Read entry: <%title(attribute)%>"><%title(raw)%></a></h2>
 </div>
 <div class="contentitem">
@@ -302,58 +248,71 @@
 <%morelink%>
 </div>]]></part>
 
-	<part name="LOCALE"><![CDATA[en]]></part>
-
-	<part name="MEDIA_CODE"><![CDATA[<%media%>]]></part>
-
-	<part name="MORELINK"><![CDATA[<p>&raquo;
+		<part name="MORELINK"><![CDATA[<p>&raquo;
 <a href="<%itemlink%>#more" title="Read more on '<%title(attribute)%>'">Read More</a>
 </p>]]></part>
 
-	<part name="POPUP_CODE"><![CDATA[<%popuplink%>]]></part>
+		<part name="EDITLINK"><![CDATA[<div class="contentitem4">
+<small class="contentitemedit">
+<a href="<%editlink%>" title="Make changes to your entry" onclick="<%editpopupcode%>" >Edit item</a>
+</small>
+</div>]]></part>
+
+		<part name="COMMENTS_ONE"><![CDATA[Comment]]></part>
+
+		<part name="COMMENTS_MANY"><![CDATA[Comments]]></part>
+
+		<part name="COMMENTS_NONE"><![CDATA[<div class="contentitem3">
+<small class="contentitemcomments">
+<a href="<%itemlink%>#c" rel="bookmark" title="Add comment on '<%itemtitle(attribute)%>'">Add comment</a>
+</small>
+</div>]]></part>
+
+		<part name="COMMENTS_TOOMUCH"><![CDATA[<div class="contentitem3">
+<small class="contentitemcomments">
+<a href="<%itemlink%>#c" rel="bookmark" title="Add comment on '<%itemtitle(attribute)%>'"><%commentcount%> <%commentword%></a>
+</small>
+</div>]]></part>
 
-	<part name="SEARCH_HIGHLIGHT"><![CDATA[<span class="highlight">\0</span>]]></part>
+		<part name="ARCHIVELIST_LISTITEM"><![CDATA[<dd>
+<a href="<%archivelink%>" title="Archive for %B, %Y">%B, %Y</a>
+</dd>]]></part>
 
-	<part name="SEARCH_NOTHINGFOUND"><![CDATA[No search results found for <b><%query%></b>]]></part>
+		<part name="BLOGLIST_LISTITEM"><![CDATA[<dd>
+<a href="<%bloglink%>" title="<%blogdesc%>"><%blogname%></a>
+</dd>]]></part>
 
-</template>
+		<part name="CATLIST_HEADER"><![CDATA[<dd>
+<a href="<%blogurl%>" title="All categories">All</a>
+</dd>]]></part>
 
+		<part name="CATLIST_LISTITEM"><![CDATA[<dd>
+<a href="<%catlink%>" title="Category: <%catname%>"><%catname%></a>
+</dd>]]></part>
 
-<template name="default/item">
+		<part name="FORMAT_DATE"><![CDATA[%d/%m]]></part>
 
-<description>Nucleus CMS default item template</description>
+		<part name="FORMAT_TIME"><![CDATA[%X]]></part>
 
-	<part name="COMMENTS_BODY"><![CDATA[<div class="itemcomment id<%memberid%>">
-<h3><a href="<%userlinkraw%>"
-title="<%ip%> | Click to visit <%user%>'s website or send an email">
-<%user%></a> wrote:</h3>
-<div class="commentbody">
-<%body%>
-</div>
-<div class="commentinfo">
-<%date%> <%time%>
-</div>
-</div>]]></part>
+		<part name="LOCALE"><![CDATA[en]]></part>
 
-	<part name="COMMENTS_MANY"><![CDATA[comments]]></part>
+		<part name="POPUP_CODE"><![CDATA[<%popuplink%>]]></part>
 
-	<part name="COMMENTS_NONE"><![CDATA[<div class="comments">No comments yet</div>]]></part>
+		<part name="IMAGE_CODE"><![CDATA[<%image%>]]></part>
 
-	<part name="COMMENTS_ONE"><![CDATA[comment]]></part>
+		<part name="MEDIA_CODE"><![CDATA[<%media%>]]></part>
 
-	<part name="EDITLINK"><![CDATA[<div class="contentitem4">
-<small class="contentitemedit">
-<a href="<%editlink%>" title="Make changes to your entry" onclick="<%editpopupcode%>" >Edit item</a>
-</small>
-</div>]]></part>
+		<part name="SEARCH_HIGHLIGHT"><![CDATA[<span class="highlight">\0</span>]]></part>
 
-	<part name="FORMAT_DATE"><![CDATA[%d/%m]]></part>
+		<part name="SEARCH_NOTHINGFOUND"><![CDATA[No search results found for <b><%query%></b>]]></part>
 
-	<part name="FORMAT_TIME"><![CDATA[%X]]></part>
+	</template>
 
-	<part name="IMAGE_CODE"><![CDATA[<%image%>]]></part>
 
-	<part name="ITEM"><![CDATA[<div class="contenttitle">
+	<template name="default/item">
+		<description>Nucleus CMS default item template</description>
+
+		<part name="ITEM"><![CDATA[<div class="contenttitle">
 <h2><%date%>: <%title(raw)%></h2>
 </div>
 <div class="contentitem">
@@ -374,14 +333,45 @@
 <a name="more"></a><%more%>
 </div>]]></part>
 
-	<part name="LOCALE"><![CDATA[en]]></part>
+		<part name="COMMENTS_BODY"><![CDATA[<div class="itemcomment id<%memberid%>">
+<h3><a href="<%userlinkraw%>"
+title="<%ip%> | Click to visit <%user%>'s website or send an email">
+<%user%></a> wrote:</h3>
+<div class="commentbody">
+<%body%>
+</div>
+<div class="commentinfo">
+<%date%> <%time%>
+</div>
+</div>]]></part>
+
+		<part name="EDITLINK"><![CDATA[<div class="contentitem4">
+<small class="contentitemedit">
+<a href="<%editlink%>" title="Make changes to your entry" onclick="<%editpopupcode%>" >Edit item</a>
+</small>
+</div>]]></part>
+
+		<part name="COMMENTS_ONE"><![CDATA[comment]]></part>
+
+		<part name="COMMENTS_MANY"><![CDATA[comments]]></part>
+
+		<part name="COMMENTS_NONE"><![CDATA[<div class="comments">No comments yet</div>]]></part>
+
+		<part name="FORMAT_DATE"><![CDATA[%d/%m]]></part>
+
+		<part name="FORMAT_TIME"><![CDATA[%X]]></part>
+
+		<part name="LOCALE"><![CDATA[en]]></part>
+
+		<part name="POPUP_CODE"><![CDATA[<%popuplink%>]]></part>
+
+		<part name="IMAGE_CODE"><![CDATA[<%image%>]]></part>
 
-	<part name="MEDIA_CODE"><![CDATA[<%media%>]]></part>
+		<part name="MEDIA_CODE"><![CDATA[<%media%>]]></part>
 
-	<part name="POPUP_CODE"><![CDATA[<%popuplink%>]]></part>
+		<part name="SEARCH_HIGHLIGHT"><![CDATA[<span class="highlight">\0</span>]]></part>
 
-	<part name="SEARCH_HIGHLIGHT"><![CDATA[<span class="highlight">\0</span>]]></part>
+	</template>
 
-</template>
 
 </nucleusskin>
diff -x .svn -aruN 3.33.src/skins/readme.txt 3.40.src/skins/readme.txt
--- 3.33.src/skins/readme.txt	2008-10-06 07:43:45.000000000 -0500
+++ 3.40.src/skins/readme.txt	2009-02-14 19:36:36.000000000 -0600
@@ -3,4 +3,6 @@
 
 PLEASE NOTE: the skinbackup.xml or skindata.xml files in these directories are not where you should edit the skins. These files get generated by the Nucleus skin export function and are meant to distribute skins between Nucleus users.
 
-To edit skins, open the Nucleus Admin Area, and select 'skins' in the left menu.
\ No newline at end of file
+To edit skins, open the Nucleus Admin Area, and select 'skins' in the left menu.
+
+PLEASE NOTE: the .htaccess file in this directory is intended to prohibit, for enhanced security, direct access .inc and .php files in the skin folders. Depending on the web server configuration, the code in this .htaccess file may not work as intended. In this case, your site will be displayed incorrectly, with missing content or style. Renaming the .htaccess file should fix the problem.
\ No newline at end of file
diff -x .svn -aruN 3.33.src/skins/rsd/skinbackup.xml 3.40.src/skins/rsd/skinbackup.xml
--- 3.33.src/skins/rsd/skinbackup.xml	2008-10-06 07:43:45.000000000 -0500
+++ 3.40.src/skins/rsd/skinbackup.xml	2009-02-14 19:36:36.000000000 -0600
@@ -1,16 +1,30 @@
-<nucleusskin><meta><skin name="xml/rsd" /><info><![CDATA[RSD (Really Simple Discovery) information for weblog clients]]></info></meta><skin name="xml/rsd" type="text/xml" includeMode="normal" includePrefix=""><description>RSD (Really Simple Discovery) information for weblog clients</description><part name="index"><![CDATA[<?xml version="1.0"?>
+<nucleusskin>
+	<meta>
+		<skin name="xml/rsd" />
+		<info><![CDATA[RSD (Really Simple Discovery) information for weblog clients]]></info>
+	</meta>
+
+
+	<skin name="xml/rsd" type="text/xml" includeMode="normal" includePrefix="">
+		<description>RSD (Really Simple Discovery) information for weblog clients</description>
+		<part name="index"><![CDATA[<?xml version="1.0"?>
 <rsd version="1.0">
- <service>
-  <engineName><%version%></engineName>
-  <engineLink>http://nucleuscms.org/</engineLink>
-  <homepageLink><%sitevar(url)%></homepageLink>
-  <apis>
-   <api name="MetaWeblog" preferred="true" apiLink="<%adminurl%>xmlrpc/server.php" blogID="<%blogsetting(id)%>">
-	<docs>http://nucleuscms.org/documentation/devdocs/xmlrpc.html</docs>
-   </api>
-   <api name="Blogger" preferred="false" apiLink="<%adminurl%>xmlrpc/server.php" blogID="<%blogsetting(id)%>">
-	<docs>http://nucleuscms.org/documentation/devdocs/xmlrpc.html</docs>
-   </api>
-  </apis>
- </service>
-</rsd>]]></part></skin></nucleusskin>
\ No newline at end of file
+    <service>
+        <engineName><%version%></engineName>
+        <engineLink>http://nucleuscms.org/</engineLink>
+        <homepageLink><%sitevar(url)%></homepageLink>
+        <apis>
+            <api name="MetaWeblog" preferred="true" apiLink="<%adminurl%>xmlrpc/server.php" blogID="<%blogsetting(id)%>">
+                <docs>http://nucleuscms.org/documentation/devdocs/xmlrpc.html</docs>
+            </api>
+            <api name="Blogger" preferred="false" apiLink="<%adminurl%>xmlrpc/server.php" blogID="<%blogsetting(id)%>">
+                <docs>http://nucleuscms.org/documentation/devdocs/xmlrpc.html</docs>
+            </api>
+        </apis>
+    </service>
+</rsd>]]></part>
+
+	</skin>
+
+
+</nucleusskin>
\ No newline at end of file
diff -x .svn -aruN 3.33.src/skins/rss2.0/skinbackup.xml 3.40.src/skins/rss2.0/skinbackup.xml
--- 3.33.src/skins/rss2.0/skinbackup.xml	2008-10-06 07:43:45.000000000 -0500
+++ 3.40.src/skins/rss2.0/skinbackup.xml	2009-02-14 19:36:36.000000000 -0600
@@ -1,32 +1,60 @@
-<nucleusskin><meta><skin name="feeds/rss20" /><template name="feeds/rss20" /><info><![CDATA[RSS 2.0 syndication of weblogs]]></info></meta><skin name="feeds/rss20" type="text/xml" includeMode="normal" includePrefix=""><description>RSS 2.0 syndication of weblogs</description><part name="index"><![CDATA[<?xml version="1.0" encoding="<%charset%>"?>
+<nucleusskin>
+	<meta>
+		<skin name="feeds/rss20" />
+		<template name="feeds/rss20" />
+		<info><![CDATA[RSS 2.0 syndication of weblogs]]></info>
+	</meta>
+
+
+	<skin name="feeds/rss20" type="text/xml" includeMode="normal" includePrefix="">
+		<description>RSS 2.0 syndication of weblogs</description>
+		<part name="index"><![CDATA[<?xml version="1.0" encoding="<%charset%>"?>
 <rss version="2.0">
-  <channel>
+    <channel>
     <title><%blogsetting(name)%></title>
     <link><%blogsetting(url)%></link>
     <description><%blogsetting(desc)%></description>
     <language>en-us</language>           
     <generator><%version%></generator>
-    <copyright></copyright>             
+    <copyright>&#169;</copyright>             
     <category>Weblog</category>
     <docs>http://backend.userland.com/rss</docs>
     <image>
-      <url><%blogsetting(url)%>/nucleus/nucleus2.gif</url>
-      <title><%blogsetting(name)%></title>
-      <link><%blogsetting(url)%></link>
+        <url><%blogsetting(url)%>/nucleus/nucleus2.gif</url>
+        <title><%blogsetting(name)%></title>
+        <link><%blogsetting(url)%></link>
     </image>
     <%blog(feeds/rss20,10)%>
   </channel>
-</rss>]]></part></skin><template name="feeds/rss20"><description>Used for RSS 2.0 syndication of your blog</description><part name="EDITLINK"><![CDATA[<a href="<%editlink%>" onclick="<%editpopupcode%>">edit</a>]]></part><part name="FORMAT_DATE"><![CDATA[%x]]></part><part name="FORMAT_TIME"><![CDATA[%X]]></part><part name="ITEM"><![CDATA[<item>
- <title><%title(xml)%></title>
- <link><%blogurl%>index.php?itemid=<%itemid%></link>
-<description><![CDATA[<%body%><%more%>]]></description>
- <category><%category%></category>
-<comments><%blogurl%>index.php?itemid=<%itemid%></comments>
- <pubDate><%date(rfc822)%></pubDate>
+</rss>]]></part>
+
+	</skin>
+
+
+	<template name="feeds/rss20">
+		<description>Used for RSS 2.0 syndication of your blog</description>
+		<part name="ITEM"><![CDATA[<item>
+    <title><%title(xml)%></title>
+    <link><%itemlink%></link>
+    <description><![CDATA[<%body%><%more%>]]]]><![CDATA[></description>
+    <category><%category%></category>
+    <comments><%itemlink%></comments>
+    <pubDate><%date(rfc822)%></pubDate>
 </item>]]></part>
 
-<part name="IMAGE_CODE"><![CDATA[<%image%>]]></part>
-<part name="MEDIA_CODE"><![CDATA[<%media%>]]></part>
-<part name="POPUP_CODE"><![CDATA[<%media%>]]></part>
+		<part name="EDITLINK"><![CDATA[<a href="<%editlink%>" onclick="<%editpopupcode%>">edit</a>]]></part>
+
+		<part name="FORMAT_DATE"><![CDATA[%x]]></part>
+
+		<part name="FORMAT_TIME"><![CDATA[%X]]></part>
+
+		<part name="POPUP_CODE"><![CDATA[<%popuplink%>]]></part>
+
+		<part name="IMAGE_CODE"><![CDATA[<%image%>]]></part>
+
+		<part name="MEDIA_CODE"><![CDATA[<%media%>]]></part>
+
+	</template>
+
 
-</template></nucleusskin>
\ No newline at end of file
+</nucleusskin>
\ No newline at end of file
