View Single Post
  #13  
Old 06-11-2017, 06:06 PM
Dinocanid's Avatar
Dinocanid Dinocanid is offline
Member
 
Join Date: Aug 2016
Location: Maryland, USA
Posts: 516
Gender: Unknown/Other
Credits: 93,638
Dinocanid is on a distinguished road
Default

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:
$stmt $mysidia->db->select("owned_adoptables", array("aid"), "owner = '{$mysidia->user->username}' ORDER BY totalclicks LIMIT {$pagination->getLimit()},{$pagination->getRowsperPage()}"); 
Maybe make a column in phpMyAdmin called sort and put the stmt line in an if statement; sort of like this:
PHP Code:
$sort $mysidia->db->select("users", array("sort"), "username = '{$mysidia->user->username}'");

if(
$sort 'clicks'){
    
$stmt $mysidia->db->select("owned_adoptables", array("aid"), "owner = '{$mysidia->user->username}' ORDER BY totalclicks LIMIT {$pagination->getLimit()},{$pagination->getRowsperPage()}");
}
elseif(
$sort 'level'){
    
$stmt $mysidia->db->select("owned_adoptables", array("aid"), "owner = '{$mysidia->user->username}' ORDER BY level LIMIT {$pagination->getLimit()},{$pagination->getRowsperPage()}");
}
//etc... 
(This is just psuedo-code, so I doubt it would work as-is)
__________________
Reply With Quote