Back to Top

Started by Matthew K., January 18, 2010, 05:42:38 PM

Previous topic - Next topic

Matthew K.

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.

Matthew K.

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

shakaran

This lines fails for me:
         <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:

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

Matthew K.

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

Matthew K.

#4
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

iPhoneDestek

#5
translation in turkish



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


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


FireDitto

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<br />An AU Pernse RPG<br /><br />SMF 2.0.6 with SP 2.3.5

Matthew K.

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

FireDitto

#8
Ah, yes, very easy.

For anyone interested, I simply added this:

// 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??
Second Pass Weyr<br />An AU Pernse RPG<br /><br />SMF 2.0.6 with SP 2.3.5

MS Modders Team

#9
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
Please do not send us PMs. If you have a question, ask in our forum.
http://smfmodders.com/index.php

FireDitto

Second Pass Weyr<br />An AU Pernse RPG<br /><br />SMF 2.0.6 with SP 2.3.5

MS Modders Team

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

FireDitto

Naa, it's fine; I edited the "upshrink" image to fit the theme, and used it =D
Second Pass Weyr<br />An AU Pernse RPG<br /><br />SMF 2.0.6 with SP 2.3.5

Jayne Louise

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

Matthew K.

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.
Quote from: Jayne Louise 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?

barefoot

how can i add this return to top stuff to my ds- natural theme ?


barefoot

#17
Quote from: Labradoodle-360 on February 04, 2011, 10:57:22 PM
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>';

NanoSector

woot, nice.

PS there are two "Link to mod" links in the topic.
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

barefoot

i am still waiting for someone to help me...:(

Matthew K.

If you attach your themes index.template.php, I will install that edit for you.

barefoot

Quote from: Labradoodle-360 on February 05, 2011, 01:31:17 PM
If you attach your themes index.template.php, I will install that edit for you.

here is my themes  index.template.php ... thanx alot :)  by the way  can we change it "back to top"  to " başa dön" ?

Matthew K.


barefoot

#23
Quote from: Labradoodle-360 on February 05, 2011, 01:48:39 PM
Here you are

thanx so much for your interest mate :)   i upload this file to my site via ftp. I saw the title  as "basa don"  but it is not working ! when i hit the text nothing happens. i changed specified files as you mentioned  at manuel install (parse) do you think this problem caused by the name changing? it was "back to top" but i asked for "basa don"  maybe this is the problem?
You can check it out here : beta.aero-model.net [nofollow]

Matthew K.

The anchor edit was probably not completed for your custom theme.

Matthew K.


barefoot


Matthew K.


steveraven

Any chance of this mod being upgraded to 2.0rc5?

I'm really missing the smooth scrolling!

Matthew K.

I'll update this for SMF 2.0 Final.

simon36

Not working for 2.0.2 which is a shame.

NanoSector

What is not working?
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

simon36

Does not install under 2.0.2

NanoSector

Any errors you are getting?
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Matthew K.

It should work with 2.0.2 as far as I know...? Hmmmmm. Did you try using Version Emulate?

simon36

Hi, I tried installing under 2.0.2 and get:

The package you are trying to download or install is either corrupt or not compatible with this version of SMF.

Robert.


simon36

Hi, I do know how to version emulate but Labradoodle believes it should install under 2.0.2

Do you know which version I should emulate?

Robert.

2.0 RC3 would do fine :)

simon36


Robert.


Ninja ZX-10RR

Thanks for the mod I really like it in long topics :) it also made me reach a very good achievement, this has been the 100th mod installed on my forum with no errors :D
For anyone wanting to use it without emulation (since you don't need it) just replace the back_to_top_vrc2.3.xml file of the mod with the one attached and it will install just fine ;)
Quote from: BeastMode topic=525177.msg3720020#msg3720020
It's so powerful that on this post and even in the two PMs you sent me,you still answered my question very quickly and you're apologizing for the delay. You're the #1 support I've probably ever encountered man, so much respect for that. Thank you, and get better soon.

I'll keep this in my siggy for a while just to remind me that someone appreciated what I did while others didn't.

♥ Jess ♥

STOP EDITING MY PROFILE

Rk2910

Ninj, what version of SMF are you running?  I tried to install on 2.0.9 and it said not compatible, tried to emulate to 2.0 RC3 and install tests fail so I didn't install.  I replaced the xml file with the one you posted and it still fails test install.
One of my tablet users asked for a mod like this.

Matthew K.

If install tests failed, it may not be compatible with some other modifications you have installed. You might have to manually install it if that's comfortable for you.

Advertisement: