PremiumBeat Mp3 Player

Started by Chen Zhen, August 30, 2010, 05:20:07 PM

Previous topic - Next topic

Chen Zhen

Quote from: ACAMS on March 22, 2011, 11:26:07 AM
Is it possible to give a member access to the player admin area and not give them admin access to my forum?


Or maybe set up another FTP and give them access there.

With this version ( 1 . 8 ) ...  no.

All the admin templates and source code check if the user is admin or they get booted to the main page.
Plus it needs filters for the mp3 title and url (which I neglected to put in) before adding permissions for this.

I was already thinking someone might request this and it will be added in the next version along with some other new features.


My SMF Mods & Plug-Ins

WebDev

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

ACAMS

GOOD.....I am getting bummed out having to load each MP3 one at a time, and the guys are using an uploader I made to upload their favorite MP3's, so I want to let somebody else do it for a while!


It would be nice if my uploader would put the MP3 in a folder and PremiumBeat Mp3 Player would automatically load it to the playlist!

dzadza

help!
ok - I installed simple portal (no problems there), then I installed this mod - no problems there, either.
now all I get is the "MP3 player malfunction" box, on every browser (opera, firefox, chrome, IE). I checked and re-checked the links - they're fine. I can see that mod is working on other forums - so I must be doing something wrong...

