Ratings | | Unique User Downloads | | Download Rankings |
60% | | Total: 464 | | All time: 6,056 This week: 455 |
|
Description | | Author |
This package can notify user browsing a site in real time with AJAX.
It takes AJAX requests that perform long polling to send notification messages to users browsing the current site pages.
Browser side JavaScript code can receive the messages immediately and display them to the user.
The package provides an administration interface that can send messages to the users queueing them in a database. Innovation Award
November 2015
Number 3 |
Sites like for instance social networks send notifications to the users to let them know about new content, new messages, or actions that they need to take.
This package implements a solution to send notifications to users using AJAX so they can be aware of new notifications without having to load a new page.
Manuel Lemos |
| |
|
|
Innovation award
Nominee: 3x |
|
Recommendations
Example
<?php
/**
* Here intercept the ajax call for the administration panel
*
*
*
* PHP version 5
*
* @author Ettore Moretti <ettoremoretti27@gmail.com>
* @version 1.0.0
*
*/
set_time_limit(0);
require_once 'core/XajaAdminServer.php';
// Retrieving the last timestamp
$notification=isset( $_GET['notification'])? $_GET['notification']: 0 ;
// Retrieving the uid
$uid=isset( $_GET['id'])? $_GET['id']: 0 ;
//XajaServerClass instance and send notification
$XS= new XajaAdminServer();
$XS->SendNotification($notification,$uid);
|
Details
xajanotifier
What is XajaNotifier?
XajaNotifier is a solution designed to send notifications to users browsing your site in real-time.
Using the technique of reverse ajax through the implementation of long polling.
What I could use?
Could be very useful in case you want to send any message to all your users online fast and non-invasive.
How do I configure?
Db side, import the table that you will find in the package.
Server side, change configurations to connect to the db in config.php.
Client side configuration is the only one in the script js, where you specify the server address.
Known issues
- deliberately (to make scripts as customizable as possible) has been given the opportunity to inject JavaScript code in the message
if not you need it, you may want to inhibit such a possibility ...
File NotificationSender.php
Replace:
$XS->SendNotification($notification,$uid);
with:
$XS->SendNotification(htmlentities($notification),$uid);
|
Applications that use this package |
|
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.