Jump to content
MakeWebGames

Marriage Proposal


Strats

Recommended Posts

I have nearly got working marriage on my game lol

But once you marry someone you can marry again, Like Mormons lol

Can anyone take a look at the proposal.php and try to fix it?

Also if you can please let me know what you changed so I can learn :)

Thank you for anyone who takes the time to have a read.

 

<?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";
if ($ir['married'] != 0)
{
die("You are already married");
}
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)
{
die("You are already married");
}
else
{
print"<h1>Proposal Center</h1>

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)
{
die("You are already married");
}
else
{
print"<h1>Proposal Center</h1>

<form action='propose.php?action=proposesub' method='post'>
Please enter the user id of the user you want to propose to:

User: <input type='text' name='propose' />

Message: <input type='text' name='message' />

<input type='submit' value='Propose' /></form>";
}
}
function propose_submit()
{
global $db,$ir,$c,$h,$userid;
if ($ir['married'] != 0)
{
die("You are already married");
}
else if ($ir['userid'] == $_POST['propose'])
{
die("You cannot marry yourself");
}
else
{
$ch=$db->query("SELECT * FROM proposals WHERE proPROPOSED={$_POST['propose']}");
if ($db->num_rows($ch)!=0)
{
die("This user already has a pending proposal, please try again later

<a href=index.php>> Back</a>");
}
else
{
$m=$db->query("SELECT * FROM users WHERE userid={$_POST['propose']}");
$r=$db->fetch_row($m);
$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</a> ",$c);
print"<h3>Proposal Center</h3>

You proposed to {$r['username']} [{$r['userid']}], please wait for their decision
";
}
}
}
$h->endpage();
?>

]

Link to comment
Share on other sites

Re: Marriage Proposal

Yup, Lithium has worked his magic again.

My Marriage mod is a little bit altered than this now,

Mine does not stop you marrying someone of the same sex and once you are married you cannot accept a proposal from someone else :)

If anyone wants it mail me and I can send you it.

To my knowledge I believe this is working perfectly.

If anyone spots anything wrong let me know please.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...