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 04-03-2012, 07:57 PM
SilverDragonTears's Avatar
SilverDragonTears SilverDragonTears is offline
I am your Nemesis.
 
Join Date: Jun 2011
Posts: 1,113
Gender: Female
Credits: 82,318
SilverDragonTears is on a distinguished road
Default How to replace this to work with new Mys

Anyone know what to replace the query with to work with the new functions? I've tried things but nothing works.

PHP Code:
function getfamilymembers($aid$generation){
  
$familymember = array(array($aid));  
  for(
$i=0$i<$generation$i++){
    for(
$j=0$j<count($familymember[$i]); $j++){
      
$query "SELECT * FROM {$GLOBALS['prefix']}owned_adoptables WHERE aid = '{$familymember[$i][$j]}'";
      
$thisadopt mysql_fetch_array($result);
      
$familymember[$i+1][2*$j] = $thisadopt['mother'];
      
$familymember[$i+1][2*$j+1] = $thisadopt['father']; 
    }     
  }
  return 
$familymember;

__________________

Check out SilvaTales
Reply With Quote
  #2  
Old 04-04-2012, 12:24 AM
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: 332,942
Hall of Famer is on a distinguished road
Default

Change this line:

PHP Code:
$thisadopt mysql_fetch_array($result); 
to the codes below:

PHP Code:
$stmt $GLOBALS['adopts']->query($query);
$row $stmt->fetch(PDO::FETCH_ASSOC); 
__________________


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

Did that, now I'm getting:

Code:
Fatal error: Call to undefined function getcurrentimage() in /home/taleofdr/public_html/lineage.php on line 21
which is:
Code:
$familyinsert[0][0] = "<a href='levelup.php?id={$familymember[0][0]}'><img src='".getcurrentimage($familymember[0][0])."'/></a><br>";
__________________

Check out SilvaTales
Reply With Quote
  #4  
Old 04-04-2012, 12:59 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: 332,942
Hall of Famer is on a distinguished road
Default

Well that error has nothing to do with the function getfamilymember() script itself, and its simple enough to fix. I trust you will have no problem figuring it out on your own, give a try and lemme know only if you still cant find out cause of this error at the end of the day.
__________________


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

I've been fiddling with it for three days now :( Usually I can figure these things out but not this one.
It's clearly the new functions thing. It works fine on my SA site.
__________________

Check out SilvaTales

Last edited by SilverDragonTears; 04-04-2012 at 01:37 PM.
Reply With Quote
  #6  
Old 04-04-2012, 03:19 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: 332,942
Hall of Famer is on a distinguished road
Default

Well just add the below codes to the beginning of your script file:

PHP Code:
include("functions/functions_adopts.php"); 
The function getcurrentimage() has been moved to the file functions_adopts.php. I split the original large functions.php file into five pieces for Mys v1.3.0.
__________________


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

Well I managed to get the page to show without errors... I didn't know how to properly change this:

Code:
      $adoptexist = mysql_num_rows($result);
So I removed it. The parents don't show up though :/

Edit: Lol... my wisdom tooth hurts and is making my brain stupid.. I fixed it :p
__________________

Check out SilvaTales

Last edited by SilverDragonTears; 04-04-2012 at 04:45 PM.
Reply With Quote
  #8  
Old 04-04-2012, 05:49 PM
SilverDragonTears's Avatar
SilverDragonTears SilverDragonTears is offline
I am your Nemesis.
 
Join Date: Jun 2011
Posts: 1,113
Gender: Female
Credits: 82,318
SilverDragonTears is on a distinguished road
Default

One more thing... the names aren't showing up?

Code:
function getfamilynames($familymember, $generation){
  $familyname = array(array());
  for($i=0; $i<=$generation; $i++){
    for($j=0; $j<count($familymember[$i]); $j++){
      $query = "SELECT * FROM {$GLOBALS['prefix']}owned_adoptables WHERE aid = '{$familymember[$i][$j]}'";
      $stmt = $GLOBALS['adopts']->query($query);
$adoptexist = $stmt->fetch(PDO::FETCH_ASSOC); 
      if($adoptexist == 0) $familyname[$i][$j] = "<br>";
      else $familyname[$i][$j] = $thisadopt['name'];
    }
  }
  return $familyname;  
}
__________________

Check out SilvaTales
Reply With Quote
  #9  
Old 04-04-2012, 06:08 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: 332,942
Hall of Famer is on a distinguished road
Default

Well, replace the line below:

PHP Code:
$adoptexist $stmt->fetch(PDO::FETCH_ASSOC);        
if(
$adoptexist == 0$familyname[$i][$j] = "<br>"
by the correct one:

PHP Code:
$thisadopt $stmt->fetch(PDO::FETCH_ASSOC); 
if(!
is_object($thisadopt)) $familyname[$i][$j] = "<br>"
__________________


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

That didn't work but I left out a part... here is the original

Code:
function getfamilynames($familymember, $generation){
  $familyname = array(array());
  for($i=0; $i<=$generation; $i++){
    for($j=0; $j<count($familymember[$i]); $j++){
      $result = mysql_query("SELECT * FROM {$GLOBALS['prefix']}owned_adoptables WHERE aid = '{$familymember[$i][$j]}'");
      $thisadopt = mysql_fetch_array($result);
      $adoptexist = mysql_num_rows($result);
      if($adoptexist == 0) $familyname[$i][$j] = "<br>";
      else $familyname[$i][$j] = $thisadopt['name'];
    }
  }
  return $familyname;  
}
__________________

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
Replace shoutbox with a different chat box tahbikat Questions and Supports 0 12-01-2015 09:07 AM
Does this script always not work? PokeFerno Questions and Supports 5 05-10-2014 01:17 PM
Oh My God. Something else does not work PokeFerno Questions and Supports 1 05-10-2014 10:14 AM
Links will not work Eagle9615 Questions and Supports 4 07-03-2013 11:30 PM
Replace Index Page SilverDragonTears Questions and Supports 0 06-02-2011 09:24 PM


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

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