diff options
author | uckelman <uckelman@nomic.net> | 2010-04-13 22:04:55 +0000 |
---|---|---|
committer | uckelman <uckelman@nomic.net> | 2010-04-13 22:04:55 +0000 |
commit | 36a4efb0d72f69a25a14d93c05fc587739915273 (patch) | |
tree | c938452a96daeb1c4729e53e3951d03eacf364e5 /src/PhpBB3.php | |
parent | d6a3cc8022b33687200776d0c0ce77bb9502956a (diff) |
Added getTopicId().
git-svn-id: https://vassalengine.svn.sourceforge.net/svnroot/vassalengine/site-src/trunk@6710 67b53d14-2c14-4ace-a08f-0dab2b34000c
Diffstat (limited to 'src/PhpBB3.php')
-rw-r--r-- | src/PhpBB3.php | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/PhpBB3.php b/src/PhpBB3.php index ca75c24..3c6a508 100644 --- a/src/PhpBB3.php +++ b/src/PhpBB3.php @@ -44,13 +44,25 @@ class PhpBB3 { return $names[$id]; } + public function getTopicId($postId) { + throw_if_null($post_id); + + global $db; + + $sql = 'SELECT topic_id FROM ' . POSTS_TABLE . ' ' . + 'WHERE post_id = ' . $post_id; + + $row = $this->get_exactly_one_row($sql); + return $row ? $row['topic_id'] : false; + } + public function getTopicAndForumIds($post_id) { throw_if_null($post_id); global $db; $sql = 'SELECT topic_id, forum_id FROM ' . POSTS_TABLE . ' ' . - 'WHERE post_id = "' . $db->sql_escape($post_id) . '"'; + 'WHERE post_id = ' . $post_id; $row = $this->get_exactly_one_row($sql); return $row; |