vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   mySQL Query in Custom vB Page (https://vborg.vbsupport.ru/showthread.php?t=172184)

NoPretender 03-05-2008 06:34 PM

mySQL Query in Custom vB Page
 
I've basically created a custom Portal for my vB based site. vbAdvanced wasn't as customizable as I wanted it to be, or at least it was easier to just make my own. Anyways, I just about have it completed and am now working on the "News" portion of the portal. I want to query the database, pull the 5 latest threads from a forum and display the username, title, post, views, etc onto the page.

So the page would query the database, pull * from threads where forumid = 11. Then run a while loop outputting the array into a fancy table.

Now my question is, where do I put the mysql query and loop code? Do I create a plugin, call the plugin in the template? Put it in a function in a PHP page and call the function from the template? I'm pretty familiar with vB and coding but haven't gone this far into it. I just need a starting point/idea and from there I should be good to go. Thanks in advance, it's much appreciated.

Dismounted 03-06-2008 04:28 AM

You call your queries in your portal PHP page.

NoPretender 03-06-2008 08:02 PM

Thanks, I tried that yesterday but was going about it all wrong, now got it working. Thanks for your help :)


All times are GMT. The time now is 06:50 PM.

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.01016 seconds
  • Memory Usage 1,705KB
  • 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)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