MyBB Community Forums

Full Version: How link links to words in threads?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I know my subject is confusing, but what i'm trying to do is link a word in a thread to another word in another post of the same thread. Basically I'm trying to do what they have at the MTGSalvation forums. They made links like a table of contents that are linked to larger text lower in the thread.
You can see what i'm talking about here.

You can see that the links they use in the initial post, when clicked jump down to the associated word section. How the hell do you do that? lol. I tried this by linking text to the #2 post but all it does is open the next post in a new Window.
Any insight would be helpful. Thanks.
*edit*
I noticed that the link ending on each of the "quick links" has a #Spam, #flaming, etc. Is that all i have to do to get it to work?
A plugin or javascript. For the plugin it would be when the post is parsed it would link specified stings of text with bbcode or whatever. Same for javascript except it would be done page load(and user side).
(2013-06-28, 11:40 PM)Alex Smith Wrote: [ -> ]A plugin or javascript. For the plugin it would be when the post is parsed it would link specified stings of text with bbcode or whatever. Same for javascript except it would be done page load(and user side).

Ahh, i see. You wouldn't know if this is a plugin do you or is it a user made script? Either way, if you have a name i can look up for it, please post. Smile Thanks.
You don't need a plugin, just custom MyCode. I don't have the wiki up anymore, but the help doc is still here:

http://www.tesof.com/misc.php?action=help&hid=9#toc

And just use HTML such as: http://www.htmlgoodies.com/tutorials/get...mp-Huh.htm
Oh! I misunderstood. I thought he wanted it to be automatically done based on certain text.
(2013-06-29, 12:27 AM)Tecca Wrote: [ -> ]You don't need a plugin, just custom MyCode. I don't have the wiki up anymore, but the help doc is still here:

http://www.tesof.com/misc.php?action=help&hid=9#toc

And just use HTML such as: http://www.htmlgoodies.com/tutorials/get...mp-Huh.htm

Exactly what i was looking for! Thanks a million!
Now that i have the info i need, how the heck do i use it? lol
I have no clue how to use Mycode or hot to go about making what i want happen. I get the concept and all but i don't know where to begin.
Try something similar to this (or just copy it). I use "toc" because I was using it for a table of contents, so you can change that to something else if you'd like.

Add a custom MyCode:

Title: Table of Contents Link
Short Description: Links within the table of contents
Regular Expression: \[toclink=(.*?)\](.*?)\[/toclink\]

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

That will be the text that links to the section you want to jump to. Below is what you add next to the item that's going to be jumped to.

Title: Table of Contents Jump
Short Description: Jumps to a link within the Table of Contents
Regular Expression: \[tocjump=(.*?)\](.*?)\[/tocjump\]

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


And that should do it. Then to use it, do something like:

Toys - Lorem ipsum dolor, bla bla bla, your text here ... [toclink=toys]Read more[/toclink]

That will be the link which will jump to:

[tocjump=toys][/tocjump] Toys
This is where you continue reading the text.

And that will be the jump. You can also wrap "Toys" with the jump, but it will display as a link. The way it is above, it will still jump to that spot, but without displaying anything.

Hope that helps.
(2013-06-29, 04:50 AM)Tecca Wrote: [ -> ]Try something similar to this (or just copy it). I use "toc" because I was using it for a table of contents, so you can change that to something else if you'd like.

Add a custom MyCode:

Title: Table of Contents Link
Short Description: Links within the table of contents
Regular Expression: \[toclink=(.*?)\](.*?)\[/toclink\]

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

That will be the text that links to the section you want to jump to. Below is what you add next to the item that's going to be jumped to.

Title: Table of Contents Jump
Short Description: Jumps to a link within the Table of Contents
Regular Expression: \[tocjump=(.*?)\](.*?)\[/tocjump\]

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


And that should do it. Then to use it, do something like:

Toys - Lorem ipsum dolor, bla bla bla, your text here ... [toclink=toys]Read more[/toclink]

That will be the link which will jump to:

[tocjump=toys][/tocjump] Toys
This is where you continue reading the text.

And that will be the jump. You can also wrap "Toys" with the jump, but it will display as a link. The way it is above, it will still jump to that spot, but without displaying anything.

Hope that helps.

Thanks i will give it a try.
This works like a charm. For a while i had issues figuring it out but i finally understood what i was doing wrong. Again, thank you for all your help, everyone. Heart Big Grin