Welcome, Guest. Please login or register.
Did you miss your activation email?
May 25, 2012, 04:33:24 PM

Login with username, password and session length
Search:     Advanced search
Wollen Sie dem WebsiteBaker Team beitreten?
Nähere Informationen finden Sie unter hier und auf unserer neuen Webseite.
155511 Posts in 21712 Topics by 7738 Members
Latest Member: chris85
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: load a sound once at 1 page  (Read 786 times)
Ogierini

Offline Offline

Posts: 276



WWW
« on: August 21, 2009, 07:56:06 PM »

Hi therem,


Is ther e a script available for this?

I would like to load a sound at loading of 1 specific page. It should load the sound only one time....

Is this possible in website baker?

I made a swishmax file but cannot load it once....

kind regards Irene
Logged

Kind regards,Irene
albatros

Offline Offline

Posts: 674


WWW
« Reply #1 on: August 21, 2009, 08:04:39 PM »

Hi Irene,

the only method I know to load a sound only one time would be setting the WB-site into a frame. But I would never do that.

Could it be a solution for you, using the swf only on the home-page, and using a jpg instead for the other pages?

Best regards

Uwe
Logged
Ogierini

Offline Offline

Posts: 276



WWW
« Reply #2 on: August 21, 2009, 08:12:44 PM »

The picture and sound should only be heard 1 time at the home page and not at the rest of the pages.
How could I load this into a frame /wrapper one time with what code? And why is this not ideal?

kind regards Irene
Logged

Kind regards,Irene
crnogorac081
AddOn Development
*
Offline Offline

Posts: 1706



« Reply #3 on: August 21, 2009, 08:22:39 PM »

You can try to download some flash player wit auto start, then put it in hidden <div> Smiley maybe that can help..

cheers
Logged

Wow, I coded something myself: PM Messanger Modul ,Searchbox with suggestions
albatros

Offline Offline

Posts: 674


WWW
« Reply #4 on: August 21, 2009, 08:43:37 PM »

Hi Irene,

And why is this not ideal?
I am shure, for searchengines it would work like an eye of a needle. And this is really bad.

The picture and sound should only be heard 1 time at the home page and not at the rest of the pages.
How could I load this into a frame /wrapper one time with what code?

If it is a header-animation, my sugestion is to use this animation on the home-page, an a (standing) jpg instead on the other pages. There are different ways to do this. one easy way is to make a templateclone fore the home-page.

Best regards

Uwe
Logged
kweitzel
Forum administrator
*****
Offline Offline

Posts: 6975


WWW
« Reply #5 on: August 21, 2009, 08:47:34 PM »

If you know a bit of programming you could create a bit of PHP which checks for a cookie, if no cookie present then loads the sound and then sets a cookie.

This way you have the sound loaded once during the visit. Of cause, if the cookie is still present, when the surfer comes back next time, it will not play the sound again. But if the cookie is not present it will play. You could also give the cookie a limited lifetime ...

cheers

Klaus
Logged

WebsiteBaker Org e.V. - for WebsiteBaker

albatros

Offline Offline

Posts: 674


WWW
« Reply #6 on: August 21, 2009, 08:58:59 PM »

Hi Klaus,

that's a very elegant way. But this way I will never hear the sound, because I use a positive-list for cookies in ff. Ok, I know that I am a little bit exotic here.  grin

Best regards

Uwe
Logged
Ogierini

Offline Offline

Posts: 276



WWW
« Reply #7 on: August 21, 2009, 09:01:37 PM »

Yeah, Klaus I know, unfortunately I am no php scripter.
Dreamweaver cs3 has a standard code for this but now use cs 4.....

- hoped some one had a simple code a la this.....
Logged

Kind regards,Irene
kweitzel
Forum administrator
*****
Offline Offline

Posts: 6975


WWW
« Reply #8 on: August 21, 2009, 09:10:42 PM »

It's not a hard thing ... have a little look here: http://www.w3schools.com/PHP/php_cookies.asp ... of cause that doesn't help people with "cookie issues" grin

cheers

Klaus
Logged

WebsiteBaker Org e.V. - for WebsiteBaker

crnogorac081
AddOn Development
*
Offline Offline

Posts: 1706



« Reply #9 on: August 21, 2009, 09:25:25 PM »

there is simpler way to do this, instead to clone template:

Check this code:
Code:
<?php
if (file_exists("".WB_PATH."/templates/".TEMPLATE."/pagepics/".PAGE_ID.".jpg") )
{
echo 
"<img src=\"".TEMPLATE_DIR."/pagepics/".PAGE_ID.".jpg\" title=\"".PAGE_TITLE."\" alt=\"".PAGE_TITLE."\">\n";
}
else
{
echo 
"<div class=\"pagepics\"><img src=\"".TEMPLATE_DIR."/pagepics/default.jpg\" title=\"".PAGE_TITLE."\" alt=\"".PAGE_TITLE."\"></div>\n";
}
?>

You should make a folder: pagepics in your template folder. Then add picture names: defult.jpg and the other should be named 1.jpg or some other number ---look for page id number in backend admin> pages..

You could put as much pictures in that folder as much you want for all pages, and they are named 1.jpg , 2.jpg...etc.. and if you are on page who has page_id == 50 and you dont have picture 50.jpg , the defult.jpg picture will be used..

You can also make simular line for audio, like:
Code:
<?php
if (file_exists("".WB_PATH."/templates/".TEMPLATE."/pagepics/".PAGE_ID.".wav") )
{
echo 
"
<embed src=\""
.TEMPLATE_DIR."/pagepics/".PAGE_ID.".wav\" hidden=\"true\" autostart=\"true\" loop=\"1\">\n";
}
?>


I hope I helped Smiley
cheers
« Last Edit: August 21, 2009, 09:39:59 PM by crnogorac081 » Logged

Wow, I coded something myself: PM Messanger Modul ,Searchbox with suggestions
kweitzel
Forum administrator
*****
Offline Offline

Posts: 6975


WWW
« Reply #10 on: August 21, 2009, 10:07:52 PM »

@ crnogorac081 ... you should try to read better please ... this user wants to use audio (sound) files ... not images or video ...

cheers

Klaus
Logged

WebsiteBaker Org e.V. - for WebsiteBaker

crnogorac081
AddOn Development
*
Offline Offline

Posts: 1706



« Reply #11 on: August 21, 2009, 10:21:13 PM »

I think she said in 9 posts above:
Quote
The picture and sound should only be heard 1 time at the home page and not at the rest of the pages...
If you have .mid, then just put instead .wav ---> .mid  in the code:)

you can add additional parameter: volume=\"30%\"

cheers
« Last Edit: August 21, 2009, 10:24:20 PM by crnogorac081 » Logged

Wow, I coded something myself: PM Messanger Modul ,Searchbox with suggestions
Ogierini

Offline Offline

Posts: 276



WWW
« Reply #12 on: August 22, 2009, 08:42:26 AM »

Thanks you guy's!
I resolved it by making a little flashfile with a turn on and turn off button.
And in websie baker I choose for play it by activating/once....

So it works as I wanted now!

Thanks for your help!

Logged

Kind regards,Irene
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!