Exemple #1
0
 public function install()
 {
     $this->db()->queryMulti($this->getInstallSql());
     $articleMapper = new \Modules\Article\Mappers\Article();
     $catMapper = new \Modules\Article\Mappers\Category();
     /*
      * @todo change content for different types.
      */
     $cat = new \Modules\Article\Models\Category();
     $cat->setName('Allgemein');
     $catMapper->save($cat);
     $article = new \Modules\Article\Models\Article();
     $article->setCatId(1);
     $article->setTitle('Startseite');
     $article->setAuthorId(1);
     $article->setContent('Willkommen auf meiner Internetseite! Auf dieser Seite möchte ich mich als Person vorstellen.');
     $article->setPerma('startseite.html');
     $articleMapper->save($article);
 }
Exemple #2
0
<?php

$articles = $this->get('articles');
$categoryMapper = new \Modules\Article\Mappers\Category();
$commentMapper = new \Modules\Comment\Mappers\Comment();
$articlesCats = $categoryMapper->getCategoryById($this->getRequest()->getParam('id'));
?>

<legend><?php 
echo $this->getTrans('catArchives');
?>
: <i><?php 
echo $articlesCats->getName();
?>
</i></legend>
<?php 
if ($articles != '') {
    ?>
    <?php 
    foreach ($articles as $article) {
        ?>
        <?php 
        $date = new \Ilch\Date($article->getDateCreated());
        ?>
        <?php 
        $commentsCount = $commentMapper->getCountComments('article/index/show/id/' . $article->getId());
        ?>
        <?php 
        $image = $article->getArticleImage();
        ?>
        <?php 
Exemple #3
0
<?php

$comments = $this->get('comments');
$article = $this->get('article');
$commentMapper = new \Modules\Comment\Mappers\Comment();
$categoryMapper = new \Modules\Article\Mappers\Category();
$articlesCats = $categoryMapper->getCategoryById($article->getCatId());
$content = str_replace('[PREVIEWSTOP]', '', $article->getContent());
$image = $article->getArticleImage();
$imageSource = $article->getArticleImageSource();
$preview = $this->getRequest()->getParam('preview');
$config = \Ilch\Registry::get('config');
$date = new \Ilch\Date($article->getDateCreated());
$commentsCount = $commentMapper->getCountComments('article/index/show/id/' . $article->getId());
function rec($id, $uid, $req, $obj)
{
    $CommentMappers = new \Modules\Comment\Mappers\Comment();
    $userMapper = new \Modules\User\Mappers\User();
    $fk_comments = $CommentMappers->getCommentsByFKId($id);
    $user_rep = $userMapper->getUserById($uid);
    $config = \Ilch\Registry::get('config');
    $nowDate = new \Ilch\Date();
    foreach ($fk_comments as $fk_comment) {
        $commentDate = new \Ilch\Date($fk_comment->getDateCreated());
        $user = $userMapper->getUserById($fk_comment->getUserId());
        if ($req > $config->get('comment_interleaving')) {
            $req = $config->get('comment_interleaving');
        }
        $col = 10 - $req;
        echo '  <article class="row" id="comment_' . $fk_comment->getId() . '">';
        if ($config->get('comment_avatar') == 1) {