Advertisement:

Author Topic: Back to Top  (Read 6176 times)

Online Labradoodle-360

  • Developer
  • SMF Super Hero
  • *
  • Posts: 11,469
  • Gender: Male
    • matthew.kerle on Facebook
    • @matthew_kerle on Twitter
Back to Top
« on: January 18, 2010, 05:42:38 PM »
Link to Mod

Back to Top

Written by: Labradoodle-360
Current version: 1.1
Updates: Mod Support Topic
Suitable for: SMF 1.1.11, SMF 2.0 RC2, SMF 2.0 RC3
Supported languages:

Link to Mod | Donate




Summary

Back to Top adds an anchor to the top of index.template.php and a link in the footer of every page. Back to Top v1.1 now has the ability to toggle smoothscroll!

Installation

Package Manager should work in most cases. If you need to make any edits, the full list can be obtained from the Parse function on the right..

Useful links
Manual Installation Of Mods
How Do I Modify Files?

Support

Questions should be address to the mod support topic.

Updating

Version 1.1 adds it's own mod tab for toggling smoothscroll (SMF 2.0 Only), for SMF 1.1, the setting is added to Features and Options.
Mod is not utf-8 compatible.

Changelog

1.1 - 03.10.2010
Version 1.1 Released!

1.0 - 4 January 2010
First release of Back to Top

Files modified by Back to Top
./Sources/Admin.php (SMF 2.0 Only)
./Sources/Load.php
./Sources/ManageSettings.php (SMF 2.0 Only)
./Sources/ModSettings.php (SMF 1.1 Only)
./Themes/default/index.template.php
./Themes/default/languages/Modifications.english.php
smoothscroll.js added to either $themedir or $themedir/scripts depending on version of SMF.

Smoothscroll JavaScript: The smoothscroll.js file is from Kryogenix.org.
« Last Edit: March 10, 2010, 03:42:00 PM by Labradoodle-360 »

The quality of the responses received is directly proportional to the quality of the question asked. | My Modifications

Online Labradoodle-360

  • Developer
  • SMF Super Hero
  • *
  • Posts: 11,469
  • Gender: Male
    • matthew.kerle on Facebook
    • @matthew_kerle on Twitter
Re: Back to Top
« Reply #1 on: January 18, 2010, 10:06:45 PM »
After updating the rest of my mods, I will go back and make a quick update to Back to Top, v1.1, will be compiled into one version instead of Regular and Smoothscroll, using an admin option to enable/disable the Smoothscroll effect.

Labradoodle-360

The quality of the responses received is directly proportional to the quality of the question asked. | My Modifications

Offline shakaran

  • Semi-Newbie
  • *
  • Posts: 57
  • Gender: Male
    • .::ApogeusOne::.
Re: Back to Top
« Reply #2 on: February 06, 2010, 06:02:01 PM »
This lines fails for me:
         
Code: [Select]
<li class="last">
<a id="button_wap2" href="', $scripturl , '?wap2" class="new_win"><span>', $txt['wap2'], '</span></a>
</li>

Because the file $themedir/index.template.php have:

Code: [Select]
<li class="last"><a id="button_wap2" href="', $scripturl , '?wap2" class="new_win"><span>', $txt['wap2'], '</span></a></li>
I attach the file fixed for the install and I add the translation for spanish, spanish-utf8, spanish_es and spanish_es-utf8:
back_to_top_vrc2.xml
Code: [Select]
<?xml version="1.0"?>
<!DOCTYPE modification SYSTEM "http://www.simplemachines.org/xml/modification">
<modification xmlns="http://www.simplemachines.org/xml/modification" xmlns:smf="http://www.simplemachines.org/">
<id>Labradoodle-360:BackToTop</id>
<version>1.0</version>
<file name="$themedir/index.template.php">
<operation>
<search position="before"><![CDATA[
function template_body_above()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;
]]></search>
<add><![CDATA[
echo '<a name="forum_top"></a>';
]]></add>
</operation>
<operation>
<search position="before"><![CDATA[<li class="last"><a id="button_wap2" href="', $scripturl , '?wap2" class="new_win"><span>', $txt['wap2'], '</span></a></li>]]></search>
<add><![CDATA[
<br />
<li><a href="#forum_top">', $txt['back_to_top'], '</a></li>
]]></add>
</operation>
</file>
<file name="$sourcedir/Load.php">
<operation>
<search position="after"><![CDATA[
// Detect the browser. This is separated out because it's also used in attachment downloads
detectBrowser();
]]></search>
<add><![CDATA[
$context['html_headers'] .='<script type="text/javascript" src="'. $settings['default_theme_url']. '/scripts/smoothscroll.js"></script>';
]]></add>
</operation>
</file>
<file name="$themedir/languages/Modifications.english.php">
<operation>
<search position="end"></search>
<add><![CDATA[
// Labradoodle-360's Mod: Back to Top
$txt['back_to_top'] = 'Back to Top';
]]></add>
</operation>
</file>
<file name="$themedir/languages/Modifications.spanish.php" error="skip">
<operation>
<search position="end"></search>
<add><![CDATA[
// Labradoodle-360's Mod: Back to Top
$txt['back_to_top'] = 'Volver a arriba';
]]></add>
</operation>
</file>
<file name="$themedir/languages/Modifications.spanish-utf8.php" error="skip">
<operation>
<search position="end"></search>
<add><![CDATA[
// Labradoodle-360's Mod: Back to Top
$txt['back_to_top'] = 'Volver a arriba';
]]></add>
</operation>
</file>
<file name="$themedir/languages/Modifications.spanish_es.php" error="skip">
<operation>
<search position="end"></search>
<add><![CDATA[
// Labradoodle-360's Mod: Back to Top
$txt['back_to_top'] = 'Volver a arriba';
]]></add>
</operation>
</file>
<file name="$themedir/languages/Modifications.spanish_es-utf8.php" error="skip">
<operation>
<search position="end"></search>
<add><![CDATA[
// Labradoodle-360's Mod: Back to Top
$txt['back_to_top'] = 'Volver a arriba';
]]></add>
</operation>
</file>
</modification>

My blog: http://www.shakaran.net
Quijost: professional & reliable webhosting (with SMF support) http://www.quijost.com
Tivion: a player for streaming TV and Radio channels http://www.shakaran.net/blog/tivion
Spanish RPG game: http://www.apogeus.es & http://www.apogeus.es/ao

Online Labradoodle-360

  • Developer
  • SMF Super Hero
  • *
  • Posts: 11,469
  • Gender: Male
    • matthew.kerle on Facebook
    • @matthew_kerle on Twitter
Re: Back to Top
« Reply #3 on: February 06, 2010, 06:20:06 PM »
What I would like to know, is why the SMF Customization Team have missed two issues with my mods (small as they are) yet there.

This, and a missing text string for another. Obviously I pulled up the wrong edit...

I appreciate the notification,
Labradoodle-360

The quality of the responses received is directly proportional to the quality of the question asked. | My Modifications

Online Labradoodle-360

  • Developer
  • SMF Super Hero
  • *
  • Posts: 11,469
  • Gender: Male
    • matthew.kerle on Facebook
    • @matthew_kerle on Twitter
Re: Back to Top
« Reply #4 on: February 06, 2010, 08:52:00 PM »
Version 1.1 Released! ;D

It combines the "Smoothscroll" and "Regular" versions into one version for ease, with a toggle in the admin panel to turn Smoothscroll on or off.

Also bringing SMF 2.0 RC3 compatibility, as well as utf-8 for English!
Spanish was not included, because of new language strings that had to be added.

Enjoy,
Labradoodle-360
« Last Edit: March 10, 2010, 03:44:07 PM by Labradoodle-360 »

The quality of the responses received is directly proportional to the quality of the question asked. | My Modifications

Offline iPhoneDestek

  • Jr. Member
  • **
  • Posts: 200
  • Gender: Male
  • MOD Translator from iPhoneDestek.org
    • iPhoenDestek
Re: Back to Top
« Reply #5 on: September 07, 2010, 08:13:46 AM »
translation in turkish


Code: [Select]
//Back to Top translation by SirtLanVadisi.net
$txt['back_to_top_title'] = 'Yukarıya Git';
$txt['enable_smoothscroll'] = 'Smoothscroll açık';
$txt['back_to_top_desc'] = 'Yukarıya Git Düzenleme';
$txt['back_to_top_settings_title'] = 'Yukarıya Git Ayarları';
//Back to Top translation by SirtLanVadisi.net
« Last Edit: September 07, 2010, 08:37:05 AM by ®SirtLan »

