improve the directory popup a bit
This commit is contained in:
parent
766454a607
commit
8194ade886
@ -201,10 +201,10 @@ function syncdirs($uid) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$address = $p[0]['channel_address'] . '@' . get_app()->get_hostname();
|
||||||
|
|
||||||
if(perm_is_allowed($uid,'','view_profile')) {
|
if(perm_is_allowed($uid,'','view_profile')) {
|
||||||
import_directory_profile($hash,$profile);
|
import_directory_profile($hash,$profile,$address,0);
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// they may have made it private
|
// they may have made it private
|
||||||
|
@ -104,16 +104,42 @@ function dirprofile_init(&$a) {
|
|||||||
|| (x($profile,'country') == 1))
|
|| (x($profile,'country') == 1))
|
||||||
$location = t('Location:');
|
$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);
|
// $homepage = ((x($profile,'homepage') == 1) ? t('Homepage: ') . $profile['homepage'] : False);
|
||||||
|
|
||||||
$about = ((x($profile,'about') == 1) ? t('About:') : 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 .= '<strong>' . $k . '</strong>';
|
||||||
|
else
|
||||||
|
$out .= $k;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
$entry = replace_macros(get_markup_template('direntry_large.tpl'), array(
|
$entry = replace_macros(get_markup_template('direntry_large.tpl'), array(
|
||||||
'$id' => ++$t,
|
'$id' => ++$t,
|
||||||
'$profile_link' => $profile_link,
|
'$profile_link' => $profile_link,
|
||||||
@ -128,6 +154,8 @@ function dirprofile_init(&$a) {
|
|||||||
'$marital' => $marital,
|
'$marital' => $marital,
|
||||||
'$homepage' => $homepage,
|
'$homepage' => $homepage,
|
||||||
'$about' => $about,
|
'$about' => $about,
|
||||||
|
'$kw' => (($out) ? t('Keywords: ') : ''),
|
||||||
|
'$keywords' => $out,
|
||||||
'$conn_label' => t('Connect'),
|
'$conn_label' => t('Connect'),
|
||||||
'$connect' => $connect_link,
|
'$connect' => $connect_link,
|
||||||
));
|
));
|
||||||
|
@ -172,13 +172,11 @@ function dirsearch_content(&$a) {
|
|||||||
json_return_and_die($spkt);
|
json_return_and_die($spkt);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
dbg(1);
|
|
||||||
$r = q("SELECT xchan.*, xprof.* from xchan left join xprof on xchan_hash = xprof_hash where ( $logic $sql_extra ) and not ( xchan_flags & %d ) and not ( xchan_flags & %d ) and not ( xchan_flags & %d ) $safesql $order $qlimit ",
|
$r = q("SELECT xchan.*, xprof.* from xchan left join xprof on xchan_hash = xprof_hash where ( $logic $sql_extra ) and not ( xchan_flags & %d ) and not ( xchan_flags & %d ) and not ( xchan_flags & %d ) $safesql $order $qlimit ",
|
||||||
intval(XCHAN_FLAGS_HIDDEN),
|
intval(XCHAN_FLAGS_HIDDEN),
|
||||||
intval(XCHAN_FLAGS_ORPHAN),
|
intval(XCHAN_FLAGS_ORPHAN),
|
||||||
intval(XCHAN_FLAGS_DELETED)
|
intval(XCHAN_FLAGS_DELETED)
|
||||||
);
|
);
|
||||||
dbg(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$ret['page'] = $page + 1;
|
$ret['page'] = $page + 1;
|
||||||
@ -195,8 +193,6 @@ dbg(0);
|
|||||||
$entry['name'] = $rr['xchan_name'];
|
$entry['name'] = $rr['xchan_name'];
|
||||||
$entry['hash'] = $rr['xchan_hash'];
|
$entry['hash'] = $rr['xchan_hash'];
|
||||||
|
|
||||||
// $entry['updated'] = (($rr['ud_date']) ? $rr['ud_date'] : '0000-00-00 00:00:00');
|
|
||||||
// $entry['update_guid'] = (($rr['ud_guid']) ? $rr['ud_guid'] : '');
|
|
||||||
$entry['url'] = $rr['xchan_url'];
|
$entry['url'] = $rr['xchan_url'];
|
||||||
$entry['photo_l'] = $rr['xchan_photo_l'];
|
$entry['photo_l'] = $rr['xchan_photo_l'];
|
||||||
$entry['photo'] = $rr['xchan_photo_m'];
|
$entry['photo'] = $rr['xchan_photo_m'];
|
||||||
@ -210,6 +206,7 @@ dbg(0);
|
|||||||
$entry['age'] = $rr['xprof_age'];
|
$entry['age'] = $rr['xprof_age'];
|
||||||
$entry['gender'] = $rr['xprof_gender'];
|
$entry['gender'] = $rr['xprof_gender'];
|
||||||
$entry['marital'] = $rr['xprof_marital'];
|
$entry['marital'] = $rr['xprof_marital'];
|
||||||
|
$entry['sexual'] = $rr['xprof_sexual'];
|
||||||
$entry['keywords'] = $rr['xprof_keywords'];
|
$entry['keywords'] = $rr['xprof_keywords'];
|
||||||
|
|
||||||
$entries[] = $entry;
|
$entries[] = $entry;
|
||||||
|
@ -8,9 +8,18 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="contact-name" id="directory-name-{{$id}}" >{{$name}}</div>
|
<div class="contact-name" id="directory-name-{{$id}}" >{{$name}}</div>
|
||||||
{{if $entry.connect}}
|
{{if $connect}}
|
||||||
<div class="directory-connect"><a href="{{$connect}}">{{$conn_label}}</a></div>
|
<div class="directory-connect"><a href="{{$connect}}">{{$conn_label}}</a></div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<div class="contact-details">{{$details}}</div>
|
<div class="contact-details">{{$details}}</div>
|
||||||
</div>
|
</div>
|
||||||
|
{{if $marital}}
|
||||||
|
<div class="directory-marital">{{$marital}} </div>
|
||||||
|
{{/if}}
|
||||||
|
{{if $sexual}}
|
||||||
|
<div class="directory-sexual">{{$sexual}} </div>
|
||||||
|
{{/if}}
|
||||||
|
{{if $kw}}
|
||||||
|
<div class="directory-keywords">{{$kw}} {{$keywords}}</div>
|
||||||
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user