Plugin Shoutcast Radio Player (beta)

Discussion in 'Subrion CMS Plugins Discussion' started by olairmarcos, Feb 7, 2013.

  1. olairmarcos

    olairmarcos Member

    Hello friends
    I'm developing a simple plugin to play online radios on site with subrion.
    The plugin is in early development and works perfectly on our test site.
    I am needing help to introduce the player (popup) variables with values ​​previously configured in the admin panel of the site.
    The operation of the plug is as follows:
    The user clicks on the block and a page (popup) opens with the player.
    As this is a popup I can not do the reading of variables from site URL and IP radio. It would be great if you could read the intervals of the variables in the player. So, the plugin could be installed on any site and configured via the control panel.
    If anyone can help me. How can I make the values ​​of variables can be read in the file of the player on the site?
    I have no programming knowledge with SMARTY and would like someone to help me develop this plugin will be available for download on the website.

    My difficulty is to introduce the variables {$config.rplayer_ip} and {$smarty.const.IA_URL} within the file player.html (popup).

    file : install.xml
    Code (Text):
    <?xml version="1.0" encoding="utf-8" ?>
    <plugin name="rplayer">
        <summary>This mod allows you to integrate Shoutcast Radio Player on your website powered by Subrion CMS.</summary>
        <author>Olair Marcos</author>
        <contributor>Olair Marcos</contributor>

        <config group="miscellaneous" name="rplayer_plugin" type="divider" value="rplayer"><![CDATA[ RPlayer ]]></config>
        <config group="miscellaneous" name="rplayer_ip" type="text" description="IP Stream MP3 Radio"></config>
        <config group="miscellaneous" name="rplayer_wpopup" type="text" description="PopUp Width">220</config>
        <config group="miscellaneous" name="rplayer_hpopup" type="text" description="PopUp Height">210</config>

            <block title="Shoutcast RadioPlayer" name="rplayer_block" showheader="1" collapsible="1" position="right" type="smarty" sticky="1">

    <div id="rplayer_popup">
    <p><a href="{$smarty.const.IA_URL}plugins/rplayer/player.html" onclick=",, 'width={$config.rplayer_wpopup}px,height={$config.rplayer_hpopup}px'); return false;" target="popup"><img alt="" border="0" src="{$smarty.const.IA_URL}plugins/rplayer/sound_on.png" />&nbsp;Listen online</a></p>
    I tried this way but it did not work properly. How is the correct way to introduce these variables in the file player.html. I appreciate if someone can help me.

    file: player.html no working.
    Code (Text):
    <img src="{$smarty.const.IA_URL}/plugins/rplayer/img_popup.png"> <br />
    <div id="container"><a href="">Get the Flash Player.</a></div>

    <p><script type="text/javascript" src="{$smarty.const.IA_URL}/plugins/rplayer/swfobject.js"></script><script type="text/javascript">
                    var s1 = new SWFObject("{$smarty.const.IA_URL}/plugins/rplayer/player.swf", "ply", "200", "20", "9", "#FFFFFF");
                    s1.addParam("allowfullscreen", "false");
                    s1.addParam("allowscriptaccess", "always");
                    s1.addParam("flashvars", "file=http://{$config.rplayer_ip}/;stream.nsv&type=mp3&volume=80&autostart=true");
    As I said, the above code does not work correctly when using variables SMARTY. When you typed the URL directly, the player works perfectly. You can see the player running the test site:
    Últimas Notícias WebRadioOne : A número 1 na internet

    To test plugin download the plugin and install normally as the site

    I appreciate if someone can help me finish the project plugin RPlayer.:)

    Attached Files:

    Last edited: Feb 7, 2013
  2. wazza

    wazza Member

    Just installed. Seems to be working fine.

    1 Suggestion though. Nothing to do with functionality. Maybe have the plugin use its on config group?

    I hope im not missing what you are asking.
  3. olairmarcos

    olairmarcos Member

    Hello Wazza,
    Thanks for testing the plugin RPlayer. I developed the plugin to use CMS for a site Subrion Radio Online.
    I do not know how to read the file player.html variables install.xml file. if you know how much I appreciate the help.
    When the file player.html able to read the settings of the plugin file install.xml will be possible to install any radio to listen online. To function properly enough to enter the settings in the control panel. But when the radio settings must be configured manually in the file player.html.

    As for your suggestion, it might be interesting. I'll try to find more to try to improve RPlayer plugin and add more features.

    Thanks for the help.
  4. olairmarcos

    olairmarcos Member

    Plugin RPlayer v1.1
    :: fix to work with multi language.

    Attached Files:

  5. wazza

    wazza Member

    Just use <![CDATA[]]> or <![CDATA[your_ip_here]> (if you want a default ip.

    Last edited: Feb 8, 2013
  6. wazza

    wazza Member

    Sorry looks like you fixed already:D
  7. wazza

    wazza Member

    Noticed you created a player.tpl file.

    If you want to use that tpl file for the block data

    Code (Text):
    <block name="rplayer_block" title="Shoutcast RadioPlayer:" collapsible="1" showheader="1" position="right" type="smarty" sticky="1"

    You will need to move player.tpl to /templates/player.tpl (inside your plugin folder)

    also you may want to move your image(s) to /img (under plugin folder as well)

    Just to keep the structure set by Subrion Team.

    Hope this helps :D


    With the same content as your .html file
    Last edited: Feb 8, 2013
  8. olairmarcos

    olairmarcos Member

    By the time I could not pass the variables to the file install.xml file player.html.
    I tried many ways without success.
    When creating the player with the name player.tpl the system does not open the player. Always appears the site's homepage. I do not understand why.
    With php also does not open. It seems that the system does not allow open external files php, tpl. Only html.

    I do not have enough knowledge about the functioning of the CMS Subrion and also on javascript. If you can help me thank you very much. ShoutcastRadioPlayer The plugin will be very useful for sites created with CMS Subrion.
    The plugin RPlayer1.2 works normally, but you need to edit the INSTALL_SUBRION_URL of the site where it will be installed and the IP:pORT of the Stream. Via administration is not yet possible to enter IP:pORT. Data entered in the administration of the site, does not save the file popup player.html.
    The organization realized the files according to the structure Subrion and is available for download at the site.
    Who knows a way to pass the value of variables install.xml file to file player.html can do to change the script. Please share with us.
    Thanks for the help.:)

    Edit file: /plugins/rplayer/templates/player.html

    IP:pORT =
    INSTALL_SUBRION_URL = - URL SUBRION site installation

    Attached Files:

    Last edited: Feb 13, 2013

Share This Page