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 08-28-2011, 12:13 AM
SilverDragonTears's Avatar
SilverDragonTears SilverDragonTears is offline
I am your Nemesis.
 
Join Date: Jun 2011
Posts: 1,113
Gender: Female
Credits: 84,761
SilverDragonTears is on a distinguished road
Default I love questions =)

I wanted to disallow leveling up adults (increasing their clicks)

so I found this:

Code:
	
	// Now we see if the adoptable is frozen by its owner.  If it is, we do not level...

	if($isfrozen == "yes"){

	$article_title = $lang_isfrozen_title;
	$article_content = $lang_isfrozen_explain;

	}
And after it added this:

Code:
	// Now we see if the adoptable is an adult.  If it is, we do not level...

	if($currentlevel == "5"){

	$article_content = "Adults can not be leveled up!";

	}
It works but how do I disallow getting coins for clicking it?
__________________

Check out SilvaTales
Reply With Quote
  #2  
Old 08-28-2011, 12:18 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: 395,470
Hall of Famer is on a distinguished road
Default

Well find these lines in your levelup.php:

PHP Code:
    if($isfrozen == "no"){   
    
changecash(grabanysetting('rewardmoney'), $GLOBALS['username'], $GLOBALS['money']);
    
$article_content $article_content "<div align='center'><br />You have earned "grabanysetting('rewardmoney') ." "grabanysetting('cost') ." for leveling up this adoptable. <br />You now have {$GLOBALS['money']} ".grabanysetting('cost')."</div>";
    } 
Replace with:(assuming the maximum level on your site is 5, as inferred from your script)
PHP Code:
    if($isfrozen == "no" and $currentlevel <5){   
    
changecash(grabanysetting('rewardmoney'), $GLOBALS['username'], $GLOBALS['money']);
    
$article_content $article_content "<div  align='center'><br />You have earned ".  grabanysetting('rewardmoney') ." "grabanysetting('cost') ." for  leveling up this adoptable. <br />You now have {$GLOBALS['money']}  ".grabanysetting('cost')."</div>";
    } 
Give a try on your site and see if it works.

Hall of Famer
__________________


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

wonderful!!! *more cookies for you* need some milk?
__________________

Check out SilvaTales
Reply With Quote
  #4  
Old 08-28-2011, 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: 395,470
Hall of Famer is on a distinguished road
Default

Well this is up to you. XD

Did you try the code on Silvadopts? Lemme know if you have more questions regarding customizing your site.
__________________


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

Yep, it worked perfect! That's why I gave you cookies!! I do have another question but maybe more complicated. I want to show a link that will list all the children an adopt has had. How difficult would this be?
__________________

Check out SilvaTales
Reply With Quote
  #6  
Old 08-28-2011, 12:34 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: 395,470
Hall of Famer is on a distinguished road
Default

Oh I see, I am glad it works for ya.

Well its not really complicated, are you using Arianna's family tree script? As I've said before, that one is not compatible with Mys v1.2.x, but perhaps you've got it to work. If so, you will find the two columns 'father' and 'mother' in prefix.ownedadoptables table. What you should do is to make a PHP table that retrieves data from all rows of child adoptables whose father(if the gender is male) or mother(if the gender is female) is very parent adoptable you have selected.

If you do not use Arianna's family tree script, then create two columns 'father' and 'mother' in table prefix.owned_adoptables and repeat the same procedure as mentioned above.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #7  
Old 08-28-2011, 12:38 AM
SilverDragonTears's Avatar
SilverDragonTears SilverDragonTears is offline
I am your Nemesis.
 
Join Date: Jun 2011
Posts: 1,113
Gender: Female
Credits: 84,761
SilverDragonTears is on a distinguished road
Default

Yes I'm using her script and it's working wonderfully(after tweaking some things) however, my coding is still not advanced so... err.. can you show me? I learn better seeing it. It's hard to follow how to do it all myself.
__________________

Check out SilvaTales
Reply With Quote
  #8  
Old 08-28-2011, 01:11 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: 395,470
Hall of Famer is on a distinguished road
Default

