Member
Member
gracestanat   2009-12-15, 21:02
#1
Just updated to the nightly build (12/14/09). I updated from quite a ways back, so I doubt the problem I've encountered is due to this particular build. But the problem is nonetheless a VERY strange one. Some code that I have commented out seems to cause a problem. Here's my comment block:

` <!-- this was the original code we made:

<a>" title="<?php echo getImageTitle();?>"><?php printCustomSizedImageMaxHeight(480) ?></a>


Note that we don't have to worry about a Max Width since we can set that in the Admin options.

-->`

If I change it to this, it works:

` <!-- this was the original code we made:

<a>" title="<?php echo getImageTitle();?>"><?php SUBSTITURE ?></a>


SUBSTITUTE=printCustomSizedImageMaxHeight(480)

Note that we don't have to worry about a Max Width since we can set that in the Admin options.

-->`

So it's something to do with this text: printCustomSizedImageMaxHeight(480)

Changing it to any of the following makes the error go away:

` printCustomSizedImage(480)

printCustomSizedImageSOMETHING(480)`

But the following versions still cause the error:

` printCustomSizedImageMaxHeight(480)

printCustomSizedImageMax480)

printCustomSizedImageHeight(480) `

Needless to say, I am mystified. Any ideas?
Administrator
Administrator
acrylian   2009-12-15, 21:11
#2
You neither said from what version you upgrade nor what actually the problem is...

Anyway, the `MaxHeight` functions are deprecated and have been replaced by a set of `maxspace` functions (for fixed width x height) for some versions now so the plugin `deprecated-function` has to be enabled to use this function. Best is of course you update your theme. See the documentation for the `maxspace` ones.

Btw, PHP code within HTML comments is of course executed.
Member
Member
gracestanat   2009-12-16, 01:24
#3
Thanks for responding so quickly.

I didn't worry about the versions since I don't think that's the problem. I think the problem is in my coding syntax. And you seem to have verified that.

And yes, I realize that function is deprecated; I'm not using yet, but thanks for the tip about the plugin - that could be useful at some point.

I had no idea that php code within HTML comments is executed. So am I right that I have to comment out PHP code INSIDE the commented-out HTML code? Seems strange, but of course I can make that change.
Member
Member
sbillard   2009-12-16, 01:45
#4
The general rules of evaluation are that all php code is evaluated. Code within an html comment will generate part of that comment, which will, naturally, be commented out. That is how you can make specific comments like the ones at the bottom of your scripts that zenphot generates giving the version, etc.
  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.