[ Index ]
 

Code source de PHP NUKE 7.9

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

title

Body

[fermer]

/modules/Forums/ -> faq.php (source)

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

   3   *                                  faq.php

   4   *                            -------------------

   5   *   begin                : Sunday, Jul 8, 2001

   6   *   copyright            : (C) 2001 The phpBB Group

   7   *   email                : support@phpbb.com

   8   *

   9   *   Id: faq.php,v 1.14.2.2 2004/07/11 16:46:15 acydburn Exp

  10   *

  11   *

  12   ***************************************************************************/
  13  
  14  /***************************************************************************

  15   *

  16   *   This program is free software; you can redistribute it and/or modify

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

  18   *   the Free Software Foundation; either version 2 of the License, or

  19   *   (at your option) any later version.

  20   *

  21   ***************************************************************************/
  22  if ( !defined('MODULE_FILE') )
  23  {
  24      die("You can't access this file directly...");
  25  }
  26  $module_name = basename(dirname(__FILE__));
  27  require("modules/".$module_name."/nukebb.php");
  28  
  29  define('IN_PHPBB', true);
  30  include ($phpbb_root_path . 'extension.inc');
  31  include($phpbb_root_path . 'common.'.$phpEx);
  32  
  33  //

  34  // Start session management

  35  //

  36  $userdata = session_pagestart($user_ip, PAGE_FAQ, $nukeuser);
  37  init_userprefs($userdata);
  38  //

  39  // End session management

  40  //

  41  // Set vars to prevent naughtiness

  42  $faq = array();
  43  //

  44  // Load the appropriate faq file

  45  //

  46  if( isset($HTTP_GET_VARS['mode']) )
  47  {
  48          switch( $HTTP_GET_VARS['mode'] )
  49          {
  50                  case 'bbcode':
  51                          $lang_file = 'lang_bbcode';
  52                          $l_title = $lang['BBCode_guide'];
  53                          break;
  54                  default:
  55                          $lang_file = 'lang_faq';
  56                          $l_title = $lang['FAQ'];
  57                          break;
  58          }
  59  }
  60  else
  61  {
  62          $lang_file = 'lang_faq';
  63          $l_title = $lang['FAQ'];
  64  }
  65  include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/' . $lang_file . '.' . $phpEx);
  66  
  67  //

  68  // Pull the array data from the lang pack

  69  //

  70  $j = 0;
  71  $counter = 0;
  72  $counter_2 = 0;
  73  $faq_block = array();
  74  $faq_block_titles = array();
  75  
  76  for($i = 0; $i < count($faq); $i++)
  77  {
  78          if( $faq[$i][0] != '--' )
  79          {
  80                  $faq_block[$j][$counter]['id'] = $counter_2;
  81                  $faq_block[$j][$counter]['question'] = $faq[$i][0];
  82                  $faq_block[$j][$counter]['answer'] = $faq[$i][1];
  83  
  84                  $counter++;
  85                  $counter_2++;
  86          }
  87          else
  88          {
  89                  $j = ( $counter != 0 ) ? $j + 1 : 0;
  90  
  91                  $faq_block_titles[$j] = $faq[$i][1];
  92  
  93                  $counter = 0;
  94          }
  95  }
  96  
  97  //

  98  // Lets build a page ...

  99  //

 100  $page_title = $l_title;
 101  include ("includes/page_header.php");
 102  
 103  $template->set_filenames(array(
 104          'body' => 'faq_body.tpl')
 105  );
 106  make_jumpbox('viewforum.'.$phpEx);
 107  
 108  $template->assign_vars(array(
 109          'L_FAQ_TITLE' => $l_title,
 110          'L_BACK_TO_TOP' => $lang['Back_to_top'])
 111  );
 112  
 113  for($i = 0; $i < count($faq_block); $i++)
 114  {
 115          if( count($faq_block[$i]) )
 116          {
 117                  $template->assign_block_vars('faq_block', array(
 118                          'BLOCK_TITLE' => $faq_block_titles[$i])
 119                  );
 120                  $template->assign_block_vars('faq_block_link', array(
 121                          'BLOCK_TITLE' => $faq_block_titles[$i])
 122                  );
 123  
 124                  for($j = 0; $j < count($faq_block[$i]); $j++)
 125                  {
 126                          $row_color = ( !($j % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
 127                          $row_class = ( !($j % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
 128  
 129                          $template->assign_block_vars('faq_block.faq_row', array(
 130                                  'ROW_COLOR' => '#' . $row_color,
 131                                  'ROW_CLASS' => $row_class,
 132                                  'FAQ_QUESTION' => $faq_block[$i][$j]['question'],
 133                                  'FAQ_ANSWER' => $faq_block[$i][$j]['answer'],
 134  
 135                                  'U_FAQ_ID' => $faq_block[$i][$j]['id'])
 136                          );
 137  
 138                          $template->assign_block_vars('faq_block_link.faq_row_link', array(
 139                                  'ROW_COLOR' => '#' . $row_color,
 140                                  'ROW_CLASS' => $row_class,
 141                                  'FAQ_LINK' => $faq_block[$i][$j]['question'],
 142  
 143                                  'U_FAQ_LINK' => '#' . $faq_block[$i][$j]['id'])
 144                          );
 145                  }
 146          }
 147  }
 148  
 149  $template->pparse('body');
 150  
 151  include ("includes/page_tail.php");
 152  
 153  ?>


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