[Share] A3 characters TOP

Results 1 to 9 of 9
  1. #1
    Newbie PhDoc is offline
    MemberRank
    Dec 2004 Join Date
    1Posts

    [Share] A3 characters TOP

    Just simple characters TOP by some parameters:
    PHP Code:
    <?php
    $SERVER
    ="";
    $USER="";
    $PASS="";

    $DB_NAME="ASD";
    $LINK=mssql_connect($SERVER,$USER,$PASS);
    $DB=mssql_select_db($DB_NAME,$LINK);

    //$lines="100 PERCENT";
    $lines="100";

    if (!isset(
    $_GET['t'])) 
    {
        
    $t 0;
    }
    else
    {
        
    $t floor($_GET['t']);
    }

    $aClass = array(
            
    => 'Warrior',
            
    => 'Knight',
            
    => 'Mage',
            
    => 'Archer');

    $strSQL  "SELECT TOP {$lines} ";
    $strSQL .= "c_id as char, ";
    $strSQL .= "c_sheaderb as class, ";
    $strSQL .= "c_sheaderc as level, ";
    $strSQL .= "CAST(dbo.fnSplit(c_headera, ';', 1) AS int) as str, ";
    $strSQL .= "CAST(dbo.fnSplit(c_headera, ';', 2) AS int) as int, ";
    $strSQL .= "CAST(dbo.fnSplit(c_headera, ';', 3) AS int) as dex, ";
    $strSQL .= "CAST(dbo.fnSplit(c_headera, ';', 4) AS int) as vit, ";
    $strSQL .= "CAST(dbo.fnSplit(c_headera, ';', 5) AS int) as mana, ";
    $strSQL .= "CAST(dbo.fnSplit(c_headera, ';', 7) AS int) as HP, ";
    $strSQL .= "CAST(dbo.fnSplit(c_headera, ';', 8) AS int) as MP, ";
    $strSQL .= "c_headerc as gold, ";
    $strSQL .= "CONVERT(VARCHAR, d_udate, 105)  +  ' ' + CONVERT(VARCHAR, d_udate, 108) as laston ";
    $strSQL .= "from charac0 (nolock) ";
    $strSQL .= "where (not d_udate IS NULL) ";

    switch (
    $t
    {
        case 
    1:            // str
            
    $strSQL .= "ORDER BY CAST(dbo.fnSplit(c_headera, ';', 1) AS int) DESC ";
            break;
        case 
    2:            // int
            
    $strSQL .= "ORDER BY CAST(dbo.fnSplit(c_headera, ';', 2) AS int) DESC ";
            break;
        case 
    3:            // dex
            
    $strSQL .= "ORDER BY CAST(dbo.fnSplit(c_headera, ';', 3) AS int) DESC ";
            break;
        case 
    4:            // vit
            
    $strSQL .= "ORDER BY CAST(dbo.fnSplit(c_headera, ';', 4) AS int) DESC ";
            break;
        case 
    5:            // mana
            
    $strSQL .= "ORDER BY CAST(dbo.fnSplit(c_headera, ';', 5) AS int) DESC ";
            break;
        case 
    7:            // HP
            
    $strSQL .= "ORDER BY CAST(dbo.fnSplit(c_headera, ';', 7) AS int) DESC ";
            break;
        case 
    8:            // MP
            
    $strSQL .= "ORDER BY CAST(dbo.fnSplit(c_headera, ';', 8) AS int) DESC ";
            break;
        case 
    10:        // gold
            
    $strSQL .= "ORDER BY CAST(c_headerc as int) DESC ";
            break;
        case 
    11:        // date
            
    $strSQL .= "ORDER BY d_udate DESC ";
            break;
        default:        
    // level (t=0)
            
    $strSQL .= "ORDER BY CAST(c_sheaderc as int) DESC ";
    }
    $res=mssql_query($strSQL$LINK);
    ?>
    <html>
    <head>
    <title>TOPs :: Project A3</title>
    <STYLE>
    body    {font-family: Verdana; font-size: 12px; BACKGROUND: #94B6C6; color: black}
    td    {font-family: Verdana; font-size: 11px; color: black;}
    td.h    {font-family: Verdana; font-size: 12px; color: black; background-color: #A6B6C6;}
    </STYLE>
    </head>
    <body TOPMARGIN="5">
    <table align=center border=1 cellpadding=1 cellspacing=1>
    <tr align=center height=25>
    <td width= 30 class=h>№</td>
    <td width=150 class=h>Name</td>
    <td width= 50 class=h>Class</td>
    <td width= 50 class=h><a href="a3tops.php?t=0"><?php if  ($t==0)  echo "<b><font color=red>";?>Level<?php if ($t==0)  echo "</font></b>";?></a></td>
    <td width= 50 class=h><a href="a3tops.php?t=1"><?php if  ($t==1)  echo "<b><font color=red>";?>STR  <?php if ($t==1)  echo "</font></b>";?></a></td>
    <td width= 50 class=h><a href="a3tops.php?t=2"><?php if  ($t==2)  echo "<b><font color=red>";?>INT  <?php if ($t==2)  echo "</font></b>";?></a></td>
    <td width= 50 class=h><a href="a3tops.php?t=3"><?php if  ($t==3)  echo "<b><font color=red>";?>DEX  <?php if ($t==3)  echo "</font></b>";?></a></td>
    <td width= 50 class=h><a href="a3tops.php?t=4"><?php if  ($t==4)  echo "<b><font color=red>";?>VIT  <?php if ($t==4)  echo "</font></b>";?></a></td>
    <td width= 50 class=h><a href="a3tops.php?t=5"><?php if  ($t==5)  echo "<b><font color=red>";?>Mana <?php if ($t==5)  echo "</font></b>";?></a></td>
    <td width= 50 class=h><a href="a3tops.php?t=7"><?php if  ($t==7)  echo "<b><font color=red>";?>HP   <?php if ($t==7)  echo "</font></b>";?></a></td>
    <td width= 50 class=h><a href="a3tops.php?t=8"><?php if  ($t==8)  echo "<b><font color=red>";?>MP   <?php if ($t==8)  echo "</font></b>";?></a></td>
    <td width=100 class=h><a href="a3tops.php?t=10"><?php if ($t==10) echo "<b><font color=red>";?>Gold <?php if ($t==10) echo "</font></b>";?></a></td>
    <td width=150 class=h><a href="a3tops.php?t=11"><?php if ($t==11) echo "<b><font color=red>";?>Last Visit<?php if ($t==11) echo "</font></b>";?></a></td></tr>
    <?php
    $i
    =0;
    while (
    $data=@mssql_fetch_array($res))
    {
        
    $i++;
        echo 
    "
        <tr align=center>
        <td>"
    .$i."</td>
        <td>"
    .$data['char']."</td>
        <td>"
    .$aClass[$data['class']]."</td>
        <td>"
    .$data['level']."</td>
        <td>"
    .$data['str']."</td>
        <td>"
    .$data['int']."</td>
        <td>"
    .$data['dex']."</td>
        <td>"
    .$data['vit']."</td>
        <td>"
    .$data['mana']."</td>
        <td>"
    .$data['HP']."</td>
        <td>"
    .$data['MP']."</td>
        <td>"
    .$data['gold']."</td>
        <td>"
    .$data['laston']."</td>
        </tr>"
    ;
    }
    ?>
    </table>
    </body>
    </html>
    Maybe will need "SELECT UNOIN" for tables charac0-charac#...
    Enjoy.
    Last edited by PhDoc; 14-06-07 at 10:56 AM.


  2. #2
    My LanHouse in Brazil!!!! Yag4mi2k is offline
    Grand MasterRank
    Feb 2007 Join Date
    CoNquEsT FrOm Br4ZiLianLocation
    721Posts

    Re: [Share] A3 characters TOP

    page of I register in cadastre in php

  3. #3
    Grand Master iNs@nE is offline
    Grand MasterRank
    Jun 2006 Join Date
    HereLocation
    9,537Posts

    Re: [Share] A3 characters TOP

    Decent share. Will come in handy to people.

  4. #4
    Elite Member divyang is offline
    Member +Rank
    Apr 2007 Join Date
    IndiaLocation
    102Posts

    Re: [Share] A3 characters TOP

    good nice work :p

    :construct

  5. #5
    My LanHouse in Brazil!!!! Yag4mi2k is offline
    Grand MasterRank
    Feb 2007 Join Date
    CoNquEsT FrOm Br4ZiLianLocation
    721Posts

    Re: [Share] A3 characters TOP

    What! he would be dbo.fnSplit?


    O que seria est

  6. #6
    Newbie elzorrofox is offline
    MemberRank
    Apr 2005 Join Date
    venezuelaLocation
    17Posts

    Re: [Share] A3 characters TOP

    helpme no see all charac I see only charac0 if change charac1 see only charac1 how see all charac thx man..
    sorry my ingles

    no veo todos los character en el top solo los caracter que estan en el charac0 gracias

  7. #7
    Grand Master iNs@nE is offline
    Grand MasterRank
    Jun 2006 Join Date
    HereLocation
    9,537Posts

    Re: [Share] A3 characters TOP

    Please stop bumping old topics of reasons like these..

    Just replace the charac value with the one's present in your DB's ...

  8. #8
    Sorcerer Supreme apocalipsy is offline
    Member +Rank
    Feb 2007 Join Date
    Brazil A3 Cyberstore GMLocation
    250Posts

    Re: [Share] A3 characters TOP

    PHP Code:
    <table align=center border=1 cellpadding=1 cellspacing=1>
    <tr align=center height=25>
    <td width= 30 class=h>№</td>
    <td width=150 class=h>Name</td>
    <td width= 50 class=h>Class</td>
    <td width= 50 class=h><a href="a3tops.php?t=0"><?php if  ($t==0)  echo "<b><font color=red>";?>Level<?php if ($t==0)  echo "</font></b>";?></a></td>
    <td width= 50 class=h><a href="a3tops.php?t=1"><?php if  ($t==1)  echo "<b><font color=red>";?>STR  <?php if ($t==1)  echo "</font></b>";?></a></td>
    <td width= 50 class=h><a href="a3tops.php?t=2"><?php if  ($t==2)  echo "<b><font color=red>";?>INT  <?php if ($t==2)  echo "</font></b>";?></a></td>
    <td width= 50 class=h><a href="a3tops.php?t=3"><?php if  ($t==3)  echo "<b><font color=red>";?>DEX  <?php if ($t==3)  echo "</font></b>";?></a></td>
    <td width= 50 class=h><a href="a3tops.php?t=4"><?php if  ($t==4)  echo "<b><font color=red>";?>VIT  <?php if ($t==4)  echo "</font></b>";?></a></td>
    <td width= 50 class=h><a href="a3tops.php?t=5"><?php if  ($t==5)  echo "<b><font color=red>";?>Mana <?php if ($t==5)  echo "</font></b>";?></a></td>
    <td width= 50 class=h><a href="a3tops.php?t=7"><?php if  ($t==7)  echo "<b><font color=red>";?>HP   <?php if ($t==7)  echo "</font></b>";?></a></td>
    <td width= 50 class=h><a href="a3tops.php?t=8"><?php if  ($t==8)  echo "<b><font color=red>";?>MP   <?php if ($t==8)  echo "</font></b>";?></a></td>
    <td width=100 class=h><a href="a3tops.php?t=10"><?php if ($t==10) echo "<b><font color=red>";?>Gold <?php if ($t==10) echo "</font></b>";?></a></td>
    <td width=150 class=h><a href="a3tops.php?t=11"><?php if ($t==11) echo "<b><font color=red>";?>Last Visit<?php if ($t==11) echo "</font></b>";?></a></td></tr>
    <?php
    plss 100% working It seems to lack something to me ones pages

    sorry bad ingles brazil \o/

  9. #9
    Newbie elzorrofox is offline
    MemberRank
    Apr 2005 Join Date
    venezuelaLocation
    17Posts

    Re: [Share] A3 characters TOP

    it excuses you did not understand to me if only one sees in the pagina the characters that belong to the value charac0 but demas character does not appear to me in pagina. but if change to charac1 or charac2 sees the character that estan in that value... excuses the insistence and my ingles



Advertisement