Assault Posted April 5, 2009 Posted April 5, 2009 I have been modifying my script a bit I have added reCAPTCHA which works very nicely and was very easy to install. ================= First off in the bank.php file how do i get it to show the daily interest you will gain, i want to have a maximum cap of 500k and you stop earning interest after you have 20million in your bank account. Ex: John has Account: 15,000,000 Daily interest: $300,000 (max 500,000) Interest Rate: 2% (For first $20,000,000) ================= Second off, in preferences.php under the shortcuts area there is this error Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/thugmayh/public_html/preferences.php on line 559 line 559 has this: if(mysql_num_rows($q)==0) ================= Third off, how to change the layout of the site, i found how to change the background colors,and tet but how do i make it so the site is not a full page site but rather centered with blank room on each side ================= Thank you all in advanced! Quote
Magictallguy Posted April 5, 2009 Posted April 5, 2009 Re: Some Help with MCCODE V1 I have been modifying my script a bit I have added reCAPTCHA which works very nicely and was very easy to install. ================= First off in the bank.php file how do i get it to show the daily interest you will gain, i want to have a maximum cap of 500k and you stop earning interest after you have 20million in your bank account. Ex: John has Account: 15,000,000 Daily interest: $300,000 (max 500,000) Interest Rate: 2% (For first $20,000,000) ================= Second off, in preferences.php under the shortcuts area there is this error Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/thugmayh/public_html/preferences.php on line 559 line 559 has this: if(mysql_num_rows($q)==0) ================= Third off, how to change the layout of the site, i found how to change the background colors,and tet but how do i make it so the site is not a full page site but rather centered with blank room on each side ================= Thank you all in advanced! 1st: Not quiet sure what you are wanting exactly.. $interest = $ir['bankmoney'] / 100; $increase = $interest - $ir['bankmoney']; echo "You gain an interest rate of 2% daily "; echo sprintf("Your new balance at the end of today will be \$%s, an increase of \$%s", number_format($interest), number_format($increase)); 2nd: (Interest) Edit cron_day.php Find $db->query("UPDATE users SET bankmoney=bankmoney+(bankmoney/100) WHERE bankmoney>0"); and change to $db->query("UPDATE users SET bankmoney=bankmoney+(bankmoney/100) WHERE ((bankmoney > 0) AND (bankmoney < 20000000))"); 3rd I can't answer that unless you provide the query in the $q variable Quote
Assault Posted April 6, 2009 Author Posted April 6, 2009 Re: Some Help with MCCODE V1 Thank you very much 1st. when i try to enter sections of that intop the page or even the whole thing i get this error Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/thugmayh/public_html/bank.php on line 78 2. It worked! 3. I figured it out, the design/css part is spread out over different files (brilliant) here is my bank.php files <?php /*----------------------------------------------------- -- Mono Country v1.0 BETA -- A product of DBS-entertainment -- Copyright held 2005 by Dabomstew -- INDEX.php -----------------------------------------------------*/ session_start(); require "global_func.php"; if($_SESSION['loggedin']==0) { header("Location: login.php");exit; } $userid=$_SESSION['userid']; require "header.php"; $h = new headers; $h->startheaders(); include "mysql.php"; global $c; $is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error()); $ir=mysql_fetch_array($is); check_level(); $fm=money_formatter($ir['money']); $cm=money_formatter($ir['crystals'],''); $lv=date('F j, Y, g:i a',$ir['laston']); $h->userdata($ir,$lv,$fm,$cm); $h->menuarea(); print "<h3>Bank</h3>"; if($ir['bankmoney']>-1) { switch($_GET['action']) { case "deposit": deposit(); break; case "withdraw": withdraw(); break; default: index(); break; } } else { if(isset($_GET['buy'])) { if($ir['money']>5000) { print "Congratulations, you bought a bank account for \$5,000! [url='bank.php']Start using my bank account![/url]"; mysql_query("UPDATE users SET money=money-5000,bankmoney=0 WHERE userid=$userid",$c); } else { print "You do not have enough money to open an account. [url='explore.php']Back to downtown...[/url]"; } } else { print "Open a bank account today, just \$5,000! [url='bank.php?buy']> Yes, sign me up![/url]"; } } function index() { global $ir,$c,$userid,$h; print "\n <table width='40%' border='2'> <tr> <td width='50%'> <div class="g_content"><h3> Bank</h3><div class="g_text"> Welcome to the bank. Here are your bank details: <table><tr> <td>Bank:</td><td> \${$ir['bankmoney']}</td><td> (How much you have)</td> </tr><tr> <td>Interest Daily:</td><td> </td><td> (How much you have)</td> </tr><tr> <td>Interest Rate:</td><td> 2%</td><td> (Daily Interest)</td> </tr></table> [b]Deposit Money[/b] Fee 0%<form action='bank.php?action=deposit' method='post'> <input type='text' name='deposit' value='{$ir['money']}' /> <input type='submit' value='Deposit' /></form> [b]Withdraw Money[/b] Fee 0%<form action='bank.php?action=withdraw' method='post'> <input type='text' name='withdraw' value='{$ir['bankmoney']}' /><input type='submit' value='Withdraw' /></form> </td> </tr> </table>"; } function deposit() { global $ir,$c,$userid,$h; $_POST['deposit']=abs((int) $_POST['deposit']); if($_POST['deposit'] > $ir['money']) { print "You do not have enough money to deposit this amount."; } else { $fee=ceil($_POST['deposit']*0/100); if($fee > 0) { $fee=0; } $gain=$_POST['deposit']-$fee; $ir['bankmoney']+=$gain; mysql_query("UPDATE users SET bankmoney=bankmoney+$gain, money=money-{$_POST['deposit']} where userid=$userid",$c); print "You hand over \${$_POST['deposit']} to be deposited. [b]You now have \${$ir['bankmoney']} in the bank.[/b] [url='bank.php']> Back[/url]"; } } function withdraw() { global $ir,$c,$userid,$h; $_POST['withdraw']=abs((int) $_POST['withdraw']); if($_POST['withdraw'] > $ir['bankmoney']) { print "You do not have enough banked money to withdraw this amount."; } else { $gain=$_POST['withdraw']; $ir['bankmoney']-=$gain; mysql_query("UPDATE users SET bankmoney=bankmoney-$gain, money=money+$gain where userid=$userid",$c); print "You ask to withdraw $gain, the banking lady grudgingly hands it over. [b]You now have \${$ir['bankmoney']} in the bank.[/b] [url='bank.php']> Back[/url]"; } } $h->endpage(); ?> Quote
Magictallguy Posted April 6, 2009 Posted April 6, 2009 Re: Some Help with MCCODE V1 <?php /*----------------------------------------------------- -- Mono Country v1.0 BETA -- A product of DBS-entertainment -- Copyright held 2005 by Dabomstew -- INDEX.php -----------------------------------------------------*/ session_start(); require "global_func.php"; if($_SESSION['loggedin']==0) { header("Location: login.php");exit; } $userid=$_SESSION['userid']; require "header.php"; $h = new headers; $h->startheaders(); include "mysql.php"; global $c; $is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error()); $ir=mysql_fetch_array($is); check_level(); $fm=money_formatter($ir['money']); $cm=money_formatter($ir['crystals'],''); $lv=date('F j, Y, g:i a',$ir['laston']); $h->userdata($ir,$lv,$fm,$cm); $h->menuarea(); print "<h3>Bank</h3>"; if($ir['bankmoney']>-1) { switch($_GET['action']) { case "deposit": deposit(); break; case "withdraw": withdraw(); break; default: index(); break; } } else { if(isset($_GET['buy'])) { if($ir['money']>5000) { print "Congratulations, you bought a bank account for \$5,000! [url='bank.php']Start using my bank account![/url]"; mysql_query("UPDATE users SET money=money-5000,bankmoney=0 WHERE userid=$userid",$c); } else { print "You do not have enough money to open an account. [url='explore.php']Back to downtown...[/url]"; } } else { print "Open a bank account today, just \$5,000! [url='bank.php?buy']> Yes, sign me up![/url]"; } } function index() { global $ir,$c,$userid,$h; $interest = $ir['bankmoney'] / 100; $increase = $interest - $ir['bankmoney']; print "\n <table width='40%' border='2'> <tr> <td width='50%'> <div class=\"g_content\"><h3> Bank</h3><div class=\"g_text\"> Welcome to the bank. Here are your bank details: <table><tr> <td>Bank:</td><td> \$".number_format($ir['bankmoney'])."</td><td> (How much you have)</td> </tr><tr> <td>Interest Daily:</td><td> \$".number_format($interest)."</td><td> (How much you get)</td> </tr><tr> <td>Interest Rate:</td><td> 2%</td><td> (Daily Interest)</td> </tr></table> [b]Deposit Money[/b] Fee 0%<form action='bank.php?action=deposit' method='post'> <input type='text' name='deposit' value='{$ir['money']}' /> <input type='submit' value='Deposit' /></form> [b]Withdraw Money[/b] Fee 0%<form action='bank.php?action=withdraw' method='post'> <input type='text' name='withdraw' value='{$ir['bankmoney']}' /><input type='submit' value='Withdraw' /></form> </td> </tr> </table>"; } function deposit() { global $ir,$c,$userid,$h; $_POST['deposit']=abs((int) $_POST['deposit']); if($_POST['deposit'] > $ir['money']) { print "You do not have enough money to deposit this amount."; } else { $fee=ceil($_POST['deposit']*0/100); if($fee > 0) { $fee=0; } $gain=$_POST['deposit']-$fee; $ir['bankmoney']+=$gain; mysql_query("UPDATE users SET bankmoney=bankmoney+$gain, money=money-{$_POST['deposit']} where userid=$userid",$c); print "You hand over \${$_POST['deposit']} to be deposited. [b]You now have \${$ir['bankmoney']} in the bank.[/b] [url='bank.php']> Back[/url]"; } } function withdraw() { global $ir,$c,$userid,$h; $_POST['withdraw']=abs((int) $_POST['withdraw']); if($_POST['withdraw'] > $ir['bankmoney']) { print "You do not have enough banked money to withdraw this amount."; } else { $gain=$_POST['withdraw']; $ir['bankmoney']-=$gain; mysql_query("UPDATE users SET bankmoney=bankmoney-$gain, money=money+$gain where userid=$userid",$c); print "You ask to withdraw $gain, the banking lady grudgingly hands it over. [b]You now have \${$ir['bankmoney']} in the bank.[/b] [url='bank.php']> Back[/url]"; } } $h->endpage(); ?> Quote
Assault Posted April 6, 2009 Author Posted April 6, 2009 Re: Some Help with MCCODE V1 Wow, thanks! it worked beautifully! but don't i have to add a cron some where so it credits each account with their interest each day? Quote
Magictallguy Posted April 7, 2009 Posted April 7, 2009 Re: Some Help with MCCODE V1 Wow, thanks! it worked beautifully! but don't i have to add a cron some where so it credits each account with their interest each day? Already added I believe, though I think that's a 1% increase. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.