Exemplo n.º 1
0
<?php

// configuration
require_once "../includes/config.php";
require_once "enum.php";
require "../includes/mediaService.php";
require "../includes/searchService.php";
require "../includes/sharingService.php";
require "../includes/interactionService.php";
$db = new mysql_db(SERVER, USERNAME, PASSWORD, DATABASE);
$mediaid = $_GET["id"];
$playlists = array();
if (isset($_SESSION["username"])) {
    $playlists = showPlaylists($_SESSION["username"]);
    $username = $_SESSION["username"];
}
if (isset($username) && isset($_GET["favorite"])) {
    addFavoriteMedia($username, $mediaid);
}
if (isset($username) && isset($_GET["commentid"])) {
    $commentid = $_GET["commentid"];
    rmComment($commentid);
}
if (isset($username) && $_SERVER["REQUEST_METHOD"] == "POST") {
    if (!empty($_POST["playlist"])) {
        foreach ($_POST["playlist"] as $playlistid) {
            addPlaylistMedia($playlistid, $mediaid);
        }
    }
    if (!empty($_POST["comment"])) {
        $content = $_POST["comment"];
Exemplo n.º 2
0
<?php

// configuration
require "../includes/config.php";
require "../includes/mediaService.php";
$db = new mysql_db(SERVER, USERNAME, PASSWORD, DATABASE);
$username = $_SESSION["username"];
if (isset($_POST["playlist"])) {
    $playlistname = $_POST["playlist"];
    addPlaylist($playlistname, $username);
}
$playlists = showPlaylists($username);
render("playlist_template.php", ["title" => "playlist", "playlists" => $playlists]);
$db->sql_close();
?>