Login  |  Register
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome, Guest. Please login or register.
Did you miss your activation email?

August 19, 2022, 05:00:14 AM

Login with username, password and session length
Members
  • Total Members: 3843
  • Latest: Tricky
Stats
  • Total Posts: 193479
  • Total Topics: 21088
  • Online today: 51
  • Online ever: 1035
  • (November 26, 2020, 04:45:12 AM)
Users Online
Users: 1
Guests: 39
Total: 40

Author Topic: JukeBox  (Read 35339 times)

0 Members and 1 Guest are viewing this topic.

borgBOB

  • Guest
JukeBox
« on: September 24, 2005, 12:24:53 PM »
I have a Jukebox on my sight, and Here is the link to download it.

1)  In your browser, go to this address http://osplayer.counteractdesign.com
Select 'DOWNLOAD" from the menu on the left.

Click on " osPlayer Stand alone"  then "osplayer_standalone_v2.0b" to start the download.  Save it to your hard drive, I suggest a new folder named
'osPlayer' in My Documents, or as a new folder  with the same name in your SMF Folder to keep things together.

After downloading, select open folder option. then Right click on the osplayer .zip file and extract it to a file with the same name. Open that folder and go to 'files'

Now open your Cpanel, File Manager; or FTP program and create a new folder in the same folder you installed SMF in.  If that's 'forum' go there. Name the new folder "osPlayer". This must be exact, or the links/paths set in the file modifications will not work.
 Upload all the files you unzipped from osPlayer Stand alone > 'files' to this folder.

2)  Now go to http://www.bloczone.net/button-generator/helios.php and make a button for your jukebox.

right click and save the file to your hard drive in the 'osPlayer' folder you created above.

FTP that image into your /Themes/default/images/english folder, and the /images/english folders of and other themes it fits in. If you only use helios, then it's /Themes/helios/images/english.

If you use other themes, you can use bloc's button generator to make different styles, just add them to the matching /images/english folders.


3)  In index.template.php; located in the /Themes/default/ folder; Make these modifications. Open it in ConTEXT.

Down load the file from the install package, or unzip it to your hard drive in a folder called SMF or something like that. Or take it via FTP right off your web server.

Find this

Code: [Select]
// Show the menu up top.  Something like [home] [help] [profile] [logout]...
function template_menu()
{
        global $context, $settings, $options, $scripturl, $txt;

Insert this right after that line, on a new line.

Code: [Select]
$playerurl = 'javascript:window.open(\'http://www.site url/FORUM FOLDER NAME/osPlayer/osplayer.html\', \'osplayer\', \'width=193,height=265\');history.go();';
Before this code:

Code: [Select]
// Show the [home] and [help] buttons.
So it looks like this:

Code: [Select]
// Show the menu up top.  Something like [home] [help] [profile] [logout]...
function template_menu()
{
        global $context, $settings, $options, $scripturl, $txt;

  $playerurl = 'javascript:window.open(\'http://www.forum url/FORUM FOLDER NAME//osPlayer/osplayer.html\', \'osplayer\', \'width=193,height=265\');history.go();';

  // Show the [home] and [help] buttons.


Decide where you want the button to appear.  I added mine after the help button

Find this:

Code: [Select]
  // Show the [home] and [help] buttons.

        echo '<td><a href="', $scripturl, '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/home.gif" alt="' . $txt[103] . '" style="margin: 0px 0;" border="0" />' : $txt[103]), '</a></td>';
        echo '<td><a href="', $scripturl, '?action=help" target="_blank">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/help.gif" alt="' . $txt[119] . '" style="margin: 0px 0;" border="0" />' : $txt[119]), '</a></td>';
.

And insert this after:

Code: [Select]
echo '<td><a href="', $playerurl, '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/jukebox.gif" alt="Jukebox" style="margin: 0px 0;" border="0" />' : Jukebox), '</a></td>';


