@@ -402,26 +404,23 @@
* @return categories
*/
function getPostCategories($value) {
-
$fields = 'catname';
- $table = 'tx_t3blog_cat';
- $where = 'deleted = 0 and hidden = 0 and uid = '.$value ;
+ $table = 'tx_t3blog_cat, tx_t3blog_post_cat_mm';
+ $where = 'deleted = 0 and hidden = 0 and uid_local = '.$value.' AND uid_foreign = tx_t3blog_cat.uid';
// checks for posts only available on specific fe-users
$fe_groupCheck = $GLOBALS['TSFE']->fe_user->groupData[uid];
if(empty($fe_groupCheck)) {
- $where.= ' AND '.$table.'.fe_group = "0"';
+ $where.= ' AND tx_t3blog_cat.fe_group = 0';
} else {
- $where.= ' AND ('.$table.'.fe_group = 0 OR '.$table.'.fe_group = '.$fe_groupCheck['1'].')';
+ $where.= ' AND (tx_t3blog_cat.fe_group = 0 OR tx_t3blog_cat.fe_group = '.$fe_groupCheck['1'].')';
}
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($fields, $table, $where);
- $catlist = '';
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
-
- $data = $row['catname'];
+ $data[] = $row['catname'];
}
return $data;
}
@@ -515,7 +514,7 @@
switch($field) {
- case 'author':
+ case 'author':
if($value != '') {
if($this->localPiVars['value'] == $this->pi_getLL('rss_click_comment')) {
return ''.$value.'';
@@ -527,8 +526,6 @@
break;
case 'cat':
- $category = $this->getPostCategories($value);
- return ''.$category.'';
break;
case 'fk_post':
@@ -539,14 +536,16 @@
case 'uid':
$newDate = $this->getDate($value);
- $postid = TYPE == 'Comments' ? $this->getFkPostID($value) : $value;
+ $postid = TYPE == 'Comments' ? $this->getFkPostID($value) : $value;
$day = strftime('%d', $date);
$month = strftime('%m', $date);
$year = strftime('%Y', $date);
-
+ $category = $this->getPostCategories($value);
+ $catLink = ''.implode(',', $category).'';
return ''.(stripos('http://',t3lib_div::getIndpEnv('HTTP_HOST'))?'':'http://').t3lib_div::getIndpEnv('HTTP_HOST').'/'.tslib_pibase::pi_getPageLink(t3blog_div::getBlogPid(), '', array('tx_t3blog_pi1[blogList][year]' => $year, 'tx_t3blog_pi1[blogList][month]' => $month, 'tx_t3blog_pi1[blogList][day]' => $day, 'tx_t3blog_pi1[blogList][showUid]' => $this->conf['feedItemLinkPrefix'].$postid)).'
'.(stripos('http://',t3lib_div::getIndpEnv('HTTP_HOST'))?'':'http://').t3lib_div::getIndpEnv('HTTP_HOST').'/'.tslib_pibase::pi_getPageLink(t3blog_div::getBlogPid(), '', array('tx_t3blog_pi1[blogList][year]' => $year, 'tx_t3blog_pi1[blogList][month]' => $month, 'tx_t3blog_pi1[blogList][day]' => $day, 'tx_t3blog_pi1[blogList][showUid]' => $this->conf['feedItemLinkPrefix'].$postid)).'
- ';
+
+ '.$catLink;
break;
case 'text':