[ Index ]
 

Code source de e107 0.7.8

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/e107_plugins/pdf/ -> pdf.php (source)

   1  <?php
   2  /*
   3  + ----------------------------------------------------------------------------+
   4  |     e107 website system
   5  |
   6  |     ©Steve Dunstan 2001-2002
   7  |     http://e107.org
   8  |     jalist@e107.org
   9  |
  10  |     Released under the terms and conditions of the
  11  |     GNU General Public License (http://gnu.org).
  12  |
  13  |     $Source: /cvsroot/e107/e107_0.7/e107_plugins/pdf/pdf.php,v $
  14  |     $Revision: 1.8 $
  15  |     $Date: 2006/01/13 10:49:03 $
  16  |     $Author: lisa_ $
  17  +----------------------------------------------------------------------------+
  18  */
  19  require_once ("../../class2.php");
  20  $qs = explode(".", e_QUERY);
  21  if ($qs[0] == "") {
  22      header("location:".e_BASE."index.php");
  23       exit;
  24  }
  25  $source = $qs[0];
  26  $parms = $qs[1];
  27  
  28  $lan_file = e_PLUGIN."pdf/languages/".e_LANGUAGE.".php";
  29  include_once(file_exists($lan_file) ? $lan_file : e_PLUGIN."pdf/languages/English.php");
  30  
  31  define('FPDF_FONTPATH', 'font/');
  32  require_once(e_PLUGIN."pdf/ufpdf.php");        //require the ufpdf class
  33  require_once(e_PLUGIN."pdf/e107pdf.php");    //require the e107pdf class
  34  $pdf = new e107PDF();
  35  
  36  if(strpos($source,'plugin:') !== FALSE)
  37  {
  38      $plugin = substr($source,7);
  39      if(file_exists(e_PLUGIN.$plugin."/e_emailprint.php"))
  40      {
  41          include_once(e_PLUGIN.$plugin."/e_emailprint.php");
  42          $text = print_item_pdf($parms);
  43          $pdf->makePDF($text);
  44      }
  45      else
  46      {
  47          echo "file missing.";
  48          exit;
  49      }
  50  }
  51  else
  52  {
  53      
  54      if($source == 'news'){
  55          $con = new convert;
  56          $sql->db_Select("news", "*", "news_id='".intval($parms)."'");
  57          $row = $sql->db_Fetch(); 
  58          $news_body = $tp->toHTML($row['news_body'], TRUE);
  59          $news_extended = $tp->toHTML($row['news_extended'], TRUE);
  60          if ($row['news_author'] == 0){
  61              $a_name = "e107";
  62              $category_name = "e107 welcome message";
  63          }else{
  64              $sql->db_Select("news_category", "category_id, category_name", "category_id='".intval($row['news_category'])."'");
  65              list($category_id, $category_name) = $sql->db_Fetch();
  66              $sql->db_Select("user", "user_id, user_name", "user_id='".intval($row['news_author'])."'");
  67              list($a_id, $a_name) = $sql->db_Fetch();
  68          }
  69          $row['news_datestamp'] = $con->convert_date($row['news_datestamp'], "long");
  70      
  71          $row['news_title'] = $tp -> toHTML($row['news_title'], TRUE, 'parse_sc');
  72  
  73          //remove existing links from news title
  74          $search = array();
  75          $replace = array();
  76          $search[0] = "/\<a href=\"(.*?)\">(.*?)<\/a>/si";
  77          $replace[0] = '\\2';
  78          $search[1] = "/\<a href='(.*?)'>(.*?)<\/a>/si";
  79          $replace[1] = '\\2';
  80          $search[2] = "/\<a href='(.*?)'>(.*?)<\/a>/si";
  81          $replace[2] = '\\2';
  82          $search[3] = "/\<a href=&quot;(.*?)&quot;>(.*?)<\/a>/si";
  83          $replace[3] = '\\2';
  84          $search[4] = "/\<a href=&#39;(.*?)&#39;>(.*?)<\/a>/si";
  85          $replace[4] = '\\2';
  86          $row['news_title'] = preg_replace($search, $replace, $row['news_title']);
  87  
  88          $text = "
  89          <b>".$row['news_title']."</b><br />
  90          ".$row['category_name']."<br />
  91          ".$a_name.", ".$row['news_datestamp']."<br />
  92          <br />
  93          ".$row['news_body']."<br />
  94          ";
  95  
  96          if ($row['news_extended'] != ""){ $text .= "<br /><br />".$row['news_extended']; }
  97          if ($row['news_source'] != ""){ $text .= "<br /><br />".$row['news_source']; }
  98          if ($row['news_url'] != ""){ $text .= "<br />".$row['news_url']; }
  99  
 100          $text        = $text;                    //define text
 101          $creator    = SITENAME;                    //define creator
 102          $author        = $a_name;                    //define author
 103          $title        = $row['news_title'];        //define title
 104          $subject    = $category_name;            //define subject
 105          $keywords    = "";                        //define keywords
 106  
 107          //define url and logo to use in the header of the pdf file
 108          $url        = SITEURL."news.php?item.".$row['news_id'];
 109  
 110          //always return an array with the following data:
 111          $text = array($text, $creator, $author, $title, $subject, $keywords, $url);
 112          $pdf->makePDF($text);
 113      
 114      }
 115  
 116  }
 117  
 118  ?>


Généré le : Sun Apr 1 01:23:32 2007 par Balluche grâce à PHPXref 0.7