aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-03-03 18:20:52 -0800
committerfriendica <info@friendica.com>2014-03-03 18:20:52 -0800
commit12480a13cd46b5aa747dc72b42b0d78b8852d2bb (patch)
tree4dec3f578b3c796e216b782804e71addedf7e11d
parent5c08713ee52196908b1304c46b63b99f3588be9c (diff)
downloadvolse-hubzilla-12480a13cd46b5aa747dc72b42b0d78b8852d2bb.tar.gz
volse-hubzilla-12480a13cd46b5aa747dc72b42b0d78b8852d2bb.tar.bz2
volse-hubzilla-12480a13cd46b5aa747dc72b42b0d78b8852d2bb.zip
item widget - displays one (webpage) item by mid. This is how you could put multiple content blobs on a page without turning them all into blocks.
-rw-r--r--include/widgets.php27
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