diff -x .svn -aruN 3.40.src/nucleus/documentation/history.html 3.41.src/nucleus/documentation/history.html
--- 3.40.src/nucleus/documentation/history.html	2009-04-15 12:46:28.000000000 -0500
+++ 3.41.src/nucleus/documentation/history.html	2009-03-15 22:31:37.000000000 -0500
@@ -2,7 +2,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" lang="en-us" xml:lang="en-us">
 <head>
-	<!-- $Id: history.html 1324 2009-02-13 05:04:30Z shizuki $ -->
+	<!-- $Id: history.html 1356 2009-03-15 21:21:25Z kaigreve $ -->
     <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" />
@@ -28,6 +28,19 @@
 
 <ul>
 	<li>
+		<strong>Nucleus v3.41 (March 15, 2009)</strong>
+		<ul>
+			<li>FIXED: Reduce PHP Notices caused by undefined variables and wrong offsets (shizuki, kaigreve)</li>
+			<li>FIXED: additional changes in the language files english.php and english-utf8.php to reflect modifications since version 3.30 (kaigreve)</li>
+			<li>FIXED: SQL error in MEMBER::write() where mautosave not forced to be integer. See <a href="http://forum.nucleuscms.org/viewtopic.php?t=18575">Problem with 3.40</a>. (ftruscot)</li>
+			<li>CHANGED: Modify Fix SQL error when new blog add by shizuki, to give a default english value for category name, category desc, first item title, and first item body in case where user does not have updated language file. (ftruscot)</li>
+			<li>FIXED: Fix SQL Error when new blog add. (shizuki)</li>
+			<li>CHANGED: Mod Change link URI of 'help icon' to full URI (documentation/help.html to $CONF['AdminURL'].'documentation/help.html') (shizuki)</li>
+			<li>ADDED: getTeamBlogs() method to MEMBER class to retrieve list of blogs to which a member has team rights (ftruscot)</li>
+			<li>FIXED: rearrange english.php and english-utf8.php files so all new-to-3.40 contants are grouped together at top (ftruscot)</li>
+			<li>FIXED: Add missing language item to english-utf-8.php (admun)</li>
+			<li>FIXED: CONF['Self'] merging error in globalfunctions.php (admun)</li>
+		</ul>
 		<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>
diff -x .svn -aruN 3.40.src/nucleus/language/english.php 3.41.src/nucleus/language/english.php
--- 3.40.src/nucleus/language/english.php	2009-04-15 12:46:28.000000000 -0500
+++ 3.41.src/nucleus/language/english.php	2009-03-15 22:31:29.000000000 -0500
@@ -17,11 +17,61 @@
  *
  * @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 $
+ * @version $Id: english.php 1349 2009-03-13 13:42:10Z kaigreve $
  */
 
+/********************************************
+ *        Start New for 3.40                *
+ ********************************************/
+
 // START changed/added after 3.33 START
 define('_MEMBERS_USEAUTOSAVE',						'Use the Autosave function?');
+
+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');
+define('_SETTINGS_DEBUGVARS',		'Debug Vars');
+
+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');
+
+define('_BMLET_BACKTODRAFTS',		'Move back to drafts');
+define('_BMLET_CANCEL',				'Cancel');
+
+define('_LIST_ITEM_NOCONTENT',						'No Comment');
+define('_LIST_ITEM_COMMENTS',						'%d Comments');
+
+define('_EDITC_URL',				'Web site');
+define('_EDITC_EMAIL',				'E-mail');
+
+define('_MANAGER_PLUGINFILE_NOTFOUND',				"Plugin %s was not loaded (File not found)");
+/* changed */
+// plugin dependency 
+define('_ERROR_INSREQPLUGIN',		'Plugin installation failed, requires %s');
+define('_ERROR_DELREQPLUGIN',		'Plugin deletion failed, required by %s');
+
+//define('_ADD_ADDLATER',								'Add Later');
+define('_ADD_ADDLATER',								'Add the dates specified');
+
+define('_LOGIN_NAME',				'Name:');
+define('_LOGIN_PASSWORD',			'Password:');
+
+// changed from _BOOKMARLET_BMARKLFOLLOW
+define('_BOOKMARKLET_BMARKFOLLOW',					' (Works with nearly all browsers)');
 // END changed/added after 3.33 END
 
 // START merge UTF-8 and EUC-JP
@@ -42,32 +92,257 @@
 
 // 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
+// <add by shizuki>
+// OVERVIEW screen
+define('_OVERVIEW_SHOWALL',							'Show all blogs');	// <add by shizuki />
 
-// 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');
+// Edit skins
+define('_SKINEDIT_ALLOWEDBLOGS',						'Short blog names:');			// <add by shizuki>
+define('_SKINEDIT_ALLOWEDTEMPLATESS',					'Template names:');		// <add by shizuki>
 
-// START changed/added for 3.32 START
-define('_SETTINGS_DEBUGVARS',		'Debug Vars');
-// END changed/added for 3.32 END
+// 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_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_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>
+
+/********************************************
+ *        End New for 3.40                  *
+ ********************************************/
 
 // START changed/added after 3.3 START
 define('_AUTOSAVEDRAFT',		'Auto save draft');
@@ -113,10 +388,6 @@
 // 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 %s');
-define('_ERROR_DELREQPLUGIN',		'Plugin deletion failed, required by %s');
-
 // cookie prefix
 define('_SETTINGS_COOKIEPREFIX',	'Cookie Prefix');
 
@@ -403,8 +674,6 @@
 // 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');
@@ -553,8 +822,6 @@
 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 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)');
@@ -898,8 +1165,6 @@
 
 // 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?');
 