idiot  :-[

dzadza

well, I copied the code from the readme file inside the package, and it's working now

have absolutely no idea what happened there.... ???

Chen Zhen


Updated to version 1.9 with the following changes:

Version 1.9 (Public)
- added forum settings source code + template
- added bbcode to play single mp3 url
- added button/link in forum for a popup
- added auto-load folder with playlist setting
- permissions to moderate configuration and/or settings
- permissions to view/use popup link and/or bbcode
- unique permission settings for forum link
- filters for all user inputs and mysql queries
- added integration hooks for RC5

The player will now work individually with a permission based popup executed from a forum link and/or a php block/module.
There is now an option to auto-load mp3's from a specified local folder and a bbcode that plays a single mp3 url.

My SMF Mods & Plug-Ins

WebDev

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

ACAMS

I updated 1.7 to 1.9 and the damn thing deleted all my mp3's......HUNDREDS of them!
If I ever get my forum restored from back-up.......I have problems I will need help with!


WARNING

SAVE all files before updating!!!!!




I uninstalled 1.7......was I supposed to?

ACAMS

#66
I have most of it sorted out, but my player does not show


http://gametechmods.com/forums/index.php/page,page4106.html


I may have my code wrong
I used this code on my page.




/* 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 ='1';
$width = '800';
$height = '600';


/* 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.';';






/*  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['customMusic_checker'] = true;
echo $pop;





EDIT:


I can't figure out how to make the new player show, nor can I load the playlist.


Also, this image is not in the download.....  /images/admin/custom_music.gif

Chen Zhen

#67
@ACAMS:

When updating from v1.7 (or prior) the installation will copy all the mp3 db entries from your settings table to its own premiumbeat_mp3s table...
I just tested this again and it is working as it should.
Uninstalling your older version was the proper procedure.
Quote
SAVE all files before updating!!!!!
It does not manipulate any mp3 files at all and any you had stored on your server hdd will be untouched.
There is no file named custom_music.gif associated with this modification.

Check Admin -> Premiumbeat -> Configuration to view your mp3 list.. if your mp3's do not show on the mp3 list (they should because I just tested this again!!) and you had them stored on your server hdd you can use Admin -> Premiumbeat -> Settings to adjust your auto-load folder to where you stored all those mp3's and set the appropriate playlist. From that point you can enter one manual entry for the same playlist where the mod will allow settings for it. (Do this only if your mp3 list was void of the original entries of your server hdd (site) stored mp3's)
Adjust your block code with the opted playlist id.

That code you just displayed is for a popup display via a fixed icon from the top right corner but what you have there is incomplete where part of the code is missing. Look at the codes from the first post of this thread and choose which one suits your personal setup.
Your forum had a unique setup where you had a link that opened a separate page that displayed a block I believe.. For that same setup you will need to use the Player visible in the block code for SMF 2 and assign that block for that page.
If you choose playlist 0 or 999 then the playlist will be permission based from the mods configuration menu for membergroups opted from each playlist or you may choose to use a specific playlist.

What playlist # are your mp3's set at?

ie. this is assuming the $playlist_id=1

/* Set Playlist ID Number  - default is 1  */
/* MP3's that use playlist number 1 will play on all blocks... Other playlists are block specific  */

$playlist_id = 1;

global $scripturl, $smcFunc;

/* Adjustable parameters  */
$width = 800;
$height = 600;
$skin = '#FFFFFF';
$autoplay = 'yes';   /*  yes = autoplay,    no = manual play  */

$columns_settings = array('height', 'width', 'autoplay', 'skin');
$a = check_block_playlist($playlist_id);
if ($a == true)
{
$result1 = $smcFunc['db_query']('', "SELECT myplaylist, height, width, autoplay, type, skin FROM {db_prefix}premiumbeat_settings WHERE (myplaylist = {$playlist_id}) LIMIT 1");
while ($val = $smcFunc['db_fetch_assoc']($result1))
{
if ((empty($val['myplaylist']))) {continue;}
if ((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';}
       $width = $val['width'];
                       $height = $val['height'];
                       $skin = '#' . $val['skin'];                       
}
$smcFunc['db_free_result']($result1);

}

$_SESSION['premiumbeat_bbc'] = false;
$_SESSION['customMusic_checker'] = true;
if($playlist_id < 1) {$playlist_id = 1;}
$_SESSION['playlist_id'] = $playlist_id;

echo'<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", "mymovie", "'.$width.'", "'.$height.'", "7", "'.$skin.'");
   so.addVariable("autoPlay","'.$autoplay.'")
   so.addVariable("playlistPath","',$scripturl,'?action=customMusic", "SESSION")
   so.write("flashPlayer");
</script>';

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;
}

My SMF Mods & Plug-Ins

WebDev

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

ACAMS

THANKS for the help, and this great mod.....all is working now.


I guess my host deleted my MP3's thinking they were infringing on copyrights, but I don't know......they are gone.


I love this new thing were they go to the playlist automatically!


THANKS!!!!!

Chen Zhen

#69
Quote from: ACAMS on May 02, 2011, 06:24:50 PM
THANKS for the help, and this great mod.....all is working now.


I guess my host deleted my MP3's thinking they were infringing on copyrights, but I don't know......they are gone.


I love this new thing were they go to the playlist automatically!


THANKS!!!!!

I am glad you like the new feature.

Actually I made a mistake there and better put a warning on the original post to copy any mp3's from that folder.
On uninstall I have it removing the my_music folder altogether which would remove any mp3's stored in there.. I will have to change it to removing specific files I suppose so people do not make that mistake.
My apologies for that as it was overlooked during testing this update.
Perhaps it would be best to use a separate folder to store your mp3's so you do not forget when uninstalling the mod for updating next time.
When you create a separate directory put the file attached to this post into it.. it will stop people from browsing your mp3's.





My SMF Mods & Plug-Ins

WebDev

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

ACAMS

OK, Thanks, I guess I need to keep everybody out of my music folder.


THANKS AGAIN!

ACAMS

OK, I am about to go nuts trying to figure out how to make it have 3 autoloading playlists.


I created 3 pages, and can link to 3 players, but need to make them load.


How can I make it have


Auto Playlist ID#1
Auto Playlist ID#2
Auto Playlist ID#3





Is this even possible?

Chen Zhen


I only allowed it to have 1 auto loading folder in version 1.9.
The other folders you want to use will have to be manually added to another playlist in Configuration.

I will consider a multiple auto load folder setting in the next version.

My SMF Mods & Plug-Ins

WebDev

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

ACAMS

So, I should be able to a playlist #2 and make a page in simpleportal with the player and naming the playlist #2 and it should work....right?

If so I am having trouble

Quote from: ACAMS on May 07, 2011, 01:48:11 PM
Link to post in Simple Portal topic

Chen Zhen

Quote from: ACAMS on May 07, 2011, 01:53:57 PM
So, I should be able to a playlist #2 and make a page in simpleportal with the player and naming the playlist #2 and it should work....right?

If so I am having trouble

Quote from: ACAMS on May 07, 2011, 01:48:11 PM
Link to post in Simple Portal topic

Yes but remember that any mp3's assigned to playlist 1 (including the auto-load playlist) will be available on all playlists.
If you only want playlists with specific mp3's not to show on other playlists do not use playlist#1.

My SMF Mods & Plug-Ins

WebDev

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

ACAMS

I am having so damn much trouble getting the pages to do right, I will probably just wait for an update that allows more than one playlist.


Thanks for your efforts!

Chen Zhen

Quote from: ACAMS on May 07, 2011, 03:47:57 PM
I am having so damn much trouble getting the pages to do right, I will probably just wait for an update that allows more than one playlist.


Thanks for your efforts!

You will need to learn how to display different playlists to accomplish what you posted.
It is very simple, set mp3's to the appropriate playlist and the playlist in the block to match what you want displayed.

My SMF Mods & Plug-Ins

WebDev

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

ACAMS

I have that part down, and all seems to work now.
Is there a way to may the title be longer....after it passes 30 spaces it quits displaying the name of the tune.


THANKS for all the help.

Chen Zhen

Quote from: ACAMS on May 07, 2011, 04:31:03 PM
I have that part down, and all seems to work now.
Is there a way to may the title be longer....after it passes 30 spaces it quits displaying the name of the tune.


THANKS for all the help.

File:

Themes / default / CustomMusicEdit.template.php

Find:

echo '<tr><td style="text-align:left">', $txt['customMusic_description'], '</td><td style="text-align:left"><input type="text" name="description" value="'.$context['description'][$track].'" maxlength="30" size="30" /></td></tr><tr><td>&nbsp;</td></tr>';


Change maxlength and size to your desired integer for the maximum variable length to be entered in the description text field.

My SMF Mods & Plug-Ins

WebDev

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

ACAMS

WOOHOOO.....that worked, now all I need is to be able to have autoloading playlist 1,2, and 3




THANKS!


All is working now!

Advertisement: