[ticket/305] Add fetch_posts service as replacement for phpbb_fetch_posts

B3P-305
This commit is contained in:
Marc Alexander
2014-07-12 23:16:18 +02:00
parent ac88dde05b
commit 9922b6a7a7
4 changed files with 928 additions and 0 deletions

View File

@@ -55,3 +55,13 @@ services:
class: board3\portal\includes\modules_helper
arguments:
- @auth
board3.portal.fetch_posts:
class: board3\portal\portal\fetch_posts
arguments:
- @auth
- @cache
- @config
- @dbal.conn
- @board3.portal.modules_helper
- @user

466
portal/fetch_posts.php Normal file
View File

@@ -0,0 +1,466 @@
<?php
/**
*
* @package Board3 Portal v2.1
* @copyright (c) 2014 Board3 Group ( www.board3.de )
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
namespace board3\portal\portal;
class fetch_posts
{
/**
* phpBB auth
* @var \phpbb\auth\auth
*/
protected $auth;
/**
* phpBB cache
* @var \phpbb\cache\driver
*/
protected $cache;
/**
* phpBB config
* @var \phpbb\config\config
*/
protected $config;
/**
* phpBB db driver
* @var \phpbb\db\driver_interface
*/
protected $db;
/**
* Modules helper
* @var \board3\portal\includes\modules_helper
*/
protected $modules_helper;
/**
* phpBB user
* @var \phpbb\user
*/
protected $user;
/**
* SQL Query where constraint
* @var string
*/
protected $where_string = '';
/**
* SQL topic type constraint
* @var string
*/
protected $topic_type = '';
/**
* SQL user link constraint
* @var string
*/
protected $user_link = '';
/**
* SQL post link constraint
* @var string
*/
protected $post_link = '';
/**
* SQL topic order constraint
* @var string
*/
protected $topic_order = '';
/**
* Module ID
* @var int
*/
protected $module_id;
/**
* Forum ID to use for global topics
* @var int
*/
protected $global_id;
/**
* Type of posts to fetch
* @var string
*/
protected $type;
/**
* Constructor
* NOTE: The parameters of this method must match in order and type with
* the dependencies defined in the services.yml file for this service.
* @param \phpbb\auth\auth $auth phpBB auth object
* @param \phpbb\cache\driver $cache phpBB cache driver
* @param \phpbb\config\config $config phpBB config
* @param \phpbb\db\driver_interface $db phpBB database driver
* @param \board3\portal\includes\modules_helper $modules_helper Board3 modules helper
* @param \phpbb\user $user phpBB user object
*/
public function __construct($auth, $cache, $config, $db, $modules_helper, $user)
{
$this->auth = $auth;
$this->cache = $cache;
$this->config = $config;
$this->db = $db;
$this->modules_helper = $modules_helper;
$this->user = $user;
}
/**
* Get posts defined by type and other settings
*
*/
public function get_posts($forum_from, $permissions, $number_of_posts, $text_length, $time, $type, $start = 0, $invert = false)
{
$posts = $update_count = array();
$post_time = ($time == 0) ? '' : 'AND t.topic_time > ' . (time() - $time * 86400);
$forum_from = (strpos($forum_from, ',') !== false) ? explode(',', $forum_from) : (($forum_from != '') ? array($forum_from) : array());
$topic_icons = array(0);
$have_icons = 0;
$this->global_id = 0;
$this->type = $type;
$this->reset_constraints();
// Get disallowed forums
$disallow_access = $this->modules_helper->get_disallowed_forums($permissions);
// Set forums that should be excluded or included
if (!$this->set_forum_constraints($forum_from, $disallow_access, $invert))
{
return array();
}
// Get SQL constraints
$this->get_type_constraints();
// Get global forum ID for announcements
if (!$this->get_global_id())
{
return array();
}
$sql_array = array(
'SELECT' => 't.forum_id,
t.topic_id,
t.topic_last_post_id,
t.topic_last_post_time,
t.topic_time,
t.topic_title,
t.topic_attachment,
t.topic_views,
t.poll_title,
t.topic_posts_approved,
t.topic_posts_unapproved,
t.topic_posts_softdeleted,
t.topic_poster,
t.topic_type,
t.topic_status,
t.topic_last_poster_name,
t.topic_last_poster_id,
t.topic_last_poster_colour,
t.icon_id,
u.username,
u.user_id,
u.user_type,
u.user_colour,
p.post_id,
p.poster_id,
p.post_time,
p.post_text,
p.post_attachment,
p.post_username,
p.enable_smilies,
p.enable_bbcode,
p.enable_magic_url,
p.bbcode_bitfield,
p.bbcode_uid,
f.forum_name,
f.enable_icons',
'FROM' => array(
TOPICS_TABLE => 't',
),
'LEFT_JOIN' => array(
array(
'FROM' => array(USERS_TABLE => 'u'),
'ON' => $this->user_link,
),
array(
'FROM' => array(FORUMS_TABLE => 'f'),
'ON' => 't.forum_id=f.forum_id',
),
array(
'FROM' => array(POSTS_TABLE => 'p'),
'ON' => $this->post_link,
),
),
'WHERE' => $this->topic_type . '
' . $post_time . '
AND t.topic_status <> ' . ITEM_MOVED . '
AND t.topic_visibility = 1
AND t.topic_moved_id = 0
' . $this->where_string,
'ORDER_BY' => $this->topic_order,
);
$sql_array['LEFT_JOIN'][] = array('FROM' => array(TOPICS_POSTED_TABLE => 'tp'), 'ON' => 'tp.topic_id = t.topic_id AND tp.user_id = ' . $this->user->data['user_id']);
$sql_array['SELECT'] .= ', tp.topic_posted';
$sql = $this->db->sql_build_query('SELECT', $sql_array);
if ($number_of_posts != 0)
{
$result = $this->db->sql_query_limit($sql, $number_of_posts, $start);
}
else
{
$result = $this->db->sql_query($sql);
}
$i = 0;
while ($row = $this->db->sql_fetchrow($result))
{
$attachments = array();
if (($this->auth->acl_get('u_download') && ($this->auth->acl_get('f_download', $row['forum_id']) || $row['forum_id'] == 0)) && $this->config['allow_attachments'] && $row['post_id'] && $row['post_attachment'])
{
// Pull attachment data
$sql2 = 'SELECT *
FROM ' . ATTACHMENTS_TABLE . '
WHERE post_msg_id = '. $row['post_id'] .'
AND in_message = 0
ORDER BY filetime DESC';
$result2 = $this->db->sql_query($sql2);
while ($row2 = $this->db->sql_fetchrow($result2))
{
$attachments[] = $row2;
}
$this->db->sql_freeresult($result2);
}
$posts[$i]['bbcode_uid'] = $row['bbcode_uid'];
$len_check = $row['post_text'];
$maxlen = $text_length;
if (($text_length != 0) && (strlen($len_check) > $text_length))
{
$message = str_replace(array("\n", "\r"), array('<br />', "\n"), $row['post_text']);
$message = get_sub_taged_string($message, $row['bbcode_uid'], $maxlen);
$posts[$i]['striped'] = true;
}
else
{
$message = str_replace("\n", '<br/> ', $row['post_text']);
}
$row['bbcode_options'] = (($row['enable_bbcode']) ? OPTION_FLAG_BBCODE : 0) + (($row['enable_smilies']) ? OPTION_FLAG_SMILIES : 0) + (($row['enable_magic_url']) ? OPTION_FLAG_LINKS : 0);
$message = generate_text_for_display($message, $row['bbcode_uid'], $row['bbcode_bitfield'], $row['bbcode_options']);
if (!empty($attachments))
{
parse_attachments($row['forum_id'], $message, $attachments, $update_count);
}
if ($this->global_id < 1)
{
$this->global_id = $row['forum_id'];
}
$topic_icons[] = $row['enable_icons'];
$have_icons = ($row['icon_id'] > 0) ? 1 : $have_icons;
$posts[$i] = array_merge($posts[$i], array(
'post_text' => ap_validate($message),
'topic_id' => $row['topic_id'],
'topic_last_post_id' => $row['topic_last_post_id'],
'topic_type' => $row['topic_type'],
'topic_posted' => (isset($row['topic_posted']) && $row['topic_posted']) ? true : false,
'icon_id' => $row['icon_id'],
'topic_status' => $row['topic_status'],
'forum_id' => $row['forum_id'],
'topic_replies' => $row['topic_posts_approved'] + $row['topic_posts_unapproved'] + $row['topic_posts_softdeleted'],
'topic_replies_real' => $row['topic_posts_approved'],
'topic_time' => $this->user->format_date($row['post_time']),
'topic_last_post_time' => $row['topic_last_post_time'],
'topic_title' => $row['topic_title'],
'username' => $row['username'],
'username_full' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], $row['post_username']),
'username_full_last' => get_username_string('full', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour'], $row['topic_last_poster_name']),
'user_id' => $row['user_id'],
'user_type' => $row['user_type'],
'user_colour' => $row['user_colour'],
'poll' => ($row['poll_title']) ? true : false,
'attachment' => ($row['topic_attachment']) ? true : false,
'topic_views' => $row['topic_views'],
'forum_name' => $row['forum_name'],
'attachments' => (!empty($attachments)) ? $attachments : array(),
));
$posts['global_id'] = $this->global_id;
++$i;
}
$this->db->sql_freeresult($result);
$posts['topic_icons'] = ((max($topic_icons) > 0) && $have_icons) ? true : false;
$posts['topic_count'] = $i;
if ($this->global_id < 1)
{
return array();
}
else
{
return $posts;
}
}
/**
* Get type constraints for database query
*
* @return null
* @throws \InvalidArgumentexception If unknown type is used
*/
protected function get_type_constraints()
{
switch($this->type)
{
case "announcements":
$this->topic_type = '((t.topic_type = ' . POST_ANNOUNCE . ') OR (t.topic_type = ' . POST_GLOBAL . '))';
$this->where_string = (strlen($this->where_string) > 0) ? 'AND (t.forum_id = 0 OR (' . trim(substr($this->where_string, 0, -4)) . '))' : '';
$this->user_link = 't.topic_poster = u.user_id';
$this->post_link = 't.topic_first_post_id = p.post_id';
$this->topic_order = 't.topic_time DESC';
break;
case "news":
$this->topic_type = 't.topic_type = ' . POST_NORMAL;
$this->where_string = (strlen($this->where_string) > 0) ? 'AND (' . trim(substr($this->where_string, 0, -4)) . ')' : '';
$this->user_link = ($this->config['board3_news_style_' . $this->module_id]) ? 't.topic_poster = u.user_id' : (($this->config['board3_news_show_last_' . $this->module_id]) ? 't.topic_last_poster_id = u.user_id' : 't.topic_poster = u.user_id' ) ;
$this->post_link = ($this->config['board3_news_style_' . $this->module_id]) ? 't.topic_first_post_id = p.post_id' : (($this->config['board3_news_show_last_' . $this->module_id]) ? 't.topic_last_post_id = p.post_id' : 't.topic_first_post_id = p.post_id' ) ;
$this->topic_order = ($this->config['board3_news_show_last_' . $this->module_id]) ? 't.topic_last_post_time DESC' : 't.topic_time DESC' ;
break;
case "news_all":
$this->topic_type = '(t.topic_type <> ' . POST_ANNOUNCE . ') AND (t.topic_type <> ' . POST_GLOBAL . ')';
$this->where_string = (strlen($this->where_string) > 0) ? 'AND (' . trim(substr($this->where_string, 0, -4)) . ')' : '';
$this->user_link = ($this->config['board3_news_style_' . $this->module_id]) ? 't.topic_poster = u.user_id' : (($this->config['board3_news_show_last_' . $this->module_id]) ? 't.topic_last_poster_id = u.user_id' : 't.topic_poster = u.user_id' ) ;
$this->post_link = ($this->config['board3_news_style_' . $this->module_id]) ? 't.topic_first_post_id = p.post_id' : (($this->config['board3_news_show_last_' . $this->module_id]) ? 't.topic_last_post_id = p.post_id' : 't.topic_first_post_id = p.post_id' ) ;
$this->topic_order = ($this->config['board3_news_show_last_' . $this->module_id]) ? 't.topic_last_post_time DESC' : 't.topic_time DESC' ;
break;
default:
// Method was called with unsupported type
throw new \InvalidArgumentexception($this->user->lang('B3P_WRONG_METHOD_CALL', __FUNCTION__));
}
}
/**
* Set module id
*
* @param int $module_id Module ID
* @return null
*/
public function set_module_id($module_id)
{
$this->module_id = $module_id;
}
/**
* Set forums to exclude or include
*
* @param array $forum_from Forums that should be shown or
* excluded from being shown
* @param array $disallowed_forums Forums that user is not
* allowed to see
* @param bool $invert Whether forum IDs in forum_from
* should be used for excluding or
* including forums
* @return bool True if valid constraints were generated, false if not
*/
protected function set_forum_constraints($forum_from, $disallowed_forums, $invert = false)
{
if ($invert == true)
{
$access_list = array_merge($disallowed_forums, $forum_from);
$forum_from = array();
$sql_operator = '<>';
$sql_append = 'AND';
}
else
{
$access_list = array_diff($forum_from, $disallowed_forums);
$sql_operator = '=';
$sql_append = 'OR';
if (empty($access_list) && !empty($forum_from))
{
return false;
}
}
foreach ($access_list as $acc_id)
{
$acc_id = (int) $acc_id;
$this->where_string .= 't.forum_id ' . $sql_operator . " $acc_id $sql_append ";
if ($sql_operator === '=' && $this->type == 'announcements' && $this->global_id < 1 && $acc_id > 0)
{
$this->global_id = $acc_id;
}
}
return true;
}
/**
* Gets the a global forum ID for global announcements
*
* @return bool True if proper ID was selected, false if not
*/
protected function get_global_id()
{
if ($this->type == 'announcements' && $this->global_id < 1)
{
if (!empty($this->where_string) || ($row = $this->cache->get('_forum_id_first_forum_post')) === false)
{
$sql = 'SELECT forum_id
FROM ' . FORUMS_TABLE . '
WHERE forum_type = ' . FORUM_POST . '
' . str_replace('t.', '', $this->where_string) . '
ORDER BY forum_id';
$result = $this->db->sql_query_limit($sql, 1);
$row = $this->db->sql_fetchrow($result);
$this->db->sql_freeresult($result);
if (empty($this->where_string))
{
// Cache first forum ID for one day = 86400 s
$this->cache->put('_forum_id_first_forum_post', $row, 86400);
}
}
if (empty($row))
{
return false;
}
$this->global_id = $row['forum_id'];
}
return true;
}
/**
* Resets constraints that might have been set before
*
* @return null
*/
protected function reset_constraints()
{
$this->where_string = '';
}
}

