Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)

Reply
 
Thread Tools Display Modes
  #11  
Old 09-08-2002, 05:08 PM
CRego3D CRego3D is offline
 
Join Date: May 2002
Posts: 82
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #12  
Old 09-13-2002, 05:18 PM
CRego3D CRego3D is offline
 
Join Date: May 2002
Posts: 82
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

any ideas?
Reply With Quote
  #13  
Old 09-13-2002, 06:58 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by CRego3D
any ideas?
PHP Code:
$numbersmembers=$DB_site->query_first('SELECT MAX(userid) AS max FROM user'); 
Reply With Quote
  #14  
Old 09-14-2002, 05:04 AM
CRego3D CRego3D is offline
 
Join Date: May 2002
Posts: 82
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

^^^^ That gives me users = 0 ..
Reply With Quote
  #15  
Old 09-17-2002, 07:08 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

After adding the line, you should use this variable in your templates:
$numbersmembers['max']
Reply With Quote
  #16  
Old 09-17-2002, 07:44 PM
CRego3D CRego3D is offline
 
Join Date: May 2002
Posts: 82
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

tried it .. still showed "0"
Reply With Quote
  #17  
Old 09-18-2002, 07:32 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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..
Reply With Quote
  #18  
Old 09-18-2002, 09:21 PM
wolfe wolfe is offline
 
Join Date: Jan 2002
Posts: 900
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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']);
Reply With Quote
  #19  
Old 09-19-2002, 08:59 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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..
Reply With Quote
  #20  
Old 11-30-2002, 04:53 PM
Legacy's Avatar
Legacy Legacy is offline
 
Join Date: Apr 2002
Posts: 26
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:09 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04319 seconds
  • Memory Usage 2,257KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_code
  • (3)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete