| 482 | | ?> |
| 483 | | <a name="comment<?php echo $comment_id; ?>"></a> |
| 484 | | <div class="log_comment_head"> |
| 485 | | <span class="log_comment_subject"> |
| 486 | | <h1 class="log_comment_h1"><?php echo $comment["title"]; ?></h1> |
| 487 | | </span> |
| 488 | | </div> |
| 489 | | <div class="log_comment_body"> |
| 490 | | <?php echo $comment["comment"]; |
| 491 | | ?> |
| 492 | | </div> |
| 493 | | <div class="log_comment_foot"> |
| 494 | | <span class="log_comment_author"> |
| 495 | | <?php |
| 496 | | echo gettext("posted by").": ".$comment["name"]; |
| 497 | | if ($comment["ip"]) |
| 498 | | echo " (".$comment["ip"].") "; |
| 499 | | echo gettext("on").": ".$comment["hdate"]; |
| 500 | | ?> |
| 501 | | </span> |
| 502 | | |
| 503 | | <?php if ($comment["email"]) { ?> |
| 504 | | <br /><span class="log_comment_email"><a href="mailto:<?php echo $comment["email"]; ?>"><?php echo $comment["email"]; ?></a></span> |
| 505 | | <?php } ?> |
| 506 | | <?php if ($comment["website"] && $comment["website"] != "http://") { ?> |
| 507 | | <span class="log_comment_website"><a href="<?php echo $comment["website"]; ?>"><?php echo $comment["website"]; ?></a></span> |
| 508 | | <?php } ?> |
| 509 | | </div> |
| 510 | | <?php |
| | 482 | echo $this->show_comment($comment); |
| | 576 | <script type="text/javascript" language="Javascript1.2" src="common/js/xmlhttp.js"></script> |
| | 577 | <script type="text/javascript" language="Javascript1.2"> |
| | 578 | function previewComment() { |
| | 579 | var commentform = document.getElementById('commentform'); |
| | 580 | var title = escape(commentform.comment_title.value); |
| | 581 | var comment = escape(commentform.comment_content.value); |
| | 582 | var name = escape(commentform.comment_author.value); |
| | 583 | var email = escape(commentform.comment_email.value); |
| | 584 | var website = escape(commentform.comment_url.value); |
| | 585 | var previewurl = 'common/previewcomment.php?action=show_comment_preview&title=' + title + '&comment=' + comment + '&name=' + name + '&email=' + email + '&website=' + website; |
| | 586 | document.getElementById('commentpreviewdiv').innerHTML = loadXMLContent(previewurl); |
| | 587 | document.getElementById('commentpreviewdiv').style.visibility='visible'; |
| | 588 | } |
| | 589 | </script> |
| | 590 | <input type="button" onclick="javascript: previewComment();" value="<?php echo gettext("preview comment"); ?>" /> |
| | 599 | } |
| | 600 | /* }}} */ |
| | 601 | /* show_comment {{{ */ |
| | 602 | /** |
| | 603 | * Format the output for a comment. |
| | 604 | * |
| | 605 | * @param array $commentdata The data for this comment |
| | 606 | */ |
| | 607 | public function show_comment($commentdata) { |
| | 608 | $output =""; |
| | 609 | $output .= "<div class=\"log_comment_head\">\n"; |
| | 610 | $output .= "\t<span class=\"log_comment_subject\">\n"; |
| | 611 | $output .= "\t\t<h1 class=\"log_comment_h1\">".$commentdata["title"]."</h1>\n"; |
| | 612 | $output .= "\t</span>\n"; |
| | 613 | $output .= "</div>\n"; |
| | 614 | $output .= "<div class=\"log_comment_body\">\n"; |
| | 615 | $output .= "\t".$commentdata["comment"]."\n"; |
| | 616 | $output .= "</div>\n"; |
| | 617 | $output .= "<div class=\"log_comment_foot\">\n"; |
| | 618 | $output .= "\t<span class=\"log_comment_author\">\n"; |
| | 619 | $output .= "\t\t".gettext("posted by").": ".$commentdata["name"]; |
| | 620 | if ($commentdata["ip"]) |
| | 621 | $output .= " (".$commentdata["ip"].") "; |
| | 622 | if (array_key_exists("hdate", $commentdata)) |
| | 623 | $output .= gettext("on").": ".$commentdata["hdate"]."\n"; |
| | 624 | else |
| | 625 | $output .= gettext("on").": ".date("d-m-Y H:i")."\n"; |
| | 626 | $output .= "\t</span>\n"; |
| | 627 | if ($commentdata["email"]) |
| | 628 | $output .= "\t<br /><span class=\"log_comment_email\"><a href=\"mailto:".$commentdata["email"]."\">".$commentdata["email"]."</a></span>\n"; |
| | 629 | if ($commentdata["website"] && $commentdata["website"] != "http://") |
| | 630 | $output .= "\t<span class=\"log_comment_website\"><a href=\"".$commentdata["website"]."\">".$commentdata["website"]."</a></span>\n"; |
| | 631 | $output .= "</div>\n"; |
| | 632 | |
| | 633 | return $output; |