Hallo Leute,
ich benutze "mininews" für unseren Pressecorner. Auf der Seite mit den "frontpage_listing" klappt das wunderbar. Aber auf der "Archiv" Seite werden wieder alle angezeigt anstatt nur die, die nicht auf Frontpage ersichtlich sind.
Hat jemand das schonmal umgesetzt ?
Generell wird die DB ausgelesen wobei auch der Wert "front_page" abgefragt wird, was ja nicht so übel ist, denn eigentlich brauche ich fürs Archiv alle die Einträge wo front_page = 0 ist.
$content = $this->singleView();
if (!is_array($this->TA)) { // !TemplaVoila:
$content .= $lConf['HR_code'] . '<p>' . $this->pi_list_linkSingle($this->pi_getLL('archive', 'News archive', TRUE), 0) . '</p>';
}
return $content;
} else {
if (!isset($this->piVars['pointer'])) {
$this->piVars['pointer'] = 0;
}
// Initializing the query parameters:
list($this->internal['orderBy'], $this->internal['descFlag']) = explode(':','datetime:1'); //explode(':',$this->piVars['sort']);
$this->internal['maxPages'] = t3lib_div::intInRange($lConf['maxPages'],0,1000,2); // The maximum number of 'pages' in the browse-box: 'Page 1', 'Page 2', etc.
$this->internal['searchFieldList'] = 'title,teaser,full_text';
$this->internal['orderByList'] = 'datetime,title';
$this->internal['dontLinkActivePage'] = true;
$addWhere = $FP ? ' AND front_page>0 ' : '';
// Get total number of news for page browser:
$query = $this->pi_list_query('tx_mininews_news', true, $addWhere);
$res = $GLOBALS['TYPO3_DB']->sql_query($query);
$row = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
$GLOBALS['TYPO3_DB']->sql_free_result($res);
$this->internal['res_count'] = $row[0];
// Make listing query, pass query to MySQL:
$this->internal['results_at_a_time'] = t3lib_div::intInRange($lConf['results_at_a_time'], 0, 1000, 3); // Number of results to show in a listing.
$query = $this->pi_list_query('tx_mininews_news', false, $addWhere);
$res = $GLOBALS['TYPO3_DB']->sql_query($query);
$this->internal['currentTable'] = 'tx_mininews_news';
// Put the whole list together:
$fullTable = ''; // Clear var;
// Determine mode of listing:
if ($FP) { // Frontpage listing:
// Adds the whole list table
$fullTable .= $this->makefrontpagelist($res);
} else { // Archive listing:
if (is_array($this->TA)) { // TemplaVoila:
$fullTable .= $this->templaVoilaList($res);
} else {
// Adds the whole list table
$fullTable .= $this->makelist($res);
// Adds the search box:
if (!$lConf['disableSearch']) {
$fullTable .= $this->pi_list_searchBox();
}
if ($this->internal['res_count'] > $lConf['results_at_a_time']) {
// Adds the result browser:
$this->pi_alwaysPrev = -1;
$fullTable .= $this->pi_list_browseresults();
}
}
}
$GLOBALS['TYPO3_DB']->sql_free_result($res);
// Returns the content from the plugin.
return $fullTable;
}
}
Das Listing im Archiv wird dann so erzeugt:
function makelist($res) {
$items = array();
// Make list table rows
$first = true;
$count = $GLOBALS['TYPO3_DB']->sql_num_rows($res); $cur = 1;
while($this->internal['currentRow'] = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$items[] = $this->makeListItem($first, $cur == $count);
$first = false; $cur++;
}
$out = ($this->disablePrefixComment ? '' : '
<!--
Archive listing of mininews:
-->
') . '<div'.$this->pi_classParam('listrow').'>
'.implode(chr(10),$items).'
</div>';
return $out;
}
Ich hier schon versucht eine gleiche Abfrage wie oben der DB zusätzlich einzubauen die eben bei $addwhere abfragt ob "front_page=0" ist. Aber meist kommen dann gar keine Einträge mehr im Archiv 😉 Also wohl irgendwas faul an meiner Denkweise.
Für Hilfe wäre ich sehr dankbar.
lG
Roland