News:

Wondering if this will always be free?  See why free is better.

Main Menu

Go Up button

Started by NOS ChromeNut, August 15, 2005, 03:35:17 PM

Previous topic - Next topic

NOS ChromeNut

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
:-*

codenaught

#1
In Themes/default/Display.template.php


Find:

<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: 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.
Dev Consultant
Former SMF Doc Coordinator

NOS ChromeNut

Quote from: akabugeyes on August 15, 2005, 04:02:33 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

anunlike

Could this be made a feature?

JayBachatero

Quote from: anunlike on August 18, 2005, 09:34:53 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

anunlike

Yeah, I didn't think about that. Thanks.

JayBachatero

Follow me on Twitter

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

dtm.exe

akabugeyes, nice work.  This is definitley worthy being in the Tips and Tricks board, IMO.

-Dan The Man

JayBachatero

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

dtm.exe

Quote from: LiL_J 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?

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

-Dan The Man

JayBachatero

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

Xarcell

Hey, can we get this tread listed in teh tip & tricks index?

If not already listed (if I overlooked).

Thanx,

-Xarcell

gravesend46

#12
THis is kinda weird, but it replaces the MODIFY tab on my forum rather than sits alongside it.... ???

Simplemachines Cowboy

Alignment is off.
The up button is a couple of pixels aboue the others.

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

edi67

Quote from: akabugeyes on August 15, 2005, 04:02:33 PM
In Themes/default/Display.template.php


Find:

<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: 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

DJ Rg

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)

Arbalot

in display.template.php
here
<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>


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

in messageindex.templte.php
here
<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>';


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

DJ Rg

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?

JayBachatero

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

DJ Rg

#19
yes i know ..but i dont understand what code goes where...

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

already in here...

Quote from: Arbalot on May 07, 2006, 09:53:24 AM
in display.template.php
here
<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..
<a href="#bot"><b>' . $txt['topbottom5'] . '</b></a>

is already in here...


in messageindex.templte.php
here
<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?

Advertisement: