#11
|
||||
|
||||
I'm selfish and don't like to share ;)
|
#12
|
||||
|
||||
I know this is an old post (like a REALLY old one...) but how would I let users sort their pets? Through a preset list. I've been attempting to work it out but I don't have a good enough grasp of PHP... I can get the dropdown list with the button to show up but I don't know how to make it actually send the info to sort the pets that way..
I'd like them to be able to sort their pets by clicks, level, gender, name, class, and birthday (date adopted, which I have stored in the database as birthday in the format 'June 11th, 2017'). Any help would be much, MUCH, appreciated.. XD Once I see the code I'll know how to add more to it, probably, it's just having no idea where to start...
__________________
It's been a long time. I had so much fun making a site back in 2016 that recently, when I started thinking about it again, I decided to come back and work on something small. It'll probably just be a personal project but who knows? We'll see, anyway.
|
#13
|
||||
|
||||
I've haven't tried it, but I'm assuming this can be done by storing the user's choice somewhere and changing the sort order based on that. So in myadopts.php, there's this line:
PHP Code:
PHP Code:
__________________
|
#14
|
||||
|
||||
Thanks! I'll try it out tomorrow because I'm probably too tired to make sense of anything XD
__________________
It's been a long time. I had so much fun making a site back in 2016 that recently, when I started thinking about it again, I decided to come back and work on something small. It'll probably just be a personal project but who knows? We'll see, anyway.
|
#15
|
||||
|
||||
Hmm it doesn't like the elseif parts o.O It basically ignores them and uses the last 'if' statement regardless of what $sort is set as. I also tried making them all 'if' statements just in case but then it just uses the last one as the default, regardless of what is input in the database... I also tried using them in the view file (just as a test XD) and it obviously didn't work lol XD
PHP Code:
__________________
It's been a long time. I had so much fun making a site back in 2016 that recently, when I started thinking about it again, I decided to come back and work on something small. It'll probably just be a personal project but who knows? We'll see, anyway.
|
#16
|
||||
|
||||
I decided to play around with it and I got it working! The refresh is a bit strange, but it works well enough. Otherwise users would have to click on the page link again to see the changes.
For the column in phpMyAdmin, you're going to have to set the default 'as defined' to one of the choices or else you'll get an error. PHP Code:
PHP Code:
I might add this to the tutorials (or mods) section since it seems to be in high demand.
__________________
|
#17
|
||||
|
||||
Awesome! Thanks so much! And people would love it as a mod XD
Also, for the redirect, couldn't you use this instead? PHP Code:
And how would I get the button on the same line as the drop down box? It's for purely aesthetic reasons but I have the text as 'Sort by clicks', 'Sort by [whatever]', etc and want the button next to it. Thanks for your help :3
__________________
It's been a long time. I had so much fun making a site back in 2016 that recently, when I started thinking about it again, I decided to come back and work on something small. It'll probably just be a personal project but who knows? We'll see, anyway.
|
#18
|
||||
|
||||
I tried to do it myself, but couldn't figure it out. You can probably do it manually through css with a div element and positioning it next to the dropdown box, but that could lead to issues depending on the user's window size.
EDIT: I can't seem to get the refresh to work that way on my end, I just get an error: Quote:
__________________
Last edited by Dinocanid; 06-12-2017 at 04:11 PM. |
#19
|
||||
|
||||
Okay thanks anyway! ^_^ I'm going to give it a shot!
And maybe try PHP Code:
All it would mean is you'd have to manually change the link if you change domains
__________________
It's been a long time. I had so much fun making a site back in 2016 that recently, when I started thinking about it again, I decided to come back and work on something small. It'll probably just be a personal project but who knows? We'll see, anyway.
|
#20
|
||||
|
||||
Still won't work. I'll just stick with what I had xD
__________________
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
"Fairy State" theme by Bobbybighoof (Mysidia 1.3.3) | bobbybig | Templates and Themes | 3 | 07-18-2018 06:54 PM |
Removing of prefix "class", "abstract", "interface" Suggestions | FounderSim | Suggestions and Feature Requests | 3 | 10-05-2014 05:35 PM |
Changing... or "masking" existing URLs | Vaporman87 | Questions and Supports | 7 | 03-03-2014 07:10 PM |
[Updated] AJAX Sortable Adoptables on "myadopts.php" Page | fadillzzz | Mys v1.2.x Mods | 57 | 05-29-2012 02:16 AM |
A php question about changing the "level up" section | coffeeaddict | Questions and Supports | 6 | 02-26-2011 11:08 AM |
What's New? |
What's Hot? |
What's Popular? |