vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   hack to show the total posts/threads ever not just the totals in the database now? (https://vborg.vbsupport.ru/showthread.php?t=38411)

CRego3D 09-08-2002 05:08 PM

no :(

I get this error

Database error in vBulletin 2.2.5:

Invalid SQL: SELECT userid AS users,MAX(userid) AS max FROM user
mysql error: Mixing of GROUP columns (MIN(),MAX(),COUNT()...) with no GROUP columns is illegal if there is no GROUP BY clause

mysql error number: 1140

CRego3D 09-13-2002 05:18 PM

any ideas? :)

Logician 09-13-2002 06:58 PM

Quote:

Originally posted by CRego3D
any ideas? :)
PHP Code:

$numbersmembers=$DB_site->query_first('SELECT MAX(userid) AS max FROM user'); 


CRego3D 09-14-2002 05:04 AM

^^^^ That gives me users = 0 :D ..

Logician 09-17-2002 07:08 AM

After adding the line, you should use this variable in your templates:
$numbersmembers['max']

CRego3D 09-17-2002 07:44 PM

tried it .. still showed "0" :(

Logician 09-18-2002 07:32 AM

If you add the line:
PHP Code:

$numbersmembers=$DB_site->query_first('SELECT MAX(userid) AS max FROM user'); 

to your index.php and add

PHP Code:

$numbersmembers['max'

to your forumhome template, it should work.. I tested it and it's working here..

wolfe 09-18-2002 09:21 PM

Quote:

Originally posted by Logician

Sure, why not:

Leave the original code as it is and add these 2 lines after them:

$count_maxx_posts=$DB_site->query_first('SELECT postid AS posts FROM post ORDER BY postid DESC LIMIT 1' );

$count_maxx_threads=$DB_site->query_first('SELECT threadid AS threads FROM thread ORDER BY threadid DESC LIMIT 1');

Now you can change your main page template and use these 2 variables $count_maxx_posts and $count_maxx_threads in anywhere or in any way you like..

Logician



i get this error on my index.php i use

Code:

Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING'
VBB 2.2.7

here is what i got in my index.php

Code:

// get total posts ever
$count_maxx_posts=$DB_site->query_first('SELECT postid AS posts FROM post ORDER BY postid DESC LIMIT 1' );
$count_maxx_posts=number_format($count_maxx_posts['posts']);

$count_maxx_threads=$DB_site->query_first('SELECT threadid AS threads FROM thread ORDER BY threadid DESC LIMIT 1');
$count_maxx_posts=number_format($count_maxx_threads['threads']);


Logician 09-19-2002 08:59 AM

Quote:

Originally posted by wolfe
i get this error on my index.php i use
Code:

Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING'

I tested your code in vb.2.2.7 and it gave me no errors and successfully give me the numbers when I put them inside the forumhome template. Make sure you use the variables ($count_maxx_threads,$count_maxx_posts) only inside the templates and make sure you dont process these variables in your php script like adding them something etc. like

$count_maxx_threads=$count_maxx_threads+1000;

also make sure you dont get the error because of any other line in your code..

I strongly believe if you use only this code in index.php and $count_maxx_threads and $count_maxx_posts in forumhome template, you will not get ant errors..

Legacy 11-30-2002 04:53 PM

NONE of this works for 2.2.8

for the MEMBERS part

have the Post counts working..need a working members count..600 members got removed acidentaly


All times are GMT. The time now is 01:45 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.01347 seconds
  • Memory Usage 1,739KB
  • 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
  • (3)bbcode_code_printable
  • (3)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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