Example #1
0
} else {
    if (isset($_POST['showid'])) {
        $showid = $_POST['showid'];
        $artistid = check_or_insert_artist($_POST['artistname']);
        if ($showid != -1) {
            update_tunes($_POST['songname'], $_POST['tuneid'], $artistid, $_POST['filename'], $_POST['album'], $_POST['time'], $_POST['order']);
        } else {
            update_tunes($_POST['songname'], $_POST['tuneid'], $artistid, $_POST['filename'], $_POST['album'], $_POST['time'], -1);
        }
        tag_mp3($_POST['filename'], $_POST['songname'], $_POST['album'], $_POST['artistname'], $_POST['time']);
        if ($showid == -1) {
            $freetag_options = array('db_user' => 'root', 'db_pass' => '', 'db_host' => 'localhost', 'db_name' => 'tunequeue');
            $freetag = new freetag($freetag_options);
            $freetag->delete_all_object_tags_for_user(1, $_POST['tuneid']);
            if (isset($_POST['tags']) && trim($_POST['tags']) != "") {
                $freetag->tag_object(1, $tuneid, $_POST['tags']);
            }
            header("Location:randomizer.php");
        } else {
            header("Location:create-show.php?showid=" . $showid);
        }
    }
}
if (isset($_GET["remove"])) {
    delete_from_tunes($_GET["id"]);
    $freetag_options = array('db_user' => 'root', 'db_pass' => '', 'db_host' => 'localhost', 'db_name' => 'tunequeue');
    $freetag = new freetag($freetag_options);
    $freetag->delete_all_object_tags_for_user(1, $_GET['id']);
    if ($showid == -1) {
        header("Location:randomizer.php");
    } else {
Example #2
0
 *
 ********************************************************************************/
$ajaxaction = $_REQUEST["ajxaction"];
global $current_user;
global $default_charset;
$crmid = vtlib_purify($_REQUEST["recordid"]);
$module = vtlib_purify($_REQUEST["module"]);
$userid = $current_user->id;
if ($ajaxaction == "SAVETAG") {
    require_once 'include/freetag/freetag.class.php';
    $tagfields = function_exists(iconv) ? @iconv("UTF-8", $default_charset, $_REQUEST['tagfields']) : $_REQUEST['tagfields'];
    $tagfields = str_replace(array("'", '"'), '', $tagfields);
    if ($tagfields != "") {
        $freetag = new freetag();
        if (isset($_REQUEST["tagfields"]) && trim($_REQUEST["tagfields"]) != "") {
            $freetag->tag_object($userid, $crmid, $tagfields, $module);
            $tagcloud = $freetag->get_tag_cloud_html($module, $userid, $crmid);
            echo $tagcloud;
        }
    } else {
        echo ":#:FAILURE";
    }
} elseif ($ajaxaction == 'GETTAGCLOUD') {
    require_once 'include/freetag/freetag.class.php';
    $freetag = new freetag();
    if (trim($module) != "") {
        $tagcloud = $freetag->get_tag_cloud_html($module, $userid, $crmid);
        echo $tagcloud;
    } else {
        $tagcloud = $freetag->get_tag_cloud_html("", $userid);
        echo $tagcloud;