friendica-github/include/fcontact.php

34 lines
676 B
PHP
Raw Normal View History

2011-03-14 05:07:56 +00:00
<?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 (dbm::is_result($r))
2011-03-14 05:07:56 +00:00
return $r[0]['id'];
$r = dba::insert('fcontact', array('url' => $nurl, 'name' => $name, 'photo' => $photo));
2011-03-14 05:07:56 +00:00
if (dbm::is_result($r)) {
2011-03-14 05:07:56 +00:00
$r = q("SELECT `id` FROM `fcontact` WHERE `url` = '%s' LIMIT 1",
dbesc($nurl)
);
if (dbm::is_result($r))
2011-03-14 05:07:56 +00:00
return $r[0]['id'];
}
return 0;
}
function ffinder_store($uid,$cid,$fid) {
$r = dba::insert('ffinder', array('uid' => $uid, 'cid' => $cid, 'fid' => $fid));
2011-03-14 05:07:56 +00:00
return $r;
}