![]() |
Anchor and Jump BBCode!
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 :D) Functions --------------
Features ------------
Installation ------------------
Hyperlinking Anchors -----------------------------
Key-Shortcuts -----------------------------
|
Very nice, thanks for sharing.
Could you please also provide these instructions in a textfile, so people can keep that for future reference and upgrades. |
I don't know js that well, so have no clue what that code does. Not using it on my site .. using other bbcodes that works without file modifications.
http://www.vbulletin-tutorials.com/showthread.php?t=2 |
Quote:
Instructions put in a zipped txt as for Marco's request. Thanks Marco! :) |
Oh dear lord. I love you. This is incredible... my website compiles lists of working glitches on various video games. I've moved them all into one post and have always wanted a way so that users could simply click a glitch's name from a list and they would be pointed to the appropriate glitch. Did I mention I love you? :)
Edit: It makes perfect sense that the hack I've been dreaming of finally arrives and I can't get it to work. Ha! I've cleared my cache, but still no go. I've tried in Firefox, Opera, and Internet Explorer. Will this work across most common browsers, or is it limited to IE only? Perhaps I'm not properly clearing my cache. In Firefox and Opera, there's an option that specifically states, "Clear Cache". However, in IE, there is no similar option. Perhaps an auto-installer isn't such a bad idea... for those of us not gifted with intelligence, lol. :nervous: |
Quote:
|
Oh yes, Acidburn - I forgot to tell you that for your purpose another hack I made might be better - it's called Accordion BBCode: (https://vborg.vbsupport.ru/showthrea...t=76405&page=4)
|
Well, it's still not working. I've seen the Accordian BBCode before, it's cool, but this BBCode works the best, in my opinion... plus it's like extra super-special cool. I just wish I could get it to work. I've rechecked the BBCode replacements, they're correct... I'm putting the provided code at the bottom of my vbulletin_global.js file.
Code:
tds[i].origclass = tds[i].className; By the way, I've noticed that when I place the Javascript code into the .js file, some things on my Forum mess up. Like I cannot type in the New Reply box and I cannot click on a drop-down menu. |
Acid,
Ahhh - figured it out. For some reason the install instructions within the code tags in my post were being screwed up. The code tag added spaces as shown between the n and the t: "b=b.offsetParen t" Now I only have the instructions in the zip attached. Please just download the zipped txt and copy the function from there. Sorry for the inconvenience - I guess code tags aren't suited for pasting in javascript :( |
Oh ya - If it does work after copying, please tell me so I can move the hack into the regular section.
|
AHHH!!!! OMFG! LOL! Okay...whew. It works! :D Wow, finally... damn this rocks. Nice freaking hack pimp, God I love you!
|
Quote:
Btw - could you post a link to an example of the hack on your forum so future viewers get a better idea of it - thanks. |
Anyone who downloaded - please redownload - there was a thing in the bbcode values that has been changed:
The container tags have been changed from divs to spans so content is inline instead of being pushed to a new line. |
Quote:
Edit: Okay, here's a demo link on my board. Login with username: test Login with password: test http://www.socomcity.net/forum/showthread.php?p=7353 Look for the Table of Contents section, choose a glitch, and watch your screen fly! Thanks again for this hack! |
Quote:
|
Just noticed you posted the link. Make sure you also update both your anchor and jump bbcode replacement values because as I look - the anchor bbcode is still a div tag. Just download the zipped txt and replace the anchor and jump replacement values with the new ones - thanks! :D
By the way, nice forum! |
Judging from the demo this looks like another great BBCode pimpery :)
I'll post a link tommorow to my board when I have the hack installed. |
Quote:
|
Someone alerted me that if the browser is in the middle of doing a 'jump' you cannot switch to another tab/window in the browser until the jump is finished. I believe this is due to my loop.
I'll have to change the scroll actions to setTimeout. Someone also alerted me that if someone posted an anchor tag in a post below someone elses post - the person with the above post can edit his post to have an anchor with the same name which would OVERRIDE the anchor in the post below. I'll have to add a different function rather than getElementById - which will only check for anchors within the post the anchor is within. I'm also going to have an autoinstaller made shortly. |
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?
|
Quote:
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) |
Quote:
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 |
Quote:
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. |
Quote:
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. |
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. |
Quote:
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! |
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. :)
|
Updated!
Few bugs fixed. Optional cross-page jumping feature added (hyperlink an anchor!) :D |
Quote:
Thanks for the update pimpery! :) |
Quote:
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 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". |
Quote:
He did add the instructions about how to do the anchor link in the vB3.5 post. Aye guess he forgot to do it here |
Thanks for clarifying that sirbutts.
Yeh. Sorry bout that, acid. I didn't realize that I had only put them in the 3.5 post. Anyhow, I just updated the main post with your example cross-page url - and the instructions on how to use the cross-page jumping. Glad ya like the hack as well - but it seems that not many others are using it. Hehe - if they only knew how nice it was :D |
Well, in my opinion, this is a must for anyone that lists information on their site.
|
This does not work in Safari. The page simply scrolls to the bottom. There's no jumping or linking to anywhere else. Click a link.... wait for the page to scroll to the bottom, and then, not be able to scroll up again because it continues to scroll downward.
|
Quote:
|
Quote:
|
I wish I had a mac so I could help ya, but who uses macs anyways? They suck ass! :lick:
|
Quote:
|
Quote:
I was referring to the demo links. I haven't installed because this hack will absolutely exclude most Mac users from using the links and in return annoy the hell out of them. |
Hmm... that's a shame. This is a great vBCode. Do Firefox/Opera work on Mac?
|
All times are GMT. The time now is 09:44 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|