Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 02-13-2017, 12:13 PM
kristhasirah's Avatar
kristhasirah kristhasirah is offline
Member
 
Join Date: Jan 2010
Location: In middle of the nothingness
Posts: 196
Gender: Female
Credits: 37,842
kristhasirah
Default

there's an old thread here with a code doing what you want, but you will need to edit it so it can work with the new script:
http://mysidiaadoptables.com/forum/s...ead.php?t=3527

I manage to make it work, so is not that hard ^^ you just need to add a new row in the database in the adopt_adoptables called rarity and made the changes to the code so it can appear

PHP Code:
   $adoptform "<form name='form1' method='post' action='$adopt'><table id='adoptdark' name='adopt' class='adopt'>";
    
$common 0
    
$uncommon rand(1,50);   
    
$rare rand(1,100);   
    
$ultrarare rand(1,200);
    
$legendary rand(1,300);   

    if (
$uncommon==&& $onlyone==0){   
    
$query "SELECT * FROM ".constant('PREFIX'). "adoptables WHERE rarity='1' ORDER BY RAND() LIMIT 1"
$onlyone 1;   
    }   
    else if (
$rare==&& $onlyone==0){   
    
$query "SELECT * FROM ".constant('PREFIX'). "adoptables WHERE rarity='2' ORDER BY RAND() LIMIT 1"
$onlyone 1;   
    }       
    else if (
$ultrarare==1  && $onlyone==0){   
    
$query "SELECT * FROM ".constant('PREFIX'). "adoptables WHERE rarity='3' ORDER BY RAND() LIMIT 1"
$onlyone 1;   
    }  
    else if (
$legendary==1  && $onlyone==0){   
    
$query "SELECT * FROM ".constant('PREFIX'). "adoptables WHERE rarity='4' ORDER BY RAND() LIMIT 1"
$onlyone 1;   
    }     
    else{   
    
$query "SELECT * FROM ".constant('PREFIX'). "adoptables WHERE rarity='0' ORDER BY RAND() LIMIT 1";   
    }   
    
$stmt $mysidia->db->query($query);  
    
        while(
$row $stmt->fetchObject()) {

            
$adoptform .= "<td width='25%' VALIGN='center'><div align=center><img src='http://127.0.0.1/pokeupdate/picuploads/unknownegg.png' /></div></a><br><div align=center><input type='radio' name='id' id='id' value='{$row->id}' /></div><div align=center><strong>{$row->description}</strong></td>";
        
        }
    
    
    
$common 0
    
$uncommon rand(1,50);   
    
$rare rand(1,100);   
    
$ultrarare rand(1,200);
    
$legendary rand(1,300);   

    if (
$uncommon==&& $onlyone==0){   
    
$query "SELECT * FROM ".constant('PREFIX'). "adoptables WHERE rarity='1' ORDER BY RAND() LIMIT 1"
$onlyone 1;   
    }   
    else if (
$rare==&& $onlyone==0){   
    
$query "SELECT * FROM ".constant('PREFIX'). "adoptables WHERE rarity='2' ORDER BY RAND() LIMIT 1"
$onlyone 1;   
    }       
    else if (
$ultrarare==1  && $onlyone==0){   
    
$query "SELECT * FROM ".constant('PREFIX'). "adoptables WHERE rarity='3' ORDER BY RAND() LIMIT 1"
$onlyone 1;   
    }  
    else if (
$legendary==1  && $onlyone==0){   
    
$query "SELECT * FROM ".constant('PREFIX'). "adoptables WHERE rarity='4' ORDER BY RAND() LIMIT 1"
$onlyone 1;   
    }     
    else{   
    
$query "SELECT * FROM ".constant('PREFIX'). "adoptables WHERE rarity='0' ORDER BY RAND() LIMIT 1";   
    }   
    
$stmt $mysidia->db->query($query);  

    while(
$row $stmt->fetchObject()) {

            
$adoptform2 .= "<td width='25%' VALIGN='center'><div align=center><img src='http://127.0.0.1/pokeupdate/picuploads/unknownegg.png' /></div></a><br><div align=center><input type='radio' name='id' id='id' value='{$row->id}' /></div><div align=center><strong>{$row->description}</strong></div></td>";

            
   } 
   
    
$common 0
    
$uncommon rand(1,50);   
    
$rare rand(1,100);   
    
$ultrarare rand(1,200);
    
$legendary rand(1,300);   

    if (
$uncommon==&& $onlyone==0){   
    
$query "SELECT * FROM ".constant('PREFIX'). "adoptables WHERE rarity='1' ORDER BY RAND() LIMIT 1"
$onlyone 1;   
    }   
    else if (
$rare==&& $onlyone==0){   
    
$query "SELECT * FROM ".constant('PREFIX'). "adoptables WHERE rarity='2' ORDER BY RAND() LIMIT 1"
$onlyone 1;   
    }       
    else if (
$ultrarare==1  && $onlyone==0){   
    
$query "SELECT * FROM ".constant('PREFIX'). "adoptables WHERE rarity='3' ORDER BY RAND() LIMIT 1"
$onlyone 1;   
    }  
    else if (
$legendary==1  && $onlyone==0){   
    
$query "SELECT * FROM ".constant('PREFIX'). "adoptables WHERE rarity='4' ORDER BY RAND() LIMIT 1"
$onlyone 1;   
    }     
    else{   
    
$query "SELECT * FROM ".constant('PREFIX'). "adoptables WHERE rarity='0' ORDER BY RAND() LIMIT 1";   
    }   
    
$stmt $mysidia->db->query($query);  

    while(
$row $stmt->fetchObject()) {

            
$adoptform3 .= "<td width='25%' VALIGN='center'><div align=center><img src='http://127.0.0.1/pokeupdate/picuploads/unknownegg.png' /></div></a><br><div align=center><input type='radio' name='id' id='id' value='{$row->id}' /></div><div align=center><strong>{$row->description}</strong></div></td>";
    }
  
   
        
$document->add(new Comment("{$adoptform}{$adoptform2}{$adoptform3}")); 
probably is not the best way of doing it, but it works for me ^^
I have mine below the lines:
PHP Code:
            $document->addLangvar((!$mysidia->user->isloggedin)?$mysidia->lang->guest:$mysidia->lang->member);          
            
$adoptForm = new Form("form""adopt""post");
            
$adoptTitle = new Comment("Available Adoptables");
            
$adoptTitle->setHeading(3);
            
$adoptForm->add($adoptTitle);
            
$adoptTable = new Table("table"""FALSE); 
and above the lines:
PHP Code:
            $adoptForm->add($adoptTable);        
            
$adoptForm->add(new Button("Adopt Me""submit""submit"));
            
$document->add($adoptForm);
        }
    }
}
?> 
this part of the code:
PHP Code:
$document->add(new Comment("{$adoptform}{$adoptform2}{$adoptform3}")); 
replaces the
PHP Code:
$document->add(new Comment($adoptform)); 
cant post my full adoptview.php file because is very modified.
hope this can be use full for you^^

this code shows 3 eggs at the same time.
__________________
Reply With Quote
 


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


All times are GMT -5. The time now is 09:43 AM.

Currently Active Users: 4071 (0 members and 4071 guests)
Threads: 4,081, Posts: 32,032, 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 - 2025, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636