Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: SoLoGHoST on July 27, 2009, 08:55:14 AM

Title: Page Dropdown
Post by: SoLoGHoST on July 27, 2009, 08:55:14 AM
Page Dropdown





Written by: Arantor (http://www.simplemachines.org/community/index.php?action=profile;u=53626) (my other mods (http://custom.simplemachines.org/mods/index.php?action=profile;u=53626))   Current version: 1.3
Thanks to: Cleo (http://www.atrinik.org/), tech ideasUpdates: Arantor's Developments (http://ara.ixos.org/)
Suitable for: 1.1.10, 2.0 RC1.2, 2.0 RC2Supported languages: ALL languages

Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=2025) | Mod support topic (http://www.simplemachines.org/community/index.php?topic=326974.0) | Mod bugtracker (http://ara.ixos.org/index.php?project=2) | Donate (https://www.paypal.com/cgi-bin/webscr&cmd=_s-xclick&hosted_button_id=7164850)





Summary

This mod adds a small drop-down next to the page list, so as well as clicking on the links to step through pages, you can have a quick dropdown to jump to any page and your current page is always highlighted.

Installation

Package Manager should work in most cases. If you need to make any edits, it will be limited to Subs.php - no theme changes are necessary.

Useful links
Manual 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)

Support

Questions should be address to the mod support topic (http://www.simplemachines.org/community/index.php?topic=326974.0). Anything that is a bug or feature request can additionally be reported to the mod bugtracker (http://ara.ixos.org/index.php?project=2).

Updating

Please uninstall version 1.0 or 1.1 before installing 1.2, which should fix all the known issues at this time. Version 1.2 will be required for RC2 use.

Changelog

1.3 - November 9, 2009
Bugfix for RC2 support for Public RC2.

1.2 - October 26, 2009
Added RC2 support.

1.1 - August 4, 2009
Updated to 1.1 to fix two major bugs (dropdown at bottom of page not working and dropdown not working on all pages)

1.0 - July 26, 2009
First release

beta - July 24, 2009
First version added to the SMF Mod site

Files modified by Page Dropdown

Sources/Subs.php (where the dropdown is made)
Title: Re: Page Dropdown
Post by: SoLoGHoST on July 27, 2009, 09:11:45 AM
Nice MOD, though why not just give an option in the Admin Panel to choose between Page Drop Down and Page Links instead of having both of them?  Just a thought.
Title: Re: Page Dropdown
Post by: Blinker on July 27, 2009, 09:12:12 AM
Neat little mod, installed flawlessly on a very heavily modded & custom-themed 1.1.10. I like it, thanks Arantor! :)
Title: Re: Page Dropdown
Post by: Marcus Forsberg on July 27, 2009, 09:14:56 AM
Good job on this, Arantor!
Title: Re: Page Dropdown
Post by: JBlaze on July 27, 2009, 09:35:03 AM
Great job, Arantor :)
Title: Re: Page Dropdown
Post by: Özgür on July 27, 2009, 09:41:57 AM
Great Mod Arantor simple and useful as like as smf =)
Title: Re: Page Dropdown
Post by: Arantor on July 27, 2009, 10:12:21 AM
Quote from: SoLoGHoST on July 27, 2009, 09:11:45 AM
Nice MOD, though why not just give an option in the Admin Panel to choose between Page Drop Down and Page Links instead of having both of them?  Just a thought.

Interesting idea. I hadn't thought of that.

That said, for users who don't have JS available, they would be unable to page through if the admin were to only have the drop down, so there's an accessibility argument for not doing that. It's something I can review for a future version though, thanks!

And thanks to everyone else! I tried to make this in a way that wouldn't affect any theme; it's a mod only to Subs.php, so it should appear on just about every theme.
Title: Re: Page Dropdown
Post by: MaXiForum.cz on July 27, 2009, 11:06:26 AM
Thanks Arantor!!! :-)
Title: Re: Page Dropdown
Post by: SoLoGHoST on July 27, 2009, 11:22:29 AM
Quote from: Arantor on July 27, 2009, 10:12:21 AM

Interesting idea. I hadn't thought of that.

