/
group_forum.php
659 lines (644 loc) · 40.5 KB
/
group_forum.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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
<?php
/*===================================================+
|| # HoloCMS - Website and Content Management System
|+===================================================+
|| # Copyright © 2016 Miguel González Aravena. All rights reserved.
|| # https://github.com/MiguelGonzalezAravena/HoloCMS
|+===================================================+
|| # HoloCMS is provided 'as is" and comes without
|| # warrenty of any kind. HoloCMS is free software!
|+===================================================*/
$allow_guests = true;
require_once(dirname(__FILE__) . '/core.php');
require_once(dirname(__FILE__) . '/includes/session.php');
(getContent('forum-enabled') != 1) ? header('Location: index.php') : '';
$pagename = 'Discussion Board';
$pageid = 'forum';
$body_id = 'viewmode';
$edit_mode = false;
$member_rank = 0;
$searchString = isset($_POST['searchString']) ? FilterText($_POST['searchString']) : '';
$groupid = isset($_GET['id']) ? (int) $_GET['id'] : 0;
$page = isset($_GET['page']) ? (int) $_GET['page'] : 0;
if(!empty($searchString)) {
$check = mysqli_query($connection, "SELECT id FROM groups_details WHERE name LIKE '{$searchString}' LIMIT 1") or die(mysqli_error($connection));
$found = mysqli_num_rows($check);
if($found > 0) {
$tmp = mysqli_fetch_assoc($check);
header('Location: group_profile.php?id=' . $tmp['id']);
}
}
if(!empty($groupid)) {
$check = mysqli_query($connection, "SELECT * FROM groups_details WHERE id = '{$groupid}' LIMIT 1");
$exists = mysqli_num_rows($check);
if($exists > 0) {
$error = false;
$groupdata = mysqli_fetch_assoc($check);
$pagename = $groupdata['name'];
$ownerid = $groupdata['ownerid'];
$members = mysqli_evaluate("SELECT COUNT(*) FROM groups_memberships WHERE groupid = '{$groupid}' AND is_pending = '0'");
$check = mysqli_query($connection, "SELECT * FROM groups_memberships WHERE userid = '{$my_id}' AND groupid = '{$groupid}' AND is_pending = '0' LIMIT 1");
$is_member = mysqli_num_rows($check);
if($is_member > 0 && $logged_in) {
$is_member = true;
$my_membership = mysqli_fetch_assoc($check);
$member_rank = $my_membership['member_rank'];
} else {
$is_member = false;
}
} else {
$error = true;
}
} else {
$error = true;
}
if($error != true) {
require_once(dirname(__FILE__) . '/templates/community/subheader.php');
require_once(dirname(__FILE__) . '/templates/community/header.php');
mysqli_query($connection, "UPDATE groups_details SET views = views + 1 WHERE id = '{$groupid}' LIMIT 1");
$viewtools = '<div class="myhabbo-view-tools">';
$threads = mysqli_evaluate("SELECT COUNT(*) FROM cms_forum_threads WHERE forumid = '{$groupid}'");
$pages = ceil(($threads + 0) / 10);
$page = ($page > $pages || $page < 1) ? 1 : $page;
$key = 0;
?>
<div id="container">
<div id="content" style="position: relative" class="clearfix">
<div id="mypage-wrapper" class="cbb blue">
<div class="box-tabs-container box-tabs-left clearfix">
<?php echo ($member_rank > 1 && $edit_mode ? '<a href="' . $path . 'group_profile.php?id=' . $groupid . '&do=edit" class="new-button dark-button edit-icon" style="float:left"><b><span></span>Edit</b><i></i></a>' : ''); ?>
<h2 class="page-owner">
<?php echo HoloText($groupdata['name']); ?>
<?php echo ($groupdata['type'] == 2 ? '<img src="' . $web_gallery . 'images/status_closed_big.gif" alt="Closed Group" title="Closed Group" />' : ''); ?>
<?php echo ($groupdata['type'] == 1 ? '<img src="' . $web_gallery . 'images/status_exclusive_big.gif" alt="Moderated Group" title="Moderated Group" />' : ''); ?>
</h2>
<ul class="box-tabs">
<li>
<a href="<?php echo $path; ?>group_profile.php?id=<?php echo $groupid; ?>">Front Page</a><span class="tab-spacer"></span>
</li>
<li class="selected">
<a href="<?php echo $path; ?>group_forum.php?id=<?php echo $groupid; ?>">
Discussion Forum <?php echo ($groupdata['pane'] > 0 ? '<img src="' . $web_gallery . 'images/grouptabs/privatekey.png" alt="Private">' : ''); ?>
</a>
<span class="tab-spacer"></span>
</li>
<?php
if($logged_in && !$is_member && $groupdata['type'] != 2 && $my_membership['is_pending'] != 1) {
$viewtools .= '<a href="' . $path . 'joingroup.php?groupId=' . $groupid . '" id="join-group-button">';
$viewtools .= ($groupdata['type'] == 0 || $groupdata['type'] == 3 ? 'Join' : 'Request membership');
$viewtools .= '</a>';
}
$viewtools .= ($logged_in && $my_membership['is_current'] != 1 && $is_member ? '<a href="#" id="select-favorite-button">Make favourite</a>' : '');
$viewtools .= ($logged_in && $my_membership['is_current'] == 1 && $is_member ? '<a href="#" id="deselect-favorite-button">Remove favourite</a>' : '');
$viewtools .= ($logged_in && $is_member && $my_id != $ownerid ? '<a href="' . $path . 'leavegroup.php?groupId=' . $groupid . '" id="leave-group-button">Leave group</a>' : '');
$viewtools .= ' </div>';
?>
</ul>
</div>
<div id="mypage-content">
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="content-1col">
<tr>
<td valign="top" style="width: 750px;" class="habboPage-col rightmost">
<div id="discussionbox">
<?php
if($groupdata['pane'] > 0) {
$sql = mysqli_query($connection, "SELECT * FROM groups_memberships WHERE userid = '{$my_id}' AND is_pending != '1' AND groupid = '{$groupid}'");
$member = mysqli_fetch_assoc($sql);
if(mysqli_num_rows($sql) > 0) {
?>
<div id="group-topiclist-container">
<div class="topiclist-header clearfix">
<?php
$sql = mysqli_query($connection, "SELECT * FROM groups_details WHERE id = '{$groupid}' LIMIT 1");
$row = mysqli_fetch_assoc($sql);
if($row['topics'] == 0) {
?>
<input type="hidden" id="email-verfication-ok" value="1" />
<?php echo ($logged_in ? '<a href="#" id="newtopic-upper" class="new-button verify-email newtopic-icon" style="float:left"><b><span></span>New Thread</b><i></i></a>' : 'You must be logged in to reply or post new threads.'); ?>
<?php
} else if($row['topics'] == 1) {
$check = mysqli_query($connection, "SELECT * FROM groups_memberships WHERE userid = '{$my_id}' AND groupid = '{$groupid}' AND is_pending != '1' LIMIT 1");
if(mysqli_num_rows($check) > 0) {
?>
<input type="hidden" id="email-verfication-ok" value="1" />
<?php echo ($logged_in ? '<a href="#" id="newtopic-upper" class="new-button verify-email newtopic-icon" style="float:left"><b><span></span>New Thread</b><i></i></a>' : 'You must be logged in to reply or post new threads.'); ?>
<?php
}
} else if($row['topics'] == 2) {
$check = mysqli_query($connection, "SELECT * FROM groups_memberships WHERE userid = '{$my_id}' AND groupid = '{$groupid}' AND member_rank = '2' AND is_pending != '1' LIMIT 1");
if(mysqli_num_rows($check) > 0) {
?>
<input type="hidden" id="email-verfication-ok" value="1" />
<?php echo ($logged_in ? '<a href="#" id="newtopic-upper" class="new-button verify-email newtopic-icon" style="float:left"><b><span></span>New Thread</b><i></i></a>' : 'You must be logged in to reply or post new threads.'); ?>
<?php
}
}
?>
<div class="page-num-list">
View page:
<?php
for ($i = 1; $i <= $pages; $i++) {
if($page == $i) {
echo $i;
} else {
?>
<a href="<?php echo $path; ?>forum.php?page=<?php echo $i; ?>" class="topiclist-page-link"><?php echo $i; ?></a>
<?php
}
}
?>
</div>
</div>
<table class="group-topiclist" border="0" cellpadding="0" cellspacing="0" id="group-topiclist-list">
<tr class="topiclist-columncaption">
<td class="topiclist-columncaption-topic">Topic</td>
<td class="topiclist-columncaption-lastpost">Last post</td>
<td class="topiclist-columncaption-replies">Replies</td>
<td class="topiclist-columncaption-views">Views</td>
</tr>
<?php if($threads == 0) { ?>
<tr class="topiclist-row-1">
<td class="topiclist-rowtopic" valign="top">
No threads to display.
</td>
</tr>
<?php
}
$sql = mysqli_query($connection, "SELECT * FROM cms_forum_threads WHERE type > 2 AND forumid = '{$groupid}' ORDER BY unix DESC") or die(mysqli_error($connection));
$stickies = mysqli_num_rows($sql);
$query_min = ($page * 10) - 10;
$query_max = 10;
$query_max = $query_max - $stickies;
$query_min = $query_min - $stickies;
$query_min = ($query_min < 0) ? 0 : $query_min;
while($row = mysqli_fetch_assoc($sql)) {
$key++;
$x = (IsEven($key)) ? 'odd' : 'even';
$date_bits = explode(' ', $row['date']);
$date = $date_bits[0];
$time = $date_bits[1];
$lastpost_date_bits = explode(' ', $row['lastpost_date']);
$lastpost_date = $lastpost_date_bits[0];
$lastpost_time = $lastpost_date_bits[1];
?>
<tr class="topiclist-row-<?php echo $x; ?>">
<td class="topiclist-rowtopic" valign="top">
<div class="topiclist-row-content">
<a class="topiclist-link icon icon-sticky" href="<?php echo $path; ?>viewthread.php?thread=<?php echo $row['id']; ?>"><?php echo HoloText($row['title']); ?></a>
<?php echo ($row['type'] == 4 ? ' <span class="topiclist-row-topicsticky"><img src="' . $web_gallery . 'images/groups/status_closed.gif" title="Closed Thread" alt="Closed Thread"></span>' : ''); ?>
(page
<?php
$thread_pages = ceil(($row['posts'] + 1) / 10);
for ($i = 1; $i <= $thread_pages; $i++) {
?>
<a href="<?php echo $path; ?>viewthread.php?thread=<?php echo $row['id']; ?>&page=<?php echo $i; ?>" class="topiclist-page-link"><?php echo $i; ?></a><?php } ?>)
<br />
<span>
<a class="topiclist-row-openername" href="<?php echo $path; ?>user_profile.php?name=<?php echo $row['author'];; ?>"><?php echo $row['author']; ?></a>
</span>
<span class="latestpost"><?php echo $date; ?></span>
<span class="latestpost">(<?php echo $time; ?>)</span>
</div>
</td>
<td class="topiclist-lastpost" valign="top">
<a class="lastpost-page-link" href="<?php echo $path; ?>viewthread.php?thread=<?php echo $row['id']; ?>&sp=JumpToLast">
<span class="lastpost"><?php echo $lastpost_date; ?></span>
<span class="lastpost">(<?php echo $lastpost_time; ?>)</span>
</a>
<br />
<span class="topiclist-row-writtenby">by:</span>
<a class="topiclist-row-openername" href="<?php echo $path; ?>user_profile.php?name=<?php echo $row['lastpost_author']; ?>"><?php echo $row['lastpost_author']; ?></a>
</td>
<td class="topiclist-replies" valign="top"><?php echo $row['posts']; ?></td>
<td class="topiclist-views" valign="top"><?php echo $row['views']; ?></td>
</tr>
<?php
}
$sql = mysqli_query($connection, "SELECT * FROM cms_forum_threads WHERE type < 3 AND forumid = '{$groupid}' ORDER BY unix DESC LIMIT {$query_min}, {$query_max}") or die(mysqli_error($connection));
while($row = mysqli_fetch_assoc($sql)) {
$key++;
$x = (IsEven($key)) ? 'odd' : 'even';
$date_bits = explode(' ', $row['date']);
$date = $date_bits[0];
$time = $date_bits[1];
$lastpost_date_bits = explode(' ', $row['lastpost_date']);
$lastpost_date = $lastpost_date_bits[0];
$lastpost_time = $lastpost_date_bits[1];
?>
<tr class="topiclist-row-<?php echo $x; ?>">
<td class="topiclist-rowtopic" valign="top">
<div class="topiclist-row-content">
<a class="topiclist-link" href="<?php echo $path; ?>viewthread.php?thread=<?php echo $row['id']; ?>"><?php echo HoloText($row['title']); ?></a>
<?php echo ($row['type'] == 2 ? ' <span class="topiclist-row-topicsticky"><img src="' . $web_gallery . 'images/groups/status_closed.gif" title="Closed Thread" alt="Closed Thread"></span>' : ''); ?>
(page
<?php
$thread_pages = ceil(($row['posts'] + 1) / 10);
for ($i = 1; $i <= $thread_pages; $i++) {
?>
<a href="<?php echo $path; ?>viewthread.php?thread=<?php echo $row['id']; ?>&page=<?php echo $i; ?>" class="topiclist-page-link"><?php echo $i; ?></a><?php } ?>)
<br />
<span>
<a class="topiclist-row-openername" href="<?php echo $path; ?>user_profile.php?name=<?php echo $row['author']; ?>"><?php echo $row['author']; ?></a>
</span>
<span class="latestpost"><?php echo $date; ?></span>
<span class="latestpost">(<?php echo $time; ?>)</span>
</div>
</td>
<td class="topiclist-lastpost" valign="top">
<a class="lastpost-page-link" href="<?php echo $path; ?>viewthread.php?thread=<?php echo $row['id']; ?>&sp=JumpToLast">
<span class="lastpost"><?php echo $lastpost_date; ?></span>
<span class="lastpost">(<?php echo $lastpost_time; ?>)</span>
</a>
<br />
<span class="topiclist-row-writtenby">by:</span>
<a class="topiclist-row-openername" href="<?php echo $path; ?>user_profile.php?name=<?php echo $row['lastpost_author']; ?>"><?php echo $row['lastpost_author']; ?></a>
</td>
<td class="topiclist-replies" valign="top"><?php echo $row['posts']; ?></td>
<td class="topiclist-views" valign="top"><?php echo $row['views']; ?></td>
</tr>
<?php } ?>
</table>
<div class="topiclist-footer clearfix">
<?php
$sql = mysqli_query($connection, "SELECT * FROM groups_details WHERE id = '{$groupid}' LIMIT 1");
$row = mysqli_fetch_assoc($sql);
if($row['topics'] == 0) {
?>
<input type="hidden" id="email-verfication-ok" value="1" />
<?php echo ($logged_in ? '<a href="#" id="newtopic-upper" class="new-button verify-email newtopic-icon" style="float:left"><b><span></span>New Thread</b><i></i></a>' : 'You must be logged in to reply or post new threads.'); ?>
<?php
} else if($row['topics'] == 1) {
$check = mysqli_query($connection, "SELECT * FROM groups_memberships WHERE userid = '{$my_id}' AND groupid = '{$groupid}' LIMIT 1");
if(mysqli_num_rows($check) > 0) {
?>
<input type="hidden" id="email-verfication-ok" value="1" />
<?php echo ($logged_in ? '<a href="#" id="newtopic-upper" class="new-button verify-email newtopic-icon" style="float:left"><b><span></span>New Thread</b><i></i></a>' : 'You must be logged in to reply or post new threads.'); ?>
<?php
}
} else if($row['topics'] == 2) {
$check = mysqli_query($connection, "SELECT * FROM groups_memberships WHERE userid = '{$my_id}' AND groupid = '{$groupid}' AND member_rank = '2' LIMIT 1");
if(mysqli_num_rows($check) > 0) {
?>
<input type="hidden" id="email-verfication-ok" value="1" />
<?php echo ($logged_in ? '<a href="#" id="newtopic-upper" class="new-button verify-email newtopic-icon" style="float:left"><b><span></span>New Thread</b><i></i></a>' : 'You must be logged in to reply or post new threads.'); ?>
<?php
}
}
?>
<div class="page-num-list">
View page:
<?php
for ($i = 1; $i <= $pages; $i++) {
if($page == $i) {
echo $i;
} else {
?>
<a href="<?php echo $path; ?>forum.php?page=<?php echo $i; ?>" class="topiclist-page-link"><?php echo $i; ?></a>
<?php
}
}
?>
</div>
<?php } else { ?>
<h1>Oops...</h1>
<p>
You can't acces this discussion forum, you need to be a member!<br />
</p>
<?php
}
} else {
?>
<div id="group-topiclist-container">
<div class="topiclist-header clearfix">
<input type="hidden" id="email-verfication-ok" value="1" />
<?php
$sql = mysqli_query($connection, "SELECT * FROM groups_details WHERE id = '{$groupid}' LIMIT 1");
$row = mysqli_fetch_assoc($sql);
if($row['topics'] == 0) {
?>
<input type="hidden" id="email-verfication-ok" value="1" />
<?php echo ($logged_in ? '<a href="#" id="newtopic-upper" class="new-button verify-email newtopic-icon" style="float:left"><b><span></span>New Thread</b><i></i></a>' : 'You must be logged in to reply or post new threads.'); ?>
<?php
} else if($row['topics'] == 1) {
$check = mysqli_query($connection, "SELECT * FROM groups_memberships WHERE userid = '{$my_id}' AND groupid = '{$groupid}' LIMIT 1");
if(mysqli_num_rows($check) > 0) {
?>
<input type="hidden" id="email-verfication-ok" value="1" />
<?php echo ($logged_in ? '<a href="#" id="newtopic-upper" class="new-button verify-email newtopic-icon" style="float:left"><b><span></span>New Thread</b><i></i></a>' : 'You must be logged in to reply or post new threads.'); ?>
<?php
}
} else if($row['topics'] == 2) {
$check = mysqli_query($connection, "SELECT * FROM groups_memberships WHERE userid = '{$my_id}' AND groupid = '{$groupid}' AND member_rank = '2' LIMIT 1");
if(mysqli_num_rows($check) > 0) {
?>
<input type="hidden" id="email-verfication-ok" value="1" />
<?php echo ($logged_in ? '<a href="#" id="newtopic-upper" class="new-button verify-email newtopic-icon" style="float:left"><b><span></span>New Thread</b><i></i></a>' : 'You must be logged in to reply or post new threads.'); ?>
<?php
}
}
?>
<div class="page-num-list">
View page:
<?php
for ($i = 1; $i <= $pages; $i++) {
if($page == $i) {
echo $i ;
} else {
?>
<a href="<?php echo $path; ?>forum.php?page=<?php echo $i; ?>" class="topiclist-page-link"><?php echo $i; ?></a>
<?php
}
}
?>
</div>
</div>
<table class="group-topiclist" border="0" cellpadding="0" cellspacing="0" id="group-topiclist-list">
<tr class="topiclist-columncaption">
<td class="topiclist-columncaption-topic">Topic</td>
<td class="topiclist-columncaption-lastpost">Last post</td>
<td class="topiclist-columncaption-replies">Replies</td>
<td class="topiclist-columncaption-views">Views</td>
</tr>
<?php if($threads == 0) { ?>
<tr class="topiclist-row-1">
<td class="topiclist-rowtopic" valign="top">
No threads to display.
</td>
</tr>
<?php
}
$sql = mysqli_query($connection, "SELECT * FROM cms_forum_threads WHERE type > 2 AND forumid = '{$groupid}' ORDER BY unix DESC") or die(mysqli_error($connection));
$stickies = mysqli_num_rows($sql);
$query_min = ($page * 10) - 10;
$query_max = 10;
$query_max = $query_max - $stickies;
$query_min = $query_min - $stickies;
$query_min = ($query_min < 0) ? 0 : $query_min;
while($row = mysqli_fetch_assoc($sql)) {
$key++;
$x = (IsEven($i)) ? 'odd' : 'even';
$date_bits = explode(' ', $row['date']);
$date = $date_bits[0];
$time = $date_bits[1];
$lastpost_date_bits = explode(' ', $row['lastpost_date']);
$lastpost_date = $lastpost_date_bits[0];
$lastpost_time = $lastpost_date_bits[1];
?>
<tr class="topiclist-row-<?php echo $x; ?>">
<td class="topiclist-rowtopic" valign="top">
<div class="topiclist-row-content">
<a class="topiclist-link icon icon-sticky" href="<?php echo $path; ?>viewthread.php?thread=<?php echo $row['id']; ?>"><?php echo HoloText($row['title']); ?></a>
<?php echo ($row['type'] == 4 ? ' <span class="topiclist-row-topicsticky"><img src="' . $web_gallery . 'images/groups/status_closed.gif" title="Closed Thread" alt="Closed Thread"></span>' : ''); ?>
(page
<?php
$thread_pages = ceil(($row['posts'] + 1) / 10);
for ($i = 1; $i <= $thread_pages; $i++) {
?>
<a href="<?php echo $path; ?>viewthread.php?thread=<?php echo $row['id']; ?> . "&page=<?php echo $i; ?>" class="topiclist-page-link"><?php echo $i; ?></a><?php } ?>)
<br />
<span>
<a class="topiclist-row-openername" href="<?php echo $path; ?>user_profile.php?name=<?php echo $row['author']; ?>"><?php echo $row['author']; ?></a>
</span>
<span class="latestpost"><?php echo $date; ?></span>
<span class="latestpost">(<?php echo $time; ?>)</span>
</div>
</td>
<td class="topiclist-lastpost" valign="top">
<a class="lastpost-page-link" href="<?php echo $path; ?>viewthread.php?thread=<?php echo $row['id']; ?>&sp=JumpToLast">
<span class="lastpost"><?php echo $date; ?></span>
<span class="lastpost">(<?php echo $time; ?>)</span>
</a><br />
<span class="topiclist-row-writtenby">by:</span>
<a class="topiclist-row-openername" href="<?php echo $path; ?>user_profile.php?name=<?php echo $row['lastpost_author']; ?>"><?php echo $row['lastpost_author']; ?></a>
</td>
<td class="topiclist-replies" valign="top"><?php echo $row['posts']; ?></td>
<td class="topiclist-views" valign="top"><?php echo $row['views']; ?></td>
</tr>
<?php
}
$sql = mysqli_query($connection, "SELECT * FROM cms_forum_threads WHERE type < 3 AND forumid = '{$groupid}' ORDER BY unix DESC LIMIT {$query_min}, {$query_max}") or die(mysqli_error($connection));
while($row = mysqli_fetch_assoc($sql)) {
$key++;
$x = (IsEven($key)) ? 'odd' : 'even';
$date_bits = explode(' ', $row['date']);
$date = $date_bits[0];
$time = $date_bits[1];
$lastpost_date_bits = explode(' ', $row['lastpost_date']);
$lastpost_date = $lastpost_date_bits[0];
$lastpost_time = $lastpost_date_bits[1];
?>
<tr class="topiclist-row-<?php echo $x; ?>">
<td class="topiclist-rowtopic" valign="top">
<div class="topiclist-row-content">
<a class="topiclist-link " href="<?php echo $path; ?>viewthread.php?thread=<?php echo $row['id']; ?>"><?php echo HoloText($row['title']); ?></a>
<?php echo ($row['type'] == 2 ? ' <span class="topiclist-row-topicsticky"><img src="' . $web_gallery . 'images/groups/status_closed.gif" title="Closed Thread" alt="Closed Thread"></span>' : ''); ?>
(page
<?php
$thread_pages = ceil(($row['posts'] + 1) / 10);
for ($i = 1; $i <= $thread_pages; $i++) {
?>
<a href="<?php echo $path; ?>viewthread.php?thread=<?php echo $row['id']; ?>&page=<?php echo $i; ?>" class="topiclist-page-link"><?php echo $i; ?></a><?php } ?>)
<br />
<span>
<a class="topiclist-row-openername" href="<?php echo $path; ?>user_profile.php?name=<?php echo $row['author']; ?>"><?php echo $row['author']; ?></a>
</span>
<span class="latestpost"><?php echo $date; ?></span>
<span class="latestpost">(<?php echo $time; ?>)</span>
</div>
</td>
<td class="topiclist-lastpost" valign="top">
<a class="lastpost-page-link" href="<?php echo $path; ?>viewthread.php?thread=<?php echo $row['id']; ?>&sp=JumpToLast">
<span class="lastpost"><?php echo $lastpost_date; ?></span>
<span class="lastpost">(<?php echo $lastpost_time; ?>)</span>
</a>
<br />
<span class="topiclist-row-writtenby">by:</span>
<a class="topiclist-row-openername" href="<?php echo $path; ?>user_profile.php?name=<?php echo $row['lastpost_author']; ?>"><?php echo $row['lastpost_author']; ?></a>
</td>
<td class="topiclist-replies" valign="top"><?php echo $row['posts']; ?></td>
<td class="topiclist-views" valign="top"><?php echo $row['views']; ?></td>
</tr>
<?php } ?>
</table>
<div class="topiclist-footer clearfix">
<?php
$sql = mysqli_query($connection, "SELECT * FROM groups_details WHERE id = '{$groupid}' LIMIT 1");
$row = mysqli_fetch_assoc($sql);
if($row['topics'] == 0) {
?>
<input type="hidden" id="email-verfication-ok" value="1" />
<?php echo ($logged_in ? '<a href="#" id="newtopic-upper" class="new-button verify-email newtopic-icon" style="float:left"><b><span></span>New Thread</b><i></i></a>' : 'You must be logged in to reply or post new threads.'); ?>
<?php
} else if($row['topics'] == 1) {
$check = mysqli_query($connection, "SELECT * FROM groups_memberships WHERE userid = '{$my_id}' AND groupid = '{$groupid}' AND is_pending != '1' LIMIT 1");
if(mysqli_num_rows($check) > 0) {
?>
<input type="hidden" id="email-verfication-ok" value="1" />
<?php echo ($logged_in ? '<a href="#" id="newtopic-upper" class="new-button verify-email newtopic-icon" style="float:left"><b><span></span>New Thread</b><i></i></a>' : 'You must be logged in to reply or post new threads.'); ?>
<?php
}
} else if($row['topics'] == 2) {
$check = mysqli_query($connection, "SELECT * FROM groups_memberships WHERE userid='".$my_id."' AND groupid='".$groupid."' AND member_rank='2' AND is_pending <> '1' LIMIT 1");
if(mysqli_num_rows($check) > 0) {
?>
<input type="hidden" id="email-verfication-ok" value="1" />
<?php echo ($logged_in ? '<a href="#" id="newtopic-upper" class="new-button verify-email newtopic-icon" style="float:left"><b><span></span>New Thread</b><i></i></a>' : 'You must be logged in to reply or post new threads.'); ?>
<?php
}
}
?>
<div class="page-num-list">
View page:
<?php
for ($i = 1; $i <= $pages; $i++) {
if($page == $i) {
echo $i;
} else {
?>
<a href="<?php echo $path; ?>forum.php?page=<?php echo $i; ?>" class="topiclist-page-link"><?php echo $i; ?></a>
<?php
}
}
?>
</div>
<?php } ?>
</div>
</div>
<script type="text/javascript" language="JavaScript">
L10N.put('myhabbo.discussion.error.topic_name_empty', 'Topic title may not be empty');
Discussions.initialize('<?php echo $groupid; ?>', 'forum.php', null);
</script>
</div>
</div>
</div>
</td>
<td style="width: 4px;"></td>
<td valign="top" style="width: 164px;">
<div class="habblet"></div>
</td>
</tr>
</table>
</div>
</div>
<script type="text/javascript">
Event.observe(window, 'load', observeAnim);
document.observe('dom:loaded', initDraggableDialogs);
</script>
</div>
<div id="footer">
<p>
<a href="<?php echo $path; ?>index.php" target="_self">Homepage</a> |
<a href="<?php echo $path; ?>disclaimer.php" target="_self">Terms of Service</a> |
<a href="<?php echo $path; ?>privacy.php" target="_self">Privacy Policy</a>
</p>
<?php /*@@* DO NOT EDIT OR REMOVE THE LINE BELOW WHATSOEVER! *@@*/ ?>
<p>
Powered by <a href="https://github.com/MiguelGonzalezAravena/HoloCMS" target="_blank">HoloCMS</a> © 2016 Miguel González Aravena.<br />
</p>
<?php /*@@* DO NOT EDIT OR REMOVE THE LINE ABOVE WHATSOEVER! *@@*/ ?>
</div>
</div>
</div>
<div class="cbb topdialog black" id="dialog-group-settings">
<div class="box-tabs-container">
<ul class="box-tabs">
<li class="selected" id="group-settings-link-group"><a href="#">Groepsinstellingen</a><span class="tab-spacer"></span></li>
<li id="group-settings-link-forum"><a href="#">Foruminstellingen</a><span class="tab-spacer"></span></li>
<li id="group-settings-link-room"><a href="#">Kamersettings</a><span class="tab-spacer"></span></li>
</ul>
</div>
<a class="topdialog-exit" href="#" id="dialog-group-settings-exit">X</a>
<div class="topdialog-body" id="dialog-group-settings-body">
<p style="text-align:center"><img src="<?php echo $web_gallery; ?>images/progress_bubbles.gif" alt="" width="29" height="6" /></p>
</div>
</div>
<script language="JavaScript" type="text/javascript">
Event.observe('dialog-group-settings-exit', 'click', function(e) {
Event.stop(e);
closeGroupSettings();
}, false);
</script>
<div class="cbb topdialog" id="postentry-verifyemail-dialog">
<h2 class="title dialog-handle">Bevestig e-mailadres</h2>
<a class="topdialog-exit" href="#" id="postentry-verifyemail-dialog-exit">X</a>
<div class="topdialog-body" id="postentry-verifyemail-dialog-body">
<p>Je moet je mailadres invullen voor je een reactie kunt plaatsen.</p>
<p><a href="<?php echo $path; ?>profile.php?tab=3">Activeer je mailadres</a></p>
<p class="clearfix">
<a href="#" id="postentry-verifyemail-ok" class="new-button"><b>OK</b><i></i></a>
</p>
</div>
</div>
<script type="text/javascript">
HabboView.run();
</script>
</body>
</html>
<?php
} else {
$pagename = 'Page not found';
require_once(dirname(__FILE__) . '/templates/community/subheader.php');
require_once(dirname(__FILE__) . '/templates/community/header.php');
?>
<div id="container">
<div id="content" style="position: relative" class="clearfix">
<div id="column1" class="column">
<div class="habblet-container">
<div class="cbb clearfix red">
<h2 class="title">Page not found!</h2>
<div id="notfound-content" class="box-content">
<p class="error-text">Sorry, but the page you were looking for was not found.</p>
<img id="error-image" src="<?php echo $web_gallery; ?>v2/images/error.gif" />
<p class="error-text">Please use the 'Back' button to get back to where you started.</p>
<p class="error-text"><b>Search for group</b></p>
<?php echo (!empty($searchString) ? '<p class="error-text">Sorry, but no results were found for <strong>\'' . $searchString . '\'.</strong></p>' : ''); ?>
<p class="error-text">
<form method="post">
Group Name:<br />
<input type="text" name="searchString" maxlength="25" size="25" value="<?php echo $searchString; ?>">
<input type="submit" class="submit" value="Submit">
</form>
</p>
</div>
</div>
</div>
<script type="text/javascript">
if(!$(document.body).hasClassName('process-template')) {
Rounder.init();
}
</script>
</div>
<div id="column2" class="column">
<div class="habblet-container">
<div class="cbb clearfix green">
<h2 class="title">Were you looking for...</h2>
<div id="notfound-looking-for" class="box-content">
<p>
<b>A friend's group or personal page?</b><br />
See if it is listed on the <a href="<?php echo $path; ?>community.php">Community</a> page.
</p>
<p>
<b>Rooms that rock?</b><br />
Browse the <a href="<?php echo $path; ?>community.php">Recommended Rooms</a> list.
</p>
<p>
<b>What other users are in to?</b><br />
Check out the <a href="<?php echo $path; ?>tags.php">Top Tags</a> list.
</p>
<p>
<b>How to get Credits?</b><br />
Have a look at the <a href="<?php echo $path; ?>credits.php">Credits</a> page.
</p>
</div>
</div>
</div>
<script type="text/javascript">
if(!$(document.body).hasClassName('process-template')) {
Rounder.init();
}
</script>
</div>
<?php
require_once(dirname(__FILE__) . '/templates/community/footer.php');
}
?>