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

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #13  
Old 04-30-2011, 01:27 PM
Beaux Beaux is offline
Member
 
Join Date: Apr 2011
Posts: 13
Gender: Female
Credits: 2,807
Beaux is on a distinguished road
Default

PHP Code:
// Now we check those three conditions we have in the Admin CP
    
if($row['whenisavail'] == "conditions") {
        
// If we have a restriction on the number of times this can be adopted...
        
if($row['freqcond'] == "enabled") {
            
// Select from the database and determine how many times this adoptable type has been adopted
            
$num 0;

            
$query "SELECT * FROM ".$GLOBALS['prefix']."owned_adoptables WHERE type='$type'"// QUERYPROBLEM
            
$result runquery($query);
            
$num mysql_numrows($result);

            if(
$num $number) {
                return 
"no";
            }
        }

        
// Begin the date restriction check
        
$today date('Y-m-d');

        if(
$row['datecond'] == "enabled" and $row['date'] != $today) {
            return 
"no";
        }

        
// We are checking to see how many of this adoptable a user owns
        // If they own more than the specifed number, they cannot adopt...
        
if($row['moreless'] == "enabled") {
            
$num 0;

            
$query "SELECT * FROM ".$GLOBALS['prefix']."owned_adoptables WHERE owner='$loggedinname' and type='$type'";
            
$result runquery($query);
            
$num mysql_numrows($result);

            if(
$num $row['morelessnum']) {
                return 
"no";
            }
        }


        
// Check if the user is of a specified usergroup...
        
if($row['levelgrle'] == "enabled") {
            
$ourgid getgroup();

            
// If the two numbers do not match, do not allow the adoption...
            
if($ourgid != $row['grlelevel']) {
                return 
"no";
            }    
        }
    } 
// end conditions
    
return "yes";
}

// MESSY
function getaltstatus($parentid$childid$childlevel) {

    
// This function determines if we will use alternate images...
    
$alt "Cannot find adopt with given parent id.";

    
// First we need to see if this adoptable type has alternate images enabled...
    
$query "SELECT * FROM ".$prefix."adoptables WHERE id='".$parentid."'";
    
$result mysql_query($query);
    
$num mysql_num_rows($result);
    
$alternates=@mysql_result($result$i,"alternates");
    
    
// Let's see if the level we are on is the level that requires alternates
    
if($alternates == "enabled") {
        
// Alternates for adoptable type are enabled, next check to see if this adopt is already using an alternate.
        
$query "SELECT * FROM ".$prefix."owned_adoptables WHERE aid='".$childid."'";
        
$result mysql_query($query);
        
$num mysql_num_rows($result);
        
$usealt=@mysql_result($result$i,"usealternates");
        
$currentimage=@mysql_result($result$i,"altimage");
        if(
$usealt == "no"){
        
// Alternates are not currently being used, next check for alternate image w/ specified entry level.
        
$query "SELECT * FROM ".$prefix."alternates WHERE entry='".$childlevel."' AND adoptid='".$parentid."'";
        
$result runquery($query);
        
        while(
$row mysql_fetch_array($result)){
        
$method=$row['method'];
        
$data=$row['data'];
        
$newurl=$row['alturl'];
        
// check what kind of method we're using to choose an alternate.
        
if($method == "random"){
        
$chance rand(1$data);
        if(
$chance == 1){
            
$alt $newurl;
        }
        else{
            
$alt "The random finder did not pick 1.";
        }
        
        }
        else{
            
$alt "Not finding method random...";
        }
        
        
$i++;
        }
        
        
        }
        else if(
$usealt == "yes"){ 
Lines 400-500.
I'll bet anything I pasted it in wrong.

Last edited by Kaeliah; 04-30-2011 at 07:04 PM.
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
alternate outcomes Nemesis Questions and Supports 3 07-03-2012 01:36 PM
EpicStats Plugin [by Kae] Kaeliah Mys v1.2.x Mods 9 04-10-2011 07:46 PM
View Active Promocodes Plugin HIddenPanda Mys v1.1.x Mods 11 01-25-2011 05:10 PM
Alternate adopt RipJawWolfFang Questions and Supports 10 02-03-2010 09:41 PM
Multiple multiple outcomes..? Quillink Suggestions and Feature Requests 5 05-31-2009 07:14 AM


All times are GMT -5. The time now is 02:54 PM.

Currently Active Users: 3718 (0 members and 3718 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