Merge branch 'master' of git://github.com/friendika/friendika

This commit is contained in:
root 2011-01-19 17:55:27 +01:00
commit 8e22c669a0
13 changed files with 67 additions and 11 deletions

View file

@ -100,9 +100,13 @@ Current hooks:
'contact' => contact (array) record for the person from the database 'contact' => contact (array) record for the person from the database
'entry' => the (string) HTML of the generated entry 'entry' => the (string) HTML of the generated entry
'profile_sidebar_enter' - called prior to generating the sidebar "short" profile for a page
$b is (array) the person's profile array
'profile_sidebar' - called when generating the sidebar "short" profile for a page 'profile_sidebar' - called when generating the sidebar "short" profile for a page
$b is the (string) generated HTML of the entry $b is an array
(The profile array details are in $a->profile) 'profile' => profile (array) record for the person from the database
'entry' => the (string) HTML of the generated entry
'contact_block_end' - called when formatting the block of contacts/friends on a 'contact_block_end' - called when formatting the block of contacts/friends on a
profile sidebar has completed profile sidebar has completed

View file

@ -2,8 +2,8 @@
set_time_limit(0); set_time_limit(0);
define ( 'BUILD_ID', 1032 ); define ( 'BUILD_ID', 1033 );
define ( 'FRIENDIKA_VERSION', '2.01.1003' ); define ( 'FRIENDIKA_VERSION', '2.01.1004' );
define ( 'DFRN_PROTOCOL_VERSION', '2.0' ); define ( 'DFRN_PROTOCOL_VERSION', '2.0' );
define ( 'EOL', "<br />\r\n" ); define ( 'EOL', "<br />\r\n" );
@ -2009,8 +2009,12 @@ function profile_sidebar($profile) {
if((! is_array($profile)) && (! count($profile))) if((! is_array($profile)) && (! count($profile)))
return $o; return $o;
call_hooks('profile_sidebar_enter', $profile);
$fullname = '<div class="fn">' . $profile['name'] . '</div>'; $fullname = '<div class="fn">' . $profile['name'] . '</div>';
$pdesc = '<div class="title">' . $profile['pdesc'] . '</div>';
$tabs = ''; $tabs = '';
$photo = '<div id="profile=photo-wrapper"><img class="photo" src="' . $profile['photo'] . '" alt="' . $profile['name'] . '" /></div>'; $photo = '<div id="profile=photo-wrapper"><img class="photo" src="' . $profile['photo'] . '" alt="' . $profile['name'] . '" /></div>';
@ -2049,6 +2053,7 @@ function profile_sidebar($profile) {
$o .= replace_macros($tpl, array( $o .= replace_macros($tpl, array(
'$fullname' => $fullname, '$fullname' => $fullname,
'$pdesc' => $pdesc,
'$tabs' => $tabs, '$tabs' => $tabs,
'$photo' => $photo, '$photo' => $photo,
'$connect' => $connect, '$connect' => $connect,
@ -2059,7 +2064,10 @@ function profile_sidebar($profile) {
'$homepage' => $homepage '$homepage' => $homepage
)); ));
call_hooks('profile_sidebar', $o);
$arr = array('profile' => $profile, 'entry' => $o);
call_hooks('profile_sidebar', $arr);
return $o; return $o;
}} }}

View file

@ -281,6 +281,7 @@ CREATE TABLE IF NOT EXISTS `profile` (
`is-default` tinyint(1) NOT NULL DEFAULT '0', `is-default` tinyint(1) NOT NULL DEFAULT '0',
`hide-friends` tinyint(1) NOT NULL DEFAULT '0', `hide-friends` tinyint(1) NOT NULL DEFAULT '0',
`name` char(255) NOT NULL, `name` char(255) NOT NULL,
`pdesc` char(255) NOT NULL,
`dob` char(32) NOT NULL DEFAULT '0000-00-00', `dob` char(32) NOT NULL DEFAULT '0000-00-00',
`address` char(255) NOT NULL, `address` char(255) NOT NULL,
`locality` char(255) NOT NULL, `locality` char(255) NOT NULL,

Binary file not shown.

View file

@ -40,7 +40,7 @@ function directory_content(&$a) {
if($search) if($search)
$search = dbesc($search); $search = dbesc($search);
$sql_extra = ((strlen($search)) ? " AND MATCH (`profile`.`name`, `user`.`nickname`, `locality`,`region`,`country-name`,`gender`,`marital`,`sexual`,`about`,`romance`,`work`,`education`,`keywords` ) AGAINST ('$search' IN BOOLEAN MODE) " : ""); $sql_extra = ((strlen($search)) ? " AND MATCH (`profile`.`name`, `user`.`nickname`, `pdesc`, `locality`,`region`,`country-name`,`gender`,`marital`,`sexual`,`about`,`romance`,`work`,`education`,`keywords` ) AGAINST ('$search' IN BOOLEAN MODE) " : "");
$publish = ((get_config('system','publish_all')) ? '' : " AND `publish` = 1 " ); $publish = ((get_config('system','publish_all')) ? '' : " AND `publish` = 1 " );
@ -68,6 +68,9 @@ function directory_content(&$a) {
$profile_link = $a->get_baseurl() . '/profile/' . ((strlen($rr['nickname'])) ? $rr['nickname'] : $rr['profile_uid']); $profile_link = $a->get_baseurl() . '/profile/' . ((strlen($rr['nickname'])) ? $rr['nickname'] : $rr['profile_uid']);
$pdesc = (($rr['pdesc']) ? $rr['pdesc'] . '<br />' : '');
$details = ''; $details = '';
if(strlen($rr['locality'])) if(strlen($rr['locality']))
$details .= $rr['locality']; $details .= $rr['locality'];
@ -94,7 +97,7 @@ function directory_content(&$a) {
'$photo' => $rr[$photo], '$photo' => $rr[$photo],
'$alt-text' => $rr['name'], '$alt-text' => $rr['name'],
'$name' => $rr['name'], '$name' => $rr['name'],
'$details' => $details '$details' => $pdesc . $details
)); ));

