Пример #1
0
    }
    if ($adminEmail != "-") {
        // send a notification email to the administrator
        Util::extensionNotification($adminEmail, $parentToUpdate, $episodeToUpdate, $authorName);
        // send a notification email (if applicable) to the author of the parent episode
        $dbStatement = Util::getDbConnection()->prepare("SELECT AuthorNotify, " . "AuthorEmail " . "FROM Episode " . "WHERE EpisodeID = :parentToUpdate");
        $dbStatement->bindParam(":parentToUpdate", $parentToUpdate, PDO::PARAM_INT);
        $dbStatement->execute();
        $row = $dbStatement->fetch(PDO::FETCH_NUM);
        if (!$row) {
            throw new HardStoryException("Problem fetching parent episode row from the database.");
        }
        $tempAuthorNotify = $row[0];
        $tempAuthorEmail = $row[1];
        if ($tempAuthorNotify == "Y") {
            Util::extensionNotification($tempAuthorEmail, $parentToUpdate, $episodeToUpdate, $authorName);
        }
    }
}
if ($command == "EditSave") {
    // if the editor is a user, look up their name for the edit log
    if ($userID != 0) {
        $dbStatement = Util::getDbConnection()->prepare("SELECT UserName FROM User WHERE UserID = :userID");
        $dbStatement->bindParam(":userID", $userID, PDO::PARAM_INT);
        $dbStatement->execute();
        $row = $dbStatement->fetch(PDO::FETCH_NUM);
        if (!$row) {
            throw new HardStoryException("Unable to fetch user row from the database.");
        }
        $userName = $row[0];
    } else {