Indent BBCode

Started by GirlinGray, December 22, 2018, 09:36:15 PM

Previous topic - Next topic

GirlinGray

I've been looking for indent BBCode a long time. The only thing I've ever found is a 4 year old mod that only lists compatibility up to smf 2.0.11: http://custom.simplemachines.org/mods/index.php?mod=4003

Not sure about trying to use that on smf 2.0.15 with https in the mix.

I use html "<blockquote>" and it works but it gets pretty messy mixing html up back to back with BBCode.

Any chance anyone brilliant here has come up with an indent mod that is for sure compatible with 2.0.15?



PS: Can't use regular quote option, the blocks of text must be black 12 point Courier font on a white background to mimic very specific manuscript formatting on a webpage.
That Adams Girl

Chen Zhen

Use the Personalized BBC mod or Custom BBC mod to create it yourself.

My SMF Mods & Plug-Ins

WebDev

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

GirlinGray

I am not familiar with the Personalized BBC mod or Custom BBC mod.

Thank you for the info. I will look for those in mods.

I'm pretty lame coding php though, I'm lucky to be able to follow some of the stuff posted around here and not blow up the site on a regular basis, trying to code something myself? If those are too complex I'll flat line.

That Adams Girl

GirlinGray

Oh wow. Personalized BBC is yours. You created that? That is so cool.
That Adams Girl

GirlinGray

Question. Does "Add any HTML/Javascript/Text for every BB Code" mean there is a pretty simple menu that would allow me to put in html and assign its function a bb code approximation/label?

Or is it a lot more coplex than that requiring me to write out php code for padding or indents or tables or pixels or ems or such?

Because that second part is where I will flat line and blow up the site. (wry smile)
That Adams Girl

Chen Zhen

#5
You just select the type of BBCode you want, add the HTML/Javascript and in this case you leave the viewing & usage selected for every membergroup.
Depending on the type you can have up to 3 user settings for your bbcode: {content} {option1} {option2}

With this scenario it sounds like you want to use [tag]{content}[/tag] which is for one member input (between the BBCode tags).

Name: blockquote
Description Blockquote BBCode

No parsing, trim whitespace = none.
You can likely use the included quote image but that is up to you as it allows you to upload your own image if you want.

Here is an example for your HTML to add to the settings:

<blockquote>
<p style="background-color: white;font-size: 1.2em;font-family: courier;color: black;display: block;margin-top: 1em;margin-bottom: 1em;">{content}</p>
</blockquote>


... I don't know how you want it to look exactly so you will have to adjust the style css in that code.

My SMF Mods & Plug-Ins

WebDev

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

GirlinGray

Thank you. I will work with this and see if I can suss it out and pull it off.

I'm formatting screenplay pages in forum posts to show to students -- and screenplay format is already a ****** in just day to day life, it is more of a ****** in web formats. I have been limping in big ways a long time formatting this in the forum. The html and bbcode hate each other the html throws <'s about at the beginning of excerpts a lot. And also kicks in extra blank lines that have to be fought with. I'm forcing a lot of indents with some weird fixes like white text that in the old days would have gotten me blacklisted as a probably porn site, but who knows how white text is interpreted these days and it's a mostly private forum anyway.

