private static function pushNotification($userKey, $message, $title = null, $url = null, $urltitle = null) { Notifications::addLog('Pushalot - $userKey=[' . $userKey . ']; $message=[' . $message . ']; $title=[' . $title . ']; $url=[' . $url . ']; $urltitle=[' . $urltitle . ']', 'MESSAGING'); if (is_null($userKey)) { throw new Exception("Pushalot - User/API key not specified", 500); } $notification = new Pushalot($userKey); //$pushalot->setProxy('http://localhost:12345','user:pass'); $success = $notification->sendMessage(array('Title' => $title, 'Body' => $message, 'IsImportant' => true, 'IsSilent' => false, 'Image' => 'http://wiki.tarski.nl/skins/common/images/AmpersandLogo.png', 'Source' => 'Ampersand prototype')); if (!$success) { Notifications::addError("Pushalot error '{$notification->getError}()' sending notification to '{$userKey}'"); } else { Notifications::addSuccess('Pushalot message sent.'); } }
text-decoration: none; } </style> </head> <body> <div style="width: 500px; margin: 20px auto;"> <form action="push.php" method="POST"> <p style="text-align: center;"> <img src="https://pushalot.com/Content/Images/logo.png" style="width: 128px; height: 128px;" /> </p> <p style="font-size: 22px; text-align: center;"> <?php include 'pushalot_api.php'; $pushalot = new Pushalot(''); // Your API key here if ($_POST["ref"] == null) { $title = $_POST["title"]; } else { $title = $_POST["ref"] . ": " . $_POST["title"]; } if ($_POST["body"] == null) { $body = "..."; } else { $body = $_POST["body"]; } $link = $_POST["link"]; $img = $_POST["img"]; if ($_POST["imp"] === "imp") { $imp = true;