Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: SMF Customization Team on October 18, 2006, 08:50:26 PM

Title: Expand Page Index
Post by: SMF Customization Team on October 18, 2006, 08:50:26 PM
Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=497)

Expand PageIndex



Author: SMF Customization Team (http://www.simplemachines.org/community/index.php?action=profile;u=1)

Supported Languages: English

Link To Mod (http://custom.simplemachines.org/mods/index.php?mod=497) | Mod Discussion (http://www.simplemachines.org/community/index.php?topic=121219.0) | Other SMF Customization Team Mods (http://custom.simplemachines.org/mods/index.php?action=profile;u=1)


Summary:
This mod will expand all the pages when you click on the "..." in a page index.  Example open a board in SMF and you will something like Pages: [1] 2 3 ... 20, click on ... and it will expand to show all the page numbers.

Note: This mod makes changes to script.js, which is often cached. For it to work your users may have to do a hard refresh (usually Ctrl + F5).

Compatibility:
Compatible with SMF 1.0 only as its a standard feature of 2.0

Installation Information:
The Package Manager should work in most cases, if you have problems installing please use the discussion thread as well as Manual Installation of Mods (http://docs.simplemachines.org/index.php?topic=402)

License:
Copyright (c) 2015, Simple Machines
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.
    * Neither the name of the <organization> nor the
      names of its contributors may be used to endorse or promote products
      derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


Change Log:
Version 1.1 - March 23 2016
- Updated to work with SMF 1.1.21
- BSD License
Version 1.0 - October 10 2006
- Initial release
Title: Re: Expand Pages
Post by: WarBirD on October 19, 2006, 04:27:19 AM
Aehm, how do I use the Mod ? Any image as example ?  ???
Title: Re: Expand Pages
Post by: !Hachi! on October 19, 2006, 06:59:30 AM
open any board in SMF i mean here and you will something like
Pages: [1] 2 3  ... 18   Go Down
                        click on ... and it will expand.

click here
http://www.simplemachines.org/community/index.php?board=59.0
Title: Re: Expand Pages
Post by: Rudolf on October 19, 2006, 07:30:42 AM
Shouldn't this be called "Expand Pageindex" or something similar? It's very inaccurate and misleading the title.
Title: Re: Expand Pages
Post by: !Hachi! on October 19, 2006, 08:19:04 AM
to me its perfect
PAGE 1,2,3,4,5,6,7 and so on
            it will become 1,2......100
                      by the mod we will able to EXPAND pages  right!
Title: Re: Expand Pages
Post by: Rudolf on October 19, 2006, 09:20:43 AM
Sorry, but that's wrong. The list of numbers that is bein expanded is the "page index".
A page by definition is
Quote from: dictionary.com
Computers.
a.   a relatively small block of main or secondary storage, up to about 1024 words.
b.   a block of program instructions or data stored in main or secondary storage.
c.   (in word processing) a portion of a document.
or
Quote from: dictionary.com
Web page 
Computers.
1.   a single, usually hypertext document on the World Wide Web that can incorporate text, graphics, sounds, etc.

And if you don't agree with these definitions, check the SMF team's definition of that thing. The function to create it is called "constructPageIndex();", the variable that holds it is called $context['page_index'].
Title: Re: Expand Pages
Post by: winrules on October 19, 2006, 04:31:20 PM
I don't see any reason to rename it since it's already named this way. It may be more acurate, but it's jsut a name.
Title: Re: Expand Pages
Post by: Rudolf on October 19, 2006, 05:12:26 PM
So much for clarity. Actually I think it's pretty serious. Misleading users.
For a mod the name is that identifies the mod, I search the mod page looking at their names first.
I assure you that I was quite disappointed to when I realized what this mod was about, and it seemed a waste of my time. But that's just me, one in a billion.
Who am I to argue with the "SMF Customization Team"?
Title: Re: Expand Pages
Post by: Skipdawg on October 19, 2006, 05:44:15 PM
Oh this is nice. A Perl written message board I use to visit had such a feature. Comes in handy!  ;D ;)
Title: Re: Expand Pages
Post by: winrules on October 19, 2006, 06:19:37 PM
SMF Customization Team just means that it was worked on by various members of the team.

I really don't see how it is that misleading. If anything maybe "Expand Page Listing" would be better.
Title: Re: Expand Pages
Post by: Vinspire on October 23, 2006, 01:00:41 AM
Just install this mods into my SMF Board. No matter what name we should have for this mod, there is only 1 comment I will give to this mod is "Awesome" !!!
Title: Re: Expand Pages
Post by: Vinspire on October 23, 2006, 01:30:36 AM
How do i get this to work well with Helios Theme ?

There isn't any script.js file in the theme. The function work fine.

When i click on the page beside "go down" ... The whole pages list did scroll down and work smoothly.

but

When i click on the page at the bottom beside "go up" ... the whole pages list goes all the way till the end in 1 line. Here is the screenshot for better explaination.

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg291.imageshack.us%2Fimg291%2F9622%2Fpexppp6.png&hash=7df2fcc77e0278abfc8636812cd4f973d36cf8bc) (http://imageshack.us)
Title: Re: Expand Pages
Post by: winrules on October 23, 2006, 03:55:06 PM
Script.js is global. There isn't one in every theme so you don't need to make any changes. With having it in one line there is probobally a fixed height. You'd ahve to modify the theme, which I'm not quite sure how you would do.
Title: Re: Expand Pages
Post by: Daniel15 on November 05, 2006, 10:31:06 AM
Nice MOD... This should come in handy.

P.S I finally found out what User 1 is used for :P
Title: Re: Expand Pages
Post by: L.G.S on May 30, 2007, 07:05:32 PM
This mod has been used on my forum for a while now and its awesome, but I have a problem.

I installed the SEO urls mod and for some reason if I expanded the pages and clicked on one other than the first, it would take me back to the first anyway :(
Title: Re: Expand Pages
Post by: MinasC on June 28, 2007, 08:30:30 PM
installed great in 1.1.3 but isn't working (shows as a link but doesn;t expand) ! any ideas ?
Title: Re: Expand Pages
Post by: AdviseorAnswers.com on July 03, 2007, 07:34:27 PM
Quote from: MinasC on June 28, 2007, 08:30:30 PM
installed great in 1.1.3 but isn't working (shows as a link but doesn;t expand) ! any ideas ?
I also installed it on 1.1.3 and had the problem of not expanding. But if you look a few post up before the name discussion, it mentions doing a hard refresh. I did a refresh by clicking refresh on my browser and it worked fine
Title: Re: Expand Pages
Post by: kamili34 on July 03, 2007, 07:57:28 PM
I have smf 1.1.3 and not default theme and mod work correct. Thanks :)
Title: Re: Expand Pages
Post by: MinasC on July 09, 2007, 06:38:46 AM
Quote from: AdviseorAnswers.com on July 03, 2007, 07:34:27 PM
Quote from: MinasC on June 28, 2007, 08:30:30 PM
installed great in 1.1.3 but isn't working (shows as a link but doesn;t expand) ! any ideas ?
I also installed it on 1.1.3 and had the problem of not expanding. But if you look a few post up before the name discussion, it mentions doing a hard refresh. I did a refresh by clicking refresh on my browser and it worked fine

works fine now , thnx a lot , hadn't seen that post about the refresh thing !
Title: Re: Expand Pages
Post by: falguni1 on December 01, 2007, 04:54:47 AM
any images cant understand wot this mod does
Title: Re : Expand Pages
Post by: Dragooon on December 01, 2007, 05:16:37 AM
On MessageIndex like you have Page 1,2,3......10, It makes the "..." clickable to expand pageindex like Pages 1,2,3,4,5,6,7,8,9,10
Title: Re: Expand Pages
Post by: falguni1 on December 01, 2007, 09:08:58 AM
ohhhhhhh ok

thank you dragoon
Title: Re: Expand Pages
Post by: 2pac on January 12, 2008, 02:31:53 AM
this mod  is awesome! although my board is so young, it doesnt require it at this point, i've bookmarked it for future reference :D
Title: Re: Expand Pages
Post by: Chriss Cohn on February 04, 2008, 04:21:18 PM
Quote from: 2pac on January 12, 2008, 02:31:53 AM
this mod  is awesome! although my board is so young, it doesnt require it at this point, i've bookmarked it for future reference :D
Me too  ;D
I always searched for this because i often use it here at simplemachines.org
Title: Re: Expand Pages
Post by: smldmr on July 01, 2008, 06:31:18 PM
hello. This mod is pretty good. But i need a modification. I want that the lines have a constant length. for example if i make it 10 numbers long, it should paste a newline after 10th pagenumber.

ex.

1 2 3 4 5 6 7 8 9 10
11 12 13 14 15.......
.....
Title: Re: Expand Pages
Post by: rarach on December 11, 2008, 12:03:57 PM
I just installed this mod and it is wonderful! :D Exactly what I've been needing on my forum.
Thanks! :D
Title: Re: Expand Pages
Post by: Rich N-O on December 11, 2008, 02:05:30 PM
Can't get this great mod to work in 2.0 beta 4; tests fail on subs.php and says script.js does not exist.
Title: Re: Expand Pages
Post by: SleePy on December 11, 2008, 05:08:32 PM
This is a default feature in SMF 2.0
Title: Re: Expand Pages
Post by: L'AltroWeb on February 11, 2009, 02:53:31 PM
Hi!
I have applied this mod in my smf 1.1.8 and works fine :)
Now i've test to apply also for tinyportal "BoardNews"
but when i click on 1 2 3 ... 5 instead to see 1 2 3 4 5 i see 1 2 3 5 (without 4)
any idea to fix?
(i've posted also in tinyportal support topic)
Title: Re: Expand Pages
Post by: heavyccasey on July 30, 2009, 06:27:08 AM
I was playing around with this, and if you want a dropdown menu instead of just a list of pages, replace the expandPages() function in script.js with this:

// Shows the page numbers by clicking the dots (in compact view).
function expandPages(spanNode, baseURL, firstPage, lastPage, perPage)
{
var replacement = '', i, oldLastPage = 0;

// The dots were bold, the page numbers are not (in most cases).
spanNode.style.fontWeight = 'normal';
spanNode.onclick = '';

// Calculate the new pages.
for (i = firstPage; i < lastPage; i += perPage)
//replacement += '<a class="navPages" href="' + baseURL.replace(/%d/, i) + '">' + (1 + i / perPage) + '</a> ';
replacement += '<option value="' + i + '">' + (1 + i / perPage) + '</option>';

// Replace the dots by the new page links.
setInnerHTML(spanNode, '<select id="page_dropdown" onchange="window.location=(\'' + baseURL + '\').replace(/%d/, this.value);">' + replacement + '</select> ');
}
Title: Re: Expand Pages
Post by: Jeff B on January 09, 2011, 01:11:42 PM
I've found what I believe to be a bug in this mod.   When on a topic index page within a board, if the topic has enough pages that the modded function appears, if you double click on the ....  to expand the page numbers, it actually creates an editable text box out of the subject topic instead of expanding the pages, and you can actually modify the topic name by changing it and hitting enter. I'm using 1.1.12 and viewing with firefox 3.6.13

I don't know if this poses any security issue or not, but thought it might be worth reporting. This eventoccurs when I am logged in as an admin. It does not occur if you are logged out, or it appears it does not happen if you are logged in as a non administrative member.
Title: Re: Expand Pages
Post by: impreza on January 09, 2011, 03:15:19 PM
A useful modification, thank you