-
1 Attachment(s)
WebScrips To Show TOP 10 People, Guilds, Online GM's
This is my starting with PHP and MSSQL. Script to show TOP 5 (or more) strongest Character, Guilds, And Script to show if GM's are on.
http://img172.imageshack.us/img172/9780/gmsonue3.jpg
------------------------------
http://img144.imageshack.us/img144/2...gesttopxm0.jpg
------------------------------
http://img88.imageshack.us/img88/8125/guildstopcc8.jpg
P.S. This is really easy
I have all 3 these tables, but you can add just 1 if you want.
The green rows mean that the GM is on, the top player is on, or one or more of top guild members are on.
If none is online you wouldnt see the "GM's On" like there wouldnt be Gms table. And top players and guilds list will be gray(#cccccc) color.
You need to have Class.MSSQL.php file.If you dont have then download from attachments and config it (change just yourpass)!!!
added attachments if you need
Function needed to each table
without it would work none of tables.
Add it to your index.php
PHP Code:
function isnickonline($nick){
$db2 = new DB_MSSQL;
$db2->query("SELECT ConnectStat FROM dbo.MEMB_STAT WHERE memb___id =(SELECT Id FROM dbo.AccountCharacter WHERE GameIDC='$nick')");
if ($db2->next_record())
if($db2->f('ConnectStat') == 1) return true;
else return false;
else return false;
}
Now The GM's ON table code. Add in
index.php if you want this
PHP Code:
$db = new DB_MSSQL;
$db->query('SELECT Name FROM dbo.Character WHERE CtlCode = 8 OR CtlCode = 32');
while ($db->next_record()){
$gmnick = $db->f('Name');
if (isnickonline($gmnick)){
$gmoncontent =("$gmoncontent<tr><td>$gmnick</td></tr>");
$yra = true; }
}
if ($yra) $gmsonline =("<table width='167' border='0' bordercolor='#000000' cellpadding='1' cellspacing='0' style='font:Verdana, Arial, Helvetica, sans-serif; font-size:14px; color:#00FF00;'>
<tbody align='center'>
<tr><th>GM's ON:</th></tr>$gmoncontent</tbody></table>");
$smarty->assign('gmsonline',$gmsonline);
Code to show this table: Add in
index.html(the place where you want see this table)
And you have you GM's ON :busted_co
Now TOP players table: Add in
index.php
PHP Code:
$howmuch = 10; /* How may top players to show */
$query =("SELECT TOP $howmuch Name,Reset FROM dbo.Character ORDER BY Reset desc , cLevel desc;");
$skaic = 1;
$top5 = array();
$db = new DB_MSSQL($query);
while ($db->next_record()){
$nick = $db->f('Name');
$reset = $db->f('Reset');
if(isnickonline($nick)) $spalva =("style='color:#00FF00;'");
else $spalva =("style='color:#CCCCCC;'");
$top5content=("$top5content<tr $spalva><td>$skaic</td><td>$nick</td><td>$reset</td></tr><div>");
$skaic++;
}
$tablewithtops=("<table width='167' border='0' bordercolor='#000000' cellpadding='1' cellspacing='0' style='font:Verdana, Arial, Helvetica, sans-serif; font-size:12px;'>
<tbody align='center'>
<tr style='color:#CCCCCC'><th>Nr.</th><th>Nick</th><th>Reset</th></tr>$top5content</tbody></table>");
$smarty->assign('tablewithtops',$tablewithtops);
Code to show this table: Add in
index.html(the place where you want see this table). P.s. Change this: Stipriausi TOP 10 to what name you want.
Code:
<font color="#CCCCCC" ><center><strong>Stipriausi TOP 10</strong></center><br /></font>
{$tablewithtops}
<br />
And you have you TOP Players :busted_co
And TOP guilds table: Add in
index.php
PHP Code:
$howmuch = 10; /* How may top players to show */
$db = new DB_MSSQL;
$db->query("SELECT TOP $howmuch G_Name,G_Score FROM dbo.Guild ORDER BY G_score desc");
$i2 = 1;
$db2 = new DB_MSSQL;
while ($db->next_record())
{
$guild = $db->f('G_Name');
$gpoints= $db->f('G_Score');
$stabdis= true;
$db2->query("SELECT Name FROM dbo.GuildMember WHERE G_Name='$guild'");
while($db2->next_record() AND $stabdis){
$nick = $db2->f('Name');
if (isnickonline($nick)) {$guildon = true; $stabdis =false;} else $guildon = false;
}
if ($guildon) $spalva =("style='color:#00FF00;'"); else $spalva =("style='color:#CCCCCC;'");
$top5guildcontent =("$top5guildcontent<tr $spalva><td>$i2</td><td>$guild</td><td>$gpoints</td></tr>");
$i2++;
}
$topguildtable =("<table width='167' border='0' bordercolor='#000000' cellpadding='1' cellspacing='0' style='font:Verdana, Arial, Helvetica, sans-serif; font-size:12px; color:#CCCCCC;'>
<tbody align='center'>
<tr><th>Nr.</th><th>Guild</th><th>Points</th></tr>$top5guildcontent</tbody></table>");
$smarty->assign('topguildtable',$topguildtable);
Code to show this table: Add in
index.html(the place where you want see this table)
And you have you TOP GUILDS :busted_co
And thats all ;-) hope it works :construct
Credits: Me.
Real demo in my signature
-
Re: [Release] WebScrips To Show TOP 10 People, Guilds, Online GM's
-
Re: [Release] WebScrips To Show TOP 10 People, Guilds, Online GM's
Usefull for people who wanna make new webs :)
-
Re: [Release] WebScrips To Show TOP 10 People, Guilds, Online GM's
[ENG] good work 9/10
[LTU] malacius gera padarei ;) 9/10
-
Re: [Release] WebScrips To Show TOP 10 People, Guilds, Online GM's
-
Re: [Release] WebScrips To Show TOP 10 People, Guilds, Online GM's
Quote:
Originally Posted by
Alfons
Approved
hey, this is the first post I see from Alfons, and I see you are from The Netherlands! =D Nice to meet you =)
btw, Alfons, your website says a lot about yourself, maybe a little too much..
anyway, now I know with what types of people I deal with at RZ.. all sick porn people!
Have a nice day everyone, and Alfons, have a nice wank ;)
-
Re: [Release] WebScrips To Show TOP 10 People, Guilds, Online GM's
-
Re: [Release] WebScrips To Show TOP 10 People, Guilds, Online GM's
-
Re: [Release] WebScrips To Show TOP 10 People, Guilds, Online GM's
Quote:
Originally Posted by
Alfons
Approved
Big thanks ;-)
-
Re: [Release] WebScrips To Show TOP 10 People, Guilds, Online GM's
-
Re: [Release] WebScrips To Show TOP 10 People, Guilds, Online GM's
-
Re: [Release] WebScrips To Show TOP 10 People, Guilds, Online GM's
-
Re: [Release] WebScrips To Show TOP 10 People, Guilds, Online GM's
Good, but need to call library adodb, and use engine snarty, easy to add to mutoolz.
-
Re: [Release] WebScrips To Show TOP 10 People, Guilds, Online GM's
I have a website by lavinelu. I can't make it more easier with the libraries, because I'm just a starter in PHP and MSSQL
-
Re: [Release] WebScrips To Show TOP 10 People, Guilds, Online GM's
how the reset list works? eg if we use autoreset [sql job] are these resets going to be appeared on list or not?