Пример #1
0
<?php

require_once "resources/core.php";
$activeMenuItem = "Home";
if (isset($_GET['delete']) && $_GET['delete']) {
    $result = delete_song($_GET['delete']);
    if (!$result['success']) {
        $message = array('type' => 'error', 'text' => $result['message'], 'destructs' => true);
    } else {
        $message = array('type' => 'success', 'text' => $result['message'], 'destructs' => true);
    }
}
$query = "SELECT count(*) FROM music";
$areSongs = $db->get_var($query);
include 'resources/templates/head.php';
include 'resources/templates/songs.php';
include 'resources/templates/foot.php';
Пример #2
0
        $_POST['artist'] = stripslashes($_POST['artist']);
        $_POST['title'] = stripslashes($_POST['title']);
    }
    if (rename_song($args['song_key'], $_POST['artist'], $_POST['title'])) {
        echo '{"status":true,"command":"' . $command . '","debug":"","args":{"song_key":"' . $args['song_key'] . '","artist":"' . escape_for_json($_POST['artist']) . '","title":"' . escape_for_json($_POST['title']) . '"}}';
    } else {
        echo '{"status":false,"command":"' . $command . '","debug":""}';
    }
} elseif (!strcmp($command, "reorder")) {
    if (reorder_songs($args)) {
        echo '{"status":true,"command":"' . $command . '","debug":""}';
    } else {
        echo '{"status":false,"command":"' . $command . '","debug":""}';
    }
} elseif (!strcmp($command, "delete")) {
    if (delete_song($_POST['args'])) {
        echo '{"status":true,"command":"' . $command . '","debug":"","args":"' . $_POST['args'] . '"}';
    } else {
        echo '{"status":false,"command":"' . $command . '","debug":""}';
    }
} elseif (!strcmp($command, "bannercaptioncolor")) {
    $prefs_struct = get_opentape_prefs();
    if (get_magic_quotes_gpc()) {
        $_POST['banner'] = stripslashes($_POST['banner']);
        $_POST['caption'] = stripslashes($_POST['caption']);
        $_POST['color'] = stripslashes($_POST['color']);
    }
    $prefs_struct['banner'] = $_POST['banner'];
    $prefs_struct['caption'] = $_POST['caption'];
    $prefs_struct['color'] = $_POST['color'];
    if (write_opentape_prefs($prefs_struct)) {