pace ) {
$this->append(
$this->current_item[ $this->current_namespace ][$this->current_field ],
$text);
}
else {
$this->append(
$this->current_item[ $this->current_field ],
$text );
}
}
elseif ( $this->parent_field[0] == 'author' ) {
if ( $this->current_namespace ) {
$this->append(
$this->author[ $this->current_namespace ][ $this->current_field ],
$text );
}
else {
$this->append(
$this->author[ $this->current_field ],
$text );
}
}
elseif ( $this->parent_field[0] == 'contributor' ) {
if ( $this->current_namespace ) {
$this->append(
$this->contributor[ $this->current_namespace ][ $this->current_field ],
$text );
}
else {
$this->append(
$this->contributor[ $this->current_field ],
$text );
}
}
}
function append (&$str1, $str2="") {
if (!isset($str1) ) {
$str1="";
}
$str1 .= $str2;
}
function error ($errormsg, $lvl=E_USER_WARNING) {
// append PHP's error message if track_errors enabled
if ( $php_errormsg ) {
$errormsg .= " ($php_errormsg)";
}
$this->ERROR = $errormsg;
if ( ATOM_DEBUG ) {
trigger_error( $errormsg, $lvl);
}
else {
error_log( $errormsg, 0);
}
}
/*======================================================================*\
EVERYTHING BELOW HERE IS FOR DEBUGGING PURPOSES
\*======================================================================*/
function show_list () {
echo "<ol>\n";
foreach ($this->entries as $item) {
echo "<li>", $this->show_entry( $item );
}
echo "</ol>";
}
function show_feed () {
echo "feed:<br>";
echo "<ul>";
while ( list($key, $value) = each( $this->feed ) ) {
echo "<li> $key: $value";
}
echo "</ul>";
}
function show_entry ($item) {
echo "entry: $item[title]";
echo "<ul>";
while ( list($key, $value) = each($item) ) {
if ( is_array($value) ) {
echo "<br><b>$key</b>";
echo "<ul>";
while ( list( $ns_key, $ns_value) = each( $value ) ) {
echo "<li>$ns_key: $ns_value";
}
echo "</ul>";
}
else {
echo "<li> $key: $value";
}
}
echo "</ul>";
}
/*======================================================================*\
END DEBUGGING FUNCTIONS
\*======================================================================*/
} # end class Atom
?>