pvp serverler,pvp server,pvp serverlar,private serverlar,private serverler,private server,metin2

Sizleri Neler Bekliyor ?
-Foruma Üye Olarak Yeni Arkadaşlıklar Edineceksiniz.
-İnternette Zaman Geçirecek Bir Alanınız Olucak Ve Eğleneceksiniz.
-PvP Server Tutkunuysanız Pvp Serverlerde Yenilikleri Takip Ediceksiniz.
-Yeni Açılan Serverleri Anında Bulacaksınız .
-Gmlik Adaylığı Koyacaksınız.Serverinizi Tanıtacaksınız.
-Pvp Serverler Hakkında Herşey Bu Forumda Olucak.
-ÜYE OLURSANIZ FORUMDAKİ REKLAMLAR GÖZÜKMEZ
Bunlardan Yararlanmak İçin Sizden Tek İsteyimiz Üye Olmanız Yada Giriş Yapmanız.


GunLuk NP Prosedürü ve PHP Kodu! 30us3s8
Lütfen Foruma FİREFOX İle Giriniz !



Join the forum, it's quick and easy

pvp serverler,pvp server,pvp serverlar,private serverlar,private serverler,private server,metin2

Sizleri Neler Bekliyor ?
-Foruma Üye Olarak Yeni Arkadaşlıklar Edineceksiniz.
-İnternette Zaman Geçirecek Bir Alanınız Olucak Ve Eğleneceksiniz.
-PvP Server Tutkunuysanız Pvp Serverlerde Yenilikleri Takip Ediceksiniz.
-Yeni Açılan Serverleri Anında Bulacaksınız .
-Gmlik Adaylığı Koyacaksınız.Serverinizi Tanıtacaksınız.
-Pvp Serverler Hakkında Herşey Bu Forumda Olucak.
-ÜYE OLURSANIZ FORUMDAKİ REKLAMLAR GÖZÜKMEZ
Bunlardan Yararlanmak İçin Sizden Tek İsteyimiz Üye Olmanız Yada Giriş Yapmanız.


GunLuk NP Prosedürü ve PHP Kodu! 30us3s8
Lütfen Foruma FİREFOX İle Giriniz !

pvp serverler,pvp server,pvp serverlar,private serverlar,private serverler,private server,metin2

Would you like to react to this message? Create an account in a few clicks or log in to continue.

pvp serverler,pvp server,pvp serverlar,private serverlar,private serverler,private server,metin pvp server

