Mysidia Adoptables Support Forum

Mysidia Adoptables Support Forum (http://www.mysidiaadoptables.com/forum/index.php)
-   Mys v1.2.x Mods (http://www.mysidiaadoptables.com/forum/forumdisplay.php?f=38)
-   -   GD images (http://www.mysidiaadoptables.com/forum/showthread.php?t=2515)

mapleblade 11-09-2011 02:40 AM

GD images [DONE]
 
1 Attachment(s)
this will show all your adoptables with the name and click under it like click critters:

EXAMPLE:
http://www.epicmiro.99webs.info/siggy.php?id=4


in functions.php find:
PHP Code:

function getcurrentimage($id) {

    
// This function determines which image we should use for a given adoptable...

    
$image "";



    
// First we select the adoptable from the database and get some basic information...

    
$query "SELECT * FROM ".$GLOBALS['prefix']."owned_adoptables WHERE aid='$id'";

    
$result runquery($query);

    
$num mysql_num_rows($result);



    
$type=@mysql_result($result0,"type"); 

    
$currentlevel=@mysql_result($result0,"currentlevel"); 

    
$imageurl=@mysql_result($result0,"imageurl");

    
$usealternates=@mysql_result($result0,"usealternates");



    if(
$imageurl != "") {

        
// If we are using a custom image for this adoptable, use that

        
$image $imageurl;

    }

    else {

        
// There is no custom image, so we must see if we are using an egg or a level image.

        
if($currentlevel == or $currentlevel == "0") {

            
// Let's see what the egg image is...    

            
$query "SELECT * FROM ".$GLOBALS['prefix']."adoptables WHERE type='$type'";

            
$result runquery($query);

            
$num mysql_num_rows($result);



            
$eggimage=@mysql_result($result0"eggimage"); 



            
$image $eggimage// Set the image URL equal to the egg image...

        
}

        else {

            
// We don't know the level or the image - we must find both.



            
$query "SELECT * FROM ".$GLOBALS['prefix']."levels WHERE adoptiename='$type' and thisislevel='$currentlevel'";

            
$result runquery($query);

            
$num mysql_num_rows($result);



            
$primaryimage=@mysql_result($result0,"primaryimage"); 

            
$alternateimage=@mysql_result($result0,"alternateimage");



            
// If alternate images are enabled and an alternate image exists, use it

            
if($usealternates == "yes" and $alternateimage != "") {

                
$image $alternateimage// Use the alternate image

            
}

            else{

                
$image $primaryimage// Set the image equal to the primary image for the level

            
}

        }



    }



    if(
$type == "" or $image == "") {

        
// We did not settle on an image, so we show an error image...

        
$image "http://www.".$GLOBALS['domain']."".$GLOBALS['scriptpath']."/templates/icons/delete.gif";

    }

    return 
$image;



replace with:
PHP Code:

function getcurrentimage($id) {

$image "http://www.".$GLOBALS['domain']."".$GLOBALS['scriptpath']."/image.php?id=".$id."";
return 
$image;
    
}



function 
getcurrentrealimage($id) {

    
// This function determines which image we should use for a given adoptable...

    
$image "";



    
// First we select the adoptable from the database and get some basic information...

    
$query "SELECT * FROM ".$GLOBALS['prefix']."owned_adoptables WHERE aid='$id'";

    
$result runquery($query);

    
$num mysql_num_rows($result);



    
$type=@mysql_result($result0,"type"); 

    
$currentlevel=@mysql_result($result0,"currentlevel"); 

    
$imageurl=@mysql_result($result0,"imageurl");

    
$usealternates=@mysql_result($result0,"usealternates");



    if(
$imageurl != "") {

        
// If we are using a custom image for this adoptable, use that

        
$image $imageurl;

    }

    else {

        
// There is no custom image, so we must see if we are using an egg or a level image.

        
if($currentlevel == or $currentlevel == "0") {

            
// Let's see what the egg image is...    

            
$query "SELECT * FROM ".$GLOBALS['prefix']."adoptables WHERE type='$type'";

            
$result runquery($query);

            
$num mysql_num_rows($result);



            
$eggimage=@mysql_result($result0"eggimage"); 



            
$image $eggimage// Set the image URL equal to the egg image...

        
}

        else {

            
// We don't know the level or the image - we must find both.



            
$query "SELECT * FROM ".$GLOBALS['prefix']."levels WHERE adoptiename='$type' and thisislevel='$currentlevel'";

            
$result runquery($query);

            
$num mysql_num_rows($result);



            
$primaryimage=@mysql_result($result0,"primaryimage"); 

            
$alternateimage=@mysql_result($result0,"alternateimage");



            
// If alternate images are enabled and an alternate image exists, use it

            
if($usealternates == "yes" and $alternateimage != "") {

                
$image $alternateimage// Use the alternate image

            
}

            else{

                
$image $primaryimage// Set the image equal to the primary image for the level

            
}

        }



    }



    if(
$type == "" or $image == "") {

        
// We did not settle on an image, so we show an error image...

        
$image "http://www.".$GLOBALS['domain']."".$GLOBALS['scriptpath']."/templates/icons/delete.gif";

    }

    return 
$image;



And upload the image.php and your'e done!

mapleblade 11-09-2011 08:00 AM

updated: DONE!

mapleblade 11-09-2011 01:47 PM

id love to have some feedback please x.x x3

Tequila 11-09-2011 05:56 PM

If I used the GD images this would be great. :smile: You've done it again. :3

mapleblade 11-10-2011 12:33 AM

haha, while i was making it, i suddently realized the fonts were exactly the same as the ones from clickcritters lol.

mapleblade 11-10-2011 12:45 AM

right now, if you have too small images, the text wont fit, so be sure to make the adoptable images a set size or something, so the text under it will look better.

mapleblade 11-24-2011 11:10 AM

i added an example to the post

mapleblade 02-29-2012 11:58 AM

maybe ill add functions to add badges to the adoptable (i.e the highest cliked adoptable gets a medal)

ChibiMaestro 02-29-2012 03:43 PM

The site contains images from SilvAdopts, did she give you permission?

mapleblade 03-01-2012 02:01 AM

i just used it at testing image, its not an official site or anything, i forgot to remove it, thanks for tellin.


All times are GMT -5. The time now is 11:12 AM.

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