PDA

View Full Version : Mini Mods - Move forumjump to the navbar with javascript


Lea Verou
07-06-2007, 10:00 PM
I wanted as many others do, to move the forumjump menu to the navbar, in the pages that it appeared.
If you just put $forumjump in the navbar, it only works in showthread. I had to think of something else.

Pros:
The original vbulletin's forumjump is used and not another re-created version.
The template edits are only 3 and the templates edited just 2: navbar and forumjump!
No vb html code is changed, the template edits are about adding code.
Very little and simple code
No pluginsCons:
This hack does not work if the forumjump is not meant to appear on a vb page, it just moves it in those pages that it would appear anyway.
The page has to load till the bottom for the forumjump to appear in the navbar. In fact it is firstly loaded at its original position and then moved via javascript in the new one, so in order for the javascript to be executed it has to be loaded at the original postion. This causes the delay.
<script> tags in the body and not in head as the standards command
If javascript is disabled, the forumjump will remain at its original position. Instructions
1. Put in the navbar where you want the forumjump to appear this code:
<span id="forumjump_span"></span>2. In template forumjump add in the start (before any code):
<span id="forumjump_originalspan">3. In template forumjump add in the end (after any code):
</span>
<script type="text/javascript">
document.getElementById('forumjump_span').innerHTM L = document.getElementById('forumjump_originalspan'). innerHTML;
document.getElementById('forumjump_originalspan'). innerHTML = '';
</script>
If you want it to remain at its original position as well remove the document.getElementById('forumjump_originalspan'). innerHTML = '';That's it!

Magnumutz
07-07-2007, 03:50 AM
Could you post a screenshot please? I have an idea of what it would look like, but not sure if it would fit.

Lea Verou
07-07-2007, 04:06 AM
Could you post a screenshot please? I have an idea of what it would look like, but not sure if it would fit.
Sorry, I can't provide a screenshot as I'm working on a private style atm.
Scroll down to the bottom of this page and you will see a small form consisting of a dropdown and a button with the words "Forum Jump". This is forumjump.

Magnumutz
07-07-2007, 04:29 AM
Yeah, i know what it is :D
But wasn't sure on how it would look on the navbar... visually.

Lea Verou
07-07-2007, 05:02 AM
You wouldn't benefit from my screenshot about it, the templates on the style I'm working on are heavily modified...

Magnumutz
07-07-2007, 07:28 AM
Oh... ok, thanks anyways.

obetyance
08-24-2007, 06:13 AM
i Love it! ;)

Lea Verou
08-24-2007, 06:14 AM
wow, somebody else installed it :P
thanks obetyance!

obetyance
08-24-2007, 10:49 PM
yes, ma'am! look here. www.filairsoft.com .

what i don't like about it is that, its not permanent on the navbar. meaning, it only shows on the navbar when it shows on its original spot.

anyhow, its what i'm really looking for and its good enough. :D

FastCougar
11-01-2007, 05:08 PM
The only downside to this hack is that the code block doesn't show until the page is fully loaded ... other than that ...great hack!

perfphysio
11-10-2007, 11:18 AM
</span>
<script type="text/javascript">
document.getElementById('forumjump_span').innerHTM L = document.getElementById('forumjump_originalspan'). innerHTML;
document.getElementById('forumjump_originalspan'). innerHTML = '';
</script> As this file already ends in a </span> comment do we still add another one berectly below it so the page ends up ending like???

</span>
</span>
<script type="text/javascript">
document.getElementById('forumjump_span').innerHTM L = document.getElementById('forumjump_originalspan'). innerHTML;
document.getElementById('forumjump_originalspan'). innerHTML = '';
</script>

Lea Verou
11-10-2007, 03:23 PM
As this file already ends in a </span> comment do we still add another one berectly below it so the page ends up ending like???

</span>
</span>
<script type="text/javascript">
document.getElementById('forumjump_span').innerHTM L = document.getElementById('forumjump_originalspan'). innerHTML;
document.getElementById('forumjump_originalspan'). innerHTML = '';
</script>
I don't think so, but I don't remember the template that well now.

@FastCougar: Same goes with some vBulletin features, such as the popup menu arrow in pagenav.