From 273112695da89b8d0d6ac54a5f4f068969c0bd70 Mon Sep 17 00:00:00 2001 From: Jesse Morgan Date: Tue, 30 Aug 2011 10:32:35 -0700 Subject: Added source information to moderation block on posting pages. (Eventum #33). --- htdocs/postings.php | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'htdocs/postings.php') 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 "
You are moderating this post: "; printf("approve " - . "reject", - $post->getid(), $post->getid()); + . " or reject." + , $post->getid(), $post->getid()); + + // Print Source information + printSourceInfo($post); + echo "

return to moderation

"; echo "
"; @@ -58,6 +62,9 @@ if (isset($_SESSION['currentUser'])) { printf("delete post
" . "reject post", $post->getid(), $post->getid()); + + printSourceInfo($post); + echo ""; } @@ -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("

This post was posted by %s from %s.

", + $post->getEmail(), $source); +} + function errorNotFound() { // Get the 404 page $page = Page::getByUrl('404'); -- cgit v1.2.3