]> git.mxchange.org Git - friendica.git/commitdiff
friend finder support functions
authorFriendika <info@friendika.com>
Mon, 14 Mar 2011 05:07:56 +0000 (22:07 -0700)
committerFriendika <info@friendika.com>
Mon, 14 Mar 2011 05:07:56 +0000 (22:07 -0700)
include/fcontact.php [new file with mode: 0644]

diff --git a/include/fcontact.php b/include/fcontact.php
new file mode 100644 (file)
index 0000000..8821a98
--- /dev/null
@@ -0,0 +1,41 @@
+<?php
+
+
+
+function fcontact_store($url,$name,$photo) {
+
+       $nurl = str_replace(array('https:','//www.'), array('http:','//'), $url);
+
+       $r = q("SELECT `id` FROM `fcontact` WHERE `url` = '%s' LIMIT 1",
+               dbesc($nurl)
+       );
+
+       if(count($r))
+               return $r[0]['id'];
+
+       $r = q("INSERT INTO `fcontact` ( `url`, `name`, `photo` ) VALUES ( '%s', '%s', '%s' ) ",
+               dbesc($nurl),
+               dbesc($name),
+               dbesc($photo)
+       );
+
+       if($r) {
+               $r = q("SELECT `id` FROM `fcontact` WHERE `url` = '%s' LIMIT 1",
+                       dbesc($nurl)
+               );
+               if(count($r))
+                       return $r[0]['id'];
+       }
+
+       return 0;
+}
+
+function ffinder_store($uid,$cid,$fid) {
+       $r = q("INSERT INTO `ffinder` ( `uid`, `cid`, `fid` ) VALUES ( %d, %d, %d ) ",
+               intval($uid),
+               intval($cid),
+               intval($fid)
+       );
+       return $r;
+}
+