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

Members Online + Stats at bottom?

Discussion in 'Styling and Customization Questions' started by toodlez, Dec 5, 2011.

  1. toodlez

    toodlez Active Member

    Hi, I am sure you all are aware of vBulletin's structure with having the users currently online, as well as the forum stats in the bottom of the board..

    Is there anyone with an addon or a code that I can use to insert this at the bottom of my XF board?
    I would like to keep the sidebar with this info as well, just trying to add it to the bottom too for those who like it there! (I have a collapsing sidebar)
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Admin CP -> Appearance -> Templates -> forum_list

    Add the red code (copied and pasted from the sidebar):

    Code:
    <xen:h1>{$xenOptions.boardTitle}</xen:h1>
    
    <xen:container var="$head.canonical"><link rel="canonical" href="{xen:link 'canonical:index'}" /></xen:container>
    <xen:if is="{$xenOptions.boardDescription}"><xen:container var="$head.description">
    	<meta name="description" content="{$xenOptions.boardDescription}" /></xen:container></xen:if>
    <xen:container var="$head.openGraph">
    	<xen:include template="open_graph_meta">
    		<xen:set var="$url">{xen:link 'canonical:index'}</xen:set>
    		<xen:set var="$title">{$xenOptions.boardTitle}</xen:set>
    	</xen:include></xen:container>
    
    <xen:hook name="forum_list_nodes">
    	<xen:if is="{$renderedNodes}"><xen:include template="node_list" /></xen:if>
    </xen:hook>
    
    		<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: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>
    		
    	</xen:hook>
    </xen:sidebar>
    
    However, you lose some styling by taking this content out of the sidebar. Some extra work is required to get it looking how you want.
     
    WinX64 likes this.
  3. toodlez

    toodlez Active Member


    Very good, Jake...
    Is there any way we can mod this code so that it doesn't show "Staff Online Now" ?
     
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    That requires editing the sidebar_online_users template, but that will affect both locations. Or you can replace <xen:include template="sidebar_online_users" /> with just the code that you want from sidebar_online_users
     
  5. bassoto

    bassoto Member

    why it dont work in
    category_view
     
  6. thanhncb91

    thanhncb91 Member

    Yes, I want to add forum stats in catagory_view? Please help me...
     
  7. Jeremy

    Jeremy XenForo Moderator Staff Member

    The necessary information is not fetch nor available in category_view. You will need an add-on.
     
  8. thanhncb91

    thanhncb91 Member

    You can tell me more? Is it difficult? Thanks
     
  9. Jeremy

    Jeremy XenForo Moderator Staff Member

    I believe bd Widget Framework has the capability. But I do not use it. Fetching the data and adding it shouldn't be too difficult if you know PHP.
     
  10. thanhncb91

    thanhncb91 Member

    Thank U so much:)
     

Share This Page