Mysidia Adoptables Support Forum  

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

Notices

Reply
 
Thread Tools Display Modes
  #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: 82,578
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
  #2  
Old 11-12-2011, 02:53 AM
mapleblade mapleblade is offline
Epicness sausage
 
Join Date: May 2009
Posts: 180
Gender: Male
Credits: 20,005
mapleblade
Default

try changing
PHP Code:

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

runquery
("UPDATE ".$prefix."owned_adoptables SET gender='f', usealternates='yes' WHERE aid='".$aid."'");
runquery("UPDATE ".$prefix."owned_adoptables SET lastinfluence = '$time' WHERE aid='".$aid."'"); 
__________________
Need coding help? send me a PM! :)
Reply With Quote
  #3  
Old 11-12-2011, 11:57 AM
SilverDragonTears's Avatar
SilverDragonTears SilverDragonTears is offline
I am your Nemesis.
 
Join Date: Jun 2011
Posts: 1,113
Gender: Female
Credits: 82,578
SilverDragonTears is on a distinguished road
Default

I've tried that :/
__________________

Check out SilvaTales
Reply With Quote
  #4  
Old 11-12-2011, 02:46 PM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 338,157
Hall of Famer is on a distinguished road
Default

umm are you sure this is all you got for the influence script? It is technically impossible to have influence inserting into all adoptables unless you have a loop that executes erroneously. I do not see such a loop from your codes above.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #5  
Old 11-12-2011, 03:13 PM
SilverDragonTears's Avatar
SilverDragonTears SilverDragonTears is offline
I am your Nemesis.
 
Join Date: Jun 2011
Posts: 1,113
Gender: Female
Credits: 82,578
SilverDragonTears is on a distinguished road
Default

I don't want it to go into all the adoptables. Just the one that is doing the influencing.
__________________

Check out SilvaTales
Reply With Quote
  #6  
Old 11-13-2011, 06:02 PM
SilverDragonTears's Avatar
SilverDragonTears SilverDragonTears is offline
I am your Nemesis.
 
Join Date: Jun 2011
Posts: 1,113
Gender: Female
Credits: 82,578
SilverDragonTears is on a distinguished road
Default

Halp!
__________________

Check out SilvaTales
Reply With Quote
Reply


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
Last Influence Countdown SilverDragonTears Questions and Supports 2 12-07-2011 10:13 PM


All times are GMT -5. The time now is 06:02 AM.

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