Update of /cvsroot/phpslash/phpslash-ft/class
In directory usw-pr-cvs1:/tmp/cvs-serv3535/phpslash-ft/class
Modified Files:
Block.class Block_render_skin.class Block_render_rss.class
NavBar.class
Log Message:
submitted patches
Index: Block.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/Block.class,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** Block.class 2002/02/03 02:49:39 1.10
--- Block.class 2002/02/06 18:47:43 1.11
***************
*** 1,3 ****
! '<?php
/* @version $Id$ */
--- 1,3 ----
! <?php
/* @version $Id$ */
***************
*** 583,585 ****
} /* End class Block */
! ?>
--- 583,585 ----
} /* End class Block */
! ?>
\ No newline at end of file
Index: Block_render_skin.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/Block_render_skin.class,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Block_render_skin.class 2002/02/03 02:49:39 1.2
--- Block_render_skin.class 2002/02/06 18:47:43 1.3
***************
*** 82,86 ****
'SKIN' => "",
'ROOTDIR' => $this->psl['rooturl'],
! 'IMAGEDIR' => $this->psl['imagedir'],
'PHP_SELF' => $this->psl['phpself']
));
--- 82,86 ----
'SKIN' => "",
'ROOTDIR' => $this->psl['rooturl'],
! 'IMAGEDIR' => $this->psl['imageurl'],
'PHP_SELF' => $this->psl['phpself']
));
Index: Block_render_rss.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/Block_render_rss.class,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Block_render_rss.class 2002/02/03 02:49:39 1.4
--- Block_render_rss.class 2002/02/06 18:47:43 1.5
***************
*** 1,4 ****
<?php
-
/* Block_render_rss.class -> Methods for parsing RSS 0.91 data */
/* CHANGES: 4Jan02 - RSS title stored */
--- 1,3 ----
***************
*** 9,12 ****
--- 8,16 ----
* max = 10
* tpl = alternate template ( no .tpl extension) [rssblock.tpl]
+ * title = none - dont display title or image, even if they are available
+ * image - force display of image (if tag present - else show no title)
+ * text - force display of title text (if tag present - else show no title)
+ * both - display both image and text if available
+ * best (default) - display image if tags present, else display title if possible
*
* NOTES
***************
*** 216,220 ****
$default_tpl = "rssblock.tpl";
!
$target = "_self";
$max_items = 10;
--- 220,226 ----
$default_tpl = "rssblock.tpl";
!
!
! $titletype = "best";
$target = "_self";
$max_items = 10;
***************
*** 224,237 ****
if (is_string($block_info["block_options"]["max_items"])) {
$max_items = $block_info["block_options"]["max_items"];
! }
if (is_string($block_info["block_options"]["target"])) {
$target = $block_info["block_options"]["target"];
! }
! if (is_string($block_info["block_options"]["tpl"])) {
if (@file_exists($this->psl['templatedir'] . "/" . basename($block_info['block_options']['tpl']) . ".tpl") ) {
! // should be secure as path directives are discarded and extension added
$tpl = basename($block_info["block_options"]["tpl"]) . ".tpl";
}
! }
}
--- 230,246 ----
if (is_string($block_info["block_options"]["max_items"])) {
$max_items = $block_info["block_options"]["max_items"];
! }
if (is_string($block_info["block_options"]["target"])) {
$target = $block_info["block_options"]["target"];
! }
! if (is_string($block_info["block_options"]["title"])) {
! $titletype = $block_info["block_options"]["title"];
! }
! if (is_string($block_info["block_options"]["tpl"])) {
if (@file_exists($this->psl['templatedir'] . "/" . basename($block_info['block_options']['tpl']) . ".tpl") ) {
! // should be secure as path directives are discarded and extension added
$tpl = basename($block_info["block_options"]["tpl"]) . ".tpl";
}
! }
}
***************
*** 255,273 ****
$template->set_block ("block", "each_description", "description_block");
! // <title> and <image> tags seem to hold identical description and link info in most sites
! // ... so use an image if possible, else show title
! if (empty($this->rdf->image["url"])) {
if ( !empty( $this->rdf->channel["title"]) ) {
! $template->set_var("CHANNEL_TITLE", $this->rdf->channel["title"]);
! $template->set_var("CHANNEL_LINK", empty($this->rdf->channel["link"])?"#":$this->rdf->channel["link"]);
$template->parse("title_block","channel_title");
}
! } else {
! $template->set_var(array(
! "IMAGE_URL" => $this->rdf->image["url"],
! "IMAGE_TITLE" => $this->rdf->image["title"],
! "IMAGE_LINK" => $this->rdf->image["link"],
! ));
! $template->parse("image_block","channel_image");
}
--- 264,330 ----
$template->set_block ("block", "each_description", "description_block");
! switch ($titletype) {
! case "none":
! break;
!
! case "text":
if ( !empty( $this->rdf->channel["title"]) ) {
! $template->set_var(array(
! "CHANNEL_TITLE" => $this->rdf->channel["title"],
! "CHANNEL_LINK" => empty($this->rdf->channel["link"])?"#":$this->rdf->channel["link"]
! ));
$template->parse("title_block","channel_title");
}
! break;
!
! case "image":
! if ( !empty( $this->rdf->channel["image"]) ) {
! $template->set_var(array(
! "IMAGE_URL" => $this->rdf->image["url"],
! "IMAGE_TITLE" => $this->rdf->image["title"],
! "IMAGE_LINK" => $this->rdf->image["link"],
! ));
! $template->parse("image_block","channel_image");
! }
! break;
!
! case "both":
! if ( !empty( $this->rdf->channel["title"]) ) {
! $template->set_var(array(
! "CHANNEL_TITLE" => $this->rdf->channel["title"],
! "CHANNEL_LINK" => empty($this->rdf->channel["link"])?"#":$this->rdf->channel["link"]
! ));
! $template->parse("title_block","channel_title");
! }
! if ( !empty( $this->rdf->channel["image"]) ) {
! $template->set_var(array(
! "IMAGE_URL" => $this->rdf->image["url"],
! "IMAGE_TITLE" => $this->rdf->image["title"],
! "IMAGE_LINK" => $this->rdf->image["link"],
! ));
! $template->parse("image_block","channel_image");
! }
! break;
!
! case "best":
! default:
! // <title> and <image> tags seem to hold identical description and link info in most sites
! // ... so use an image if possible, else show title
! if (empty($this->rdf->image["url"])) {
! if ( !empty( $this->rdf->channel["title"]) ) { // No image, but there is a title
! $template->set_var(array(
! "CHANNEL_TITLE" => $this->rdf->channel["title"],
! "CHANNEL_LINK" => empty($this->rdf->channel["link"])?"#":$this->rdf->channel["link"]
! ));
! $template->parse("title_block","channel_title");
! }
! } else { // ...we can show the image
! $template->set_var(array(
! "IMAGE_URL" => $this->rdf->image["url"],
! "IMAGE_TITLE" => $this->rdf->image["title"],
! "IMAGE_LINK" => $this->rdf->image["link"],
! ));
! $template->parse("image_block","channel_image");
! }
}
***************
*** 299,303 ****
$this->output = $template->parse(OUT,"block");
$this->title = $this->rdf->channel["title"];
- // debug("rss::parse::title", $this->title);
return true;
--- 356,359 ----
***************
*** 306,311 ****
debug("Block_render_rss::parse error", $this->rdf->error_str);
! $this->output = "Error in source file:".$this->rdf->error_str;
! // $this->output = "";
return false;
--- 362,366 ----
debug("Block_render_rss::parse error", $this->rdf->error_str);
! $this->output = error("Error in source file:".$this->rdf->error_str);
return false;
***************
*** 319,327 ****
function getTitle() {
! // $this->title = "RSS Channel";
// debug("rss::parse::getTitle", $this->title);
return $this->title;
}
}
-
?>
--- 374,381 ----
function getTitle() {
! // Note: This wont work until object values are saved between the two stages of rendering a block
// debug("rss::parse::getTitle", $this->title);
return $this->title;
}
}
?>
Index: NavBar.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/NavBar.class,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** NavBar.class 2002/02/03 02:49:40 1.8
--- NavBar.class 2002/02/06 18:47:43 1.9
***************
*** 44,49 ****
function parse ($text,$link) {
! $this->templ->set_var( array( 'LINK_NAVBAR' => "$link",
! 'LINK_NAVBAR_TEXT' => pslgetText($text)) );
$this->templ->parse("block", "each_destination" ,true);
--- 44,52 ----
function parse ($text,$link) {
! $this->templ->set_var( array(
! 'IMAGEDIR' => $this->psl['imageurl'],
! 'LINK_NAVBAR' => "$link",
! 'LINK_NAVBAR_TEXT' => pslgetText($text)
! ));
$this->templ->parse("block", "each_destination" ,true);
|