[ Index ]
 

Code source de PHP NUKE 7.9

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

title

Body

[fermer]

/modules/FAQ/ -> index.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('MODULE_FILE')) {
  16      die ("You can't access this file directly...");
  17  }
  18  
  19  require_once ("mainfile.php");
  20  $module_name = basename(dirname(__FILE__));
  21  get_lang($module_name);
  22  
  23  $pagetitle = "- $module_name";
  24  
  25  function ShowFaq($id_cat, $categories) {
  26      global $bgcolor2, $sitename, $prefix, $db, $module_name;
  27      $categories = filter($categories, "nohtml");
  28      OpenTable();
  29      echo"<center><font class=\"content\"><b>$sitename "._FAQ2."</b></font></center><br><br>"
  30      ."<a name=\"top\"></a><br>" /* Bug fix : added missing closing hyperlink tag messes up display */
  31      .""._CATEGORY.": <a href=\"modules.php?name=$module_name\">"._MAIN."</a> -> $categories"
  32      ."<br><br>"
  33      ."<table width=\"100%\" cellpadding=\"4\" cellspacing=\"0\" border=\"0\">"
  34      ."<tr bgcolor=\"$bgcolor2\"><td colspan=\"2\"><font class=\"option\"><b>"._QUESTION."</b></font></td></tr><tr><td colspan=\"2\">";
  35      $id_cat = intval($id_cat);
  36      $result = $db->sql_query("SELECT id, id_cat, question, answer FROM ".$prefix."_faqanswer WHERE id_cat='$id_cat'");
  37      while ($row = $db->sql_fetchrow($result)) {
  38          $id = intval($row['id']);
  39          $id_cat = intval($row['id_cat']);
  40          $question = filter($row['question'], "nohtml");
  41          $answer = filter($row['answer']);
  42          echo"<strong><big>&middot;</big></strong>&nbsp;&nbsp;<a href=\"#$id\">$question</a><br>";
  43      }
  44      echo "</td></tr></table>
  45      <br>";
  46  }
  47  
  48  function ShowFaqAll($id_cat) {
  49      global $bgcolor2, $prefix, $db, $module_name;
  50      $id_cat = intval($id_cat);
  51      echo "<table width=\"100%\" cellpadding=\"4\" cellspacing=\"0\" border=\"0\">"
  52      ."<tr bgcolor=\"$bgcolor2\"><td colspan=\"2\"><font class=\"option\"><b>"._ANSWER."</b></font></td></tr>";
  53      $id_cat = intval($id_cat);
  54      $result = $db->sql_query("SELECT id, id_cat, question, answer FROM ".$prefix."_faqanswer WHERE id_cat='$id_cat'");
  55      while ($row = $db->sql_fetchrow($result)) {
  56          $id = intval($row['id']);
  57          $id_cat = intval($row['id_cat']);
  58          $question = filter($row['question'], "nohtml");
  59          $answer = filter($row['answer']);
  60          echo"<tr><td><a name=\"$id\"></a>"
  61          ."<strong><big>&middot;</big></strong>&nbsp;&nbsp;<b>$question</b>"
  62          ."<p align=\"justify\">$answer</p>"
  63          ."[ <a href=\"#top\">"._BACKTOTOP."</a> ]"
  64          ."<br><br>"
  65          ."</td></tr>";
  66      }
  67      echo "</table><br><br>"
  68      ."<div align=\"center\"><b>[ <a href=\"modules.php?name=$module_name\">"._BACKTOFAQINDEX."</a> ]</b></div>";
  69  }
  70  
  71  if (!isset($myfaq)) {
  72      global $currentlang, $multilingual;
  73      if ($multilingual == 1) {
  74          $querylang = "WHERE flanguage='$currentlang'";
  75      } else {
  76          $querylang = "";
  77      }
  78      include ("header.php");
  79      OpenTable();
  80      echo "<center><font class=\"option\">"._FAQ2."</font></center><br><br>"
  81      ."<table width=\"100%\" cellpadding=\"4\" cellspacing=\"0\" border=\"0\">"
  82      ."<tr><td bgcolor=\"$bgcolor2\"><font class=\"option\"><b>"._CATEGORIES."</b></font></td></tr><tr><td>";
  83      $result2 = $db->sql_query("SELECT id_cat, categories FROM ".$prefix."_faqcategories $querylang");
  84      while ($row2 = $db->sql_fetchrow($result2)) {
  85          $id_cat = intval($row2['id_cat']);
  86          $categories = filter($row2['categories'], "nohtml");
  87          echo"<strong><big>&middot;</big></strong>&nbsp;<a href=\"modules.php?name=$module_name&amp;myfaq=yes&amp;id_cat=$id_cat&amp;categories=$catname\">$categories</a><br>";
  88      }
  89      echo "</td></tr></table>";
  90      CloseTable();
  91      include ("footer.php");
  92  } else {
  93      include ("header.php");
  94      ShowFaq($id_cat, $categories);
  95      ShowFaqAll($id_cat);
  96      CloseTable();
  97      include ("footer.php");
  98  }
  99  
 100  ?>


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