'; printf(_NW_THISCOMESFROM,htmlspecialchars($xoopsConfig['sitename'],ENT_QUOTES)); echo ' '.XOOPS_URL.' '._NW_URLFORSTORY.' '.XOOPS_URL.'/modules/news/article.php?storyid='.$story->storyid().' |
// // ------------------------------------------------------------------------- // // This program is free software; you can redistribute it and/or modify // // it under the terms of the GNU General Public License as published by // // the Free Software Foundation; either version 2 of the License, or // // (at your option) any later version. // // // // You may not change or alter any portion of this comment or credits // // of supporting developers from this source code or any supporting // // source code which is considered copyrighted (c) material of the // // original comment or credit authors. // // // // This program is distributed in the hope that it will be useful, // // but WITHOUT ANY WARRANTY; without even the implied warranty of // // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // // GNU General Public License for more details. // // // // You should have received a copy of the GNU General Public License // // along with this program; if not, write to the Free Software // // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // ------------------------------------------------------------------------ // /** * Print an article * * This page is used to print an article. The advantage of this script is that you * only see the article and nothing else. * * @package News * @author Xoops Modules Dev Team * @copyright (c) The Xoops Project - www.xoops.org * * Parameters received by this page : * @page_param int storyid Id of news to print * * @page_title Story's title - Printer Friendly Page - Topic's title - Site's name * * @template_name This page does not use any template * */ include_once '../../mainfile.php'; include_once XOOPS_ROOT_PATH.'/modules/news/class/class.newsstory.php'; include_once XOOPS_ROOT_PATH.'/modules/news/include/functions.php'; $storyid = isset($_GET['storyid']) ? intval($_GET['storyid']) : 0; if ( empty($storyid) ) { redirect_header(XOOPS_URL.'/modules/news/index.php',2,_NW_NOSTORY); } // Verify that the article is published $story = new NewsStory($storyid); // Not yet published if ( $story->published() == 0 || $story->published() > time() ) { redirect_header(XOOPS_URL.'/modules/news/index.php', 2, _NW_NOSTORY); exit(); } // Expired if ( $story->expired() != 0 && $story->expired() < time() ) { redirect_header(XOOPS_URL.'/modules/news/index.php', 2, _NW_NOSTORY); exit(); } // Verify permissions $gperm_handler =& xoops_gethandler('groupperm'); if (is_object($xoopsUser)) { $groups = $xoopsUser->getGroups(); } else { $groups = XOOPS_GROUP_ANONYMOUS; } if (!$gperm_handler->checkRight('news_view', $story->topicid(), $groups, $xoopsModule->getVar('mid'))) { redirect_header(XOOPS_URL.'/modules/news/index.php', 3, _NOPERM); exit(); } $xoops_meta_keywords=''; $xoops_meta_description=''; if(trim($story->keywords()) != '') { $xoops_meta_keywords = $story->keywords(); } else { $xoops_meta_keywords = news_createmeta_keywords($story->hometext().' '.$story->bodytext()); } if(trim($story->description())!='') { $xoops_meta_description = $story->description(); } else { $xoops_meta_description=strip_tags($story->title()); } function PrintPage() { global $xoopsConfig, $xoopsModule, $story, $xoops_meta_keywords,$xoops_meta_description; $myts =& MyTextSanitizer::getInstance(); $datetime = formatTimestamp($story->published(),news_getmoduleoption('dateformat')); ?> \n"; echo '
'; printf(_NW_THISCOMESFROM,htmlspecialchars($xoopsConfig['sitename'],ENT_QUOTES)); echo ' '.XOOPS_URL.' '._NW_URLFORSTORY.' '.XOOPS_URL.'/modules/news/article.php?storyid='.$story->storyid().' |