mirror of
https://github.com/e107inc/e107.git
synced 2025-08-05 06:07:32 +02:00
Corrected/improved news print layout.
This commit is contained in:
@@ -198,7 +198,7 @@ class news_shortcodes extends e_shortcode
|
|||||||
|
|
||||||
$caption = vartrue($parm['text'],LAN_BACK);
|
$caption = vartrue($parm['text'],LAN_BACK);
|
||||||
|
|
||||||
$text = '<ul class="pager">
|
$text = '<ul class="pager hidden-print">
|
||||||
<li><a href="'.$url.'">'.e107::getParser()->toHtml($caption,false,'defs').'</a></li>
|
<li><a href="'.$url.'">'.e107::getParser()->toHtml($caption,false,'defs').'</a></li>
|
||||||
</ul>';
|
</ul>';
|
||||||
|
|
||||||
|
@@ -161,7 +161,7 @@ if (varset($e107_popup) != 1)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
echo($rinfo ? "\n<div class='e-footer-info muted smalltext'><small>{$rinfo}</small></div>\n" : "");
|
echo($rinfo ? "\n<div class='e-footer-info muted smalltext hidden-print'><small>{$rinfo}</small></div>\n" : "");
|
||||||
}
|
}
|
||||||
|
|
||||||
} // End of regular-page footer (the above NOT done for popups)
|
} // End of regular-page footer (the above NOT done for popups)
|
||||||
|
@@ -2847,7 +2847,7 @@ class e_form
|
|||||||
|
|
||||||
if(count($list))
|
if(count($list))
|
||||||
{
|
{
|
||||||
return "<div class='e-related clearfix'><hr><h4>".defset('LAN_RELATED', 'Related')."</h4><ul class='e-related'>".implode("\n",$list)."</ul></div>"; //XXX Tablerender?
|
return "<div class='e-related clearfix hidden-print'><hr><h4>".defset('LAN_RELATED', 'Related')."</h4><ul class='e-related'>".implode("\n",$list)."</ul></div>"; //XXX Tablerender?
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -99,7 +99,7 @@ $NEWS_TEMPLATE['default']['item'] = '
|
|||||||
{NEWSBODY}
|
{NEWSBODY}
|
||||||
<hr>
|
<hr>
|
||||||
<div class="options">
|
<div class="options">
|
||||||
<div class="btn-group">{NEWSCOMMENTLINK: glyph=comments&class=btn btn-default}{PRINTICON: class=btn btn-default}{PDFICON}{SOCIALSHARE}{ADMINOPTIONS: class=btn btn-default}</div>
|
<div class="btn-group hidden-print">{NEWSCOMMENTLINK: glyph=comments&class=btn btn-default}{PRINTICON: class=btn btn-default}{PDFICON}{SOCIALSHARE}{ADMINOPTIONS: class=btn btn-default}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
';
|
';
|
||||||
@@ -161,7 +161,7 @@ $NEWS_TEMPLATE['view']['item'] = '
|
|||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
<div class="options ">
|
<div class="options hidden-print ">
|
||||||
<div class="btn-group">{NEWSCOMMENTLINK: glyph=comments&class=btn btn-default}{PRINTICON: class=btn btn-default}{ADMINOPTIONS: class=btn btn-default}{SOCIALSHARE}</div>
|
<div class="btn-group">{NEWSCOMMENTLINK: glyph=comments&class=btn btn-default}{PRINTICON: class=btn btn-default}{ADMINOPTIONS: class=btn btn-default}{SOCIALSHARE}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@@ -93,7 +93,7 @@ class social_shortcodes extends e_shortcode
|
|||||||
|
|
||||||
if($text !='')
|
if($text !='')
|
||||||
{
|
{
|
||||||
return '<p class="xurl-social-icons">'.$text.'</p>';
|
return '<p class="xurl-social-icons hidden-print">'.$text.'</p>';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -273,7 +273,7 @@ class social_shortcodes extends e_shortcode
|
|||||||
{
|
{
|
||||||
$dir = ($parm['dropdown'] == 'right') ? 'pull-right' : '';
|
$dir = ($parm['dropdown'] == 'right') ? 'pull-right' : '';
|
||||||
|
|
||||||
$text = '<div class="btn-group '.$dir.'">
|
$text = '<div class="btn-group hidden-print '.$dir.'">
|
||||||
<a class="e-tip btn btn-dropdown btn-default btn-'.$size.' dropdown-toggle" data-toggle="dropdown" href="#" title="Share">'.$label.'</a>
|
<a class="e-tip btn btn-dropdown btn-default btn-'.$size.' dropdown-toggle" data-toggle="dropdown" href="#" title="Share">'.$label.'</a>
|
||||||
|
|
||||||
<ul class="dropdown-menu" role="menu" style="min-width:435px">
|
<ul class="dropdown-menu" role="menu" style="min-width:435px">
|
||||||
@@ -290,7 +290,7 @@ class social_shortcodes extends e_shortcode
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
return '<div class="btn-group text-center">'.implode("\n",$opt)."</div>";
|
return '<div class="btn-group text-center hidden-print">'.implode("\n",$opt)."</div>";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
77
print.php
77
print.php
@@ -21,18 +21,25 @@ require_once("class2.php");
|
|||||||
|
|
||||||
e107::coreLan('print');
|
e107::coreLan('print');
|
||||||
|
|
||||||
/*
|
|
||||||
$HEADER="";
|
|
||||||
$FOOTER="";
|
|
||||||
$CUSTOMHEADER = "";
|
|
||||||
$CUSTOMFOOTER = "";
|
|
||||||
*/
|
|
||||||
|
|
||||||
$qs = explode(".", e_QUERY,2);
|
$qs = explode(".", e_QUERY,2);
|
||||||
if ($qs[0] == "") {
|
if ($qs[0] == "") {
|
||||||
header("location:".e_BASE."index.php");
|
header("location:".e_BASE."index.php");
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$CSS = <<<CSS
|
||||||
|
@media print {
|
||||||
|
|
||||||
|
a[href]:after {
|
||||||
|
content: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
CSS;
|
||||||
|
|
||||||
|
|
||||||
|
e107::css('inline',$CSS);
|
||||||
|
|
||||||
define('e_IFRAME', true);
|
define('e_IFRAME', true);
|
||||||
|
|
||||||
$source = $qs[0];
|
$source = $qs[0];
|
||||||
@@ -56,13 +63,22 @@ if(strpos($source,'plugin:') !== FALSE)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$con = new convert;
|
//$con = new convert;
|
||||||
$sql->db_Select("news", "*", "news_id='{$parms}'");
|
|
||||||
$row = $sql->db_Fetch();
|
$query = "SELECT n.*,c.* FROM `#news` AS n LEFT JOIN `#news_category` AS c ON n.news_category = c.category_id WHERE n.news_id=".intval($parms);
|
||||||
$newsUrl = e107::getUrl()->create('news/view/item', $row, 'full=1');
|
|
||||||
extract($row);
|
//$sql->db_Select("news", "*", "news_id='{$parms}'");
|
||||||
define("e_PAGETITLE", $news_title);
|
$sql = e107::getDb();
|
||||||
$news_body = $tp->toHTML($news_body, TRUE, 'BODY');
|
$sql->gen($query);
|
||||||
|
$row = $sql->fetch();
|
||||||
|
$newsUrl = e107::getUrl()->create('news/view/item', $row, 'full=1');
|
||||||
|
|
||||||
|
|
||||||
|
// extract($row);
|
||||||
|
// define("e_PAGETITLE", $news_title);
|
||||||
|
//$news_body = $tp->toHTML($news_body, TRUE, 'BODY');
|
||||||
|
|
||||||
|
/*
|
||||||
$news_extended = $tp->toHTML($news_extended, TRUE, 'BODY');
|
$news_extended = $tp->toHTML($news_extended, TRUE, 'BODY');
|
||||||
if ($news_author == 0)
|
if ($news_author == 0)
|
||||||
{
|
{
|
||||||
@@ -78,7 +94,7 @@ else
|
|||||||
}
|
}
|
||||||
$news_datestamp = $con->convert_date($news_datestamp, "long");
|
$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\">
|
$print_text = "<span style=\"font-size: 13px; color: black; font-family: tahoma, verdana, arial, helvetica; text-decoration: none\">
|
||||||
<b>".LAN_PRINT_135.$news_title."</b>
|
<h2>".LAN_PRINT_135.$news_title."</h2>
|
||||||
<br />
|
<br />
|
||||||
(".LAN_PRINT_86." ".$tp->toHTML($category_name,FALSE,"defs").")
|
(".LAN_PRINT_86." ".$tp->toHTML($category_name,FALSE,"defs").")
|
||||||
<br />
|
<br />
|
||||||
@@ -87,14 +103,27 @@ else
|
|||||||
<br /><br />".
|
<br /><br />".
|
||||||
$news_body;
|
$news_body;
|
||||||
|
|
||||||
if ($news_extended != ""){ $print_text .= "<br /><br />".$news_extended; }
|
if (!empty($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; }
|
if (!empty($news_extended)){ $print_text .= "<br /><br />".$news_extended; }
|
||||||
|
if (!empty($news_source)){ $print_text .= "<br /><br />".$news_source; }
|
||||||
$print_text .= "<br /><br /></span><hr />".
|
if (!empty($news_url)){ $print_text .= "<br />".$news_url; }
|
||||||
LAN_PRINT_303.SITENAME."
|
*/
|
||||||
|
|
||||||
|
$tmp = e107::getTemplate('news', 'news', 'view');
|
||||||
|
$template = $tmp['item'];
|
||||||
|
unset($tmp);
|
||||||
|
// ob_start();
|
||||||
|
require_once(e_HANDLER."news_class.php");
|
||||||
|
$ix = new news;
|
||||||
|
|
||||||
|
$print_text = $ix->render_newsitem($row, 'return', '', $template, null);
|
||||||
|
//$print_text = ob_get_flush();
|
||||||
|
|
||||||
|
$print_text .= "<br /><br /><hr />".
|
||||||
|
LAN_PRINT_303."<b>".SITENAME."</b>
|
||||||
<br />
|
<br />
|
||||||
( ".$newsUrl." )
|
".$newsUrl."
|
||||||
";
|
";
|
||||||
|
|
||||||
|
|
||||||
@@ -121,9 +150,9 @@ else
|
|||||||
{
|
{
|
||||||
echo "
|
echo "
|
||||||
<div style='background-color:white'>
|
<div style='background-color:white'>
|
||||||
<div style='text-align:".$align."'>".$tp->parseTemplate("{LOGO}", TRUE)."</div><hr /><br />
|
<div style='text-align:".$align."'>".$tp->parseTemplate("{LOGO: h=100}", TRUE)."</div><hr />
|
||||||
<div style='text-align:".$align."'>".$print_text."</div><br /><br />
|
<div style='text-align:".$align."'>".$print_text."</div><br /><br />
|
||||||
<form action=''><div class='hidden-print' style='text-align:center'><input class='btn btn-primary ' type='button' value='".LAN_PRINT_307."' onclick='window.print()' /></div></form></div>";
|
<form action='#'><div class='hidden-print' style='text-align:center'><input class='btn btn-primary ' type='button' value='".LAN_PRINT_307."' onclick='window.print()' /></div></form></div>";
|
||||||
}
|
}
|
||||||
require_once(FOOTERF);
|
require_once(FOOTERF);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user