diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2005-05-05 16:55:05 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2005-05-05 16:55:05 +0000 |
commit | b576d6af0a9c0c78f379ca09069648d87364e1a0 (patch) | |
tree | eb73ff0919d865a420a2dd4cc71409f59da76ebd /phpBB/includes/functions.php | |
parent | 16e50db4baf39877fe3e02a13dfc57983b12f414 (diff) | |
download | forums-b576d6af0a9c0c78f379ca09069648d87364e1a0.tar forums-b576d6af0a9c0c78f379ca09069648d87364e1a0.tar.gz forums-b576d6af0a9c0c78f379ca09069648d87364e1a0.tar.bz2 forums-b576d6af0a9c0c78f379ca09069648d87364e1a0.tar.xz forums-b576d6af0a9c0c78f379ca09069648d87364e1a0.zip |
- some cross-db related changes
- putting active bots array into cache
git-svn-id: file:///svn/phpbb/trunk@5140 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions.php')
-rw-r--r-- | phpBB/includes/functions.php | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 4c749eb354..d5accb90cf 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -1117,6 +1117,36 @@ function obtain_attach_extensions(&$extensions, $forum_id = false) } /** +* 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 */ function generate_board_url() |