| 1 | <?php |
|---|
| 2 | // $Id: print.php,v 1.5 2005/09/04 20:46:11 onokazu Exp $ |
|---|
| 3 | // ------------------------------------------------------------------------ // |
|---|
| 4 | // XOOPS - PHP Content Management System // |
|---|
| 5 | // Copyright (c) 2000 XOOPS.org // |
|---|
| 6 | // <http://www.xoops.org/> // |
|---|
| 7 | // ------------------------------------------------------------------------- // |
|---|
| 8 | // This program is free software; you can redistribute it and/or modify // |
|---|
| 9 | // it under the terms of the GNU General Public License as published by // |
|---|
| 10 | // the Free Software Foundation; either version 2 of the License, or // |
|---|
| 11 | // (at your option) any later version. // |
|---|
| 12 | // // |
|---|
| 13 | // You may not change or alter any portion of this comment or credits // |
|---|
| 14 | // of supporting developers from this source code or any supporting // |
|---|
| 15 | // source code which is considered copyrighted (c) material of the // |
|---|
| 16 | // original comment or credit authors. // |
|---|
| 17 | // // |
|---|
| 18 | // This program is distributed in the hope that it will be useful, // |
|---|
| 19 | // but WITHOUT ANY WARRANTY; without even the implied warranty of // |
|---|
| 20 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // |
|---|
| 21 | // GNU General Public License for more details. // |
|---|
| 22 | // // |
|---|
| 23 | // You should have received a copy of the GNU General Public License // |
|---|
| 24 | // along with this program; if not, write to the Free Software // |
|---|
| 25 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // |
|---|
| 26 | // ------------------------------------------------------------------------ // |
|---|
| 27 | include '../../mainfile.php'; |
|---|
| 28 | |
|---|
| 29 | $storyid = isset($_GET['storyid']) ? intval($_GET['storyid']) : 0; |
|---|
| 30 | if ( empty($storyid) ) { |
|---|
| 31 | redirect_header("index.php"); |
|---|
| 32 | } |
|---|
| 33 | include_once XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->dirname().'/class/class.newsstory.php'; |
|---|
| 34 | |
|---|
| 35 | function PrintPage($storyid) |
|---|
| 36 | { |
|---|
| 37 | global $xoopsConfig, $xoopsModule; |
|---|
| 38 | $story = new NewsStory($storyid); |
|---|
| 39 | $datetime = formatTimestamp($story->published()); |
|---|
| 40 | echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">'; |
|---|
| 41 | echo '<html><head>'; |
|---|
| 42 | echo '<meta http-equiv="Content-Type" content="text/html; charset='._CHARSET.'" />'; |
|---|
| 43 | echo '<title>'.htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES).'</title>'; |
|---|
| 44 | echo '<meta name="AUTHOR" content="'.htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES).'" />'; |
|---|
| 45 | echo '<meta name="COPYRIGHT" content="Copyright (c) 2005 by '.htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES).'" />'; |
|---|
| 46 | echo '<meta name="DESCRIPTION" content="'.$xoopsConfig['slogan'].'" />'; |
|---|
| 47 | echo '<meta name="GENERATOR" content="'.XOOPS_VERSION.'" />'; |
|---|
| 48 | echo '<body bgcolor="#ffffff" text="#000000" onload="window.print()"> |
|---|
| 49 | <table border="0"><tr><td align="center"> |
|---|
| 50 | <table border="0" width="640" cellpadding="0" cellspacing="1" bgcolor="#000000"><tr><td> |
|---|
| 51 | <table border="0" width="640" cellpadding="20" cellspacing="1" bgcolor="#ffffff"><tr><td align="center"> |
|---|
| 52 | <img src="'.XOOPS_URL.'/images/logo.gif" border="0" alt="" /><br /><br /> |
|---|
| 53 | <h3>'.$story->title().'</h3> |
|---|
| 54 | <small><b>'._NW_DATE.'</b> '.$datetime.' | <b>'._NW_TOPICC.'</b> '.$story->topic_title().'</small><br /><br /></td></tr>'; |
|---|
| 55 | echo '<tr valign="top" style="font:12px;"><td>'.$story->hometext().'<br />'; |
|---|
| 56 | $bodytext = $story->bodytext(); |
|---|
| 57 | $bodytext = str_replace("[pagebreak]","<br style=\"page-break-after:always;\">",$bodytext); |
|---|
| 58 | if ( $bodytext != '' ){ |
|---|
| 59 | echo $bodytext.'<br /><br />'; |
|---|
| 60 | } |
|---|
| 61 | echo '</td></tr></table></td></tr></table> |
|---|
| 62 | <br /><br />'; |
|---|
| 63 | printf(_NW_THISCOMESFROM,htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES)); |
|---|
| 64 | echo '<br /><a href="'.XOOPS_URL.'/">'.XOOPS_URL.'</a><br /><br /> |
|---|
| 65 | '._NW_URLFORSTORY.' <!-- Tag below can be used to display Permalink image --><!--img src="'.XOOPS_URL.'/modules/'.$xoopsModule->dirname().'/images/x.gif" /--><br /> |
|---|
| 66 | <a href="'.XOOPS_URL.'/modules/'.$xoopsModule->dirname().'/article.php?storyid='.$story->storyid().'">'.XOOPS_URL.'/article.php?storyid='.$story->storyid().'</a> |
|---|
| 67 | </td></tr></table> |
|---|
| 68 | </body> |
|---|
| 69 | </html> |
|---|
| 70 | '; |
|---|
| 71 | } |
|---|
| 72 | PrintPage($storyid); |
|---|
| 73 | ?> |
|---|