|
Revision 2, 1.3 kB
(checked in by sven, 3 years ago)
|
importing elgg-0.1.1a
|
| Line | |
|---|
| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
$username = $_SESSION['username']; |
|---|
| 4 |
|
|---|
| 5 |
$post = db_query("select * from weblog_posts where ident = " . $parameter); |
|---|
| 6 |
$post = $post[0]; |
|---|
| 7 |
|
|---|
| 8 |
if ($post->owner != $_SESSION['userid']) { |
|---|
| 9 |
exit(); |
|---|
| 10 |
} |
|---|
| 11 |
|
|---|
| 12 |
$body = <<< END |
|---|
| 13 |
|
|---|
| 14 |
<form method="post" name="elggform" action="/{$username}/weblog/{$post->ident}.html" onsubmit="return submitForm();"> |
|---|
| 15 |
|
|---|
| 16 |
<h2>Edit a post</h2> |
|---|
| 17 |
<p> |
|---|
| 18 |
Post title:<br /> |
|---|
| 19 |
END; |
|---|
| 20 |
|
|---|
| 21 |
$body .= run("display:input_field",array("edit_weblog_title",stripslashes($post->title),"text")); |
|---|
| 22 |
$body .= <<< END |
|---|
| 23 |
|
|---|
| 24 |
</p> |
|---|
| 25 |
|
|---|
| 26 |
<p>Post body:<br /> |
|---|
| 27 |
END; |
|---|
| 28 |
|
|---|
| 29 |
$body .= run("display:input_field",array("new_weblog_post",stripslashes($post->body),"longtext")); |
|---|
| 30 |
|
|---|
| 31 |
$body .= <<< END |
|---|
| 32 |
</p> |
|---|
| 33 |
<p> |
|---|
| 34 |
Keywords:<br /> |
|---|
| 35 |
END; |
|---|
| 36 |
$body .= run("display:input_field",array("edit_weblog_keywords","","keywords","weblog",$post->ident)); |
|---|
| 37 |
$body .= <<< END |
|---|
| 38 |
</p> |
|---|
| 39 |
<p> |
|---|
| 40 |
Access restrictions:<br /> |
|---|
| 41 |
|
|---|
| 42 |
END; |
|---|
| 43 |
|
|---|
| 44 |
$body .= run("display:access_level_select",array("edit_weblog_access",$post->access)); |
|---|
| 45 |
$body .= <<< END |
|---|
| 46 |
</p> |
|---|
| 47 |
END; |
|---|
| 48 |
$body .= run("weblogs:posts:add:fields",$_SESSION['userid']); |
|---|
| 49 |
$body .= <<< END |
|---|
| 50 |
<p> |
|---|
| 51 |
<input type="hidden" name="action" value="weblogs:post:edit" /> |
|---|
| 52 |
<input type="hidden" name="edit_weblog_post_id" value="{$post->ident}" /> |
|---|
| 53 |
<input type="submit" value="Save Post" /> |
|---|
| 54 |
</p> |
|---|
| 55 |
|
|---|
| 56 |
</form> |
|---|
| 57 |
END; |
|---|
| 58 |
|
|---|
| 59 |
$run_result .= $body; |
|---|
| 60 |
|
|---|
| 61 |
?> |
|---|