diff options
author | Fabio Comuni <fabrix.xm@gmail.com> | 2011-09-26 11:42:48 +0200 |
---|---|---|
committer | Fabio Comuni <fabrix.xm@gmail.com> | 2011-09-26 11:42:48 +0200 |
commit | 5792b3d3580b9f09460305858293398d8d8a9abf (patch) | |
tree | 90d60e9db4ed733a60c2890c7305d45ddd48be42 /include/network.php | |
parent | 991656a3ef396d9a6bd43ddb752627c2880b17ba (diff) | |
parent | 428e6766411d2c6708ad25f726c4bcf1d64af1cc (diff) | |
download | volse-hubzilla-5792b3d3580b9f09460305858293398d8d8a9abf.tar.gz volse-hubzilla-5792b3d3580b9f09460305858293398d8d8a9abf.tar.bz2 volse-hubzilla-5792b3d3580b9f09460305858293398d8d8a9abf.zip |
Merge branch 'master' into newui
Diffstat (limited to 'include/network.php')
-rw-r--r-- | include/network.php | 73 |
1 files changed, 54 insertions, 19 deletions
diff --git a/include/network.php b/include/network.php index deb257ff3..ec99d1e0d 100644 --- a/include/network.php +++ b/include/network.php @@ -701,24 +701,59 @@ function parse_xml_string($s,$strict = true) { return $x; }} -function add_fcontact($arr) { - - $r = q("insert into fcontact ( `url`,`name`,`photo`,`request`,`nick`,`addr`, - `notify`,`poll`,`confirm`,`network`,`alias`,`pubkey`,`updated` ) - values('%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s')", - dbesc($arr['url']), - dbesc($arr['name']), - dbesc($arr['photo']), - dbesc($arr['request']), - dbesc($arr['nick']), - dbesc($arr['addr']), - dbesc($arr['notify']), - dbesc($arr['poll']), - dbesc($arr['confirm']), - dbesc($arr['network']), - dbesc($arr['alias']), - dbesc($arr['pubkey']), - dbesc(datetime_convert()) - ); +function add_fcontact($arr,$update = false) { + + if($update) { + $r = q("UPDATE `fcontact` SET + `name` = '%s', + `photo` = '%s', + `request` = '%s', + `nick` = '%s', + `addr` = '%s', + `batch` = '%s', + `notify` = '%s', + `poll` = '%s', + `confirm` = '%s', + `alias` = '%s', + `pubkey` = '%s', + `updated` = '%s' + WHERE `url` = '%s' AND `network` = '%s' LIMIT 1", + dbesc($arr['name']), + dbesc($arr['photo']), + dbesc($arr['request']), + dbesc($arr['nick']), + dbesc($arr['addr']), + dbesc($arr['batch']), + dbesc($arr['notify']), + dbesc($arr['poll']), + dbesc($arr['confirm']), + dbesc($arr['network']), + dbesc($arr['alias']), + dbesc($arr['pubkey']), + dbesc(datetime_convert()), + dbesc($arr['url']), + dbesc($arr['network']) + ); + } + else { + $r = q("insert into fcontact ( `url`,`name`,`photo`,`request`,`nick`,`addr`, + `batch`, `notify`,`poll`,`confirm`,`network`,`alias`,`pubkey`,`updated` ) + values('%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s')", + dbesc($arr['url']), + dbesc($arr['name']), + dbesc($arr['photo']), + dbesc($arr['request']), + dbesc($arr['nick']), + dbesc($arr['addr']), + dbesc($arr['batch']), + dbesc($arr['notify']), + dbesc($arr['poll']), + dbesc($arr['confirm']), + dbesc($arr['network']), + dbesc($arr['alias']), + dbesc($arr['pubkey']), + dbesc(datetime_convert()) + ); + } return $r; } |