@@ -1012,8 +1277,6 @@
 // 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
@@ -1025,8 +1288,6 @@
 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');
@@ -1036,257 +1297,4 @@
 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.40.src/nucleus/libs/ADMIN.php 3.41.src/nucleus/libs/ADMIN.php
--- 3.40.src/nucleus/libs/ADMIN.php	2009-04-15 12:46:28.000000000 -0500
+++ 3.41.src/nucleus/libs/ADMIN.php	2009-03-15 22:31:35.000000000 -0500
@@ -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 1319 2009-02-11 11:27:15Z shizuki $
+ * @version $Id: ADMIN.php 1352 2009-03-14 02:14:10Z ehui $
  */
 
 if ( !function_exists('requestVar') ) exit;
@@ -334,7 +334,7 @@
 			$amount = intPostVar('amount');
 		else {
 			$amount = intval($CONF['DefaultListSize']);
-			if ($amount < 1) 
+			if ($amount < 1)
 				$amount = 10;
 		}
 
@@ -901,7 +901,7 @@
 			$amount = intPostVar('amount');
 		else {
 			$amount = intval($CONF['DefaultListSize']);
-			if ($amount < 1) 
+			if ($amount < 1)
 				$amount = 10;
 		}
 
@@ -956,7 +956,7 @@
 			$amount = intPostVar('amount');
 		else {
 			$amount = intval($CONF['DefaultListSize']);
-			if ($amount < 1) 
+			if ($amount < 1)
 				$amount = 10;
 		}
 
@@ -1000,7 +1000,7 @@
 			$amount = intPostVar('amount');
 		else {
 			$amount = intval($CONF['DefaultListSize']);
-			if ($amount < 1) 
+			if ($amount < 1)
 				$amount = 10;
 		}
 
@@ -1056,7 +1056,7 @@
 			$amount = intPostVar('amount');
 		else {
 			$amount = intval($CONF['DefaultListSize']);
-			if ($amount < 1) 
+			if ($amount < 1)
 				$amount = 10;
 		}
 
@@ -1224,7 +1224,7 @@
 				$wasdraft = 0;
 				$publish = 0;
 				$timestamp = 0;
-				break;			
+				break;
 			case 'edit':
 			default:
 				$publish = 1;
@@ -1519,7 +1519,7 @@
 		}
 		if ($result['status'] == 'newcategory') {
 //			$distURI = ($nextAction == 'sendping') ? $manager->addTicketToUrl($CONF['AdminURL'] . 'index.php?action='
-//					 . $nextAction . '&blogid=' . intval($blogid)) : 
+//					 . $nextAction . '&blogid=' . intval($blogid)) :
 //					   '';
 			$distURI = $manager->addTicketToUrl($CONF['AdminURL'] . 'index.php?action=' . $nextAction . '&blogid=' . intval($blogid));
 			$this->action_categoryedit($result['catid'], $blogid, $distURI);
@@ -2100,7 +2100,7 @@
 			$mem->setCanLogin($canlogin);
 		}
 
-		$autosave = postVar ('autosave'); 
+		$autosave = postVar ('autosave');
 		$mem->setAutosave($autosave);
 
 		$mem->write();
@@ -3437,7 +3437,12 @@
 		$blog	=& $manager->getBlog($blogid);
 
 		// create new category
-		sql_query('INSERT INTO '.sql_table('category')." (cblog, cname, cdesc) VALUES ($blogid, _EBLOGDEFAULTCATEGORY_NAME, _EBLOGDEFAULTCATEGORY_DESC)");
+		$catdefname = (defined('_EBLOGDEFAULTCATEGORY_NAME') ? _EBLOGDEFAULTCATEGORY_NAME : 'General');
+		$catdefdesc = (defined('_EBLOGDEFAULTCATEGORY_DESC') ? _EBLOGDEFAULTCATEGORY_DESC : 'Items that do not fit in other categories');
+		$sql = 'INSERT INTO %s (cblog, cname, cdesc) VALUES (%d, "%s", "%s")';
+		sql_query(sprintf($sql, sql_table('category'), $blogid, $catdefname, $catdefdesc));
+//		sql_query(sprintf($sql, sql_table('category'), $blogid, _EBLOGDEFAULTCATEGORY_NAME, _EBLOGDEFAULTCATEGORY_DESC));
+//		sql_query('INSERT INTO '.sql_table('category')." (cblog, cname, cdesc) VALUES ($blogid, _EBLOGDEFAULTCATEGORY_NAME, _EBLOGDEFAULTCATEGORY_DESC)");
 		$catid = mysql_insert_id();
 
 		// set as default category
@@ -3449,8 +3454,11 @@
 		$query = 'INSERT INTO '.sql_table('team')." (tmember, tblog, tadmin) VALUES ($memberid, $blogid, 1)";
 		sql_query($query);
 
+		$itemdeftitle = (defined('_EBLOG_FIRSTITEM_TITLE') ? _EBLOG_FIRSTITEM_TITLE : 'First Item');
+		$itemdefbody = (defined('_EBLOG_FIRSTITEM_BODY') ? _EBLOG_FIRSTITEM_BODY : 'This is the first item in your weblog. Feel free to delete it.');
 
