diff --git a/addon/README b/addon/README
index 89f39e39..33b84e10 100644
--- a/addon/README
+++ b/addon/README
@@ -100,9 +100,13 @@ Current hooks:
'contact' => contact (array) record for the person from the database
'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
- $b is the (string) generated HTML of the entry
- (The profile array details are in $a->profile)
+ $b is an array
+ '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
profile sidebar has completed
diff --git a/boot.php b/boot.php
index 85e15988..d7f32dba 100644
--- a/boot.php
+++ b/boot.php
@@ -2,8 +2,8 @@
set_time_limit(0);
-define ( 'BUILD_ID', 1032 );
-define ( 'FRIENDIKA_VERSION', '2.01.1003' );
+define ( 'BUILD_ID', 1033 );
+define ( 'FRIENDIKA_VERSION', '2.01.1004' );
define ( 'DFRN_PROTOCOL_VERSION', '2.0' );
define ( 'EOL', " \r\n" );
@@ -2009,8 +2009,12 @@ function profile_sidebar($profile) {
if((! is_array($profile)) && (! count($profile)))
return $o;
+ call_hooks('profile_sidebar_enter', $profile);
+
$fullname = '
' . $profile['name'] . '
';
+ $pdesc = '
' . $profile['pdesc'] . '
';
+
$tabs = '';
$photo = '';
@@ -2049,6 +2053,7 @@ function profile_sidebar($profile) {
$o .= replace_macros($tpl, array(
'$fullname' => $fullname,
+ '$pdesc' => $pdesc,
'$tabs' => $tabs,
'$photo' => $photo,
'$connect' => $connect,
@@ -2059,7 +2064,10 @@ function profile_sidebar($profile) {
'$homepage' => $homepage
));
- call_hooks('profile_sidebar', $o);
+
+ $arr = array('profile' => $profile, 'entry' => $o);
+
+ call_hooks('profile_sidebar', $arr);
return $o;
}}
diff --git a/database.sql b/database.sql
index 0e21be51..54950f0f 100644
--- a/database.sql
+++ b/database.sql
@@ -281,6 +281,7 @@ CREATE TABLE IF NOT EXISTS `profile` (
`is-default` tinyint(1) NOT NULL DEFAULT '0',
`hide-friends` tinyint(1) NOT NULL DEFAULT '0',
`name` char(255) NOT NULL,
+ `pdesc` char(255) NOT NULL,
`dob` char(32) NOT NULL DEFAULT '0000-00-00',
`address` char(255) NOT NULL,
`locality` char(255) NOT NULL,
diff --git a/jumploader_z.jar b/jumploader_z.jar
index 30a85a33..9ef2abd8 100644
Binary files a/jumploader_z.jar and b/jumploader_z.jar differ
diff --git a/mod/directory.php b/mod/directory.php
index f70cd6df..0504ac32 100644
--- a/mod/directory.php
+++ b/mod/directory.php
@@ -40,7 +40,7 @@ function directory_content(&$a) {
if($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 " );
@@ -68,6 +68,9 @@ function directory_content(&$a) {
$profile_link = $a->get_baseurl() . '/profile/' . ((strlen($rr['nickname'])) ? $rr['nickname'] : $rr['profile_uid']);
+
+ $pdesc = (($rr['pdesc']) ? $rr['pdesc'] . ' ' : '');
+
$details = '';
if(strlen($rr['locality']))
$details .= $rr['locality'];
@@ -94,7 +97,7 @@ function directory_content(&$a) {
'$photo' => $rr[$photo],
'$alt-text' => $rr['name'],
'$name' => $rr['name'],
- '$details' => $details
+ '$details' => $pdesc . $details
));
diff --git a/mod/network.php b/mod/network.php
index 5073b8a6..c761af81 100644
--- a/mod/network.php
+++ b/mod/network.php
@@ -134,11 +134,14 @@ function network_content(&$a, $update = 0) {
`contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`,
`contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`,
`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
+ AND `contact`.`id` = `item`.`contact-id`
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
+ AND `item`.`parent` = `parentitem`.`id`
$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($a->pager['start']),
intval($a->pager['itemspage'])
diff --git a/mod/profiles.php b/mod/profiles.php
index 3488c868..54c57f73 100644
--- a/mod/profiles.php
+++ b/mod/profiles.php
@@ -46,6 +46,7 @@ function profiles_post(&$a) {
if($orig[0]['name'] != $name)
$namechanged = true;
+ $pdesc = notags(trim($_POST['pdesc']));
$gender = notags(trim($_POST['gender']));
$address = notags(trim($_POST['address']));
$locality = notags(trim($_POST['locality']));
@@ -125,6 +126,7 @@ function profiles_post(&$a) {
$r = q("UPDATE `profile`
SET `profile-name` = '%s',
`name` = '%s',
+ `pdesc` = '%s',
`gender` = '%s',
`dob` = '%s',
`address` = '%s',
@@ -153,6 +155,7 @@ function profiles_post(&$a) {
WHERE `id` = %d AND `uid` = %d LIMIT 1",
dbesc($profile_name),
dbesc($name),
+ dbesc($pdesc),
dbesc($gender),
dbesc($dob),
dbesc($address),
@@ -208,6 +211,7 @@ function profiles_post(&$a) {
function profiles_content(&$a) {
+
$o = '';
$o .= '';
@@ -356,6 +360,7 @@ function profiles_content(&$a) {
'$profile_name' => $r[0]['profile-name'],
'$default' => (($is_default) ? '
' . t('This is your public profile. It may be visible to anybody using the internet.') . '