So it looks like this:
Code: [Select]
  // Show the [home] and [help] buttons.

        echo '<td><a href="', $scripturl, '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/home.gif" alt="' . $txt[103] . '" style="margin: 0px 0;" border="0" />' : $txt[103]), '</a></td>';
        echo '<td><a href="', $scripturl, '?action=help" target="_blank">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/help.gif" alt="' . $txt[119] . '" style="margin: 0px 0;" border="0" />' : $txt[119]), '</a></td>';
        echo '<td><a href="', $playerurl, '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/jukebox.gif" alt="Jukebox" style="margin: 0px 0;" border="0" />' : Jukebox), '</a></td>';

        // How about the [search] button?

Note: Replace ' FORUM FOLDER NAME ' in the above code boxes to match your path.  If 'forum' is the file you
installed SMF in, then replace with"forum".

Note: Also keep the www in your path

Save this file in ConTEXT, and Upload. via FTP, your modified index.template.php file.

NOTES:

A)  You may have to check if your server supports the .swf mime type. Do this from cpanel.

Look for " application/x-shockwave-flash swf  "

B)  This coding will open the player in a new , non-re-sizable window.

C)  Upload your .mp3 music files to the "osPlayer" folder on your web server.

D) You can save an unmodified copy of 'index.template.php in your osPlayer Stand alone folder to easily uninstall this mod.

borgBOB

  • Guest
Re: JukeBox
« Reply #1 on: September 24, 2005, 12:51:33 PM »
Just a side note, I would like to add a $txt value for "JUKEBOX" in the button link. But I am Not sure which file to add it to.

This is how it's done for "Home" > home.gif" alt="' . $txt[103]

Anyone have an answer, I attempted to search SMF's site, but don't know what this is called. and a search for " $txt " did nothing.

 :uglystupid2:EDIT  I found it in index.english.php

But now do I have to have a unique number to all Language files, or just in this file?
« Last Edit: September 24, 2005, 12:55:41 PM by borgBOB »

Offline bloc

  • Founder
  • *
  • Posts: 5229
    • Bloc
Re: JukeBox
« Reply #2 on: September 24, 2005, 03:27:35 PM »
Any extra buttons texts, help texts etc. would go in Modifications.english.php - and use strings instead of numbers to be sure its unique. Like $txt['jukebox'] = 'Jukebox';

i doubt "jukebox" is used elsewhere, but in that event add more to the name.

borgBOB

  • Guest
Re: JukeBox
« Reply #3 on: September 24, 2005, 03:58:24 PM »
Any extra buttons texts, help texts etc. would go in Modifications.english.php - and use strings instead of numbers to be sure its unique. Like $txt['jukebox'] = 'Jukebox';

i doubt "jukebox" is used elsewhere, but in that event add more to the name.

Thanks for the advice.
I will attempt to mod my files, and if that works, mod my post.

WizardHawk

  • Guest
Re: JukeBox
« Reply #4 on: October 06, 2005, 11:57:20 PM »
Might also want to state that people should put one of the dummy index.php files in the osPlayer folder to prevent unwanted access. Otherwise, anyone has full access to downloading the .mp3's you put on your site.

It is always good practice to add index.php to any public html folder. All you need is a blank file with that name and no one can directly access your files.

FYI, from looking at his file structure (told you that you needed index.php lol) it appears that this player shows files in the order of last modified date starting with the oldest file first. It just simply shows the file name so rename your files by artist-song if you want that info on your play list.
« Last Edit: October 07, 2005, 12:01:17 AM by WizardHawk »

WizardHawk

  • Guest
Re: JukeBox
« Reply #5 on: October 15, 2005, 02:07:30 PM »
How would I go about putting the code in a java/html or php block instead of creating a button for it and putting the code in the php files?

What I want to do is have more than one folder on my server with each one having a full copy of the .swf and support files. Each folder would have a different 'playlist' of Mp3's.

I would have a link box (java/html or php) with links that when clicked would open up a non-resizable window from the corresponding folder.

So the menu could read:
Music
80's
90's
Rap

And if they clicked on the 80's it would open the osplayer in the /80s folder. If they clicked 90's it would open the /90s folder etc...

Part of the reason I want to do this from a block is I am going to restrict access to only those in a specific group and I might add several different play lists which would be impracticle for buttons.

I just don't know how to code a 'a href' box to open a new non-resizable window in the fashion of the one in the above code. The exact code used here is fine if it can be adapted to a block.

borgBOB

  • Guest
