- $r = q("insert into notify (name,url,photo,date,msg,uid,link,type,verb,otype)
- values('%s','%s','%s','%s','%s',%d,'%s',%d,'%s','%s')",
- dbesc($params['source_name']),
- dbesc($params['source_link']),
- dbesc($params['source_photo']),
- dbesc(datetime_convert()),
- dbesc($epreamble),
- intval($params['uid']),
- dbesc($itemlink),
- intval($params['type']),
- dbesc($params['verb']),
- dbesc($params['otype'])
+ $r = q("insert into notify (hash,name,url,photo,date,uid,link,parent,type,verb,otype)
+ values('%s','%s','%s','%s','%s',%d,'%s',%d,%d,'%s','%s')",
+ dbesc($datarray['hash']),
+ dbesc($datarray['name']),
+ dbesc($datarray['url']),
+ dbesc($datarray['photo']),
+ dbesc($datarray['date']),
+ intval($datarray['uid']),
+ dbesc($datarray['link']),
+ intval($datarray['parent']),
+ intval($datarray['type']),
+ dbesc($datarray['verb']),
+ dbesc($datarray['otype'])
+ );
+
+ $r = q("select id from notify where hash = '%s' and uid = %d limit 1",
+ dbesc($hash),
+ intval($params['uid'])
+ );
+ if($r)
+ $notify_id = $r[0]['id'];
+ else {
+ pop_lang();
+ return;
+ }
+
+ $itemlink = $a->get_baseurl() . '/notify/view/' . $notify_id;
+ $msg = replace_macros($epreamble,array('$itemlink' => $itemlink));
+ $r = q("update notify set msg = '%s' where id = %d and uid = %d limit 1",
+ dbesc($msg),
+ intval($notify_id),
+ intval($params['uid'])