vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   is this code have problem?? (https://vborg.vbsupport.ru/showthread.php?t=33078)

squawell 12-09-2001 03:38 PM

PHP Code:

$countposts=$DB_site->query_first("SELECT count(*) AS posts FROM post WHERE userid='$bbuserinfo[userid]'");
$todays=number_format($countposts[userposts]); 

this code is work but not perfect~~~

when i use admin account login it seems normal but i use member

account it seems wrong~~

for example:

admin login:show 11 posts--this is right!!

member login:show 0 or 1 posts--this is wrong!!

why??

Admin 12-09-2001 03:44 PM

Maybe the user you are using to login doesn't have any posts?

squawell 12-09-2001 03:54 PM

but i want it show up the forum topposter's post number

so if this code work whatever anyone login it should show up

the topposter's post number~~~

bira 12-09-2001 04:05 PM

$bbuserinfo[userid] is the id of the current viewer of the page.

If you are looking at the page logged in as user X who has 11 posts, it will show 11. If you are logged in as user Y who has 0 posts, it will show 0.

squawell 12-09-2001 04:25 PM

so now, how i to do can make it just like my last post say that

way??


All times are GMT. The time now is 03:29 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.00959 seconds
  • Memory Usage 1,715KB
  • 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
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete