Update of /cvsroot/phpslash/phpslash-ft/class
In directory usw-pr-cvs1:/tmp/cvs-serv13222/class
Modified Files:
Author.class Block.class Block_i.class Block_render_cal.class
Block_render_poll.class Block_render_query.class
Block_render_quote.class Block_render_rss.class
Block_render_section.class Block_render_skin.class
Block_render_topic.class Comment.class Glossary.class
Infolog.class MailingList.class NavBar.class Poll.class
Section.class Story.class Story_base.class Submission.class
Topic.class TopicBar.class functions.inc slashAuth.class
slashAuthCR.class slashPerm.class
Log Message:
made class files and such use quoted strings in arrays
Index: Author.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/Author.class,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** Author.class 2002/01/23 00:15:22 1.15
--- Author.class 2002/02/03 02:49:39 1.16
***************
*** 32,42 ****
$this->author_templ->debug = 0;
$this->author_templ->set_file(array(
! listauthor => "authorList.tpl",
! newauthor => "authorNew.tpl"
));
$this->author_templ->set_var( array(
! ROOTDIR => $this->psl['rootur'],
! IMAGEDIR => $this->psl['imageurl']
));
}
--- 32,42 ----
$this->author_templ->debug = 0;
$this->author_templ->set_file(array(
! 'listauthor' => "authorList.tpl",
! 'newauthor' => "authorNew.tpl"
));
$this->author_templ->set_var( array(
! 'ROOTDIR' => $this->psl['rootur'],
! 'IMAGEDIR' => $this->psl['imageurl']
));
}
***************
*** 68,90 ****
while ($this->db->next_record()) {
! $author_id = $this->db->Record[author_id];
$this->author_templ->set_var(array(
! ACTION_URL => $this->psl['phpself'],
! AUTHOR_ID => $author_id,
! NAME => $this->db->f("author_name"),
! REALNAME => $this->db->f("author_realname"),
! EMAIL => $this->db->f("email"),
! URL => $this->db->f("url"),
! QUOTE => $this->db->f("quote"),
! PASSWORD => $this->db->f("password"),
! COUNT => $count,
! AMP => $this->psl['amp']
));
$this->author_templ->parse("rows","row",true);
$count++;
};
! $this->author_templ->parse(OUT,array("listauthor"));
! $this->author_templ->p(OUT);
}
--- 68,90 ----
while ($this->db->next_record()) {
! $author_id = $this->db->Record['author_id'];
$this->author_templ->set_var(array(
! 'ACTION_URL' => $this->psl['phpself'],
! 'AUTHOR_ID' => $author_id,
! 'NAME' => $this->db->f("author_name"),
! 'REALNAME' => $this->db->f("author_realname"),
! 'EMAIL' => $this->db->f("email"),
! 'URL' => $this->db->f("url"),
! 'QUOTE' => $this->db->f("quote"),
! 'PASSWORD' => $this->db->f("password"),
! 'COUNT' => $count,
! 'AMP' => $this->psl['amp']
));
$this->author_templ->parse("rows","row",true);
$count++;
};
! $this->author_templ->parse('OUT',array("listauthor"));
! $this->author_templ->p('OUT');
}
***************
*** 105,113 ****
function saveAuthor($ary) {
! if ($ary[author_name] == "") {
error("There is no author_name in Author.class::saveAuthor");
return false;
}
! if (!is_array($ary[permission]) or (count($ary[permission]) < 1)) {
error("You need to select some permissions in Author.class::saveAuthor");
return false;
--- 105,113 ----
function saveAuthor($ary) {
! if ($ary['author_name'] == "") {
error("There is no author_name in Author.class::saveAuthor");
return false;
}
! if (!is_array($ary['permission']) or (count($ary['permission']) < 1)) {
error("You need to select some permissions in Author.class::saveAuthor");
return false;
***************
*** 117,134 ****
$ary["quote"] = clean($ary["quote"]);
! $ary[author_name] = addslashes(str_replace('\"',""",stripslashes($ary["author_name"])));
! // $ary[author_name] = str_replace(" "," ",stripslashes($ary["author_name"]));
! $ary[author_realname] = addslashes(str_replace('\"',""",stripslashes(
! $ary["author_realname"])));
/* if a record exists, then we update, else we insert a new author! */
$this->db->query("SELECT author_id
! FROM psl_author
! WHERE author_id = '$ary[author_id]'");
! $joined_perms = join(',',$ary[permission]);
if ($this->db->next_record()) {
! if ($ary[password] == "") {
$q = "UPDATE psl_author
SET author_name = '$ary[author_name]',
--- 117,133 ----
$ary["quote"] = clean($ary["quote"]);
! $ary['author_name'] = addslashes(str_replace('\"',""",stripslashes($ary["author_name"])));
! // $ary['author_name'] = str_replace(" "," ",stripslashes($ary["author_name"]));
! $ary['author_realname'] = addslashes(str_replace('\"',""",stripslashes($ary["author_realname"])));
/* if a record exists, then we update, else we insert a new author! */
$this->db->query("SELECT author_id
! FROM psl_author
! WHERE author_id = '".$ary['author_id']."'");
! $joined_perms = join(',',$ary['permission']);
if ($this->db->next_record()) {
! if ($ary['password'] == "") {
$q = "UPDATE psl_author
SET author_name = '$ary[author_name]',
***************
*** 152,161 ****
} else {
! if ($ary[password] == "") {
error("There is no password in Author.class::saveAuthor");
return false;
}
! $ary[author_id] = generateID("psl_author_seq");
$q = "INSERT INTO psl_author
--- 151,160 ----
} else {
! if ($ary['password'] == "") {
error("There is no password in Author.class::saveAuthor");
return false;
}
! $ary['author_id'] = generateID("psl_author_seq");
$q = "INSERT INTO psl_author
***************
*** 264,280 ****
$this->author_templ->set_var(array(
! ACTION_URL => $this->psl['phpself'],
! AUTHOR_ID => "",
! NAME => "",
! REALNAME => $this->author_id,
! EMAIL => "",
! URL => "",
! QUOTE => "",
! PASSWORD => "",
! SECLEV => ""
));
! $this->author_templ->parse(OUT,array("newauthor"));
! $this->author_templ->p(OUT);
}
--- 263,279 ----
$this->author_templ->set_var(array(
! 'ACTION_URL' => $this->psl['phpself'],
! 'AUTHOR_ID' => "",
! 'NAME' => "",
! 'REALNAME' => $this->author_id,
! 'EMAIL' => "",
! 'URL' => "",
! 'QUOTE' => "",
! 'PASSWORD' => "",
! 'SECLEV' => ""
));
! $this->author_templ->parse('OUT',array("newauthor"));
! $this->author_templ->p('OUT');
}
***************
*** 303,308 ****
while ($this->db->next_record()) {
! $author_id = $this->db->Record[author_id];
! $author_perms = $this->db->Record[perms];
$this->author_templ->set_block("newauthor","perm_row","perm_rows");
$this->author_templ->set_block("newauthor","permhave_row","permhave_rows");
--- 302,307 ----
while ($this->db->next_record()) {
! $author_id = $this->db->Record['author_id'];
! $author_perms = $this->db->Record['perms'];
$this->author_templ->set_block("newauthor","perm_row","perm_rows");
$this->author_templ->set_block("newauthor","permhave_row","permhave_rows");
***************
*** 319,338 ****
$this->author_templ->set_var(array(
! ACTION_URL => $this->psl['phpself'],
! AUTHOR_ID => $author_id,
! NAME => $this->db->f("author_name"),
! REALNAME => $this->db->f("author_realname"),
! EMAIL => $this->db->f("email"),
! URL => $this->db->f("url"),
! QUOTE => $this->db->f("quote"),
! // PASSWORD => $this->db->f("password"),
! SECLEV => $this->db->f("seclev"),
! COUNT => $count,
! AMP => $this->psl['amp']
));
};
! $this->author_templ->parse(OUT,array("newauthor"));
! $this->author_templ->p(OUT);
}
--- 318,337 ----
$this->author_templ->set_var(array(
! 'ACTION_URL' => $this->psl['phpself'],
! 'AUTHOR_ID' => $author_id,
! 'NAME' => $this->db->f("author_name"),
! 'REALNAME' => $this->db->f("author_realname"),
! 'EMAIL' => $this->db->f("email"),
! 'URL' => $this->db->f("url"),
! 'QUOTE' => $this->db->f("quote"),
! // 'PASSWORD' => $this->db->f("password"),
! 'SECLEV' => $this->db->f("seclev"),
! 'COUNT' => $count,
! 'AMP' => $this->psl['amp']
));
};
! $this->author_templ->parse('OUT',array("newauthor"));
! $this->author_templ->p('OUT');
}
Index: Block.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/Block.class,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** Block.class 2002/02/01 21:38:55 1.9
--- Block.class 2002/02/03 02:49:39 1.10
***************
*** 1,3 ****
! <?php
/* @version $Id$ */
--- 1,3 ----
! '<?php
/* @version $Id$ */
***************
*** 358,362 ****
$this->getBlock($id);
}
! if ( ($this->block_info[block_options][column] == $column) OR
($column == "")) {
--- 358,362 ----
$this->getBlock($id);
}
! if ( ($this->block_info['block_options']['column'] == $column) OR
($column == "")) {
***************
*** 386,390 ****
$link = "";
}
! if (is_array($this->block_info[block_options])) {
if (is_string($this->block_info["block_options"]["width"])) {
$width = $this->block_info["block_options"]["width"];
--- 386,390 ----
$link = "";
}
! if (is_array($this->block_info["block_options"])) {
if (is_string($this->block_info["block_options"]["width"])) {
$width = $this->block_info["block_options"]["width"];
***************
*** 448,452 ****
return true;
} else {
! $this->block_info["cache_data"] = "type = $this->block_info[type]<br>";
return false;
}
--- 448,452 ----
return true;
} else {
! $this->block_info["cache_data"] = "type = ".$this->block_info['type']."<br>";
return false;
}
***************
*** 560,564 ****
$this->block_ary[$i] = $db->Record;
! $this->block_ary[$i][block_options] = unserialize($db->Record["block_options"]);
$last = intval($this->block_ary[$i]["last_update"]);
--- 560,564 ----
$this->block_ary[$i] = $db->Record;
! $this->block_ary[$i]['block_options'] = unserialize($db->Record["block_options"]);
$last = intval($this->block_ary[$i]["last_update"]);
***************
*** 573,577 ****
if ($this->doParse('1')) {
! $this->block_ary[$i][cache_data] = $this->block_info["cache_data"];
}
}
--- 573,577 ----
if ($this->doParse('1')) {
! $this->block_ary[$i]['cache_data'] = $this->block_info["cache_data"];
}
}
Index: Block_i.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/Block_i.class,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** Block_i.class 2002/02/01 21:38:56 1.13
--- Block_i.class 2002/02/03 02:49:39 1.14
***************
*** 5,9 ****
/* First let's bring in my parent class */
! require($_PSL[classdir] . '/Block.class');
/**
--- 5,9 ----
/* First let's bring in my parent class */
! require($_PSL['classdir'] . '/Block.class');
/**
***************
*** 48,60 ****
/* Setup the files array */
$this->templ->set_file(array(
! listblock => "blockList.tpl",
! newblock => "blockEdit.tpl",
! editblock => "blockEdit.tpl"
));
/* Setup the template vars. We need these in all our templates */
$this->templ->set_var( array(
! ROOTDIR => $this->psl[rooturl],
! IMAGEDIR => $this->psl[imageurl]
));
}
--- 48,60 ----
/* Setup the files array */
$this->templ->set_file(array(
! 'listblock' => "blockList.tpl",
! 'newblock' => "blockEdit.tpl",
! 'editblock' => "blockEdit.tpl"
));
/* Setup the template vars. We need these in all our templates */
$this->templ->set_var( array(
! 'ROOTDIR' => $this->psl['rooturl'],
! 'IMAGEDIR' => $this->psl['imageurl']
));
}
***************
*** 76,82 ****
while ( list( $key, $val ) = each( $ary ) ) {
$this->templ->set_var(array(
! BLOCK_TYPE_ID => $key,
! SELECTED => "",
! BLOCK_TYPE_NAME => $val
));
$this->templ->parse("block_type_rows","block_type_row",true);
--- 76,82 ----
while ( list( $key, $val ) = each( $ary ) ) {
$this->templ->set_var(array(
! 'BLOCK_TYPE_ID' => $key,
! 'SELECTED' => "",
! 'BLOCK_TYPE_NAME' => $val
));
$this->templ->parse("block_type_rows","block_type_row",true);
***************
*** 90,96 ****
while ($this->db->next_record()) {
$this->templ->set_var(array(
! SECTION_ID => $this->db->Record[section_id],
! SELECTED => "",
! SECTION_NAME => $this->db->Record[section_name]
));
$this->templ->parse("section_rows","section_row",true);
--- 90,96 ----
while ($this->db->next_record()) {
$this->templ->set_var(array(
! 'SECTION_ID' => $this->db->Record[section_id],
! 'SELECTED' => "",
! 'SECTION_NAME' => $this->db->Record[section_name]
));
$this->templ->parse("section_rows","section_row",true);
***************
*** 100,107 ****
for ($i =1; $i <= $blockcnt; $i++) {
$this->templ->set_var(array(
! OPTION_NAME => "optionname[$i]",
! OPTION_NAME_VAL => "",
! OPTION_VALUE => "optionval[$i]",
! OPTION_VALUE_VAL => ""
));
$this->templ->parse("options", "each_option", true);
--- 100,107 ----
for ($i =1; $i <= $blockcnt; $i++) {
$this->templ->set_var(array(
! 'OPTION_NAME' => "optionname[$i]",
! 'OPTION_NAME_VAL' => "",
! 'OPTION_VALUE' => "optionval[$i]",
! 'OPTION_VALUE_VAL' => ""
));
$this->templ->parse("options", "each_option", true);
***************
*** 110,125 ****
/* display a blank form */
$this->templ->set_var(array(
! ACTION_URL => $this->psl['phpself'],
! BLOCK_TITLE => "",
! LOCATION => "",
! SOURCE_URL => "",
! EXPIRE_LENGTH => "",
! CACHE_DATA => "",
! BLOCK_ID => "",
! ORDERNUM => ""
));
! $this->templ->parse(OUT,array("newblock"));
! $this->templ->p(OUT);
}
--- 110,125 ----
/* display a blank form */
$this->templ->set_var(array(
! 'ACTION_URL' => $this->psl['phpself'],
! 'BLOCK_TITLE' => "",
! 'LOCATION' => "",
! 'SOURCE_URL' => "",
! 'EXPIRE_LENGTH' => "",
! 'CACHE_DATA' => "",
! 'BLOCK_ID' => "",
! 'ORDERNUM' => ""
));
! $this->templ->parse('OUT',array("newblock"));
! $this->templ->p('OUT');
}
***************
*** 160,170 ****
while ( list( $key, $val ) = each( $ary ) ) {
$this->templ->set_var(array(
! BLOCK_TYPE_ID => $key,
! SELECTED => "",
! BLOCK_TYPE_NAME => $val
));
if ($key == $this->block_info["type_id"]) {
$this->templ->set_var(array(
! SELECTED => "SELECTED"
));
}
--- 160,170 ----
while ( list( $key, $val ) = each( $ary ) ) {
$this->templ->set_var(array(
! 'BLOCK_TYPE_ID' => $key,
! 'SELECTED' => "",
! 'BLOCK_TYPE_NAME' => $val
));
if ($key == $this->block_info["type_id"]) {
$this->templ->set_var(array(
! 'SELECTED' => "SELECTED"
));
}
***************
*** 178,183 ****
while ($this->db->next_record()) {
$this->templ->set_var(array(
! SECTION_ID => $this->db->Record[section_id],
! SECTION_NAME => $this->db->Record[section_name]
));
--- 178,183 ----
while ($this->db->next_record()) {
$this->templ->set_var(array(
! 'SECTION_ID' => $this->db->Record['section_id'],
! 'SECTION_NAME' => $this->db->Record['section_name']
));
***************
*** 195,199 ****
reset($temparray);
}
! $blockcnt = $this->psl[block_optioncount];
$i = 1;
--- 195,199 ----
reset($temparray);
}
! $blockcnt = $this->psl['block_optioncount'];
$i = 1;
***************
*** 203,210 ****
if ($current) {
$this->templ->set_var(array(
! OPTION_NAME => "optionname[$i]",
! OPTION_NAME_VAL => $current[0],
! OPTION_VALUE => "optionval[$i]",
! OPTION_VALUE_VAL => $current[1]
));
}
--- 203,210 ----
if ($current) {
$this->templ->set_var(array(
! 'OPTION_NAME' => "optionname[$i]",
! 'OPTION_NAME_VAL' => $current[0],
! 'OPTION_VALUE' => "optionval[$i]",
! 'OPTION_VALUE_VAL' => $current[1]
));
}
***************
*** 218,225 ****
while ($i <= $blockcnt) {
$this->templ->set_var(array(
! OPTION_NAME => "optionname[$i]",
! OPTION_NAME_VAL => "",
! OPTION_VALUE => "optionval[$i]",
! OPTION_VALUE_VAL => ""
));
$this->templ->parse("options", "each_option", true);
--- 218,225 ----
while ($i <= $blockcnt) {
$this->templ->set_var(array(
! 'OPTION_NAME' => "optionname[$i]",
! 'OPTION_NAME_VAL' => "",
! 'OPTION_VALUE' => "optionval[$i]",
! 'OPTION_VALUE_VAL' => ""
));
$this->templ->parse("options", "each_option", true);
***************
*** 228,244 ****
$this->templ->set_var(array(
! ACTION_URL => $this->psl['phpself'],
! BLOCK_TITLE => $this->block_info["title"],
! LOCATION => $this->block_info["location"],
! SOURCE_URL => $this->block_info["source_url"],
! EXPIRE_LENGTH => $this->block_info["expire_length"],
! CACHE_DATA => $this->block_info["cache_data"],
! ORDERNUM => $this->block_info["ordernum"],
! BLOCK_ID => $id
));
! $this->templ->parse(OUT,array("editblock"));
! $this->templ->p(OUT);
! $this->templ->set_var(OUT,"");
}
--- 228,244 ----
$this->templ->set_var(array(
! 'ACTION_URL' => $this->psl['phpself'],
! 'BLOCK_TITLE' => $this->block_info["title"],
! 'LOCATION' => $this->block_info["location"],
! 'SOURCE_URL' => $this->block_info["source_url"],
! 'EXPIRE_LENGTH' => $this->block_info["expire_length"],
! 'CACHE_DATA' => $this->block_info["cache_data"],
! 'ORDERNUM' => $this->block_info["ordernum"],
! 'BLOCK_ID' => $id
));
! $this->templ->parse('OUT',array("editblock"));
! $this->templ->p('OUT');
! $this->templ->set_var('OUT',"");
}
***************
*** 274,284 ****
$this->templ->set_var(array(
! MODIFYURL => $modifyurl,
! DELURL => $delurl,
! VIEWURL => $viewurl,
! TITLE => $this->db->f("title"),
! URL => $this->db->f("location"),
! SOURCE_URL=> $this->db->f("source_url"),
! TYPE => $this->db->f("type")
));
$this->templ->parse("rows","row","true");
--- 274,284 ----
$this->templ->set_var(array(
! 'MODIFYURL' => $modifyurl,
! 'DELURL' => $delurl,
! 'VIEWURL' => $viewurl,
! 'TITLE' => $this->db->f("title"),
! 'URL' => $this->db->f("location"),
! 'SOURCE_URL' => $this->db->f("source_url"),
! 'TYPE' => $this->db->f("type")
));
$this->templ->parse("rows","row","true");
***************
*** 287,292 ****
titlebar("100%", "Update the Current Blocks");
! $this->templ->parse(OUT, array("listblock"));
! $this->templ->p(OUT);
}
--- 287,292 ----
titlebar("100%", "Update the Current Blocks");
! $this->templ->parse('OUT', array("listblock"));
! $this->templ->p('OUT');
}
***************
*** 303,307 ****
*/
function getAllBlocksForIndex($section, $column="") {
! $ary[section] = $section;
return $this->getBlocks($ary, $column);
}
--- 303,307 ----
*/
function getAllBlocksForIndex($section, $column="") {
! $ary['section'] = $section;
return $this->getBlocks($ary, $column);
}
***************
*** 312,317 ****
* @param array ary
*
! * ary[section] = return html formatted blocks assigned to this section
! * ary[section_id] = return html formatted blocks assigned to this section_id
*
* @param string column
--- 312,317 ----
* @param array ary
*
! * ary['section'] = return html formatted blocks assigned to this section
! * ary['section_id'] = return html formatted blocks assigned to this section_id
*
* @param string column
***************
*** 359,363 ****
$width = "100%";
! if ( ($ary[block_options][column] == $column) OR
($column == "")) {
--- 359,363 ----
$width = "100%";
! if ( ($ary['block_options']['column'] == $column) OR
($column == "")) {
***************
*** 376,380 ****
$link = "";
}
! if (is_array($ary[block_options])) {
if (is_string($ary["block_options"]["width"])) {
$width = $ary["block_options"]["width"];
--- 376,380 ----
$link = "";
}
! if (is_array($ary['block_options'])) {
if (is_string($ary["block_options"]["width"])) {
$width = $ary["block_options"]["width"];
***************
*** 401,405 ****
function listBlockTypes($option="", $name="") {
! $this->templ = new Template($this->psl[templatedir]);
$this->templ->debug = 0;
$this->templ->set_file(array(
--- 401,405 ----
function listBlockTypes($option="", $name="") {
! $this->templ = new Template($this->psl['templatedir']);
$this->templ->debug = 0;
$this->templ->set_file(array(
***************
*** 411,418 ****
if( $option == "all") {
! $fulldirlist = dir($this->psl[classdir]);
$i=1;
while( $eachfile = $fulldirlist->read()) {
! $each = $this->psl[classdir] . "/" . $eachfile;
if( (is_file($each)) AND
( $each != ".") AND
--- 411,418 ----
if( $option == "all") {
! $fulldirlist = dir($this->psl['classdir']);
$i=1;
while( $eachfile = $fulldirlist->read()) {
! $each = $this->psl['classdir'] . "/" . $eachfile;
if( (is_file($each)) AND
( $each != ".") AND
***************
*** 436,440 ****
$this->templ->set_var(array(
REMOVENAME => $current_type,
! REMOVEURL => $this->psl[phpself] ."?option=delete". $this->psl[amp] ."name=". $current_type
));
--- 436,440 ----
$this->templ->set_var(array(
REMOVENAME => $current_type,
! REMOVEURL => $this->psl['phpself'] ."?option=delete". $this->psl['amp'] ."name=". $current_type
));
***************
*** 450,455 ****
$this->templ->set_var(array(
! ADDNAME => $key,
! ADDURL => $this->psl[phpself] ."?option=add". $this->psl[amp] ."name=". $key
));
$this->templ->parse("rows","addrow",true);
--- 450,455 ----
$this->templ->set_var(array(
! 'ADDNAME' => $key,
! 'ADDURL' => $this->psl[phpself] ."?option=add". $this->psl[amp] ."name=". $key
));
$this->templ->parse("rows","addrow",true);
***************
*** 457,462 ****
}
! $this->templ->parse(OUT,array("listblocktypes"));
! $this->templ->p(OUT);
} elseif ($option == "add") {
$this->putType($name);
--- 457,462 ----
}
! $this->templ->parse('OUT',array("listblocktypes"));
! $this->templ->p('OUT');
} elseif ($option == "add") {
$this->putType($name);
***************
*** 466,470 ****
$this->listBlockTypes("all");
} else {
! echo "<A HREF=" . $this->psl[phpself] . "?submit=display" . $this->psl[amp] . "option=all>[Add or Remove Block Types]</A>";
}
}
--- 466,470 ----
$this->listBlockTypes("all");
} else {
! echo "<A HREF=" . $this->psl['phpself'] . "?submit=display" . $this->psl['amp'] . "option=all>[Add or Remove Block Types]</A>";
}
}
Index: Block_render_cal.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/Block_render_cal.class,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Block_render_cal.class 2001/08/06 13:22:31 1.2
--- Block_render_cal.class 2002/02/03 02:49:39 1.3
***************
*** 21,30 ****
function parse($block_info) {
!
global $templatedir;
$templ = new Template($templatedir);
$templ->set_file(array(
! calendar => "calendar.tpl"
));
$templ->debug=0;
--- 21,30 ----
function parse($block_info) {
! // TODO: Make this class use $_PSL
global $templatedir;
$templ = new Template($templatedir);
$templ->set_file(array(
! 'calendar' => "calendar.tpl"
));
$templ->debug=0;
***************
*** 89,94 ****
}
$templ->set_var(array(
! URL => "$PHP_SELF?date=$url_date" . $url_day,
! LINKED_DATA => "$daycounter"
));
$linkon = 1;
--- 89,94 ----
}
$templ->set_var(array(
! 'URL' => "$PHP_SELF?date=$url_date" . $url_day,
! 'LINKED_DATA' => "$daycounter"
));
$linkon = 1;
***************
*** 112,117 ****
}
! $templ->parse(OUT,array("calendar"));
! $this->output = $templ->get(OUT);
}
--- 112,117 ----
}
! $templ->parse('OUT',array("calendar"));
! $this->output = $templ->get('OUT');
}
***************
*** 124,129 ****
$current_date=getdate();
! $month=$current_date[ "mon"];
! $day=$current_date[ "mday"];
$this->title=pslgetText($montharray[$month]) . " " . $day;
--- 124,129 ----
$current_date=getdate();
! $month=$current_date["mon"];
! $day=$current_date["mday"];
$this->title=pslgetText($montharray[$month]) . " " . $day;
Index: Block_render_poll.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/Block_render_poll.class,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Block_render_poll.class 2001/05/15 22:36:15 1.1
--- Block_render_poll.class 2002/02/03 02:49:39 1.2
***************
*** 28,32 ****
$question_id = "";
! if (is_array($block_info[block_options])) {
if (is_string($block_info["block_options"]["question_id"])) {
$question_id = $block_info["block_options"]["question_id"];
--- 28,32 ----
$question_id = "";
! if (is_array($block_info["block_options"])) {
if (is_string($block_info["block_options"]["question_id"])) {
$question_id = $block_info["block_options"]["question_id"];
Index: Block_render_query.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/Block_render_query.class,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Block_render_query.class 2001/11/12 02:34:11 1.4
--- Block_render_query.class 2002/02/03 02:49:39 1.5
***************
*** 1,145 ****
! <?php
!
! /* Block_render_query.class -> Methods for phpslash specfic blocks */
! /* Id:$ */
!
! /* pass the query in the "Source Url" form field in the format of:
! *
! * option1=setting1&option2=setting2
! *
! * Available query options:
! *
! * section = section name
! * topic = topic name
! * author = author name
! * date = starting date in "to_days" format
! * start = "starting" point [0]
! * max = maximum returned [10]
! * order = [time], hits, title, etc.
! * asc = ASC, [DESC] ( Ascending or Descending)
! * query = urlencoded text string
! * tpl = template filename (no path or extension)
! *
! */
!
! class Block_render_query {
!
! var $type;
! var $output;
! var $psl;
!
! /* constructor */
! function Block_render_query() {
!
! global $_PSL;
!
! $this->type = "query"; /* 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->query( $block_info);
! return 1;
! }
!
! function query( $block_info) {
!
! $stories = new Story_base;
!
! $amp = $this->psl['amp'];
! $site_homesection = $this->psl['site_homesection'];
!
! $default_tpl = "queryblock.tpl";
!
! $options_ary = split( "&",$block_info["source_url"] );
! for( $i=0 ; $i < count($options_ary) ; $i++) {
! $arg_ary = split( "=", $options_ary[$i]);
! $ary[$arg_ary[0]] = urldecode($arg_ary[1]);
! }
!
! $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_query:Template file doesn't exist, using default instead", $tpl);
! $tpl = $default_tpl;
! }
!
! $template = new Template($this->psl["templatedir"]);
! $template->debug = 0;
! $template->set_file(array(
! block => "$tpl"
! ));
! $template->set_block ("block", "each_query", "query_block");
!
! $stories_ary = $stories->extractStories( $ary);
!
! if (is_array($stories_ary)) {
! for ($i = 0 ; $i < count($stories_ary) ; $i++) {
!
! $story_id = $stories_ary[$i][story_id];
! if ($ary['section_id'] != "") {
! $story_id .= $amp . "section_id=" . $ary['section_id'];
! } elseif ( ($ary['section'] != "") AND ( $ary['section'] != $site_homesection)) {
! $section = new Section;
! $section_name = $section->getId($ary['section']);
! $story_id .= $amp . "section=" . $section_name;
! }
! if ($topic_id != "") {
! $story_id .= $amp . "topic_id=" . $ary['topic_id'];
! } elseif ($ary['topic'] != "") {
! $topic = new Topic;
! $topic_name = $topic->getId($ary['topic']);
! $story_id .= $amp . "topic=" . $topic_name;
! }
!
! $template->set_var(array(
! STORY_ID => $story_id,
! TITLE => $stories_ary[$i][title],
! INTRO_TEXT => $stories_ary[$i][intro_text],
! BODY_TEXT => $body_text,
! DEPT => $stories_ary[$i][dept],
! URL => $stories_ary[$i][url],
! NAME => $stories_ary[$i][name],
! DATEF => $stories_ary[$i][datef],
! HITS => $stories_ary[$i][hits],
! TOPIC_ID => $stories_ary[$i][topic_id],
! TOPIC_NAME => $stories_ary[$i][topic_name],
! TOPICIMAGE => $stories_ary[$i][image],
! TOPICWIDTH => $stories_ary[$i][width],
! TOPICHEIGHT => $stories_ary[$i][height],
! ALTTEXT => $stories_ary[$i][alt_text]
! ));
!
! $template->parse ("query_block", "each_query", true);
! }
!
! }
!
! $template->set_var(array(
! ROOTDIR => $this->psl[rooturl],
! IMAGEDIR => $this->psl[imageurl]
! ));
!
! return $template->parse(OUT,"block");
!
! }
!
! function getFinal() {
! return $this->output;
! }
!
! }
!
! ?>
--- 1,145 ----
! <?php
!
! /* Block_render_query.class -> Methods for phpslash specfic blocks */
! /* Id:$ */
!
! /* pass the query in the "Source Url" form field in the format of:
! *
! * option1=setting1&option2=setting2
! *
! * Available query options:
! *
! * section = section name
! * topic = topic name
! * author = author name
! * date = starting date in "to_days" format
! * start = "starting" point [0]
! * max = maximum returned [10]
! * order = [time], hits, title, etc.
! * asc = ASC, [DESC] ( Ascending or Descending)
! * query = urlencoded text string
! * tpl = template filename (no path or extension)
! *
! */
!
! class Block_render_query {
!
! var $type;
! var $output;
! var $psl;
!
! /* constructor */
! function Block_render_query() {
!
! global $_PSL;
!
! $this->type = "query"; /* 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->query( $block_info);
! return 1;
! }
!
! function query( $block_info) {
!
! $stories = new Story_base;
!
! $amp = $this->psl['amp'];
! $site_homesection = $this->psl['site_homesection'];
!
! $default_tpl = "queryblock.tpl";
!
! $options_ary = split( "&",$block_info["source_url"] );
! for( $i=0 ; $i < count($options_ary) ; $i++) {
! $arg_ary = split( "=", $options_ary[$i]);
! $ary[$arg_ary[0]] = urldecode($arg_ary[1]);
! }
!
! $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_query:Template file doesn't exist, using default instead", $tpl);
! $tpl = $default_tpl;
! }
!
! $template = new Template($this->psl["templatedir"]);
! $template->debug = 0;
! $template->set_file(array(
! block => "$tpl"
! ));
! $template->set_block ("block", "each_query", "query_block");
!
! $stories_ary = $stories->extractStories( $ary);
!
! if (is_array($stories_ary)) {
! for ($i = 0 ; $i < count($stories_ary) ; $i++) {
!
! $story_id = $stories_ary[$i][story_id];
! if ($ary['section_id'] != "") {
! $story_id .= $amp . "section_id=" . $ary['section_id'];
! } elseif ( ($ary['section'] != "") AND ( $ary['section'] != $site_homesection)) {
! $section = new Section;
! $section_name = $section->getId($ary['section']);
! $story_id .= $amp . "section=" . $section_name;
! }
! if ($topic_id != "") {
! $story_id .= $amp . "topic_id=" . $ary['topic_id'];
! } elseif ($ary['topic'] != "") {
! $topic = new Topic;
! $topic_name = $topic->getId($ary['topic']);
! $story_id .= $amp . "topic=" . $topic_name;
! }
!
! $template->set_var(array(
! 'STORY_ID' => $story_id,
! 'TITLE' => $stories_ary[$i]['title'],
! 'INTRO_TEXT' => $stories_ary[$i]['intro_text'],
! 'BODY_TEXT' => $body_text,
! 'DEPT' => $stories_ary[$i]['dept'],
! 'URL' => $stories_ary[$i]['url'],
! 'NAME' => $stories_ary[$i]['name'],
! 'DATEF' => $stories_ary[$i]['datef'],
! 'HITS' => $stories_ary[$i]['hits'],
! 'TOPIC_ID' => $stories_ary[$i]['topic_id'],
! 'TOPIC_NAME' => $stories_ary[$i]['topic_name'],
! 'TOPICIMAGE' => $stories_ary[$i]['image'],
! 'TOPICWIDTH' => $stories_ary[$i]['width'],
! 'TOPICHEIGHT' => $stories_ary[$i]['height'],
! 'ALTTEXT' => $stories_ary[$i]['alt_text']
! ));
!
! $template->parse ("query_block", "each_query", true);
! }
!
! }
!
! $template->set_var(array(
! 'ROOTDIR' => $this->psl['rooturl'],
! 'IMAGEDIR' => $this->psl['imageurl']
! ));
!
! return $template->parse('OUT',"block");
!
! }
!
! function getFinal() {
! return $this->output;
! }
!
! }
!
! ?>
Index: Block_render_quote.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/Block_render_quote.class,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Block_render_quote.class 2001/10/09 23:21:45 1.2
--- Block_render_quote.class 2002/02/03 02:49:39 1.3
***************
*** 44,50 ****
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);
--- 44,50 ----
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);
***************
*** 75,83 ****
$template->set_var(array(
! QUOTE => $db->f("quote"),
! AUTHOR => $db->f("author")
));
! return $template->parse(OUT,"block");
}
--- 75,83 ----
$template->set_var(array(
! 'QUOTE' => $db->f("quote"),
! 'AUTHOR' => $db->f("author")
));
! return $template->parse('OUT',"block");
}
Index: Block_render_rss.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/Block_render_rss.class,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Block_render_rss.class 2002/01/23 20:17:46 1.3
--- Block_render_rss.class 2002/02/03 02:49:39 1.4
***************
*** 1,327 ****
! <?php
!
! /* Block_render_rss.class -> Methods for parsing RSS 0.91 data */
! /* CHANGES: 4Jan02 - RSS title stored */
! /* $Id$ */
! /*
! * VARAIBLES USED
! * target = [_blank],_self etc
! * max = 10
! * tpl = alternate template ( no .tpl extension) [rssblock.tpl]
! *
! * NOTES
! * - image width and height are not used since most sites seem not to give this info anyway
! * - rdfparser ignores max_items - it pulls everything it can from the RDF file
! */
! class rdfparser {
!
! // Settings
! var $max_items;
! var $tags; // tags to process (all others are ignored)
!
! // Output information
! var $channel;
! var $image;
! var $items;
!
! var $error_str = ""; /* if you got an error reading a file this will store an error */
!
! // Private
! var $xml;
! var $node;
! var $current;
! var $count;
!
! /***************************************
! ** Constructor function. See parse_setup
! ***************************************/
! function rdfparser() {
! }
!
! /***************************************
! ** Start element function.
! ***************************************/
! function start_element($xml, $element, $attributes) {
!
! $this->current = $element;
!
! switch ($element) {
! case $this->tags["item"]:
! case $this->tags["image"]:
! case $this->tags["channel"]:
! $this->node = $element; // Should be a stack really, but nesting is only one deep
! // debug("rdf:start element+node","$element+".$this->node);
! break;
!
! default:
! }
!
! }
!
! /***************************************
! ** End element function.
! ***************************************/
! function end_element($xml, $element) {
! $this->current = "";
!
! switch ($element) {
! case $this->tags["item"]:
! $this->node = "";
! $this->count++;
! break;
! case $this->tags["channel"]:
! case $this->tags["image"]:
! $this->node = "";
! break;
! }
! }
!
! function character_data($xml, $data) {
!
! switch ($this->node) {
!
! case $this->tags["item"]:
! switch ($this->current) {
! case $this->tags["title"]:
! $this->items[$this->count]["title"] .= $data;
! break;
! case $this->tags["link"]:
! $this->items[$this->count]["link"] .= $data;
! break;
! case $this->tags["description"]:
! $this->items[$this->count]["description"] .= $data;
! break;
! default:
! }
! break;
!
! case $this->tags["image"]:
! switch ($this->current) {
! case $this->tags["title"]:
! $this->image["title"] .= $data;
! break;
! case $this->tags["link"]:
! $this->image["link"] .= $data;
! break;
! case $this->tags["url"]:
! $this->image["url"] .= $data;
! break;
! default:
! }
! break;
!
! case $this->tags["channel"]:
! switch ($this->current) {
! case $this->tags["title"]:
! $this->channel["title"] .= $data;
! break;
! case $this->tags["link"]:
! $this->channel["link"] .= $data;
! break;
! case $this->tags["description"]:
! $this->channel["description"] .= $data;
! break;
! default:
! }
! break;
!
! default:
! }
! }
!
! function parse_setup($tags="",$max_items="") {
!
! if (is_array($tags)) {
! $this->tags = $tags;
! } else {
! // standard rdf setup - must be upper case (assuming case-folding is on which is PHP's default)
! $this->tags = array("channel" => "CHANNEL",
! "image" => "IMAGE",
! "item" => "ITEM",
! "title" => "TITLE",
! "link" => "LINK",
! "url" => "URL",
! "description" => "DESCRIPTION" );
! }
!
! // Internal initialisation
! $this->count = 0;
! $this->node = ""; // can be "" (ie channel), "item" or "image"
! $this->current = array(); // element stack
!
! $this->error_str = "";
!
! $this->channel = array("title"=>"", "link"=>"", "description" => "");
! $this->image = array("title"=>"", "link"=>"");
! $this->items = array();
!
! $this->xml = xml_parser_create();
! xml_set_object($this->xml, &$this);
! }
!
! function parse_file($url) {
! // debug("rdfparser::parse_file", "Now parsing $url");
!
! xml_parser_set_option($this->xml, XML_OPTION_CASE_FOLDING, true);
! xml_set_element_handler($this->xml, "start_element", "end_element");
! xml_set_character_data_handler($this->xml, "character_data");
!
! $fpread = @fopen($url, "r");
! if ( !($fpread) ) {
! // error in opening url
! $this->error_str = "rdfparser::parse_file could not open $url";
! // debug("rdfparser::parse_file", $this->error_str);
!
! // Where does $err* come from?
! // debug("rdfparser::parse_file", "$errstr $errno");
! } else {
! while (($this->error_str == "") && ($data = fread($fpread, 4096))) {
! if (!xml_parse($this->xml, $data, feof($fpread))) {
! // error
! $this->error_str = xml_error_string(xml_get_error_code($this->xml)) . " at line " . xml_get_current_line_number($this->xml);
! debug("rdfparser::parse_file", $this->error_str);
! }
! }
! fclose($fpread);
! if ($this->error_str == "") {
! // debug("rdfparser::parse_file", "Data parsed successfully!");
! }
! }
! }
! }
!
! class Block_render_rss {
! var $type;
! var $output;
! var $rdf;
!
! /* constructor */
! function Block_render_rss() {
! global $_PSL;
!
! $this->type = "rss"; /* set the 'type' */
! $this->output = ""; /* clear the output */
! $this->rdf = new rdfparser;
! $this->psl = $_PSL;
! }
!
! /* returns the TYPE of this class */
! function getType() {
! return $this->type;
! }
!
! function parse($block_info) {
! global $_PSL;
! // debug("Block_render_rss::parse", "Starting RDF Block parsing");
!
! $default_tpl = "rssblock.tpl";
!
! $target = "_self";
! $max_items = 10;
! $tpl = $default_tpl;
!
! if (is_array($block_info[block_options])) {
! 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";
! }
! }
! }
!
! // debug("Block_render_rss::parse", "setting parser with $item_element, $title_element, $link_element");
! $this->rdf->parse_setup(); //$item_element, $title_element, $link_element);
! $this->rdf->parse_file($block_info['source_url']);
!
! if (empty($this->rdf->error_str)) {
! // debug("Block_render_rss::parse", "xml has no errors, making block");
! // debug("rss::parse::channel",$this->rdf->channel);
! // debug("rss::parse::image",$this->rdf->image);
! // debug("rss::parse::items", $this->rdf->items);
!
! $template = new Template($this->psl["templatedir"]);
! $template->set_file ("block", $tpl);
!
! $template->set_block ("block", "channel_title","title_block");
! $template->set_block ("block", "channel_image","image_block");
! $template->set_block ("block", "channel_description","channeldescription_block");
! $template->set_block ("block", "each_query", "query_block");
! $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");
! }
!
! if ( !empty( $this->rdf->channel["description"]) ) {
! $template->set_var("CHANNEL_DESCRIPTION", $this->rdf->channel["description"]);
! $template->parse("channeldescription_block","channel_description",true);
! }
!
! $numitems = min($max_items, $this->rdf->count);
! // debug("rss::numitems",$numitems);
! for ($items = 0; $items < $numitems; $items++ ) {
! $template->set_var(array(
! "TITLE" => $this->rdf->items[$items]["title"],
! "LINK" => $this->rdf->items[$items]["link"]
! ));
! $template->parse ("query_block", "each_query", true);
!
! if (!empty($this->rdf->items[$items]["description"] )) {
! $template->set_var("DESCRIPTION",$this->rdf->items[$items]["description"] );
! $template->parse ("query_block", "each_description", true);
! }
! }
!
! $template->set_var(array(
! "TARGET" => $target,
! "ROOTDIR" => $this->psl["rooturl"],
! "IMAGEDIR" => $this->psl["imageurl"]
! ));
! $this->output = $template->parse(OUT,"block");
! $this->title = $this->rdf->channel["title"];
! // debug("rss::parse::title", $this->title);
!
! return true;
!
! } else {
!
! debug("Block_render_rss::parse error", $this->rdf->error_str);
! $this->output = "Error in source file:".$this->rdf->error_str;
! // $this->output = "";
!
! return false;
! }
!
! }
!
! function getFinal() {
! return $this->output;
! }
!
! function getTitle() {
! // $this->title = "RSS Channel";
! // debug("rss::parse::getTitle", $this->title);
! return $this->title;
! }
! }
!
! ?>
--- 1,327 ----
! <?php
!
! /* Block_render_rss.class -> Methods for parsing RSS 0.91 data */
! /* CHANGES: 4Jan02 - RSS title stored */
! /* $Id$ */
! /*
! * VARAIBLES USED
! * target = [_blank],_self etc
! * max = 10
! * tpl = alternate template ( no .tpl extension) [rssblock.tpl]
! *
! * NOTES
! * - image width and height are not used since most sites seem not to give this info anyway
! * - rdfparser ignores max_items - it pulls everything it can from the RDF file
! */
! class rdfparser {
!
! // Settings
! var $max_items;
! var $tags; // tags to process (all others are ignored)
!
! // Output information
! var $channel;
! var $image;
! var $items;
!
! var $error_str = ""; /* if you got an error reading a file this will store an error */
!
! // Private
! var $xml;
! var $node;
! var $current;
! var $count;
!
! /***************************************
! ** Constructor function. See parse_setup
! ***************************************/
! function rdfparser() {
! }
!
! /***************************************
! ** Start element function.
! ***************************************/
! function start_element($xml, $element, $attributes) {
!
! $this->current = $element;
!
! switch ($element) {
! case $this->tags["item"]:
! case $this->tags["image"]:
! case $this->tags["channel"]:
! $this->node = $element; // Should be a stack really, but nesting is only one deep
! // debug("rdf:start element+node","$element+".$this->node);
! break;
!
! default:
! }
!
! }
!
! /***************************************
! ** End element function.
! ***************************************/
! function end_element($xml, $element) {
! $this->current = "";
!
! switch ($element) {
! case $this->tags["item"]:
! $this->node = "";
! $this->count++;
! break;
! case $this->tags["channel"]:
! case $this->tags["image"]:
! $this->node = "";
! break;
! }
! }
!
! function character_data($xml, $data) {
!
! switch ($this->node) {
!
! case $this->tags["item"]:
! switch ($this->current) {
! case $this->tags["title"]:
! $this->items[$this->count]["title"] .= $data;
! break;
! case $this->tags["link"]:
! $this->items[$this->count]["link"] .= $data;
! break;
! case $this->tags["description"]:
! $this->items[$this->count]["description"] .= $data;
! break;
! default:
! }
! break;
!
! case $this->tags["image"]:
! switch ($this->current) {
! case $this->tags["title"]:
! $this->image["title"] .= $data;
! break;
! case $this->tags["link"]:
! $this->image["link"] .= $data;
! break;
! case $this->tags["url"]:
! $this->image["url"] .= $data;
! break;
! default:
! }
! break;
!
! case $this->tags["channel"]:
! switch ($this->current) {
! case $this->tags["title"]:
! $this->channel["title"] .= $data;
! break;
! case $this->tags["link"]:
! $this->channel["link"] .= $data;
! break;
! case $this->tags["description"]:
! $this->channel["description"] .= $data;
! break;
! default:
! }
! break;
!
! default:
! }
! }
!
! function parse_setup($tags="",$max_items="") {
!
! if (is_array($tags)) {
! $this->tags = $tags;
! } else {
! // standard rdf setup - must be upper case (assuming case-folding is on which is PHP's default)
! $this->tags = array("channel" => "CHANNEL",
! "image" => "IMAGE",
! "item" => "ITEM",
! "title" => "TITLE",
! "link" => "LINK",
! "url" => "URL",
! "description" => "DESCRIPTION" );
! }
!
! // Internal initialisation
! $this->count = 0;
! $this->node = ""; // can be "" (ie channel), "item" or "image"
! $this->current = array(); // element stack
!
! $this->error_str = "";
!
! $this->channel = array("title"=>"", "link"=>"", "description" => "");
! $this->image = array("title"=>"", "link"=>"");
! $this->items = array();
!
! $this->xml = xml_parser_create();
! xml_set_object($this->xml, &$this);
! }
!
! function parse_file($url) {
! // debug("rdfparser::parse_file", "Now parsing $url");
!
! xml_parser_set_option($this->xml, XML_OPTION_CASE_FOLDING, true);
! xml_set_element_handler($this->xml, "start_element", "end_element");
! xml_set_character_data_handler($this->xml, "character_data");
!
! $fpread = @fopen($url, "r");
! if ( !($fpread) ) {
! // error in opening url
! $this->error_str = "rdfparser::parse_file could not open $url";
! // debug("rdfparser::parse_file", $this->error_str);
!
! // Where does $err* come from?
! // debug("rdfparser::parse_file", "$errstr $errno");
! } else {
! while (($this->error_str == "") && ($data = fread($fpread, 4096))) {
! if (!xml_parse($this->xml, $data, feof($fpread))) {
! // error
! $this->error_str = xml_error_string(xml_get_error_code($this->xml)) . " at line " . xml_get_current_line_number($this->xml);
! debug("rdfparser::parse_file", $this->error_str);
! }
! }
! fclose($fpread);
! if ($this->error_str == "") {
! // debug("rdfparser::parse_file", "Data parsed successfully!");
! }
! }
! }
! }
!
! class Block_render_rss {
! var $type;
! var $output;
! var $rdf;
!
! /* constructor */
! function Block_render_rss() {
! global $_PSL;
!
! $this->type = "rss"; /* set the 'type' */
! $this->output = ""; /* clear the output */
! $this->rdf = new rdfparser;
! $this->psl = $_PSL;
! }
!
! /* returns the TYPE of this class */
! function getType() {
! return $this->type;
! }
!
! function...
[truncated message content] |