Display of number of registered users

11 years 8 months ago #206992 by nickr
Is there an easy way (e.g. a module for J2.5) that shows the number of registered users?

If not, I have sort of figured out how to do this using CB Query Field. I use the following simple query in a field I called 'cb_membercounterquery':

SELECT COUNT( `id` ) FROM `###__users`

I then used the following content substitution in my article:

{cb:[cb:userdata field="cb_membercounterquery"/]}

This works fine if you log in, but for some reason it doesn't work in the Public areas of the site (nothing is displayed) - any ideas why not? I ensured that the field is associated with a Public tab.

Thanks.

Please Log in to join the conversation.

11 years 8 months ago #207003 by krileon
Replied by krileon on topic Re: Display of number of registered users
Substitutions without a user specified users the viewing user. If you're not logged in then such a user doesn't exist and thus such a field doesn't exist. It's not the most ideal approach, but you can force a user by specifying user="USER_ID" so it'll always display. I however recommend one of the below modules from S4J.

www.software4joomla.com/

If none of the above are sufficient there are plenty of user counters on Joomla.org extension directory.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: nickr

Please Log in to join the conversation.

11 years 8 months ago #207005 by nickr
Replied by nickr on topic Re: Display of number of registered users
Okay - will look at what modules they have on offer.

Thanks.

Please Log in to join the conversation.

11 years 8 months ago #207006 by krileon
Replied by krileon on topic Re: Display of number of registered users
If you find you like any of the S4J modules as a Professional subscriber you can get a discount coupon below.

www.joomlapolis.com/promotions


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

11 years 8 months ago #207007 by nickr
Replied by nickr on topic Re: Display of number of registered users
Even better - thanks again!

By the way, when you said it is possible to use: user="USER_ID", where am I putting this? Is it not recommended because it can cause problems/security issues?

Please Log in to join the conversation.

11 years 8 months ago #207010 by krileon
Replied by krileon on topic Re: Display of number of registered users

By the way, when you said it is possible to use: user="USER_ID", where am I putting this?

Your substitution. Example as follows.

{cb:[cb:userdata field="cb_membercounterquery" user="42" /]}

Is it not recommended because it can cause problems/security issues?

It's just not the proper way to do it. The query also needs to be more refined. As is it'd count people banned, unconfirmed, unapproved, etc..


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.325 seconds

Facebook Twitter LinkedIn