Where can I find the forum NAMES in the database?
I am using WordPress 3.6.1 with plugins Buddypress 1.8.1 and bbpress 2.3. I am trying to import the latest topics and replies from specific bbpress forums into specific wordpress pages.
I started with a Mysql query:
$query=”SELECT * FROM
wp_postsWHERE post_type = ‘topic’ OR post_type = ‘reply’ ORDER BY post_date DESC”;
Then (in pseudo code) I planned to do the following:
// since forum is a parent of topic which is a parent of reply
// if post is topic get forum id
// if post is reply get forum id from the parent of the topic
//create an array of latest topics and replies associated with their forums
//print latest topics and replies for each forum to different wordpress pages.
The problem I cannot seem to solve is – where to get the name of the forum from? Without getting the name of the forum from somewhere in the database, my only option would seem to be to hardcode the forum id’s of each forum with their respective names. Which means every time a new forum is created this needs to be added in manually in the code. None of the tables I see in the wp database seems to contain the names of the different forums. Even if one of the other tables did contain it I am still not sure how I would then associate the forum id’s from the wp_posts table with the forum names from another table – presumably I would have to do some kind of join? Or maybe I am going about it completely the wrong way – is anyone able to help an inexperienced developer out of his depth navigate his way through this problem?
You must be logged in to reply to this topic.