[Phpslash-commit] CVS: phpslash-ft/class Block_render_quote.class,1.4,1.5
Brought to you by:
joestewart,
nhruby
From: nathan h. <nh...@us...> - 2002-04-28 21:10:07
|
Update of /cvsroot/phpslash/phpslash-ft/class In directory usw-pr-cvs1:/tmp/cvs-serv29002/class Modified Files: Block_render_quote.class Log Message: fix errors in quote class Index: Block_render_quote.class =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/class/Block_render_quote.class,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Block_render_quote.class 5 Mar 2002 16:50:57 -0000 1.4 --- Block_render_quote.class 28 Apr 2002 01:32:39 -0000 1.5 *************** *** 2,6 **** /* Block_render_quote.class -> Random quote generator */ ! /* Id:$ */ class Block_render_quote { --- 2,6 ---- /* Block_render_quote.class -> Random quote generator */ ! /* $Id$ */ class Block_render_quote { *************** *** 12,22 **** /* constructor */ function Block_render_quote() { - global $_PSL; ! $this->type = "quote"; /* set the 'type' */ ! $this->output = ""; /* clear the output */ ! $this->psl = $_PSL; ! } --- 12,20 ---- /* constructor */ function Block_render_quote() { global $_PSL; ! $this->type = 'quote'; // set the 'type' ! $this->output = ''; // clear the output ! $this->psl = $_PSL; } *************** *** 26,59 **** } ! function parse( $block_info) { ! ! $this->output = $this->query( $block_info); ! return 1; } ! function query( $block_info) { ! $default_tpl = "quoteblock.tpl"; ! $options = $block_info["source_url"]; ! ! parse_str( $options, $ary); ! # parse_str( $options); ! $ary[tpl] = ""; // disable template option ! if( empty($ary[tpl]) ) { $tpl = $default_tpl; ! } elseif ( file_exists($this->['templatedir'] . "/" . basename($ary['tpl']) . ".tpl") ) { ! # should be secure as path directives are discarded and extension added ! $tpl = basename($ary['tpl']) . ".tpl"; } else { ! debug ( "Block_render_quote:Template file doesn't exist, using default instead", $tpl); $tpl = $default_tpl; ! } ! ! $template = new Template($this->[templatedir]); $template->debug = 0; $template->set_file(array( ! block => "$tpl" )); --- 24,58 ---- } ! function parse($block_info) { ! $this->output = $this->query($block_info); ! return TRUE; } ! function query($block_info) { ! // nh - This should be an object property in a skel class... ! $default_tpl = 'quoteblock.tpl'; ! $options = $block_info['source_url']; ! parse_str($options, $ary); ! # parse_str($options); ! ! $ary['tpl'] = ''; // disable template option ! ! if (empty($ary['tpl'])) { $tpl = $default_tpl; ! } elseif (file_exists($this->psl['templatedir'] . '/' . basename($ary['tpl']) . '.tpl')) { ! // should be secure as path directives are discarded and extension added ! $tpl = basename($ary['tpl']) . '.tpl'; } else { ! debug('Block_render_quote::Template file does not exist, using default instead', $tpl); $tpl = $default_tpl; ! } ! ! $template = new Template($this->psl['templatedir']); $template->debug = 0; $template->set_file(array( ! 'block' => $tpl )); *************** *** 75,84 **** $template->set_var(array( ! 'QUOTE' => $db->f("quote"), ! 'AUTHOR' => $db->f("author") )); unset($db); ! return $template->parse('OUT',"block"); } --- 74,83 ---- $template->set_var(array( ! 'QUOTE' => $db->f('quote'), ! 'AUTHOR' => $db->f('author') )); unset($db); ! return $template->parse('OUT','block'); } |