This repository has been archived by the owner on Jan 26, 2020. It is now read-only.
/
listthreads.php
95 lines (74 loc) · 3.47 KB
/
listthreads.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
<?php
/*
ThWboard - PHP/MySQL Bulletin Board System
==============================================
(c) 2000-2004 by ThWboard Development Group
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";
$navpath .= 'Abonnierte Themen';
if( $g_user['userid'] == 0 )
{
message("Nur für Mitglieder", "Diese Funktion ist nur für Mitglieder. Sie können sich <a href=\"register.php\">hier</a> kostenlos registrieren.");
}
if(!$config['use_email'])
{
message('Funktion nicht verfügbar', 'Diese Funktion wurde vom Administrator deaktiviert.');
}
$Tframe = new Template("templates/" . $style['styletemplate'] . "/frame.html");
$TTopics = new Template("templates/" . $style['styletemplate'] . "/markedlist.html");
$TTopicrow = new Template("templates/" . $style['styletemplate'] . "/markedrow.html");
if(!empty($do_delthreads) && ($do_delthreads))
{
if(empty($delthreads) || !count($delthreads))
{
message('Fehler', 'Sie müssen ein Thema auswählen.');
}
thwb_query("UPDATE ".$pref."post SET postemailnotify='0' WHERE userid='".$g_user['userid']."' AND threadid IN (".join(',', $delthreads).")");
message('Themen abbestellt', 'Die markierten Themen wurden abbestellt.');
}
$r_usermarkedthreads = thwb_query("SELECT DISTINCT threadid FROM ".$pref."post WHERE postemailnotify = '1' AND userid = '".$g_user['userid']."' GROUP BY threadid");
$i = 0;
$TOPICROWS = '';
if( !mysql_num_rows($r_usermarkedthreads) )
{
$TTopicrow = new Template('./templates/'.$style['styletemplate'].'/board_nothreads.html');
eval($TTopicrow->GetTemplate("TOPICROWS"));
}
else
{
while ($a_thread = mysql_fetch_assoc($r_usermarkedthreads))
{
$i % 2 > 0 ? $thisrowbg = $style['CellB'] : $thisrowbg = $style['CellA'];
$i++;
$r_thread = mysql_query("SELECT threadid, threadauthor, threadtopic, threadviews, threadreplies, threadtime, boardid, threadlastreplyby FROM " . $pref . "thread WHERE threadid = '" . $a_thread['threadid'] . "'");
if ( mysql_num_rows( $r_thread ) != 0 )
{
$thread = mysql_fetch_array( $r_thread );
$r_board = mysql_query("SELECT boardname FROM " . $pref . "board WHERE boardid = '" . $thread['boardid'] . "'");
$board = mysql_fetch_array( $r_board );
$thread['threadtopic'] .= "<BR><span style=\"color:" . $style['color1'] . "\">". $style['smallfont'] . "Forum: " . $board['boardname'] . $style['smallfontend'] . "</span>";
$thread['threadtime'] = form_date($thread['threadtime']);
eval($TTopicrow->GetTemplate("TOPICROWS"));
}
else
{
$usermarkedthreads = str_replace( ";" . $threadid . ";", ";", $g_user['usermarkedthreads'] );
if ( strlen( $usermarkedthreads ) == 1 )
{
$usermarkedthreads = "";
}
mysql_query("UPDATE " . $pref . "user SET usermarkedthreads = '" . $usermarkedthreads . "' WHERE userid = '" . $g_user['userid'] . "'");
}
}
}
eval($TTopics->GetTemplate("CONTENT"));
eval($Tframe->GetTemplate());