Help - Search - Members - Calendar
Full Version: How Can I Get [p] And [anchor] Codes On My Forum?
Sal's RuneScape Forum > Everything... Not RuneScape > Tech Talk > Programming & Web Development
Shade Pure
I tried doing the
CODE
[p][/p] and [anchor=1]Anchor[/anchor]
BBCode on my forum and it didn't work, can you guys give me the code that I can set into my forum so it will work?
Roy
QUOTE (Shade Pure @ Aug 28 2009, 08:55 PM) *
I tried doing the
CODE
[p][/p] and [anchor=1]Anchor[/anchor]
BBCode on my forum and it didn't work, can you guys give me the code that I can set into my forum so it will work?

You want the 'and anchor' inside the box like this?
and Anchor

CODE
[p] and [anchor=1]Anchor[/anchor][/p]
Shade Pure
No, I want both options, I created my own forum, but I can't use either of those. Does BBCode work with MyBB?
Agent F
I've never used MyBB, but I assume they have an area in the Admin Control Panel for adding custom BBcodes. One thing you need to know is that BBcodes need a HTML replacement. When you submit a post on a bulletin board, the forum converts all the BBcode into the HTML counterpart and then outputs that to your browser. So when you add a paragraph tag and a anchor/name tags, you also need to add the HTML replacement code.

The HTML for paragraphs is:
CODE
<p>{TEXT}</p>

and the BBcode usage is:
CODE
[p]{TEST}[/p]

Notice I put "Text" in brackets. This is called a token and the forum interprets that token as the stuff the user places within the BBcode. This might not even be the right token for MyBB forums, so consult the manual if it doesn't work. You can also add a style attributes to the paragraph tag using inline-CSS or add a class attribute to the HTML replacement and add the CSS attributes to the actual CSS document for the style. It's your choice.

Anchor tags are hyperlinks. Instead of jumping to the top of a page, they can be marked to jump midway on a page. This requires two BBcodes; an anchor tag and a name tag. The anchor is the link to the area you're jumping to, and the name tag is the area you want to jump to.
BBcode usage for anchor tag:
CODE
[anchor={SIMPLETEXT}]{TEXT}[/anchor]

HTML replacement:
CODE
<a href="#{SIMPLETEXT}">{TEXT}</a>


BBcode usage for name tag:
CODE
[name={SIMPLETEXT}]{TEXT}[/name]

HTML replacement:
CODE
<a name="{SIMPLETEXT}">{TEXT}</a>

SimpleText is another token and it's there to identify the difference between the two input areas for the end-user.
Shade Pure
Thanks Agent F, I'm going to have to look up a few tutorials on making BBCode, now the anchor thing makes sense smile.gif well, okay thanks.
Yippee
Just one correction to what Agent F said. The HTML paragraph tag is '<p>', but the equivalent to the [.p] tag (at least on Sal's and my forum) is actually something like:

CODE
<div style="border:1px solid #000000; -moz-border-radius:8px; padding-left:10px; padding-right:10px; padding-top:5px; padding-bottom:5px;">


And the equivalent to the [./p] tag is just '</div>'.

The color of the border (#000000) can be changed to whatever you want, as long as it's hexadecimal or one of the predefined colors recognized by browsers. I always use the hex version just to make sure all browsers can recognize it.

Sorry about the .'s in the tags, I'm not sure what Sal's equivalent to [nocode] is, or if it has one.
Shade Pure
K thanks Yippee smile.gif.
error404
QUOTE (Yippee @ Aug 29 2009, 01:44 PM) *
Just one correction to what Agent F said. The HTML paragraph tag is '<p>', but the equivalent to the [.p] tag (at least on Sal's and my forum) is actually something like:

CODE
<div style="border:1px solid #000000; -moz-border-radius:8px; padding-left:10px; padding-right:10px; padding-top:5px; padding-bottom:5px;">


And the equivalent to the [./p] tag is just '</div>'.

The color of the border (#000000) can be changed to whatever you want, as long as it's hexadecimal or one of the predefined colors recognized by browsers. I always use the hex version just to make sure all browsers can recognize it.

Sorry about the .'s in the tags, I'm not sure what Sal's equivalent to [nocode] is, or if it has one.

No code is this
CODE
[p].............[/p]

Html is this:
HTML
<div style="border:1px solid #000000; -moz-border-radius:8px; padding-left:10px; padding-right:10px; padding-top:5px; padding-bottom:5px;">
-tag is html
Agent F
QUOTE (Yippee @ Aug 29 2009, 08:44 AM) *
Just one correction to what Agent F said. The HTML paragraph tag is '<p>', but the equivalent to the [.p] tag (at least on Sal's and my forum) is actually something like:

CODE
<div style="border:1px solid #000000; -moz-border-radius:8px; padding-left:10px; padding-right:10px; padding-top:5px; padding-bottom:5px;">


And the equivalent to the [./p] tag is just '</div>'.

The color of the border (#000000) can be changed to whatever you want, as long as it's hexadecimal or one of the predefined colors recognized by browsers. I always use the hex version just to make sure all browsers can recognize it.

Sorry about the .'s in the tags, I'm not sure what Sal's equivalent to [nocode] is, or if it has one.

Everything I said was accurate. You can substitute the HTML tag for a paragraph, span, or division and make them all look the same with CSS. The paragraph tag by default has attributes assigned to it while using a division or span would require adjustments to the CSS to match its display.

You didn't post a correction. You posted an alternate. tongue.gif
error404
QUOTE (Yippee @ Aug 29 2009, 12:44 PM) *
Just one correction to what Agent F said. The HTML paragraph tag is '<p>', but the equivalent to the [.p] tag (at least on Sal's and my forum) is actually something like:

CODE
<div style="border:1px solid #000000; -moz-border-radius:8px; padding-left:10px; padding-right:10px; padding-top:5px; padding-bottom:5px;">


And the equivalent to the [./p] tag is just '</div>'.

The color of the border (#000000) can be changed to whatever you want, as long as it's hexadecimal or one of the predefined colors recognized by browsers. I always use the hex version just to make sure all browsers can recognize it.

Sorry about the .'s in the tags, I'm not sure what Sal's equivalent to [nocode] is, or if it has one.

To add to that in IPB there are contents and options so it should be:
HTML
<div style="border:1px solid #000000; -moz-border-radius:8px; padding-left:10px; padding-right:10px; padding-top:5px; padding-bottom:5px;">{content}</div>
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.