From b76cddb9313d8a67e5d7e1830503b5775666238f Mon Sep 17 00:00:00 2001 From: Arun Persaud Date: Tue, 2 Feb 2010 22:37:27 -0800 Subject: NEW FEATURE: provide an RSS feed for each user showing in which games it's his turn the feed shows the same as the "It's your turn in these games" box. --- rss.php | 101 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 rss.php (limited to 'rss.php') diff --git a/rss.php b/rss.php new file mode 100644 index 0000000..6dbb6e6 --- /dev/null +++ b/rss.php @@ -0,0 +1,101 @@ + + +E-DoKo Feed +Know when it is your turn +\n"; +echo "\n"; +$date = DB_query_array("Select create_date from User order by create_date ASC limit 1"); +$date = $date[0]; +$timestamp = strtotime($date); +echo "tag:".$_SERVER['SERVER_NAME'].",".date("Y-m-d",$timestamp).":$INDEX\n"; +echo "".date(DATE_ATOM)."\n"; +echo "\n"; +echo "$ADMIN_NAME $date $timestamp\n"; +echo "$ADMIN_EMAIL\n"; +echo "\n\n"; + + + /* output the entries */ + + + $result = DB_query("SELECT Hand.hash,Hand.game_id,Game.player from Hand". + " LEFT JOIN Game On Hand.game_id=Game.id". + " WHERE Hand.user_id='$id'". + " AND ( Game.player='$id' OR ISNULL(Game.player) )". + " AND ( Game.status='pre' OR Game.status='play' )". + " ORDER BY Game.session" ); + + while( $r = DB_fetch_array($result)) + { + echo "\n"; + echo "game ".DB_format_gameid($r[1])."\n"; + $url=$INDEX."?action=game&me=".$r[0]; + echo "\n"; + $date = DB_get_game_timestamp($r[1]); + $timestamp = strtotime($date); + $date = date("Y-m-d",$timestamp); + echo "tag:doko.nubati.net,$date:$url\n"; + echo "".date(DATE_ATOM,$timestamp)."\n"; + echo "Please use the link to access the game.\n"; + echo "\n\n"; + } + +?> + \ No newline at end of file -- cgit v1.2.3-18-g5258