That said, for users who don't have JS available, they would be unable to page through if the admin were to only have the drop down, so there's an accessibility argument for not doing that. It's something I can review for a future version though, thanks!
Well, if you place a GO Button next to it, problem solved :)
Title: Re: Page Dropdown
Post by: Arantor on July 27, 2009, 11:29:59 AM
You'd be surprised how much extra work that might actually generate - but again I thank you for the suggestion and will consider it in the next version.
Title: Re: Page Dropdown
Post by: SoLoGHoST on July 27, 2009, 11:35:29 AM
Quote from: Arantor on July 27, 2009, 11:29:59 AM
You'd be surprised how much extra work that might actually generate - but again I thank you for the suggestion and will consider it in the next version.
I am well aware of the work that would be needed to accomplish this.  An easier way would be to just look at how the JumpTo Box does this.

In any case, Thanks and a very nice MOD indeed :)
Title: Re: Page Dropdown
Post by: Arantor on July 27, 2009, 11:38:37 AM
Whoa, that's a LOT of Javascript right there (compared to the one line I'm using!). It should be doable without needing that much JS but we'll see. I have a few other things in the pot right now that will come ahead of upgrading this, but I should get to it soon enough.
Title: Re: Page Dropdown
Post by: LHW on July 27, 2009, 12:03:17 PM
We've got nearly 40 Mods installed on our board, and this one installed without a hitch.  Nice job!
Title: Re: Page Dropdown
Post by: SoLoGHoST on July 27, 2009, 01:41:07 PM
First, let me just say that I hope I am not disrupting your Support Area for this MOD with my topics.  If this is the case, I sincerely apologize and will dismiss myself from it now.  As this is not my intention.

With that being said, Very little to no Javascript would even be needed, maybe just to check if JS is enabled or not.  Haven't checked to see how you have coded the select box with option tags in it.  But it would seem that it is a form and the form has an action that gets sent everytime an option is changed.  So, this being the case, I would then assume that each option tag has a value, so if this is the case all that needs to be done is when the "GO" button is clicked on, submit the form, and whereever it get's submitted to, check the selectbox name for a value, and any other hidden values that may be needed (for example topic id, board id, etc.) have those value's get passed and redirectexit to the page it requested in that topic, and TADA.  Basically, will set the start, limit values accordingly in this function.

Well, I believe I have wore out my welcome in here.  Just wanted to give you an idea on how to do this, though, you are probably already aware of this.

Solomon
Title: Re: Page Dropdown
Post by: Afro on July 27, 2009, 02:53:03 PM
Nice and simple. Welldone

Is there a way to remove other pages ...
I mean the initial 1,2,3.....

and allow everything to be on the dropdown..
Title: Re: Page Dropdown
Post by: Arantor on July 27, 2009, 04:05:23 PM
Adding a Go button is not actually as simple as it sounds, especially without using Javascript - SoLoGHoST, you refer to the Jump To code but seriously that's far more code than mine; yes, it is built using a <select> and an <option> but you still have to provide all the other handling and essentially build the URL which is potentially complex to do like that.

I will however look into it.

Please note this mod is for 'Support and Comments' and all comments are welcome.

I will probably provide an option in a future version however I suspect it will be for 2.0 only in future.
Title: Re: Page Dropdown
Post by: MF30 on July 27, 2009, 04:10:23 PM
Thanks. :)
Title: Re: Page Dropdown
Post by: Arantor on July 27, 2009, 05:24:15 PM
Considering that this mod applies to every single instance of the Page counter throughout SMF, it is no small matter at all to have it submit the form. Nor is it a small matter to ensure it actually generates the appropriate URL reference information - in fact to do so cleanly would take a fairly large amount of code since it has to be modified in a number of places. Thus, a non-JS Go button is unlikely to appear before long. (Please do feel free to correct me however note that I may or may not apply the changes depending on whether they interact with a theme or not)

