/* Set Playlist ID Number - default is 1 */
/* MP3's using playlist number 99 will play on all blocks... Other mp3 playlist settings are block specific */
$playlist_id = 1;
global $scripturl, $smcFunc, $boardurl;
/* Adjustable parameters */
$width = 800;
$height = 215;
$skin = '0000FF';
$skinType = 5;
$autoplay = 'yes'; /* yes = autoplay, no = manual play */
$columns_settings = array('height', 'width', 'autoplay', 'skin');
$a = check_block_playlist($playlist_id);
if ($a == true)
{
$result = $smcFunc['db_query']('', "SELECT myplaylist, height, width, autoplay, type, skin, skin_type FROM {db_prefix}premiumbeat_settings WHERE (myplaylist = {$playlist_id}) LIMIT 1");
while ($val = $smcFunc['db_fetch_assoc']($result))
{
if ((empty($val['myplaylist'])) || (int)$val['myplaylist'] < 1)
continue;
foreach ($columns_settings as $sets)
{
if (empty($val[$sets]))
$val[$sets] = 0;
}
$autoplay = 'no';
if($val['autoplay'] == 1)
$autoplay = 'yes';
if (!$width)
$width = $val['width'];
if (!$height)
$height = $val['height'];
if (!$skin)
$skin = $val['skin'];
if (!$skinType)
$skinType = $val['skin_type'];
}
$smcFunc['db_free_result']($result);
}
$_SESSION['premiumbeat_bbc'] = false;
$_SESSION['customMusic_checker'] = true;
$_SESSION['premiumbeat_new'] = true;
if($playlist_id < 0) {$playlist_id = 999;}
$_SESSION['playlist_id'] = $playlist_id;
echo'<div id="premiumbeat_player" style="position:relative;margin:auto;text-align:center;"><script type="text/javascript" src="my_music/swfobject.js"></script>
<div id="flashPlayer">
Mp3 Player Malfunction
</div>
<script type="text/javascript">
var so = new SWFObject("my_music/playerMultipleList.swf", "premiumbeat-player", "'.$width.'", "'.$height.'", "9.0.0");
so.addVariable("autoPlay","'.$autoplay.'")
so.addVariable("overColor","'.$skin.'")
so.addVariable("playerSkin", "'.$skinType.'")
so.addVariable("playlistPath","',$scripturl,'?action=customMusic", "SESSION")
so.addParam("bgcolor", "ffffff");
so.useExpressInstall("expressinstall.swf");
so.addVariable("getURL","")
so.write("flashPlayer");
</script></div>';
function check_block_playlist($play)
{
global $smcFunc;
$result2 = $smcFunc['db_query']('', "SELECT myplaylist FROM {db_prefix}premiumbeat_settings WHERE myplaylist = {$play} LIMIT 1");
$result3 = $smcFunc['db_num_rows']($result2);
$smcFunc['db_free_result']($result2);
if ($result3 > 0)
return true;
return false;
}
echo '<script type="text/javascript">
// when the document has loaded, start the premiumbeat player
window.onload = function () {
(function () {
var a = document.getElementById("premiumbeat_player");
if (a) {
// Player has loaded!
}
else {
setTimeout(arguments.callee, 50);
}
}());
};
</script>';
/* Adjustable variables: Set playlist ID + match width & height to the proper playlist settings */
/* Setting the playlist ID# to 0 or 999 will allow this block to use playlist permissions */
$playlist ='0';
$width = '220';
$height = '230';
/* Set $position to false to have the button appear in the block and set block body style accordingly */
/* For $position = false put the following in your body style... text-align:center;vertical-align:middle;overflow:hidden; */
$position = 'fixed';
if ($position == 'fixed')
$style = "position:fixed;top:0px;right:0px;";
else
$style="text-align:center";
$url = 'index.php?action=customMusicPopup;playlist='.$playlist.';';
$icon = '<img src ="http://i272.photobucket.com/albums/jj187/ginger_face/mymusic.gif" style="'.$style.'" />';
/* Do not edit below this line */
echo ' <script type="text/javascript">
<!--
var WindowObjectReference = null;
function PremiumbeatPopup(strURL,strWidth,strHeight)
{
var strOptions="";
var strType = "console";
if (strType=="console") strOptions="resizable,height="+strHeight+",width="+strWidth;
if (strType=="fixed") strOptions="status,height="+strHeight+",width="+strWidth;
if (strType=="elastic") strOptions="toolbar,menubar,scrollbars,resizable,location,height="+strHeight+",width="+strWidth;
WindowObjectReference = window.open(strURL, "newWin", strOptions);
WindowObjectReference.focus();
}
//-->
</script>';
$pop = '<a href="javascript:void(0)" onclick="PremiumbeatPopup(\''.$url.'\',\''.$width.'\',\''.$height.'\')">'.$icon.'</a>';
$_SESSION['premiumbeat_bbc'] = false;
$_SESSION['customMusic_checker'] = true;
$_SESSION['premiumbeat_new'] = true;
echo $pop;
/* Premiumbeat PHP ~ popup block with multiple playlist dropdown option */
/* Edit your image location or make it false not to display it */
$image = false;
// $image = 'http://i272.photobucket.com/albums/jj187/ginger_face/mymusic.gif';
$width = '450';
$height = '230';
$autoplay = 'yes';
$title = 'Select Playlist';
/*
* Set $position to false to have the button appear in the block and set block body style accordingly
* For $position = false put the following in your body style... text-align:center;vertical-align:middle;overflow:hidden;
*/
$position = 'fixed';
/*
* Do not edit below this comment
*/
global $smcFunc, $scripturl, $settings;
$datum = array('myplaylist','title','equip');
$num = 0;
$drop = '';
$_SESSION['premiumbeat_bbc'] = false;
$_SESSION['customMusic_checker'] = true;
$_SESSION['premiumbeat_width'] = $width;
$_SESSION['premiumbeat_height'] = $height;
$_SESSION['premiumbeat_autoplay'] = $autoplay;
$_SESSION['premiumbeat_new'] = true;
if ($position == 'fixed')
$style = "position:fixed;top:0px;right:2px;";
else
$style="text-align:center;";
$result = $smcFunc['db_query']('', "SELECT myplaylist, title, equip
FROM {db_prefix}premiumbeat_settings
WHERE equip > 0");
while ($val = $smcFunc['db_fetch_assoc']($result))
{
foreach ($datum as $data)
$playlists[$num][$data] = $val[$data];
$num++;
}
$smcFunc['db_free_result']($result);
if (empty($playlists))
return false;
foreach ($playlists as $playlist)
$drop .= '<option value="' . $playlist['myplaylist'] . '">' . $playlist['title'] . '</option>';
$playlist = $playlists[0]['myplaylist'];
$Xurl = 'index.php?action=customMusicPopup;playlist=989;playsong=playlist=';
$url = $Xurl . $playlist.';';
if (!$image)
$icon = false;
elseif ($position == 'fixed')
$icon = '<img src ="'.$image.'" alt="" style="position:relative;height:30px;width:59px;float:right;right:2px;" />';
else
$icon = '<span style="display: block;margin-left: auto;margin-right: auto;"><img src ="'.$image.'" alt="" style="position:relative;height:30px;width:59px;" /></span>';
echo '
<script type="text/javascript"><!--
var WindowObjectReference = null;
function PremiumbeatPopup(strURL,strWidth,strHeight)
{
var strOptions="";
var strType = "console";
if (strType=="console") strOptions="resizable,height="+strHeight+",width="+strWidth;
if (strType=="fixed") strOptions="status,height="+strHeight+",width="+strWidth;
if (strType=="elastic") strOptions="toolbar,menubar,scrollbars,resizable,location,height="+strHeight+",width="+strWidth;
WindowObjectReference = window.open(strURL, "newWin", strOptions);
WindowObjectReference.focus();
}
//--></script>';
if ($icon)
$pop = '<a href="javascript:void(0)" onclick="PremiumbeatPopup(\''.$url.'\',\''.$width.'\',\''.$height.'\')">'.$icon.'</a>';
else
$pop = false;
echo '
<ul id="someID" style="list-style-type:none;'.$style.'">
<li>'
, $pop, '<br />
</li>
<li>
<select id="C4" dir="rtl" onchange="PremiumbeatPopup(\''.$Xurl.'\' + this.options[this.selectedIndex].value,\''.$width.'\',\''.$height.'\')">
<option disabled=true value="0" title="tooltip" selected=true>
',$title,'
</option>
',$drop,'
</select>
</li>
</ul>';
Premiumbeat for SMF | - | Underdog (http://askusaquestion.net) | Creative Commons License - Attribution No Derivatives (http://creativecommons.org/licenses/by-nd/3.0/) |
Premiumbeat Flash Music Player | - | Gilles & Francois Arbour (http://premiumbeat.com) | Permission was granted directly from the authors (http://premiumbeat.com) |
jQuery AXuploader | - | Alban Xhaferllari (http://www.albanx.com) | Dual licensed under the MIT or GPL Version 2 licenses (http://jquery.org/license) |
SMF Documentation | - | Skhilled (http://www.docskillz.com/docs/) | GNU Free Documentation License (http://www.gnu.org/copyleft/fdl.html) |
/* Premiumbeat - for SMF */
$txt['customMusic_tabtitle'] = 'Premiumbeat';
$txt['customMusic_tabtitle2'] = 'Premiumbeat MP3 List';
$txt['customMusic_tabtitle3'] = 'Premiumbeat Playlist Settings Menu';
$txt['customMusic_tabtitle4'] = 'Premiumbeat Edit Playlist';
$txt['customMusic_tabtitle5'] = 'Premiumbeat Add/Edit';
$txt['customMusic_tabtitle6'] = 'Configuration';
$txt['customMusic_tabtitle7'] = 'Settings';
$txt['premiumbeat_forum'] = 'Premiumbeat Settings';
$txt['premiumbeat_override'] = 'Override Playlist ID#';
$txt['premiumbeat_file'] = 'Auto Loading Folder';
$txt['premiumbeat_auto'] = 'Auto Playlist ID#';
$txt['premiumbeat_link'] = 'Playlist Permissions';
$txt['premiumbeat_mainlink'] = 'Playlist Link';
$txt['customMusic_tag'] = 'Track number of mp3';
$txt['customMusic_description'] = 'Title of mp3';
$txt['customMusic_enable'] = 'Enable mp3';
$txt['customMusic_text'] = 'Details';
$txt['customMusic_url'] = 'mp3 URL';
$txt['CustomMusic_count'] = 'MP3 ID Number';
$txt['customMusic_type'] = 'Enable Shuffling of mp3 Playlist';
$txt['customMusic_width'] = 'Set overall mp3 Player Width';
$txt['customMusic_height'] = 'Set overall mp3 Player Height';
$txt['customMusic_autoplay'] = 'Enable Autoplay of mp3 Playlist';
$txt['customMusic_skin'] = 'Set skin color code #';
$txt['customMusic_playlist'] = 'Playlist#';
$txt['customMusic_view_playlist'] = 'View Playlist#';
$txt['customMusic_playlist_alt'] = '#';
$txt['customMusic_trackid'] = 'Track#';
$txt['customMusic_mp3id'] = 'Mp3 ID#';
$txt['premiumbeat_enabled'] = 'Enabled';
$txt['premiumbeat_disabled'] = 'Disabled';
$txt['customMusic_enable'] = 'Enable/Disable';
$txt['customMusic_delete'] = 'Delete';
$txt['customMusic_trackname'] = 'Track Name';
$txt['customMusic_submit'] = 'Submit';
$txt['customMusic_help'] = 'Help';
$txt['premiumbeat_settings'] = 'Playlist Settings';
$txt['premiumbeat_edit'] = 'Edit Mp3';
$txt['premiumbeat_browse'] = 'Mp3 Music List';
$txt['customMusic_status'] = 'Status';
$txt['premiumbeat_type'] = 'Playlist Order';
$txt['premiumbeat_asc'] = 'Ascend';
$txt['premiumbeat_shuffle'] = 'Shuffle';
$txt['premiumbeat_return'] = 'MP3 List';
$txt['premiumbeat_height'] = 'Playlist Height';
$txt['premiumbeat_width'] = 'Playlist Width';
$txt['premiumbeat_autoplay'] = 'Playlist Autoplay';
$txt['premiumbeat_edit_list'] = 'Edit Settings For Playlist#';
$txt['premiumbeat_playlist'] = 'Specific Playlist';
$txt['premiumbeat_toggle_autoplay'] = 'Autoplay';
$txt['premiumbeat_toggle_type'] = 'Order';
$txt['premiumbeat_edit_add'] = 'Add New Mp3';
$txt['premiumbeat_playlist_query'] = 'Query Specific Playlist';
$txt['premiumbeat_playlist_edit'] = 'Browse Specific Playlist#';
$txt['premiumbeat_playlist_perm1'] = 'Assigned to membergroup: ';
$txt['premiumbeat_playlist_perm2'] = 'Assign this playlist to membergroups shown below:';
$txt['premiumbeat_help_perm'] = 'Playlist permissions allow specific membergroups access from the forum link.<br />Unassigned membergroups will use the override playlist available from the link.<br />Each membergroup can only be assigned to one playlist.<br />If a user belongs to more than one membergroup, the highest star rated group will apply.<br />For portal php blocks/modules use your portal permissions.<br />';
$txt['premiumbeat_na'] = 'Unassigned';
$txt['premiumbeat_open_perm'] = 'Permission Settings';
$txt['premiumbeat_player'] = 'Mp3 Player';
$txt['premiumbeat_checkall'] = 'Select All';
$txt['premiumbeat_delete_all'] = 'Delete All';
$txt['premiumbeat_bbc_mp3'] = 'Play MP3';
/* Premium Beat - Custom mp3 Player for SMF error message */
$txt['customMusic_check'] = 'You are not permitted to view the mp3 playlist.';
$txt['customMusic_error'] = 'Premiumbeat database error.';
$txt['customMusic_error2'] = 'Playlist not found/specified.';
/* Premiumbeat permission language variables */
$txt['permissiongroup_simple_premiumbeat_perms'] = 'Premiumbeat';
$txt['permissiongroup_premiumbeat_perms'] = 'Premiumbeat';
$txt['permissionname_premiumbeat_config'] = 'Access Premiumbeat Configuration';
$txt['permissionname_premiumbeat_settings'] = 'Access Premiumbeat Forum Settings';
$txt['permissionname_premiumbeat_showlink'] = 'Enable/View Premiumbeat Forum Link';
$txt['permissionname_premiumbeat_showbbc'] = 'Enable/View Premiumbeat BB Code Link';
$txt['permissionhelp_premiumbeat_config'] = 'This will allow the opted usergroup to moderate Premiumbeat Configuration';
$txt['permissionhelp_premiumbeat_settings'] = 'This will allow the opted usergroup to moderate Premiumbeat Forum Settings';
$txt['permissionhelp_premiumbeat_showlink'] = 'This will allow the opted usergroup to view the premiumbeat play link';
$txt['permissionhelp_premiumbeat_showbbc'] = 'This will allow the opted usergroup to view the BB Code play link';
Awesome Work, Underdog. Congratulations and Thanks for sharing.
I was already using the Premium Beat Player, but with the manual playlist edition method (in the same manner as use it on a webpage). I think that the Admin Panel page that you wrote is waaaay better than manual edition of playlist.xml :D
hi,
i'm having a problem with the location of the file - i've pasted in the url (i'm testing it locally), but it's not picking it up. i'v copied the file into the folder already as well.
it installed ok, and i've pasted the code into a simpleportal 'custom php block'. i'm running smf 2.0 rc3 and sp2.3.2
my path is correct i think: C:\AppServ\www\mirrorfoundation\my_music\music\spank_me_baby.mp3
i can't test it on my live site as it's down at the moment.
any ideas? thanks :)
Underdog, may I ask you to add russian translations into your package and change package-info.xml?Code: (install section) [Select]<modification>russian-utf8.xml</modification>
<modification>russian.xml</modification>Code: (uninstall section) [Select]<modification reverse="true">russian-utf8.xml</modification>
<modification reverse="true">russian.xml</modification>
Nice mod. 8)
Anyway to make it so that when a member switches between tabs the music is not interrupted?
my path is correct i think: C:\AppServ\www\mirrorfoundation\my_music\music\spank_me_baby.mp3
Thank for the mod. I have finished add it to my forum, but I don't know how to align the code at the center of the block. Anybody can help me this?
echo '<div class="centertext smalltext">';
/* Put existing block code here */
echo '</div>';
echo '<div style="text-align:center;">';
/* Put existing block code here */
echo '</div>';
heres a question, how bout a streaming audio player?
can this player wiich looks really nice, have the source set to: ie. a shoutcast server?
Thanks for your work on this Underdog.
I installed it, but this is what shows up in my admin panel:
(http://img546.imageshack.us/img546/6666/premiumbeatproblem.jpg)
I'm using SMF 1.1.13 and Simple Portal 2.3.3
[premiumbeat]http://some_site/samplesong1.mp3, http://some_site/samplesong2.mp3, http://some_site/samplesong3.mp3[/premiumbeat]
or
[premiumbeat=http://some_site/samplesong1.mp3, http://some_site/samplesong2.mp3, http://some_site/samplesong3.mp3]Cool Songs!![/premiumbeat]
Nice work Underdog... will check it out tonight.
ive installed this to SMF 1.1.14 but it didnt work. i wanted to uninstall this but its giving an error.
"This package cannot be uninstalled, because there is no uninstaller!
Please contact the mod author for more information."
hope you could help on this.
ive installed this to SMF 1.1.14 but it didnt work. i wanted to uninstall this but its giving an error.
"This package cannot be uninstalled, because there is no uninstaller!
Please contact the mod author for more information."
hope you could help on this.
thanks nob4uask
OK, here the problem. iv installed it and it shows the mp3 player tab on the top. iv put on sample mp3 url. when i click on the tab and try to play the music, it wont. nothings happening. and also with some members, the tab wont show up. even if i have properly made the settings.
i tried it but there is a particular setting that i cant find. would it be possible to ask for the uninstaller for this so i could uninstall it first then try to reinstall it again?
ive already checked it multiple times and this is whats showing
(http://i1210.photobucket.com/albums/cc416/ram_ragz/packages.png)
and if i uninstall it through the installed packages tab, this is what i get
(http://i1210.photobucket.com/albums/cc416/ram_ragz/packages2.png)
Even cebu,
Follow the instructions that underdog gave me about half way down page 5 of the following link.
http://www.simplemachines.org/community/index.php?topic=398381.80
After that, delete the 1.9 in the browse packages.
Check to see if you see it listed in "Installed Packages". If so go to smf/packages/installed.list. Open the "Installed.list" file in an editor and find the Premiumbeat line. There should be one line for each installed package that you have. Delete this line and save it, make sure that you save it as "Installed.list" because the .list file type might not be listed. Re-upload the file and that should be it.
Re-upload the 1.9 package and install it.
Hope this helps.