aboutsummaryrefslogtreecommitdiffstats
path: root/notification.php
diff options
context:
space:
mode:
Diffstat (limited to 'notification.php')
-rw-r--r--notification.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/notification.php b/notification.php
index beb91b4da..0be9aa8b7 100644
--- a/notification.php
+++ b/notification.php
@@ -28,6 +28,29 @@
define('PHPWG_ROOT_PATH','./');
include_once( PHPWG_ROOT_PATH.'include/common.inc.php' );
+/**
+ * search an available feed_id
+ *
+ * @return string feed identifier
+ */
+function find_available_feed_id()
+{
+ while (true)
+ {
+ $key = generate_key(50);
+ $query = '
+SELECT COUNT(*)
+ FROM '.USER_FEED_TABLE.'
+ WHERE id = \''.$key.'\'
+;';
+ list($count) = pwg_db_fetch_row(pwg_query($query));
+ if (0 == $count)
+ {
+ return $key;
+ }
+ }
+}
+
// +-----------------------------------------------------------------------+
// | Check Access and exit when user status is not ok |
// +-----------------------------------------------------------------------+