Version 3.1.4

This commit is contained in:
Neo committed 2025-12-19 00:32:22 -08:00
1 parent 1d4720f3e2
commit ae5c01cc78
2563 files changed
+283048 -240689

No files matched your search

@@ -1,19 +1,19 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.0.5
* IP.Board v3.1.4
* Moderator actions
* Last Updated: $Date: 2009-10-01 10:02:08 -0400 (Thu, 01 Oct 2009) $
* Last Updated: $Date: 2010-10-20 09:03:17 -0400 (Wed, 20 Oct 2010) $
* </pre>
*
* @author $Author: bfarber $
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link http://www.iinvisionpower.com
* @version $Revision: 5190 $
*
* @link http://www.invisionpower.com
* @version $Revision: 7003 $
*/
if ( ! defined( 'IN_IPB' ) )
@@ -27,7 +27,6 @@ class digestLibrary
/**
* Digest time
*
* @access public
* @var string daily|weekly
*/
public $digest_time = 'daily';
@@ -35,7 +34,6 @@ class digestLibrary
/**
* Digest type
*
* @access public
* @var string topic|forum
*/
public $digest_type = 'topic';
@@ -43,7 +41,6 @@ class digestLibrary
/**
* Midnight time
*
* @access public
* @var integer Timestamp
*/
public $midnight = 0;
@@ -51,7 +48,6 @@ class digestLibrary
/**
* Last week timestamp
*
* @access public
* @var integer Timestamp
*/
public $last_week = 0;
@@ -59,7 +55,6 @@ class digestLibrary
/**
* Yesterday timestamp
*
* @access public
* @var integer Timestamp
*/
public $last_day = 0;
@@ -67,7 +62,6 @@ class digestLibrary
/**
* Last time timestamp
*
* @access public
* @var integer Timestamp
*/
public $last_time = 0;
@@ -75,7 +69,6 @@ class digestLibrary
/**#@+
* Registry Object Shortcuts
*
* @access protected
* @var object
*/
protected $registry;
@@ -84,13 +77,14 @@ class digestLibrary
protected $request;
protected $lang;
protected $member;
protected $cache;
protected $memberData;
protected $cache;
protected $caches;
/**#@-*/
/**
* Constructor
*
* @access public
* @param object Registry reference
* @return void
*/
@@ -110,8 +104,8 @@ class digestLibrary
/* Check for class_forums */
if( ! $this->registry->isClassLoaded( 'class_forums' ) )
{
require_once( IPSLib::getAppDir( 'forums' ) . "/sources/classes/forums/class_forums.php" );
$this->registry->setClass( 'class_forums', new class_forums( $registry ) );
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . "/sources/classes/forums/class_forums.php", 'class_forums', 'forums' );
$this->registry->setClass( 'class_forums', new $classToLoad( $registry ) );
$this->registry->strip_invisible = 0;
$this->registry->class_forums->forumsInit();
}
@@ -144,7 +138,6 @@ class digestLibrary
/**
* Run the digest
*
* @access public
* @return void
*/
public function runDigest()
@@ -164,11 +157,17 @@ class digestLibrary
/**
* Run the digest
*
* @access private
* @return void
*/
private function _sendTopicDigest()
{
//-----------------------------------------
// Notifications library
//-----------------------------------------
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . '/sources/classes/member/notifications.php', 'notifications' );
$notifyLibrary = new $classToLoad( $this->registry );
//-----------------------------------------
// Get all posts / topics
//-----------------------------------------
@@ -293,28 +292,33 @@ class digestLibrary
if ( $others_posted )
{
$count++;
$trids[ $t['trid'] ] = intval( $t['trid'] );
//-----------------------------------------
// Send email...
// Send notification...
//-----------------------------------------
IPSText::getTextClass( 'email' )->getTemplate( $subject, $t['language'] );
IPSText::getTextClass('email')->getTemplate( $subject, $t['language'] );
IPSText::getTextClass( 'email' )->buildMessage( array(
'TOPIC_ID' => $t['tid'],
'FORUM_ID' => $t['forum_id'],
'TITLE' => $topic_title,
'NAME' => $t['members_display_name'],
'CONTENT' => $main_output,
'TOPIC_ID' => $t['tid'],
'FORUM_ID' => $t['forum_id'],
'TITLE' => $topic_title,
'NAME' => $t['members_display_name'],
'CONTENT' => $main_output,
) );
$notifyLibrary->setMember( $t );
$notifyLibrary->setFrom( array() );
$notifyLibrary->setNotificationKey( 'new_reply' );
$notifyLibrary->setNotificationText( IPSText::getTextClass('email')->message );
$notifyLibrary->setNotificationTitle( IPSText::getTextClass('email')->subject );
$this->DB->insert( 'mail_queue', array( 'mail_to' => $t['email'],
'mail_date' => time(),
'mail_from' => '',
'mail_subject' => IPSText::getTextClass( 'email' )->subject,
'mail_content' => IPSText::getTextClass( 'email' )->message ) );
try
{
$notifyLibrary->sendNotification();
}
catch( Exception $e ){}
}
}
@@ -324,25 +328,22 @@ class digestLibrary
{
$this->DB->update( 'tracker', array( 'last_sent' => time() ), 'trid IN (' . implode( ',', $trids ) . ')' );
}
$cache = ipsRegistry::cache()->getCache('systemvars');
$cache['mail_queue'] += $count;
//-----------------------------------------
// Update cache with remaning email count
//-----------------------------------------
ipsRegistry::cache()->setCache( 'systemvars', $cache, array( 'array' => 1, 'donow' => 1 ) );
}
/**
* Run the digest
*
* @access private
* @return void
*/
private function _sendForumDigest()
{
//-----------------------------------------
// Notifications library
//-----------------------------------------
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . '/sources/classes/member/notifications.php', 'notifications' );
$notifyLibrary = new $classToLoad( $this->registry );
//-----------------------------------------
// Get all posts / topics
//-----------------------------------------
@@ -456,27 +457,32 @@ class digestLibrary
if ( $others_posted )
{
$count++;
$frids[ $t['frid'] ] = intval( $t['frid'] );
//-----------------------------------------
// Send email...
// Send notification...
//-----------------------------------------
IPSText::getTextClass( 'email' )->getTemplate( $subject, $t['language'] );
IPSText::getTextClass('email')->getTemplate( $subject, $t['language'] );
IPSText::getTextClass( 'email' )->buildMessage( array(
'FORUM_ID' => $t['forum_id'],
'FORUM_NAME' => $forum_name,
'NAME' => $t['members_display_name'],
'CONTENT' => $main_output,
) );
) );
$notifyLibrary->setMember( $t );
$notifyLibrary->setFrom( array() );
$notifyLibrary->setNotificationKey( 'new_topic' );
$notifyLibrary->setNotificationText( IPSText::getTextClass('email')->message );
$notifyLibrary->setNotificationTitle( IPSText::getTextClass('email')->subject );
$this->DB->insert( 'mail_queue', array( 'mail_to' => $t['email'],
'mail_date' => time(),
'mail_from' => '',
'mail_subject' => IPSText::getTextClass( 'email' )->subject,
'mail_content' => IPSText::getTextClass( 'email' )->message ) );
try
{
$notifyLibrary->sendNotification();
}
catch( Exception $e ){}
}
}
@@ -486,15 +492,5 @@ class digestLibrary
{
$this->DB->update( 'forum_tracker', array( 'last_sent' => time() ), 'frid IN (' . implode( ',', $frids ) . ')' );
}
$cache = ipsRegistry::cache()->getCache('systemvars');
$cache['mail_queue'] += $count;
//-----------------------------------------
// Update cache with remaning email count
//-----------------------------------------
ipsRegistry::cache()->setCache( 'systemvars', $cache, array( 'array' => 1, 'donow' => 1 ) );
}
}