Topic: [Tutorial] Show PunBB info in Wordpress

Things you need

Preparation: Install the "Widgetize Anything" Plugin

  1. Download the plugin.

  2. Extract its contents (a folder called "widgetize-anything") into 'wp-content/plugins/'.

  3. Go to Plugins on your Wordpress dashboard.

  4. Install the plugin.

Widgetize Anything: Adding more widgets

  1. Go to Settings/Options»Widgetize Anything on your Wordpress dashboard.

  2. Change the number to your needs.

  3. Update the options.

Steps

  1. Go to Appearance»Widgets (depends on your WP version) and add the "Widgetize Anything (number)" widget to your sidebar.

  2. Edit the "Widgetize Anything (number)" widget.

  3. Set the widget title to your liking.

  4. If you want to show the forum's active topics, paste Code 1 into the text box. If you want to show how many online users there are, paste Code 2. If you want to show your board stats, paste Code 3.

  5. Replace '{replace_this}' with the relative URI to your PunBB installation. See Example 1.

  6. Save the changes.

Code 1:

$show = '10'; //How many active topics we want to show

define('FORUM_ROOT', '{replace_this}');

echo '<ul>';
echo file_get_contents(FORUM_ROOT . '/extern.php?show=' . $show);
echo '</ul>';

Code 2:

define('FORUM_ROOT', '{replace_this}');

echo '<ul>';
echo file_get_contents(FORUM_ROOT . '/extern.php?action=online');
echo '</ul>';

Code 3:

define('FORUM_ROOT', '{replace_this}');

echo '<ul>';
echo file_get_contents(FORUM_ROOT . '/extern.php?action=stats');
echo '</ul>';

Example 1:

You have Wordpress installed in www.example.com and PunBB on www.example.com/forums/. Your relative URI to PunBB will then be "./forums". If Wordpress is installed on www.example.com/blog/ and www.example.com/forums/, your relative URI to PunBB will be "../forums"

Advanced users:
Read the instructions found inside 'extern.php', edit the following code to your liking and use it on step 4.

$variables = ''; //Example: action=feed&fid=1&show=30

define('FORUM_ROOT', '{replace_this}');

echo '<ul>';
echo file_get_contents(FORUM_ROOT . '/extern.php?' . $variables);
echo '</ul>';

I hope you understood my messy tutorial big_smile

Re: [Tutorial] Show PunBB info in Wordpress

thanks i will translate it in Italian language

Re: [Tutorial] Show PunBB info in Wordpress

mmm it word with Wp 2.7???

Re: [Tutorial] Show PunBB info in Wordpress

Yes, works on WP 2.2 and later.

Re: [Tutorial] Show PunBB info in Wordpress

thanks!

Re: [Tutorial] Show PunBB info in Wordpress

I not use the widget, how can i show the info?

Re: [Tutorial] Show PunBB info in Wordpress

Well, you would have to edit your Wordpress style.

Re: [Tutorial] Show PunBB info in Wordpress

i have translate the tutorial in Italian languages wink

9

Re: [Tutorial] Show PunBB info in Wordpress

is it possible to put only 5 active topics?

10

Re: [Tutorial] Show PunBB info in Wordpress

$show = '5'; //<--- Change this to how many active topics you want

define('FORUM_ROOT', '{replace_this}');

echo '<ul>';
echo file_get_contents(FORUM_ROOT . '/extern.php?show=' . $show);
echo '</ul>';

11

Re: [Tutorial] Show PunBB info in Wordpress

thnx a lot

Re: [Tutorial] Show PunBB info in Wordpress

Is it possible to place the entire forum into a page on Wordpress, kind of like with phpbb.

13 (edited by colak 2009-01-25 08:06)

Re: [Tutorial] Show PunBB info in Wordpress

Garciat, thanks for that, it also works with textpattern if wrapped in php and placed in a page or form,

<txp:php>$show = '10';
define('FORUM_ROOT', '{replace_this}');
echo '<ul>';
echo file_get_contents(FORUM_ROOT . '/extern.php?show=' . $show);
echo '</ul>';</txp:php>

Is there a way to rid of the ellipse at the which shortens topic titles and allow for the whole title to appear?

Forum, Art, Architecture, Passion.

Have you ever visited the textpattern forum?

Re: [Tutorial] Show PunBB info in Wordpress

hello there, i wanted to use the code number 2 and i go these two errors:


Notice: Undefined index: Guests online in /home2/supermag/public_html/forum/extern.php on line 499
: 2

Notice: Undefined index: Users online in /home2/supermag/public_html/forum/extern.php on line 504
: 1

when i try to open this url: http://wrestlingfans.co.cc/forum/extern … ion=online
i got the same thing. what is wrong with my installation.


http://wrestlingfans.co.cc/forum/

MyFootballCafe.com  is Now Online!

15

Re: [Tutorial] Show PunBB info in Wordpress

SuperMAG, that bug has been fixed here.

Re: [Tutorial] Show PunBB info in Wordpress

ok thanks,

question, how can i show in active topics, complete title. currently it shows few words with (...) in the last.

MyFootballCafe.com  is Now Online!

17

Re: [Tutorial] Show PunBB info in Wordpress

I couldn't find a way to fix that, sorry.