aboutsummaryrefslogtreecommitdiffstats
path: root/boot.php
diff options
context:
space:
mode:
authorMike Macgirvin <mike@macgirvin.com>2010-09-13 22:57:31 -0700
committerMike Macgirvin <mike@macgirvin.com>2010-09-13 22:57:31 -0700
commitc5031139ebb46ce4994d3bd62059ae4eaba71359 (patch)
treeaadb065cbaf0fbf788b6f4fdd7a5e1a332ba7373 /boot.php
parent38fde6672eb3d46b8b154ba2f22df99f91f64852 (diff)
downloadvolse-hubzilla-c5031139ebb46ce4994d3bd62059ae4eaba71359.tar.gz
volse-hubzilla-c5031139ebb46ce4994d3bd62059ae4eaba71359.tar.bz2
volse-hubzilla-c5031139ebb46ce4994d3bd62059ae4eaba71359.zip
abstractify items, check photos for birthday paradox
Diffstat (limited to 'boot.php')
-rw-r--r--boot.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/boot.php b/boot.php
index b69502ef2..1a1a05418 100644
--- a/boot.php
+++ b/boot.php
@@ -776,6 +776,23 @@ function item_new_uri($hostname,$uid) {
return $uri;
}}
+if(! function_exists('photo_new_resource')) {
+function photo_new_resource() {
+
+ do {
+ $found = false;
+ $resource = hash('md5',uniqid(mt_rand(),true));
+ $r = q("SELECT `id` FROM `photo` WHERE `resource-id` = '%s' LIMIT 1",
+ dbesc($resource)
+ );
+ if(count($r))
+ $found = true;
+ } while($found == true);
+ return $resource;
+}}
+
+
+
if(! function_exists('get_uid')) {
function get_uid() {
return ((x($_SESSION,'uid')) ? intval($_SESSION['uid']) : 0) ;