summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Morgan <jesse@jesterpm.net>2011-08-30 10:32:35 -0700
committerJesse Morgan <jesse@jesterpm.net ; true>2011-08-30 10:32:35 -0700
commit273112695da89b8d0d6ac54a5f4f068969c0bd70 (patch)
tree6b385fce9cac5c3f5faeb30384b8e98cff040d41
parente132d19ab7c8bf565c9b93f7e838a775458c94b2 (diff)
Added source information to moderation block on posting pages. (Eventum #33).
-rw-r--r--htdocs/postings.php30
1 files changed, 28 insertions, 2 deletions
diff --git a/htdocs/postings.php b/htdocs/postings.php
index ec98ddc..15d3d5f 100644
--- a/htdocs/postings.php
+++ b/htdocs/postings.php
@@ -45,8 +45,12 @@ if (isset($_SESSION['currentUser'])) {
// Post waiting for approval...
echo "<div class=\"moderationbox\">You are moderating this post: ";
printf("<a href=\"../moderate/moderate.php?id=%s&action=approve\">approve</a> "
- . "<a href=\"../moderate/moderate.php?id=%s&action=reject\">reject</a>",
- $post->getid(), $post->getid());
+ . " or <a href=\"../moderate/moderate.php?id=%s&action=reject\">reject</a>."
+ , $post->getid(), $post->getid());
+
+ // Print Source information
+ printSourceInfo($post);
+
echo "<p><a href=\"../moderate/index.php\">return to moderation</a></p>";
echo "</div>";
@@ -58,6 +62,9 @@ if (isset($_SESSION['currentUser'])) {
printf("<a href=\"../moderate/moderate.php?id=%s&action=delete\">delete post</a><br />"
. "<a href=\"../moderate/moderate.php?id=%s&action=reject\">reject post</a>",
$post->getid(), $post->getid());
+
+ printSourceInfo($post);
+
echo "</div>";
}
@@ -91,6 +98,25 @@ foreach ($post->getImages() as $imgid) {
require_once "src/footer.inc.php";
+function printSourceInfo($post) {
+ // Print Source information
+ $source = $post->getSource();
+
+ if ($source !== false) {
+ // Get source from source id
+ $sourceObj = Source::getById($source);
+ $source = $sourceObj->getName();
+
+
+ } else {
+ // Get other
+ $source = $post->getOtherSource();
+ }
+
+ printf("<p>This post was posted by %s from %s.</p>",
+ $post->getEmail(), $source);
+}
+
function errorNotFound() {
// Get the 404 page
$page = Page::getByUrl('404');