View File

@@ -0,0 +1,259 @@
<?php
/**
*
* @package Board3 Portal Testing
* @copyright (c) Board3 Group ( www.board3.de )
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
require_once(dirname(__FILE__) . '/../../../includes/functions.php');
require_once(dirname(__FILE__) . '/../../../../../../includes/functions_acp.php');
require_once(dirname(__FILE__) . '/../../../../../../includes/functions.php');
require_once(dirname(__FILE__) . '/../../../../../../includes/utf/utf_tools.php');
class phpbb_portal_fetch_posts_test extends \board3\portal\tests\testframework\database_test_case
{
protected $default_main_columns = array('topic_count', 'global_id', 'topic_icons');
protected $fetch_posts;
public function setUp()
{
global $auth, $cache, $phpbb_dispatcher, $template, $user;;
parent::setUp();
$user = new \phpbb\user();
$user->data['user_id'] = 2;
$user->timezone = new \DateTimeZone('UTC');
$user->add_lang('common');
$user->add_lang('../../ext/board3/portal/language/en/portal');
$phpbb_dispatcher = new phpbb_mock_event_dispatcher();
$cache = $this->getMock('\phpbb\cache\cache', array('obtain_word_list', 'get', 'sql_exists', 'put', 'obtain_attach_extensions'));
$cache->expects($this->any())
->method('obtain_word_list')
->with()
->will($this->returnValue(array()));
$cache->expects($this->any())
->method('get')
->with($this->anything())
->will($this->returnValue(false));
require_once(dirname(__FILE__) . '/../../../../../../includes/functions_content.php');
$this->config = new \phpbb\config\config(array('allow_attachments' => 1));
$auth = new \phpbb\auth\auth();
$userdata = array(
'user_id' => 2,
);
$auth->acl($userdata);
// Pretend to allow downloads
$auth->acl[0][0] = true;
// Pretend to allow downloads in forum 1
$auth->acl[1][0] = true;
$this->auth = $auth;
$this->modules_helper = new \board3\portal\includes\modules_helper($auth);
$this->user = $user;
$template = $this->getMock('\phpbb\template', array('set_filenames', 'destroy_block_vars', 'assign_block_vars', 'assign_display'));
$this->fetch_posts = new \board3\portal\portal\fetch_posts($auth, $cache, $this->config, $this->db, $this->modules_helper, $user);
}
public function getDataSet()
{
return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/news.xml');
}
public function data_phpbb_fetch_news()
{
return array(
array('news', array(
'forum_id',
'topic_id',
'topic_last_post_time',
'topic_replies',
'topic_replies_real',
'topic_type',
'topic_status',
'topic_posted',
'attachment',
'forum_name',
'topic_title',
'username',
'username_full',
'username_full_last',
'user_type',
'user_id',
'topic_time',
'post_text',
'topic_views',
'icon_id',
'poll',
'attachments',
'forum_name',
)),
array('news_all', array(
'forum_id',
'topic_id',
'topic_last_post_time',
'topic_replies',
'topic_replies_real',
'topic_type',
'topic_status',
'topic_posted',
'attachment',
'forum_name',
'topic_title',
'username',
'username_full',
'username_full_last',
'user_type',
'user_id',
'topic_time',
'post_text',
'topic_views',
'icon_id',
'poll',
'attachments',
'forum_name',
)),
array('announcements', array(), array('topic_icons', 'topic_count'), 5, ''),
array('news', array(), array(), 0),
array('foobar', array(), array(), 5, '', false, false, false, 150, '\InvalidArgumentException'),
array('news', array(
'forum_id',
'topic_id',
'topic_last_post_time',
'topic_replies',
'topic_replies_real',
'topic_type',
'topic_status',
'topic_posted',
'attachment',
'forum_name',
'topic_title',
'username',
'username_full',
'username_full_last',
'user_type',
'user_id',
'topic_time',
'post_text',
'topic_views',
'icon_id',
'poll',
'attachments',
'forum_name',
), array(), 5, '', false, true),
array('announcements', array(), array('topic_icons', 'topic_count'), 5, '3'),
array('announcements', array(), array('topic_icons', 'topic_count'), 5, '1,2', false, true),
array('news', array(), array(), 5, '1,2', true, false, true),
array('announcements', array(), array('topic_icons', 'topic_count'), 5, '', false, true),
array('announcements', array(), array(), 5, '1,2', true, true, true),
array('news', array(
'forum_id',
'topic_id',
'topic_last_post_time',
'topic_replies',
'topic_replies_real',
'topic_type',
'topic_status',
'topic_posted',
'attachment',
'forum_name',
'topic_title',
'username',
'username_full',
'username_full_last',
'user_type',
'user_id',
'topic_time',
'post_text',
'topic_views',
'icon_id',
'poll',
'attachments',
'forum_name',
), array(), 5, '', false, true, false, 5),
);
}
/**
* @dataProvider data_phpbb_fetch_news
*/
public function test_phpbb_fetch_news($type, $expected_columns, $expected_main_columns = array(), $number_of_posts = 5, $forum_from = '', $empty = false, $permissions = false,
$invert = false, $text_length = 150, $expected_exception = false)
{
$module_id = 5;
$time = time();
$start = 0;
if ($expected_exception)
{
$this->setExpectedException($expected_exception);
}
$this->fetch_posts->set_module_id($module_id);
$fetch_posts = $this->fetch_posts->get_posts($forum_from, $permissions, $number_of_posts, $text_length, $time, $type, $start, $invert);
if (!$empty)
{
if (empty($expected_main_columns))
{
$expected_main_columns = $this->default_main_columns;
}
foreach ($expected_main_columns as $main_column)
{
$this->assertArrayHasKey($main_column, $fetch_posts);
unset($fetch_posts[$main_column]);
}
foreach ($fetch_posts as $post)
{
foreach ($expected_columns as $column)
{
$this->assertArrayHasKey($column, $post);
$this->assertNotNull($post[$column]);
}
}
}
else
{
if (!empty($fetch_posts))
{
var_export($fetch_posts);
}
$this->assertEmpty($fetch_posts);
}
}
public function test_cached_first_forum_id()
{
global $cache;
$cache = $this->getMock('\phpbb\cache\cache', array('obtain_word_list', 'get', 'sql_exists', 'put'));
$cache->expects($this->any())
->method('obtain_word_list')
->with()
->will($this->returnValue(array()));
$cache->expects($this->any())
->method('get')
->with($this->anything())
->will($this->returnValue(array()));
$this->fetch_posts = new \board3\portal\portal\fetch_posts($this->auth, $cache, $this->config, $this->db, $this->modules_helper, $this->user);
$this->fetch_posts->set_module_id(5);
$fetch_posts = $this->fetch_posts->get_posts('', false, 5, 150, time(), 'announcements');
$this->assertEmpty($fetch_posts);
}
public function test_no_allowed_forums()
{
global $auth;
$auth = new \phpbb\auth\auth();
$this->fetch_posts->set_module_id(5);
$fetch_posts = $this->fetch_posts->get_posts('2', true, 5, 150, time(), 'announcements');
$this->assertSame(array(), $fetch_posts);
}
}

