--- /root/typo3/tt_news/ext_conf_template.txt	2006-06-12 10:50:44.000000000 +0000
+++ ext_conf_template.txt	2006-09-08 15:54:59.341382750 +0000
@@ -2,6 +2,9 @@
   # cat=basic//10; type=boolean; label= Use "General record storage page": This option configures the handling of news categories in BackEnd forms and on the website (FrontEnd). By default categories will be displayed only if they are found in the "General record storage page" (AKA "GRSP" or "storagePid"). If you set "useStoragePid" to "0", all categories from the pagetree will be displayed (that was the default behaviour for tt_news versions < 1.3.0). If you're updating an older tt_news version or if you need the "GRSP" for other records (e.g. fe_users) you should set this value to "0". If "useStoragePid" is set to "1" and the tt_news categories are not located in the "GRSP" you won't see any categories in BackEnd forms or on the website. See tt_news manual for more information.
 useStoragePid = 1
 
+  # cat=basic//10; type=boolean; label= Use "News Pid as Categorie Folder": This option configures the handling of news categories in BackEnd forms and on the website (FrontEnd). By default categories will be displayed only if they are found in the "General record storage page" (AKA "GRSP" or "storagePid"). If you set "useNewsPidforCat" to "0", all categories from the pagetree will be displayed (that was the default behaviour for tt_news versions < 1.3.0). If you're updating an older tt_news version or if you need the "GRSP" for other records (e.g. fe_users) you should set this value to "0". If "useStoragePid" is set to "0" and "useNewsPidforCat" is set to "1" the tt_news categories must be located in same folder like you News.
+useNewsPidforCat = 0
+
   # cat=basic/enable/120; type=boolean; label= Do not use Tab-Dividers: Here you can disable the "dividers2tabs" feature (TYPO3 > 3.7.0). "Dividers to Tabs" means: the BE form is divided in 2 sections. If you don't want this, set this value to 1.
 noTabDividers = 0
 
@@ -46,4 +49,4 @@
 /*
   ### CVS id ###
   $Id: ext_conf_template.txt,v 1.15 2006/05/19 13:58:05 rupertgermann Exp $
-*/
\ No newline at end of file
+*/
--- /root/typo3/tt_news/class.tx_ttnews_treeview.php	2006-06-12 10:50:44.000000000 +0000
+++ class.tx_ttnews_treeview.php	2006-09-08 15:58:39.459139250 +0000
@@ -212,6 +212,9 @@
 					if ($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['tt_news']) { // get tt_news extConf array
 						$confArr = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['tt_news']);
 					}
+                    if ($confArr['useNewsPidforCat']) {
+						$SPaddWhere = ' AND tt_news_cat.pid IN (' . $PA['row']['pid'] . ')';
+                    }
 					if ($confArr['useStoragePid']) {
 						$TSconfig = t3lib_BEfunc::getTCEFORM_TSconfig($table,$row);
 						$storagePid = $TSconfig['_STORAGE_PID']?$TSconfig['_STORAGE_PID']:0;
--- /tmp/class.tx_ttnews.php	2006-09-09 08:56:17.742182092 +0000
+++ pi/class.tx_ttnews.php	2006-09-09 09:01:00.207835092 +0000
@@ -1975,6 +1975,10 @@
 				$catlistWhere .= ' AND tt_news_cat.uid IN ('.implode(t3lib_div::intExplode(',',$lConf['includeList']),',').')';
 			}
 		}
+    // check useNewsPidforCat and set the pid for sql
+    if ($this->useNewsPidforCat == 1) {
+      $catlistWhere .= ' AND tt_news_cat.pid IN ('.implode(t3lib_div::intExplode(',',$this->pid_list),',').')';
+    }
 		if ($lConf['includeList'] || $this->catExclusive) {
 
 			// MOUNTS (in tree mode) must only contain the main/parent categories. Therefore it is required to filter out the subcategories from $this->catExclusive or $lConf['includeList']
@@ -2621,6 +2625,7 @@
 			$storagePid = $GLOBALS['TSFE']->getStorageSiterootPids();
 			$this->SPaddWhere = ' AND tt_news_cat.pid IN (' . $storagePid['_STORAGE_PID'] . ')';
 		}
++		$this->useNewsPidforCat = $confArr['useNewsPidforCat'];
 
 		if ($this->conf['catExcludeList']) {
 			$this->SPaddWhere .= ' AND tt_news_cat.uid NOT IN ('.$this->conf['catExcludeList'].')';
@@ -3037,4 +3042,4 @@
 	include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/tt_news/pi/class.tx_ttnews.php']);
 }
 
-?>
\ No newline at end of file
+?>