-		$blog->additem($blog->getDefaultCategory(),_EBLOG_FIRSTITEM_TITLE,_EBLOG_FIRSTITEM_BODY,'',$blogid, $memberid,$blog->getCorrectTime(),0,0,0);
+		$blog->additem($blog->getDefaultCategory(),$itemdeftitle,$itemdefbody,'',$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',
@@ -3476,13 +3484,13 @@
 		<p><?php echo sprintf(_BLOGCREATED_ADDEDTXT, htmlspecialchars($bname)) ?></p>
 
 		<ol>
-			<li><a href="#index_php"><?php sprintf(_BLOGCREATED_SIMPLEWAY, htmlspecialchars($bshortname)) ?></code></a></li>
-			<li><a href="#skins"><?php _BLOGCREATED_ADVANCEDWAY ?></a></li>
+			<li><a href="#index_php"><?php echo sprintf(_BLOGCREATED_SIMPLEWAY, htmlspecialchars($bshortname)) ?></a></li>
+			<li><a href="#skins"><?php echo _BLOGCREATED_ADVANCEDWAY ?></a></li>
 		</ol>
 
-		<h3><a id="index_php"><?php sprintf(_BLOGCREATED_SIMPLEDESC1, htmlspecialchars($bshortname)) ?></a></h3>
+		<h3><a id="index_php"><?php echo sprintf(_BLOGCREATED_SIMPLEDESC1, htmlspecialchars($bshortname)) ?></a></h3>
 
-		<p><?php sprintf(_BLOGCREATED_SIMPLEDESC2, htmlspecialchars($bshortname)) ?></p>
+		<p><?php echo sprintf(_BLOGCREATED_SIMPLEDESC2, htmlspecialchars($bshortname)) ?></p>
 <pre><code>&lt;?php
 
 $CONF['Self'] = '<b><?php echo htmlspecialchars($bshortname)?>.php</b>';
@@ -4003,7 +4011,7 @@
 				$this->_templateEditRow($template, $pfdesc, $pffield, '',++$tab,0);
 			}
 		}
-?>			
+?>
 		</tr><tr>
 			<th colspan="2"><?php echo _TEMPLATE_UPDATE?></th>
 		</tr><tr>
@@ -4025,6 +4033,7 @@
 	 */
 	function _templateEditRow(&$template, $description, $name, $help = '', $tabindex = 0, $big = 0) {
 		static $count = 1;
+		if (!isset($template[$name])) $template[$name] = '';
 	?>
 		</tr><tr>
 			<td><?php echo $description?> <?php if ($help) help('template'.$help); ?></td>
@@ -4911,14 +4920,14 @@
 					   <td><?php
 
 						$this->input_yesno('DebugVars',$CONF['DebugVars'],10078);
-						
+
 							 ?>
 
 					   </td>
 		</tr><tr>
 			<td><?php echo _SETTINGS_DEFAULTLISTSIZE?> <?php help('defaultlistsize');?></td>
 			<td>
-			<?php 
+			<?php
 				if (!array_key_exists('DefaultListSize',$CONF)) {
 					sql_query("INSERT INTO ".sql_table('config')." VALUES ('DefaultListSize', '10')");
 					$CONF['DefaultListSize'] = 10;
@@ -5102,10 +5111,10 @@
 		exit;
 
 	}
-	
+
 	/**
 	 *  Give an overview over the used system
-	 */	
+	 */
 	function action_systemoverview() {
 		global $member, $nucleus, $CONF;
 
@@ -5144,7 +5153,7 @@
 			$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";
+			echo "\t\t" . '<td>register_globals' . "</td>\n";
 			$rg = ini_get('register_globals') ? 'On' : 'Off';
 			echo "\t\t" . '<td>' . $rg . "</td>\n";
 			echo "\t</tr>";
@@ -5179,14 +5188,14 @@
 			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') != '') ? 
+			$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 
+			// Information about the used Nucleus CMS
 			echo '<h3>' . _ADMIN_SYSTEMOVERVIEW_NUCLEUSSYSTEM . "</h3>\n";
 			global $nucleus;
 			$nv = getNucleusVersion() / 100 . '(' . $nucleus['version'] . ')';
@@ -5211,6 +5220,9 @@
 			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[' . "'ItemURL']</td>\n";
+			echo "\t\t" . '<td>' . $CONF['ItemURL'] . "</td>\n";
+			echo "\t</tr><tr>\n";
 			echo "\t\t" . '<td width="50%">' . '$CONF[' . "'alertOnHeadersSent']</td>\n";
 			$ohs = $CONF['alertOnHeadersSent'] ?
 						_ADMIN_SYSTEMOVERVIEW_ENABLE :
@@ -5236,7 +5248,7 @@
 		else {
 			echo _ADMIN_SYSTEMOVERVIEW_NOT_ADMIN;
 		}
-		
+
 		$this->pagefoot();
 	}
 
@@ -5335,10 +5347,12 @@
 
 			$codenamestring = ($nucleus['codename']!='')? ' &quot;'.$nucleus['codename'].'&quot;':'';
 
-			if ($member->isLoggedIn() && $member->isAdmin())
-				echo '<a href="http://nucleuscms.org/version.php?v=',getNucleusVersion(),'&amp;pl=',getNucleusPatchLevel(),'" title="Check for upgrade">Nucleus CMS ', $nucleus['version'], $codenamestring, '</a>';
-			else
-				echo 'Nucleus CMS ', $nucleus['version'], $codenamestring;
+			if ($member->isLoggedIn() && $member->isAdmin()) {
+				$checkURL = sprintf(_ADMIN_SYSTEMOVERVIEW_VERSIONCHECK_URL, getNucleusVersion(), getNucleusPatchLevel());
+				echo '<a href="' . $checkURL . '" title="' . _ADMIN_SYSTEMOVERVIEW_VERSIONCHECK_TITLE . '">Nucleus CMS ' . $nucleus['version'] . $codenamestring . '</a>';
+			} else {
+				echo 'Nucleus CMS ' . $nucleus['version'] . $codenamestring;
+			}
 			echo ')';
 		echo '</div>';
 	}
@@ -6538,7 +6552,7 @@
 				echo '<tr><th colspan="2">Options for ', htmlspecialchars($aOption['pfile']),'</th></tr>';
 			}
 
