C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\webboard\board.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
<?php
/* $Id: board.php,v 1.4 2002/12/30 23:24:34 thetinysteini Exp $ */
/*
          ThWboard - PHP/MySQL Bulletin Board System
        ==============================================
            (c) 2000, 2001 by
               Paul Baecher         <paul@thewall.de>
               Felix Gonschorek   <funner@thewall.de>

          download the latest version:
            http://www.thwboard.de

          This  program is  free  software;  you can
          redistribute it and/or modify it under the
          terms of the GNU General Public License as
          published by the Free Software Foundation;
          either  version 2 of  the License,  or (at
          your option) any later version.

        ==============================================

*/

include "./inc/header.inc.php";


if( !
$board['boardid'] || $board['boarddisabled'] )
{
    
message("Fehler""Board existiert nicht!");
}

$TMain = new Template("templates/" $style['styletemplate'] . "/frame.html");
$TTopics = new Template("templates/" $style['styletemplate'] . "/topics.html");
$TTopicrow = new Template("templates/" $style['styletemplate'] . "/topicrow.html");

if( !isset(
$pagenum) )
{
    
$pagenum 1;
}

if( 
$time )
{
    
$lastvisited $time;
}

if( 
$lastvisited )
{
    
$TIME_STRING "&time=$lastvisited";
}

$r_thread thwb_query("SELECT threadid, threadtopic, threadtime, threadauthor,
    threadreplies, threadclosed, threadtop, threadlastreplyby, threadiconid, threadlink,
    threadviews FROM "
.$pref."thread WHERE
    boardid='"
.intval($board['boardid'])."' 
    ORDER BY threadtop DESC, threadtime DESC LIMIT
    "
.intval(($pagenum 1) * $config['vars_t_amount']).", $config[vars_t_amount]");

$i 0;
$topicicon[0] = 'fullalpha';

$r_news thwb_query("SELECT newsid, newstopic, newstime FROM ".$pref."news WHERE boardid LIKE '%;" intval($board['boardid']) . ";%' ORDER BY newstime DESC LIMIT 1");
if( 
mysql_num_rows($r_news) > )
{
    
$TNewsrow = new Template('./templates/'.$style['styletemplate'].'/newstopicrow.html');
    
$news mysql_fetch_array($r_news);

    
$news['newstopic'] = parse_code($news['newstopic']);
    
$news['newstime'] = form_date($news['newstime'], 0);
    eval(
$TNewsrow->GetTemplate("TOPICROWS"));
}

if( 
mysql_num_rows($r_thread) < )
{
    
$TTopicrow = new Template('./templates/'.$style['styletemplate'].'/board_nothreads.html');
    eval(
$TTopicrow->GetTemplate("TOPICROWS"));
}

while( 
$thread mysql_fetch_array($r_thread) )
{
    
$i $thisrowbg $style['CellB'] : $thisrowbg $style['CellA'];
    
    
$thread['threadauthor'] = parse_code($thread['threadauthor']);
    
$thread['threadlastreplyby'] = parse_code($thread['threadlastreplyby']);

    if( 
$thread['threadlink'] != )
    {
        if( 
$P->has_permissionP_OMOVE ) )
            
$prepend 'Verschoben [<a href="threadops.php?action=remove_link&threadid='.$thread['threadid'].'">Link entf.</a>]: ';
        else
            
$prepend 'Verschoben: ';
        
$thread['threadid'] = $thread['threadlink'];
        
$thread['threadreplies'] = '-';
        
$thread['threadviews'] = '-';
        
$thread['threadtime'] = 0;
        
$thread['threadlastreplyby'] = 'N/A';
    }
    elseif( 
$thread['threadtop'] )
    {
        
$prepend 'Fest: ';
    }
    else
    {
        
$prepend '';
    }
    
    if( 
$thread['threadtime'] > $lastvisited && $lastvisited != )
    {
        
$imagepath 'templates/'.$style['styletemplate'].'/images/icon/'.$topicicon[($thread['threadiconid'])].'_new.gif';
    }
    else
    {
        
$imagepath 'templates/'.$style['styletemplate'].'/images/icon/'.$topicicon[($thread['threadiconid'])].'.gif';
    }

    
$thread['threadtopic'] = parse_code($thread['threadtopic']);
    
$thread['threadtime'] = form_date($thread['threadtime']);
/*    if ( substr_count( $g_user['usermarkedthreads'], ';' . $thread['threadid'] . ';' ) != 0 )
    {
        $thread['threadtopic'] = '<B>' . $thread['threadtopic'] . $style['smallfont'] .' *markiert* ' . $style['smallfontend'] . '</b>';
    }*/

    
$npages ceil(($thread['threadreplies'] + 1) / $config['vars_m_amount']);
    
    
$pages '';
    if( 
$npages )
    {
        for( 
$j 0$j $npages$j++ )
        {
            
$pages .= '<a href="showtopic.php?threadid='.$thread['threadid'].'&pagenum='.($j 1).$TIME_STRING.'">'.($j 1).'</a> ';
            if( 
$j == && $npages )
            {
                
$pages .= '... ';
                
$j $npages 4;
            }
        }
        
$pages '(Seiten: ' $pages ')';
    }

    if( 
$thread['threadclosed'] == )
    
$imagepath "templates/".$style['styletemplate']."/images/information_closed.gif";

    eval(
$TTopicrow->GetTemplate("TOPICROWS"));
    
$i++;
}

$topic_pages ceil($board['boardthreads'] / $config['vars_t_amount']);


// max. number of pages visible at a time / 2 ([1] [2] ... 
define('PADDING'3);
$pages_nav '';

// << <
if( $pagenum PADDING )
{
    
$pages_nav '[<a class="bglink" href="board.php?boardid='.$board['boardid'].'&pagenum=1">Erste Seite</a>] ... ';
}
// pages ..
$i $pagenum PADDING;
if( 
$i )
    
$i 1;
$imax $pagenum PADDING;
if( 
$imax $topic_pages )
    
$imax $topic_pages;

for( 
$i$i <= $imax$i++ )
{
    if( 
$i == $pagenum )
        
$pages_nav .= '<b>-'.$i.'-</b> ';
    else
        
$pages_nav .= '[<a class="bglink" href="board.php?boardid='.$board['boardid'].'&pagenum='.$i.'">'.$i.'</a>] ';
        
}
// > >>
if( $pagenum PADDING $topic_pages )
{
    
$pages_nav .= '... [<a class="bglink" href="board.php?boardid='.$board['boardid'].'&pagenum='.$topic_pages.'">Letzte Seite</a>]';
}


if( 
$g_user['userid'] != )
{
    
$options_newthread '<a href="newtopic.php?boardid='.$board['boardid'].'">Neues Topic</a> |';
}

if( 
$P->has_permissionP_POSTNEW ) )
{
    
$canpostnew 'Ja';
}
else
{
    
$canpostnew 'Nein';
}

if( 
$P->has_permissionP_REPLY ) )
{
    
$canreply 'Ja';
}
else
{
    
$canreply 'Nein';
}

$JUMP_MENU jumpmenu($board['boardid']);

$navpath .= 'Themenübersicht';
$titleprepend $board['boardname'] . ' - ';

eval(
$TTopics->GetTemplate("CONTENT"));
eval(
$TMain->GetTemplate());


?>