vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=192)
-   -   "To the top" link in every reply (https://vborg.vbsupport.ru/showthread.php?t=136576)

StarBuG 01-14-2007 10:00 PM

"To the top" link in every reply
 
Hi

Desc: This is a simple modification. It adds an image link next to every quick reply (or quote) button in every thread and reply that brings you back to top.
Time to install: About 1Min
Templates to edit: 1
Versions: All vB Versions

In postbit template search for:

Code:

<if condition="$show['moderated']">
                <img src="$stylevar[imgdir_misc]/moderated.gif" alt="$vbphrase[moderated_post]" border="0" />
            </if>

after that add

Code:

<a href="#top" onclick="self.scrollTo(0, 0); return false;"><img src="$stylevar[imgdir_button]/top.gif" alt="$vbphrase[top]" border="0" /></a>
Now download the image I attached and upload it to /forum/images/buttons

I made you an image for the standard vBulletin Buttons but you can change it or add a different image.

Hope you like it.... and if you do don?t forget to click INSTALL

DEMO: http://www.elternfragen.net/showthread.php?t=107
Just view any thread you like to see the top button

StarBuG

Snake 01-15-2007 04:41 PM

Thanks for this. :)

StarBuG 01-15-2007 05:04 PM

You'r welcome ;)

efil 01-16-2007 04:54 AM

Thank you!

very useful.

richTV 01-22-2007 03:34 AM

works fine in 3.6.4 Kartel Style, also uploaded a pic that fits better with this style.

my question is:

this mod will take the user to the top of the page, but can this be adjusted so that it takes the user to the top of the thread if it is a multiple-page thread?

tnx for sharing this.

StarBuG 01-22-2007 03:37 PM

Adjust the onclick="self.scrollTo(0, 0) to what ever pixel height you want it to jump to (counted from the top beeing 0)

d8tabyte 01-22-2007 03:44 PM

I always have this in my forums, why it isn't a standard, I don't know. I hate having to scroll ALL the way to the bottom, just to click top. One could say, why don't you just scroll to the top then, and I answer - what's the point of convenience then? ;)

richTV 01-22-2007 05:27 PM

Quote:

Originally Posted by StarBuG (Post 1165083)
Adjust the onclick="self.scrollTo(0, 0) to what ever pixel height you want it to jump to (counted from the top beeing 0)

if i adjusted it so that it looks like:

Code:

<a href="#top" onclick="self.scrollTo(0, 10); return false;"><img src="$stylevar[imgdir_button]/top.gif" alt="Top of Page" border="0" /></a>
does this mean that if the thread was up to 10 pages long, it would take me to the beginning of the thread? or if was 30 pages long it would take me to page 20 of the thread?

i'm not a coder so i wanted to make sure i understood what u mean.

TIA

stomph 01-25-2007 11:23 PM

Perfect, thank you!

Eq4bits 02-01-2007 04:43 PM

ummm I have an English language only board... so I changed the *alt* 'nach oben' to 'To Top' as follows:
PHP Code:

<a href="#top" onclick="self.scrollTo(0, 0); return false;"><img src="$stylevar[imgdir_button]/top.gif" alt="To Top" border="0" /></a


Eq4bits 02-01-2007 04:45 PM

Quote:

Originally Posted by richTV (Post 1165136)
if i adjusted it so that it looks like:

Code:

<a href="#top" onclick="self.scrollTo(0, 10); return false;"><img src="$stylevar[imgdir_button]/top.gif" alt="Top of Page" border="0" /></a>
does this mean that if the thread was up to 10 pages long, it would take me to the beginning of the thread? or if was 30 pages long it would take me to page 20 of the thread?

i'm not a coder so i wanted to make sure i understood what u mean.

TIA

after installing and 'trying it out' :wink: regardless of what page you are on it takes you to the top of the page you are viewing, not to any other page...

StarBuG 02-01-2007 05:49 PM

Ups, missed the german phrase ;)

the self.scrollTo(0, 10) is a pixel specification not a page specification ;)

ElNino 02-03-2007 03:50 AM

thanks for that little hack.

For those which use the old forum style, edit template postbit_legacy.
find:
PHP Code:

<!-- / controls --> 

add before:
PHP Code:

<a href="#top" onclick="self.scrollTo(0, 10); return false;"><img src="$stylevar[imgdir_button]/top.gif" alt="Top of Page" border="0" /></a


Nathan2006 02-04-2007 09:05 PM

Thank you StarBuG

Just what I always wanted :D

Install

DasCool 02-05-2007 12:23 AM

All right this is not working for me, i have the pic uploaded to button and the code where it is. Nothing is shwoing up though. Thanks

StarBuG 02-05-2007 03:54 PM

Then you have made something wrong.

Check the placement of the code in your template.

This is a simple link with an image, there is nothing in this code that can be wrong except your placement of the code. ;)

StarBuG

Smoothie 02-05-2007 06:49 PM

working in both postbit and postbit_legacy.

vspro 02-07-2007 08:02 PM

me too .this is not working for me, i have the pic uploaded to button and the code where it is. Nothing is shwoing up though. Thanks
anyone show me how to fix

StarBuG 02-08-2007 04:31 AM

If you want you can copy your postbit template into a txt file and attach it to your post, I will then have a look ;)

2meplie 02-09-2007 09:40 PM

I just installed it and it didn't work. I had to install it in both postbid and postbid_legacy for it to work. I have custom styles so maybe this is why I had to do that.

StarBuG 02-10-2007 06:34 AM

you can't use both postbit and postbit legacy at the same time.
For this there can't be any dependencies.

But maybe you installed it in postbit first but watched your forum in postbit legacy, which is why you did not see it.

Anyway the only thing that counts is that it is working now ;)

Tomek 02-10-2007 06:44 AM

It would be better to use the already existing phrase in vBulletin:
Code:

$vbphrase[top]

rjmjr69 02-10-2007 10:08 AM

Quote:

Originally Posted by Tomek (Post 1178957)
It would be better to use the already existing phrase in vBulletin:
Code:

$vbphrase[top]

So with that one phrase you can but all that additional code out right? Can this be updated please

StarBuG 02-11-2007 03:50 PM

This phrase only replaces the alt text of the img, nothing more.

So you still need all the code above.

StarBuG

Eq4bits 07-14-2008 12:18 AM

works fine with 3.7.2

janelle00 02-28-2009 03:12 AM

Hi, does anyone know how can i also add also add a "to the bottom" button to each post? this "to the top" is very helpful--thank you!

DaSpyda 12-26-2009 01:21 AM

Hi, any tips on implementing this in 4.0?

I tried, but no change.

We miss it, terribly. :mad:

Thanks!


All times are GMT. The time now is 05:04 AM.

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.01500 seconds
  • Memory Usage 1,777KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_code_printable
  • (3)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (27)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete