Exemple #1
0
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>&nbsp;".$datetime."<br /><b>"
        ._WFS_TOPICC."</b>&nbsp;".$story->categoryTitle()."<br /><b>"
        ._WFS_URLFORSTORY."</b>&nbsp;".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>
            ";
}
Exemple #2
0
if (empty($item_id)) {
	redirect_header("index.php",2,_WFS_NOSTORY);
	exit();
}

// add if block
IF ($count == 1)
{

$myts =& MyTextSanitizer::getInstance();
$article = new WfsArticle($item_id);

// BUG 174: offline article is displayed
// check the showing property
if ( !$article->checkPublish() ) 
{
	redirect_header("index.php",2,_WFS_NOSTORY);
	exit();
}

// easy to rename module and table
if ($article->ishtml == '2') {
//$xoopsOption['template_main'] = 'wfsection_htmlart.html';
$xoopsOption['template_main'] = $wfsHtmlHtmlart;
} else {
//$xoopsOption['template_main'] = 'wfsection_article.html';
$xoopsOption['template_main'] = $wfsHtmlArticle;
}

include_once(XOOPS_ROOT_PATH."/header.php");