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)
-   -   Check for Pet Level? (http://www.mysidiaadoptables.com/forum/showthread.php?t=5116)

Abronsyth 04-24-2016 06:24 PM

Check for Pet Level?
 
Edit: Way to go, solving my own problem XD
For those who may find use of it! You can use something like this to require a user to have a particular pet:
PHP Code:

    $haspet $mysidia->db->select("owned_adoptables", array("type"), "type ='TYPE NAME' and owner='{$mysidia->user->username}'")->fetchColumn(); 
        if(
$haspet){
            
$document->add(new Comment("CONTENT"FALSE));
        }
        else{
            
$document->add(new Comment("Sorry, you don't have the correct pet to enter!"FALSE));
        } 

And this for a user to have a particular level (of any pet):
PHP Code:

    $haspet $mysidia->db->select("owned_adoptables", array("currentlevel"), "currentlevel ='#' and owner='{$mysidia->user->username}'")->fetchColumn(); 
        if(
$haspet){
            
$document->add(new Comment("CONTENT"FALSE));
        }
        else{
            
$document->add(new Comment("Sorry, your pets are all too young or old to enter!"FALSE));
        } 

And this for a user to have a particular level and type:
PHP Code:

        $haspet $mysidia->db->select("owned_adoptables", array("type""currentlevel"), "type ='TYPE' and currentlevel='LEVEL' and owner='{$mysidia->user->username}'")->fetchColumn(); 
        if(
$haspet){
            
$document->add(new Comment("Test Success"FALSE));
        }
        else{
            
$document->add(new Comment("Sorry, you don't have the right pet at the right age to enter!"FALSE));
        } 

This can be very useful if you want to include exploring and/or quests on your site!

-Abron

tahbikat 04-26-2016 12:28 AM

Oh, awesome! I'll definitely be using this. ^^


All times are GMT -5. The time now is 07:46 AM.

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