-			$meta = NucleusPlugin::getOptionMeta($current['typeinfo']);
+			$meta = NucleusPlugin::getOptionMeta($aOption['typeinfo']);
 			if (@$meta['access'] != 'hidden') {
 				echo '<tr>';
 				listplug_plugOptionRow($aOption);
diff -x .svn -aruN 3.40.src/nucleus/libs/BLOG.php 3.41.src/nucleus/libs/BLOG.php
--- 3.40.src/nucleus/libs/BLOG.php	2009-04-15 12:46:28.000000000 -0500
+++ 3.41.src/nucleus/libs/BLOG.php	2009-03-15 22:31:35.000000000 -0500
@@ -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 1322 2009-02-12 23:30:26Z kaigreve $
+ * @version $Id: BLOG.php 1353 2009-03-14 13:12:55Z kaigreve $
  */
 
 if ( !function_exists('requestVar') ) exit;
@@ -552,8 +552,13 @@
 	function showArchiveList($template, $mode = 'month', $limit = 0) {
 		global $CONF, $catid, $manager;
 
-		if ($catid)
+		if (!isset ($linkparams)) {
+			$linkparams = array();
+		}
+		
+		if ($catid) {
 			$linkparams = array('catid' => $catid);
+		}
 
 		$template =& $manager->getTemplate($template);
 		$data['blogid'] = $this->getID();
@@ -593,7 +598,7 @@
 			$data['month'] = date('m',$current->itime);
 			$data['year'] = date('Y',$current->itime);
 			$data['archivelink'] = createArchiveLink($this->getID(),$archivedate,$linkparams);
-			
+
 			$manager->notify(
 				'PreArchiveListItem',
 				array(
@@ -670,7 +675,7 @@
 					'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);
@@ -686,15 +691,15 @@
 								'self' => $CONF['Self']
 							));
 	}
-	
+
 	/**
 	  * 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	    
+	  * in ascending or descending order
 	  */
 	function showBlogList($template, $bnametype, $orderby, $direction) {
 		global $CONF, $manager;
-		
+
 		switch ($orderby) {
 			case 'number': $orderby='bnumber'; break;
 			case 'name': $orderby='bname'; break;
@@ -702,56 +707,56 @@
 			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),
 							array(
 								'sitename' => $CONF['SiteName'],
 								'siteurl' => $CONF['IndexURL']
 							));
-		
+
 		$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)) {
-		
+
 			$list = array();
-		
+
 //			$list['bloglink'] = createLink('blog', array('blogid' => $data['bnumber']));
 			$list['bloglink'] = createBlogidLink($data['bnumber']);
-		
+
 			$list['blogdesc'] = $data['bdesc'];
-			
+
 			$list['blogurl'] = $data['burl'];
-			
+
 			if ($bnametype=='shortname') {
 				$list['blogname'] = $data['bshortname'];
 			}
 			else { // all other cases
 				$list['blogname'] = $data['bname'];
 			}
-			
+
 			$manager->notify(
 				'PreBlogListItem',
 				array(
 					'listitem' => &$list
 				)
 			);
-			
+
 			echo TEMPLATE::fill((isset($template['BLOGLIST_LISTITEM']) ? $template['BLOGLIST_LISTITEM'] : null), $list);
-			
+
 		}
-		
+
 		mysql_free_result($res);
-		
+
 		echo TEMPLATE::fill((isset($template['BLOGLIST_FOOTER']) ? $template['BLOGLIST_FOOTER'] : null),
 							array(
 								'sitename' => $CONF['SiteName'],
@@ -1083,7 +1088,7 @@
 
 		$logMsg = sprintf(_TEAM_ADD_NEWTEAMMEMBER, $tmem->getDisplayName(), $memberid, $this->getName());
 		ACTIONLOG::add(INFO, $logMsg);
-		
+
 		return 1;
 	}
 
@@ -1139,8 +1144,8 @@
 				// clear all expired future posts
 				sql_query("UPDATE " . sql_table('item') . " SET iposted='1' WHERE iblog=" . $blogid . " AND itime<NOW()");
 
-				// check to see any pending future post, clear the flag is none 
-				$result = sql_query("SELECT * FROM " . sql_table('item') 
+				// check to see any pending future post, clear the flag is none
+				$result = sql_query("SELECT * FROM " . sql_table('item')
 				          . " WHERE iposted=0 AND iblog=" . $blogid);
 				if (mysql_num_rows($result) == 0) {
 					$this->clearFuturePost();
@@ -1148,14 +1153,14 @@
 			}
 		}
 	}
-	
+
 	/**
 	 * 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_ (!)	 
+	 *		String representing the template _NAME_ (!)
 	 * @param $highlight
 	 *		contains a query that should be highlighted
 	 * @param $comments
@@ -1171,7 +1176,7 @@
 
 		return $this->showUsingQuery($template, $query, $highlight, $comments, $dateheads);
 	}
-	
+
 	/**
 	 * Returns the SQL query used to fill out templates for a list of items
 	 *
@@ -1195,7 +1200,7 @@
 		$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'
@@ -1210,7 +1215,7 @@
 			$i--;
 			if ($i) $query .= ' UNION ';
 		}
-		
+
 		return $query;
 	}
 
diff -x .svn -aruN 3.40.src/nucleus/libs/globalfunctions.php 3.41.src/nucleus/libs/globalfunctions.php
--- 3.40.src/nucleus/libs/globalfunctions.php	2009-04-15 12:46:28.000000000 -0500
+++ 3.41.src/nucleus/libs/globalfunctions.php	2009-03-15 22:31:33.000000000 -0500
@@ -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 1326 2009-02-14 18:21:46Z kaigreve $
+ * @version $Id: globalfunctions.php 1355 2009-03-15 21:14:41Z kaigreve $
 
  */
 
 // needed if we include globalfunctions from install.php
 global $nucleus, $CONF, $DIR_LIBS, $DIR_LANG, $manager, $member;
 
