Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
themes-topic
Footer stats - odd behaviour
Avatar
Conrad_Farlow
Sheffield, UK
Member
Free Members
sp_UserOfflineSmall Offline
Jan 21, 2012 - 10:18 am

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:

Image Enlarger

 

 

How can I suppress this as well?

Conrad

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jan 21, 2012 - 11:03 am

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

Avatar
Conrad_Farlow
Sheffield, UK
Member
Free Members
sp_UserOfflineSmall Offline
Jan 21, 2012 - 11:17 am

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?

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jan 21, 2012 - 11:22 am

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: '));
}

Avatar
Conrad_Farlow
Sheffield, UK
Member
Free Members
sp_UserOfflineSmall Offline
Jan 21, 2012 - 11:39 am

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.

Avatar
Conrad_Farlow
Sheffield, UK
Member
Free Members
sp_UserOfflineSmall Offline
Jan 21, 2012 - 11:50 am

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

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jan 21, 2012 - 12:19 pm

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

Avatar
Conrad_Farlow
Sheffield, UK
Member
Free Members
sp_UserOfflineSmall Offline
Jan 21, 2012 - 12:30 pm

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

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jan 21, 2012 - 12:32 pm

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

Avatar
Conrad_Farlow
Sheffield, UK
Member
Free Members
sp_UserOfflineSmall Offline
Jan 21, 2012 - 12:36 pm

OK great will it be an =0 or =1 type scenario?

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 620
Members: 17365
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10128
Posts: 79626