1
trspice
Trying to use a smarty tag in an IFrame - need help
  • 2007/12/20 8:11

  • trspice

  • Not too shy to talk

  • Posts: 193

  • Since: 2007/3/24


I have a popup window with a video screen and want to place banner ads on the page using the RW_banner module. The popup is a simple module and is recognized with a smarty switch at the top of theme.html. This allows a different design to show for the popup.
Quote:

<{if $xoops_dirname == "videos"}>
<{include file="default/videos.html"}>
<{else}>
Show the default theme layout coding
<{/if}>


The videos.html file only has the center block and $xoops_contents and is formatted like this
Quote:

<{foreach item=block from=$xoops_ccblocks}>
<{include file="default/center.html"}>
<{/foreach}>
<hr />
<{$xoops_contents}>


This is the module
Quote:

<?php
include("../../mainfile.php");
include(XOOPS_ROOT_PATH."/header.php");
$xoopsOption['show_rblock'] = 1;
?>

<iframe width="400" height="195" frameborder="0" scrolling="none" name="vidadverts" src="videoads.php">
</iframe>
<?php
include(XOOPS_ROOT_PATH."/footer.php");

?>


I want the adbanners to change at 60 sec intervals so I decided on IFrame which would refresh itself using the Meta refresh. I created the file with the banner like this; videoads.php

Quote:

<?php
include("../../mainfile.php");
include("include/functions.php");

echo "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'>";
echo "<html>";
echo "<head>";
echo "<meta http-equiv='refresh' content='60'>";
echo "</head>";
echo "<body>";

echo "<{$adverts}>"; //this is the rw_banner tag

echo "</body>";
echo "</html>";

?>


Everything works fine except the banner smarty tag. I have tried many ways without success. Can anyone suggest the proper way to call the smarty tag
There's nothing but science....
The Reggae Album

2
Quest
Re: Trying to use a smarty tag in an IFrame - need help
  • 2007/12/20 11:54

  • Quest

  • Friend of XOOPS

  • Posts: 1034

  • Since: 2005/11/19


Try

echo $adverts //without the <{ and }>

Quest

3
trspice
Re: Trying to use a smarty tag in an IFrame - need help
  • 2007/12/20 16:52

  • trspice

  • Not too shy to talk

  • Posts: 193

  • Since: 2007/3/24


Thanks for the suggestion Quest. I did try that but the page returns empty. Here are the methods and results I tried;
Quote:

echo "<{$adverts}>"; //returns <>
echo '<{$adverts}>'; //returns <{$adverts}>
echo "$adverts"; //returns empty page
echo $adverts; //returns empty page


Does the file need a smarty interpreter? I figured functions.php had the interpreter.
There's nothing but science....
The Reggae Album

4
Will_H
Re: Trying to use a smarty tag in an IFrame - need help
  • 2007/12/20 17:30

  • Will_H

  • Friend of XOOPS

  • Posts: 1786

  • Since: 2004/10/10


So you created a custom module? Did you hook the modules?

5
Quest
Re: Trying to use a smarty tag in an IFrame - need help
  • 2007/12/20 17:55

  • Quest

  • Friend of XOOPS

  • Posts: 1034

  • Since: 2005/11/19


I'm not so sure you need the semi-colon after the $adverts

echo=$adverts

assuming of course you have defined $adverts (where it is)

as far as I know smarty is located in xoops/class/smarty , not sure if that will help you or not. Have a look at it and see...

Best of luck,
Quest

6
wizanda
Re: Trying to use a smarty tag in an IFrame - need help
  • 2007/12/20 19:27

  • wizanda

  • Home away from home

  • Posts: 1585

  • Since: 2004/3/21


Smarty renders the templates of XOOPS and so to use Smarty variables, it needs to be in the template…
The variables can be assigned to Smarty in the PHP and also in the template if needed....

Login

Who's Online

247 user(s) are online (151 user(s) are browsing Support Forums)


Members: 0


Guests: 247


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits