Hallo, ich programiere derzeit ein Modul, welches eine Übersichtseite und zu jedem Eintrag eine Detailseite bietet. Auf dieser Detailseite soll das Kommentarmodul zum Einsatz kommen, jedoch für jede Seite die passenden Kommentare. Also für Eintrag mit ID 8 sollen alle Kommentare aufgelistet werden die zu ID 8 gehören.
Ich habe versucht es soweit aus dem FAQ Modul zu übernehmen, was auch halbwegs funktioniert, nur wenn ein Kommentar geschrieben wurde kommt folgdendes:
Code:
#0 C:\xampp\htdocs\clients_13\cms\system\libraries\Template.php(130): Controller->getTemplate(NULL)
#1 C:\xampp\htdocs\clients_13\cms\system\modules\frontend\FrontendTemplate.php(47): Template->parse()
#2 C:\xampp\htdocs\clients_13\cms\system\modules\comments\Comments.php(99): FrontendTemplate->parse()
#3 C:\xampp\htdocs\clients_13\cms\system\modules\mixes\ModuleMixesDetails.php(61): Comments->addCommentsToTemplate(Object(FrontendTemplate), Object(stdClass), 'tl_mixes', '3', Array)
#4 C:\xampp\htdocs\clients_13\cms\system\modules\frontend\Module.php(126): ModuleMixesDetails->compile()
#5 C:\xampp\htdocs\clients_13\cms\system\modules\frontend\ContentModule.php(70): Module->generate()
#6 C:\xampp\htdocs\clients_13\cms\system\libraries\Controller.php(364): ContentModule->generate()
#7 C:\xampp\htdocs\clients_13\cms\system\modules\frontend\ModuleArticle.php(170): Controller->getContentElement('5')
#8 C:\xampp\htdocs\clients_13\cms\system\modules\frontend\Module.php(126): ModuleArticle->compile()
#9 C:\xampp\htdocs\clients_13\cms\system\modules\frontend\ModuleArticle.php(69): Module->generate()
#10 C:\xampp\htdocs\clients_13\cms\system\libraries\Controller.php(297): ModuleArticle->generate(false)
#11 C:\xampp\htdocs\clients_13\cms\system\libraries\Controller.php(184): Controller->getArticle('3', false, false, 'main')
#12 C:\xampp\htdocs\clients_13\cms\system\modules\frontend\PageRegular.php(68): Controller->getFrontendModule('0', 'main')
#13 C:\xampp\htdocs\clients_13\cms\index.php(188): PageRegular->generate(Object(DB_Mysql_Result))
#14 C:\xampp\htdocs\clients_13\cms\index.php(299): Index->run()
#15 {main}
Der Code des Moduls bisher:
PHP-Code:
<?php
class ModuleMixesDetails extends ModuleMixes
{
protected $strTemplate = 'mod_mixesdetails';
protected function compile()
{
$pid = $this->Input->get('id');
$arrMixes = array();
$objMixes = $this->Database->execute("SELECT * FROM tl_mixes WHERE id = ".$pid);
while ($objMixes->next())
{
$arrMixes[] = array
(
'name' => $objMixes->name,
'duration' => $objMixes->duration,
'datum' => $objMixes->datum,
'description' => $objMixes->description,
'img' => $this->getImage($objMixes->img, '120', _),
'link' => $objMixes->link
);
}
$this->Template->mixes = $arrMixes;
$this->Template->allowComments = true;
$this->import('Comments');
$arrNotifies = array();
// Notify system administrator
if ($objMixes->notify != 'notify_author')
{
$arrNotifies[] = $GLOBALS['TL_ADMIN_EMAIL'];
}
// Notify author
if ($objMixes->notify != 'notify_admin')
{
$objAuthor = $this->Database->prepare("SELECT email FROM tl_user WHERE id=?")
->limit(1)
->execute($objMixes->authorId);
if ($objAuthor->numRows)
{
$arrNotifies[] = $objAuthor->email;
}
}
$objConfig = new stdClass();
$objConfig->perPage = $objMixes->perPage;
$objConfig->order = $objMixes->sortOrder;
$objConfig->template = $objMixes->template;
$objConfig->requireLogin = $objMixes->requireLogin;
$objConfig->disableCaptcha = $objMixes->disableCaptcha;
$objConfig->bbcode = $objMixes->bbcode;
$objConfig->moderate = $objMixes->moderate;
$this->Comments->addCommentsToTemplate($this->Template, $objConfig, 'tl_mixes', $objMixes->id, $arrNotifies);
}
}
?>
Vielen Dank im voraus für eure Lösungsvorschläge
Viele Grüße
Lesezeichen