I'm migrating out of vBulletin and we've got a tag there some folks use... [indent].
Since I'm one of them and find it handy, I'm wondering how I might go about adding it to bbcode?
Since I'm pretty sure there's no such thing as an indent tag in HTML, I'll probably want to use the dd tag or something. (vBulletin actually converts INDENT into blockquote and converts its QUOTE tags into table cells!... definitely not interested in going that route!).

Anyway, any tips appreciated.

Comments

naudefj’s picture

Status: Active » Needs work

Good idea. Can you please start working on a patch?

aharown07’s picture

Don't know how to do that, or I would. Was hoping the suggestion would pique the interest of someone with the necessary skills.

nileshgr’s picture

Status: Needs work » Patch (to be ported)
StatusFileSize
new1.12 KB
new663 bytes

Hi there ! I also needed this, so I've created two patches for this. One for bbcode-filter.inc & another for bbcode-help.inc illustrating its usage.

I've also tested it, and its working fine. It doesn't have any CSS setting (I'm using div's style attribute).

Hope its ported in next release.

If you get any problems while applying the patch, request another patch.

I cd into bbcode directory then ran patch -i ../patch1 and similarly for patch2.

nileshgr’s picture

Category: support » task
StatusFileSize
new1.12 KB

Sorry, I inserted by mistake a <br> in help file. Uploading another patch for the help file.

naudefj’s picture

Version: 6.x-1.2 » master
Assigned: Unassigned » naudefj
Status: Patch (to be ported) » Fixed

Looks good!
Your patch was applied.
For details, see http://drupal.org/cvs?commit=328156

nileshgr’s picture

Status: Fixed » Needs review
StatusFileSize
new664 bytes

Hey there seems to be some big time bug in the regex I put in.
I had tested it thoroughly before uploading the patch here, but I don't know how it stopped working on my site.
Now I again edited bbcode-filter.inc and added the 's' flag to the regex and it started working.

I'm uploading the new patch again, PLEASE TEST IT BEFORE COMMITING IT !!!

nileshgr’s picture

Status: Needs review » Patch (to be ported)

I saw the CVS tree. You've commited it. So changing the status.

naudefj’s picture

Status: Patch (to be ported) » Needs review

Sorry, patch will be rolled back until it's properly tested by a third party.

nileshgr’s picture

StatusFileSize
new621 bytes

Yep, it seriously needs to be rolled back from bbcode-filter.inc and as well as bbcode-help.inc.

There's something seriously wrong in it. It was working previously, but now it isn't.

It works just for one level. It fails in multiple levels.

But I found a method to accomplish this without using preg_replace, but str_ireplace. As you know str_ireplace is much faster than preg_replace, it will be better I think.

I have switched to str_ireplace method. You can test it at my site- www.itech7.com

Try to put a comment using BBCode format and click on preview. It will show you proper code.

Here I'm attaching a patch.

In the patch, I changed str_replace to str_ireplace because users can input [HR], [BR], [SP] instead of their lowercase counterparts. The [indent] substitute and the [/indent] substitute has been added to the same array.

nileshgr’s picture

why doesn't the person who started this thread come here and check out the patches ?

aharown07’s picture

Sorry about that. Moved on to another solution long ago. What I ended up doing was keeping all the vbulletin stuff I was going to import in a separate archive.
If I were going to do it today though, I would just replace all the "[indent]" tags with html dd tags in the database itself.
(At the time--almost a year ago--I didn't know how to do that)

nileshgr’s picture

Ah great. Well my patch doesn't use dd or something else. Its a div element with css setting :)

naudefj’s picture

Version: master » 7.x-1.x-dev
Issue summary: View changes
Status: Needs review » Fixed

The latest version has an [indent] tag.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.