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!

MuWeb Ban IP PHP

Skilled Illusionist
Joined
May 6, 2006
Messages
330
Reaction score
1
MuWeb Ban IP PHP

This script is used to ban someone`s IP,
Banned IP will not be able to view anymore your website.

INSTALL NOTES:
1.Copy files in your site
2.Open index.php and on first line add this:
PHP:
<? include("MuWeb_ban.inc.php"); ?>
3.Add ban ip in ban_ip_list.txt, example:
Code:
#127.0.0.1
#83.155.65.5
#89.55.78.68

NOTE*
- If you don`t have any ip to ban, leave in the ban_ip_list.txt the ip #127.0.0.1
- If your ban_ip_list.txt is empty no one will be able to view your website


Credits,
=Master=
 

Attachments

You must be registered for see attachments list
Divine Celestial
Loyal Member
Joined
Aug 24, 2007
Messages
890
Reaction score
5
Re: [Release] MuWeb Ban IP PHP

ok thankf for sharing 10/10
 
Pyro Dude
Loyal Member
Joined
Jan 23, 2007
Messages
450
Reaction score
8
Re: [Release] MuWeb Ban IP PHP

Sweeeeeeet, But people will still use proxy >.> pr if they have a dynamic ip ^^
 
Skilled Illusionist
Joined
May 6, 2006
Messages
330
Reaction score
1
Re: [Release] MuWeb Ban IP PHP

Sweeeeeeet, But people will still use proxy >.> Page Ranking if they have a dynamic ip ^^

yea i know...but most of newbies will don`t know how to use proxy ^_^
 
Pyro Dude
Loyal Member
Joined
Jan 23, 2007
Messages
450
Reaction score
8
Re: [Release] MuWeb Ban IP PHP

wtf, why did i say page ranking? D:
 
Experienced Elementalist
Joined
Jun 24, 2005
Messages
287
Reaction score
41
Re: [Release] MuWeb Ban IP PHP

Thanks,
but can i add to ban_ip_list all IP like
#12.0.0.0 - 12.255.255.255 ?
 
Junior Spellweaver
Joined
Sep 29, 2007
Messages
117
Reaction score
0
Re: [Release] MuWeb Ban IP PHP

thanks master
10/10!
you are the best coder in php ^^
 
Joined
Jan 22, 2005
Messages
889
Reaction score
80
Re: [Release] MuWeb Ban IP PHP

- If you don`t have any ip to ban, leave in the ban_ip_list.txt the ip #127.0.0.1
err but actually if i block my own ip then i cant see website too :eek:
lol but works nice on others
well works if theres more than 1 ip
even if just one empty line after #127.0.0.1
now need to make some editbox for it ;)
 
Experienced Elementalist
Joined
Dec 28, 2007
Messages
288
Reaction score
2
Re: [Release] MuWeb Ban IP PHP

Hah i don`t liked verry much account menager but this is good :)
i`ts easy, but maybe you must add this to Admin Area :) so anyone can ban users from The Admin Panel... I will try to add it :p
So 8/10 :)
 
Master Summoner
Loyal Member
Joined
Jun 17, 2006
Messages
549
Reaction score
3
Re: [Release] MuWeb Ban IP PHP

Easy to stop little annoying ppl. Thx.
 
Banned
Banned
Joined
May 23, 2007
Messages
12
Reaction score
0
Re: [Release] MuWeb Ban IP PHP

Very good but i would like to ask something if posible.
If we could search a specific ip to see which accounts (maybe more than 1) has loged in game :)
 
Twilight Mu Owner
Loyal Member
Joined
Aug 8, 2005
Messages
505
Reaction score
74
Re: [Release] MuWeb Ban IP PHP

 
Newbie Spellweaver
Joined
May 2, 2006
Messages
45
Reaction score
0
Re: [Release] MuWeb Ban IP PHP

Nice . It work fine .

=Master= , When edit your Mu Web , i have 1 query :

