diff -x .svn -aruN 0.7.19.src/e107_admin/core_image.php 0.7.20.src/e107_admin/core_image.php
--- 0.7.19.src/e107_admin/core_image.php	2010-02-22 14:58:44.000000000 -0600
+++ 0.7.20.src/e107_admin/core_image.php	2010-04-15 21:46:29.000000000 -0500
@@ -10,8 +10,8 @@
 |     Released under the terms and conditions of the
 |     GNU General Public License (http://gnu.org).
 |
-|     $URL: https://e107.svn.sourceforge.net/svnroot/e107/tags/e107_v07_19_release/e107_admin/core_image.php $
-|     $Id: core_image.php 11362 2010-02-22 20:59:08Z mcfly_e107 $
+|     $URL: https://e107.svn.sourceforge.net/svnroot/e107/tags/e107_v07_20_release/e107_admin/core_image.php $
+|     $Id: core_image.php 11481 2010-04-16 02:46:53Z mcfly_e107 $
 +----------------------------------------------------------------------------+
 */
 
@@ -60,7 +60,7 @@
     'comment.php' => 'e19cef505e9e34b173347776822fc938',
     'compact.php' => '7d2fb15144e156001a5ba509c8e9460c',
     'content.php' => '11c0b2775685a764568e56309b9f6640',
-    'core_image.php' => '957aee6470c33b157d97de60f9b70904',
+    'core_image.php' => 'b87d3dd14870aa4587eabf09b3a13a3c',
     'cpage.php' => '42db23338a2c22c6b36dba22c4a2d8c4',
     'credits.php' => '517a7fa63891e1ddf081022124b55484',
     'db.php' => '04bfff9ac83efefc421fbfc2f9e47a2f',
@@ -69,7 +69,7 @@
     'download.php' => 'f9965e27a84e40558531275f8035cbaf',
     'e107_update.php' => 'c205921e0a76ef06ada605695ff375a2',
     'emoticon.php' => 'dcc20e1ad560497c1acceeb171326f1e',
-    'fileinspector.php' => 'b1be17f080e51ed331e62c64b5bb58af',
+    'fileinspector.php' => '6d553f064fca7b6ce6020b708dd85bcc',
     'filemanager.php' => '03dfdc82d9c028a4a8f5c5eb36c05ff0',
     'filetypes_.php' => 'f951037335e993337792606cc1475cec',
     'fla.php' => 'd395ebdb71b93c5fb91b5f0010a0583c',
@@ -90,7 +90,7 @@
     'notify.php' => '4a1bd8344d67380b856154adba33c5c1',
     'phpinfo.php' => '4df5e29409b5a5b09dbca5ad581fda7b',
     'plugin.php' => '8e41c495bb1f2e9c5a8d3e48f0665776',
-    'prefs.php' => '0e5fdcd0495608630340457fcd3bcf4d',
+    'prefs.php' => '62ce30c4e8bd73fc3fa3a951c7ea5493',
     'review.php' => '5162c3c4b56fd4f969fc75f995a8c345',
     'search.php' => '1f6c001e78f4a2cb2763f9f467d94f14',
     'theme.php' => '48ed356f966bd680dc141292e1909da9',
@@ -104,7 +104,7 @@
     'users.php' => '68beb8ff7b13da66a5045935adbe1b92',
     'users_extended.php' => 'fd1606e621f53b5344024bdf697573f8',
     'users_extended_predefined.php' => 'dfcd9bfa4780211dd5973e01d49831b0',
-    'ver.php' => '00cc40ab727c933269e02d4300a00dc6',
+    'ver.php' => 'da2343d402e7e6b9ad70d83efa647c8c',
     'wmessage.php' => '351f74bf0a1a756f00b3ae5e2b84acae',
   ),
   $coredir['docs'] => 
@@ -130,7 +130,7 @@
         'Maintainance' => 'f248eeafde7e99293b77d662304bfb52',
         'Menus' => '7344815f36b8aa616047ec8152ad54fa',
         'News' => '6eadf4f45748cad4f37e67fea04e05db',
-        'Preferences' => '9b3d173843f5ac04b8cac472a8e213f2',
+        'Preferences' => '8b45117a057f4c3f657ec499b3baa950',
         'Uploads' => '1a979ee608d8dd812dd2752ba8d9f48a',
         'Users' => 'd62e15078e8d9d7ab8da7ec654cdef43',
         'Welcome_Message' => 'd3a3a4dfd02ec7258dd91364be7d6aa8',
@@ -235,7 +235,7 @@
         'bbcode_shortcodes.php' => '46af3ed7c2b0f5fc135ada558603ac7e',
         'comment_shortcodes.php' => 'd0a1cca3bb01a4b1056131ff532ce96d',
         'contact_shortcodes.php' => 'dc84266c922c02f8855bbadb95bcf45e',
-        'download_shortcodes.php' => '06b762072b6f46c0f1fd511a30a3ac05',
+        'download_shortcodes.php' => '72adc4bb3862266f3fbbfbe59070021f',
         'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
         'news_archives.php' => 'b7513e4539e166bd371833f77b2c2434',
         'news_shortcodes.php' => '267e26bb1dd9a759d45d9f87a3835b6d',
@@ -729,7 +729,7 @@
       'tiny_mce_gzip.php' => 'def6c78847a3a181cfed52b93d8d5f06',
       'tiny_mce_popup.js' => '8ccd8e1ecd2700cb83ee770337b3b542',
       'tiny_mce_src.js' => '3e0019162c45c999336c2fa811e4f522',
-      'wysiwyg.php' => 'e8464711dc32cc8159288a62892eec1e',
+      'wysiwyg.php' => '8f3cd9616eb6d35c5f2371dd4e155e4d',
     ),
     'admin_handler.php' => '2d593943e40bf02d5d46cf6b6af6b7e7',
     'admin_log_class.php' => 'df5b496de9c56a9563bb49f865baa38e',
@@ -749,7 +749,7 @@
     'emote_filter.php' => '111b2ea89469b71aaebb5c479f947c27',
     'encrypt_handler.php' => '50d57fd8b478a0dd466620659c678fd3',
     'event_class.php' => 'b836b1ca68cc583c4884d5bad9559091',
-    'file_class.php' => 'b29974ee6517ebcab65a13e82de3d3c9',
+    'file_class.php' => 'e0e41c10710af9a35dc01d6596b45c9a',
     'form_handler.php' => 'c469a6006195b1c9a4f6e67b6955b76f',
     'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
     'language_class.php' => 'e091be509d8cb776e7312c000a29cdf0',
@@ -790,7 +790,7 @@
     'theme_handler.php' => '1fe3a701a0d5ec518e4dc3da43f28c36',
     'traffic_class.php' => 'bcbd2aec962fad5c9cc7f8e62633139c',
     'traffic_class_display.php' => '90ee3f8a726661cabc025d2d05a84858',
-    'upload_handler.php' => 'ab3a9b12a236c8e8289f03fccba30b33',
+    'upload_handler.php' => '719e8be9c411108e155b12eace32c30f',
     'user_extended_class.php' => '62a4329dc5bbea162e3149e6a944f47e',
     'user_func.php' => '0c3240d996023127051008878f91ece7',
     'user_select_class.php' => '25dece13f184f003e10cd2ef79aa0a25',
@@ -1292,7 +1292,7 @@
           'users_extended.php' => '5c052a374fbd18b4346486b8335eb1f6',
           'wmessage.php' => 'f567067e08538f26c9efe9f770e0a055',
         ),
-        'lan_admin.php' => 'b0cc9a5a365e5576c4adcc2234496476',
+        'lan_admin.php' => '2bdeb1acc3e49e95d774d866608f8c51',
         'lan_admin_log.php' => 'f08c7b17c6fc8078020affd72aa954f1',
         'lan_administrator.php' => '991b91136d8b3b6a03c7135d06d354a3',
         'lan_banlist.php' => 'd2bdfed7daa93dda96014dc79534edb6',
@@ -1351,7 +1351,7 @@
       'lan_login.php' => '809182c05d7f00262c689e2a75003b25',
       'lan_mail_handler.php' => '34e92ba1926cd6b0d25052bb20c4da66',
       'lan_membersonly.php' => '0a053f203c69099945a4f6831f2846f7',
-      'lan_news.php' => '76db73a7e2ea26e3f13b94abe6c31ced',
+      'lan_news.php' => '67d838f38d41c4e7dff7a88aa1aa8983',
       'lan_notify.php' => '0451881149a74d4ae19da258e6f8af2b',
       'lan_np.php' => 'e039d68fc6948a13c0197374f1d60630',
       'lan_online.php' => 'a96e1b8d6573a417bc73adab645ca1f7',
@@ -1486,7 +1486,7 @@
       ),
       'admin_config.php' => '9803e95550853ab0aec63517e86fdcbb',
       'calendar.php' => '39293d69702a8133f1526fb126e32a47',
-      'calendar_menu.php' => '8d0b510796ca017bdbe74f5416c236ac',
+      'calendar_menu.php' => 'df67a8592e5ef98de4e511da8a5d861b',
       'calendar_shortcodes.php' => '14508816696fc376d57ec8a43b1529ff',
       'calendar_sql.php' => '39899457df794d8b56c58d3b1c8db88e',
       'calendar_template.php' => 'd00fdc534145833c4559e08cfa3a1e6a',
@@ -1579,11 +1579,11 @@
     array (
       'handlers' => 
       array (
-        'content_class.php' => 'f623c23f2cb312e31432f2046d8dd9b7',
+        'content_class.php' => '693d362e8882e1d62970b40e4ab7a517',
         'content_convert_class.php' => 'bca013a5032381acd3c753a487a406e0',
-        'content_db_class.php' => '3775ab75db778a5b9a876de4e43f4e03',
+        'content_db_class.php' => '1149ee881ec33ca5f6ecd2554f612c02',
         'content_defines.php' => '17705ead3b96dabdd746a32c8f29935f',
-        'content_form_class.php' => '0616e9c66cf5b297c02df6e38ddb7b7f',
+        'content_form_class.php' => '8770ba4660c6813ed040efcc66dfd5cb',
         'content_preset.php' => 'f3061b1451c85ffa473bf5520d41b49a',
       ),
       'images' => 
@@ -1703,11 +1703,11 @@
       ),
       'admin_content_config.php' => 'bf233d943d27ea429d4f035c69654c82',
       'content.js' => 'd41d8cd98f00b204e9800998ecf8427e',
-      'content.php' => '310681afb0e7ece1f8e163906f052ac9',
-      'content_manager.php' => '0dac3ba5d15f8f146bc8f45c04dc524b',
+      'content.php' => '6fee3ccce9dbdad72bfe851a6ee1b44d',
+      'content_manager.php' => '770aad2333abbee246660a87b56d2e30',
       'content_shortcodes.php' => '6fe643a18d7f1b8a877eed93f82bb165',
       'content_sql.php' => '4f0d506e09421f21708a36e96f80c7db',
-      'content_submit.php' => 'b7d7fc20565009d001e6202da8b265a2',
+      'content_submit.php' => 'c9ae8cac4aa857e31f18bcc270e6b515',
       'content_update.php' => '307ca362312109b3dabe8ba173710a48',
       'content_update_check.php' => '25753c2c070b06f0352f6e5d3a366d9a',
       'e_comment.php' => 'd1f4f87a428c69c499818721d0f48331',
@@ -1715,7 +1715,7 @@
       'e_frontpage.php' => 'fe4139040c268b13517b9a78fa35f190',
       'e_help.php' => '4320e5f811fd90d98d2339b11575d57c',
       'e_latest.php' => 'dad7101dbd2063723e94300723e67c2e',
-      'e_list.php' => 'ab980f0952f90a44c3d27ed1edfcd354',
+      'e_list.php' => '179fdb2049690d93d67b50629c92e5e3',
       'e_meta.php' => '6026564b4dec2a4dbaa5cdaebce4a7f4',
       'e_notify.php' => '477f94be0cc87c30ce9171d6744b1738',
       'e_rss.php' => '76954b881d598f26ecaebb4422f87696',
@@ -1903,7 +1903,7 @@
       'e_frontpage.php' => '47fc49f7f27140d518eb73932b6023c6',
       'e_latest.php' => 'ba485c38b9ab90c0f572a2397b49c9f5',
       'e_linkgen.php' => '9149ffa2aa65de7e21eec81f3b3617ec',
-      'e_list.php' => 'f8e705f9d71c1bcaafb63cfc54b086c5',
+      'e_list.php' => '8c318e2f3a838ca643e1434a199a11f7',
       'e_rss.php' => 'cf96fbd5d8ae9f83f6ca2b98ac069970',
       'e_search.php' => 'f0c6eabebb2359afd8bc4557bbc3dd02',
       'e_status.php' => 'e707e64a960612d443e16906faaf0e22',
@@ -2062,7 +2062,7 @@
       ),
       'admin_list_config.php' => '2402d279dbe973c14e92e639bcdafa82',
       'list.php' => '49440e7676ada4c34b4cf3db2a9c612d',
-      'list_class.php' => '276ec8bd66cb6e766ecbd1b98d641c97',
+      'list_class.php' => '51ddf5aca0dec2cf111dfc31c4d88b7e',
       'list_new_menu.php' => 'd27da980c790204a24044f293acb50d5',
       'list_recent_menu.php' => 'a43717a8366f090d199ad1d58c802591',
       'list_shortcodes.php' => '1c4972d09e83f1945c6652126bba6248',
@@ -2177,7 +2177,7 @@
       'log_update_check.php' => '90239b4b5094816a98717d84beaf552e',
       'loginfo.php' => '8f0ec65ba581c4acb45fcd485360be15',
       'plugin.php' => 'e7258008c2c318735c1722a739497985',
-      'stats.php' => 'e42941b0b7459a7d936f063615b2a858',
+      'stats.php' => '0e31333d0394a98345f7b7f3d550a6a3',
     ),
     'login_menu' => 
     array (
@@ -2487,7 +2487,7 @@
         'English.php' => 'ff16196d68aae90f24695d79a281c4e2',
       ),
       'config.php' => '4dff3b5f74facbcd890384d65ff0d79e',
-      'tree_menu.php' => '9aee221e609ff3a18d8d4162a82522e6',
+      'tree_menu.php' => '3e3ebb3b95188e5c0a5e1a084106a678',
     ),
     'userlanguage_menu' => 
     array (
@@ -3072,7 +3072,7 @@
   'links.php' => 'bed206fc2abe8f1307ef4db3b7fee63e',
   'login.php' => '6466e040063af9242f68a2f897eac7c0',
   'membersonly.php' => '0089b319ff74bb44d4ed284f9817b1bd',
-  'news.php' => '4828abf9d90cb98e4631a6d1acdd6a75',
+  'news.php' => 'bf8138e9ca40472053f20db7e5080f36',
   'online.php' => 'cc1723a30c127b0850e0a59b43f5e66d',
   'page.php' => 'd85502c586e4c33952a5ef2611e11903',
   'print.php' => 'c701a9e78536556b4252412d1fc1ffd1',
@@ -3087,7 +3087,7 @@
   'upload.php' => 'b70a08b20a7bf52088038c057a36d64a',
   'user.php' => 'c12af9f6ad66aec6325e6e1e7b382ca0',
   'userposts.php' => 'acabb6f8f3e261572aa115f4e72f6824',
-  'usersettings.php' => '2736421d4072b0fb88c317de521d89a8',
+  'usersettings.php' => '591a3e24e4abee995d9cff62373c8eda',
 );
 
 $deprecated_image = array (
@@ -5835,7 +5835,7 @@
   'chat.php' => 'f99ca9a68e350852ff12b6f201ff46e4',
   'e107_6171_readme.txt' => '7f411eaafccc974f91447c8efd9992d4',
   'forum_post.php' => 'b4537a7296252a0d8c010824b698259b',
-  'install.php' => '6962265d372d8d5bd08ccb6a87c5187f',
+  'install.php' => '608c273d656960375693be1e5af7d446',
   'oldpolls.php' => '2758e56550195c508819c6062b950bc3',
   'readme.txt' => 'ff257006036939e779d287cdfee3b4b3',
   'sitemap.php' => 'd72fdc265a68f5a3b8a5d4b51d776f84',
diff -x .svn -aruN 0.7.19.src/e107_admin/fileinspector.php 0.7.20.src/e107_admin/fileinspector.php
--- 0.7.19.src/e107_admin/fileinspector.php	2010-02-17 12:55:50.000000000 -0600
+++ 0.7.20.src/e107_admin/fileinspector.php	2010-02-23 10:26:53.000000000 -0600
@@ -11,9 +11,9 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvs_backup/e107_0.7/e107_admin/fileinspector.php,v $
-|     $Revision: 11346 $
-|     $Date: 2010-02-17 13:56:14 -0500 (Wed, 17 Feb 2010) $
-|     $Author: secretr $
+|     $Revision: 11366 $
+|     $Date: 2010-02-23 11:27:17 -0500 (Tue, 23 Feb 2010) $
+|     $Author: mcfly_e107 $
 +----------------------------------------------------------------------------+
 */
 require_once('../class2.php');
@@ -40,8 +40,6 @@
 }
 
 require_once('core_image.php');
-$core_image[$coredir['admin']]['filetypes.php'] = ' ';
-
 
 if (e_QUERY) {
 	$fi -> snapshot_interface();
@@ -228,9 +226,6 @@
 		return $list;
 	}
 
-
-
-
 	// Given a full path and filename, looks it up in the list to determine valid actions; returns:
 	//	  'check' - file is expected to be present, and validity is to be checked
 	//	  'ignore' - file may or may not be present - check its validity if found, but not an error if missing
@@ -238,25 +233,26 @@
 	//	  'nocalc' - file may be present, but its integrity cannot be checked. Not an error if missing
 	function check_action($dir, $name)
 	{
+
 	  global $coredir;
 	  
-	  if ($name == 'e_inspect.php') return 'nocalc';		// Special case for plugin integrity checking
+	  if ($name == 'e_inspect.php') { return 'nocalc'; }		// Special case for plugin integrity checking
 	  
 	  $filename = $dir.'/'.$name;
-	  $admin_dir = $this -> root_dir.'/'.$coredir['admin'].'/';
-	  $image_dir  = $this -> root_dir.'/'.$coredir['images'].'/';
-	  $test_list = array(
-			$admin_dir.'core_image.php' => 'uncalc',
-			$admin_dir.'filetypes.php' => 'uncalc',
-			$admin_dir.'filetypes_.php' => 'uncalc',
-			$admin_dir.'admin_filetypes.php' => 'uncalc',
-			$this -> root_dir.'/e107_config.php' => 'uncalc',
-			$this -> root_dir.'/.htaccess' => 'uncalc',
-			$this -> root_dir.'/robots.txt' => 'nocalc',
-			$this -> root_dir.'/e107.htaccess' => 'ignore',
-			$this -> root_dir.'/e107.robots.txt' => 'ignore',
-		);
-	  if (isset($test_list[$filename])) return $test_list[$filename];
+	  $admin_dir = $this->root_dir.'/'.$coredir['admin'].'/';
+	  $image_dir  = $this->root_dir.'/'.$coredir['images'].'/';
+	  $test_list = array();
+
+	  // Files that are unable to be checked
+	  $test_list[$admin_dir.'core_image.php'] = 'uncalc';
+	  $test_list[$this->root_dir.'/e107_config.php'] = 'uncalc';
+
+      // Files that are likely to be renamed by user
+	  $test_list[$admin_dir.'filetypes_.php'] = 'ignore';
+	  $test_list[$this->root_dir.'/e107.htaccess'] = 'ignore';
+	  $test_list[$this->root_dir.'/e107.robots.txt'] = 'ignore';
+	  
+	  if (isset($test_list[$filename])) { return $test_list[$filename]; }
 	  return 'check';
 	}
 
@@ -705,9 +701,9 @@
 		$data .= "|     GNU General Public License (http://gnu.org).\n";
 		$data .= "|\n";
 		$data .= "|     \$Source: /cvs_backup/e107_0.7/e107_admin/fileinspector.php,v $\n";
-		$data .= "|     \$Revision: 11346 $\n";
-		$data .= "|     \$Date: 2010-02-17 13:56:14 -0500 (Wed, 17 Feb 2010) $\n";
-		$data .= "|     \$Author: secretr $\n";
+		$data .= "|     \$Revision: 11366 $\n";
+		$data .= "|     \$Date: 2010-02-23 11:27:17 -0500 (Tue, 23 Feb 2010) $\n";
+		$data .= "|     \$Author: mcfly_e107 $\n";
 		$data .= "+----------------------------------------------------------------------------+\n";
 		$data .= "*/\n\n";
 		$data .= "if (!defined('e107_INIT')) { exit; }\n\n";
diff -x .svn -aruN 0.7.19.src/e107_admin/prefs.php 0.7.20.src/e107_admin/prefs.php
--- 0.7.19.src/e107_admin/prefs.php	2010-02-17 12:55:50.000000000 -0600
+++ 0.7.20.src/e107_admin/prefs.php	2010-03-06 17:48:44.000000000 -0600
@@ -11,9 +11,9 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvs_backup/e107_0.7/e107_admin/prefs.php,v $
-|     $Revision: 11346 $
-|     $Date: 2010-02-17 13:56:14 -0500 (Wed, 17 Feb 2010) $
-|     $Author: secretr $
+|     $Revision: 11384 $
+|     $Date: 2010-03-06 18:49:08 -0500 (Sat, 06 Mar 2010) $
+|     $Author: mcfly_e107 $
 +----------------------------------------------------------------------------+
 */
 require_once("../class2.php");
@@ -78,7 +78,7 @@
 		else
 		{
 		  $value = $pref_limits[$key]['default'];
-		} 
+		}
 	    $pref[$key] = $value;
 	  }
 	  else
@@ -491,7 +491,7 @@
 	</tr>
 
 	<tr>
-	<td style='width:50%' class='forumheader3'>".PRFLAN_45."<br /><span class='smalltext'>".PRFLAN_46." <a href='http://www.cdt.org/legislation/105th/privacy/coppa.html'>".PRFLAN_94."</a></span></td>
+	<td style='width:50%' class='forumheader3'>".PRFLAN_45."<br /><span class='smalltext'>".PRFLAN_46." <a href='http://www.ftc.gov/privacy/coppafaqs.shtm'>".PRFLAN_94."</a></span></td>
 	<td style='width:50%; text-align:right' class='forumheader3'>
 	<input type='radio' name='use_coppa' value='1'".($pref['use_coppa'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
 	<input type='radio' name='use_coppa' value='0'".(!$pref['use_coppa'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
diff -x .svn -aruN 0.7.19.src/e107_admin/users.php 0.7.20.src/e107_admin/users.php
--- 0.7.19.src/e107_admin/users.php	2010-02-17 12:55:50.000000000 -0600
+++ 0.7.20.src/e107_admin/users.php	2010-02-17 12:55:50.000000000 -0600
@@ -10,7 +10,7 @@
 |     Released under the terms and conditions of the
 |     GNU General Public License (http://gnu.org).
 |
-|     $URL: https://e107.svn.sourceforge.net/svnroot/e107/tags/e107_v07_19_release/e107_admin/users.php $
+|     $URL: https://e107.svn.sourceforge.net/svnroot/e107/tags/e107_v07_20_release/e107_admin/users.php $
 |     $Id: users.php 11346 2010-02-17 18:56:14Z secretr $
 +----------------------------------------------------------------------------+
 */
diff -x .svn -aruN 0.7.19.src/e107_admin/ver.php 0.7.20.src/e107_admin/ver.php
--- 0.7.19.src/e107_admin/ver.php	2010-02-22 14:44:07.000000000 -0600
+++ 0.7.20.src/e107_admin/ver.php	2010-04-15 21:46:05.000000000 -0500
@@ -1,13 +1,13 @@
 <?php
 /*
 * Copyright e107 Inc e107.org, Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
-* $URL: https://e107.svn.sourceforge.net/svnroot/e107/tags/e107_v07_19_release/e107_admin/ver.php $
-* $Id: ver.php 11356 2010-02-22 20:44:31Z mcfly_e107 $
+* $URL: https://e107.svn.sourceforge.net/svnroot/e107/tags/e107_v07_20_release/e107_admin/ver.php $
+* $Id: ver.php 11480 2010-04-16 02:46:29Z mcfly_e107 $
 *
 * Version file
 */
 
 if (!defined('e107_INIT')) { exit; }
 
-$e107info['e107_version'] = "0.7.19";
+$e107info['e107_version'] = "0.7.20";
 ?>
diff -x .svn -aruN 0.7.19.src/e107_docs/help/English/Preferences 0.7.20.src/e107_docs/help/English/Preferences
--- 0.7.19.src/e107_docs/help/English/Preferences	2006-08-26 21:24:22.000000000 -0500
+++ 0.7.20.src/e107_docs/help/English/Preferences	2010-03-06 17:48:44.000000000 -0600
@@ -3,7 +3,7 @@
 A>	There is a section in your Preferences page that allows you to change your site theme. Please preview the theme first as some older themes are no longer compatible and could render your site unusable if applied.
 
 Q>	What's COPPA?
-A>	The Children's Online Privacy Protection Act of 1998. It's a universally used rule that protects minors aged 13 and under. It ensures that no information on minors will be used by the 'Operator' (i.e., you) for purposes other than maintaining the website. For more information please see http://www.cdt.org/legislation/105th/privacy/coppa.html.
+A>	The Children's Online Privacy Protection Act of 1998. It's a universally used rule that protects minors aged 13 and under. It ensures that no information on minors will be used by the 'Operator' (i.e., you) for purposes other than maintaining the website. For more information please see http://www.ftc.gov/privacy/coppafaqs.shtm.
 
 Q>	What's flood protection?
 A>	It prevents your site being flooded by HTTP calls, which can render your site unreachable.
diff -x .svn -aruN 0.7.19.src/e107_files/shortcode/batch/download_shortcodes.php 0.7.20.src/e107_files/shortcode/batch/download_shortcodes.php
--- 0.7.19.src/e107_files/shortcode/batch/download_shortcodes.php	2010-02-17 12:55:50.000000000 -0600
+++ 0.7.20.src/e107_files/shortcode/batch/download_shortcodes.php	2010-04-13 01:48:31.000000000 -0500
@@ -3,7 +3,7 @@
 + ----------------------------------------------------------------------------+
 |     e107 website system
 |
-|     Steve Dunstan 2001-2002
+|     �Steve Dunstan 2001-2002
 |     http://e107.org
 |     jalist@e107.org
 |
@@ -11,9 +11,9 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvs_backup/e107_0.7/e107_files/shortcode/batch/download_shortcodes.php,v $
-|     $Revision: 11346 $
-|     $Date: 2010-02-17 13:56:14 -0500 (Wed, 17 Feb 2010) $
-|     $Author: secretr $
+|     $Revision: 11473 $
+|     $Date: 2010-04-13 02:48:55 -0400 (Tue, 13 Apr 2010) $
+|     $Author: e107coders $
 +----------------------------------------------------------------------------+
 */
 if (!defined('e107_INIT')) { exit; }
@@ -94,6 +94,16 @@
 }
 SC_END
 
+SC_BEGIN DOWNLOAD_LIST_IMAGEFULL
+global $row;
+$img = ($row['download_image']) ? "<img class='dl_image' src='".e_FILE."downloadimages/".$row['download_image']."' alt='' style='".DL_IMAGESTYLE."' />" : "";
+if($parm == "link" && $row['download_image']){
+	return "<a href='".e_BASE."download.php?view.".$row['download_id']."'>".$img."</a>";
+}else{
+	return $img;
+}
+SC_END
+
 
 SC_BEGIN DOWNLOAD_LIST_ID
 global $row;
diff -x .svn -aruN 0.7.19.src/e107_handlers/file_class.php 0.7.20.src/e107_handlers/file_class.php
--- 0.7.19.src/e107_handlers/file_class.php	2010-02-17 12:55:50.000000000 -0600
+++ 0.7.20.src/e107_handlers/file_class.php	2010-03-10 16:19:29.000000000 -0600
@@ -11,9 +11,9 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvs_backup/e107_0.7/e107_handlers/file_class.php,v $
-|     $Revision: 11346 $
-|     $Date: 2010-02-17 13:56:14 -0500 (Wed, 17 Feb 2010) $
-|     $Author: secretr $
+|     $Revision: 11410 $
+|     $Date: 2010-03-10 17:19:53 -0500 (Wed, 10 Mar 2010) $
+|     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
 
@@ -39,7 +39,7 @@
 		}
 		if($omit == 'standard')
 		{
-			$rejectArray = array('^\.$','^\.\.$','^\/$','^CVS$','thumbs\.db','.*\._$','^\.htaccess$','index\.html','null\.txt');
+			$rejectArray = array('^\.$','^\.\.$','^\/$','^CVS$','^\.svn','thumbs\.db','.*\._$','^\.htaccess$','index\.html','null\.txt');
 		}
 		else
 		{
@@ -56,7 +56,7 @@
 		{
 			if(is_dir($path.'/'.$file))
 			{
-				if($file != '.' && $file != '..' && $file != 'CVS' && $recurse_level > 0 && $current_level < $recurse_level)
+				if($file != '.' && $file != '..' && $file != 'CVS' && ($file != '.svn') && $recurse_level > 0 && $current_level < $recurse_level)
 				{
 					$xx = $this->get_files($path.'/'.$file, $fmask, $omit, $recurse_level, $current_level+1);
 					$ret = array_merge($ret,$xx);
diff -x .svn -aruN 0.7.19.src/e107_handlers/tiny_mce/wysiwyg.php 0.7.20.src/e107_handlers/tiny_mce/wysiwyg.php
--- 0.7.19.src/e107_handlers/tiny_mce/wysiwyg.php	2010-02-17 12:55:50.000000000 -0600
+++ 0.7.20.src/e107_handlers/tiny_mce/wysiwyg.php	2010-03-07 15:04:01.000000000 -0600
@@ -4,9 +4,9 @@
 |     e107 website system - Tiny MCE controller file.
 |
 |     $Source: /cvs_backup/e107_0.7/e107_handlers/tiny_mce/wysiwyg.php,v $
-|     $Revision: 11346 $
-|     $Date: 2010-02-17 13:56:14 -0500 (Wed, 17 Feb 2010) $
-|     $Author: secretr $
+|     $Revision: 11387 $
+|     $Date: 2010-03-07 16:04:25 -0500 (Sun, 07 Mar 2010) $
+|     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
 
@@ -44,7 +44,7 @@
 $mce_plugins = array();
 $mce_plugins[0]	= "table";
 $mce_plugins[1]	= "contextmenu";
-$mce_plugins[2]	= ($pref['smiley_activate']) ? ",emoticons" : "";
+$mce_plugins[2]	= ($pref['smiley_activate']) ? "emoticons" : "";
 $mce_plugins[4]	= (ADMIN) ? "ibrowser" : "image";
 $mce_plugins[5]	= "contextmenu";
 $mce_plugins[6]	= "iespell";
diff -x .svn -aruN 0.7.19.src/e107_handlers/upload_handler.php 0.7.20.src/e107_handlers/upload_handler.php
--- 0.7.19.src/e107_handlers/upload_handler.php	2010-02-17 12:55:50.000000000 -0600
+++ 0.7.20.src/e107_handlers/upload_handler.php	2010-04-07 16:12:32.000000000 -0500
@@ -12,9 +12,9 @@
 |        GNU General Public License (http://gnu.org).
 |
 |   $Source: /cvs_backup/e107_0.7/e107_handlers/upload_handler.php,v $
-|   $Revision: 11346 $
-|   $Date: 2010-02-17 13:56:14 -0500 (Wed, 17 Feb 2010) $
-|   $Author: secretr $
+|   $Revision: 11467 $
+|   $Date: 2010-04-07 17:12:56 -0400 (Wed, 07 Apr 2010) $
+|   $Author: e107steved $
 +---------------------------------------------------------------+
 */
 
@@ -245,16 +245,15 @@
  
 	  if (!$first_error)
 	  {
-		$tpos = strrchr($files['name'][$key], ".");		// Require uploaded files to have an extension
+		$tpos = strrchr($name, '.');		// Require uploaded files to have an extension
 		if ($tpos !== FALSE) 
 		{
-		  $fileext = strtolower($tpos);
-		  $tpos = (($file_status = vet_file($uploadfile, $name, $allowed_filetypes, varset($options['extra_file_types'],FALSE))) === TRUE);
+			$tpos = (($file_status = vet_file($uploadfile, $name, $allowed_filetypes, varset($options['extra_file_types'],FALSE))) === TRUE);
 		}
 		if ($tpos === FALSE)
 		{
 			// File type upload not permitted - error message and abort
-		  $first_error = 251;			// Invent our own error number - file type not permitted
+			$first_error = 251;			// Invent our own error number - file type not permitted
 		}
 	  }
 
@@ -607,14 +606,10 @@
 	$a_filetypes = trim(file_get_contents(e_ADMIN.$def_file));
 	$a_filetypes = explode(',', $a_filetypes);
   }
-  else
-  { // Its an 'override' array
-	$a_filetypes = explode(',', $def_file);
-  }
   foreach ($a_filetypes as $ftype) 
   {
 	$ftype = strtolower(trim(str_replace('.', '', $ftype)));
-	if (!$file_mask || in_array($ftype, $file_array))
+	if ($ftype && (!$file_mask || in_array($ftype, $file_array)))
 	{
 	  $ret[] = $ftype;
 	}
diff -x .svn -aruN 0.7.19.src/e107_languages/English/admin/lan_admin.php 0.7.20.src/e107_languages/English/admin/lan_admin.php
--- 0.7.19.src/e107_languages/English/admin/lan_admin.php	2010-02-17 12:55:50.000000000 -0600
+++ 0.7.20.src/e107_languages/English/admin/lan_admin.php	2010-04-05 16:34:33.000000000 -0500
@@ -4,9 +4,9 @@
 |     e107 website system - Language File.
 |
 |     $Source: /cvs_backup/e107_0.7/e107_languages/English/admin/lan_admin.php,v $
-|     $Revision: 11346 $
-|     $Date: 2010-02-17 13:56:14 -0500 (Wed, 17 Feb 2010) $
-|     $Author: secretr $
+|     $Revision: 11461 $
+|     $Date: 2010-04-05 17:34:57 -0400 (Mon, 05 Apr 2010) $
+|     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
 define("ADLAN_0", "News");
@@ -196,7 +196,7 @@
 
 //LAN_WARNING define("ADLAN_ERR_1", "Warning!");
 define("ADLAN_ERR_2", "There are files on your server that are known to be exploitable. These must be removed <b>immediately</b>. The files are related to the older 0.6xx branch of e107. Please delete the following directories and all their contents:");
-define("ADLAN_ERR_3", "There are one or more files in your public upload directories that are not in your allowed upload filetypes list. These may have been placed here by an attacker and if so should be removed <b>immediately</b>. You should <b>not</b> open these files as this may execute any malicious code the file might contain; i.e. do not open them with your browser.<br /><br />If you recognise these files as being legitimate, it is likely that due to the recent allowed filetypes changes, the filetype you allowed is no longer in the allowed filetypes list and you will need to re-add it (see admin => uploads). You should not allow the upload of .html, .txt, etc as an attacker may upload a file of this type which includes malicious javascript. You should also, of course, not allow the upload of .php files or any other type of executable script.<br /><br />Below is the list of files that could potentially be malicious:");
+define("ADLAN_ERR_3", "There are one or more files in your public upload directories that are not in your allowed upload filetypes list. These may have been placed here by an attacker and if so should be removed <b>immediately</b>. You should <b>not</b> open these files as this may execute any malicious code the file might contain; e.g. do not open them with your browser.<br /><br />If you recognise these files as being legitimate, it is likely that the filetype is no longer in the allowed filetypes list for some reason, and you will need to re-add it (see admin => uploads). You should not allow the upload of .html, .txt, etc as an attacker may upload a file of this type which includes malicious javascript. You should also, of course, not allow the upload of .php files or any other type of executable script.<br /><br />Below is the list of files that could potentially be malicious:");
 define("ADLAN_ERR_4", "Deprecated plugin file(s) found");
 define("ADLAN_ERR_5", "The following files need to be renamed to");
 define("ADLAN_ERR_6", "Then, click here to re-scan your plugin folders.");
diff -x .svn -aruN 0.7.19.src/e107_languages/English/lan_news.php 0.7.20.src/e107_languages/English/lan_news.php
--- 0.7.19.src/e107_languages/English/lan_news.php	2010-02-17 12:55:50.000000000 -0600
+++ 0.7.20.src/e107_languages/English/lan_news.php	2010-04-07 15:35:59.000000000 -0500
@@ -4,9 +4,9 @@
 |     e107 website system - Language File.
 |
 |     $Source: /cvs_backup/e107_0.7/e107_languages/English/lan_news.php,v $
-|     $Revision: 11346 $
-|     $Date: 2010-02-17 13:56:14 -0500 (Wed, 17 Feb 2010) $
-|     $Author: secretr $
+|     $Revision: 11465 $
+|     $Date: 2010-04-07 16:36:23 -0400 (Wed, 07 Apr 2010) $
+|     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
 define("PAGE_NAME", "News");
@@ -37,4 +37,9 @@
 define('LAN_NEWS_87', 'Newer News');
 define("LAN_NEWS_462", "No news items for specified month");
 
+// Following used by alt_news
+define("LAN_99", 'Comments');
+define("LAN_100", 'On');
+define("LAN_307", 'Total posts in this category: ');
+
 ?>
\ No newline at end of file
diff -x .svn -aruN 0.7.19.src/e107_plugins/calendar_menu/calendar_menu.php 0.7.20.src/e107_plugins/calendar_menu/calendar_menu.php
--- 0.7.19.src/e107_plugins/calendar_menu/calendar_menu.php	2010-02-17 12:55:50.000000000 -0600
+++ 0.7.20.src/e107_plugins/calendar_menu/calendar_menu.php	2010-03-02 16:32:50.000000000 -0600
@@ -11,9 +11,9 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvsroot/e107/e107_0.7/e107_plugins/calendar_menu/calendar_menu.php,v $
-|     $Revision: 11346 $
-|     $Date: 2010-02-17 13:56:14 -0500 (Wed, 17 Feb 2010) $
-|     $Author: secretr $
+|     $Revision: 11380 $
+|     $Date: 2010-03-02 17:33:14 -0500 (Tue, 02 Mar 2010) $
+|     $Author: e107steved $
 |
 | 22.10.06 steved - Various tidying up, additional options supported
 | 24.10.06 steved - templated, various cleaning up
@@ -74,38 +74,38 @@
 $cal_totev = 0;
 if ($cal_totev = $sql->db_Select_gen($cal_qry))
 {
-  while ($cal_row = $sql->db_Fetch())
-  {
-    if ($cal_row['event_rec_y'] == $cal_current_month)
-    {	// Recurring events
-	  $cal_start_day = $cal_row['event_rec_m'];
-    }
-    else
-    {	// 'normal' events
-      $cal_tmp = getdate($cal_row['event_start']);
-      if ($cal_tmp['mon'] == $cal_current_month)
-      {
-        $cal_start_day = $cal_tmp['mday'];
-      }
-      else
-      {
-        $cal_start_day = 1;
-      }
-    }
-    // Mark start day of each event
-	$cal_events[$cal_start_day][] = $cal_row['event_cat_icon'];	// Will be overwritten if several events on same day
-	if ((($ecal_class->max_recent_show != 0) && (time() - $cal_row['event_datestamp']) <= $ecal_class->max_recent_show)) $cal_events[$cal_start_day]['is_recent'] = TRUE;
-  }
+	while ($cal_row = $sql->db_Fetch())
+	{
+		if ($cal_row['event_rec_y'] == $cal_current_month)
+		{	// Recurring events
+			$cal_start_day = $cal_row['event_rec_m'];
+		}
+		else
+		{	// 'normal' events
+			$cal_tmp = getdate($cal_row['event_start']);
+			if ($cal_tmp['mon'] == $cal_current_month)
+			{
+				$cal_start_day = $cal_tmp['mday'];
+			}
+			else
+			{
+				$cal_start_day = 1;
+			}
+		}
+		// Mark start day of each event
+		$cal_events[$cal_start_day][] = $cal_row['event_cat_icon'];	// Will be overwritten if several events on same day
+		if ((($ecal_class->max_recent_show != 0) && (time() - $cal_row['event_datestamp']) <= $ecal_class->max_recent_show)) $cal_events[$cal_start_day]['is_recent'] = TRUE;
+	}
 }
 
 
 if ($pref['eventpost_weekstart'] == 'sun')
 {
-  $cal_week	= array(EC_LAN_25, EC_LAN_19, EC_LAN_20, EC_LAN_21, EC_LAN_22, EC_LAN_23, EC_LAN_24);
+	$cal_week	= array(EC_LAN_25, EC_LAN_19, EC_LAN_20, EC_LAN_21, EC_LAN_22, EC_LAN_23, EC_LAN_24);
 }
 else
 {
-  $cal_week	= array(EC_LAN_19, EC_LAN_20, EC_LAN_21, EC_LAN_22, EC_LAN_23, EC_LAN_24, EC_LAN_25);
+	$cal_week	= array(EC_LAN_19, EC_LAN_20, EC_LAN_21, EC_LAN_22, EC_LAN_23, EC_LAN_24, EC_LAN_25);
 }
 
 $cal_months	= array(EC_LAN_0, EC_LAN_1, EC_LAN_2, EC_LAN_3, EC_LAN_4, EC_LAN_5, EC_LAN_6, EC_LAN_7, EC_LAN_8, EC_LAN_9, EC_LAN_10, EC_LAN_11);
@@ -114,11 +114,11 @@
 $calendar_title = "<a class='forumlink' href='".e_PLUGIN."calendar_menu/";
 if ($pref['eventpost_menulink'] == 1)
 {
-  $calendar_title .= "calendar.php' >";
+	$calendar_title .= "calendar.php' >";
 }
 else
 {
-  $calendar_title .= "event.php' >";
+	$calendar_title .= "event.php' >";
 }
 if ($pref['eventpost_dateformat'] == 'my')
 {
@@ -195,32 +195,32 @@
 	$cal_css = 2;		// The default - not today, no events
     if ($cal_dayarray['mon'] == $cal_thismonth)
     {  // Dates match for this month
-      $cal_img = $cal_c;		// Default 'image' is the day of the month
-      $cal_event_count = 0;
-      $title = "";
-      if ($cal_thisday == $cal_c) $cal_css = 1;
+		$cal_img = $cal_c;		// Default 'image' is the day of the month
+		$cal_event_count = 0;
+		$title = "";
+		if ($cal_thisday == $cal_c) $cal_css = 1;
         $cal_linkut = mktime(0 , 0 , 0 , $cal_dayarray['mon'], $cal_c, $cal_datearray['year']).".one";  // ALways need "one"
         if (array_key_exists($cal_c, $cal_events))
-        {
+        {	// Events happening today
             $cal_event_icon = "calendar_menu/images/" . $cal_events[$cal_c]['0'];
             $cal_event_count = count($cal_events[$cal_c]);		// See how many events today
-            if (!empty($cal_events[$cal_c]) && is_readable(e_PLUGIN.$cal_event_icon))
+            if (!empty($cal_events[$cal_c]['0']) && is_readable(e_PLUGIN.$cal_event_icon))
             {   // Show icon if it exists
-			  $cal_css += 2;		// Gives 3 for today, 4 for other day
-			  if ($cal_event_count == 1)
-			  {
-                $title = " title='1 ".EC_LAN_135."' ";
-			  }
-			  else
-			  {
-                $title = " title='{$cal_event_count} " . EC_LAN_106 . "' ";
-			  }
-              $cal_img = "<img style='border:0' src='".e_PLUGIN_ABS.$cal_event_icon."' alt='' />";
+				$cal_css += 2;		// Gives 3 for today, 4 for other day
+				if ($cal_event_count == 1)
+				{
+					$title = " title='1 ".EC_LAN_135."' ";
+				}
+				else
+				{
+					$title = " title='{$cal_event_count} " . EC_LAN_106 . "' ";
+				}
+				$cal_img = "<img style='border:0' src='".e_PLUGIN_ABS.$cal_event_icon."' alt='' />";
 				//height='10' width='10'
-			  if (isset($cal_events[$cal_c]['is_recent']) && $cal_events[$cal_c]['is_recent'])
-			  {
-			    $cal_css += 2;
-			  }
+				if (isset($cal_events[$cal_c]['is_recent']) && $cal_events[$cal_c]['is_recent'])
+				{
+					$cal_css += 2;
+				}
             }
 		}
         $cal_text .= $CALENDAR_MENU_DAY_START[$cal_css]."<a {$title} href='" . e_PLUGIN_ABS."calendar_menu/event.php?{$cal_linkut}'>{$cal_img}</a>";
diff -x .svn -aruN 0.7.19.src/e107_plugins/content/content_manager.php 0.7.20.src/e107_plugins/content/content_manager.php
--- 0.7.19.src/e107_plugins/content/content_manager.php	2010-02-17 12:55:50.000000000 -0600
+++ 0.7.20.src/e107_plugins/content/content_manager.php	2010-04-07 15:08:41.000000000 -0500
@@ -12,13 +12,18 @@
 |        GNU General Public License (http://gnu.org).
 |
 |		$Source: /cvs_backup/e107_0.7/e107_plugins/content/content_manager.php,v $
-|		$Revision: 11346 $
-|		$Date: 2010-02-17 13:56:14 -0500 (Wed, 17 Feb 2010) $
-|		$Author: secretr $
+|		$Revision: 11464 $
+|		$Date: 2010-04-07 16:09:05 -0400 (Wed, 07 Apr 2010) $
+|		$Author: e107steved $
 +---------------------------------------------------------------+
 */
 
 require_once("../../class2.php");
+if (!isset($pref['plug_installed']['content']))
+{
+	header('location:'.e_BASE.'index.php');
+	exit;
+}
 
 $plugindir = e_PLUGIN."content/";
 require_once($plugindir."content_shortcodes.php");
@@ -50,7 +55,7 @@
 }
 
 
-if (!USER)
+if (!USER || !$aa->checkPersonalManager())
 {	// non-user can never manage content
 	header("location:".$plugindir."content.php"); 
 	exit;
diff -x .svn -aruN 0.7.19.src/e107_plugins/content/content.php 0.7.20.src/e107_plugins/content/content.php
--- 0.7.19.src/e107_plugins/content/content.php	2010-02-17 12:55:50.000000000 -0600
+++ 0.7.20.src/e107_plugins/content/content.php	2010-04-07 15:08:41.000000000 -0500
@@ -12,13 +12,19 @@
 |        GNU General Public License (http://gnu.org).
 |
 |		$Source: /cvs_backup/e107_0.7/e107_plugins/content/content.php,v $
-|		$Revision: 11346 $
-|		$Date: 2010-02-17 13:56:14 -0500 (Wed, 17 Feb 2010) $
-|		$Author: secretr $
+|		$Revision: 11464 $
+|		$Date: 2010-04-07 16:09:05 -0400 (Wed, 07 Apr 2010) $
+|		$Author: e107steved $
 +---------------------------------------------------------------+
 */
 
-require_once("../../class2.php");
+require_once('../../class2.php');
+if (!isset($pref['plug_installed']['content']))
+{
+	header('location:'.e_BASE.'index.php');
+	exit;
+}
+
 $plugindir = e_PLUGIN."content/";
 require_once($plugindir."content_shortcodes.php");
 require_once(e_HANDLER."emailprint_class.php");
@@ -35,12 +41,16 @@
 $eArrayStorage = new ArrayData();
 include_lan($plugindir."languages/".e_LANGUAGE."/lan_content.php");
 
-if(e_QUERY){
+if(e_QUERY)
+{
 	$qs = explode(".", e_QUERY);
 
-	if(is_numeric($qs[0])){
+	if(is_numeric($qs[0]))
+	{
 		$from = array_shift($qs);
-	}else{
+	}
+	else
+	{
 		$from = "0";
 	}
 }
@@ -340,28 +350,12 @@
 				}
 			}
 
-			if(USER){
-				$personalmanagercheck = FALSE;
-				$array = $aa -> getCategoryTree("", "", TRUE);
-				$catarray = array_keys($array);
-				$qry = "";
-				foreach($catarray as $catid){
-					$qry .= " content_id='".$catid."' || ";
-				}
-				$qry = substr($qry,0,-3);
-				if($sql -> db_Select($plugintable, "content_id, content_heading, content_pref", " ".$qry." ")){
-					while($row = $sql -> db_Fetch()){
-						if(isset($row['content_pref']) && $row['content_pref']){
-							$content_pref = $eArrayStorage->ReadArray($row['content_pref']);
-						}
-						if( (isset($content_pref["content_manager_approve"]) && check_class($content_pref["content_manager_approve"])) || (isset($content_pref["content_manager_personal"]) && check_class($content_pref["content_manager_personal"])) || (isset($content_pref["content_manager_category"]) && check_class($content_pref["content_manager_category"])) ){
-							$personalmanagercheck = TRUE;
-							break;
-						}
-					}
-				}
-				if($personalmanagercheck == TRUE){
-					if($SUBMIT_LINE != TRUE){
+			if(USER)
+			{
+				if ($aa->checkPersonalManager())
+				{
+					if($SUBMIT_LINE != TRUE)
+					{
 						$content_type_table_string .= $CONTENT_TYPE_TABLE_LINE;
 					}
 					$content_type_table_string .= $tp -> parseTemplate($CONTENT_TYPE_TABLE_MANAGER, FALSE, $content_shortcodes);
diff -x .svn -aruN 0.7.19.src/e107_plugins/content/content_submit.php 0.7.20.src/e107_plugins/content/content_submit.php
--- 0.7.19.src/e107_plugins/content/content_submit.php	2010-02-17 12:55:50.000000000 -0600
+++ 0.7.20.src/e107_plugins/content/content_submit.php	2010-04-07 15:08:41.000000000 -0500
@@ -12,13 +12,18 @@
 |        GNU General Public License (http://gnu.org).
 |
 |		$Source: /cvs_backup/e107_0.7/e107_plugins/content/content_submit.php,v $
-|		$Revision: 11346 $
-|		$Date: 2010-02-17 13:56:14 -0500 (Wed, 17 Feb 2010) $
-|		$Author: secretr $
+|		$Revision: 11464 $
+|		$Date: 2010-04-07 16:09:05 -0400 (Wed, 07 Apr 2010) $
+|		$Author: e107steved $
 +---------------------------------------------------------------+
 */
 
 require_once("../../class2.php");
+if (!isset($pref['plug_installed']['content']))
+{
+	header('location:'.e_BASE.'index.php');
+	exit;
+}
 
 $plugindir = e_PLUGIN."content/";
 
diff -x .svn -aruN 0.7.19.src/e107_plugins/content/e_list.php 0.7.20.src/e107_plugins/content/e_list.php
--- 0.7.19.src/e107_plugins/content/e_list.php	2010-02-17 12:55:50.000000000 -0600
+++ 0.7.20.src/e107_plugins/content/e_list.php	2010-04-15 14:45:32.000000000 -0500
@@ -1,111 +1,124 @@
-<?php
-
-if (!defined('e107_INIT')) { exit; }
-
-	if(!$content_install = $sql -> db_Select("plugin", "*", "plugin_path = 'content' AND plugin_installflag = '1' ")){
-		return;
-	}
-
-	require_once(e_PLUGIN."content/handlers/content_class.php");
-	$aa = new content;
-
-	$datequery = " AND content_datestamp < ".time()." AND (content_enddate=0 || content_enddate>".time().") ";
-
-	global $contentmode;
-	//contentmode : content_144 (content_ + idvalue)
-	if($contentmode){
-		$headingquery = " AND content_id = '".substr($contentmode,8)."' ";
-	}else{
-		$headingquery = "";
-	}
-
-	//get main parent types
-	$sqlm = new db;
-	if(!$mainparents = $sqlm -> db_Select("pcontent", "*", "content_class REGEXP '".e_CLASS_REGEXP."' AND content_parent = '0' ".$datequery." ".$headingquery." ORDER BY content_heading")){
-		$LIST_DATA = "no valid content category";
-	}else{		
-		while($rowm = $sqlm -> db_Fetch()){
-			$ICON = "";
-			$HEADING = "";
-			$AUTHOR = "";
-			$CATEGORY = "";
-			$DATE = "";
-			$INFO = "";
-			$LIST_CAPTION	= $rowm['content_heading'];
-
-			//global var for this main parent
-			$mainparent = $rowm['content_id'];
-
-			//get path variables
-			$content_recent_pref = $aa -> getContentPref($mainparent);
-			$content_recent_pref["content_icon_path"] = ($content_recent_pref["content_icon_path"] ? $content_recent_pref["content_icon_path"] : "{e_PLUGIN_ABS}content/images/icon/" );
-			$content_icon_path = $tp -> replaceConstants($content_recent_pref["content_icon_path"]);
-
-			//prepare query string
-			$array = $aa -> getCategoryTree("", $mainparent, TRUE);
-			$validparent = implode(",", array_keys($array));
-			$qry = " content_refer !='sa' AND content_parent REGEXP '".$aa -> CONTENTREGEXP($validparent)."' AND content_class REGEXP '".e_CLASS_REGEXP."' ";
-
-			//check so only the preferences from the correct content_type (article, content, review etc) are used and rendered
-			if(substr($contentmode,8) == $rowm['content_id']){
-
-				if($mode == "new_page" || $mode == "new_menu" ){
-					$lvisit = $this -> getlvisit();
-					$qry = $qry." AND content_datestamp>".$lvisit;
-				}else{
-					$qry = $qry." ".$datequery;
-				}
-				$qry .= " ORDER BY content_datestamp DESC LIMIT 0,".intval($arr[7]);
-
-				//get recent content for each main parent
-				$sqli = new db;
-				if(!$resultitem = $sqli -> db_Select("pcontent", "*", $qry)){
-					$LIST_DATA = CONTENT_MENU_LAN_5." ".$rowm['content_heading'];
-				}else{
-					$LIST_DISPLAYSTYLE = ($arr[2] ? "" : "none");
-
-					while($rowi = $sqli -> db_Fetch()){
-						$rowheading = $this -> parse_heading($rowi['content_heading'], $mode);
-						$HEADING = "<a href='".e_PLUGIN_ABS."content/content.php?content.".$rowi['content_id']."' title='".$rowi['content_heading']."'>".$rowheading."</a>";
-						//category
-						if($arr[4]){
-							$crumb = "";
-							if(array_key_exists($rowi['content_parent'], $array)){
-								$newarr = $array[$rowi['content_parent']];
-								$newarr = array_reverse($newarr);
-								$CATEGORY = "<a href='".e_PLUGIN_ABS."content/content.php?cat.".$newarr[1]."'>".$newarr[0]."</a>";
-							}
-						}
-
-						$DATE = ($arr[5] ? $this -> getListDate($rowi['content_datestamp'], $mode) : "");
-						//$ICON = $this -> getBullet($arr[6], $mode);
-
-						$image_link_append = "<a href='".e_PLUGIN_ABS."content/content.php?content.".$rowi['content_id']."'>";
-						if($rowi['content_icon'] && file_exists(e_PLUGIN."content/images/icon/".$rowi['content_icon'])){
-							$ICON = $image_link_append."<img src='".e_PLUGIN_ABS."content/images/icon/".$rowi['content_icon']."' style='width:50px; border:1px solid #000;' alt='' /></a>";
-						}else{
-							$ICON = "";
-						}
-
-						//get author details
-						if($arr[3]){
-							$authordetails = $aa -> getAuthor($rowi['content_author']);
-							if(USER && is_numeric($authordetails[0]) && $authordetails[0] != "0"){
-								$AUTHOR = "<a href='".e_HTTP."user.php?id.".$authordetails[0]."' >".$authordetails[1]."</a>";
-							}else{
-								$AUTHOR = $authordetails[1];
-							}
-						}else{
-							$AUTHOR = "";
-						}
-						$INFO = "";
-
-						$LIST_DATA[$mode][] = array( $ICON, $HEADING, $AUTHOR, $CATEGORY, $DATE, $INFO );
-					}
-				}
-			}
-		}
-	}
-
-
+<?php
+
+if (!defined('e107_INIT')) { exit; }
+
+	if (!isset($pref['plug_installed']['content'])) return;
+
+
+	require_once(e_PLUGIN.'content/handlers/content_class.php');
+	$aa = new content;
+
+	$datequery = " AND content_datestamp < ".time()." AND (content_enddate=0 || content_enddate>".time().") ";
+
+	global $contentmode;
+	//contentmode : content_144 (content_ + idvalue)
+	if($contentmode)
+	{
+		$headingquery = " AND content_id = '".substr($contentmode,8)."' ";
+	}
+	else
+	{
+		$headingquery = "";
+	}
+
+	//get main parent types
+	$sqlm = new db;
+	if(!$mainparents = $sqlm -> db_Select("pcontent", "*", "content_class REGEXP '".e_CLASS_REGEXP."' AND content_parent = '0' ".$datequery." ".$headingquery." ORDER BY content_heading"))
+	{
+		$LIST_DATA = "no valid content category";
+		return;
+	}
+
+
+	while($rowm = $sqlm -> db_Fetch())
+	{
+		$ICON = "";
+		$HEADING = "";
+		$AUTHOR = "";
+		$CATEGORY = "";
+		$DATE = "";
+		$INFO = "";
+		$LIST_CAPTION	= $rowm['content_heading'];
+
+		//global var for this main parent
+		$mainparent = $rowm['content_id'];
+
+		//get path variables
+		$content_recent_pref = $aa -> getContentPref($mainparent);
+		$content_recent_pref["content_icon_path"] = ($content_recent_pref["content_icon_path"] ? $content_recent_pref["content_icon_path"] : "{e_PLUGIN_ABS}content/images/icon/" );
+		$content_icon_path = $tp -> replaceConstants($content_recent_pref["content_icon_path"]);
+
+		//prepare query string
+		$array = $aa -> getCategoryTree("", $mainparent, TRUE);
+		$validparent = implode(",", array_keys($array));
+		$qry = " content_refer !='sa' AND content_parent REGEXP '".$aa -> CONTENTREGEXP($validparent)."' AND content_class REGEXP '".e_CLASS_REGEXP."' ";
+
+		//check so only the preferences from the correct content_type (article, content, review etc) are used and rendered
+		if(substr($contentmode,8) == $rowm['content_id'])
+		{
+			if($mode == "new_page" || $mode == "new_menu" )
+			{
+				$lvisit = $this -> getlvisit();
+				$qry = $qry." AND content_datestamp>".$lvisit;
+			}
+			else
+			{
+				$qry = $qry." ".$datequery;
+			}
+			$qry .= " ORDER BY content_datestamp DESC LIMIT 0,".intval($arr[7]);
+
+			//get recent content for each main parent
+			$sqli = new db;
+			if(!$resultitem = $sqli -> db_Select("pcontent", "*", $qry))
+			{
+				$LIST_DATA = CONTENT_MENU_LAN_5." ".$rowm['content_heading'];
+			}
+			else
+			{
+				$LIST_DISPLAYSTYLE = ($arr[2] ? "" : "none");
+
+				while($rowi = $sqli -> db_Fetch())
+				{
+					$rowheading = $this -> parse_heading($rowi['content_heading'], $mode);
+					$HEADING = "<a href='".e_PLUGIN_ABS."content/content.php?content.".$rowi['content_id']."' title='".$rowi['content_heading']."'>".$rowheading."</a>";
+					//category
+					if($arr[4]){
+						$crumb = "";
+						if(array_key_exists($rowi['content_parent'], $array)){
+							$newarr = $array[$rowi['content_parent']];
+							$newarr = array_reverse($newarr);
+							$CATEGORY = "<a href='".e_PLUGIN_ABS."content/content.php?cat.".$newarr[1]."'>".$newarr[0]."</a>";
+						}
+					}
+
+					$DATE = ($arr[5] ? $this -> getListDate($rowi['content_datestamp'], $mode) : "");
+					//$ICON = $this -> getBullet($arr[6], $mode);
+
+					$image_link_append = "<a href='".e_PLUGIN_ABS."content/content.php?content.".$rowi['content_id']."'>";
+					if($rowi['content_icon'] && file_exists(e_PLUGIN."content/images/icon/".$rowi['content_icon'])){
+						$ICON = $image_link_append."<img src='".e_PLUGIN_ABS."content/images/icon/".$rowi['content_icon']."' style='width:50px; border:1px solid #000;' alt='' /></a>";
+					}else{
+						$ICON = "";
+					}
+
+					//get author details
+					if($arr[3]){
+						$authordetails = $aa -> getAuthor($rowi['content_author']);
+						if(USER && is_numeric($authordetails[0]) && $authordetails[0] != "0"){
+							$AUTHOR = "<a href='".e_HTTP."user.php?id.".$authordetails[0]."' >".$authordetails[1]."</a>";
+						}else{
+							$AUTHOR = $authordetails[1];
+						}
+					}else{
+						$AUTHOR = "";
+					}
+					$INFO = "";
+
+					$LIST_DATA[$mode][] = array( $ICON, $HEADING, $AUTHOR, $CATEGORY, $DATE, $INFO );
+				}
+			}
+		}
+	}
+
+
 ?>
\ No newline at end of file
diff -x .svn -aruN 0.7.19.src/e107_plugins/content/handlers/content_class.php 0.7.20.src/e107_plugins/content/handlers/content_class.php
--- 0.7.19.src/e107_plugins/content/handlers/content_class.php	2010-02-17 12:55:50.000000000 -0600
+++ 0.7.20.src/e107_plugins/content/handlers/content_class.php	2010-04-07 15:08:41.000000000 -0500
@@ -12,13 +12,18 @@
 |        GNU General Public License (http://gnu.org).
 |
 |		$Source: /cvs_backup/e107_0.7/e107_plugins/content/handlers/content_class.php,v $
-|		$Revision: 11346 $
-|		$Date: 2010-02-17 13:56:14 -0500 (Wed, 17 Feb 2010) $
-|		$Author: secretr $
+|		$Revision: 11464 $
+|		$Date: 2010-04-07 16:09:05 -0400 (Wed, 07 Apr 2010) $
+|		$Author: e107steved $
 +---------------------------------------------------------------+
 */
 
 if (!defined('e107_INIT')) { exit; }
+if (!isset($pref['plug_installed']['content']))
+{
+	header('location:'.e_BASE.'index.php');
+	exit;
+}
 
 global $plugindir, $plugintable, $datequery;
 $plugindir		= e_PLUGIN."content/";
@@ -342,9 +347,9 @@
 			$content_pref['content_inherit'] = '0';							//inherit options from default preferences
 
 			//CONTENT MANAGER
-			$content_pref['content_manager_approve'] = '0';					//class for managers who can approve submitted items
-			$content_pref['content_manager_personal'] = '0';				//class for managers who can manage personal items
-			$content_pref['content_manager_category'] = '0';				//class for managers who can manage all items in a category
+			$content_pref['content_manager_approve'] = e_UC_NOBODY;					//class for managers who can approve submitted items
+			$content_pref['content_manager_personal'] = e_UC_NOBODY;				//class for managers who can manage personal items
+			$content_pref['content_manager_category'] = e_UC_NOBODY;				//class for managers who can manage all items in a category
 
 			//PAGE RESTRICTION (NOT YET IN USE)
 			$content_pref['content_restrict_managecontent'] = '0';
@@ -1529,6 +1534,36 @@
 			}
 			return $message;
 		}
+		
+		
+		function checkPersonalManager()
+		{
+			global $sql, $plugintable, $eArrayStorage;
+			$array = $this->getCategoryTree("", "", TRUE);
+			$catarray = array_keys($array);
+			$qry = "";
+			foreach($catarray as $catid)
+			{
+				$qry .= " content_id='".$catid."' || ";
+			}
+			$qry = substr($qry,0,-3);
+			if($sql -> db_Select($plugintable, "content_id, content_heading, content_pref", $qry))
+			{
+				while($row = $sql -> db_Fetch(MYSQL_ASSOC))
+				{
+					if(isset($row['content_pref']) && $row['content_pref'])
+					{
+						$content_pref = $eArrayStorage->ReadArray($row['content_pref']);
+					}
+					if( (isset($content_pref["content_manager_approve"]) && ($content_pref["content_manager_approve"] != e_UC_PUBLIC) && check_class($content_pref["content_manager_approve"])) 
+					|| (isset($content_pref["content_manager_personal"]) && ($content_pref["content_manager_personal"] != e_UC_PUBLIC) && check_class($content_pref["content_manager_personal"])) 
+					|| (isset($content_pref["content_manager_category"]) && ($content_pref["content_manager_category"] != e_UC_PUBLIC) && check_class($content_pref["content_manager_category"])) )
+					{
+						return TRUE;
+					}
+				}
+			}
+		}
 }	//close class
 
 ?>
\ No newline at end of file
diff -x .svn -aruN 0.7.19.src/e107_plugins/content/handlers/content_db_class.php 0.7.20.src/e107_plugins/content/handlers/content_db_class.php
--- 0.7.19.src/e107_plugins/content/handlers/content_db_class.php	2010-02-17 12:55:50.000000000 -0600
+++ 0.7.20.src/e107_plugins/content/handlers/content_db_class.php	2010-04-07 15:08:41.000000000 -0500
@@ -12,13 +12,18 @@
 |        GNU General Public License (http://gnu.org).
 |
 |		$Source: /cvs_backup/e107_0.7/e107_plugins/content/handlers/content_db_class.php,v $
-|		$Revision: 11346 $
-|		$Date: 2010-02-17 13:56:14 -0500 (Wed, 17 Feb 2010) $
-|		$Author: secretr $
+|		$Revision: 11464 $
+|		$Date: 2010-04-07 16:09:05 -0400 (Wed, 07 Apr 2010) $
+|		$Author: e107steved $
 +---------------------------------------------------------------+
 */
 
 if (!defined('e107_INIT')) { exit; }
+if (!isset($pref['plug_installed']['content']))
+{
+	header('location:'.e_BASE.'index.php');
+	exit;
+}
 
 $plugindir		= e_PLUGIN."content/";
 $plugintable	= "pcontent";		//name of the table used in this plugin (never remove this, as it's being used throughout the plugin !!)
diff -x .svn -aruN 0.7.19.src/e107_plugins/content/handlers/content_form_class.php 0.7.20.src/e107_plugins/content/handlers/content_form_class.php
--- 0.7.19.src/e107_plugins/content/handlers/content_form_class.php	2010-02-17 12:55:50.000000000 -0600
+++ 0.7.20.src/e107_plugins/content/handlers/content_form_class.php	2010-04-13 21:44:28.000000000 -0500
@@ -4,7 +4,7 @@
 |        e107 website system
 |        /admin/review.php
 |
-|        Steve Dunstan 2001-2002
+|        �Steve Dunstan 2001-2002
 |        http://e107.org
 |        jalist@e107.org
 |
@@ -12,9 +12,9 @@
 |        GNU General Public License (http://gnu.org).
 |
 |		$Source: /cvs_backup/e107_0.7/e107_plugins/content/handlers/content_form_class.php,v $
-|		$Revision: 11346 $
-|		$Date: 2010-02-17 13:56:14 -0500 (Wed, 17 Feb 2010) $
-|		$Author: secretr $
+|		$Revision: 11474 $
+|		$Date: 2010-04-13 22:44:52 -0400 (Tue, 13 Apr 2010) $
+|		$Author: mcfly_e107 $
 +---------------------------------------------------------------+
 */
 
@@ -59,167 +59,167 @@
 
 	function ContentItemPreview()
 	{
-				global $ns, $sql, $aa, $qs, $tp, $mainparent, $months;
+		global $ns, $sql, $aa, $qs, $tp, $mainparent, $months;
 
-				$TRPRE = "<tr>";
-				$TRPOST = "</tr>";
-				$TDPRE1 = "<td class='forumheader3' style='vertical-align:top;'>";
-				$TDPRE2 = "<td class='forumheader3' style='vertical-align:top;'>";
-				$TDPOST = "</td>";
-				$CONTENT_CONTENT_PREVIEW = "
-				<table class='fborder' cellpadding='0' cellspacing='0' style='width:90%; text-align:left; margin-bottom:20px;' border='1'>
-					{CONTENT_CONTENT_PREVIEW_CATEGORY}
-					{CONTENT_CONTENT_PREVIEW_HEADING}
-					{CONTENT_CONTENT_PREVIEW_SUBHEADING}
-					{CONTENT_CONTENT_PREVIEW_SUMMARY}
-					{CONTENT_CONTENT_PREVIEW_TEXT}
-					{CONTENT_CONTENT_PREVIEW_AUTHORNAME}
-					{CONTENT_CONTENT_PREVIEW_AUTHOREMAIL}
-					{CONTENT_CONTENT_PREVIEW_STARTDATE}
-					{CONTENT_CONTENT_PREVIEW_ENDDATE}
-					{CONTENT_CONTENT_PREVIEW_COMMENT}
-					{CONTENT_CONTENT_PREVIEW_RATE}
-					{CONTENT_CONTENT_PREVIEW_PE}
-					{CONTENT_CONTENT_PREVIEW_CLASS}
-					{CONTENT_CONTENT_PREVIEW_SCORE}
-					{CONTENT_CONTENT_PREVIEW_META}
-					{CONTENT_CONTENT_PREVIEW_LAYOUT}
-					{CONTENT_CONTENT_PREVIEW_CUSTOM}
-
-					{CONTENT_CONTENT_PREVIEW_PARENT}
-					{CONTENT_CONTENT_PREVIEW_ICON}
-					{CONTENT_CONTENT_PREVIEW_ATTACH}									
-					{CONTENT_CONTENT_PREVIEW_IMAGES}
-					{CONTENT_CONTENT_PREVIEW_PAGENAMES}
-				</table>\n";
-
-				$tmp = explode(".",$_POST['parent1']);
-				$_POST['parent1'] = $tmp[1];
-				$mainparent						= $aa -> getMainParent( $_POST['parent1'] );
-				$content_pref					= $aa -> getContentPref($mainparent);
-				$content_cat_icon_path_large	= $tp -> replaceConstants($content_pref["content_cat_icon_path_large"]);
-				$content_cat_icon_path_small	= $tp -> replaceConstants($content_pref["content_cat_icon_path_small"]);
-				$content_icon_path				= $tp -> replaceConstants($content_pref["content_icon_path"]);
-				$content_image_path				= $tp -> replaceConstants($content_pref["content_image_path"]);
-				$content_file_path				= $tp -> replaceConstants($content_pref["content_file_path"]);
-				
-				$content_pref["content_icon_path_tmp"] = ($content_pref["content_icon_path_tmp"] ? $content_pref["content_icon_path_tmp"] : $content_pref["content_icon_path"]."tmp/");
-				$content_pref["content_file_path_tmp"] = ($content_pref["content_file_path_tmp"] ? $content_pref["content_file_path_tmp"] : $content_pref["content_file_path"]."tmp/");
-				$content_pref["content_image_path_tmp"] = ($content_pref["content_image_path_tmp"] ? $content_pref["content_image_path_tmp"] : $content_pref["content_image_path"]."tmp/");
-						
-				$content_tmppath_icon			= $tp -> replaceConstants($content_pref["content_icon_path_tmp"]);
-				$content_tmppath_file			= $tp -> replaceConstants($content_pref["content_file_path_tmp"]);
-				$content_tmppath_image			= $tp -> replaceConstants($content_pref["content_image_path_tmp"]);
-
-				if($sql -> db_Select("pcontent", "content_heading", " content_id='".$_POST['parent1']."' ")){
-					$row = $sql -> db_Fetch();
-					$PARENT = $row['content_heading'];
-				}
-				$content_heading	= $tp -> post_toHTML($_POST['content_heading']);
-				$content_subheading	= $tp -> post_toHTML($_POST['content_subheading']);
-				$content_summary	= $tp -> post_toHTML($_POST['content_summary']);
-				$content_text		= $_POST['content_text'];
-				if(e_WYSIWYG){
-					$content_text = $tp->createConstants($content_text); // convert e107_images/ to {e_IMAGE} etc.
-				}
+		$TRPRE = "<tr>";
+		$TRPOST = "</tr>";
+		$TDPRE1 = "<td class='forumheader3' style='vertical-align:top;'>";
+		$TDPRE2 = "<td class='forumheader3' style='vertical-align:top;'>";
+		$TDPOST = "</td>";
+		$CONTENT_CONTENT_PREVIEW = "
+		<table class='fborder' cellpadding='0' cellspacing='0' style='width:90%; text-align:left; margin-bottom:20px;' border='1'>
+			{CONTENT_CONTENT_PREVIEW_CATEGORY}
+			{CONTENT_CONTENT_PREVIEW_HEADING}
+			{CONTENT_CONTENT_PREVIEW_SUBHEADING}
+			{CONTENT_CONTENT_PREVIEW_SUMMARY}
+			{CONTENT_CONTENT_PREVIEW_TEXT}
+			{CONTENT_CONTENT_PREVIEW_AUTHORNAME}
+			{CONTENT_CONTENT_PREVIEW_AUTHOREMAIL}
+			{CONTENT_CONTENT_PREVIEW_STARTDATE}
+			{CONTENT_CONTENT_PREVIEW_ENDDATE}
+			{CONTENT_CONTENT_PREVIEW_COMMENT}
+			{CONTENT_CONTENT_PREVIEW_RATE}
+			{CONTENT_CONTENT_PREVIEW_PE}
+			{CONTENT_CONTENT_PREVIEW_CLASS}
+			{CONTENT_CONTENT_PREVIEW_SCORE}
+			{CONTENT_CONTENT_PREVIEW_META}
+			{CONTENT_CONTENT_PREVIEW_LAYOUT}
+			{CONTENT_CONTENT_PREVIEW_CUSTOM}
+
+			{CONTENT_CONTENT_PREVIEW_PARENT}
+			{CONTENT_CONTENT_PREVIEW_ICON}
+			{CONTENT_CONTENT_PREVIEW_ATTACH}
+			{CONTENT_CONTENT_PREVIEW_IMAGES}
+			{CONTENT_CONTENT_PREVIEW_PAGENAMES}
+		</table>\n";
+
+		$tmp = explode(".",$_POST['parent1']);
+		$_POST['parent1'] = $tmp[1];
+		$mainparent						= $aa -> getMainParent( $_POST['parent1'] );
+		$content_pref					= $aa -> getContentPref($mainparent);
+		$content_cat_icon_path_large	= $tp -> replaceConstants($content_pref["content_cat_icon_path_large"]);
+		$content_cat_icon_path_small	= $tp -> replaceConstants($content_pref["content_cat_icon_path_small"]);
+		$content_icon_path				= $tp -> replaceConstants($content_pref["content_icon_path"]);
+		$content_image_path				= $tp -> replaceConstants($content_pref["content_image_path"]);
+		$content_file_path				= $tp -> replaceConstants($content_pref["content_file_path"]);
 
-				//the problem with tiny_mce is it's storing e_HTTP with an image path, while it should only use the {e_xxx} variables
-				//this small check resolves this, and stores the paths correctly
-				if(strstr($content_text,e_HTTP."{e_")){
-					$content_text = str_replace(e_HTTP."{e_", "{e_", $content_text);
-				}
-				$content_text = $tp->post_toHTML($content_text,TRUE);
-
-				$CONTENT_CONTENT_PREVIEW_CATEGORY = ($_POST['parent1'] ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_57.$TDPOST.$TDPRE2.$PARENT.$TDPOST.$TRPOST : "");
-				$CONTENT_CONTENT_PREVIEW_HEADING = ($content_heading ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_11.$TDPOST.$TDPRE2.$content_heading.$TDPOST.$TRPOST : "");
-				$CONTENT_CONTENT_PREVIEW_SUBHEADING = ($content_subheading ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_16.$TDPOST.$TDPRE2.$content_subheading.$TDPOST.$TRPOST : "");
-				$CONTENT_CONTENT_PREVIEW_SUMMARY = ($content_summary ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_17.$TDPOST.$TDPRE2.$content_summary.$TDPOST.$TRPOST : "");
-				$CONTENT_CONTENT_PREVIEW_TEXT = ($content_text ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_18.$TDPOST.$TDPRE2.$content_text.$TDPOST.$TRPOST : "");
-				$CONTENT_CONTENT_PREVIEW_AUTHORNAME = ($_POST['content_author_name'] ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_10." ".CONTENT_ADMIN_ITEM_LAN_14.$TDPOST.$TDPRE2.$_POST['content_author_name'].$TDPOST.$TRPOST : "");
-				$CONTENT_CONTENT_PREVIEW_AUTHOREMAIL = ($_POST['content_author_email'] ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_10." ".CONTENT_ADMIN_ITEM_LAN_15.$TDPOST.$TDPRE2.$_POST['content_author_email'].$TDPOST.$TRPOST : "");
-				$CONTENT_CONTENT_PREVIEW_COMMENT = $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_36.$TDPOST.$TDPRE2.($_POST['content_comment'] ? CONTENT_ADMIN_ITEM_LAN_85 : CONTENT_ADMIN_ITEM_LAN_86).$TDPOST.$TRPOST;
-				$CONTENT_CONTENT_PREVIEW_RATE = $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_37.$TDPOST.$TDPRE2.($_POST['content_rate'] ? CONTENT_ADMIN_ITEM_LAN_85 : CONTENT_ADMIN_ITEM_LAN_86).$TDPOST.$TRPOST;
-				$CONTENT_CONTENT_PREVIEW_PE = $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_38.$TDPOST.$TDPRE2.($_POST['content_pe'] ? CONTENT_ADMIN_ITEM_LAN_85 : CONTENT_ADMIN_ITEM_LAN_86).$TDPOST.$TRPOST;
-				$CONTENT_CONTENT_PREVIEW_CLASS = $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_39.$TDPOST.$TDPRE2.r_userclass_name($_POST['content_class']).$TDPOST.$TRPOST;
-				$CONTENT_CONTENT_PREVIEW_SCORE = ($_POST['content_score'] ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_40.$TDPOST.$TDPRE2.($_POST['content_score']!="none" ? $_POST['content_score']."/100" : CONTENT_ADMIN_ITEM_LAN_118." ".CONTENT_ADMIN_ITEM_LAN_40." ".CONTENT_ADMIN_ITEM_LAN_119).$TDPOST.$TRPOST : "");
-				$CONTENT_CONTENT_PREVIEW_META = ($_POST['content_meta'] ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_53.$TDPOST.$TDPRE2.($_POST['content_meta']!="" ? $_POST['content_meta'] : CONTENT_ADMIN_ITEM_LAN_118." ".CONTENT_ADMIN_ITEM_LAN_53." ".CONTENT_ADMIN_ITEM_LAN_119).$TDPOST.$TRPOST : "");
-				$CONTENT_CONTENT_PREVIEW_LAYOUT = ($_POST['content_layout'] ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_92.$TDPOST.$TDPRE2.($_POST['content_layout'] == "none" || $_POST['content_layout'] =="content_content_template.php" ? CONTENT_ADMIN_ITEM_LAN_120 : substr($_POST['content_layout'],25 ,-4)).$TDPOST.$TRPOST : "");
-
-				//start date
-				if($_POST['ne_day'] != "none" && $_POST['ne_month'] != "none" && $_POST['ne_year'] != "none"){
-				$CONTENT_CONTENT_PREVIEW_STARTDATE = $TRPRE.$TDPRE1.CONTENT_ADMIN_DATE_LAN_15.$TDPOST.$TDPRE2.$_POST['ne_day']." ".$months[($_POST['ne_month']-1)]." ".$_POST['ne_year'].$TDPOST.$TRPOST;
-				}else{
-				$CONTENT_CONTENT_PREVIEW_STARTDATE = $TRPRE.$TDPRE1.CONTENT_ADMIN_DATE_LAN_15.$TDPOST.$TDPRE2.strftime("%d %b %Y", time()).$TDPOST.$TRPOST;
-				}
-				//end date
-				if($_POST['end_day'] != "none" && $_POST['end_month'] != "none" && $_POST['end_year'] != "none"){
-				$CONTENT_CONTENT_PREVIEW_ENDDATE = $TRPRE.$TDPRE1.CONTENT_ADMIN_DATE_LAN_16.$TDPOST.$TDPRE2.$_POST['end_day']." ".$months[($_POST['end_month']-1)]." ".$_POST['end_year'].$TDPOST.$TRPOST;
-				}else{
-				$CONTENT_CONTENT_PREVIEW_ENDDATE = $TRPRE.$TDPRE1.CONTENT_ADMIN_DATE_LAN_16.$TDPOST.$TDPRE2.CONTENT_ADMIN_ITEM_LAN_118." ".CONTENT_ADMIN_DATE_LAN_16." ".CONTENT_ADMIN_ITEM_LAN_119.$TDPOST.$TRPOST;
-				}
-				$CONTENT_CONTENT_PREVIEW_CUSTOM = "";
-				
-				//custom tags
-				for($i=0;$i<$content_pref["content_admin_custom_number"];$i++){
-				if($_POST["content_custom_key_{$i}"] != "" && $_POST["content_custom_value_{$i}"] != ""){
-				$CONTENT_CONTENT_PREVIEW_CUSTOM .= $TRPRE.$TDPRE1.$_POST["content_custom_key_{$i}"].$TDPOST.$TDPRE2.$_POST["content_custom_value_{$i}"].$TDPOST.$TRPOST;
-				}
-				}
-				//custom preset tags
-				foreach($_POST['content_custom_preset_key'] as $k => $v){
-				if($k != "" && $v != ""){
-				$CONTENT_CONTENT_PREVIEW_CUSTOM .= $TRPRE.$TDPRE1.$k.$TDPOST.$TDPRE2.$v.$TDPOST.$TRPOST;
-				}
-				}
-				
-				//icon
-				if($_POST['content_icon'] && file_exists($content_tmppath_icon.$_POST['content_icon'])){
-					$ICON = "<img src='".$content_tmppath_icon.$_POST['content_icon']."' alt='' style='width:100px; border:0;' />";
-				}elseif($_POST['content_icon'] && file_exists($content_icon_path.$_POST['content_icon'])){
-					$ICON = "<img src='".$content_icon_path.$_POST['content_icon']."' alt='' style='width:100px; border:0;' />";
-				}else{
-					$ICON = CONTENT_ADMIN_ITEM_LAN_118." ".CONTENT_ADMIN_ITEM_LAN_114." ".CONTENT_ADMIN_ITEM_LAN_119;
-				}
-				$CONTENT_CONTENT_PREVIEW_ICON = $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_114.$TDPOST.$TDPRE2.$ICON.$TDPOST.$TRPOST;
+		$content_pref["content_icon_path_tmp"] = ($content_pref["content_icon_path_tmp"] ? $content_pref["content_icon_path_tmp"] : $content_pref["content_icon_path"]."tmp/");
+		$content_pref["content_file_path_tmp"] = ($content_pref["content_file_path_tmp"] ? $content_pref["content_file_path_tmp"] : $content_pref["content_file_path"]."tmp/");
+		$content_pref["content_image_path_tmp"] = ($content_pref["content_image_path_tmp"] ? $content_pref["content_image_path_tmp"] : $content_pref["content_image_path"]."tmp/");
 
-				//images and attachments
-				$file	= FALSE;
-				$image	= FALSE;
-				$ATTACH = $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_24.$TDPOST.$TDPRE2;
-				$IMAGES = $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_31.$TDPOST.$TDPRE2;
-				foreach($_POST as $k => $v){
-					if(strpos($k, "content_files") === 0){
-						if($v && file_exists($content_tmppath_file.$v)){
-							$ATTACH .= CONTENT_ICON_FILE." ".$v."<br />";
-							$file = TRUE;
-						}elseif($v && file_exists($content_file_path.$v)){
-							$ATTACH .= CONTENT_ICON_FILE." ".$v."<br />";
-							$file = TRUE;
-						}
-					}
-					if(strpos($k, "content_images") === 0){
-						if($v && file_exists($content_tmppath_image.$v)){
-							$IMAGES .= "<img src='".$content_tmppath_image.$v."' alt='' style='width:100px; border:0;' /> ";
-							$image	= TRUE;
-						}elseif($v && file_exists($content_image_path.$v)){
-							$IMAGES .= "<img src='".$content_image_path.$v."' alt='' style='width:100px; border:0;' /> ";
-							$image	= TRUE;
-						}
-					}
-				}
-				if($file !== TRUE){
-					$ATTACH .= CONTENT_ADMIN_ITEM_LAN_118." ".CONTENT_ADMIN_ITEM_LAN_24." ".CONTENT_ADMIN_ITEM_LAN_119;
-				}
-				if($image !== TRUE){
-					$IMAGES .= CONTENT_ADMIN_ITEM_LAN_118." ".CONTENT_ADMIN_ITEM_LAN_31." ".CONTENT_ADMIN_ITEM_LAN_119;
-				}
-				$CONTENT_CONTENT_PREVIEW_ATTACH = $ATTACH.$TDPOST.$TRPOST;
-				$CONTENT_CONTENT_PREVIEW_IMAGES = $IMAGES.$TDPOST.$TRPOST;
+		$content_tmppath_icon			= $tp -> replaceConstants($content_pref["content_icon_path_tmp"]);
+		$content_tmppath_file			= $tp -> replaceConstants($content_pref["content_file_path_tmp"]);
+		$content_tmppath_image			= $tp -> replaceConstants($content_pref["content_image_path_tmp"]);
 
-				$caption = CONTENT_ADMIN_ITEM_LAN_46." ".$_POST['content_heading'];
-				$preview = preg_replace("/\{(.*?)\}/e", '$\1', $CONTENT_CONTENT_PREVIEW);
-				$ns -> tablerender($caption, $preview);
-		}
+		if($sql -> db_Select("pcontent", "content_heading", " content_id='".$_POST['parent1']."' ")){
+			$row = $sql -> db_Fetch();
+			$PARENT = $row['content_heading'];
+		}
+		$content_heading	= $tp -> post_toHTML($_POST['content_heading']);
+		$content_subheading	= $tp -> post_toHTML($_POST['content_subheading']);
+		$content_summary	= $tp -> post_toHTML($_POST['content_summary']);
+		$content_text		= $_POST['content_text'];
+		if(e_WYSIWYG){
+			$content_text = $tp->createConstants($content_text); // convert e107_images/ to {e_IMAGE} etc.
+		}
+
+		//the problem with tiny_mce is it's storing e_HTTP with an image path, while it should only use the {e_xxx} variables
+		//this small check resolves this, and stores the paths correctly
+		if(strstr($content_text,e_HTTP."{e_")){
+			$content_text = str_replace(e_HTTP."{e_", "{e_", $content_text);
+		}
+		$content_text = $tp->post_toHTML($content_text,TRUE);
+
+		$CONTENT_CONTENT_PREVIEW_CATEGORY = ($_POST['parent1'] ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_57.$TDPOST.$TDPRE2.$PARENT.$TDPOST.$TRPOST : "");
+		$CONTENT_CONTENT_PREVIEW_HEADING = ($content_heading ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_11.$TDPOST.$TDPRE2.$content_heading.$TDPOST.$TRPOST : "");
+		$CONTENT_CONTENT_PREVIEW_SUBHEADING = ($content_subheading ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_16.$TDPOST.$TDPRE2.$content_subheading.$TDPOST.$TRPOST : "");
+		$CONTENT_CONTENT_PREVIEW_SUMMARY = ($content_summary ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_17.$TDPOST.$TDPRE2.$content_summary.$TDPOST.$TRPOST : "");
+		$CONTENT_CONTENT_PREVIEW_TEXT = ($content_text ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_18.$TDPOST.$TDPRE2.$content_text.$TDPOST.$TRPOST : "");
+		$CONTENT_CONTENT_PREVIEW_AUTHORNAME = ($_POST['content_author_name'] ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_10." ".CONTENT_ADMIN_ITEM_LAN_14.$TDPOST.$TDPRE2.$_POST['content_author_name'].$TDPOST.$TRPOST : "");
+		$CONTENT_CONTENT_PREVIEW_AUTHOREMAIL = ($_POST['content_author_email'] ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_10." ".CONTENT_ADMIN_ITEM_LAN_15.$TDPOST.$TDPRE2.$_POST['content_author_email'].$TDPOST.$TRPOST : "");
+		$CONTENT_CONTENT_PREVIEW_COMMENT = $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_36.$TDPOST.$TDPRE2.($_POST['content_comment'] ? CONTENT_ADMIN_ITEM_LAN_85 : CONTENT_ADMIN_ITEM_LAN_86).$TDPOST.$TRPOST;
+		$CONTENT_CONTENT_PREVIEW_RATE = $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_37.$TDPOST.$TDPRE2.($_POST['content_rate'] ? CONTENT_ADMIN_ITEM_LAN_85 : CONTENT_ADMIN_ITEM_LAN_86).$TDPOST.$TRPOST;
+		$CONTENT_CONTENT_PREVIEW_PE = $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_38.$TDPOST.$TDPRE2.($_POST['content_pe'] ? CONTENT_ADMIN_ITEM_LAN_85 : CONTENT_ADMIN_ITEM_LAN_86).$TDPOST.$TRPOST;
+		$CONTENT_CONTENT_PREVIEW_CLASS = $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_39.$TDPOST.$TDPRE2.r_userclass_name($_POST['content_class']).$TDPOST.$TRPOST;
+		$CONTENT_CONTENT_PREVIEW_SCORE = ($_POST['content_score'] ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_40.$TDPOST.$TDPRE2.($_POST['content_score']!="none" ? $_POST['content_score']."/100" : CONTENT_ADMIN_ITEM_LAN_118." ".CONTENT_ADMIN_ITEM_LAN_40." ".CONTENT_ADMIN_ITEM_LAN_119).$TDPOST.$TRPOST : "");
+		$CONTENT_CONTENT_PREVIEW_META = ($_POST['content_meta'] ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_53.$TDPOST.$TDPRE2.($_POST['content_meta']!="" ? $_POST['content_meta'] : CONTENT_ADMIN_ITEM_LAN_118." ".CONTENT_ADMIN_ITEM_LAN_53." ".CONTENT_ADMIN_ITEM_LAN_119).$TDPOST.$TRPOST : "");
+		$CONTENT_CONTENT_PREVIEW_LAYOUT = ($_POST['content_layout'] ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_92.$TDPOST.$TDPRE2.($_POST['content_layout'] == "none" || $_POST['content_layout'] =="content_content_template.php" ? CONTENT_ADMIN_ITEM_LAN_120 : substr($_POST['content_layout'],25 ,-4)).$TDPOST.$TRPOST : "");
+
+		//start date
+		if($_POST['ne_day'] != "none" && $_POST['ne_month'] != "none" && $_POST['ne_year'] != "none"){
+		$CONTENT_CONTENT_PREVIEW_STARTDATE = $TRPRE.$TDPRE1.CONTENT_ADMIN_DATE_LAN_15.$TDPOST.$TDPRE2.$_POST['ne_day']." ".$months[($_POST['ne_month']-1)]." ".$_POST['ne_year'].$TDPOST.$TRPOST;
+		}else{
+		$CONTENT_CONTENT_PREVIEW_STARTDATE = $TRPRE.$TDPRE1.CONTENT_ADMIN_DATE_LAN_15.$TDPOST.$TDPRE2.strftime("%d %b %Y", time()).$TDPOST.$TRPOST;
+		}
+		//end date
+		if($_POST['end_day'] != "none" && $_POST['end_month'] != "none" && $_POST['end_year'] != "none"){
+		$CONTENT_CONTENT_PREVIEW_ENDDATE = $TRPRE.$TDPRE1.CONTENT_ADMIN_DATE_LAN_16.$TDPOST.$TDPRE2.$_POST['end_day']." ".$months[($_POST['end_month']-1)]." ".$_POST['end_year'].$TDPOST.$TRPOST;
+		}else{
+		$CONTENT_CONTENT_PREVIEW_ENDDATE = $TRPRE.$TDPRE1.CONTENT_ADMIN_DATE_LAN_16.$TDPOST.$TDPRE2.CONTENT_ADMIN_ITEM_LAN_118." ".CONTENT_ADMIN_DATE_LAN_16." ".CONTENT_ADMIN_ITEM_LAN_119.$TDPOST.$TRPOST;
+		}
+		$CONTENT_CONTENT_PREVIEW_CUSTOM = "";
+
+		//custom tags
+		for($i=0;$i<$content_pref["content_admin_custom_number"];$i++){
+		if($_POST["content_custom_key_{$i}"] != "" && $_POST["content_custom_value_{$i}"] != ""){
+		$CONTENT_CONTENT_PREVIEW_CUSTOM .= $TRPRE.$TDPRE1.$_POST["content_custom_key_{$i}"].$TDPOST.$TDPRE2.$_POST["content_custom_value_{$i}"].$TDPOST.$TRPOST;
+		}
+		}
+		//custom preset tags
+		foreach($_POST['content_custom_preset_key'] as $k => $v){
+		if($k != "" && $v != ""){
+		$CONTENT_CONTENT_PREVIEW_CUSTOM .= $TRPRE.$TDPRE1.$k.$TDPOST.$TDPRE2.$v.$TDPOST.$TRPOST;
+		}
+		}
+
+		//icon
+		if($_POST['content_icon'] && file_exists($content_tmppath_icon.$_POST['content_icon'])){
+			$ICON = "<img src='".$content_tmppath_icon.$_POST['content_icon']."' alt='' style='width:100px; border:0;' />";
+		}elseif($_POST['content_icon'] && file_exists($content_icon_path.$_POST['content_icon'])){
+			$ICON = "<img src='".$content_icon_path.$_POST['content_icon']."' alt='' style='width:100px; border:0;' />";
+		}else{
+			$ICON = CONTENT_ADMIN_ITEM_LAN_118." ".CONTENT_ADMIN_ITEM_LAN_114." ".CONTENT_ADMIN_ITEM_LAN_119;
+		}
+		$CONTENT_CONTENT_PREVIEW_ICON = $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_114.$TDPOST.$TDPRE2.$ICON.$TDPOST.$TRPOST;
+
+		//images and attachments
+		$file	= FALSE;
+		$image	= FALSE;
+		$ATTACH = $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_24.$TDPOST.$TDPRE2;
+		$IMAGES = $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_31.$TDPOST.$TDPRE2;
+		foreach($_POST as $k => $v){
+			if(strpos($k, "content_files") === 0){
+				if($v && file_exists($content_tmppath_file.$v)){
+					$ATTACH .= CONTENT_ICON_FILE." ".$v."<br />";
+					$file = TRUE;
+				}elseif($v && file_exists($content_file_path.$v)){
+					$ATTACH .= CONTENT_ICON_FILE." ".$v."<br />";
+					$file = TRUE;
+				}
+			}
+			if(strpos($k, "content_images") === 0){
+				if($v && file_exists($content_tmppath_image.$v)){
+					$IMAGES .= "<img src='".$content_tmppath_image.$v."' alt='' style='width:100px; border:0;' /> ";
+					$image	= TRUE;
+				}elseif($v && file_exists($content_image_path.$v)){
+					$IMAGES .= "<img src='".$content_image_path.$v."' alt='' style='width:100px; border:0;' /> ";
+					$image	= TRUE;
+				}
+			}
+		}
+		if($file !== TRUE){
+			$ATTACH .= CONTENT_ADMIN_ITEM_LAN_118." ".CONTENT_ADMIN_ITEM_LAN_24." ".CONTENT_ADMIN_ITEM_LAN_119;
+		}
+		if($image !== TRUE){
+			$IMAGES .= CONTENT_ADMIN_ITEM_LAN_118." ".CONTENT_ADMIN_ITEM_LAN_31." ".CONTENT_ADMIN_ITEM_LAN_119;
+		}
+		$CONTENT_CONTENT_PREVIEW_ATTACH = $ATTACH.$TDPOST.$TRPOST;
+		$CONTENT_CONTENT_PREVIEW_IMAGES = $IMAGES.$TDPOST.$TRPOST;
+
+		$caption = CONTENT_ADMIN_ITEM_LAN_46." ".$content_heading;
+		$preview = preg_replace("/\{(.*?)\}/e", '$\1', $CONTENT_CONTENT_PREVIEW);
+		$ns -> tablerender($caption, $preview);
+	}
 
 
 
@@ -291,9 +291,9 @@
 			$array						= $aa -> getCategoryTree("", "", FALSE);
 			$mainparent					= $aa -> getMainParent( (isset($qs[3]) && is_numeric($qs[3]) ? $qs[3] : intval($qs[2])) );
 		}
-						
+
 		$content_pref					= $aa -> getContentPref($mainparent);
-						
+
 		$content_pref["content_icon_path_tmp"] = ($content_pref["content_icon_path_tmp"] ? $content_pref["content_icon_path_tmp"] : $content_pref["content_icon_path"]."tmp/");
 		$content_pref["content_file_path_tmp"] = ($content_pref["content_file_path_tmp"] ? $content_pref["content_file_path_tmp"] : $content_pref["content_file_path"]."tmp/");
 		$content_pref["content_image_path_tmp"] = ($content_pref["content_image_path_tmp"] ? $content_pref["content_image_path_tmp"] : $content_pref["content_image_path"]."tmp/");
@@ -329,7 +329,7 @@
 				header("location:".$plugindir."content_submit.php"); exit;
 			}
 		}
-						
+
 						//check manager permissions
 		if($mode == "contentmanager")
 		{
@@ -397,92 +397,92 @@
 		//get preferences for submit page
 		if($mode == "submit")
 		{
-							$checksubheading	= (isset($content_pref["content_submit_subheading"]) ? $content_pref["content_submit_subheading"] : "");
-							$checksummary		= (isset($content_pref["content_submit_summary"]) ? $content_pref["content_submit_summary"] : "");
-							$checkstartdate		= (isset($content_pref["content_submit_startdate"]) ? $content_pref["content_submit_startdate"] : "");
-							$checkenddate		= (isset($content_pref["content_submit_enddate"]) ? $content_pref["content_submit_enddate"] : "");
-							$checkicon			= (isset($content_pref["content_submit_icon"]) ? $content_pref["content_submit_icon"] : "");
-							$checkattach		= (isset($content_pref["content_submit_attach"]) ? $content_pref["content_submit_attach"] : "");
-							$checkattachnumber	= (isset($content_pref["content_submit_files_number"]) ? $content_pref["content_submit_files_number"] : "");
-							$checkimages		= (isset($content_pref["content_submit_images"]) ? $content_pref["content_submit_images"] : "");
-							$checkimagesnumber	= (isset($content_pref["content_submit_images_number"]) ? $content_pref["content_submit_images_number"] : "");
-							$checkcomment		= (isset($content_pref["content_submit_comment"]) ? $content_pref["content_submit_comment"] : "");
-							$checkrating		= (isset($content_pref["content_submit_rating"]) ? $content_pref["content_submit_rating"] : "");
-							$checkscore			= (isset($content_pref["content_submit_score"]) ? $content_pref["content_submit_score"] : "");
-							$checkpe			= (isset($content_pref["content_submit_pe"]) ? $content_pref["content_submit_pe"] : "");
-							$checkvisibility	= (isset($content_pref["content_submit_visibility"]) ? $content_pref["content_submit_visibility"] : "");
-							$checkmeta			= (isset($content_pref["content_submit_meta"]) ? $content_pref["content_submit_meta"] : "");
-							$checkcustom		= (isset($content_pref["content_submit_customtags"]) ? $content_pref["content_submit_customtags"] : "");
-							$checkcustomnumber	= (isset($content_pref["content_submit_custom_number"]) ? $content_pref["content_submit_custom_number"] : "");
-							$checklayout		= (isset($content_pref["content_submit_layout"]) ? $content_pref["content_submit_layout"] : "");
-							$checkpreset		= (isset($content_pref["content_submit_presettags"]) ? $content_pref["content_submit_presettags"] : "");
-						
-						//get preferences for admin area; posted submitted item.
+			$checksubheading	= (isset($content_pref["content_submit_subheading"]) ? $content_pref["content_submit_subheading"] : "");
+			$checksummary		= (isset($content_pref["content_submit_summary"]) ? $content_pref["content_submit_summary"] : "");
+			$checkstartdate		= (isset($content_pref["content_submit_startdate"]) ? $content_pref["content_submit_startdate"] : "");
+			$checkenddate		= (isset($content_pref["content_submit_enddate"]) ? $content_pref["content_submit_enddate"] : "");
+			$checkicon			= (isset($content_pref["content_submit_icon"]) ? $content_pref["content_submit_icon"] : "");
+			$checkattach		= (isset($content_pref["content_submit_attach"]) ? $content_pref["content_submit_attach"] : "");
+			$checkattachnumber	= (isset($content_pref["content_submit_files_number"]) ? $content_pref["content_submit_files_number"] : "");
+			$checkimages		= (isset($content_pref["content_submit_images"]) ? $content_pref["content_submit_images"] : "");
+			$checkimagesnumber	= (isset($content_pref["content_submit_images_number"]) ? $content_pref["content_submit_images_number"] : "");
+			$checkcomment		= (isset($content_pref["content_submit_comment"]) ? $content_pref["content_submit_comment"] : "");
+			$checkrating		= (isset($content_pref["content_submit_rating"]) ? $content_pref["content_submit_rating"] : "");
+			$checkscore			= (isset($content_pref["content_submit_score"]) ? $content_pref["content_submit_score"] : "");
+			$checkpe			= (isset($content_pref["content_submit_pe"]) ? $content_pref["content_submit_pe"] : "");
+			$checkvisibility	= (isset($content_pref["content_submit_visibility"]) ? $content_pref["content_submit_visibility"] : "");
+			$checkmeta			= (isset($content_pref["content_submit_meta"]) ? $content_pref["content_submit_meta"] : "");
+			$checkcustom		= (isset($content_pref["content_submit_customtags"]) ? $content_pref["content_submit_customtags"] : "");
+			$checkcustomnumber	= (isset($content_pref["content_submit_custom_number"]) ? $content_pref["content_submit_custom_number"] : "");
+			$checklayout		= (isset($content_pref["content_submit_layout"]) ? $content_pref["content_submit_layout"] : "");
+			$checkpreset		= (isset($content_pref["content_submit_presettags"]) ? $content_pref["content_submit_presettags"] : "");
+
+		//get preferences for admin area; posted submitted item.
 		}
 		elseif($mode == "sa")
 		{
-							//show all preferences from the submit options. if submit pref is not set, check if create prefs are set and use those
-							$checksubheading = (isset($content_pref["content_submit_subheading"]) ? $content_pref["content_submit_subheading"] : (isset($content_pref["content_admin_subheading"]) ? $content_pref["content_admin_subheading"] : ""));
+			//show all preferences from the submit options. if submit pref is not set, check if create prefs are set and use those
+			$checksubheading = (isset($content_pref["content_submit_subheading"]) ? $content_pref["content_submit_subheading"] : (isset($content_pref["content_admin_subheading"]) ? $content_pref["content_admin_subheading"] : ""));
+
+			$checksummary	= (isset($content_pref["content_submit_summary"]) ? $content_pref["content_submit_summary"] : (isset($content_pref["content_admin_summary"]) ? $content_pref["content_admin_summary"] : ""));
+
+			$checkstartdate = (isset($content_pref["content_submit_startdate"]) ? $content_pref["content_submit_startdate"] : (isset($content_pref["content_admin_startdate"]) ? $content_pref["content_admin_startdate"] : ""));
+
+			$checkenddate = (isset($content_pref["content_submit_enddate"]) ? $content_pref["content_submit_enddate"] : (isset($content_pref["content_admin_enddate"]) ? $content_pref["content_admin_enddate"] : ""));
+
+			$checkicon = (isset($content_pref["content_submit_icon"]) ? $content_pref["content_submit_icon"] : (isset($content_pref["content_admin_icon"]) ? $content_pref["content_admin_icon"] : ""));
+
+			$checkattach = (isset($content_pref["content_submit_attach"]) ? $content_pref["content_submit_attach"] : (isset($content_pref["content_admin_attach"]) ? $content_pref["content_admin_attach"] : ""));
+
+			$checkattachnumber = (isset($content_pref["content_submit_files_number"]) ? $content_pref["content_submit_files_number"] : (isset($content_pref["content_admin_files_number"]) ? $content_pref["content_admin_files_number"] : ""));
+
+			$checkimages = (isset($content_pref["content_submit_images"]) ? $content_pref["content_submit_images"] : (isset($content_pref["content_admin_images"]) ? $content_pref["content_admin_images"] : ""));
+
+			$checkimagesnumber = (isset($content_pref["content_submit_images_number"]) ? $content_pref["content_submit_images_number"] : (isset($content_pref["content_admin_images_number"]) ? $content_pref["content_admin_images_number"] : ""));
+
+			$checkcomment = (isset($content_pref["content_submit_comment"]) ? $content_pref["content_submit_comment"] : (isset($content_pref["content_admin_comment"]) ? $content_pref["content_admin_comment"] : ""));
+
+			$checkrating = (isset($content_pref["content_submit_rating"]) ? $content_pref["content_submit_rating"] : (isset($content_pref["content_admin_rating"]) ? $content_pref["content_admin_rating"] : ""));
+
+			$checkscore = (isset($content_pref["content_submit_score"]) ? $content_pref["content_submit_score"] : (isset($content_pref["content_admin_score"]) ? $content_pref["content_admin_score"] : ""));
 
-							$checksummary	= (isset($content_pref["content_submit_summary"]) ? $content_pref["content_submit_summary"] : (isset($content_pref["content_admin_summary"]) ? $content_pref["content_admin_summary"] : ""));
+			$checkpe = (isset($content_pref["content_submit_pe"]) ? $content_pref["content_submit_pe"] : (isset($content_pref["content_admin_pe"]) ? $content_pref["content_admin_pe"] : ""));
 
-							$checkstartdate = (isset($content_pref["content_submit_startdate"]) ? $content_pref["content_submit_startdate"] : (isset($content_pref["content_admin_startdate"]) ? $content_pref["content_admin_startdate"] : ""));
-							
-							$checkenddate = (isset($content_pref["content_submit_enddate"]) ? $content_pref["content_submit_enddate"] : (isset($content_pref["content_admin_enddate"]) ? $content_pref["content_admin_enddate"] : ""));
-							
-							$checkicon = (isset($content_pref["content_submit_icon"]) ? $content_pref["content_submit_icon"] : (isset($content_pref["content_admin_icon"]) ? $content_pref["content_admin_icon"] : ""));
-							
-							$checkattach = (isset($content_pref["content_submit_attach"]) ? $content_pref["content_submit_attach"] : (isset($content_pref["content_admin_attach"]) ? $content_pref["content_admin_attach"] : ""));
-							
-							$checkattachnumber = (isset($content_pref["content_submit_files_number"]) ? $content_pref["content_submit_files_number"] : (isset($content_pref["content_admin_files_number"]) ? $content_pref["content_admin_files_number"] : ""));
-							
-							$checkimages = (isset($content_pref["content_submit_images"]) ? $content_pref["content_submit_images"] : (isset($content_pref["content_admin_images"]) ? $content_pref["content_admin_images"] : ""));
-							
-							$checkimagesnumber = (isset($content_pref["content_submit_images_number"]) ? $content_pref["content_submit_images_number"] : (isset($content_pref["content_admin_images_number"]) ? $content_pref["content_admin_images_number"] : ""));
-							
-							$checkcomment = (isset($content_pref["content_submit_comment"]) ? $content_pref["content_submit_comment"] : (isset($content_pref["content_admin_comment"]) ? $content_pref["content_admin_comment"] : ""));
-							
-							$checkrating = (isset($content_pref["content_submit_rating"]) ? $content_pref["content_submit_rating"] : (isset($content_pref["content_admin_rating"]) ? $content_pref["content_admin_rating"] : ""));
-							
-							$checkscore = (isset($content_pref["content_submit_score"]) ? $content_pref["content_submit_score"] : (isset($content_pref["content_admin_score"]) ? $content_pref["content_admin_score"] : ""));
-							
-							$checkpe = (isset($content_pref["content_submit_pe"]) ? $content_pref["content_submit_pe"] : (isset($content_pref["content_admin_pe"]) ? $content_pref["content_admin_pe"] : ""));
-							
-							$checkvisibility = (isset($content_pref["content_submit_visibility"]) ? $content_pref["content_submit_visibility"] : (isset($content_pref["content_admin_visibility"]) ? $content_pref["content_admin_visibility"] : ""));
-							
-							$checkmeta = (isset($content_pref["content_submit_meta"]) ? $content_pref["content_submit_meta"] : (isset($content_pref["content_admin_meta"]) ? $content_pref["content_admin_meta"] : ""));
-							
-							$checkcustom = (isset($content_pref["content_submit_customtags"]) ? $content_pref["content_submit_customtags"] : (isset($content_pref["content_admin_customtags"]) ? $content_pref["content_admin_customtags"] : ""));
-							
-							$checkcustomnumber = (isset($content_pref["content_submit_custom_number"]) && $content_pref["content_submit_custom_number"] != "0" ? $content_pref["content_submit_custom_number"] : (isset($content_pref["content_admin_custom_number"]) ? $content_pref["content_admin_custom_number"] : ""));
-							
-							$checklayout = (isset($content_pref["content_submit_layout"]) ? $content_pref["content_submit_layout"] : (isset($content_pref["content_admin_layout"]) ? $content_pref["content_admin_layout"] : ""));
+			$checkvisibility = (isset($content_pref["content_submit_visibility"]) ? $content_pref["content_submit_visibility"] : (isset($content_pref["content_admin_visibility"]) ? $content_pref["content_admin_visibility"] : ""));
 
-							$checkpreset = (isset($content_pref["content_submit_presettags"]) ? $content_pref["content_submit_presettags"] : (isset($content_pref["content_admin_presettags"]) ? $content_pref["content_admin_presettags"] : ""));
+			$checkmeta = (isset($content_pref["content_submit_meta"]) ? $content_pref["content_submit_meta"] : (isset($content_pref["content_admin_meta"]) ? $content_pref["content_admin_meta"] : ""));
+
+			$checkcustom = (isset($content_pref["content_submit_customtags"]) ? $content_pref["content_submit_customtags"] : (isset($content_pref["content_admin_customtags"]) ? $content_pref["content_admin_customtags"] : ""));
+
+			$checkcustomnumber = (isset($content_pref["content_submit_custom_number"]) && $content_pref["content_submit_custom_number"] != "0" ? $content_pref["content_submit_custom_number"] : (isset($content_pref["content_admin_custom_number"]) ? $content_pref["content_admin_custom_number"] : ""));
+
+			$checklayout = (isset($content_pref["content_submit_layout"]) ? $content_pref["content_submit_layout"] : (isset($content_pref["content_admin_layout"]) ? $content_pref["content_admin_layout"] : ""));
+
+			$checkpreset = (isset($content_pref["content_submit_presettags"]) ? $content_pref["content_submit_presettags"] : (isset($content_pref["content_admin_presettags"]) ? $content_pref["content_admin_presettags"] : ""));
 
 		//normal admin content create preferences
 		}
 		else
 		{
-							$checksubheading	= (isset($content_pref["content_admin_subheading"]) ? $content_pref["content_admin_subheading"] : "");
-							$checksummary		= (isset($content_pref["content_admin_summary"]) ? $content_pref["content_admin_summary"] : "");
-							$checkstartdate		= (isset($content_pref["content_admin_startdate"]) ? $content_pref["content_admin_startdate"] : "");
-							$checkenddate		= (isset($content_pref["content_admin_enddate"]) ? $content_pref["content_admin_enddate"] : "");
-							$checkicon			= (isset($content_pref["content_admin_icon"]) ? $content_pref["content_admin_icon"] : "");
-							$checkattach		= (isset($content_pref["content_admin_attach"]) ? $content_pref["content_admin_attach"] : "");
-							$checkattachnumber	= (isset($content_pref["content_admin_files_number"]) ? $content_pref["content_admin_files_number"] : "");
-							$checkimages		= (isset($content_pref["content_admin_images"]) ? $content_pref["content_admin_images"] : "");
-							$checkimagesnumber	= (isset($content_pref["content_admin_images_number"]) ? $content_pref["content_admin_images_number"] : "");
-							$checkcomment		= (isset($content_pref["content_admin_comment"]) ? $content_pref["content_admin_comment"] : "");
-							$checkrating		= (isset($content_pref["content_admin_rating"]) ? $content_pref["content_admin_rating"] : "");
-							$checkscore			= (isset($content_pref["content_admin_score"]) ? $content_pref["content_admin_score"] : "");
-							$checkpe			= (isset($content_pref["content_admin_pe"]) ? $content_pref["content_admin_pe"] : "");
-							$checkvisibility	= (isset($content_pref["content_admin_visibility"]) ? $content_pref["content_admin_visibility"] : "");
-							$checkmeta			= (isset($content_pref["content_admin_meta"]) ? $content_pref["content_admin_meta"] : "");
-							$checkcustom		= (isset($content_pref["content_admin_customtags"]) ? $content_pref["content_admin_customtags"] : "");
-							$checkcustomnumber	= (isset($content_pref["content_admin_custom_number"]) ? $content_pref["content_admin_custom_number"] : "");
-							$checklayout		= (isset($content_pref["content_admin_layout"]) ? $content_pref["content_admin_layout"] : "");
-							$checkpreset		= (isset($content_pref["content_admin_presettags"]) ? $content_pref["content_admin_presettags"] : "");
+			$checksubheading	= (isset($content_pref["content_admin_subheading"]) ? $content_pref["content_admin_subheading"] : "");
+			$checksummary		= (isset($content_pref["content_admin_summary"]) ? $content_pref["content_admin_summary"] : "");
+			$checkstartdate		= (isset($content_pref["content_admin_startdate"]) ? $content_pref["content_admin_startdate"] : "");
+			$checkenddate		= (isset($content_pref["content_admin_enddate"]) ? $content_pref["content_admin_enddate"] : "");
+			$checkicon			= (isset($content_pref["content_admin_icon"]) ? $content_pref["content_admin_icon"] : "");
+			$checkattach		= (isset($content_pref["content_admin_attach"]) ? $content_pref["content_admin_attach"] : "");
+			$checkattachnumber	= (isset($content_pref["content_admin_files_number"]) ? $content_pref["content_admin_files_number"] : "");
+			$checkimages		= (isset($content_pref["content_admin_images"]) ? $content_pref["content_admin_images"] : "");
+			$checkimagesnumber	= (isset($content_pref["content_admin_images_number"]) ? $content_pref["content_admin_images_number"] : "");
+			$checkcomment		= (isset($content_pref["content_admin_comment"]) ? $content_pref["content_admin_comment"] : "");
+			$checkrating		= (isset($content_pref["content_admin_rating"]) ? $content_pref["content_admin_rating"] : "");
+			$checkscore			= (isset($content_pref["content_admin_score"]) ? $content_pref["content_admin_score"] : "");
+			$checkpe			= (isset($content_pref["content_admin_pe"]) ? $content_pref["content_admin_pe"] : "");
+			$checkvisibility	= (isset($content_pref["content_admin_visibility"]) ? $content_pref["content_admin_visibility"] : "");
+			$checkmeta			= (isset($content_pref["content_admin_meta"]) ? $content_pref["content_admin_meta"] : "");
+			$checkcustom		= (isset($content_pref["content_admin_customtags"]) ? $content_pref["content_admin_customtags"] : "");
+			$checkcustomnumber	= (isset($content_pref["content_admin_custom_number"]) ? $content_pref["content_admin_custom_number"] : "");
+			$checklayout		= (isset($content_pref["content_admin_layout"]) ? $content_pref["content_admin_layout"] : "");
+			$checkpreset		= (isset($content_pref["content_admin_presettags"]) ? $content_pref["content_admin_presettags"] : "");
 		}
 		if($mode == "contentmanager")
 		{ // used in contentmanager
@@ -526,674 +526,684 @@
 		//re-prepare the posted fields for the form (after preview)
 		if ( isset($_POST['preview_content']) || isset($message) )
 		{
-								$row['content_parent']				= $_POST['parent1'];
-								$row['content_heading']				= $tp -> post_toForm($_POST['content_heading']);
-								$row['content_subheading']			= $tp -> post_toForm($_POST['content_subheading']);
-								$row['content_summary']				= $tp -> post_toForm($_POST['content_summary']);
-								$row['content_text']				= $tp -> post_toForm($_POST['content_text']);
-								$authordetails[0]					= $_POST['content_author_id'];
-								$authordetails[1]					= $_POST['content_author_name'];
-								$authordetails[2]					= $_POST['content_author_email'];
-								$ne_day								= $_POST['ne_day'];
-								$ne_month							= $_POST['ne_month'];
-								$ne_year							= $_POST['ne_year'];
-								$end_day							= $_POST['end_day'];
-								$end_month							= $_POST['end_month'];
-								$end_year							= $_POST['end_year'];
-								$row['content_comment']				= $_POST['content_comment'];
-								$row['content_rate']				= $_POST['content_rate'];
-								$row['content_pe']					= $_POST['content_pe'];
-								$row['content_class']				= $_POST['content_class'];
-								$row['content_refer']				= $_POST['content_refer'];
-								$row['content_datestamp']			= $_POST['content_datestamp'];
-								$row['content_score']				= $_POST['content_score'];
-								$row['content_meta']				= $_POST['content_meta'];
-								$row['content_layout']				= $_POST['content_layout'];
-								$row['content_icon']				= $_POST['content_icon'];
-
-								//images and attachments
-								foreach($_POST as $k => $v){
-									if(strpos($k, "content_files") === 0){
-										$row['content_file'] .= "[file]".$v;
-									}
-									if(strpos($k, "content_images") === 0){
-										$row['content_image'] .= "[img]".$v;
-									}
-								}
-								//custom tags
-								for($i=0;$i<$content_pref["content_admin_custom_number"];$i++){
-									$keystring = $tp -> post_toForm($_POST["content_custom_key_{$i}"]);
-									$custom["content_custom_{$keystring}"] = $tp -> post_toForm($_POST["content_custom_value_{$i}"]);
-								}
-								//preset tags
-								foreach($_POST['content_custom_preset_key'] as $k => $v){
-									$k = $tp -> post_toForm($k);
-									$custom['content_custom_presettags'][$k] = $tp -> post_toForm($v);
-								}
+			$row['content_parent']				= $_POST['parent1'];
+			$row['content_heading']				= $tp -> post_toForm($_POST['content_heading']);
+			$row['content_subheading']			= $tp -> post_toForm($_POST['content_subheading']);
+			$row['content_summary']				= $tp -> post_toForm($_POST['content_summary']);
+			$row['content_text']				= $tp -> post_toForm($_POST['content_text']);
+			$authordetails[0]					= $_POST['content_author_id'];
+			$authordetails[1]					= $_POST['content_author_name'];
+			$authordetails[2]					= $_POST['content_author_email'];
+			$ne_day								= $_POST['ne_day'];
+			$ne_month							= $_POST['ne_month'];
+			$ne_year							= $_POST['ne_year'];
+			$end_day							= $_POST['end_day'];
+			$end_month							= $_POST['end_month'];
+			$end_year							= $_POST['end_year'];
+			$row['content_comment']				= $_POST['content_comment'];
+			$row['content_rate']				= $_POST['content_rate'];
+			$row['content_pe']					= $_POST['content_pe'];
+			$row['content_class']				= $_POST['content_class'];
+			$row['content_refer']				= $_POST['content_refer'];
+			$row['content_datestamp']			= $_POST['content_datestamp'];
+			$row['content_score']				= $_POST['content_score'];
+			$row['content_meta']				= $_POST['content_meta'];
+			$row['content_layout']				= $_POST['content_layout'];
+			$row['content_icon']				= $_POST['content_icon'];
+
+			//images and attachments
+			foreach($_POST as $k => $v){
+				if(strpos($k, "content_files") === 0){
+					$row['content_file'] .= "[file]".$v;
+				}
+				if(strpos($k, "content_images") === 0){
+					$row['content_image'] .= "[img]".$v;
+				}
+			}
+			//custom tags
+			for($i=0;$i<$content_pref["content_admin_custom_number"];$i++){
+				$keystring = $tp -> post_toForm($_POST["content_custom_key_{$i}"]);
+				$custom["content_custom_{$keystring}"] = $tp -> post_toForm($_POST["content_custom_value_{$i}"]);
+			}
+			//preset tags
+			foreach($_POST['content_custom_preset_key'] as $k => $v){
+				$k = $tp -> post_toForm($k);
+				$custom['content_custom_presettags'][$k] = $tp -> post_toForm($v);
+			}
 		}
 
 		$content_author_id		= (isset($authordetails[0]) && $authordetails[0] != "" ? $authordetails[0] : USERID);
 		$content_author_name	= (isset($authordetails[1]) && $authordetails[1] != "" ? $authordetails[1] : USERNAME);
 		$content_author_email	= (isset($authordetails[2]) ? $authordetails[2] : USEREMAIL);
 
-						$formurl = e_SELF."?".e_QUERY;
-						$text = "
-						<div style='text-align:center;'>
-						".$rs -> form_open("post", $formurl, "dataform", "", "enctype='multipart/form-data'")."
-						<table style='".$tableprop." ".ADMIN_WIDTH."' class='fborder'>";
+		$formurl = e_SELF."?".e_QUERY;
+		$text = "
+		<div style='text-align:center;'>
+		".$rs -> form_open("post", $formurl, "dataform", "", "enctype='multipart/form-data'")."
+		<table style='".$tableprop." ".ADMIN_WIDTH."' class='fborder'>";
 
-						$hidden = "";
-						if($mode == "contentmanager")
-						{
-							if($qs[1] == "edit")
-							{
-								$hidden .= $rs -> form_hidden("parent1", $row['content_parent']);
-								$hidden .= $rs -> form_hidden("preview_parent1", varset($_POST['preview_parent1'],$row['content_parent']));
+		$hidden = "";
+		if($mode == "contentmanager")
+		{
+			if($qs[1] == "edit")
+			{
+				$hidden .= $rs -> form_hidden("parent1", $row['content_parent']);
+				$hidden .= $rs -> form_hidden("preview_parent1", varset($_POST['preview_parent1'],$row['content_parent']));
 //								echo "CM Edit mode parent1 post: {$_POST['parent1']},{$_POST['preview_parent1']},{$row['content_parent']}<br />";
-							}
-							else
-							{
-								$hidden .= $rs -> form_hidden("parent1", intval($qs[2]));
-							}
-						}
-						else
-						{
-							if($mode == "submit")
-							{
-								$parent = "submit";
-							}
-							else
-							{
-								$parent = (isset($qs[3]) && is_numeric($qs[3]) ? $qs[3] : (isset($row['content_parent']) ? $row['content_parent'] : "") );
-							}
-							//category parent
-							$TOPIC_TOPIC = CONTENT_ADMIN_CAT_LAN_27;
-							$TOPIC_FIELD = $aa -> ShowOption($parent, "createcontent");
-							$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
-							//$text .= $TOPIC_ROW_SPACER;
-						}
+			}
+			else
+			{
+				$hidden .= $rs -> form_hidden("parent1", intval($qs[2]));
+			}
+		}
+		else
+		{
+			if($mode == "submit")
+			{
+				$parent = "submit";
+			}
+			else
+			{
+				$parent = (isset($qs[3]) && is_numeric($qs[3]) ? $qs[3] : (isset($row['content_parent']) ? $row['content_parent'] : "") );
+			}
+			//category parent
+			$TOPIC_TOPIC = CONTENT_ADMIN_CAT_LAN_27;
+			$TOPIC_FIELD = $aa -> ShowOption($parent, "createcontent");
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+			//$text .= $TOPIC_ROW_SPACER;
+		}
 
-						//heading
-						$row['content_heading'] = (isset($row['content_heading']) ? $row['content_heading'] : "");
-						$TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_11;
-						$TOPIC_FIELD = $rs -> form_text("content_heading", 74, $row['content_heading'], 250);
-						$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
-
-						if($checksubheading){
-							//subheading
-							$row['content_subheading'] = (isset($row['content_subheading']) ? $row['content_subheading'] : "");
-							$TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_16;
-							$TOPIC_FIELD = $rs -> form_text("content_subheading", 74, $row['content_subheading'], 250);
-							$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
-						}else{
-							$hidden .= $rs -> form_hidden("content_subheading", $row['content_subheading']);
-						}
-						
-						if($checksummary){
-							//summary
-							$row['content_summary'] = (isset($row['content_summary']) ? $row['content_summary'] : "");
-							$TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_17;
-							$TOPIC_FIELD = $rs -> form_textarea("content_summary", 74, 5, $row['content_summary']);
-							$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
-						}else{
-							$hidden .= $rs -> form_hidden("content_summary", $row['content_summary']);
-						}
+		//heading
+		$row['content_heading'] = (isset($row['content_heading']) ? $row['content_heading'] : "");
+		$TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_11;
+		$TOPIC_FIELD = $rs -> form_text("content_heading", 74, $row['content_heading'], 250);
+		$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
 
-						//text
-						if(e_WYSIWYG){
-							$row['content_text'] = $tp->replaceConstants($row['content_text'], true);
-						}
-						require_once(e_HANDLER."ren_help.php");
-						$TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_18;
-						$insertjs = (!e_WYSIWYG) ? "onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'": "";
-						$TOPIC_FIELD = $rs -> form_textarea("content_text", 74, 20, $row['content_text'], $insertjs)."<br />";
-						if (!$pref['wysiwyg']) { $TOPIC_FIELD .= $rs -> form_text("helpb", 90, '', '', "helpbox")."<br />".display_help("helpb"); }
-						$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
-
-						//author
-						$content_author_name_value	= ($content_author_name ? $content_author_name : CONTENT_ADMIN_ITEM_LAN_14);
-						$content_author_name_js		= ($content_author_name ? "" : "onfocus=\"if(document.getElementById('dataform').content_author_name.value=='".CONTENT_ADMIN_ITEM_LAN_14."'){document.getElementById('dataform').content_author_name.value='';}\"");
-						$content_author_email_value	= ($content_author_email ? $content_author_email : CONTENT_ADMIN_ITEM_LAN_15);
-						$content_author_email_js	= ($content_author_email ? "" : "onfocus=\"if(document.getElementById('dataform').content_author_email.value=='".CONTENT_ADMIN_ITEM_LAN_15."'){document.getElementById('dataform').content_author_email.value='';}\"");
-
-						$TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_51;
-						$TOPIC_FIELD = "(".CONTENT_ADMIN_ITEM_LAN_71.")<br />
-							<table style='width:100%; text-align:left;'>
-							<tr><td>".CONTENT_ADMIN_ITEM_LAN_14."</td><td>".$rs -> form_text("content_author_name", 70, $content_author_name_value, 100, "tbox", "", "", $content_author_name_js )."</td></tr>
-							<tr><td>".CONTENT_ADMIN_ITEM_LAN_15."</td><td>".$rs -> form_text("content_author_email", 70, $content_author_email_value, 100, "tbox", "", "", $content_author_email_js )."
-							".$rs -> form_hidden("content_author_id", $content_author_id)."
-							</td></tr></table>";
-						$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
-
-						if(isset($row['content_datestamp']) && $row['content_datestamp'] != "0" && $row['content_datestamp'] != ""){
-							$startdate	= getdate($row['content_datestamp']);
-							$ne_day		= $startdate['mday'];
-							$ne_month	= $startdate['mon'];
-							$ne_year	= $startdate['year'];
-						}else{
-							$ne_day		= (isset($ne_day) ? $ne_day : "0");
-							$ne_month	= (isset($ne_month) ? $ne_month : "0");
-							$ne_year	= (isset($ne_year) ? $ne_year : "0");
-						}
+		if($checksubheading){
+			//subheading
+			$row['content_subheading'] = (isset($row['content_subheading']) ? $row['content_subheading'] : "");
+			$TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_16;
+			$TOPIC_FIELD = $rs -> form_text("content_subheading", 74, $row['content_subheading'], 250);
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+		}else{
+			$hidden .= $rs -> form_hidden("content_subheading", $row['content_subheading']);
+		}
 
-						$smarray = getdate();
-						$current_year = $smarray['year'];
+		if($checksummary)
+		{
+			//summary
+			$row['content_summary'] = (isset($row['content_summary']) ? $row['content_summary'] : "");
+			$TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_17;
+			$TOPIC_FIELD = $rs -> form_textarea("content_summary", 74, 5, $row['content_summary']);
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+		}else{
+			$hidden .= $rs -> form_hidden("content_summary", $row['content_summary']);
+		}
+
+		//text
+		if(e_WYSIWYG){
+			$row['content_text'] = $tp->replaceConstants($row['content_text'], true);
+		}
+		require_once(e_HANDLER."ren_help.php");
+		$TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_18;
+		$insertjs = (!e_WYSIWYG) ? "onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'": "";
+		$TOPIC_FIELD = $rs -> form_textarea("content_text", 74, 20, $row['content_text'], $insertjs)."<br />";
+		if (!$pref['wysiwyg']) { $TOPIC_FIELD .= $rs -> form_text("helpb", 90, '', '', "helpbox")."<br />".display_help("helpb"); }
+		$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+		//author
+		$content_author_name_value	= ($content_author_name ? $content_author_name : CONTENT_ADMIN_ITEM_LAN_14);
+		$content_author_name_js		= ($content_author_name ? "" : "onfocus=\"if(document.getElementById('dataform').content_author_name.value=='".CONTENT_ADMIN_ITEM_LAN_14."'){document.getElementById('dataform').content_author_name.value='';}\"");
+		$content_author_email_value	= ($content_author_email ? $content_author_email : CONTENT_ADMIN_ITEM_LAN_15);
+		$content_author_email_js	= ($content_author_email ? "" : "onfocus=\"if(document.getElementById('dataform').content_author_email.value=='".CONTENT_ADMIN_ITEM_LAN_15."'){document.getElementById('dataform').content_author_email.value='';}\"");
+
+		$TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_51;
+		$TOPIC_FIELD = "(".CONTENT_ADMIN_ITEM_LAN_71.")<br />
+			<table style='width:100%; text-align:left;'>
+			<tr><td>".CONTENT_ADMIN_ITEM_LAN_14."</td><td>".$rs -> form_text("content_author_name", 70, $content_author_name_value, 100, "tbox", "", "", $content_author_name_js )."</td></tr>
+			<tr><td>".CONTENT_ADMIN_ITEM_LAN_15."</td><td>".$rs -> form_text("content_author_email", 70, $content_author_email_value, 100, "tbox", "", "", $content_author_email_js )."
+			".$rs -> form_hidden("content_author_id", $content_author_id)."
+			</td></tr></table>";
+		$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
 
-						if($checkstartdate){
-							//start date
-							$TOPIC_TOPIC = CONTENT_ADMIN_DATE_LAN_15;
-							$TOPIC_HEADING = CONTENT_ADMIN_ITEM_LAN_73;
-							$TOPIC_HELP = CONTENT_ADMIN_DATE_LAN_17;
-							$TOPIC_FIELD = "
-								".$rs -> form_select_open("ne_day")."
-								".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_12, 0, "none");
-								for($count=1; $count<=31; $count++){
-									$TOPIC_FIELD .= $rs -> form_option($count, (isset($ne_day) && $ne_day == $count ? "1" : "0"), $count);
-								}
-								$TOPIC_FIELD .= $rs -> form_select_close()."
-								".$rs -> form_select_open("ne_month")."
-								".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_13, 0, "none");
-								for($count=1; $count<=12; $count++){
-									$TOPIC_FIELD .= $rs -> form_option($months[($count-1)], (isset($ne_month) && $ne_month == $count ? "1" : "0"), $count);
-								}
-								$TOPIC_FIELD .= $rs -> form_select_close()."
-								".$rs -> form_select_open("ne_year")."
-								".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_14, 0, "none");
-								for($count=($current_year-5); $count<=($current_year+1); $count++){
-									$TOPIC_FIELD .= $rs -> form_option($count, (isset($ne_year) && $ne_year == $count ? "1" : "0"), $count);
-								}
-								$TOPIC_FIELD .= $rs -> form_select_close()."
-							";
-							$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
-						}else{
-							$hidden .= $rs -> form_hidden("ne_day", $ne_day);
-							$hidden .= $rs -> form_hidden("ne_month", $ne_month);
-							$hidden .= $rs -> form_hidden("ne_year", $ne_year);
-						}
+		if(isset($row['content_datestamp']) && $row['content_datestamp'] != "0" && $row['content_datestamp'] != ""){
+			$startdate	= getdate($row['content_datestamp']);
+			$ne_day		= $startdate['mday'];
+			$ne_month	= $startdate['mon'];
+			$ne_year	= $startdate['year'];
+		}else{
+			$ne_day		= (isset($ne_day) ? $ne_day : "0");
+			$ne_month	= (isset($ne_month) ? $ne_month : "0");
+			$ne_year	= (isset($ne_year) ? $ne_year : "0");
+		}
 
+		$smarray = getdate();
+		$current_year = $smarray['year'];
 
-						if(isset($row['content_enddate']) && $row['content_enddate'] != "0" && $row['content_enddate'] != ""){
-							$enddate	= getdate($row['content_enddate']);
-							$end_day	= $enddate['mday'];
-							$end_month	= $enddate['mon'];
-							$end_year	= $enddate['year'];
-						}else{
-							$end_day	= (isset($end_day) ? $end_day : "0");
-							$end_month	= (isset($end_month) ? $end_month : "0");
-							$end_year	= (isset($end_year) ? $end_year : "0");
-						}
+		if($checkstartdate)
+		{
+			//start date
+			$TOPIC_TOPIC = CONTENT_ADMIN_DATE_LAN_15;
+			$TOPIC_HEADING = CONTENT_ADMIN_ITEM_LAN_73;
+			$TOPIC_HELP = CONTENT_ADMIN_DATE_LAN_17;
+			$TOPIC_FIELD = "
+				".$rs -> form_select_open("ne_day")."
+				".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_12, 0, "none");
+				for($count=1; $count<=31; $count++){
+					$TOPIC_FIELD .= $rs -> form_option($count, (isset($ne_day) && $ne_day == $count ? "1" : "0"), $count);
+				}
+				$TOPIC_FIELD .= $rs -> form_select_close()."
+				".$rs -> form_select_open("ne_month")."
+				".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_13, 0, "none");
+				for($count=1; $count<=12; $count++){
+					$TOPIC_FIELD .= $rs -> form_option($months[($count-1)], (isset($ne_month) && $ne_month == $count ? "1" : "0"), $count);
+				}
+				$TOPIC_FIELD .= $rs -> form_select_close()."
+				".$rs -> form_select_open("ne_year")."
+				".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_14, 0, "none");
+				for($count=($current_year-5); $count<=($current_year+1); $count++){
+					$TOPIC_FIELD .= $rs -> form_option($count, (isset($ne_year) && $ne_year == $count ? "1" : "0"), $count);
+				}
+				$TOPIC_FIELD .= $rs -> form_select_close()."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+		}else{
+			$hidden .= $rs -> form_hidden("ne_day", $ne_day);
+			$hidden .= $rs -> form_hidden("ne_month", $ne_month);
+			$hidden .= $rs -> form_hidden("ne_year", $ne_year);
+		}
 
-						if($checkenddate){
-							//end date
-							$TOPIC_TOPIC = CONTENT_ADMIN_DATE_LAN_16;
-							$TOPIC_HEADING = CONTENT_ADMIN_ITEM_LAN_74;
-							$TOPIC_HELP = CONTENT_ADMIN_DATE_LAN_18;
-							$TOPIC_FIELD = "
-								".$rs -> form_select_open("end_day")."
-								".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_12, 0, "none");
-								for($count=1; $count<=31; $count++){
-									$TOPIC_FIELD .= $rs -> form_option($count, (isset($end_day) && $end_day == $count ? "1" : "0"), $count);
-								}
-								$TOPIC_FIELD .= $rs -> form_select_close()."
-								".$rs -> form_select_open("end_month")."
-								".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_13, 0, "none");
-								for($count=1; $count<=12; $count++){
-									$TOPIC_FIELD .= $rs -> form_option($months[($count-1)], (isset($end_month) && $end_month == $count ? "1" : "0"), $count);
-								}
-								$TOPIC_FIELD .= $rs -> form_select_close()."
-								".$rs -> form_select_open("end_year")."
-								".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_14, 0, "none");
-								for($count=($current_year-5); $count<=($current_year+1); $count++){
-									$TOPIC_FIELD .= $rs -> form_option($count, (isset($end_year) && $end_year == $count ? "1" : "0"), $count);
-								}
-								$TOPIC_FIELD .= $rs -> form_select_close()."
-							";
-							$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
-						}else{
-							$hidden .= $rs -> form_hidden("end_day", $end_day);
-							$hidden .= $rs -> form_hidden("end_month", $end_month);
-							$hidden .= $rs -> form_hidden("end_year", $end_year);
-						}
 
-						//$text .= $TOPIC_ROW_SPACER;
-						if( $checkicon || $checkattach || $checkimages ){
-							//$text .= $TOPIC_ROW_SPACER;
-
-							//upload icon
-							$TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_104;
-							$TOPIC_HEADING = CONTENT_ADMIN_ITEM_LAN_112;
-							$TOPIC_HELP = CONTENT_ADMIN_ITEM_LAN_113;
-							
-							$rejectlist			= array('$.','$..','/','CVS','thumbs.db','Thumbs.db','*._$', 'index', 'null*', 'thumb_*');
-							$iconlist			= $fl->get_files($content_tmppath_icon,"",$rejectlist);
-							$filelist			= $fl->get_files($content_tmppath_file,"",$rejectlist);
-							$imagelist			= $fl->get_files($content_tmppath_image,"",$rejectlist);
-
-							$TOPIC_FIELD = "";
-							if(!FILE_UPLOADS){
-								$TOPIC_FIELD .= "<b>".CONTENT_ADMIN_ITEM_LAN_21."</b>";
-							}else{
-								if(!is_writable($content_tmppath_icon)){
-									$TOPIC_FIELD .= "<b>".CONTENT_ADMIN_ITEM_LAN_22." ".$content_tmppath_icon." ".CONTENT_ADMIN_ITEM_LAN_23."</b><br />";
-								}
-								if(!is_writable($content_tmppath_file)){
-									$TOPIC_FIELD .= "<b>".CONTENT_ADMIN_ITEM_LAN_22." ".$content_tmppath_file." ".CONTENT_ADMIN_ITEM_LAN_23."</b><br />";
-								}
-								if(!is_writable($content_tmppath_image)){
-									$TOPIC_FIELD .= "<b>".CONTENT_ADMIN_ITEM_LAN_22." ".$content_tmppath_image." ".CONTENT_ADMIN_ITEM_LAN_23."</b><br />";
-								}
-								$TOPIC_FIELD .= "<br />
-								<input class='tbox' type='file' name='file_userfile[]'  size='36' /> 
-									".$rs -> form_select_open("uploadtype")."
-									".($checkicon ? $rs -> form_option(CONTENT_ADMIN_ITEM_LAN_114, "0", "1") : '')."
-									".($checkattach ? $rs -> form_option(CONTENT_ADMIN_ITEM_LAN_115, "0", "2") : '')."
-									".($checkimages ? $rs -> form_option(CONTENT_ADMIN_ITEM_LAN_116, "0", "3") : '')."
-									".$rs -> form_select_close()."
-								<input type='hidden' name='tmppathicon' value='".$content_tmppath_icon."' />
-								<input type='hidden' name='tmppathfile' value='".$content_tmppath_file."' />
-								<input type='hidden' name='tmppathimage' value='".$content_tmppath_image."' />
-								<input class='button' type='submit' name='uploadfile' value='".CONTENT_ADMIN_ITEM_LAN_104."' />";
-							}
-							$TOPIC_FIELD .= "<br />";
-							$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
-						}
+		if(isset($row['content_enddate']) && $row['content_enddate'] != "0" && $row['content_enddate'] != ""){
+			$enddate	= getdate($row['content_enddate']);
+			$end_day	= $enddate['mday'];
+			$end_month	= $enddate['mon'];
+			$end_year	= $enddate['year'];
+		}else{
+			$end_day	= (isset($end_day) ? $end_day : "0");
+			$end_month	= (isset($end_month) ? $end_month : "0");
+			$end_year	= (isset($end_year) ? $end_year : "0");
+		}
 
-						if($checkicon){
-							//icon
-							$row['content_icon'] = (isset($row['content_icon']) ? $row['content_icon'] : "");
-							$TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_20;
-							$TOPIC_HEADING = CONTENT_ADMIN_ITEM_LAN_75;
-							$TOPIC_HELP = "";
-							$TOPIC_FIELD = "
-								".$rs -> form_text("content_icon", 60, $row['content_icon'], 100)."
-								".$rs -> form_button("button", '', CONTENT_ADMIN_ITEM_LAN_105, "onclick=\"expandit('divicon')\"")."
-								<div id='divicon' style='display:none;'>";
-								if(empty($iconlist)){
-									$TOPIC_FIELD .= CONTENT_ADMIN_ITEM_LAN_121;
-								}else{
-									foreach($iconlist as $icon){
-										if(file_exists($icon['path']."thumb_".$icon['fname'])){
-											$img = "<img src='".$icon['path']."thumb_".$icon['fname']."' style='width:100px; border:0' alt='' />";
-										}else{
-											$img = "<img src='".$icon['path'].$icon['fname']."' style='width:100px; border:0' alt='' />";
-										}
-										$TOPIC_FIELD .= "<a href=\"javascript:insertext('".$icon['fname']."','content_icon','divicon')\">".$img."</a> ";
-									}
-								}
-								$TOPIC_FIELD .= "</div>";
+		if($checkenddate)
+		{
+			//end date
+			$TOPIC_TOPIC = CONTENT_ADMIN_DATE_LAN_16;
+			$TOPIC_HEADING = CONTENT_ADMIN_ITEM_LAN_74;
+			$TOPIC_HELP = CONTENT_ADMIN_DATE_LAN_18;
+			$TOPIC_FIELD = "
+				".$rs -> form_select_open("end_day")."
+				".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_12, 0, "none");
+				for($count=1; $count<=31; $count++){
+					$TOPIC_FIELD .= $rs -> form_option($count, (isset($end_day) && $end_day == $count ? "1" : "0"), $count);
+				}
+				$TOPIC_FIELD .= $rs -> form_select_close()."
+				".$rs -> form_select_open("end_month")."
+				".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_13, 0, "none");
+				for($count=1; $count<=12; $count++){
+					$TOPIC_FIELD .= $rs -> form_option($months[($count-1)], (isset($end_month) && $end_month == $count ? "1" : "0"), $count);
+				}
+				$TOPIC_FIELD .= $rs -> form_select_close()."
+				".$rs -> form_select_open("end_year")."
+				".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_14, 0, "none");
+				for($count=($current_year-5); $count<=($current_year+1); $count++){
+					$TOPIC_FIELD .= $rs -> form_option($count, (isset($end_year) && $end_year == $count ? "1" : "0"), $count);
+				}
+				$TOPIC_FIELD .= $rs -> form_select_close()."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+		}else{
+			$hidden .= $rs -> form_hidden("end_day", $end_day);
+			$hidden .= $rs -> form_hidden("end_month", $end_month);
+			$hidden .= $rs -> form_hidden("end_year", $end_year);
+		}
+
+		//$text .= $TOPIC_ROW_SPACER;
+		if( $checkicon || $checkattach || $checkimages ){
+			//$text .= $TOPIC_ROW_SPACER;
+
+			//upload icon
+			$TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_104;
+			$TOPIC_HEADING = CONTENT_ADMIN_ITEM_LAN_112;
+			$TOPIC_HELP = CONTENT_ADMIN_ITEM_LAN_113;
+
+			$rejectlist			= array('$.','$..','/','CVS','thumbs.db','Thumbs.db','*._$', 'index', 'null*', 'thumb_*');
+			$iconlist			= $fl->get_files($content_tmppath_icon,"",$rejectlist);
+			$filelist			= $fl->get_files($content_tmppath_file,"",$rejectlist);
+			$imagelist			= $fl->get_files($content_tmppath_image,"",$rejectlist);
+
+			$TOPIC_FIELD = "";
+			if(!FILE_UPLOADS){
+				$TOPIC_FIELD .= "<b>".CONTENT_ADMIN_ITEM_LAN_21."</b>";
+			}else{
+				if(!is_writable($content_tmppath_icon)){
+					$TOPIC_FIELD .= "<b>".CONTENT_ADMIN_ITEM_LAN_22." ".$content_tmppath_icon." ".CONTENT_ADMIN_ITEM_LAN_23."</b><br />";
+				}
+				if(!is_writable($content_tmppath_file)){
+					$TOPIC_FIELD .= "<b>".CONTENT_ADMIN_ITEM_LAN_22." ".$content_tmppath_file." ".CONTENT_ADMIN_ITEM_LAN_23."</b><br />";
+				}
+				if(!is_writable($content_tmppath_image)){
+					$TOPIC_FIELD .= "<b>".CONTENT_ADMIN_ITEM_LAN_22." ".$content_tmppath_image." ".CONTENT_ADMIN_ITEM_LAN_23."</b><br />";
+				}
+				$TOPIC_FIELD .= "<br />
+				<input class='tbox' type='file' name='file_userfile[]'  size='36' />
+					".$rs -> form_select_open("uploadtype")."
+					".($checkicon ? $rs -> form_option(CONTENT_ADMIN_ITEM_LAN_114, "0", "1") : '')."
+					".($checkattach ? $rs -> form_option(CONTENT_ADMIN_ITEM_LAN_115, "0", "2") : '')."
+					".($checkimages ? $rs -> form_option(CONTENT_ADMIN_ITEM_LAN_116, "0", "3") : '')."
+					".$rs -> form_select_close()."
+				<input type='hidden' name='tmppathicon' value='".$content_tmppath_icon."' />
+				<input type='hidden' name='tmppathfile' value='".$content_tmppath_file."' />
+				<input type='hidden' name='tmppathimage' value='".$content_tmppath_image."' />
+				<input class='button' type='submit' name='uploadfile' value='".CONTENT_ADMIN_ITEM_LAN_104."' />";
+			}
+			$TOPIC_FIELD .= "<br />";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+		}
 
-							$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+		if($checkicon)
+		{
+			//icon
+			$row['content_icon'] = (isset($row['content_icon']) ? $row['content_icon'] : "");
+			$TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_20;
+			$TOPIC_HEADING = CONTENT_ADMIN_ITEM_LAN_75;
+			$TOPIC_HELP = "";
+			$TOPIC_FIELD = "
+				".$rs -> form_text("content_icon", 60, $row['content_icon'], 100)."
+				".$rs -> form_button("button", '', CONTENT_ADMIN_ITEM_LAN_105, "onclick=\"expandit('divicon')\"")."
+				<div id='divicon' style='display:none;'>";
+				if(empty($iconlist)){
+					$TOPIC_FIELD .= CONTENT_ADMIN_ITEM_LAN_121;
+				}else{
+					foreach($iconlist as $icon){
+						if(file_exists($icon['path']."thumb_".$icon['fname'])){
+							$img = "<img src='".$icon['path']."thumb_".$icon['fname']."' style='width:100px; border:0' alt='' />";
 						}else{
-							$hidden .= $rs -> form_hidden("content_icon", $row['content_icon']);
+							$img = "<img src='".$icon['path'].$icon['fname']."' style='width:100px; border:0' alt='' />";
 						}
+						$TOPIC_FIELD .= "<a href=\"javascript:insertext('".$icon['fname']."','content_icon','divicon')\">".$img."</a> ";
+					}
+				}
+				$TOPIC_FIELD .= "</div>";
 
-						if($checkattach){
-							//file
-							$TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_24;
-							$TOPIC_HEADING = CONTENT_ADMIN_ITEM_LAN_76;
-							$TOPIC_HELP = "";
-							$TOPIC_FIELD = "";
-							$filetmp = explode("[file]", $row['content_file']);
-							foreach($filetmp as $key => $value) { 
-								if($value == "") { 
-									unset($filetmp[$key]); 
-								} 
-							} 
-							$attachments = array_values($filetmp);
-							for($i=0;$i<$checkattachnumber;$i++){
-								$k=$i+1;
-								$num = (strlen($k) == 1 ? "0".$k : $k);
-								$attachments[$i] = ($attachments[$i] ? $attachments[$i] : "");
-
-								//choose file
-								$TOPIC_FIELD .= "
-								<div style='padding:2px;'>
-								".$num." ".$rs -> form_text("content_files".$i."", 60, $attachments[$i], 100)."
-								".$rs -> form_button("button", '', CONTENT_ADMIN_ITEM_LAN_105, "onclick=\"expandit('divfile".$i."')\"")."
-								<div id='divfile".$i."' style='display:none;'>";
-								if(empty($filelist)){
-									$TOPIC_FIELD .= CONTENT_ADMIN_ITEM_LAN_122;
-								}else{
-									foreach($filelist as $file){
-										$TOPIC_FIELD .= CONTENT_ICON_FILE." <a href=\"javascript:insertext('".$file['fname']."','content_files".$i."','divfile".$i."')\">".$file['fname']."</a><br />";
-									}
-								}
-								$TOPIC_FIELD .= "</div></div>";
-							}
-							$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
-						}else{
-							$hidden .= $rs -> form_hidden("content_file", $row['content_file']);
-						}
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+		}else{
+			$hidden .= $rs -> form_hidden("content_icon", $row['content_icon']);
+		}
 
-						if($checkimages){
-							//image
-							$TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_31;
-							$TOPIC_HEADING = CONTENT_ADMIN_ITEM_LAN_77;
-							$TOPIC_HELP = "";
-							$TOPIC_FIELD = "";
-							$imagestmp = explode("[img]", $row['content_image']);
-							foreach($imagestmp as $key => $value) { 
-								if($value == "") { 
-									unset($imagestmp[$key]); 
-								} 
-							} 
-							$imagesarray = array_values($imagestmp);
-							for($i=0;$i<$checkimagesnumber;$i++){
-								$k=$i+1;
-								$num = (strlen($k) == 1 ? "0".$k : $k);
-								$imagesarray[$i] = ($imagesarray[$i] ? $imagesarray[$i] : "");
-
-								//choose image
-								$TOPIC_FIELD .= "
-								<div style='padding:2px;'>
-								".$num." ".$rs -> form_text("content_images".$i."", 60, $imagesarray[$i], 100)."
-								".$rs -> form_button("button", '', CONTENT_ADMIN_ITEM_LAN_105, "onclick=\"expandit('divimage".$i."')\"")."
-								<div id='divimage".$i."' style='display:none;'>";
-								if(empty($imagelist)){
-									$TOPIC_FIELD .= CONTENT_ADMIN_ITEM_LAN_123;
-								}else{
-									foreach($imagelist as $image){
-										if(file_exists($image['path']."thumb_".$image['fname'])){
-											$img = "<img src='".$image['path']."thumb_".$image['fname']."' style='width:100px; border:0' alt='' />";
-										}else{
-											$img = "<img src='".$image['path'].$image['fname']."' style='width:100px; border:0' alt='' />";
-										}
-										$TOPIC_FIELD .= "<a href=\"javascript:insertext('".$image['fname']."','content_images".$i."','divimage".$i."')\">".$img."</a> ";
-									}
-								}
-								$TOPIC_FIELD .= "</div></div>";								
-							}
-							$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
-						}else{
-							$hidden .= $rs -> form_hidden("content_image", $row['content_image']);
-						}
+		if($checkattach)
+		{
+			//file
+			$TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_24;
+			$TOPIC_HEADING = CONTENT_ADMIN_ITEM_LAN_76;
+			$TOPIC_HELP = "";
+			$TOPIC_FIELD = "";
+			$filetmp = explode("[file]", $row['content_file']);
+			foreach($filetmp as $key => $value) {
+				if($value == "") {
+					unset($filetmp[$key]);
+				}
+			}
+			$attachments = array_values($filetmp);
+			for($i=0;$i<$checkattachnumber;$i++){
+				$k=$i+1;
+				$num = (strlen($k) == 1 ? "0".$k : $k);
+				$attachments[$i] = ($attachments[$i] ? $attachments[$i] : "");
+
+				//choose file
+				$TOPIC_FIELD .= "
+				<div style='padding:2px;'>
+				".$num." ".$rs -> form_text("content_files".$i."", 60, $attachments[$i], 100)."
+				".$rs -> form_button("button", '', CONTENT_ADMIN_ITEM_LAN_105, "onclick=\"expandit('divfile".$i."')\"")."
+				<div id='divfile".$i."' style='display:none;'>";
+				if(empty($filelist)){
+					$TOPIC_FIELD .= CONTENT_ADMIN_ITEM_LAN_122;
+				}else{
+					foreach($filelist as $file){
+						$TOPIC_FIELD .= CONTENT_ICON_FILE." <a href=\"javascript:insertext('".$file['fname']."','content_files".$i."','divfile".$i."')\">".$file['fname']."</a><br />";
+					}
+				}
+				$TOPIC_FIELD .= "</div></div>";
+			}
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+		}else{
+			$hidden .= $rs -> form_hidden("content_file", $row['content_file']);
+		}
 
-						if($checkcomment || $checkrating || $checkpe || $checkvisibility || $checkscore || $checkmeta || $checklayout ){
-							//$text .= $TOPIC_ROW_SPACER;
-						}
-						if($checkcomment){
-							//comment
-							$row['content_comment'] = (isset($row['content_comment']) ? $row['content_comment'] : "");
-							$TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_36;
-							$TOPIC_FIELD = "
-							".$rs -> form_radio("content_comment", "1", ($row['content_comment'] ? "1" : "0"), "", "").CONTENT_ADMIN_ITEM_LAN_85."
-							".$rs -> form_radio("content_comment", "0", ($row['content_comment'] ? "0" : "1"), "", "").CONTENT_ADMIN_ITEM_LAN_86."
-							";
-							$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+		if($checkimages){
+			//image
+			$TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_31;
+			$TOPIC_HEADING = CONTENT_ADMIN_ITEM_LAN_77;
+			$TOPIC_HELP = "";
+			$TOPIC_FIELD = "";
+			$imagestmp = explode("[img]", $row['content_image']);
+			foreach($imagestmp as $key => $value) {
+				if($value == "") {
+					unset($imagestmp[$key]);
+				}
+			}
+			$imagesarray = array_values($imagestmp);
+			for($i=0;$i<$checkimagesnumber;$i++){
+				$k=$i+1;
+				$num = (strlen($k) == 1 ? "0".$k : $k);
+				$imagesarray[$i] = ($imagesarray[$i] ? $imagesarray[$i] : "");
+
+				//choose image
+				$TOPIC_FIELD .= "
+				<div style='padding:2px;'>
+				".$num." ".$rs -> form_text("content_images".$i."", 60, $imagesarray[$i], 100)."
+				".$rs -> form_button("button", '', CONTENT_ADMIN_ITEM_LAN_105, "onclick=\"expandit('divimage".$i."')\"")."
+				<div id='divimage".$i."' style='display:none;'>";
+				if(empty($imagelist)){
+					$TOPIC_FIELD .= CONTENT_ADMIN_ITEM_LAN_123;
+				}else{
+					foreach($imagelist as $image){
+						if(file_exists($image['path']."thumb_".$image['fname'])){
+							$img = "<img src='".$image['path']."thumb_".$image['fname']."' style='width:100px; border:0' alt='' />";
 						}else{
-							$hidden .= $rs -> form_hidden("content_comment", $row['content_comment']);
+							$img = "<img src='".$image['path'].$image['fname']."' style='width:100px; border:0' alt='' />";
 						}
+						$TOPIC_FIELD .= "<a href=\"javascript:insertext('".$image['fname']."','content_images".$i."','divimage".$i."')\">".$img."</a> ";
+					}
+				}
+				$TOPIC_FIELD .= "</div></div>";
+			}
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+		}else{
+			$hidden .= $rs -> form_hidden("content_image", $row['content_image']);
+		}
 
-						if($checkrating){
-							//rating
-							$row['content_rate'] = (isset($row['content_rate']) ? $row['content_rate'] : "");
-							$TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_37;
-							$TOPIC_FIELD = "
-							".$rs -> form_radio("content_rate", "1", ($row['content_rate'] ? "1" : "0"), "", "").CONTENT_ADMIN_ITEM_LAN_85."
-							".$rs -> form_radio("content_rate", "0", ($row['content_rate'] ? "0" : "1"), "", "").CONTENT_ADMIN_ITEM_LAN_86."
-							";
-							$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
-						}else{
-							$hidden .= $rs -> form_hidden("content_rate", $row['content_rate']);
-						}
+		if($checkcomment || $checkrating || $checkpe || $checkvisibility || $checkscore || $checkmeta || $checklayout )
+		{
+			//$text .= $TOPIC_ROW_SPACER;
+		}
+		if($checkcomment){
+			//comment
+			$row['content_comment'] = (isset($row['content_comment']) ? $row['content_comment'] : "");
+			$TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_36;
+			$TOPIC_FIELD = "
+			".$rs -> form_radio("content_comment", "1", ($row['content_comment'] ? "1" : "0"), "", "").CONTENT_ADMIN_ITEM_LAN_85."
+			".$rs -> form_radio("content_comment", "0", ($row['content_comment'] ? "0" : "1"), "", "").CONTENT_ADMIN_ITEM_LAN_86."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+		}else{
+			$hidden .= $rs -> form_hidden("content_comment", $row['content_comment']);
+		}
 
-						if($checkpe){
-							//print/email/pdf icons
-							$row['content_pe'] = (isset($row['content_pe']) ? $row['content_pe'] : "");
-							$TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_38;
-							$TOPIC_FIELD = "
-							".$rs -> form_radio("content_pe", "1", ($row['content_pe'] ? "1" : "0"), "", "").CONTENT_ADMIN_ITEM_LAN_85."
-							".$rs -> form_radio("content_pe", "0", ($row['content_pe'] ? "0" : "1"), "", "").CONTENT_ADMIN_ITEM_LAN_86."
-							";
-							$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
-						}else{
-							$hidden .= $rs -> form_hidden("content_pe", $row['content_pe']);
-						}
+		if($checkrating){
+			//rating
+			$row['content_rate'] = (isset($row['content_rate']) ? $row['content_rate'] : "");
+			$TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_37;
+			$TOPIC_FIELD = "
+			".$rs -> form_radio("content_rate", "1", ($row['content_rate'] ? "1" : "0"), "", "").CONTENT_ADMIN_ITEM_LAN_85."
+			".$rs -> form_radio("content_rate", "0", ($row['content_rate'] ? "0" : "1"), "", "").CONTENT_ADMIN_ITEM_LAN_86."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+		}else{
+			$hidden .= $rs -> form_hidden("content_rate", $row['content_rate']);
+		}
 
-						if($checkvisibility){
-							//userclass
-							$row['content_class'] = (isset($row['content_class']) ? $row['content_class'] : "");
-							$TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_39;
-							$TOPIC_FIELD = r_userclass("content_class",$row['content_class'], "CLASSES");
-							$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
-						}else{
-							$hidden .= $rs -> form_hidden("content_class", $row['content_class']);
-						}
+		if($checkpe){
+			//print/email/pdf icons
+			$row['content_pe'] = (isset($row['content_pe']) ? $row['content_pe'] : "");
+			$TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_38;
+			$TOPIC_FIELD = "
+			".$rs -> form_radio("content_pe", "1", ($row['content_pe'] ? "1" : "0"), "", "").CONTENT_ADMIN_ITEM_LAN_85."
+			".$rs -> form_radio("content_pe", "0", ($row['content_pe'] ? "0" : "1"), "", "").CONTENT_ADMIN_ITEM_LAN_86."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+		}else{
+			$hidden .= $rs -> form_hidden("content_pe", $row['content_pe']);
+		}
 
-						if($checkscore){
-							//score
-							$TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_40;
-							$TOPIC_FIELD = "
-								".$rs -> form_select_open("content_score")."
-								".$rs -> form_option(CONTENT_ADMIN_ITEM_LAN_41, 0, "none");
-								for($a=1; $a<=100; $a++){
-									$TOPIC_FIELD .= $rs -> form_option($a, ($row['content_score'] == $a ? "1" : "0"), $a);
-								}
-								$TOPIC_FIELD .= $rs -> form_select_close();
-							$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
-						}else{
-							$hidden .= $rs -> form_hidden("content_score", $row['content_score']);
-						}
+		if($checkvisibility){
+			//userclass
+			$row['content_class'] = (isset($row['content_class']) ? $row['content_class'] : "");
+			$TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_39;
+			$TOPIC_FIELD = r_userclass("content_class",$row['content_class'], "CLASSES");
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+		}else{
+			$hidden .= $rs -> form_hidden("content_class", $row['content_class']);
+		}
 
-						if($checkmeta){
-							//meta
-							$TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_53;
-							$TOPIC_FIELD = CONTENT_ADMIN_ITEM_LAN_70."<br />".$rs -> form_text("content_meta", 74, $row['content_meta'], 250);
-							$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
-						}else{
-							$hidden .= $rs -> form_hidden("content_meta", $row['content_meta']);
-						}
+		if($checkscore){
+			//score
+			$TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_40;
+			$TOPIC_FIELD = "
+				".$rs -> form_select_open("content_score")."
+				".$rs -> form_option(CONTENT_ADMIN_ITEM_LAN_41, 0, "none");
+				for($a=1; $a<=100; $a++){
+					$TOPIC_FIELD .= $rs -> form_option($a, ($row['content_score'] == $a ? "1" : "0"), $a);
+				}
+				$TOPIC_FIELD .= $rs -> form_select_close();
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+		}else{
+			$hidden .= $rs -> form_hidden("content_score", $row['content_score']);
+		}
 
-						if($checklayout){
-							global $fl;
+		if($checkmeta){
+			//meta
+			$TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_53;
+			$TOPIC_FIELD = CONTENT_ADMIN_ITEM_LAN_70."<br />".$rs -> form_text("content_meta", 74, $row['content_meta'], 250);
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+		}else{
+			$hidden .= $rs -> form_hidden("content_meta", $row['content_meta']);
+		}
 
-							if(!isset($content_pref["content_theme"])){
-								$dir = $plugindir."templates/default";
-							}else{
-								if(is_readable($tp->replaceConstants($content_pref["content_theme"])."content_content_template.php")){
-									$dir = $tp->replaceConstants($content_pref["content_theme"]);
-								}else{
-									$dir = $plugindir."templates/default";
-								}
-							}
-							//get_files($path, $fmask = '', $omit='standard', $recurse_level = 0, $current_level = 0, $dirs_only = FALSE)
-							$rejectlist = array('$.','$..','/','CVS','thumbs.db','Thumbs.db','*._$', 'index', 'null*', '.bak');
-							$templatelist = $fl->get_files($dir,"content_content",$rejectlist);
-
-							//template
-							$check = "";
-							if(isset($row['content_layout']) && $row['content_layout'] != ""){
-								$check = $row['content_layout'];
-							}else{
-								if(isset($content_pref["content_layout"])){
-									$check = $content_pref["content_layout"];
-								}
-							}
-							$TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_92;
-							$TOPIC_FIELD = "
-							".$rs -> form_select_open("content_layout")."
-							".$rs -> form_option(CONTENT_ADMIN_ITEM_LAN_94, 0, "none");
-							foreach($templatelist as $template){
-								$templatename = substr($template['fname'], 25, -4);
-								$templatename = ($template['fname'] == "content_content_template.php" ? "default" : $templatename);
-								$TOPIC_FIELD .= $rs -> form_option($templatename, ($check == $template['fname'] ? "1" : "0"), $template['fname']);
-							}
-							$TOPIC_FIELD .= $rs -> form_select_close();
-							$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
-						}else{
-							$hidden .= $rs -> form_hidden("content_layout", $row['content_layout']);
-						}
+		if($checklayout)
+		{
+			global $fl;
 
-						if( $checkcustom && $checkcustomnumber ){
-							//$text .= $TOPIC_ROW_SPACER;
-						}
-						
-						if(!(isset($_POST['preview_content']) || isset($message))){
-							if(isset($row['content_pref']) && $row['content_pref']){
-								$custom = $eArrayStorage->ReadArray($row['content_pref']);
-							}
-						}
+			if(!isset($content_pref["content_theme"])){
+				$dir = $plugindir."templates/default";
+			}else{
+				if(is_readable($tp->replaceConstants($content_pref["content_theme"])."content_content_template.php")){
+					$dir = $tp->replaceConstants($content_pref["content_theme"]);
+				}else{
+					$dir = $plugindir."templates/default";
+				}
+			}
+			//get_files($path, $fmask = '', $omit='standard', $recurse_level = 0, $current_level = 0, $dirs_only = FALSE)
+			$rejectlist = array('$.','$..','/','CVS','thumbs.db','Thumbs.db','*._$', 'index', 'null*', '.bak');
+			$templatelist = $fl->get_files($dir,"content_content",$rejectlist);
 
-						//custom data
-						$existing_custom = "0";
-						$TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_54;
-						$TOPIC_HEADING = CONTENT_ADMIN_ITEM_LAN_84;
-						$TOPIC_HELP = CONTENT_ADMIN_ITEM_LAN_68;
-						$TOPIC_CHECK_VALID = FALSE;
-						$TOPIC_FIELD = "";
-						if($checkcustom && $checkcustomnumber){ $TOPIC_FIELD = "<table style='width:100%; border:0;'>"; }
-						if(!empty($custom)){
-							foreach($custom as $k => $v){
-								if(substr($k,0,22) != "content_custom_preset_" && $k != "content_custom_presettags"){
-									$key = substr($k,15);
-
-									$key	= $tp -> post_toForm($key);
-									$v		= $tp -> post_toForm($v);
-
-									if($checkcustom && $checkcustomnumber){
-										$TOPIC_FIELD .= "
-										<tr>
-											<td class='forumheader3' style='border:0;'>".$rs -> form_text("content_custom_key_".$existing_custom."", 20, $key, 100)."</td>
-											<td class='forumheader3' style='border:0;'>".$rs -> form_text("content_custom_value_".$existing_custom."", 70, $v, 250)."</td>
-										</tr>";
-									}else{
-										$TOPIC_FIELD .= "
-										".$rs -> form_hidden("content_custom_key_".$existing_custom, $key)."
-										".$rs -> form_hidden("content_custom_value_".$existing_custom, $v);
-										$TOPIC_CHECK_VALID = TRUE;
-									}
-									$existing_custom = $existing_custom + 1;
-								}
-							}
-						}
+			//template
+			$check = "";
+			if(isset($row['content_layout']) && $row['content_layout'] != ""){
+				$check = $row['content_layout'];
+			}else{
+				if(isset($content_pref["content_layout"])){
+					$check = $content_pref["content_layout"];
+				}
+			}
+			$TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_92;
+			$TOPIC_FIELD = "
+			".$rs -> form_select_open("content_layout")."
+			".$rs -> form_option(CONTENT_ADMIN_ITEM_LAN_94, 0, "none");
+			foreach($templatelist as $template){
+				$templatename = substr($template['fname'], 25, -4);
+				$templatename = ($template['fname'] == "content_content_template.php" ? "default" : $templatename);
+				$TOPIC_FIELD .= $rs -> form_option($templatename, ($check == $template['fname'] ? "1" : "0"), $template['fname']);
+			}
+			$TOPIC_FIELD .= $rs -> form_select_close();
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+		}else{
+			$hidden .= $rs -> form_hidden("content_layout", $row['content_layout']);
+		}
 
-						if($checkcustom && $checkcustomnumber){
-							$TOPIC_CHECK_VALID = TRUE;
-							for($i=$existing_custom;$i<$checkcustomnumber;$i++){
-									$TOPIC_FIELD .= "
-									<tr>
-										<td class='forumheader3' style='border:0;'>".$rs -> form_text("content_custom_key_".$i."", 20, "", 100)."</td>
-										<td class='forumheader3' style='border:0;'>".$rs -> form_text("content_custom_value_".$i."", 70, "", 250)."</td>
-									</tr>";
-							}
-						}
-						if($checkcustom && $checkcustomnumber){ $TOPIC_FIELD .= "</table>"; }
-						if($TOPIC_CHECK_VALID){ $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW); }
-						
-						//preset custom data fields
-						if(count($content_pref["content_custom_preset_key"]) > 0){
-							//$text .= $TOPIC_ROW_SPACER;
-						}
+		if( $checkcustom && $checkcustomnumber ){
+			//$text .= $TOPIC_ROW_SPACER;
+		}
 
-						for($i=0;$i<count($content_pref["content_custom_preset_key"]);$i++){
-							$value = "";
-							if(!empty($content_pref["content_custom_preset_key"][$i])){
-								if($checkpreset){
-									$text .= $this -> parseCustomPresetTag($content_pref["content_custom_preset_key"][$i], $custom['content_custom_presettags']);
-								}else{
-									$tmp = explode("^", $content_pref["content_custom_preset_key"][$i]);
-									if(is_array($custom['content_custom_presettags'][$tmp[0]])){
-										$tmp[0] = $tp -> post_toForm($tmp[0]);
-										$hidden .= $rs -> form_hidden("content_custom_preset_key[$tmp[0]][day]", $custom['content_custom_presettags'][$tmp[0]][day]);
-										$hidden .= $rs -> form_hidden("content_custom_preset_key[$tmp[0]][month]", $custom['content_custom_presettags'][$tmp[0]][month]);
-										$hidden .= $rs -> form_hidden("content_custom_preset_key[$tmp[0]][year]", $custom['content_custom_presettags'][$tmp[0]][year]);
-									}else{
-										$tmp[0] = $tp -> post_toForm($tmp[0]);
-										$hidden .= $rs -> form_hidden("content_custom_preset_key[$tmp[0]]", $custom['content_custom_presettags'][$tmp[0]]);
-									}
-								}
-							}
-						}
+		if(!(isset($_POST['preview_content']) || isset($message))){
+			if(isset($row['content_pref']) && $row['content_pref']){
+				$custom = $eArrayStorage->ReadArray($row['content_pref']);
+			}
+		}
 
-						$text .= $TOPIC_ROW_SPACER."
-						<tr>
-							<td colspan='2' style='text-align:center' class='forumheader'>".($hidden ? $hidden : "");
-							if($qs[1] == "edit" || $qs[1] == "sa" || isset($_POST['editp']) ){
-								if($qs[1] == "sa"){
-								$text .= $rs -> form_hidden("content_refer", $row['content_refer']);
-								}
-								$text .= $rs -> form_hidden("content_datestamp", $row['content_datestamp']);
-								$text .= $rs -> form_button("submit", "preview_content", (isset($_POST['preview_content']) ? CONTENT_ADMIN_MAIN_LAN_27 : CONTENT_ADMIN_MAIN_LAN_26));
-								$text .= $rs -> form_button("submit", "update_content", ($qs[1] == "sa" ? CONTENT_ADMIN_ITEM_LAN_43 : CONTENT_ADMIN_ITEM_LAN_45));
-								$text .= $rs -> form_hidden("content_id", $qs[2]);
-								$text .= $rs -> form_checkbox("update_datestamp", 1, 0)." ".CONTENT_ADMIN_ITEM_LAN_42;
-							}else{
-								$text .= $rs -> form_button("submit", "preview_content", (isset($_POST['preview_content']) ? CONTENT_ADMIN_MAIN_LAN_27 : CONTENT_ADMIN_MAIN_LAN_26));
-								$text .= $rs -> form_button("submit", "create_content", CONTENT_ADMIN_ITEM_LAN_44);								
-							}
-							$text .= "
-							</td>
-						</tr>
+		//custom data
+		$existing_custom = "0";
+		$TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_54;
+		$TOPIC_HEADING = CONTENT_ADMIN_ITEM_LAN_84;
+		$TOPIC_HELP = CONTENT_ADMIN_ITEM_LAN_68;
+		$TOPIC_CHECK_VALID = FALSE;
+		$TOPIC_FIELD = "";
+		if($checkcustom && $checkcustomnumber){ $TOPIC_FIELD = "<table style='width:100%; border:0;'>"; }
+		if(!empty($custom)){
+			foreach($custom as $k => $v){
+				if(substr($k,0,22) != "content_custom_preset_" && $k != "content_custom_presettags"){
+					$key = substr($k,15);
 
-						</table>
-						</form>
-						</div>";
+					$key	= $tp -> post_toForm($key);
+					$v		= $tp -> post_toForm($v);
 
-						$caption = ($qs[1] == "edit" ? CONTENT_ADMIN_ITEM_LAN_45 : CONTENT_ADMIN_ITEM_LAN_44);
-						$ns -> tablerender($caption, $text);
+					if($checkcustom && $checkcustomnumber){
+						$TOPIC_FIELD .= "
+						<tr>
+							<td class='forumheader3' style='border:0;'>".$rs -> form_text("content_custom_key_".$existing_custom."", 20, $key, 100)."</td>
+							<td class='forumheader3' style='border:0;'>".$rs -> form_text("content_custom_value_".$existing_custom."", 70, $v, 250)."</td>
+						</tr>";
+					}else{
+						$TOPIC_FIELD .= "
+						".$rs -> form_hidden("content_custom_key_".$existing_custom, $key)."
+						".$rs -> form_hidden("content_custom_value_".$existing_custom, $v);
+						$TOPIC_CHECK_VALID = TRUE;
+					}
+					$existing_custom = $existing_custom + 1;
+				}
+			}
 		}
 
+		if($checkcustom && $checkcustomnumber){
+			$TOPIC_CHECK_VALID = TRUE;
+			for($i=$existing_custom;$i<$checkcustomnumber;$i++){
+					$TOPIC_FIELD .= "
+					<tr>
+						<td class='forumheader3' style='border:0;'>".$rs -> form_text("content_custom_key_".$i."", 20, "", 100)."</td>
+						<td class='forumheader3' style='border:0;'>".$rs -> form_text("content_custom_value_".$i."", 70, "", 250)."</td>
+					</tr>";
+			}
+		}
+		if($checkcustom && $checkcustomnumber){ $TOPIC_FIELD .= "</table>"; }
+		if($TOPIC_CHECK_VALID){ $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW); }
 
-		function parseCustomPresetTag($tag, $values){
-			global $rs, $TOPIC_ROW_NOEXPAND, $months, $tp;
+			//preset custom data fields
+			if(count($content_pref["content_custom_preset_key"]) > 0){
+				//$text .= $TOPIC_ROW_SPACER;
+			}
 
-			$tmp = explode("^", $tag);
+			for($i=0;$i<count($content_pref["content_custom_preset_key"]);$i++){
+				$value = "";
+				if(!empty($content_pref["content_custom_preset_key"][$i])){
+					if($checkpreset){
+						$text .= $this -> parseCustomPresetTag($content_pref["content_custom_preset_key"][$i], $custom['content_custom_presettags']);
+					}else{
+						$tmp = explode("^", $content_pref["content_custom_preset_key"][$i]);
+						if(is_array($custom['content_custom_presettags'][$tmp[0]])){
+							$tmp[0] = $tp -> post_toForm($tmp[0]);
+							$hidden .= $rs -> form_hidden("content_custom_preset_key[$tmp[0]][day]", $custom['content_custom_presettags'][$tmp[0]][day]);
+							$hidden .= $rs -> form_hidden("content_custom_preset_key[$tmp[0]][month]", $custom['content_custom_presettags'][$tmp[0]][month]);
+							$hidden .= $rs -> form_hidden("content_custom_preset_key[$tmp[0]][year]", $custom['content_custom_presettags'][$tmp[0]][year]);
+						}else{
+							$tmp[0] = $tp -> post_toForm($tmp[0]);
+							$hidden .= $rs -> form_hidden("content_custom_preset_key[$tmp[0]]", $custom['content_custom_presettags'][$tmp[0]]);
+						}
+					}
+				}
+			}
 
-			$str = "";
-			if($tmp[1] == "text"){
-					$str = $rs -> form_text("content_custom_preset_key[{$tmp[0]}]", $tmp[2], $tp -> post_toForm($values[$tmp[0]]), $tmp[3], "tbox", "", "", "");
+		$text .= $TOPIC_ROW_SPACER."
+		<tr>
+			<td colspan='2' style='text-align:center' class='forumheader'>".($hidden ? $hidden : "");
+			if($qs[1] == "edit" || $qs[1] == "sa" || isset($_POST['editp']) ){
+				if($qs[1] == "sa"){
+				$text .= $rs -> form_hidden("content_refer", $row['content_refer']);
+				}
+				$text .= $rs -> form_hidden("content_datestamp", $row['content_datestamp']);
+				$text .= $rs -> form_button("submit", "preview_content", (isset($_POST['preview_content']) ? CONTENT_ADMIN_MAIN_LAN_27 : CONTENT_ADMIN_MAIN_LAN_26));
+				$text .= $rs -> form_button("submit", "update_content", ($qs[1] == "sa" ? CONTENT_ADMIN_ITEM_LAN_43 : CONTENT_ADMIN_ITEM_LAN_45));
+				$text .= $rs -> form_hidden("content_id", $qs[2]);
+				$text .= $rs -> form_checkbox("update_datestamp", 1, 0)." ".CONTENT_ADMIN_ITEM_LAN_42;
+			}else{
+				$text .= $rs -> form_button("submit", "preview_content", (isset($_POST['preview_content']) ? CONTENT_ADMIN_MAIN_LAN_27 : CONTENT_ADMIN_MAIN_LAN_26));
+				$text .= $rs -> form_button("submit", "create_content", CONTENT_ADMIN_ITEM_LAN_44);
+			}
+			$text .= "
+			</td>
+		</tr>
 
-			}elseif($tmp[1] == "area"){
-					$str = $rs -> form_textarea("content_custom_preset_key[{$tmp[0]}]", $tmp[2], $tmp[3], $tp -> post_toForm($values[$tmp[0]]), "", "", "", "", "");
+		</table>
+		</form>
+		</div>";
 
-			}elseif($tmp[1] == "select"){
-					$str = $rs -> form_select_open("content_custom_preset_key[{$tmp[0]}]", "");
-					$str .= $rs -> form_option($tmp[2], ($values[$tmp[0]] == $tmp[2] ? "1" : "0"), "", "");
-					for($i=3;$i<count($tmp);$i++){
-						$tmp[$i] = $tp -> post_toForm($tmp[$i]);
-						$str .= $rs -> form_option($tmp[$i], ($values[$tmp[0]] == $tmp[$i] ? "1" : "0"), $tmp[$i], "");
-					}				
-					$str .= $rs -> form_select_close();
-				
-			}elseif($tmp[1] == "date"){
-					$str = $rs -> form_select_open("content_custom_preset_key[{$tmp[0]}][day]", "")."
-					".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_12, "0", "");
-					for($i=1;$i<=31;$i++){
-						$str .= $rs -> form_option($i, ($values[$tmp[0]]['day'] == $i ? "1" : "0"), $i, "");
-					}
-					$str .= $rs -> form_select_close();
+		$caption = ($qs[1] == "edit" ? CONTENT_ADMIN_ITEM_LAN_45 : CONTENT_ADMIN_ITEM_LAN_44);
+		$ns -> tablerender($caption, $text);
+	}
 
-					$str .= $rs -> form_select_open("content_custom_preset_key[{$tmp[0]}][month]", "")."
-					".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_13, "0", "");
-					for($i=1;$i<=12;$i++){
-						$str .= $rs -> form_option($months[($i-1)], ($values[$tmp[0]]['month'] == $i ? "1" : "0"), $i, "");
-					}
-					$str .= $rs -> form_select_close();
 
-					$str .= $rs -> form_select_open("content_custom_preset_key[{$tmp[0]}][year]", "")."
-					".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_14, "0", "");
-					for($i=$tmp[2];$i<=$tmp[3];$i++){
-						$str .= $rs -> form_option($i, ($values[$tmp[0]]['year'] == $i ? "1" : "0"), $i, "");
-					}
-					$str .= $rs -> form_select_close();
-			
-			}elseif($tmp[1] == "radio"){
-					for($i=2;$i<count($tmp);$i++){
-						$str .= $rs -> form_radio("content_custom_preset_key[{$tmp[0]}]", $tmp[$i], ($values[$tmp[0]] == $tmp[$i] ? "1" : "0"), "", "")." ".$tmp[$i];
-						$i++;					
-					}
 
-			}elseif($tmp[1] == "checkbox"){
-					$str = $rs -> form_checkbox("content_custom_preset_key[{$tmp[0]}]", $tp -> post_toForm($tmp[2]), ($values[$tmp[0]] == $tmp[2] ? "1" : "0"), "", "");
-			}
 
-			$TOPIC_TOPIC = $tmp[0];
-			$TOPIC_FIELD = $str;
-			$text = preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+	function parseCustomPresetTag($tag, $values)
+	{
+		global $rs, $TOPIC_ROW_NOEXPAND, $months, $tp;
 
-			return $text;
+		$tmp = explode("^", $tag);
+
+		$str = "";
+		if($tmp[1] == "text"){
+				$str = $rs -> form_text("content_custom_preset_key[{$tmp[0]}]", $tmp[2], $tp -> post_toForm($values[$tmp[0]]), $tmp[3], "tbox", "", "", "");
+
+		}elseif($tmp[1] == "area"){
+				$str = $rs -> form_textarea("content_custom_preset_key[{$tmp[0]}]", $tmp[2], $tmp[3], $tp -> post_toForm($values[$tmp[0]]), "", "", "", "", "");
+
+		}elseif($tmp[1] == "select"){
+				$str = $rs -> form_select_open("content_custom_preset_key[{$tmp[0]}]", "");
+				$str .= $rs -> form_option($tmp[2], ($values[$tmp[0]] == $tmp[2] ? "1" : "0"), "", "");
+				for($i=3;$i<count($tmp);$i++){
+					$tmp[$i] = $tp -> post_toForm($tmp[$i]);
+					$str .= $rs -> form_option($tmp[$i], ($values[$tmp[0]] == $tmp[$i] ? "1" : "0"), $tmp[$i], "");
+				}
+				$str .= $rs -> form_select_close();
+
+		}elseif($tmp[1] == "date"){
+				$str = $rs -> form_select_open("content_custom_preset_key[{$tmp[0]}][day]", "")."
+				".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_12, "0", "");
+				for($i=1;$i<=31;$i++){
+					$str .= $rs -> form_option($i, ($values[$tmp[0]]['day'] == $i ? "1" : "0"), $i, "");
+				}
+				$str .= $rs -> form_select_close();
+
+				$str .= $rs -> form_select_open("content_custom_preset_key[{$tmp[0]}][month]", "")."
+				".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_13, "0", "");
+				for($i=1;$i<=12;$i++){
+					$str .= $rs -> form_option($months[($i-1)], ($values[$tmp[0]]['month'] == $i ? "1" : "0"), $i, "");
+				}
+				$str .= $rs -> form_select_close();
+
+				$str .= $rs -> form_select_open("content_custom_preset_key[{$tmp[0]}][year]", "")."
+				".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_14, "0", "");
+				for($i=$tmp[2];$i<=$tmp[3];$i++){
+					$str .= $rs -> form_option($i, ($values[$tmp[0]]['year'] == $i ? "1" : "0"), $i, "");
+				}
+				$str .= $rs -> form_select_close();
+
+		}elseif($tmp[1] == "radio"){
+				for($i=2;$i<count($tmp);$i++){
+					$str .= $rs -> form_radio("content_custom_preset_key[{$tmp[0]}]", $tmp[$i], ($values[$tmp[0]] == $tmp[$i] ? "1" : "0"), "", "")." ".$tmp[$i];
+					$i++;
+				}
+
+		}elseif($tmp[1] == "checkbox"){
+				$str = $rs -> form_checkbox("content_custom_preset_key[{$tmp[0]}]", $tp -> post_toForm($tmp[2]), ($values[$tmp[0]] == $tmp[2] ? "1" : "0"), "", "");
 		}
 
+		$TOPIC_TOPIC = $tmp[0];
+		$TOPIC_FIELD = $str;
+		$text = preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+		return $text;
+	}
+
 
 
 		function show_manage_content($mode, $userid="", $username=""){
@@ -1211,7 +1221,7 @@
 				$caption = CONTENT_ADMIN_MAIN_LAN_2;
 				$ns -> tablerender($caption, $text);
 			}
-			
+
 			if(!isset($qs[1])){
 				return;
 			}
@@ -1262,7 +1272,7 @@
 					$qrycat		= " content_parent = '".intval($qs[1])."' ";
 					$qryfirst	= " content_parent = '".intval($qs[1])."' ";
 					$qryletter	= "";
-					
+
 				}else{
 					header("location:".$plugindir."content_manager.php"); exit;
 				}
@@ -1273,11 +1283,11 @@
 				$qryuser = "";
 				if( !(isset($qs[2]) && is_numeric($qs[2])) ){
 					$formtarget	= e_SELF."?content.".intval($qs[1]);
-					$qryfirst	= " ".$qrycat." ";							
+					$qryfirst	= " ".$qrycat." ";
 					$qryletter	= "";
 				}
 			}
-			
+
 			$text = "";
 			// -------- SHOW FIRST LETTERS FIRSTNAMES ------------------------------------
 			if(!is_object($sql)){ $sql = new db; }
@@ -1301,7 +1311,7 @@
 					return;
 
 			}elseif ($distinctfirstletter != 1){
-					
+
 					$text .= "
 					<div style='text-align:center'>
 					<form method='post' action='".$formtarget."'>
@@ -1326,11 +1336,11 @@
 			// -------- CHECK FOR FIRST LETTER SUBMISSION --------------------------------
 			$letter=(isset($_POST['letter']) ? $_POST['letter'] : "");
 			if ($letter != "" && $letter != "all" ) { $qryletter .= " AND content_heading LIKE '".$tp->toDB($letter)."%' "; }else{ $qryletter .= ""; }
-			
+
 			$qryitem = " ".$qrycat." AND content_refer != 'sa' ".$qryletter." ".$qryuser." ORDER BY content_datestamp DESC";
 			// ---------------------------------------------------------------------------
 
-			$sql2 = new db;						
+			$sql2 = new db;
 			if(!$content_total = $sql2 -> db_Select($plugintable, "content_id, content_heading, content_subheading, content_author, content_icon", $qryitem)){
 				$text .= "<div style='text-align:center'>".CONTENT_ADMIN_ITEM_LAN_4."</div>";
 			}else{
@@ -1347,7 +1357,7 @@
 					<td class='fcaption' style='width:10%; text-align:center;'>".CONTENT_ADMIN_ITEM_LAN_12."</td>
 					</tr>";
 					while($row = $sql2 -> db_Fetch()){
-						$delete_heading	= str_replace("&#39;", "\'", $row['content_heading']);
+						$delete_heading	= htmlentities($row['content_heading']);
 						$authordetails	= $aa -> getAuthor($row['content_author']);
 						$caticon		= $content_icon_path.$row['content_icon'];
 						$deleteicon		= CONTENT_ICON_DELETE;
@@ -1360,10 +1370,10 @@
 						<td class='forumheader3' style='width:5%; text-align:center'>".($row['content_icon'] ? "<img src='".$caticon."' alt='' style='width:50px; vertical-align:middle' />" : "&nbsp;")."</td>
 						<td class='forumheader3' style='width:10%; text-align:left'>".($authordetails[0] != "0" ? "<a href='".e_BASE."user.php?id.".$authordetails[0]."'>".CONTENT_ICON_USER."</a>" : "")." ".$authordetails[1]."</td>
 						<td class='forumheader3' style='width:70%; text-align:left;'>
-							<a href='".$plugindir."content.php?content.".$row['content_id']."'>".CONTENT_ICON_LINK."</a> 
+							<a href='".$plugindir."content.php?content.".$row['content_id']."'>".CONTENT_ICON_LINK."</a>
 							".$row['content_heading']." ".($row['content_subheading'] ? "[".$row['content_subheading']."]" : "")."</td>
 						<td class='forumheader3' style='width:10%; text-align:center; white-space:nowrap; vertical-align:top;'>
-							<a href='".e_SELF."?content.edit.".$cid."'>".CONTENT_ICON_EDIT."</a> 
+							<a href='".e_SELF."?content.edit.".$cid."'>".CONTENT_ICON_EDIT."</a>
 							<input type='image' title='".CONTENT_ICON_LAN_1."' name='delete[content_{$cid}]' src='".CONTENT_ICON_DELETE_BASE."' onclick=\"return jsconfirm('".$tp->toJS(CONTENT_ADMIN_JS_LAN_1."\\n\\n[".CONTENT_ADMIN_JS_LAN_6." ".$cid." : ".$delete_heading."]")."')\"/>
 						</td>
 						</tr>";
@@ -1416,13 +1426,13 @@
 						$content_icon_path	= $tp -> replaceConstants($iconpath);
 						$icon				= $content_icon_path.$row['content_icon'];
 					}
-					$delete_heading			= str_replace("&#39;", "\'", $row['content_heading']);										
+					$delete_heading	= htmlentities($row['content_heading']);
 					$authordetails			= $aa -> getAuthor($row['content_author']);
 					$delid					= $row['content_id'];
 
 					$row['content_heading']		= $tp->toHTML($row['content_heading'], TRUE, "");
 					$row['content_subheading']	= $tp->toHTML($row['content_subheading'], TRUE, "");
-						
+
 					$text .= "
 					<tr>
 					<td class='forumheader3' style='width:5%; text-align:center'>".$delid."</td>
@@ -1481,7 +1491,7 @@
 						$content_pref					= $aa -> getContentPref($catarray[$catid][0]);
 						$content_cat_icon_path_large	= $tp -> replaceConstants($content_pref["content_cat_icon_path_large"]);
 						$content_cat_icon_path_small	= $tp -> replaceConstants($content_pref["content_cat_icon_path_small"]);
-						$delete_heading					= str_replace("&#39;", "\'", $row['content_heading']);
+						$delete_heading	= htmlentities($row['content_heading']);
 						$authordetails					= $aa -> getAuthor($row['content_author']);
 						$caticon						= $content_cat_icon_path_large.$row['content_icon'];
 
@@ -1498,7 +1508,7 @@
 
 						$options = "<a href='".e_SELF."?cat.edit.".$catid."'>".CONTENT_ICON_EDIT."</a>
 						<input type='image' title='".CONTENT_ICON_LAN_1."' name='delete[cat_{$catid}]' src='".CONTENT_ICON_DELETE_BASE."' onclick=\"return jsconfirm('".$tp->toJS(CONTENT_ADMIN_JS_LAN_9."\\n\\n".CONTENT_ADMIN_JS_LAN_0."\\n\\n[".CONTENT_ADMIN_JS_LAN_6." ".$catid." : ".$delete_heading."]\\n\\n")."')\"/>";
-						
+
 						$row['content_heading']		= $tp->toHTML($row['content_heading'], TRUE, "");
 						$row['content_subheading']	= $tp->toHTML($row['content_subheading'], TRUE, "");
 
@@ -1509,7 +1519,7 @@
 						<td class='".$class."' style='width:5%; text-align:center'>".($row['content_icon'] ? "<img src='".$caticon."' alt='' style='vertical-align:middle' />" : "&nbsp;")."</td>
 						<td class='".$class."' style='width:15%'>".($authordetails[0] != "0" ? "<a href='".e_BASE."user.php?id.".$authordetails[0]."'>".CONTENT_ICON_USER."</a>" : "")." ".$authordetails[1]."</td>
 						<td class='".$class."' style='width:65%;'>
-							 <a href='".$plugindir."content.php?cat.".$row['content_id']."'>".CONTENT_ICON_LINK."</a> 
+							 <a href='".$plugindir."content.php?cat.".$row['content_id']."'>".CONTENT_ICON_LINK."</a>
 							".$pre.$row['content_heading']." ".($row['content_subheading'] ? "[".$row['content_subheading']."]" : "")."
 						</td>
 						<td class='".$class."' style='width:10%; text-align:left; white-space:nowrap;'>
@@ -1556,7 +1566,7 @@
 						$content_pref					= $eArrayStorage->ReadArray($row['content_pref']);
 						$content_cat_icon_path_large	= $tp -> replaceConstants($content_pref["content_cat_icon_path_large"]);
 						$content_cat_icon_path_small	= $tp -> replaceConstants($content_pref["content_cat_icon_path_small"]);
-						$delete_heading					= str_replace("&#39;", "\'", $row['content_heading']);
+						$delete_heading	= htmlentities($row['content_heading']);
 						$authordetails					= $aa -> getAuthor($row['content_author']);
 						$caticon						= $content_cat_icon_path_large.$row['content_icon'];
 
@@ -1593,7 +1603,7 @@
 						<tr>
 							<td class='".$class."' style='width:5%; text-align:left'>".$catid."</td>
 							<td class='forumheader' style='width:65%;'>
-								 <a href='".$plugindir."content.php?cat.".$row['content_id']."'>".CONTENT_ICON_LINK."</a> 
+								 <a href='".$plugindir."content.php?cat.".$row['content_id']."'>".CONTENT_ICON_LINK."</a>
 								".$pre.$row['content_heading']." ".($row['content_subheading'] ? "[".$row['content_subheading']."]" : "")."
 							</td>
 							<td class='".$class."' style='width:10%; text-align:left; white-space:nowrap;'>
@@ -1637,7 +1647,7 @@
 					".CONTENT_ADMIN_MANAGER_LAN_0."<br />".CONTENT_ADMIN_MANAGER_LAN_1."<br />
 				</td>
 				<td class='forumheader3' style='text-align:left'>
-					".r_userclass("content_manager_approve", $content_pref["content_manager_approve"], 'off', "public,guest,nobody,member,admin,classes")."
+					".r_userclass("content_manager_approve", $content_pref["content_manager_approve"], 'off', "nobody,member,admin,classes")."
 				</td>
 			</tr>
 			<tr>
@@ -1645,7 +1655,7 @@
 					".CONTENT_ADMIN_MANAGER_LAN_2."<br />".CONTENT_ADMIN_MANAGER_LAN_3."<br />
 				</td>
 				<td class='forumheader3' style='text-align:left'>
-					".r_userclass("content_manager_personal", $content_pref["content_manager_personal"], 'off', "public,guest,nobody,member,admin,classes")."
+					".r_userclass("content_manager_personal", $content_pref["content_manager_personal"], 'off', "nobody,member,admin,classes")."
 				</td>
 			</tr>
 			<tr>
@@ -1653,7 +1663,7 @@
 					".CONTENT_ADMIN_MANAGER_LAN_4."<br />".CONTENT_ADMIN_MANAGER_LAN_5."<br />
 				</td>
 				<td class='forumheader3' style='text-align:left'>
-					".r_userclass("content_manager_category", $content_pref["content_manager_category"], 'off', "public,guest,nobody,member,admin,classes")."
+					".r_userclass("content_manager_category", $content_pref["content_manager_category"], 'off', "nobody,member,admin,classes")."
 				</td>
 			</tr>
 			<tr>
@@ -1702,7 +1712,7 @@
 				}
 				$formurl = e_SELF."?".e_QUERY;
 			}
-			
+
 			if(isset($_POST['preview_category'])){
 				$formurl			= e_SELF."?".e_QUERY;
 				$cat_heading		= $tp -> post_toHTML($_POST['cat_heading']);
@@ -1712,7 +1722,7 @@
 					$_POST['cat_text'] = $tp->createConstants($_POST['cat_text']); // convert e107_images/ to {e_IMAGE} etc.
 				}
 				$cat_text = $tp->post_toHTML($_POST['cat_text'],TRUE);
-				
+
 				$text = "
 				<div style='text-align:center'>
 				<table class='fborder' style='".ADMIN_WIDTH."' border='0'>
@@ -1735,7 +1745,7 @@
 				<tr><td class='forumheader3'>".CONTENT_ADMIN_CAT_LAN_16."</td><td class='forumheader3'>".($_POST['cat_pe'] == "1" ? CONTENT_ADMIN_ITEM_LAN_85 : CONTENT_ADMIN_ITEM_LAN_86)."</td></tr>
 				</table>
 				</div>";
-					  
+
 				$ns -> tablerender($cat_heading, $text);
 			}
 
@@ -1927,7 +1937,7 @@
 							$TOPIC_FIELD .= "<b>".CONTENT_ADMIN_ITEM_LAN_22." ".$content_cat_icon_path_large." ".CONTENT_ADMIN_ITEM_LAN_23."</b><br />";
 						}
 						$TOPIC_FIELD .= CONTENT_ADMIN_CAT_LAN_62."
-						<input class='tbox' type='file' name='file_userfile[]'  size='58' /> 
+						<input class='tbox' type='file' name='file_userfile[]'  size='58' />
 						<input type='hidden' name='iconpathlarge' value='".$content_cat_icon_path_large."' />
 						<input type='hidden' name='iconpathsmall' value='".$content_cat_icon_path_small."' />
 						<input class='button' type='submit' name='uploadcaticon' value='".CONTENT_ADMIN_CAT_LAN_63."' />";
@@ -2000,7 +2010,7 @@
 				if($qs[1] == "edit" && is_numeric($qs[2]) ){
 					$text .= $rs -> form_button("submit", "preview_category", (isset($_POST['preview_category']) ? CONTENT_ADMIN_MAIN_LAN_27 : CONTENT_ADMIN_MAIN_LAN_26));
 					$text .= $rs -> form_button("submit", "update_category", CONTENT_ADMIN_CAT_LAN_7).$rs -> form_button("submit", "category_clear", CONTENT_ADMIN_CAT_LAN_21).$rs -> form_hidden("parent_id", $parent).$rs -> form_hidden("cat_id", $qs[2]).$rs -> form_hidden("id", $qs[2]).$rs -> form_hidden("menuheading", $menuheading);
-					
+
 					$caption = CONTENT_ADMIN_CAT_LAN_1;
 				}else{
 					$text .= $rs -> form_button("submit", "preview_category", (isset($_POST['preview_category']) ? CONTENT_ADMIN_MAIN_LAN_27 : CONTENT_ADMIN_MAIN_LAN_26));
@@ -2019,42 +2029,57 @@
 
 
 
-		function show_contentmanager($mode, $userid="", $username=""){
-			global $content_shortcodes, $row, $tp, $sql, $ns, $rs, $plugintable, $plugindir, $aa, $eArrayStorage;
-			global $CONTENT_CONTENTMANAGER_CATEGORY, $CONTENT_CONTENTMANAGER_TABLE, $CONTENT_CONTENTMANAGER_TABLE_START, $CONTENT_CONTENTMANAGER_TABLE_END, $content_pref, $pref;
-			$personalmanagercheck = FALSE;
-
-			if(!isset($CONTENT_CONTENTMANAGER_TABLE)){
-				if(is_readable(e_THEME.$pref['sitetheme']."/content/content_manager_template.php")){
-					require_once(e_THEME.$pref['sitetheme']."/content/content_manager_template.php");
-				}else{
-					require_once(e_PLUGIN."content/templates/content_manager_template.php");
-				}
+
+	function show_contentmanager($mode, $userid="", $username="")
+	{
+		global $content_shortcodes, $row, $tp, $sql, $ns, $rs, $plugintable, $plugindir, $aa, $eArrayStorage;
+		global $CONTENT_CONTENTMANAGER_CATEGORY, $CONTENT_CONTENTMANAGER_TABLE, $CONTENT_CONTENTMANAGER_TABLE_START, $CONTENT_CONTENTMANAGER_TABLE_END, $content_pref, $pref;
+		$personalmanagercheck = FALSE;
+
+		if(!isset($CONTENT_CONTENTMANAGER_TABLE))
+		{
+			if(is_readable(e_THEME.$pref['sitetheme']."/content/content_manager_template.php"))
+			{
+				require_once(e_THEME.$pref['sitetheme']."/content/content_manager_template.php");
 			}
-			$array		= $aa -> getCategoryTree("", "", TRUE);
-			$catarray	= array_keys($array);
-			$content_contentmanager_table_string = "";
-			foreach($catarray as $catid){
-				if($sql -> db_Select($plugintable, "content_id, content_heading, content_pref", " content_id='".intval($catid)."' ")){
-					$row = $sql -> db_Fetch();
-					$content_pref = $eArrayStorage->ReadArray($row['content_pref']);
-					if( (isset($content_pref["content_manager_approve"]) && check_class($content_pref["content_manager_approve"])) || (isset($content_pref["content_manager_personal"]) && check_class($content_pref["content_manager_personal"])) || (isset($content_pref["content_manager_category"]) && check_class($content_pref["content_manager_category"])) ){
-						$personalmanagercheck = TRUE;
-						$content_contentmanager_table_string .= $tp -> parseTemplate($CONTENT_CONTENTMANAGER_TABLE, FALSE, $content_shortcodes);
-					}
-				}
+			else
+			{
+				require_once(e_PLUGIN."content/templates/content_manager_template.php");
 			}
-			if($personalmanagercheck == TRUE){
-				$text = $CONTENT_CONTENTMANAGER_TABLE_START.$content_contentmanager_table_string.$CONTENT_CONTENTMANAGER_TABLE_END;
-				$ns -> tablerender(CONTENT_ADMIN_ITEM_LAN_56, $text);
-			}else{
-				header("location:".$plugindir."content.php"); exit;
+		}
+		$array		= $aa -> getCategoryTree("", "", TRUE);
+		$catarray	= array_keys($array);
+		$content_contentmanager_table_string = "";
+		foreach($catarray as $catid)
+		{
+			if($sql -> db_Select($plugintable, "content_id, content_heading, content_pref", " content_id='".intval($catid)."' "))
+			{
+				$row = $sql -> db_Fetch(MYSQL_ASSOC);
+				$content_pref = $eArrayStorage->ReadArray($row['content_pref']);
+				if( (isset($content_pref["content_manager_approve"]) && ($content_pref["content_manager_approve"] != e_UC_PUBLIC) && check_class($content_pref["content_manager_approve"]))
+				|| (isset($content_pref["content_manager_personal"]) && ($content_pref["content_manager_personal"] != e_UC_PUBLIC) && check_class($content_pref["content_manager_personal"]))
+				|| (isset($content_pref["content_manager_category"]) && ($content_pref["content_manager_category"] != e_UC_PUBLIC) && check_class($content_pref["content_manager_category"])) )
+				{
+					$personalmanagercheck = TRUE;
+					$content_contentmanager_table_string .= $tp -> parseTemplate($CONTENT_CONTENTMANAGER_TABLE, FALSE, $content_shortcodes);
+				}
 			}
 		}
+		if($personalmanagercheck == TRUE)
+		{
+			$text = $CONTENT_CONTENTMANAGER_TABLE_START.$content_contentmanager_table_string.$CONTENT_CONTENTMANAGER_TABLE_END;
+			$ns -> tablerender(CONTENT_ADMIN_ITEM_LAN_56, $text);
+		}
+		else
+		{
+			header("location:".$plugindir."content.php"); exit;
+		}
+	}
 
 
 
-		function show_order(){
+	function show_order()
+	{
 			global $qs, $sql, $ns, $rs, $aa, $plugintable, $plugindir, $tp, $stylespacer;
 
 			if(!getperms("0")){ header("location:".e_SELF); exit; }
@@ -2071,7 +2096,7 @@
 				$text = "
 				<div style='text-align:center'>
 				".$rs -> form_open("post", e_SELF."?order", "orderform")."
-				<table class='fborder' style='".ADMIN_WIDTH."'>							
+				<table class='fborder' style='".ADMIN_WIDTH."'>
 				<tr>
 					<td class='fcaption' style='width:5%'>".CONTENT_ADMIN_CAT_LAN_24."</td>
 					<td class='fcaption' style='width:5%'>".CONTENT_ADMIN_CAT_LAN_25."</td>
@@ -2128,7 +2153,7 @@
 							$ordercatall = ($row['content_parent'] == 0 ? "<a href='".e_SELF."?order.".$catid."'>".CONTENT_ICON_ORDERALL."</a>" : "");
 						}
 						$amount = "(".($n == 1 ? $n." ".CONTENT_ADMIN_CAT_LAN_56 : $n." ".CONTENT_ADMIN_CAT_LAN_57).")";
-						
+
 						//if($ordermax > 1){
 							//up arrow
 							if($row['content_order'] != 1 && $row['content_order'] != 0){
@@ -2163,7 +2188,7 @@
 							<td class='".$class."' style='width:5%; text-align:center'>".($row['content_icon'] ? "<img src='".$caticon."' alt='' style='vertical-align:middle' />" : "&nbsp;")."</td>
 							<td class='".$class."' style='width:15%'>".($authordetails[0] != "0" ? "<a href='".e_BASE."user.php?id.".$authordetails[0]."'>".CONTENT_ICON_USER."</a>" : "")." ".$authordetails[1]."</td>
 							<td class='".$class."' style='width:50%;'>
-								<a href='".$plugindir."content.php?cat.".$row['content_id']."'>".CONTENT_ICON_LINK."</a> 
+								<a href='".$plugindir."content.php?cat.".$row['content_id']."'>".CONTENT_ICON_LINK."</a>
 								".$pre.$row['content_heading']." ".($row['content_subheading'] ? "[".$row['content_subheading']."]" : "")." ".$amount."
 							</td>
 							<td class='".$class."' style='width:5%; text-align:left; white-space:nowrap;'>
@@ -2171,7 +2196,7 @@
 								".$ordercatall."
 							</td>
 							<td class='".$class."' style='width:5%; text-align:center; white-space:nowrap;'>
-								".$up." 
+								".$up."
 								".$down."
 							</td>
 							<td class='".$class."' style='width:5%; text-align:center; white-space:nowrap;'>
@@ -2234,7 +2259,8 @@
 				</tr>";
 
 				while($row = $sqlo -> db_Fetch()){
-						$delete_heading	= str_replace("&#39;", "\'", $row['content_heading']);
+						$delete_heading	= htmlentities($row['content_heading']);
+
 						$authordetails	= $aa -> getAuthor($row['content_author']);
 						$caticon		= (isset($row['content_icon']) ? $content_icon_path.$row['content_icon'] : "");
 						$deleteicon		= CONTENT_ICON_DELETE;
@@ -2279,7 +2305,7 @@
 								".($authordetails[0] != "0" ? "<a href='".e_BASE."user.php?id.".$authordetails[0]."'>".CONTENT_ICON_USER."</a>" : "")." ".$authordetails[1]."
 							</td>
 							<td class='forumheader3' style='width:70%; text-align:left;'>
-								<a href='".$plugindir."content.php?content.".$row['content_id']."'>".CONTENT_ICON_LINK."</a> 
+								<a href='".$plugindir."content.php?content.".$row['content_id']."'>".CONTENT_ICON_LINK."</a>
 								".$row['content_heading']." (".$row['content_order'].")</td>
 							<td class='forumheader3' style='width:5%; text-align:center; white-space:nowrap;'>
 								".$up."
@@ -2331,7 +2357,7 @@
 			$content_pref					= $aa -> getContentPref(0);
 			$content_cat_icon_path_large	= $tp -> replaceConstants($content_pref["content_cat_icon_path_large"]);
 			$content_cat_icon_path_small	= $tp -> replaceConstants($content_pref["content_cat_icon_path_small"]);
-			
+
 			$text .= "
 			<tr><td colspan='5' $stylespacer></td></tr>
 			<tr>
@@ -2356,13 +2382,13 @@
 					$authordetails					= $aa -> getAuthor($row['content_author']);
 					$caticon						= $content_cat_icon_path_large.$row['content_icon'];
 
-					$text .= "								
+					$text .= "
 					<tr>
 						<td class='forumheader3' style='width:5%; text-align:left'>".$row['content_id']."</td>
 						<td class='forumheader3' style='width:5%; text-align:center'>".($row['content_icon'] ? "<img src='".$caticon."' alt='' style='vertical-align:middle' />" : "&nbsp;")."</td>
 						<td class='forumheader3' style='width:15%'>".($authordetails[0] != "0" ? "<a href='".e_BASE."user.php?id.".$authordetails[0]."'>".CONTENT_ICON_USER."</a>" : "")." ".$authordetails[1]."</td>
 						<td class='forumheader3' style='width:65%;'>
-							<a href='".$plugindir."content.php?cat.".$row['content_id']."'>".CONTENT_ICON_LINK."</a> 
+							<a href='".$plugindir."content.php?cat.".$row['content_id']."'>".CONTENT_ICON_LINK."</a>
 							".$row['content_heading']." ".($row['content_subheading'] ? "[".$row['content_subheading']."]" : "")."
 						</td>
 						<td class='forumheader3' style='width:10%; text-align:center; white-space:nowrap;'>
@@ -2413,7 +2439,7 @@
 			}else{
 				header("location:".e_SELF."?option"); exit;
 			}
-			//check prefs two times to insure they are shown, if none present, the first inserts them, the second retrieves them						
+			//check prefs two times to insure they are shown, if none present, the first inserts them, the second retrieves them
 			//$content_pref		= $aa -> getContentPref($id);
 			$content_pref		= $aa -> getContentPref($id);
 
@@ -2451,12 +2477,12 @@
 					hide=document.getElementById(hideid).style;
 					show.display=\"\";
 					hide.display=\"none\";
-					
+
 					showh=document.getElementById(showid+'help').style;
 					hideh=document.getElementById(hideid+'help').style;
 					showh.display=\"\";
 					hideh.display=\"none\";
-					
+
 					hideid = showid;
 				}
 			}
@@ -2468,8 +2494,8 @@
 			<form method='post' name='optform' action='".e_SELF."?".e_QUERY."'>\n
 
 			<div id='creation' style='text-align:center'>
-			<table style='".ADMIN_WIDTH."' class='fborder'>";						
-			
+			<table style='".ADMIN_WIDTH."' class='fborder'>";
+
 			$TOPIC_CAPTION = CONTENT_ADMIN_OPT_LAN_MENU_3;
 			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_TITLE_ROW);
 
@@ -2477,8 +2503,8 @@
 			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_SECTION_1;
 			$TOPIC_FIELD = "<table style='width:100%;' cellpadding='0' cellspacing='0'><tr><td style='white-space:nowrap;'>
 			".$rs -> form_checkbox("content_admin_subheading", 1, (isset($content_pref['content_admin_subheading']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_32."<br />
-			".$rs -> form_checkbox("content_admin_summary", 1, (isset($content_pref['content_admin_summary']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_38."<br />	
-			".$rs -> form_checkbox("content_admin_startdate", 1, (isset($content_pref['content_admin_startdate']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_33."<br />				
+			".$rs -> form_checkbox("content_admin_summary", 1, (isset($content_pref['content_admin_summary']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_38."<br />
+			".$rs -> form_checkbox("content_admin_startdate", 1, (isset($content_pref['content_admin_startdate']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_33."<br />
 			".$rs -> form_checkbox("content_admin_enddate", 1, (isset($content_pref['content_admin_enddate']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_34."<br />
 			".$rs -> form_checkbox("content_admin_icon", 1, (isset($content_pref['content_admin_icon']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_27."<br />
 			".$rs -> form_checkbox("content_admin_attach", 1, (isset($content_pref['content_admin_attach']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_2."<br />
@@ -2537,13 +2563,13 @@
 			$i=0;
 			$existing = 0;
 			$TOPIC_FIELD = "
-			<div id='div_content_custom_preset' style='width:80%;'>";						
+			<div id='div_content_custom_preset' style='width:80%;'>";
 			for($i=0;$i<count($content_pref['content_custom_preset_key']);$i++){
 				if(!empty($content_pref['content_custom_preset_key'][$i])){
 					$TOPIC_FIELD .= "
 					<span style='white-space:nowrap;'>
 					".$rs -> form_text("content_custom_preset_key[$existing]", 50, $content_pref['content_custom_preset_key'][$existing], 100)."
-					".$rs -> form_button("button", "x", "x", "onclick=\"document.getElementById('content_custom_preset_key[$existing]').value='';\"", "", "")."	
+					".$rs -> form_button("button", "x", "x", "onclick=\"document.getElementById('content_custom_preset_key[$existing]').value='';\"", "", "")."
 					</span>";
 					$existing++;
 				}
@@ -2574,16 +2600,16 @@
 
 			$text .= "
 			<div id='catcreation' style='display:none; text-align:center'>
-			<table style='".ADMIN_WIDTH."' class='fborder'>";						
-			
+			<table style='".ADMIN_WIDTH."' class='fborder'>";
+
 			$TOPIC_CAPTION = CONTENT_ADMIN_OPT_LAN_MENU_21;
 			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_TITLE_ROW);
 
 			//content_admin_sections_category
 			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_SECTION_1;
 			$TOPIC_FIELD = "<table style='width:100%;' cellpadding='0' cellspacing='0'><tr><td style='white-space:nowrap;'>
-			".$rs -> form_checkbox("content_admincat_subheading", 1, (isset($content_pref['content_admincat_subheading']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_32."<br />	
-			".$rs -> form_checkbox("content_admincat_startdate", 1, (isset($content_pref['content_admincat_startdate']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_33."<br />				
+			".$rs -> form_checkbox("content_admincat_subheading", 1, (isset($content_pref['content_admincat_subheading']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_32."<br />
+			".$rs -> form_checkbox("content_admincat_startdate", 1, (isset($content_pref['content_admincat_startdate']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_33."<br />
 			".$rs -> form_checkbox("content_admincat_enddate", 1, (isset($content_pref['content_admincat_enddate']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_34."<br />
 			".$rs -> form_checkbox("content_admincat_uploadicon", 1, (isset($content_pref['content_admincat_uploadicon']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_35."<br />
 			".$rs -> form_checkbox("content_admincat_selecticon", 1, (isset($content_pref['content_admincat_selecticon']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_36."<br />
@@ -2604,7 +2630,7 @@
 
 			$TOPIC_CAPTION = CONTENT_ADMIN_OPT_LAN_MENU_4;
 			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_TITLE_ROW);
-			
+
 			//content_submit_
 			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_9;
 			$TOPIC_FIELD = "
@@ -2630,8 +2656,8 @@
 			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_SECTION_1;
 			$TOPIC_FIELD = "<table style='width:100%;' cellpadding='0' cellspacing='0'><tr><td style='white-space:nowrap;'>
 			".$rs -> form_checkbox("content_submit_subheading", 1, (isset($content_pref['content_submit_subheading']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_32."<br />
-			".$rs -> form_checkbox("content_submit_summary", 1, (isset($content_pref['content_submit_summary']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_38."<br />	
-			".$rs -> form_checkbox("content_submit_startdate", 1, (isset($content_pref['content_submit_startdate']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_33."<br />				
+			".$rs -> form_checkbox("content_submit_summary", 1, (isset($content_pref['content_submit_summary']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_38."<br />
+			".$rs -> form_checkbox("content_submit_startdate", 1, (isset($content_pref['content_submit_startdate']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_33."<br />
 			".$rs -> form_checkbox("content_submit_enddate", 1, (isset($content_pref['content_submit_enddate']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_34."<br />
 			".$rs -> form_checkbox("content_submit_icon", 1, (isset($content_pref['content_submit_icon']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_27."<br />
 			".$rs -> form_checkbox("content_submit_attach", 1, (isset($content_pref['content_submit_attach']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_2."<br />
@@ -2704,7 +2730,7 @@
 			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
 
 			$text .= "<tr><td style='border:0; height:20px;' colspan='2'></td></tr>";
-			
+
 			//content_icon_path_
 			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_17;
 			$TOPIC_FIELD = $rs -> form_text("content_icon_path", 60, $content_pref['content_icon_path'], 100);
@@ -2716,7 +2742,7 @@
 			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
 
 			$text .= "<tr><td style='border:0; height:20px;' colspan='2'></td></tr>";
-			
+
 			//content_image_path_
 			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_18;
 			$TOPIC_FIELD = $rs -> form_text("content_image_path", 60, $content_pref['content_image_path'], 100);
@@ -2728,7 +2754,7 @@
 			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
 
 			$text .= "<tr><td style='border:0; height:20px;' colspan='2'></td></tr>";
-			
+
 			//content_file_path_
 			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_19;
 			$TOPIC_FIELD = $rs -> form_text("content_file_path", 60, $content_pref['content_file_path'], 100);
@@ -2787,7 +2813,7 @@
 				$TOPIC_FIELD .= $rs -> form_select_close()."
 			";
 			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
-			
+
 			$text .= $TOPIC_TABLE_END;
 
 			$text .= "
@@ -3044,7 +3070,7 @@
 			".$rs -> form_radio("content_list_text_link", "0", ($content_pref['content_list_text_link'] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_31."
 			";
 			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
-			
+
 			//content_list_authoremail_nonmember_
 			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_64;
 			$TOPIC_FIELD = "
@@ -3068,7 +3094,7 @@
 			".$rs -> form_radio("content_list_rating_all", "0", ($content_pref['content_list_rating_all'] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_31."
 			";
 			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
-			
+
 			//content_list_datestyle_
 			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_67;
 			$TOPIC_FIELD = $rs -> form_text("content_list_datestyle", 15, $content_pref['content_list_datestyle'], 50);
@@ -3193,7 +3219,7 @@
 			".$rs -> form_radio("content_cat_text_link", "0", ($content_pref['content_cat_text_link'] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_31."
 			";
 			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
-			
+
 			//content_cat_authoremail_nonmember_
 			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_64;
 			$TOPIC_FIELD = "
@@ -3266,7 +3292,7 @@
 			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_159;
 			$TOPIC_FIELD = $rs -> form_text("content_cat_caption", 25, $tp->toHTML($content_pref['content_cat_caption'],"","defs"), 50);
 			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
-			
+
 			//content_cat_caption_append_name
 			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_160;
 			$TOPIC_FIELD = "
@@ -3407,7 +3433,7 @@
 			".$rs -> form_checkbox("content_author_amount", 1, (isset($content_pref['content_author_amount']) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_25."<br />
 			";
 			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
-			
+
 			//content_author_nextprev_
 			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_49;
 			$TOPIC_FIELD = "
@@ -3435,7 +3461,7 @@
 			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_157;
 			$TOPIC_FIELD = $rs -> form_text("content_author_caption", 25, $tp->toHTML($content_pref['content_author_caption'],"","defs"), 50);
 			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
-			
+
 			//content_author_caption_append_name
 			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_158;
 			$TOPIC_FIELD = "
@@ -3471,7 +3497,7 @@
 			".$rs -> form_radio("content_archive_authoremail_nonmember", "0", ($content_pref['content_archive_authoremail_nonmember'] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_31."
 			";
 			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
-			
+
 			//content_archive_nextprev_
 			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_49;
 			$TOPIC_FIELD = "
@@ -3539,7 +3565,7 @@
 			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_133;
 			$TOPIC_FIELD = $rs -> form_text("content_top_icon_width", 10, $content_pref['content_top_icon_width'], 3)." ".CONTENT_ADMIN_OPT_LAN_61;
 			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
-			
+
 			//content_top_caption_
 			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_155;
 			$TOPIC_FIELD = $rs -> form_text("content_top_caption", 25, $tp->toHTML($content_pref['content_top_caption'],"","defs"), 50);
@@ -3585,7 +3611,7 @@
 			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_133;
 			$TOPIC_FIELD = $rs -> form_text("content_score_icon_width", 10, $content_pref['content_score_icon_width'], 3)." ".CONTENT_ADMIN_OPT_LAN_61;
 			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
-			
+
 			//content_score_caption_
 			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_155;
 			$TOPIC_FIELD = $rs -> form_text("content_score_caption", 25, $tp->toHTML($content_pref['content_score_caption'],"","defs"), 50);
@@ -3641,7 +3667,7 @@
 			".$rs -> form_radio("content_menu_links", "0", ($content_pref['content_menu_links'] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_31." (".CONTENT_ADMIN_OPT_LAN_97.")
 			";
 			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
-			
+
 			//content_menu_viewallcat_
 			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_98;
 			$TOPIC_FIELD = "
diff -x .svn -aruN 0.7.19.src/e107_plugins/forum/e_list.php 0.7.20.src/e107_plugins/forum/e_list.php
--- 0.7.19.src/e107_plugins/forum/e_list.php	2010-02-17 12:55:50.000000000 -0600
+++ 0.7.20.src/e107_plugins/forum/e_list.php	2010-04-15 21:35:32.000000000 -0500
@@ -1,152 +1,147 @@
 <?php
 /*
-+ ----------------------------------------------------------------------------+
-|     e107 website system
-|
-|    	Steve Dunstan 2001-2002
-|     http://e107.org
-|     jalist@e107.org
-|
-|     Released under the terms and conditions of the
-|     GNU General Public License (http://gnu.org).
-|
-|     $Source: /cvs_backup/e107_0.7/e107_plugins/forum/e_list.php,v $
-|     $Revision: 11346 $
-|     $Date: 2010-02-17 13:56:14 -0500 (Wed, 17 Feb 2010) $
-|     $Author: secretr $
-+----------------------------------------------------------------------------+
+* e107 website system
+*
+* Copyright (c) 2001-2010 e107 Inc (e107.org)
+* Released under the terms and conditions of the
+* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
+*
+* $URL: https://e107.svn.sourceforge.net/svnroot/e107/tags/e107_v07_20_release/e107_plugins/forum/e_list.php $
+* $Id: e_list.php 11479 2010-04-16 02:35:56Z mcfly_e107 $
+*
+*/
+
+/**
+*	@package e107
+*	@subpackage	forum
+*	@version $Id: e_list.php 11479 2010-04-16 02:35:56Z mcfly_e107 $;
+*
 */
 if (!defined('e107_INIT')) { exit; }
+global $pref;
+if(!isset($pref['plug_installed']['forum'])) { return; }
 
-	if(!$forum_install = $sql -> db_Select("plugin", "*", "plugin_path = 'forum' AND plugin_installflag = '1' "))
-	{
-		return;
-	}
+$LIST_CAPTION = $arr[0];
+$LIST_DISPLAYSTYLE = ($arr[2] ? "" : "none");
 
-	$LIST_CAPTION = $arr[0];
-	$LIST_DISPLAYSTYLE = ($arr[2] ? "" : "none");
+$bullet = $this -> getBullet($arr[6], $mode);
 
-	$bullet = $this -> getBullet($arr[6], $mode);
+if($mode == "new_page" || $mode == "new_menu" )
+{
+	$lvisit = $this -> getlvisit();
+	$qry = "
+	SELECT tp.thread_name AS parent_name, tp.thread_id as parent_id, f.forum_id, f.forum_name, f.forum_class, u.user_name, lp.user_name AS lp_name, t.thread_thread, t.thread_id, t.thread_views as tviews, t.thread_name, tp.thread_parent, t.thread_datestamp, t.thread_user, tp.thread_views, tp.thread_lastpost, tp.thread_lastuser, tp.thread_total_replies
+	FROM #forum_t AS t
+	LEFT JOIN #forum_t AS tp ON t.thread_parent = tp.thread_id
+	LEFT JOIN #forum AS f ON f.forum_id = t.thread_forum_id
+	LEFT JOIN #user AS u ON t.thread_user = u.user_id
+	LEFT JOIN #user AS lp ON tp.thread_lastuser = lp.user_id
+	WHERE f.forum_class REGEXP '".e_CLASS_REGEXP."'
+	AND t.thread_datestamp > $lvisit
+	ORDER BY t.thread_datestamp DESC LIMIT 0,".intval($arr[7]);
+}
+else
+{
+	$qry = "
+	SELECT t.thread_id, t.thread_name AS parent_name, t.thread_datestamp, t.thread_user, t.thread_views, t.thread_lastpost, t.thread_lastuser, t.thread_total_replies, f.forum_id, f.forum_name, f.forum_class, u.user_name, lp.user_name AS lp_name
+	FROM #forum_t AS t
+	LEFT JOIN #forum AS f ON f.forum_id = t.thread_forum_id
+	LEFT JOIN #user AS u ON t.thread_user = u.user_id
+	LEFT JOIN #user AS lp ON t.thread_lastuser = lp.user_id
+	WHERE t.thread_parent=0 AND f.forum_class REGEXP '".e_CLASS_REGEXP."'
+	ORDER BY t.thread_lastpost DESC LIMIT 0,".intval($arr[7]);
+}
+
+if(!$results = $sql->db_Select_gen($qry))
+{
+	$LIST_DATA = LIST_FORUM_2;
+}
+else
+{
+	$forumArray = $sql->db_getList();
+	$path = e_PLUGIN."forum/";
 
-	if($mode == "new_page" || $mode == "new_menu" )
-	{
-		$lvisit = $this -> getlvisit();
-		$qry = "
-		SELECT tp.thread_name AS parent_name, tp.thread_id as parent_id, f.forum_id, f.forum_name, f.forum_class, u.user_name, lp.user_name AS lp_name, t.thread_thread, t.thread_id, t.thread_views as tviews, t.thread_name, tp.thread_parent, t.thread_datestamp, t.thread_user, tp.thread_views, tp.thread_lastpost, tp.thread_lastuser, tp.thread_total_replies 
-		FROM #forum_t AS t 
-		LEFT JOIN #forum_t AS tp ON t.thread_parent = tp.thread_id 
-		LEFT JOIN #forum AS f ON f.forum_id = t.thread_forum_id 
-		LEFT JOIN #user AS u ON t.thread_user = u.user_id 
-		LEFT JOIN #user AS lp ON tp.thread_lastuser = lp.user_id 
-		WHERE f.forum_class REGEXP '".e_CLASS_REGEXP."' 
-		AND t.thread_datestamp > $lvisit 
-		ORDER BY t.thread_datestamp DESC LIMIT 0,".intval($arr[7]);
-	}
-	else
+	foreach($forumArray as $forumInfo)
 	{
-		$qry = "
-		SELECT t.thread_id, t.thread_name AS parent_name, t.thread_datestamp, t.thread_user, t.thread_views, t.thread_lastpost, t.thread_lastuser, t.thread_total_replies, f.forum_id, f.forum_name, f.forum_class, u.user_name, lp.user_name AS lp_name 
-		FROM #forum_t AS t 
-		LEFT JOIN #forum AS f ON f.forum_id = t.thread_forum_id 
-		LEFT JOIN #user AS u ON t.thread_user = u.user_id 
-		LEFT JOIN #user AS lp ON t.thread_lastuser = lp.user_id 
-		WHERE t.thread_parent=0 AND f.forum_class REGEXP '".e_CLASS_REGEXP."' 
-		ORDER BY t.thread_lastpost DESC LIMIT 0,".intval($arr[7]);
-		
-	}
+		extract($forumInfo);
 
-	if(!$results = $sql->db_Select_gen($qry))
-	{
-		$LIST_DATA = LIST_FORUM_2;
-	}
-	else
-	{
-		$forumArray = $sql->db_getList();
-		$path = e_PLUGIN."forum/";
+		//last user
+		$r_id = substr($thread_lastuser, 0, strpos($thread_lastuser, "."));
+		$r_name = substr($thread_lastuser, (strpos($thread_lastuser, ".")+1));
+		if (strstr($thread_lastuser, chr(1))) {
+			$tmp = explode(chr(1), $thread_lastuser);
+			$r_name = $tmp[0];
+		}
+		$thread_lastuser = $r_id;
 
-		foreach($forumArray as $forumInfo)
-		{
-			extract($forumInfo);
-			
-			//last user
-			$r_id = substr($thread_lastuser, 0, strpos($thread_lastuser, "."));
-			$r_name = substr($thread_lastuser, (strpos($thread_lastuser, ".")+1));
-			if (strstr($thread_lastuser, chr(1))) {
-				$tmp = explode(chr(1), $thread_lastuser);
-				$r_name = $tmp[0];
-			}
-			$thread_lastuser = $r_id;
+		//user
+		$u_id = substr($thread_user, 0, strpos($thread_user, "."));
+		$u_name = substr($thread_user, (strpos($thread_user, ".")+1));
+		$thread_user = $u_id;
+
+		if ($thread_anon) {
+			$tmp = explode(chr(1), $thread_anon);
+			$thread_user = $tmp[0];
+			$thread_user_ip = $tmp[1];
+		}
 
-			//user
-			$u_id = substr($thread_user, 0, strpos($thread_user, "."));
-			$u_name = substr($thread_user, (strpos($thread_user, ".")+1));
-			$thread_user = $u_id;
-
-			if ($thread_anon) {
-				$tmp = explode(chr(1), $thread_anon);
-				$thread_user = $tmp[0];
-				$thread_user_ip = $tmp[1];
+		$gen = new convert;
+		$r_datestamp = $gen->convert_date($thread_lastpost, "short");
+		if($thread_total_replies)
+		{
+			$LASTPOST = "";
+			if($lp_name)
+			{
+				$LASTPOST = "<a href='".e_BASE."user.php?id.{$thread_lastuser}'>$lp_name</a>";
 			}
-			
-			$gen = new convert;
-			$r_datestamp = $gen->convert_date($thread_lastpost, "short");
-			if($thread_total_replies)
+			else
 			{
-				$LASTPOST = "";
-				if($lp_name)
+				if($thread_lastuser{0} == "0")
 				{
-					$LASTPOST = "<a href='".e_BASE."user.php?id.{$thread_lastuser}'>$lp_name</a>";
+					$LASTPOST = substr($thread_lastuser, 2);
 				}
 				else
 				{
-					if($thread_lastuser{0} == "0")
-					{
-						$LASTPOST = substr($thread_lastuser, 2);
-					}
-					else
-					{
-						//$LASTPOST = NFPM_L16;
-					}
+					//$LASTPOST = NFPM_L16;
 				}
-				$LASTPOST .= " ".LIST_FORUM_6." <span class='smalltext'>$r_datestamp</span>";
-			}
-			else
-			{
-				$LASTPOST		= " - ";
-				$LASTPOSTDATE	= "";
 			}
+			$LASTPOST .= " ".LIST_FORUM_6." <span class='smalltext'>$r_datestamp</span>";
+		}
+		else
+		{
+			$LASTPOST		= " - ";
+			$LASTPOSTDATE	= "";
+		}
 
-			if($parent_name == "")
-			{
-				$parent_name = $thread_name;
-			}
-			$rowheading	= $this -> parse_heading($parent_name, $mode);
-			if($parent_id)
-			{
-				$lnk = $thread_id.".post";
-			}
-			else
-			{
-				$lnk = $thread_id;
-			}
-			$HEADING	= "<a href='".$path."forum_viewtopic.php?$lnk' title='".$parent_name."'>".$rowheading."</a>";
-			$AUTHOR		= ($arr[3] ? ($thread_anon ? $thread_user : "<a href='".e_BASE."user.php?id.$thread_user'>$user_name</a>") : "");
-			$CATEGORY	= ($arr[4] ? "<a href='".$path."forum_viewforum.php?$forum_id'>$forum_name</a>" : "");
-			$DATE		= ($arr[5] ? $this -> getListDate($thread_datestamp, $mode) : "");
-			$ICON		= $bullet;
-			$VIEWS		= $thread_views;
-			$REPLIES	= $thread_total_replies;
-			if($thread_total_replies)
-			{
-				$INFO		= "[ ".LIST_FORUM_3." ".$VIEWS.", ".LIST_FORUM_4." ".$REPLIES.", ".LIST_FORUM_5." ".$LASTPOST." ]";
-			}
-			else
-			{
-				$INFO		= "[ ".LIST_FORUM_3." ".intval($tviews)." ]";
-			}
-			$LIST_DATA[$mode][] = array( $ICON, $HEADING, $AUTHOR, $CATEGORY, $DATE, $INFO );
+		if($parent_name == "")
+		{
+			$parent_name = $thread_name;
+		}
+		$rowheading	= $this -> parse_heading($parent_name, $mode);
+		if($parent_id)
+		{
+			$lnk = $thread_id.".post";
 		}
+		else
+		{
+			$lnk = $thread_id;
+		}
+		$HEADING	= "<a href='".$path."forum_viewtopic.php?$lnk' title='".$parent_name."'>".$rowheading."</a>";
+		$AUTHOR		= ($arr[3] ? ($thread_anon ? $thread_user : "<a href='".e_BASE."user.php?id.$thread_user'>$user_name</a>") : "");
+		$CATEGORY	= ($arr[4] ? "<a href='".$path."forum_viewforum.php?$forum_id'>$forum_name</a>" : "");
+		$DATE		= ($arr[5] ? $this -> getListDate($thread_datestamp, $mode) : "");
+		$ICON		= $bullet;
+		$VIEWS		= $thread_views;
+		$REPLIES	= $thread_total_replies;
+		if($thread_total_replies)
+		{
+			$INFO		= "[ ".LIST_FORUM_3." ".$VIEWS.", ".LIST_FORUM_4." ".$REPLIES.", ".LIST_FORUM_5." ".$LASTPOST." ]";
+		}
+		else
+		{
+			$INFO		= "[ ".LIST_FORUM_3." ".$VIEWS." ]";
+		}
+		$LIST_DATA[$mode][] = array( $ICON, $HEADING, $AUTHOR, $CATEGORY, $DATE, $INFO );
 	}
-
-
+}
 ?>
\ No newline at end of file
diff -x .svn -aruN 0.7.19.src/e107_plugins/forum/forum_viewtopic.php 0.7.20.src/e107_plugins/forum/forum_viewtopic.php
--- 0.7.19.src/e107_plugins/forum/forum_viewtopic.php	2010-02-20 09:33:29.000000000 -0600
+++ 0.7.20.src/e107_plugins/forum/forum_viewtopic.php	2010-02-20 09:33:29.000000000 -0600
@@ -10,7 +10,7 @@
 |     Released under the terms and conditions of the
 |     GNU General Public License (http://gnu.org).
 |
-|     $URL: https://e107.svn.sourceforge.net/svnroot/e107/tags/e107_v07_19_release/e107_plugins/forum/forum_viewtopic.php $
+|     $URL: https://e107.svn.sourceforge.net/svnroot/e107/tags/e107_v07_20_release/e107_plugins/forum/forum_viewtopic.php $
 |     $Id: forum_viewtopic.php 11350 2010-02-20 15:33:53Z mcfly_e107 $
 +----------------------------------------------------------------------------+
 */
diff -x .svn -aruN 0.7.19.src/e107_plugins/list_new/list_class.php 0.7.20.src/e107_plugins/list_new/list_class.php
--- 0.7.19.src/e107_plugins/list_new/list_class.php	2010-02-17 12:55:50.000000000 -0600
+++ 0.7.20.src/e107_plugins/list_new/list_class.php	2010-04-15 14:45:32.000000000 -0500
@@ -11,9 +11,9 @@
 |       GNU General Public License (http://gnu.org).
 |
 |		$Source: /cvs_backup/e107_0.7/e107_plugins/list_new/list_class.php,v $
-|		$Revision: 11346 $
-|		$Date: 2010-02-17 13:56:14 -0500 (Wed, 17 Feb 2010) $
-|		$Author: secretr $
+|		$Revision: 11478 $
+|		$Date: 2010-04-15 15:45:56 -0400 (Thu, 15 Apr 2010) $
+|		$Author: e107steved $
 +---------------------------------------------------------------+
 */
 if (!defined('e107_INIT')) { exit(); }
@@ -65,7 +65,10 @@
 		return $list_pref;
 	}
 
-	function prepareSection($mode){
+
+
+	function prepareSection($mode)
+	{
 		global $list_pref;
 
 		$len = strlen($mode) + 9;
@@ -79,11 +82,15 @@
 		return $sections;
 	}
 
-	function prepareSectionArray($mode, $sections){
+
+
+	function prepareSectionArray($mode, $sections)
+	{
 		global $list_pref;
 
 		//section reference
-		for($i=0;$i<count($sections);$i++){
+		for($i=0;$i<count($sections);$i++)
+		{
 			if(isset($list_pref[$sections[$i]."_".$mode."_display"]) && $list_pref[$sections[$i]."_".$mode."_display"] == "1"){
 				$arr[$sections[$i]][0] = (isset($list_pref[$sections[$i]."_".$mode."_caption"]) ? $list_pref[$sections[$i]."_".$mode."_caption"] : "");
 				$arr[$sections[$i]][1] = (isset($list_pref[$sections[$i]."_".$mode."_display"]) ? $list_pref[$sections[$i]."_".$mode."_display"] : "");
@@ -103,7 +110,10 @@
 		return $arr;
 	}
 
-	function getDefaultSections(){
+
+
+	function getDefaultSections()
+	{
 		global $sql, $sections, $titles, $defaultarray;
 
 		//default always present sections
@@ -119,10 +129,9 @@
 	{
 		global $sql, $sections, $titles, $content_types, $content_name, $pref;
 
-//		if(!$content_install = $sql -> db_Select("plugin", "plugin_id", "plugin_path = 'content' AND plugin_installflag = '1' "))
 		if (!$content_install = isset($pref['plug_installed']['content']))		
 		{
-		  return;
+			return;
 		}
 		$datequery = " AND (content_datestamp=0 || content_datestamp < ".time().") AND (content_enddate=0 || content_enddate>".time().") ";
 
@@ -141,10 +150,11 @@
 			}
 		}
 		$content_types = array_unique($content_types);
-
 		return;
 	}
 
+
+
 	function getSections()
 	{
 		global $sql, $sections, $titles, $pref;
@@ -161,7 +171,6 @@
 			$tmp = array_reverse($tmp);
 			$icon['fname'] = $tmp[1];
 
-//			if($plugin_installed = $sql -> db_Select("plugin", "plugin_id", "plugin_path = '".$icon['fname']."' AND plugin_installflag = '1' "))
 			if ($plugin_installed = isset($pref['plug_installed'][$icon['fname']]))
 			{
 				if($icon['fname'] == "content")
@@ -178,6 +187,8 @@
 		return;
 	}
 
+
+
 	function getDefaultPrefs()
 	{
 		global $sql, $sections, $titles, $defaultarray, $content_types, $tp, $pref;
@@ -304,9 +315,13 @@
 		return $list_pref;
 	}
 
+
+
+
+
 	function show_section_list($arr, $mode, $max="")
 	{
-		global $tp, $listplugindir, $list_shortcodes, $sql, $list_pref, $defaultarray, $content_types, $content_name;
+		global $pref, $tp, $listplugindir, $list_shortcodes, $sql, $list_pref, $defaultarray, $content_types, $content_name;
 		global $LIST_ICON, $LIST_DATE, $LIST_HEADING, $LIST_AUTHOR, $LIST_CATEGORY, $LIST_INFO;
 		global $LIST_DISPLAYSTYLE, $LIST_CAPTION, $LIST_STYLE_CAPTION, $LIST_STYLE_BODY;
 		global $LIST_PAGE_NEW, $LIST_PAGE_RECENT, $LIST_MENU_NEW, $LIST_MENU_RECENT, $LIST_PAGE_NEW_START, $LIST_PAGE_RECENT_START, $LIST_MENU_NEW_START, $LIST_MENU_RECENT_START, $LIST_PAGE_NEW_END, $LIST_PAGE_RECENT_END, $LIST_MENU_NEW_END, $LIST_MENU_RECENT_END;
diff -x .svn -aruN 0.7.19.src/e107_plugins/log/stats.php 0.7.20.src/e107_plugins/log/stats.php
--- 0.7.19.src/e107_plugins/log/stats.php	2010-02-17 12:55:50.000000000 -0600
+++ 0.7.20.src/e107_plugins/log/stats.php	2010-03-13 16:13:31.000000000 -0600
@@ -11,9 +11,9 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvs_backup/e107_0.7/e107_plugins/log/stats.php,v $
-|     $Revision: 11346 $
-|     $Date: 2010-02-17 13:56:14 -0500 (Wed, 17 Feb 2010) $
-|     $Author: secretr $
+|     $Revision: 11422 $
+|     $Date: 2010-03-13 17:13:55 -0500 (Sat, 13 Mar 2010) $
+|     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
 require_once("../../class2.php");
@@ -1208,7 +1208,8 @@
 
 	/* -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
 
-	function renderMonthly() {
+	function renderMonthly() 
+	{
 		global $sql;
 
 		if(!$entries = $sql -> db_Select("logstats", "*", "log_id REGEXP('^[[:digit:]]+\-[[:digit:]]+$') ORDER BY CONCAT(LEFT(log_id,4), RIGHT(log_id,2)) DESC")) {
@@ -1220,16 +1221,28 @@
 		$monthTotal = array();
 		$mtotal = 0;
 		$utotal = 0;
-		foreach($array as $info) {
+		foreach($array as $info) 
+		{
 			$date = $info['log_id'];
 			$stats = unserialize($info['log_data']);
 
-			foreach($stats as $key => $total) {
+			/*
+			Used to have to calculate monthly stats by adding the individual page access fields
+			foreach($stats as $key => $total) 
+			{
+				if (!isset($monthTotal[$date]['totalv'])) $monthTotal[$date]['totalv'] = 0;
+				if (!isset($monthTotal[$date]['uniquev'])) $monthTotal[$date]['uniquev'] = 0;
 				$monthTotal[$date]['totalv'] += $total['ttlv'];
 				$monthTotal[$date]['uniquev'] += $total['unqv'];
 				$mtotal += $total['ttlv'];
 				$utotal += $total['unqv'];
 			}
+			*/
+			// Now we store a total, so just use that
+			$monthTotal[$date]['totalv'] = varset($stats['TOTAL']['ttlv'], 0);
+			$monthTotal[$date]['uniquev'] = varset($stats['TOTAL']['unqv'], 0);
+			$mtotal += $monthTotal[$date]['totalv'];
+			$utotal += $monthTotal[$date]['uniquev'];
 		}
 
 		$tmpArray = $this -> arraySort($monthTotal, "totalv");
diff -x .svn -aruN 0.7.19.src/e107_plugins/tree_menu/tree_menu.php 0.7.20.src/e107_plugins/tree_menu/tree_menu.php
--- 0.7.19.src/e107_plugins/tree_menu/tree_menu.php	2010-02-17 12:55:50.000000000 -0600
+++ 0.7.20.src/e107_plugins/tree_menu/tree_menu.php	2010-04-11 16:50:34.000000000 -0500
@@ -12,9 +12,9 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvs_backup/e107_0.7/e107_plugins/tree_menu/tree_menu.php,v $
-|     $Revision: 11346 $
-|     $Date: 2010-02-17 13:56:14 -0500 (Wed, 17 Feb 2010) $
-|     $Author: secretr $
+|     $Revision: 11470 $
+|     $Date: 2010-04-11 17:50:58 -0400 (Sun, 11 Apr 2010) $
+|     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
 
@@ -49,8 +49,8 @@
 // all main links now held in array, we now need to loop through them and assign the sublinks to the correct parent links ...
 
 $mainLinkArray = array();
-foreach($linkArray as $links) {
-
+foreach($linkArray as $links) 
+{
 // Updated to stop using the deprecated method of splitting the link-name in 3.
 // Now uses uses the link parent to determine the 'tree'.
 
@@ -126,11 +126,19 @@
 
 }
 
-function setlink($link_name, $link_url, $link_open, $link_description) {
+function setlink($link_name, $link_url, $link_open, $link_description) 
+{
 	global $tp;
-	switch ($link_open) {
+	if (!strstr($link_url, "http:") && !strstr($link_url, "void") && strpos($link_url, "mailto:") !== 0) 
+	{
+		$link_url = e_BASE.$link_url;
+	}
+	$link_url =	$tp->replaceConstants($link_url, $nonrelative = TRUE, $all = false);
+    $href = " href='".$link_url."'";
+	switch ($link_open) 
+	{
 		case 1:
-		$link_append = "rel='external'";
+		$link_append = " rel='external'";
 		break;
 		case 2:
 		$link_append = "";
@@ -138,23 +146,21 @@
 		case 3:
 		$link_append = "";
 		break;
+		case 4 :
+		case 5 :
+            $dimen = ($link_open == 4) ? '600,400' : '800,600';
+            $href = " href=\"javascript:open_window('".$link_url."',{$dimen})\"";
+			break;
 		default:
 		$link_append = '';
 	}
-	
-	if (!strstr($link_url, "http:") && !strstr($link_url, "void") && strpos($link_url, "mailto:") !== 0) {
-		$link_url = e_BASE.$link_url;
-	}
-	$link_url =	$tp->replaceConstants($link_url, $nonrelative = TRUE, $all = false);
 
-	if ($link_open == 4) {
-		$link = "<a style='text-decoration:none' title='".$link_description."' href=\"javascript:open_window('".$link_url."')\">".$link_name."</a>\n";
-	} else {
-		$link = "<a style='text-decoration:none' title='".$link_description."' href=\"".$link_url."\" ".$link_append.">".$link_name."</a>\n";
-	}
+	$link = "<a style='text-decoration:none' title='".$link_description."'{$link_append}{$href}')\">".$link_name."</a>\n";
 	return $link;
 }
 
+
+
 (isset($_COOKIE["treemenustatus"]) && $_COOKIE["treemenustatus"]) ? $treemenustatus = $_COOKIE["treemenustatus"] : $treemenustatus = "0";
 $text .= "
 	<script type='text/javascript'>
diff -x .svn -aruN 0.7.19.src/news.php 0.7.20.src/news.php
--- 0.7.19.src/news.php	2010-02-17 12:55:50.000000000 -0600
+++ 0.7.20.src/news.php	2010-04-05 16:34:33.000000000 -0500
@@ -11,9 +11,9 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvs_backup/e107_0.7/news.php,v $
-|     $Revision: 11346 $
-|     $Date: 2010-02-17 13:56:14 -0500 (Wed, 17 Feb 2010) $
-|     $Author: secretr $
+|     $Revision: 11461 $
+|     $Date: 2010-04-05 17:34:57 -0400 (Mon, 05 Apr 2010) $
+|     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
 require_once("class2.php");
@@ -186,7 +186,7 @@
 	{
     	$NEWSLISTTITLE = str_replace("{NEWSCATEGORY}",$tp->toHTML($category_name,FALSE,'TITLE'),$NEWSLISTTITLE);
 	}
-	$text .= "<div style='text-align:center;'><a href='".e_SELF."' alt=''>".LAN_NEWS_84."</a></div>";
+	$text .= "<div style='text-align:center;'><a href='".e_SELF."'>".LAN_NEWS_84."</a></div>";
 	ob_start();
 	$ns->tablerender($NEWSLISTTITLE, $text);
 	$cache_data = ob_get_flush();
diff -x .svn -aruN 0.7.19.src/usersettings.php 0.7.20.src/usersettings.php
--- 0.7.19.src/usersettings.php	2010-02-21 10:04:15.000000000 -0600
+++ 0.7.20.src/usersettings.php	2010-03-10 15:38:06.000000000 -0600
@@ -11,8 +11,8 @@
 |     GNU General Public License (http://gnu.org).
 |
 |     $Source: /cvs_backup/e107_0.7/usersettings.php,v $
-|     $Revision: 11352 $
-|     $Date: 2010-02-21 11:04:39 -0500 (Sun, 21 Feb 2010) $
+|     $Revision: 11409 $
+|     $Date: 2010-03-10 16:38:30 -0500 (Wed, 10 Mar 2010) $
 |     $Author: e107steved $
 +----------------------------------------------------------------------------+
 */
@@ -371,36 +371,45 @@
 	$ue_fields = "";
 	if($_POST['ue'])
 	{
-		if ($sql->db_Select('user_extended_struct', '*', 'user_extended_struct_type != 0'))		// Get field definitions, but not categories
+		if ($sql->db_Select('user_extended_struct', '*', 'order by user_extended_struct_type', 'order'))		// Get both field and category definitions
 		{
+			$skipCat = array();
 			while($row = $sql->db_Fetch())
 			{
-			  $extList["user_".$row['user_extended_struct_name']] = $row;
+				if($row['user_extended_struct_type']) 
+				{	// Its a field
+					$extList["user_".$row['user_extended_struct_name']] = $row;
+				}
+				// else its a category
+				elseif(!check_class($row['user_extended_struct_applicable']) || !check_class($row['user_extended_struct_write'])) 
+				{
+					$skipCat[] = $row['user_extended_struct_id'];
+				}
 			}
 		}
 
 		foreach ($extList as $key => $settings)
-		{
-			if ($settings['user_extended_struct_applicable'] != e_UC_NOBODY)
-			{
-			$val = '';
-			if (isset($_POST['ue'][$key])) $val = $_POST['ue'][$key]; 
-			$err = $ue->user_extended_validate_entry($val,$settings);
-			if($err === TRUE && !$_uid)
-			{  // General error - usually empty field; could be unacceptable value, or regex fail and no error message defined
-				$error .= LAN_SIGNUP_6.($tp->toHtml($settings['user_extended_struct_text'],FALSE,'defs')).' '.LAN_SIGNUP_7."\\n";
-			}
-			elseif ($err)
-			{	// Specific error message returned - usually regex fail
-				$error .= $err."\\n";
-				$err = TRUE;
-			}
-			if(!$err)
+		{	// Only process field if its in a category relevant to this user, and this user should be able to change it
+			if (!in_array($settings['user_extended_struct_parent'],$skipCat) && check_class($settings['user_extended_struct_applicable']) && check_class($settings['user_extended_struct_write']))
 			{
-				$val = $tp->toDB($val);
-				$ue_fields .= ($ue_fields) ? ", " : "";
-				$ue_fields .= $key."='".$val."'";
-			}
+				$val = '';
+				if (isset($_POST['ue'][$key])) $val = $_POST['ue'][$key]; 
+				$err = $ue->user_extended_validate_entry($val,$settings);
+				if($err === TRUE && !$_uid)
+				{  // General error - usually empty field; could be unacceptable value, or regex fail and no error message defined
+					$error .= LAN_SIGNUP_6.($tp->toHtml($settings['user_extended_struct_text'],FALSE,'defs')).' '.LAN_SIGNUP_7."\\n";
+				}
+				elseif ($err)
+				{	// Specific error message returned - usually regex fail
+					$error .= $err."\\n";
+					$err = TRUE;
+				}
+				if(!$err)
+				{
+					$val = $tp->toDB($val);
+					$ue_fields .= ($ue_fields) ? ", " : "";
+					$ue_fields .= $key."='".$val."'";
+				}
 			}
 		}
 
