Mys 1.3.4 Dynamically Generated Images Addon

Forum
Last Post
Threads / Messages
You could use variables in the image url, so it fetches the proper species type. For example:
'http://YOURSITE.com/picuploads/pet_images/{$pet->type}/markings/somemarking.png',

You could create two separate folders for snakes and lizards, but the subfolder names would remain the same. If you don't want to mix up markings by naming them the same thing in both directories, you could label them "snake-stripes1.png" and "lizard-stripes1.png", then you can do this:
PHP:
'http://YOURSITE.com/picuploads/pet_images/{$pet->type}/markings/' . $pet->type . '-stripes1.png'.png',

If you want to go further and grab a different marking based on the level of a pet (assuming it has a baby stage, etc.), then you can replace "$pet->age" with "$pet->currentlevel", and then change the if statement accordingly. So:
PHP:
if($pet->currentlevel >= 1){
//image array for baby pets goes here...
}
 
Last edited:
You could use variables in the image url, so it fetches the proper species type. For example:


You could create two separate folders for snakes and lizards, but the subfolder names would remain the same. If you don't want to mix up markings by naming them the same thing in both directories, you could label them "snake-stripes1.png" and "lizard-stripes1.png", then you can do this:
PHP:
'http://YOURSITE.com/picuploads/pet_images/{$pet->type}/markings/' . $pet->type . '-stripes1.png'.png',

If you want to go further and grab a different marking based on the level of a pet (assuming it has a baby stage, etc.), then you can replace "$pet->age" with "$pet->currentlevel", and then change the if statement accordingly. So:
PHP:
if($pet->currentlevel >= 1){
//image array for baby pets goes here...
}


Yes thank you! this will help a lot, since I am Planning on making marking sets for babies too, and of course multiple species types.
 
Last edited:

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,277
Messages
33,122
Members
1,602
Latest member
BerrieMilk
BETA

Latest Threads

Top