Początkujący
Postów: 143 Pomógł: 3 Ostrzeżeń: 5
Data rejestracji: 01.10.2009 00:04
|
Witam ściągnąłem wtyczkę pod nazwą Articles/News PDF wgrałem ją i wszystko niby pięknie ale wywala mi błąd w pliku pdf.php
Kod pliku pdf.php
<?php
/*---------------------------------------------------+
| PHP-Fusion 7 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2006 Nick Jones
| http://www.php-fusion.co.uk/
| Filename: pdf.php
| Author: olelau
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*/
require_once "maincore.php";
require_once INCLUDES."output_handling_include.php";
require (INCLUDES."output_pdf/html2fpdf.php");
if (!isset($item_id) && !isNum($item_id)) die();
if (!isset($type) && ($type!="A" || $type!="N" || $type!="CP")) die();
switch ($type) {
case "A":
$result = dbquery("SELECT * FROM ".DB_PREFIX."articles WHERE article_id='".$item_id."'");
$data = dbarray($result);
$subject = stripslashes($data['article_subject']);
$snippet = parseubb(stripslashes($data['article_snippet']));
if ($data['article_breaks']=="y") {
$snippet = nl2br($snippet);
}
$date = stripslashes($data['article_datestamp']);
$text = stripslashes($data['article_article']);
$text = str_replace("<--PAGEBREAK-->", "", $text);
$text = str_replace("[PAGEBREAK]", "", $text);
$text = parseubb(stripslashes($text));
if ($data['article_breaks']=="y") {
$text = nl2br($text);
}
$result = dbquery("SELECT user_name FROM ".DB_PREFIX."users WHERE user_id='".$data['article_name']."'");
$data = dbarray($result);
$footer = stripslashes($data['user_name']);
break;
case "N":
$result = dbquery("SELECT * FROM ".DB_PREFIX."news WHERE news_id='".$_GET['item_id']."'");
$data = dbarray($result);
$subject = stripslashes($data['news_subject']);
$date = stripslashes($data['news_datestamp']);
if ($data['news_cat']!=0) {
$cat = dbarray(dbquery("SELECT news_cat_image FROM ".DB_PREFIX."news_cats WHERE news_cat_id='".$data['news_cat']."'"));
$cat_image = "<img src='".$settings['siteurl']."images/news_cats/".$cat['news_cat_image']."' border='0' align='left' alt=''>";
} else {
$cat_image = '';
}
$snippet = nl2br(parseubb(stripslashes($data['news_news'])));
//$snippet = $cat_image.$snippet;
$text = nl2br(parseubb(stripslashes($data['news_extended'])));
$result = dbquery("SELECT user_name FROM ".DB_PREFIX."users WHERE user_id='".$data['news_name']."'");
$data = dbarray($result);
$footer = stripslashes($data['user_name']);
break;
}
$search = array("<", ">", "@", "#", "$", "%", "^", "&", "&", "*", "(", ")", "+", "=", "[", "]", "{", "}", "|", "!", "~", ",", ".", ";", ":", "`", "/", """, "'", "\", """, "'", " ", "-");
$replace = array("", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "_", "_");
$file_name = str_replace($search, $replace, $subject);
$file_name .= "_".$type.$item_id.".pdf";
$pdf = new HTML2FPDF();
$pdf->Open();
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->SetTopMargin(15);
$pdf->SetFont('Arial','B',14);
$pdf->WriteHTML('<br>'.$subject.'<br><br>');
if ($type!="CP" && $snippet!='') {
$pdf->SetFont('Arial','',11);
if ($snippet!='') {
$pdf->WriteHTML($snippet);
}
if ($text!='' && $snippet!='') {
$pdf->WriteHTML('<br><br>');
}
}
if ($text!='') {
$pdf->SetFont('Arial','',11);
$pdf->WriteHTML($text);
}
if ($type!="CP") {
$pdf->SetFont('Arial','',8);
$pdf->WriteHTML("<br><br><hr><div align='right'>".$locale['040'].": ".$footer.", ".$locale['041']." ".showdate("longdate", $date)."</div>");
$pdf->SetAuthor($footer);
}
$pdf->Output($file_name, 'D');
?>
wywala mi bład :Notice: Undefined variable: item_id in /home/arkagdynia/domains/photoshop-tutorials.unl.pl/public_html/pdf.php on line 21
Proszę o pomoc:)
PW od moderatora:
- Zmiana nazwy tematu - Pieka 21.02 - 13:35
- Przeniesienie tematu - Pieka 21.02 - 13:35
Edytowane przez ArkaGdynia dnia 21.02.2010 13:18:23
|