Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Addons and Modifications > Addons/Mods Graveyard

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #14  
Old 11-19-2009, 07:34 AM
Arianna's Avatar
Arianna Arianna is offline
Dev Staff
 
Join Date: Sep 2009
Posts: 334
Gender: Female
Credits: 31,744
Arianna will become famous soon enough
Default RE: Cash System

I just made the thing to buy adoptables. It works well, except for I can't get it to set the price in the admin CP - it always defaults to then 10 that I've set. Here's what I did.
PHP Code:
<?

// FILE: admin.php
// okay, I'm a failure here. It only works if I insert it in phpmyadmin. help?
// After line 158 add:
    
<p>Price
    <
input name='price' type='text' id='price'>
    </
p>

// reminder to me: there's a good code for a style switcher on line 119-213

// FILE: nadopt.php
// After line 136 add:
    
$price $_POST["price"];
    
$price secure($price);
    
// Change line 243 (about) to:
mysql_query("INSERT INTO ".$prefix."adoptables VALUES ('', '$name', '$description','$eggimage','$cba','$promocode', '$freqcond', '$number','$datecond','$date','$adoptscond','$maxnumcond','$morethannum','$usergroupcond','$usergroups','$alternates','$altoutlevel','$altchance','$price')");

// in the table adopts_adoptables, use the sql query. Change the '10' to your default adoptable price.
ALTER TABLE  `adopts_adoptablesADD  `priceINT10 NOT NULL DEFAULT  '10';

// we still have to alter two more things - the adopt.php page, and the doadopt.php page.
// FILE: adopt.php
// After line 96 add:
$price=@mysql_result($result,$i,"price");
// After line 152 add:
$price=@mysql_result($result,$i,"price");
// After line 174 add:
<p>I cost ".$price." coins!</p>
// And after line 179 add:
<input name='price' type='hidden' id='price' value='".$price."'>

// FILE: doadopt.php
// After line 102 add:
$price=@mysql_result($result,$i,"price");
// Insert this giant junk of code after:
$code rand(120000);
// Here's the code:
$query "SELECT * FROM `adopts_users` WHERE `username`='$loggedinname'";
$result mysql_query($query);
$num mysql_numrows($result);

$i 0;
while (
$i 1) {
$money = @mysql_result($result$i"money");
$newbalance $money $price;
$i++;
}

mysql_query("UPDATE `adopts_users` SET `money`='" $newbalance "' WHERE `username`='$loggedinname'");

$article_content $article_content "<div align='center'>Thanks for buying your adoptable! Now you have ".$newbalance." coins!</div>"

// I can't guarentee that this is right, but if you have any problems, please tell me. :D
?>
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
secondary cash.. maximillion Questions and Supports 2 07-04-2011 09:42 PM
Games With the Cash System redheadturkey Suggestions and Feature Requests 8 08-27-2010 03:37 AM
Cash System Ashje Questions and Supports 10 12-21-2009 03:55 PM
About the cash system Ben Suggestions and Feature Requests 10 10-07-2009 08:34 PM
Buying 'cash' with cash? Quillink Questions and Supports 4 07-20-2009 03:21 AM


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

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