SELECT
    `p`.`topic_id`,
    `t`.`subject`,
    `p`.`poster`,
    `p`.`posted`,
    `t`.`num_replies`,
    `t`.`num_views`,
    `t`.`forum_id`,
    `f`.`forum_name`
FROM
    `pun_posts` AS `p` 
JOIN
    `pun_topics` AS `t` 
ON
    `p`.`topic_id` = `t`.`id` 
JOIN
    `pun_forums` AS `f`
ON
    `t`.`forum_id` = `f`.`id`
GROUP BY 
    `t`.`id`
ORDER BY
    `p`.`posted` DESC 
LIMIT 10;

In my case, I have another page on my site, with forums as a subdirectory. I figured out much of the profile integration for register, edit profile, username, user id, private message link, private message count, forgot password, and a form for logging in. For the logout link, I did it like so:

<?php
define('FORUM_ROOT','forums/');
require_once('forums/config.php');
require_once('forums/include/common.php');
ini_set('error_reporting',6135);

$USERID = $forum_user['id'];
$USERNAME = $forum_user['username'];
$LOGOUT_TOKEN = generate_form_token('logout' . $USERID);

// you may have another way to get your base URL; this is mine
$sScriptName = $_SERVER['SCRIPT_NAME'];
$sBaseName = basename($sScriptName);
$BASE = str_replace($sBaseName,'',$sScriptName);

// your other code goes here
?>
<a href="<?= $BASE ?>forums/login.php?action=out&id=<?= $USERID ?>&csrf_token=<?= $LOGOUT_TOKEN ?>">Logout <?= $USERNAME ?></a>

Tested on PunBB 1.3 RC.

I need to build a screen widget on my site that will show the last 10 forum posts. The columns I need are:

* thread topic (with hyperlink to jump right to it)
* last poster's username and date/time
* # of replies on that thread topic
* # of views on that thread topic
* forum name (with hyperlink to jump right to it)

I think I can figure out how to do this the SQL way, but is there like a way I can do it by calling a function already in the forum system? For instance, I'm already loading common.php like so:

define('FORUM_ROOT','forums/');
require_once('forums/config.php');
require_once('forums/include/common.php');
ini_set('error_reporting',6135);

EDIT: Oh, I forgot to mention -- I'm loading this screen widget/gadget on a page separate from my website -- one directory above it "forums".

If anyone wants to fork this hack into an official extension for FluxBB and PunBB, please be my guest.

Slavok wrote:

You can look pun_bbcode as an example of extension. Our documentation about extension development isn't ready yet. But extension system of PunBB is compatible with ext. system FluxBB, so you can see this article by FluxBB team. And we advice you not to name extensions with "pun_", because we use this prefix for our official extensions.

I wish had the time to make it into an extension. I did look over the extension doc and it looks possible for me, given I had the time. I loved how the hooks are implemented -- neat idea.

For now, it's just a hack. In fact, I renamed it from pun_ to hack_ to comply with your naming standard. EDIT: And I renamed the link at the top of this thread.

Well, back to my project deadlines...hope you all enjoy the hack...

6

(14 replies, posted in PunBB 1.2 discussion)

Okay, Utchin. I understand. Thanks.

Woops! Didn't know that about the pun_ thing. I'll change that in a few minutes. I'll make it ext_ instead and repost the link.

8

(14 replies, posted in PunBB 1.2 discussion)

Utchin wrote:

And you can see...

All I can see is that PunBB has a working Private Messaging feature, while Flux does not, and I've been patient enough to try every conceivable normal means to install the two separate PM mods that are out there.

Based on time constraints, I guess I'll go with PunBB for now. If and when FluxBB has a working PM mod and is stable in other aspects, I'll go back and switch to it. (However, that might be scary as far as moving all the existing forum posts and PMs from PunBB to Flux.)

Now, the one thing I didn't try is version 1.2 of Flux, but I imagine that's pretty ancient by now.

9

(14 replies, posted in PunBB 1.2 discussion)

volomike wrote:

Installing pun_pm on stable Beta2 also fails with:

Fatal error: Call to undefined method DBLayer::create_table() in /var/www/e1/forum/admin/extensions.php(139) : eval()'d code on line 61

And when you try to install the other Pun PM, the one with folder private_messaging, it fails with:

The error occurred on line 305 in /var/www/e1/forum/include/dblayer/mysqli.php

Database reported: Table 'e1.groups' doesn't exist (Errno: 1146).

10

(14 replies, posted in PunBB 1.2 discussion)

volomike wrote:

Okay, that didn't work either. I think I'm going to have to delete FluxBB and reinstall from the stable Beta 2 version, rather than the latest development release, and see if that fixes things.

Installing pun_pm on stable Beta2 also fails with:

Fatal error: Call to undefined method DBLayer::create_table() in /var/www/e1/forum/admin/extensions.php(139) : eval()'d code on line 61

11

(14 replies, posted in PunBB 1.2 discussion)

