$password = getPassword(); $response = getDatabases($email, $password); if (isOK($response)) { printDatabasesResult($response, "GETTING CVS DBs FAILED", " ---- GETTING CVS DBs SUCCESSFULLY COMPLETED ----"); } else { echo $response->getMessage(); } break; case "addApplication": echo "Connecting Application to CVS Database..." . PHP_EOL; $email = getEMail(); $password = getPassword(); $dbName = getDbName(); $appId = getAppId(); if (is_numeric($appId)) { $response = addChannel($email, $password, $dbName, $appId); } else { $response = addApplication($email, $password, $dbName, $appId); } if (isOK($response)) { printResult($response, "CONNECTING APPLICATION TO CVS DB FAILED", " Application {$appId} has been connected to the database {$dbName}." . PHP_EOL . " ---- CONNECTING APPLICATION TO CVS DB SUCCESSFULLY COMPLETED ----"); } else { echo $response->getMessage(); } break; case "deleteApplication": $msg = "Deleting Application ..." . PHP_EOL; echo PHP_EOL . "{$msg}"; $email = getEMail(); $password = getPassword(); $dbName = getDbName();
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"]; addComment($username, $mediaid, $content); } if (!empty($_POST["rate"])) { $score = $_POST["rate"]; rateMedia($mediaid, $username, $score); } } $recommend = recommend($mediaid, 8); $media = viewMedia($mediaid); $comments = getComments($mediaid); if (isset($username) && isset($_GET["subscribe"])) { $subscriber_id = $username; $channel_id = $media['username']; if ($subscriber_id != $channel_id) { addChannel($subscriber_id, $channel_id); } } render("video_template.php", ["media" => $media, "comments" => $comments, "mediaid" => $mediaid, "recommend" => $recommend, "playlists" => $playlists, "Category" => $Category, "Keywords" => $Keywords]); $db->sql_close();
require 'HeaderChannels.php'; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Add Channel</title> </head> <body> <?php if (isset($_POST['submit'])) { if (!empty($_POST['title'])) { $ip = getRealIpAddr(); $p_id = addChannel($_POST["title"]); } else { echo "<script language=\"javascript\" type=\"text/javascript\">"; echo "alert('Channel name cannot be empty!')"; echo "</script>"; } } ?> <div class='form' > <form method="POST" action="" enctype="multipart/form-data"> <br/>Channel Name: <input type='text' class="tb" name='title'/> <input type="submit" class="button" name="submit" value="Create"/> </form> </div>