$$  Q u a l i t y    I n f o r m a t i o n    L i n e  for iPhone $$



<   M O D  |  T R A N S L A T O R  |  TO  |  TUR  |  A N D   |  G E R   >


Offline FireDitto

  • Full Member
  • ***
  • Posts: 550
  • Gender: Female
  • Shadow In The Flame
    • @SPWeyr on Twitter
    • Second Pass Weyr RPG
Re: Back to Top
« Reply #6 on: September 11, 2010, 05:29:29 AM »
Would it take a lot of effort, to have the "Return to Top" at the top of posts, so it would read similar to this:
"Quote, Modify, Remove, Return To Top"

I'm working on an RP thread, and the posts on such tend to get long.

Thanks =)
Second Pass Weyr
An AU Pernse RPG

SMF 2.0.4 with SP 2.3.5

Online Labradoodle-360

  • Developer
  • SMF Super Hero
  • *
  • Posts: 11,469
  • Gender: Male
    • matthew.kerle on Facebook
    • @matthew_kerle on Twitter
Re: Back to Top
« Reply #7 on: September 11, 2010, 10:03:17 AM »
No, take a peak at the code Back to Top adds in index.template.php for the actual link. Then add that link where you want it in Display.template.php

The quality of the responses received is directly proportional to the quality of the question asked. | My Modifications

Offline FireDitto

  • Full Member
  • ***
  • Posts: 550
  • Gender: Female
  • Shadow In The Flame
    • @SPWeyr on Twitter
    • Second Pass Weyr RPG
Re: Back to Top
« Reply #8 on: September 11, 2010, 11:35:48 PM »
Ah, yes, very easy.

For anyone interested, I simply added this:

Code: [Select]
// can we return to top, please?
echo '
                                <li class="back_to_top_title"><a href="#forum_top">', $txt['back_to_top_title'], '</a></li>';

