Plugin Directory

Changeset 477586


Ignore:
Timestamp:
12/19/2011 04:59:09 PM (14 years ago)
Author:
manfer
Message:

Added songlist shortcode and widget

Location:
embed-grooveshark/trunk
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • embed-grooveshark/trunk/embed_grooveshark.php

    r469906 r477586  
    44Plugin URI: http://www.manfersite.tk/embed-grooveshark
    55Description: Add grooveshark songs or playlists to your posts.
    6 Version: 0.1
     6Version: 0.2
    77Author: Fernando San Julián
    88Email: manfer.site@gmail.com
     
    3737require_once('includes/GroovesharkSongWidget.class.php');
    3838require_once('includes/GroovesharkPlaylistWidget.class.php');
     39require_once('includes/GroovesharkSongListWidget.class.php');
    3940load_plugin_textdomain('embed_grooveshark', false, basename( dirname( __FILE__ ) ) . '/languages' );
    4041
  • embed-grooveshark/trunk/includes/GroovesharkShortcode.class.php

    r469887 r477586  
    1313        add_action('init', array(__CLASS__, 'register_script'));
    1414        add_action('wp_footer', array(__CLASS__, 'print_script'));
     15        ini_set("display_errors",1);
     16        error_reporting(E_ALL);
    1517    }
    1618
     
    2426                'swfobject' => 0,
    2527                'autoplay'  => 0,
     28                'random'    => 0,
    2629                'width'     => 250,
    2730                'height'    => 40,
     
    3437        ) );
    3538
    36         if ( ! isset($atts['height'] ) && $type == 'playlist' ) $height = 250;
     39        if ( ! isset($atts['height'] ) && $type != 'song' ) $height = 250;
    3740
    3841        self::$add_js = $swfobject;
     
    4346            $gstype = 'songIDs';
    4447            $theme  = 'style=' . $style;
     48        } elseif ( $type === 'songlist' ) {
     49            $name   = 'asManySongs';
     50            $widget = 'widget.swf';
     51            $gstype = 'songIDs';
     52            $theme  = $skin;
     53            $id     = preg_split( "/[\s,]+/", $id );
     54            if ( $random ) shuffle( $id );
     55            $id     = implode( ",", $id );
    4556        } else {
    4657            $name   = 'gsPlaylist' . $id;
     
    4859            $gstype = 'playlistID';
    4960            $theme  = $skin;
    50             // I thought I read that texturizer filter was not applied to shortcodes
    51             // but it is. So we revert & which code is #038; to & to use in parse_str
    52             parse_str( str_replace("#038;", "&", $skin) );
    5361        }
     62
     63
     64        // I thought I read that texturizer filter was not applied to shortcodes
     65        // but it is. So we revert & which code is #038; to & to use in parse_str
     66        parse_str( str_replace("#038;", "&", $skin) );
    5467
    5568        // It is strange someone wants to add same playlist or song to same page.
  • embed-grooveshark/trunk/readme.txt

    r469906 r477586  
    55Requires at least: 2.9
    66Tested up to: 3.2.1
    7 Stable tag: 0.1
     7Stable tag: 0.2
    88
    99This plugin allows you to embed grooveshark songs and playlists in your posts/pages/widgets with a shortcode.
     
    3737== Installation ==
    38381. Download and unpack the download package.
    39 1. Upload the `embed-grooveshark` folder to the '/wp-content/plugins/' directory.
     391. Upload the `embed-grooveshark` folder to the `/wp-content/plugins/` directory.
    40401. Activate the plugin through the 'Plugins' menu in WordPress.
    41411. You will now have your "grooveshark" shortcode and widgets available.
    4242
    4343= Usage =
    44 * After you install this plugin you can start using the shortcode [grooveshark]
    45 * The available attributes for the shortcode are: type, id, width, height, style, skin, swfobject.
    46 * Use the content of the shortcode as the alternative content to show to visitors that has not flash available.
     44* After you install this plugin you can start using the shortcode `[grooveshark]`.
     45* The available attributes for the shortcode are: `type`, `id`, `width`, `height`, `style`, `skin`, `autoplay`, `swfobject`, `random`.
     46* Use the `content` (text between the start and close tags) of the shortcode as the alternative content to show to visitors that has not flash available.
    4747* For a more in detail tutorial and example on how to use the shortcode visit [Embed Grooveshark Homepage](http://www.manfersite.tk/embed-grooveshark "Embed Grooveshark Wordpress plugin").
    4848* You can use the available Grooveshark Song and Grooveshark Playlist widgets in your sidebars.
     
    5757== Changelog ==
    5858
     59= 0.2 =
     60* Added a new widget to include a list of songs.
     61* Added type songlist to shortcode.
     62
    5963= 0.1 =
    6064* Initial release.
Note: See TracChangeset for help on using the changeset viewer.