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)
-   -   Cannot view last pet (http://www.mysidiaadoptables.com/forum/showthread.php?t=5478)

Dinocanid 06-28-2017 11:05 AM

Cannot view last pet
 
One of my users reported not being able to view/manage their last pet, and clicking the next page pagination just shows the last pet from the first page. (They have 16, but can only see 15) The pet they can't see is their favorite/active pet if that helps.
PHP Code:

    public function index(){
        
$mysidia Registry::get("mysidia");
        
$total $mysidia->db->select("owned_adoptables", array("aid"), "owner = '{$mysidia->user->username}'")->rowCount();
        
$pagination = new Pagination($total10"myadopts");
        
$pagination->setPage($mysidia->input->get("page"));    
        
        
//Attempting to sort!
        
$sort $mysidia->db->select("users_options", array("petsort"), "username = '{$mysidia->user->username}'")->fetchColumn();
            switch (
$sort){
    case 
'clicks'
        
$stmt $mysidia->db->select("owned_adoptables", array("aid"), "owner = '{$mysidia->user->username}' ORDER BY totalclicks LIMIT {$pagination->getLimit()},{$pagination->getRowsperPage()}");
        break;
    case 
'gender'
        
$stmt $mysidia->db->select("owned_adoptables", array("aid"), "owner = '{$mysidia->user->username}' ORDER BY gender LIMIT {$pagination->getLimit()},{$pagination->getRowsperPage()}"); 
        break;
    case 
'level'
        
$stmt $mysidia->db->select("owned_adoptables", array("aid"), "owner = '{$mysidia->user->username}' ORDER BY currentlevel LIMIT {$pagination->getLimit()},{$pagination->getRowsperPage()}");
        break;
    case 
'name'
        
$stmt $mysidia->db->select("owned_adoptables", array("aid"), "owner = '{$mysidia->user->username}' ORDER BY name LIMIT {$pagination->getLimit()},{$pagination->getRowsperPage()}");
        break;
}
        
        
//Sorting ends here!
        
$this->setField("pagination"$pagination);
        
$this->setField("stmt", new DatabaseStatement($stmt));
    } 

(myadopts.php)
Continued in next post...

parayna 06-28-2017 11:29 AM

I think sometimes what happens is with the sort feature it randomises the pets on each page (so sometimes some pets that were on the previous page also appear on the next page). Maybe check what sort they have, and if it's clicks how many clicks the pet they can't see has (in comparison to the pet they can see). I've figured that the levels and clicks sort both have that problem but the name one doesn't (as usually pets don't have the same name, maybe?)

Dinocanid 06-28-2017 12:36 PM

Yeah, it looks like that's probably it. I ran into a similar problem when sorting by level and gender, but not clicks and name. They have their sort set to clicks now, but it could've been set to something else when they reported it.

parayna 06-28-2017 12:40 PM

Hmm... I have the issue when it's set to clicks o.O (If more than one pet has the same amount of clicks, they'll sometimes swap places.. get's noticeable when it transfers across pages lol)

Dinocanid 06-28-2017 01:35 PM

They replied back and said that there's always a pet missing no matter how they sort their pets.
Quote:

The pets that vanish changes however you sort the pantry but it always seems to be replaced with a duplicate of the cheese egg for the mouse.
(direct quote)

parayna 06-28-2017 01:36 PM

Hmm that's odd o.O I haven't really been able to duplicate it on Foodbabs but I do have like 29 pets now so it's a little hard to really see if one appears more than once or not at all... :/

Dinocanid 06-29-2017 10:51 AM

I clicked through the sorting options a bunch of times each and yeah, it seems to randomize which pets appear on what page sometimes which can lead to some pets being missed. I never ran into the problem before when it was always ordered by clicks, but now choosing to order by clicks makes it random o.0
This is just really wierd.

parayna 06-29-2017 11:53 AM

It is... it also happens on my site o.O (But I have 30 pets being shown per page, so it probably won't be too much of an issue at the beginning lol)

I don't know how you'd make it not random, unless you specified what order each adoptable owned by that person specifically appeared in... (which would probably be so much work and not very practical in the long run)


All times are GMT -5. The time now is 01:51 PM.

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