Mysidia Adoptables Support Forum

Mysidia Adoptables Support Forum (http://www.mysidiaadoptables.com/forum/index.php)
-   Questions and Supports (http://www.mysidiaadoptables.com/forum/forumdisplay.php?f=18)
-   -   Sort "myadopts" page (http://www.mysidiaadoptables.com/forum/showthread.php?t=2199)

SilverDragonTears 06-13-2011 08:07 PM

Sort "myadopts" page
 
Is there a way to let users sort their adoptables into the order they want?

SilverDragonTears 06-15-2011 11:39 AM

anyone? =( My members are requesting this and I've no idea how to implement it.

fadillzzz 06-15-2011 11:50 AM

Could you be more specific?
In what order do they actually want? By the total clicks? levels? names? ascending or descending?
Or something more customizable like, they have full control which one is the first, second, third, and so on regardless of the adoptables' stats?

SilverDragonTears 06-15-2011 11:57 AM

More customizable where they can sort which is first,second etc, regardless of the stats =p The other I could do but I don't have any idea how to make it so they can sort them and save the order.

fadillzzz 06-15-2011 12:16 PM

You'll need to create a new table for that
I'm thinking the table would be something like this
-----------------------------------
|adoptable_id|sorting_number|
-----------------------------------
|_________1|____________2|
|_________2|____________3|
|_________7|____________1|
|_________4|____________1|
...

And then when you're fetching the adoptables from the owned_adoptables table, join it with the other table above and order the rows by the sorting_number field.

SilverDragonTears 06-15-2011 12:33 PM

Ok, how would I go about allowing them to actually sort them... and how to join the tables? I've no idea where to start and can follow code but I'm not advanced by any means =p

fadillzzz 06-15-2011 12:51 PM

To allow users to sort their adoptables, you can create a page where it lists all their own adoptables and put a textbox next to each adoptable for them to input the sorting number.

The JOIN query would probably look like this
SELECT * FROM adopts_owned_adoptables JOIN adopts_sorting_adoptables ON adoptable_id = aid ORDER BY sorting_number ASC;

I think that should do it (for the query part)

Ruinily 06-15-2011 03:51 PM

This is great, I've been dying for something like this for ages! I'll be trying it out soon too after straightening out some other little things and see if it works for me. :)

SilverDragonTears 06-15-2011 06:28 PM

Got it working thanks to an awesome friend. Now my next issue.

Is it possible to give my users a link for other people to see the adoptables they own?

EDIT: nm =p friend is doing that as well.. I luuuv this guy!

Ruinily 06-15-2011 11:36 PM

o.o Where did you get this friend and can I get one? :D


All times are GMT -5. The time now is 05:01 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.