Refresh

Support for PhpBB3. Post here to get help with any phpBB3 related issue here
There is no support here! Only Read Access!
Forum rules
In order the get any support, you will have to do following:
1. Use a describing title!
2. Describe your problem and what happened when the problem occured
3. Tell us what version of phpBB3 you are currently using.
Else your topic may be ignored or locked!
Locked
User avatar
DannyG
BBCoder II
BBCoder II
Posts: 54
Joined: 10 Mar 2010, 18:05

Refresh

Post by DannyG »

Hi all I have a little script that I would liek some help with. I have a radio on my forum, with a WM player but I also have an Iframe that shows the current song and listeners. But I need the iframe to refresh every 30 seconds, How do I do this without refreshing the whole forum.

Cheers for any help chaps! ;)

Code: Select all

<center><IFRAME 
SRC='http://95.154.227.120/fr2.php?ip=78.129.233.196&port=6171&ip1=82.27.105.240&ip2=&ip3=&show=&b=0' WIDTH=410 
HEIGHT=18 FRAMEBORDER=0 SCROLLING=no ALIGN=left></IFRAME></center>
cisco007
BBCoder VI
BBCoder VI
Posts: 1015
Joined: 16 Mar 2010, 18:14
Location: Don't really know!

Re: Refresh

Post by cisco007 »

first of all you should really use lower case letters in HTML, second how come you want to refresh the iframe, if you refresh it won't it also refresh the radio and everything in it? or is that what you want!?
KukY13
BBCoder III
BBCoder III
Posts: 96
Joined: 26 Jun 2010, 16:23
Contact:

Re: Refresh

Post by KukY13 »

First, code you are using is not valid!!!
Frames of any kind are not allowed, and instead of old align tags(<left>,<right>,<center>), you use CSS!
Now, instructions how to do what you want:
Give your iFrame an ID. Make that ID be "radio".
Now, add following code after the iFrame code:

Code: Select all

<script>
window.onload=refreshFrame;
function refreshFrame(){
document.getElementById("radio").src=document.getElementById("radio").src;
setTimeout("refreshFrame()",30000);}
</script>
It should work.
Image
User avatar
DannyG
BBCoder II
BBCoder II
Posts: 54
Joined: 10 Mar 2010, 18:05

Re: Refresh

Post by DannyG »

Ok..

Cheer for the reply guys. the IFRAME is a seperate code from the radio, so I want to refresh that. KukY13. I dont now what you mean the code is not vaild. the code was take from the site that host my radio (free shoutcast). I used view source to extract teh code. However, Thankyou for helping me. appreicate it loads.

Where do I add the ID part of the script to the code that I posted?
KukY13
BBCoder III
BBCoder III
Posts: 96
Joined: 26 Jun 2010, 16:23
Contact:

Re: Refresh

Post by KukY13 »

DannyG » 13 Aug 2010, 20:54 wrote:I dont now what you mean the code is not vaild. the code was take from the site that host my radio (free shoutcast). I used view source to extract teh code. However, Thankyou for helping me. appreicate it loads.
I mean that the HTML code doesn't follow the standards made by W3C.

Anyways, this is the code you should insert. I made it as much W3C compliant as I can and I placed the ID attribute.

Code: Select all

<div style="text-align:center;"><iframe 
src="http://95.154.227.120/fr2.php?ip=78.129.233.196&port=6171&ip1=82.27.105.240&ip2=&ip3=&show=&b=0" width="410" height="18" frameborder="0" scrolling="no" align="left" id="radio" /></div>
Image
User avatar
DannyG
BBCoder II
BBCoder II
Posts: 54
Joined: 10 Mar 2010, 18:05

Re: Refresh

Post by DannyG »

Hi,

Thanks for the code, however it did'nt work.
Image

But I take the iframe code out and it the radio is there
Image

I do have the radio inside the "Avata on forum index" mod. Would that cause the problem?

here is the full code including the Avata on index and the radio and the iframe. Does this need to be changed?

Code: Select all

<a name="start_here"></a>
	<div id="page-body">
