wall posts now display - address book structure revamp started
This commit is contained in:
@@ -209,7 +209,7 @@ function event_store($arr) {
|
||||
$arr['edited'] = (($arr['edited']) ? $arr['edited'] : datetime_convert());
|
||||
$arr['type'] = (($arr['type']) ? $arr['type'] : 'event' );
|
||||
$arr['cid'] = ((intval($arr['cid'])) ? intval($arr['cid']) : 0);
|
||||
$arr['uri'] = (x($arr,'uri') ? $arr['uri'] : item_message_id());
|
||||
$arr['message_id'] = (x($arr,'message_id') ? $arr['message_id'] : get_message_id());
|
||||
$arr['private'] = ((x($arr,'private')) ? intval($arr['private']) : 0);
|
||||
|
||||
if($arr['cid'])
|
||||
@@ -286,7 +286,7 @@ function event_store($arr) {
|
||||
intval($arr['uid'])
|
||||
);
|
||||
if(count($r)) {
|
||||
$object = '<object><type>' . xmlify(ACTIVITY_OBJ_EVENT) . '</type><title></title><id>' . xmlify($arr['uri']) . '</id>';
|
||||
$object = '<object><type>' . xmlify(ACTIVITY_OBJ_EVENT) . '</type><title></title><id>' . xmlify($arr['message_id']) . '</id>';
|
||||
$object .= '<content>' . xmlify(format_event_bbcode($arr)) . '</content>';
|
||||
$object .= '</object>' . "\n";
|
||||
|
||||
@@ -317,9 +317,10 @@ function event_store($arr) {
|
||||
|
||||
// New event. Store it.
|
||||
|
||||
$r = q("INSERT INTO `event` ( `uid`,`cid`,`uri`,`created`,`edited`,`start`,`finish`,`summary`, `desc`,`location`,`type`,
|
||||
$r = q("INSERT INTO `event` ( `uid`,`account`,`cid`,`message_id`,`created`,`edited`,`start`,`finish`,`summary`, `desc`,`location`,`type`,
|
||||
`adjust`,`nofinish`,`allow_cid`,`allow_gid`,`deny_cid`,`deny_gid`)
|
||||
VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, '%s', '%s', '%s', '%s' ) ",
|
||||
VALUES ( %d, %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, '%s', '%s', '%s', '%s' ) ",
|
||||
intval($arr['account']),
|
||||
intval($arr['uid']),
|
||||
intval($arr['cid']),
|
||||
dbesc($arr['uri']),
|
||||
@@ -340,8 +341,8 @@ function event_store($arr) {
|
||||
|
||||
);
|
||||
|
||||
$r = q("SELECT * FROM `event` WHERE `uri` = '%s' AND `uid` = %d LIMIT 1",
|
||||
dbesc($arr['uri']),
|
||||
$r = q("SELECT * FROM `event` WHERE `hash` = '%s' AND `uid` = %d LIMIT 1",
|
||||
dbesc($arr['hash']),
|
||||
intval($arr['uid'])
|
||||
);
|
||||
if(count($r))
|
||||
@@ -349,10 +350,11 @@ function event_store($arr) {
|
||||
|
||||
$item_arr = array();
|
||||
|
||||
|
||||
$item_arr['uid'] = $arr['uid'];
|
||||
$item_arr['contact-id'] = $arr['cid'];
|
||||
$item_arr['uri'] = $arr['uri'];
|
||||
$item_arr['parent_uri'] = $arr['uri'];
|
||||
$item_arr['uri'] = $arr['message_id'];
|
||||
$item_arr['parent_uri'] = $arr['message_id'];
|
||||
$item_arr['type'] = 'activity';
|
||||
$item_arr['wall'] = (($arr['cid']) ? 0 : 1);
|
||||
$item_arr['contact-id'] = $contact['id'];
|
||||
@@ -376,7 +378,7 @@ function event_store($arr) {
|
||||
$item_arr['body'] = format_event_bbcode($event);
|
||||
|
||||
|
||||
$item_arr['object'] = '<object><type>' . xmlify(ACTIVITY_OBJ_EVENT) . '</type><title></title><id>' . xmlify($arr['uri']) . '</id>';
|
||||
$item_arr['object'] = '<object><type>' . xmlify(ACTIVITY_OBJ_EVENT) . '</type><title></title><id>' . xmlify($arr['message_id']) . '</id>';
|
||||
$item_arr['object'] .= '<content>' . xmlify(format_event_bbcode($event)) . '</content>';
|
||||
$item_arr['object'] .= '</object>' . "\n";
|
||||
|
||||
|
||||
@@ -110,14 +110,17 @@ function create_identity($arr) {
|
||||
|
||||
$newuid = $ret['channel']['channel_id'];
|
||||
|
||||
$r = q("insert into xchan ( xchan_hash, xchan_guid, xchan_guid_sig, xchan_photo, xchan_addr, xchan_profile, xchan_name ) values ('%s', '%s', '%s', '%s', '%s', '%s', '%s')",
|
||||
$r = q("insert into xchan ( xchan_hash, xchan_guid, xchan_guid_sig, xchan_photo, xchan_addr, xchan_profile, xchan_name, xchan_network, xchan_photo_date, xchan_name_date ) values ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')",
|
||||
dbesc($hash),
|
||||
dbesc($ret['channel']['channel_guid']),
|
||||
dbesc($sig),
|
||||
dbesc($a->get_baseurl() . "/photo/profile/{$newuid}"),
|
||||
dbesc($ret['channel']['channel_address'] . '@' . $a->get_hostname()),
|
||||
dbesc(z_root() . '/profile/' . $ret['channel']['channel_address']),
|
||||
dbesc($ret['channel']['channel_name'])
|
||||
dbesc($ret['channel']['channel_name']),
|
||||
dbesc('zot'),
|
||||
dbesc(datetime_convert()),
|
||||
dbesc(datetime_convert())
|
||||
);
|
||||
|
||||
// Not checking return value.
|
||||
@@ -135,21 +138,6 @@ function create_identity($arr) {
|
||||
dbesc($a->get_baseurl() . "/photo/avatar/{$newuid}")
|
||||
);
|
||||
|
||||
$r = q("INSERT INTO `contact` ( `aid`, `uid`, `created`, `self`, `name`, `nick`, `photo`, `thumb`, `micro`, `blocked`, `pending`, `url`, `name_date`, `uri_date`, `avatar_date`, `closeness` )
|
||||
VALUES ( %d, %d, '%s', 1, '%s', '%s', '%s', '%s', '%s', 0, 0, '%s', '%s', '%s', '%s', 0 ) ",
|
||||
intval($ret['channel']['channel_account_id']),
|
||||
intval($newuid),
|
||||
datetime_convert(),
|
||||
dbesc($ret['channel']['channel_name']),
|
||||
dbesc($ret['channel']['channel_address']),
|
||||
dbesc($a->get_baseurl() . "/photo/profile/{$newuid}"),
|
||||
dbesc($a->get_baseurl() . "/photo/avatar/{$newuid}"),
|
||||
dbesc($a->get_baseurl() . "/photo/micro/{$newuid}"),
|
||||
dbesc($a->get_baseurl() . "/profile/{$ret['channel']['channel_address']}"),
|
||||
dbesc(datetime_convert()),
|
||||
dbesc(datetime_convert()),
|
||||
dbesc(datetime_convert())
|
||||
);
|
||||
|
||||
// Create a group with no members. This allows somebody to use it
|
||||
// right away as a default group for new contacts.
|
||||
|
||||
Reference in New Issue
Block a user