function PrintPage($articleid) { global $xoopsConfig, $xoopsDB, $xoopsModule, $wfsConfig; $story = new WfsArticle($articleid); $datetime = formatTimestamp($story->created(), $wfsConfig['timestamp']); echo "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>\n"; echo "<html>\n<head>\n"; echo "<title>" . $xoopsConfig['sitename'] . "</title>\n"; echo "<meta http-equiv='Content-Type' content='text/html; charset=" . _CHARSET . "' />\n"; echo "<meta name='AUTHOR' content='" . $xoopsConfig['sitename'] . "' />\n"; echo "<meta name='COPYRIGHT' content='Copyright (c) 2001 by " . $xoopsConfig['sitename'] . "' />\n"; echo "<meta name='DESCRIPTION' content='" . $xoopsConfig['slogan'] . "' />\n"; echo "<meta name='GENERATOR' content='" . XOOPS_VERSION . "' />\n\n\n"; echo "<body bgcolor='#ffffff' text='#000000'>\n <table border='0'><tr><td align='center'>\n <table border='0' width='650' cellpadding='0' cellspacing='1' bgcolor='#000000'><tr><td>\n <table border='0' width='650' cellpadding='20' cellspacing='1' bgcolor='#ffffff'><tr><td align='center'>\n <img src='" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/images/logo.gif' border='0' alt='' /><br />\n <h2>" . $story->title() . "</h2><hr />"; if ($story->htmlpage) { $includepage = XOOPS_ROOT_PATH . "/modules/" . $xoopsModule->dirname() . "/html/" . $story->htmlpage(); $maintext = ''; $maintext = (include $includepage); $maintext = $maintext; } else { $maintext = $story->maintext(); //if (!empty($maintext)) $maintext .= "<hr />"; $maintext = preg_replace("/\\[pagebreak\\]/", "<hr width='75%' />", $maintext); } echo "<tr><td>" . $maintext . "<br /><br /><br /><hr /><br />"; echo "<small><b>" . _WFS_DATE . "</b> " . $datetime . "<br /><b>" . _WFS_TOPICC . "</b> " . $story->categoryTitle() . "<br /><b>" . _WFS_URLFORSTORY . "</b> " . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/article.php?articleid=" . $story->articleid() . "</small><br /></td></tr>"; echo "</td></tr></table></td></tr></table>\n\n </td></tr></table>\n </body>\n </html>\n "; }
function PrintPage($articleid) { global $xoopsConfig, $xoopsDB, $xoopsModule, $wfsConfig; $story = new WfsArticle($articleid); // BUG 174: offline article is displayed // check the showing property if ( !$story->checkPublish() ) { redirect_header("index.php",2,_WFS_NOSTORY); exit(); } // change the date from created to published same as displaying article // $datetime = formatTimestamp($story->created(), $wfsConfig['timestamp']); $datetime = formatTimestamp($story->published(), $wfsConfig['timestamp']); echo "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>\n"; echo "<html>\n<head>\n"; echo "<title>".$xoopsConfig['sitename']."</title>\n"; echo "<meta http-equiv='Content-Type' content='text/html; charset="._CHARSET."' />\n"; echo "<meta name='AUTHOR' content='".$xoopsConfig['sitename']."' />\n"; echo "<meta name='COPYRIGHT' content='Copyright (c) 2001 by ".$xoopsConfig['sitename']."' />\n"; echo "<meta name='DESCRIPTION' content='".$xoopsConfig['slogan']."' />\n"; echo "<meta name='GENERATOR' content='".XOOPS_VERSION."' />\n\n\n"; // change the image from fixation at "logo.gif" to Main Index Image set up by Index Page Management. // echo "<body bgcolor='#ffffff' text='#000000'> // <table border='0'><tr><td align='center'> // <table border='0' width='650' cellpadding='0' cellspacing='1' bgcolor='#000000'><tr><td> // <table border='0' width='650' cellpadding='20' cellspacing='1' bgcolor='#ffffff'><tr><td align='center'> // <img src='".XOOPS_URL."/modules/".$xoopsModule->dirname()."/images/logo.gif' border='0' alt='' /><br /> // <h2>".$story->title()."</h2><hr />"; $indeximage = XOOPS_URL."/modules/".$xoopsModule->dirname()."/images/".$wfsConfig['indeximage']; echo "<body bgcolor='#ffffff' text='#000000'> <table border='0'><tr><td align='center'> <table border='0' width='650' cellpadding='0' cellspacing='1' bgcolor='#000000'><tr><td> <table border='0' width='650' cellpadding='20' cellspacing='1' bgcolor='#ffffff'><tr><td align='center'> <img src='$indeximage' border='0' alt='indeximage' /><br /> <h2>".$story->title()."</h2><hr />"; // If($story->htmlpage) { // $includepage = XOOPS_ROOT_PATH."/modules/".$xoopsModule->dirname()."/html/".$story->htmlpage(); // $maintext = ''; // $maintext = include($includepage); // $maintext = $maintext; // } else { // $maintext = $story->maintext(); // //if (!empty($maintext)) $maintext .= "<hr />"; // $maintext = preg_replace("/\[pagebreak\]/","<hr width='75%' />",$maintext); // } // BUG 8569: Warning: failed to open $includepage // same as article.php $maintext = $story->maintext(); $maintext = preg_replace("/\[pagebreak\]/","<hr width='75%' />",$maintext); if($story->ishtml != '0' && $story->htmlpage()) { $maintextfile = XOOPS_ROOT_PATH.'/'.$wfsConfig['htmlpath'].'/'.$story->htmlpage; if (file_exists($maintextfile) && false !== $fp = fopen($maintextfile, 'r')) { $maintext = fread($fp, filesize($maintextfile)); fclose($fp); } } echo "<tr><td>".$maintext."<br /><br /><br /><hr /><br />"; echo "<small><b>"._WFS_DATE."</b> ".$datetime."<br /><b>" ._WFS_TOPICC."</b> ".$story->categoryTitle()."<br /><b>" ._WFS_URLFORSTORY."</b> ".XOOPS_URL."/modules/".$xoopsModule->dirname()."/article.php?articleid=".$story->articleid() ."</small><br /></td></tr>"; echo "</td></tr></table></td></tr></table>\n </td></tr></table> </body> </html> "; }
$articletag['datetime'] = formatTimestamp($article->published, $wfsConfig['timestamp']); } // $title $articletag['title'] = $article->category->textLink() . ": "; $articletag['title'] .= $article->title(); //Counter $counter = $article->counter; $pagenum = $article->maintextPages() - 1; if ($page > $pagenum) { $page = $pagenum; } if ($page == -2) { $page = 0; } $articletag['maintext'] = $article->maintextWithFile("S", $page); if ($article->ishtml != '0' && $article->htmlpage()) { $maintextfile = XOOPS_ROOT_PATH . '/' . $wfsConfig['htmlpath'] . '/' . $article->htmlpage; if (file_exists($maintextfile) && false !== ($fp = fopen($maintextfile, 'r'))) { $articletag['maintext'] = fread($fp, filesize($maintextfile)); fclose($fp); } } // Setup URL link for article $articletag['urllink'] = ' '; if ($article->url && !$article->urlname) { $articletag['urllink'] = "<a href='http://" . $article->url() . "' target='_blank'>Url Link: " . $article->url() . "</a><br />"; } elseif ($article->urlname) { $articletag['urllink'] = "<a href='http://" . $article->url() . "' target='_blank'>Url Link: " . $article->urlname() . "</a><br />"; } //Downloads links $workdir = XOOPS_ROOT_PATH . "/" . $wfsConfig['filesbasepath'];