<div class="custom-foot"></div>
         <div class="inner">
         <ul class="topiclist">
            <li class="header">
            <div class="custom-cat-header">
               <dl class="icon">
<dt><div style="padding-left: 20px; margin-top: 8px; font-weight: bold; font-family: Tahoma, Geneva, sans-serif; text-shadow: 2px 2px 2px #0b2534;"> 
 Music Mix Djs© User Info & Radio Player
                                                 </dt>
                                              </dl>
            </li>
         </ul>    <div class="custom-row" id="{forumrow.FORUM_ID}">
         <ul class="topiclist forums">
         <li>
            <dl>
               <dd style="padding:5px; text-align: center; border:none;">
               <!-- IF USER_AVATAR -->{USER_AVATAR}<!-- ELSE --><img src="{T_THEME_PATH}/images/no_avatar.gif"/><!-- ENDIF -->
               </dd>
               <dd class="lastpost" style="padding:5px; width:40%;">
               <p>{S_WELCOME}</p>
               <span><!-- IF S_USER_LOGGED_IN -->{LAST_VISIT_DATE}<br />{CURRENT_TIME}<!-- ELSE -->{CURRENT_TIME}<!-- ENDIF --><!-- IF S_USER_LOGGED_IN --><br /><br />{S_JOINED_DATE}<br />{MEMBER_FOR}<!-- ENDIF --></span>               
               </dd>                
               <dd class="lastpost" style="padding:5px; width:36%;"><span>{TOTAL_POSTS} &bull; {TOTAL_TOPICS}<br /> {TOTAL_USERS}<br />{NEWEST_USER}
               <!-- IF S_DISPLAY_ONLINE_LIST --><br /><br />{TOTAL_USERS_ONLINE} ({L_ONLINE_EXPLAIN})<!-- ENDIF --></span>                
              <br />
              <center><div style="text-align:center;"><iframe 
src="http://95.154.227.120/fr2.php?ip=78.129.233.196&port=6171&ip1=82.27.105.240&ip2=&ip3=&show=&b=0" width="410" height="18" frameborder="0" scrolling="no" align="left" id="radio" /></div></center>
              <br />
              <br />              
              <td align='center' width='255'>
<p align='center'>
<object id='mediaplayer'
classid='clsid:6bf52a52-394a-11d3-b153-00c04f79faa6'
type='application/x-oleobject' width='330' height='65'>
<param name='url' value='http://78.129.233.196:6171' />
<param name='autostart' value='1' />
<param name='showcontrols' value='1' />
<param name='stretchtofit' value='0' />
<param name='enablecontextmenu' value='0' />
<param name='ShowStatusBar' value='1'>
<embed
src='http://78.129.233.196:6171' width=330'
height='65'
autostart='1' type='application/x-mplayer2'
pluginspage='http://www.microsoft.com/Windows/MediaPlayer/'
transparentatstart='0'
animationatstart='0'
showcontrols='1'
autosize='0'
displaysize='0'
showtracker='0'
ShowStatusBar='1'></embed>
</object>


<center><b>Can't Hear Anything ? Click Link Below To Activate The Radio</b></center>

<center><a target='_top' href='http://musicmixdjsradio.listen2myradio.com/'>Music Mix Djs Radio</a></center>

</td>
              
       <marquee behavior="left" direction="left" bgcolor="yellow" vspace="20"><h4>Weekends :Resident DJ's - In The Mix...!</h4></marquee>               
            
               </dd>
            </dl>
         </li>
         </ul> 
<span class="corners-bottom"><span></span></span></div></div>
I would be most greatfull if you could help me succeed in what I'm trying to do.
cisco007
BBCoder VI
BBCoder VI
Posts: 1015
Joined: 16 Mar 2010, 18:14
Location: Don't really know!

Re: Refresh

Post by cisco007 »

are you trying to refresh the number of the radio listeners or the number of registered forum users listening to the radio?
User avatar
DannyG
BBCoder II
BBCoder II
Posts: 54
Joined: 10 Mar 2010, 18:05

Re: Refresh

Post by DannyG »

Trying to refresh the number of listeners and song title. The actual iframe itself
Locked