vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Custom query in postbit (https://vborg.vbsupport.ru/showthread.php?t=206271)

leenster 02-22-2009 09:29 PM

Custom query in postbit
 
Hey guys in my vb database i have a custom table that contains information about our users. We run a couple game servers and in that table we have the stats of our members.

my question is how do i add some of this info into the postbit?

The info can be linked through a custom profile field.

so
let say the custom table is called stats

Select * from stats where playername='$post[fieldXX]';

where would i put the query?
how do i display this only if the member has the custom profile field filled in?

thanks in advance ..

TigerC10 02-22-2009 10:19 PM

Have you done a search of the forums?

https://vborg.vbsupport.ru/showthread.php?t=166290

leenster 02-22-2009 10:59 PM

I know how to display a custom field, that one is easy.... showing info from a custom table i am not sure about.... thanx though

Lynne 02-22-2009 11:11 PM

I'm not sure I completely understand. Are you looking for the stats info for the user who's post you are seeing? If so, I'm not sure you mean playername='$post[fieldXX]', but instead playername='$post[username]', right? If so, then I think you can hook into the $posts query to grab that info. You'd have to ask for the columns you want (I wouldn't suggest doing stats.*, but instead exactly which fields you want) and also do a JOIN.

leenster 02-22-2009 11:23 PM

i do mean playername='$post[fieldXX]' < that contains the name of the player in the game, but yes i do want to show the stats of the person that posted...

the custom table does not contain the users name on the forum, just his playername

how do i hook into the post query?

Lynne 02-23-2009 03:33 AM

If you want to hook into the $posts query, then I think you would use the hook location 'showthread_query'. I'm not great at joins (the different types still confuse me), so I can't help with that part.

Dismounted 02-24-2009 04:47 AM

Quote:

Originally Posted by Lynne (Post 1751980)
I'm not great at joins (the different types still confuse me), so I can't help with that part.

Most of the time, a left [outer] join will fit the bill.


All times are GMT. The time now is 07:58 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.00977 seconds
  • Memory Usage 1,720KB
  • 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_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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