Opcja wydruku dodatkowych stron dla v7
|
Martini26 |
Dodany dnia 05.12.2008 07:50:37
|
Przedszkolak
Postów: 54 Ostrzeżeń: 3
Data rejestracji: 09.09.2007 10:01
|
Witam!
Znalazlem takie nakladki autorstwa Wooya ale na starego PHP-Fusiona pod tym linkiem: http://www.php-fu...ad_id=3304
Sprawdzilem wgrywajac je do nowego ale nie dzialaja niestety :|
Chodzi o to aby byla mozliwosc druku stron dodatkowych tak jak newsow i artykulow poprzez ikonke drukarki.
Czy mozna liczyc na czyjas dobra wole i przerobienie tego pod najnowszego PHP-Fusiona?
Dzieki.
PW od moderatora:
- Przeniesienie tematu - khaman 05.12 - 08:56
Edytowane przez Pieka dnia 20.10.2010 10:01:18
Pozdrawiam
Martini26
|
|
|
|
Wścibski Gość |
Dodany dnia 24.11.2024 17:58:10
|
Pan Kontekstualny
Postów: n^x
Data rejestracji: Zawsze
|
|
IP: localhost |
|
|
kefirek |
Dodany dnia 05.12.2008 12:17:55
|
Zaawansowany
Postów: 1191 Pomógł: 418 Ostrzeżeń: 1
v6.00.xxx Data rejestracji: 06.04.2008 21:59
|
W pliku print.php dodajesz to co oznaczone:
<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2008 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: print.php
| Author: Nick Jones (Digitanium)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at http://www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "maincore.php";
include LOCALE.LOCALESET."print.php";
echo "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>\n";
echo "<html>\n<head>\n";
echo "<title>".$settings['sitename']."</title>\n";
echo "<meta http-equiv='Content-Type' content='text/html; charset=".$locale['charset']."' />\n";
echo "<meta name='description' content='".$settings['description']."' />\n";
echo "<meta name='keywords' content='".$settings['keywords']."' />\n";
echo "<style type=\"text/css\">\n";
echo "body { font-family:Verdana,Tahoma,Arial,Sans-Serif;font-size:14px; }\n";
echo "hr { height:1px;color:#ccc; }\n";
echo ".small { font-family:Verdana,Tahoma,Arial,Sans-Serif;font-size:12px; }\n";
echo ".small2 { font-family:Verdana,Tahoma,Arial,Sans-Serif;font-size:12px;color:#666; }\n";
echo "</style>\n</head>\n<body>\n";
if ((isset($_GET['type']) && $_GET['type'] == "A") && (isset($_GET['item_id']) && isnum($_GET['item_id']))) {
$result = dbquery(
"SELECT ta.*,tac.*, tu.user_id,user_name FROM ".DB_ARTICLES." ta
INNER JOIN ".DB_ARTICLE_CATS." tac ON ta.article_cat=tac.article_cat_id
LEFT JOIN ".DB_USERS." tu ON ta.article_name=tu.user_id
WHERE article_id='".$_GET['item_id']."' AND article_draft='0'"
);
$res = false;
if (dbrows($result)) {
$data = dbarray($result);
if (checkgroup($data['article_cat_access'])) {
$res = true;
$article = str_replace("<--PAGEBREAK-->", "", stripslashes($data['article_article']));
if ($data['article_breaks'] == "y") { $article = nl2br($article); }
echo "<strong>".$data['article_subject']."</strong><br />\n";
echo "<span class='small'>".$locale['400'].$data['user_name'].$locale['401'].ucfirst(showdate("longdate", $data['article_datestamp']))."</span>\n";
echo "<hr />".$article."\n";
}
}
if (!$res) { redirect("index.php"); }
} elseif ((isset($_GET['type']) && $_GET['type'] == "N") && (isset($_GET['item_id']) && isnum($_GET['item_id']))) {
$result = dbquery(
"SELECT tn.*, user_id, user_name FROM ".DB_NEWS." tn
LEFT JOIN ".DB_USERS." tu ON tn.news_name=tu.user_id
WHERE news_id='".$_GET['item_id']."' AND news_draft='0'"
);
$res = false;
if (dbrows($result) != 0) {
$data = dbarray($result);
if (checkgroup($data['news_visibility'])) {
$res = true;
$news = stripslashes($data['news_news']);
if ($data['news_breaks'] == "y") { $news = nl2br($news); }
if ($data['news_extended']) {
$news_extended = stripslashes($data['news_extended']);
if ($data['news_breaks'] == "y") { $news_extended = nl2br($news_extended); }
} else {
$news_extended = "";
}
echo "<strong>".$data['news_subject']."</strong><br />\n";
echo "<span class='small'>".$locale['400'].$data['user_name'].$locale['401'].ucfirst(showdate("longdate", $data['news_datestamp']))."</span>\n";
echo "<hr />".$news."\n";
if ($news_extended) { echo "<hr />\n<strong>".$locale['402']."</strong>\n<hr>\n$news_extended\n"; }
}
}
if (!$res) { redirect("index.php"); }
} elseif ((isset($_GET['type']) && $_GET['type'] == "F") && (isset($_GET['thread']) && isNum($_GET['thread'])) && !isset($_GET['post'])) {
$result = dbquery("SELECT fp.*, fu.user_name AS user_name, fe.user_name AS edit_name, ft.thread_subject, ff.forum_access FROM ".DB_THREADS." ft INNER JOIN ".DB_POSTS." fp ON ft.thread_id = fp.thread_id INNER JOIN ".DB_FORUMS." ff ON ff.forum_id = ft.forum_id INNER JOIN ".DB_USERS." fu ON fu.user_id = fp.post_author LEFT JOIN ".DB_USERS." fe ON fe.user_id = fp.post_edituser WHERE ft.thread_id=".$_GET['thread']." ORDER BY fp.post_datestamp");
$res = false; $i = 0;
if (dbrows($result)) {
while ($data = dbarray($result)) {
if (checkgroup($data['forum_access'])) {
$res = true;
if ($i == 0) echo $locale['500']." <strong>".$settings['sitename']." :: ".$data['thread_subject']."</strong><hr /><br />\n";
echo "<div style='margin-left:20px'>\n";
echo "<div style='float:left'>".$locale['501'].$data['user_name'].$locale['502'].showdate("forumdate", $data['post_datestamp'])."</div><div style='float:right'>#".($i+1)."</div><div style='float:none;clear:both'></div><hr />\n";
echo parseubb(nl2br($data['post_message']));
if ($data['edit_name']!='') {
echo "<div style='margin-left:20px'>\n<hr />\n";
echo $locale['503'].$data['edit_name'].$locale['502'].showdate("forumdate", $data['post_edittime']);
echo "</div>\n";
}
echo "</div>\n";
echo "<br />\n";
$i++;
}
}
}
if (!$res) { redirect("index.php"); }
} elseif ((isset($_GET['type']) && $_GET['type'] == "F") && (isset($_GET['thread']) && isNum($_GET['thread'])) && (isset($_GET['post']) && isNum($_GET['post'])) && (isset($_GET['nr']) && isNum($_GET['nr']))) {
$result = dbquery("SELECT fp.*, fu.user_name AS user_name, fe.user_name AS edit_name, ft.thread_subject, ff.forum_access FROM ".DB_THREADS." ft INNER JOIN ".DB_POSTS." fp ON ft.thread_id = fp.thread_id INNER JOIN ".DB_FORUMS." ff ON ff.forum_id = ft.forum_id INNER JOIN ".DB_USERS." fu ON fu.user_id = fp.post_author LEFT JOIN ".DB_USERS." fe ON fe.user_id = fp.post_edituser WHERE ft.thread_id=".$_GET['thread']." AND fp.post_id = ".$_GET['post']);
$res = false;
if (dbrows($result)) {
$data = dbarray($result);
if (checkgroup($data['forum_access'])) {
$res = true;
echo $locale['500']." <strong>".$settings['sitename']." :: ".$data['thread_subject']."</strong><hr /><br />\n";
echo "<div style='margin-left:20px'>\n";
echo "<div style='float:left'>".$locale['501'].$data['user_name'].$locale['502'].showdate("forumdate", $data['post_datestamp'])."</div><div style='float:right'>#".$_GET['nr']."</div><div style='float:none;clear:both'></div><hr />\n";
echo parseubb(nl2br($data['post_message']));
if ($data['edit_name']!='') {
echo "<div style='margin-left:20px'>\n<hr />\n";
echo $locale['503'].$data['edit_name'].$locale['502'].showdate("forumdate", $data['post_edittime']);
echo "</div>\n";
}
echo "</div>\n";
echo "<br />\n";
}
}
if (!$res) { redirect("index.php"); }
} elseif (isset($_GET['type']) && $_GET['type'] == "T" && $settings['enable_terms'] == 1) {
echo "<strong>".$settings['sitename']." ".$locale['600']."</strong><br />\n";
echo "<span class='small'>".$locale['601']." ".ucfirst(showdate("longdate", $settings['license_lastupdate']))."</span>\n";
echo "<hr />".stripslashes($settings['license_agreement'])."\n";
//Drukuj
} else if (isset($_GET['type']) && $_GET['type'] == "P" && isset($_GET['page_id']) && isNum($_GET['page_id'])) {
$result = dbquery("SELECT * FROM ".DB_CUSTOM_PAGES." WHERE page_id='".$_GET['page_id']."'");
if (dbrows($result) != 0) {
$data = dbarray($result);
echo "<b>".$data['page_title']."</b><br>";
if (checkgroup($data['page_access'])) {
eval("?>".stripslashes($data['page_content'])."<?php ");
}
}
//Drukuj
} else {
redirect("index.php");
}
echo "</body>\n</html>\n";
?>
W pliku viewpage.php dodajesz to zaznaczone:
<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2008 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: viewpage.php
| Author: Nick Jones (Digitanium)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at http://www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "maincore.php";
require_once THEMES."templates/header.php";
require_once INCLUDES."comments_include.php";
require_once INCLUDES."ratings_include.php";
include LOCALE.LOCALESET."custom_pages.php";
if (!isset($_GET['page_id']) || !isnum($_GET['page_id'])) { redirect("index.php"); }
if (!isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) { $_GET['rowstart'] = 0; }
$result = dbquery("SELECT * FROM ".DB_CUSTOM_PAGES." WHERE page_id='".$_GET['page_id']."'");
if (dbrows($result) != 0) {
$data = dbarray($result);
add_to_title($locale['global_200'].$data['page_title']);
opentable($data['page_title']);
if (checkgroup($data['page_access'])) {
ob_start();
eval("?>".stripslashes($data['page_content'])."<?php ");
$custompage = ob_get_contents();
ob_end_clean();
if ($settings['tinymce_enabled']) {
$custompage = explode("<!-- pagebreak -->", $custompage);
$pagecount = count($custompage);
echo $custompage[$_GET['rowstart']];
if ($pagecount > 1) {
echo "<div align='center' style='margin-top:5px;'>\n".makepagenav($_GET['rowstart'], 1, $pagecount, 3, FUSION_SELF."?page_id=".$_GET['page_id']."&")."\n</div>\n";
}
} else {
echo $custompage;
}
} else {
echo "<div style='text-align:center'><br />\n".$locale['400']."\n<br /><br /></div>\n";
}
} else {
add_to_title($locale['global_200'].$locale['401']);
opentable($locale['401']);
echo "<div style='text-align:center'><br />\n".$locale['402']."\n<br /><br /></div>\n";
}
//Drukuj
echo "<br><br><div style='text-align:right'><a href='".BASEDIR."print.php?type=P&page_id=".$_GET['page_id']."'><img src='".THEME."images/printer.gif' alt='' style='border:0px;vertical-align:middle;'></a></div>";
//Drukuj
closetable();
if (dbrows($result) && checkgroup($data['page_access'])) {
if ($data['page_allow_comments']) { showcomments("C", DB_CUSTOM_PAGES, "page_id", $_GET['page_id'],FUSION_SELF."?page_id=".$_GET['page_id']); }
if ($data['page_allow_ratings']) { showratings("C", $_GET['page_id'], FUSION_SELF."?page_id=".$_GET['page_id']); }
}
require_once THEMES."templates/footer.php";
?>
Edytowane przez Pieka dnia 12.03.2011 22:36:43
|
|
|
|
Martini26 |
Dodany dnia 05.12.2008 14:02:40
|
Przedszkolak
Postów: 54 Ostrzeżeń: 3
Data rejestracji: 09.09.2007 10:01
|
Serdeczne dzieki za szybka odpowiedz!
Cos mi nie dzialaja te wpisy ;/ wysypuje sie blad po otwarciu dodatkowej strony w postaci:
Parse error: syntax error, unexpected '[' in /virtual/pl/bytom/mopr/marcin/viewpage.php on line 57
Czy mozesz pomoc albo poprostu wrzucic dobre pliki zmienione w orginale aby je tylko podmienic?
Dzieki
Usunalem znacznik [colour] i strona dodatkowa sie otwiera ale nie ma ikonki drukarki podajacej strone gotowa do wydruku :(
Edytowane przez Martini26 dnia 08.12.2008 14:25:00
Pozdrawiam
Martini26
|
|
|
|
kefirek |
Dodany dnia 08.12.2008 19:12:43
|
Zaawansowany
Postów: 1191 Pomógł: 418 Ostrzeżeń: 1
v6.00.xxx Data rejestracji: 06.04.2008 21:59
|
W załączniku daje gotowe pliki
kefirek dodał/a następującą plik:
Edytowane przez kefirek dnia 08.12.2008 19:13:04
|
|
|
|
Wooya |
Dodany dnia 08.12.2008 19:18:00
|
Zaawansowany
Postów: 1449 Pomógł: 22
Data rejestracji: 30.01.2005 15:40
|
Tak mnie ostatnio korcilo, czego w custom pages brakuje Dzieki za przypomnienie, sprawa trafila na DEV.
Edytowane przez Wooya dnia 08.12.2008 19:18:09
... Pomagam tylko przy najnowszych wersjach PHP-Fusion ...
|
|
|
|
Martini26 |
Dodany dnia 08.12.2008 20:19:48
|
Przedszkolak
Postów: 54 Ostrzeżeń: 3
Data rejestracji: 09.09.2007 10:01
|
Teraz dziala wysmiecicie!
Dziekuje!
Pozdrawiam
Martini26
|
|
|
|
Siwy_boros |
Dodany dnia 12.10.2010 19:37:15
|
Przedszkolak
Postów: 19
v7.01.06 Data rejestracji: 02.10.2010 16:33
|
Odswieżam jak widzę dość stary temat, ale potrzebuję właśnie takich przeróbek do najnowszej wersji Fusiona 7.01.01. Dało by się wpadkować poprawione pliki lbu napisać co zmienić w kodzie print.php i viewpage.php aby drukowanie działało na wybranych stronach ??
Wiadomość doklejona:
Sorka za umieszczenie posta nie w tym dziale. Będę już pamiętał Po prostu znalazłem temat w szukajce, wczytałem się w niego i dopisałem nie patrząc, że dotyczy wersji "6". A o spojrzeniu w dział "7" już nie pomyślałem.
PW od moderatora:
- Przeniesienie posta - khaman 12.10 - 19:37
Edytowane przez Siwy_boros dnia 12.10.2010 20:32:10
|
|
|
|
Martini26 |
Dodany dnia 20.10.2010 10:07:13
|
Przedszkolak
Postów: 54 Ostrzeżeń: 3
Data rejestracji: 09.09.2007 10:01
|
Przyłączam się do kolegi - w końcu tyle chyba mogę zrobić?
Edytowane przez Martini26 dnia 20.10.2010 10:07:34
Pozdrawiam
Martini26
|
|
|
|
Pawlo_23 |
Dodany dnia 12.03.2011 22:10:49
|
Przedszkolak
Postów: 23
Data rejestracji: 18.05.2010 00:08
|
kefirek napisał/a:
W pliku print.php dodajesz to co oznaczone:
<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2008 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: print.php
| Author: Nick Jones (Digitanium)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at http://www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "maincore.php";
include LOCALE.LOCALESET."print.php";
echo "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>\n";
echo "<html>\n<head>\n";
echo "<title>".$settings['sitename']."</title>\n";
echo "<meta http-equiv='Content-Type' content='text/html; charset=".$locale['charset']."' />\n";
echo "<meta name='description' content='".$settings['description']."' />\n";
echo "<meta name='keywords' content='".$settings['keywords']."' />\n";
echo "<style type=\"text/css\">\n";
echo "body { font-family:Verdana,Tahoma,Arial,Sans-Serif;font-size:14px; }\n";
echo "hr { height:1px;color:#ccc; }\n";
echo ".small { font-family:Verdana,Tahoma,Arial,Sans-Serif;font-size:12px; }\n";
echo ".small2 { font-family:Verdana,Tahoma,Arial,Sans-Serif;font-size:12px;color:#666; }\n";
echo "</style>\n</head>\n<body>\n";
if ((isset($_GET['type']) && $_GET['type'] == "A") && (isset($_GET['item_id']) && isnum($_GET['item_id']))) {
$result = dbquery(
"SELECT ta.*,tac.*, tu.user_id,user_name FROM ".DB_ARTICLES." ta
INNER JOIN ".DB_ARTICLE_CATS." tac ON ta.article_cat=tac.article_cat_id
LEFT JOIN ".DB_USERS." tu ON ta.article_name=tu.user_id
WHERE article_id='".$_GET['item_id']."' AND article_draft='0'"
);
$res = false;
if (dbrows($result)) {
$data = dbarray($result);
if (checkgroup($data['article_cat_access'])) {
$res = true;
$article = str_replace("<--PAGEBREAK-->", "", stripslashes($data['article_article']));
if ($data['article_breaks'] == "y") { $article = nl2br($article); }
echo "<strong>".$data['article_subject']."</strong><br />\n";
echo "<span class='small'>".$locale['400'].$data['user_name'].$locale['401'].ucfirst(showdate("longdate", $data['article_datestamp']))."</span>\n";
echo "<hr />".$article."\n";
}
}
if (!$res) { redirect("index.php"); }
} elseif ((isset($_GET['type']) && $_GET['type'] == "N") && (isset($_GET['item_id']) && isnum($_GET['item_id']))) {
$result = dbquery(
"SELECT tn.*, user_id, user_name FROM ".DB_NEWS." tn
LEFT JOIN ".DB_USERS." tu ON tn.news_name=tu.user_id
WHERE news_id='".$_GET['item_id']."' AND news_draft='0'"
);
$res = false;
if (dbrows($result) != 0) {
$data = dbarray($result);
if (checkgroup($data['news_visibility'])) {
$res = true;
$news = stripslashes($data['news_news']);
if ($data['news_breaks'] == "y") { $news = nl2br($news); }
if ($data['news_extended']) {
$news_extended = stripslashes($data['news_extended']);
if ($data['news_breaks'] == "y") { $news_extended = nl2br($news_extended); }
} else {
$news_extended = "";
}
echo "<strong>".$data['news_subject']."</strong><br />\n";
echo "<span class='small'>".$locale['400'].$data['user_name'].$locale['401'].ucfirst(showdate("longdate", $data['news_datestamp']))."</span>\n";
echo "<hr />".$news."\n";
if ($news_extended) { echo "<hr />\n<strong>".$locale['402']."</strong>\n<hr>\n$news_extended\n"; }
}
}
if (!$res) { redirect("index.php"); }
} elseif ((isset($_GET['type']) && $_GET['type'] == "F") && (isset($_GET['thread']) && isNum($_GET['thread'])) && !isset($_GET['post'])) {
$result = dbquery("SELECT fp.*, fu.user_name AS user_name, fe.user_name AS edit_name, ft.thread_subject, ff.forum_access FROM ".DB_THREADS." ft INNER JOIN ".DB_POSTS." fp ON ft.thread_id = fp.thread_id INNER JOIN ".DB_FORUMS." ff ON ff.forum_id = ft.forum_id INNER JOIN ".DB_USERS." fu ON fu.user_id = fp.post_author LEFT JOIN ".DB_USERS." fe ON fe.user_id = fp.post_edituser WHERE ft.thread_id=".$_GET['thread']." ORDER BY fp.post_datestamp");
$res = false; $i = 0;
if (dbrows($result)) {
while ($data = dbarray($result)) {
if (checkgroup($data['forum_access'])) {
$res = true;
if ($i == 0) echo $locale['500']." <strong>".$settings['sitename']." :: ".$data['thread_subject']."</strong><hr /><br />\n";
echo "<div style='margin-left:20px'>\n";
echo "<div style='float:left'>".$locale['501'].$data['user_name'].$locale['502'].showdate("forumdate", $data['post_datestamp'])."</div><div style='float:right'>#".($i+1)."</div><div style='float:none;clear:both'></div><hr />\n";
echo parseubb(nl2br($data['post_message']));
if ($data['edit_name']!='') {
echo "<div style='margin-left:20px'>\n<hr />\n";
echo $locale['503'].$data['edit_name'].$locale['502'].showdate("forumdate", $data['post_edittime']);
echo "</div>\n";
}
echo "</div>\n";
echo "<br />\n";
$i++;
}
}
}
if (!$res) { redirect("index.php"); }
} elseif ((isset($_GET['type']) && $_GET['type'] == "F") && (isset($_GET['thread']) && isNum($_GET['thread'])) && (isset($_GET['post']) && isNum($_GET['post'])) && (isset($_GET['nr']) && isNum($_GET['nr']))) {
$result = dbquery("SELECT fp.*, fu.user_name AS user_name, fe.user_name AS edit_name, ft.thread_subject, ff.forum_access FROM ".DB_THREADS." ft INNER JOIN ".DB_POSTS." fp ON ft.thread_id = fp.thread_id INNER JOIN ".DB_FORUMS." ff ON ff.forum_id = ft.forum_id INNER JOIN ".DB_USERS." fu ON fu.user_id = fp.post_author LEFT JOIN ".DB_USERS." fe ON fe.user_id = fp.post_edituser WHERE ft.thread_id=".$_GET['thread']." AND fp.post_id = ".$_GET['post']);
$res = false;
if (dbrows($result)) {
$data = dbarray($result);
if (checkgroup($data['forum_access'])) {
$res = true;
echo $locale['500']." <strong>".$settings['sitename']." :: ".$data['thread_subject']."</strong><hr /><br />\n";
echo "<div style='margin-left:20px'>\n";
echo "<div style='float:left'>".$locale['501'].$data['user_name'].$locale['502'].showdate("forumdate", $data['post_datestamp'])."</div><div style='float:right'>#".$_GET['nr']."</div><div style='float:none;clear:both'></div><hr />\n";
echo parseubb(nl2br($data['post_message']));
if ($data['edit_name']!='') {
echo "<div style='margin-left:20px'>\n<hr />\n";
echo $locale['503'].$data['edit_name'].$locale['502'].showdate("forumdate", $data['post_edittime']);
echo "</div>\n";
}
echo "</div>\n";
echo "<br />\n";
}
}
if (!$res) { redirect("index.php"); }
} elseif (isset($_GET['type']) && $_GET['type'] == "T" && $settings['enable_terms'] == 1) {
echo "<strong>".$settings['sitename']." ".$locale['600']."</strong><br />\n";
echo "<span class='small'>".$locale['601']." ".ucfirst(showdate("longdate", $settings['license_lastupdate']))."</span>\n";
echo "<hr />".stripslashes($settings['license_agreement'])."\n";
//Drukuj
} else if (isset($_GET['type']) && $_GET['type'] == "P" && isset($_GET['page_id']) && isNum($_GET['page_id'])) {
$result = dbquery("SELECT * FROM ".DB_CUSTOM_PAGES." WHERE page_id='".$_GET['page_id']."'");
if (dbrows($result) != 0) {
$data = dbarray($result);
echo "<b>".$data['page_title']."</b><br>";
if (checkgroup($data['page_access'])) {
eval("?>".stripslashes($data['page_content'])."<?php ");
}
}
//Drukuj
} else {
redirect("index.php");
}
echo "</body>\n</html>\n";
?>
W pliku viewpage.php dodajesz to zaznaczone:
<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2008 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: viewpage.php
| Author: Nick Jones (Digitanium)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at http://www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "maincore.php";
require_once THEMES."templates/header.php";
require_once INCLUDES."comments_include.php";
require_once INCLUDES."ratings_include.php";
include LOCALE.LOCALESET."custom_pages.php";
if (!isset($_GET['page_id']) || !isnum($_GET['page_id'])) { redirect("index.php"); }
if (!isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) { $_GET['rowstart'] = 0; }
$result = dbquery("SELECT * FROM ".DB_CUSTOM_PAGES." WHERE page_id='".$_GET['page_id']."'");
if (dbrows($result) != 0) {
$data = dbarray($result);
add_to_title($locale['global_200'].$data['page_title']);
opentable($data['page_title']);
if (checkgroup($data['page_access'])) {
ob_start();
eval("?>".stripslashes($data['page_content'])."<?php ");
$custompage = ob_get_contents();
ob_end_clean();
if ($settings['tinymce_enabled']) {
$custompage = explode("<!-- pagebreak -->", $custompage);
$pagecount = count($custompage);
echo $custompage[$_GET['rowstart']];
if ($pagecount > 1) {
echo "<div align='center' style='margin-top:5px;'>\n".makepagenav($_GET['rowstart'], 1, $pagecount, 3, FUSION_SELF."?page_id=".$_GET['page_id']."&")."\n</div>\n";
}
} else {
echo $custompage;
}
} else {
echo "<div style='text-align:center'><br />\n".$locale['400']."\n<br /><br /></div>\n";
}
} else {
add_to_title($locale['global_200'].$locale['401']);
opentable($locale['401']);
echo "<div style='text-align:center'><br />\n".$locale['402']."\n<br /><br /></div>\n";
}
//Drukuj
echo "<br><br><div style='text-align:right'><a href='".BASEDIR."print.php?type=P&page_id=".$_GET['page_id']."'><img src='".THEME."images/printer.gif' alt='' style='border:0px;vertical-align:middle;'></a></div>";
//Drukuj
closetable();
if (dbrows($result) && checkgroup($data['page_access'])) {
if ($data['page_allow_comments']) { showcomments("C", DB_CUSTOM_PAGES, "page_id", $_GET['page_id'],FUSION_SELF."?page_id=".$_GET['page_id']); }
if ($data['page_allow_ratings']) { showratings("C", $_GET['page_id'], FUSION_SELF."?page_id=".$_GET['page_id']); }
}
require_once THEMES."templates/footer.php";
?>
Na swojej stronie mam zainstalowane drugie "viewpage" o nazwie "osoby" (drugie dodatkowe strony). Problem polega na tym, że jak wstawiłem do pliku print.php proponowany wpis to zawsze drukuje tylko odpowiednią stronę z "viewpage" a nie z stronę "osoby", choć aktualnie jest ona wyświetlana. Co należy poprawić w pliku print.php, aby było dobrze?
Edytowane przez Pieka dnia 12.03.2011 22:39:08
Pawlo
|
|
|
|
Pieka |
Dodany dnia 12.03.2011 22:52:18
|
Postów: 19882 Pomógł: 767
v7.02.03 Data rejestracji: 23.02.2005 18:12
|
Pawlo_23 napisał/a:
...Problem polega na tym, że jak wstawiłem do pliku print.php proponowany wpis to zawsze drukuje tylko odpowiednią stronę z "viewpage" a nie z stronę "osoby", choć aktualnie jest ona wyświetlana. Co należy poprawić w pliku print.php, aby było dobrze?
Musisz zmienic w pliku viewpage.php TYPE na P2 i sklonowac funkcje podana przez kefirka w pliku print.php.
Edytowane przez Pieka dnia 13.03.2011 03:05:38
Jestem jaki jestem
|
|
|
|
Pawlo_23 |
Dodany dnia 14.03.2011 12:30:37
|
Przedszkolak
Postów: 23
Data rejestracji: 18.05.2010 00:08
|
Dzięki za pomoc Pieka! Wszystko jest OK i świetnie działa.
Pawlo
|
|
|