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.
|