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> "; }
//echo $HTTP_POST_VARS['ishtml']; echo _AM_NOMAINTEXT . "<br />"; echo "</td></tr></table>"; break; } if ($article->approved && $article->type() != "admin") { $article->setPublished(time()); $isnew = '1'; } $article->store(); if (!empty($isnew) && $article->notifypub() && $article->uid() != 0) { $poster = new XoopsUser($article->uid()); $subject = _AM_ARTPUBLISHED; $message = sprintf(_AM_HELLO, $poster->uname()); $message .= "\n\n" . _AM_YOURARTPUB . "\n\n"; $message .= _AM_TITLEC . $article->title() . "\n" . _AM_URLC . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/article.php?articleryid=" . $article->storyid() . "\n" . _AM_PUBLISHEDC . formatTimestamp($article->published(), "{$timestanp}", 0) . "\n\n"; $message .= $xoopsConfig['sitename'] . "\n" . XOOPS_URL . ""; $xoopsMailer =& getMailer(); $xoopsMailer->useMail(); $xoopsMailer->setToEmails($poster->getVar("email")); $xoopsMailer->setFromEmail($xoopsConfig['adminmail']); $xoopsMailer->setFromName($xoopsConfig['sitename']); $xoopsMailer->setSubject($subject); $xoopsMailer->setBody($message); $xoopsMailer->send(); } redirect_header('allarticles.php', 1, _AM_DBUPDATED); exit; break; case "delete": if ($ok) {