phpbb_recent_topics version 0.6

UPDATE: This Plugin has been updated, the below links to the new file, but please comment on the new post, thanks.

Screenshot phpbb_recent_topics admin page

Screenshot phpbb_recent_topics admin page

Admin GUI

It’s that time again, enough things have happened in the support forum to warrant another version.

phpbb_recent_topics 0.6 owes a debt of gratitude to number3nl he has worked very hard to push in two main new features and his work was so good it only needed a couple of minor tweaks from myself.

New Features!

  • The loooong awaited phpBB recent posts feature has been enabled, simply tick the box that says “Sort results by post date” and you’re away!
  • Tooltips are here! Yup if you’re into that kind of thing enabling tool tips will show a snippet of the post content to your visitors prior to them clicking on any links.
  • Admin UI Error Messages are here; the GUI will now inform you if you’re connected to phpBB.

Bug Fixes.

  • The variables in display.php now match those of admin-display.php; hopefully this will make community contribution simpler.
  • Uninstall.php has been added so removal of the plugin is more comprehensive.

A note to upgrader’s.

  • If you’re using secure database connectivity you’ll need to GRANT access to the posts table….
    GRANT SELECT ON phpbb_database.phpbb_posts TO wp_user@localhost;

Download phpBB_Recent_Topics_0.6 from wordpress.org

The usual stuff now follows….


The Installation

Before starting you need to get your database configuration sorted. So, are you going to connect to the PHPBB Database securely or Insecurely?

To connect Securely you need to GRANT access TO WordPress FROM 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;

AND

GRANT SELECT ON phpbb_database.phpbb_forums TO wp_user@localhost;

AND

GRANT SELECT ON phpbb_database.phpbb_posts 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.

WordPress 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 ‘Settings’ -> ‘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)
    • * The Date Formatting, i.e. “d/M/y – g:i a” similar to the WordPress “General Settings”
  • The use of Insecure connectivity is optional – See Below
  • Tick the boxes of any Forums you don’t want this plugin to show posts from
  • 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 using the widget…

    • * click “design” in the dashboard
    • * click “widgets”
    • * next to phpBB Recent Topics click “add”
    • * click “save changes”

    To output the list of topics in your theme sidebar using a template tag…

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

What is Insecure MySQL Connectivity & How do I use it?
If you need to you can connect in a less secure manner, the connection details held in your PHPBB config.php can be loaded into WordPress. This is insecure becuase the phpbb3 credentials are store in clear text, this is bad cuase if someone somehow comprised WordPress they’d have full access to PHPBB.

To use, tick the “Enable Insecure Database Connection” box, and submit, when the page re-freshes you’ll have some more boxes to populate, from your phpbb config.php fill in


$dbuser = phpbb MySQL Database UserName
$dbpasswd = phpbb MySQL Database Password
$dbhost = phpbb MySQL Server

Click update, and you should be connected!

Support
I’ve always been honest about support, there isn’t any. Basically I write this for my own needs and then publish it for you to use for free. You’re more than welcome to post comments here and if you need support the community phpbb-recent-topics forum is available, I do read every post there but we all have busy lives and I make no promises on how quickly I’ll reply to you.

Finally Subversion
The source for this plugin is in the wordpress subversion, you can checkout the trunk directly from here, if you weren’t aware wp.org also auto-magically creates a nightly build of any developments here.

I hope you enjoy my plug-in!

rgds,

Nick


14 thoughts on “phpbb_recent_topics version 0.6

  1. Just a note for GoDaddy users with shared hosting, this script won’t work because you don’t have the proper user privileges in MySQL. I kept getting a Grant Denied error when trying to connect. I contacted GoDaddy and someone said yes, it should work but in fact, it doesn’t. I tried variations of the code for the last 2 – 3 hours and no luck. I’m going to try somewhere else but I thought this would be much easier of a solution.

    • Hi Grant, it sounds like you’re running the GRANT statement as the WordPress user rather than as the phpBB user.

  2. Good plugin, has taken me a while to work out from the install that if Word Press and PHP BB are on the same database all you need to do it put DB_NAME in the “phpbb MySQL Database Name” field in settings.

  3. I always used you’re plugin, worked perfect till now I replaced my forum to another URL.

    All settings are clear for me, but what do I need to fill in by: phpbb MySQL Server?

    localhost or my forum url didn’t work….

    Each time I get the message: Database Error. Connectivity to phpBB failed. See README for help

    Please help me! Thank you!

    • Hello,

      The phpbb MySQL Server is the resolvable name or IP address of the server running mysql.

      If WordPress and MySQL are on the same box usually 127.0.0.1 is sufficient…. The phpbb_recent_topics README says copy the settings from your phpbb config.php.

  4. Time formmating needs timezone offset.

    phpBB is configured to show UTC +2 but plugin shows UTC + 0. Date and Time Formmating is d.m.y H:i

  5. First and foremost, thanks for all of your hard work on the plugin.

    Second, I noticed that your plugin does not have all of the options that my other plugins have when I customize it on the widgets screen. Is it because it is not using the latest and greatest wordpress hooks? The functionality is still there and works perfectly, but it would be nice if it integrated completely.

    Thx for the coding!

  6. Hi, nifty plugin. I am running the latest phpbb and WP. For some reason my posts are not updating in the widget i am using. They display fine though.

    Any thoughts on how to fix this?

    thanks much,
    Nigel

  7. To develop a plug in is not an easy task but you made it. But there are still limitations and problems that arises upon using it such as it do not update a widget. Hope you will post solutions to such kind of problem.