MyBB Hacks

Full Version: Anchor Link MyCode
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
This is a simple example using MyCode for anchor link.
Because I use Easy MyCodes plugin, so this example will use it.

Create MyCode:
  1. Anchor Link
    This is link to go to a specified anchor name.
    • Title: Anchor Link
    • MyCode Pattern:

      Code:
      [al={ALPHADIGIT}]{TEXT}[/al]

      Modify it as our needs.

    • Replacement:

      Code:
      <a href="#$1">$2</a>

      Modify it as our needs.

  2. Anchor Name
    • Title: Anchor Name
    • MyCode Pattern:

      Code:
      [an={ALPHADIGIT}]{TEXT}[/an]

      Modify it as our needs.

    • Replacement:

      Code:
      <a name="$1"></a>$2

      We can use ID in the replacement above:

      Code:
      <a name="$1" id="$1"></a>$2

      Modify it as our needs.



That is our anchor link. Please make sure that we use unique name/id for our anchor links in a page.

Live Demo:
http://www.14.mynie.co.cc/showthread.php?tid=402

We can use the anchor link from other page/site to go to a specified anchor name in a thread.
Example:
http://www.14.mynie.co.cc/showthread.php...http://www.14.mynie.co.cc/showthread.php?tid=402
The link above will lead us directly to the variation anchor name in the thread.

Because I'm still learning, please tell me if there is something wrong with the MyCode above Smile
nice mod.  

I'll have to try this out on my political forum!
Can any help how to put code in post?
i try many thing but not succeed.

like [al=http://abc.com/thread-3-post-5.html#1. test]1. test [/al][an=abc.com/thread-3-post-5.html#1. test]1. test[an]

please guide.
Don't use "http://" or # symbols.
Reference URL's