Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Anchor and Jump BBCode! Details »»
Anchor and Jump BBCode!
Version: 1.00, by pimpery pimpery is offline
Developer Last Online: Aug 2006 Show Printable Version Email this Page

Version: 3.0.7 Rating:
Released: 07-03-2005 Last Update: 07-31-2005 Installs: 4
 
No support by the author.

This hack adds 2 BBCodes to your forum: [anchor] and [jump]
Demo: http://www.socomcity.net/forum/showthread.php?p=7353
Cross-Page Jump Demo: http://www.socomcity.net/forum/index.php (below the header, Latest Glitches Added)

[username:test][password:test] (thanks to acidburn0520 )



Functions

--------------
  • If you can't already tell from the example, you can set anchors in your posts via the [anchor] tag, and create a link that enables the user to jump to them via the [jump] tag. This comes very handy if you want to make a navigation for your forum rules, tutorials, or any other list-type post. Best of all, using cube root, the javascript function I made allows for a smooth/exponential jump.


Features

------------
  • prioritization: if there are multiple anchors - it uses DOM nesting detection to choose the anchor which is within the post containing the jump tag being clicked
  • optional cross-page jumping (hyper-link to anchors!)
  • optional key-shortcuts (remembers last anchor and last jump)
  • uses setInterval as oppose to a loop for best performance
  • works on all internet browsers
  • works on every version of vBulletin


Installation

------------------
  • Just download the zipped txt attached to this post with the 3 easy installation steps. Follow them and it's as easy as cake. Enjoy!


Hyperlinking Anchors