(Google is already enraged at me anyway because I gave the sites a new url and yanked rebuilt them on a new host site over the holiday, and now the old domain is a redirect until it's safe to move it and rebuild that too. Google SO hates redirects.)

Anyway this is essentially what I'm working with and format counts and it's a beast making it all work without an indent code that integrates with the rest of the forum's bbcode.

What would be amazing though? To really do this right requires 3 primary indents (4 to do it really right) each on their own line, and if I could build in 3 or 4 indents without force line breaks in between them? Holy cats that would be real formatting instead of faking and forcing it the way I have been doing in smf.

That Adams Girl

GirlinGray

Oh, also, no one else in the forum needs to be able to use this code. Just me. As long as I can use it and everyone else can see it, it works.
That Adams Girl

Chen Zhen

My mod is the right fit for what you are trying to do.
What you're referring to is simple HTML containers (or in this case using SMF 2.0 branch it is XHTML) and css styling.
You can Google W3schools for HTML tag types and a list of css attributes to help you get the gist of it.
ie. to drop down a line in css you use an inner container (ie. span or div) with display: block;
(div is actually display: block by default but I shouldn't confuse you with too much info at this time).

Good luck.

My SMF Mods & Plug-Ins

WebDev

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

Chen Zhen


If you don't care who uses it then just leave all the "usage" groups checked.
If you really want to have it so only you (as Admin) can use it then uncheck all groups for usage.
Leave all groups checked under "viewing"

My SMF Mods & Plug-Ins

WebDev

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

GirlinGray

Regular forum members can't use this. Half the regular forum members can't Skype or figure out how to share a youtube clip in a forum that has Ohara YouTube embed installed. (Ahh!) (They're brilliant people, code just isn't their arena.) But spammers? Code and websites are the spammers' arena. Masking this control counts. Thank you.

Thank you so much too for all your help and time explaining things. I have to do a site back up before I launch this and also I've been up 48 hours it would probably be stupid to try to launch this tonight on very little sleep but I might go for it anyway I'm not real good at waiting. I'll let you know how it goes and hope I can yell for help if I sink.
That Adams Girl

Sesquipedalian

In addition to what Chen Zen has already helpfully said, I'd also suggest that you use his mod to create a series of BBCodes that are named for the different parts of the screenplay scripts that you need to work with, rather than naming them for different formatting effects. So instead of creating BBC for, say, [indent] or [caps] or whatever, make ones like [scene], [speaker], [dialogue], etc. Define the formatting that each of these parts needs when you create the BBC for it.

For [scene], you could define the BBC to wrap its content in a block (i.e. on its own line) that always renders its text as uppercase. For [dialogue], you could define it as a block with a margin on the left that is 10 characters wide and has a width of 40 characters (or whatever values these ought to be). For [speaker], you could give it a left margin of 20 characters and uppercase text.

Using the [scene] example, you would accomplish this by telling the BBCode to wrap its content in HTML tags like this:

<div style="text-transform: uppercase;">the scene description</div>


You would set the the [speaker] BBCode to wrap its content in HTML tags like this:

<div style="margin-left: 20ch; text-transform: uppercase;">the speaker</div>


Similarly, the [dialogue] BBCode would be set to wrap its content in HTML tags like this:

<div style="margin-left: 10ch; width: 40ch;">the dialogue</div>


Then if you entered the following into your post:


[scene]Int. – Hospital – treatment room – day[/scene]

Hearing voices, Kimble cuts short his suturing. He steps to the door and cracks it open.

[speaker]Voice (O.S.)[/speaker]
[dialogue]Yeah, an escaped killer...[/dialogue]


... the result would look like this (except not in the code block, of course):


INT. – HOSPITAL – TREATMENT ROOM – DAY

Hearing voices, Kimble cuts short his suturing. He steps to the door and cracks it open.

                    VOICE (O.S.)
          Yeah, an escaped killer...

I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

GirlinGray

That is so smart. That is exactly how I coded Microsoft Word in the old days in style sheets to format scripts. It should work the same way in the mod I think? That is brilliant. You rock.

(Of Course I was so crippled even trying to code Word, it's going to be a disaster trying to code php, probably it will require a virgin sacrifice or such AND a volcano and I know no virgins and have no proximity to a volcano, ahhh!)
That Adams Girl

Sesquipedalian

#13
Don't worry, working with HTML and CSS is way, way easier than trying to get Microsoft Word to do anything right.

Just check out W3schools like Chen Zen suggested. That site explains both HTML and CSS simply and clearly.

Also, just to be clear myself, Cascading Style Sheets (CSS) is the name of the styling language that you saw me using inside the style attributes on the div elements in the examples above. In general, HTML is used to tell the browser what the different pieces of your webpage are, while CSS tells the browser how to format those different pieces.
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

GirlinGray

This is very helpful. Thank you both so much for the help.
That Adams Girl

GirlinGray

Success! Yay yay yay!

It works!

Thank you so much again for your help and instructions and examples. This is miraculous. It fixes everything.

Yay!

You guys rock.
That Adams Girl

Sesquipedalian

I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

GirlinGray

I have a follow up question. I have created bb code using Personalized BBC and it works great, but there's a hitch, I can't use other bb code within the text. For example, if I want to red out or bold or underline some text and I try to use bb code for colors or underlines or bold for text while using the Personalized BBC? It doesn't take, instead it shows the bb code for color or underline or bold as text in the post.

Is there a fix for that?
That Adams Girl

Kindred

There is an order of operations to what bbc works and in what order.

You would have to ask in the support topic for the personalized bbc mod
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

GirlinGray

Ah. Thanks. It's something I can work around.
That Adams Girl

Advertisement: