2006-12-02 04:36:16 +00:00
|
|
|
<?php
|
|
|
|
/*
|
|
|
|
+ ----------------------------------------------------------------------------+
|
|
|
|
| e107 website system
|
|
|
|
|
|
2009-11-18 01:06:08 +00:00
|
|
|
| Copyright (C) 2008-2009 e107 Inc
|
2006-12-02 04:36:16 +00:00
|
|
|
| http://e107.org
|
2009-07-14 05:31:57 +00:00
|
|
|
|
|
2006-12-02 04:36:16 +00:00
|
|
|
|
|
|
|
|
| Released under the terms and conditions of the
|
|
|
|
| GNU General Public License (http://gnu.org).
|
|
|
|
|
|
|
|
|
| $Source: /cvs_backup/e107_0.8/print.php,v $
|
2010-02-10 18:18:01 +00:00
|
|
|
| $Revision$
|
|
|
|
| $Date$
|
|
|
|
| $Author$
|
2006-12-02 04:36:16 +00:00
|
|
|
+----------------------------------------------------------------------------+
|
|
|
|
*/
|
|
|
|
require_once("class2.php");
|
2012-12-07 09:34:22 +02:00
|
|
|
//include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_'.e_PAGE);
|
|
|
|
e107::coreLan('print');
|
2009-08-28 15:30:25 +00:00
|
|
|
|
2006-12-02 04:36:16 +00:00
|
|
|
$HEADER="";
|
|
|
|
$FOOTER="";
|
2007-02-11 18:26:54 +00:00
|
|
|
$CUSTOMHEADER = "";
|
|
|
|
$CUSTOMFOOTER = "";
|
2007-01-24 22:34:29 +00:00
|
|
|
|
2006-12-02 04:36:16 +00:00
|
|
|
|
2008-01-09 22:06:22 +00:00
|
|
|
$qs = explode(".", e_QUERY,2);
|
2006-12-02 04:36:16 +00:00
|
|
|
if ($qs[0] == "") {
|
|
|
|
header("location:".e_BASE."index.php");
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
$source = $qs[0];
|
2008-01-09 22:06:22 +00:00
|
|
|
$parms = varset($qs[1],'');
|
2006-12-02 04:36:16 +00:00
|
|
|
unset($qs);
|
|
|
|
|
|
|
|
if(strpos($source,'plugin:') !== FALSE)
|
|
|
|
{
|
|
|
|
$plugin = substr($source,7);
|
|
|
|
if(file_exists(e_PLUGIN.$plugin."/e_emailprint.php"))
|
|
|
|
{
|
|
|
|
include_once(e_PLUGIN.$plugin."/e_emailprint.php");
|
2007-01-24 22:34:29 +00:00
|
|
|
$print_text = print_item($parms);
|
|
|
|
// define("e_PAGETITLE", $plugin);
|
2006-12-02 04:36:16 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
echo "file missing.";
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$con = new convert;
|
|
|
|
$sql->db_Select("news", "*", "news_id='{$parms}'");
|
|
|
|
$row = $sql->db_Fetch();
|
|
|
|
extract($row);
|
2007-01-24 22:34:29 +00:00
|
|
|
define("e_PAGETITLE", $news_title);
|
2008-01-09 22:06:22 +00:00
|
|
|
$news_body = $tp->toHTML($news_body, TRUE, 'BODY');
|
|
|
|
$news_extended = $tp->toHTML($news_extended, TRUE, 'BODY');
|
2006-12-02 04:36:16 +00:00
|
|
|
if ($news_author == 0)
|
|
|
|
{
|
|
|
|
$a_name = "e107";
|
|
|
|
$category_name = "e107 welcome message";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$sql->db_Select("news_category", "category_id, category_name", "category_id='{$news_category}'");
|
2009-01-22 01:58:29 +00:00
|
|
|
list($category_id, $category_name) = $sql->db_Fetch(MYSQL_NUM);
|
2006-12-02 04:36:16 +00:00
|
|
|
$sql->db_Select("user", "user_id, user_name", "user_id='{$news_author}'");
|
2009-01-22 01:58:29 +00:00
|
|
|
list($a_id, $a_name) = $sql->db_Fetch(MYSQL_NUM);
|
2006-12-02 04:36:16 +00:00
|
|
|
}
|
|
|
|
$news_datestamp = $con->convert_date($news_datestamp, "long");
|
2007-02-13 22:27:33 +00:00
|
|
|
$print_text = "<span style=\"font-size: 13px; color: black; font-family: tahoma, verdana, arial, helvetica; text-decoration: none\">
|
2010-08-23 17:32:24 +00:00
|
|
|
<b>".LAN_PRINT_135.$news_title."</b>
|
2006-12-02 04:36:16 +00:00
|
|
|
<br />
|
2007-02-13 22:27:33 +00:00
|
|
|
(".LAN_PRINT_86." ".$tp->toHTML($category_name,FALSE,"defs").")
|
2006-12-02 04:36:16 +00:00
|
|
|
<br />
|
|
|
|
".LAN_PRINT_94." ".$a_name."<br />
|
|
|
|
".$news_datestamp."
|
|
|
|
<br /><br />".
|
|
|
|
$news_body;
|
|
|
|
|
2007-01-24 22:34:29 +00:00
|
|
|
if ($news_extended != ""){ $print_text .= "<br /><br />".$news_extended; }
|
|
|
|
if ($news_source != ""){ $print_text .= "<br /><br />".$news_source; }
|
|
|
|
if ($news_url != ""){ $print_text .= "<br />".$news_url; }
|
2006-12-02 04:36:16 +00:00
|
|
|
|
2007-02-13 22:27:33 +00:00
|
|
|
$print_text .= "<br /><br /></span><hr />".
|
2006-12-02 04:36:16 +00:00
|
|
|
LAN_PRINT_303.SITENAME."
|
|
|
|
<br />
|
2007-02-13 22:27:33 +00:00
|
|
|
( http://".$_SERVER['HTTP_HOST'].e_HTTP."news.php?extend.".$news_id." )
|
2006-12-02 04:36:16 +00:00
|
|
|
";
|
|
|
|
}
|
|
|
|
|
2007-01-24 22:34:29 +00:00
|
|
|
|
2006-12-02 04:36:16 +00:00
|
|
|
if(defined("TEXTDIRECTION") && TEXTDIRECTION == "rtl"){
|
|
|
|
$align = 'right';
|
|
|
|
}else{
|
|
|
|
$align = 'left';
|
|
|
|
}
|
|
|
|
|
2007-01-24 22:34:29 +00:00
|
|
|
// Header down here to give us a chance to set a page title
|
|
|
|
require_once(HEADERF);
|
|
|
|
|
2009-04-16 10:02:03 +00:00
|
|
|
//temporary solution - object of future cahges
|
|
|
|
if(is_readable(THEME.'print_template.php'))
|
|
|
|
{
|
|
|
|
include_once(THEME.'print_template.php');
|
|
|
|
echo $tp->parseTemplate($PRINT_TEMPLATE);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
echo "
|
|
|
|
<div style='background-color:white'>
|
|
|
|
<div style='text-align:".$align."'>".$tp->parseTemplate("{LOGO}", TRUE)."</div><hr /><br />
|
|
|
|
<div style='text-align:".$align."'>".$print_text."</div><br /><br />
|
|
|
|
<form action=''><div style='text-align:center'><input type='button' value='".LAN_PRINT_307."' onclick='window.print()' /></div></form></div>";
|
|
|
|
}
|
2006-12-02 04:36:16 +00:00
|
|
|
require_once(FOOTERF);
|
|
|
|
|
|
|
|
?>
|