Recent phpBB Topics on WordPress Plugin v0.3

UPDATE: This Plugin has been updated, please download the update from http://wordpress.org/extend/plugins/phpbb-recent-topics/, and please comment on the new post, thanks.

phpBB recent topics admin interface in WP 2.3.x
Admin GUI

Another day, another plug-in update…..Version 0.2 never saw the light of day, after fixing my compatibility issue I moved straight into setting up the admin interface. So here we have it, a proper implementation :)

Download phpBB Recent Topics

Installation

  • Unzip phpbb_recent_topics.tgz in your `/wp-content/plugins/` directory. (You’ll have a new directory, with this plugin in /wp-content/plugins/phpbb_recent_topics)
  • Activate the plugin through the ‘Plugins’ menu in WordPress
  • Configure the plugin, you need to tell wordpress about phpbb, this is done in the wordpress menu ‘Options’ -> ‘phpBB Recent Topics’
    The following Settings are required:

    • * The name of your phpBB database (e.g phpbb)
    • * The name of the table where topics are held (the default is phpbb_topics )
    • * The full url of your forum for links (e.g. http://www.mydomain.com/forum)
    • * The number of topics to show. (If left blank you get 5)
  • Hit ‘Update Options”
  • To output the list of topics in a page or post…
    • * create a new page/post, type {phpbb_recent_topics} , hit ‘Publish’ or ‘Create new page’

    To output the list of topics in your theme sidebar…

    • * edit sidebar.php and inside <div id=”sidebar”> type…
      <?php
      if (function_exists('phpbb_topics')) {
      phpbb_topics();
      }
      ?>

A bit about Database configuration.
If wordpress & phpBB share a DB already then set $PHPBBDB to DB_NAME and everything will be fine, else you’re going to need to GRANT the wordpress user read access to phpBB.

How to GRANT wordpress read only access to phpBB ?
If you don’t know it already you need to find your wordpress mysql user id, it’ll be in wp-config.php

define('DB_USER', 'wp_user');     // Your MySQL username

and you should have already found your phpbb database & table for the above.
You need to type the following syntax into your mysql database

GRANT SELECT ON phpbb_database.phpbb_topics TO wp_user@localhost;

this can be achieved by logging into phpmyadmin as your phpbb user, selecting SQL and pasting the correct GRANT into the text box.

Upgrading from Version 0.1
Upgrading is optional. This version has two major changes: The first basically fixes the compatibility issue I have running two php ob_start processes in wordpress; the second is the introduction of a “proper” admin interface (rather than hacking the php file).
To upgrade, make a note of the following settings:

$PHPBBDB = "phpbb"; //phpBB db name
$TOPIC_TABLE = "phpbb_topics"; //phpbb topics table
$SITEURL = "http://www.mydomain.com/forum"; //Forum URL

Deactivate version 0.1, and follow the Installation instructions above :)

Frequently Asked Questions

  • Can I output 10 Topics in my Page, and 3 Topics in my Sidebar ?
    • Yes ! In the WordPress menu ‘Options’ -> ‘phpBB Recent Topics’, set ‘The number of topics to show’ to 10, and then in your sidebar include…<?php
      if (function_exists(‘phpbb_topics’)) {
      phpbb_topics(3);
      }
      ?>
  • Can I exclude a certain forum from the list ?
    • In this version, the only way to do that is to hack /wp-content/plugins/phpbb_recent_topics/display/display.php, change
      $results = $wpdb->get_results("SELECT * FROM $TOPIC_TABLE ORDER BY topic_time DESC LIMIT $LIMIT");

      to

      $results = $wpdb->get_results("SELECT * FROM $TOPIC_TABLE WHERE forum_id != 1 ORDER BY topic_time DESC LIMIT $LIMIT");

      to exclude forum 1 from the list. I plan to setup a proper solution to this in the next version.

Finally Subversion
You also might be interested to know that I’ve been getting to grips with the wordpress plug-ins svn, so you can get work directly from here; and when wordpress.org re-crawls my readme the latest version will also be available on wordpress.org/extend/plugins/ :cool:

rgds,

Nick


