Advertisement:

Author Topic: How get numbers of users,groups,vistors ...etc  (Read 690 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: 68,044
    • Arantor 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.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

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: 68,044
    • Arantor 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.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

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: 48,071
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: 68,044
    • Arantor 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...?
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

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: 7,096
  • 'Tis the gift to be simple
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: 68,044
    • Arantor 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...
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

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