Пример #1
0
 /**
  * Zeigt die Einträge an
  *
  * @param integer $max_entries_pp Anzahl Einträge pro Seite
  */
 private function _view($max_entries_pp)
 {
     $this->_tplfile = 'gbook.tpl';
     $gbook_array = array();
     if (isset($this->_gpc['GET']['page']) && is_numeric($this->_gpc['GET']['page']) && $this->_gpc['GET']['page'] > 0) {
         $page = $this->_gpc['GET']['page'];
     } else {
         $page = 1;
     }
     $gbook_array = $this->_msbox->getEntries($max_entries_pp, $page, 'DESC', 'ASC', $this->_timeformat);
     $this->_mysql->query('SELECT COUNT(*) as many FROM `gbook` WHERE `gbook_ref_ID` = \'0\'');
     $entries = $this->_mysql->fetcharray('num');
     $this->_mysql->query('SELECT COUNT(*) as many FROM `gbook` WHERE `gbook_ref_ID` != \'0\'');
     $comments = $this->_mysql->fetcharray('num');
     $pagesnav_array = Page::get_static_pagesnav_array($entries[0], $max_entries_pp, $this->_gpc['GET']);
     //Inhalt parsen (Smilies) und an Smarty-Array übergeben
     foreach ($gbook_array as $key => $value) {
         $gbook_array[$key] = array('ID' => $value['gbook_ID'], 'title' => htmlentities($value['gbook_title']), 'content' => $this->_smilie->show_smilie(nl2br(htmlentities($value['gbook_content'])), $this->_mysql), 'name' => htmlentities($value['gbook_name']), 'time' => $value['gbook_time'], 'email' => htmlentities($value['gbook_email']), 'hp' => htmlentities($value['gbook_hp']), 'number_of_comments' => $value['number_of_comments']);
         $count = 0;
         //Kommentare durchackern
         foreach ($value['comments'] as $ckey => $cvalue) {
             $gbook_array[$key]['comments'][$ckey] = array('ID' => $cvalue['gbook_ID'], 'title' => htmlentities($cvalue['gbook_title']), 'content' => $this->_smilie->show_smilie(nl2br(htmlentities($cvalue['gbook_content'])), $this->_mysql), 'name' => htmlentities($cvalue['gbook_name']), 'time' => $cvalue['gbook_time'], 'email' => htmlentities($cvalue['gbook_email']), 'hp' => htmlentities($cvalue['gbook_hp']));
             $count++;
         }
     }
     $this->_smarty->assign('gbook', $gbook_array);
     $this->_smarty->assign('pages', $pagesnav_array);
     $this->_smarty->assign('entries', $entries[0]);
     $this->_smarty->assign('comments', $comments[0]);
 }
Пример #2
0
 /**
  * Zeigt die Einträge an
  *
  * @param int $max_entries_pp Anzahl Einträge pro Seite
  */
 private function _view($max_entries_pp)
 {
     //Daten definiere und initialisieren
     $this->_tplfile = 'news.tpl';
     $news_array = array();
     //Seite herausfinden
     if (isset($this->_gpc['GET']['page']) && is_numeric($this->_gpc['GET']['page']) && $this->_gpc['GET']['page'] > 0) {
         $page = $this->_gpc['GET']['page'];
     } else {
         $page = 1;
     }
     //Daten holen
     $news_array = $this->_msbox->getEntries($max_entries_pp, $page, 'DESC', 'ASC', $this->_timeformat);
     $this->_mysql->query('SELECT COUNT(*) as many FROM `news` WHERE `news_ref_ID` = \'0\'');
     $entries = $this->_mysql->fetcharray('num');
     $pagesnav_array = Page::get_static_pagesnav_array($entries[0], $max_entries_pp, $this->_gpc['GET']);
     $this->_smarty->assign('entrys', $entries[0]);
     foreach ($news_array as $key => $value) {
         //Nur news-Daten ohne $news_array['many'] abchecken
         $news_array[$key]['news_content'] = $this->_smilie->show_smilie(nl2br(htmlentities($value['news_content'])), $this->_mysql);
         foreach ($value['comments'] as $ckey => $cvalue) {
             $news_array[$key]['comments'][$ckey]['news_content'] = $this->_smilie->show_smilie(nl2br(htmlentities($cvalue['news_content'])), $this->_mysql);
         }
     }
     $this->_smarty->assign('newsarray', $news_array);
     $this->_smarty->assign('pages', $pagesnav_array);
 }