aboutsummaryrefslogtreecommitdiffstats
path: root/include/contact_widgets.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2018-01-09 09:00:20 +0100
committerMario <mario@mariovavti.com>2018-01-09 09:00:20 +0100
commit4f4d0e416eac87121898b8a27b1afa6065ff17a2 (patch)
treeaae7f2582b2b9c6596dcbf87c06a836434140830 /include/contact_widgets.php
parent22c89b6c660e185d5c5c6362acf23b145d932d15 (diff)
parent8fde0f01b8472082158b38386046ed606bcfbc49 (diff)
downloadvolse-hubzilla-4f4d0e416eac87121898b8a27b1afa6065ff17a2.tar.gz
volse-hubzilla-4f4d0e416eac87121898b8a27b1afa6065ff17a2.tar.bz2
volse-hubzilla-4f4d0e416eac87121898b8a27b1afa6065ff17a2.zip
Merge branch '3.0RC'3.0
Diffstat (limited to 'include/contact_widgets.php')
-rw-r--r--include/contact_widgets.php87
1 files changed, 68 insertions, 19 deletions
diff --git a/include/contact_widgets.php b/include/contact_widgets.php
index 9cc9f0baf..a105bca19 100644
--- a/include/contact_widgets.php
+++ b/include/contact_widgets.php
@@ -72,21 +72,66 @@ function categories_widget($baseurl,$selected = '') {
$item_normal = item_normal();
$terms = array();
+ $r = q("select distinct(term.term) from term join item on term.oid = item.id
+ where item.uid = %d
+ and term.uid = item.uid
+ and term.ttype = %d
+ and term.otype = %d
+ and item.owner_xchan = '%s'
+ and item.item_wall = 1
+ and item.verb != '%s'
+ $item_normal
+ $sql_extra
+ order by term.term asc",
+ intval(App::$profile['profile_uid']),
+ intval(TERM_CATEGORY),
+ intval(TERM_OBJ_POST),
+ dbesc(App::$profile['channel_hash']),
+ dbesc(ACTIVITY_UPDATE)
+ );
+ if($r && count($r)) {
+ foreach($r as $rr)
+ $terms[] = array('name' => $rr['term'], 'selected' => (($selected == $rr['term']) ? 'selected' : ''));
+
+ return replace_macros(get_markup_template('categories_widget.tpl'),array(
+ '$title' => t('Categories'),
+ '$desc' => '',
+ '$sel_all' => (($selected == '') ? 'selected' : ''),
+ '$all' => t('Everything'),
+ '$terms' => $terms,
+ '$base' => $baseurl,
+
+ ));
+ }
+ return '';
+}
+
+function cardcategories_widget($baseurl,$selected = '') {
+
+ if(! feature_enabled(App::$profile['profile_uid'],'categories'))
+ return '';
+
+ $sql_extra = item_permissions_sql(App::$profile['profile_uid']);
+
+ $item_normal = "and item.item_hidden = 0 and item.item_type = 6 and item.item_deleted = 0
+ and item.item_unpublished = 0 and item.item_delayed = 0 and item.item_pending_remove = 0
+ and item.item_blocked = 0 ";
+
+ $terms = array();
$r = q("select distinct(term.term)
- from term join item on term.oid = item.id
- where item.uid = %d
- and term.uid = item.uid
- and term.ttype = %d
+ from term join item on term.oid = item.id
+ where item.uid = %d
+ and term.uid = item.uid
+ and term.ttype = %d
and term.otype = %d
- and item.owner_xchan = '%s'
- and item.item_wall = 1
+ and item.owner_xchan = '%s'
$item_normal
$sql_extra
- order by term.term asc",
+ order by term.term asc",
intval(App::$profile['profile_uid']),
- intval(TERM_CATEGORY),
+ intval(TERM_CATEGORY),
intval(TERM_OBJ_POST),
- dbesc(App::$profile['channel_hash'])
+ dbesc(App::$profile['channel_hash'])
);
if($r && count($r)) {
foreach($r as $rr)
@@ -105,32 +150,33 @@ function categories_widget($baseurl,$selected = '') {
return '';
}
-function cardcategories_widget($baseurl,$selected = '') {
+
+function articlecategories_widget($baseurl,$selected = '') {
if(! feature_enabled(App::$profile['profile_uid'],'categories'))
return '';
$sql_extra = item_permissions_sql(App::$profile['profile_uid']);
- $item_normal = "and item.item_hidden = 0 and item.item_type = 6 and item.item_deleted = 0
+ $item_normal = "and item.item_hidden = 0 and item.item_type = 7 and item.item_deleted = 0
and item.item_unpublished = 0 and item.item_delayed = 0 and item.item_pending_remove = 0
and item.item_blocked = 0 ";
$terms = array();
$r = q("select distinct(term.term)
- from term join item on term.oid = item.id
- where item.uid = %d
- and term.uid = item.uid
- and term.ttype = %d
+ from term join item on term.oid = item.id
+ where item.uid = %d
+ and term.uid = item.uid
+ and term.ttype = %d
and term.otype = %d
- and item.owner_xchan = '%s'
+ and item.owner_xchan = '%s'
$item_normal
$sql_extra
- order by term.term asc",
+ order by term.term asc",
intval(App::$profile['profile_uid']),
- intval(TERM_CATEGORY),
+ intval(TERM_CATEGORY),
intval(TERM_OBJ_POST),
- dbesc(App::$profile['channel_hash'])
+ dbesc(App::$profile['channel_hash'])
);
if($r && count($r)) {
foreach($r as $rr)
@@ -151,6 +197,9 @@ function cardcategories_widget($baseurl,$selected = '') {
+
+
+
function common_friends_visitor_widget($profile_uid,$cnt = 25) {
if(local_channel() == $profile_uid)