Previous Thread
Next Thread
Print Thread
Rate Thread
#183989 12/29/2004 11:26 PM
Joined: Oct 2002
Posts: 394
Enthusiast
Enthusiast
Offline
Joined: Oct 2002
Posts: 394
I have this code in my Header
Code
 <embed height="1" src="http://www.romanianational.com/ubb/christmas/carols/cvpastori.mid" width="1" EN? 3.2 HTML DTD W3C ?- PUBLIC <!DOCTYPE AUTOSTART="TRUE">  
which plays a Christmas song on the page. Is there a way to make the .mid file change automatically every day without editing the Style Header daily?

Felix

Sponsored Links
#183990 12/30/2004 12:13 AM
Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2
um, upload a different song to that url everyday?


and about the html, how about something like

Code
<embed src="http://www.romanianational.com/ubb/christmas/carols/cvpastori.mid" style="display: none;" autostart="true"></embed>
I doubt it's the right syntax, but it's probably a lot closer than what you have

#183991 12/30/2004 10:46 AM
Joined: Oct 2002
Posts: 394
Enthusiast
Enthusiast
Offline
Joined: Oct 2002
Posts: 394
Yes, your code is much cleaner. Mine was generated by the FrontPage and didnt bother to clean it, why fix it if it works? smile

As far as "upload a different song every day"....I know I have been doing that all along, I was thinking I could set it up to change it by itself..

Thank you,

Felix

#183992 12/30/2004 12:39 PM
Joined: Jun 2001
Posts: 729
Coder
Coder
Offline
Joined: Jun 2001
Posts: 729
Try this...

Code
<SCRIPT LANGUAGE="Javascript"><!--
function sound() {
//Random Sounds
} ; s = new sound() ; n = 0

// - Sound Database -
s[n++]= "Some.wav"
s[n++]= "OrSome.mid"
s[n++]= "Another.wav"
s[n++]= "Again.mid"
s[n++]= "And.wav"
s[n++]= "sound.mid"

i=Math.floor(Math.random() * n) ;

if (navigator.appName.indexOf("Microsoft") != -1){
document.write('<BGSOUND SRC="'+ s[i] +'"> ')
}
else if (navigator.appName.indexOf("Netscape") != -1){
document.write('<EMBED SRC="'+ s[i] +'" HIDDEN=TRUE AUTOSTART=TRUE> ')
}
//--></SCRIPT>

#183993 12/30/2004 8:59 PM
Joined: Oct 2002
Posts: 394
Enthusiast
Enthusiast
Offline
Joined: Oct 2002
Posts: 394
Thank you very much for trying. smile

in
Code
 // - Sound Database - 
what format should the .mid directory be written?

I tried:

I also tried this:

Code
<SCRIPT LANGUAGE="Javascript"><!--
function sound() {
//Random Sounds
} ; s = new sound() ; n = 0

src="http://www.romanianational.com/ubb/christmas/carols/"
s[n++]= "betleem.mid"
s[n++]= "cvapstori.mid"
etc
etc..
none of them work frown

Felix

Sponsored Links
#183994 12/31/2004 4:04 PM
Joined: Jun 2001
Posts: 729
Coder
Coder
Offline
Joined: Jun 2001
Posts: 729
The line:

// - Sound Database -

Is just a remark line and is not intended to imply the need to chnage it.

Just enter the file names in between the quotes on these lines.

s[n++]= "Some.wav"
s[n++]= "OrSome.mid"
s[n++]= "Another.wav"
s[n++]= "Again.mid"
s[n++]= "And.wav"
s[n++]= "sound.mid"

The actual file(s) should reside in the same directory as the file the script is being called from. Although untested you might be able to place the path there as well allowing you to keep the files in their own directory.

