diff options
Diffstat (limited to 'include/socgraph.php')
-rw-r--r-- | include/socgraph.php | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/include/socgraph.php b/include/socgraph.php index 7f03f8696..0ad7c4034 100644 --- a/include/socgraph.php +++ b/include/socgraph.php @@ -180,6 +180,26 @@ function poco_load($xchan = '', $url = null) { } $total ++; + + + $r = q("select * from xlink where xlink_xchan = '%s' and xlink_link = '%s' and xlink_static = 0 limit 1", + dbesc($xchan), + dbesc($hash) + ); + + if(! $r) { + q("insert into xlink ( xlink_xchan, xlink_link, xlink_updated, xlink_static ) values ( '%s', '%s', '%s', 0 ) ", + dbesc($xchan), + dbesc($hash), + dbesc(datetime_convert()) + ); + } + else { + q("update xlink set xlink_updated = '%s' where xlink_id = %d", + dbesc(datetime_convert()), + intval($r[0]['xlink_id']) + ); + } } logger("poco_load: loaded $total entries",LOGGER_DEBUG); @@ -450,7 +470,7 @@ function poco($a,$extended = false) { $sql_extra = " and abook_flags = 0 "; if($cid) - $sql_extra = sprintf(" and abook_id = %d ",intval($cid)); + $sql_extra = sprintf(" and abook_id = %d and ( abook_flags & " . ABOOK_FLAG_HIDDEN . " ) = 0 ",intval($cid)); if($system_mode) { $r = q("SELECT count(*) as `total` from abook where ( abook_flags & " . ABOOK_FLAG_SELF . |