Update of /cvsroot/phpslash/phpslash-ft/class
In directory usw-pr-cvs1:/tmp/cvs-serv10348/phpslash-ft/class
Modified Files:
Block_render_skin.class Block_render_html.class
Block_render_topic.class Block_render_section.class
Block_render_quote.class Block_render_poll.class
Block_render_cal.class
Log Message:
object cleanup
Index: Block_render_skin.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/Block_render_skin.class,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Block_render_skin.class 7 Feb 2002 21:19:54 -0000 1.4
--- Block_render_skin.class 5 Mar 2002 16:50:57 -0000 1.5
***************
*** 18,112 ****
class Block_render_skin {
! var $type;
! var $output;
! /* constructor */
! function Block_render_skin() {
! global $_PSL;
! $this->type = "skin"; /* set the 'type' */
! $this->output = ""; /* clear the output */
! $this->psl = $_PSL;
! }
! /* returns the TYPE of this class */
! function getType() {
! return $this->type;
! }
! function parse( $block_info) {
! $this->output = $this->skin( $block_info);
! // $this->output = "";
! return 1;
! }
! function skin( $block_info) {
! $db = new SlashDB;
! $default_tpl = "skinsblock.tpl";
! $options = $block_info["source_url"];
! parse_str( $options);
! if ($this->psl['skin']) {
! $skin = $this->psl['skin'];
! } else {
! $skin = $this->psl['defaultskin'];
! $this->psl['templatedir]'] .= $skin;
! }
! // remove "skin" from templatedir
! $templatedir = substr( $this->psl['templatedir'], 0, strrpos($this->psl['templatedir'], "/") );
! // $tpl = ""; // disable template option
! if( empty($tpl) ) {
! $tpl = $default_tpl;
! } elseif ( file_exists($templatedir . "/" . basename($tpl) . ".tpl") ) {
! $tpl = basename($tpl) . ".tpl";
! } else {
! debug ( "Block_render_skin:Template file doesn't exist, using default instead", $tpl);
! $tpl = $default_tpl;
! }
! $template = new Template($templatedir . "/" . $skin);
! $template->debug = 0;
! $template->set_file(array(
! 'block' => $tpl
! ));
! $template->set_block ("block", "each_skin", "skin_block");
! $template->set_var (array (
! 'SKIN' => "",
! 'ROOTDIR' => $this->psl['rooturl'],
! 'IMAGEDIR' => $this->psl['imageurl'],
! 'PHP_SELF' => $this->psl['phpself']
! ));
! $fulldirlist = dir($templatedir . "/");
! while( $eachfile = $fulldirlist->read()) {
! if( (@is_dir($templatedir . "/" . $eachfile)) AND
( $eachfile != ".") AND
( $eachfile != "..") AND
( $eachfile != "CVS") ) {
! $template->set_var(array(
! SKIN => $eachfile
! ));
! $template->parse("skin_block","each_skin",true);
}
}
! $output = $template->parse('OUT',"block");
!
! return $output;
! }
! function getFinal() {
! return $this->output;
! }
}
--- 18,113 ----
class Block_render_skin {
! var $type;
! var $output;
! /* constructor */
! function Block_render_skin() {
! global $_PSL;
! $this->type = "skin"; /* set the 'type' */
! $this->output = ""; /* clear the output */
! $this->psl = $_PSL;
! }
! /* returns the TYPE of this class */
! function getType() {
! return $this->type;
! }
! function parse( $block_info) {
! $this->output = $this->skin( $block_info);
! // $this->output = "";
! return 1;
! }
! function skin( $block_info) {
! $db = new SlashDB;
! $default_tpl = "skinsblock.tpl";
! $options = $block_info["source_url"];
! parse_str( $options);
! if ($this->psl['skin']) {
! $skin = $this->psl['skin'];
! } else {
! $skin = $this->psl['defaultskin'];
! $this->psl['templatedir]'] .= $skin;
! }
! // remove "skin" from templatedir
! $templatedir = substr( $this->psl['templatedir'], 0, strrpos($this->psl['templatedir'], "/") );
! // $tpl = ""; // disable template option
! if( empty($tpl) ) {
! $tpl = $default_tpl;
! } elseif ( file_exists($templatedir . "/" . basename($tpl) . ".tpl") ) {
! $tpl = basename($tpl) . ".tpl";
! } else {
! debug ( "Block_render_skin:Template file doesn't exist, using default instead", $tpl);
! $tpl = $default_tpl;
! }
! $template = new Template($templatedir . "/" . $skin);
! $template->debug = 0;
! $template->set_file(array(
! 'block' => $tpl
! ));
! $template->set_block ("block", "each_skin", "skin_block");
! $template->set_var (array (
! 'SKIN' => "",
! 'ROOTDIR' => $this->psl['rooturl'],
! 'IMAGEDIR' => $this->psl['imageurl'],
! 'PHP_SELF' => $this->psl['phpself']
! ));
! $fulldirlist = dir($templatedir . "/");
! while( $eachfile = $fulldirlist->read()) {
! if( (@is_dir($templatedir . "/" . $eachfile)) AND
( $eachfile != ".") AND
( $eachfile != "..") AND
( $eachfile != "CVS") ) {
!
! $template->set_var(array(
! SKIN => $eachfile
! ));
! $template->parse("skin_block","each_skin",true);
}
}
! $output = $template->parse('OUT',"block");
! unset($db);
! return $output;
! }
! function getFinal() {
! return $this->output;
! }
}
Index: Block_render_html.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/Block_render_html.class,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Block_render_html.class 15 May 2001 22:36:15 -0000 1.1
--- Block_render_html.class 5 Mar 2002 16:50:57 -0000 1.2
***************
*** 6,43 ****
class Block_render_html {
! var $type;
! var $output;
! /* constructor */
! function Block_render_html() {
! $this->type = "html"; /* set the 'type' */
! $this->output = ""; /* clear the output */
! }
! /* returns the TYPE of this class */
! function getType() {
! return $this->type;
! }
! function parse($block_info) {
! $sl_q = new slashDB;
! $query = "SELECT cache_data
FROM psl_block
! WHERE id = " . $block_info["id"];
! $sl_q->query($query);
! if ($sl_q->next_record()) {
! $this->output = $sl_q->f("cache_data");
! return 1;
! } else {
! return 0;
! }
! }
! function getFinal() {
! return $this->output;
! }
}
--- 6,50 ----
class Block_render_html {
! var $type;
! var $output;
! /* constructor */
! function Block_render_html() {
! $this->type = "html"; /* set the 'type' */
! $this->output = ""; /* clear the output */
! }
! /* returns the TYPE of this class */
! function getType() {
! return $this->type;
! }
! function parse($block_info) {
! $this->output = $block_info["cache_data"];
! return 1;
!
! /*
! $sl_q = new slashDB;
! $query = "SELECT cache_data
FROM psl_block
! WHERE id = " . $block_info["id"];
! $sl_q->query($query);
! if ($sl_q->next_record()) {
! $this->output = $sl_q->f("cache_data");
! return 1;
! } else {
! return 0;
! }
! unset($db);
! */
!
! }
! function getFinal() {
! return $this->output;
! }
}
Index: Block_render_topic.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/Block_render_topic.class,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Block_render_topic.class 3 Feb 2002 02:49:39 -0000 1.6
--- Block_render_topic.class 5 Mar 2002 16:50:57 -0000 1.7
***************
*** 145,149 ****
$output = $template->parse('OUT',"block");
!
return $output;
--- 145,149 ----
$output = $template->parse('OUT',"block");
! unset($db);
return $output;
Index: Block_render_section.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/Block_render_section.class,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** Block_render_section.class 7 Feb 2002 17:54:22 -0000 1.7
--- Block_render_section.class 5 Mar 2002 16:50:57 -0000 1.8
***************
*** 123,126 ****
--- 123,127 ----
));
+ unset($db);
return $template->parse('OUT',"block");
Index: Block_render_quote.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/Block_render_quote.class,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Block_render_quote.class 3 Feb 2002 02:49:39 -0000 1.3
--- Block_render_quote.class 5 Mar 2002 16:50:57 -0000 1.4
***************
*** 79,82 ****
--- 79,83 ----
));
+ unset($db);
return $template->parse('OUT',"block");
Index: Block_render_poll.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/Block_render_poll.class,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Block_render_poll.class 3 Feb 2002 02:49:39 -0000 1.2
--- Block_render_poll.class 5 Mar 2002 16:50:57 -0000 1.3
***************
*** 34,37 ****
--- 34,38 ----
}
$this->output = $this->poll->getPollBooth($question_id);
+ unset($this->poll);
}
Index: Block_render_cal.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/Block_render_cal.class,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Block_render_cal.class 6 Feb 2002 20:46:52 -0000 1.4
--- Block_render_cal.class 5 Mar 2002 16:50:57 -0000 1.5
***************
*** 117,120 ****
--- 117,121 ----
$templ->parse('OUT',array("calendar"));
$this->output = $templ->get('OUT');
+ unset($cal_q);
}
|