#183995 01/01/2005 1:46 PM
Joined: Oct 2002
Posts: 394
Enthusiast
Enthusiast
Offline
Joined: Oct 2002
Posts: 394
I understand. I've already done that. But it still doesnt work. I am not sure which is the directory though, I added this code in the header of the (seasonal) Christmas Style template, therefore I loaded these .mid files in the Templates folder
(
http://romanianational.com/public_html/ubb/Templates/)
Is that correct?

Thank you Steven

#183996 01/01/2005 4:19 PM
Joined: Mar 2001
Posts: 7,394
LK Offline
Admin / Code Breaker
Admin / Code Breaker
Offline
Joined: Mar 2001
Posts: 7,394
I think you have to put the files in both the /cgi-bin (ultimatebb.cgi, for non-topic pages) and /ubb (ultimatebb.php, and also for topic loaded with ultimatebb.cgi) directories.

Note that Steven gave you the code to make it random, not according to the day.

#183997 01/02/2005 2:17 AM
Joined: Oct 2002
Posts: 394
Enthusiast
Enthusiast
Offline
Joined: Oct 2002
Posts: 394
I already tried LK.
I wasnt sure where they're needed and I uploaded them in 3 directories, /ubb, /Templates and /cgi-bin. No music to my ears... frown

Thank you.

#183998 01/04/2005 1:29 PM
Joined: Jun 2001
Posts: 729
Coder
Coder
Offline
Joined: Jun 2001
Posts: 729
Sorry I miss read the inital post on wanting it based on the day of week frown Try this...

Change each document.write line's src= portion for the different songs you wish to play and their location. Also if you want the audio file to play "loop" change to true.

Code
<body>

<script language="JavaScript" type="text/javascript">

s_date = new Date();

if(s_date.getDay() == 1){
document.write('<embed width=0 height=0 hidden="true" autostart="true" volume="5" loop="false" src="AudioFile1.mp3">');
}

if(s_date.getDay() == 2){
document.write('<embed width=0 height=0 hidden="true" autostart="true" volume="5" loop="false" src="AudioFile2.mp3">');
}

if(s_date.getDay() == 3){
document.write('<embed width=0 height=0 hidden="true" autostart="true" volume="5" loop="false" src="AudioFile3.mp3">');
}

if(s_date.getDay() == 4){
document.write('<embed width=0 height=0 hidden="true" autostart="true" volume="5" loop="false" src="AudioFile4.mp3">');
}

if(s_date.getDay() == 5){
document.write('<embed width=0 height=0 hidden="true" autostart="true" volume="5" loop="false" src="AudioFile5.mp3">');
}

if(s_date.getDay() == 6){
document.write('<embed width=0 height=0 hidden="true" autostart="true" volume="5" loop="false" src="AudioFile6.mp3">');
}

if(s_date.getDay() == 7){
document.write('<embed width=0 height=0 hidden="true" autostart="true" volume="5" loop="false" src="AudioFile7.mp3">');
}

if(s_date.getDay() == 0){
document.write('<embed width=0 height=0 hidden="true" autostart="true" volume="5" loop="false" src="AudioFile0.mp3">');
}
</script>

Sponsored Links
#183999 01/05/2005 1:51 AM
Joined: Oct 2002
Posts: 394
Enthusiast
Enthusiast
Offline
Joined: Oct 2002
Posts: 394
Steven, it doesnt matter if they work randomly or by day, as long as they work smile

Right now they dont because I dont know what directory I should load the into. Is it the:

/ubb/
/cgi-bin/
/Templates/ ?

or all?

thank you very much for your effort.

Felix

#184000 01/05/2005 12:08 PM
Joined: Jun 2001
Posts: 729
Coder
Coder
Offline
Joined: Jun 2001
Posts: 729
Are you trying to implement this site wide to your UBB system or jsut a single webpage?

#184001 01/05/2005 4:04 PM
Joined: Oct 2002
Posts: 394
Enthusiast
Enthusiast
Offline
Joined: Oct 2002
Posts: 394
Just the UBB. http://romanianational.com/cgi-bin/ultimatebb.cgi
And just the Summary page will suffice.

Funny think is that it did work a little, and trully "random" indeed, only on the Topic page and on the PM page, can't figure that out because I uploaded (4 songs, true) in each of the above directories.

smile


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Nettomo
Nettomo
Germany, Bremen
Posts: 417
Joined: November 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)