diff options
author | Romain d'Alverny <rdalverny@gmail.com> | 2022-01-15 16:41:25 +0100 |
---|---|---|
committer | Romain d'Alverny <rdalverny@gmail.com> | 2022-01-15 16:41:25 +0100 |
commit | fda57f3b7c52ea9747e8c132c4571772ab913752 (patch) | |
tree | 73e15148320882539b1ff9dd456f8bd02a9078db /custom/views/archive/index.tpl.php | |
parent | b9b9f483f54365ecb88572690f308a29d26da31c (diff) | |
download | planet-fda57f3b7c52ea9747e8c132c4571772ab913752.tar planet-fda57f3b7c52ea9747e8c132c4571772ab913752.tar.gz planet-fda57f3b7c52ea9747e8c132c4571772ab913752.tar.bz2 planet-fda57f3b7c52ea9747e8c132c4571772ab913752.tar.xz planet-fda57f3b7c52ea9747e8c132c4571772ab913752.zip |
Refactor main controller and templates
Templates for the public part:
- archive/default views are merged into a single set
- becomes HTML5
Controller code is reorganized for clarity.
Compiled template caching is also fixed and activated when config cache
value is > 0.
Caching is also given new default larger values.
Diffstat (limited to 'custom/views/archive/index.tpl.php')
-rwxr-xr-x | custom/views/archive/index.tpl.php | 114 |
1 files changed, 0 insertions, 114 deletions
diff --git a/custom/views/archive/index.tpl.php b/custom/views/archive/index.tpl.php deleted file mode 100755 index 679ef71..0000000 --- a/custom/views/archive/index.tpl.php +++ /dev/null @@ -1,114 +0,0 @@ -<?php -$count = 0; -$today = array(); -$week = array(); -$month = array(); -$older = array(); -$now = time(); - -foreach ($items as $item) { - $age = ($now - $item->get_date('U')) / (60*60*24); - if ($age < 1) { - $today[] = $item; - } elseif ($age < 7) { - $week[] = $item; - } elseif ($age < 30) { - $month[] = $item; - } else { - $older[] = $item; - } -} - -header('Content-type: text/html; charset=UTF-8'); -?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?=$PlanetConfig->getLocale()?>" lang="<?=$PlanetConfig->getLocale()?>"> -<head> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> - <meta http-equiv="Content-Script-Type" content="text/javascript" /> - <meta http-equiv="Content-Style-Type" content="text/css" /> - - <title><?php echo $PlanetConfig->getName(); ?></title> - <?php include(__DIR__.'/head.tpl.php'); ?> -</head> - -<body> - <div id="page"> - <?php include(__DIR__.'/top.tpl.php'); ?> - - <div id="content"> - <?php if (0 == count($items)) :?> - <div class="article"> - <h2 class="article-title"> - <?=_g('No article')?> - </h2> - <p class="article-content"><?=_g('No news, good news.')?></p> - </div> - <?php endif; ?> - <?php if (count($today)) : ?> - <div class="article"> - <h2><?=_g('Today')?></h2> - <ul> - <?php foreach ($today as $item) : ?> - <?php $feed = $item->get_feed(); ?> - <li> - <a href="<?php echo $feed->getWebsite() ?>" class="source"><?php echo $feed->getName() ?></a> : - <a href="<?php echo $item->get_permalink(); ?>" title="<?=_g('Go to original place')?>"><?php echo $item->get_title(); ?></a> - </li> - <?php endforeach; ?> - </ul> - </div> - <?php endif; ?> - - <?php if (count($week)) : ?> - <div class="article"> - <h2><?=_g('This week')?></h2> - <ul> - <?php foreach ($week as $item) : ?> - <?php $feed = $item->get_feed(); ?> - <li> - <a href="<?php echo $feed->getWebsite() ?>" class="source"><?php echo $feed->getName() ?></a> : - <a href="<?php echo $item->get_permalink(); ?>" title="<?=_g('Go to original place')?>"><?php echo $item->get_title(); ?></a> - </li> - <?php endforeach; ?> - </ul> - </div> - <?php endif; ?> - - <?php if (count($month)) : ?> - <div class="article"> - <h2><?=_g('This month')?></h2> - <ul> - <?php foreach ($month as $item) : ?> - <?php $feed = $item->get_feed(); ?> - <li> - <a href="<?php echo $feed->getWebsite() ?>" class="source"><?php echo $feed->getName() ?></a> : - <a href="<?php echo $item->get_permalink(); ?>" title="<?=_g('Go to original place')?>"><?php echo $item->get_title(); ?></a> - </li> - <?php endforeach; ?> - </ul> - </div> - <?php endif; ?> - - <?php if (count($older)) : ?> - <div class="article"> - <h2><?=_g('Older items')?></h2> - <ul> - <?php foreach ($older as $item) : ?> - <?php $feed = $item->get_feed(); ?> - <li> - <a href="<?php echo $feed->getWebsite() ?>" class="source"><?php echo $feed->getName() ?></a> : - <a href="<?php echo $item->get_permalink(); ?>" title="Go to original place"><?php echo $item->get_title(); ?></a> - </li> - <?php endforeach; ?> - </ul> - </div> - <?php endif; ?> - </div> - - <?php include_once(__DIR__.'/sidebar.tpl.php'); ?> - - <?php include(__DIR__.'/footer.tpl.php'); ?> - </div> -</body> -</html> |