Advertisement:

Author Topic: Indent BBCode  (Read 5131 times)

Offline GirlinGray

  • Semi-Newbie
  • *
  • Posts: 63
  • Go big or stay home.
    • SeeMaxRun
Indent BBCode
« on: December 22, 2018, 09:36:15 PM »
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

Offline Chen Zhen

  • Sophist Member
  • *****
  • Posts: 1,185
  • Gender: Male
  • If you're going through hell, keep going!
    • Underdog-01 on GitHub
    • WebDev.ca
Re: Indent BBCode
« Reply #1 on: December 22, 2018, 09:38:47 PM »
Use the Personalized BBC mod or Custom BBC mod to create it yourself.

My SMF Mods & Plug-Ins

WebDev
Simple Portal Support

Request politely & demand nothing.

Offline GirlinGray

  • Semi-Newbie
  • *
  • Posts: 63
  • Go big or stay home.
    • SeeMaxRun
Re: Indent BBCode
« Reply #2 on: December 22, 2018, 09:45:30 PM »
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

Offline GirlinGray

  • Semi-Newbie
  • *
  • Posts: 63
  • Go big or stay home.
    • SeeMaxRun
Re: Indent BBCode
« Reply #3 on: December 22, 2018, 09:50:41 PM »
Oh wow. Personalized BBC is yours. You created that? That is so cool.
That Adams Girl

Offline GirlinGray

  • Semi-Newbie
  • *
  • Posts: 63
  • Go big or stay home.
    • SeeMaxRun
Re: Indent BBCode
« Reply #4 on: December 22, 2018, 10:00:41 PM »
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

Offline Chen Zhen

  • Sophist Member
  • *****
  • Posts: 1,185
  • Gender: Male
  • If you're going through hell, keep going!
    • Underdog-01 on GitHub
    • WebDev.ca
Re: Indent BBCode
« Reply #5 on: December 22, 2018, 10:10:14 PM »
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:
Code: [Select]
<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.
« Last Edit: December 22, 2018, 10:23:18 PM by Chen Zhen »

My SMF Mods & Plug-Ins

WebDev
Simple Portal Support

Request politely & demand nothing.

Offline GirlinGray

  • Semi-Newbie
  • *
  • Posts: 63
  • Go big or stay home.
    • SeeMaxRun
Re: Indent BBCode
« Reply #6 on: December 22, 2018, 10:42:39 PM »
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

Offline GirlinGray

  • Semi-Newbie
  • *
  • Posts: 63
  • Go big or stay home.
    • SeeMaxRun
Re: Indent BBCode
« Reply #7 on: December 22, 2018, 10:47:15 PM »
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

Offline Chen Zhen

  • Sophist Member
  • *****
  • Posts: 1,185
  • Gender: Male
  • If you're going through hell, keep going!
    • Underdog-01 on GitHub
    • WebDev.ca
Re: Indent BBCode
« Reply #8 on: December 22, 2018, 10:51:55 PM »
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
Simple Portal Support

Request politely & demand nothing.

Offline Chen Zhen

  • Sophist Member
  • *****
  • Posts: 1,185
  • Gender: Male
  • If you're going through hell, keep going!
    • Underdog-01 on GitHub
    • WebDev.ca
Re: Indent BBCode
« Reply #9 on: December 22, 2018, 10:53:38 PM »

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
Simple Portal Support

Request politely & demand nothing.

Offline GirlinGray

  • Semi-Newbie
  • *
  • Posts: 63
  • Go big or stay home.
    • SeeMaxRun
Re: Indent BBCode
« Reply #10 on: December 22, 2018, 11:23:56 PM »
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

Offline Sesquipedalian

  • The Mad Doctor
  • On Hiatus
  • Sr. Member
  • *
  • Posts: 970
  • Gender: Male
  • It works! ... in theory.
    • Sesquipedalian on GitHub
Re: Indent BBCode
« Reply #11 on: December 23, 2018, 01:40:09 AM »
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:
Code: [Select]
<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:
Code: [Select]
<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:
Code: [Select]
<div style="margin-left: 10ch; width: 40ch;">the dialogue</div>

Then if you entered the following into your post:

Code: [Select]
[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):

Code: [Select]
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.

Offline GirlinGray

  • Semi-Newbie
  • *
  • Posts: 63
  • Go big or stay home.
    • SeeMaxRun
Re: Indent BBCode
« Reply #12 on: December 23, 2018, 03:09:52 AM »
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

Offline Sesquipedalian

  • The Mad Doctor
  • On Hiatus
  • Sr. Member
  • *
  • Posts: 970
  • Gender: Male
  • It works! ... in theory.
    • Sesquipedalian on GitHub
Re: Indent BBCode
« Reply #13 on: December 23, 2018, 04:12:06 PM »
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.
« Last Edit: December 23, 2018, 04:23:30 PM by Sesquipedalian »
I promise you nothing.

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

Offline GirlinGray

  • Semi-Newbie
  • *
  • Posts: 63
  • Go big or stay home.
    • SeeMaxRun
Re: Indent BBCode
« Reply #14 on: December 23, 2018, 05:13:49 PM »
This is very helpful. Thank you both so much for the help.
That Adams Girl

Offline GirlinGray

  • Semi-Newbie
  • *
  • Posts: 63
  • Go big or stay home.
    • SeeMaxRun
Re: Indent BBCode
« Reply #15 on: December 23, 2018, 08:48:54 PM »
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

Offline Sesquipedalian

  • The Mad Doctor
  • On Hiatus
  • Sr. Member
  • *
  • Posts: 970
  • Gender: Male
  • It works! ... in theory.
    • Sesquipedalian on GitHub
Re: Indent BBCode
« Reply #16 on: December 23, 2018, 10:47:29 PM »
Glad to help. :)
I promise you nothing.

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

Offline GirlinGray

  • Semi-Newbie
  • *
  • Posts: 63
  • Go big or stay home.
    • SeeMaxRun
Re: Indent BBCode
« Reply #17 on: December 25, 2018, 01:34:31 AM »
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

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,565
  • Gender: Male
    • Kindred-999 on GitHub
Re: Indent BBCode
« Reply #18 on: December 25, 2018, 08:34:26 AM »
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
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline GirlinGray

  • Semi-Newbie
  • *
  • Posts: 63
  • Go big or stay home.
    • SeeMaxRun
Re: Indent BBCode
« Reply #19 on: December 25, 2018, 03:18:05 PM »
Ah. Thanks. It's something I can work around.
That Adams Girl