Version 3.2.3
This commit is contained in:
1 parent
ae5c01cc78
commit
78706903a2
2641 files changed
+228363
-201264
No files matched your search
@@ -1,19 +1,14 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Task: Sends Mobile Notifications
|
||||
* Last Updated: $LastChangedDate$
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author$
|
||||
* @copyright (c) 2001 - 2010 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Members
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev$
|
||||
* @file mobile_notifications.php Task to send out mobile notifications
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: ips_terabyte $
|
||||
* @since -
|
||||
* $LastChangedDate: 2011-02-08 17:20:18 -0500 (Tue, 08 Feb 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 7750 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -22,66 +17,57 @@ if ( ! defined( 'IN_IPB' ) )
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @class task_item
|
||||
* @brief Task to send out mobile notifications
|
||||
*
|
||||
*/
|
||||
class task_item
|
||||
{
|
||||
/**
|
||||
* Parent task manager class
|
||||
* Object that stores the parent task manager class
|
||||
*
|
||||
* @var object
|
||||
* @var $class
|
||||
*/
|
||||
protected $class;
|
||||
|
||||
/**
|
||||
* This task data
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $task = array();
|
||||
|
||||
/**
|
||||
* Prevent logging
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
protected $restrict_log = false;
|
||||
|
||||
/**#@+
|
||||
/**
|
||||
* Array that stores the task data
|
||||
*
|
||||
* @var $task
|
||||
*/
|
||||
protected $task = array();
|
||||
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @var object
|
||||
* @var $registry
|
||||
* @var $DB
|
||||
* @var $settings
|
||||
* @var $lang
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $request;
|
||||
protected $lang;
|
||||
protected $member;
|
||||
protected $memberData;
|
||||
protected $cache;
|
||||
protected $caches;
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param object ipsRegistry reference
|
||||
* @param object Parent task class
|
||||
* @param array This task data
|
||||
* @return void
|
||||
* @param object $registry Registry object
|
||||
* @param object $class Task manager class object
|
||||
* @param array $task Array with the task data
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry, $class, $task )
|
||||
{
|
||||
/* Make registry objects */
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
|
||||
|
||||
$this->class = $class;
|
||||
$this->task = $task;
|
||||
}
|
||||
@@ -89,18 +75,20 @@ class task_item
|
||||
/**
|
||||
* Run this task
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function runTask()
|
||||
{
|
||||
/* INIT */
|
||||
$maxNotificationsToProcess = 250;
|
||||
$licenseKey = ipsRegistry::$settings['ipb_reg_number'];
|
||||
$forum = urlencode( $this->settings['board_name'] );
|
||||
$domain = urlencode( ipsRegistry::$settings['board_url'] );
|
||||
$apiBaseURL = "http://myipb.in/apn-server/index.php?api=addMessageToQueue&key={$licenseKey}&forum={$forum}&domain={$domain}";
|
||||
|
||||
/* Get the file managemnet class */
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classFileManagement.php', 'classFileManagement' );
|
||||
$query = new $classToLoad();
|
||||
$query->use_sockets = 1;
|
||||
|
||||
/* Get waiting notifications */
|
||||
$this->DB->build( array(
|
||||
@@ -133,7 +121,7 @@ class task_item
|
||||
}
|
||||
|
||||
/* Query the api */
|
||||
$response = '';
|
||||
$response = $query->getFileContents( "{$apiBaseURL}&ipsToken={$ipsToken}&message={$message}" );
|
||||
|
||||
/* Save the ID */
|
||||
$_sentIds[] = $r['id'];
|
||||
|
||||
Reference in new issue
Block a user