As for removing the options, this will only be supported for 2.0. Is this something people would want? I will not provide a 1.1 compliant version with any options in it.
Title: Re: Page Dropdown
Post by: babjusi on July 27, 2009, 05:28:06 PM
Nice work again Arantor. Keep it up :)
Title: Re: Page Dropdown
Post by: Joe N on July 29, 2009, 08:26:28 AM
Nice Mod. Good Job :)
Title: Re: Page Dropdown
Post by: Realinfo on July 31, 2009, 03:33:32 AM
Thanks............ Many People were not understand that there are more pages to read in thread.......... By this it's very clear to Newbie member or Guests..................
Title: Re: Page Dropdown
Post by: Özgür on August 01, 2009, 12:37:02 AM
I have a problem :)
Dropdown worked fine in forum boards and topics. But not correctly work on other area.
Ex: memberlist, admin attachment list etc.
In memberlist : If you try to go any pages, you go to ./index.php?action=mlist;sort=real_name;start=
Number is missing. Is this known bug?
Title: Re: Page Dropdown
Post by: Blinker on August 01, 2009, 04:00:49 AM
I can confirm that. The dropdown doesn't work for pages other than topic lists & boards. Just noticed today.
Title: Re: Page Dropdown
Post by: Arantor on August 01, 2009, 08:14:31 AM
How odd. I never encountered that in any other page - thanks for the heads-up, I'll investigate now.
Title: Re: Page Dropdown
Post by: bbmtalk on August 01, 2009, 05:44:46 PM
Quote from: [Daydreamer] on August 01, 2009, 12:37:02 AM
I have a problem :)
Dropdown worked fine in forum boards and topics. But not correctly work on other area.
Ex: memberlist, admin attachment list etc.
In memberlist : If you try to go any pages, you go to ./index.php?action=mlist;sort=real_name;start=
Number is missing. Is this known bug?

Same problem here too. For example, in the "Show the last post of the person" from profile, it shows the dropdown but doesn't jump to the page. It always return to the page 1.

Also, when in the forum, the dropdown menu doesn't jump on the bottom page link. The top one works.

Thanks for making this mod. It is useful.
Title: Re: Page Dropdown
Post by: digger on August 03, 2009, 03:43:09 PM
Quote from: bbmtalk on August 01, 2009, 05:44:46 PM
Also, when in the forum, the dropdown menu doesn't jump on the bottom page link. The top one works.

I have this problem too.
Title: Re: Page Dropdown
Post by: Arantor on August 03, 2009, 04:07:35 PM
Interesting since it's the exact same code in both cases.

I'm still looking at a fix to it that should sort all the issues out in one swoop.
Title: Re: Page Dropdown
Post by: bbmtalk on August 03, 2009, 08:48:48 PM
Thanks for taking a look on this. I also checked using both IE and FF - same problem.
Title: Re: Page Dropdown
Post by: Arantor on August 03, 2009, 09:01:48 PM
The root cause is actually more an inconsistency in SMF than anything else, that the same code can be called in different ways.

I should be able to get a fixed version up tomorrow :)
Title: Re: Page Dropdown
Post by: LHW on August 03, 2009, 11:31:19 PM
For what it's worth, neither the Top or the Bottom one seem to work on the "Recent Posts" page...in addition to the previously mentioned issues.  We're running v1.1.10.
Title: Re: Page Dropdown
Post by: Arantor on August 04, 2009, 07:35:42 AM
All these faults are actually the same problem as each other.

Resolution due shortly.
Title: Re: Page Dropdown
Post by: Arantor on August 04, 2009, 09:30:30 AM
Updated to version 1.1 which should fix all these issues.
Title: Re: Page Dropdown
Post by: Blinker on August 04, 2009, 09:56:04 AM
Great work Arantor, the update seems to have fixed the problem. I tested on a few instances of multiple pages (not counting topics or boards) and it worked fine.

Title: Re: Page Dropdown
Post by: Arantor on August 04, 2009, 10:08:11 AM
Excellent :)
Title: Re: Page Dropdown
Post by: bbmtalk on August 04, 2009, 02:23:51 PM
The update seems to fix the problems. Thank you very much for the update, Arantor.

