The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Foreach in plugin
So I am trying to use a foreach in my plugin and call it in my template with a variable, since my foreach is open it's breaking my product. How can I go about calling a foreach and include it in my template?
My before product, raw php: PHP Code:
so I have my plugin like this (and yes the other variables are defined, this is just where the is) PHP Code:
HTML Code:
$drc_4ch-st <div id="something"> <div class="really"><b>Cool:</b> $drc_rep</div> </div> $drcc_4ch-ed Code:
$drc_rep |
#2
|
||||
|
||||
I am no expert but …
1 - there is an extra semicolon at line 2 of your php code 2 - PHP variables, I think underscore should be used not dashes |
#3
|
|||
|
|||
Also PHP doesn't have any type of macro support like that (unlike C++ macro definitions using #define). You can't assign portions of a function to a variable and then execute the function as usual by calling the PHP variables in order.
|
#4
|
|||
|
|||
Template:
Code:
<div id="something"> <div class="really"><b>Cool:</b>$drc_rep</div> </div> hook : parse_templates PHP Code:
|
#5
|
||||
|
||||
Quote:
so my end results ended up being along these lines: PHP Code:
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|