WordPress.org

Support

Support » Plugins and Hacks » HTML5 jQuery Audio Player » Javascript/jQuery problem

Javascript/jQuery problem

  • I was having a problem with the plugin conflicting with another plugin (NextGen Gallery). I emailed handhugsdesign as she had a similar problem and she helped lead me to my solution (thanks again!). Where the problem was at was with the following section of plugin.php:

    function pro_scripts_method() {
    $query = $_SERVER[‘PHP_SELF’];

    wp_deregister_script( ‘hmp-jquery’ );
    wp_register_script( ‘hmp-jquery’, “http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js”);

    wp_deregister_script( ‘drag-jquery’ );
    wp_register_script( ‘drag-jquery’, plugin_dir_url( __FILE__ ).”player/js/jquery-ui-1.7.1.custom.min.js”,true);
    if(strpos($query,’admin.php’)!==false){
    wp_enqueue_script(‘hmp-jquery’);
    wp_enqueue_script( ‘drag-jquery’ );
    }
    wp_register_style( ‘hmp-style’, plugin_dir_url( __FILE__ ).”/includes/css/hmp-style.css”);
    wp_enqueue_style( ‘hmp-style’ );
    }

    add_action(‘admin_enqueue_scripts’, ‘pro_scripts_method’);

    I replaced it with:

    function pro_scripts_method() {
    $query = $_SERVER[‘PHP_SELF’];

    if(strpos($query,’admin.php’)!==false){
    wp_enqueue_script(‘jquery-ui-sortable’);
    }
    wp_register_style( ‘hmp-style’, plugin_dir_url( __FILE__ ).”/includes/css/hmp-style.css”);
    wp_enqueue_style( ‘hmp-style’ );
    }

    add_action(‘admin_enqueue_scripts’, ‘pro_scripts_method’);

    Also I changed the following:

    <link href=”<?php echo $pluginurl ; ?>includes/css/style.css” type=”text/css” rel=”stylesheet” media=”screen” />
    <script type=”text/javascript” src=”http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js”></script>
    <script type=”text/javascript” src=”<?php echo $pluginurl ; ?>includes/jquery-jplayer/jquery.jplayer.js”></script>

    It is now:

    <link href=”<?php echo $pluginurl ; ?>includes/css/style.css” type=”text/css” rel=”stylesheet” media=”screen” />
    <?php require_once ‘includes/ttw-music-player.php’; ?>

    This seems to have solved all my problems.

    http://wordpress.org/extend/plugins/html5-jquery-audio-player/

Viewing 15 replies - 1 through 15 (of 34 total)
Viewing 15 replies - 1 through 15 (of 34 total)
  • The topic ‘Javascript/jQuery problem’ is closed to new replies.
Skip to toolbar