$day) { if (file_exists("$mods/sgf.$day")) { $games = file("$mods/sgf.$day"); if (!count($games)) continue; $newgames[$kday] = array( 'url' => 'http://gobase.org/information/whatsnew/' , 'date' => date('Y-m-d', strtotime("-$day days")) , 'time' => '00:15:00' , 'text' => "New games (select to replay):\n<p>\n" ); foreach ($games as $kgame => $path) { $url = str_replace( array( './' ) , array( '/games/') , $path ) ; $sgfphp = '/home/jansteen/gobase/bin/sgfphp'; eval("\$prop = " . `$sgfphp {$_SERVER['DOCUMENT_ROOT']}/$url` . ";"); $text = "{$prop['dt']} {$prop['ev']} (" . strtolower($prop['pc']) . "): "; $text .= "{$prop['pb']},{$prop['br']} vs. {$prop['pw']},{$prop['wr']}"; $newgames[$kday]['text'] .= "<a target='gobase_gam' href='http://gobase.org/replay/?gam=$url'>$text</a><br>\n"; } } } return $newgames; } function rss_items() // // Emit news items as RSS records // { global $news; global $tips; $rss_articles = array_merge($news, $tips); $rss_articles = array_merge($rss_articles, rss_games()); uasort($rss_articles, 'cmp_news'); $now = strtotime(date('Y-m-d')); foreach ($rss_articles as $key => $val) { $news_item = $val; if (!empty($news_item['expired'])) continue; // // Tips might not have an URL reference. // if (empty($news_item['url'])) $news_item['url'] = 'http://gobase.org/'; // // Two month old, then break // $then = strtotime($news_item['date']); if ($now - $then > 2 * (60 * 60 * 24 * 31)) break; if (!preg_match('/^http:/', $news_item['url'])) { $news_item['url'] = "http://gobase.org{$news_item['url']}"; } $news_item['url'] = htmlentities($news_item['url']); print "\n"; print " "; if (!empty($news_item['title'])) { print $news_item['title']; } else { print $news_item['url']; } print "\n"; print " "; print reEncodeString(strip_tags($news_item['text'])); print "\n"; if (false && !empty($news_item['ccode'])) { flag_emit($news_item['ccode']); } if (!empty($news_item['url'])) { print " "; print "{$news_item['url']}"; print "\n"; } if (false && !empty($news_item['pics'])) { foreach ($news_item['pics'] as $k => $img) { print " \n"; } } if (false && !empty($news_item['pics'])) { foreach ($news_item['pics'] as $k => $img) { print "\n"; print "{$img['alt']}\n"; print "http://gobase.org{$img['src']}\n"; print "http://gobase.org{$img['url']}\n"; print "{$img['w']}\n"; print "{$img['h']}\n"; print "\n"; } } // // Emit date in RFC-822 format // if (!isset($news_item['time'])) { $news_item['time'] = "00:00:00"; } print " "; print date( 'D, d M Y H:i:s O' , strtotime( $news_item['date'] . " " . $news_item['time'] ) ) ; print "\n"; print " editor@gobase.org\n"; print " GoBase.org\n"; print "\n"; } } ?> \n"; print "\n"; print "\n"; print "GoBase.org:Go games, Go information and Go study tools.\n"; print "http://gobase.org\n"; print "en-gb\n"; print "Copyright: GoBase.org, J. van der Steen\n"; print "GoBase.org | news\n"; print "\n"; print "GoBase.org\n"; print "http://gobase.org/img/new/gobase-org-small.gif\n"; print "http://gobase.org/\n"; print "\n"; rss_items(); print "\n"; print "\n"; ?>