Alright I will show you. But since I am not that familiar with Arianna's family tree script, what I provide below should NOT be directly copy/pasted to your site. It merely serves as a reference, especially since I do not know exactly what your database owned_adoptables looks like and what mysql command you uses to retrieve data.

First of all, you need to retrieve the gender of your parent adoptable. The parentid should be available to you already, and I strongly advise you to name it $parentid to avoid confusion. Write the codes below:

PHP Code:
$result runquery("SELECT * FROM {$prefix}owned_adoptables WHERE aid = '{$parentid}'") ;
$row mysql_fetch_array($result);
$gender $row['gender']; 
Next, you will need to select from database prefix.owned_adoptables for all child adoptables with the very parent. This may vary depends on if the parent adoptable is male or female, as shown below:

PHP Code:
if($gender == "f"){
    
$query "SELECT * FROM {$prefix}owned_adoptables,  
                            
{$prefix}adoptables  WHERE {$prefix}owned_adoptables.mother = '{$parentid}
                                                 AND 
{$prefix}adoptables.type = {$prefix}owned_adoptables.type 
                                                 ORDER BY 
{$prefix}owned_adoptables.aid";
    
$result runquery($query);
}
else{
    
$query "SELECT * FROM {$prefix}owned_adoptables,  
                            
{$prefix}adoptables  WHERE {$prefix}owned_adoptables.father = '{$parentid}
                                                 AND 
{$prefix}adoptables.type = {$prefix}owned_adoptables.type 
                                                 ORDER BY 
{$prefix}owned_adoptables.aid";
    
$result runquery($query);

Nicely done, you should write a table to display child adoptables info, a good example is provided below, you may modify it to suit your need:

PHP Code:
    $article_content "<table border='1'>
    <tr>
    <th>Image</th><th>Species</th><th>Name</th><th>Level</th><th>TotalClicks</th><th>Owner</th><th>Gender</th>
    </tr>"
;
    while(
$row mysql_fetch_array($result)){
       if(
$row['usealternates'] =='yes')
            { 
                
$image $row['alternateimage']; 
            }
       else
            { 
                
$image $row['primaryimage']; 
            }
       if(
$row['currentlevel'] == 0)
            { 
                
$image $row['eggimage']; 
            }
       if(
$image=='')
            { 
                
$image $row['primaryimage']; 
            }
      
$article_content .= "<tr>
                          <td><center><img src='
{$image}'></center></td>
                          <td><center>
{$row['type']}</center></td>
                          <td><center>
{$row['name']}</center></td>
                          <td><center>
{$row['level']}</center></td>
                          <td><center>
{$row['totalclicks']}</center></td>
                          <td><center>
{$row['owner']}</center></td>
                          <td><center><img src='picuploads/
{$row['gender']}.png'></center></td>
                                  </tr>"
;
    }
    
$article_content .= "</table>"
This may look complicated, but it is the only way I can think of with Arianna's family tree script. Give a try on your site and see if you can set up a page like that.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #9  
Old 08-28-2011, 01:14 AM
SilverDragonTears's Avatar
SilverDragonTears SilverDragonTears is offline
I am your Nemesis.
 
Join Date: Jun 2011
Posts: 1,113
Gender: Female
Credits: 84,761
SilverDragonTears is on a distinguished road
Default

ok the only part that confuses me is
Quote:
The parentid should be available to you already, and I strongly advise you to name it $parentid to avoid confusion.
__________________

Check out SilvaTales
Reply With Quote
  #10  
Old 08-28-2011, 01:17 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: 395,470
Hall of Famer is on a distinguished road
Default

That I figured. Would you mind showing your script file so I can tell you which one is supposed to be $parentid?
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
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
Just A Few Questions: Mousewhisper Questions and Supports 4 04-14-2012 07:05 PM
Just some Questions i have. rickasawr Questions and Supports 3 04-30-2011 11:04 PM
Some Questions? :) blondbananamix Questions and Supports 10 04-25-2011 01:47 PM
two questions RoconzaArt Questions and Supports 10 02-24-2011 09:15 AM


All times are GMT -5. The time now is 07:34 PM.

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