From bec3d15c525ff12ba0de53c0b21e03cc9a3a7f39 Mon Sep 17 00:00:00 2001 From: Mike Macgirvin Date: Thu, 8 Jul 2010 17:49:41 -0700 Subject: more work --- include/notifier.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'include/notifier.php') diff --git a/include/notifier.php b/include/notifier.php index e67ef06e3..89b0964b4 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -15,17 +15,29 @@ require_once("datetime.php"); // FIXME - generalise for other content, probably create a notify queue in // the db with type and recipient list -if(($argc != 3) || (! intval($argv[2]))) +if($argc < 3) exit; - $baseurl = trim(pack("H*" , $argv[1])); + $baseurl = trim(hex2bin($argv[1])); + + $cmd = $argv[2]; + + switch($cmd) { + + default: + $item_id = intval($argv[3]); + if(! $item_id) + killme(); + break; + } - $item_id = $argv[2]; $is_parent = false; $recipients = array(); + // fetch requested item + $r = q("SELECT `item`.*, `contact`.*,`item`.`id` AS `item_id` FROM `item` LEFT JOIN `contact` ON `item`.`contact-id` = `contact`.`id` WHERE `item`.`id` = %d LIMIT 1", intval($item_id) -- cgit v1.2.3