Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Addons and Modifications > Mys v1.2.x Mods

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 11-09-2011, 03:40 AM
mapleblade mapleblade is offline
Epicness sausage
 
Join Date: May 2009
Posts: 180
Gender: Male
Credits: 24,923
mapleblade
Default GD images [DONE]

this will show all your adoptables with the name and click under it like click critters:

EXAMPLE:



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!
Attached Files
File Type: php image.php (1.3 KB, 20 views)
__________________
Need coding help? send me a PM! :)

Last edited by mapleblade; 11-24-2011 at 12:10 PM. Reason: finished the script
Reply With Quote
  #2  
Old 11-09-2011, 09:00 AM
mapleblade mapleblade is offline
Epicness sausage
 
Join Date: May 2009
Posts: 180
Gender: Male
Credits: 24,923
mapleblade
Default

updated: DONE!
__________________
Need coding help? send me a PM! :)

Last edited by mapleblade; 11-09-2011 at 10:32 AM.
Reply With Quote
  #3  
Old 11-09-2011, 02:47 PM
mapleblade mapleblade is offline
Epicness sausage
 
Join Date: May 2009
Posts: 180
Gender: Male
Credits: 24,923
mapleblade
Default

id love to have some feedback please x.x x3
__________________
Need coding help? send me a PM! :)
Reply With Quote
  #4  
Old 11-09-2011, 06:56 PM
Tequila's Avatar
Tequila Tequila is offline
The Grim One
 
Join Date: Jan 2009
Location: Souther Tier, New York State
Posts: 1,356
Gender: Female
Credits: 109,687
Tequila is on a distinguished road
Default

If I used the GD images this would be great. You've done it again. :3
__________________
Artist. Designer. Gamer. Mother.
[portfolio] [tarot] [Rune Hollow] [freebies]
Reply With Quote
  #5  
Old 11-10-2011, 01:33 AM
mapleblade mapleblade is offline
Epicness sausage
 
Join Date: May 2009
Posts: 180
Gender: Male
Credits: 24,923
mapleblade
Default

haha, while i was making it, i suddently realized the fonts were exactly the same as the ones from clickcritters lol.
__________________
Need coding help? send me a PM! :)
Reply With Quote
  #6  
Old 11-10-2011, 01:45 AM
mapleblade mapleblade is offline
Epicness sausage
 
Join Date: May 2009
Posts: 180
Gender: Male
Credits: 24,923
mapleblade
Default

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.
__________________
Need coding help? send me a PM! :)
Reply With Quote
  #7  
Old 11-24-2011, 12:10 PM
mapleblade mapleblade is offline
Epicness sausage
 
Join Date: May 2009
Posts: 180
Gender: Male
Credits: 24,923
mapleblade
Default

i added an example to the post
__________________
Need coding help? send me a PM! :)
Reply With Quote
  #8  
Old 02-29-2012, 12:58 PM
mapleblade mapleblade is offline
Epicness sausage
 
Join Date: May 2009
Posts: 180
Gender: Male
Credits: 24,923
mapleblade
Default

maybe ill add functions to add badges to the adoptable (i.e the highest cliked adoptable gets a medal)
__________________
Need coding help? send me a PM! :)
Reply With Quote
  #9  
Old 02-29-2012, 04:43 PM
ChibiMaestro ChibiMaestro is offline
bruh
 
Join Date: Nov 2010
Location: United Kingdom
Posts: 300
Gender: Female
Credits: 56,490
ChibiMaestro is on a distinguished road
Default

The site contains images from SilvAdopts, did she give you permission?
__________________
Regards,
...the CSS lovin' cookie monster...

~C.Maestro
___________________
I'd like to think I'm good at CSS&HTML, so if you need help with designing templates and stuff, feel free to 'come at me bro' with the questions. Haha, also if you need help with installing the Mysidia Adoptables Script, please check out my guide here!
Reply With Quote
  #10  
Old 03-01-2012, 03:01 AM
mapleblade mapleblade is offline
Epicness sausage
 
Join Date: May 2009
Posts: 180
Gender: Male
Credits: 24,923
mapleblade
Default

i just used it at testing image, its not an official site or anything, i forgot to remove it, thanks for tellin.
__________________
Need coding help? send me a PM! :)
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
no images RoconzaArt Questions and Supports 1 03-13-2011 11:39 AM
More images would be nice. RoconzaArt Feedback and Suggestions 12 01-22-2011 11:24 PM
Images are a no show RoconzaArt Questions and Supports 27 01-15-2011 11:49 PM
I cant see the images zKaZy Questions and Supports 11 03-28-2010 12:49 PM
Images not showing Tequila Questions and Supports 22 03-07-2009 08:15 AM


All times are GMT -5. The time now is 06:22 PM.

Currently Active Users: 709 (0 members and 709 guests)
Threads: 4,081, Posts: 32,031, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636