1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 20:58:30 +01:00
php-e107/print.php

119 lines
3.2 KiB
PHP
Raw Normal View History

2006-12-02 04:36:16 +00:00
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
2009-07-14 05:31:57 +00:00
| Copyright (C) 2001-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 $
2009-07-14 05:31:57 +00:00
| $Revision: 1.10 $
| $Date: 2009-07-14 05:31:57 $
| $Author: e107coders $
2006-12-02 04:36:16 +00:00
+----------------------------------------------------------------------------+
*/
require_once("class2.php");
$HEADER="";
$FOOTER="";
$CUSTOMHEADER = "";
$CUSTOMFOOTER = "";
2006-12-02 04:36:16 +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];
$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");
$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);
define("e_PAGETITLE", $news_title);
$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}'");
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}'");
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");
$print_text = "<span style=\"font-size: 13px; color: black; font-family: tahoma, verdana, arial, helvetica; text-decoration: none\">
2006-12-02 04:36:16 +00:00
<b>".LAN_PRINT_135.": ".$news_title."</b>
<br />
(".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;
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
$print_text .= "<br /><br /></span><hr />".
2006-12-02 04:36:16 +00:00
LAN_PRINT_303.SITENAME."
<br />
( http://".$_SERVER['HTTP_HOST'].e_HTTP."news.php?extend.".$news_id." )
2006-12-02 04:36:16 +00:00
";
}
2006-12-02 04:36:16 +00:00
if(defined("TEXTDIRECTION") && TEXTDIRECTION == "rtl"){
$align = 'right';
}else{
$align = 'left';
}
// 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);
?>