X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fcontact_widgets.php;h=96b02f29391c816926739db27dc07fb86d552bc1;hb=384d28a6bd04648a2d15e257568a5c9f65273db4;hp=605a3eb78e64c46bcf4691774a8f1a0a8995fbc5;hpb=c95deb48398a23de68a3d438b5fffeaea3f3fa01;p=friendica.git diff --git a/include/contact_widgets.php b/include/contact_widgets.php old mode 100755 new mode 100644 index 605a3eb78e..96b02f2939 --- a/include/contact_widgets.php +++ b/include/contact_widgets.php @@ -12,11 +12,10 @@ function follow_widget() { } function findpeople_widget() { + require_once('include/Contact.php'); $a = get_app(); - $inv = (($a->config['register_policy'] != REGISTER_CLOSED) ? t('Invite Friends') : ''); - if(get_config('system','invitation_only')) { $x = get_pconfig(local_user(),'system','invites_remaining'); if($x || is_site_admin()) { @@ -34,7 +33,8 @@ function findpeople_widget() { '$findthem' => t('Find'), '$suggest' => t('Friend Suggestions'), '$similar' => t('Similar Interests'), - '$inv' => $inv + '$random' => t('Random Profile'), + '$inv' => t('Invite Friends') )); } @@ -48,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()) ); @@ -89,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'),