The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Trying to understand array's and rendering
So, I'm trying to convert my mod over to vB4 completely. I have most of it worked out, but now I'm trying to make it easier for the users to update the fields and titles they want to use. In the current version, the user has to go around and update the fields and titles they want to use in multiple places. I want to make it so they only have to do it once. Eventually, I want to make it so they can do it from a vB options page, but I'm taking baby steps. I want to get the variables working first. So, here is what I've done.
PHP Code:
Anyhow, here is the cool thing. groupsort is used to store the current title being sorted. In the template, if I use the following: {vb:var user.{vb:var groupsort}}, it works perfectly and gives the correct title of the current usergroup. Also, using {vb:var columns.title1} and {vb:var columns.column1} work fine in the template. Although, when I try to use {vb:var user.{vb:var columns.column1}}, the spot is blank. I've even replaced var with raw for testing, and it is still blank. I'm not sure what I missed, but I'm sure it is some beginner mistake. Either that, or array's can't be doubled up like a regular variable can be (i.e. {vb:var user.{vb:var groupsort}}). I can provide the entire code if someone is interested and that is needed to figure out my problem. Thanks for your time. |
#2
|
||||
|
||||
Hmmm, maybe {vb:var user.{$columns[column1]}}
Not really sure, but I'd play around with that. |
#3
|
|||
|
|||
Lynne, thank you for giving me the inspiration of adding the brackets. I figured the brackets couldn't be used in the newer way, but this looks to have done the trick. I'll test it out more later and confirm.
{vb:var user.{vb:var columns[column6]}} |
#4
|
||||
|
||||
Oh, that's an interesting way you ended up doing it! I would not have thought of that.
|
#5
|
|||
|
|||
Thanks, I hope. For the record, I did try your way and other similiar ways. That one was the only one that worked though. Fun fun fun, I really enjoy learning this stuff.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|