Verzeichnisstruktur phpBB-1.0.0


Veröffentlicht
15.12.2000

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

viewtopic.php

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


 001  <?php
 002  /***************************************************************************
 003                              viewtopic.php  -  description
 004                               -------------------
 005      begin                : Sat June 17 2000
 006      copyright            : (C) 2000 by James Atkinson
 007      email                : james@totalgeek.org
 008   
 009      $Id: viewtopic.php,v 1.34 2000/11/27 05:26:44 thefinn Exp $
 010   
 011   ***************************************************************************/
 012   
 013  /***************************************************************************
 014   *                                                                                         
 015   *   This program is free software; you can redistribute it and/or modify      
 016   *   it under the terms of the GNU General Public License as published by  
 017   *   the Free Software Foundation; either version 2 of the License, or            
 018   *   (at your option) any later version.
 019   *
 020   ***************************************************************************/
 021  include('extention.inc');
 022  include('functions.'.$phpEx);
 023  include('config.'.$phpEx);
 024  require('auth.'.$phpEx);
 025  $pagetitle = "View Topic";
 026  $pagetype = "viewtopic";
 027  $sql = "SELECT forum_name FROM forums WHERE forum_id = '$forum'";
 028  if(!$result = mysql_query($sql, $db))
 029      die("<font size=+1>An Error Occured</font><hr>Could not connect to the forums database.");
 030  $myrow = mysql_fetch_array($result);
 031  $forum_name = $myrow[forum_name];
 032  $sql = "SELECT topic_title, topic_status FROM topics WHERE topic_id = '$topic'";
 033   
 034  $total = get_total_posts($topic, $db, "topic");
 035  if($total > $posts_per_page) {
 036     $times = 0;
 037     for($x = 0; $x <= $total; $x += $posts_per_page)
 038       $times++;
 039     $pages = $times;
 040  }
 041   
 042   
 043   
 044  if(!$result = mysql_query($sql, $db))
 045    die("<font size=+1>An Error Occured</font><hr>Could not connect to the forums database.");
 046  $myrow = mysql_fetch_array($result);
 047  $topic_subject = stripslashes($myrow[topic_title]);
 048  $lock_state = $myrow[topic_status];
 049   
 050  include('page_header.'.$phpEx);
 051   
 052  ?>
 053  <?php
 054  if($total > $posts_per_page) {
 055     echo "<TABLE BORDER=0 WIDTH=$TableWidth ALIGN=CENTER>";
 056     $times = 1;
 057     echo "<TR ALIGN=\"LEFT\"><TD><FONT FACE=\"$FontFace\" SIZE=\"$FontSize3\" COLOR=\"$textcolor\">This topic is <b>$pages</b> pages long ( ";
 058     for($x = 0; $x <= $total; $x += $posts_per_page) {
 059        if($times != 1)
 060      echo " | ";
 061        echo "<a href=\"$PHP_SELF?mode=viewtopic&topic=$topic&forum=$forum&start=$x\">$times</a>";
 062        $times++;
 063     }
 064     echo " ) </FONT></TD></TR></TABLE>\n";
 065  }
 066  ?>
 067   
 068  <TABLE BORDER="0" CELLPADDING="1" CELLPADDING="0" ALIGN="CENTER" VALIGN="TOP" WIDTH="<?php echo $TableWidth?>"><TR><TD  BGCOLOR="<?php echo $table_bgcolor?>">
 069  <TABLE BORDER="0" CELLPADDING="3" CELLPADDING="1" WIDTH="100%">
 070  <TR BGCOLOR="<?php echo $color1?>" ALIGN="LEFT">
 071      <TD WIDTH="20%"><FONT FACE="<?php echo $FontFace?>" SIZE="<? echo $FontSize2?>" COLOR="<?php echo $textcolor?>">Author</FONT></TD>
 072      <TD><FONT FACE="<?php echo $FontFace?>" SIZE="<? echo $FontSize2 ?>"COLOR="<?php echo $textcolor?>"><?php echo $topic_subject?></FONT></TD>
 073  </TR>
 074  <?php
 075  if(isset($start)) {
 076     $sql = "SELECT * FROM posts WHERE topic_id = '$topic' ORDER BY post_id LIMIT $start, $posts_per_page";
 077  }
 078  else {
 079     $sql = "SELECT * FROM posts WHERE topic_id = '$topic' ORDER BY post_id LIMIT $posts_per_page";
 080  }
 081  if(!$result = mysql_query($sql, $db))
 082    die("<font size=+1>An Error Occured</font><hr>Could not connect to the forums database.");
 083  $myrow = mysql_fetch_array($result);
 084  $row_color = $color2;
 085  $count = 0;
 086  do {
 087     if(!($count % 2))
 088       $row_color = $color2;
 089     else 
 090       $row_color = $color1;
 091     
 092     echo "<TR BGCOLOR=\"$row_color\" ALIGN=\"LEFT\">\n";
 093     if($myrow[poster_id] != -1) {
 094         $posterdata = get_userdata_from_id($myrow[poster_id], $db);
 095      }
 096     else 
 097       $posterdata = array("user_id" => -1, "username" => "Anonymous", "user_posts" => "0", "user_rank" => -1);
 098     echo "<TD valign=top><FONT FACE=\"$FontFace\" COLOR=\"$textcolor\"><b>$posterdata[username]</b></FONT>";
 099     $posts = $posterdata[user_posts];
 100     if($posterdata[user_id] != -1) {
 101        if($posterdata[user_rank] != 0) 
 102      $sql = "SELECT rank_title, rank_image FROM ranks WHERE rank_id = '$posterdata[user_rank]'";
 103        else
 104      $sql = "SELECT rank_title, rank_image  FROM ranks WHERE rank_min <= " . $posterdata[user_posts] . " AND rank_max >= " . $posterdata[user_posts] . " AND rank_special = 0";
 105        if(!$rank_result = mysql_query($sql, $db))
 106      die("Error connecting to the database!");
 107        list($rank, $rank_image) = mysql_fetch_array($rank_result);
 108        echo "<BR><FONT FACE=\"$FontFace\" SIZE=\"$FontSize1\" COLOR=\"$textcolor\"><B>" . stripslashes($rank) . "</B></font>";
 109        if($rank_image != '')
 110      echo "<BR><IMG SRC=\"$url_images/$rank_image\" BORDER=\"0\">";
 111        echo "<BR><BR><FONT FACE=\"$FontFace\" SIZE=\"$FontSize1\" COLOR=\"$textcolor\">Joined: $posterdata[user_regdate]</FONT>";
 112        echo "<br><FONT FACE=\"$FontFace\" SIZE=\"$FontSize1\" COLOR=\"$textcolor\">Posts: $posts</FONT>";
 113        echo "<BR><FONT FACE=\"$FontFace\" SIZE=\"$FontSize1\" COLOR=\"$textcolor\">From: $posterdata[user_from]<br></FONT></TD>";
 114     }
 115     else {
 116        echo "<BR><FONT FACE=\"$FontFace\" SIZE=\"$FontSize1\" COLOR=\"$textcolor\">Unregistered User</font></TD>";
 117     }
 118     echo "<TD><img src=\"$posticon\"><FONT FACE=\"$FontFace\" SIZE=\"$FontSize1\" COLOR=\"$textcolor\">Posted: $myrow[post_time]&nbsp;&nbsp;&nbsp";
 119     echo "<HR></font>\n";
 120     $message = stripslashes($myrow[post_text]);
 121     $message = eregi_replace("\[addsig]$", "<BR>-----------------<BR>" . stripslashes(bbencode($posterdata[user_sig])), $message);
 122     
 123     echo "\n<FONT COLOR=\"$textcolor\" face=\"$FontFace\">" . $message . "</FONT><BR><BR>";
 124     echo "\n<HR>";
 125     echo "&nbsp;&nbsp<a href=\"$url_phpbb/bb_profile.$phpEx?mode=view&user=$posterdata[user_id]\"><img src=\"$profile_image\" border=0 alt=\"View Profile of $posterdata[username]\"></a>\n";
 126     if($posterdata["user_viewemail"] != 0) 
 127       echo "&nbsp;&nbsp;<a href=\"mailto:$posterdata[user_email]\"><IMG SRC=\"$email_image\" BORDER=0 ALT=\"Email $posterdata[username]\"></a>\n";
 128     if($posterdata["user_website"] != '') {
 129        if(strstr("http://", $posterdata["user_website"]))
 130      $posterdata["user_website"] = "http://" . $posterdata["user_website"];
 131        echo "&nbsp;&nbsp;<a href=\"$posterdata[user_website]\" TARGET=\"_blank\"><IMG SRC=\"$www_image\" BORDER=0 ALT=\"Goto $posterdata[username]s web site\"></a>\n";
 132     }
 133     if($posterdata["user_icq"] != '')
 134       echo "&nbsp;&nbsp;<a href=\"http://wwp.icq.com/$posterdata[user_icq]#pager\" target=\"_blank\"><img src=\"http://online.mirabilis.com/scripts/online.dll?icq=$posterdata[user_icq]&img=5\" alt=\"ICQ status\" border=\"0\"></a>&nbsp;&nbsp;<a href=\"http://wwp.icq.com/scripts/search.dll?to=$posterdata[user_icq]\"><img src=\"$icq_add_image\" border=\"0\"></a>";
 135     
 136     if($posterdata["user_aim"] != '')
 137       echo "&nbsp;&nbsp;<a href=\"aim:goim?screenname=$posterdata[user_aim]&message=Hi+$posterdata[user_aim].+Are+you+there?\"><img src=\"$images_aim\" border=\"0\"></a>";
 138     
 139     if($posterdata["user_yim"] != '')
 140       echo "&nbsp;&nbsp;<a href=\"http://edit.yahoo.com/config/send_webmesg?.target=$posterdata[user_yim]&.src=pg\"><img src=\"$images_yim\" border=\"0\"></a>";
 141     
 142     if($posterdata["user_msnm"] != '')
 143       echo "&nbsp;&nbsp;<a href=\"$url_phpbb/bb_profile.$phpEx?mode=view&user=$posterdata[user_id]\"><img src=\"$images_msnm\" border=\"0\"></a>";
 144     
 145     echo "&nbsp;&nbsp;<IMG SRC=\"images/div.gif\">\n";
 146     if($posterdata[user_id] != -1)
 147       echo "&nbsp;&nbsp;<a href=\"$url_phpbb/editpost.$phpEx?post_id=$myrow[post_id]&topic=$topic&forum=$forum\"><img src=\"$edit_image\" border=0 alt=\"Edit/Delete This Post\"></a>\n";
 148     echo "&nbsp;&nbsp;<a href=\"$url_phpbb/reply.$phpEx?topic=$topic&forum=$forum&post=$myrow[post_id]&quote=1\"><IMG SRC=\"$reply_wquote_image\" BORDER=\"0\" alt=\"Reply with quote\"></a>\n";
 149     if(is_moderator($forum, $userdata["user_id"], $db) || $userdata[user_level] > 2) {
 150        echo "&nbsp;&nbsp;<IMG SRC=\"images/div.gif\">\n";
 151        echo "&nbsp;&nbsp;<a href=\"$url_phpbb/topicadmin.$phpEx?mode=viewip&post=$myrow[post_id]&forum=$forum\"><IMG SRC=\"$ip_image\" BORDER=0 ALT=\"View Posters IP (Moderators/Admins Only)\"></a>\n";
 152     }
 153     echo "</TD></TR>";
 154     $count++;
 155  } while($myrow = mysql_fetch_array($result));
 156  $sql = "UPDATE topics SET topic_views = topic_views + 1 WHERE topic_id = '$topic'";
 157  @mysql_query($sql, $db);
 158  ?>
 159   
 160  </TABLE></TD></TR></TABLE>
 161  <TABLE ALIGN="CENTER" BORDER="0" WIDTH="<?php echo $TableWidth?>">
 162  <?php
 163  if($total > $posts_per_page) {
 164      $times = 1;
 165      echo "<TR ALIGN=\"RIGHT\"><TD COLSPAN=2><FONT FACE=\"$FontFace\" SIZE=\"$FontSize1\" COLOR=\"$textcolor\">Goto Page:</FONT> ";
 166      for($x = 0; $x <= $total; $x += $posts_per_page) {
 167          if($times != 1)
 168              echo " | ";
 169          echo "  <a href=\"$PHP_SELF?mode=viewtopic&topic=$topic&forum=$forum&start=$x\">$times</a>";
 170          $times++;
 171      }
 172      echo "</TD></TR>\n";
 173  }
 174  ?>
 175  <TR>
 176      <TD>
 177          <a href="newtopic.<?php echo $phpEx?>?forum=<?php echo $forum?>"><IMG SRC="<?php echo $newtopic_image?>" BORDER="0"></a>&nbsp;&nbsp;
 178  <?php
 179          if($lock_state != 1) {
 180  ?>
 181              <a href="<?php echo $url_phpbb ?>/reply.<?php echo $phpEx?>?topic=<?php echo $topic ?>&forum=<?php echo $forum ?>"><IMG SRC="<?php echo $reply_image ?>" BORDER="0"></a></TD>
 182  <?php
 183          }
 184          else {
 185  ?>
 186              <IMG SRC="<?php echo $reply_locked_image ?>" BORDER="0"></TD>
 187  <?php
 188          }
 189  ?>
 190      </TD>
 191  <TD ALIGN="RIGHT">
 192  <FORM ACTION="viewforum.<?php echo $phpEx?>" METHOD="GET">
 193  <FONT FACE="<?php echo $FontFace?>" SIZE="<? echo $FontSize2?>" COLOR="<?php echo $textcolor?>">Jump To:</FONT> <SELECT NAME="forum"><OPTION VALUE="-1">Select a Forum</OPTION>
 194  <?php
 195    $sql = "SELECT cat_id, cat_title FROM catagories ORDER BY cat_id";
 196  if($result = mysql_query($sql, $db)) {
 197     $myrow = mysql_fetch_array($result);   
 198     do {
 199        echo "<OPTION VALUE=\"-1\">&nbsp;</OPTION>\n";
 200        echo "<OPTION VALUE=\"-1\">$myrow[cat_title]</OPTION>\n";
 201        echo "<OPTION VALUE=\"-1\">----------------</OPTION>\n";
 202        $sub_sql = "SELECT forum_id, forum_name FROM forums WHERE cat_id = '$myrow[cat_id]' ORDER BY forum_id";
 203        if($res = mysql_query($sub_sql, $db)) {
 204       if($row = mysql_fetch_array($res)) {   
 205          do {
 206             $name = stripslashes($row[forum_name]);
 207             echo "<OPTION VALUE=\"$row[forum_id]\">$name</OPTION>\n";
 208          } while($row = mysql_fetch_array($res));
 209       }
 210       else {
 211          echo "<OPTION VALUE=\"0\">No More Forums</OPTION>\n";
 212       }
 213        }
 214        else {
 215       echo "<OPTION VALUE=\"0\">Error Connecting to DB</OPTION>\n";
 216        }
 217     } while($myrow = mysql_fetch_array($result));
 218  }
 219  else {
 220     echo "<OPTION VALUE=\"-1\">ERROR</OPTION>\n";
 221  }
 222  ?>
 223  </SELECT>
 224  <INPUT TYPE="SUBMIT" VALUE="Go">
 225  </FORM>
 226  </TR></TABLE>
 227   
 228  <?php
 229  echo "<CENTER>";
 230  if($lock_state != 1)
 231      echo "<a href=\"$url_phpbb/topicadmin.$phpEx?mode=lock&topic=$topic&forum=$forum\"><IMG SRC=\"$locktopic_image\" ALT=\"Lock this Topic\" BORDER=0></a> ";
 232  else
 233      echo "<a href=\"$url_phpbb/topicadmin.$phpEx?mode=unlock&topic=$topic&forum=$forum\"><IMG SRC=\"$unlocktopic_image\" ALT=\"Lock this Topic\" BORDER=0></a> ";
 234   
 235  echo "<a href=\"$url_phpbb/topicadmin.$phpEx?mode=move&topic=$topic&forum=$forum\"><IMG SRC=\"$movetopic_image\" ALT=\"Move this Topic\" BORDER=0></a> ";
 236  echo "<a href=\"$url_phpbb/topicadmin.$phpEx?mode=del&topic=$topic&forum=$forum\"><IMG SRC=\"$deltopic_image\" ALT=\"Delete this Topic\" BORDER=0></a></CENTER>\n";
 237   
 238  require('page_tail.'.$phpEx);
 239   
 240  /********************************************
 241  CVS Log
 242  $Log: viewtopic.php,v $
 243  Revision 1.34  2000/11/27 05:26:44  thefinn
 244  Fixed the goto box so if you select something that isn't a forum you go to the index
 245  Other little bug fixes.
 246   
 247  Revision 1.33  2000/11/15 04:57:15  thefinn
 248  New extention.inc functonaly
 249  New admin login that works on Windows systems
 250  Overall code fixes (Time calc etc etc)
 251   
 252  Revision 1.32  2000/11/07 17:31:43  thefinn
 253  Little fixes
 254   
 255  Revision 1.31  2000/11/06 01:23:07  thefinn
 256  Added rank images
 257   
 258  Revision 1.30  2000/10/27 19:04:27  thefinn
 259  Multipal moderators, everything works except edit forum
 260   
 261  Revision 1.29  2000/10/26 00:11:41  thefinn
 262  Polishing the dynamic signature feature, still needs work
 263   
 264  Revision 1.28  2000/10/24 20:05:40  thefinn
 265  Fixy fixy
 266   
 267  Revision 1.27  2000/10/24 17:05:18  thefinn
 268  Fixy fixy:
 269   
 270  Revision 1.26  2000/10/24 16:57:18  thefinn
 271  Fixed stuff
 272   
 273  Revision 1.25  2000/10/24 05:32:53  yokhannan
 274  config.php = New Font Settings For The Message Font... for those who *really*
 275  want to change things.   viewtopic = Font & Table Variables Added.
 276   
 277  Revision 1.24  2000/10/22 07:42:23  thefinn
 278  Dynamic signature hack
 279   
 280  Revision 1.23  2000/10/22 03:10:08  thefinn
 281  Dynamic Signatures
 282   
 283  Revision 1.22  2000/10/14 04:02:57  thefinn
 284  Small fixes, mostly cosmetic
 285   
 286  Revision 1.21  2000/10/13 18:06:44  thefinn
 287  Anonymous posting
 288   
 289  Revision 1.20  2000/10/03 20:33:06  thefinn
 290  User registration date shows up correctly on posts now
 291   
 292  Revision 1.19  2000/09/18 20:40:25  thefinn
 293  Got the ranking code in, needs input validity checking but other wise its done.
 294   
 295  Revision 1.18  2000/09/14 18:27:57  thefinn
 296  Added CVS Log tags to frequently changed files
 297   
 298   
 299  *********************************************/
 300  ?>
 301