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

topic_review.php

Zuletzt modifiziert: 09.10.2024, 12:51 - Dateigröße: 6.19 KiB


001  <?php
002  /***************************************************************************
003   *                              topic_review.php
004   *                            -------------------
005   *   begin                : Saturday, Feb 13, 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   
024  function topic_review($topic_id, $is_inline_review)
025  {
026      global $db, $board_config, $template, $lang, $images, $theme, $phpEx, $phpbb_root_path;
027      global $userdata, $user_ip;
028      global $orig_word, $replacement_word;
029      global $starttime;
030   
031      if ( !$is_inline_review )
032      {
033          if ( !isset($topic_id) || !$topic_id)
034          {
035              message_die(GENERAL_MESSAGE, 'Topic_post_not_exist');
036          }
037   
038          //
039          // Get topic info ...
040          //
041          $sql = "SELECT t.topic_title, f.forum_id, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_pollcreate, f.auth_vote, f.auth_attachments 
042              FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f 
043              WHERE t.topic_id = $topic_id
044                  AND f.forum_id = t.forum_id";
045          if ( !($result = $db->sql_query($sql)) )
046          {
047              message_die(GENERAL_ERROR, 'Could not obtain topic information', '', __LINE__, __FILE__, $sql);
048          }
049   
050          if ( !($forum_row = $db->sql_fetchrow($result)) )
051          {
052              message_die(GENERAL_MESSAGE, 'Topic_post_not_exist');
053          }
054          $db->sql_freeresult($result);
055   
056          $forum_id = $forum_row['forum_id'];
057          $topic_title = $forum_row['topic_title'];
058          
059          //
060          // Start session management
061          //
062          $userdata = session_pagestart($user_ip, $forum_id);
063          init_userprefs($userdata);
064          //
065          // End session management
066          //
067   
068          $is_auth = array();
069          $is_auth = auth(AUTH_ALL, $forum_id, $userdata, $forum_row);
070   
071          if ( !$is_auth['auth_read'] )
072          {
073              message_die(GENERAL_MESSAGE, sprintf($lang['Sorry_auth_read'], $is_auth['auth_read_type']));
074          }
075      }
076   
077      //
078      // Define censored word matches
079      //
080      if ( empty($orig_word) && empty($replacement_word) )
081      {
082          $orig_word = array();
083          $replacement_word = array();
084   
085          obtain_word_list($orig_word, $replacement_word);
086      }
087   
088      //
089      // Dump out the page header and load viewtopic body template
090      //
091      if ( !$is_inline_review )
092      {
093          $gen_simple_header = TRUE;
094   
095          $page_title = $lang['Topic_review'] . ' - ' . $topic_title;
096          include($phpbb_root_path . 'includes/page_header.'.$phpEx);
097   
098          $template->set_filenames(array(
099              'reviewbody' => 'posting_topic_review.tpl')
100          );
101      }
102   
103      //
104      // Go ahead and pull all data for this topic
105      //
106      $sql = "SELECT u.username, u.user_id, p.*,  pt.post_text, pt.post_subject, pt.bbcode_uid
107          FROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u, " . POSTS_TEXT_TABLE . " pt
108          WHERE p.topic_id = $topic_id
109              AND p.poster_id = u.user_id
110              AND p.post_id = pt.post_id
111          ORDER BY p.post_time DESC
112          LIMIT " . $board_config['posts_per_page'];
113      if ( !($result = $db->sql_query($sql)) )
114      {
115          message_die(GENERAL_ERROR, 'Could not obtain post/user information', '', __LINE__, __FILE__, $sql);
116      }
117   
118      //
119      // Okay, let's do the loop, yeah come on baby let's do the loop
120      // and it goes like this ...
121      //
122      if ( $row = $db->sql_fetchrow($result) )
123      {
124          $mini_post_img = $images['icon_minipost'];
125          $mini_post_alt = $lang['Post'];
126   
127          $i = 0;
128          do
129          {
130              $poster_id = $row['user_id'];
131              $poster = $row['username'];
132   
133              $post_date = create_date($board_config['default_dateformat'], $row['post_time'], $board_config['board_timezone']);
134   
135              //
136              // Handle anon users posting with usernames
137              //
138              if( $poster_id == ANONYMOUS && $row['post_username'] != '' )
139              {
140                  $poster = $row['post_username'];
141                  $poster_rank = $lang['Guest'];
142              }
143              elseif ( $poster_id == ANONYMOUS )
144              {
145                  $poster = $lang['Guest'];
146                  $poster_rank = '';
147              }
148   
149              $post_subject = ( $row['post_subject'] != '' ) ? $row['post_subject'] : '';
150   
151              $message = $row['post_text'];
152              $bbcode_uid = $row['bbcode_uid'];
153   
154              //
155              // If the board has HTML off but the post has HTML
156              // on then we process it, else leave it alone
157              //
158              if ( !$board_config['allow_html'] && $row['enable_html'] )
159              {
160                  $message = preg_replace('#(<)([\/]?.*?)(>)#is', '&lt;\2&gt;', $message);
161              }
162   
163              if ( $bbcode_uid != "" )
164              {
165                  $message = ( $board_config['allow_bbcode'] ) ? bbencode_second_pass($message, $bbcode_uid) : preg_replace('/\:[0-9a-z\:]+\]/si', ']', $message);
166              }
167   
168              $message = make_clickable($message);
169   
170              if ( count($orig_word) )
171              {
172                  $post_subject = preg_replace($orig_word, $replacement_word, $post_subject);
173                  $message = preg_replace($orig_word, $replacement_word, $message);
174              }
175   
176              if ( $board_config['allow_smilies'] && $row['enable_smilies'] )
177              {
178                  $message = smilies_pass($message);
179              }
180   
181              $message = str_replace("\n", '<br />', $message);
182   
183              //
184              // Again this will be handled by the templating
185              // code at some point
186              //
187              $row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
188              $row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
189   
190              $template->assign_block_vars('postrow', array(
191                  'ROW_COLOR' => '#' . $row_color, 
192                  'ROW_CLASS' => $row_class, 
193   
194                  'MINI_POST_IMG' => $mini_post_img, 
195                  'POSTER_NAME' => $poster, 
196                  'POST_DATE' => $post_date, 
197                  'POST_SUBJECT' => $post_subject, 
198                  'MESSAGE' => $message,
199                      
200                  'L_MINI_POST_ALT' => $mini_post_alt)
201              );
202   
203              $i++;
204          }
205          while ( $row = $db->sql_fetchrow($result) );
206      }
207      else
208      {
209          message_die(GENERAL_MESSAGE, 'Topic_post_not_exist', '', __LINE__, __FILE__, $sql);
210      }
211      $db->sql_freeresult($result);
212   
213      $template->assign_vars(array(
214          'L_AUTHOR' => $lang['Author'],
215          'L_MESSAGE' => $lang['Message'],
216          'L_POSTED' => $lang['Posted'],
217          'L_POST_SUBJECT' => $lang['Post_subject'], 
218          'L_TOPIC_REVIEW' => $lang['Topic_review'])
219      );
220   
221      if ( !$is_inline_review )
222      {
223          $template->pparse('reviewbody');
224          include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
225      }
226  }
227   
228  ?>