-$nucleus['version'] = 'v3.40';
+$nucleus['version'] = 'v3.41';
 $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'));
@@ -47,14 +47,9 @@
 		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'];
+/*$CONF['ItemURL'] = $CONF['Self'];
 $CONF['ArchiveURL'] = $CONF['Self'];
 $CONF['ArchiveListURL'] = $CONF['Self'];
 $CONF['MemberURL'] = $CONF['Self'];
@@ -66,7 +61,7 @@
 // this avoids urls like index.php/item/13/index.php/item/15
 if (!isset($CONF['URLMode']) || (($CONF['URLMode'] == 'pathinfo') && (substr($CONF['Self'], strlen($CONF['Self']) - 4) == '.php'))) {
 	$CONF['URLMode'] = 'normal';
-}
+}*/
 
 if (getNucleusPatchLevel() > 0) {
 	$nucleus['version'] .= '/' . getNucleusPatchLevel();
@@ -170,13 +165,27 @@
 		$CONF['Self'] = substr($CONF['Self'], 0, strlen($CONF['Self']) -1);
 	}
 
-	$CONF['ItemURL'] = $CONF['Self'];
+/*	$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'];
+	$CONF['CategoryURL'] = $CONF['Self']; */
+}
+
+$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'];
+
+// switch URLMode back to normal when $CONF['Self'] ends in .php
+// this avoids urls like index.php/item/13/index.php/item/15
+if (!isset($CONF['URLMode']) || (($CONF['URLMode'] == 'pathinfo') && (substr($CONF['Self'], strlen($CONF['Self']) - 4) == '.php'))) {
+	$CONF['URLMode'] = 'normal';
 }
 
 // automatically use simpler toolbar for mozilla
@@ -481,7 +490,7 @@
   * returns the currently used version (100 = 1.00, 101 = 1.01, etc...)
   */
 function getNucleusVersion() {
-	return 340;
+	return 341;
 }
 
 /**
@@ -833,30 +842,30 @@
 
 		// get next and prev month links ...
 		global $archivenext, $archiveprev, $archivetype, $archivenextexists, $archiveprevexists;
-		
+
 		// sql queries for the timestamp of the first and the last published item
 		$query = "SELECT UNIX_TIMESTAMP(itime) as result FROM ".sql_table('item')." WHERE idraft=0 ORDER BY itime ASC";
-		$first_timestamp=quickQuery ($query); 
+		$first_timestamp=quickQuery ($query);
 		$query = "SELECT UNIX_TIMESTAMP(itime) as result FROM ".sql_table('item')." WHERE idraft=0 ORDER BY itime DESC";
-		$last_timestamp=quickQuery ($query); 
+		$last_timestamp=quickQuery ($query);
 
 		sscanf($archive, '%d-%d-%d', $y, $m, $d);
 
 		if ($d != 0) {
 			$archivetype = _ARCHIVETYPE_DAY;
 			$t = mktime(0, 0, 0, $m, $d, $y);
-			// one day has 24 * 60 * 60 = 86400 seconds			
+			// one day has 24 * 60 * 60 = 86400 seconds
 			$archiveprev = strftime('%Y-%m-%d', $t - 86400 );
-			// check for published items			
+			// check for published items
 			if ($t > $first_timestamp) {
 				$archiveprevexists = true;
 			}
 			else {
 				$archiveprevexists = false;
 			}
-			
+
 			// one day later
-			$t += 86400; 
+			$t += 86400;
 			$archivenext = strftime('%Y-%m-%d', $t);
 			if ($t < $last_timestamp) {
 				$archivenextexists = true;
@@ -864,7 +873,7 @@
 			else {
 				$archivenextexists = false;
 			}
-			
+
 		} else {
 			$archivetype = _ARCHIVETYPE_MONTH;
 			$t = mktime(0, 0, 0, $m, 1, $y);
@@ -876,8 +885,8 @@
 			else {
 				$archiveprevexists = false;
 			}
-			
-			// timestamp for the next month			
+
+			// timestamp for the next month
 			$t = mktime(0, 0, 0, $m+1, 1, $y);
 			$archivenext = strftime('%Y-%m', $t);
 			if ($t < $last_timestamp) {
@@ -1162,11 +1171,13 @@
 }
 
 function helpHtml($id) {
-	return helplink($id) . '<img src="documentation/icon-help.gif" width="15" height="15" alt="' . _HELP_TT . '" /></a>';
+	global $CONF;
+	return helplink($id) . '<img src="' . $CONF['AdminURL'] . 'documentation/icon-help.gif" width="15" height="15" alt="' . _HELP_TT . '" title="' . _HELP_TT . '" /></a>';
 }
 
 function helplink($id) {
-	return '<a href="documentation/help.html#'. $id . '" onclick="if (event &amp;&amp; event.preventDefault) event.preventDefault(); return help(this.href);">';
+	global $CONF;
+	return '<a href="' . $CONF['AdminURL'] . 'documentation/help.html#'. $id . '" onclick="if (event &amp;&amp; event.preventDefault) event.preventDefault(); return help(this.href);">';
 }
 
 function getMailFooter() {
@@ -1518,67 +1529,67 @@
 }
 
 
-/** 
+/**
  * Sanitize parameters such as $_GET and $_SERVER['REQUEST_URI'] etc.
- * to avoid XSS 
+ * to avoid XSS
  */
 function sanitizeParams()
 {
 	global $HTTP_SERVER_VARS;
-	
+
 	$array = array();
 	$str = '';
 	$frontParam = '';
-	
+
 	// REQUEST_URI of $HTTP_SERVER_VARS
 	$str =& $HTTP_SERVER_VARS["REQUEST_URI"];
 	serverStringToArray($str, $array, $frontParam);
 	sanitizeArray($array);
 	arrayToServerString($array, $frontParam, $str);
-	
+
 	// QUERY_STRING of $HTTP_SERVER_VARS
 	$str =& $HTTP_SERVER_VARS["QUERY_STRING"];
 	serverStringToArray($str, $array, $frontParam);
 	sanitizeArray($array);
 	arrayToServerString($array, $frontParam, $str);
-	
+
 	if (phpversion() >= '4.1.0') {
 		// REQUEST_URI of $_SERVER
 		$str =& $_SERVER["REQUEST_URI"];
 		serverStringToArray($str, $array, $frontParam);
 		sanitizeArray($array);
 		arrayToServerString($array, $frontParam, $str);
-	
+
 		// QUERY_STRING of $_SERVER
 		$str =& $_SERVER["QUERY_STRING"];
 		serverStringToArray($str, $array, $frontParam);
 		sanitizeArray($array);
 		arrayToServerString($array, $frontParam, $str);
 	}
-	
+
 	// $_GET
 	convArrayForSanitizing($_GET, $array);
 	sanitizeArray($array);
 	revertArrayForSanitizing($array, $_GET);
-	
+
 	// $_REQUEST (only GET param)
 	convArrayForSanitizing($_REQUEST, $array);
 	sanitizeArray($array);
 	revertArrayForSanitizing($array, $_REQUEST);
 }
 