pvpserverler.forumclan.com  Üye sayımız +105.000 / Aramıza Hoşgeldiniz !

    GunLuk NP Prosedürü ve PHP Kodu!

    MétaLicSt0Rm
    MétaLicSt0Rm
    Moderatör


    <b>Mesaj Sayısı</b> Mesaj Sayısı : 859
    <b>Kayıt tarihi</b> Kayıt tarihi : 07/06/10
    Warıor
    Eski Oyuncu
    GS

    GunLuk NP Prosedürü ve PHP Kodu! Empty GunLuk NP Prosedürü ve PHP Kodu!

    Mesaj tarafından MétaLicSt0Rm Ptsi Haz. 07, 2010 10:23 pm

    Merhaba Arkadaşlar bir cok kişi bu kodu arıyor bende zamanında cok
    aramiştim sizinle paylaşmak istedim.

    KOD


    Kod:

    Query Analyzer'a Girip Gerekli Column'u Ekleyelim
    ------
    ALTER TABLE USERDATA
    ADD GunLukLoyalty int

    ------
    ------
    Eklenecek Tablo :

    if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[GUNLUK_NP_TAKIP]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
    drop table [dbo].[GUNLUK_NP_TAKIP]
    GO

    CREATE TABLE [dbo].[GUNLUK_NP_TAKIP] (
    [StrUserID] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
    [Giris] [int] NULL ,
    [cikis] [int] NULL
    ) ON [PRIMARY]
    GO

    ------

    1. Account_Logout Procedure'sine girelim

    BEGIN TRAN'yn hemen altyna ?u kodu yapy?tyralym :

    ----- gunluk baslangic
    DECLARE @girisnp int , @cikisnp int , @id varchar(50), @logvarmi int
    select @id = StrCharID from CURRENTUSER where StrAccountID = @AccountID
    select @girisnp = Giris from GUNLUK_NP_TAKIP where StrUserID = @id
    select @cikisnp = Loyalty from USERDATA where StrUserID = @id
    if @girisnp > @cikisnp
    BEGIN
    update USERDATA set GunlukLoyalty = GunlukLoyalty + (@girisnp - @cikisnp) where StrUserID = @id
    DELETE FROM GUNLUK_NP_TAKIP where StrUserID = @id
    END
    if @cikisnp > @girisnp
    BEGIN
    update USERDATA set GunlukLoyalty = GunlukLoyalty + (@cikisnp - @girisnp) where StrUserID = @id
    DELETE FROM GUNLUK_NP_TAKIP where StrUserID = @id
    END
    ---- gunluk bitis

    Kodumuzu Yapy?tyrdyktan Sonra Kaydedip Çykalym Bu Procedure'den.


    2. Load_User_Data Procedure'sine girelim

    EXEC REPAIR_USER_STAT_POINTS @id hemen üstüne gelicek ?ekilde kodu yapy?tyralym :

    -- gunluk baslangic
    DECLARE @girisnp int
    select @girisnp = Loyalty from userdata where StrUserID = @id
    insert into GUNLUK_NP_TAKIP (StrUserID, Giris, Cikis) VALUES (@id, @girisnp, '0')
    -- gunluk bitis

    EXEC REPAIR_USER_STAT_POINTS @id

    Kodumuzu Yapy?tyrdyktan Sonra Kaydedip Çykalym ve Query Analyzer'i Açalym
    Query Analyzer'i Açtyktan Sonra Günlük NP'nin Çaly?masy için Bu Kodu Yapy?tyryyoruz :

    update userdata set GunlukLoyalty = '0' ve F5'E Basyyoruz ( Her Gün Saat 00:00'da Bu Kodu Girmelisiniz ki Günlük NP'yi Syfyrlasyn )

    Günlük NP Proceduresinin Sa?lykly Çaly?masy Yçin Ne Gerekiyorsa Yaptyk Burada Y?imiz Bitmi?tir...

    Kod K2D Yapımcısından Alıntıdır.

    Sırada Php Kodunda!


    PHP- Kodu:




    <?

    // Oturumlar

    ob_start();

    session_start();



    if (
    $_SESSION['sesusera'] == '') {





    echo
    'Üye Girisi yapiniz!';



    }



    else {


    ?>

    <center> <B> <a href="index.php?sayfa=gunluk"> Ortak Gunluk Siralama </a> | <a href="index.php?sayfa=gunluk&irk=hmn"> Human Gunluk Siralama </a> | <a href="index.php?sayfa=gunluk&irk=krs"> Karus Gunluk Siralama </a>


    <br /><br />Hergun Saat 24:00'da resetlenir.<br />



    <?

    $irkg
    = $_GET['irk'];


    if (
    $irkg == '') {



    $irkgunluk = "ORTAK";





    }

    elseif (
    $irkg == 'hmn') {



    $irkgunluk = "HUMAN";

    $irks = "2";



    }

    elseif (
    $irkg == 'krs') {



    $irkgunluk = "KARUS";

    $irks = "1";



    }



    else {



    $irkgunluk = "ORTAK";



    }



    if (
    $irks == '') {



    /// ORTAK



    ?>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml">

    <head>

    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-9" />

    <title><? echo $titled; ?></title>

    <link href="../style.css" rel="stylesheet" type="text/css" />

    <link href="style.css" rel="stylesheet" type="text/css" />


    <style type="text/css">

    <!--

    .style1 {color: #000000}

    .style2 {color: #FFFFFF}

    .style3 {color: #FFFFFF; font-weight: bold; }

    -->

    </style>


    </head>


    <body background="../imgs/bg.jpg" topmargin="0" marginheight="0">

    <table width="520" border="0" cellpadding="0" cellspacing="0">

    <tr>

    <td height="24" align="left" >&nbsp;<img src="../imgs/arti.gif" width="9" height="9" />&nbsp;<strong><center>Gunluk NP Siralamasi - <? echo ($irkgunluk) ; ?></strong></td>

    </tr>

    <tr>

    <?

    function GNation($nation)

    {

    if (
    $nation == 1) {

    $nation = '<img src="../imgs/karus.gif">';

    } elseif (
    $nation == 2) {

    $nation = '<img src="../imgs/elmo.gif">';

    }


    return
    $nation;

    }

    ?>

    <td align="left" valign="top" background="../imgs/bg.png">


    <table width="520" border="0" cellpadding="0" cellspacing="0">


    <?




    $results
    =odbc_exec($conn,"SELECT TOP 50 strUserID, Level, Nation, Class, Knights, Loyalty, GunlukLoyalty strCharID FROM USERDATA ORDER BY GunlukLoyalty DESC, LEVEL DESC");

    $asd = 0;

    $tablo_1 = '

    <center> <tr>

    <td width="25" align="center" background="../imgs/menubg.gif" bgcolor="#FF9900"><b><font color="#ffffff">Sira</span></td>



    <td width="100" align="center" height="14" background="../imgs/menubg.gif" bgcolor="#FF9900"><b><font color="#ffffff">Karakter Ady </span></td>

    <td width="100" align="center" background="../imgs/menubg.gif" bgcolor="#FF9900"><b><font color="#ffffff">Level</span></td>







    <td width="100" align="center" background="../imgs/menubg.gif" bgcolor="#FF9900"><b><font color="#ffffff">National Point</span></td>

    <td width="100" align="center" background="../imgs/menubg.gif" bgcolor="#FF9900"><b><font color="#ffffff">Gunluk NP</span></td>

    </tr>

    '
    ;

    echo
    $tablo_1;

    while (
    odbc_fetch_row($results)) {

    $user = odbc_result($results,1);



    $np = odbc_result($results, 6);

    $aylik = odbc_result($results, 7);

    $level = odbc_result($results, 2);

    $clan = odbc_result($results, 5);

    $clannm = odbc_result($results, 5);

    $clanr=odbc_exec($conn,"SELECT IDName FROM KNIGHTS WHERE IDNum = '$clan'");

    $clan=odbc_result($clanr, 1);

    if (
    $clan == '') {

    $clan = 'Yok';

    }

    $sira++;


    ?>



    <?



    $tablo_2
    = '


    <tr class="textwhite">

    <td align="center"><font color="#990000">'
    .$sira.'</font></td>



    <td align="center"><a href="index.php?sayfa=userdetay&karakter='
    .$user.'"><font color="#990000">'.$user.'</a></td>

    <td align="center"><font color="#990000">'
    .$level.'</font></td>







    <td align="center"><font color="#990000">'
    .number_format($np).'</font></td>

    <td align="center"><font color="#990000">'
    .number_format($aylik).'</font></td>

    </tr>

    '
    ;

    echo
    $tablo_2;

    }


    ?>

    </table></td>

    </tr>

    </table>

    </body>

    </html>




    <? }





    else {
    ?>



    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml">

    <head>

    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-9" />

    <title><? echo $titled; ?></title>

    <link href="../style.css" rel="stylesheet" type="text/css" />

    <link href="style.css" rel="stylesheet" type="text/css" />


    <style type="text/css">

    <!--

    .style1 {color: #000000}

    .style2 {color: #FFFFFF}

    .style3 {color: #FFFFFF; font-weight: bold; }

    -->

    </style>


    </head>


    <body background="../imgs/bg.jpg" topmargin="0" marginheight="0">

    <table width="520" border="0" cellpadding="0" cellspacing="0">

    <tr>

    <td height="24" align="left" >&nbsp;<img src="../imgs/arti.gif" width="9" height="9" />&nbsp;<strong><center>Gunluk NP Siralamasi - <? echo ($irkgunluk) ; ?></strong></td>

    </tr>

    <tr>

    <?

    function GNation($nation)

    {

    if (
    $nation == 1) {

    $nation = '<img src="../imgs/karus.gif">';

    } elseif (
    $nation == 2) {

    $nation = '<img src="../imgs/elmo.gif">';

    }


    return
    $nation;

    }

    ?>

    <td align="left" valign="top" background="../imgs/bg.png">


    <table width="520" border="0" cellpadding="0" cellspacing="0">


    <?




    $results
    =odbc_exec($conn,"SELECT TOP 50 strUserID, Level, Nation, Class, Knights, Loyalty, GunlukLoyalty strCharID FROM USERDATA WHERE Nation = '".$irks."' ORDER BY GunlukLoyalty DESC, LEVEL DESC");

    $asd = 0;

    $tablo_1 = '

    <center> <tr>

    <td width="25" align="center" background="../imgs/menubg.gif" bgcolor="#FF9900"><b><font color="#ffffff">Sira</span></td>



    <td width="100" align="center" height="14" background="../imgs/menubg.gif" bgcolor="#FF9900"><b><font color="#ffffff">Karakter Ady </span></td>

    <td width="100" align="center" background="../imgs/menubg.gif" bgcolor="#FF9900"><b><font color="#ffffff">Level</span></td>







    <td width="100" align="center" background="../imgs/menubg.gif" bgcolor="#FF9900"><b><font color="#ffffff">National Point</span></td>

    <td width="100" align="center" background="../imgs/menubg.gif" bgcolor="#FF9900"><b><font color="#ffffff">Gunluk NP</span></td>

    </tr>

    '
    ;

    echo
    $tablo_1;

    while (
    odbc_fetch_row($results)) {

    $user = odbc_result($results,1);



    $np = odbc_result($results, 6);

    $aylik = odbc_result($results, 7);

    $level = odbc_result($results, 2);

    $clan = odbc_result($results, 5);

    $clannm = odbc_result($results, 5);

    $clanr=odbc_exec($conn,"SELECT IDName FROM KNIGHTS WHERE IDNum = '$clan'");

    $clan=odbc_result($clanr, 1);

    if (
    $clan == '') {

    $clan = 'Yok';

    }

    $sira++;


    ?>



    <?



    $tablo_2
    = '


    <tr class="textwhite">

    <td align="center"><font color="#990000">'
    .$sira.'</font></td>



    <td align="center"><a href="index.php?sayfa=userdetay&karakter='
    .$user.'"><font color="#990000">'.$user.'</a></td>

    <td align="center"><font color="#990000">'
    .$level.'</font></td>







    <td align="center"><font color="#990000">'
    .number_format($np).'</font></td>

    <td align="center"><font color="#990000">'
    .number_format($aylik).'</font></td>

    </tr>



    '
    ;

    echo
    $tablo_2;

    }


    ?>

    </table></td>

    </tr>

    </table>

    </body>

    </html>

    <?











    }


    }


    ?>

      Forum Saati Perş. Mayıs 02, 2024 11:40 am