![]() |
|
Thread Tools |
#1
|
||||||||||||||||
|
||||||||||||||||
![]()
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:
so I have my plugin like this (and yes the other variables are defined, this is just where the is)
and the template like this
and it breaks, the variable
works on its own, but nothing works when i add the portion above it.
__________________
If you need custom work done please use Dirt RIF CustUmz Owner of vBTeam vBulletin 3.8.14 DRC Edition PHP 7.4 Compatible- NOT a null, NOT complete files Requires a legit copy of vBulletin 3.8.11. No members have liked this post.
|
#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 No members have liked this post.
|
#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.
No members have liked this post.
|
#4
|
||||||||
|
||||||||
Template:
Plugin: hook : parse_templates
Note: This is just a randon guess! No members have liked this post.
|
#5
|
||||||||||||
|
||||||||||||
Originally Posted by PinkMilk
thanks pink, i did something similar, been reading through alot of articles on here to find anything similar. I ended up doing it all in the plugin since im calling multiple varibles throughout the html code as well.![]()
so my end results ended up being along these lines:
then just used the $cantTellYa variable in the template, this seems to work well, there are multiple spans and variables in the code, i just shortened everything to display it here.
__________________
If you need custom work done please use Dirt RIF CustUmz Owner of vBTeam vBulletin 3.8.14 DRC Edition PHP 7.4 Compatible- NOT a null, NOT complete files Requires a legit copy of vBulletin 3.8.11. No members have liked this post.
|
![]() |
Tags |
foreach, php, plugin, template |
«
Previous Thread
|
Next Thread
»
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
|
|
New To Site? | Need Help? |
All times are GMT. The time now is 05:43.