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
  #1  
Old 03-20-2013, 05:46 PM
kristhasirah's Avatar
kristhasirah kristhasirah is offline
Member
 
Join Date: Jan 2010
Location: In middle of the nothingness
Posts: 196
Gender: Female
Credits: 29,073
kristhasirah
Default Edit rarity code for 1.3.2 to the 1.3.3 script

just like the title says, im using the rarity code in my site, and is very useful, because i can hide some eggs from public view and show more some types than others, but i have no idea how i can edit the code to make it compatible with the new script =(

this is the code im using:
Code:
   $adoptform = "<form name='form1' method='post' action='doadopt.php'><h3>Available Adoptables</h3><table width='500' height='130' background='http://pokepony.x10.mx/picuploads/deserty1.png' class='adopt'>";
    $onlyone = 0; 
    $uncommon = rand(1,50);   
    $rare = rand(1,100);   
    $ultrarare = rand(1,200);
    $legendary = rand(1,300);
    $legendary2 = rand(1,250);   

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

    while($row = $stmt->fetchObject()) {
 	  // Call a function to check if we have the proper privledge level to adopt this pet
	  $canadopt = canadopt($aid, "showing", "none", $row); // Feed an adoptable ID and showing, to show the adopt to guests...

	  if($canadopt == "yes"){
			//If we can adopt the adoptable, show the image and adoption link...
			$adoptform .= "<td  width='25%' VALIGN='center'><div align=center><img src='http://www.pokepony.x10.mx/picuploads/png/ee15a8cd09e9cde3a34896e250ece23d.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>";
	  }
   } // End the loop  
   
   $adoptform .= "</table><h3>Adopt</h3>
			     <p>Adoptable Name: <input name='name' type='text' id='name' />
			     <p><input type='submit' name='Submit' value='Adopt Me'></p></form>";
   $mysidia->page->addcontent($adoptform);
__________________
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Item 'Rarity' Column Kyttias Questions and Supports 3 11-08-2014 05:51 PM
My art edit solskenn Art Gallery 6 04-03-2012 09:58 PM
Invite Code/Alpha Code Shex Questions and Supports 0 03-07-2011 04:08 AM
Edit No Name ??[Answered] gjac1 Questions and Supports 5 12-03-2009 05:23 AM


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

Currently Active Users: 788 (0 members and 788 guests)
Threads: 4,080, Posts: 32,024, 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