<?php $commentMapper = new \Modules\Comment\Mappers\Comment(); ?> <style> @media (max-width: 990px) { #gallery > [class*="col-"] { padding: 0px !important; } } .panel-heading ~ .panel-image img.panel-image-preview { border-radius: 0px; } .panel-body { overflow: hidden; } .panel-image ~ .panel-footer a { padding: 0px 10px; font-size: 1.3em; color: rgb(100, 100, 100); } .panel-footer{ padding: 5px !important; color: #BBB; }
<?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
<?php $commentMapper = new \Modules\Comment\Mappers\Comment(); ?> <div id="gallery"> <?php foreach ($this->get('file') as $file) { ?> <?php $comments = $commentMapper->getCommentsByKey('downloads/index/showfile/downloads/' . $this->getRequest()->getParam('id') . '/id/' . $file->getId()); ?> <?php $image = ''; ?> <?php if ($file->getFileImage() != '') { ?> <?php $image = $this->getBaseUrl($file->getFileImage()); ?> <?php } else { ?> <?php $image = $this->getBaseUrl('application/modules/media/static/img/nomedia.png'); ?> <?php } ?> <div class="col-xs-6 col-md-4 col-lg-3 col-sm-4"> <div class="panel panel-default">
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) { echo ' <div class="col-md-2 col-sm-2 col-md-offset-' . $req . ' col-sm-offset-' . $req . ' hidden-xs">'; echo ' <figure class="thumbnail" title="' . $user->getName() . '">'; echo ' <a href="' . $obj->getUrl(array('module' => 'user', 'controller' => 'profil', 'action' => 'index', 'user' => $user->getId())) . '"><img class="img-responsive" src="' . $obj->getBaseUrl($user->getAvatar()) . '" alt="' . $user->getName() . '"></a>'; echo ' </figure>'; echo ' </div>'; echo ' <div class="col-md-' . $col . ' col-sm-' . $col . '">'; } else { $col = $col + 2; echo ' <div class="col-md-' . $col . ' col-sm-' . $col . ' col-md-offset-' . $req . ' col-sm-offset-' . $req . '">'; } echo ' <div class="panel panel-default">'; echo ' <div class="panel-bodylist">'; echo ' <div class="panel-heading right"><i class="fa fa-reply"></i> ' . $user_rep->getName() . '</div>'; echo ' <header class="text-left">'; echo ' <div class="comment-user">'; echo ' <i class="fa fa-user" title="' . $obj->getTrans('commentUser') . '"></i> <a href="' . $obj->getUrl(array('module' => 'user', 'controller' => 'profil', 'action' => 'index', 'user' => $fk_comment->getUserId())) . '">' . $user->getName() . '</a>'; echo ' </div>'; if ($config->get('comment_date') == 1) { echo '<time class="comment-date"><i class="fa fa-clock-o" title="' . $obj->getTrans('commentDateTime') . '"></i> ' . $commentDate->format("d.m.Y - H:i", true) . '</time>'; } echo ' </header>'; echo ' <div class="comment-post"><p>' . nl2br($fk_comment->getText()) . '</p></div>'; if ($obj->getUser() and $config->get('comment_reply') == 1) { echo '<p class="text-right"><a href="javascript:slideReply(\'reply_' . $fk_comment->getId() . '\');" class="btn btn-default btn-sm"><i class="fa fa-reply"></i> ' . $obj->getTrans('reply') . '</a></p>'; } echo ' </div>'; echo ' </div>'; echo ' </div>'; echo ' </article>'; if ($obj->getUser()) { echo ' <div class="replyHidden" id="reply_' . $fk_comment->getId() . '">'; echo ' <form action="" class="form-horizontal" method="POST">'; echo $obj->getTokenField(); echo ' <section class="comment-list">'; echo ' <article class="row">'; $col = $col - 1; $req = $req + 1; if ($config->get('comment_avatar') == 1) { echo ' <div class="col-md-2 col-sm-2 col-md-offset-' . $req . ' col-sm-offset-' . $req . ' hidden-xs">'; echo ' <figure class="thumbnail" title="' . $obj->getUser()->getName() . '">'; echo ' <a href="' . $obj->getUrl('user/profil/index/user/' . $obj->getUser()->getId()) . '"><img class="img-responsive" src="' . $obj->getUrl() . '/' . $obj->getUser()->getAvatar() . '" alt="' . $obj->getUser()->getName() . '"></a>'; echo ' </figure>'; echo ' </div>'; } echo ' <div class="col-md-' . $col . ' col-sm-' . $col . '">'; echo ' <div class="panel panel-default">'; echo ' <div class="panel-body">'; echo ' <div class="panel-heading right"><i class="fa fa-reply"></i> ' . $user->getName() . '</div>'; echo ' <header class="text-left">'; echo ' <div class="comment-user">'; echo ' <i class="fa fa-user" title="' . $obj->getTrans('commentUser') . '"></i> <a href="' . $obj->getUrl(array('module' => 'user', 'controller' => 'profil', 'action' => 'index', 'user' => $obj->getUser()->getId())) . '">' . $obj->getUser()->getName() . '</a>'; echo ' </div>'; if ($config->get('comment_date') == 1) { echo '<time class="comment-date"><i class="fa fa-clock-o" title="' . $obj->getTrans('commentDateTime') . '"></i> ' . $nowDate->format("d.m.Y - H:i", true) . '</time>'; } echo ' </header>'; echo ' <div class="comment-post">'; echo ' <p>'; echo ' <textarea class="form-control" accesskey="" name="article_comment_text" style="resize: vertical" required></textarea>'; echo ' </p>'; echo ' </div>'; echo ' <input type="hidden" name="fkId" value="' . $fk_comment->getId() . '" />'; echo ' <p class="text-right submit">'; echo $obj->getSaveBar('submit', 'Comment'); echo ' </p>'; echo ' </div>'; echo ' </div>'; echo ' </div>'; echo ' </article>'; echo ' </section>'; echo ' </form>'; echo ' </div>'; } $fkk_comments = $CommentMappers->getCommentsByFKId($fk_comment->getId()); $req = $req - 1; if (count($fkk_comments) > 0) { $req++; } $i = 1; foreach ($fkk_comments as $fkk_comment) { if ($i == 1) { rec($fk_comment->getId(), $fk_comment->getUserId(), $req, $obj); $i++; } } if (count($fkk_comments) > 0) { $req--; } } }
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'); 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 = 9 - $req; $req = $req + 1; echo '<article class="row" id="' . $fk_comment->getId() . '">'; if ($config->get('comment_avatar') == 1) { echo '<div class="col-md-2 col-sm-2 col-md-offset-' . $req . ' col-sm-offset-' . $req . ' hidden-xs">'; echo '<figure class="thumbnail" title="' . $user->getName() . '">'; echo '<a href="' . $obj->getUrl(array('module' => 'user', 'controller' => 'profil', 'action' => 'index', 'user' => $user->getId())) . '"><img class="img-responsive" src="' . $obj->getBaseUrl($user->getAvatar()) . '" alt="' . $user->getName() . '"></a>'; echo '</figure>'; echo '</div>'; echo '<div class="col-md-' . $col . ' col-sm-' . $col . '">'; } else { $col = $col + 2; echo '<div class="col-md-' . $col . ' col-sm-' . $col . ' col-md-offset-' . $req . ' col-sm-offset-' . $req . '">'; } echo '<div class="panel panel-default">'; echo '<div class="panel-bodylist">'; echo '<div class="panel-heading right"><i class="fa fa-reply"></i> ' . $user_rep->getName() . '</div>'; echo '<header class="text-left">'; echo '<div class="comment-user">'; echo '<i class="fa fa-user" title="' . $obj->getTrans('commentUser') . '"></i> <a href="' . $obj->getUrl(array('module' => 'user', 'controller' => 'profil', 'action' => 'index', 'user' => $fk_comment->getUserId())) . '">' . $user->getName() . '</a>'; echo '</div>'; if ($config->get('comment_date') == 1) { echo '<time class="comment-date"><i class="fa fa-clock-o" title="' . $obj->getTrans('dateTime') . '"></i> ' . $commentDate->format("d.m.Y - H:i", true) . '</time>'; } echo '</header>'; echo '<div class="comment-post"><p>' . nl2br($fk_comment->getText()) . '</p></div>'; if ($config->get('comment_reply') == 1) { echo '<p class="text-right"><a href="' . $obj->getUrl(array('module' => 'comment', 'controller' => 'index', 'action' => 'index', 'id' => $fk_comment->getId(), 'id_a' => $obj->getRequest()->getParam('id'))) . '" class="btn btn-default btn-sm"><i class="fa fa-reply"></i> ' . $obj->getTrans('reply') . '</a></p>'; } echo '</div>'; echo '</div>'; echo '</div>'; echo '</article>'; $fkk_comments = $CommentMappers->getCommentsByFKId($fk_comment->getId()); if (count($fkk_comments) > 0) { $req++; } $i = 1; foreach ($fkk_comments as $fkk_comment) { if ($i == 1) { rec($fk_comment->getId(), $fk_comment->getUserId(), $req, $obj); $i++; } } if (count($fkk_comments) > 0) { $req--; } } }