Selbst ist der Mann
Nach langem Experimentieren ist es mir selbst gelungen. Hier nun für alle die evtl ein ähnliches Problem haben meine Lösung:
PHP-Code:
<?php
class ModuleMixesStart extends ModuleMixes
{
protected $strTemplate = 'mod_mixesstart';
protected function compile()
{
$page = $this->Input->get('page') ? $this->Input->get('page') : 1;
$limit = 4;
$offset = ($page - 1) * $limit;
$objMixes = $this->Database->execute("SELECT name,datum,img,id, COUNT(id) AS count FROM tl_mixes");
// Add pagination menu
$objPagination = new Pagination($objMixes->count, $limit);
$this->Template->pagination = $objPagination->generate("\n ");
if ($limit)
{
$objMixes = $this->Database->execute("SELECT * FROM tl_mixes ORDER BY datum DESC LIMIT ".$offset.",".$limit);
}
$total = $objMixes->numRows;
$arrMixes = array();
if ($total > 0)
{
$count = 0;
while ($objMixes->next())
{
$arrMixes[] = array
(
'name' => $objMixes->name,
'datum' => $objMixes->datum,
'img' => $this->getImage($objMixes->img, '89', _),
'id' => $objMixes->id
);
}
}
$this->Template->mixes = $arrMixes;
}
}
?>
Lesezeichen