Thread: Influence
View Single Post
  #1  
Old 11-11-2011, 11:49 PM
SilverDragonTears's Avatar
SilverDragonTears SilverDragonTears is offline
I am your Nemesis.
 
Join Date: Jun 2011
Posts: 1,113
Gender: Female
Credits: 113,231
SilverDragonTears is on a distinguished road
Default Influence

So I thought my influence script was working but now that I've released it, it isn't functioning properly. When $lastinfluence is inserted, it inserts into ALL the adopts and not just the adopt doing the influence.

HELP!
PHP Code:
else if($act == "influence"){


if(
is_numeric($id)){

// Now we see if the adoptable actually exists...

$query "SELECT * FROM ".$prefix."owned_adoptables WHERE owner='$loggedinname' and aid='$id'";
$result runquery($query);
$num mysql_numrows($result);

//Loop out code
$i=0;
while (
$i 1) {

$aid=@mysql_result($result,$i,"aid"); //The adoptable's ID
$currentlevel=@mysql_result($result,$i,"currentlevel");
$type=@mysql_result($result,$i,"type");
$name=@mysql_result($result,$i,"name");
$totalclicks=@mysql_result($result,$i,"totalclicks");
$isfrozen=@mysql_result($result,$i,"isfrozen");
$lastinfluence=@mysql_result($result,$i,"lastinfluence");

$i++;
}

if(
$aid == $id){


$time time();
$image getcurrentimage($id); // Get the image for the adopt...

if($more == ""){

$article_title "Allow an adopt to be influenced female by ".stripslashes($name);
$article_content "<center><img src='".$image."'><br>"
$lastweek time() - ((grabanysetting('breedinginterval')) * 24 60 60);

if(
$lastinfluence >= '$lastweek'){
$article_content .= "You must wait one week before influencing.<br>";
}else{
$article_content .= "Select an Adoptable<br>";
       
$result runquery("SELECT * FROM {$prefix}owned_adoptables WHERE owner ='{$loggedinname}' and currentlevel <=3 and isfrozen = 'no'");
       while(
$row mysql_fetch_array($result)){
         
$article_content .= " <img src='http://silvadopts.com/get/".$row['aid'].".gif'> {$row['aid']} {$row['name']} <a href='myadopts.php?act=influence&id=".$row['aid']."&more=confirm'>Influence</a><br>";
       
}


       
}

}
else if(
$more == "confirm"){

// Actually run the execution

runquery("UPDATE ".$prefix."owned_adoptables SET gender='f', usealternates='yes' WHERE aid='".$id."'");
runquery("UPDATE ".$prefix."owned_adoptables SET lastinfluence = '$time' WHERE aid='$id'");

$article_title $lang_influence_title_complete;
$article_content $lang_influence_complete;

$article_content $aid." was influenced successfully!";
}

__________________

Check out SilvaTales
Reply With Quote