示例#1
0
// --------------------------------------------------------------
$xoopsOption['template_main'] = 'mywords_post.html';
$xoopsOption['module_subpage'] = 'post';
include 'header.php';
if ($post <= 0) {
    redirect_header(MWFunctions::get_url(), 2, '');
    die;
}
$post = new MWPost($post);
// Comprobamos que exista el post
if ($post->isNew()) {
    redirect_header(mw_get_url(), 2, __('Document not found', 'mywords'));
    die;
}
// Comprobamos permisos de acceso al post
if (!$post->user_allowed()) {
    redirect_header(MWFunctions::get_url(), 2, __('Sorry, you are not allowed to view this post', 'mywords'));
    die;
}
// Check if post belong to some category
if (count($post->get_categos()) <= 0) {
    $post->update();
}
# Generamos los vínculos
$day = date('d', $post->getVar('pubdate'));
$month = date('m', $post->getVar('pubdate'));
$year = date('Y', $post->getVar('pubdate'));
//
$page = isset($_REQUEST['page']) ? $_REQUEST['page'] : 0;
# Generamos el vínculo para el autor
$editor = new MWEditor($post->getVar('author'));