Include radio stream in sidebar?

sforum

Active member
Hi all,

I would like to include a radio stream in a little block in my sidebar (or anywhere on the forum that would be suitable, I suppose). It is the stream from this site - you can find it by clicking the big LISTEN LIVE NOW! button at the top right.

I use xfrocks' [bd] widget framework, so if I could wrap it in a widget for that, that would be ideal :) But to be honest, any way in which I can allow my users to listen to that stream while browsing would be great!
 
But to be honest, any way in which I can allow my users to listen to that stream while browsing would be great!

That is the key. If you embed something in the page then it will be reloaded on every page which doesn't work well for an audio feed. I recommend a popup window. For example, edit this template:

Admin CP -> Appearance -> Templates -> forum_list

Add the red code:

Rich (BB code):
<xen:sidebar>
	<xen:edithint template="sidebar.css" />
	
	<xen:hook name="forum_list_sidebar">
		<xen:include template="sidebar_online_users" />
		
		<!-- block: forum_stats -->
		<div class="section">
			<div class="secondaryContent statsList" id="boardStats">
				<h3>{xen:phrase forum_statistics}</h3>
				<div class="pairsJustified">
					<dl class="discussionCount"><dt>{xen:phrase discussions}:</dt>
						<dd>{xen:number $boardTotals.discussions}</dd></dl>
					<dl class="messageCount"><dt>{xen:phrase messages}:</dt>
						<dd>{xen:number $boardTotals.messages}</dd></dl>
					<dl class="memberCount"><dt>{xen:phrase members_count}:</dt>
						<dd>{xen:number $boardTotals.users}</dd></dl>
					<dl><dt>{xen:phrase latest_member}:</dt>
						<dd><xen:username user="$boardTotals.latestUser" /></dd></dl>
					<!-- slot: forum_stats_extra -->
				</div>
			</div>
		</div>
		<!-- end block: forum_stats -->
		
		<xen:include template="sidebar_share_page">
			<xen:set var="$url">{xen:link canonical:index}</xen:set>
		</xen:include>

		<div class="section">
			<div class="secondaryContent statsList">
				<a href="#" onclick="window.open('http://www.apple.com/','radio','width=400,height=220,scrollbars=no,');return false" target="radio">
					Click for radio!
				</a>
			</div>
		</div>
		
	</xen:hook>
</xen:sidebar>

You can enter the URL of the page with the radio player. This will add a sidebar box like this:

Screen shot 2012-02-26 at 8.57.45 PM.webp

Clicking the link will open the URL in a popup.
 
That is the key. If you embed something in the page then it will be reloaded on every page which doesn't work well for an audio feed. I recommend a popup window. For example, edit this template:

Admin CP -> Appearance -> Templates -> forum_list

Add the red code:

Rich (BB code):
<xen:sidebar>
<xen:edithint template="sidebar.css" />
 
<xen:hook name="forum_list_sidebar">
<xen:include template="sidebar_online_users" />
 
<!-- block: forum_stats -->
<div class="section">
<div class="secondaryContent statsList" id="boardStats">
<h3>{xen:phrase forum_statistics}</h3>
<div class="pairsJustified">
<dl class="discussionCount"><dt>{xen:phrase discussions}:</dt>
<dd>{xen:number $boardTotals.discussions}</dd></dl>
<dl class="messageCount"><dt>{xen:phrase messages}:</dt>
<dd>{xen:number $boardTotals.messages}</dd></dl>
<dl class="memberCount"><dt>{xen:phrase members_count}:</dt>
<dd>{xen:number $boardTotals.users}</dd></dl>
<dl><dt>{xen:phrase latest_member}:</dt>
<dd><xen:username user="$boardTotals.latestUser" /></dd></dl>
<!-- slot: forum_stats_extra -->
</div>
</div>
</div>
<!-- end block: forum_stats -->
 
<xen:include template="sidebar_share_page">
<xen:set var="$url">{xen:link canonical:index}</xen:set>
</xen:include>
 
<div class="section">
 <div class="secondaryContent statsList">
 <a href="#" onclick="window.open('http://www.apple.com/','radio','width=400,height=220,scrollbars=no,');return false" target="radio">
 Click for radio!
 </a>
 </div>
 </div>
 
</xen:hook>
</xen:sidebar>

You can enter the URL of the page with the radio player. This will add a sidebar box like this:

View attachment 26369

Clicking the link will open the URL in a popup.
This is great, but where do I put this code if I want to to stay directly above the 'online members' box and below the 'sign up now' bow (in between them both, on whatever pages they occupy? Right now I have it on "Forum" only but I want it to be on where ever the online members box is.
 
Top Bottom