Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=2361)
Back to Top
Written by: Labradoodle-360 (http://www.simplemachines.org/community/index.php?action=profile;u=182638) |
Current version: 1.1 |
Updates: Mod Support Topic |
Suitable for: SMF 1.1.11, SMF 2.0 RC2, SMF 2.0 RC3 |
Supported languages: (https://www.simplemachines.org/site_images/lang/english.gif) |
Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=2361) | Donate (https://www.paypal.com/cgi-bin/webscr&cmd=_s-xclick&hosted_button_id=10240245)
SummaryBack 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!
InstallationPackage 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 linksManual Installation Of Mods (http://docs.simplemachines.org/index.php?topic=402)
How Do I Modify Files? (http://www.simplemachines.org/community/index.php?topic=24110.0)
SupportQuestions should be address to the mod support topic (http://www.simplemachines.org/community/index.php?topic=360874.0).
UpdatingVersion 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.
Changelog1.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 (http://www.kryogenix.org/code/browser/smoothscroll/).
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
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>
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
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
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
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 =)
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
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??
Here are the edits you will need to execute. (SMF 2.0 RC3)
./Themes/default/Display.template.php
// 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">';
// 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
ul.quickbuttons a:hover
{
color: #a70;
}
/* 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
Beautiful. Thanks, =D
I apologize for the poor graphic quality. Glad to hear the code works out well for you :)
Best Regards,
SMF Modders Team
Naa, it's fine; I edited the "upshrink" image to fit the theme, and used it =D
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?
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?
how can i add this return to top stuff to my ds- natural theme ?
Manual Installation of Mods (http://docs.simplemachines.org/index.php?topic=402.0)
Quote from: Labradoodle-360 on February 04, 2011, 10:57:22 PM
Manual Installation of Mods (http://docs.simplemachines.org/index.php?topic=402.0)
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" 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>';
woot, nice.
PS there are two "Link to mod" links in the topic.
i am still waiting for someone to help me...:(
If you attach your themes index.template.php, I will install that edit for you.
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" ?
Here you are
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
The anchor edit was probably not completed for your custom theme.
Here you go
Not a problem! Enjoy
Any chance of this mod being upgraded to 2.0rc5?
I'm really missing the smooth scrolling!
I'll update this for SMF 2.0 Final.
Not working for 2.0.2 which is a shame.
What is not working?
Does not install under 2.0.2
Any errors you are getting?
It should work with 2.0.2 as far as I know...? Hmmmmm. Did you try using Version Emulate?
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.
Try this:
How can I install a mod that doesn't work in my SMF version? (http://wiki.simplemachines.org/smf/How_can_install_a_mod_that_doesn%27t_work_in_my_SMF_version)
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?
2.0 RC3 would do fine :)
Ok, thank you.
You're welcome ;D
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 ;)
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.
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.