91 thoughts on “Recent phpBB Topics on WordPress Plugin v0.3

  1. Pingback: Weblog Tools Collection » Blog Archive » WordPress Plugin Releases for 3/27

  2. Pingback: » Plugin WP: Recent phpBB Topics on Wordpress » WordPress Italy

  3. Pingback: WeblogToolsCollection Español » Blog Archive » Plugins de WordPress publicados 27/3

  4. Pingback: Recent phpBB Topics Wordpress Plugin » D’ Technology Weblog — Technology, Blogging, Gadgets, Fashion, Life Style.

  5. This works for the latest version of WordPress and the newest version of phpbb (Version 3 Beta)

  6. Pingback: leighburke.com · PHPBB installed, and wordpress integration plugin being tested

  7. Hi,
    is there a way to include the forum hte topic came from in the output? Also, I would like to be able to display the author of the topic. I have had a bit of a play around, but can’t figure it out.
    My install is here: http://www.leighburke.com

    Cheers,

    Leigh.

  8. Pingback: leighburke.com · Refining output of PHPBB integration plugin

  9. Hi Leigh,

    is there a way to include the forum hte topic came from in the output?

    I guess you’ve been got by the typo bug ;)

    This version of the plug-in only references one table in phpBB, you’ll notice that both the forum where a topic came from, and the author (topic_poster) are Integer values, the “english” equivalents are held in other tables.

    I’ve had a few requests involving functionality where other tables are referenced, and I hope to include that in the next version, but some requests pose a security problem… as wordpress is becoming more popular (and targeted for attacks) opening up the phpbb_users table means that your forum members password hashes are exposed to the wordpress install… I hope to have something sorted soon :D

  10. Pingback: WP Plugins DB » Blog Archive » phpBB recent topics for wordpress

  11. does this work with phpbb3?

    According to Stickboy, it does.

    when i click on the options for the plugin, i get a 404 page… any ideas why?

    um no, which ver of WP are you 2.0.10 or 2.2.1 ? is there anything interesting in your apache error_log ?

  12. kills my site to, so i cant troubleshoot, when i turn it on the whole front end has a database error… i assume the plugin is inserting itself into my sidebar and causing it all to die. any way i can stop that happening so i can troubleshoot?

  13. Just installed a clean, 2.2.1.

    I can get to the options page, but it does indeed kill the site… must be a new thing with 2.2.1… there’s no sidebar insert, just a text filter…. the problem is probably because wp doesn’t have access to the phpbb DB…. I haven’t yet set that up on my Test-Site… I’ll see if that fixes it.

  14. Just checked the, DB error page is because ~/phpbb_recent_topics/display/display.php

    # Connect to php BB
    $wpdb->select($PHPBBDB);

    fails, as soon as you are able to fix the problem to get to the options page and setup the DB connection, the plugin should then work fine. I’ll check the WP documentation for a “test” to fix this.

  15. I’ve installed it and manage to display top 5 topic but I also get an error before the first topic. Error message as per below:

    Warning: Missing argument 1 for phpbb_topics() in /home/emenang/public_html/homewordpress/wp-content/plugins/phpbb_recent_topics/phpbb_recent_topics.php on line 70

    You can view it here:
    http://www.emenang.com/homewordpress/

    Any advice?

    Cheers!
    Sha

  16. I manage to solve it by editing some text in line 70 of the affected php file.

    Original:
    function phpbb_topics($LIMIT) {

    New One:
    function phpbb_topics() {

    No more error message but I would like to know would it cause any bigger threat or issue for my blog?

    Cheers!
    Sha

  17. No more error message but I would like to know would it cause any bigger threat or issue for my blog?

    $LIMIT was supposed to define how many rows are returned on the DB query, I’ll take a look for any further issues for you.

  18. Pingback: Recent phpBB Topics on Wordpress Plugin - [LINICKX].com

  19. Nick,

    Cool plugin here – unfortunately, I’m getting seriously rejected bt MySQL. I’ve run the following query:

    GRANT SELECT ON jnowings_forum.jnowings_forum_topics TO ‘jnowings_bp’@'localhost’;

    my DB is jnowings_forum and the prefix is forum (so forum_topics) … but when I run this command I get the following error:

    #1142 – GRANT command denied to user ‘jnowings_forum’@'localhost’ for table ‘jnowings_forum_topics’

    I’ve tried running it a few different ways (jnowings_forum_database.forum_topics or jnowings_forum.forum_topics etc…, but those return the same error). Any idea what I’m doing wrong? Thanks-

    Justin

  20. Hi, after I activate v0.3 of the phpbb plugin and go to options->phpbbBB Recent Topics tab I get a 404 error. The URL in the browser points to /blog/wp-admin/phpbb_recent_topics/display/admin-options.php

    My WP is v2.2.1

    Has anybody seen this before?

    Thanks

    LBS

  21. @Lordbigsack
    Odd, on my test 221 install the url is /wp-admin/options-general.php?page=phpbb_recent_topics/display/admin-options.php

  22. Hi Nick, thanks for reply. I have enabled the plugin again and paste the url you specified into my browser, this brings up the WP page not found (404?) error. could it have anything to do with my hosting package? (IIS) Is there anything I have missed from the install? hmmm, maybe i should download again and reinstall…

    I tried some php database queries against the phpbb tables and they return data correctly.

    /pulls hair out/

    LBS

  23. humm, tbh I don’t have an IIS box to test it on, try re-downloading it from my site.. does IIS give you any error logs ?

  24. a-ha! found problem. The folder structure was phpbb-recent-posts not phpbb_recent_posts in my plugins directory. Admin screen is now working.

    Cheers for replies

    LBS

  25. hi, very nice plug in, thanks

    i got the same issue as lordbigsack with the wrong name, maybe you can add this into FAQ,…

    thanks

  26. Hi nero, thanks for your feedback.

    I think it’s something to do with the automagic packaging that wordpress.org do.. I will look at getting it fixed… life just a bit busy at the mo ;)

  27. Do you know how to get this to work with wp-cache? When wp-cache is enable, the recent topics don’t get updated because the page is cached. I tried following the wp-cache directions for dynamic parts of a page, but no luck.

  28. yeah i’ve got mine working now

    the folder in the zip has dashes not underscores so i used to get a 404 when i tried to access the admin options, just replaces the dashes with underscores and it should work.

    i also had to edit line 70 of the recent topics php and update it to this

    function phpbb_topics() {

    the limit still works.

  29. Has anyone gotten around the database issue? When trying to allow the wordpress database to read the phpbb database, I still get an error.

  30. never had that issue…

    MAKE SURE you have the SAME USER that you use for your WP database has acess to your phpbb database (grant it user permissions)

  31. Everyone,

    Thanks for your input. It turns out there was a permission issue. My ISP doesn’t allow granting permissions between DBs using shared hosting.

  32. can you create your 2nd database with the same user account?

    so dont create a wp user, wp db, phpbb user and phpbb db.

    create a wp user, wp db, then a phpbb db. so dont create a user for the phpbb db, just use the wp user for both databases.

    thats how i have it, 1 user is the owner of both databases, not 2 different users with one that has permissions on both

  33. Is it possible I point the plugin towards an address (or IP) in order to find my phpBB datebase?
    My datebases are kept on paid hosting.

    Or, if the databases share the same location, would it be a given where to look for it?

    Thanks a lot btw, I wasn’t even looking for something this cool.

  34. yeah, it should be possible by hacking my plugin to use
    wpdb($dbuser, $dbpassword, $dbname, $dbhost)
    rather than

    $wpdb->select($PHPBBDB);

    just remember to connect back to wordpress when you’re done ;)

  35. Maybe it’s my lack of knowledge with MySql, but that hack didn’t go far enough because I had no way of inputting information about my datebase.
    I tried to fix that problem but all I was left with was a headache. lol

    I’m sure it was helpful to someone anyway :)

  36. Is there any system ( any code) by which i can get the list of post by a specific user only. if any please tell me. im using WP 2.2 and this plugin installed

  37. there is, but posts are held in a different table, so this plugin won’t help.

    Posts are stored in phpbb_posts, an sql query of
    select * from phpbb_posts where poster_id = 5
    or similar would list all posts from the username with id 5.

  38. Hi, i just installed your plugin works great.
    I managed to exclude one forum but I need to exclude few more.. can you please help me