PDA

View Full Version : Category conditional? Or way to emulate it through plugin?


TheMilkCarton
06-21-2007, 11:00 AM
I was wondering if there was any way at ALL to apply a conditional to all forum id's under a certain category? A long array of $forumid's is really not an option... or I'd be typing out hundreds of $forumid's. There is obviously some way that vBulletin keeps track of what category a forum belongs to, so is there a way to utilize this in a plugin?

Dismounted
06-22-2007, 06:23 AM
parentid or something like that, check in the forum table.

TheMilkCarton
06-22-2007, 07:55 AM
Oh geez.. I'm pretty bad with query stuff... I'll probably butcher the terminology.. so here goes the basic idea:

So I need to write a query to call "parentid" (or whatever it is called) from the forum table, assign it to a variable, and then just say if ($parentid == 1)
{ code here }

Why isn't $parentid already a variable like $forumid? It seems pretty useful.

EDIT: I just found an instance of "$foruminfo[parentid]" in FORUMDISPLAY... So do I even need to go the plugin route? It seems like I could just get by with <if condition="$foruminfo[parentid] == 1"> code <else /> other code </if> if there's at least one use of it in a template.

Well, I feel kind of stupid now.. :) I really need to learn all of my vBulletin variables. Of course watch me not actually be able to use $foruminfo[parentid] how I'd want to.

Dismounted
06-22-2007, 08:04 AM
$forum['parentid'] or $foruminfo['parentid'], whichever works.