volomike wrote:

I'm going back now to pun_pm to see if I can go to Profile, create my first private message, and see if that enables the new messages link on all the pages.

Okay, that didn't work either. I think I'm going to have to delete FluxBB and reinstall from the stable Beta 2 version, rather than the latest development release, and see if that fixes things.

12

(14 replies, posted in PunBB 1.2 discussion)

Yep, this link installed:

http://connorhd.co.uk/fluxbb/private_messaging.zip

...but it was not working properly. First, you don't see New Messages. Second, when you go to your profile and try to compose a message, it's got errors and doesn't function.

I'm going back now to pun_pm to see if I can go to Profile, create my first private message, and see if that enables the new messages link on all the pages.

13

(14 replies, posted in PunBB 1.2 discussion)

Okay, so I switched over to FluxBB. I basically downloaded the latest build from SVN.

I tried to install the pun_pm mod. Sure enough, it installed. However, it does not show up in the menus either for admin or any new user I create. So, it's broke.

I found another one here...

http://connorhd.co.uk/fluxbb/private_messaging.zip

...but I'm going to try it out.

14

(14 replies, posted in PunBB 1.2 discussion)

Okay, now that's something I didn't know. Okay, I'll start to work on moving my changes over to FluxBB and to get the PM working. PM is pretty critical for my client.

15

(14 replies, posted in PunBB 1.2 discussion)

Utchin wrote:

punbb 1.3 beta 2 mods work on fluxbb beta 2 aswell, all mods should work on each forum.

I tried the Pun PM mod on Flux and it didn't work. Perhaps because all the code inside kept referring to Pun instead of Flux?

I've got a long-term client need at stake here -- I need to decide which to go with, Pun or Flux? If Flux is the way to go, then I need a working PM mod and I need to become really convinced that this is where the active development is.

16

(14 replies, posted in PunBB 1.2 discussion)

So what version of Flux should I be using if I'm liking 1.3 RC of Pun? And where is that PM mod that works? I really like the PM mod I found for Pun. (It's the one that makes a directory pun_pm and its manifest.xml says "Private Messaging 1.0b".)

MrMister wrote:

Has anyone tried this yet?
I found a discussion of it here ( http://tinymce.moxiecode.com/punbb/view … hp?id=1323 )but before trying it out wanted to see if anyone tried it yet.

I have it working on PunBB 1.3 RC. I don't know how to make a portable mod out of it yet, though. I can run diff files on the tinymce folder and the PunBB folder to let someone know how I did it. I posted this into the PunBB 1.3 Extensions forum to see if an extensions developer can help me get this set up. I'm waiting on someone to respond.

18

(1 replies, posted in Feature requests)

godknow wrote:

i want use tinyMCE support my punbb,how to do?

I have it working on PunBB 1.3 RC. I don't know how to make a portable mod out of it yet, though. I can run diff files on the tinymce folder and the PunBB folder to let someone know how I did it. I posted this into the PunBB 1.3 Extensions forum to see if an extensions developer can help me get this set up. I'm waiting on someone to respond.

I have a working TinyMCE modification for rich editing, and have customized TinyMCE a little as well to get rid of some quirks that come up with BBCode <--> HTML through PunBB and TinyMCE.

When you go to post a new topic, or reply to one, or edit an existing one -- it's all working properly. I am providing support currently for quotes, bolding, italics, hyperlinks, bullets, and remove formatting, although someone could easily take this further and add the images button, font colorizing, and code. (I didn't need the images, font colorization, and code, so I didn't install that into the toolbar and didn't test it -- but it probably will still work.)

I made the mod to PunBB 1.3 RC.

I can run diffs on things and tell you how I did it. Can anyone take over this mod or show me how to bundle it as an extension?

EDIT: I just ran a diff and I provide the file for download: hack_tinymce.1.1.tar.gz.

20

(14 replies, posted in PunBB 1.2 discussion)

I'm new around here. I guess I'm confused on which to go with -- FluxBB or PunBB. I thought I read that PunBB was stalled and FluxBB was a fork with most of the original developers. But then when I found that the very latest Flux 1.3 Beta 2 didn't have Private Messages, nor a working beta mod, I had to look elsewhere. So I downloaded the PunBB 1.3 RC and got the pun_pm mod working just fine with it. I also noticed that the files inside were updated very recently. To me, that doesn't sound like PunBB is being pushed aside for Flux -- that sounds like more active development on PunBB than Flux.

And PM is a really important thing for me -- my client had this as a request on a proposal, and originally I used phpBB for that very reason. But then as I got used to phpBB and learned how aggravating it was to theme and build my own components for, I had to look elsewhere. I wanted something more recent, so I dropped the idea of SMF. So that's when I noticed on forums.devnetwork.net that a guy recently posted a message there that he liked PunBB. I gave it a shot, and I compared it to SMF, and I liked it's look a lot more.

So, there's still active development on PunBB, right?