Advertisement:

Author Topic: Go Up button  (Read 35528 times)

Offline NOS ChromeNut

  • Semi-Newbie
  • *
  • Posts: 76
  • Gender: Male
    • Squad NOS
Go Up button
« on: August 15, 2005, 03:35:17 PM »
Hi all!  I'm very happy to be a proud SMF user (gee, sounds like a new drug!), and am thoroughly enjoying the forums I've created with this fine product.  Great job dev team!!

I posted a similar question in the 1.0.5 thread, but it actually belonged here and the answer I got over there was extremely vague to say the least.  Maybe here it will get a little more attention.

I know that you can define the number of posts viewed in a thread, and that it's controlled through the admin panel (not sure if it's user controlled or not, but doesn't matter), but what if you're posts are realllllly long, and even if you limit view of 9 posts to a page it still can be rather lengthy, and I'm wearing out the scroll button on my mouse.

Is there no way to embed the Go Up button in each post, similar to phpBB, so that if you want to go to the top of the page you can at any point?  It must not be terribly hard but I'm no SMF whiz.

Kindest regards and best wishes to all SMF'ers!!

RobinH
 :-*

Offline codenaught

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 14,653
  • Gender: Male
  • Formerly Known As akabugeyes
Re: Go Up button
« Reply #1 on: August 15, 2005, 04:02:33 PM »
In Themes/default/Display.template.php


Find:

Code: [Select]
<a href="', $scripturl, '?action=post;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/modify.gif" alt="' . $txt[66] . '" border="0" />' : $txt[17]), '</a>';
Add:
Code: [Select]
echo '  <a href="#top">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/go_up.gif" alt="' . $txt['topbottom4'] . '" border="0" align="top" />' : $txt['topbottom4']) . '</a>';
That will add it after the Modify button.
« Last Edit: August 15, 2005, 04:08:24 PM by akabugeyes »
Dev Consultant
Former SMF Doc Coordinator

Offline NOS ChromeNut

  • Semi-Newbie
  • *
  • Posts: 76
  • Gender: Male
    • Squad NOS
Re: Go Up button
« Reply #2 on: August 18, 2005, 09:28:54 PM »
In Themes/default/Display.template.php

That will add it after the Modify button.

OMG that did it!!! Love ya!!!!! That was just too darned simple.

 ;D

Offline anunlike

  • Sr. Member
  • ****
  • Posts: 746
  • Gender: Male
Re: Go Up button
« Reply #3 on: August 18, 2005, 09:34:53 PM »
Could this be made a feature?

Offline JayBachatero

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,562
  • Gender: Male
    • @jaycreations on Twitter
    • JayBachatero.com
Re: Go Up button
« Reply #4 on: August 18, 2005, 11:07:19 PM »
Could this be made a feature?

its all a matter of choice of the theme developers.  there are themes that come with this.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Offline anunlike

  • Sr. Member
  • ****
  • Posts: 746
  • Gender: Male
Re: Go Up button
« Reply #5 on: August 19, 2005, 12:02:16 AM »
Yeah, I didn't think about that. Thanks.

Offline JayBachatero

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,562
  • Gender: Male
    • @jaycreations on Twitter
    • JayBachatero.com
Re: Go Up button
« Reply #6 on: August 19, 2005, 12:10:24 AM »
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Offline dtm.exe

  • SMF Hero
  • ******
  • Posts: 5,465
Re: Go Up button
« Reply #7 on: August 19, 2005, 12:12:33 AM »
akabugeyes, nice work.  This is definitley worthy being in the Tips and Tricks board, IMO.

-Dan The Man

Offline JayBachatero

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,562
  • Gender: Male
    • @jaycreations on Twitter
    • JayBachatero.com
Re: Go Up button
« Reply #8 on: August 19, 2005, 12:14:20 AM »
its weird though if the image and the text is there why its not in the theme?
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Offline dtm.exe

  • SMF Hero
  • ******
  • Posts: 5,465
Re: Go Up button
« Reply #9 on: August 19, 2005, 12:15:38 AM »
its weird though if the image and the text is there why its not in the theme?

It's just one of those additional and optional options.

-Dan The Man

Offline JayBachatero

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,562
  • Gender: Male
    • @jaycreations on Twitter
    • JayBachatero.com
Re: Go Up button
« Reply #10 on: August 19, 2005, 12:20:07 AM »
oic.  maybe it should be added to the theme options were you can check it off if you want it on or off.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Offline Xarcell

  • SMF Hero
  • ******
  • Posts: 1,684
  • Gender: Male
  • SMF-DP Supporter
Re: Go Up button
« Reply #11 on: August 19, 2005, 10:41:08 PM »
Hey, can we get this tread listed in teh tip & tricks index?

If not already listed (if I overlooked).

Thanx,

-Xarcell

Offline gravesend46

  • Semi-Newbie
  • *
  • Posts: 24
Re: Go Up button
« Reply #12 on: November 22, 2005, 11:20:10 AM »
THis is kinda weird, but it replaces the MODIFY tab on my forum rather than sits alongside it.... ???
« Last Edit: January 01, 2006, 08:55:41 PM by gravesend46 »

Offline Simplemachines Cowboy

  • Jr. Member
  • **
  • Posts: 354
  • KA-CLICK
    • The Open Range
