-
Notifications
You must be signed in to change notification settings - Fork 0
/
postNew.php
60 lines (48 loc) · 1.12 KB
/
postNew.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
<?php
require_once('includes/globals.inc');
if(isset($_GET['projid']))
{
$projid = $_GET['projid'];
$projinfo = getProjInfoFromId($projid);
$name = $projinfo[0];
$owner = $projinfo[1];
escapes('projid', $projid);
escapes('name', $name);
escapes('owner', $owner);
$isNews = isNews($projid);
emitTop('Peanut Butter -> Posts -> New Post', $_SERVER['PHP_SELF']."?projid=$urlprojid");
if($name == '')
{
print('<h3>Project not found.</h3>');
emitBottom();
die();
}
}
else
{
errAndDie('Project not specified.');
}
if($userType == VISITOR)
{
errAndDie('Sorry, visitors may not post.');
}
if($isNews && ($userType != ADMIN && $userType != SITEADMIN))
{
errAndDie('Sorry, only admins may create news posts.');
}
?>
<h2>New Post for: <?php echo $name;?></h2>
<form name="postNew" method="post" action="postSave.php?projid=<?php echo $urlprojid;?>">
<table>
<tr>
<th>Title:</th>
<td><input type="text" size="80" name="title" /></td>
</tr>
<tr>
<th>Text:</th>
<td rowspan="2"><textarea name="text" cols="80" rows="10"></textarea></td>
</tr>
</table>
<input type="submit" value="Add Post" />
</form>
<?php emitBottom();?>