<?PHP
#
#   FILE:  CleanSpam.php
#
#   FUNCTIONS PROVIDED:
#
#   FUNCTIONS EXPECTED:
#       DisplayAddButtons()
#           - display add, delete, cancel buttons
#
#   Part of the Scout Portal Toolkit
#   Copyright 2004 Internet Scout Project
#   http://scout.cs.wisc.edu
#

# ----- EXPORTED FUNCTIONS ---------------------------------------------------

function PrintResourceComments($PosterId, $PosterName, $PosterEmail)
{
    global $DB;

    $Comments = array();
    $DB->Query("SELECT * FROM Messages WHERE PosterId=".$PosterId);
    while ($Row = $DB->FetchRow() )
    {
        $Comments []= $Row;
    }

    # for each comment
    foreach ($Comments as $Comment)
    {
        # print comment
        PrintForumMessage(
            $Comment["Subject"],
            $Comment["Body"],
            $Comment["DatePosted"],
            $PosterName,
            $PosterEmail,
            FALSE,
            NULL,
            NULL,
            NULL,
            TRUE,
            NULL);
    }
}


# ----- LOCAL FUNCTIONS ------------------------------------------------------

# ----- MAIN -----------------------------------------------------------------

$PosterId   = isset($_GET["PosterId"]  ) ? intval($_GET["PosterId"]  ) : -1;
$ResourceId = isset($_GET["ResourceId"]) ? intval($_GET["ResourceId"]) : -1;

$TgtUser = new User ($DB, $PosterId);

$PosterName = $TgtUser->Name();
$PosterEmail = $TgtUser->Get("EMail");

if (CheckAuthorization(PRIV_FORUMADMIN, PRIV_USERADMIN)) {  return;  }

PageTitle("Preview Message");
