Advertisement:

Author Topic: How get numbers of users,groups,vistors ...etc  (Read 1231 times)

Offline sahr

  • Semi-Newbie
  • *
  • Posts: 12
How get numbers of users,groups,vistors ...etc
« on: November 20, 2017, 07:12:04 AM »
How get numbers of users,groups,vistors ...etc  in code progrmming

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 69,442
    • StoryBB/StoryBB on GitHub
Re: How get numbers of users,groups,vistors ...etc
« Reply #1 on: November 20, 2017, 07:18:27 AM »
To display where and how?

Note that displaying such stats tends to be inclined to discourage people unless the stats are already pretty high.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline sahr

  • Semi-Newbie
  • *
  • Posts: 12
Re: How get numbers of users,groups,vistors ...etc
« Reply #2 on: November 20, 2017, 07:25:55 AM »
thaanks for your replay,i have custom theme and need to display users,groups,vistors in front page as Board Stats in simpleportal mode

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 69,442
    • StoryBB/StoryBB on GitHub
Re: How get numbers of users,groups,vistors ...etc
« Reply #3 on: November 20, 2017, 08:29:30 AM »
Why can't you just get SimplePortal to do it? I'm sure it has a block for this already, but it's been a while since I used SP.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline sahr

  • Semi-Newbie
  • *
  • Posts: 12
Re: How get numbers of users,groups,vistors ...etc
« Reply #4 on: November 20, 2017, 08:47:14 AM »
I need to do that without simple portal

Offline Illori

  • Project Manager
  • SMF Master
  • *
  • Posts: 49,945
Re: How get numbers of users,groups,vistors ...etc
« Reply #5 on: November 20, 2017, 08:48:04 AM »
where do you want it to show? within SMF if so where exactly? if outside SMF where?

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 69,442
    • StoryBB/StoryBB on GitHub
Re: How get numbers of users,groups,vistors ...etc
« Reply #6 on: November 20, 2017, 08:48:40 AM »
So you're using SimplePortal but you need to not do it with SimplePortal...?
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline sahr

  • Semi-Newbie
  • *
  • Posts: 12
Re: How get numbers of users,groups,vistors ...etc
« Reply #7 on: November 20, 2017, 11:46:56 AM »
surly in SMF,but i change fornt page in index.template to suit my design now i need to put number of users,visitors,posts as large tittles in my page to notify my visitor with information about my site.

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 8,323
  • Then they came for me ...
Re: How get numbers of users,groups,vistors ...etc
« Reply #8 on: November 20, 2017, 12:10:17 PM »
The code that displays those stats is in BoardIndex.template.php, look for "info center".  You should be able to adapt it for your purpose.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 69,442
    • StoryBB/StoryBB on GitHub
Re: How get numbers of users,groups,vistors ...etc
« Reply #9 on: November 20, 2017, 12:13:33 PM »
Display is there but the logic is in BoardIndex.php and other files depending on what you're trying to do...
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline sahr

  • Semi-Newbie
  • *
  • Posts: 12
Re: How get numbers of users,groups,vistors ...etc
« Reply #10 on: November 20, 2017, 03:19:41 PM »
Which php code get total visitors like ', $context['common_stats']['total_members'], '

Offline wildmisty06

  • Newbie
  • *
  • Posts: 4
Re: How get numbers of users,groups,vistors ...etc
« Reply #11 on: November 26, 2017, 01:07:16 AM »
Is this an ok idea? Maybe I'll do this if the site is already stable with a lot of visitors. Well, that will depend on your goal.