forked from RetroAchievements/RAWeb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreatetopic.php
104 lines (81 loc) · 3.07 KB
/
createtopic.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
<?php
require_once('db.inc.php');
if( RA_ReadCookieCredentials( $user, $points, $truePoints, $unreadMessageCount, $permissions, Permissions::Registered ) )
{
if( getAccountDetails( $user, $userDetails ) == FALSE )
{
// Immediate redirect if we cannot validate user! //TBD: pass args?
header( "Location: http://" . AT_HOST . "?e=accountissue" );
exit;
}
}
else
{
// Immediate redirect if we cannot validate cookie! //TBD: pass args?
header( "Location: http://" . AT_HOST . "?e=notloggedin" );
exit;
}
$requestedForumID = seekGet( 'f', 0 );
settype( $requestedForumID, "integer" );
if( $requestedForumID == 0 )
{
header( "location: http://" . AT_HOST . "/forum.php?e=unknownforum" );
exit;
}
if( getForumDetails( $requestedForumID, $forumData ) == FALSE )
{
header( "location: http://" . AT_HOST . "/forum.php?e=unknownforum2" );
exit;
}
//var_dump( $forumData );
$thisForumID = $forumData['ID'];
$thisForumTitle = $forumData['ForumTitle'];
$thisForumDescription = $forumData['ForumDescription'];
$thisCategoryID = $forumData['CategoryID'];
$thisCategoryName = $forumData['CategoryName'];
$pageTitle = "Create topic: $thisForumTitle";
getCookie( $user, $cookieRaw );
$errorCode = seekGET('e');
RenderDocType();
?>
<head>
<?php RenderSharedHeader( $user ); ?>
<?php RenderTitleTag( $pageTitle, $user ); ?>
<?php RenderGoogleTracking(); ?>
</head>
<body>
<?php RenderTitleBar( $user, $points, $truePoints, $unreadMessageCount, $errorCode ); ?>
<?php RenderToolbar( $user, $permissions ); ?>
<div id="mainpage">
<?php RenderRecentForumPostsComponent( 4 ); ?>
<div id="forums" class="left">
<?php
echo "<div class='navpath'>";
echo "<a href='forum.php'>Forum Index</a>";
echo " » <a href='/forum.php?c=$thisCategoryID'>$thisCategoryName</a>";
echo " » <a href='/viewforum.php?f=$thisForumID'>$thisForumTitle</a>";
echo " » <b>Create Topic</b></a>";
echo "</div>";
echo "<h2 class='longheader'>Create Topic: $thisForumTitle</h2>";
echo "<table class='smalltable'>";
echo "<tbody>";
echo "<form action='requestsubmitforumtopic.php' method='post'>";
echo "<input type='hidden' value='$cookieRaw' name='c'></input>";
echo "<input type='hidden' value='$requestedForumID' name='f'></input>";
echo "<tr>" . "<td>Forum:</td><td><input type='text' readonly value='$thisForumTitle'></input></td></tr>";
echo "<tr class='alt'>" . "<td>Author:</td><td><input type='text' readonly value='$user' name='u'></input></td></tr>";
echo "<tr>" . "<td>Title:</td><td><input class='fullwidth' type='text' value='' name='t'></input></td></tr>";
echo "<tr class='alt'>" . "<td>Message:</td><td>";
RenderPHPBBIcons();
echo "<textarea id='commentTextarea' class='fullwidth forum' style='height:160px' rows=5 cols=63 name='p'></textarea></td></tr>";
echo "<tr>" . "<td></td><td class='fullwidth'><input type='submit' value='Submit new topic' SIZE='37'/></td></tr>";
echo "</form>";
echo "</tbody>";
echo "</table>";
?>
<br/>
</div>
</div>
<?php RenderFooter(); ?>
</body>
</html>