Plugin Directory

Changeset 533694


Ignore:
Timestamp:
04/19/2012 08:25:37 PM (14 years ago)
Author:
slowmove
Message:

dirname(FILE) instead of DIR since it did not work everywhere

Location:
spotify-embed-creator/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • spotify-embed-creator/trunk/Admin-pages/Spotify-Search-Page.php

    r532145 r533694  
    22if (is_user_logged_in ()):
    33  // get the plugin base url
    4   $pluginRoot = plugins_url('', __DIR__);
     4  $pluginRoot = plugins_url('', dirname( __FILE__ ));
    55  $sec = new SpotifyEmbedCreator();
    66  wp_enqueue_script('SpotifyEmbedCreator');
     
    6868        var query = jQuery('#artist-search').val();
    6969        console.log("Ska söka artist: " + query);
    70         search_spotify("artist", query);
     70        search_spotify("artist", query, "");
    7171      });
    7272      jQuery('#album-do-search').bind('click', function(event) {
    7373        var query = jQuery('#album-search').val();
    7474        console.log("Ska söka album: " + query);
    75         search_spotify("album", query);
     75        search_spotify("album", query, "");
    7676      });
    7777      jQuery('#song-do-search').bind('click', function(event) {
    7878        var query = jQuery('#song-search').val();
    7979        console.log("Ska söka låt: " + query);
    80         search_spotify("track", query);
     80        search_spotify("track", query, "");
    8181      });   
    8282    }); 
    83     function search_spotify(type, query)
     83    function search_spotify(type, query, path)
    8484    {
    8585        jQuery("#spotify-result-container").html("Searching...");
     
    8888                jQuery.ajax({
    8989                    type: "POST",
    90                     url: "<?php echo $pluginRoot ?>/Api/Spotify-Request-handler.php",
     90                    url: "<?php echo $pluginRoot ?>" + path + "/Api/Spotify-Request-handler.php",
    9191                    async: true,
    9292                    timeout: 50000,
     
    122122                    },
    123123                    error: function(data) {
    124                         console.log("misslyckades");
    125                         alert("Gick dåligt");
     124                      if(data.status == 404)
     125                      {
     126                        alert("Something went wrong with the url (seems to happend on Binero)");
     127                      }
     128                      else
     129                      {
     130                        console.log("misslyckades");
     131                        alert("Something went wrong");
     132                      }
    126133                    }
    127134                });     
  • spotify-embed-creator/trunk/Admin-pages/edit-post-box.php

    r533079 r533694  
    11<?php
    22  // get the plugin base url
    3   $pluginRoot = plugins_url('', __DIR__);
     3  $pluginRoot = plugins_url('', dirname( __FILE__ ));
    44  $sec = new SpotifyEmbedCreator();
    55  wp_enqueue_script('SpotifyEmbedCreator');
     
    6666    var query = jQuery('#artist-search').val();
    6767    console.log("Ska söka artist: " + query);
    68     search_spotify("artist", query);
     68    search_spotify("artist", query, "");
    6969  });
    7070  jQuery('#album-do-search').bind('click', function(event) {
    7171    var query = jQuery('#album-search').val();
    7272    console.log("Ska söka album: " + query);
    73     search_spotify("album", query);
     73    search_spotify("album", query, "");
    7474  });
    7575  jQuery('#song-do-search').bind('click', function(event) {
    7676    var query = jQuery('#song-search').val();
    7777    console.log("Ska söka låt: " + query);
    78     search_spotify("track", query);
     78    search_spotify("track", query, "");
    7979  });   
    8080});
     
    130130                },
    131131                error: function(data) {
    132                     console.log("misslyckades");
    133                     alert("Gick dåligt");
     132                      if(data.status == 404)
     133                      {
     134                        alert("Something went wrong with the url (seems to happend on Binero)");
     135                      }
     136                      else
     137                      {
     138                        console.log("misslyckades");
     139                        alert("Something went wrong");
     140                      }
    134141                }
    135142            });     
  • spotify-embed-creator/trunk/Api/Spotify-Request-handler.php

    r533328 r533694  
    11<?php
    22
    3     require_once(__DIR__ . '/../../../../wp-config.php');       
     3    require_once(dirname( __FILE__ ) . '/../../../../wp-config.php');       
    44
    55    if ( is_user_logged_in() )
     
    3131            }
    3232            // write it as json
     33            //header('HTTP/1.1 404 Page Not Found');
    3334            header('Cache-Control: no-cache, must-revalidate');
    3435            header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
  • spotify-embed-creator/trunk/Readme.txt

    r533328 r533694  
    44Requires at least: 3.0
    55Tested up to: 3.3
    6 Stable tag: 1.0.3
     6Stable tag: 1.0.4
    77
    88Search for Album or Track on Spotify and create a Spotify Play Button.
     
    3535== Changelog ==
    3636
     37= 1.0.4 =
     38* dirname(__FILE__) instead of __DIR__ since it didn't work everywhere
     39
    3740= 1.0.3 =
    3841* Uses file_get_contents() if curl isn't installed
  • spotify-embed-creator/trunk/Spotify-Embed-Creator.php

    r533328 r533694  
    55  Plugin URI: http://slowmove.se/wordpress-plugin-spotify-embed-creator/
    66  Description: Search for Album or Song on Spotify and create a Spotify Play Button
    7   Version: 1.0.3
     7  Version: 1.0.4
    88  Author: Erik Johansson
    99  Author URI: http://slowmove.se
Note: See TracChangeset for help on using the changeset viewer.