[ Index ]
 

Code source de e107 0.7.8

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

title

Body

[fermer]

/e107_plugins/forum/ -> newforumposts_menu.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/forum/newforumposts_menu.php,v $
  14  |     $Revision: 1.17 $
  15  |     $Date: 2006/08/27 02:24:45 $
  16  |     $Author: mcfly_e107 $
  17  +----------------------------------------------------------------------------+
  18  */
  19  if (!defined('e107_INIT')) { exit; }
  20  
  21  global $tp;
  22  $gen = new convert;
  23  
  24  if (file_exists(e_PLUGIN."forum/languages/".e_LANGUAGE."/lan_newforumposts_menu.php"))
  25  {
  26      include_once(e_PLUGIN."forum/languages/".e_LANGUAGE."/lan_newforumposts_menu.php");
  27  }
  28  else
  29  {
  30      include_once(e_PLUGIN."forum/languages/English/lan_newforumposts_menu.php");
  31  }
  32  
  33  $query2 = "
  34  SELECT tp.thread_name AS parent_name, t.thread_datestamp , t.thread_thread, t.thread_name, t.thread_id, t.thread_user, f.forum_id, f.forum_name, f.forum_class, u.user_name, fp.forum_class FROM #forum_t AS t
  35  LEFT JOIN #user AS u ON t.thread_user = u.user_id
  36  LEFT JOIN #forum_t AS tp ON t.thread_parent = tp.thread_id
  37  LEFT JOIN #forum AS f ON (f.forum_id = t.thread_forum_id
  38  AND f.forum_class IN (".USERCLASS_LIST."))
  39  LEFT JOIN #forum AS fp ON f.forum_parent = fp.forum_id
  40  WHERE fp.forum_class IN (".USERCLASS_LIST.")
  41  ORDER BY t.thread_datestamp DESC LIMIT 0, ".$menu_pref['newforumposts_display'];
  42  
  43  $results = $sql->db_Select_gen($query2);
  44  
  45  if(!$results)
  46  {
  47      // no posts yet ..
  48      $text = NFP_2;
  49  }
  50  else
  51  {
  52      $text = "";
  53      $forumArray = $sql->db_getList();
  54      foreach($forumArray as $fi)
  55      {
  56          $datestamp = $gen->convert_date($fi['thread_datestamp'], "short");
  57          $topic = ($fi['parent_name'] ? "Re: <i>{$fi['parent_name']}</i>" : "<i>{$fi['thread_name']}</i>");
  58          $topic = strip_tags($tp->toHTML($topic, TRUE, "emotes_off, no_make_clickable, parse_bb", "", $pref['menu_wordwrap']));
  59          $id = $fi['thread_id'];
  60  
  61          if($fi['user_name'])
  62          {
  63              $poster = $fi['user_name'];
  64          }
  65          else
  66          {
  67              $x = explode(chr(1), $fi['thread_user']);
  68              $tmp = explode(".", $x[0], 2);
  69              if($tmp[1])
  70              {
  71                  $poster = $tmp[1];
  72              }
  73              else
  74              {
  75                  $poster = "[deleted]";
  76              }
  77          }
  78  
  79          $fi['thread_thread'] = strip_tags($tp->toHTML($fi['thread_thread'], TRUE, "emotes_off, no_make_clickable", "", $pref['menu_wordwrap']));
  80  
  81          if (strlen($fi['thread_thread']) > $menu_pref['newforumposts_characters'])
  82          {
  83              $fi['thread_thread'] = substr($fi['thread_thread'], 0, $menu_pref['newforumposts_characters']).$menu_pref['newforumposts_postfix'];
  84          }
  85  
  86          if ($menu_pref['newforumposts_title'])
  87          {
  88              $text .= "<img src='".THEME."images/".(defined("BULLET") ? BULLET : "bullet2.gif")."' alt='' /> <a href='".e_PLUGIN."forum/forum_viewtopic.php?{$id}.post'>".$topic."</a><br />".$fi['thread_thread']."<br />".NFP_11." ".$poster."<br />".$datestamp."<br/><br />";
  89          }
  90          else
  91          {
  92              $text .= "<img src='".THEME."images/".(defined("BULLET") ? BULLET : "bullet2.gif")."' alt='' /> <a href='".e_PLUGIN."forum/forum_viewtopic.php?{$id}.post'>".NFP_11." ".$poster."</a><br />".$fi['thread_thread']."<br />".$datestamp."<br/><br />";
  93          }
  94      }
  95  }
  96  
  97  $ns->tablerender($menu_pref['newforumposts_caption'], $text, 'nfp_menu');
  98  
  99  ?>


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