The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Question: How do you display custom (non-vb) array variables in templates?
I am sure it is something silly, either that or it can't be done at all.
This is what I mean: I have a script that allows me to: In php I can get the right value by putting: $myarray[$increment]->fieldtodisplay Which will pull all fields from the result list that I queried in the previous function. Now whenever I try to add the above variable into vbulletin's templating system it will only output the first value. The query itself is working fine, it is just the display end of it. For example if I go to the "next page" it will display the correct FIRST ENTRY of that page. Entry into template is: {$myarray[$increment]->fieldtodisplay} Is there anyway to get vbulletin templates to correctly display ALL values of custom arrays? I am sure it is one of those things that is either incredibly simple, or just a matter of "it doesn't work, sorry" but, it would save me some time if someone could give me a heads up either way. Thanks! ~Attilitus Edit: Here are some examples of what I want to do: Quote:
Now, putting an echo function within the for() loop displays all values, however, defining a variable within the for () loop will only store one variable to be pulled by the template. Since I want to use a vbulletin template to display the values, this is obviously a problem. Can anyone at least point me in the right direction? |
#2
|
|||
|
|||
When you do a loop like that for elements of a list, it's usually done with a bits template.
So, my suggestion would be to have a template like so... HTML Code:
<li>$artist</li> PHP Code:
HTML Code:
<ul> $artistbits </ul> |
#3
|
||||
|
||||
First off thanks for your response!
However, I can't seem to get that code to work... Is there something that I am missing? I set everything up "exactly" as you said. Edit: Nevermind, it is working now, I was working with templates that were being overriden by child styles when testing. Thanks! I had been trying to figure this out all last night. |
#4
|
|||
|
|||
Glad to help. It's even better when the help get ya there.
Good job! |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|