Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[Release] MFS Team Web 0.6

MFS Team Owner
Joined
Jan 10, 2007
Messages
767
Reaction score
227
Refferal list isn`t working correctly. For example, I voted for my character AngeL 3 times, he should be ranked 1st in list, but for each vote he get in top again.
See image View attachment 127593

open referal.php and chage code with this, test and say is it working
Code:
<? if (eregi("modules/", $_SERVER['SCRIPT_NAME'])) { header("Location: ../?op=news"); } ?>
<script type="text/javascript" src="includes/javascript/rules.js"></script>
<script type="text/javascript" src="includes/javascript/pfewlpflpwelpf.js"></script>


<table align='center' width='350' cellspacing='0' cellpaddding='0' class='sort-table'>


<tr>
<td align='center' colspan='5' class=asd><? echo $servername; ?> :: Referals</td>
</tr>
<tr>
<td align='right'>Referals:</td>
<td align='center'><a onclick="rules('')"><input OnClick="rankings('rank')" type='submit' class='button' value='show'></a></td>
</tr>


<tr><td align='center' colspan='2'>
<div id='showrules' style='display: none;'>
<table width='400' align='center'>
<tr><td> </td></tr>
<tr><td align='center'>
<table width='400' align='center' class='maintable'>
<tr>
<td align='center' class='asd'>Total Referals</td></tr></table>
<table width='400' align='center' class='maintable'>


<tr>
<td align='center' class='asd'>#
<td align='center' class='asd'>Name
<td align='center' class='asd'>Votes
</td></tr>


<?php
include "config.php";


$query = mssql_query("SELECT TOP 100 userid, broi from items order by broi desc");


for($i=0; $i < mssql_num_rows($query); ++$i)
{
$rank = $i+1;


while ($a = $fetch = mssql_fetch_array($query)) {
    
    $id = $a['userid'];
    $getname = mssql_query("SELECT * from MEMB_INFO where memb___id='$id'");
    $fatch = mssql_fetch_array($getname);
    $username = $fatch['memb___id'];


    $broi = mssql_num_rows(mssql_query("SELECT broi from items where userid='$id'"));
    $up = mssql_query("UPDATE items SET broi='$broi' WHERE userid='$id'");
    $username = $fatch['memb___id']; 
    


    
 
echo"
<tr>
<td align='center' class='maintable'>$rank.</td>
<td align='center' class='maintable'>$username</td>
<td align='center' class='maintable'>$broi</td>
</tr>


";
}}
?>
</table>
</td></tr>


</table>
<tr><td> </td></tr>
<tr class='even'></td></tr>
</table>
 
MFS Team Owner
Joined
Jan 10, 2007
Messages
767
Reaction score
227
okey for referal fix:
1. open DB. delete table items
2. insert in query this:
Code:
CREATE TABLE [dbo].[items] (
    [vreme] [int] NULL ,
    [userid] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
    [ip] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
    [broi] [int] NOT NULL default 0;
) ON [PRIMARY]
GO
3. open modules/referal.php replace the code with this:
Code:
<? if (eregi("modules/", $_SERVER['SCRIPT_NAME'])) { header("Location: ../?op=news"); } ?>
<script type="text/javascript" src="includes/javascript/rules.js"></script>
<script type="text/javascript" src="includes/javascript/pfewlpflpwelpf.js"></script>


<table align='center' width='350' cellspacing='0' cellpaddding='0' class='sort-table'>


<tr>
<td align='center' colspan='5' class=asd><? echo $servername; ?> :: Referals</td>
</tr>
<tr>
<td align='right'>Referals:</td>
<td align='center'><a onclick="rules('')"><input OnClick="rankings('rank')" type='submit' class='button' value='show'></a></td>
</tr>


<tr><td align='center' colspan='2'>
<div id='showrules' style='display: none;'>
<table width='400' align='center'>
<tr><td> </td></tr>
<tr><td align='center'>
<table width='400' align='center' class='maintable'>
<tr>
<td align='center' class='asd'>Total Referals</td></tr></table>
<table width='400' align='center' class='maintable'>


<tr>
<td align='center' class='asd'>#
<td align='center' class='asd'>Name
<td align='center' class='asd'>Votes
</td></tr>


<?php


$topq = mssql_query("Select userid, broi from items order by broi desc");


for($i=0; $i < mssql_num_rows($topq); ++$i)
{
$rank = $i+1;
$row = mssql_fetch_row($topq);
 
echo"
<tr>
<td align='center' class='maintable'>$i</td>
<td align='center' class='maintable'>$row[0]</td>
<td align='center' class='maintable'>$row[1]</td>
</tr>


";
}
?>
</table>
</td></tr>


</table>
<tr><td> </td></tr>
<tr class='even'></td></tr>
</table>
4. open vote.php replace code with this:
Code:
<center>
<?php
include "config.php";
global $yoursite;


$id = stripslashes($_GET['id']);
$id = str_replace("drop", "", $id);
$id = str_replace(";", "", $id);
$id = str_replace("shutdown", "", $id);
$id = str_replace("UPDATE", "", $id);
if (eregi("[^a-zA-Z0-9_-]", $id))
{
    echo "Dont cheat.";
}
else
{
    if ($_POST['click'])
    {
        echo "<font color='#FFFFFF'>";


        $time = time();
        $time1 = time() - 86400;
        $ip = $_SERVER['REMOTE_ADDR'];


        $s = mssql_num_rows(mssql_query("SELECT * from MEMB_INFO where memb___id='$id'"));
        if ($s == "1")
        {
            $query = mssql_query("SELECT broi from items WHERE ip='$ip' and userid='$id' and vreme>$time1 ORDER by vreme DESC");
            $broi = mssql_num_rows($query);
            if ($broi == "0")
            {
            $broi=mssql_fetch_row($query);
                $rand = "1";
                $insert = mssql_query("INSERT INTO items (vreme, userid , ip ) VALUES('$time','$id','$ip')");
                $update = mssql_query("Update MEMB_CREDITS set credits = credits+$rand WHERE memb___id='$id'");
                $a = mssql_query("UPDATE items set broi=broi+1 where userid='$id'");
                echo "You successful vote for <font color='red'>$id</font> and he get <font color='green'>$rand</font> credits!";
            }
            else
            {
                echo "You are already vote. You can vote again after 24 hours.";
            }


            echo "</font>";
        }
        else
        {
            echo "This user doesn't exist!";
        }
    }
    else
    {
?>
    <form action="index.php?op=vote&id=<?= $id ?>" method="post">
    <input type="submit" value="Vote for <?= $id ?>" name="click">
    </form>
    <?php
    }
}
?>
</center>

Test and say is it working now?
 
Last edited:
Newbie Spellweaver
Joined
Mar 9, 2011
Messages
51
Reaction score
7
i don't know why but for me this web load slowly if you understand what I mean ....
i use xamp 1.7.1 (fresh install).

never mind, I fix it
 
Last edited:
Junior Spellweaver
Joined
Oct 1, 2012
Messages
127
Reaction score
8
Please tighten website security and important transactions must include logs. This project is exciting. Keep it up.
 
MFS Team Owner
Joined
Jan 10, 2007
Messages
767
Reaction score
227
i will check this for logs, about security try to hack it and say if you find some holes in web so to fix them until then its secured
something else that isnt working and new ideas?
 
Newbie Spellweaver
Joined
Apr 21, 2011
Messages
96
Reaction score
8
Day Top 5 Users module. It`s like show most active players ( who have reached the most resets in one day ) top and 1st place receive 100 credits. It would be grate module. And maybe something like chat module where players in website can talk to each other and receive help!
 
Back
Top