-/** 
+/**
  * Check ticket when not checked in plugin's admin page
  * to avoid CSRF.
  * Also avoid the access to plugin/index.php by guest user.
  */
 function ticketForPlugin(){
 	global $CONF,$DIR_PLUGINS,$member,$ticketforplugin;
-	
+
 	/* initialize */
 	$ticketforplugin=array();
 	$ticketforplugin['ticket']=false;
-	
+
 	/* Check if using plugin's php file. */
 	if ($p_translated=serverVar('PATH_TRANSLATED')) {
 		if (!file_exists($p_translated)) $p_translated='';
@@ -1593,13 +1604,13 @@
 	$p_translated=str_replace('\\','/',$p_translated);
 	$d_plugins=str_replace('\\','/',$DIR_PLUGINS);
 	if (strpos($p_translated,$d_plugins)!==0) return;// This isn't plugin php file.
-	
+
 	/* Solve the plugin php file or admin directory */
 	$phppath=substr($p_translated,strlen($d_plugins));
 	$phppath=preg_replace('!^/!','',$phppath);// Remove the first "/" if exists.
 	$path=preg_replace('/^NP_(.*)\.php$/','$1',$phppath); // Remove the first "NP_" and the last ".php" if exists.
 	$path=preg_replace('!^([^/]*)/(.*)$!','$1',$path); // Remove the "/" and beyond.
-	
+
 	/* Solve the plugin name. */
 	$plugins=array();
 	$query='SELECT pfile FROM '.sql_table('plugin');
@@ -1615,16 +1626,16 @@
 		header("HTTP/1.0 404 Not Found");
 		exit('');
 	}
-	
+
 	/* Return if not index.php */
 	if ( $phppath!=strtolower($plugin_name).'/'
 		&& $phppath!=strtolower($plugin_name).'/index.php' ) return;
-	
+
 	/* Exit if not logged in. */
 	if ( !$member->isLoggedIn() ) exit("You aren't logged in.");
-	
+
 	global $manager,$DIR_LIBS,$DIR_LANG,$HTTP_GET_VARS,$HTTP_POST_VARS;
-	
+
 	/* Check if this feature is needed (ie, if "$manager->checkTicket()" is not included in the script). */
 	if (!($p_translated=serverVar('PATH_TRANSLATED'))) $p_translated=serverVar('SCRIPT_FILENAME');
 	if ($file=@file($p_translated)) {
@@ -1634,7 +1645,7 @@
 			$prevline=$line;
 		}
 	}
-	
+
 	/* Show a form if not valid ticket */
 	if ( ( strstr(serverVar('REQUEST_URI'),'?') || serverVar('QUERY_STRING')
 			|| strtoupper(serverVar('REQUEST_METHOD'))=='POST' )
@@ -1654,7 +1665,7 @@
 		$oPluginAdmin = new PluginAdmin($plugin_name);
 		$oPluginAdmin->start();
 		echo '<p>' . _ERROR_BADTICKET . "</p>\n";
-		
+
 		/* Show the form to confirm action */
 		// PHP 4.0.x support
 		$get=  (isset($_GET))  ? $_GET  : $HTTP_GET_VARS;
@@ -1685,11 +1696,11 @@
 		echo '<input type="submit" value="'._YES.'" />&nbsp;&nbsp;&nbsp;&nbsp;';
 		echo '<input type="button" value="'._NO.'" onclick="history.back(); return false;" />';
 		echo "</form>\n";
-		
+
 		$oPluginAdmin->end();
 		exit;
 	}
