Jump to content

IPB Forum Module beginnings

Recommended Posts

This is just something I'm doing for one of my sites that's possibly too complicated to release as a module as it requires a third-party module that I've had to squash bugs in myself  (:rolleyes:), but it is a bit nifty even if I do say so myself.

Basically what I've done (or rather re-done as I lost the original code when my hard drive died) is written a module to use my forums as comments for news articles that are written in PW.

I'll give you the link first and explain it all later: http://screencast.com/t/TvCg6lHUZ1L

So, I created a new page in ProcessWire using the News template. My module knows that anything using the News template that's under the News page will create a topic in a specific forum. Upon first save it creates the topic and puts in some text that links to the news article page on the PW site (when I get the right link... seem to have linked the forum topic to itself there in the vid ;)).

At first, the forum post is "Queued" - as in hidden from non-forum-staff - as the page is not yet published. I debated whether to copy the article content into the topic, but the point of the exercise on my site at least is that this News Desk forum is hidden away from all but site staff (it's just a container for news comment topics) - it could easily contain something more interesting like an intro with a link to the full article so people browsing your news forum click through to your news section if they see something interesting.

You'll see as the page is published, the topic is made live (Queued status removed) so all can see it (but in this test case it's still just in a staff-only forum :P).

Moving the news page to the trash causes the forum topic to be Queued again to the public can't see it - very important I thought!

Restoring the page, or in fact moving it anywhere after it's been out of the trash makes the topic visible again.

Deleting the page deletes the forum topic as well.

That's it so far and it suits my immediate needs :)

Something that's important to note is that as I'd previously logged in to the forum software it knew to create the news post as me - I'll tie in PW and forum logins at a later date, or at the very least throw up a warning if you try and create a news page but PW detects you're not logged into the forum software - since it's only a handful of admins who will use this I'd like to do the former as I can just tell them to use the same username and password for both and create a login form that logs them in to both systems.

Also, the forum software I use is IPB - www.invisionpower.com if anyone is interested, and the class that I used to talk to it is www.ipbwi.com , but as I say I had to fix a few bugs in IPBWI as IPB did a major release not so long ago that means IPBWI isn't too happy with it at present.

  • Like 1

Share this post

Link to post
Share on other sites

That looks great and solid implementation, very well done! That will be great feature to have in news/community site, for sure!

Little off topic, but what do you think about IPB btw? I have used it once, and I think it was little bit "too much" for that case I had.

Share this post

Link to post
Share on other sites

Great job Pete! Very cool to see this integration, and looks like you've really done it nicely. Thanks also for posting this screencast, it was great to see this in action.

As a side note, I noticed that there were no margins between the individual fields in ProcessPageEdit (in your screencast). Just wanted to check if you had changed something in PW's stylesheet to do this, or if that's the way it displays for you? If so, it's a bug, and I'd like to find out what version of Firefox?



Share this post

Link to post
Share on other sites

I use IPB purely because I've used it since version 1, back when it was a bit simpler (and free). It's probably a bit overkill for a lot of sites, but they've been trying to streamline it a bit in 3.2 and you can turn a lot of extra stuff off. it's a very solid product anyway and I like the new, more streamlined default skin as well as built in anti-spam in the new version (they have a central server a bit like the StopForumSpam website). I guess I've just used it so much that setting it up, configuring it and maintaining it doesn't bother me, but to a newcomer it's so big in the admin area I imagine it can be a bit daunting.

In terms of free forum software, I've used MYBB - very good product and feature set, and the code was easy enough to manipulate on one site I used to have so that I could do integration like I'm doing here without the need for a third-party set of classes (pretty sure I was able to initialise an instance of MYBB inside my custom CMS at the time so could probably do it again with ProcessWire if the need ever arises again.

No worries on the skin issue Ryan - that's just me fiddling with the stylesheet ;)

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...