[ Index ]
 

Code source de PHP NUKE 7.9

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

title

Body

[fermer]

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

   1  <?php
   2  
   3  /************************************************************************/

   4  /* PHP-NUKE: Web Portal System                                          */

   5  /* ===========================                                          */

   6  /*                                                                      */

   7  /* Copyright (c) 2005 by Francisco Burzi                                */

   8  /* http://phpnuke.org                                                   */

   9  /*                                                                      */

  10  /* This program is free software. You can redistribute it and/or modify */

  11  /* it under the terms of the GNU General Public License as published by */

  12  /* the Free Software Foundation; either version 2 of the License.       */

  13  /************************************************************************/

  14  
  15  if ( !defined('BLOCK_FILE') ) {
  16      Header("Location: ../index.php");
  17      die();
  18  }
  19  
  20  global $cat, $language, $prefix, $multilingual, $currentlang, $db;
  21  
  22      if ($multilingual == 1) {
  23      $querylang = "AND (alanguage='$currentlang' OR alanguage='')"; /* the OR is needed to display stories who are posted to ALL languages */
  24      } else {
  25      $querylang = "";
  26      }
  27      $result = $db->sql_query("SELECT catid, title FROM ".$prefix."_stories_cat ORDER BY title");
  28      $numrows = $db->sql_numrows($result);
  29      if ($numrows == 0) {
  30      return;
  31      } else {
  32      $boxstuff = "<span class=\"content\">";
  33      while ($row = $db->sql_fetchrow($result)) {
  34          $catid = intval($row['catid']);
  35          $title = filter($row['title'], "nohtml");
  36          $numrows = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_stories WHERE catid='$catid' $querylang LIMIT 1"));
  37          if ($numrows > 0) {
  38          if ($cat == 0 AND !$a) {
  39              $boxstuff .= "<strong><big>&middot;</big></strong>&nbsp;<b>"._ALLCATEGORIES."</b><br>";
  40              $a = 1;
  41          } elseif ($cat != 0 AND !$a) {
  42              $boxstuff .= "<strong><big>&middot;</big></strong>&nbsp;<a href=\"modules.php?name=News\">"._ALLCATEGORIES."</a><br>";
  43              $a = 1;
  44          }
  45          
  46          if ($cat == $catid) {
  47              $boxstuff .= "<strong><big>&middot;</big></strong>&nbsp;<b>$title</b><br>";
  48          } else {
  49              $boxstuff .= "<strong><big>&middot;</big></strong>&nbsp;<a href=\"modules.php?name=News&amp;file=categories&amp;op=newindex&amp;catid=$catid\">$title</a><br>";
  50          }
  51          }
  52      }
  53      $boxstuff .= "</span>";
  54      $content = $boxstuff;
  55      }
  56  
  57  ?>


Généré le : Sun Apr 1 11:11:59 2007 par Balluche grâce à PHPXref 0.7