Version 2.1.7
This commit is contained in:
1 parent
0eecc172d9
commit
f73f8bff6d
941 files changed
+215301
-103093
No files matched your search
@@ -2,16 +2,28 @@
|
||||
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Board v2.0.0
|
||||
| Invision Power Board 2.1.7
|
||||
| =============================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2004 Invision Power Services, Inc.
|
||||
| (c) 2001 - 2005 Invision Power Services, Inc.
|
||||
| http://www.invisionpower.com
|
||||
| =============================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| Time: Tue, 21 Sep 2004 16:34:28 GMT
|
||||
| Release: 150aa7a702c3c8b6f6eb90ad49305d2f
|
||||
| http://www.ibresource.ru/products/invisionpowerboard/
|
||||
| Time: Tuesday 18th of July 2006 05:56:00 PM
|
||||
| Release: 52f408a29988b02f45b5e6f4ba5af0ae
|
||||
| Licence Info: http://www.invisionboard.com/?license
|
||||
| http://www.ibresource.ru/license
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER BOARD IS NOT FREE / OPEN SOURCE!
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
|
||||
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
|
||||
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
|
||||
+---------------------------------------------------------------------------
|
||||
| > $Date: 2005-10-10 14:08:54 +0100 (Mon, 10 Oct 2005) $
|
||||
| > $Revision: 23 $
|
||||
| > $Author: matt $
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > TASK SCRIPT: Test
|
||||
@@ -28,7 +40,7 @@
|
||||
|
||||
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.";
|
||||
print "<h1>Íåêîððåêòíûé àäðåñ</h1>Âû íå èìååòå äîñòóïà ê ýòîìó ôàéëó íàïðÿìóþ. Åñëè âû íåäàâíî îáíîâëÿëè ôîðóì, âû äîëæíû îáíîâèòü âñå ñîîòâåòñòâóþùèå ôàéëû.";
|
||||
exit();
|
||||
}
|
||||
|
||||
@@ -46,113 +58,17 @@ class task_item
|
||||
|
||||
function run_task()
|
||||
{
|
||||
global $DB, $ibforums, $std;
|
||||
|
||||
//-----------------------------------------
|
||||
// Cache calendar info
|
||||
// Load and recache info
|
||||
//-----------------------------------------
|
||||
|
||||
$calendar = array();
|
||||
$birthdays = array();
|
||||
define( 'IN_ACP', 1 );
|
||||
|
||||
$a = explode( ',', gmdate( 'Y,n,j,G,i,s', time() ) );
|
||||
require_once( ROOT_PATH . 'sources/action_admin/calendars.php' );
|
||||
$calendars = new ad_calendars();
|
||||
$calendars->ipsclass =& $this->ipsclass;
|
||||
|
||||
$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)) ) );
|
||||
$calendars->calendar_rebuildcache( 0 );
|
||||
|
||||
//-----------------------------------------
|
||||
// Log to log table - modify but dont delete
|
||||
@@ -160,8 +76,14 @@ class task_item
|
||||
|
||||
if ( ! $this->restrict_log )
|
||||
{
|
||||
$this->class->append_task_log( $this->task, intval(count($birthdays))." birthdays cached, ".intval(count($calendar))." events cached" );
|
||||
$this->class->append_task_log( $this->task, "Êåø êàëåíäàðÿ îáíîâëåí" );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Unlock Task: DO NOT MODIFY!
|
||||
//-----------------------------------------
|
||||
|
||||
$this->class->unlock_task( $this->task );
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
@@ -171,8 +93,8 @@ class task_item
|
||||
|
||||
function register_class(&$class)
|
||||
{
|
||||
$this->class = $class;
|
||||
|
||||
$this->class = $class;
|
||||
$this->ipsclass =& $class->ipsclass;
|
||||
$this->root_path = $this->class->root_path;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user