From b08d4cc1fe2b8dd45de7546f05cf9a9601aeca03 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 23 Dec 2013 17:24:25 -0800 Subject: first cut at a directory popup. It's a bit annoying at the moment, so we'll have to make it less so. Also had second thoughts about the project homepage changes made yesterday. Just because a bunch of Reddit trolls can't get social networking out of their brain long enough to explore other technologies or even read the project page doesn't mean we should pander to them and explain how or why we either are or aren't a social network. --- mod/dirprofile.php | 151 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 151 insertions(+) create mode 100644 mod/dirprofile.php (limited to 'mod/dirprofile.php') diff --git a/mod/dirprofile.php b/mod/dirprofile.php new file mode 100644 index 000000000..133089419 --- /dev/null +++ b/mod/dirprofile.php @@ -0,0 +1,151 @@ +' : ''); + $connect_link = ((local_user()) ? z_root() . '/follow?f=&url=' . urlencode($rr['address']) : ''); + + if(in_array($rr['hash'],$contacts)) + $connect_link = ''; + + $details = ''; + if(strlen($rr['locale'])) + $details .= $rr['locale']; + if(strlen($rr['region'])) { + if(strlen($rr['locale'])) + $details .= ', '; + $details .= $rr['region']; + } + if(strlen($rr['country'])) { + if(strlen($details)) + $details .= ', '; + $details .= $rr['country']; + } + if(strlen($rr['birthday'])) { + if(($years = age($rr['birthday'],'UTC','')) != 0) + $details .= '
' . t('Age: ') . $years ; + } + if(strlen($rr['gender'])) + $details .= '
' . t('Gender: ') . $rr['gender']; + + $page_type = ''; + + $profile = $rr; + + if ((x($profile,'locale') == 1) + || (x($profile,'region') == 1) + || (x($profile,'postcode') == 1) + || (x($profile,'country') == 1)) + $location = t('Location:'); + + $gender = ((x($profile,'gender') == 1) ? t('Gender:') : False); + + $marital = ((x($profile,'marital') == 1) ? t('Status:') : False); + + $homepage = ((x($profile,'homepage') == 1) ? t('Homepage:') : False); + + $about = ((x($profile,'about') == 1) ? t('About:') : False); + + + + $entry = replace_macros(get_markup_template('direntry_large.tpl'), array( + '$id' => ++$t, + '$profile_link' => $profile_link, + '$photo' => $rr['photo_l'], + '$alttext' => $rr['name'] . ' ' . $rr['address'], + '$name' => $rr['name'], + '$details' => $pdesc . $details, + '$profile' => $profile, + '$location' => $location, + '$gender' => $gender, + '$pdesc' => $pdesc, + '$marital' => $marital, + '$homepage' => $homepage, + '$about' => $about, + '$conn_label' => t('Connect'), + '$connect' => $connect_link, + )); + + + echo $entry; + killme(); + + } + } + else { + info( t("Not found.") . EOL); + } + } + } + } + + + + +} \ No newline at end of file -- cgit v1.2.3 From 8194ade8868bb57180d49a86216fc6fd680b4e79 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 23 Dec 2013 19:44:23 -0800 Subject: improve the directory popup a bit --- mod/dirprofile.php | 42 +++++++++++++++++++++++++++++++++++------- 1 file changed, 35 insertions(+), 7 deletions(-) (limited to 'mod/dirprofile.php') diff --git a/mod/dirprofile.php b/mod/dirprofile.php index 133089419..dd583a89e 100644 --- a/mod/dirprofile.php +++ b/mod/dirprofile.php @@ -104,16 +104,42 @@ function dirprofile_init(&$a) { || (x($profile,'country') == 1)) $location = t('Location:'); - $gender = ((x($profile,'gender') == 1) ? t('Gender:') : False); - $marital = ((x($profile,'marital') == 1) ? t('Status:') : False); + $marital = ((x($profile,'marital') == 1) ? t('Status: ') . $profile['marital'] : False); + $sexual = ((x($profile,'sexual') == 1) ? t('Sexual Preference: ') . $profile['sexual'] : False); - $homepage = ((x($profile,'homepage') == 1) ? t('Homepage:') : False); - - $about = ((x($profile,'about') == 1) ? t('About:') : False); - +// $homepage = ((x($profile,'homepage') == 1) ? t('Homepage: ') . $profile['homepage'] : False); + +// $about = ((x($profile,'about') == 1) ? t('About: ') . $profile['about'] : False); + + $keywords = ((x($profile,'keywords')) ? $profile['keywords'] : ''); + if($keywords) { + $keywords = str_replace(',',' ', $keywords); + $keywords = str_replace(' ',' ', $keywords); + $karr = explode(' ', $keywords); + $out = ''; + if($karr) { + if(local_user()) { + $r = q("select keywords from profile where uid = %d and is_default = 1 limit 1", + intval(local_user()) + ); + if($r) { + $keywords = str_replace(',',' ', $r[0]['keywords']); + $keywords = str_replace(' ',' ', $keywords); + $marr = explode(' ', $keywords); + } + } + foreach($karr as $k) { + if(strlen($out)) + $out .= ', '; + if($marr && in_array($k,$marr)) + $out .= '' . $k . ''; + else + $out .= $k; + } + } - + } $entry = replace_macros(get_markup_template('direntry_large.tpl'), array( '$id' => ++$t, '$profile_link' => $profile_link, @@ -128,6 +154,8 @@ function dirprofile_init(&$a) { '$marital' => $marital, '$homepage' => $homepage, '$about' => $about, + '$kw' => (($out) ? t('Keywords: ') : ''), + '$keywords' => $out, '$conn_label' => t('Connect'), '$connect' => $connect_link, )); -- cgit v1.2.3 From 71dde7c6875c85e4bfbe6e2eadecaf0bbc9fd20c Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 23 Dec 2013 22:56:32 -0800 Subject: use case-insensitive array search for matching directory keywords with your own --- mod/dirprofile.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod/dirprofile.php') diff --git a/mod/dirprofile.php b/mod/dirprofile.php index dd583a89e..01a0debfc 100644 --- a/mod/dirprofile.php +++ b/mod/dirprofile.php @@ -132,7 +132,7 @@ function dirprofile_init(&$a) { foreach($karr as $k) { if(strlen($out)) $out .= ', '; - if($marr && in_array($k,$marr)) + if($marr && in_arrayi($k,$marr)) $out .= '' . $k . ''; else $out .= $k; -- cgit v1.2.3 From fe00e9b2615dbc06ee0db82ca2c4334baa64e258 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 25 Dec 2013 01:57:04 -0800 Subject: extend the directory profiles a bit more --- mod/dirprofile.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'mod/dirprofile.php') diff --git a/mod/dirprofile.php b/mod/dirprofile.php index 01a0debfc..ba056e864 100644 --- a/mod/dirprofile.php +++ b/mod/dirprofile.php @@ -1,6 +1,7 @@ $pdesc, '$marital' => $marital, '$homepage' => $homepage, + '$hometown' => $hometown, '$about' => $about, '$kw' => (($out) ? t('Keywords: ') : ''), '$keywords' => $out, -- cgit v1.2.3 From 29db2369811ba35515d285491ce089d937ed8d29 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 8 Jan 2014 14:11:39 -0800 Subject: qr enhancements --- mod/dirprofile.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'mod/dirprofile.php') diff --git a/mod/dirprofile.php b/mod/dirprofile.php index ba056e864..0cd84b910 100644 --- a/mod/dirprofile.php +++ b/mod/dirprofile.php @@ -70,6 +70,8 @@ function dirprofile_init(&$a) { $profile_link = chanlink_url($rr['url']); $pdesc = (($rr['description']) ? $rr['description'] . '
' : ''); + + $qrlink = zid($rr['url']); $connect_link = ((local_user()) ? z_root() . '/follow?f=&url=' . urlencode($rr['address']) : ''); if(in_array($rr['hash'],$contacts)) @@ -145,6 +147,7 @@ function dirprofile_init(&$a) { $entry = replace_macros(get_markup_template('direntry_large.tpl'), array( '$id' => ++$t, '$profile_link' => $profile_link, + '$qrlink' => $qrlink, '$photo' => $rr['photo_l'], '$alttext' => $rr['name'] . ' ' . $rr['address'], '$name' => $rr['name'], -- cgit v1.2.3 From 05951a9877a2e8d0369ae3201a4379016b9b4968 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 21 Jan 2014 18:45:40 -0800 Subject: add primary webbie to directory popup --- mod/dirprofile.php | 1 + 1 file changed, 1 insertion(+) (limited to 'mod/dirprofile.php') diff --git a/mod/dirprofile.php b/mod/dirprofile.php index 0cd84b910..1593b014a 100644 --- a/mod/dirprofile.php +++ b/mod/dirprofile.php @@ -153,6 +153,7 @@ function dirprofile_init(&$a) { '$name' => $rr['name'], '$details' => $pdesc . $details, '$profile' => $profile, + '$address' => $rr['address'], '$location' => $location, '$gender' => $gender, '$pdesc' => $pdesc, -- cgit v1.2.3 From d970c69f91b96b3ef40752a95ecec8ca8b11b62a Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 28 Jan 2014 19:49:56 -0800 Subject: online indication to the directory popup --- mod/dirprofile.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'mod/dirprofile.php') diff --git a/mod/dirprofile.php b/mod/dirprofile.php index 1593b014a..d88144f52 100644 --- a/mod/dirprofile.php +++ b/mod/dirprofile.php @@ -74,6 +74,9 @@ function dirprofile_init(&$a) { $qrlink = zid($rr['url']); $connect_link = ((local_user()) ? z_root() . '/follow?f=&url=' . urlencode($rr['address']) : ''); + $online = remote_online_status($rr['address']); + + if(in_array($rr['hash'],$contacts)) $connect_link = ''; @@ -151,6 +154,7 @@ function dirprofile_init(&$a) { '$photo' => $rr['photo_l'], '$alttext' => $rr['name'] . ' ' . $rr['address'], '$name' => $rr['name'], + '$online' => (($online) ? t('Online Now') : ''), '$details' => $pdesc . $details, '$profile' => $profile, '$address' => $rr['address'], -- cgit v1.2.3