1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Include radio stream in sidebar?

Discussion in 'Styling and Customization Questions' started by sforum, Feb 26, 2012.

  1. sforum

    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!
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    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:

    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.png

    Clicking the link will open the URL in a popup.
     
    ArnyVee and sforum like this.
  3. sforum

    sforum Active Member

    Good point. I went with the pop-up option and it works spiffingly; thanks. :)
     
  4. JMPRockFm

    JMPRockFm Member

    Hello, how do you do this radio host?????
     
  5. CritiKiL

    CritiKiL Active Member

    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.
     
  6. CritiKiL

    CritiKiL Active Member

    Hey man, please disregard. I managed to find each place where I could embed the code ;-) Great idea, keep them coming bro! ;-)
     

Share This Page