MyBB Community Forums

Full Version: <a name="ex"><a/> MyCode Sectional Reference
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Two MyCodes, one optional.

First-

Regular Expression
\[a=(.*?)\]

and

Replacement
<a name="$1"></a>

What this does is set a sectional reference for pages in threads/posts. Useful for marking an exact spot to link people to. You can direct it with the normal [url] tags, but I also added a MyCode to work within the thread to keep things simple.

Second-

Regular Expression
\[ar=(.*?)\](.*?)\[/ar\]

and

Replacement
<a href="#$1">$2</a>


Live Preview (no registration needed): http://www.theboywholived.net/Thread-New...References

Didn't see this before, hopes it helps someone out there.
Awesome for tutorial / wiki-type threads. Nice work. Smile
I think you have to use id="" to, an the "" (quotation marks), like this:
<a name="$1" id="$1"></a>
(2011-08-15, 01:37 AM)Sama34 Wrote: [ -> ]I think you have to use id="" to, an the "" (quotation marks), like this:
<a name="$1" id="$1"></a>

Works without it just fine. How is your change necessary?
(2011-08-15, 02:28 AM)xerotic Wrote: [ -> ]
(2011-08-15, 01:37 AM)Sama34 Wrote: [ -> ]I think you have to use id="" to, an the "" (quotation marks), like this:
<a name="$1" id="$1"></a>

Works without it just fine. How is your change necessary?

You need the quotation marks for it to be xhtml validated, and the id for older browsers support I think.
(2011-08-15, 03:10 AM)Sama34 Wrote: [ -> ]
(2011-08-15, 02:28 AM)xerotic Wrote: [ -> ]
(2011-08-15, 01:37 AM)Sama34 Wrote: [ -> ]I think you have to use id="" to, an the "" (quotation marks), like this:
<a name="$1" id="$1"></a>

Works without it just fine. How is your change necessary?

You need the quotation marks for it to be xhtml validated, and the id for older browsers support I think.

Oh yeah, I see. Silly mistake, really. Thank you Smile

Updated OP.