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