Name: Unnamed
Owner:
ShinePaw101
Species: Pink Egg
Rarity: Common
$rarity = $adopt->rarity-1;
if(isset($adopt->trait4)){
$extra = 40;
}
elseif(isset($adopt->trait3)){
$extra = 30;
}
elseif(isset($adopt->trait2)){
$extra = 20;
}
elseif(isset($adopt->trait1)){
$extra = 10;
}
$maxviews = 50+($rarity*30)+($extra);
if($adopt->views < $maxviews){
#adopt views are not maxed
$ip = $_SERVER['REMOTE_ADDR'];
if(isset($adopt->viewstoday)){
#views have been obtained today, check if user has already viewed
$viewstoday = explode("/","$adopt->viewstoday");
if(in_array($ip, $viewstoday)){
#user has viewed today
$views = $adopt->views;
}
else{
#user has not viewed today, add a view
$views = $adopt->views+1;
$id = $adopt->id;
$sql = "UPDATE gryalicadopt SET views = '$views' WHERE id = '$id'";
$result = mysqli_query($conn, $sql);
$viewstoday = $adopt->viewstoday."/$ip";
$sql = "UPDATE gryalicadopt SET viewstoday = '$viewstoday' WHERE id = '$id'";
$result = mysqli_query($conn, $sql);
}
}else{
#has not been viewed today, add a view
$views = $adopt->views+1;
$id = $adopt->id;
$sql = "UPDATE gryalicadopt SET views = '$views' WHERE id = '$id'";
$result = mysqli_query($conn, $sql);
$viewstoday = $adopt->viewstoday;
$viewstoday = $ip;
$sql = "UPDATE gryalicadopt SET viewstoday = '$viewstoday' WHERE id = '$id'";
$result = mysqli_query($conn, $sql);
}
#display the view counter
$prog = round(($views/$maxviews)*100);
echo "
This adopt is not ready to hatch.";
}
else{
#adopt views are maxed
echo "
This adopt is ready to hatch!";
}
if(isset($adopt->trait4)){
echo "
This adopt will hatch with 4 extra traits!";
}
elseif(isset($adopt->trait3)){
echo "
This adopt will hatch with 3 extra traits!";
}
elseif(isset($adopt->trait2)){
echo "
This adopt will hatch with 2 extra traits!";
}
elseif(isset($adopt->trait1)){
echo "
This adopt will hatch with 1 extra trait!";
}
?>
Internal Name: GRY20