Marry module for MuCore 1.0.8

Results 1 to 2 of 2
  1. #1
    |::::|;;;;;;;;;;> ThePunish3r is offline
    MemberRank
    Jul 2008 Join Date
    RomaniaLocation
    217Posts

    Support Marry module for MuCore 1.0.8

    Can someone make this as a module for MuCore 1.0.8?


    Quote Originally Posted by diablo71 View Post
    Here is new module for my web:
    - Marry

    How to install:
    1. Open _inc/mfs.class and add this:
    PHP Code:
    /* Marry */
    function login() {
    if(isset(
    $_POST['login']))
    {
    $account secure($_POST['account']);
    $password secure($_POST['password']);
    $married secure($_POST['married']);
    check_inject();

    $check_accq mssql_query("Select * from MEMB_INFO where memb___id='$account' and memb__pwd='$password'");
    $check_acc mssql_num_rows($check_accq);

    if(
    $check_acc == 0) { echo"<meta http-equiv=\"refresh\" content=\"0\">"; }
    else
    {
    $_SESSION['ip'] = $_SERVER['REMOTE_ADDR']; 
    $_SESSION['date'] = date("F j, Y, G:i A");
    $_SESSION['user'] = $account;
    $_SESSION['pass'] = $password;
    echo 
    "<meta http-equiv=\"refresh\" content=\"0\">";
    }
    }
    if(isset(
    $_POST['logout']))
    {
    unset(
    $_SESSION['ip']);
    unset(
    $_SESSION['date']);
    unset(
    $_SESSION['user']);
    unset(
    $_SESSION['pass']);
     echo 
    "<meta http-equiv=\"refresh\" content=\"0;url=index.php\">";
    }
    }

    function 
    married_users()
    {
    $char secure($_POST['ycharacter']);
    $char2 secure($_POST['acharacter']);
    $message secure($_POST['message']);
    $type secure($_POST['type']);
    $user secure($_SESSION['user']);
    check_inject();
    $date date('d/m/Y H:i');
    $time time();
    $time12 $time 172800;

    $check_chr mssql_num_rows(mssql_query("Select * from Character where AccountID='$user' and Name='$char'"));
    $check_chr2 mssql_num_rows(mssql_query("Select * from Character where AccountID='$user' and Name='$char2'"));

    $row mssql_fetch_array(mssql_query("Select * from Character where Name='$char'"));
    $row2 mssql_fetch_array(mssql_query("Select * from Character where Name='$char2'"));
    $row3 mssql_fetch_array(mssql_query("Select * from married where senderacc='$user'"));

    $already mssql_num_rows(mssql_query("Select * from married where senderacc='$user'"));
    $already2 mssql_num_rows(mssql_query("Select * from marriedusers where priel='$char2'"));
    $already3 mssql_num_rows(mssql_query("Select * from marriedusers where predlojil='$char2'"));
    $already4 mssql_num_rows(mssql_query("Select * from marriedusers where predlojil='$char'"));
    $already5 mssql_num_rows(mssql_query("Select * from marriedusers where priel='$char'"));

    if(empty(
    $char) or empty($char2) or empty($user) or empty($message)) { echo"<font color='red'>You cannot leave any fields blank!</font><br>"$error=1; }
    elseif(
    $row['Class'] == or $row['Class'] == 16 or $row['Class'] == 32) { echo"<font color='red'>Your character must to have a 2nd quest !</font>"$error=1; }
    elseif(
    $row2['Class'] == or $row2['Class'] == 16 or $row2['Class'] == 32) { echo"<font color='red'>The another character must to have a 2nd quest !</font>"$error=1; }
    elseif(
    $already != 0) { echo"<font color='red'>This character already waiting for Married !</font><br>"$error=1; }
    elseif(
    $already != and $row3['time'] < $time12) { mssql_query("DELETE from married where senderacc='$user'"); echo"<font color='red'>Please try again... Thank you !</font><br>"$error=1; }

    elseif(
    $already2 != 0) { echo"<font color='red'>This character is Married !</font><br>"$error=1; }
    elseif(
    $already3 != 0) { echo"<font color='red'>This character is Married !</font><br>"$error=1; }
    elseif(
    $already4 != 0) { echo"<font color='red'>This character is Married !</font><br>"$error=1; }
    elseif(
    $already5 != 0) { echo"<font color='red'>This character is Married !</font><br>"$error=1; }
    elseif(
    $check_chr2 >= 1) { echo"<font color='red'>Second selected character is your, you cant married with your characters!</font><br>"$error=1; }
    elseif(
    $char == $char2) { echo"<font color='red'>First selected character is the same like the second. Please go back and try again!</font><br>"$error=1; }
    elseif(
    $row['Resets'] < 1) { echo"<font color='red'>Your character must have at least one Reset to send this invitation!</font><br>"$error=1;}
    elseif(
    $row2['Resets'] < 1) { echo"<font color='red'>Another character must have at least one Reset to send this invitation!</font><br>"$error=1;}
    elseif(
    $check_chr <= 0) { echo"<font color='red'>First selected character is not your. Please go back and try again!</font><br>"$error=1; }

    if(
    $type == normal) {
    if(
    $row['Class'] == 33 and $row2['Class'] == 33) { echo"<font color='red'>If you want to married for woman (woman + woman) you must select Lesbian type. Please go back and try again!</font><br>"$error=1; }
    elseif(
    $row['Class'] != 33 and $row2['Class'] != 33) { echo"<font color='red'>If you want to married for man (man + man) you must select Gay type. Please go back and try again!2</font><br>"$error=1; }
    }
    if(
    $type == gay) {
    if(
    $row['Class'] == 33 and $row2['Class'] == 33) { echo"<font color='red'>You are selected Gay couple and you cant married with Womans (Elf). Please go back and try again!</font><br>"$error=1; }
    }
    if(
    $type == lesbian) {
    if(
    $row['Class'] != 33 and $row2['Class'] != 33) { echo"<font color='red'>You are selected Lesbian couple and you cant married with Mans (BK,SM,MG). Please go back and try again!</font><br>"$error=1; }
    }

    if(
    $error != 1) {
    $a mssql_query("INSERT INTO married (senderacc,receiveracc,sender,receiver,message,status,type,time,date) VALUES ('$user','$row2[AccountID]','$char','$char2','$message','not','$type','$time','$date')");
    echo
    "<font color='green'>You successful send this invitation to $char2! If she/he approved your invitation, you will be married ! But if she/he unapproved your invitation, you will not Married !</font><br>";
    }
    }
    /* End Marry */ 
    2. Insert this Quarety in MuOnline:
    Code:
    if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[married]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
    drop table [dbo].[married]
    GO
    
    CREATE TABLE [dbo].[married] (
     [senderacc] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
     [receiveracc] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
     [sender] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
     [receiver] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
     [message] [varchar] (1800) COLLATE Chinese_PRC_CI_AS NULL ,
     [status] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
     [type] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
     [time] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
     [date] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL 
    ) ON [PRIMARY]
    GO
    3. Crate 2 Files in folder _mods :
    - First is Married.php
    PHP Code:
    <?php if(isset($_POST['login']) or isset($_POST['logout'])) { login(); } ?>
    <?php 
    if ($_SESSION['user'] == false) {
    echo 
    "
    <br>You have to log in system to view this module !
    <table border=0 cellspacing=5 cellpadding=0>
    <td width='250'>
    <form name=login method=post action=>
    <table width=100% border=0 cellspacing=1 cellpadding=1>
    <tr> 
    <td width=70><font color=#cccccc>Login ID :</td>
    <td>
    <input name=account type=text id=account maxlength=10>
    </td>
    </tr>
    <tr> 
    <td width=70><font color=#cccccc>Password :</td>
    <td>
    <input name=password type=password id=password maxlength=10>
    </td>
    </tr>
    <td width=70> </td>
    </tr>
    <tr>
    <tr> 
    <td width=100 align=right><input type=submit class=button name=login value=Login></td>
    <td><input type=reset class=button name=Submit2 value=Reset></td>
    </tr>
    </table>
    </form>
    </div>
    </td>
    </table>
    "
    ;
    }
    else {
    $accuser secure($_SESSION['user']);
    check_inject();

    $check_accq mssql_query("Select * from married where receiveracc='$accuser'"); 
    $check mssql_num_rows($check_accq);
    if (
    $check 0) {
    echo 
    "<meta http-equiv=\"refresh\" content=\"0;url=?page=marr_request\">";
    }
    else{
    ?>
    <?php
    if(isset($_POST['submit'])) { married_users(); }
    ?>
    <br>With this module, you can married your character with another characters... :)
    <table border=0 cellspacing=5 cellpadding=0>
    <td width='250'>
    <table width="100%" border="0" cellspacing="1" cellpadding="1">
    <tr> 
    <td align="center" colspan="5">
    <select style="width: 220;" onchange="window.location='?page=married&sex='+this.value">
    <option value="0" selected>- Choose your sexual orientation -</option>
    <option value="normal">- I am Normal (Woman + Man)</option>
    <option value="gay">- I am gay (Man + Man)</option>
    <option value="lesbian">- I am lesbian (Woman + Woman)</option>
    </select>
    </td>
    <form name="" method="post" action="">
    <td><input type='submit' name='logout' class='button' value='Logout' title='Log out from the module'></td>
    </form>
    </tr>

    <? if ($_GET['sex'] == normal)
    ?>
    <form name="" method="post" action="">
    <tr><td colspan="5" align="center">Your sexual orientation is <?=$_GET['sex']?>, [<?=$_SESSION['user']?>]</td></tr>
    <tr> 
    <td width="70"><font color=#cccccc>Your Character :</td>
    <td>
    <select name="ycharacter" style="width: 121;"><optgroup label="Hero for Married">
    <?php
    $charq 
    mssql_query("SELECT [Name] FROM [Character] where AccountID='$_SESSION[user]'");

    for(
    $i=0;$i mssql_num_rows($charq);++$i)
    {
    $row mssql_fetch_row($charq);
    echo
    "<option value='$row[0]'><b>$row[0]</b></option>";
    }
    ?>
    </select>
    </td>
    </tr>
    <tr> 
    <td width="70"><font color=#cccccc>Your partner :</td>
    <td>
    <select name="acharacter" style="width: 121;"><optgroup label="Choose your partner">
    <?php
    $charq 
    mssql_query("SELECT [Name] FROM [Character] where AccountID != '$_SESSION[user]'");

    for(
    $i=0;$i mssql_num_rows($charq);++$i)
    {
    $row mssql_fetch_row($charq);
    echo
    "<option value='$row[0]'><b>$row[0]</b></option>";
    }
    ?>
    </select>
    <input type="hidden" name="type" value="<?=$_GET['sex']?>">
    </td>
    </tr>
    <tr> 
    <td align="center" colspan="5"><input type="text" name="message" style="width: 220; height: 15; text-align: center;" maxlength="100" value="You message to your next wife/husband..."></td>
    </tr>

    <tr> 
    <td width="70"> </td>
    </tr>
    <tr>
    <tr> 
    <td width="100" align="right"><input type="submit" class=button name="submit" value="Submit"></td>
    <td><input type="reset" class=button name="Submit2" value="Reset"></td>
    </tr>
    </form>
    <?}
    elseif(
    $_GET['sex'] == gay)
    {
    ?>
    <form name="" method="post" action="">
    <tr><td colspan="5" align="center">Your sexual orientation is <?=$_GET['sex']?></td></tr>
    <tr> 
    <td width="70"><font color=#cccccc>Your Character :</td>
    <td>
    <select name="ycharacter" style="width: 121;"><optgroup label="Hero for Married">
    <?php
    $charq 
    mssql_query("SELECT [Name] FROM [Character] where class!='32' and class!='33' and AccountID = '$_SESSION[user]'");

    for(
    $i=0;$i mssql_num_rows($charq);++$i)
    {
    $row mssql_fetch_row($charq);
    echo
    "<option value='$row[0]'><b>$row[0]</b></option>";
    }
    ?>
    </select>
    </td>
    </tr>
    <tr> 
    <td width="70"><font color=#cccccc>Your partner :</td>
    <td>
    <select name="acharacter" style="width: 121;"><optgroup label="Choose your partner">
    <?php
    $charq 
    mssql_query("SELECT [Name] FROM [Character] where class!='32' and class!='33' and AccountID!='$_SESSION[user]'");

    for(
    $i=0;$i mssql_num_rows($charq);++$i)
    {
    $row mssql_fetch_row($charq);
    echo
    "<option value='$row[0]'><b>$row[0]</b></option>";
    }
    ?>
    </select>
    <input type="hidden" name="type" value="<?=$_GET['sex']?>">
    </td>
    </tr>
    <tr> 
    <td align="center" colspan="5"><input type="text" name="message" style="width: 220; height: 15; text-align: center;" maxlength="100" value="You message to your next wife/husband..."></td>
    </tr>

    <tr> 
    <td width="70"> </td>
    </tr>
    <tr>
    <tr> 
    <td width="100" align="right"><input type="submit" class=button name="submit" value="Submit"></td>
    <td><input type="reset" class=button name="Submit2" value="Reset"></td>
    </tr>
    </form>
    <?}
    elseif(
    $_GET['sex'] == lesbian) {?>
    <form name="" method="post" action="">
    <tr><td colspan="5" align="center">Your sexual orientation is <?=$_GET['sex']?></td></tr>
    <tr> 
    <td width="70"><font color=#cccccc>Your Character :</td>
    <td>
    <select name="ycharacter" style="width: 121;"><optgroup label="Hero for Married">
    <?php
    $charq 
    mssql_query("SELECT [Name] FROM [Character] where class='32' or class='33' and AccountID = '$_SESSION[user]'");

    for(
    $i=0;$i mssql_num_rows($charq);++$i)
    {
    $row mssql_fetch_row($charq);
    echo
    "<option value='$row[0]'><b>$row[0]</b></option>";
    }
    ?>
    </select>
    </td>
    </tr>
    <tr> 
    <td width="70"><font color=#cccccc>Your partner :</td>
    <td>
    <select name="acharacter" style="width: 121;"><optgroup label="Choose your partner">
    <?php
    $charq 
    mssql_query("SELECT [Name] FROM [Character] where class='32' or class='33' and AccountID!='$_SESSION[user]'");

    for(
    $i=0;$i mssql_num_rows($charq);++$i)
    {
    $row mssql_fetch_row($charq);
    echo
    "<option value='$row[0]'><b>$row[0]</b></option>";
    }
    ?>
    </select>
    <input type="hidden" name="type" value="<?=$_GET['sex']?>">
    </td>
    </tr>
    <tr> 
    <td align="center" colspan="5"><input type="text" name="message" style="width: 220; height: 15; text-align: center;" maxlength="100" value="You message to your next wife/husband..."></td>
    </tr>

    <tr> 
    <td width="70"> </td>
    </tr>
    <tr>
    <tr> 
    <td width="100" align="right"><input type="submit" class=button name="submit" value="Submit"></td>
    <td><input type="reset" class=button name="Submit2" value="Reset"></td>
    </tr>
    </form>
    <?}}}?>
    </table>
    </div>
    </td>
    </table>
    -Second is marr_request.php
    PHP Code:
    <?php if(isset($_POST['login'])) { login(); } ?>
    <?php 
    if ($_SESSION['user'] == false) {
    echo 
    "<meta http-equiv=\"refresh\" content=\"0;url=?page=married\">";
    }
    else {
    $accuser secure($_SESSION['user']);
    check_inject();

    $check_accq mssql_query("Select * from married where receiveracc='$accuser' and status='not'"); 
    $check mssql_num_rows($check_accq);
    $row mssql_fetch_array($check_accq);
    $date date("F j, Y, G:i A");
    $time time();

    if(
    $row['type'] == normal) { $type "Normal"; }
    elseif(
    $row['type'] == gay) { $type "Gays"; }
    elseif(
    $row['type'] == lesbian) { $type "Lesbians"; }

    if(
    $_GET['id'] == agree and $check 0)
    {
    mssql_query("INSERT INTO marriedusers (predlojil,priel,message,type,date,time) VALUES ('$row[sender]','$row[receiver]','$row[message]','$type','$date','$time')");
    mssql_query("delete from married where receiveracc='$accuser'"); 
    echo 
    "<script language=\"JavaScript\">alert (\"You successful accept this married !\");</script>";
    echo 
    "<meta http-equiv=\"refresh\" content=\"0;url=?page=married\">";
    }
    elseif(
    $_GET['id'] == idont and $check 0)
    {
    mssql_query("delete from married where receiveracc='$accuser'"); 
    }

    if (
    $check 0) { 
    ?>
    <br>Here you can check your requestions for Married
    <table border="0" cellspacing="5" cellpadding="0">
    <td width='400'>
    <table width="100%" border="0" cellspacing="1" cellpadding="1" class='tmem'>
    <tr> 
    <td align="center">Request By</td>
    <td align="center">Request To</td>
    <td align="center">Yes or No</td>
    </tr>
    <tr>
    <td align="center"><?=$row['sender']?></td>
    <td align="center"><?=$row['receiver']?></td>
    <td align="center"><a rel="nofollow" href="?page=marr_request&id=agree" style="border-bottom: 1px dashed;">I agree</a>  <a rel="nofollow" href="?page=marr_request&id=idont" style="border-bottom: 1px dashed;">I don't</a></td>
    </tr>
    <tr>
    <td align="center" colspan="3"> </td>
    </tr>
    <tr>
    <td align="center" colspan="3">Message sended from <?=$row['sender']?> to you:</td>
    </tr>
    <tr>
    <td align="center" colspan="3"><?=$row['message']?></td>
    </tr>
    <?}
    else{
    echo 
    "<meta http-equiv=\"refresh\" content=\"0;url=?page=married\">";
    }}
    ?>
    </table>
    </div>
    </td>
    </table>
    Enjoy from me ;]
    Thanks!

    P.S.: Btw i think marr_request.php is wrong/incomplete ... it doesn't UPDATE anything - like Married and MarryName from table Character...

    P.S.2: Also, classes are messed up ... High Elf + Blade Master is Gays type :))
    Last edited by ThePunish3r; 24-11-12 at 12:21 AM.


  2. #2
    |::::|;;;;;;;;;;> ThePunish3r is offline
    MemberRank
    Jul 2008 Join Date
    RomaniaLocation
    217Posts

    Re: Marry module for MuCore 1.0.8

    Nwm ... i did it myself ...!

    Here it is:
    Add this to _inc/mfs.class
    Code:
    /* Marry */
    function login() {
    if(isset($_POST['login']))
    {
    $account = secure($_POST['account']);
    $password = secure($_POST['password']);
    $married = secure($_POST['married']);
    check_inject();
    
    $check_accq = mssql_query("Select * from MEMB_INFO where memb___id='$account' and memb__pwd='$password'");
    $check_acc = mssql_num_rows($check_accq);
    
    if($check_acc == 0) { echo"<meta http-equiv=\"refresh\" content=\"0\">"; }
    else
    {
    $_SESSION['ip'] = $_SERVER['REMOTE_ADDR']; 
    $_SESSION['date'] = date("F j, Y, G:i A");
    $_SESSION['user'] = $account;
    $_SESSION['pass'] = $password;
    echo "<meta http-equiv=\"refresh\" content=\"0\">";
    }
    }
    if(isset($_POST['logout']))
    {
    unset($_SESSION['ip']);
    unset($_SESSION['date']);
    unset($_SESSION['user']);
    unset($_SESSION['pass']);
     echo "<meta http-equiv=\"refresh\" content=\"0;url=index.php\">";
    }
    }
    
    function married_users()
    {
    $char = secure($_POST['ycharacter']);
    $char2 = secure($_POST['acharacter']);
    $message = secure($_POST['message']);
    $type = secure($_POST['type']);
    $user = secure($_SESSION['user']);
    check_inject();
    $date = date('d/m/Y H:i');
    $time = time();
    $time12 = $time - 172800;
    
    $check_chr = mssql_num_rows(mssql_query("Select * from Character where AccountID='$user' and Name='$char'"));
    $check_chr2 = mssql_num_rows(mssql_query("Select * from Character where AccountID='$user' and Name='$char2'"));
    
    $row = mssql_fetch_array(mssql_query("Select * from Character where Name='$char'"));
    $row2 = mssql_fetch_array(mssql_query("Select * from Character where Name='$char2'"));
    $row3 = mssql_fetch_array(mssql_query("Select * from married where senderacc='$user'"));
    
    $already = mssql_num_rows(mssql_query("Select * from married where senderacc='$user'"));
    $already2 = mssql_num_rows(mssql_query("Select * from marriedusers where priel='$char2'"));
    $already3 = mssql_num_rows(mssql_query("Select * from marriedusers where predlojil='$char2'"));
    $already4 = mssql_num_rows(mssql_query("Select * from marriedusers where predlojil='$char'"));
    $already5 = mssql_num_rows(mssql_query("Select * from marriedusers where priel='$char'"));
    
    if(empty($char) or empty($char2) or empty($user) or empty($message)) { echo"<font color='red'>You cannot leave any fields blank!</font><br>"; $error=1; }
    elseif($row['Class'] == 0 or $row['Class'] == 16 or $row['Class'] == 32 or $row['Class'] == 2 or $row['Class'] == 17 or $row['Class'] == 33 or $row['Class'] == 80 or $row['Class'] == 81) { echo"<font color='red'>Your character must to have a 3rd quest !</font>"; $error=1; }
    elseif($row2['Class'] == 0 or $row2['Class'] == 16 or $row2['Class'] == 32 or $row2['Class'] == 2 or $row2['Class'] == 17 or $row2['Class'] == 33 or $row2['Class'] == 80 or $row2['Class'] == 81) { echo"<font color='red'>Your partner must to have a 3rd quest !</font>"; $error=1; }
    elseif($already != 0) { echo"<font color='red'>This character already waiting for Married !</font><br>"; $error=1; }
    elseif($already != 0 and $row3['time'] < $time12) { mssql_query("DELETE from married where senderacc='$user'"); echo"<font color='red'>Please try again... Thank you !</font><br>"; $error=1; }
    
    elseif($already2 != 0) { echo"<font color='red'>This character is Married !</font><br>"; $error=1; }
    elseif($already3 != 0) { echo"<font color='red'>This character is Married !</font><br>"; $error=1; }
    elseif($already4 != 0) { echo"<font color='red'>This character is Married !</font><br>"; $error=1; }
    elseif($already5 != 0) { echo"<font color='red'>This character is Married !</font><br>"; $error=1; }
    elseif($row['Married'] > 0) { echo"<font color='red'>Your character is Married !</font><br>"; $error=1; }
    elseif($row2['Married'] > 0) { echo"<font color='red'>Your partner is Married !</font><br>"; $error=1; }
    elseif($check_chr2 >= 1) { echo"<font color='red'>Second selected character is your, you cant married with your characters!</font><br>"; $error=1; }
    elseif($char == $char2) { echo"<font color='red'>First selected character is the same like the second. Please go back and try again!</font><br>"; $error=1; }
    elseif($row['Resets'] < 10) { echo"<font color='red'>Your character must have at least 10 Resets to send this invitation!</font><br>"; $error=1;}
    elseif($row2['Resets'] < 10) { echo"<font color='red'>Your partner must have at least 10 Resets to send this invitation!</font><br>"; $error=1;}
    elseif($check_chr <= 0) { echo"<font color='red'>First selected character is not your. Please go back and try again!</font><br>"; $error=1; }
    
    if($type == normal) {
    if($row['Class'] == 35 and $row2['Class'] == 35 and $row['Class'] == 83 and $row2['Class'] == 83) { echo"<font color='red'>If you want to married for woman (woman + woman) you must select Lesbian type. Please go back and try again!</font><br>"; $error=1; }
    elseif($row['Class']!= 35 and $row2['Class'] != 35 and $row['Class'] != 83 and $row2['Class'] != 83) { echo"<font color='red'>If you want to married for man (man + man) you must select Gay type. Please go back and try again!2</font><br>"; $error=1; }
    }
    if($type == gay) {
    if($row['Class']!= 35 and $row2['Class'] != 35 and $row['Class'] != 83 and $row2['Class'] != 83) { echo"<font color='red'>You are selected Gay couple and you cant married with Womans (Elf). Please go back and try again!</font><br>"; $error=1; }
    }
    if($type == lesbian) {
    if($row['Class'] == 35 and $row2['Class'] == 35 and $row['Class'] == 83 and $row2['Class'] == 83) { echo"<font color='red'>You are selected Lesbian couple and you cant married with Mans (BK,SM,MG). Please go back and try again!</font><br>"; $error=1; }
    }
    
    if($error != 1) {
    $a = mssql_query("INSERT INTO married (senderacc,receiveracc,sender,receiver,message,status,type,time,date) VALUES ('$user','$row2[AccountID]','$char','$char2','$message','not','$type','$time','$date')");
    echo"<font color='green'>You successful send this invitation to $char2! If she/he approved your invitation, you will be married ! But if she/he unapproved your invitation, you will not Married !</font><br>";
    }
    }
    /* End Marry */
    Married.php:
    Code:
    <?php if(isset($_POST['login']) or isset($_POST['logout'])) { login(); } ?>
    <?php 
    if ($_SESSION['user'] == false) {
    echo "
    <br>You have to log in system to view this module !
    <table border=0 cellspacing=5 cellpadding=0>
    <td width='250'>
    <form name=login method=post action=>
    <table width=100% border=0 cellspacing=1 cellpadding=1>
    <tr> 
    <td width=70><font color=#cccccc>Login ID :</td>
    <td>
    <input name=account type=text id=account maxlength=10>
    </td>
    </tr>
    <tr> 
    <td width=70><font color=#cccccc>Password :</td>
    <td>
    <input name=password type=password id=password maxlength=10>
    </td>
    </tr>
    <td width=70>&nbsp;</td>
    </tr>
    <tr>
    <tr> 
    <td width=100 align=right><input type=submit class=button name=login value=Login></td>
    <td><input type=reset class=button name=Submit2 value=Reset></td>
    </tr>
    </table>
    </form>
    </div>
    </td>
    </table>
    ";
    }
    else {
    $accuser = secure($_SESSION['user']);
    check_inject();
    
    $check_accq = mssql_query("Select * from married where receiveracc='$accuser'"); 
    $check = mssql_num_rows($check_accq);
    if ($check > 0) {
    echo "<meta http-equiv=\"refresh\" content=\"0;url=?page=marr_request\">";
    }
    else{
    ?>
    <?php
    if(isset($_POST['submit'])) { married_users(); }
    ?>
    <br>With this module, you can married your characters with other characters... :)
    <table border=0 cellspacing=5 cellpadding=0>
    <td width='250'>
    <table width="100%" border="0" cellspacing="1" cellpadding="1">
    <tr> 
    <td align="center" colspan="5">
    <select style="width: 220;" onchange="window.location='?page=married&sex='+this.value">
    <option value="0" selected>- Choose your sexual orientation -</option>
    <option value="normal">- I am Normal (Woman + Man)</option>
    <option value="gay">- I am gay (Man + Man)</option>
    <option value="lesbian">- I am lesbian (Woman + Woman)</option>
    </select>
    </td>
    <form name="" method="post" action="">
    <td><input type='submit' name='logout' class='button' value='Logout' title='Log out from the module'></td>
    </form>
    </tr>
    
    <? if ($_GET['sex'] == normal)
    { ?>
    <form name="" method="post" action="">
    <tr><td colspan="5" align="center">Your sexual orientation is <?=$_GET['sex']?>, [<?=$_SESSION['user']?>]</td></tr>
    <tr> 
    <td width="70"><font color=black>Your Character:</td>
    <td>
    <select name="ycharacter" style="width: 121;"><optgroup label="Hero for Married">
    <?php
    $charq = mssql_query("SELECT [Name] FROM [Character] where AccountID='$_SESSION[user]'");
    
    for($i=0;$i < mssql_num_rows($charq);++$i)
    {
    $row = mssql_fetch_row($charq);
    echo"<option value='$row[0]'><b>$row[0]</b></option>";
    }
    ?>
    </select>
    </td>
    </tr>
    <tr> 
    <td width="70"><font color=black>Your partner:</td>
    <td>
    <select name="acharacter" style="width: 121;"><optgroup label="Choose your partner">
    <?php
    $charq = mssql_query("SELECT [Name] FROM [Character] where AccountID!='$_SESSION[user]'");
    
    for($i=0;$i < mssql_num_rows($charq);++$i)
    {
    $row = mssql_fetch_row($charq);
    echo"<option value='$row[0]'><b>$row[0]</b></option>";
    }
    ?>
    </select>
    <input type="hidden" name="type" value="<?=$_GET['sex']?>">
    </td>
    </tr>
    <tr> 
    <td align="center" colspan="5"><input type="text" name="message" style="width: 220; height: 15; text-align: center;" maxlength="100" value="You message to your next wife/husband..."></td>
    </tr>
    
    <tr> 
    <td width="70">&nbsp;</td>
    </tr>
    <tr>
    <tr> 
    <td width="100" align="right"><input type="submit" class=button name="submit" value="Submit"></td>
    <td><input type="reset" class=button name="Submit2" value="Reset"></td>
    </tr>
    </form>
    <?}
    elseif($_GET['sex'] == gay)
    {?>
    <form name="" method="post" action="">
    <tr><td colspan="5" align="center">Your sexual orientation is <?=$_GET['sex']?></td></tr>
    <tr> 
    <td width="70"><font color=black>Your Character:</td>
    <td>
    <select name="ycharacter" style="width: 121;"><optgroup label="Hero for Married">
    <?php
    $charq = mssql_query("SELECT [Name] FROM [Character] where class!='32' and class!='33' and class!='35' and class!='80' and class!='81' and class!='83' and AccountID='$_SESSION[user]'");
    
    for($i=0;$i < mssql_num_rows($charq);++$i)
    {
    $row = mssql_fetch_row($charq);
    echo"<option value='$row[0]'><b>$row[0]</b></option>";
    }
    ?>
    </select>
    </td>
    </tr>
    <tr> 
    <td width="70"><font color=black>Your partner:</td>
    <td>
    <select name="acharacter" style="width: 121;"><optgroup label="Choose your partner">
    <?php
    $charq = mssql_query("SELECT [Name] FROM [Character] where class!='32' and class!='33' and class!='35' and class!='80' and class!='81' and class!='83' and AccountID!='$_SESSION[user]'");
    
    for($i=0;$i < mssql_num_rows($charq);++$i)
    {
    $row = mssql_fetch_row($charq);
    echo"<option value='$row[0]'><b>$row[0]</b></option>";
    }
    ?>
    </select>
    <input type="hidden" name="type" value="<?=$_GET['sex']?>">
    </td>
    </tr>
    <tr> 
    <td align="center" colspan="5"><input type="text" name="message" style="width: 220; height: 15; text-align: center;" maxlength="100" value="You message to your next wife/husband..."></td>
    </tr>
    
    <tr> 
    <td width="70">&nbsp;</td>
    </tr>
    <tr>
    <tr> 
    <td width="100" align="right"><input type="submit" class=button name="submit" value="Submit"></td>
    <td><input type="reset" class=button name="Submit2" value="Reset"></td>
    </tr>
    </form>
    <?}
    elseif($_GET['sex'] == lesbian) {?>
    <form name="" method="post" action="">
    <tr><td colspan="5" align="center">Your sexual orientation is <?=$_GET['sex']?></td></tr>
    <tr> 
    <td width="70"><font color=black>Your Character:</td>
    <td>
    <select name="ycharacter" style="width: 121;"><optgroup label="Hero for Married">
    <?php
    $charq = mssql_query("SELECT [Name] FROM [Character] where class!='0' and class!='1' and class!='3' and class!='16' and class!='17' and class!='19' and class!='48' and class!='50' and class!='64' and class!='66' and class!='96' and class!='98' and AccountID='$_SESSION[user]'");
    
    for($i=0;$i < mssql_num_rows($charq);++$i)
    {
    $row = mssql_fetch_row($charq);
    echo"<option value='$row[0]'><b>$row[0]</b></option>";
    }
    ?>
    </select>
    </td>
    </tr>
    <tr> 
    <td width="70"><font color=black>Your partner:</td>
    <td>
    <select name="acharacter" style="width: 121;"><optgroup label="Choose your partner">
    <?php
    $charq =  mssql_query("SELECT [Name] FROM [Character] where class!='0' and class!='1' and class!='3' and class!='16' and class!='17' and class!='19' and class!='48' and class!='50' and class!='64' and class!='66' and class!='96' and class!='98' and AccountID!='$_SESSION[user]'");
    
    for($i=0;$i < mssql_num_rows($charq);++$i)
    {
    $row = mssql_fetch_row($charq);
    echo"<option value='$row[0]'><b>$row[0]</b></option>";
    }
    ?>
    </select>
    <input type="hidden" name="type" value="<?=$_GET['sex']?>">
    </td>
    </tr>
    <tr> 
    <td align="center" colspan="5"><input type="text" name="message" style="width: 220; height: 15; text-align: center;" maxlength="100" value="You message to your next wife/husband..."></td>
    </tr>
    
    <tr> 
    <td width="70">&nbsp;</td>
    </tr>
    <tr>
    <tr> 
    <td width="100" align="right"><input type="submit" class=button name="submit" value="Submit"></td>
    <td><input type="reset" class=button name="Submit2" value="Reset"></td>
    </tr>
    </form>
    <?}}}?>
    </table>
    </div>
    </td>
    </table>
    marr_request.php
    Code:
    <?php if(isset($_POST['login'])) { login(); } ?>
    <?php 
    if ($_SESSION['user'] == false) {
    echo "<meta http-equiv=\"refresh\" content=\"0;url=?page=married\">";
    }
    else {
    $accuser = secure($_SESSION['user']);
    check_inject();
    
    $check_accq = mssql_query("Select * from married where receiveracc='$accuser' and status='not'"); 
    $check = mssql_num_rows($check_accq);
    $row = mssql_fetch_array($check_accq);
    $date = date("F j, Y, G:i A");
    $time = time();
    
    if($row['type'] == normal) { $type = "Normal"; }
    elseif($row['type'] == gay) { $type = "Gays"; }
    elseif($row['type'] == lesbian) { $type = "Lesbians"; }
    
    if($_GET['id'] == agree and $check > 0)
    {
    mssql_query("INSERT INTO marriedusers (predlojil,priel,message,type,date,time) VALUES ('$row[sender]','$row[receiver]','$row[message]','$type','$date','$time')");
    mssql_query("delete from married where receiveracc='$accuser'"); 
    mssql_query("UPDATE Character set Married='1',MarryName='$row[sender]' where Name='$row[receiver]'");
    mssql_query("UPDATE Character set Married='1',MarryName='$row[receiver]' where Name='$row[sender]'");
    echo "<script language=\"JavaScript\">alert (\"You successful accept this married !\");</script>";
    echo "<meta http-equiv=\"refresh\" content=\"0;url=?page=married\">";
    }
    elseif($_GET['id'] == idont and $check > 0)
    {
    mssql_query("delete from married where receiveracc='$accuser'"); 
    }
    
    if ($check > 0) { 
    ?>
    <br>Here you can check your requestions for Married
    <table border="0" cellspacing="5" cellpadding="0">
    <td width='400'>
    <table width="100%" border="0" cellspacing="1" cellpadding="1" class='tmem'>
    <tr> 
    <td align="center">Request By</td>
    <td align="center">Request To</td>
    <td align="center">Yes or No</td>
    </tr>
    <tr>
    <td align="center"><?=$row['sender']?></td>
    <td align="center"><?=$row['receiver']?></td>
    <td align="center"><a href="?page=marr_request&id=agree" style="border-bottom: 1px dashed;">I agree</a>&nbsp;&nbsp;<a href="?page=marr_request&id=idont" style="border-bottom: 1px dashed;">I don't</a></td>
    </tr>
    <tr>
    <td align="center" colspan="3">&nbsp;</td>
    </tr>
    <tr>
    <td align="center" colspan="3">Message sended from <?=$row['sender']?> to you:</td>
    </tr>
    <tr>
    <td align="center" colspan="3"><?=$row['message']?></td>
    </tr>
    <?}
    else{
    echo "<meta http-equiv=\"refresh\" content=\"0;url=?page=married\">";
    }}?>
    </table>
    </div>
    </td>
    </table>
    SQL Query
    Code:
    USE [MuOnline]
    GO
    if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[married]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
    drop table [dbo].[married]
    GO
    
    CREATE TABLE [dbo].[married] (
     [senderacc] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
     [receiveracc] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
     [sender] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
     [receiver] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
     [message] [varchar] (1800) COLLATE Chinese_PRC_CI_AS NULL ,
     [status] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
     [type] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
     [time] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
     [date] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL 
    ) ON [PRIMARY]
    GO
    I made it a simple page based on diablo71's web - removed almost everything ... only Marry link and Hall of Fame left. So until i figure out how to make it as a module for MuCore i'll use it as a web in web :P

    P.S.: Thanks anyway for your help! I don't believe none knows how to do it - this community gets worse by the day ... and i'm starting to get sick of it!
    Last edited by ThePunish3r; 01-12-12 at 05:02 PM. Reason: Married.php edited



Advertisement