/**
 * The handler for replacing the [jwplayer] shortcode.
 * @param array $atts The parsed attributes.
 * @return string The script to replace the tag.
 */
function jwplayer_handler($atts)
{
    $embedder = file_exists(LongTailFramework::getEmbedderPath());
    $config = "";
    $default = get_option(LONGTAIL_KEY . "default");
    $image = "";
    if (isset($atts["config"]) && LongTailFramework::configExists($atts["config"])) {
        $config = $atts["config"];
    } else {
        if (LongTailFramework::configExists($default)) {
            $config = $default;
        } else {
            unset($atts["config"]);
        }
    }
    LongTailFramework::setConfig($config);
    if (isset($atts["mediaid"])) {
        resolve_media_id($atts);
    }
    if (!array_key_exists("file", $atts)) {
        $atts["file"] = isset($atts["html5_file"]) ? $atts["html5_file"] : "";
    }
    if (empty($image)) {
        $image = isset($atts["image"]) ? $atts["image"] : "";
    }
    if ($embedder) {
        $atts["modes"] = create_mode_block($atts);
    }
    if (isset($atts["playlistid"])) {
        $id = $atts["playlistid"];
        $playlist = "";
        if (is_numeric($id)) {
            $playlist = get_post($id);
        }
        if ($playlist) {
            if ($embedder) {
                $atts["playlist"] = generate_playlist($id);
            } else {
                $atts["file"] = urlencode(get_option('siteurl') . '/' . 'index.php?xspf=true&id=' . $id);
            }
        } else {
            return __("[PLAYLIST not found]", 'jw-player-plugin-for-wordpress');
        }
        unset($atts["playlistid"]);
    }
    $loaded_config = LongTailFramework::getConfigValues(true);
    $atts = array_merge($loaded_config, $atts);
    unset($atts["config"]);
    unset($atts["html5_file"]);
    unset($atts["download_file"]);
    if (is_feed()) {
        $out = '';
        // remove media file from RSS feed
        if (!empty($image)) {
            $width = isset($atts["width"]) ? $atts["width"] : $loaded_config["width"];
            $height = isset($atts["height"]) ? $atts["height"] : $loaded_config["height"];
            $out .= '<br /><img src="' . $image . '" width="' . $width . '" height="' . $height . '" alt="media" /><br />' . "\n";
        }
        return $out;
    }
    return generate_embed_code($atts);
}
Exemple #2
0
        $title = $_GET["sc_name"];
    }
    $title = trim($title);
    $genre = trim($genre);
    add_station($title, $url, $genre);
}
// delete station
if (isset($_GET["del_item_id"])) {
    $id = $_GET["del_item_id"];
    delete_station($id);
    header("Location:app.php#page2");
}
// play folder
if (isset($_GET["play_folder"])) {
    $folder = base64_decode($_GET["play_folder"]);
    generate_playlist($folder);
    $_GET["play_local"] = "playlist.m3u";
    $_GET["play_local_rel"] = 1;
}
?>

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1" />
        <title>
        </title>
        <link rel="stylesheet" href="jquery.mobile-1.1.0.min.css" />
        <link rel="stylesheet" href="my.css" />
        <style>
Exemple #3
0
/**
 * The handler for replacing the [jwplayer] shortcode.
 * @global undefined $wpdb Reference to the WordPress database.
 * @param array $atts The parsed attributes.
 * @return string The script to replace the tag.
 */
function jwplayer_handler($atts)
{
    $version = version_compare(get_option(LONGTAIL_KEY . "version"), "5.3", ">=");
    $embedder = file_exists(LongTailFramework::getEmbedderPath());
    $test = $atts;
    global $wpdb;
    $config = "";
    $default = get_option(LONGTAIL_KEY . "default");
    $image = "";
    if (LongTailFramework::configExists($atts["config"])) {
        $config = $atts["config"];
    } else {
        if (LongTailFramework::configExists($default)) {
            $config = $default;
        } else {
            unset($atts["config"]);
        }
    }
    LongTailFramework::setConfig($config);
    if (isset($atts["mediaid"])) {
        resolve_media_id($atts);
    }
    if (empty($image)) {
        $image = $atts["image"];
    }
    if (isset($atts["playlistid"])) {
        $id = $atts["playlistid"];
        if (is_numeric($id)) {
            $playlist = get_post($id);
        }
        if ($playlist) {
            if ($version && $embedder) {
                $atts["playlist"] = generate_playlist($id);
            } else {
                $atts["file"] = urlencode(get_option('siteurl') . '/' . 'index.php?xspf=true&id=' . $id);
            }
        } else {
            return __("[PLAYLIST not found]");
        }
        unset($atts["playlistid"]);
    }
    $loaded_config = LongTailFramework::getConfigValues();
    if ($loaded_config["wmode"] && !$atts["wmode"]) {
        $atts["wmode"] = $loaded_config["wmode"];
    }
    if (is_feed()) {
        $out = '';
        // remove media file from RSS feed
        if (!empty($image)) {
            $width = isset($atts["width"]) ? $atts["width"] : $loaded_config["width"];
            $height = isset($atts["height"]) ? $atts["height"] : $loaded_config["height"];
            $out .= '<br /><img src="' . $image . '" width="' . $width . '" height="' . $height . '" alt="media" /><br />' . "\n";
        }
        return $out;
    }
    return generate_embed_code($config, $atts);
}