Shakeynath Posted January 1, 2010 Author Posted January 1, 2010 Do you have the extra files ? QUERY ERROR: Unknown column 'proPROPOSED' in 'where clause' Query was SELECT * FROM proposals WHERE proPROPOSED=3 I think a query is messing , i think a column is missing ! Quote
J_StrauD Posted January 1, 2010 Posted January 1, 2010 The sql used at the top of this page, the one marzy did, has proPROPOSED in it. Are you using that sql? Quote
Shakeynath Posted January 1, 2010 Author Posted January 1, 2010 Yes all of the above Sql's have been added Quote
Shakeynath Posted January 1, 2010 Author Posted January 1, 2010 Okay we have managed to sort that issue out Thanks Quote
albenski Posted January 8, 2010 Posted January 8, 2010 just a question ok your saying Then you need to add this somewhere in explore: Marriage Center should Marriage Center made a link and if so is this the right way of making the link Marriage Center Quote
jds137 Posted January 9, 2010 Posted January 9, 2010 How is this being redirected as it says? Also how secure is all this. I know print is being replaced by echo. print "You are already married![color=white]Being redirected, Please Wait![/color]"; $h->endpage(); exit; } Quote
jds137 Posted January 9, 2010 Posted January 9, 2010 I just tried propose.php and got this as well: All printed out on a white page. Which you add <?php and it works. But there is no redirect as far as I can see, and it says this: You are already married!Being redirected, Please Wait! /*----------------------------------------------------- -- Advanced Marriage Mod -- Product Copyright (c) Halo 2008 -- To be sold as freeware, do not re-sell -- Free for CE Members | Mccode V2 -----------------------------------------------------*/ include "globals.php"; if ($ir['married'] != 0) { print "You are already married![color=white]Being redirected, Please Wait![/color]"; $h->endpage(); exit; } switch($_GET['action']) { case 'propose': propose_form(); break; case 'proposesub': propose_submit(); break; default: index(); break; } function index() { global $db,$ir,$c,$h,$userid; if ($ir['married'] != 0) { print "You are already married![color=white]Being redirected, Please Wait![/color]"; $h->endpage(); exit; } else { print"Proposal Center Do you want to propose to someone? [url='propose.php?action=propose']> Yes[/url] [url='index.php']> No[/url]"; } } function propose_form() { global $db,$ir,$c,$h,$userid; if ($ir['married'] != 0) { print "You are already married![color=white]Being redirected, Please Wait![/color]"; $h->endpage(); exit; } else { print"Proposal Center Please enter the user id of the user you want to propose to: User: Message: "; } } function propose_submit() { global $db,$ir,$c,$h,$userid; if ($ir['married'] != 0) { print "You are already married![color=white]Being redirected, Please Wait![/color]"; $h->endpage(); exit; } else if ($ir['userid'] == $_POST['propose']) { print "You cannot marry yourself![color=white]Being redirected, Please Wait![/color]"; $h->endpage(); exit; } else { $ch=$db->query("SELECT * FROM proposals WHERE proPROPOSED={$_POST['propose']}"); if ($db->num_rows($ch)!=0) { print "This user already has a pending proposal, please try again later![color=white]Being redirected, Please Wait![/color]"; $h->endpage(); exit; } else { $m=$db->query("SELECT * FROM users WHERE userid={$_POST['propose']}"); $r=$db->fetch_row($m); if ($ir['gender'] == $r['gender']) { print "You cannot propose to someone the same gender as you![color=white]Being redirected, Please Wait![/color]"; $h->endpage(); exit; } else { $db->query("INSERT INTO proposals VALUES('', '{$ir['userid']}', '{$_POST['propose']}', '{$_POST['message']}')"); event_add($_POST['propose'],"[url='viewuser.php?u=$userid']{$ir['username']} [{$ir['userid']}][/url] proposed to you Click [url='decision.php'][u]here[/u][/url] to make your mind up ",$c); print"Proposal Center You proposed to {$r['username']} [{$r['userid']}], please wait for their decision[color=white]Being redirected, Please Wait![/color]"; } } } } $h->endpage(); ?> Quote
reek13 Posted January 15, 2010 Posted January 15, 2010 why are there bbcodes being used in the code ? Quote
p_T_s Posted January 15, 2010 Posted January 15, 2010 sorry guys but it never saved to this post when i posted it so You need to change it in the file to this <font color=white>Being redirected, Please Wait!</font><META HTTP-EQUIV=Refresh CONTENT='1;url=index.php'> or use this one <?php /*----------------------------------------------------- -- Advanced Marriage Mod -- Product Copyright (c) Halo 2008 -- To be sold as freeware, do not re-sell -- Free for CE Members | Mccode V2 -----------------------------------------------------*/ include "globals.php"; $m=$db->query("SELECT * FROM users WHERE userid={$ir['married']}"); $par=$db->fetch_row($m); if($ir['married'] == 0) { die("You are not married, come back when you have a partner"); } switch($_GET['action']) { case 'givemoney': give_money_form(); break; case 'givemoneysub': give_money_submit(); break; case 'givecrystals': give_crystals_form(); break; case 'givecrystalssub': give_crystals_submit(); break; case 'givebank': give_bank_form(); break; case 'givebanksub': give_bank_submit(); break; case 'givecyber': give_cyber_form(); break; case 'givecybersub': give_cyber_submit(); break; case 'takemoney': take_money_form(); break; case 'takemoneysub': take_money_submit(); break; case 'takecrystals': take_crystals_form(); break; case 'takecrystalssub': take_crystals_submit(); break; case 'takebank': take_bank_form(); break; case 'takebanksub': take_bank_submit(); break; case 'takecyber': take_cyber_form(); break; case 'takecybersub': take_cyber_submit(); break; case 'sendmessage': send_message_form(); break; case 'sendmessagesub': send_message_submit(); break; case 'sleep': sleep_form(); break; case 'sleepsub': sleep_submit(); break; case 'affair': begin_affair(); break; case 'doaffair': do_affair(); break; case 'divorce': divorce_form(); break; case 'divorcesub': divorce_submit(); break; case 'allowence': allowence_form(); break; case 'council': begin_council(); break; case 'docouncil': do_council(); break; default: index(); break; } function give_money_form() { global $db,$ir,$c,$h,$userid,$par; print "<h3>Giving Money</h3> This action will give your money to your partner <form action='partner.php?action=givemoneysub' method='post'> Money: <input type='text' name='money' value='{$ir['money']}'> <input type='submit' value='Give Money' /></form>"; } function give_money_submit() { global $db,$ir,$c,$h,$userid,$par; if ($ir['money'] < $_POST['money']) { die("You are trying to give more money than you can [url='partner.php?action=givemoney']Back[/url]"); } else { $db->query("UPDATE users SET money=money+{$_POST['money']} WHERE userid={$par['userid']}"); $db->query("UPDATE users SET money=money-{$_POST['money']} WHERE userid=$userid"); event_add($par['userid'],"You partner has just given you \${$_POST['money']}",$c); print"You gave \${$_POST['money']} to your partner"; } } function give_crystals_form() { global $db,$ir,$c,$h,$userid,$par; print "<h3>Giving Crystals</h3> This action will give your crystals to your partner <form action='partner.php?action=givecrystalssub' method='post'> Crystals: <input type='text' name='crystals' value='{$ir['crystals']}'> <input type='submit' value='Give Crystals' /></form>"; } function give_crystals_submit() { global $db,$ir,$c,$h,$userid,$par; if ($ir['crystals'] < $_POST['crystals']) { die("You are trying to give more crystals than you can [url='partner.php?action=givecrystals']Back[/url]"); } else { $db->query("UPDATE users SET crystals=crystals+'{$_POST['crystals']}' WHERE userid={$par['userid']}"); $db->query("UPDATE users SET crystals=crystals-'{$_POST['crystals']}' WHERE userid=$userid"); event_add($par['userid'],"You partner has just given you {$_POST['crystals']} crystals",$c); print"You gave {$_POST['crystals']} crystals to your partner"; } } function give_bank_form() { global $db,$ir,$c,$h,$userid,$par; if ($ir['bankmoney'] < 0) { die("You dont have a bank account"); } if ($par['bankmoney'] < 0) { die("Your partner dose not have a bank account"); } else { print "<h3>Giving Bank Money</h3> This action will give bank money to your partner <form action='partner.php?action=givebanksub' method='post'> Bank Money: <input type='text' name='bank' value='{$ir['bankmoney']}'> <input type='submit' value='Give Bank Money' /></form>"; } } function give_bank_submit() { global $db,$ir,$c,$h,$userid,$par; if ($ir['bankmoney'] < $_POST['bank']) { die("You are trying to give more bank money than you can [url='partner.php?action=givecrystals']Back[/url]"); } else { $db->query("UPDATE users SET bankmoney=bankmoney+'{$_POST['bank']}' WHERE userid={$par['userid']}"); $db->query("UPDATE users SET bankmoney=bankmoney-'{$_POST['bank']}' WHERE userid=$userid"); event_add($par['userid'],"You partner has just wired you \${$_POST['bank']} into your bank account",$c); print"You wired \${$_POST['bank']} to your partner"; } } function give_cyber_form() { global $db,$ir,$c,$h,$userid,$par; if ($ir['cybermoney'] < 0) { die("You dont have a cyber bank account"); } if ($par['cybermoney'] < 0) { die("Your partner dose not have a cyber bank account"); } else { print "<h3>Giving Cyber Bank Money</h3> This action will give cyber bank money to your partner <form action='partner.php?action=givecybersub' method='post'> Bank Money: <input type='text' name='cyber' value='{$ir['cybermoney']}'> <input type='submit' value='Give Cyber Money' /></form>"; } } function give_cyber_submit() { global $db,$ir,$c,$h,$userid,$par; if ($ir['cybermoney'] < $_POST['cyber']) { die("You are trying to give more cyber bank money than you can [url='partner.php?action=givecrystals']Back[/url]"); } else { $db->query("UPDATE users SET cybermoney=cybermoney+'{$_POST['cyber']}' WHERE userid={$par['userid']}"); $db->query("UPDATE users SET cybermoney=cybermoney-'{$_POST['cyber']}' WHERE userid=$userid"); event_add($par['userid'],"You partner has just wired you \${$_POST['cyber']} into your cyber bank account",$c); print"You wired \${$_POST['cyber']} to your partner"; } } function take_money_form() { global $db,$ir,$c,$h,$userid,$par; if ($par['allowence'] == 0) { die("Your partner hasnt allowed your to access their finacial items"); } else { print "<h3>Taking Money</h3> This action will take money from your partner <form action='partner.php?action=takemoneysub' method='post'> Money: <input type='text' name='money' value='{$par['money']}'> <input type='submit' value='Take Money' /></form>"; } } function take_money_submit() { global $db,$ir,$c,$h,$userid,$par; if ($par['allowence'] == 0) { die("Your partner hasnt allowed your to access their finacial items"); } if ($par['money'] < $_POST['money']) { die("You are trying to take more money than you can [url='partner.php?action=takemoney']Back[/url]"); } else { $db->query("UPDATE users SET money=money+'{$_POST['money']}' WHERE userid=$userid"); $db->query("UPDATE users SET money=money-'{$_POST['money']}' WHERE userid={$par['userid']}"); event_add($par['userid'],"Your partner has just taken \${$_POST['money']} from your hand money",$c); print"You took \${$_POST['money']} from your partner"; } } function take_crystals_form() { global $db,$ir,$c,$h,$userid,$par; if ($par['allowence'] == 0) { die("Your partner hasnt allowed your to access their finacial items"); } else { print "<h3>Take Crystals</h3> This action will take crystals from your partner <form action='partner.php?action=takecrystalssub' method='post'> Crystals: <input type='text' name='crystals' value='{$par['crystals']}'> <input type='submit' value='Take Crystals' /></form>"; } } function take_crystals_submit() { global $db,$ir,$c,$h,$userid,$par; if ($par['allowence'] == 0) { die("Your partner hasnt allowed your to access their finacial items"); } if ($par['crystals'] < $_POST['crystals']) { die("You are trying to take more crystals than you can [url='partner.php?action=takecrystals']Back[/url]"); } else { $db->query("UPDATE users SET crystals=crystals+'{$_POST['crystals']}' WHERE userid=$userid"); $db->query("UPDATE users SET crystals=crystals-'{$_POST['crystals']}' WHERE userid={$par['userid']}"); event_add($par['userid'],"Your partner has just taken {$_POST['crystals']} crystals from you",$c); print"You took {$_POST['crystals']} crystals to your partner"; } } function take_bank_form() { global $db,$ir,$c,$h,$userid,$par; if ($par['allowence'] == 0) { die("Your partner hasnt allowed your to access their finacial items"); } if ($ir['bankmoney'] < 0) { die("You dont have a bank account"); } if ($par['bankmoney'] < 0) { die("Your partner dose not have a bank account"); } else { print "<h3>Take Bank Money</h3> This action will take bank money from your partner <form action='partner.php?action=takebanksub' method='post'> Bank Money: <input type='text' name='bank' value='{$par['bankmoney']}'> <input type='submit' value='Take Bank Money' /></form>"; } } function take_bank_submit() { global $db,$ir,$c,$h,$userid,$par; if ($par['allowence'] == 0) { die("Your partner hasnt allowed your to access their finacial items"); } if ($par['bankmoney'] < $_POST['bank']) { die("You are trying to take more bank money than you can [url='partner.php?action=takebank']Back[/url]"); } else { $db->query("UPDATE users SET bankmoney=bankmoney+'{$_POST['bank']}' WHERE userid=$userid"); $db->query("UPDATE users SET bankmoney=bankmoney-'{$_POST['bank']}' WHERE userid={$par['userid']}"); event_add($par['userid'],"Your partner has just taken \${$_POST['bank']} from your bank account",$c); print"You took \${$_POST['bank']} from your partner"; } } function take_cyber_form() { global $db,$ir,$c,$h,$userid,$par; if ($par['allowence'] == 0) { die("Your partner hasnt allowed your to access their finacial items"); } if ($ir['cybermoney'] < 0) { die("You dont have a cyber bank account"); } if ($par['cybermoney'] < 0) { die("Your partner dose not have a cyber bank account"); } else { print "<h3>Taking Cyber Bank Money</h3> This action will take cyber bank money from your partner <form action='partner.php?action=takecybersub' method='post'> Bank Money: <input type='text' name='cyber' value='{$par['cybermoney']}'> <input type='submit' value='Take Cyber Money' /></form>"; } } function take_cyber_submit() { global $db,$ir,$c,$h,$userid,$par; if ($par['allowence'] == 0) { die("Your partner hasnt allowed your to access their finacial items"); } if ($par['cybermoney'] < $_POST['cyber']) { die("You are trying to take more cyber bank money than you can [url='partner.php?action=givecrystals']Back[/url]"); } else { $db->query("UPDATE users SET cybermoney=cybermoney+'{$_POST['cyber']}' WHERE userid=$userid"); $db->query("UPDATE users SET cybermoney=cybermoney-'{$_POST['cyber']}' WHERE userid={$par['userid']}"); event_add($par['userid'],"Your partner has just taken \${$_POST['cyber']} from your cyber bank account",$c); print"You took \${$_POST['cyber']} from your partner"; } } function send_message_form() { global $db,$ir,$c,$h,$userid,$par; print "<h3>Send a message</h3> <form action='partner.php?action=sendmessagesub' method='post'> Your LUV Message: <input type='text' name='msg'> <input type='submit' value='Give Message' /></form>"; } function send_message_submit() { global $db,$ir,$c,$h,$userid,$par; if ($_POST['msg'] == '') { die("Why send a blank message?"); } else { event_add($par['userid'],"You partner sent you a LUV message: {$_POST['msg']}",$c); print"Message sent!"; } } function sleep_form() { global $db,$ir,$c,$h,$userid,$par; if($ir['tired'] == 1 or $par['tired'] == 1) { die("You are too tired to sleep with your partner again"); } print "<h3>Sleep with your Partner</h3> <form action='partner.php?action=sleepsub' method='post'> <input type='submit' value='Sleep With {$par['username']}' /></form>"; } function sleep_submit() { global $db,$ir,$c,$h,$userid,$par; if($ir['tired'] == 1 or $par['tired'] == 1) { die("You are too tired to sleep with your partner again"); } if (!$_POST['msg']) { $db->query("UPDATE users SET happiness=happiness+1 WHERE userid={$par['userid']}"); $db->query("UPDATE users SET happiness=happiness+1 WHERE userid=$userid"); $db->query("UPDATE users SET tired=1 WHERE userid={$par['userid']}"); $db->query("UPDATE users SET tired=1 WHERE userid=$userid"); event_add($par['userid'],"Your partner slept with you, you gained one happiness",$c); print"You slept with your partner and gained one happiness!"; } } function begin_affair() { global $db,$ir,$c,$h,$userid,$par; print "<h3>Have an affair</h3>"; if ($ir['happiness'] > 4) { die("You have a happy relationship, why risk it?"); } print" <form action='partner.php?action=doaffair' method='post'> You and your partner havent been having a good time recently, and a colleuge of your asked you out, what do you do? <input type='submit' value='Go with Colleuge' /></form> <form action='partner.php' method='post'><input type='submit' value='Dont Risk It' /></form>"; } function do_affair() { global $db,$ir,$c,$h,$userid,$par; $chance=(int) rand(1,2); if($chance==1) { $db->query("UPDATE users SET happiness=10 WHERE userid=$userid"); print"1.)You go with your colleuge and have a great date, you then go over to their house and have some fun 2.) After you finish you go to your house and find out your wifes asleep 3.) She didnt suspect a thing and you get away with it"; } else if($chance=2) { $db->query("UPDATE users SET happiness=1 WHERE userid=$userid"); $db->query("UPDATE users SET happiness=1 WHERE userid={$par['userid']}"); event_add($par['userid'],"You find out your partner has cheated on you",$c); print"1.) You go with you colleuge to your date, and wish you never bothered, the date was a complete faliure 2.) You go home and to your horror see your colleuge there 3.) She told your partner about you and walks away smirking 4.) You gulp"; } } function divorce_form() { global $db,$ir,$c,$h,$userid,$par; print "<h3>Divorce Your Partner</h3> This action will divorce your partner <form action='partner.php?action=divorcesub' method='post'> <input type='submit' value='Divorce' /></form>"; } function divorce_submit() { global $db,$ir,$c,$h,$userid,$par; { $db->query("UPDATE users SET married=0 WHERE userid={$par['userid']}"); $db->query("UPDATE users SET married=0 WHERE userid=$userid"); event_add($par['userid'],"Your partner divorced you!",$c); print"You divorced your partner"; } } function allowence_form() { global $db,$ir,$c,$h,$userid,$par; print "<h3>Marriage Allowence</h3> This action will decide wether you want to allow your partner to take money or not [[url='partner.php?action=allowence&allow=yes']Allow[/url]] [[url='partner.php?action=allowence&allow=no']Do Not Allow[/url]] "; if($_GET['allow'] == yes) { $db->query("UPDATE users SET allowence=1 WHERE userid=$userid"); print" Now your partner is allowed to access your finance"; } else if($_GET['allow'] == no) { $db->query("UPDATE users SET allowence=0 WHERE userid=$userid"); print" Now your partner isnt allowed to access your finance"; } } function begin_council() { global $db,$ir,$c,$h,$userid,$par; print "<h3>Marriage Counciling</h3>"; if ($ir['happiness'] > 6 and $par['happiness'] > 6) { die("You have a happy relationship, why risk it?"); } print" <form action='partner.php?action=docouncil' method='post'> You enter Dr. Lovvels Marriage Counciling Center, you could come out with your marriage secure, or it shatters <input type='submit' value='Enter' /></form>"; } function do_council() { global $db,$ir,$c,$h,$userid,$par; $chance=(int) rand(1,2); if($chance==1) { $db->query("UPDATE users SET happiness=10 WHERE userid=$userid"); $db->query("UPDATE users SET happiness=10 WHERE userid={$par['userid']}"); print"1.) You enter the counciling room 2.) You and your partner resolve a few issues you have been having 3.) You come out feeling happy"; } else if($chance=2) { $db->query("UPDATE users SET happiness=1 WHERE userid=$userid"); $db->query("UPDATE users SET happiness=1 WHERE userid={$par['userid']}"); event_add($par['userid'],"You went to marriage coucling and it was a disaster",$c); print"1.) You go with your partner to marriage counciling 2.) You blame things on your partner and vice versa 3.) It was a disaster and you go out seeling sad and sleep on the sofa"; } } function index() { global $db,$ir,$c,$h,$userid,$par; print "<h3>Partner Managment</h3> Here you can perform many actions to do with your marriage <table width=80% height=80% border=1><tr><td>[url='partner.php?action=givemoney']Send Money[/url]</td> <td>[url='partner.php?action=givecrystals']Send Crystals[/url]</td></tr><tr> <td>[url='partner.php?action=givebank']Send Bank Money[/url]</td> <td>[url='partner.php?action=givecyber']Send Cyber Money[/url]</td></tr><tr> <tr><td>[url='partner.php?action=takemoney']Take Money[/url]</td> <td>[url='partner.php?action=takecrystals']Take Crystals[/url]</td></tr><tr> <td>[url='partner.php?action=takebank']Take Bank Money[/url]</td> <td>[url='partner.php?action=takecyber']Take Cyber Money[/url]</td></tr><tr> <td>[url='partner.php?action=sendmessage']Send Message[/url]</td> <td><a href='partner.php?action=sleep'>Sleep With {$par['username']}</td></tr> <tr><td><a href='partner.php?action=affair'>Have an Affair</td> <td>[url='partner.php?action=divorce']Divorce[/url]</td><tr> <td>[url='partner.php?action=allowence']Change Marriage Allowence</td><td><a href='partner.php?action=council'>Go to Marriage Counciling[/url]</td></tr></table> <h3>Marriage Stats</h3> <table width=80% height=80% border=1><tr><td>Your Happiness: {$ir['happiness']}</td><td>Their Happiness: {$par['happiness']}</td></tr></table>"; } $h->endpage(); ?> Quote
Repo Posted January 16, 2010 Posted January 16, 2010 To make this show on the index.php you need to find $exp=(int)($ir['exp']/$ir['exp_needed']*100); Then under that add $m=$db->query("SELECT * FROM users WHERE userid='{$ir['married']}'"); $par=$db->fetch_row($m); if($ir['married'] != 0) { $partner= "[url='viewuser.php?u={$par[']<font color=green>{$par['username']}</font>[/url] [[url='partner.php']Manage[/url]]"; } else { $partner= "<font color=red>N/A</font>"; } Then add [b]Married:[/b] $partner Wherever you want it to show. Quote
Repo Posted January 16, 2010 Posted January 16, 2010 To make it show on the view user page you need to find $r=$db->fetch_row($q); and right under it add $m=$db->query("SELECT * FROM users WHERE userid={$r['married']}"); $par=$db->fetch_row($m); This is in addition to what was posted earlier by someone else. Quote
madmanz Posted January 17, 2010 Posted January 17, 2010 QUERY ERROR: Unknown column 'proPROPOSED' in 'where clause' Query was SELECT * FROM proposals WHERE proPROPOSED=3 that the error i get when u propose to sum1 any ideas y and how to fix it?? Quote
Magictallguy Posted January 17, 2010 Posted January 17, 2010 That code is heavily insecure, I would suggest securing that before uploading it. Quote
Nicholas Posted February 27, 2010 Posted February 27, 2010 i think i secured my verison lol (also a better layout) partner.php <?php include "globals.php"; $m=$db->query("SELECT * FROM users WHERE userid={$ir['married']}"); $par=$db->fetch_row($m); if($ir['married'] == 0) { die("You are not married, come back when you have a partner"); } $_GET['action'] = (isset($_GET['action']) && is_string($_GET['action'])) ? stripslashes(trim($_GET['action'])) : FALSE; switch($_GET['action']) { case 'givemoney': give_money_form(); break; case 'givemoneysub': give_money_submit(); break; case 'givecrystals': give_crystals_form(); break; case 'givecrystalssub': give_crystals_submit(); break; case 'givebank': give_bank_form(); break; case 'givebanksub': give_bank_submit(); break; case 'givebankcrystals': give_bankcrystals_form(); break; case 'givebankcrystalssub': give_bankcrystals_submit(); break; case 'takemoney': take_money_form(); break; case 'takemoneysub': take_money_submit(); break; case 'takecrystals': take_crystals_form(); break; case 'takecrystalssub': take_crystals_submit(); break; case 'takebank': take_bank_form(); break; case 'takebanksub': take_bank_submit(); break; case 'takecbank': take_cbank_form(); break; case 'takecbanksub': take_cbank_submit(); break; case 'sleep': sleep_form(); break; case 'sleepsub': sleep_submit(); break; case 'divorce': divorce(); break; case 'allowence': allowence_form(); break; default: index(); break; } function give_money_form() { global $db,$ir,$c,$h,$userid,$par; print "<h3>Giving Money</h3> This action will give your money to your partner You currently have [b]\${$ir['money']}[/b] that you could send. <form action='partner.php?action=givemoneysub' method='post'> Money: <input type='text' name='money' value='0'> <input type='submit' value='Give Money' /></form>"; } function give_money_submit() { global $db,$ir,$c,$h,$userid,$par; if ($ir['money'] < $_POST['money']) { die("You are trying to give more money than you can [url='partner.php?action=givemoney']Back[/url]"); } else { $db->query("UPDATE users SET money=money+".abs(floatval($_POST['money']))." WHERE userid={$par['userid']}"); $db->query("UPDATE users SET money=money-".abs(floatval($_POST['money']))." WHERE userid=$userid"); event_add($par['userid'],"You partner has just given you \${$_POST['money']}",$c); print"You gave \${$_POST['money']} to your partner"; } } function give_crystals_form() { global $db,$ir,$c,$h,$userid,$par; print "<h3>Giving crystals</h3> This action will give your crystals to your partner You currently have [b]{$ir['crystals']}[/b] crystals that you could send. <form action='partner.php?action=givecrystalssub' method='post'> Crystals: <input type='text' name='crystals' value='0'> <input type='submit' value='Give crystals' /></form>"; } function give_crystals_submit() { global $db,$ir,$c,$h,$userid,$par; if ($ir['crystals'] < $_POST['crystals']) { die("You are trying to give more crystals than you can. [url='partner.php?action=givecrystals']Back[/url]"); } else { $db->query("UPDATE users SET crystals=crystals+".abs(floatval($_POST['crystals']))." WHERE userid={$par['userid']}"); $db->query("UPDATE users SET crystals=crystals-".abs(floatval($_POST['crystals']))." WHERE userid=$userid"); event_add($par['userid'],"You partner has just given you {$_POST['crystals']} crystals",$c); print"You gave {$_POST['crystals']} crystals to your partner"; } } function give_bank_form() { global $db,$ir,$c,$h,$userid,$par; if ($ir['bankmoney'] < 0) { die("You dont have a bank account"); } if ($par['bankmoney'] < 0) { die("Your partner doesnt have a bank account"); } else { print "<h3>Giving Bank Money</h3> This action will give bank money to your partner You currently have [b]\${$ir['bankmoney']}[/b] that you could send. <form action='partner.php?action=givebanksub' method='post'> Bank Money: <input type='text' name='bankmoney' value='0'> <input type='submit' value='Give Bank Money' /></form>"; } } function give_bank_submit() { global $db,$ir,$c,$h,$userid,$par; if ($ir['bankmoney'] < $_POST['bankmoney']) { die("You are trying to give more bank money than you can [url='partner.php?action=givecrystals']Back[/url]"); } else { $db->query("UPDATE users SET bankmoney=bankmoney+".abs(floatval($_POST['bankmoney']))." WHERE userid={$par['userid']}"); $db->query("UPDATE users SET bankmoney=bankmoney-".abs(floatval($_POST['bankmoney']))." WHERE userid=$userid"); event_add($par['userid'],"You partner has just wired you \${$_POST['bankmoney']} into your bank account",$c); print"You wired \${$_POST['bankmoney']} to your partner"; } } function give_bankcrystals_form() { global $db,$ir,$c,$h,$userid,$par; print "<h3>Giving Bank crystals</h3> This action will give your bank crystals to your partner You currently have [b]{$ir['bankcrystals']}[/b] bank crystals that you could send. <form action='partner.php?action=givebankcrystalssub' method='post'> Bank Crystals: <input type='text' name='bankcrystals' value='0'> <input type='submit' value='Give Bank Crystals' /></form>"; } function give_bankcrystals_submit() { global $db,$ir,$c,$h,$userid,$par; if ($ir['bankcrystals'] < $_POST['bankcrystals']) { die("You are trying to give more bank crystals than you can. [url='partner.php?action=givebankcrystals']Back[/url]"); } else { $db->query("UPDATE users SET bankcrystal=bankcrystal+".abs(floatval($_POST['bankcrystals']))." WHERE userid={$par['userid']}"); $db->query("UPDATE users SET bankcrystal=bankcrystal-".abs(floatval($_POST['bankcrystals']))." WHERE userid=$userid"); event_add($par['userid'],"You partner has just given you {$_POST['bankcrystals']} crystals",$c); print"You gave {$_POST['bankcrystals']} crystals to your partner"; } } function take_money_form() { global $db,$ir,$c,$h,$userid,$par; if ($par['allowence'] == 0) { die("Your partner hasnt allowed your to access their money."); } else { print "<h3>Take Money</h3> This action will take money from your partner Your partner has \${$par['money']}. <form action='partner.php?action=takemoneysub' method='post'> Money: <input type='text' name='money' value='{$par['money']}'> <input type='submit' value='Take Money' /></form>"; } } function take_money_submit() { global $db,$ir,$c,$h,$userid,$par; if ($par['allowence'] == 0) { die("Your partner hasnt allowed your to access their money."); } if ($par['money'] < $_POST['money']) { die("You are trying to take more money than you can. [url='partner.php?action=takemoney']Back[/url]"); } else { $db->query("UPDATE users SET money=money+".abs(floatval($_POST['money']))." WHERE userid=$userid"); $db->query("UPDATE users SET money=money-".abs(floatval($_POST['money']))." WHERE userid={$par['userid']}"); event_add($par['userid'],"Your partner has just taken \${$_POST['money']} from your hand money",$c); print"You took \${$_POST['money']} from your partner"; } } function take_crystals_form() { global $db,$ir,$c,$h,$userid,$par; if ($par['allowence'] == 0) { die("Your partner hasnt allowed your to access their crystals"); } else { print "<h3>Take Crystals</h3> This action will take crystals from your partner Your partner has {$par['crystals']} crystals. <form action='partner.php?action=takecrystalssub' method='post'> Crystals: <input type='text' name='crystals' value='{$par['crystals']}'> <input type='submit' value='Take Crystals' /></form>"; } } function take_crystals_submit() { global $db,$ir,$c,$h,$userid,$par; if ($par['allowence'] == 0) { die("Your partner hasnt allowed your to access their crystals."); } if ($par['crystals'] < $_POST['crystals']) { die("You are trying to take more crystals than you can. [url='partner.php?action=takecrystals']Back[/url]"); } else { $db->query("UPDATE users SET crystals=crystals+".abs(floatval($_POST['crystals']))." WHERE userid=$userid"); $db->query("UPDATE users SET crystals=crystals-".abs(floatval($_POST['crystals']))." WHERE userid={$par['userid']}"); event_add($par['userid'],"Your partner has just taken {$_POST['crystals']} crystals from you",$c); print"You took {$_POST['crystals']} crystals from your partner"; } } function take_bank_form() { global $db,$ir,$c,$h,$userid,$par; if ($par['allowence'] == 0) { die("Your partner hasnt allowed your to access their finacial bank money."); } if ($ir['bankmoney'] < 0) { die("You dont have a bank account"); } if ($par['bankmoney'] < 0) { die("Your partner dose not have a bank account"); } else { print "<h3>Take Bank Money</h3> This action will take bank money from your partner Your partner has \${$par['bankmoney']}. <form action='partner.php?action=takebanksub' method='post'> Bank Money: <input type='text' name='bank' value='{$par['bankmoney']}'> <input type='submit' value='Take Bank Money' /></form>"; } } function take_bank_submit() { global $db,$ir,$c,$h,$userid,$par; if ($par['allowence'] == 0) { die("Your partner hasnt allowed your to access their bank money."); } if ($par['bankmoney'] < $_POST['bankmoney']) { die("You are trying to take more bank money than you can [url='partner.php?action=takebank']Back[/url]"); } else { $db->query("UPDATE users SET bankmoney=bankmoney+".abs(floatval($_POST['bankmoney']))." WHERE userid=$userid"); $db->query("UPDATE users SET bankmoney=bankmoney-".abs(floatval($_POST['bankmoney']))." WHERE userid={$par['userid']}"); event_add($par['userid'],"Your partner has just taken \${$_POST['bank']} from your bank account",$c); print"You took \${$_POST['bank']} from your partner"; } } function take_cbank_form() { global $db,$ir,$c,$h,$userid,$par; if ($par['allowence'] == 0) { die("Your partner hasnt allowed your to access their bank crystals."); } if ($ir['bankcrystals'] < 0) { die("You dont have a crystal bank account"); } if ($par['bankcrystals'] < 0) { die("Your partner doesnt have a crystal bank account."); } else { print "<h3>Take Bank Crystals</h3> This action will take bank money from your partner Your partner has {$par['bankcrystals']} bank crystals. <form action='partner.php?action=takebanksub' method='post'> Bank Crystals: <input type='text' name='cbank' value='{$par['bankcrystals']}'> <input type='submit' value='Take Bank Money' /></form>"; } } function take_cbank_submit() { global $db,$ir,$c,$h,$userid,$par; if ($par['allowence'] == 0) { die("Your partner hasnt allowed your to access their bank crystals."); } if ($par['bankcrystals'] < $_POST['cbank']) { die("You are trying to take more bank money than you can [url='partner.php?action=takecbank']Back[/url]"); } else { $db->query("UPDATE users SET bankcrystals=bankcrystals+".abs(floatval($_POST['bankcrystals']))." WHERE userid=$userid"); $db->query("UPDATE users SET bankcrystals=bankcrystals-".abs(floatval($_POST['bankcrystals']))." WHERE userid={$par['userid']}"); event_add($par['userid'],"Your partner has just taken {$_POST['bankcrystals']} crystals from your bank account",$c); print"You took {$_POST['bankcrystals']} bank crystals from your partner"; } } function sleep_form() { global $db,$ir,$c,$h,$userid,$par; if($ir['tired'] == 1) { die("You are too tired to sleep with your partner again"); } print "<h3>Sleep with your Partner?</h3> <form action='partner.php?action=sleepsub' method='post'> <input type='submit' value='Sleep With {$par['username']}' /></form>"; } function sleep_submit() { global $db,$ir,$c,$h,$userid,$par; if($ir['tired'] == 1) { die("You are too tired to sleep with your partner again"); } if (!$_POST['msg']) { $db->query("UPDATE users SET happiness=happiness+1 WHERE userid=$userid"); $db->query("UPDATE users SET tired=1 WHERE userid=$userid"); event_add($par['userid'],"Your partner has just slept with you. Please take a pregnancy test.",$c); print"You slept with your partner and gained 1 happiness!"; } } function divorce() { global $ir, $mr, $c, $userid, $h; mysql_query("UPDATE users SET married=0 WHERE userid IN($userid, {$ir['married']})", $c); event_add($ir['married'],"{$ir['username']} divorced you... Your now single...",$c); print "You divorced your partner and went back to being single. > [url='index.php']Back[/url]"; } function allowence_form() { global $db,$ir,$c,$h,$userid,$par; print "<h3>C</h3> This action will decide wether you want to allow your partner to take money, crystals, bank money, bank crystals, etc or not... [[url='partner.php?action=allowence&allow=yes']Allow[/url]] [[url='partner.php?action=allowence&allow=no']Do Not Allow[/url]] "; if($_GET['allow'] == yes) { $db->query("UPDATE users SET allowence=1 WHERE userid=$userid"); print" Now your partner is allowed to access your finance"; } else if($_GET['allow'] == no) { $db->query("UPDATE users SET allowence=0 WHERE userid=$userid"); print" Now your partner isnt allowed to access your finance"; } } function index() { global $db,$ir,$c,$h,$userid,$par; print " <h3><center>Information</h3> <center><table width=60% cellspacing=1 class='table' border='1' bordercolor='#636363'></center> <tr> <th><font color=gold>Theirs</th> <th><font color=gold>Yours</th> </tr> <tr> <td><center>Money: \${$par['money']}</td> <td><center>Money: \${$ir['money']}</td> </tr> <td><center>Crystals: {$par['crystals']}</td> <td><center>Crystals: {$ir['crystals']}</td> </tr> <tr> <td><center>Banked Money: \${$par['bankmoney']}</td> <td><center>Banked Money: \${$ir['bankmoney']}</td> </tr> <tr> <td><center>Banked Crystals: {$par['bankcrystals']}</td> <td><center>Banked Crystals: {$ir['bankcrystals']}</td> </tr> </table> <h3><center>Partner Managment</h3> <center><table width=60% cellspacing=1 class='table' border='1' bordercolor='#636363'></center> <tr> <td>[url='partner.php?action=givemoney']<center>Send Money[/url]</td> <td>[url='partner.php?action=takemoney']<center>Take Money[/url]</td> </tr><tr> <td>[url='partner.php?action=givebank']<center>Send Bank Money[/url]</td> <td>[url='partner.php?action=takebank']<center>Take Bank Money[/url]</td> </tr><tr> <td>[url='partner.php?action=givecrystals']<center>Send Crystals[/url]</td> <td>[url='partner.php?action=takecrystals']<center>Take Crystals[/url]</td> </tr><tr> <td>[url='partner.php?action=givebankcrystals']<center>Send Bank Crystals[/url]</td> <td>[url='partner.php?action=takecbank']<center>Take Bank Crystals[/url]</td> </tr><tr> <td><a href='partner.php?action=sleep'><center>Sleep With {$par['username']}</td> <td>[url='partner.php?action=allowence']<center>Marriage Allowence![/url]</td> </tr><tr> <td colspan='2'>[url='partner.php?action=divorce']<center>Divorce[/url]</td></tr></table> <h3><center>Marriage Stats</h3> <center><table width=60% cellspacing=1 class='table' border='1' bordercolor='#636363'></center> <tr> <td><center>Your Happiness: {$ir['happiness']}</td> <td><center>Their Happiness: {$par['happiness']}</td></tr></table>"; } $h->endpage(); ?> you might have to add bankcrystals to your database or remove the functions for it. (i dont have cyber bank (donator bank), so its not on there, you have to copy and moditfy the send/take banking function, if you want it.) ALTER TABLE `users` ADD `bankcrystals` INT(11) NOT NULL DEFAULT '-1'; continued... Quote
Nicholas Posted February 27, 2010 Posted February 27, 2010 Continued... acceptpro.php <?php include(DIRNAME(__FILE__).'/globals.php'); if(!$_GET['pro'] || !ctype_digit($_GET['pro'])) { echo ('You\'ve clicked an invalid link, please report to an administrator.'); $h->endpage(); exit(); } $m=$db->query("SELECT * FROM proposals WHERE (`proID` = ".abs(intval($_GET['pro'])).") AND (`proPROPOSED` = $userid)"); if(!mysql_num_rows($m)) { echo ('You\'ve clicked an invalid link, please report to an administrator.'); $h->endpage(); exit(); } else { $m=$db->query("SELECT * FROM proposals WHERE proID=".abs(intval($_GET['pro']))." AND proPROPOSED=$userid"); $pro=$db->fetch_row($m); $db->query("UPDATE `users` SET `married` =".abs(intval($pro['proPROPOSER']))." WHERE (`userid` = $userid)"); $db->query("UPDATE `users` SET `married` =".abs(intval($pro['proPROPOSED']))." WHERE (`userid` = ".abs(intval($pro['proPROPOSER'])).")"); $db->query("DELETE FROM proposals WHERE (proID=".abs(intval($pro['proID'])).")"); $mr=$db->query("SELECT * FROM `users` WHERE (`userid` =".abs(intval($pro['proPROPOSER'])).")"); $par=$db->fetch_row($mr); event_add($par['userid'],"<font color=white>Your proposal for [url='viewuser.php?ID={$ir[']{$ir['username']}[/url] was accepted",$c); print"<span style = 'color:yellow'>You married {$par['username']}!</span> "; } $h->endpage(); ?> declinepro.php <?php require "globals.php"; if(!$_GET['pro'] || !ctype_digit($_GET['pro'])) { die("Stop abusing our marriage system!"); } $m=$db->query("SELECT * FROM proposals WHERE proID=".abs(intval($_GET['pro']))." AND proPROPOSED=$userid"); if ($db->num_rows($m) == 0) { print "<font color=white>Invalid proposal or this is not your proposal"; } else { $pro=$db->fetch_row($m); $db->query("DELETE FROM proposals WHERE proID=".abs(intval($pro['proID'])).""); $mr=$db->query("SELECT * FROM users WHERE userid=".abs(intval($pro['proPROPOSER'])).""); $par=$db->fetch_row($mr); event_add($par['userid'],"{$ir['username']} [{$ir['userid']}] has declined your proposal",$c); print"<font color=white>You declined the proposal from</font> <font color=yellow>{$par['username']}</font>! "; } $h->endpage(); ?> decision.php <?php include "globals.php"; $m=$db->query("SELECT * FROM proposals WHERE proPROPOSED={$ir['userid']}"); if ($db->num_rows($m)==0) { die("Nobody has proposed to you! <a href=index.php>> Back</a>"); } else { $pro=$db->fetch_row($m); $f=$db->query("SELECT * FROM users WHERE userid={$pro['proPROPOSER']}"); $r=$db->fetch_row($f); print"<h3>Decision Center</h3> <center><table width=80% cellspacing=1 class=table border=1 bordercolor=#636363></center><tr><td> Proposer: [url='viewuser.php?u={$r[']{$r['username']}[/url] </td> <td>Message: {$pro['proMESSAGE']} </td> <td>Decision: [url='acceptpro.php?pro={$pro[']<font color=green>Accept</font>[/url] or [url='declinepro.php?pro={$pro[']<font color=red>Decline</font>[/url]</td></tr></table>"; } $h->endpage(); ?> Quote
Jordan Palmer Posted February 27, 2010 Posted February 27, 2010 This isn't fully secured either :P Â It is better but still could be improved, I may recode the whole system :) Quote
Nicholas Posted February 28, 2010 Posted February 28, 2010 could you tell me what isnt secure on it please mate? as im trying to learn security lol. Quote
WiCkEdBiTcH Posted July 28, 2010 Posted July 28, 2010 I'm a noob My question is how do i get any of these to work? Everyone i have tried none of them work for me. I am not a coder at all so all the help i can get would be greatly appreciated. :) Quote
sniko Posted July 30, 2010 Posted July 30, 2010 1. Log into your cPanel 2. Click "PhpMyAdmin" 3. Click the SQL Tab 4. Paste all sql's in the text box 5. Click "Go" 6. Go back to cPanel 7. Click "Legacy File Manager" 8. Create a new file 9. Paste the code according to the file name 10. Follow any instructions 11. Test 11 (a) . If the code doesnt work, post the error in the forums, under the relavent topic/thread 11 (b). If the code does work, post a thank you note or provide a demo Quote
DJShad10 Posted December 14, 2010 Posted December 14, 2010 Please enter the user id of the user you want to propose to: User: Message: that is in the propose.php... where do we put in the user id? where do we put the message? i think this mod needs to be fully redone im going to work on it to see what i could do Thanks Shad Quote
Cronus Posted December 30, 2010 Posted December 30, 2010 Here is a link to one for $5(full support) with shared housing/will: (screenshots included) http://www.cronwerks.com/forum/cronwerks-mccode-mccodes-mods/advanced-marriage-w-shared-housing/ Quote
phoenix201012 Posted March 7, 2011 Posted March 7, 2011 please some one get this working im noob and this code is to complex but there is so much confusen when reading this but. can some awsome user post a full working and tested one on here (hint Downloadable zip file if many files) thank you very much 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.