[ Index ]

PHP Cross Reference of Nuke-Evolution v2.0.5

title

Body

[close]

/blocks/ -> block-Old_Articles.php (source)

   1  <?php
   2  /*=======================================================================
   3   Nuke-Evolution Basic: Enhanced PHP-Nuke Web Portal System
   4   =======================================================================*/
   5  
   6  /************************************************************************/
   7  /* PHP-NUKE: Web Portal System                                          */
   8  /* ===========================                                          */
   9  /*                                                                      */
  10  /* Copyright (c) 2002 by Francisco Burzi                                */
  11  /* http://phpnuke.org                                                   */
  12  /*                                                                      */
  13  /* This program is free software. You can redistribute it and/or modify */
  14  /* it under the terms of the GNU General Public License as published by */
  15  /* the Free Software Foundation; either version 2 of the License.       */
  16  /************************************************************************/
  17  /*         Additional security & Abstraction layer conversion           */
  18  /*                           2003 chatserv                              */
  19  /*      http://www.nukefixes.com -- http://www.nukeresources.com        */
  20  /************************************************************************/
  21  
  22  /*****[CHANGES]**********************************************************
  23  -=[Base]=-
  24        Nuke Patched                             v3.1.0       06/26/2005
  25   ************************************************************************/
  26  
  27  if(!defined('NUKE_EVO')) exit;
  28  
  29  global $locale, $oldnum, $storynum, $storyhome, $cookie, $categories, $cat, $prefix, $multilingual, $currentlang, $db, $new_topic, $user_news, $userinfo, $user;
  30  
  31  if ($multilingual == 1) {
  32      if ($categories == 1) {
  33          $querylang = "where catid='$cat' AND (alanguage='$currentlang' OR alanguage='')";
  34      } else {
  35          $querylang = "where (alanguage='$currentlang' OR alanguage='')";
  36      if ($new_topic != 0) {
  37          $querylang .= " AND topic='$new_topic'";
  38      }
  39      }
  40  } else {
  41      if ($categories == 1) {
  42         $querylang = "where catid='$cat'";
  43      } else {
  44      $querylang = "";
  45      if ($new_topic != 0) {
  46          $querylang = "WHERE topic='$new_topic'";
  47      }
  48      }
  49  }
  50  if (isset($userinfo['storynum']) AND $user_news == 1) {
  51      $storynum = $userinfo['storynum'];
  52  } else {
  53      $storynum = $storyhome;
  54  }
  55  $boxstuff = "<table border=\"0\" width=\"100%\">";
  56  $boxTitle = _PASTARTICLES;
  57  $sql = "SELECT sid, title, time, comments FROM ".$prefix."_stories $querylang ORDER BY time DESC LIMIT $storynum, $oldnum";
  58  $result = $db->sql_query($sql);
  59  $vari = 0;
  60  
  61  if (!isset($mode) OR empty($mode)) {
  62      if(isset($userinfo['umode'])) {
  63        $mode = $userinfo['umode'];
  64      } else {
  65        $mode = "thread";
  66      }
  67  }
  68  if (!isset($order) OR empty($order)) {
  69      if(isset($userinfo['uorder'])) {
  70        $order = $userinfo['uorder'];
  71      } else {
  72        $order = 0;
  73      }
  74  }
  75  if (!isset($thold) OR empty($thold)) {
  76      if(isset($userinfo['thold'])) {
  77        $thold = $userinfo['thold'];
  78      } else {
  79        $thold = 0;
  80      }
  81  }
  82  $r_options = "";
  83  $r_options .= "&amp;mode=".$mode;
  84  $r_options .= "&amp;order=".$order;
  85  $r_options .= "&amp;thold=".$thold;
  86  
  87  while (list($sid, $title, $time, $comments) = $db->sql_fetchrow($result)) {
  88      $sid = intval($sid);
  89      $title = stripslashes($title);
  90      $see = 1;
  91      setlocale(LC_TIME, $locale);
  92      ereg ("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $time, $datetime2);
  93      $datetime2 = strftime(_DATESTRING2, mktime($datetime2[4],$datetime2[5],$datetime2[6],$datetime2[2],$datetime2[3],$datetime2[1]));
  94      $datetime2 = ucfirst($datetime2);
  95      if ($articlecomm == 1) {
  96      $comments = "(".$comments.")";
  97      } else {
  98      $comments = "";
  99      }
 100      if($time2==$datetime2) {
 101          $boxstuff .= "<tr><td valign=\"top\"><strong><big>&middot;</big></strong></td><td> <a href=\"modules.php?name=News&amp;file=article&amp;sid=$sid$r_options\">$title</a> $comments</td></tr>\n";
 102      } else {
 103          if(empty($a)) {
 104              $boxstuff .= "<tr><td colspan=\"2\"><strong>$datetime2</strong></td></tr><tr><td valign=\"top\"><strong><big>&middot;</big></strong></td><td> <a href=\"modules.php?name=News&amp;file=article&amp;sid=$sid$r_options\">$title</a> $comments</td></tr>\n";
 105          $time2 = $datetime2;
 106          $a = 1;
 107      } else {
 108          $boxstuff .= "<tr><td colspan=\"2\"><strong>$datetime2</strong></td></tr><tr><td valign=\"top\"><strong><big>&middot;</big></strong></td><td> <a href=\"modules.php?name=News&amp;file=article&amp;sid=$sid$r_options\">$title</a> $comments</td></tr>\n";
 109          $time2 = $datetime2;
 110      }
 111      }
 112      $vari++;
 113      if ($vari==$oldnum) {
 114      if (isset($userinfo['storyhome'])) {
 115          $storynum = $userinfo['storyhome'];
 116      } else {
 117          $storynum = $storyhome;
 118      }
 119      $min = $oldnum + $storynum;
 120      $dummy = 1;
 121      }
 122  }
 123  $db->sql_freeresult($result);
 124  
 125  if ($dummy == 1 AND is_active("Stories_Archive")) {
 126      $boxstuff .= "</table><br /><a href=\"modules.php?name=Stories_Archive\"><strong>"._OLDERARTICLES."</strong></a>\n";
 127  } else {
 128      $boxstuff .= "</table>";
 129  }
 130  
 131  if ($see == 1) {
 132      $content = $boxstuff;
 133  }
 134  
 135  ?>


Generated: Wed Jun 6 11:38:01 2007 Cross-referenced by PHPXref 0.7