Mysidia Adoptables Support Forum

Mysidia Adoptables Support Forum (http://www.mysidiaadoptables.com/forum/index.php)
-   Questions and Supports (http://www.mysidiaadoptables.com/forum/forumdisplay.php?f=18)
-   -   Only 2? (http://www.mysidiaadoptables.com/forum/showthread.php?t=698)

BMR777 04-27-2009 05:38 PM

RE: Only 2?
 
Basically you would make a new database table for the alternate images that contains the adoptable type, level and level image location, plus give each alternate level a defining name, such as alternate1, alternate2 etc.

Then you need to modify the getcurrentimage() function in functions.php to read from the new table if the adoptable is using alternate images. So, in functions.php for getcurrentimage() replace the part after "If alternate images are enabled and an alternate image exists, use it" with...

PHP Code:

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

        
// Using an alternate image, read from the alternate images table you 
                // made based on adoptable type and type of alternate image.

        
}
        else{

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


        } 

Then you would have to alter doadopt.php and levelup.php where they determine alternate images and change it so it picks a specific alternate image set, which you could store in the usealternates field for a given adoptable in owned_adoptables.

It's not something that can be done in 5 minutes, but it is doable.

gjac1 04-27-2009 05:38 PM

RE: Only 2?
 
I have created a new table called "adopts_alts" , the structure of this table is just a single field called "alturl" , Type : varchar(120)

I have already added 10 alternate image locations, the part at where i am stuck now is where to edit in the functions.php file, i have found where the alternate image is :

PHP Code:

// 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

        


Thanks for all your help :)

BMR777 04-27-2009 05:39 PM

RE: Only 2?
 
Basically, you want to replace:

PHP Code:

$image $alternateimage// Use the alternate image 

With some code to assign $image to one of the alternate images you created for the adoptable.

gjac1 04-27-2009 05:39 PM

RE: Only 2?
 
ahh, sorry, i seem to have posted just after you did :s , it seems i was way off with what i was doing lol :(

Thanks for the reply, i will give it a go now :)[hr]
ok, i know you must be getting really annoyed with me now, sorry :( but the reply you gave telling me what i needed to replace in the code, is that in response to what i was doing or an add on explanation to your guide ??

If its a reply to my idea, do i change it to :

PHP Code:

$image 'adopts_alts' $alturl 

You must get so tired of us noobs, and again i am really sorry.....

gjac1 04-28-2009 04:38 AM

RE: Only 2?
 
I have tried several different things to try and get it to pick one image from the new table i created, but i am having no luck...

Anyone have any ideas what i need to replace that line of code with ??

gjac1 04-30-2009 12:26 PM

RE: Only 2?
 
Sorry to keep bugging you with this, but have you had a chance to think this over a little more ??

Like i said, i have setup the new table which includes the links to the multiple random images, i just dont know what code to add or where to add it to make it select one and them from the new table...

Thanks again for all your patience and help :)

BMR777 04-30-2009 12:39 PM

RE: Only 2?
 
What is the structure of your table?

Seapyramid 04-30-2009 02:28 PM

RE: Only 2?
 
Why not do like I did and work with the system, not change it? Make the same adoptable more then once and different outcomes on each one:) Mystic Grave has Companions with up to 5 outcomes currently. :)

Sea

gjac1 04-30-2009 04:40 PM

RE: Only 2?
 
I called the new table "adopts_alts" , the structure is just 1 field named "alturl" which is a varchar(120) type, this is where i input the url of the image.

Sea, i kind of did something like that with the old script, i created a html page for the adoption page, made the egg on all 10 adoptable exactly the same, then created 10 different outcomes..but i had to edit the "type" of adoptable manually in the DB, which wasnt fun....

BMR777 04-30-2009 04:56 PM

RE: Only 2?
 
You need more structure than alturl. You should have the URL to the alternate image, the adoptable type and the level the alternate level is for, at a minimum.


All times are GMT -5. The time now is 01:31 PM.

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