Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2006-01-12 18:13:25

Anton
Plugin Author
From: Alingsås, Sweden
Registered: 2004-11-16
Posts: 138
Website

Re: How did you get Textile to work with PunBB?

I just tried to add Deans code (although I included ../textpattern/lib/classTextile.php directly, for smoother updates) and it works just great. Didn’t have to download a plugin or anything, just followed the above instructions.

However, I can’t seem to find where to add the “Textile: on” since it doesn’t show up for me using this method. Does the plugin do something special here..?

Offline

#14 2008-04-01 18:38:42

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,453
Website GitHub

Re: How did you get Textile to work with PunBB?

Really sorry to dredge up an old thread like this but if anyone’s remotely interested I’ve modded a PunBB 1.2.17 forum (sorry, can’t share the link yet) to offer users the choice between BBCode (which remains the default), Textile or Markdown Extra.

It adds global options to allow admin to turn on or off the various systems, and a dropdown in the Display pane in each user’s Profile; when you choose one, anything you post or edit (including your sig) uses that system. Of course, if you change the system later and edit a post/sig you’ll get the raw codes back, but hey, a small penalty, right? :-)

All three markup systems honour the [img tag] setting and will disallow images in posts/sigs if told (that was the most awkward part because of the way TextileRestricted() worked, I had to use TextileThis() in the end, which I’d prefer not to — and don’t talk to me about those regexes… sheesh!)

There’s potential to fairly easily add other markup systems, I just chose Textile and Markdown (Extra – the PHP one) because they’re both fairly intuitive and flexible imo.

But overall it was quite fun to do and, though it seems rather daunting at first, it isn’t really that tricky if anyone would like to follow in my footsteps and perhaps improve upon it. I’m hoping with PunBB 1.3 on the horizon that it’ll be a lot easier with all the admin hooks littered through the code. If anyone has experience writing PunBB plugins and thinks this could become a plugin then I’m all ears; I don’t really know the capabilities of plugins so at the moment it’s a series of little mods.

fwiw, here’s what I did

As I say, it looks a lot, but there’s loads of repetition; it only involves editing 9 files in total; and three of those are config files. If anyone wants to use it, abuse it, or improve it, feel free to let me know what you did.

I’m a PunBB novice so I might have made some heinous security blunders (TextileThis() is probably one of them!) but I think I’ve been rather restrained and found all the relevant bits — there are a couple of little help links I didn’t bother changing that point to the BBCode help file, but I think I covered the major stuff.

If anyone has the means to streamline this, maybe make it a pucker web installation or unified diff or whatever, then that’d be ace.

Hope it’s of some use — at least as a starting point — for those people that run forums and find BBCode a little clunky but don’t want to ditch support for it.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

Board footer

Powered by FluxBB