Music

Discussion in 'General Webmaster Support' started by Rad, May 5, 2007.

  1. DDRtists

    DDRtists ɹoʇɐɹǝpoɯ ɹǝdns Staff Member

    Ratings:
    +413 / 0 / -0
    Code:
    <embed src="" id="change" />
    
    
    <script>
    document.getElementById('change').src = "http://somesongurl.com/mysong.mp3";
    </script>
    Not tested.
     
  2. Nigerianrulz

    Nigerianrulz suga suga how'd you get so fly?

    Ratings:
    +197 / 0 / -0
    Im not exactly sure of this but this is what i found to put music on my forum but it should work with others too i think.
    P.S. There are the codes of COLOR blue and stuff to show you where to change stuff so ummm you want to take that off or something if i take it off then you wont know where to put it :p
    Step 1:


    Open Notepad paste the following code into it.


    PHP:
    <center><embed src="[COLOR="Blue"]LINK TO MUSIC FILE HERE[/COLOR]" 
    loop="true" autostart="true" controls="smallconsole" /></center>
    Blue: Change to your music file link

    Step 2:

    Now that same file, go to Save as and save the file "music.html"

    Step 3:

    Upload the "music.html" to a file host

    Step 4:

    Open Notepad paste the following code into it.

    PHP:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd"
    >
    <
    html>
    <
    head>
    <
    title>[COLOR="orange"]SITE NAME[/COLOR]</title>
    </
    head>
    <
    body>
    <
    frameset rows"0%,*" frameborder="no" border="0" framespacing="0">

    <
    frame src="[COLOR="Red"]music.html[/COLOR]" name="topFrame" scrolling="no" noresize >

    <
    frame src="[COLOR="Orange"]http://FORUM NAME.x.forumer.com/index.php?" [/COLOR]name="mainFrame">

    <
    noframes>

    <
    p>Click here for the <a href="[COLOR="orange"]http://FORUM NAME.x.forumer.com/index.php[/COLOR]?">non-frame based version of this site.</a></p>

    </
    noframes>
    </
    frameset>
    </
    body>
    </
    html>
    Red: Replace with the URL to the "music.html" file you uploaded before.
    Orange: Change "FORUM NAME" to your board's name and the "x" to the sever number.


    Step 5:

    Now that same file, go to Save as and save the file "boardname.html"

    Step 6:

    Upload the "boardname.html" to a file host

    Step 7:

    |-- HTML Templates -> Manage HTML -> Global HTML elements -> Board Header (logo, links, etc) Add to top


    PHP:
    <script language='JavaScript' type="text/javascript">
    <!--
    if (! 
    document.referrer.match("[COLOR="Orange"]http://FORUM NAME.x.forumer.com[/COLOR]") ) {
    window.location = [COLOR="Lime"]'boardname.html'[/COLOR];
    }
    //-->
    </script>

    Green: Replace with the URL to the "boardname.html" file you uploaded before.
    Orange: Change "FORUM NAME" to your board's name and the "x" to the sever number.

    Hope this helps
     
  3. Rad

    Rad ...

    Ratings:
    +228 / 0 / -0
    Its... sort of what I was looking for. Just a few things, which im sure you already knew:

    I am not using a host, so I dont need to upload anything
    I do not have forums
    |-- HTML Templates -> Manage HTML -> Global HTML elements -> Board Header (logo, links, etc) Add to top
    I do not have this option at all...

    I dont know HTML/Java whatever else well enough to turn this into something though...

    I successfully crashed firefox several times in a row :)
    Cant get this to work! Gah.

    Heres what I came up with (DOES NOT WORK):

    Code:
    <html>
    <head>
    <title>Test</title>
    <SCRIPT language="JavaScript">
    function doit()
     {
    	document.getElementById('change').src="Sonne.mp3";
     }
    </script>
    </head>
    <body>
    <center><embed src="" type="audio/mpeg" id="change" /></center>
    <BR><BR><BR>
    <a href="#" onclick="doit">Click here</a>
    
    </body></html>
    Note Sonne.mp3 was in the same folder as this file

    any suggestions?
     
  4. mase

    mase ____ ___ ____ __

    Ratings:
    +155 / 0 / -0
    Ok, well the embed is being gay for me, so I'm just going to use flash.
    I'm going to do
    HTML:
    function(msrc){
    parent.mp.document.location = 'loadsong.php?sl=' + msrc;
    }
    
    and for the msrc you can use any link to a song so I'll be using something like that to list the songs.
    then the flash will load the songs.

    -Edit-

    Also here is my code if you want to see it. (Don't have loadsong.php done or even started lol just an idea)
    Its rather messy but once I get it done it will be nice.
    test.html
    HTML:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Untitled Document</title>
    </head>
    
    <frameset rows="*,80" frameborder="no" border="0" framespacing="0">
      <frame src="html1.html" name="mainFrame" id="mainFrame" title="mainFrame" />
      <frame src="mp.html" name="mp" scrolling="No" noresize="noresize" id="mp" title="" />
    </frameset>
    <noframes><body>
    </body>
    </noframes></html>
    
    mp.html
    HTML:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Untitled Document</title>
    </head>
    
    <body>
    <div name="mtxt" id="mtxt"></div>
    <embed src="" width="25" volume="100" height="25" hspace="0" vspace="0" autostart="true" loop="false" id="music" name="music" border="0"></embed>
    
    </body>
    </html>
    
    html1.html
    HTML:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Untitled Document</title>
    </head>
    <script type="text/javascript">
    function changeSong(msrc){
    	alert(msrc);
    	parent.mp.document.location = "loadsong.php?sl=" + msrc;
    }
    </script>
    
    <body>
    <a href="javascript:void()" onclick="javascript:changeSong('test.mp3');">Test</a>
    </body>
    </html>
    
     
  5. Persen

    Persen Guest

    Ratings:
    +0 / 0 / -0
    Well I've been away for a while but it seems like mase got it all together:D
     
  6. Rad

    Rad ...

    Ratings:
    +228 / 0 / -0
    Mase do those 3 pages function at all (without the loadsong.php)?

    I tried it a few days ago but couldnt figure it out
     
  7. mase

    mase ____ ___ ____ __

    Ratings:
    +155 / 0 / -0
    At all what? Work?
    Yes they do work. I tested it by changing the loadsong.php? to http://mase.110mb.com and the bottom frame relocated ;)
     
  8. mase

    mase ____ ___ ____ __

    Ratings:
    +155 / 0 / -0
    Lol, I found an even better way! I realized that flash can't get URI... So I just set the embed src to the uri using php ;)
    So far it changes the source of the embed, but since 110mb.com doesn't allow uploads > 2mb for now I haven't really tested it.

    -Edit-

    Current progress:
    http://mase.110mb.com/flashtest/atest.html
     
  9. Rad

    Rad ...

    Ratings:
    +228 / 0 / -0
    Will this work if the links are in the frame, and the object is in the main window?
     
  10. mase

    mase ____ ___ ____ __

    Ratings:
    +155 / 0 / -0
    The links are in the main window, the music player is on the bottom frame. Now I just need to list all of the songs in a directory on your host :D
     
  11. Rad

    Rad ...

    Ratings:
    +228 / 0 / -0
    Well, site isnt dedicated so it may or may not be up:

    http://24.22.34.239/

    But the main page has a frame, the frame lists the links... I wanted the player to be in the main window so that it would keep playing while navigating the page, but you could go back and change songs inside the frame...

    And you could get to the music simply by the index:
    http://24.22.34.239/Files/Music/
     
  12. mase

    mase ____ ___ ____ __

    Ratings:
    +155 / 0 / -0
    Ok, well we got the files up and ready, but Rad and I don't know how to get the server's PHP to work... Help!?
     
  13. Persen

    Persen Guest

    Ratings:
    +0 / 0 / -0
    Will do:D
    Server software, first of all.
    second, is PHP installed (correctly)?
     
  14. Rad

    Rad ...

    Ratings:
    +228 / 0 / -0
    "PHP" must be installed? how? im using apache to host the server
     
  15. Persen

    Persen Guest

    Ratings:
    +0 / 0 / -0
    You need to install PHP to use it. Think of PHP as an addon to apache:D
    php.net... Download and follow the instructions. Sometimes a bit tricky to get to work, however.
     
  16. mase

    mase ____ ___ ____ __

    Ratings:
    +155 / 0 / -0
  17. Rad

    Rad ...

    Ratings:
    +228 / 0 / -0
    lol yeah now im like totally lost i dont think its working ... why do i need MySQL?
     
  18. mase

    mase ____ ___ ____ __

    Ratings:
    +155 / 0 / -0
    For a databases ><
     
  19. Rad

    Rad ...

    Ratings:
    +228 / 0 / -0
    I really dont understand though why do I need to set up a database? Unless its to organize the music or something..?

    Not really sure what it is never used one before
     
  20. mase

    mase ____ ___ ____ __

    Ratings:
    +155 / 0 / -0
    You don't need but its smart to get it. If you are going to have forums, a user system, or a comment/news system(s) then a database is recommended.
     

Share This Page