News:

Join the Facebook Fan Page.

Main Menu

Go Up button

Started by Koppo, March 23, 2016, 08:46:10 AM

Previous topic - Next topic

Koppo

Hi,

i want to add go up and go down buttons to my forum template.

// Show the page index... "Pages: [1]".
echo '
<div class="pagesection">
', template_button_strip($normal_buttons, 'right'), '
<div class="pagelinks floatleft">', $txt['pages'], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . ' &nbsp;&nbsp;<a href="#top"><strong>' . $txt['go_up'] . '</strong></a>' : '', '</div>
<div class="nextlinks_bottom">', $context['previous_next'], '</div>
</div>';


I doubt this here will work because the text is now $txt[goup]. Actually its in the code in DisplayTemplate.php but not showing on the page. Any ideas???

Shambles

Have you defined $txt['goup'] anywhere?

Ronald_1938

Quote from: Koppo on March 23, 2016, 08:46:10 AM
Hi,

i want to add go up and go down buttons to my forum template.

// Show the page index... "Pages: [1]".
   echo '
         <div class="pagesection">
            ', template_button_strip($normal_buttons, 'right'), '
            <div class="pagelinks floatleft">', $txt['pages'], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . ' &nbsp;&nbsp;<a href="#top"><strong>' . $txt['go_up'] . '</strong></a>' : '', '</div>
            <div class="nextlinks_bottom">', $context['previous_next'], '</div>
         </div>';


I doubt this here will work because the text is now $txt[goup]. Actually its in the code in DisplayTemplate.php but not showing on the page. Any ideas???

Here is a set of up and down arrows, I have these installed, work great:  http://custom.simplemachines.org/mods/index.php?mod=3433

Deprecated

There are two places you can define your text for $txt['group']. It depends on whether you are using the new hook modification style in which case you define it in {my mod name}.english.php, or doing it the old way you add it to Modifications.english.php at the end. In either case you should use a prefix such as e.g. $txt['my_modification_name_group'] to avoid name space collisions.

In any case it is bad SMF coding technique to define language strings in your *.template.php although you can be forgiven if it's a one off manual code edit and not intended for public consumption. In that case you will have to deal with conflicts if you encounter any, but it won't impact any others in the SMF community. In fact in that case you might as well just skip the variable and hard code the language.

In any case if you describe what you want to do I am glad to help you and I'll reply in this topic if you nail down better what your intentions are. Just tell me, is this a new mod or a one off manual code edit, and if a mod you intend to submit, say whether you are using integration hooks or writing old style mod packages.

Shambles

Quote from: Deprecated
There are two places you can define your text for $txt['group']

It's not $txt['group'] that he needs to define  8)

Deprecated

Well whatever $txt[] you need to define then. Sorry, just trying to help.

Koppo

Sorry for the late reply, I found that the up/down buttons are available after enabling them in the layout configuration in the forum settings... Dayum, i should had check that before posting here. Thanks anyway!

Deprecated

Don't feel bad. I've been writing code for SMF for 8 years and I still have to Google how to do some basic Admin things. I still can't figure out post approval. (Please, nobody explain it to me. Google is my friend.)

My worst fear is that I'll write a mod package to perform a feature that is already included in SMF. I already had one rejected because it was already included in 2.1.

Advertisement: