aboutsummaryrefslogtreecommitdiffstats
path: root/mod/item.php
diff options
context:
space:
mode:
authorMike Macgirvin <mike@macgirvin.com>2010-07-16 23:14:37 -0700
committerMike Macgirvin <mike@macgirvin.com>2010-07-16 23:14:37 -0700
commitf937de932d87737d14278003f80b5bc5025acdc6 (patch)
tree340429a6f2b52c6729ebe7e3cd30771042db9aba /mod/item.php
parent5e4df4b3f7782f8a82664d24b86d46a14b3d178b (diff)
downloadvolse-hubzilla-f937de932d87737d14278003f80b5bc5025acdc6.tar.gz
volse-hubzilla-f937de932d87737d14278003f80b5bc5025acdc6.tar.bz2
volse-hubzilla-f937de932d87737d14278003f80b5bc5025acdc6.zip
fixing stuff that broke with the last big code push
Diffstat (limited to 'mod/item.php')
-rw-r--r--mod/item.php35
1 files changed, 19 insertions, 16 deletions
diff --git a/mod/item.php b/mod/item.php
index 3340183b0..437e6ac59 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -22,7 +22,7 @@ function item_post(&$a) {
);
if(! count($r)) {
notice("Unable to locate original post." . EOL);
- goaway($a->get_baseurl() . "/profile/$profile_uid");
+ goaway($a->get_baseurl() . "/" . $_POST['return'] );
}
$parent_item = $r[0];
}
@@ -67,23 +67,32 @@ function item_post(&$a) {
if(! strlen($body)) {
notice("Empty post discarded." . EOL );
- goaway($a->get_baseurl() . "/profile/$profile_uid");
+ goaway($a->get_baseurl() . "/" . $_POST['return'] );
+
}
+ // get contact info for poster
if((x($_SESSION,'visitor_id')) && (intval($_SESSION['visitor_id'])))
$contact_id = $_SESSION['visitor_id'];
else {
$r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `self` = 1 LIMIT 1",
intval($_SESSION['uid']));
- if(count($r)) {
- $contact_record = $r[0];
+ if(count($r))
$contact_id = $r[0]['id'];
- }
- }
+ }
+
+ // get contact info for owner
+
+ $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `self` = 1 LIMIT 1",
+ intval($profile_uid)
+ );
+ if(count($r))
+ $contact_record = $r[0];
+
$notify_type = (($parent) ? 'comment-new' : 'wall-new' );
- if($_POST['type'] == 'jot') {
+ if(($_POST['type'] == 'wall') || ($_POST['type'] == 'wall-comment')) {
do {
$dups = false;
@@ -99,7 +108,7 @@ function item_post(&$a) {
`allow_cid`, `allow_gid`, `deny_cid`, `deny_gid`)
VALUES( %d, '%s', %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s' )",
intval($profile_uid),
- "jot",
+ dbesc($_POST['type']),
intval($contact_id),
dbesc($contact_record['name']),
dbesc($contact_record['url']),
@@ -154,12 +163,6 @@ function item_post(&$a) {
array(),$foo));
}
- goaway($a->get_baseurl() . "/profile/$profile_uid");
-
-
-
-
-
-
-
+ goaway($a->get_baseurl() . "/" . $_POST['return'] );
+ return; // NOTREACHED
} \ No newline at end of file