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

Forum Statistics

Peter

Active member
#1
If I wanted to edit 'Forum Statistics' that is on the sidebar, which file should I edit? I did a search for 'forum statistics' within templates and get the 'No items matched your filter.' message.
 

Brogan

XenForo moderator
Staff member
#2
What do you want to change/edit exactly?

The words "Forum Statistics" or the actual content?
If it's just the words then edit the phrase forum_statistics.

The stats block is in the forum_list template:
HTML:
        <!-- 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}:</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 -->
 

Brogan

XenForo moderator
Staff member
#4
Ideally you would use the phrase system as that way you can translate any text to other languages.

I'm still not sure exactly what it is you want to do though?
You just want some text displayed as "Hello World"?

In that case just enter it as, e.g.:

HTML:
<p>Hello World</p>
 

Peter

Active member
#5
I'm still not sure exactly what it is you want to do though?
Thanks Brogan. I'm just testing out different ways to show text to guests and members.

Here's the code I'm using in that statistics block:
Code:
<xen:if is="{$visitor.user_id}">
	<p> hello member</p>
<xen:else />
	<p> hello guest</p>
<p> text to show to both guest and member</p>
</xen:if>
How can I show a message to both guest and member? Do I need to duplicate?
 

Brogan

XenForo moderator
Staff member
#6
Well that code is using a conditional and works fine for both logged in users who will see "hello member" and guests who will see "hello guest".

If you want to show both strings then remove the conditional.

Or have I misunderstood the question?

Ah, I've just seen your edit. Just move the extra string outside the </xen:if> like so:
HTML:
<xen:if is="{$visitor.user_id}">
    <p> hello member</p>
<xen:else />
    <p> hello guest</p>
</xen:if>
<p> text to show to both guest and member</p>