Re: JukeBox
« Reply #6 on: October 15, 2005, 05:01:31 PM »
When you add the 
Code: [Select]
);history.go();
To the end of the link, that opens the player in a new window.

Code: [Select]
global $context, $settings, $options, $scripturl, $txt;

Code: [Select]
$playerurl = 'javascript:window.open(\'http://www.forum url/FORUM FOLDER NAME//osPlayer/osplayer.html\', \'osplayer\', \'width=193,height=265\');history.go();';
and add this:
Code: [Select]
echo '<td><a href="', $playerurl, '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/jukebox.gif" alt="Jukebox" style="margin: 0px 0;" border="0" />''
I would use a PHP block I think.  Add all three elements above.

To get different playlists just used different paths to each folder.

I have not tried it, but it should work .

Salamence

  • Guest
Re: JukeBox
« Reply #7 on: October 16, 2005, 03:45:38 AM »
cant find this:

Code: [Select]
  // Show the [home] and [help] buttons.

        echo '<td><a href="', $scripturl, '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/home.gif" alt="' . $txt[103] . '" style="margin: 0px 0;" border="0" />' : $txt[103]), '</a></td>';
        echo '<td><a href="', $scripturl, '?action=help" target="_blank">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/help.gif" alt="' . $txt[119] . '" style="margin: 0px 0;" border="0" />' : $txt[119]), '</a></td>';

This is the closest I com to this text

Code: [Select]
     // Show the [home] and [help] buttons.
       echo '<div id="menuarea"><a href="',

$scripturl, '">', ($settings['use_image_buttons']

? '<img src="' . $settings['images_url'] . '/' .

$context['user']['language'] . '/home.gif" alt="'

. $txt[103] . '" style="margin: 2px 0;" border="0"

/>' : $txt[103]), '</a>',


Is that the same?

borgBOB

  • Guest
Re: JukeBox
« Reply #8 on: October 16, 2005, 07:06:13 AM »
cant find this:

Code: [Select]
  // Show the [home] and [help] buttons.

        echo '<td><a href="', $scripturl, '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/home.gif" alt="' . $txt[103] . '" style="margin: 0px 0;" border="0" />' : $txt[103]), '</a></td>';
        echo '<td><a href="', $scripturl, '?action=help" target="_blank">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/help.gif" alt="' . $txt[119] . '" style="margin: 0px 0;" border="0" />' : $txt[119]), '</a></td>';

This is the closest I com to this text

Code: [Select]
     // Show the [home] and [help] buttons.
       echo '<div id="menuarea"><a href="',

$scripturl, '">', ($settings['use_image_buttons']

? '<img src="' . $settings['images_url'] . '/' .

$context['user']['language'] . '/home.gif" alt="'

. $txt[103] . '" style="margin: 2px 0;" border="0"

/>' : $txt[103]), '</a>',


Is that the same?

The code you are looking for is in the default theme index.template.php file.

For SMF v1.1 RC1, it starts at line 438 and looks like this:
Code: [Select]
// Show the menu up top.  Something like [home] [help] [profile] [logout]...
function template_menu()
{
global $context, $settings, $options, $scripturl, $txt;

// Show the [home] and [help] buttons.
echo '
<a href="', $scripturl, '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/home.gif" alt="' . $txt[103] . '" style="margin: 2px 0;" border="0" />' : $txt[103]), '</a>', $context['menu_separator'], '
<a href="', $scripturl, '?action=help" target="_blank">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/help.gif" alt="' . $txt[119] . '" style="margin: 2px 0;" border="0" />' : $txt[119]), '</a>', $context['menu_separator'];

For SMF v 1.0.x look around line 420, look for:

Code: [Select]
// Show the menu up top.  Something like [home] [help] [profile] [logout]...
function template_menu()
{
global $context, $settings, $options, $scripturl, $txt;

// Show the [home] and [help] buttons.

These entries are nearly at the bottom of these files.  If you are moding a custom theme, your mileage may vary. 

It appears you have the correct location, but your text editor may be messing up the format of your file.  Try useing the free ConText editor. It will retain the correct formatting.  Do a search on the internet to find it.

Salamence

  • Guest
Re: JukeBox
« Reply #9 on: October 16, 2005, 07:19:01 AM »
I found it. Thanks