Usage of /display/(guid) as path instead of /display/(user)/(id)
Bugfix for adding tags to photos
This commit is contained in:
parent
f920fa229b
commit
ed1dce93d6
16 changed files with 216 additions and 144 deletions
|
@ -1373,12 +1373,13 @@ function diaspora_comment($importer,$xml,$msg) {
|
|||
|
||||
$message_id = item_store($datarray);
|
||||
|
||||
if($message_id) {
|
||||
q("update item set plink = '%s' where id = %d",
|
||||
dbesc($a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $message_id),
|
||||
intval($message_id)
|
||||
);
|
||||
}
|
||||
//if($message_id) {
|
||||
//q("update item set plink = '%s' where id = %d",
|
||||
// //dbesc($a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $message_id),
|
||||
// dbesc($a->get_baseurl().'/display/'.$datarray['guid']),
|
||||
// intval($message_id)
|
||||
//);
|
||||
//}
|
||||
|
||||
if(($parent_item['origin']) && (! $parent_author_signature)) {
|
||||
q("insert into sign (`iid`,`signed_text`,`signature`,`signer`) values (%d,'%s','%s','%s') ",
|
||||
|
@ -1422,7 +1423,8 @@ function diaspora_comment($importer,$xml,$msg) {
|
|||
'to_email' => $importer['email'],
|
||||
'uid' => $importer['uid'],
|
||||
'item' => $datarray,
|
||||
'link' => $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $message_id,
|
||||
//'link' => $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $message_id,
|
||||
'link' => $a->get_baseurl().'/display/'.$datarray['guid'],
|
||||
'source_name' => $datarray['author-name'],
|
||||
'source_link' => $datarray['author-link'],
|
||||
'source_photo' => $datarray['author-avatar'],
|
||||
|
@ -1957,7 +1959,8 @@ EOT;
|
|||
|
||||
$ulink = '[url=' . $contact['url'] . ']' . $contact['name'] . '[/url]';
|
||||
$alink = '[url=' . $parent_item['author-link'] . ']' . $parent_item['author-name'] . '[/url]';
|
||||
$plink = '[url=' . $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $parent_item['id'] . ']' . $post_type . '[/url]';
|
||||
//$plink = '[url=' . $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $parent_item['id'] . ']' . $post_type . '[/url]';
|
||||
$plink = '[url='.$a->get_baseurl().'/display/'.$guid.']'.$post_type.'[/url]';
|
||||
$arr['body'] = sprintf( $bodyverb, $ulink, $alink, $plink );
|
||||
|
||||
$arr['app'] = 'Diaspora';
|
||||
|
@ -1973,12 +1976,13 @@ EOT;
|
|||
$message_id = item_store($arr);
|
||||
|
||||
|
||||
if($message_id) {
|
||||
q("update item set plink = '%s' where id = %d",
|
||||
dbesc($a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $message_id),
|
||||
intval($message_id)
|
||||
);
|
||||
}
|
||||
//if($message_id) {
|
||||
// q("update item set plink = '%s' where id = %d",
|
||||
// //dbesc($a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $message_id),
|
||||
// dbesc($a->get_baseurl().'/display/'.$guid),
|
||||
// intval($message_id)
|
||||
// );
|
||||
//}
|
||||
|
||||
if(! $parent_author_signature) {
|
||||
q("insert into sign (`iid`,`signed_text`,`signature`,`signer`) values (%d,'%s','%s','%s') ",
|
||||
|
|
|
@ -385,13 +385,18 @@ function event_store($arr) {
|
|||
$r = q("SELECT * FROM `user` WHERE `uid` = %d LIMIT 1",
|
||||
intval($arr['uid'])
|
||||
);
|
||||
if(count($r))
|
||||
$plink = $a->get_baseurl() . '/display/' . $r[0]['nickname'] . '/' . $item_id;
|
||||
//if(count($r))
|
||||
// $plink = $a->get_baseurl() . '/display/' . $r[0]['nickname'] . '/' . $item_id;
|
||||
|
||||
|
||||
if($item_id) {
|
||||
q("UPDATE `item` SET `plink` = '%s', `event-id` = %d WHERE `uid` = %d AND `id` = %d",
|
||||
dbesc($plink),
|
||||
//q("UPDATE `item` SET `plink` = '%s', `event-id` = %d WHERE `uid` = %d AND `id` = %d",
|
||||
// dbesc($plink),
|
||||
// intval($event['id']),
|
||||
// intval($arr['uid']),
|
||||
// intval($item_id)
|
||||
//);
|
||||
q("UPDATE `item` SET `event-id` = %d WHERE `uid` = %d AND `id` = %d",
|
||||
intval($event['id']),
|
||||
intval($arr['uid']),
|
||||
intval($item_id)
|
||||
|
|
|
@ -678,8 +678,10 @@ function get_atom_elements($feed, $item, $contact = array()) {
|
|||
if($rawgeo)
|
||||
$res['coord'] = unxmlify($rawgeo[0]['data']);
|
||||
|
||||
if ($contact["network"] == NETWORK_FEED)
|
||||
if ($contact["network"] == NETWORK_FEED) {
|
||||
$res['verb'] = ACTIVITY_POST;
|
||||
$res['object-type'] = ACTIVITY_OBJ_NOTE;
|
||||
}
|
||||
|
||||
$rawverb = $item->get_item_tags(NAMESPACE_ACTIVITY, 'verb');
|
||||
|
||||
|
@ -866,6 +868,7 @@ function get_atom_elements($feed, $item, $contact = array()) {
|
|||
if (isset($contact["network"]) AND ($contact["network"] == NETWORK_FEED) AND $contact['fetch_further_information']) {
|
||||
$res["body"] = $res["title"].add_page_info($res['plink']);
|
||||
$res["title"] = "";
|
||||
$res["object-type"] = ACTIVITY_OBJ_BOOKMARK;
|
||||
} elseif (isset($contact["network"]) AND ($contact["network"] == NETWORK_OSTATUS))
|
||||
$res["body"] = add_page_info_to_body($res["body"]);
|
||||
elseif (isset($contact["network"]) AND ($contact["network"] == NETWORK_FEED) AND strstr($res['plink'], ".app.net/")) {
|
||||
|
@ -1093,9 +1096,14 @@ function item_store($arr,$force_parent = false) {
|
|||
$arr['attach'] = ((x($arr,'attach')) ? notags(trim($arr['attach'])) : '');
|
||||
$arr['app'] = ((x($arr,'app')) ? notags(trim($arr['app'])) : '');
|
||||
$arr['origin'] = ((x($arr,'origin')) ? intval($arr['origin']) : 0 );
|
||||
$arr['guid'] = ((x($arr,'guid')) ? notags(trim($arr['guid'])) : get_guid());
|
||||
$arr['guid'] = ((x($arr,'guid')) ? notags(trim($arr['guid'])) : get_guid(30));
|
||||
$arr['network'] = ((x($arr,'network')) ? trim($arr['network']) : '');
|
||||
|
||||
if ($arr['plink'] == "") {
|
||||
$a = get_app();
|
||||
$arr['plink'] = $a->get_baseurl().'/display/'.$arr['guid'];
|
||||
}
|
||||
|
||||
if ($arr['network'] == "") {
|
||||
$r = q("SELECT `network` FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
||||
intval($arr['contact-id']),
|
||||
|
@ -1274,7 +1282,8 @@ function item_store($arr,$force_parent = false) {
|
|||
'to_email' => $u[0]['email'],
|
||||
'uid' => $u[0]['uid'],
|
||||
'item' => $item[0],
|
||||
'link' => $a->get_baseurl().'/display/'.$u[0]['nickname'].'/'.$current_post,
|
||||
//'link' => $a->get_baseurl().'/display/'.$u[0]['nickname'].'/'.$current_post,
|
||||
'link' => $a->get_baseurl().'/display/'.$arr['guid'],
|
||||
'source_name' => $item[0]['author-name'],
|
||||
'source_link' => $item[0]['author-link'],
|
||||
'source_photo' => $item[0]['author-avatar'],
|
||||
|
@ -1395,6 +1404,15 @@ function item_store($arr,$force_parent = false) {
|
|||
|
||||
return $current_post;
|
||||
}
|
||||
|
||||
function get_item_guid($id) {
|
||||
$r = q("SELECT `guid` FROM `item` WHERE `id` = %d LIMIT 1", intval($id));
|
||||
if (count($r))
|
||||
return($r[0]["guid"]);
|
||||
else
|
||||
return("");
|
||||
}
|
||||
|
||||
// return - test
|
||||
function get_item_contact($item,$contacts) {
|
||||
if(! count($contacts) || (! is_array($item)))
|
||||
|
@ -1494,7 +1512,8 @@ function tag_deliver($uid,$item_id) {
|
|||
'to_email' => $u[0]['email'],
|
||||
'uid' => $u[0]['uid'],
|
||||
'item' => $item,
|
||||
'link' => $a->get_baseurl() . '/display/' . $u[0]['nickname'] . '/' . $item['id'],
|
||||
//'link' => $a->get_baseurl() . '/display/' . $u[0]['nickname'] . '/' . $item['id'],
|
||||
'link' => $a->get_baseurl() . '/display/'.get_item_guid($item['id']),
|
||||
'source_name' => $item['author-name'],
|
||||
'source_link' => $item['author-link'],
|
||||
'source_photo' => $photo,
|
||||
|
@ -3309,7 +3328,8 @@ function local_delivery($importer,$data) {
|
|||
'to_email' => $importer['email'],
|
||||
'uid' => $importer['importer_uid'],
|
||||
'item' => $datarray,
|
||||
'link' => $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $posted_id,
|
||||
//'link' => $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $posted_id,
|
||||
'link' => $a->get_baseurl().'/display/'.get_item_guid($posted_id),
|
||||
'source_name' => stripslashes($datarray['author-name']),
|
||||
'source_link' => $datarray['author-link'],
|
||||
'source_photo' => ((link_compare($datarray['author-link'],$importer['url']))
|
||||
|
@ -3473,7 +3493,8 @@ function local_delivery($importer,$data) {
|
|||
'to_email' => $importer['email'],
|
||||
'uid' => $importer['importer_uid'],
|
||||
'item' => $datarray,
|
||||
'link' => $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $posted_id,
|
||||
//'link' => $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $posted_id,
|
||||
'link' => $a->get_baseurl().'/display/'.get_item_guid($posted_id),
|
||||
'source_name' => stripslashes($datarray['author-name']),
|
||||
'source_link' => $datarray['author-link'],
|
||||
'source_photo' => ((link_compare($datarray['author-link'],$importer['url']))
|
||||
|
@ -3626,7 +3647,8 @@ function local_delivery($importer,$data) {
|
|||
'to_email' => $importer['email'],
|
||||
'uid' => $importer['importer_uid'],
|
||||
'item' => $datarray,
|
||||
'link' => $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $posted_id,
|
||||
//'link' => $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $posted_id,
|
||||
'link' => $a->get_baseurl().'/display/'.get_item_guid($posted_id),
|
||||
'source_name' => stripslashes($datarray['author-name']),
|
||||
'source_link' => $datarray['author-link'],
|
||||
'source_photo' => ((link_compare($datarray['author-link'],$importer['url']))
|
||||
|
@ -3717,7 +3739,8 @@ function new_follower($importer,$contact,$datarray,$item,$sharing = false) {
|
|||
group_add_member($r[0]['uid'],'',$contact_record['id'],$r[0]['def_gid']);
|
||||
}
|
||||
|
||||
if(($r[0]['notify-flags'] & NOTIFY_INTRO) && ($r[0]['page-flags'] == PAGE_NORMAL)) {
|
||||
if(($r[0]['notify-flags'] & NOTIFY_INTRO) &&
|
||||
(($r[0]['page-flags'] == PAGE_NORMAL) OR ($r[0]['page-flags'] == PAGE_SOAPBOX))) {
|
||||
$email_tpl = get_intltext_template('follow_notify_eml.tpl');
|
||||
$email = replace_macros($email_tpl, array(
|
||||
'$requestor' => ((strlen($name)) ? $name : t('[Name Withheld]')),
|
||||
|
|
|
@ -148,7 +148,7 @@ function nav_info(&$a) {
|
|||
|
||||
/* only show friend requests for normal pages. Other page types have automatic friendship. */
|
||||
|
||||
if($_SESSION['page_flags'] == PAGE_NORMAL || $_SESSION['page_flags'] == PAGE_PRVGROUP) {
|
||||
if($_SESSION['page_flags'] == PAGE_NORMAL || $_SESSION['page_flags'] == PAGE_SOAPBOX || $_SESSION['page_flags'] == PAGE_PRVGROUP) {
|
||||
$nav['introductions'] = array('notifications/intros', t('Introductions'), "", t('Friend Requests'));
|
||||
$nav['notifications'] = array('notifications', t('Notifications'), "", t('Notifications'));
|
||||
$nav['notifications']['all']=array('notifications/system', t('See all notifications'), "", "");
|
||||
|
@ -166,12 +166,12 @@ function nav_info(&$a) {
|
|||
}
|
||||
|
||||
$nav['delegations'] = Array('delegate', t('Delegations'), "", t('Delegate Page Management'));
|
||||
|
||||
|
||||
$nav['settings'] = array('settings', t('Settings'),"", t('Account settings'));
|
||||
|
||||
|
||||
if(feature_enabled(local_user(),'multi_profiles'))
|
||||
$nav['profiles'] = array('profiles', t('Profiles'),"", t('Manage/Edit Profiles'));
|
||||
|
||||
|
||||
$nav['contacts'] = array('contacts', t('Contacts'),"", t('Manage/edit friends and contacts'));
|
||||
}
|
||||
|
||||
|
|
|
@ -331,6 +331,7 @@ function onepoll_run(&$argv, &$argc){
|
|||
|
||||
$datarray = array();
|
||||
$datarray['verb'] = ACTIVITY_POST;
|
||||
$datarray['object-type'] = ACTIVITY_OBJ_NOTE;
|
||||
// $meta = email_msg_meta($mbox,$msg_uid);
|
||||
// $headers = email_msg_headers($mbox,$msg_uid);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue