Support Forum

Footer stats – odd behaviour

CF Conrad_Farlow
Conrad_Farlow
Member

I have suppressed the output in the currently online and currently browsing outputs in the footer to not include guests. This is because on our live forum we do not have guests and any output in this area results in me getting asked lots of questions like ‘ How come there are guests showing when we don’t have guests’. So I explain that if someone views the forum pages even if they can’t log in then there a statistics generated. I explain that these guests cannot view form content but quite honestly there is only so many times I can repeat myself without getting a little annoyed. So I have tried to suppress the output for guests.

However I still get the number count like this:

 

 

How can I suppress this as well?

Conrad

16 Answers

New Answer

MP Mr Papa
Mr Papa
Member

in your sp theme, all the stats display is via called template tags… just remove the ones you dont want…

if you want to not display for guests, just check for member first with something like

if ($spThisUser->member) {
  # template tag here
}

and it will only call the template tag for logged in users…

CF Conrad_Farlow
Conrad_Farlow
Member

OK Steve so taking the relevant section from my theme spFoot.php:

        sp_ColumnStart('tagClass=spColumnSection spLeft spOnlineStats&width=40%&height=0');
            sp_OnlineStats('tagClass=spLeft', __sp('Most Users Ever Online: '), __sp('Currently Online: '), __sp('Currently Browsing this Page: '));
            if (function_exists('sp_OnlinePageLink')) sp_OnlinePageLink('', __sp('See All Online Activity'));
        sp_ColumnEnd();

How would I insert your code into that section?

MP Mr Papa
Mr Papa
Member

you have not clearly stated what you want to do – at least I have not followed it… but assuming its dealing with stats and I only see one stats template tag there, perhaps:

if ($spThisUser->member) {
    sp_OnlineStats(‘tagClass=spLeft’, __sp(‘Most Users Ever Online: ‘), __sp(‘Currently Online: ‘), __sp(‘Currently Browsing this Page: ‘));
}

CF Conrad_Farlow
Conrad_Farlow
Member

What I want to do is suppress all stats from Guests in the footer. Inserting your code does that very simply so thanks.

Can you now tell me how to suppress the numbers 2 and 1 in the stats screenshot.? These I believe are related to the number of guests. Checking with firebug doesn’t really give any clue as the number appears to be generated by the same HTML as that which generates the members names. So where are these numbers generated? spOnlineStats? If I can those numbers  then I am there.

CF Conrad_Farlow
Conrad_Farlow
Member

Got it, unfortunately its in common-view-functions, a pain for maintenance when you go in here! I have commented out the #guests online section.

I don’t seem able to suppress the numbers from inside the theme.

Conrad

MP Mr Papa
Mr Papa
Member

ah… didnt get that from the first post…  odd, that bothers some folks, but hey, to each his own…

I would have used a filter to remove rather than editing core code…  each template tags contains a filter at the end that allows you to further change up the output…  in this case, its not a simple filter…

I can open a ticket to see if we can add an ‘suppress guests’ type option to the argument list…

CF Conrad_Farlow
Conrad_Farlow
Member

That would be great and infinitely preferable to tinkering in common-view-functions. I explained why I have to suppress the word guest from any stats, not me but the members of the forum. I want rid of the numbers because without the words guests online they make no sense and are annoying 🙂

Bit like me at times………… wink

MP Mr Papa
Mr Papa
Member

I have already made the changes… and will be committing a bit later when I make one other mod regarding an unread posts class on rows…

CF Conrad_Farlow
Conrad_Farlow
Member

Steve I found the usersOnly entry in the sp_OnlineStats section of sp-common-view-functions.php and changed it to 1.It works a treat of course.

Can I pass this as an argument in my theme instead of in the core?

I still can’t tell embarassed

Conrad