mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-12 03:34:04 +02:00
- updated topic tracking code
- additional changes (mostly bugfixes) - bart, if you update your user table with the user_lastmark field, set it to the user_lastvisit value ;) - and last but not least, introducing some bugs in ucp main front (regarding topic tracking) git-svn-id: file:///svn/phpbb/trunk@5272 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -20,8 +20,12 @@ $cron_type = request_var('cron_type', '');
|
||||
|
||||
$use_shutdown_function = (@function_exists('register_shutdown_function')) ? true : false;
|
||||
|
||||
// Run cron-like action
|
||||
// Real cron-based layer will be introduced in 3.2
|
||||
/**
|
||||
* Run cron-like action
|
||||
* Real cron-based layer will be introduced in 3.2
|
||||
*
|
||||
* @todo: check gc-intervals here too (important!)
|
||||
*/
|
||||
switch ($cron_type)
|
||||
{
|
||||
case 'queue':
|
||||
@@ -35,7 +39,7 @@ switch ($cron_type)
|
||||
{
|
||||
$queue->process();
|
||||
}
|
||||
break;
|
||||
break;
|
||||
|
||||
case 'tidy_cache':
|
||||
if ($use_shutdown_function)
|
||||
@@ -46,7 +50,7 @@ switch ($cron_type)
|
||||
{
|
||||
$cache->tidy();
|
||||
}
|
||||
break;
|
||||
break;
|
||||
|
||||
case 'tidy_database':
|
||||
include_once($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
|
||||
@@ -59,17 +63,66 @@ switch ($cron_type)
|
||||
{
|
||||
tidy_database();
|
||||
}
|
||||
break;
|
||||
break;
|
||||
|
||||
case 'tidy_login_keys':
|
||||
case 'tidy_sessions':
|
||||
if ($use_shutdown_function)
|
||||
{
|
||||
register_shutdown_function(array(&$user, 'tidy_login_keys'));
|
||||
register_shutdown_function(array(&$user, 'session_gc'));
|
||||
}
|
||||
else
|
||||
{
|
||||
$user->tidy_login_keys();
|
||||
$user->session_gc();
|
||||
}
|
||||
break;
|
||||
|
||||
case 'prune_forum':
|
||||
|
||||
$forum_id = request_var('f', 0);
|
||||
|
||||
$sql = 'SELECT forum_id, prune_next, enable_prune, prune_days, prune_viewed, forum_flags, prune_freq
|
||||
FROM ' . FORUMS_TABLE . "
|
||||
WHERE forum_id = $forum_id";
|
||||
$result = $db->sql_query($sql);
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
if (!$row)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
// Do the forum Prune thang
|
||||
if ($row['prune_next'] < time() && $row['enable_prune'])
|
||||
{
|
||||
include_once($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
|
||||
|
||||
if ($row['prune_days'])
|
||||
{
|
||||
if ($use_shutdown_function)
|
||||
{
|
||||
register_shutdown_function('auto_prune', $row['forum_id'], 'posted', $row['forum_flags'], $row['prune_days'], $row['prune_freq']);
|
||||
}
|
||||
else
|
||||
{
|
||||
auto_prune($row['forum_id'], 'posted', $row['forum_flags'], $row['prune_days'], $row['prune_freq']);
|
||||
}
|
||||
}
|
||||
|
||||
if ($row['prune_viewed'])
|
||||
{
|
||||
if ($use_shutdown_function)
|
||||
{
|
||||
register_shutdown_function('auto_prune', $row['forum_id'], 'viewed', $row['forum_flags'], $row['prune_viewed'], $row['prune_freq']);
|
||||
}
|
||||
else
|
||||
{
|
||||
auto_prune($row['forum_id'], 'viewed', $row['forum_flags'], $row['prune_viewed'], $row['prune_freq']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// Output transparent gif
|
||||
|
Reference in New Issue
Block a user