Merge remote-tracking branch 'mike/master' into dev

This commit is contained in:
Mario Vavti 2018-03-30 09:07:43 +02:00
commit 6822415ee2
6 changed files with 32 additions and 17 deletions

View File

@ -828,7 +828,7 @@ class Connedit extends \Zotlabs\Web\Controller {
$locstr = locations_by_netid($contact['xchan_hash']);
if(! $locstr)
$locstr = $contact['xchan_url'];
$locstr = unpunify($contact['xchan_url']);
$clone_warn = '';
$clonable = (in_array($contact['xchan_network'],['zot','rss']) ? true : false);
@ -852,8 +852,8 @@ class Connedit extends \Zotlabs\Web\Controller {
'$permcat' => [ 'permcat', t('Permission role'), '', '<span class="loading invisible">' . t('Loading') . '<span class="jumping-dots"><span class="dot-1">.</span><span class="dot-2">.</span><span class="dot-3">.</span></span></span>',$permcats ],
'$permcat_new' => t('Add permission role'),
'$permcat_enable' => feature_enabled(local_channel(),'permcats'),
'$addr' => $contact['xchan_addr'],
'$primeurl' => $contact['xchan_url'],
'$addr' => unpunify($contact['xchan_addr']),
'$primeurl' => unpunify($contact['xchan_url']),
'$section' => $section,
'$sections' => $sections,
'$vcard' => $vcard,

View File

@ -299,9 +299,9 @@ class Directory extends \Zotlabs\Web\Controller {
if(strlen($out))
$out .= ', ';
if($marr && in_arrayi($k,$marr))
$out .= '<strong>' . $k . '</strong>';
$out .= '<a href="' . z_root() . '/directory/f=&keywords=' . urlencode($k) .'"><strong>' . $k . '</strong></a>';
else
$out .= $k;
$out .= '<a href="' . z_root() . '/directory/f=&keywords=' . urlencode($k) .'">' . $k . '</a>';
}
}

View File

@ -80,6 +80,8 @@ class Tagger extends \Zotlabs\Web\Controller {
break;
}
$clean_term = trim($term,'"\' ');
$links = array(array('rel' => 'alternate','type' => 'text/html',
'href' => z_root() . '/display/' . gen_link_id($item['mid'])));
@ -103,15 +105,15 @@ class Tagger extends \Zotlabs\Web\Controller {
),
));
$tagid = z_root() . '/search?tag=' . $term;
$tagid = z_root() . '/search?tag=' . $clean_term;
$objtype = ACTIVITY_OBJ_TAGTERM;
$obj = json_encode(array(
'type' => $objtype,
'id' => $tagid,
'link' => array(array('rel' => 'alternate','type' => 'text/html', 'href' => $tagid)),
'title' => $term,
'content' => $term
'title' => $clean_term,
'content' => $clean_term
));
$bodyverb = t('%1$s tagged %2$s\'s %3$s with %4$s');
@ -119,7 +121,7 @@ class Tagger extends \Zotlabs\Web\Controller {
// saving here for reference
// also check out x22d5 and x2317 and x0d6b and x0db8 and x24d0 and xff20 !!!
$termlink = html_entity_decode('&#x22d5;') . '[zrl=' . z_root() . '/search?tag=' . urlencode($term) . ']'. $term . '[/zrl]';
$termlink = html_entity_decode('&#x22d5;') . '[zrl=' . z_root() . '/search?tag=' . urlencode($clean_term) . ']'. $clean_term . '[/zrl]';
$channel = \App::get_channel();
@ -143,8 +145,7 @@ class Tagger extends \Zotlabs\Web\Controller {
$arr['obj_type'] = $objtype;
$arr['obj'] = $obj;
$arr['parent_mid'] = $item['mid'];
store_item_tag($item['uid'],$item['id'],TERM_OBJ_POST,TERM_COMMUNITYTAG,$term,$tagid);
store_item_tag($item['uid'],$item['id'],TERM_OBJ_POST,TERM_COMMUNITYTAG,$clean_term,$tagid);
$ret = post_activity_item($arr);
if($ret['success']) {

View File

@ -1573,14 +1573,25 @@ function advanced_profile() {
$profile['howlong'] = relative_date(App::$profile['howlong'], t('for %1$d %2$s'));
}
if(App::$profile['keywords']) {
$keywords = str_replace(',',' ', App::$profile['keywords']);
$keywords = str_replace(' ',' ', $keywords);
$karr = explode(' ', $keywords);
if($karr) {
for($cnt = 0; $cnt < count($karr); $cnt ++) {
$karr[$cnt] = '<a href="' . z_root() . '/directory/f=&keywords=' . trim($karr[$cnt]) . '">' . $karr[$cnt] . '</a>';
}
}
$profile['keywords'] = array( t('Tags:'), implode(' ', $karr));
}
if(App::$profile['sexual']) $profile['sexual'] = array( t('Sexual Preference:'), App::$profile['sexual'] );
if(App::$profile['homepage']) $profile['homepage'] = array( t('Homepage:'), linkify(App::$profile['homepage']) );
if(App::$profile['hometown']) $profile['hometown'] = array( t('Hometown:'), linkify(App::$profile['hometown']) );
if(App::$profile['keywords']) $profile['keywords'] = array( t('Tags:'), App::$profile['keywords']);
if(App::$profile['politic']) $profile['politic'] = array( t('Political Views:'), App::$profile['politic']);
if(App::$profile['religion']) $profile['religion'] = array( t('Religion:'), App::$profile['religion']);

View File

@ -270,7 +270,8 @@ function locations_by_netid($netid) {
dbesc($netid)
);
return array_elm_to_str($locs,'location',', ');
return array_elm_to_str($locs,'location',', ','trim_and_unpunify');
}

View File

@ -2189,13 +2189,13 @@ function ids_to_querystr($arr,$idx = 'id',$quote = false) {
* @returns string
*/
function array_elm_to_str($arr,$elm,$delim = ',') {
function array_elm_to_str($arr,$elm,$delim = ',',$each = 'trim') {
$tmp = [];
if($arr && is_array($arr)) {
foreach($arr as $x) {
if(is_array($x) && array_key_exists($elm,$x)) {
$z = trim($x[$elm]);
$z = $each($x[$elm]);
if(($z) && (! in_array($z,$tmp))) {
$tmp[] = $z;
}
@ -2205,7 +2205,9 @@ function array_elm_to_str($arr,$elm,$delim = ',') {
return implode($delim,$tmp);
}
function trim_and_unpunify($s) {
return unpunify(trim($s));
}
/**