Re: Go Up button
« Reply #13 on: November 22, 2005, 03:12:24 PM »
Alignment is off.
The up button is a couple of pixels aboue the others.

I removed the
Quote
align="top"
and made it
Quote
'" border="0" />'
and it aligns just fine.
My SMF forum: The Open Range

Offline edi67

  • SMF Hero
  • ******
  • Posts: 1,532
  • Gender: Male
  • Italian Supporter
    • CrazyZone
Re: Go Up button
« Reply #14 on: November 23, 2005, 12:51:36 AM »
In Themes/default/Display.template.php


Find:

Code: [Select]
<a href="', $scripturl, '?action=post;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/modify.gif" alt="' . $txt[66] . '" border="0" />' : $txt[17]), '</a>';
Add:
Code: [Select]
echo '  <a href="#top">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/go_up.gif" alt="' . $txt['topbottom4'] . '" border="0" align="top" />' : $txt['topbottom4']) . '</a>';
That will add it after the Modify button.

this trip not work with FIREFOX in index.teamplte.php , appear button but clicking it nothing appear some solution for make it work ?
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

Offline DJ Rg

  • Jr. Member
  • **
  • Posts: 122
  • Gender: Male
  • Hi There!
    • BZoO Radio WorldWide
Re: Go Up button
« Reply #15 on: May 07, 2006, 09:47:39 AM »
How about a code for a "Go Down" Button ..also seems SMF use text links at top and button ..what would the code be to change the text to buttons, also where would that code go..

thanks..

 8)

Offline Arbalot

  • SMF Hero
  • ******
  • Posts: 3,635
  • Gender: Male
  • SMF Hastası
    • SMF Destek
Re: Go Up button
« Reply #16 on: May 07, 2006, 09:53:24 AM »
in display.template.php
here
Code: [Select]
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="middletext" valign="bottom" style="padding-bottom: 4px;">', $txt[139], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . ' &nbsp;&nbsp;<a href="#lastPost"><b>' . $txt['topbottom5'] . '</b></a>' : '', '</td>
<td align="right" style="padding-right: 1ex;">
<div class="nav" style="margin-bottom: 2px;"> ', $context['previous_next'], '</div>
<table cellpadding="0" cellspacing="0">
<tr>
', template_button_strip($normal_buttons, 'bottom'), '
</tr>
</table>

Code: [Select]
<a href="#lastPost"><b>' . $txt['topbottom5'] . '</b></a>
in messageindex.templte.php
here
Code: [Select]
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="middletext">', $txt[139], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '&nbsp;&nbsp;<a href="#bot"><b>' . $txt['topbottom5'] . '</b></a>' : '', '</td>
<td align="right" style="padding-right: 1ex;">
<table cellpadding="0" cellspacing="0">
<tr>
', template_button_strip($normal_buttons, 'bottom'), '
</tr>
</table>
</td>
</tr>
</table>';

Code: [Select]
<a href="#bot"><b>' . $txt['topbottom5'] . '</b></a>

Offline DJ Rg

  • Jr. Member
  • **
  • Posts: 122
  • Gender: Male
  • Hi There!
    • BZoO Radio WorldWide
Re: Go Up button
« Reply #17 on: May 07, 2006, 10:52:09 AM »
i am sorry, i dont understand ..my template already has that info in it ..what do i change ..and what do i change it too?

this is for the "Go To Top" Button correct? What do i do/use for the "Go To Bottom" button?

Offline JayBachatero

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,562
  • Gender: Male
    • @jaycreations on Twitter
    • JayBachatero.com
Re: Go Up button
« Reply #18 on: May 07, 2006, 02:08:28 PM »
That is for the go bottom link.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Offline DJ Rg

  • Jr. Member
  • **
  • Posts: 122
  • Gender: Male
  • Hi There!
    • BZoO Radio WorldWide
Re: Go Up button
« Reply #19 on: May 07, 2006, 04:34:28 PM »
yes i know ..but i dont understand what code goes where...

this is
<a href="#lastPost"><b>' . $txt['topbottom5'] . '</b></a>

already in here...

in display.template.php
here
Code: [Select]
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="middletext" valign="bottom" style="padding-bottom: 4px;">', $txt[139], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . ' &nbsp;&nbsp;<a href="#lastPost"><b>' . $txt['topbottom5'] . '</b></a>' : '', '</td>
<td align="right" style="padding-right: 1ex;">
<div class="nav" style="margin-bottom: 2px;"> ', $context['previous_next'], '</div>
<table cellpadding="0" cellspacing="0">
<tr>
', template_button_strip($normal_buttons, 'bottom'), '
</tr>
</table>

~*~

and this..
Code: [Select]
<a href="#bot"><b>' . $txt['topbottom5'] . '</b></a>
is already in here...


in messageindex.templte.php
here
Code: [Select]
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="middletext">', $txt[139], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '&nbsp;&nbsp;<a href="#bot"><b>' . $txt['topbottom5'] . '</b></a>' : '', '</td>
<td align="right" style="padding-right: 1ex;">
<table cellpadding="0" cellspacing="0">
<tr>
', template_button_strip($normal_buttons, 'bottom'), '
</tr>
</table>
</td>
</tr>
</table>';



as it is also now in my templates..

i dont understand what i am suppose change and where?
« Last Edit: May 07, 2006, 04:37:20 PM by DJ Rg »