The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
loop & customfields
Can I do a while loop in the templates ?
I need to list all the choices choose in a multiple selection box in the postbit template Thanks for reading! |
#2
|
|||
|
|||
Not in templates, do it in a plugin and assign it to a variable. Use this variable in your template.
|
#3
|
||||
|
||||
how would I do that ?
|
#4
|
||||
|
||||
Add a plugin for postbit_display_start that has the following code:
PHP Code:
|
#5
|
||||
|
||||
I tried this
PHP Code:
|
#6
|
|||
|
|||
Why are you using a while() loop with a custom field as the condition? Are you sure you're not looking for something like foreach() ? You need some kind of list or something to cycle through. I recommend you read up on the basics of PHP (and loops) before you progress further, else we will probably be here all day trying to explain. You can find many tutorials through a quick google search or the php.net site.
Basically you need something to loop through like an array of data (maybe by using explode() on the custom field?) or a database fetch or something but the code you posted doesn't indicate anything of the sort. |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|