praiadeseselle/site/templates/publicacion.php

76 lines
3.1 KiB
PHP
Raw Normal View History

2022-10-25 14:47:38 +02:00
<?php namespace ProcessWire;
$menu = '';
$contido = '';
$mantemento = $inicio->mantemento;
if($mantemento && !$user->isLoggedin())
{
$session->redirect($inicio->url);
}
else
{
$data = strtotime($page->data_publicacion);
$dateFormatter = \IntlDateFormatter::create(
$languages->getLocale(),
\IntlDateFormatter::NONE,
\IntlDateFormatter::NONE,
\date_default_timezone_get(),
\IntlDateFormatter::GREGORIAN
);
$contido .= '<article id="' . $page->name . '">' . "\n";
$contido .= '<h2 class="bloque"><i class="icon-book-open"></i> ' . $page->parent()->title . ': ' . ucfirst($page->title) . '</h2>' . "\n";
$contido .= '<header class="publicacion-info">' . "\n";
$contido .= '<div class="data">' . "\n";
$contido .= '<time datetime="' . $page->data_publicacion . '">' ."\n";
$dateFormatter->setPattern('EEEE');
$contido .= '<em>' . ucfirst(datefmt_format($dateFormatter, $data)) . '</em>' . "\n";
$dateFormatter->setPattern('MMMM');
$contido .= '<strong>' . ucfirst(datefmt_format($dateFormatter, $data)) . '</strong>' . "\n";
$dateFormatter->setPattern('dd');
$contido .= '<span>' . datefmt_format($dateFormatter, $data) . '</span>' . "\n";
$contido .= '</time>' . "\n";
$contido .= '</div>' . "\n";
$contido .= '<div class="info">' . "\n";
$contido .= '<dl>' . "\n";
$contido .= '<dt title="' . _x('Autor', 'Post author') . '"><i class="icon-user"></i><span class="oculto-movil"> ' . _x('Autor', 'Post author') . '</span></dt>' . "\n";
$contido .= '<dd>' . $page->createdUser->name . '</dd>' . "\n";
$contido .= '<dt title="' . pages()->get('/categorias/')->title . '"><i class="icon-folder"></i><span class="oculto-movil"> ' . pages()->get('/categorias/')->title . '</span></dt>' . "\n";
$contido .= '<dd><a href="' . $page->categorias->url . '">' . $page->categorias->title . '</a></dd>' . "\n";
$contido .= '<dt title="' . pages()->get('/etiquetas/')->title . '"><i class="icon-tag"></i><span class="oculto-movil"> ' . pages()->get('/etiquetas/')->title . '</span></dt>' . "\n";
$contido .= '<dd>' . $page->etiquetas->each("<a href='{url}'>{title}</a>") . '</dd>' . "\n";
$contido .= '</dl>' . "\n";
$contido .= '</div>' . "\n";
$contido .= '</header>' . "\n";
$contido .= '<div class="resumo">' . "\n";
$contido .= getSeccions($page->seccions) . "\n";
$contido .= '</div>' . "\n";
$contido .= '</article>' . "\n";
/*
echo ukBlogPost(page());
// comments
$comments = page()->comments;
// comment list
if(count($comments)) {
echo ukHeading3("Comments", "icon=comments");
echo ukComments($comments);
}
// comment form
echo ukHeading3("Post a comment", "icon=comment");
echo ukCommentForm($comments);
// link to the next blog post, if there is one
$nextPost = page()->next();
if($nextPost->id): ?>
<p class='next-blog-post'>
Next <?=ukIcon('chevron-right')?>
<a href='<?=$nextPost->url?>'><?=$nextPost->title?></a>
</p>
<?php endif; ?> */
}