vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Querying the Database (https://vborg.vbsupport.ru/showthread.php?t=96664)

Reven 09-21-2005 04:44 PM

Querying the Database
 
I asked over at vBulletin.com's forums (here) and was directed here for custom modifications.

I'm trying to do a custom member map for my forums, but I can't get round this.

I want to query a table I've made in the database which contains information about the members' locations, but I can't figure out how to do it. I've made a raw PHP file which calls the template I've made.

Do I have to call from another PHP file by means of include(), or is there an easier way?

Does it have anything to do with Replacement Variables?

Thanks in advanced.

Marco van Herwaarden 09-21-2005 04:56 PM

this will depend on a lot of things, for example are you going to retrieve just 1 record, or more. Are you including global.php to make vB functions available?

Easiest would be if you posted the script you got until now.

Reven 09-21-2005 05:12 PM

I've not written a script yet, as I don't know where to start with this. I can do all the querying stuff fine in PHP, but the problem I have is where to put the actual PHP code that queries stuff from the database. It will include the vB template, so I'll have all the usual global.php stuff and navbars etc.

Basically, do the custom query codes have to go within a [do] function, like this:
PHP Code:

if ($_REQUEST['do'] == "blah blah")
{
do 
certain query;


Do they go somewhere else, such as a template bit (I've found one called 'PHP Include Templates', is this where I assign variables to my queries?), or do they have to be embedded in the actual php file?

Sorry if this is confusing.

NB. I've not yet upgraded my board to 3.5.0 RC X from 3.0.8, we're waiting for the Gold version, but I've read about Hooks and Plugins - does this allow you to specify custom PHP code and have it called from a custom php file?


All times are GMT. The time now is 08:04 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.00929 seconds
  • Memory Usage 1,714KB
  • 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
  • (3)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