X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fcontact_widgets.php;h=96b02f29391c816926739db27dc07fb86d552bc1;hb=39405c8056b4a1d55c97fb2963d8776695dbeb30;hp=135a9e4e8655a51f584504797709f28e87daeadb;hpb=6780b76b0c0c8f9f250fabe2ea35ee22139ba3d1;p=friendica.git diff --git a/include/contact_widgets.php b/include/contact_widgets.php old mode 100755 new mode 100644 index 135a9e4e86..96b02f2939 --- a/include/contact_widgets.php +++ b/include/contact_widgets.php @@ -12,6 +12,7 @@ function follow_widget() { } function findpeople_widget() { + require_once('include/Contact.php'); $a = get_app(); @@ -32,6 +33,7 @@ function findpeople_widget() { '$findthem' => t('Find'), '$suggest' => t('Friend Suggestions'), '$similar' => t('Similar Interests'), + '$random' => t('Random Profile'), '$inv' => t('Invite Friends') )); @@ -46,7 +48,7 @@ function networks_widget($baseurl,$selected = '') { return ''; - $r = q("select distinct(network) from contact where uid = %d", + $r = q("select distinct(network) from contact where uid = %d and self = 0", intval(local_user()) ); @@ -87,13 +89,41 @@ function fileas_widget($baseurl,$selected = '') { $cnt = preg_match_all('/\[(.*?)\]/',$saved,$matches,PREG_SET_ORDER); if($cnt) { foreach($matches as $mtch) { - $unescaped = file_tag_decode($mtch[1]); + $unescaped = xmlify(file_tag_decode($mtch[1])); $terms[] = array('name' => $unescaped,'selected' => (($selected == $unescaped) ? 'selected' : '')); } } return replace_macros(get_markup_template('fileas_widget.tpl'),array( - '$title' => t('File Selections'), + '$title' => t('Saved Folders'), + '$desc' => '', + '$sel_all' => (($selected == '') ? 'selected' : ''), + '$all' => t('Everything'), + '$terms' => $terms, + '$base' => $baseurl, + + )); +} + +function categories_widget($baseurl,$selected = '') { + $a = get_app(); + + $saved = get_pconfig($a->profile['profile_uid'],'system','filetags'); + if(! strlen($saved)) + return; + + $matches = false; + $terms = array(); + $cnt = preg_match_all('/<(.*?)>/',$saved,$matches,PREG_SET_ORDER); + if($cnt) { + foreach($matches as $mtch) { + $unescaped = xmlify(file_tag_decode($mtch[1])); + $terms[] = array('name' => $unescaped,'selected' => (($selected == $unescaped) ? 'selected' : '')); + } + } + + return replace_macros(get_markup_template('categories_widget.tpl'),array( + '$title' => t('Categories'), '$desc' => '', '$sel_all' => (($selected == '') ? 'selected' : ''), '$all' => t('Everything'),