Please help... I may pull out my hair....
Posted: Thu Dec 18, 2008 2:05 pm
I have been trying to get this to work for months ): If someone could please show me how to get the images for each user I would LOVE you forever. This is what I'm working with... it may be all wrong but I tried
By filling out your Dragon Cave username below, you can add your eggs and hatchlings to the hatchery, the daycare, and the emergency room all at once.
<form action="<?=$_SERVER['PHP_SELF'];?>" method="post">
<div style='margin: 0px auto; text-align: center;'> Username: <input name="username"/> <input type="submit" value="Add"/></div>
</form>
<?
if(!isset($_POST['username']) && isset($_GET['username']) && !empty($_GET['username'])) $_POST['username'] = $_GET['username'];
$data = unserialize(file_get_contents("http://dragcave.net/api/serialize/user/ ... sername'])));
foreach($data['errors'] as $error) {
if($error[0] == 5) {echo "Sorry, we were unable to find an account with that username."; return;}
elseif($error[0] == 6) {echo "Sorry, your account has no dragons."; return;}
}
$eggs ="<td><img src=\"http://dragcave.net/image/(.*).gif\" alt=\'x\'></td><td></td><td>Egg</td>";
foreach($eggs['dragons'] as $ids) {
$ids = array(1=>array(),2=>array(),3=>array());
}
echo "<tr><td><img src='http://dragcave.net/image/".implode("/1.gif'/><img src='http://dragcave.net/image/",$ids[1])."/1.gif'/></td></tr>";
echo "<tr><td><img src='http://dragcave.net/image/".implode("/1.gif'/><img src='http://dragcave.net/image/",$ids[2])."/1.gif'/></td></tr>";
echo "<tr><td><img src='http://dragcave.net/image/".implode("/1.gif'/><img src='http://dragcave.net/image/",$ids[3])."/1.gif'/></td></tr>";
?>
By filling out your Dragon Cave username below, you can add your eggs and hatchlings to the hatchery, the daycare, and the emergency room all at once.
<form action="<?=$_SERVER['PHP_SELF'];?>" method="post">
<div style='margin: 0px auto; text-align: center;'> Username: <input name="username"/> <input type="submit" value="Add"/></div>
</form>
<?
if(!isset($_POST['username']) && isset($_GET['username']) && !empty($_GET['username'])) $_POST['username'] = $_GET['username'];
$data = unserialize(file_get_contents("http://dragcave.net/api/serialize/user/ ... sername'])));
foreach($data['errors'] as $error) {
if($error[0] == 5) {echo "Sorry, we were unable to find an account with that username."; return;}
elseif($error[0] == 6) {echo "Sorry, your account has no dragons."; return;}
}
$eggs ="<td><img src=\"http://dragcave.net/image/(.*).gif\" alt=\'x\'></td><td></td><td>Egg</td>";
foreach($eggs['dragons'] as $ids) {
$ids = array(1=>array(),2=>array(),3=>array());
}
echo "<tr><td><img src='http://dragcave.net/image/".implode("/1.gif'/><img src='http://dragcave.net/image/",$ids[1])."/1.gif'/></td></tr>";
echo "<tr><td><img src='http://dragcave.net/image/".implode("/1.gif'/><img src='http://dragcave.net/image/",$ids[2])."/1.gif'/></td></tr>";
echo "<tr><td><img src='http://dragcave.net/image/".implode("/1.gif'/><img src='http://dragcave.net/image/",$ids[3])."/1.gif'/></td></tr>";
?>