Date: 06/09/01
- Next message: Dima Nemchenko: "Re: [phplib] Template Problems"
- Previous message: Chris Johnson: "RE: [phplib] Which M to FR"
- Next in thread: Dima Nemchenko: "Re: [phplib] Template Problems"
- Reply: Dima Nemchenko: "Re: [phplib] Template Problems"
- Reply: darrylross: "Re: [phplib] Template Problems"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi,
I have the following code which is supposed to replace a block in my code
with nothing (ie remove it ;-)) but it doesn't work :-(
Please help, 'cause what I'm doing hinges on getting this to work!
Thanks
Peter.
=== Start of code ===
$tpl = new Template(".");
$tpl->set_file(array("message" => "$template.tpl", "card" => "card.tpl"));
$tpl->set_var("IMAGE", $image);
[snip]
$tpl->set_var("MUSIC", $music);
if ($music == "") {
$tpl->set_block("message", "music_block");
$tpl->set_var("music_block", "");
// $tpl->parse("music_block", "");
}
$tpl->parse("CONTENT", "message");
$tpl->pparse("CONTENT", "card");
======
Where $music comes from the form input on the page before.
The number of variables present in this code has been drastically reduced
for these examples!
message.tpl contains the following:
[snipped to save space]
<.image src="{IMAGE}">
<!-- BEGIN music_block -->
<object id="sound" classid="clsid:05589FA1-C356-11CE-BF01-00AA0055595A"
align="baseline" border="0" width="0" height="0">
<param name="ShowDisplay" value="0">
<param name="ShowControls" value="1">
<param name="ShowPositionControls" value="0">
<param name="ShowSelectionControls" value="0">
<param name="ShowTracker" value="0">
<param name="MovieWindowSize" value=0>
<param name="FullScreenMode" value="0">
<param name="MovieWindowWidth" value="0">
<param name="MovieWindowHeight" value="0">
<param name="AutoStart" value="1">
<param name="AutoRewind" value="1">
<param name="PlayCount" value="1">
<param name="SelectionStart" value="0">
<param name="Appearance" value="1">
<param name="BorderStyle" value="0">
<param name="FileName" value="music/{MUSIC}">
<param name="DisplayMode" value="0">
<embed src = "music/{MUSIC}" autostart="true" hidden="true" loop="true">
</embed>
<!-- END music_block -->
=== end of code ===
--oOo--
Narrow Gauge on the web - photos, directory and forums!
http://www.narrow-gauge.co.uk
--oOo--
Peter's web page - Scottish narrow gauge in 009
http://members.aol.com/reywob/
--oOo--
---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>
--oOo--
Narrow Gauge on the web - photos, directory and forums!
http://www.narrow-gauge.co.uk
--oOo--
Peter's web page - Scottish narrow gauge in 009
http://members.aol.com/reywob/
--oOo--
---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>
- Next message: Dima Nemchenko: "Re: [phplib] Template Problems"
- Previous message: Chris Johnson: "RE: [phplib] Which M to FR"
- Next in thread: Dima Nemchenko: "Re: [phplib] Template Problems"
- Reply: Dima Nemchenko: "Re: [phplib] Template Problems"
- Reply: darrylross: "Re: [phplib] Template Problems"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

