Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2005-08-20 15:19:00
- FireFusion
- Member

- Registered: 2005-05-10
- Posts: 698
How did you get Textile to work with PunBB?
Is there a plugin?
Edit: I’m trying to get Rickard (maker of PunBB) to replace BBcode with Textile. Anyone what to help argue my case?
Last edited by FireFusion (2005-08-29 16:01:38)
Offline
Re: How did you get Textile to work with PunBB?
as far as I know there is nothing out there. Might be wrong though
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
#3 2005-08-20 17:06:37
- Neko
- Member

- Registered: 2004-03-18
- Posts: 458
Re: How did you get Textile to work with PunBB?
There’s a PunBB plug-in but doesn’t work well. For the TXP forums I guess Dean implemented Textile by himself. It would be nice if he’ll release his hack as a plug-in.
Offline
Re: How did you get Textile to work with PunBB?
> Neko wrote:
> There’s a PunBB plug-in but doesn’t work well.
You are right. It is <a href=“http://forum.textpattern.com/viewtopic.php?id=1586”>here</a>
Last edited by colak (2005-08-21 08:56:29)
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: How did you get Textile to work with PunBB?
This is just from glancing at the code, but I believe this is all it took.
at the top of /include/parse.php:
<code>include_once ‘./classTextile.php’;
$textile = new Textile();
</code>
Then the parse_message() function was changed to this:
<code>function parse_message($text)
{
global $textile;
return $textile->textileThis($text);
}</code>
of course you’ll need a copy of classTextile.php in the /include directory
text*
Offline
Re: How did you get Textile to work with PunBB?
Just to clarify:
Which part of punBB ‘working’ with TXP are we referring to here?
Also, forgive my ignorance, but what has the textile include got to do with this?
Offline
#7 2005-08-23 14:58:04
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: How did you get Textile to work with PunBB?
This forum gets marked up by Textile (as opposed to, say, BBCode).
Offline
#8 2005-08-25 13:00:20
- davidm
- Member

- From: Paris, France
- Registered: 2004-04-27
- Posts: 719
Re: How did you get Textile to work with PunBB?
> Dean wrote:
> This is just from glancing at the code, but I believe this is all it took.
Thanks Dean I’ll try that, it’ll be cool to have textile running properly with PunBB :-)
.: Retired :.
Offline
#9 2005-08-29 16:00:12
- FireFusion
- Member

- Registered: 2005-05-10
- Posts: 698
Re: How did you get Textile to work with PunBB?
I’m trying to get Rickard to replace BBcode with Textile. Anyone what to help argue my case?
http://forums.punbb.org/viewtopic.php?id=8476
Offline
#10 2005-08-29 23:27:38
- davidm
- Member

- From: Paris, France
- Registered: 2004-04-27
- Posts: 719
Re: How did you get Textile to work with PunBB?
Textile is nice for those who know it (like txp users, or those who like it and use it with drupal or other cms that have a textile plugin), but most forumers use BBcode (and mostly the FF extensions to that effect :-)
Since there is already a textile plugin for PunBB (and you can use dean’s hack above to improve it), I don’t see why rickard should make the switch. Some will argue they’d rather have Markdown, and so on.
That said, I like texile best but then again, I am a txp junkie ;-p
.: Retired :.
Offline
Re: How did you get Textile to work with PunBB?
I tried too :)
I think at least there should be a forum setting for choosing between Textile or BBCode (and Markdown?).
But I, also, am a txp junkie.
Last edited by bluearc21 (2005-08-30 02:39:20)
“If you build it, they will come.”
Offline
#12 2005-08-30 07:03:03
- davidm
- Member

- From: Paris, France
- Registered: 2004-04-27
- Posts: 719
Re: How did you get Textile to work with PunBB?
Well bluearc21, did you try Dean’s tweak mentionned above ?
Didn’t try it…. it should work !
.: Retired :.
Offline
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
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.
Hire Txp Builders – finely-crafted code, design and Txp
Offline