[Phpslash-commit] CVS: phpslash-ft/class Story.class,1.49,1.50
Brought to you by:
joestewart,
nhruby
From: Joe S. <joe...@us...> - 2003-01-23 12:03:19
|
Update of /cvsroot/phpslash/phpslash-ft/class In directory sc8-pr-cvs1:/tmp/cvs-serv30540/phpslash-ft/class Modified Files: Story.class Log Message: getStory and getStories alternate template tweaks Index: Story.class =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/class/Story.class,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** Story.class 23 Jan 2003 02:48:03 -0000 1.49 --- Story.class 23 Jan 2003 12:03:16 -0000 1.50 *************** *** 232,236 **** function getStory($story_id, $mode, $argv_ary="", $tpl="") { ! $default_tpl = "printStory"; /* * Call to _base layer for getting the Story stuff out the DB --- 232,236 ---- function getStory($story_id, $mode, $argv_ary="", $tpl="") { ! $default_tpl = "story.tpl"; /* * Call to _base layer for getting the Story stuff out the DB *************** *** 305,327 **** if( ($thestory == "") AND ($mode == "full") ) { ! if( empty($tpl) ) { ! $template = $default_tpl; ! } elseif ( file_exists($this->psl['templatedir'] . "/" . basename($tpl) . ".tpl") ) { ! $tpl_file = basename($tpl) . ".tpl"; ! $this->template->set_file(array( ! "template" => "$tpl_file" ! )); ! $template = "template"; } else { ! debug ( "Story.class::getStory:Template file doesn't exist, using default instead", $tpl); ! $template = $default_tpl; ! } ! /* We only need to set the block the first time we use it, beacuse all the variables stay there -nh */ if ($this->template->get_var("row") == "") { ! $this->template->set_block($template,"alsotext","alsoblock"); ! $this->template->set_block($template,"row","rows"); } --- 305,320 ---- if( ($thestory == "") AND ($mode == "full") ) { ! if( $tpl == '') { ! $this->template->set_file( 'template', $default_tpl); ! } elseif ( $this->template->set_file('template' , basename($tpl) . ".tpl" )) { } else { ! $this->template->set_file( 'template', $default_tpl); ! } /* We only need to set the block the first time we use it, beacuse all the variables stay there -nh */ if ($this->template->get_var("row") == "") { ! $this->template->set_block('template',"alsotext","alsoblock"); ! $this->template->set_block('template',"row","rows"); } *************** *** 392,396 **** } ! $this->template->parse('STORY', $template); $thestory = $this->template->get('STORY'); if( $cache_ary[$story_name]['expire'] > 0) { --- 385,389 ---- } ! $this->template->parse('STORY', 'template'); $thestory = $this->template->get('STORY'); if( $cache_ary[$story_name]['expire'] > 0) { *************** *** 437,441 **** # debug("Story::getStories.ary", $ary); ! $default_tpl = "indexstory"; $topic_id_ary = array(); --- 430,434 ---- # debug("Story::getStories.ary", $ary); ! $default_tpl = "storyIndex.tpl"; $topic_id_ary = array(); *************** *** 445,463 **** } ! if( empty($tpl) ) { ! $template = $default_tpl; ! } elseif ( file_exists($this->psl['templatedir'] . "/" . basename($tpl) . ".tpl") ) { ! $tpl_file = basename($tpl) . ".tpl"; ! $this->template->set_file(array( ! "template" => "$tpl_file" ! )); // reset previous values unset($this->template->varvals['template']); ! unset($this->template->varkeys['template']); ! $template = "template"; } else { ! debug ( "Story.class::getStories:Template file doesn't exist, using default instead", $tpl); ! $template = $default_tpl; ! } /* --- 438,450 ---- } ! if( $tpl == '') { ! $this->template->set_file( 'template', $default_tpl); ! } elseif ( $this->template->set_file('template' , basename($tpl) . ".tpl" )) { // reset previous values unset($this->template->varvals['template']); ! unset($this->template->varkeys['template']); } else { ! $this->template->set_file( 'template', $default_tpl); ! } /* *************** *** 470,482 **** all the variables stay there -nh */ if ($this->template->get_var("row") == "") { ! $this->template->set_block("printStory","row","rows"); ! $this->template->set_block("printStory","alsotext","alsoblock"); ! // $this->template->set_block($template,"row","rows"); ! // $this->template->set_block($template,"alsotext","alsoblock"); ! } - ! $this->template->set_block($template, 'each_story', 'stories'); if (is_array($stories_ary)) { --- 457,465 ---- all the variables stay there -nh */ if ($this->template->get_var("row") == "") { ! $this->template->set_block("template","row","rows"); ! $this->template->set_block("template","alsotext","alsoblock"); } ! $this->template->set_block('template', 'each_story', 'stories'); if (is_array($stories_ary)) { *************** *** 551,555 **** $this->template->parse('STORY', "printStory"); $thestory = $this->template->get('STORY'); - $link_argv = $stories_ary[$i]['story_id']; --- 534,537 ---- *************** *** 595,599 **** } } ! $this->template->parse('STORY', $template); $stories = $this->template->get('STORY'); --- 577,581 ---- } } ! $this->template->parse('STORY', 'template'); $stories = $this->template->get('STORY'); *************** *** 605,609 **** # debug("Story::getStories.stories", $stories); - return $stories; --- 587,590 ---- |