The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Adding/accessing a forum database field
I'm new to VBulletin programming. I've been searching through what documentation I could find, but a lot of it is cryptic to me (probably because I don't understand the programming structure of VBulletin).
I would like to add a field to the forum database (say "X") and be able to access $foruminfo[X] in a conditional such (i.e., <if condition="$forum[X] == Something"> Do something </if> Can someone walk me through the best way to accomplish this? Thanks, Chuck |
#2
|
||||
|
||||
Quote:
alter table forum add column column definition the new field will be available in $foruminfo, which itself is set when you call global.php Of course populating said field is another matter entirely. I am not a big fan of modifying core vb tables. I always set up a second table in my own db which keys on forumid (or whatever key is appropriate), then store/fetch to that table as needed. |
#3
|
|||
|
|||
Thanks. I actually tried that before I posted my question but putting $foruminfo[x] in the header text did not yield the populated value. Are other changes necessary?
I would prefer to create my own table but have no idea how to access the values from within the header text. Thanks again, Chuck |
#4
|
||||
|
||||
Quote:
at any rate, $foruminfo needs to be scoped (a global$foruminfo) before the call to the template, and you have to use the correct syntax in the template, which may involve playing around with what is quoted. |
#5
|
|||
|
|||
Quote:
Thanks for your help. Best, Chuck |
#6
|
|||
|
|||
More information: if I force $usecache to false in fetch_foruminfo $foruminfo[X] exists. If I let it remain true $foruminfo[X] does not exist.
I'm not sure what this means though. --------------- Added [DATE]1192938289[/DATE] at [TIME]1192938289[/TIME] --------------- Immediately after typing the above I put together the name "forumcache" with the fact that one has to save the display order after an import. When I did that it cached the field and now I have what I need. I'm sorry for the wasted bandwidth. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|