-----------------------------
  • To hyperlink anchors, your link must contain a reference to the post the anchor is in and the anchor of which to jump to
  • Heres the 2 possible ways (order of paramters doesn't matter - as long as the link contains the anchor parameter and a hash(#) to the post, or the p parameter to the post):
  • nameofanchor is the name of the anchor
  • 1337 is the number of the post which contains the anchor
  • http://site.com/etcetcetc?anchor=nameofanchor&p=1337
  • http://site.com/etcetcetc?anchor=nameofanchor#post1336


Key-Shortcuts

-----------------------------
  • There are two keyshortcuts: Alt+A and Alt+J
  • Alt+A (Anchor Shortcut) jumps you to the last anchor that you previously jumped to
  • Alt+J (Jump Shortcut) jumps you to the last jump tag you previously clicked

Supporters / CoAuthors

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 07-08-2005, 11:35 PM
pimpery pimpery is offline
 
Join Date: Nov 2004
Posts: 103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by acidburn0520
Mmm... the overriding thing could become a problem. At the moment I haven't disclosed how to use the vBCode to my Forum Members, so atleast they won't know how to use it. As for the tab problem... it's not like the jump takes more than 5 seconds to do... can't they wait they long to switch to another tab?
Ok.
So far (haven't updated the install.zip yet though):
hash (#anchor) support added for browsers without javascript capabilities
the scrolling now uses setInterval and clearInterval so people can switch between tabs / windows and do other stuff while waiting for the scroll to finish

TODO: working on part of the function that will recognize which anchor (if multiple ones) is closest to the jump tag on the dom tree - and will jump to that one

This way there will be no possible OVERRIDING (as acidburn said)
Reply With Quote
  #23  
Old 07-09-2005, 06:03 PM
pimpery pimpery is offline
 
Join Date: Nov 2004
Posts: 103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by pimpery
Ok.
So far (haven't updated the install.zip yet though):
hash (#anchor) support added for browsers without javascript capabilities
the scrolling now uses setInterval and clearInterval so people can switch between tabs / windows and do other stuff while waiting for the scroll to finish

TODO: working on part of the function that will recognize which anchor (if multiple ones) is closest to the jump tag on the dom tree - and will jump to that one

This way there will be no possible OVERRIDING (as acidburn said)
It took long enough (gahh! javascript >.<)
but now I have it all done.

Features include:
Support for non-javascript users
Scrolling uses setInterval so it doesn't tie up browser
Anchors in a member's own post have a higher priority than anchors in another member's post (based on DOM nesting [this was kinda hard to do!] - will always work even when vBulletin is updated)
Works on all major browsers
Reply With Quote
  #24  
Old 07-09-2005, 07:02 PM
sirbutts sirbutts is offline
 
Join Date: Sep 2004
Posts: 40
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by pimpery
It took long enough (gahh! javascript >.<)
but now I have it all done.

Features include:
Support for non-javascript users
Scrolling uses setInterval so it doesn't tie up browser
Anchors in a member's own post have a higher priority than anchors in another member's post (based on DOM nesting [this was kinda hard to do!] - will always work even when vBulletin is updated)
Works on all major browsers
Just reinstalled with the new textfile instructions.

I don't know how it really works but it's amazing how you dealt with the override thing using javascript. I mean - how does it work? Wouldnt u need to know who made what post in php to do something like that?

Anyhow - very nice job. The only thing I think you should add is maybe a little box that says can cancel the jump incase the jump is tremendously long and the person wants to cancel it.
Reply With Quote
  #25  
Old 07-09-2005, 10:38 PM
pimpery pimpery is offline
 
Join Date: Nov 2004
Posts: 103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by sirbutts
Just reinstalled with the new textfile instructions.

I don't know how it really works but it's amazing how you dealt with the override thing using javascript. I mean - how does it work? Wouldnt u need to know who made what post in php to do something like that?

Anyhow - very nice job. The only thing I think you should add is maybe a little box that says can cancel the jump incase the jump is tremendously long and the person wants to cancel it.
I attempted to do that - but the problem is it gets all stuttery since the window is scrolling at the time.
I could use position:fixed; but it's not supported by very many browsers.

BTW - I'm going to have a tutorial on my site about DOM Nesting soon. I'll pm you a link when it goes up.
Reply With Quote
  #26  
Old 07-10-2005, 03:44 AM
Kirk Y's Avatar
Kirk Y Kirk Y is offline
 
Join Date: Apr 2005
Location: Tallahassee, Florida
Posts: 2,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Updated and everything is working fine. I love how I can scroll past the anchor and it goes up... then I scroll above it and it goes down... it could easily entertain people for hours. I know some members on my site said they sat in that thread for a good 10 minutes simply clicking the jump links... lol. Thanks for the update Pimp!

Edit: I have a question for you Pimp. I have a table underneath my Forum Statistics on forumhome. Inside the table I have links to popups that give directions on the latest glitches added. Would it be possible to have a jump for the link so that once clicked it would take you to the universal glitch list (the demo page where my anchors/jumps are) and jump to the specified anchor tag? This would be like cross-page jumping, but would indeed be incredibly handy.
Reply With Quote
  #27  
Old 07-10-2005, 04:48 AM
pimpery pimpery is offline
 
Join Date: Nov 2004
Posts: 103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by acidburn0520
Updated and everything is working fine. I love how I can scroll past the anchor and it goes up... then I scroll above it and it goes down... it could easily entertain people for hours. I know some members on my site said they sat in that thread for a good 10 minutes simply clicking the jump links... lol. Thanks for the update Pimp!

Edit: I have a question for you Pimp. I have a table underneath my Forum Statistics on forumhome. Inside the table I have links to popups that give directions on the latest glitches added. Would it be possible to have a jump for the link so that once clicked it would take you to the universal glitch list (the demo page where my anchors/jumps are) and jump to the specified anchor tag? This would be like cross-page jumping, but would indeed be incredibly handy.
Great idea! Yes - that wouldn't be too hard.
I will have it like this:
http://site.com/etc..?anchor=nameofanchor

On document load a javascript function will parse the url and extract the anchor param if it exists - then it will jump to that anchor. If anchor doesn't exist, then it shows an error alert like it normally does.

There is ONE problem though
If there are multiple anchors - it won't know which one to goto since there's no reference point (no jump tag).
I have an idea though:
If we craft the url as such:
http://site.com/etc..?anchor=nameofanchor#post1337
or
http://site.com/etc..?anchor=nameofanchor&p=1337
Where 1337 is the postnumber...
Then it can also extract the postnumber and only jump to an anchor IN THE SPECIFIED POST.

I think this is a good solution. I'll have the function ready soon. I first have to pack my bags because I'm going to stonybrook for summer courses. BTW acid, you might want to redownload the zip again. There's no difference in what it does, but I did increase the performance of the function (milliseconds matter! :P)
Night mate!
Reply With Quote
  #28  
Old 07-10-2005, 04:56 AM
Kirk Y's Avatar
Kirk Y Kirk Y is offline
 
Join Date: Apr 2005
Location: Tallahassee, Florida
Posts: 2,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for taking up the task! I really appreciate it and am sure that most other members here will as well. I'll download the zip now; everything must be done faster! Ha ha, thanks again.
Reply With Quote
  #29  
Old 07-11-2005, 01:42 PM
pimpery pimpery is offline
 
Join Date: Nov 2004
Posts: 103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Updated!
Few bugs fixed.
Optional cross-page jumping feature added (hyperlink an anchor!)
Reply With Quote
  #30  
Old 07-11-2005, 06:38 PM
sirbutts sirbutts is offline
 
Join Date: Sep 2004
Posts: 40
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by pimpery
Updated!
Few bugs fixed.
Optional cross-page jumping feature added (hyperlink an anchor!)
Woah. This cross-page anchor stuff is 1337! My members love it
Thanks for the update pimpery!
Reply With Quote
  #31  
Old 07-12-2005, 03:00 AM
Kirk Y's Avatar
Kirk Y Kirk Y is offline
 
Join Date: Apr 2005
Location: Tallahassee, Florida
Posts: 2,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by pimpery
Updated!
Few bugs fixed.
Optional cross-page jumping feature added (hyperlink an anchor!)
Yipee! I'll install now... god this hack rocks! :P

Edit: Two things:
1) How on Earth do you make the hyperlink for the cross-page jump? There's no example in the installation instructions.
2) In the installation instructions, the 1A and 1B parts are right next to each other, I accidentally copied 1A's steps and 1B's and pasted them into the clientscript file as the JS function. Maybe space them apart?

Edit (Again):
1) Nevermind, was scrolling up and saw the post you made Pimp, theorizing how this could work and noticed you had posted a possible URL. I tried it out and it works. Nice job and thanks again, you may want to add an example URL into the install directions.

Oh, for anyone that wants to know:
Code:
http://www.socomcity.net/forum/showthread.php?anchor=glitch25&p=7353
socomcity.net - your website address (Obviously)
showthread.php?anchor=glitch25 - (This is the anchor's name that you'd like to jump to)
&p=7353 - (This is the post that the anchor you'd like to jump to is nested in)

Oh and Pimpery, if you'd like to add an example of the cross-page jumping feature:
User: test
Password: test
Location: http://www.socomcity.net/forum/index.php

It's just below the header, in a little table; "Latest Glitches Added".
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:06 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05415 seconds
  • Memory Usage 2,323KB
  • Queries Executed 26 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (7)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete