Page 1 of 1

Refresh

Posted: 13 Aug 2010, 16:28
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>

Re: Refresh

Posted: 13 Aug 2010, 17:40
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!?

Re: Refresh

Posted: 13 Aug 2010, 18:27
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.

Re: Refresh

Posted: 13 Aug 2010, 20:54
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?

Re: Refresh

Posted: 13 Aug 2010, 21:15
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>

Re: Refresh

Posted: 14 Aug 2010, 07:36
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.

Re: Refresh

Posted: 14 Aug 2010, 07:49
by cisco007
are you trying to refresh the number of the radio listeners or the number of registered forum users listening to the radio?

Re: Refresh

Posted: 14 Aug 2010, 13:37
by DannyG
Trying to refresh the number of listeners and song title. The actual iframe itself