$query = "select top 5 name,resets,onlinehours
from character inner join memb_stat on accountid=memb___id
where accountid in ( select top 5 memb___id from memb_stat order by onlinehours desc )
and name in ( select top 1 name from character where accountid=memb___id order by resets desc)
order by onlinehours desc";
$result = $db->Execute($query);
$row = $result->fetchrow();

Run this query on SQL Query Analyzer , i got the result of top character onlinehours but when copy it into web like that . it notice me : Fatal error: Call to a member function fetchrow() on a non-object

So what's the problem here ? My web or my code or my pc ?

1 more :

I added function jewel_check in web_modules.php to check for jewel when reset character

function jewel_check($character){
require("config.php");

$inventory_result_sql = $db->Execute("SELECT Inventory FROM Character WHERE (Character.[Name] = '$character')");
$inventory_result = $inventory_result_sql->fetchrow();
$inventory = $inventory_result[0];

$inventory = bin2hex($inventory);
$inventory = strtoupper($inventory);
//echo($inventory);
$chaos = 0;
$joc = 0;
$blue = 0;
for($x=0; $x<108; ++$x)
{
$item = substr($inventory,$x*32,32);
$chaos = $chaos + substr_count($item, '0F00');
$joc = $joc + substr_count($item, 'D600');
$blue = $blue + substr_count($item, '0E00');
}
$j = array( 'chaos' => $chaos,
'joc' => $joc,
'blue' => $blue);

return $j;
}

but i can check only 4 jewel at here

=Master= - MuWeb Ban IP PHP - RaGEZONE Forums

I think the problem is $inventory = bin2hex($inventory); . It have limited .
If you know how to fix this please help me. Thanks
 
Experienced Elementalist
Joined
Apr 29, 2007
Messages
260
Reaction score
4
Re: [Release] MuWeb Ban IP PHP

Try like this :
PHP:
$query = "select top 5 name,resets,onlinehours
from character inner join memb_stat on accountid=memb___id
where accountid in ( select top 5 memb___id from memb_stat order by onlinehours desc )
and name in ( select top 1 name from character where accountid=memb___id order by resets desc)
order by onlinehours desc";
$result = mssql_query($query);
$row = mssql_fetch_row($result);

and output the result with $row
 
Newbie Spellweaver
Joined
May 2, 2006
Messages
45
Reaction score
0
Re: [Release] MuWeb Ban IP PHP

Tried it . no more error but it show nothing.
$query = "select top 5 name,resets,onlinehours
from character inner join memb_stat on accountid=memb___id
where accountid in ( select top 5 memb___id from memb_stat order by onlinehours desc )
and name in ( select top 1 name from character where accountid=memb___id order by resets desc)
order by onlinehours desc";
$result = mssql_query($query);

for($i=0;$i < $top_rank;++$i)
{
$row = mssql_fetch_row($result);
$rank = $i+1;

$content .="<tr>
<td align=center width='94'>$rank</td>
<td align=center width='94'><div class='link_rankings'><a href=main.php?op=character&character=$row[0]>$row[0]</a></div></td>
<td align=right width='94'>$row[2]</td>
</tr>";
}
 
Experienced Elementalist
Joined
Apr 29, 2007
Messages
260
Reaction score
4
Re: [Release] MuWeb Ban IP PHP

Thats because theres no connection to the db

try like this :


PHP:
$con = mssql_connect('127.0.0.1',' sa',' SQL pass');
mssql_select_db('MuOnline', $con);
$query = "select top 5 name,resets,onlinehours 
from character inner join memb_stat on accountid=memb___id 
where accountid in ( select top 5 memb___id from memb_stat order by onlinehours desc ) 
and name in ( select top 1 name from character where accountid=memb___id order by resets desc) 
order by onlinehours desc"; 
$result = mssql_query($query);
 
for($i=0;$i < $top_rank;++$i)
{
	  $row = mssql_fetch_row($result);
          $rank = $i+1;
 
$content .="<tr> 
            <td align=center width='94'>$rank</td>
<td align=center width='94'><div class='link_rankings'><a href=main.php?op=character&character=$row[0]>$row[0]</a></div></td>
            <td align=right width='94'>$row[2]</td>
            </tr>";  
}
 
Back
Top