Version 2.0.0

This commit is contained in:
Neo committed 2025-12-19 00:19:56 -08:00
1 parent 5699abfc0e
commit 0eecc172d9
696 files changed
+120723 -77160

No files matched your search

+90
View File
@@ -0,0 +1,90 @@
<?php
/*
+--------------------------------------------------------------------------
| Invision Power Board v2.0.0
| =============================================
| by Matthew Mecham
| (c) 2001 - 2004 Invision Power Services, Inc.
| http://www.invisionpower.com
| =============================================
| Web: http://www.invisionboard.com
| Time: Tue, 21 Sep 2004 16:34:28 GMT
| Release: 150aa7a702c3c8b6f6eb90ad49305d2f
| Licence Info: http://www.invisionboard.com/?license
+---------------------------------------------------------------------------
|
| > TASK SCRIPT: Test
| > Script written by Matt Mecham
| > Date started: 28th January 2004
|
+--------------------------------------------------------------------------
*/
//-----------------------------------------
// THIS TASKS OPERATIONS:
// Clean out 'dead' sessions, validations, registration image entires, etc
//+--------------------------------------------------------------------------
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
exit();
}
class task_item
{
var $class = "";
var $root_path = "";
var $task = "";
/*-------------------------------------------------------------------------*/
// Our 'auto_run' function
// ADD CODE HERE
/*-------------------------------------------------------------------------*/
function run_task()
{
global $DB, $ibforums, $std;
//-----------------------------------------
// Deactivate expired announcements
//-----------------------------------------
require_once( $this->root_path.'sources/announcements.php' );
$announce = new announcements();
$announce->announce_retire_expired();
//-----------------------------------------
// Log to log table - modify but dont delete
//-----------------------------------------
$this->class->append_task_log( $this->task, 'Announcements updated' );
}
/*-------------------------------------------------------------------------*/
// register_class
// LEAVE ALONE
/*-------------------------------------------------------------------------*/
function register_class(&$class)
{
$this->class = $class;
$this->root_path = $this->class->root_path;
}
/*-------------------------------------------------------------------------*/
// pass_task
// LEAVE ALONE
/*-------------------------------------------------------------------------*/
function pass_task( $this_task )
{
$this->task = $this_task;
}
}
?>
+86
View File
@@ -0,0 +1,86 @@
<?php
/*
+--------------------------------------------------------------------------
| Invision Power Board v2.0.0
| =============================================
| by Matthew Mecham
| (c) 2001 - 2004 Invision Power Services, Inc.
| http://www.invisionpower.com
| =============================================
| Web: http://www.invisionboard.com
| Time: Tue, 21 Sep 2004 16:34:28 GMT
| Release: 150aa7a702c3c8b6f6eb90ad49305d2f
| Licence Info: http://www.invisionboard.com/?license
+---------------------------------------------------------------------------
|
| > TASK SCRIPT: Send Bulk Mail
| > Script written by Matt Mecham
| > Date started: 28th January 2004
|
+--------------------------------------------------------------------------
*/
//-----------------------------------------
// THIS TASKS OPERATIONS:
// Sends out bulk mail
//+--------------------------------------------------------------------------
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
exit();
}
class task_item
{
var $class = "";
var $root_path = "";
var $task = "";
/*-------------------------------------------------------------------------*/
// Our 'auto_run' function
// ADD CODE HERE
/*-------------------------------------------------------------------------*/
function run_task()
{
global $DB, $ibforums, $std;
define( 'IN_ACP', 1 );
//-----------------------------------------
// Load Bulk Mailer thing
//-----------------------------------------
require_once( $this->root_path.'sources/admin/ad_postoffice.php' );
$po = new ad_postoffice();
$po->mail_send_process( $this->root_path );
}
/*-------------------------------------------------------------------------*/
// register_class
// LEAVE ALONE
/*-------------------------------------------------------------------------*/
function register_class(&$class)
{
$this->class = $class;
$this->root_path = $this->class->root_path;
}
/*-------------------------------------------------------------------------*/
// pass_task
// LEAVE ALONE
/*-------------------------------------------------------------------------*/
function pass_task( $this_task )
{
$this->task = $this_task;
}
}
?>
+191
View File
@@ -0,0 +1,191 @@
<?php
/*
+--------------------------------------------------------------------------
| Invision Power Board v2.0.0
| =============================================
| by Matthew Mecham
| (c) 2001 - 2004 Invision Power Services, Inc.
| http://www.invisionpower.com
| =============================================
| Web: http://www.invisionboard.com
| Time: Tue, 21 Sep 2004 16:34:28 GMT
| Release: 150aa7a702c3c8b6f6eb90ad49305d2f
| Licence Info: http://www.invisionboard.com/?license
+---------------------------------------------------------------------------
|
| > TASK SCRIPT: Test
| > Script written by Matt Mecham
| > Date started: 28th January 2004
|
+--------------------------------------------------------------------------
*/
//-----------------------------------------
// THIS TASKS OPERATIONS:
// Gathers birthday and calendar events for a few days and caches them
//+--------------------------------------------------------------------------
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
exit();
}
class task_item
{
var $class = "";
var $root_path = "";
var $task = "";
var $restrict_log = 0;
/*-------------------------------------------------------------------------*/
// Our 'auto_run' function
// ADD CODE HERE
/*-------------------------------------------------------------------------*/
function run_task()
{
global $DB, $ibforums, $std;
//-----------------------------------------
// Cache calendar info
//-----------------------------------------
$calendar = array();
$birthdays = array();
$a = explode( ',', gmdate( 'Y,n,j,G,i,s', time() ) );
$day = $a[2];
$month = $a[1];
$year = $a[0];
$daysinmonth = date( 't', time() );
//-----------------------------------------
// Get 24hr before and 24hr after to make
// sure we don't break any timezones
//-----------------------------------------
$last_day = $day - 1;
$last_month = $month;
$last_year = $year;
$next_day = $day + 1;
$next_month = $month;
$next_year = $year;
//-----------------------------------------
// Calculate dates..
//-----------------------------------------
if ( $last_day == 0 )
{
$last_month -= 1;
$last_day = date( 't', time() - 86400 );
}
if ( $last_month == 0 )
{
$last_month = 12;
$last_year -= 1;
}
if ( $next_day > date( 't', time() ) )
{
$next_month += 1;
$next_day = 1;
}
if ( $next_month == 13 )
{
$next_month = 1;
$next_year += 1;
}
//-----------------------------------------
// Grab birthdays
//-----------------------------------------
$DB->simple_construct( array( 'select' => 'id, name, mgroup, bday_day, bday_month, bday_year',
'from' => 'members',
'where' => "( bday_day=$last_day AND bday_month=$last_month )
or ( bday_day=$day AND bday_month=$month )
or ( bday_day=$next_day AND bday_month=$next_month )"
) );
$DB->simple_exec();
while ( $r = $DB->fetch_row() )
{
$birthdays[ $r['id'] ] = $r;
}
//-----------------------------------------
// Grab Calendar (-24hr + 24hr)
//-----------------------------------------
if ($ibforums->vars['calendar_limit'] < 2)
{
$ibforums->vars['calendar_limit'] = 2;
}
$our_unix = time() - 86400;
$max_date = $our_unix + ( ($ibforums->vars['calendar_limit'] + 1 ) * 86400);
$DB->simple_construct( array( 'select' => 'eventid, title, read_perms, priv_event, userid, unix_stamp',
'from' => 'calendar_events',
'where' => "unix_stamp > $our_unix and unix_stamp < $max_date",
'order' => "unix_stamp"
) );
$DB->simple_exec();
while ( $r = $DB->fetch_row() )
{
$calendar[ $r['eventid'] ] = $r;
}
//-----------------------------------------
// Save...
//-----------------------------------------
$DB->simple_exec_query( array( 'delete' => 'cache_store', 'where' => "cs_key IN ('birthdays', 'calendar')" ) );
$DB->do_insert( 'cache_store', array( 'cs_array' => 1, 'cs_key' => 'birthdays', 'cs_value' => addslashes(serialize($birthdays)) ) );
$DB->do_insert( 'cache_store', array( 'cs_array' => 1, 'cs_key' => 'calendar' , 'cs_value' => addslashes(serialize($calendar)) ) );
//-----------------------------------------
// Log to log table - modify but dont delete
//-----------------------------------------
if ( ! $this->restrict_log )
{
$this->class->append_task_log( $this->task, intval(count($birthdays))." birthdays cached, ".intval(count($calendar))." events cached" );
}
}
/*-------------------------------------------------------------------------*/
// register_class
// LEAVE ALONE
/*-------------------------------------------------------------------------*/
function register_class(&$class)
{
$this->class = $class;
$this->root_path = $this->class->root_path;
}
/*-------------------------------------------------------------------------*/
// pass_task
// LEAVE ALONE
/*-------------------------------------------------------------------------*/
function pass_task( $this_task )
{
$this->task = $this_task;
}
}
?>
+105
View File
@@ -0,0 +1,105 @@
<?php
/*
+--------------------------------------------------------------------------
| Invision Power Board v2.0.0
| =============================================
| by Matthew Mecham
| (c) 2001 - 2004 Invision Power Services, Inc.
| http://www.invisionpower.com
| =============================================
| Web: http://www.invisionboard.com
| Time: Tue, 21 Sep 2004 16:34:28 GMT
| Release: 150aa7a702c3c8b6f6eb90ad49305d2f
| Licence Info: http://www.invisionboard.com/?license
+---------------------------------------------------------------------------
|
| > TASK SCRIPT: Test
| > Script written by Matt Mecham
| > Date started: 28th January 2004
|
+--------------------------------------------------------------------------
*/
//-----------------------------------------
// THIS TASKS OPERATIONS:
// Clean out 'dead' sessions, validations, registration image entires, etc
//+--------------------------------------------------------------------------
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
exit();
}
class task_item
{
var $class = "";
var $root_path = "";
var $task = "";
/*-------------------------------------------------------------------------*/
// Our 'auto_run' function
// ADD CODE HERE
/*-------------------------------------------------------------------------*/
function run_task()
{
global $DB, $ibforums, $std;
//-----------------------------------------
// Delete reg_anti_spam
//-----------------------------------------
$date = time() - (60*60*6);
$DB->simple_exec_query( array( 'delete' => 'reg_antispam', 'where' => 'ctime < '.$date ) );
//-----------------------------------------
// Delete old sessions
//-----------------------------------------
$date = $ibforums->vars['session_expiration'] ? (time() - $ibforums->vars['session_expiration']) : (time() - 3600);
$DB->simple_exec_query( array( 'delete' => 'sessions', 'where' => "running_time < {$date}" ) );
//-----------------------------------------
// Delete old searches
//-----------------------------------------
$date = time() - (60*60*24);
$DB->simple_exec_query( array( 'delete' => 'search_results', 'where' => "search_date < {$date}" ) );
//-----------------------------------------
// Log to log table - modify but dont delete
//-----------------------------------------
$this->class->append_task_log( $this->task, 'Old reg_images, sessions and search results removed' );
}
/*-------------------------------------------------------------------------*/
// register_class
// LEAVE ALONE
/*-------------------------------------------------------------------------*/
function register_class(&$class)
{
$this->class = $class;
$this->root_path = $this->class->root_path;
}
/*-------------------------------------------------------------------------*/
// pass_task
// LEAVE ALONE
/*-------------------------------------------------------------------------*/
function pass_task( $this_task )
{
$this->task = $this_task;
}
}
?>
+123
View File
@@ -0,0 +1,123 @@
<?php
/*
+--------------------------------------------------------------------------
| Invision Power Board v2.0.0
| =============================================
| by Matthew Mecham
| (c) 2001 - 2004 Invision Power Services, Inc.
| http://www.invisionpower.com
| =============================================
| Web: http://www.invisionboard.com
| Time: Tue, 21 Sep 2004 16:34:28 GMT
| Release: 150aa7a702c3c8b6f6eb90ad49305d2f
| Licence Info: http://www.invisionboard.com/?license
+---------------------------------------------------------------------------
|
| > TASK SCRIPT: Test
| > Script written by Matt Mecham
| > Date started: 28th January 2004
|
+--------------------------------------------------------------------------
*/
//-----------------------------------------
// THIS TASKS OPERATIONS:
// Prunes back subscribed topics...
//+--------------------------------------------------------------------------
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
exit();
}
class task_item
{
var $class = "";
var $root_path = "";
var $task = "";
/*-------------------------------------------------------------------------*/
// Our 'auto_run' function
// ADD CODE HERE
/*-------------------------------------------------------------------------*/
function run_task()
{
global $DB, $ibforums, $std;
//-----------------------------------------
// Delete old subscriptions
//-----------------------------------------
$deleted = 0;
$trids = array();
if ($ibforums->vars['subs_autoprune'] > 0)
{
$time = time() - ($ibforums->vars['subs_autoprune'] * 86400);
$DB->cache_add_query( 'ucp_tracker_prune', array( 'time' => $time ) );
$DB->cache_exec_query();
while ( $r = $DB->fetch_row() )
{
$trids[] = $r['trid'];
}
if (count($trids) > 0)
{
$DB->simple_exec_query( array( 'delete', 'tracker', 'where' => "trid IN (".implode(",",$trids).")" ) );
}
$deleted = intval( count($trids) );
}
//-----------------------------------------
// Remove read topics
//-----------------------------------------
$ibforums->vars['db_topic_read_cutoff'] = intval($ibforums->vars['db_topic_read_cutoff']);
if ( $ibforums->vars['db_topic_read_cutoff'] > 0 )
{
$time = time() - ( $ibforums->vars['db_topic_read_cutoff'] * 86400 );
$DB->simple_exec_query( array( 'delete' => 'topics_read', 'where' => "read_date < $time" ) );
$topics_deleted = $DB->get_affected_rows();
}
//-----------------------------------------
// Log to log table - modify but dont delete
//-----------------------------------------
$this->class->append_task_log( $this->task, "$deleted subscriptions pruned and {$topics_deleted} db read topic entries deleted" );
}
/*-------------------------------------------------------------------------*/
// register_class
// LEAVE ALONE
/*-------------------------------------------------------------------------*/
function register_class(&$class)
{
$this->class = $class;
$this->root_path = $this->class->root_path;
}
/*-------------------------------------------------------------------------*/
// pass_task
// LEAVE ALONE
/*-------------------------------------------------------------------------*/
function pass_task( $this_task )
{
$this->task = $this_task;
}
}
?>
+96
View File
@@ -0,0 +1,96 @@
<?php
/*
+--------------------------------------------------------------------------
| Invision Power Board v2.0.0
| =============================================
| by Matthew Mecham
| (c) 2001 - 2004 Invision Power Services, Inc.
| http://www.invisionpower.com
| =============================================
| Web: http://www.invisionboard.com
| Time: Tue, 21 Sep 2004 16:34:28 GMT
| Release: 150aa7a702c3c8b6f6eb90ad49305d2f
| Licence Info: http://www.invisionboard.com/?license
+---------------------------------------------------------------------------
|
| > TASK SCRIPT: Test
| > Script written by Matt Mecham
| > Date started: 28th January 2004
|
+--------------------------------------------------------------------------
*/
//-----------------------------------------
// THIS TASKS OPERATIONS:
// Clean out 'dead' sessions, validations, registration image entires, etc
//+--------------------------------------------------------------------------
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
exit();
}
class task_item
{
var $class = "";
var $root_path = "";
var $task = "";
/*-------------------------------------------------------------------------*/
// Our 'auto_run' function
// ADD CODE HERE
/*-------------------------------------------------------------------------*/
function run_task()
{
global $DB, $ibforums, $std;
//-----------------------------------------
// Send daily digests...
//-----------------------------------------
require_once( $this->root_path.'sources/lib/digest_functions.php' );
$digest = new digest_functions();
$digest->digest_time = 'daily';
$digest->digest_type = 'topic';
$digest->run_digest();
$digest->digest_time = 'daily';
$digest->digest_type = 'forum';
$digest->run_digest();
//-----------------------------------------
// Log to log table - modify but dont delete
//-----------------------------------------
$this->class->append_task_log( $this->task, 'Daily Topic & Forum Digest Sent' );
}
/*-------------------------------------------------------------------------*/
// register_class
// LEAVE ALONE
/*-------------------------------------------------------------------------*/
function register_class(&$class)
{
$this->class = $class;
$this->root_path = $this->class->root_path;
}
/*-------------------------------------------------------------------------*/
// pass_task
// LEAVE ALONE
/*-------------------------------------------------------------------------*/
function pass_task( $this_task )
{
$this->task = $this_task;
}
}
?>
+121
View File
@@ -0,0 +1,121 @@
<?php
/*
+--------------------------------------------------------------------------
| Invision Power Board v2.0.0
| =============================================
| by Matthew Mecham
| (c) 2001 - 2004 Invision Power Services, Inc.
| http://www.invisionpower.com
| =============================================
| Web: http://www.invisionboard.com
| Time: Tue, 21 Sep 2004 16:34:28 GMT
| Release: 150aa7a702c3c8b6f6eb90ad49305d2f
| Licence Info: http://www.invisionboard.com/?license
+---------------------------------------------------------------------------
|
| > TASK SCRIPT: Test
| > Script written by Matt Mecham
| > Date started: 28th January 2004
|
+--------------------------------------------------------------------------
*/
//-----------------------------------------
// THIS TASKS OPERATIONS:
// Rebuilds topics, posts, forum, members, last reg. member counts
//+--------------------------------------------------------------------------
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
exit();
}
class task_item
{
var $class = "";
var $root_path = "";
var $task = "";
/*-------------------------------------------------------------------------*/
// Our 'auto_run' function
// ADD CODE HERE
/*-------------------------------------------------------------------------*/
function run_task()
{
global $DB, $ibforums, $std;
//-----------------------------------------
// Get current stats...
//-----------------------------------------
$stats = $DB->simple_exec_query( array( 'select' => '*', 'from' => 'cache_store', 'where' => "cs_key='stats'" ) );
$stats = unserialize(stripslashes($stats['cs_value']));
//-----------------------------------------
// Rebuild stats
//-----------------------------------------
$r = $DB->simple_exec_query( array( 'select' => 'count(*) as posts', 'from' => 'posts', 'where' => 'queued <> 1' ) );
$stats['total_replies'] = intval($r['posts']);
$r = $DB->simple_exec_query( array( 'select' => 'count(*) as topics', 'from' => 'topics', 'where' => 'approved = 1' ) );
$stats['total_topics'] = intval($r['topics']);
$stats['total_replies'] -= $stats['total_topics'];
$r = $DB->simple_exec_query( array( 'select' => 'count(*) as members', 'from' => 'members', 'where' => "mgroup <> ".$ibforums->vars['auth_group'] ) );
$stats['mem_count'] = intval( $r['members'] );
$r = $DB->simple_exec_query( array( 'select' => 'id, name',
'from' => 'members',
'where' => "mgroup <> ".$ibforums->vars['auth_group'],
'order' => 'id DESC',
'limit' => array(0,1)
) );
$stats['last_mem_name'] = $r['name'];
$stats['last_mem_id'] = $r['id'];
if ( count($stats) > 0 )
{
$DB->obj['use_shutdown'] = 0;
$ibforums->cache['stats'] = $stats;
$std->update_cache( array( 'name' => 'stats', 'array' => 1, 'deletefirst' => 1 ) );
}
//-----------------------------------------
// Log to log table - modify but dont delete
//-----------------------------------------
$this->class->append_task_log( $this->task, 'Statistics rebuilt' );
}
/*-------------------------------------------------------------------------*/
// register_class
// LEAVE ALONE
/*-------------------------------------------------------------------------*/
function register_class(&$class)
{
$this->class = $class;
$this->root_path = $this->class->root_path;
}
/*-------------------------------------------------------------------------*/
// pass_task
// LEAVE ALONE
/*-------------------------------------------------------------------------*/
function pass_task( $this_task )
{
$this->task = $this_task;
}
}
?>
+96
View File
@@ -0,0 +1,96 @@
<?php
/*
+--------------------------------------------------------------------------
| Invision Power Board v2.0.0
| =============================================
| by Matthew Mecham
| (c) 2001 - 2004 Invision Power Services, Inc.
| http://www.invisionpower.com
| =============================================
| Web: http://www.invisionboard.com
| Time: Tue, 21 Sep 2004 16:34:28 GMT
| Release: 150aa7a702c3c8b6f6eb90ad49305d2f
| Licence Info: http://www.invisionboard.com/?license
+---------------------------------------------------------------------------
|
| > TASK SCRIPT: Test
| > Script written by Matt Mecham
| > Date started: 28th January 2004
|
+--------------------------------------------------------------------------
*/
//-----------------------------------------
// THIS TASKS OPERATIONS:
// Clean out 'dead' sessions, validations, registration image entires, etc
//+--------------------------------------------------------------------------
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
exit();
}
class task_item
{
var $class = "";
var $root_path = "";
var $task = "";
/*-------------------------------------------------------------------------*/
// Our 'auto_run' function
// ADD CODE HERE
/*-------------------------------------------------------------------------*/
function run_task()
{
global $DB, $ibforums, $std;
//-----------------------------------------
// Send daily digests...
//-----------------------------------------
require_once( $this->root_path.'sources/lib/digest_functions.php' );
$digest = new digest_functions();
$digest->digest_time = 'weekly';
$digest->digest_type = 'topic';
$digest->run_digest();
$digest->digest_time = 'weekly';
$digest->digest_type = 'forum';
$digest->run_digest();
//-----------------------------------------
// Log to log table - modify but dont delete
//-----------------------------------------
$this->class->append_task_log( $this->task, 'Weekly Topic & Forum Digest Sent' );
}
/*-------------------------------------------------------------------------*/
// register_class
// LEAVE ALONE
/*-------------------------------------------------------------------------*/
function register_class(&$class)
{
$this->class = $class;
$this->root_path = $this->class->root_path;
}
/*-------------------------------------------------------------------------*/
// pass_task
// LEAVE ALONE
/*-------------------------------------------------------------------------*/
function pass_task( $this_task )
{
$this->task = $this_task;
}
}
?>