The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Would like custom thread content
I have a music database and I'd like to be able to dynamically generate posts from the contents of my database. So far I know that templates are just xhtml snippets and can't call PHP code. I also know that hooks allow me to call php code (which is how I must access my database).
So what's the best way to merge the two? I only want the dynamic content on a single sub-forum -- not on a global basis. It looks to me that hooks are called globally. I don't want that. I'd like to have the posts auto-generated when a song is submitted. For example, a Title/Subject only: Song ID-4567 When somebody clicks on the thread entitled "Song ID-4567" then a dynamically generated page will display information about the song (length, recording mode, studio, venue, date, etc.). This needs to be dynamic because some of the information might change -- and that information comes directly from the database. I'm a newb to vBulletin, but a very seasoned programmer with dozens of languages (including php) under my belt. So just a few pointers in the right direction is probably all I need. Frank --------------- Added [DATE]1277168627[/DATE] at [TIME]1277168627[/TIME] --------------- So here's an idea I think should work. I could hook one of the thread or postbit hooks to call my custom PHP code. I could reduce overhead by checking for the forumID and skipping the call to my php code if the forumID doesn't match. Assuming I'm in the proper forum, I'd parse the message title to get my music database ID. Call my custom PHP page rendering code with the database ID, and place the output into a PHP variable. The PHP variable is referenced in the proper postbit template and displayed on the screen. I'm pretty sure this approach will work. But which hook do I use? Do I use one of the thread hooks, or post hooks? Which is most appropriate -- and specifically which one? If there's a tutorial, I'll look there...but where't the tutorial or FAQ for all of these hooks? Frank |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|