-	
+
 	/* Create new ticket */
 	$ticket=$manager->addTicketToUrl('');
 	$ticketforplugin['ticket']=substr($ticket,strpos($ticket,'ticket=')+7);
@@ -1707,7 +1718,7 @@
 	}
 }
 
-/** 
+/**
  * Convert the server string such as $_SERVER['REQUEST_URI']
  * to arry like arry['blogid']=1 and array['page']=2 etc.
  */
@@ -1725,7 +1736,7 @@
 		$args = $str;
 		$frontParam = "";
 	}
-	
+
 	// If there is no args like blogid=1&page=2, return
 	if (!strstr($str, "=") && !strlen($frontParam)) {
 		$frontParam = $str;
@@ -1735,7 +1746,7 @@
 	$array = explode("&", $args);
 }
 
-/** 
+/**
  * Convert array like array['blogid'] to server string
  * such as $_SERVER['REQUEST_URI']
  */
@@ -1751,14 +1762,14 @@
 	}
 }
 
-/** 
+/**
  * Sanitize array parameters.
  * This function checks both key and value.
  * - check key if it inclues " (double quote),  remove from array
  * - check value if it includes \ (escape sequece), remove remaining string
  */
 function sanitizeArray(&$array)
-{	
+{
 	$excludeListForSanitization = array('query');
 //	$excludeListForSanitization = array();
 
@@ -1776,22 +1787,24 @@
 			$val = stripslashes($val);
 		}
 		$val = addslashes($val);
-		
+
 		// if $key is included in exclude list, skip this param
 		if (!in_array($key, $excludeListForSanitization)) {
-				
+
 			// check value
-			list($val, $tmp) = explode('\\', $val);
+			if (strpos($val, '\\')) {
+				list($val, $tmp) = explode('\\', $val);
+			}
 			
 			// remove control code etc.
 			$val = strtr($val, "\0\r\n<>'\"", "       ");
-				
+
 			// check key
 			if (preg_match('/\"/i', $key)) {
 				unset($array[$k]);
 				continue;
 			}
-				
+
 			// set sanitized info
 			$array[$k] = sprintf("%s=%s", $key, $val);
 		}
diff -x .svn -aruN 3.40.src/nucleus/libs/ITEMACTIONS.php 3.41.src/nucleus/libs/ITEMACTIONS.php
--- 3.40.src/nucleus/libs/ITEMACTIONS.php	2009-04-15 12:46:28.000000000 -0500
+++ 3.41.src/nucleus/libs/ITEMACTIONS.php	2009-03-15 22:31:33.000000000 -0500
@@ -14,7 +14,7 @@
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: ITEMACTIONS.php 1277 2008-10-22 08:43:59Z shizuki $
+ * @version $Id: ITEMACTIONS.php 1338 2009-02-28 15:09:19Z shizuki $
  */
 class ITEMACTIONS extends BaseActions {
 
@@ -57,7 +57,7 @@
 
 	/**
 	  * Returns an array with the actions that are defined
-	  * in the ITEMACTIONS class 
+	  * in the ITEMACTIONS class
 	  */
 	function getDefinedActions() {
 		return array(
@@ -114,23 +114,23 @@
 	function setLastVisit($lastVisit) {
 		$this->lastVisit = $lastVisit;
 	}
-	
+
 	function setParser(&$parser) {
 		$this->parser =& $parser;
 	}
-	
+
 	function setCurrentItem(&$item) {
 		$this->currentItem =& $item;
 	}
-	
+
 	function setBlog(&$blog) {
 		$this->blog =& $blog;
 	}
-	
+
 	function setTemplate($template) {
 		$this->template =& $template;
 	}
-	
+
 	function setShowComments($val) {
 		$this->showComments = $val;
 	}
@@ -144,21 +144,21 @@
 	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
 	 */
@@ -168,32 +168,32 @@
 
 	/**
 	 * 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
 	 */
@@ -207,14 +207,14 @@
 			)
 		);
 	}
-	
+
 	/**
 	 * Parse templatevar query
 	 */
 	function parse_query() {
 		echo $this->strHighlight;
 	}
-	
+
 	/**
 	 * Parse templatevar itemlink
 	 */
@@ -229,21 +229,21 @@
 			)
 		);
 	}
-	
+
 	/**
 	 * Parse templatevar blogurl
 	 */
 	function parse_blogurl() {
 		echo $this->blog->getURL();
 	}
-	
+
 	/**
 	 * Parse templatevar closed
 	 */
 	function parse_closed() {
 		echo $this->currentItem->closed;
 	}
-	
+
 	/**
 	 * Parse templatevar relevance
 	 */
