Verzeichnisstruktur phpBB-2.0.0


Veröffentlicht
03.04.2002

So funktioniert es


Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück

Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

(Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

faq.php

Zuletzt modifiziert: 09.10.2024, 12:50 - Dateigröße: 3.50 KiB


001  <?php
002  /***************************************************************************
003   *                                  faq.php
004   *                            -------------------
005   *   begin                : Sunday, Jul 8, 2001
006   *   copyright            : (C) 2001 The phpBB Group
007   *   email                : support@phpbb.com
008   *
009   *   $Id$
010   *
011   *
012   ***************************************************************************/
013   
014  /***************************************************************************
015   *
016   *   This program is free software; you can redistribute it and/or modify
017   *   it under the terms of the GNU General Public License as published by
018   *   the Free Software Foundation; either version 2 of the License, or
019   *   (at your option) any later version.
020   *
021   ***************************************************************************/
022   
023  define('IN_PHPBB', true);
024  $phpbb_root_path = './';
025  include($phpbb_root_path . 'extension.inc');
026  include($phpbb_root_path . 'common.'.$phpEx);
027   
028  //
029  // Start session management
030  //
031  $userdata = session_pagestart($user_ip, PAGE_FAQ);
032  init_userprefs($userdata);
033  //
034  // End session management
035  //
036   
037  // Set vars to prevent naughtiness
038  $faq = array();
039   
040  //
041  // Load the appropriate faq file
042  //
043  if( isset($HTTP_GET_VARS['mode']) )
044  {
045      switch( $HTTP_GET_VARS['mode'] )
046      {
047          case 'bbcode':
048              $lang_file = 'lang_bbcode';
049              $l_title = $lang['BBCode_guide'];
050              break;
051          default:
052              $lang_file = 'lang_faq';
053              $l_title = $lang['FAQ'];
054              break;
055      }
056  }
057  else
058  {
059      $lang_file = 'lang_faq';
060      $l_title = $lang['FAQ'];
061  }
062  include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/' . $lang_file . '.' . $phpEx);
063   
064  //
065  // Pull the array data from the lang pack
066  //
067  $j = 0;
068  $counter = 0;
069  $counter_2 = 0;
070  $faq_block = array();
071  $faq_block_titles = array();
072   
073  for($i = 0; $i < count($faq); $i++)
074  {
075      if( $faq[$i][0] != '--' )
076      {
077          $faq_block[$j][$counter]['id'] = $counter_2;
078          $faq_block[$j][$counter]['question'] = $faq[$i][0];
079          $faq_block[$j][$counter]['answer'] = $faq[$i][1];
080   
081          $counter++;
082          $counter_2++;
083      }
084      else
085      {
086          $j = ( $counter != 0 ) ? $j + 1 : 0;
087   
088          $faq_block_titles[$j] = $faq[$i][1];
089   
090          $counter = 0;
091      }
092  }
093   
094  //
095  // Lets build a page ...
096  //
097  $page_title = $l_title;
098  include($phpbb_root_path . 'includes/page_header.'.$phpEx);
099   
100  $template->set_filenames(array(
101      'body' => 'faq_body.tpl')
102  );
103  make_jumpbox('viewforum.'.$phpEx);
104   
105  $template->assign_vars(array(
106      'L_FAQ_TITLE' => $l_title, 
107      'L_BACK_TO_TOP' => $lang['Back_to_top'])
108  );
109   
110  for($i = 0; $i < count($faq_block); $i++)
111  {
112      if( count($faq_block[$i]) )
113      {
114          $template->assign_block_vars('faq_block', array(
115              'BLOCK_TITLE' => $faq_block_titles[$i])
116          );
117          $template->assign_block_vars('faq_block_link', array( 
118              'BLOCK_TITLE' => $faq_block_titles[$i])
119          );
120   
121          for($j = 0; $j < count($faq_block[$i]); $j++)
122          {
123              $row_color = ( !($j % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
124              $row_class = ( !($j % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
125   
126              $template->assign_block_vars('faq_block.faq_row', array(
127                  'ROW_COLOR' => '#' . $row_color,
128                  'ROW_CLASS' => $row_class,
129                  'FAQ_QUESTION' => $faq_block[$i][$j]['question'], 
130                  'FAQ_ANSWER' => $faq_block[$i][$j]['answer'], 
131   
132                  'U_FAQ_ID' => $faq_block[$i][$j]['id'])
133              );
134   
135              $template->assign_block_vars('faq_block_link.faq_row_link', array(
136                  'ROW_COLOR' => '#' . $row_color,
137                  'ROW_CLASS' => $row_class,
138                  'FAQ_LINK' => $faq_block[$i][$j]['question'], 
139   
140                  'U_FAQ_LINK' => '#' . $faq_block[$i][$j]['id'])
141              );
142          }
143      }
144  }
145   
146  $template->pparse('body');
147   
148  include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
149   
150  ?>