Mysidia Adoptables Support Forum

Mysidia Adoptables Support Forum (http://www.mysidiaadoptables.com/forum/index.php)
-   Mys v1.3.x Mods (http://www.mysidiaadoptables.com/forum/forumdisplay.php?f=42)
-   -   Mys v1.3.4 Dynamically Generated Images Addon (http://www.mysidiaadoptables.com/forum/showthread.php?t=5503)

Dinocanid 03-12-2018 05:49 PM

You could use variables in the image url, so it fetches the proper species type. For example:
Quote:

'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 Code:

'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 Code:

if($pet->currentlevel >= 1){
//image array for baby pets goes here...



SyntaxError73 03-12-2018 07:51 PM

Quote:

Originally Posted by Dinocanid (Post 37043)
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 Code:

'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 Code:

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.


All times are GMT -5. The time now is 09:24 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.