From 870a70e109ac9e80a88047044530de53d0404ec7 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 7 Nov 2011 17:06:18 +0400 Subject: [PATCH] implement basic feed output for register.php --- register.php | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/register.php b/register.php index 144189f7..3198095a 100644 --- a/register.php +++ b/register.php @@ -16,6 +16,42 @@ init_connection($link); + if ($_REQUEST["format"] == "feed") { + header("Content-Type: text/xml"); + + print ''; + print " + ".htmlspecialchars(SELF_URL_PATH . "/register.php")." + Tiny Tiny RSS registration slots + + "; + + if (ENABLE_REGISTRATION) { + $result = db_query($link, "SELECT COUNT(*) AS cu FROM ttrss_users"); + $num_users = db_fetch_result($result, 0, "cu"); + + $num_users -= REG_MAX_USERS; + if ($num_users < 0) $num_users = 0; + $reg_suffix = "enabled"; + } else { + $num_users = 0; + $reg_suffix = "disabled"; + } + + print " + ".htmlspecialchars(SELF_URL_PATH)."/register.php?$num_users"." + "; + + print "$num_users slots are currently available, registration $reg_suffix"; + print "$num_users slots are currently available, registration $reg_suffix"; + + print ""; + + print ""; + + return; + } + /* Remove users which didn't login after receiving their registration information */ if (DB_TYPE == "pgsql") { -- 2.39.5