function Run() { $key = $this->GetParam('key', 'str'); $title = $this->GetParam('title', 'str'); $message = $this->GetParam('message', 'int'); $priority = $this->GetParam('priority', 'str'); $url = $this->GetParam('url', 'str'); $custom = $this->GetParam('custom', 'raw'); $message = str_replace('{custom}', $custom, $message); if (!strlen($priority)) { $priority == 0; } $result = ''; if ($key and $title and $message) { require_once dirname(__FILE__) . '/class.php-prowl.php'; $prowl = new Prowl(); $prowl->setApiKey($key); //$prowl->setDebug(true); $result = $prowl->add($this->conf['app']['name'], $title, $priority, $message, $url); if ($result->success['code'] == 200) { $this->DisplayJson(true, array('code' => 200, 'message' => "Successfully Sent Notification : {$title}", 'api_result' => $result)); } else { $this->DisplayJson(false, array('code' => 500, 'message' => "Failed to send Notification : {$title}", 'api_result' => $result)); } } else { $this->DisplayJson(false, array('code' => 500, 'message' => "Missing some parameters!")); } }
function wptouch_handle_new_user($user_id) { $settings = bnc_wptouch_get_settings(); if (isset($settings['prowl-api']) && isset($settings['enable-prowl-users-button']) && $settings['enable-prowl-users-button'] == 1) { global $wpdb; $api_key = $settings['prowl-api']; require_once 'include/class.prowl.php'; global $table_prefix; $sql = $wpdb->prepare("SELECT * from " . $table_prefix . "users WHERE ID = %d", $user_id); $user = $wpdb->get_row($sql); if ($user) { $prowl = new Prowl($api_key, $settings['header-title']); $result = $prowl->add(1, __("User Registration", "wptouch"), 'Name: ' . $this->wptouch_cleanup_growl(stripslashes($user->user_login)) . "\nE-Mail: " . $this->wptouch_cleanup_growl(stripslashes($user->user_email))); } } }
function prowl_handle_new_user($user_id) { require_once 'prowl.php'; global $wpdb; global $table_prefix; $settings = $this->get_settings(); if (count($settings->push_prowl_api_keys) && $settings->push_prowl_registrations) { foreach ($settings->push_prowl_api_keys as $api_key) { $user = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . $table_prefix . "users WHERE ID = %d", $user_id)); if ($user) { $prowl = new Prowl($api_key, $settings->site_title); $result = $prowl->add(1, __("User Registration", "wptouch-pro"), sprintf(__("Name: %s", "wptouch-pro") . "\n" . __("Email: %s", "wptouch-pro"), $this->wptouch_cleanup_growl(stripslashes($user->user_login)), $this->wptouch_cleanup_growl(stripslashes($user->user_email)))); } } } }