Advertisement:

Author Topic: Go to page...  (Read 44997 times)

Offline klumy

  • SMF Hero
  • ******
  • Posts: 2,483
Go to page...
« on: December 13, 2005, 12:23:39 PM »


how do you find this ;)

Offline Col

  • Sr. Member
  • ****
  • Posts: 964
Re: Go to page...
« Reply #1 on: December 13, 2005, 08:22:48 PM »
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.

Offline klumy

  • SMF Hero
  • ******
  • Posts: 2,483
Re: Go to page...
« Reply #2 on: December 17, 2005, 07:03:02 AM »
any chance to find this feature in a future release?

Offline Col

  • Sr. Member
  • ****
  • Posts: 964
Re: Go to page...
« Reply #3 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
« Last Edit: December 17, 2005, 09:10:53 PM by Col »

Offline Tippmaster

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,188
Re: Go to page...
« Reply #4 on: December 17, 2005, 08:56:28 PM »
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.



Offline JayBachatero

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,562
  • Gender: Male
    • @jaycreations on Twitter
    • JayBachatero.com
Re: Go to page...
« Reply #5 on: December 17, 2005, 09:03:48 PM »
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

Offline Tippmaster

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,188
Re: Go to page...
« Reply #6 on: December 17, 2005, 09:08:28 PM »
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.



Offline JayBachatero

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,562
  • Gender: Male
    • @jaycreations on Twitter
    • JayBachatero.com
Re: Go to page...
« Reply #7 on: December 17, 2005, 09:41:37 PM »
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

Offline klumy

  • SMF Hero
  • ******
  • Posts: 2,483
Re: Go to page...
« Reply #8 on: December 18, 2005, 06:18:00 AM »
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

Offline Thantos

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 16,163
  • Gender: Male
Re: Go to page...
« Reply #9 on: December 18, 2005, 01:39:31 PM »
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) * &#39;, $modSettings[&#39;defaultMaxMessages&#39;], &#39;;
                        var page "&#39;, $scripturl, &#39;?topic=&#39;, $context[&#39;current_topic&#39;], &#39;." reply;
                        window.location page;
                }
        -->
        </script>&#39;;

Find:
<b>&#39;, $txt[139], &#39;:</b> &#39;, $context[&#39;page_index&#39;];

Add after:

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


Find:
<a name="bot"></a><b>&#39;, $txt[139], &#39;:</b> &#39;, $context[&#39;page_index&#39;],

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

Feel free to make it prettier and all that jazz
« Last Edit: December 18, 2005, 02:00:21 PM by MikeMill »

Offline JayBachatero

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,562
  • Gender: Male
    • @jaycreations on Twitter
    • JayBachatero.com
Re: Go to page...
« Reply #10 on: December 18, 2005, 01:45:35 PM »
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

Offline Thantos

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 16,163
  • Gender: Male
Re: Go to page...
« Reply #11 on: December 18, 2005, 01:52:00 PM »
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
« Last Edit: December 18, 2005, 01:54:02 PM by MikeMill »

Offline JayBachatero

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,562
  • Gender: Male
    • @jaycreations on Twitter
    • JayBachatero.com
Re: Go to page...
« Reply #12 on: December 18, 2005, 02:04:09 PM »
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

Offline Tippmaster

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,188
Re: Go to page...
« Reply #13 on: December 18, 2005, 02:19:23 PM »
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.



Offline Thantos

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 16,163
  • Gender: Male
Re: Go to page...
« Reply #14 on: December 18, 2005, 02:35:45 PM »
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 &#39;
        
<script type="text/javascript">
        <!--
                function 
jumptopage(box)
                {
                        
jumpbox document.getElementById("jumptopageinput"+box);
                        var 
perpage = &#39;, isset($_REQUEST[&#39;all&#39;]) && !empty($modSettings[&#39;enableAllMessages&#39;]) ? $board_info[&#39;num_topics&#39;] : $modSettings[&#39;defaultMaxTopics&#39;], &#39;;
                        
var reply = (jumpbox.value-1) * perpage;
                        var 
page "&#39;, $scripturl, &#39;?board=&#39;, $context[&#39;current_board&#39;], &#39;." reply;
                        
window.location page;
                }
        -->
        
</script>&#39;;


Then its the same find and replace as before.

Offline Col

  • Sr. Member
  • ****
  • Posts: 964
Re: Go to page...
« Reply #15 on: December 18, 2005, 05:59:56 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.

Offline inthe80s

  • Jr. Member
  • **
  • Posts: 166
  • Gender: Male
  • Pick a winner...
    • in the 00s
Re: Go to page...
« Reply #16 on: January 26, 2006, 08:38:28 AM »
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.

Offline inthe80s

  • Jr. Member
  • **
  • Posts: 166
  • Gender: Male
  • Pick a winner...
    • in the 00s
Re: Go to page...
« Reply #17 on: January 26, 2006, 01:46:36 PM »
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.

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

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

Offline Vinspire

  • Sr. Member
  • ****
  • Posts: 852
  • Gender: Male
    • The Box Of Heart Forum
Re: Go to page...
« Reply #18 on: May 10, 2006, 04:24:09 AM »
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

Offline Vinspire

  • Sr. Member
  • ****
  • Posts: 852
  • Gender: Male
    • The Box Of Heart Forum
Re: Go to page...
« Reply #19 on: July 02, 2006, 05:37:12 PM »
I cant get it working :(

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