- Joined
- Aug 18, 2009
- Messages
- 269
- Reaction score
- 119
Ето как да си направим Най Много време онлайн
Влизате в query analyzer Добавяте тези 2 кода в MuOnline
След това влизате в MuOnline Процедурите търсите WZ_DISCONNECT_MEMB и замествате с тази процедура
И Вече имате Най много олнйан класация
Влизате в query analyzer Добавяте тези 2 кода в MuOnline
Code:
[B]alter table Character add TotalTime int not null default 0
alter table MEMB_STAT add TotalTime int not null default 0[/B]
След това влизате в MuOnline Процедурите търсите WZ_DISCONNECT_MEMB и замествате с тази процедура
Code:
[B]CREATE PROCEDURE WZ_DISCONNECT_MEMB
@memb___id varchar(10)
AS
Begin
set nocount on
Declare @find_id varchar(10)
Declare @con_tm DATETIME
Declare @ConnectStat tinyint
Set @ConnectStat = 0
Set @find_id = 'NOT'
select @find_id = S.memb___id, @con_tm = S.ConnectTM from MEMB_STAT S INNER JOIN MEMB_INFO I ON S.memb___id = I.memb___id COLLATE DATABASE_DEFAULT
where I.memb___id = @memb___id
if( @find_id <> 'NOT' )
begin
update MEMB_STAT set ConnectStat = @ConnectStat, DisConnectTM = getdate(), TotalTime = TotalTime+(DATEDIFF(mi,ConnectTM,getdate()))
where memb___id = @memb___id
-- TIMEONLINE MOD by john_d
update character set TotalTime = TotalTime+(DATEDIFF(mi,@con_tm,getdate()))
from character as c INNER join AccountCharacter as ac ON
c.Name = ac.GameIDC where c.accountid = @memb___id
end
end
GO[/B]
И Вече имате Най много олнйан класация
А ето ви и класация.
PHP:
<?
$top_rank=addslashes(stripslashes(htmlspecialchars(secure($_POST['100'], ENT_NOQUOTES))));
$top_rank=clean_var(addslashes(stripslashes(htmlspecialchars(secure(100), ENT_NOQUOTES))));
if (empty($top_rank)) { echo "<table class='mss2' width='450' border='1' cellpadding='0' cellspacing='0' align='center'><tr><td class='left'>Please Select Rank!</td></tr><br />"; $error=1; }
if($error !=1) {
$select = "Select Top 25 memb___id,TotalTime,ConnectStat From MEMB_STAT Order By TotalTime desc";
$result = mssql_query($select);
echo '<br /><table class="mss2" width="450" border="1" cellpadding="0" cellspacing="0" align="center"><thead><tr><td><b><center>:: Top <font color="#d2288c">25</font> Total Online Time ::</center></b>
</td></tr></thead></table><br />
<table class="mss2" width="450" border="1" cellpadding="3" cellspacing="4" align="center">
<thead>
<tr>
<td align="center"><span class="rankings_text">#</span></td>
<td align="center"><span class="rankings_text">Name</span></td>
<td align="center"><span class="rankings_text_reset">Total Online Time</span></td>
<td align="center">Status</td>
</tr></thead>';
for($i=0;$i < mssql_num_rows($result);++$i)
{
$row = mssql_fetch_row($result);
$rank = $i+1;
$accountinfo = mssql_query("Select GameIDC From AccountCharacter where id='$row[0]'");
$infos = mssql_fetch_array($accountinfo);
$mins = $row[1];
$hours = floor($mins/60);
$days = floor($hours/24);
$hours = $hours % 24;
$mins = $row[1] % 60;
$statusaq = mssql_query("select * from MEMB_STAT where memb___id='".$row['0']."' and connectstat='1'");
$statusa = mssql_num_rows($statusaq);
if($statusa != 0)
{ $status = "<font color=green>Online</font>"; }
else { $status="<font color=red>Offline</font>"; }
/*if($infos['ConnectStat'] == 1) { $status ='<font color=green><b>Online</b>'; }
else { $status='<font color=red><b>Offline</b></a>'; }
*/
//Class
if ($row['0'] == 0) { $row[0] = "Dark Wizard"; }
if ($row['0'] == 1) { $row[0] = "Soul Master"; }
if ($row['0'] == 16) { $row[0] = "Dark Knight"; }
if ($row['0'] == 17) { $row[0] = "Blade Knight"; }
if ($row['0'] == 32) { $row[0] = "Elf"; }
if ($row['0'] == 33) { $row[0] = "Muse Elf"; }
if ($row['0'] == 48) { $row[0] = "Magic Gladiator"; }
//Location
if ($proverkata['4'] == 0) { $proverkata[4] = 'Lorencia'; }
if ($proverkata['4'] == 1) { $proverkata[4] = 'Dungeon'; }
if ($proverkata['4'] == 2) { $proverkata[4] = 'Davias'; }
if ($proverkata['4'] == 3) { $proverkata[4] = 'Noria'; }
if ($proverkata['4'] == 4) { $proverkata[4] = 'Lost tower'; }
if ($proverkata['4'] == 5) { $proverkata[4] = 'Excile'; }
if ($proverkata['4'] == 6) { $proverkata[4] = 'Arena'; }
if ($proverkata['4'] == 7) { $proverkata[4] = 'Atlans'; }
if ($proverkata['4'] == 8) { $proverkata[4] = 'Tarkan'; }
if ($proverkata['4'] == 9) { $proverkata[4] = 'Devil Square'; }
if ($proverkata['4'] == 32) { $proverkata[4] = 'Devil Square'; }
if ($proverkata['4'] == 10) { $proverkata[4] = 'Icarus'; }
if($i%2) { $colors = "#232323";} else { $colors="#100c0d"; }
echo "<tbody>
<tr bgcolor='$colors'>
<td align='center'><span class='rankings_text'>$rank.</span></td>
<td align='center'><span class='rankings_text'><a href='index.php?page=character&character=$infos[GameIDC]'>$infos[GameIDC]</span></td>
<td align='center'><span class='rankings_text'><font color=red>$days days, <font color=white>$hours hours, <font color=green>$mins minutes</span></td>
<td align='center'>$status</td>
</tr>
</tbody>";
}
}
?></table>
Last edited: