public function render() { $date = new \Ilch\Date(); $statisticMapper = new \Modules\Statistic\Mappers\Statistic(); $this->getView()->set('visitsToday', $statisticMapper->getVisitsCount($date->format('Y-m-d', true))); $this->getView()->set('visitsOnline', $statisticMapper->getVisitsCountOnline()); $date->modify('-1 day'); $this->getView()->set('visitsYesterday', $statisticMapper->getVisitsCount($date->format('Y-m-d', true))); $this->getView()->set('visitsMonth', $statisticMapper->getVisitsMonthCount()); $this->getView()->set('visitsYear', $statisticMapper->getVisitsYearCount()); $this->getView()->set('visitsRegistUser', $statisticMapper->getRegistUserCount()); $this->getView()->set('visitsTotal', $statisticMapper->getVisitsCount()); }
public function showAction() { $jobsMapper = new JobsMapper(); $userMapper = new UserMapper(); $id = $this->getRequest()->getParam('id'); $job = $jobsMapper->getJobsById($id); $this->getLayout()->getHmenu()->add($this->getTranslator()->trans('menuJobs'), array('action' => 'index'))->add($job->getTitle(), array('action' => 'show', 'id' => $id)); if ($this->getRequest()->getPost('saveApply')) { $title = trim($this->getRequest()->getPost('title')); $text = trim($this->getRequest()->getPost('text')); echo $title; if (empty($text)) { $this->addMessage('missingText', 'danger'); } else { $date = new \Ilch\Date(); $job = $jobsMapper->getJobsById($id); $user = $userMapper->getUserById($this->getUser()->getId()); if ($_SESSION['layout'] == $this->getConfig()->get('default_layout') && file_exists(APPLICATION_PATH . '/layouts/' . $this->getConfig()->get('default_layout') . '/views/modules/jobs/layouts/mail/apply.php')) { $messageTemplate = file_get_contents(APPLICATION_PATH . '/layouts/' . $this->getConfig()->get('default_layout') . '/views/modules/jobs/layouts/mail/apply.php'); } else { $messageTemplate = file_get_contents(APPLICATION_PATH . '/modules/jobs/layouts/mail/apply.php'); } $messageReplace = array('{applyAs}' => $this->getTranslator()->trans('applyAs') . ' ' . $title, '{content}' => $text, '{sitetitle}' => $this->getConfig()->get('page_title'), '{date}' => $date->format("l, d. F Y", true)); $message = str_replace(array_keys($messageReplace), array_values($messageReplace), $messageTemplate); $mail = new \Ilch\Mail(); $mail->setTo($job->getEmail(), '')->setSubject($this->getTranslator()->trans('applyAs') . ' ' . $title)->setFrom($user->getEmail(), $user->getName())->setMessage($message)->addGeneralHeader('Content-type', 'text/html; charset="utf-8"'); $mail->send(); $this->addMessage('sendSuccess'); $this->redirect(array('action' => 'index')); } } $this->getView()->set('job', $job); $this->getView()->set('jobs', $jobsMapper->getJobs(array('show' => 1))); }
public function showAction() { $statisticMapper = new StatisticMapper(); $month = $this->getRequest()->getParam('month'); $year = $this->getRequest()->getParam('year'); if ($year != '' and $month != '') { $date = new \Ilch\Date($year . '-' . $month . '-01'); $this->getLayout()->getHmenu()->add($this->getTranslator()->trans('menuStatistic'), array('action' => 'index'))->add($date->format('F', true), array('action' => 'show', 'year' => $year, 'month' => $month))->add($date->format('Y', true), array('action' => 'show', 'year' => $year)); } elseif ($year != '') { $date = new \Ilch\Date($year . '-01-01'); $this->getLayout()->getHmenu()->add($this->getTranslator()->trans('menuStatistic'), array('action' => 'index'))->add($date->format('Y', true), array('action' => 'show', 'year' => $year)); } if ($year != '' and $month != '') { $this->getView()->set('visitsTotal', $statisticMapper->getVisitsMonthCount($year, $month)); $this->getView()->set('statisticHourList', $statisticMapper->getVisitsHour($year, $month)); $this->getView()->set('statisticDayList', $statisticMapper->getVisitsDay($year, $month)); $this->getView()->set('statisticYearMonthDayList', $statisticMapper->getVisitsYearMonthDay($year, $month)); $this->getView()->set('statisticYearList', $statisticMapper->getVisitsYear($year)); $this->getView()->set('statisticBrowserList', $statisticMapper->getVisitsBrowser($year, $month)); $this->getView()->set('statisticLanguageList', $statisticMapper->getVisitsLanguage($year, $month)); $this->getView()->set('statisticOSList', $statisticMapper->getVisitsOS($year, $month)); } elseif ($month == '' and $year != '') { $this->getView()->set('visitsTotal', $statisticMapper->getVisitsCount('', $year)); $this->getView()->set('statisticHourList', $statisticMapper->getVisitsHour($year)); $this->getView()->set('statisticDayList', $statisticMapper->getVisitsDay($year)); $this->getView()->set('statisticYearMonthList', $statisticMapper->getVisitsYearMonth($year)); $this->getView()->set('statisticYearList', $statisticMapper->getVisitsYear($year)); $this->getView()->set('statisticBrowserList', $statisticMapper->getVisitsBrowser($year)); $this->getView()->set('statisticLanguageList', $statisticMapper->getVisitsLanguage($year)); $this->getView()->set('statisticOSList', $statisticMapper->getVisitsOS($year)); } }
public function render() { $date = new \Ilch\Date(); $birthdayMapper = new BirthdayMapper(); $this->getView()->set('birthdayDateNowYMD', $date->format('Ymd')); $this->getView()->set('birthdayListNOW', $birthdayMapper->getBirthdayUserList($this->getConfig()->get('bday_boxShow'))); }
public function showAction() { $articleMapper = new ArticleMapper(); $date = new \Ilch\Date('' . $this->getRequest()->getParam('year') . '-' . $this->getRequest()->getParam('month') . '-01'); $this->getLayout()->getHmenu()->add($this->getTranslator()->trans('menuArticle'), array('controller' => 'index', 'action' => 'index'))->add($this->getTranslator()->trans('menuArchives'), array('action' => 'index'))->add($date->format('F Y', true), array('action' => 'show', 'year' => $this->getRequest()->getParam('year'), 'month' => $this->getRequest()->getParam('month'))); $date = $this->getRequest()->getParam('year') . '-' . $this->getRequest()->getParam('month') . '-01'; $this->getView()->set('articles', $articleMapper->getArticlesByDate($date)); }
public function install() { $this->db()->queryMulti($this->getInstallSql()); $date = new \Ilch\Date(); $databaseConfig = new \Ilch\Config\Database($this->db()); $databaseConfig->set('version', VERSION, 1); $databaseConfig->set('locale', $this->getTranslator()->getLocale(), 1); $databaseConfig->set('date_cms_installed', $date->format('Y-m-d H:i:s'), 1); $databaseConfig->set('timezone', $_SESSION['install']['timezone']); $databaseConfig->set('default_layout', 'clan3columns'); $databaseConfig->set('start_page', 'module_article'); $databaseConfig->set('page_title', 'ilch - Content Manage System'); $databaseConfig->set('standardMail', $_SESSION['install']['adminEmail']); $databaseConfig->set('admin_layout_top_nav', ''); $databaseConfig->set('maintenance_mode', '0'); $databaseConfig->set('maintenance_status', '0'); $databaseConfig->set('maintenance_date', $date->format('Y-m-d H:i:s')); $databaseConfig->set('maintenance_text', '<p>Die Seite befindet sich im Wartungsmodus</p>'); }
public function indexAction() { $profilMapper = new UserMapper(); $profil = $profilMapper->getUserById($this->getRequest()->getParam('user')); $this->getLayout()->getHmenu()->add($this->getTranslator()->trans('menuUserList'), array('controller' => 'index'))->add($profil->getName(), array('controller' => 'profil', 'action' => 'index', 'user' => $this->getRequest()->getParam('user')))->add($this->getTranslator()->trans('menuMail'), array('action' => 'index', 'user' => $this->getRequest()->getParam('user'))); if ($this->getRequest()->isPost()) { $sender = $profilMapper->getUserById($this->getUser()->getId()); $name = $sender->getName(); $email = $sender->getEmail(); $subject = trim($this->getRequest()->getPost('subject')); $message = trim($this->getRequest()->getPost('message')); if (empty($subject)) { $this->addMessage('subjectEmpty'); $this->redirect(array('action' => 'index', 'user' => $this->getRequest()->getParam('user'))); } elseif (empty($message)) { $this->addMessage('messageEmpty'); $this->redirect(array('action' => 'index', 'user' => $this->getRequest()->getParam('user'))); } else { $sitetitle = $this->getConfig()->get('page_title'); $date = new \Ilch\Date(); if ($_SESSION['layout'] == $this->getConfig()->get('default_layout') && file_exists(APPLICATION_PATH . '/layouts/' . $this->getConfig()->get('default_layout') . '/views/modules/user/layouts/mail/usermail.php')) { $messageTemplate = file_get_contents(APPLICATION_PATH . '/layouts/' . $this->getConfig()->get('default_layout') . '/views/modules/user/layouts/mail/usermail.php'); } else { $messageTemplate = file_get_contents(APPLICATION_PATH . '/modules/user/layouts/mail/usermail.php'); } $messageReplace = array('{content}' => $message, '{sitetitle}' => $sitetitle, '{date}' => $date->format("l, d. F Y", true)); $message = str_replace(array_keys($messageReplace), array_values($messageReplace), $messageTemplate); $mail = new \Ilch\Mail(); $mail->setTo($profil->getEmail(), $profil->getName())->setSubject($subject)->setFrom($email, $name)->setMessage($message)->addGeneralHeader('Content-type', 'text/html; charset="utf-8"'); $mail->send(); $this->addMessage('emailSuccess'); $this->redirect(array('controller' => 'profil', 'action' => 'index', 'user' => $this->getRequest()->getParam('user'))); } } $this->getView()->set('profil', $profil); }
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--; } } }
</div> <div class="form-group"> <label class="col-lg-2 control-label"> <?php echo $this->getTrans('profileBirthday'); ?> </label> <div class="col-lg-2 input-group date form_datetime"> <input class="form-control" type="text" name="birthday" value="<?php if ($profil->getBirthday() == '0000-00-00') { echo date('d.m.Y'); } else { echo $birthday->format('d.m.Y', true); } ?> "> <span class="input-group-addon"> <span class="fa fa-calendar"></span> </span> </div> </div> <div class="form-group"> <div class="col-lg-offset-2 col-lg-8"> <input type="submit" name="saveEntry" class="btn" value="<?php echo $this->getTrans('profileSubmit');
public function inputAction() { $this->getLayout()->getHmenu()->add($this->getTranslator()->trans('menuRegist'), array('action' => 'index'))->add($this->getTranslator()->trans('step2to3'), array('action' => 'input')); $registMapper = new UserMapper(); $errors = array(); if ($this->getRequest()->getPost('saveRegist')) { $name = $this->getRequest()->getPost('name'); $password = $this->getRequest()->getPost('password'); $password2 = $this->getRequest()->getPost('password2'); $email = trim($this->getRequest()->getPost('email')); $captcha = trim(strtolower($this->getRequest()->getPost('captcha'))); $profilName = $registMapper->getUserByName($name); $profilEmail = $registMapper->getUserByEmail($email); if (empty($_SESSION['captcha']) || $captcha != $_SESSION['captcha']) { $errors['captcha'] = 'invalidCaptcha'; } if (!empty($profilName)) { $errors['name'] = 'nameExist'; } if (!empty($profilEmail)) { $errors['email'] = 'emailExist'; } if (empty($name)) { $errors['name'] = 'fieldEmpty'; } if (empty($password)) { $errors['password'] = '******'; } if (empty($password2)) { $errors['password2'] = 'fieldEmpty'; } if ($password !== $password2) { $errors['password'] = '******'; $errors['password2'] = 'fieldDiffersPassword'; } if (empty($email)) { $errors['email'] = 'fieldEmpty'; } elseif (!filter_var($email, FILTER_VALIDATE_EMAIL)) { $errors['email'] = 'fieldEmail'; } if (empty($errors)) { $groupMapper = new \Modules\User\Mappers\Group(); $userGroup = $groupMapper->getGroupById(2); $currentDate = new \Ilch\Date(); $model = new \Modules\User\Models\User(); $model->setName($name); $model->setPassword((new PasswordService())->hash($password)); $model->setEmail($email); $model->setDateCreated($currentDate); $model->addGroup($userGroup); if ($this->getConfig()->get('regist_confirm') == 0) { $model->setDateConfirmed($currentDate); } else { $confirmedCode = md5(uniqid(rand())); $model->setConfirmed(0); $model->setConfirmedCode($confirmedCode); } $registMapper->save($model); $_SESSION["name"] = $name; $_SESSION["email"] = $email; if ($this->getConfig()->get('regist_confirm') == 1) { $sitetitle = $this->getConfig()->get('page_title'); $confirmCode = '<a href="' . BASE_URL . '/index.php/user/regist/confirm/code/' . $confirmedCode . '" class="btn btn-primary btn-sm">' . $this->getTranslator()->trans('confirmMailButtonText') . '</a>'; $date = new \Ilch\Date(); $layout = ''; if (isset($_SESSION['layout'])) { $layout = $_SESSION['layout']; } if ($layout == $this->getConfig()->get('default_layout') && file_exists(APPLICATION_PATH . '/layouts/' . $this->getConfig()->get('default_layout') . '/views/modules/user/layouts/mail/registconfirm.php')) { $messageTemplate = file_get_contents(APPLICATION_PATH . '/layouts/' . $this->getConfig()->get('default_layout') . '/views/modules/user/layouts/mail/registconfirm.php'); } else { $messageTemplate = file_get_contents(APPLICATION_PATH . '/modules/user/layouts/mail/registconfirm.php'); } $messageReplace = array('{content}' => $this->getConfig()->get('regist_confirm_mail'), '{sitetitle}' => $sitetitle, '{date}' => $date->format("l, d. F Y", true), '{name}' => $name, '{confirm}' => $confirmCode, '{footer}' => $this->getTranslator()->trans('noReplyMailFooter')); $message = str_replace(array_keys($messageReplace), array_values($messageReplace), $messageTemplate); $mail = new \Ilch\Mail(); $mail->setTo($email, $name)->setSubject($this->getTranslator()->trans('automaticEmail'))->setFrom($this->getTranslator()->trans('automaticEmail'), $sitetitle)->setMessage($message)->addGeneralHeader('Content-type', 'text/html; charset="utf-8"'); $mail->send(); } $this->redirect(array('action' => 'finish')); } $this->getView()->set('errors', $errors); } $this->getView(); }
public function forgotpasswordAction() { $this->getLayout()->getHmenu()->add($this->getTranslator()->trans('menuLogin'), array('action' => 'index'))->add($this->getTranslator()->trans('menuForgotPassword'), array('action' => 'forgotpassword')); if ($this->getRequest()->getPost('saveNewPassword')) { $name = trim($this->getRequest()->getPost('name')); if (empty($name)) { $this->addMessage('missingNameEmail', 'danger'); } else { $userMapper = new UserMapper(); $user = $userMapper->getUserByEmail($name); if ($user == null) { $user = $userMapper->getUserByName($name); } if (!empty($user)) { $confirmedCode = md5(uniqid(rand())); $user->setConfirmed(0); $user->setConfirmedCode($confirmedCode); $userMapper->save($user); $name = $user->getName(); $email = $user->getEmail(); $sitetitle = $this->getConfig()->get('page_title'); $confirmCode = '<a href="' . BASE_URL . '/index.php/user/login/newpassword/code/' . $confirmedCode . '" class="btn btn-primary btn-sm">' . $this->getTranslator()->trans('confirmMailButtonText') . '</a>'; $date = new \Ilch\Date(); if ($_SESSION['layout'] == $this->getConfig()->get('default_layout') && file_exists(APPLICATION_PATH . '/layouts/' . $this->getConfig()->get('default_layout') . '/views/modules/user/layouts/mail/passwordchange.php')) { $messageTemplate = file_get_contents(APPLICATION_PATH . '/layouts/' . $this->getConfig()->get('default_layout') . '/views/modules/user/layouts/mail/passwordchange.php'); } else { $messageTemplate = file_get_contents(APPLICATION_PATH . '/modules/user/layouts/mail/passwordchange.php'); } $messageReplace = array('{content}' => $this->getConfig()->get('password_change_mail'), '{sitetitle}' => $sitetitle, '{date}' => $date->format("l, d. F Y", true), '{name}' => $name, '{confirm}' => $confirmCode, '{footer}' => $this->getTranslator()->trans('noReplyMailFooter')); $message = str_replace(array_keys($messageReplace), array_values($messageReplace), $messageTemplate); $mail = new \Ilch\Mail(); $mail->setTo($email, $name)->setSubject($this->getTranslator()->trans('automaticEmail'))->setFrom($this->getTranslator()->trans('automaticEmail'), $sitetitle)->setMessage($message)->addGeneralHeader('Content-type', 'text/html; charset="utf-8"'); $mail->send(); $this->addMessage('newPasswordEMailSuccess'); } else { $this->addMessage('newPasswordFailed', 'danger'); } } } }
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--; } } }
?> <?php foreach ($this->get('eventList') as $eventlist) { ?> <?php $date = new \Ilch\Date($eventlist->getDateCreated()); ?> <i class="fa fa-calendar"></i> <a href="<?php echo $this->getUrl('events/index/show/id/' . $eventlist->getId()); ?> "><?php echo strlen($this->escape($eventlist->getTitle())) < 15 ? $this->escape($eventlist->getTitle()) : substr($this->escape($eventlist->getTitle()), 0, 15) . '...'; ?> </a> <span class="small" style="float: right;">(<?php echo $date->format("d.m", true); ?> )</span><br /> <?php } } else { ?> <?php echo $this->getTrans('noEvent'); } ?> <hr /> <div align="center"><a href="<?php echo $this->getUrl('events/index/index/'); ?> "><?php
echo $this->getTrans('clock'); ?> </div> </div> <?php if ($calendar->getEnd() != '0000-00-00 00:00:00') { ?> <div class="form-group"> <label for="receiver" class="col-lg-2"> <?php echo $this->getTrans('end'); ?> : </label> <div class="col-lg-10"><?php echo $end->format("l, d. F Y"); ?> <?php echo $this->getTrans('at'); ?> <?php echo $end->format("H:i"); ?> <?php echo $this->getTrans('clock'); ?> </div> </div> <?php } ?>
<?php echo $this->getTrans('statToday'); ?> : <?php echo $this->get('visitsToday'); ?> <br /> <?php echo $this->getTrans('statYesterday'); ?> : <?php echo $this->get('visitsYesterday'); ?> <br /> <a href="<?php echo $this->getUrl('statistic/index/show/year/' . $date->format("Y", true) . '/month/' . $date->format("m", true)); ?> "><?php echo $this->getTrans('statMonth'); ?> : <?php echo $this->get('visitsMonth'); ?> </a><br /> <a href="<?php echo $this->getUrl('statistic/index/show/year/' . $date->format("Y", true)); ?> "><?php echo $this->getTrans('statYear'); ?> : <?php
/** * @param array $row */ public function saveVisit($row) { $date = new \Ilch\Date(); $visitId = (int) $this->db()->select('id')->from('visits_online')->where(array('user_id' => $row['user_id'], 'ip_address' => $row['ip']))->execute()->fetchCell(); if ($visitId) { $this->db()->update('visits_online')->values(array('site' => $row['site'], 'os' => $row['os'], 'browser' => $row['browser'], 'lang' => $row['lang'], 'date_last_activity' => $date->format('Y-m-d H:i:s', true)))->where(array('id' => $visitId))->execute(); if ($row['user_id']) { $this->db()->update('users')->values(array('date_last_activity' => $date->format('Y-m-d H:i:s', true)))->where(array('id' => $row['user_id']))->execute(); } } else { $this->db()->insert('visits_online')->values(array('user_id' => $row['user_id'], 'site' => $row['site'], 'os' => $row['os'], 'browser' => $row['browser'], 'ip_address' => $row['ip'], 'lang' => $row['lang'], 'date_last_activity' => $date->format('Y-m-d H:i:s', true)))->execute(); } $sql = 'SELECT id FROM `[prefix]_visits_stats` WHERE ip_address = "' . $row['ip'] . '" AND YEAR(`date`) = YEAR(CURDATE()) AND MONTH(`date`) = MONTH(CURDATE()) AND DAY(`date`) = DAY(CURDATE())'; $uniqueUser = $this->db()->queryCell($sql); if ($uniqueUser) { $this->db()->update('visits_stats')->values(array('os' => $row['os'], 'browser' => $row['browser'], 'lang' => $row['lang']))->where(array('id' => $uniqueUser))->execute(); } else { $this->db()->insert('visits_stats')->values(array('referer' => $row['referer'], 'os' => $row['os'], 'browser' => $row['browser'], 'ip_address' => $row['ip'], 'lang' => $row['lang'], 'date' => $date->format('Y-m-d H:i:s', true)))->execute(); } }
</div> </div> <?php } ?> <div class="row"> <div class="col-lg-2 detail bold"> <?php echo $this->getTrans('profileBirthday'); ?> : </div> <div class="col-lg-10 detail"> <?php if ($profil->getBirthday() != '0000-00-00') { echo $birthday->format('d-m-Y', true); } ?> </div> </div> <?php if ($profil->getSignature() != '') { ?> <div class="clearfix"></div> <br /> <legend><?php echo $this->getTrans('profileSignature'); ?> </legend> <div class="row"> <div class="col-lg-10 detail">
echo $this->getUrl('user/profil/index/user/' . $commentUser->getId()); ?> " target="_blank"><img class="avatar" src="<?php echo $this->getUrl() . '/' . $commentUser->getAvatar(); ?> " alt="User Avatar"></a></div> <div class="userEventInfo"> <a href="<?php echo $this->getUrl('user/profil/index/user/' . $commentUser->getId()); ?> " target="_blank"><?php echo $this->escape($commentUser->getName()); ?> </a><br /> <span class="small"><?php echo $commentDate->format("Y.m.d H:i", true); ?> </span> </div> <div class="commentEventText"><?php echo nl2br($eventComments->getText()); ?> </div> </div> <br /> <?php } ?> <?php } ?>
</h4> </div> <div class="panel-body"> <div class="list-group"> <?php foreach ($this->get('statisticYearList') as $statisticList) { ?> <?php $progressWidth = $statisticMapper->getPercent($statisticList->getVisits(), $this->get('visitsTotal')); ?> <?php $date = new \Ilch\Date($statisticList->getDate()); ?> <div class="list-group-item"> <strong><a href="<?php echo $this->getUrl(array('controller' => 'index', 'action' => 'show', 'year' => $date->format("Y", true))); ?> "><?php echo $date->format("Y", true); ?> </a></strong> <span class="pull-right"><?php echo $statisticList->getVisits(); ?> </span> <div class="radio"> <div class="progress" style="margin-bottom: 0px;"> <div class="progress-bar" role="progressbar" data-transitiongoal="<?php echo $progressWidth; ?> "></div>
?> </a></td> <?php $startDate = new \Ilch\Date($away->getStart()); ?> <?php $endDate = new \Ilch\Date($away->getEnd()); ?> <?php if ($away->getStart() >= date('Y-m-d') or $away->getEnd() >= date('Y-m-d')) { ?> <td style="color: #008000;"><?php echo $startDate->format('d.m.Y', true); ?> - <?php echo $endDate->format('d.m.Y', true); ?> </td> <?php } else { ?> <td style="color: #ff0000;"><?php echo $startDate->format('d.m.Y', true); ?> - <?php echo $endDate->format('d.m.Y', true); ?> </td> <?php } ?>
$archive = $this->get('archive'); ?> <?php if (!empty($archive)) { ?> <ul class="list-unstyled"> <?php foreach ($archive as $archiv) { ?> <?php $date = new \Ilch\Date($archiv->getDateCreated()); ?> <li> <a href="<?php echo $this->getUrl(array('module' => 'article', 'controller' => 'archive', 'action' => 'show', 'year' => $date->format("Y", true), 'month' => $date->format("m", true))); ?> "> <?php echo $date->format("F Y", true); ?> </a> <span class="badge pull-right" style="margin-top: 7px;"><?php echo $articleMapper->getCountArticlesByMonthYear($archiv->getDateCreated()); ?> </span> </li> <?php } ?> </ul>
/** * Tests if Ilch_Date saves a date in the local time if the local timezone is given in the constructor. */ public function testConstructLocalTime() { $date = new \Ilch\Date('2013-09-18 18:25:01', 'Europe/Berlin'); $this->assertEquals('2013-09-18 18:25:01', $date->format('Y-m-d H:i:s', true), 'The time was not returned in local time.'); }
echo $this->getTrans('menuEventPast'); ?> </legend> <div class="row"> <div class="col-lg-12"> <ul class="event-list"> <?php foreach ($this->get('eventListPast') as $eventlist) { ?> <?php $date = new \Ilch\Date($eventlist->getStart()); ?> <li> <time> <span class="day"><?php echo $date->format("j", true); ?> </span> <span class="month"><?php echo $date->format("M", true); ?> </span> </time> <div class="info"> <h2 class="title"><a href="<?php echo $this->getUrl('events/show/event/id/' . $eventlist->getId()); ?> "><?php echo $this->escape($eventlist->getTitle()); ?> </a></h2>
<div class="container install_container"> <img class="logo" src="<?php echo $this->getStaticUrl('img/ilch_logo.png'); ?> " /> <div class="maintranceHead"><?php echo $translator->trans('maintenanceMode'); ?> </div> <div class="countdownHead"><?php echo $translator->trans('maintenanceTime'); ?> </div> <div class="countdown"> <?php if (strtotime($config->get('maintenance_date')) > strtotime($date->format('Y-m-d H:i:00', true))) { ?> <span id="countdown"></span> <?php } else { ?> <div class="countDays"> <span class="position"> <span style="top: 0px; opacity: 1;">00</span> </span> <span class="boxName"> <span><?php echo $translator->trans('maintenanceDays'); ?> </span> </span>
?> <tr> <td><input value="<?php echo $entry->getId(); ?> " type="checkbox" name="check_entries[]" /></td> <td> <?php $deleteArray = array('action' => 'del', 'id' => $entry->getId()); ?> <?php echo $this->getDeleteIcon($deleteArray); ?> </td> <td><?php echo $date->format("d.m.Y H:i", true); ?> </td> <td><a href="<?php echo $this->getUrl('user/profil/index/user/' . $user->getId()); ?> " target="_blank"><?php echo $user->getName(); ?> </a></td> <td><a href="<?php echo $this->getUrl('admin/newsletter/index/show/id/' . $entry->getId()); ?> "><?php echo $entry->getSubject(); ?>
<?php $newsletter = $this->get('newsletter'); $date = new \Ilch\Date($newsletter->getDateCreated()); ?> <p class="small text-muted"><?php echo $date->format("l, d. F Y", true); ?> </p> <p> </p> <p><b><?php echo $newsletter->getSubject(); ?> </b></p> <p><?php echo $newsletter->getText(); ?> </p>
<?php $awards = $this->get('awards'); if ($awards != '') { $getDate = new \Ilch\Date($awards->getDate()); $date = $getDate->format('d.m.Y', true); } ?> <link href="<?php echo $this->getModuleUrl('static/css/awards.css'); ?> " rel="stylesheet"> <link href="<?php echo $this->getStaticUrl('js/datetimepicker/css/bootstrap-datetimepicker.min.css'); ?> " rel="stylesheet"> <form class="form-horizontal" method="POST" action="<?php echo $this->getUrl(array('action' => $this->getRequest()->getActionName(), 'id' => $this->getRequest()->getParam('id'))); ?> "> <?php echo $this->getTokenField(); ?> <legend> <?php if ($this->get('awards') != '') { ?> <?php echo $this->getTrans('edit');
<td><input value="<?php echo $entry->getId(); ?> " type="checkbox" name="check_entries[]" /></td> <td><?php echo $this->getEditIcon(array('action' => 'treat', 'id' => $entry->getId())); ?> </td> <td><?php echo $this->getDeleteIcon(array('action' => 'del', 'id' => $entry->getId())); ?> </td> <td> <?php $getDate = new \Ilch\Date($entry->getDate()); echo $getDate->format('d.m.Y', true); ?> </td> <td> <?php echo $this->escape($entry->getTitle()); ?> </td> <td> <?php echo $entry->getText(); ?> </td> </tr> <?php }
$imageSource = $article->getArticleImageSource(); ?> <div class="col-lg-12 hidden-xs" style="padding-left: 0px;"> <div class="col-lg-8" style="padding-left: 0px;"> <h4><a href="<?php echo $this->getUrl(array('controller' => 'cats', 'action' => 'show', 'id' => $article->getCatId())); ?> "><?php echo $articlesCats->getName(); ?> </a></h4> </div> <div class="col-lg-4 text-right" style="padding-right: 0px;"> <h4><a href="<?php echo $this->getUrl(array('controller' => 'archive', 'action' => 'show', 'year' => $date->format("Y", true), 'month' => $date->format("m", true))); ?> "><?php echo $date->format('d. F Y', true); ?> </a></h4> </div> </div> <h3><a href="<?php echo $this->getUrl(array('controller' => 'index', 'action' => 'show', 'id' => $article->getId())); ?> "><?php echo $article->getTitle(); ?> </a></h3> <?php
<legend><?php echo $this->getTrans('menuBirthdayList'); ?> </legend> <?php if ($this->get('birthdayListNOW') != '') { ?> <div class="panel panel-primary"> <div class="panel-heading"> <strong><?php echo $this->getTrans('birthdayToday'); ?> </strong> <span class="pull-right"> <strong><?php echo date('d.m.Y', strtotime($date->format('Y-m-d'))); ?> </strong> </span> </div> <?php foreach ($this->get('birthdayListNOW') as $birthdaylist) { ?> <div class="panel-body"> <div class="col-lg-12"> <div class="col-lg-2 confetti"> <a href="<?php echo $this->getUrl('user/profil/index/user/' . $birthdaylist->getId()); ?> "><img class="thumbnail center-block" style="margin-bottom: 0px;" src="<?php echo $this->getStaticUrl() . '../' . $this->escape($birthdaylist->getAvatar());