@@ -253,8 +253,8 @@
 
 	/**
 	 * Parse templatevar title
-	 * 
-	 * @param string $format defines in which format the title is shown	 	 
+	 *
+	 * @param string $format defines in which format the title is shown
 	 */
 	function parse_title($format = '') {
 		if (is_array($this->currentItem)) {
@@ -362,19 +362,21 @@
 
 	/**
 	 * Parse templatevar date
-	 * 
-	 * @param format optional strftime format	 	 
+	 *
+	 * @param format optional strftime format
 	 */
 	function parse_date($format = '') {
+		if (!isset($this->template['FORMAT_DATE'])) $this->template['FORMAT_DATE'] = '';
 		echo formatDate($format, $this->currentItem->timestamp, $this->template['FORMAT_DATE'], $this->blog);
 	}
 
 	/**
 	  * Parse templatevar time
-	  * 	  
+	  *
 	  * @param format optional strftime format
 	  */
 	function parse_time($format = '') {
+		if (!isset($this->template['FORMAT_TIME'])) $this->template['FORMAT_TIME'] = '';
 		echo strftime($format ? $format : $this->template['FORMAT_TIME'],$this->currentItem->timestamp);
 	}
 
@@ -539,7 +541,7 @@
 	*/
 
 }
-	
+
 
 
 ?>
diff -x .svn -aruN 3.40.src/nucleus/libs/MEMBER.php 3.41.src/nucleus/libs/MEMBER.php
--- 3.40.src/nucleus/libs/MEMBER.php	2009-04-15 12:46:28.000000000 -0500
+++ 3.41.src/nucleus/libs/MEMBER.php	2009-03-15 22:31:33.000000000 -0500
@@ -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 1299 2009-01-16 23:13:31Z kaigreve $
+ * @version $Id: MEMBER.php 1347 2009-03-06 14:58:20Z ftruscot $
  */
 class MEMBER {
 
@@ -399,6 +399,28 @@
 
 		return $blogs;
 	}
+	
+	/**
+	  * Returns an array of all blogids for which member has team rights
+	  */
+	function getTeamBlogs($incAdmin = 1) {
+		$incAdmin = intval($incAdmin);
+		$blogs = array();
+
+		if ($this->isAdmin() && $incAdmin)
+			$query = 'SELECT bnumber as blogid from '.sql_table('blog');
+		else
+			$query = 'SELECT tblog as blogid from '.sql_table('team').' where tmember=' . $this->getID();
+
+		$res = sql_query($query);
+		if (mysql_num_rows($res) > 0) {
+			while ($obj = mysql_fetch_object($res)) {
+				array_push($blogs, $obj->blogid);
+			}
+		}
+
+		return $blogs;
+	}
 
 	/**
 	  * Returns an email address from which notification of commenting/karma voting can
@@ -431,7 +453,7 @@
 			   . "     mnotes='" . addslashes($this->getNotes()) . "',"
 			   . "     mcanlogin=" . $this->canLogin() . ","
 			   . "	   deflang='" . addslashes($this->getLanguage()) . "',"
-			   . "	   mautosave=" . addslashes($this->getAutosave()) . ""			   
+			   . "	   mautosave=" . intval($this->getAutosave()) . ""			   
 			   . " WHERE mnumber=" . $this->getID();
 		sql_query($query);
 	}
diff -x .svn -aruN 3.40.src/nucleus/libs/PAGEFACTORY.php 3.41.src/nucleus/libs/PAGEFACTORY.php
--- 3.40.src/nucleus/libs/PAGEFACTORY.php	2009-04-15 12:46:28.000000000 -0500
+++ 3.41.src/nucleus/libs/PAGEFACTORY.php	2009-03-15 22:31:33.000000000 -0500
@@ -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 1300 2009-01-17 16:49:43Z kaigreve $
+ * @version $Id: PAGEFACTORY.php 1339 2009-02-28 15:20:08Z shizuki $
  */
 
 /**
@@ -210,7 +210,7 @@
 	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);
@@ -237,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;
@@ -266,10 +266,12 @@
 	}
 
 	function parse_contents($which) {
+		if (!isset($this->variables[$which])) $this->variables[$which] = '';
 		echo htmlspecialchars($this->variables[$which],ENT_QUOTES);
 	}
 
 	function parse_checkedonval($value, $name) {
+		if (!isset($this->variables[$name])) $this->variables[$name] = '';
 		if ($this->variables[$name] == $value)
 			echo "checked='checked'";
 	}
diff -x .svn -aruN 3.40.src/nucleus/libs/showlist.php 3.41.src/nucleus/libs/showlist.php
--- 3.40.src/nucleus/libs/showlist.php	2009-04-15 12:46:28.000000000 -0500
+++ 3.41.src/nucleus/libs/showlist.php	2009-03-15 22:31:33.000000000 -0500
@@ -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 1323 2009-02-13 00:56:29Z shizuki $
+ * @version $Id: showlist.php 1348 2009-03-12 15:14:45Z ftruscot $
  */
 
 
@@ -204,7 +204,7 @@
 				$res = sql_query('SELECT pfile FROM ' . sql_table('plugin'));
 				while($o = mysql_fetch_object($res)) {
 					$preq =& $manager->getPlugin($o->pfile);
-					if ($plug) {
+					if ($preq) {
 						$depList = $preq->getPluginDep();
 						foreach ($depList as $depName) {
 							if ($current->pfile == $depName) {
diff -x .svn -aruN 3.40.src/nucleus/libs/TEMPLATE.php 3.41.src/nucleus/libs/TEMPLATE.php
--- 3.40.src/nucleus/libs/TEMPLATE.php	2009-04-15 12:46:28.000000000 -0500
+++ 3.41.src/nucleus/libs/TEMPLATE.php	2009-03-15 22:31:33.000000000 -0500
@@ -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 1269 2008-09-17 21:52:23Z ftruscot $
+ * @version $Id: TEMPLATE.php 1338 2009-02-28 15:09:19Z shizuki $
  */
 class TEMPLATE {
 
@@ -125,7 +125,7 @@
 				'template' => &$name
 			)
 		);
-			
+
 		$query = 'SELECT tpartname, tcontent'
 			   . ' FROM '.sql_table('template_desc').', '.sql_table('template')
 			   . ' WHERE tdesc=tdnumber and tdname="' . addslashes($name) . '"';
@@ -134,7 +134,7 @@
 			$template[$obj->tpartname] = $obj->tcontent;
 
 		// set locale according to template:
-		if ($template['LOCALE'])
+		if (isset($template['LOCALE']))
 			setlocale(LC_TIME,$template['LOCALE']);
 		else
 			setlocale(LC_TIME,'');
