getBlog($CONF['DefaultBlog']); $lasttime = $b->getCorrectTime(); // SQL commands $query = 'SELECT i.inumber as itemid, i.ititle as title' . ', i.ibody as body, UNIX_TIMESTAMP(i.itime) as timestamp' . ' FROM ' . $MYSQL_PREFIX . 'nucleus_item as i' . ' WHERE i.iblog='.$b->blogid . ' and i.idraft=0' // exclude drafts . ' and i.itime<=' . mysqldate($lasttime) . ' ORDER by itime DESC LIMIT' . ' 0,' . $NofPosts; // RDF1.0 echo "\n\n"; echo "\n\n"; $entries = sql_query($query); $count = 0; $row = mysql_fetch_assoc ($entries); // date --date="Nov 28 2003 00:30:00 JST" +"%s" // $lasttime = '1069311600'; // $lasttime = $row[timestamp]; // channels echo " getURL() . $RDFfile . "\">\n"; echo " " . mb_convert_encoding($b->getName(), $encode, $origcodes) . "\n"; echo " " . $b->getURL() . "\n"; echo " " . mb_convert_encoding($b->getDescription(), $encode, $origcodes) . "\n"; echo " " . $lang . "\n"; // $temp = $b->getCorrectTime(); echo " " . w3cdtf( $lasttime ) . "\n"; echo " \n\n"; echo " \n \n"; $entries = sql_query($query); $count = 0; while ($row = mysql_fetch_assoc ($entries)){ $itemlink = createItemLink($row['itemid'],''); $baseurl = $b->getURL(); $temp = strlen( $baseurl )-1; if ( ( $baseurl[$temp] == "/" ) && ( $itemlink[0] == "/" )) { $baseurl = substr( $baseurl, 0 , $temp ); } echo " \n"; } echo " \n \n \n\n"; // each items $entries = sql_query($query); $count = 0; while ($row = mysql_fetch_assoc ($entries)){ $itemlink = createItemLink($row['itemid'],''); $baseurl = $b->getURL(); $temp = strlen( $baseurl )-1; if ( ( $baseurl[$temp] == "/" ) && ( $itemlink[0] == "/" )) { $baseurl = substr( $baseurl, 0 , $temp ); } echo "\n\n"; if ( $row['title'] ) { echo " " . mb_convert_encoding($row['title'], $encode, $origcodes) . "\n"; } else { echo " untitled"; } echo " " . $baseurl . $itemlink . "\n"; $temp = strip_tags($row[body]); $temp = ereg_replace( "\n", "", $temp ); $temp = ereg_replace( "\r", "", $temp ); if (strlen($temp) < $DescrptLen) { echo " " . mb_convert_encoding($temp, $encode, $origcodes) . "\n"; } else { echo " " . mb_substr(mb_convert_encoding($temp,$encode, $origcodes),0,$DescrptLen, $encode ) . " ..\n"; } echo " " . w3cdtf($row[timestamp] ) . "\n\n"; } echo "\n\n"; // function w3cdtf( $timestamp=0 ) { $r = date( "Y-m-d" , $timestamp ) . "T"; $temp = date( "O", $timestamp ); $temp = substr( $temp, 0,3 ) . ":" . substr( $temp, 3,2 ); $r = $r . date( "H:i:s", $timestamp ) . $temp; return $r; } ?>