TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

March 29, 2024, 12:34:50 PM

Login with username, password and session length
Members
Stats
  • Total Posts: 195,106
  • Total Topics: 21,213
  • Online today: 358
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 1
  • Guests: 79
  • Total: 80
  • @rjen

JukeBox

Started by borgBOB, September 24, 2005, 07:24:53 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

borgBOB

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

// 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.

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

Before this code:

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

So it looks like this:

// 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:

  // 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:

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:
  // 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

#1
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?

bloc

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

Quote from: Bloc on September 24, 2005, 10: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.

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

WizardHawk

#4
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.

WizardHawk

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

When you add the  );history.go();

To the end of the link, that opens the player in a new window.

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();';

and add this:
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

cant find this:

  // 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

     // 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

Quote from: Salamence on October 16, 2005, 10:45:38 AM
cant find this:

ÂÃ,  // 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

ÂÃ,  ÂÃ,   // 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:
// 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:

// 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