Ich habe die function getItemMarkerArray in der pi/class.ttnews.php geändert, wie ich vermute, dass es hier gemeint war. Keine Ahnung, ob das elegant ist, oder eigentlich völliger Mumpitz, aber es funktioniert.
/**
* Fills in the markerArray with data for a news item
*
* @param array $row : result row for a news item
* @param array $textRenderObj : conf vars for the current template
* @return array $markerArray: filled marker array
*/
function getItemMarkerArray ($row, $textRenderObj = 'displaySingle') {
// get config for current template part:
$lConf = $this->conf[$textRenderObj . '.'];
$this->local_cObj->start($row, 'tt_news');
$markerArray = array();
// get image markers
$markerArray = $this->getImageMarkers($markerArray, $row, $lConf, $textRenderObj);
// find categories for the current record
if (!is_array($this->categories[$row['uid']])) {
$this->categories[$row['uid']] = $this->getCategories($row['uid']);
}
$markerArray['###NEWS_CATEGORY_ROOTLINE###'] = '';
if ($this->conf['catRootline.']['showCatRootline'] && $textRenderObj == 'displaySingle') {
$markerArray['###NEWS_CATEGORY_ROOTLINE###'] = $this->getCategoryPath($this->categories[$row['uid']]);
}
// get markers and links for categories
$markerArray = $this->getCatMarkerArray($markerArray, $row, $lConf);
$markerArray['###NEWS_UID###'] = $row['uid'];
// show language label and/or flag
$markerArray['###NEWS_LANGUAGE###'] = '';
if ($this->conf['showLangLabels']) {
$L_uid = $row['sys_language_uid'];
$markerArray['###NEWS_LANGUAGE###'] = $this->langArr[$L_uid]['title'];
}
if ($this->langArr[$L_uid]['flag'] && $this->conf['showFlags']) {
$fImgFile = ($this->conf['flagPath']?$this->conf['flagPath']:'media/uploads/flag_') . $this->langArr[$L_uid]['flag'];
$fImgConf = $this->conf['flagImage.'];
$fImgConf['file'] = $fImgFile;
$flagImg = $this->local_cObj->IMAGE($fImgConf);
// debug ($fImgConf);
$markerArray['###NEWS_LANGUAGE###'] .= $flagImg;
}
$markerArray['###NEWS_TITLE###'] = $this->local_cObj->stdWrap($row['title'], $lConf['title_stdWrap.']);
$newsAuthor = $this->local_cObj->stdWrap($row['author']?$this->pi_getLL('preAuthor').' '.$row['author']:'', $lConf['author_stdWrap.']);
$markerArray['###NEWS_AUTHOR###'] = $this->formatStr($newsAuthor);
$markerArray['###NEWS_EMAIL###'] = $this->local_cObj->stdWrap($row['author_email'], $lConf['email_stdWrap.']);
$markerArray['###NEWS_DATE###'] = $this->local_cObj->stdWrap($row['datetime'], $lConf['date_stdWrap.']);
$markerArray['###NEWS_TIME###'] = $this->local_cObj->stdWrap($row['datetime'], $lConf['time_stdWrap.']);
$markerArray['###NEWS_AGE###'] = $this->local_cObj->stdWrap($row['datetime'], $lConf['age_stdWrap.']);
$markerArray['###TEXT_NEWS_AGE###'] = $this->local_cObj->stdWrap($this->pi_getLL('textNewsAge'), $lConf['textNewsAge_stdWrap.']);
if ($this->config['croppingLenght']) {
$lConf['subheader_stdWrap.']['crop'] = $this->config['croppingLenght'];
}
$markerArray['###NEWS_SUBHEADER###'] = '';
if (!$this->piVars[$this->config['singleViewPointerName']] || $this->conf['subheaderOnAllSViewPages']) {
$markerArray['###NEWS_SUBHEADER###'] = $this->formatStr($this->local_cObj->stdWrap($row['short'], $lConf['subheader_stdWrap.']));
}
$markerArray['###NEWS_KEYWORDS###'] = $this->local_cObj->stdWrap($row['keywords'], $lConf['keywords_stdWrap.']);
if (!$this->piVars[$this->config['singleViewPointerName']]) {
if ($textRenderObj == 'displaySingle') {
// load the keywords the register 'newsKeywords' to access it from TS
$this->local_cObj->LOAD_REGISTER(array(
'newsKeywords' => $row['keywords'],
'newsSubheader' => $row['short']
), '');
}
}
if ($textRenderObj == 'displaySingle' && !$row['no_auto_pb'] && $this->config['maxWordsInSingleView']>1) {
$row['bodytext'] = $this->insertPagebreaks($row['bodytext'],count(t3lib_div::trimExplode(' ',$row['short'],1)));
}
if (strpos($row['bodytext'],$this->config['pageBreakToken'])) {
if ($this->config['useMultiPageSingleView'] && $textRenderObj == 'displaySingle') {
$tmp = $this->makeMultiPageSView($row['bodytext'],$lConf);
$newscontent = $tmp[0];
$sViewPagebrowser = $tmp[1];
} else {
$newscontent = $this->formatStr($this->local_cObj->stdWrap(preg_replace('/'.$this->config['pageBreakToken'].'/','',$row['bodytext']), $lConf['content_stdWrap.']));
}
} else {
$newscontent = $this->formatStr($this->local_cObj->stdWrap($row['bodytext'], $lConf['content_stdWrap.']));
}
if ($this->conf['appendSViewPBtoContent']) {
$newscontent = $newscontent.$sViewPagebrowser;
$sViewPagebrowser = '';
}
require_once( PATH_t3lib."class.t3lib_parsehtml_proc.php" );
$k_parser = new t3lib_parsehtml_proc();
$newscontent = $k_parser->TS_links_rte( $newscontent );
$markerArray['###NEWS_CONTENT###'] = $k_parser->TS_transform_rte( $newscontent );
$markerArray['###NEWS_SINGLE_PAGEBROWSER###'] = $sViewPagebrowser;
$markerArray['###MORE###'] = $this->pi_getLL('more');
// get title (or its language overlay) of the page where the backLink points to (this is done only in single view)
if ($this->config['backPid'] && $textRenderObj == 'displaySingle') {
if ($GLOBALS['TSFE']->sys_language_content) {
$p_res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
'*',
'pages_language_overlay',
'1=1 AND pid=' . $this->config['backPid'] . ' AND sys_language_uid=' . $GLOBALS['TSFE']->sys_language_content);
$backP = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($p_res);
} else {
$backP = $this->pi_getRecord('pages', $this->config['backPid']);
}
}
// generate the string for the backLink. By setting the conf-parameter 'hscBackLink',
// you can switch whether the string is parsed through htmlspecialchars() or not.
$markerArray['###BACK_TO_LIST###'] = sprintf($this->pi_getLL('backToList', '', $this->conf['hscBackLink']), $backP['title']);
// get related news
if ($textRenderObj == 'displaySingle' || $this->conf['alwaysShowRelated']) {
$relatedNews = $this->getRelated($row['uid']);
}
$markerArray['###TEXT_RELATED###'] = '';
$markerArray['###NEWS_RELATED###'] = '';
if ($relatedNews) {
$rel_stdWrap = t3lib_div::trimExplode('|', $this->conf['related_stdWrap.']['wrap']);
$markerArray['###TEXT_RELATED###'] = $rel_stdWrap[0].$this->local_cObj->stdWrap($this->pi_getLL('textRelated'), $this->conf['relatedHeader_stdWrap.']);
$markerArray['###NEWS_RELATED###'] = $relatedNews.$rel_stdWrap[1];
}
// Links
$markerArray['###TEXT_LINKS###'] = '';
$markerArray['###NEWS_LINKS###'] = '';
if ($row['links']) {
$links_stdWrap = t3lib_div::trimExplode('|', $lConf['links_stdWrap.']['wrap']);
$newsLinks = $this->local_cObj->stdWrap($this->formatStr($row['links']), $lConf['linksItem_stdWrap.']);
$markerArray['###TEXT_LINKS###'] = $links_stdWrap[0].$this->local_cObj->stdWrap($this->pi_getLL('textLinks'), $lConf['linksHeader_stdWrap.']);
$markerArray['###NEWS_LINKS###'] = $newsLinks.$links_stdWrap[1];
}
// filelinks
$markerArray['###TEXT_FILES###'] = '';
$markerArray['###FILE_LINK###'] = '';
if ($row['news_files']) {
$files_stdWrap = t3lib_div::trimExplode('|', $this->conf['newsFiles_stdWrap.']['wrap']);
$markerArray['###TEXT_FILES###'] = $files_stdWrap[0].$this->local_cObj->stdWrap($this->pi_getLL('textFiles'), $this->conf['newsFilesHeader_stdWrap.']);
$fileArr = explode(',', $row['news_files']);
$files = '';
while (list(, $val) = each($fileArr)) {
// fills the marker ###FILE_LINK### with the links to the atached files
$filelinks .= $this->local_cObj->filelink($val, $this->conf['newsFiles.']) ;
}
$markerArray['###FILE_LINK###'] = $filelinks.$files_stdWrap[1];
}
// show news with the same categories in SINGLE view
if ($textRenderObj == 'displaySingle' && $this->conf['showRelatedNewsByCategory'] && count($this->categories[$row['uid']])) {
// save some variables which are used to build the backLonk to the list view
$tmpcatExclusive = $this->catExclusive;
$tmpcode = $this->theCode;
$tmpBrowsePage = $this->piVars['pointer'];
unset($this->piVars['pointer']);
$tmpPS = $this->piVars['pS'];
unset($this->piVars['pS']);
$tmpPL = $this->piVars['pL'];
unset($this->piVars['pL']);
if(is_array($this->categories[$row['uid']])) {
$this->catExclusive = implode(array_keys($this->categories[$row['uid']]),',');
}
$this->config['categoryMode'] = 1;
$this->theCode = 'LIST';
$relNewsByCat = trim($this->displayList($row['uid']));
// restore variables
$this->theCode = $tmpcode;
$this->catExclusive = $tmpcatExclusive;
$this->piVars['pointer'] = $tmpBrowsePage;
$this->piVars['pS'] = $tmpPS;
$this->piVars['pL'] = $tmpPL;
}
$markerArray['###NEWS_RELATEDBYCATEGORY###'] = '';
$markerArray['###TEXT_RELATEDBYCATEGORY###'] = '';
if ($this->conf['showRelatedNewsByCategory'] && $relNewsByCat) {
$cat_rel_stdWrap = t3lib_div::trimExplode('|', $this->conf['relatedByCategory_stdWrap.']['wrap']);
$markerArray['###TEXT_RELATEDBYCATEGORY###'] = $cat_rel_stdWrap[0].$this->local_cObj->stdWrap($this->pi_getLL('textRelatedByCategory'), $this->conf['relatedByCategoryHeader_stdWrap.']);
$markerArray['###NEWS_RELATEDBYCATEGORY###'] = $relNewsByCat.$cat_rel_stdWrap[1];
}
// the both markers: ###ADDINFO_WRAP_B### and ###ADDINFO_WRAP_E### are only inserted, if there are any files, related news or links
$markerArray['###ADDINFO_WRAP_B###'] = '';
$markerArray['###ADDINFO_WRAP_E###'] = '';
if ($relatedNews || $row['links'] || $row['news_files'] || $relNewsByCat) {
$addInfo_stdWrap = t3lib_div::trimExplode('|', $lConf['addInfo_stdWrap.']['wrap']);
$markerArray['###ADDINFO_WRAP_B###'] = $addInfo_stdWrap[0];
$markerArray['###ADDINFO_WRAP_E###'] = $addInfo_stdWrap[1];
}
// Page fields:
$markerArray['###PAGE_UID###'] = $row['pid'];
$markerArray['###PAGE_TITLE###'] = $this->pageArray[$row['pid']]['title'];
$markerArray['###PAGE_AUTHOR###'] = $this->local_cObj->stdWrap($this->pageArray[$row['pid']]['author'], $lConf['author_stdWrap.']);
$markerArray['###PAGE_AUTHOR_EMAIL###'] = $this->local_cObj->stdWrap($this->pageArray[$row['pid']]['author_email'], $lConf['email_stdWrap.']);
// XML
if ($this->theCode == 'XML') {
$markerArray['###NEWS_TITLE###'] = $this->cleanXML($this->local_cObj->stdWrap($row['title'], $lConf['title_stdWrap.']));
$markerArray['###NEWS_AUTHOR###'] = $row['author_email']?'<author>'.$row['author_email'].'</author>':'';
if($this->conf['displayXML.']['xmlFormat'] == 'atom03' ||
$this->conf['displayXML.']['xmlFormat'] == 'atom1') {
$markerArray['###NEWS_AUTHOR###'] = $row['author'];
}
if($this->conf['displayXML.']['xmlFormat'] == 'rss2' ||
$this->conf['displayXML.']['xmlFormat'] == 'rss091') {
$markerArray['###NEWS_SUBHEADER###'] = $this->cleanXML($this->local_cObj->stdWrap($row['short'], $lConf['subheader_stdWrap.']));
} elseif ($this->conf['displayXML.']['xmlFormat'] == 'atom03' ||
$this->conf['displayXML.']['xmlFormat'] == 'atom1') {
//html doesn't need to be striped off in atom feeds
$lConf['subheader_stdWrap.']['stripHtml'] = 0;
$markerArray['###NEWS_SUBHEADER###'] = $this->local_cObj->stdWrap($row['short'], $lConf['subheader_stdWrap.']);
//just removing some whitespace to ease atom feed building
$markerArray['###NEWS_SUBHEADER###'] = str_replace('\n', '', $markerArray['###NEWS_SUBHEADER###']);
$markerArray['###NEWS_SUBHEADER###'] = str_replace('\r', '', $markerArray['###NEWS_SUBHEADER###']);
}
if($this->conf['displayXML.']['xmlFormat'] == 'rss2' ||
$this->conf['displayXML.']['xmlFormat'] == 'rss091') {
$markerArray['###NEWS_DATE###'] = date('D, d M Y H:i:s O', $row['datetime']);
} elseif ($this->conf['displayXML.']['xmlFormat'] == 'atom03' ||
$this->conf['displayXML.']['xmlFormat'] == 'atom1') {
$markerArray['###NEWS_DATE###'] = $this->getW3cDate($row['datetime']);
}
//dates for atom03
$markerArray['###NEWS_CREATED###'] = $this->getW3cDate($row['crdate']);
$markerArray['###NEWS_MODIFIED###'] = $this->getW3cDate($row['tstamp']);
if($this->conf['displayXML.']['xmlFormat'] == 'atom03' && !empty($this->conf['displayXML.']['xmlLang'])) {
$markerArray['###SITE_LANG###'] = ' xml:lang="'.$this->conf['displayXML.']['xmlLang'].'"';
}
$markerArray['###NEWS_ATOM_ENTRY_ID###'] = 'tag:'.substr($this->config['siteUrl'], 11, -1).','.date('Y', $row['crdate']).':article'.$row['uid'];
$markerArray['###SITE_LINK###'] = $this->config['siteUrl'];
}
// Adds hook for processing of extra item markers
if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['tt_news']['extraItemMarkerHook'])) {
foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['tt_news']['extraItemMarkerHook'] as $_classRef) {
$_procObj = & t3lib_div::getUserObj($_classRef);
$markerArray = $_procObj->extraItemMarkerProcessor($markerArray, $row, $lConf, $this);
}
}
// Pass to user defined function
if ($this->conf['itemMarkerArrayFunc']) {
$markerArray = $this->userProcess('itemMarkerArrayFunc', $markerArray);
}
return $markerArray;
}
Geändert sind nur die Zeilen 95-98. Vieleicht hilfts ja jemandem.
Gruß, Karsten