View File

@@ -0,0 +1,193 @@
<?xml version="1.0" encoding="UTF-8" ?>
<dataset>
<table name="phpbb_acl_options">
<column>auth_option_id</column>
<column>auth_option</column>
<column>is_global</column>
<column>is_local</column>
<column>founder_only</column>
<row>
<value>93</value>
<value>u_download</value>
<value>1</value>
<value>0</value>
<value>0</value>
</row>
<row>
<value>7</value>
<value>f_download</value>
<value>0</value>
<value>1</value>
<value>0</value>
</row>
</table>
<table name="phpbb_attachments">
<column>attach_id</column>
<column>post_msg_id</column>
<column>topic_id</column>
<column>poster_id</column>
<column>physical_filename</column>
<column>real_filename</column>
<column>attach_comment</column>
<row>
<value>1</value>
<value>1</value>
<value>1</value>
<value>2</value>
<value>foobar</value>
<value>foobar</value>
<value>foobar</value>
</row>
</table>
<table name="phpbb_topics">
<column>forum_id</column>
<column>topic_id</column>
<column>topic_last_post_id</column>
<column>topic_last_post_time</column>
<column>topic_time</column>
<column>topic_title</column>
<column>topic_attachment</column>
<column>topic_views</column>
<column>poll_title</column>
<column>topic_posts_approved</column>
<column>topic_posts_unapproved</column>
<column>topic_posts_softdeleted</column>
<column>topic_poster</column>
<column>topic_type</column>
<column>topic_status</column>
<column>topic_last_poster_name</column>
<column>topic_last_poster_id</column>
<column>topic_last_poster_colour</column>
<column>icon_id</column>
<column>topic_visibility</column>
<column>topic_first_post_id</column>
<row>
<value>1</value>
<value>1</value>
<value>2</value>
<value>1404830663</value>
<value>1404830663</value>
<value>test post</value>
<value>0</value>
<value>1</value>
<value></value>
<value>2</value>
<value>0</value>
<value>0</value>
<value>2</value>
<value>0</value>
<value>0</value>
<value>foobar</value>
<value>2</value>
<value></value>
<value>0</value>
<value>1</value>
<value>1</value>
</row>
</table>
<table name="phpbb_posts">
<column>post_id</column>
<column>poster_id</column>
<column>post_time</column>
<column>post_text</column>
<column>post_attachment</column>
<column>post_username</column>
<column>enable_smilies</column>
<column>enable_bbcode</column>
<column>enable_magic_url</column>
<column>bbcode_bitfield</column>
<column>bbcode_uid</column>
<column>forum_id</column>
<row>
<value>1</value>
<value>2</value>
<value>1404830663</value>
<value>foobar post</value>
<value>1</value>
<value>foobar</value>
<value>1</value>
<value>1</value>
<value>1</value>
<value></value>
<value></value>
<value>1</value>
</row>
<row>
<value>2</value>
<value>2</value>
<value>1404830663</value>
<value>foobar post</value>
<value>0</value>
<value>foobar</value>
<value>1</value>
<value>1</value>
<value>1</value>
<value></value>
<value></value>
<value>1</value>
</row>
</table>
<table name="phpbb_forums">
<column>forum_id</column>
<column>parent_id</column>
<column>forum_parents</column>
<column>forum_desc</column>
<column>forum_rules</column>
<column>forum_type</column>
<row>
<value>1</value>
<value>0</value>
<value></value>
<value></value>
<value></value>
<value>1</value>
</row>
<row>
<value>2</value>
<value>1</value>
<value></value>
<value></value>
<value></value>
<value>1</value>
</row>
</table>
<table name="phpbb_topics_posted">
<column>topic_id</column>
<column>user_id</column>
<row>
<value>1</value>
<value>1</value>
</row>
<row>
<value>1</value>
<value>2</value>
</row>
</table>
<table name="phpbb_users">
<column>username</column>
<column>username_clean</column>
<column>user_id</column>
<column>user_type</column>
<column>user_colour</column>
<column>user_permissions</column>
<column>user_sig</column>
<row>
<value>foobar</value>
<value>foobar</value>
<value>2</value>
<value>5</value>
<value></value>
<value></value>
<value></value>
</row>
<row>
<value>barfoo</value>
<value>barfoo</value>
<value>3</value>
<value>5</value>
<value></value>
<value></value>
<value></value>
</row>
</table>
</dataset>