diff options
author | marijus <mario@mariovavti.com> | 2014-03-04 14:52:12 +0100 |
---|---|---|
committer | marijus <mario@mariovavti.com> | 2014-03-04 14:52:12 +0100 |
commit | ffb791968e48b5699dc99fffccc562f198f86c5d (patch) | |
tree | 4b53eeae5f9236f76f6ba4baee00b0a08adafe50 /include/widgets.php | |
parent | 636a52d001be9bce66f5b2fd7313ffa6540a97e4 (diff) | |
parent | 5b33d98f0814a2fcb23ad78d2442ebecc85d4fb5 (diff) | |
download | volse-hubzilla-ffb791968e48b5699dc99fffccc562f198f86c5d.tar.gz volse-hubzilla-ffb791968e48b5699dc99fffccc562f198f86c5d.tar.bz2 volse-hubzilla-ffb791968e48b5699dc99fffccc562f198f86c5d.zip |
Merge branch 'master' of https://github.com/friendica/red
Diffstat (limited to 'include/widgets.php')
-rw-r--r-- | include/widgets.php | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/include/widgets.php b/include/widgets.php index 8d5ab77e3..8d8eef160 100644 --- a/include/widgets.php +++ b/include/widgets.php @@ -623,3 +623,30 @@ function widget_suggestedchats($arr) { )); } +function widget_item($arr) { + $uid = $a->profile['profile_uid']; + if((! $uid) || (! $arr['mid'])) + return ''; + + if(! perm_is_allowed($uid,get_observer_hash(),'view_pages')) + return ''; + + require_once('include/security.php'); + $sql_extra = item_permissions_sql($uid); + + + $r = q("select * from item where mid = '%s' and uid = %d and item_restrict = " . intval(ITEM_WEBPAGE) . " $sql_extra limit 1", + dbesc($arr['mid']), + intval($uid) + ); + + if(! $r) + return ''; + + xchan_query($r); + $r = fetch_post_tags($r,true); + + $o .= prepare_page($r[0]); + return $o; + +}
\ No newline at end of file |