nop, only by lines
Code:#ip
#ip
#ip
Printable View
Nice . It work fine .
=Master= , When edit your Mu Web , i have 1 query :
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-objectQuote:
$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();
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
but i can check only 4 jewel at hereQuote:
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;
}
http://img297.imageshack.us/img297/9691/jewellv1.jpg
I think the problem is $inventory = bin2hex($inventory); . It have limited .
If you know how to fix this please help me. Thanks
Try like this :
and output the result with $rowPHP Code:$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);
Tried it . no more error but it show nothing.
Quote:
$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>";
}
Thats because theres no connection to the db
try like this :
PHP Code:$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>";
}
Useful release
_________________________
MuWeb Team
MuWeb - THE PHP RESOURCE FOR MMORPG
I think more simple is just using .htaccess document.
My .htacces document:
Where deny from 81.198.14.14, just change to you needed ip and webserver will block connecting this looser to your ip :))Quote:
Order Allow,Deny
Allow from all
Deny from 81.198.14.14
Realy Master is back Again! :) Thnx 10/10
Sorry for bad english
master...i have one question for you :) you are romanian?
i'll answer for him
yes, he is
10/10
I wanna ban ip also for access to mu server ..
is it possible?