This mod will please my members very much.
Title: Re: Page Dropdown
Post by: LHW on August 29, 2009, 04:33:05 PM
Thanks for the update!  Seems to be working just fine now.  ;D
Title: Re: Page Dropdown
Post by: Shark-Time on September 12, 2009, 02:46:02 PM
great mod was looking for kind of this mod...
Title: Re: Page Dropdown
Post by: SoLoGHoST on November 13, 2009, 06:09:42 PM
Just wanted to let everyone know here that Arantor has handed me this mod to support and update.  First update I have in mind is the option to remove the pagination 1[2]3...456 links like these and have the page dropdown in there instead of those links.  If you guys have any further ideas for improving this mod, please feel free to share them with me.

Cheers :)
Title: Re: Page Dropdown
Post by: Arantor on November 13, 2009, 06:10:44 PM
Sounds like a good addition :)

Seem to recall you mentioning this a while ago...
Title: Re: Page Dropdown
Post by: SoLoGHoST on November 13, 2009, 06:12:20 PM
Quote from: Arantor on November 13, 2009, 06:10:44 PM
Sounds like a good addition :)

Seem to recall you mentioning this a while ago...

lol, it's the 2nd post within this topic... hehe ;)
Title: Re: Page Dropdown
Post by: linette97 on November 28, 2009, 12:49:35 AM
Thanks works great!
Title: Re: Page Dropdown
Post by: MaXiForum.cz on December 07, 2010, 01:59:09 PM
This modification works on RC4 fine :-)
Thank you.
Title: Re: Page Dropdown
Post by: SoLoGHoST on December 07, 2010, 05:06:40 PM
Thanks for the reminder on this, updated package-info.xml for RC3, and RC4.  Tested, and works on both just fine without any edits needed cept for package-info.xml.
Title: Re: Page Dropdown
Post by: jeroenenagnes on May 12, 2012, 06:52:27 AM
Is it possible to only show this dropdown in topics and NOT on boards?


Jeroen.
Title: Re: Page Dropdown
Post by: Arantor on May 12, 2012, 07:46:23 AM
Not without a lot more effort - both places call the same code.
Title: Re: Page Dropdown
Post by: jeroenenagnes on May 12, 2012, 10:26:20 AM
Hmm bummer. Going to uninstall the mod because too many people find it anoying on the boardindex.


Jeroen.
Title: Re: Page Dropdown
Post by: NekoJonez on April 24, 2013, 09:01:23 AM
Is this mod going to be updated to the newest versions of SMF?
Title: Re: Page Dropdown
Post by: SoLoGHoST on April 24, 2013, 09:19:14 AM
Yeah, I will be working on updating all of my mods for the newest SMF (2.0.4) very shortly.  Thanks for the reminder.
Title: Re: Page Dropdown
Post by: NekoJonez on April 29, 2013, 10:23:26 AM
Quote from: SoLoGHoST on April 24, 2013, 09:19:14 AM
Yeah, I will be working on updating all of my mods for the newest SMF (2.0.4) very shortly.  Thanks for the reminder.

That's awesome to hear. Thanks. :)

I bookmarked this thread for when the update arrives.
Title: Re: Page Dropdown
Post by: Draffi on July 24, 2013, 08:13:59 PM
something new here?
Title: Re: Page Dropdown
Post by: NekoJonez on July 27, 2013, 10:54:23 AM
Quote from: Draffi on July 24, 2013, 08:13:59 PM
something new here?
Nope not yet.
Title: Re: Page Dropdown
Post by: Arantor on August 10, 2013, 07:08:27 PM
Funny, it seems to work with just emulation, I'm not sure what update is required...
Title: Re: Page Dropdown
Post by: NekoJonez on August 11, 2013, 06:49:49 AM
Quote from: Arantor on August 10, 2013, 07:08:27 PM
Funny, it seems to work with just emulation, I'm not sure what update is required...
I just updated the XML actually for my forum. Because emulation messed up one of my mods before. 
Title: Re: Page Dropdown
Post by: Arantor on August 11, 2013, 08:12:03 AM
Then you did it wrong.
Title: Re: Page Dropdown
Post by: NekoJonez on August 11, 2013, 12:42:27 PM
Most likely, but I'm sometimes pretty lazy in hunting down my mistake then :P
Title: Re: Page Dropdown
Post by: Arantor on August 11, 2013, 09:01:13 PM
So... emulate, do the install, revert the emulation, job done.