View file

@ -134,11 +134,14 @@ function network_content(&$a, $update = 0) {
`contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`, `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`,
`contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`, `contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`,
`contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid` `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` FROM `item`, (SELECT `p`.`id`,`p`.`created` FROM `item` AS `p` WHERE `p`.`parent`=`p`.`id`) as `parentitem`,
`contact`
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0 WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
AND `contact`.`id` = `item`.`contact-id`
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
AND `item`.`parent` = `parentitem`.`id`
$sql_extra $sql_extra
ORDER BY `parent` DESC, `gravity` ASC, `created` ASC LIMIT %d ,%d ", ORDER BY `parentitem`.`created` DESC, `item`.`gravity` ASC, `item`.`created` ASC LIMIT %d ,%d ",
intval($_SESSION['uid']), intval($_SESSION['uid']),
intval($a->pager['start']), intval($a->pager['start']),
intval($a->pager['itemspage']) intval($a->pager['itemspage'])

View file

@ -46,6 +46,7 @@ function profiles_post(&$a) {
if($orig[0]['name'] != $name) if($orig[0]['name'] != $name)
$namechanged = true; $namechanged = true;
$pdesc = notags(trim($_POST['pdesc']));
$gender = notags(trim($_POST['gender'])); $gender = notags(trim($_POST['gender']));
$address = notags(trim($_POST['address'])); $address = notags(trim($_POST['address']));
$locality = notags(trim($_POST['locality'])); $locality = notags(trim($_POST['locality']));
@ -125,6 +126,7 @@ function profiles_post(&$a) {
$r = q("UPDATE `profile` $r = q("UPDATE `profile`
SET `profile-name` = '%s', SET `profile-name` = '%s',
`name` = '%s', `name` = '%s',
`pdesc` = '%s',
`gender` = '%s', `gender` = '%s',
`dob` = '%s', `dob` = '%s',
`address` = '%s', `address` = '%s',
@ -153,6 +155,7 @@ function profiles_post(&$a) {
WHERE `id` = %d AND `uid` = %d LIMIT 1", WHERE `id` = %d AND `uid` = %d LIMIT 1",
dbesc($profile_name), dbesc($profile_name),
dbesc($name), dbesc($name),
dbesc($pdesc),
dbesc($gender), dbesc($gender),
dbesc($dob), dbesc($dob),
dbesc($address), dbesc($address),
@ -208,6 +211,7 @@ function profiles_post(&$a) {
function profiles_content(&$a) { function profiles_content(&$a) {
$o = ''; $o = '';
$o .= '<script> $(document).ready(function() { $(\'#nav-profiles-link\').addClass(\'nav-selected\'); });</script>'; $o .= '<script> $(document).ready(function() { $(\'#nav-profiles-link\').addClass(\'nav-selected\'); });</script>';
@ -356,6 +360,7 @@ function profiles_content(&$a) {
'$profile_name' => $r[0]['profile-name'], '$profile_name' => $r[0]['profile-name'],
'$default' => (($is_default) ? '<p id="profile-edit-default-desc">' . t('This is your <strong>public</strong> profile.<br />It <strong>may</strong> be visible to anybody using the internet.') . '</p>' : ""), '$default' => (($is_default) ? '<p id="profile-edit-default-desc">' . t('This is your <strong>public</strong> profile.<br />It <strong>may</strong> be visible to anybody using the internet.') . '</p>' : ""),
'$name' => $r[0]['name'], '$name' => $r[0]['name'],
'$pdesc' => $r[0]['pdesc'],
'$dob' => dob($r[0]['dob']), '$dob' => dob($r[0]['dob']),
'$hide_friends' => $hide_friends, '$hide_friends' => $hide_friends,
'$address' => $r[0]['address'], '$address' => $r[0]['address'],

View file

@ -317,3 +317,6 @@ function update_1031() {
} }
} }
function update_1032() {
q("ALTER TABLE `profile` ADD `pdesc` CHAR( 255 ) NOT NULL AFTER `name` ");
}

View file

@ -29,6 +29,13 @@ $default
</div> </div>
<div id="profile-edit-name-end"></div> <div id="profile-edit-name-end"></div>
<div id="profile-edit-pdesc-wrapper" >
<label id="profile-edit-pdesc-label" for="profile-edit-pdesc" >Title/Description: </label>
<input type="text" size="32" name="pdesc" id="profile-edit-pdesc" value="$pdesc" />
</div>
<div id="profile-edit-pdesc-end"></div>
<div id="profile-edit-gender-wrapper" > <div id="profile-edit-gender-wrapper" >
<label id="profile-edit-gender-label" for="gender-select" >Your Gender: </label> <label id="profile-edit-gender-label" for="gender-select" >Your Gender: </label>
$gender $gender

View file

@ -29,6 +29,13 @@ $default
</div> </div>
<div id="profile-edit-name-end"></div> <div id="profile-edit-name-end"></div>
<div id="profile-edit-pdesc-wrapper" >
<label id="profile-edit-pdesc-label" for="profile-edit-pdesc" >Il tuo titolo: </label>
<input type="text" size="32" name="pdesc" id="profile-edit-pdesc" value="$pdesc" />
</div>
<div id="profile-edit-pdesc-end"></div>
<div id="profile-edit-gender-wrapper" > <div id="profile-edit-gender-wrapper" >
<label id="profile-edit-gender-label" for="gender-select" >Il tuo sesso: </label> <label id="profile-edit-gender-label" for="gender-select" >Il tuo sesso: </label>
$gender $gender

View file

@ -1,7 +1,7 @@
<div class="vcard"> <div class="vcard">
$fullname $fullname
$pdesc
$tabs $tabs
$photo $photo

View file

@ -256,10 +256,15 @@ nav {
.fn { .fn {
font-size: 1.4em; font-size: 1.4em;
margin-bottom: 10px; margin-bottom: 5px;
line-height: 1.5; line-height: 1.5;
} }
.vcard .title {
margin-bottom: 5px;
}
.powered { .powered {
font-size: 0.6em; font-size: 0.6em;
color: black; color: black;
@ -731,6 +736,7 @@ input#dfrn-url {
#profile-edit-profile-name-label, #profile-edit-profile-name-label,
#profile-edit-name-label, #profile-edit-name-label,
#profile-edit-pdesc-label,
#profile-edit-gender-label, #profile-edit-gender-label,
#profile-edit-dob-label, #profile-edit-dob-label,
#profile-edit-address-label, #profile-edit-address-label,
@ -750,6 +756,7 @@ input#dfrn-url {
#profile-edit-profile-name, #profile-edit-profile-name,
#profile-edit-name, #profile-edit-name,
#profile-edit-pdesc,
#gender-select, #gender-select,
#profile-edit-dob, #profile-edit-dob,
#profile-edit-address, #profile-edit-address,
@ -819,6 +826,7 @@ input#dfrn-url {
#profile-edit-profile-name-end, #profile-edit-profile-name-end,
#profile-edit-name-end, #profile-edit-name-end,
#profile-edit-pdesc-end,
#profile-edit-gender-end, #profile-edit-gender-end,
#profile-edit-dob-end, #profile-edit-dob-end,
#profile-edit-address-end, #profile-edit-address-end,

View file

@ -604,6 +604,7 @@ input#dfrn-url {
#profile-edit-profile-name-label, #profile-edit-profile-name-label,
#profile-edit-name-label, #profile-edit-name-label,
#profile-edit-pdesc-label,
#profile-edit-gender-label, #profile-edit-gender-label,
#profile-edit-dob-label, #profile-edit-dob-label,
#profile-edit-address-label, #profile-edit-address-label,
@ -623,6 +624,7 @@ input#dfrn-url {
#profile-edit-profile-name, #profile-edit-profile-name,
#profile-edit-name, #profile-edit-name,
#profile-edit-pdesc,
#gender-select, #gender-select,
#profile-edit-dob, #profile-edit-dob,
#profile-edit-address, #profile-edit-address,
@ -692,6 +694,7 @@ input#dfrn-url {
#profile-edit-profile-name-end, #profile-edit-profile-name-end,
#profile-edit-name-end, #profile-edit-name-end,
#profile-edit-pdesc-end,
#profile-edit-gender-end, #profile-edit-gender-end,
#profile-edit-dob-end, #profile-edit-dob-end,
#profile-edit-address-end, #profile-edit-address-end,
@ -1842,6 +1845,10 @@ a.mail-list-link {
font-weight: bold; font-weight: bold;
} }
.vcard .title {
margin-bottom: 5px;
}
#birthday-title { #birthday-title {
float: left; float: left;