Re: Re[2]: [SMARTY] smarty and sympoll

From: Date: Tue, 06 Aug 2002 13:05:27 +0000
Subject: Re: Re[2]: [SMARTY] smarty and sympoll
References: 1 2 3  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-5601@lists.php.net to get a copy of this message
----- Original Message ----- From: "Michał Krowiarz" <michal@probasket.pl> > Tuesday, August 06, 2002, 11:07:47 AM, you wrote: > > > Here's a piece of the code I used to integrate sympoll in an existing site > > using Smarty: > > > require 'sympoll/booth.php'; > $tpl->>assign("poll", newest_booth(1)); > > > > And you've only got to put a {$poll} tag in your template. > > yes, i've tried that and there's another problem: the poll appears > before anything else on the site, but the {$poll} variable is placed > in a table cell <td>{$poll}</td> on the lower part of the site. does > anyone have any suggestions how to prevent the poll code from being > executed before <html><head> elements?? I think I know the reason why. Someone could suggest you to RTFM ;) If you look at the README of Sympoll, there's a statement about using Sympoll with templates. You've got to edit booth.php and go to the last 3 lines of code in the file. Here's what you should have: # for use with templates, you can optionally change the following # three functions to use return instead of echo. this will return # all the text instead of directly displaying it. function display_booth($pid) { return get_booth($pid); } function random_booth() { return get_booth(-1); } function newest_booth() { return get_booth(-2); } The original functions use 'echo' instead of 'return'. I hope this helps. cya! -- Valerio Santinelli One Man Crew Gaming Community (http://www.onemancrew.org) My Lab (http://tanis.hateseed.com) HateSeed.com Founder (http://www.hateseed.com) In Flames Italia Webmaster (http://www.inflames.it)

« previous php.smarty.general (#5601) next »