![]() |
|
#8
|
|||
|
|||
|
You can use cron jobs or php, to change the pets image over time, I don't know how to remove clicks without messing up the adoptable script, but this may create a lead. This is a script I have for my own pet system I made. It makes the adoptables image change.
Just putting it out there as a resource to do this ^^; This is a image.php?id=3 it shows a pets image depending on the id number of the pet. You would need to add babyurl , teenurl , adulturl in your speices table..I think you probably already have that but with a diffrent name. In owned adoptables table you should add `date` varchar(255) NOT NULL, `fulldate` varchar(255) NOT NULL, `halfdate` varchar(255) NOT NULL, Code:
function greaterDate($dformat, $beginDate, $endDate)
{
$subtract = $endDate - $beginDate;
if($subtract > 0) {
return 1;
}
else {
return 0;
}
}
function p_image($url) {
//edit line below
return './adoptable image dictionary/' . $url;
}
function check(){
//pid is the adoptables id being requested
$pid = mysql_real_escape_string($_GET['id']);
$result = mysql_query("SELECT * FROM `OWNED ADOPTS` WHERE `id` = '{$pid}'");
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
//petid is in owned adopts table, it is the id of the speices adopted.
$results = mysql_query("SELECT * FROM `S P E C I E S` WHERE `id` = '{$row['petid']}'");
$pet = mysql_fetch_array($results);
$results2 = mysql_query("SELECT * FROM `U S E R S` WHERE `id` = '{$row['owner']}'");
$user = mysql_fetch_array($results2);
if(greaterDate(".", $row['fulldate'], date('Ymd')) > 0) {
$im = p_image($pet[adulturl']);
$image = imagecreatefrompng($im);
header('Content-type: image/png');
return imagepng($image);
return imagedestroy($image);
} elseif(greaterDate(".", $row['halfdate'], date('Ymd')) > 0 && greaterDate(".", $row[fulldate], date('Ymd')) <= 0){
$im = p_image($pet['teenurl']);
$image = imagecreatefrompng($im);
header('Content-type: image/png');
return imagepng($image);
return imagedestroy($image);
} elseif(greaterDate(".", $row['halfdate'], date('Ymd')) <= 0){
$im = p_image($pet['babyurl']);
$image = imagecreatefrompng($im);
header('Content-type: image/png');
return imagepng($image);
return imagedestroy($image);
}
}
}
echo check();
Code:
$date = date('Y/m/d');
$halfdate = date('Ymd') + 7;
$fulldate = date('Ymd') + 13;
Sorry I can't give a mod for this, its just a resource to whomever can complete the job.Keep in mind its not very secure and may need some edits :S |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Limit clicks/day to 10 | sensacion | Questions and Supports | 1 | 07-02-2011 06:15 AM |
| X Days before evolution | fadillzzz | Mys v1.1.x Mods | 0 | 02-21-2011 04:42 AM |
| waiting for premium for 5 days | Amerfira | Questions and Supports | 10 | 10-01-2010 04:10 AM |
| Limit clicks/day to 10, for each pet? | Quillink | Questions and Supports | 9 | 02-08-2010 03:35 PM |
| No Clicks at all? | rosepose | Questions and Supports | 11 | 03-07-2009 09:42 AM |
What's New? |
What's Hot? |
What's Popular? |