|
Revision 2, 1.4 kB
(checked in by sven, 3 years ago)
|
importing elgg-0.1.1a
|
| Line | |
|---|
| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
if (isset($parameter)) { |
|---|
| 4 |
|
|---|
| 5 |
$post = $parameter; |
|---|
| 6 |
|
|---|
| 7 |
$run_result .= <<< END |
|---|
| 8 |
|
|---|
| 9 |
<form action="" method="post"> |
|---|
| 10 |
|
|---|
| 11 |
<h2>Add a comment</h2> |
|---|
| 12 |
|
|---|
| 13 |
END; |
|---|
| 14 |
|
|---|
| 15 |
$field = run("display:input_field",array("new_weblog_comment","","longtext")); |
|---|
| 16 |
if (logged_on) { |
|---|
| 17 |
$userid = $_SESSION['userid']; |
|---|
| 18 |
} else { |
|---|
| 19 |
$userid = -1; |
|---|
| 20 |
} |
|---|
| 21 |
$field .= <<< END |
|---|
| 22 |
|
|---|
| 23 |
<input type="hidden" name="action" value="weblogs:comment:add" /> |
|---|
| 24 |
<input type="hidden" name="post_id" value="{$post->ident}" /> |
|---|
| 25 |
<input type="hidden" name="owner" value="{$userid}" /> |
|---|
| 26 |
|
|---|
| 27 |
END; |
|---|
| 28 |
|
|---|
| 29 |
$run_result .= run("templates:draw", array( |
|---|
| 30 |
|
|---|
| 31 |
'context' => 'databox1', |
|---|
| 32 |
'name' => "Your comment text", |
|---|
| 33 |
'column1' => $field |
|---|
| 34 |
|
|---|
| 35 |
) |
|---|
| 36 |
); |
|---|
| 37 |
|
|---|
| 38 |
if (logged_on) { |
|---|
| 39 |
$comment_name = $_SESSION['name']; |
|---|
| 40 |
} else { |
|---|
| 41 |
$comment_name = "Guest"; |
|---|
| 42 |
} |
|---|
| 43 |
|
|---|
| 44 |
$run_result .= run("templates:draw", array( |
|---|
| 45 |
|
|---|
| 46 |
'context' => 'databox1', |
|---|
| 47 |
'name' => 'Your name', |
|---|
| 48 |
'column1' => "<input type=\"text\" name=\"postedname\" value=\"".htmlentities($comment_name)."\" />" |
|---|
| 49 |
|
|---|
| 50 |
) |
|---|
| 51 |
); |
|---|
| 52 |
|
|---|
| 53 |
$run_result .= run("templates:draw", array( |
|---|
| 54 |
|
|---|
| 55 |
'context' => 'databox1', |
|---|
| 56 |
'name' => ' ', |
|---|
| 57 |
'column1' => "<input type=\"submit\" value=\"Add comment\" />" |
|---|
| 58 |
|
|---|
| 59 |
) |
|---|
| 60 |
); |
|---|
| 61 |
|
|---|
| 62 |
$run_result .= <<< END |
|---|
| 63 |
|
|---|
| 64 |
</form> |
|---|
| 65 |
|
|---|
| 66 |
END; |
|---|
| 67 |
|
|---|
| 68 |
} |
|---|
| 69 |
|
|---|
| 70 |
?> |
|---|