vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   How could I display total # of subscribers? Help Please (https://vborg.vbsupport.ru/showthread.php?t=95907)

Boofo 09-14-2005 09:48 AM

Quote:

Originally Posted by KirbyDE
My fault - it's status not active

Typo man has struck again! LMAO

Andreas 09-14-2005 09:49 AM

Nah, that wasn't a typo - just bad (brain) memory.
I don't deal with the subscriptionlog table that often you know.

Boofo 09-14-2005 09:52 AM

True, but it was still classic. ;)

TrickyD 09-15-2005 05:46 AM

Thanks again for all the help guys, hopefully this is the last I have to bug you about this particular hack.

So I ran the query with the prefix and updated code as

[sql]select count(*) from cmq_subscriptionlog where status=1[/sql]
And it returned the correct number, 95.

So then I entered the following in the plugin manager for the global_start
PHP Code:

$subscribers $db->query_first("SELECT COUNT(*) AS totalactive FROM " TABLE_PREFIX "subscriptionlog WHERE status=1");
$subscribers['totalactive'] = vb_number_format($subscribers['totalactive']); 

I went into my header template and entered $subscribers at the top of the template and saved it.

But when I went back to my board to check it, it displalyed ARRAY

What'd I screw up this time :dead:

calorie 09-15-2005 05:50 AM

Use $subscribers[totalactive] in the template.

TrickyD 09-15-2005 05:59 AM

Quote:

Originally Posted by calorie
Use $subscribers[totalactive] in the template.

Fantastic, works perfect now.

I'd like to throw out one last thank you to all.

TrickyD 06-11-2008 10:48 PM

I know this thread is from back in 2005, but this mod is still working and has been a huge asset to my forum.

But I've grown and have added other subscriptions.

Here is my question...

How can I modify this code to only count the total active subscribers in a specific subscription?

Code:

$subscribers = $db->query_first("SELECT COUNT(*) AS totalactive FROM " . TABLE_PREFIX . "subscriptionlog WHERE status=1");
$subscribers['totalactive'] = vb_number_format($subscribers['totalactive']);

I'm assuming a I need a "subscriptionid=1" in there somewhere?

psylenced 06-12-2008 04:33 AM

Quote:

Originally Posted by TrickyD (Post 1547105)
How can I modify this code to only count the total active subscribers in a specific subscription?

Code:

$subscribers = $db->query_first("SELECT COUNT(*) AS totalactive FROM " . TABLE_PREFIX . "subscriptionlog WHERE status=1");
$subscribers['totalactive'] = vb_number_format($subscribers['totalactive']);

I'm assuming a I need a "subscriptionid=1" in there somewhere?

That is correct:

PHP Code:

$subscribers $db->query_first("SELECT COUNT(*) AS totalactivesub1 FROM " TABLE_PREFIX "subscriptionlog WHERE status=1 AND subscriptionid = 1");
$subscribers['totalactivesub1'] = vb_number_format($subscribers['totalactivesub1']); 



All times are GMT. The time now is 10:43 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00987 seconds
  • Memory Usage 1,738KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (2)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete