Exemple #1
0
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>&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\n            </td></tr></table>\n            </body>\n            </html>\n            ";
}
Exemple #2
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 #3
0
             $body .= "\n" . _POSTEDBY . ": " . XoopsUser::getUnameFromId($uid);
             $body .= "\n" . _DATE . ": " . formatTimestamp(time(), 'm', $xoopsConfig['default_TZ']);
             $body .= "\n\n" . XOOPS_URL . '/modules/wfsection/admin/index.php?op=edit&articleid=' . $result;
             $xoopsMailer->setBody($body);
             $xoopsMailer->send();
         }
     } else {
         echo 'error';
     }
     redirect_header("index.php", 2, _WFS_THANKS);
     break;
 case "edit":
     include_once XOOPS_ROOT_PATH . "/modules/" . $xoopsModule->dirname() . "/class/wfscategory.php";
     include_once XOOPS_ROOT_PATH . "/modules/" . $xoopsModule->dirname() . "/class/wfsarticle.php";
     $story = new WfsArticle('articleid');
     $subject = $story->title();
     $message = $story->mainText();
     $summary = $story->summary("Edit");
     $url = $story->url();
     $urlname = $story->urlname();
     //$story->Uid();
     //$story->setCategoryid($id);
     //$story->setNohtml($nohtml_db);
     $nosmiley = isset($nosmiley) ? intval($nosmiley) : 0;
     $notifypub = isset($notifypub) ? intval($notifypub) : 0;
     $story->setHtmlpage("");
     $story->setIshtml(0);
     //$story->setGroupid($groupid);
     //$story->setNosmiley($nosmiley);
     //$story->setPublished(0);
     //$story->setExpired(0);
Exemple #4
0
     if ($wfsConfig['realname'] && $user->getvar('name') != '') {
         $articletag['poster'] = $user->getvar('name');
     } else {
         $articletag['poster'] = $user->getvar('uname');
     }
     $articletag['poster'] = "<a href='" . XOOPS_URL . "/userinfo.php?uid=" . $user->getVar('uid') . "'>" . $articletag['poster'] . "</a>";
 } else {
     $articletag['poster'] = $xoopsConfig['anonymous'];
 }
 // $datetime
 if (isset($article->published)) {
     $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);
Exemple #5
0
         //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) {
Exemple #6
0
		if (($wfsConfig['realname']) && $user->getvar('name') != '') {
			$articletag['poster'] = $user->getvar('name');
		} else {
			$articletag['poster']  = $user->getvar('uname');
		} 
		$articletag['poster']  = "<a href='".XOOPS_URL."/userinfo.php?uid=".$user->getVar('uid')."'>".$articletag['poster'] ."</a>";
	} else {
		$articletag['poster']  = $xoopsConfig['anonymous'];
	}

// $datetime
	if ( isset($article->published)) $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);
		}
	}