[ Index ]
 

Code source de e107 0.7.8

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

title

Body

[fermer]

/e107_plugins/list_new/section/ -> list_news.php (source)

   1  <?php
   2  
   3  if (!defined('e107_INIT')) { exit; }
   4  
   5      if($mode == "new_page" || $mode == "new_menu" ){
   6          $lvisit = $this -> getlvisit();
   7          $qry = " news_datestamp>".$lvisit;
   8      }else{
   9          $qry = " (news_start=0 || news_start < ".time().") AND (news_end=0 || news_end>".time().") ";
  10      }
  11  
  12      $bullet = $this -> getBullet($arr[6], $mode);
  13      
  14      $LIST_CAPTION = $arr[0];
  15      $LIST_DISPLAYSTYLE = ($arr[2] ? "" : "none");
  16  
  17      $qry = "
  18      SELECT n.*, c.category_id AS news_category_id, c.category_name AS news_category_name, u.user_id AS news_author_id, u.user_name AS news_author_name
  19      FROM #news AS n
  20      LEFT JOIN #news_category AS c ON c.category_id = n.news_category
  21      LEFT JOIN #user AS u ON n.news_author = u.user_id
  22      WHERE ".$qry." AND n.news_class REGEXP '".e_CLASS_REGEXP."'
  23      ORDER BY n.news_datestamp DESC LIMIT 0,".intval($arr[7])." 
  24      ";
  25  
  26      if(!$sql -> db_Select_gen($qry)){
  27          $LIST_DATA = LIST_NEWS_2;
  28      }else{
  29          while($row = $sql -> db_Fetch()){
  30  
  31              // Code from Lisa
  32              // copied from the rss creation, but added here to make sure the url for the newsitem is to the news.php?item.X
  33              // instead of the actual hyperlink that may have been added to a newstitle on creation
  34              $search = array();
  35              $replace = array();
  36              $search[0] = "/\<a href=\"(.*?)\">(.*?)<\/a>/si";
  37              $replace[0] = '\\2';
  38              $search[1] = "/\<a href='(.*?)'>(.*?)<\/a>/si";
  39              $replace[1] = '\\2';
  40              $search[2] = "/\<a href='(.*?)'>(.*?)<\/a>/si";
  41              $replace[2] = '\\2';
  42              $search[3] = "/\<a href=&quot;(.*?)&quot;>(.*?)<\/a>/si";
  43              $replace[3] = '\\2';
  44              $search[4] = "/\<a href=&#39;(.*?)&#39;>(.*?)<\/a>/si";
  45              $replace[4] = '\\2';
  46              $search[5] = "/\<a href=&#039;(.*?)&#039;>(.*?)<\/a>/si";
  47              $replace[5] = '\\2';
  48              $news_title = preg_replace($search, $replace, $row['news_title']);
  49              // End of code from Lisa
  50  
  51              $rowheading    = $this -> parse_heading($news_title, $mode);
  52              $ICON        = $bullet;
  53              $HEADING    = "<a href='".e_BASE."news.php?item.".$row['news_id']."' title='".$rowheading."'>".$rowheading."</a>";
  54              $AUTHOR        = ($arr[3] ? ($row['news_author'] == 0 ? $row['news_author'] : ($row['news_author_name'] ? "<a href='".e_BASE."user.php?id.".$row['news_author_id']."'>".$row['news_author_name']."</a>" : "") ) : "");
  55              $CATEGORY    = ($arr[4] ? "<a href='".e_BASE."news.php?cat.".$row['news_category_id']."'>".$row['news_category_name']."</a>" : "");
  56              $DATE        = ($arr[5] ? $this -> getListDate($row['news_datestamp'], $mode) : "");
  57              $INFO        = "";
  58              $LIST_DATA[$mode][] = array( $ICON, $HEADING, $AUTHOR, $CATEGORY, $DATE, $INFO );
  59          }
  60      }
  61  
  62  ?>


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