21
Peekay
Re: random img => random audio
  • 2007/8/7 21:21

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


No such thing as a problem. Just interesting challenges!
A thread is for life. Not just for Christmas.

22
mjz55
Re: random img => random audio
  • 2007/8/8 16:12

  • mjz55

  • Quite a regular

  • Posts: 298

  • Since: 2007/1/18


It didn't work for me. I changed the block to php. It won't play.

23
Peekay
Re: random img => random audio
  • 2007/8/11 10:20

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


It *should* auto-load the player when you open the site, then if you go to another page the player will stop. On return to the homepage, it should say 'still here then' instead of loading the player a second time.

Does the message appear at all?

My server has PHP register_globals 'Off', so the first line of code is needed to avoid creating an undefined attribute. You could try removing the first line:

$_SERVER["HTTP_REFERER"] = !isset($_SERVER["HTTP_REFERER"])? NULL $_SERVER["HTTP_REFERER"];


Other than that, I'm running out of ideas on this one!
A thread is for life. Not just for Christmas.

24
mjz55
Re: random img => random audio
  • 2007/8/21 17:55

  • mjz55

  • Quite a regular

  • Posts: 298

  • Since: 2007/1/18


How about adding a cookie or something that lets it play only once period? Is that possible?

25
Peekay
Re: random img => random audio
  • 2007/8/22 17:59

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


The referrer trick works for me on a static site, so I tried putting the conditional player script in the template. This seems to work and stops the player runing when users log in or out.

In your theme.html (I put it under the footer):

<tr><td>
<{
php}>
$_SERVER["HTTP_REFERER"] = !isset($_SERVER["HTTP_REFERER"])? NULL $_SERVER["HTTP_REFERER"];
$origin $_SERVER["HTTP_REFERER"];
if ( 
strstr$origin"example.com" ) ) {
echo 
"Still here then" ;
 }
else {
echo 
"application/x-shockwave-flash" width="1" height="1"
data="
http://www.example.com/xspf/xspf_player_slim.swf?playlist_url=http://www.example.com/xspf/playlist.xspf&autoplay=true">
<param name="movie" 
value="http://www.example.com/xspf/xspf_player_slim.swf?playlist_url=http://www.example.com/xspf/playlist.xspf&autoplay=true" />object>" ;
 }
<{/php}>


However... if a user leaves the site (to visit a web link for example) the player will play when they return, 'cos it thinks they are a new site visitor. A cookie or perhaps a session thingy may indeed be the answer to that, but I wouldn't know where to start.

Anyone out there bake a good cookie?...
A thread is for life. Not just for Christmas.

Login

Who's Online

420 user(s) are online (294 user(s) are browsing Support Forums)


Members: 0


Guests: 420


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits