case $TYPES_chatInviteGroup: $data = array("type" => $type, "title" => $title, "alert" => $m, "from_id" => $f, "from_name" => $n, "from_avatar" => getAvatarPath($f), "to_id" => $t, "type" => $type, "cid" => $_GET["cid"], "extra" => $_GET["extra"], "chat_msg" => $m, "action" => "co.aquario.vmmax.PUSH_NOTIFICATION", "customdata" => "GOD LIKE ! (506 invite chat group)"); //file_get_contents("http://armymax.com/api/noti/noti.php?a=insert&f=".$f."&t=".$t."&msg=".$m."&type=".$type); insertNoti($f, $n, $t, $m, $type, $_GET["cid"], $_GET["extra"]); break; case $TYPES_confInvite: $data = array("type" => $type, "title" => $title, "alert" => $m, "from_id" => $f, "from_name" => $n, "from_avatar" => getAvatarPath($f), "to_id" => $t, "type" => $type, "room_name" => $_GET["room_name"], "action" => "co.aquario.vmmax.PUSH_NOTIFICATION", "customdata" => "GOD LIKE ! (600,601,602 conference)"); break; case $TYPES_confCreate: case $TYPES_confJoin: if (isset($_GET["cid"])) { $data = array("type" => $type, "title" => $title, "alert" => $m, "from_id" => $f, "from_name" => $n, "from_avatar" => getAvatarPath($f), "to_id" => $t, "type" => $type, "cid" => $_GET["cid"], "room_name" => $_GET["room_name"]); } else { $data = array("type" => $type, "title" => $title, "alert" => $m, "from_id" => $f, "from_name" => $n, "from_avatar" => getAvatarPath($f), "to_id" => $t, "type" => $type, "room_name" => $_GET["room_name"]); } insertNoti($f, $n, $t, $m, $type, $_GET["cid"], $_GET["room_name"]); //file_get_contents("http://armymax.com/api/noti/noti.php?a=insert&f=".$f."&t=".$t."&msg=".$m."&type=".$type."&post_id=".$_GET["room_name"]); break; } //Default for all $data['badge'] = $badge; $data['badge_social'] = $badgeSocial; $data['badge_chat'] = $badgeChat; $data['badge_follow'] = $badgeFollow; $data['sound'] = "homerun.caf"; //echo $_GET['type']; $cURLHandler = curl_init(); $url = "https://api.parse.com/1/push"; // if(isset($_GET["all"])) { // $send_json = array( // "data" => $data
$fname = ""; } $to = $_REQUEST["t"]; $msg = $_REQUEST["msg"]; $type = $_REQUEST["type"]; if (isset($_REQUEST["post_id"])) { $post_id = $_REQUEST["post_id"]; } else { $post_id = 0; } if (isset($_REQUEST["extra"])) { $extra = $_REQUEST["extra"]; } else { $extra = ""; } echo insertNoti($from, $fname, $to, $msg, $type, $post_id, $extra); break; case "read": // http://armymax.com/api/noti/noti.php?a=list&user_id=22 $notiId = $_REQUEST["noti_id"]; echo read($notiId); break; case "readAll": $userId = $_REQUEST["user_id"]; if (isset($_REQUEST["timestamp"])) { $timestamp = $_REQUEST["timestamp"]; } else { $timestamp = now(); } echo readAll($userId, $timestamp); break;