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
|
@ -493,7 +493,8 @@ function render_content(&$a, $items, $mode, $update, $preview = false) {
|
|||
'like' => '',
|
||||
'dislike' => '',
|
||||
'comment' => '',
|
||||
'conv' => (($preview) ? '' : array('href'=> $a->get_baseurl($ssl_state) . '/display/' . $nickname . '/' . $item['id'], 'title'=> t('View in context'))),
|
||||
//'conv' => (($preview) ? '' : array('href'=> $a->get_baseurl($ssl_state) . '/display/' . $nickname . '/' . $item['id'], 'title'=> t('View in context'))),
|
||||
'conv' => (($preview) ? '' : array('href'=> $a->get_baseurl($ssl_state).'/display/'.$item['guid'], 'title'=> t('View in context'))),
|
||||
'previewing' => $previewing,
|
||||
'wait' => t('Please wait'),
|
||||
);
|
||||
|
|
20
mod/item.php
20
mod/item.php
|
@ -203,9 +203,9 @@ function item_post(&$a) {
|
|||
$private = $orig_post['private'];
|
||||
$pubmail_enable = $orig_post['pubmail'];
|
||||
$network = $orig_post['network'];
|
||||
$guid = $orig_post['guid'];
|
||||
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
|
||||
// if coming from the API and no privacy settings are set,
|
||||
// use the user default permissions - as they won't have
|
||||
|
@ -238,6 +238,7 @@ function item_post(&$a) {
|
|||
$emailcc = notags(trim($_REQUEST['emailcc']));
|
||||
$body = escape_tags(trim($_REQUEST['body']));
|
||||
$network = notags(trim($_REQUEST['network']));
|
||||
$guid = get_guid(32);
|
||||
|
||||
|
||||
$naked_body = preg_replace('/\[(.+?)\]/','',$body);
|
||||
|
@ -629,6 +630,7 @@ function item_post(&$a) {
|
|||
$datarray['commented'] = datetime_convert();
|
||||
$datarray['received'] = datetime_convert();
|
||||
$datarray['changed'] = datetime_convert();
|
||||
$datarray['guid'] = $guid;
|
||||
$datarray['uri'] = $uri;
|
||||
$datarray['title'] = $title;
|
||||
$datarray['body'] = $body;
|
||||
|
@ -664,8 +666,6 @@ function item_post(&$a) {
|
|||
|
||||
if($orig_post)
|
||||
$datarray['edit'] = true;
|
||||
else
|
||||
$datarray['guid'] = get_guid();
|
||||
|
||||
// preview mode - prepare the body for display and send it via json
|
||||
|
||||
|
@ -823,7 +823,8 @@ function item_post(&$a) {
|
|||
'to_email' => $user['email'],
|
||||
'uid' => $user['uid'],
|
||||
'item' => $datarray,
|
||||
'link' => $a->get_baseurl() . '/display/' . $user['nickname'] . '/' . $post_id,
|
||||
//'link' => $a->get_baseurl() . '/display/' . $user['nickname'] . '/' . $post_id,
|
||||
'link' => $a->get_baseurl().'/display/'.$datarray['guid'],
|
||||
'source_name' => $datarray['author-name'],
|
||||
'source_link' => $datarray['author-link'],
|
||||
'source_photo' => $datarray['author-avatar'],
|
||||
|
@ -851,7 +852,8 @@ function item_post(&$a) {
|
|||
'to_email' => $user['email'],
|
||||
'uid' => $user['uid'],
|
||||
'item' => $datarray,
|
||||
'link' => $a->get_baseurl() . '/display/' . $user['nickname'] . '/' . $post_id,
|
||||
//'link' => $a->get_baseurl() . '/display/' . $user['nickname'] . '/' . $post_id,
|
||||
'link' => $a->get_baseurl().'/display/'.$datarray['guid'],
|
||||
'source_name' => $datarray['author-name'],
|
||||
'source_link' => $datarray['author-link'],
|
||||
'source_photo' => $datarray['author-avatar'],
|
||||
|
@ -870,7 +872,8 @@ function item_post(&$a) {
|
|||
WHERE `id` = %d",
|
||||
intval($parent),
|
||||
dbesc(($parent == $post_id) ? $uri : $parent_item['uri']),
|
||||
dbesc($a->get_baseurl() . '/display/' . $user['nickname'] . '/' . $post_id),
|
||||
//dbesc($a->get_baseurl() . '/display/' . $user['nickname'] . '/' . $post_id),
|
||||
dbesc($a->get_baseurl().'/display/'.$datarray['guid']),
|
||||
dbesc(datetime_convert()),
|
||||
intval($post_id)
|
||||
);
|
||||
|
@ -903,7 +906,8 @@ function item_post(&$a) {
|
|||
update_thread($parent);
|
||||
|
||||
$datarray['id'] = $post_id;
|
||||
$datarray['plink'] = $a->get_baseurl() . '/display/' . $user['nickname'] . '/' . $post_id;
|
||||
//$datarray['plink'] = $a->get_baseurl() . '/display/' . $user['nickname'] . '/' . $post_id;
|
||||
$datarray['plink'] = $a->get_baseurl().'/display/'.$datarray['guid'];
|
||||
|
||||
call_hooks('post_local_end', $datarray);
|
||||
|
||||
|
|
|
@ -121,7 +121,7 @@ function notifications_content(&$a) {
|
|||
$notif_content .= '<a href="' . ((strlen($sql_extra)) ? 'notifications/intros/all' : 'notifications/intros' ) . '" id="notifications-show-hide-link" >'
|
||||
. ((strlen($sql_extra)) ? t('Show Ignored Requests') : t('Hide Ignored Requests')) . '</a></div>' . "\r\n";
|
||||
|
||||
$r = q("SELECT COUNT(*) AS `total` FROM `intro`
|
||||
$r = q("SELECT COUNT(*) AS `total` FROM `intro`
|
||||
WHERE `intro`.`uid` = %d $sql_extra AND `intro`.`blocked` = 0 ",
|
||||
intval($_SESSION['uid'])
|
||||
);
|
||||
|
@ -229,59 +229,62 @@ function notifications_content(&$a) {
|
|||
|
||||
$notif_tpl = get_markup_template('notifications.tpl');
|
||||
|
||||
$r = q("SELECT `item`.`id`,`item`.`parent`, `item`.`verb`, `item`.`author-name`,
|
||||
`item`.`author-link`, `item`.`author-avatar`, `item`.`created`, `item`.`object` as `object`,
|
||||
`pitem`.`author-name` as `pname`, `pitem`.`author-link` as `plink`
|
||||
$r = q("SELECT `item`.`id`,`item`.`parent`, `item`.`verb`, `item`.`author-name`,
|
||||
`item`.`author-link`, `item`.`author-avatar`, `item`.`created`, `item`.`object` as `object`,
|
||||
`pitem`.`author-name` as `pname`, `pitem`.`author-link` as `plink`, `pitem`.`guid` as `pguid`
|
||||
FROM `item` INNER JOIN `item` as `pitem` ON `pitem`.`id`=`item`.`parent`
|
||||
WHERE `item`.`unseen` = 1 AND `item`.`visible` = 1 AND `pitem`.`parent` != 0 AND
|
||||
`item`.`deleted` = 0 AND `item`.`uid` = %d AND `item`.`wall` = 0 ORDER BY `item`.`created` DESC" ,
|
||||
intval(local_user())
|
||||
);
|
||||
|
||||
|
||||
$tpl_item_likes = get_markup_template('notifications_likes_item.tpl');
|
||||
$tpl_item_dislikes = get_markup_template('notifications_dislikes_item.tpl');
|
||||
$tpl_item_friends = get_markup_template('notifications_friends_item.tpl');
|
||||
$tpl_item_comments = get_markup_template('notifications_comments_item.tpl');
|
||||
$tpl_item_posts = get_markup_template('notifications_posts_item.tpl');
|
||||
|
||||
|
||||
$notif_content = '';
|
||||
|
||||
|
||||
if ($r) {
|
||||
|
||||
|
||||
foreach ($r as $it) {
|
||||
switch($it['verb']){
|
||||
case ACTIVITY_LIKE:
|
||||
$notif_content .= replace_macros($tpl_item_likes,array(
|
||||
'$item_link' => $a->get_baseurl(true).'/display/'.$a->user['nickname']."/".$it['parent'],
|
||||
//'$item_link' => $a->get_baseurl(true).'/display/'.$a->user['nickname']."/".$it['parent'],
|
||||
'$item_link' => $a->get_baseurl(true).'/display/'.$it['pguid'],
|
||||
'$item_image' => $it['author-avatar'],
|
||||
'$item_text' => sprintf( t("%s liked %s's post"), $it['author-name'], $it['pname']),
|
||||
'$item_when' => relative_date($it['created'])
|
||||
));
|
||||
break;
|
||||
|
||||
|
||||
case ACTIVITY_DISLIKE:
|
||||
$notif_content .= replace_macros($tpl_item_dislikes,array(
|
||||
'$item_link' => $a->get_baseurl(true).'/display/'.$a->user['nickname']."/".$it['parent'],
|
||||
//'$item_link' => $a->get_baseurl(true).'/display/'.$a->user['nickname']."/".$it['parent'],
|
||||
'$item_link' => $a->get_baseurl(true).'/display/'.$it['pguid'],
|
||||
'$item_image' => $it['author-avatar'],
|
||||
'$item_text' => sprintf( t("%s disliked %s's post"), $it['author-name'], $it['pname']),
|
||||
'$item_when' => relative_date($it['created'])
|
||||
));
|
||||
break;
|
||||
|
||||
|
||||
case ACTIVITY_FRIEND:
|
||||
|
||||
|
||||
$xmlhead="<"."?xml version='1.0' encoding='UTF-8' ?".">";
|
||||
$obj = parse_xml_string($xmlhead.$it['object']);
|
||||
$it['fname'] = $obj->title;
|
||||
|
||||
|
||||
$notif_content .= replace_macros($tpl_item_friends,array(
|
||||
'$item_link' => $a->get_baseurl(true).'/display/'.$a->user['nickname']."/".$it['parent'],
|
||||
//'$item_link' => $a->get_baseurl(true).'/display/'.$a->user['nickname']."/".$it['parent'],
|
||||
'$item_link' => $a->get_baseurl(true).'/display/'.$it['pguid'],
|
||||
'$item_image' => $it['author-avatar'],
|
||||
'$item_text' => sprintf( t("%s is now friends with %s"), $it['author-name'], $it['fname']),
|
||||
'$item_when' => relative_date($it['created'])
|
||||
));
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
$item_text = (($it['id'] == $it['parent'])
|
||||
? sprintf( t("%s created a new post"), $it['author-name'])
|
||||
|
@ -289,36 +292,37 @@ function notifications_content(&$a) {
|
|||
$tpl = (($it['id'] == $it['parent']) ? $tpl_item_posts : $tpl_item_comments);
|
||||
|
||||
$notif_content .= replace_macros($tpl,array(
|
||||
'$item_link' => $a->get_baseurl(true).'/display/'.$a->user['nickname']."/".$it['parent'],
|
||||
//'$item_link' => $a->get_baseurl(true).'/display/'.$a->user['nickname']."/".$it['parent'],
|
||||
'$item_link' => $a->get_baseurl(true).'/display/'.$it['pguid'],
|
||||
'$item_image' => $it['author-avatar'],
|
||||
'$item_text' => $item_text,
|
||||
'$item_when' => relative_date($it['created'])
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
$notif_content = t('No more network notifications.');
|
||||
}
|
||||
|
||||
|
||||
$o .= replace_macros($notif_tpl, array(
|
||||
'$notif_header' => t('Network Notifications'),
|
||||
'$tabs' => $tabs,
|
||||
'$notif_content' => $notif_content,
|
||||
));
|
||||
|
||||
|
||||
} else if (($a->argc > 1) && ($a->argv[1] == 'system')) {
|
||||
|
||||
|
||||
$notif_tpl = get_markup_template('notifications.tpl');
|
||||
|
||||
|
||||
$not_tpl = get_markup_template('notify.tpl');
|
||||
require_once('include/bbcode.php');
|
||||
|
||||
$r = q("SELECT * from notify where uid = %d and seen = 0 order by date desc",
|
||||
intval(local_user())
|
||||
);
|
||||
|
||||
|
||||
if (count($r) > 0) {
|
||||
foreach ($r as $it) {
|
||||
$notif_content .= replace_macros($not_tpl,array(
|
||||
|
@ -331,7 +335,7 @@ function notifications_content(&$a) {
|
|||
} else {
|
||||
$notif_content .= t('No more system notifications.');
|
||||
}
|
||||
|
||||
|
||||
$o .= replace_macros($notif_tpl, array(
|
||||
'$notif_header' => t('System Notifications'),
|
||||
'$tabs' => $tabs,
|
||||
|
@ -339,9 +343,9 @@ function notifications_content(&$a) {
|
|||
));
|
||||
|
||||
} else if (($a->argc > 1) && ($a->argv[1] == 'personal')) {
|
||||
|
||||
|
||||
$notif_tpl = get_markup_template('notifications.tpl');
|
||||
|
||||
|
||||
$myurl = $a->get_baseurl(true) . '/profile/'. $a->user['nickname'];
|
||||
$myurl = substr($myurl,strpos($myurl,'://')+3);
|
||||
$myurl = str_replace(array('www.','.'),array('','\\.'),$myurl);
|
||||
|
@ -353,60 +357,63 @@ function notifications_content(&$a) {
|
|||
);
|
||||
|
||||
|
||||
$r = q("SELECT `item`.`id`,`item`.`parent`, `item`.`verb`, `item`.`author-name`,
|
||||
`item`.`author-link`, `item`.`author-avatar`, `item`.`created`, `item`.`object` as `object`,
|
||||
`pitem`.`author-name` as `pname`, `pitem`.`author-link` as `plink`
|
||||
$r = q("SELECT `item`.`id`,`item`.`parent`, `item`.`verb`, `item`.`author-name`,
|
||||
`item`.`author-link`, `item`.`author-avatar`, `item`.`created`, `item`.`object` as `object`,
|
||||
`pitem`.`author-name` as `pname`, `pitem`.`author-link` as `plink`, `pitem`.`guid` as `pguid`
|
||||
FROM `item` INNER JOIN `item` as `pitem` ON `pitem`.`id`=`item`.`parent`
|
||||
WHERE `item`.`unseen` = 1 AND `item`.`visible` = 1
|
||||
WHERE `item`.`unseen` = 1 AND `item`.`visible` = 1
|
||||
$sql_extra
|
||||
AND `item`.`deleted` = 0 AND `item`.`uid` = %d AND `item`.`wall` = 0 ORDER BY `item`.`created` DESC" ,
|
||||
intval(local_user())
|
||||
);
|
||||
|
||||
|
||||
$tpl_item_likes = get_markup_template('notifications_likes_item.tpl');
|
||||
$tpl_item_dislikes = get_markup_template('notifications_dislikes_item.tpl');
|
||||
$tpl_item_friends = get_markup_template('notifications_friends_item.tpl');
|
||||
$tpl_item_comments = get_markup_template('notifications_comments_item.tpl');
|
||||
$tpl_item_posts = get_markup_template('notifications_posts_item.tpl');
|
||||
|
||||
|
||||
$notif_content = '';
|
||||
|
||||
|
||||
if (count($r) > 0) {
|
||||
|
||||
|
||||
foreach ($r as $it) {
|
||||
switch($it['verb']){
|
||||
case ACTIVITY_LIKE:
|
||||
$notif_content .= replace_macros($tpl_item_likes,array(
|
||||
'$item_link' => $a->get_baseurl(true).'/display/'.$a->user['nickname']."/".$it['parent'],
|
||||
//'$item_link' => $a->get_baseurl(true).'/display/'.$a->user['nickname']."/".$it['parent'],
|
||||
'$item_link' => $a->get_baseurl(true).'/display/'.$it['pguid'],
|
||||
'$item_image' => $it['author-avatar'],
|
||||
'$item_text' => sprintf( t("%s liked %s's post"), $it['author-name'], $it['pname']),
|
||||
'$item_when' => relative_date($it['created'])
|
||||
));
|
||||
break;
|
||||
|
||||
|
||||
case ACTIVITY_DISLIKE:
|
||||
$notif_content .= replace_macros($tpl_item_dislikes,array(
|
||||
'$item_link' => $a->get_baseurl(true).'/display/'.$a->user['nickname']."/".$it['parent'],
|
||||
//'$item_link' => $a->get_baseurl(true).'/display/'.$a->user['nickname']."/".$it['parent'],
|
||||
'$item_link' => $a->get_baseurl(true).'/display/'.$it['pguid'],
|
||||
'$item_image' => $it['author-avatar'],
|
||||
'$item_text' => sprintf( t("%s disliked %s's post"), $it['author-name'], $it['pname']),
|
||||
'$item_when' => relative_date($it['created'])
|
||||
));
|
||||
break;
|
||||
|
||||
|
||||
case ACTIVITY_FRIEND:
|
||||
|
||||
|
||||
$xmlhead="<"."?xml version='1.0' encoding='UTF-8' ?".">";
|
||||
$obj = parse_xml_string($xmlhead.$it['object']);
|
||||
$it['fname'] = $obj->title;
|
||||
|
||||
|
||||
$notif_content .= replace_macros($tpl_item_friends,array(
|
||||
'$item_link' => $a->get_baseurl(true).'/display/'.$a->user['nickname']."/".$it['parent'],
|
||||
//'$item_link' => $a->get_baseurl(true).'/display/'.$a->user['nickname']."/".$it['parent'],
|
||||
'$item_link' => $a->get_baseurl(true).'/display/'.$it['pguid'],
|
||||
'$item_image' => $it['author-avatar'],
|
||||
'$item_text' => sprintf( t("%s is now friends with %s"), $it['author-name'], $it['fname']),
|
||||
'$item_when' => relative_date($it['created'])
|
||||
));
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
$item_text = (($it['id'] == $it['parent'])
|
||||
? sprintf( t("%s created a new post"), $it['author-name'])
|
||||
|
@ -414,57 +421,59 @@ function notifications_content(&$a) {
|
|||
$tpl = (($it['id'] == $it['parent']) ? $tpl_item_posts : $tpl_item_comments);
|
||||
|
||||
$notif_content .= replace_macros($tpl,array(
|
||||
'$item_link' => $a->get_baseurl(true).'/display/'.$a->user['nickname']."/".$it['parent'],
|
||||
//'$item_link' => $a->get_baseurl(true).'/display/'.$a->user['nickname']."/".$it['parent'],
|
||||
'$item_link' => $a->get_baseurl(true).'/display/'.$it['pguid'],
|
||||
'$item_image' => $it['author-avatar'],
|
||||
'$item_text' => $item_text,
|
||||
'$item_when' => relative_date($it['created'])
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
$notif_content = t('No more personal notifications.');
|
||||
}
|
||||
|
||||
|
||||
$o .= replace_macros($notif_tpl, array(
|
||||
'$notif_header' => t('Personal Notifications'),
|
||||
'$tabs' => $tabs,
|
||||
'$notif_content' => $notif_content,
|
||||
));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
} else if (($a->argc > 1) && ($a->argv[1] == 'home')) {
|
||||
|
||||
|
||||
$notif_tpl = get_markup_template('notifications.tpl');
|
||||
|
||||
$r = q("SELECT `item`.`id`,`item`.`parent`, `item`.`verb`, `item`.`author-name`,
|
||||
`item`.`author-link`, `item`.`author-avatar`, `item`.`created`, `item`.`object` as `object`,
|
||||
`pitem`.`author-name` as `pname`, `pitem`.`author-link` as `plink`
|
||||
|
||||
$r = q("SELECT `item`.`id`,`item`.`parent`, `item`.`verb`, `item`.`author-name`,
|
||||
`item`.`author-link`, `item`.`author-avatar`, `item`.`created`, `item`.`object` as `object`,
|
||||
`pitem`.`author-name` as `pname`, `pitem`.`author-link` as `plink`, `pitem`.`guid` as `pguid`
|
||||
FROM `item` INNER JOIN `item` as `pitem` ON `pitem`.`id`=`item`.`parent`
|
||||
WHERE `item`.`unseen` = 1 AND `item`.`visible` = 1 AND
|
||||
`item`.`deleted` = 0 AND `item`.`uid` = %d AND `item`.`wall` = 1 ORDER BY `item`.`created` DESC",
|
||||
intval(local_user())
|
||||
);
|
||||
|
||||
|
||||
$tpl_item_likes = get_markup_template('notifications_likes_item.tpl');
|
||||
$tpl_item_dislikes = get_markup_template('notifications_dislikes_item.tpl');
|
||||
$tpl_item_friends = get_markup_template('notifications_friends_item.tpl');
|
||||
$tpl_item_comments = get_markup_template('notifications_comments_item.tpl');
|
||||
|
||||
|
||||
$notif_content = '';
|
||||
|
||||
|
||||
if (count($r) > 0) {
|
||||
|
||||
|
||||
foreach ($r as $it) {
|
||||
switch($it['verb']){
|
||||
case ACTIVITY_LIKE:
|
||||
$notif_content .= replace_macros($tpl_item_likes,array(
|
||||
'$item_link' => $a->get_baseurl(true).'/display/'.$a->user['nickname']."/".$it['parent'],
|
||||
//'$item_link' => $a->get_baseurl(true).'/display/'.$a->user['nickname']."/".$it['parent'],
|
||||
'$item_link' => $a->get_baseurl(true).'/display/'.$it['pguid'],
|
||||
'$item_image' => $it['author-avatar'],
|
||||
'$item_text' => sprintf( t("%s liked %s's post"), $it['author-name'], $it['pname']),
|
||||
'$item_when' => relative_date($it['created'])
|
||||
|
@ -473,7 +482,8 @@ function notifications_content(&$a) {
|
|||
break;
|
||||
case ACTIVITY_DISLIKE:
|
||||
$notif_content .= replace_macros($tpl_item_dislikes,array(
|
||||
'$item_link' => $a->get_baseurl(true).'/display/'.$a->user['nickname']."/".$it['parent'],
|
||||
//'$item_link' => $a->get_baseurl(true).'/display/'.$a->user['nickname']."/".$it['parent'],
|
||||
'$item_link' => $a->get_baseurl(true).'/display/'.$it['pguid'],
|
||||
'$item_image' => $it['author-avatar'],
|
||||
'$item_text' => sprintf( t("%s disliked %s's post"), $it['author-name'], $it['pname']),
|
||||
'$item_when' => relative_date($it['created'])
|
||||
|
@ -481,13 +491,14 @@ function notifications_content(&$a) {
|
|||
|
||||
break;
|
||||
case ACTIVITY_FRIEND:
|
||||
|
||||
|
||||
$xmlhead="<"."?xml version='1.0' encoding='UTF-8' ?".">";
|
||||
$obj = parse_xml_string($xmlhead.$it['object']);
|
||||
$it['fname'] = $obj->title;
|
||||
|
||||
|
||||
$notif_content .= replace_macros($tpl_item_friends,array(
|
||||
'$item_link' => $a->get_baseurl(true).'/display/'.$a->user['nickname']."/".$it['parent'],
|
||||
//'$item_link' => $a->get_baseurl(true).'/display/'.$a->user['nickname']."/".$it['parent'],
|
||||
'$item_link' => $a->get_baseurl(true).'/display/'.$it['pguid'],
|
||||
'$item_image' => $it['author-avatar'],
|
||||
'$item_text' => sprintf( t("%s is now friends with %s"), $it['author-name'], $it['fname']),
|
||||
'$item_when' => relative_date($it['created'])
|
||||
|
@ -496,18 +507,19 @@ function notifications_content(&$a) {
|
|||
break;
|
||||
default:
|
||||
$notif_content .= replace_macros($tpl_item_comments,array(
|
||||
'$item_link' => $a->get_baseurl(true).'/display/'.$a->user['nickname']."/".$it['parent'],
|
||||
//'$item_link' => $a->get_baseurl(true).'/display/'.$a->user['nickname']."/".$it['parent'],
|
||||
'$item_link' => $a->get_baseurl(true).'/display/'.$it['pguid'],
|
||||
'$item_image' => $it['author-avatar'],
|
||||
'$item_text' => sprintf( t("%s commented on %s's post"), $it['author-name'], $it['pname']),
|
||||
'$item_when' => relative_date($it['created'])
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
$notif_content = t('No more home notifications.');
|
||||
}
|
||||
|
||||
|
||||
$o .= replace_macros($notif_tpl, array(
|
||||
'$notif_header' => t('Home Notifications'),
|
||||
'$tabs' => $tabs,
|
||||
|
|
|
@ -341,7 +341,6 @@ function photos_post(&$a) {
|
|||
|
||||
if(($a->argc > 2) && ((x($_POST,'desc') !== false) || (x($_POST,'newtag') !== false)) || (x($_POST,'albname') !== false)) {
|
||||
|
||||
|
||||
$desc = ((x($_POST,'desc')) ? notags(trim($_POST['desc'])) : '');
|
||||
$rawtags = ((x($_POST,'newtag')) ? notags(trim($_POST['newtag'])) : '');
|
||||
$item_id = ((x($_POST,'item_id')) ? intval($_POST['item_id']) : 0);
|
||||
|
@ -436,19 +435,19 @@ function photos_post(&$a) {
|
|||
$visibility = 0;
|
||||
if($p[0]['desc'] !== $desc || strlen($rawtags))
|
||||
$visibility = 1;
|
||||
|
||||
|
||||
if(! $item_id) {
|
||||
|
||||
// Create item container
|
||||
|
||||
$title = '';
|
||||
$uri = item_new_uri($a->get_hostname(),$page_owner_uid);
|
||||
|
||||
|
||||
$arr = array();
|
||||
|
||||
$arr['uid'] = $page_owner_uid;
|
||||
$arr['uri'] = $uri;
|
||||
$arr['parent-uri'] = $uri;
|
||||
$arr['parent-uri'] = $uri;
|
||||
$arr['type'] = 'photo';
|
||||
$arr['wall'] = 1;
|
||||
$arr['resource-id'] = $p[0]['resource-id'];
|
||||
|
@ -586,14 +585,17 @@ function photos_post(&$a) {
|
|||
if(strlen($str_tags))
|
||||
$str_tags .= ',';
|
||||
$profile = str_replace(',','%2c',$profile);
|
||||
$str_tags .= '@[url=' . $profile . ']' . $newname . '[/url]';
|
||||
$str_tags .= '@[url='.$profile.']'.$newname.'[/url]';
|
||||
}
|
||||
} elseif (strpos($tag,'#') === 0) {
|
||||
$tagname = substr($tag, 1);
|
||||
$str_tags .= '#[url='.$a->get_baseurl()."/search?tag=".$tagname.']'.$tagname.'[/url]';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$newtag = $old_tag;
|
||||
if(strlen($newtag) && strlen($str_tags))
|
||||
if(strlen($newtag) && strlen($str_tags))
|
||||
$newtag .= ',';
|
||||
$newtag .= $str_tags;
|
||||
|
||||
|
@ -672,11 +674,11 @@ function photos_post(&$a) {
|
|||
|
||||
$item_id = item_store($arr);
|
||||
if($item_id) {
|
||||
q("UPDATE `item` SET `plink` = '%s' WHERE `uid` = %d AND `id` = %d",
|
||||
dbesc($a->get_baseurl() . '/display/' . $owner_record['nickname'] . '/' . $item_id),
|
||||
intval($page_owner_uid),
|
||||
intval($item_id)
|
||||
);
|
||||
//q("UPDATE `item` SET `plink` = '%s' WHERE `uid` = %d AND `id` = %d",
|
||||
// dbesc($a->get_baseurl() . '/display/' . $owner_record['nickname'] . '/' . $item_id),
|
||||
// intval($page_owner_uid),
|
||||
// intval($item_id)
|
||||
//);
|
||||
|
||||
proc_run('php',"include/notifier.php","tag","$item_id");
|
||||
}
|
||||
|
@ -880,13 +882,13 @@ function photos_post(&$a) {
|
|||
|
||||
$item_id = item_store($arr);
|
||||
|
||||
if($item_id) {
|
||||
q("UPDATE `item` SET `plink` = '%s' WHERE `uid` = %d AND `id` = %d",
|
||||
dbesc($a->get_baseurl() . '/display/' . $owner_record['nickname'] . '/' . $item_id),
|
||||
intval($page_owner_uid),
|
||||
intval($item_id)
|
||||
);
|
||||
}
|
||||
//if($item_id) {
|
||||
// q("UPDATE `item` SET `plink` = '%s' WHERE `uid` = %d AND `id` = %d",
|
||||
// dbesc($a->get_baseurl() . '/display/' . $owner_record['nickname'] . '/' . $item_id),
|
||||
// intval($page_owner_uid),
|
||||
// intval($item_id)
|
||||
// );
|
||||
//}
|
||||
|
||||
if($visible)
|
||||
proc_run('php', "include/notifier.php", 'wall-new', $item_id);
|
||||
|
|
10
mod/poke.php
10
mod/poke.php
|
@ -111,11 +111,11 @@ function poke_init(&$a) {
|
|||
|
||||
$item_id = item_store($arr);
|
||||
if($item_id) {
|
||||
q("UPDATE `item` SET `plink` = '%s' WHERE `uid` = %d AND `id` = %d",
|
||||
dbesc($a->get_baseurl() . '/display/' . $poster['nickname'] . '/' . $item_id),
|
||||
intval($uid),
|
||||
intval($item_id)
|
||||
);
|
||||
//q("UPDATE `item` SET `plink` = '%s' WHERE `uid` = %d AND `id` = %d",
|
||||
// dbesc($a->get_baseurl() . '/display/' . $poster['nickname'] . '/' . $item_id),
|
||||
// intval($uid),
|
||||
// intval($item_id)
|
||||
//);
|
||||
proc_run('php',"include/notifier.php","tag","$item_id");
|
||||
}
|
||||
|
||||
|
|
|
@ -558,10 +558,10 @@ function profile_activity($changed, $value) {
|
|||
if($i) {
|
||||
|
||||
// give it a permanent link
|
||||
q("update item set plink = '%s' where id = %d",
|
||||
dbesc($a->get_baseurl() . '/display/' . $a->user['nickname'] . '/' . $i),
|
||||
intval($i)
|
||||
);
|
||||
//q("update item set plink = '%s' where id = %d",
|
||||
// dbesc($a->get_baseurl() . '/display/' . $a->user['nickname'] . '/' . $i),
|
||||
// intval($i)
|
||||
//);
|
||||
|
||||
proc_run('php',"include/notifier.php","activity","$i");
|
||||
|
||||
|
|
|
@ -970,15 +970,15 @@ function settings_content(&$a) {
|
|||
($a->user['page-flags'] == PAGE_NORMAL)),
|
||||
|
||||
'$page_soapbox' => array('page-flags', t('Soapbox Page'), PAGE_SOAPBOX,
|
||||
t('Automatically approve all connection/friend requests as read-only fans'),
|
||||
t('Automatically approve all connection/friend requests as read-only fans'),
|
||||
($a->user['page-flags'] == PAGE_SOAPBOX)),
|
||||
|
||||
'$page_community' => array('page-flags', t('Community Forum/Celebrity Account'), PAGE_COMMUNITY,
|
||||
t('Automatically approve all connection/friend requests as read-write fans'),
|
||||
t('Automatically approve all connection/friend requests as read-write fans'),
|
||||
($a->user['page-flags'] == PAGE_COMMUNITY)),
|
||||
|
||||
'$page_freelove' => array('page-flags', t('Automatic Friend Page'), PAGE_FREELOVE,
|
||||
t('Automatically approve all connection/friend requests as friends'),
|
||||
t('Automatically approve all connection/friend requests as friends'),
|
||||
($a->user['page-flags'] == PAGE_FREELOVE)),
|
||||
|
||||
'$page_prvgroup' => array('page-flags', t('Private Forum [Experimental]'), PAGE_PRVGROUP,
|
||||
|
|
|
@ -138,10 +138,10 @@ EOT;
|
|||
|
||||
$post_id = item_store($arr);
|
||||
|
||||
q("UPDATE `item` set plink = '%s' where id = %d",
|
||||
dbesc($a->get_baseurl() . '/display/' . $owner_nick . '/' . $post_id),
|
||||
intval($post_id)
|
||||
);
|
||||
// q("UPDATE `item` set plink = '%s' where id = %d",
|
||||
// dbesc($a->get_baseurl() . '/display/' . $owner_nick . '/' . $post_id),
|
||||
// intval($post_id)
|
||||
// );
|
||||
|
||||
|
||||
if(! $item['visible']) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue