Please help with passing vars to template
typo Offline
Junior Member
**
Posts: 1
Joined: Jun 2016
Post: #1
Sad Please help with passing vars to template
Hi!
      I've a problem with my forum passing php variables to template, I want I'cant pass $width y $height

I'm using a "MyBB Hacks" plugin and I can effectively use PHP in templates so this should work:

PHP Code:
<div style="float:right; display:inline-block; width: <?php echo $width; ?>px; height: <?php echo $height; ?>px; padding-left:10px; padding-right:10px; margin-left:10px; margin-right:10px; none repeat scroll 0% 0%;" > 


But not!  echo works but print nothing!

From controller-side I've this:

PHP Code:
$height = 240;
$width = 120;
// ...
eval("\$width = \"\$width\";");
eval("\$height = \"\$height\";");

I've been also trying with {$height} and {$width} with no-difference.

Now you can see the problem here, because "Ad here" in a green box at the right side of the first post should have a width of 120px but.... if you inspect the HTML you see it's EMPTY!

What can I fix this ?


BTW: the problem is NOT the plugin (it's great) but I need all the help I can get Smile

(This post was last modified: 06-02-2016 04:45 AM by typo.)
06-01-2016 06:38 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
Please help with passing vars to template - typo - 06-01-2016 06:38 AM

 Standard Tools
Forum Jump: