News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Go to page...

Started by klumy, December 13, 2005, 12:23:39 PM

Previous topic - Next topic

klumy


Col

Yes, something like that would be useful. Some way of easily navigating to any page in a thread, instead of a few pages at a time. Yes, you could use the URL, but most members would not realise this.

klumy

any chance to find this feature in a future release?

Col

#3
You should try this in mod requests as it doesn't appear to be of interest as a feature.


Edit: Just typos

1MileCrash

wow. this is definately useful. get's my vote.
The only thing php can't do is tell you how much milk is left in the fridge.



JayBachatero

This is usefull for looooong topics.   It seems like its not too hard to do.
Follow me on Twitter

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

1MileCrash

i wouldnt make it a popup though. that seems too vbulletinish/annoying. Id say stick it in the bar next to the "Jump to" box on the Core theme (aligned to the left, as "Jump to" is aligned to the right)
The only thing php can't do is tell you how much milk is left in the fridge.



JayBachatero

Yea that's a great place to put it Tipp.
Follow me on Twitter

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

klumy

Quote from: Col on December 17, 2005, 08:27:02 PM
You should try this in mod requests as it doesn't appear to be of interest as a feature.


Edit: Just typos

No I think this would be much better to put it as a default feature. It is especially really useful on large topics

Thantos

#9
File:
Display.template.php
Find:

function template_main()
{
        global $context$settings$options$txt$scripturl$modSettings;


Add after

        
echo '
        <script type="text/javascript">
        <!--
                function jumptopage(box)
                {
                        jumpbox = document.getElementById("jumptopageinput"+box);
                        var reply = (jumpbox.value-1) * '
$modSettings['defaultMaxMessages'], ';
                        var page = "'
$scripturl'?topic='$context['current_topic'], '." + reply;
                        window.location = page;
                }
        -->
        </script>'
;

Find:
<b>', $txt[139], ':</b', $context['page_index'];

Add after:

        
echo ' Jump to Page <input type="text" id="jumptopageinput" name="jumptopageinput" size="4" /> <input type="button" onclick="jumptopage()" value="Go"/>';


Find:
<a name="bot"></a><b>', $txt[139], ':</b', $context['page_index'],

Add after
'Jump to Page <input type="text" id="jumptopageinput2" name="jumptopageinput2" size="4" /> <input type="button" onclick="jumptopage(2)" value="Go"/>'

Feel free to make it prettier and all that jazz

JayBachatero

A quick not search for $context['page_index'] again to add it to the bottom page index.
Follow me on Twitter

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

Thantos

#11
Hmm that might cause problems Jay.  IDs are required to be unique.  So by putting it at the bottom you are violating that rule.

Let me update my original post to allow two boxes

JayBachatero

Ok.  I don't know much bout javascript.  I will make those changes to reflect the changes I've made.
Follow me on Twitter

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

1MileCrash

we need it in other places too. not just display. message index too.
The only thing php can't do is tell you how much milk is left in the fridge.



Thantos

On the message index do you mean per topic or per page of the message index?

For per page of the index
File:  MessageIndex.template.php
Find:

function template_main()
{
        global 
$context$settings$options$txt$scripturl$modSettings;


Add after

        
echo '
        <script type="text/javascript">
        <!--
                function jumptopage(box)
                {
                        jumpbox = document.getElementById("jumptopageinput"+box);
                        var perpage = '
, isset($_REQUEST['all']) && !empty($modSettings['enableAllMessages']) ? $board_info['num_topics'] : $modSettings['defaultMaxTopics'], ';
                        var reply = (jumpbox.value-1) * perpage;
                        var page = "'
$scripturl'?board='$context['current_board'], '." + reply;
                        window.location = page;
                }
        -->
        </script>'
;


Then its the same find and replace as before.

Col

Quote from: klumy on December 18, 2005, 06:18:00 AM
Quote from: Col on December 17, 2005, 08:27:02 PM
You should try this in mod requests as it doesn't appear to be of interest as a feature.


Edit: Just typos

No I think this would be much better to put it as a default feature. It is especially really useful on large topics

Yeah, I agree, but there hasn't been any official support for this, and I'm sure I've seen this raised before. I think a better way of jumping to the correct page should be standard.

inthe80s

Quote from: Col on December 18, 2005, 05:59:56 PM
Quote from: klumy on December 18, 2005, 06:18:00 AM
Quote from: Col on December 17, 2005, 08:27:02 PM
You should try this in mod requests as it doesn't appear to be of interest as a feature.


Edit: Just typos

No I think this would be much better to put it as a default feature. It is especially really useful on large topics

Yeah, I agree, but there hasn't been any official support for this, and I'm sure I've seen this raised before. I think a better way of jumping to the correct page should be standard.

I totally agree with this post.  I've had several users mention a need for this on my board.  On any messageboard where there are popular threads that people want to reference, regular users want to jump to specific pages (not necessarily the last post read).

So while I'll be adding it as a mod, it certainly should be considered as a regular feature as well.
Running SMF since May '04.  Started with YaBB on Oct 2001.

inthe80s

You will need to modify one line if you plan on using this with a server that has the search engine friendly URL option on:

search for the line with "var page" and replace it with the following.

var page = "', $scripturl, '/topic,', $context['current_topic'], '." + reply + ".html";


Running SMF since May '04.  Started with YaBB on Oct 2001.

Vinspire

There is so many codes lying around on this thread ... I've tried the 2 codes stated by thatos which is edit MessageIndex.template.php & Display.template but i couldn't get the things working.

So, whats the proper way to get it working and is there any screenshot of this function ?

Thanks  ;) ;) ;) ;D

Vinspire

I cant get it working :(

Can someone teach me how to get this working in SMF 1.1 RC 2 Please ?  :'(

Advertisement: