MyBB Community Forums
<a name="ex"><a/> MyCode Sectional Reference - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Resources (https://community.mybb.com/forum-8.html)
+--- Forum: MyCodes (https://community.mybb.com/forum-117.html)
+--- Thread: <a name="ex"><a/> MyCode Sectional Reference (/thread-101648.html)



<a name="ex"><a/> MyCode Sectional Reference - xerotic - 2011-08-14

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-Feature-Sectional-References

Didn't see this before, hopes it helps someone out there.


RE: <a name="ex"><a/> MyCode - Jordan L. - 2011-08-14

Awesome for tutorial / wiki-type threads. Nice work. Smile


RE: <a name="ex"><a/> MyCode Sectional Reference - Omar G. - 2011-08-15

I think you have to use id="" to, an the "" (quotation marks), like this:
<a name="$1" id="$1"></a>



RE: <a name="ex"><a/> MyCode Sectional Reference - xerotic - 2011-08-15

(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?


RE: <a name="ex"><a/> MyCode Sectional Reference - Omar G. - 2011-08-15

(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.


RE: <a name="ex"><a/> MyCode Sectional Reference - xerotic - 2011-08-15

(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.