Where I wanted it to show up [in my case, at the end of the list of "Insert Quote" etc line.


EDIT: I can't seem to figure out how to make an image appear for it, however;

I changed the <li class="back_to_top_title"> to read <li class="up_button"> but I have no idea where to stick the image I made, as putting it in the theme's "button" folder doesn't appear to work. Am I missing something??
« Last Edit: September 12, 2010, 12:07:37 AM by FireDitto »
Second Pass Weyr
An AU Pernse RPG

SMF 2.0.4 with SP 2.3.5

Offline MS Modders Team

  • Semi-Newbie
  • *
  • Posts: 40
    • SMF Modders
Re: Back to Top
« Reply #9 on: September 12, 2010, 01:23:32 AM »
Here are the edits you will need to execute. (SMF 2.0 RC3)

./Themes/default/Display.template.php
Code: (Find) [Select]
// If this is the first post, (#0) just say when it was posted - otherwise give the reply #.
if ($message['can_approve'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'])
echo '
<ul class="reset smalltext quickbuttons">';
Code: (Add After) [Select]
// SMF Modders; Back to Top
echo '
<li class="backtotop_button"><a href="#forum_top" target="_self">', $txt['back_to_top_title'], '</a></li>';

./Themes/default/css/index.css
Code: (Find) [Select]
ul.quickbuttons a:hover
{
color: #a70;
}
Code: (Add After) [Select]
/* SMF Modders; Back to Top */
ul.quickbuttons li.backtotop_button
{
background: url(../images/theme/back_to_top.png);
}

Moving the attached file (back_to_top.png) to .../images/theme if you don't already have an image to use.

Hope this helps,
SMF Modders Team
« Last Edit: September 12, 2010, 01:26:47 AM by S-M-F Modders Team »
Please do not send us PMs. If you have a question, ask in our forum.
http://smfmodders.com/index.php

Offline FireDitto

  • Full Member
  • ***
  • Posts: 550
  • Gender: Female
  • Shadow In The Flame
    • @SPWeyr on Twitter
    • Second Pass Weyr RPG
Re: Back to Top
« Reply #10 on: September 12, 2010, 02:22:23 AM »
Beautiful. Thanks, =D
Second Pass Weyr
An AU Pernse RPG

SMF 2.0.4 with SP 2.3.5

Offline MS Modders Team

  • Semi-Newbie
  • *
  • Posts: 40
    • SMF Modders
Re: Back to Top
« Reply #11 on: September 12, 2010, 02:36:04 AM »
I apologize for the poor graphic quality. Glad to hear the code works out well for you :)

Best Regards,
SMF Modders Team
Please do not send us PMs. If you have a question, ask in our forum.
http://smfmodders.com/index.php

Offline FireDitto

  • Full Member
  • ***
  • Posts: 550
  • Gender: Female
  • Shadow In The Flame
    • @SPWeyr on Twitter
    • Second Pass Weyr RPG
Re: Back to Top
« Reply #12 on: September 12, 2010, 03:03:53 AM »
Naa, it's fine; I edited the "upshrink" image to fit the theme, and used it =D
Second Pass Weyr
An AU Pernse RPG

SMF 2.0.4 with SP 2.3.5

Offline Jayne Louise

  • Semi-Newbie
  • *
  • Posts: 71
Re: Back to Top
« Reply #13 on: January 12, 2011, 06:16:09 PM »
Im having a small issue with this mod on RC3 and RC4. When I install it, the space at the top of the page increases. By default the space between the top of the forum (even here) to the top of the browser is about 5mm, when I install this mod it becomes about 1cm wide. This might seem petty but I have a banner at the top of the page and this increased space is messing it up.

Even on a fresh install Ive tried it with the same result.

Anything I can do to decrease the size at the top?
~J:L

Online Labradoodle-360

  • Developer
  • SMF Super Hero
  • *
  • Posts: 11,469
  • Gender: Male
    • matthew.kerle on Facebook
    • @matthew_kerle on Twitter
Re: Back to Top
« Reply #14 on: January 13, 2011, 12:47:37 AM »
This is simply an effect of the mod. As an anchor is put at the top which increases the space. Although I will work on a solution shortly.
Im having a small issue with this mod on RC3 and RC4. When I install it, the space at the top of the page increases. By default the space between the top of the forum (even here) to the top of the browser is about 5mm, when I install this mod it becomes about 1cm wide. This might seem petty but I have a banner at the top of the page and this increased space is messing it up.

Even on a fresh install Ive tried it with the same result.

Anything I can do to decrease the size at the top?

The quality of the responses received is directly proportional to the quality of the question asked. | My Modifications

Offline barefoot

  • Semi-Newbie
  • *
  • Posts: 16
Re: Back to Top
« Reply #15 on: February 04, 2011, 09:10:15 PM »
how can i add this return to top stuff to my ds- natural theme ?

Online Labradoodle-360

  • Developer
  • SMF Super Hero
  • *
  • Posts: 11,469
  • Gender: Male
    • matthew.kerle on Facebook
    • @matthew_kerle on Twitter
Re: Back to Top
« Reply #16 on: February 04, 2011, 10:57:22 PM »

The quality of the responses received is directly proportional to the quality of the question asked. | My Modifications

Offline barefoot

  • Semi-Newbie
  • *
  • Posts: 16
Re: Back to Top
« Reply #17 on: February 05, 2011, 06:11:18 AM »
Manual Installation of Mods


i already try to install it manually but there is no such a parameter like below in index.template.php file of theme my theme is ds natural
 </head>
<body>';

or no paramaters like this:

<a href="http://jigsaw.w3.org/css-validator/check/referer [nofollow]" target="_blank"><img id="valid-css" src="', $settings
['images_url'], '/valid-css.gif" alt="', $txt['valid_css'], '" width="54" height="20" style="margin: 5px 16px;" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
            </td>
         </tr>
      </table>';
« Last Edit: February 05, 2011, 06:17:57 AM by barefoot »

Offline Yoshi

  • Customizer
  • SMF Hero
  • *
  • Posts: 8,140
  • Gender: Male
Re: Back to Top
« Reply #18 on: February 05, 2011, 06:12:44 AM »
woot, nice.

PS there are two "Link to mod" links in the topic.
My Mods / [WIP] Mod Builder / GitHub profile / "A programmer is just a tool which converts caffeine into code."
Quote
<FLAMER> Marketing is about to get into drug activities maybe... but we will see about that later on :P
<Yoshi2889> We're getting free drugs?
<CoreISP> He's talking about caffeine man, damn pen lifter.

Offline barefoot

  • Semi-Newbie
  • *
  • Posts: 16
Re: Back to Top
« Reply #19 on: February 05, 2011, 01:16:19 PM »
i am still waiting for someone to help me...:(