mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
- some cross-db related changes
- putting active bots array into cache git-svn-id: file:///svn/phpbb/trunk@5140 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -1116,6 +1116,36 @@ function obtain_attach_extensions(&$extensions, $forum_id = false)
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Obtain active bots
|
||||
*/
|
||||
function obtain_bots(&$bots)
|
||||
{
|
||||
global $db, $cache;
|
||||
|
||||
if ($cache->exists('bots'))
|
||||
{
|
||||
$bots = $cache->get('bots');
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = 'SELECT user_id, bot_agent, bot_ip
|
||||
FROM ' . BOTS_TABLE . '
|
||||
WHERE bot_active = 1';
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$bots[] = $row;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$cache->put('bots', $bots);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate board url
|
||||
*/
|
||||
|
Reference in New Issue
Block a user