show tags (pub_keywords) in advanced profile
This commit is contained in:
parent
d79c3351ea
commit
75a62db9c5
3 changed files with 21 additions and 2 deletions
14
boot.php
14
boot.php
|
@ -819,7 +819,7 @@ function profile_load(&$a, $nickname, $profile = 0) {
|
||||||
}
|
}
|
||||||
|
|
||||||
$r = null;
|
$r = null;
|
||||||
|
|
||||||
if($profile) {
|
if($profile) {
|
||||||
$profile_int = intval($profile);
|
$profile_int = intval($profile);
|
||||||
$r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `contact`.`avatar-date` AS picdate, `user`.* FROM `profile`
|
$r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `contact`.`avatar-date` AS picdate, `user`.* FROM `profile`
|
||||||
|
@ -829,7 +829,7 @@ function profile_load(&$a, $nickname, $profile = 0) {
|
||||||
intval($profile_int)
|
intval($profile_int)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if(! count($r)) {
|
if((! $r) && (! count($r))) {
|
||||||
$r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `contact`.`avatar-date` AS picdate, `user`.* FROM `profile`
|
$r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `contact`.`avatar-date` AS picdate, `user`.* FROM `profile`
|
||||||
left join `contact` on `contact`.`uid` = `profile`.`uid` LEFT JOIN `user` ON `profile`.`uid` = `user`.`uid`
|
left join `contact` on `contact`.`uid` = `profile`.`uid` LEFT JOIN `user` ON `profile`.`uid` = `user`.`uid`
|
||||||
WHERE `user`.`nickname` = '%s' AND `profile`.`is-default` = 1 and `contact`.`self` = 1 LIMIT 1",
|
WHERE `user`.`nickname` = '%s' AND `profile`.`is-default` = 1 and `contact`.`self` = 1 LIMIT 1",
|
||||||
|
@ -842,6 +842,16 @@ function profile_load(&$a, $nickname, $profile = 0) {
|
||||||
$a->error = 404;
|
$a->error = 404;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// fetch user tags if this isn't the default profile
|
||||||
|
|
||||||
|
if(! $r[0]['is-default']) {
|
||||||
|
$x = q("select `pub_keywords` from `profile` where uid = %d and `is-default` = 1 limit 1",
|
||||||
|
intval($profile_uid)
|
||||||
|
);
|
||||||
|
if($x && count($x))
|
||||||
|
$r[0]['pub_keywords'] = $x[0]['pub_keywords'];
|
||||||
|
}
|
||||||
|
|
||||||
$a->profile = $r[0];
|
$a->profile = $r[0];
|
||||||
|
|
||||||
|
|
|
@ -44,6 +44,8 @@ function advanced_profile(&$a) {
|
||||||
|
|
||||||
if($a->profile['homepage']) $profile['homepage'] = array( t('Homepage:'), linkify($a->profile['homepage']) );
|
if($a->profile['homepage']) $profile['homepage'] = array( t('Homepage:'), linkify($a->profile['homepage']) );
|
||||||
|
|
||||||
|
if($a->profile['pub_keywords']) $profile['pub_keywords'] = array( t('Tags:'), $a->profile['pub_keywords']);
|
||||||
|
|
||||||
if($a->profile['politic']) $profile['politic'] = array( t('Political Views:'), $a->profile['politic']);
|
if($a->profile['politic']) $profile['politic'] = array( t('Political Views:'), $a->profile['politic']);
|
||||||
|
|
||||||
if($a->profile['religion']) $profile['religion'] = array( t('Religion:'), $a->profile['religion']);
|
if($a->profile['religion']) $profile['religion'] = array( t('Religion:'), $a->profile['religion']);
|
||||||
|
|
|
@ -40,6 +40,13 @@
|
||||||
</dl>
|
</dl>
|
||||||
{{ endif }}
|
{{ endif }}
|
||||||
|
|
||||||
|
{{ if $profile.pub_keywords }}
|
||||||
|
<dl id="aprofile-tags" class="aprofile">
|
||||||
|
<dt>$profile.pub_keywords.0</dt>
|
||||||
|
<dd>$profile.pub_keywords.1</dd>
|
||||||
|
</dl>
|
||||||
|
{{ endif }}
|
||||||
|
|
||||||
{{ if $profile.homepage }}
|
{{ if $profile.homepage }}
|
||||||
<dl id="aprofile-homepage" class="aprofile">
|
<dl id="aprofile-homepage" class="aprofile">
|
||||||
<dt>$profile.homepage.0</dt>
|
<dt>$profile.homepage.0</dt>
|
||||||
|
|
Loading…
Reference in a new issue