Konu Yazar
- Ağu
- 20
- 0
1. Hata// warring: fclose(): supplied argument is not a valid stream resource in c:\appserv\www\function.php on line 446
Function.php dosyası
1. Hata ise // Warning: Wrong parameter count for odbc_result() in C:\AppServ\www\sayfa\Online.php on line 17
Bu da Online.php dosyası
Şimdiden Teşekkür ederim...
Function.php dosyası
Kod:
<?php //K2D
################### Resim Upload #########################
// Türkçe karakterli dosyalar için yazdýðým fonksiyon
function ptRU($kaynak) {
$girdi = array('A','B','C','Ç','D','E','F','G','Ð','H','I','Ý','J','K','L','M','N','O','Ö','P','R','S','Þ','T','U','Ü','V','Y','Z','ç','ð','ý','ö','þ','ü',' ','_',);
$cikti = array('a','b','c','c','d','e','f','g','g','h','i','i','j','k','l','m','n','o','o','p','r','s','s','t','u','u','v','y','z','c','g','i','j','þ','u','-','-',);
$sonuc = str_replace($girdi,$cikti,$kaynak);
return $sonuc;
}
// Uzantý tespit fonksiyonum
function ptUzanti($dosyaismi) {
$degerler = explode('.',$dosyaismi);
$sonnokta = count($degerler)-1;
$uzanti = $degerler[$sonnokta];
return $uzanti;
}
################### SIKAYET SAYISI #########################
$sikayet = odbc_exec($conn,"select count(id) from _sikayet");
$sikayetsay = odbc_result($sikayet,1);
################### LINK #########################
$link = odbc_exec($conn,"select count(id) from _link");
$linksay = odbc_result($link,1);
################### HABER #########################
$haber = odbc_exec($conn,"select count(id) from _haber");
$habersay = odbc_result($haber,1);
################### Aktivite #########################
$aktivite = odbc_exec($conn,"select count(id) from _aktivite");
$aktivitesay = odbc_result($aktivite,1);
################### TÝCKET #########################
$ticket = odbc_exec($conn,"select count(id) from _ticket");
$ticketsay = odbc_result($ticket,1);
################### ANKET #########################
$anket = odbc_exec($conn,"select count(anket_id) from _anket");
$anketsay = odbc_result($anket,1);
################### GAME MASTER #########################
$gm = odbc_exec($conn,"select count(struserid) from userdata where authority = '0'");
$gmsay = odbc_result($gm,1);
################### Zones #########################
FUNCTION getZones($zone) {
if ($zone == 21) {
$zone = "Moradon";
} elseif ($zone == 1) {
$zone = "Luferson Castle";
} elseif ($zone == 201) {
$zone = "Colony Zone";
} elseif($zone==31) {
$zone = "Bifrost";
} elseif ($zone == 202) {
$zone = "Ronark Land";
} elseif ($zone == 103) {
$zone = "Lunar War";
} elseif ($zone == 2) {
$zone = "El Morad Castle";
} elseif ($zone == 300) {
$zone = "Delos";
} elseif ($zone == 480) {
$zone = "Arena";
} elseif ($zone == 101) {
$zone = "Dark Lunar";
} elseif ($zone == 11) {
$zone = "Karus Eslant";
} elseif ($zone == 12) {
$zone = "El Morad Eslant";
}
return $zone;
}
################### TARÝH #########################
$trh = substr($trhh,0,10);
$yil = substr($trh,0,4);
$bul = substr($trh,5,8);
$gün = substr($bul,3,4);
$ay = substr($bul,0,2);
$ay = getAy($ay);
$tarih = ($gün.' '.$ay.' '.$yil);
################### AYLAR #########################
FUNCTION getAy($ay) {
if($ay == '01'){
$ay = 'Ocak';
}elseif($ay == '02'){
$ay = 'Þubat';
}elseif($ay == '03'){
$ay = 'Mart';
}elseif($ay == '04'){
$ay = 'Nisan';
}elseif($ay == '05'){
$ay = 'Mayýs';
}elseif($ay == '06'){
$ay = 'Haziran';
}elseif($ay == '07'){
$ay = 'Temmuz';
}elseif($ay == '08'){
$ay = 'Aðustos';
}elseif($ay == '09'){
$ay = 'Eylül';
}elseif($ay == '10'){
$ay = 'Ekim';
}elseif($ay == '11'){
$ay = 'Kasým';
}elseif($ay == '12'){
$ay = 'Aralýk';
}
return $ay;
}
################### Authority #########################
FUNCTION getAuthority($auth) {
if ($auth == '0') {
$auth = '<font color="red">Game Master</font>';
}
elseif ($auth == '255') {
$auth = '<font color="yellow">Oynama Yasaklý</font>';
}
elseif($aut == '2') {
$auth = '<font color="yellow">Konuþma Yasaklý</font>';
} else {
$auth = '<font color="green">Oyuncu</font>';
}
return $auth;
}
################### Gelen Mailler #########################
$gelen = odbc_exec($conn,"select count(gonderilen) from _mail where gonderilen = '".$_SESSION['k2duser']."' and okundu='0'");
$gelenler = odbc_result($gelen,1);
if($gelenler == 0) { $gelenler = '';}else{$gelenler = '('.$gelenler.')';}
################### Gonderilen Mailler #########################
$giden = odbc_exec($conn,"select count(gonderen) from _mail where gonderen = '".$_SESSION['k2duser']."'");
$gidenler = odbc_result($giden,1);
if($gidenler == 0){ $gidenler = ''; }else{$gidenler = '('.$gidenler.')';}
################### Castle Siege War #########################
FUNCTION getWar($warday) {
if ($warday == '1') {
$warday = 'Pazar';
} elseif ($warday == '2') {
$warday = 'Pazartesi';
} elseif ($warday == '3') {
$warday = 'Sali';
} elseif ($warday == '4') {
$warday = 'Çarsamba';
} elseif ($warday == '5') {
$warday = 'Persembe';
} elseif ($warday == '6') {
$warday = 'Cuma';
} elseif ($warday == '7') {
$warday = 'Cumartesi';
}
return $warday;
}
################### Clan Nation Resmi #########################
FUNCTION Nation($nation)
{
if ($nation == '1') {
$nation = '<script>put_flash("swf/karus.swf", 120, 65);</script>';
} elseif ($nation == '2') {
$nation = '<script>put_flash("swf/elmorad.swf", 120, 65);</script>';
}
return $nation;
}
################### Nation Resim #########################
// Nation Resim
function getNation($nation2)
{
if ($nation2 == 1) {
$nation2 = '<img src="resim/diger/karus.gif" alt="" />';
} elseif ($nation2 == 2) {
$nation2 = '<img src="resim/diger/elmo.gif" alt="" />';
}
return $nation2;
}
################### Nation Ýsim #########################
function getIrk($nation2)
{
if ($nation2 == 1) {
$nation2 = 'Karus';
} elseif ($nation2 == 2) {
$nation2 = 'El Morad';
}
return $nation2;
}
################### Class #########################
function getClass($class) {
if ($class == 105 or $class==101) {
$class = "Warrior";
}
if ($class == 106) {
$class = "Berserker Hero";
}
if ($class == 107 or $class == 102) {
$class = "Rogue";
}
if ($class == 108) {
$class = "Shadow Vain";
}
if ($class == 109 or $class==103) {
$class = "Mage";
}
if ($class == 110) {
$class = "Elemental Lord";
}
if ($class == 111 or $class==104) {
$class = "Priest";
}
if ($class == 112) {
$class = "Shadow Knight";
}
if ($class == 205 or $class==201) {
$class = "Warrior";
}
if ($class == 206) {
$class = "Blade Master";
}
if ($class == 207 or $class==202) {
$class = "Rogue";
}
if ($class == 208) {
$class = "Kasar Hood";
}
if ($class == 209 or $class==203) {
$class = "Mage";
}
if ($class == 210) {
$class = "Arch Mage";
}
if ($class == 211 or $class==204) {
$class = "Priest";
}
if ($class == 212) {
$class = "Paladin";
}
return $class;
}
################### Class Change #########################
function Class_ch($class) {
if ($class == 105 or $class==101) {
$class = "Warrior";
}
if ($class == 106) {
$class = "Warrior";
}
if ($class == 107 or $class == 102) {
$class = "Rogue";
}
if ($class == 108) {
$class = "Rogue";
}
if ($class == 109 or $class==103) {
$class = "Mage";
}
if ($class == 110) {
$class = "Mage";
}
if ($class == 111 or $class==104) {
$class = "Priest";
}
if ($class == 112) {
$class = "Priest";
}
if ($class == 205 or $class==201) {
$class = "Warrior";
}
if ($class == 206) {
$class = "Warrior";
}
if ($class == 207 or $class==202) {
$class = "Rogue";
}
if ($class == 208) {
$class = "Rogue";
}
if ($class == 209 or $class==203) {
$class = "Mage";
}
if ($class == 210) {
$class = "Mage";
}
if ($class == 211 or $class==204) {
$class = "Priest";
}
if ($class == 212) {
$class = "Priest";
}
return $class;
}
################### RACE #########################
function getTip($race) {
if ($race == '1') {
$race = "Karus Barbar Warrior";
}
if ($race == '2') {
$race = "Karus Erkek";
}
if ($race == '3') {
$race = "Karus Cüce Mage";
}
if ($race == '4') {
$race = "Karus Kýz";
}
if ($race == '11') {
$race = "Barbar Warrior";
}
if ($race == '12') {
$race = "Human Erkek";
}
if ($race == '13') {
$race = "Human Kýz";
}
return $race;
}
function kral($kral){
if($kral == '') {
$kral = 'Seçilmemiþ';
}
return $kral;
}
################### SERVER DURUM #########################
$topchar = odbc_exec($conn, "SELECT COUNT(*) FROM USERDATA");
$ktopchar = $ex($conn,"select count(*) from userdata where nation='1'");
$htopchar = $ex($conn,"select count(*) from userdata where nation='1'");
$topacc = odbc_exec($conn, "SELECT COUNT(*) FROM TB_USER");
$ktopacc = odbc_exec($conn, "SELECT COUNT(*) FROM Account_char where bnation='1'");
$htopacc = odbc_exec($conn, "SELECT COUNT(*) FROM Account_char where bnation='2'");
$onacc = odbc_exec($conn, "SELECT COUNT(*) FROM CURRENTUSER");
$topclan = $ex($conn,"select count(*) from knights");
$humankral = odbc_exec($conn,"select strKingName from KING_SYSTEM where byNation = '2'");
$karuskral = odbc_exec($conn,"select strKingName from KING_SYSTEM where byNation = '1'");
$karus_kral = odbc_result($karuskral,1);
$human_kral = odbc_result($humankral,1);
$deloss = odbc_exec($conn,"select sMasterKnights from KNIGHTS_SIEGE_WARFARE where sCastleIndex = '1'");
$delosss = odbc_result($deloss,1);
$delossahibi = odbc_exec($conn,"select IDName from KNIGHTS where IDNum = '".$delosss."'");
$dls = odbc_result($delossahibi,1);
$top_char = odbc_result($topchar, 1);
$top_acc = odbc_result($topacc, 1);
$top_on = odbc_result($onacc, 1);
$acc_karus = $re($ktopacc,1);
$acc_human = $re($htopacc,1);
$top_clan = $re($topclan,1);
$top_karus = $re($ktopchar,1);
$top_human = $re($htopchar,1);
if($delosss == ''){
$delos = 'Belirli Deðil';
}else{
$delos = '<a href="index.php?sayfa=siralama&islem=c_detay&sid='.$delosss.'">'.$dls.'</a>';
}
//CSW
$kode = odbc_exec($conn, "SELECT byWarDay, byWarTime, byWarMinute FROM KNIGHTS_SIEGE_WARFARE");
//RESULT
while (odbc_fetch_row($kode)) {
$warday = odbc_result($kode,1);
$warday = getWar($warday);
$wartime = odbc_result($kode,2);
$warmin = odbc_result($kode,3);
}
$ip_ad = "127.0.0.1";
if ($fp=@fsockopen($ip_ad,15100, $ERROR_NO, $ERROR_STR,(float)0.5))
{
fclose($fp);
$login = '<img src = "resim/diger/online.gif">';
}
else
{
$login = '<img src = "resim/diger/offline.gif">';
}
if ($fp2=@fsockopen($ip_ad,15001, $ERROR_NO, $ERROR_STR,(float)0.5))
{
fclose($fp2);
$game = '<img src = "resim/diger/online.gif">';
}
else
{
$game = '<img src = "resim/diger/offline.gif">';
}
if ($fp3=@fsockopen($ip_ad,80, $ERROR_NO, $ERROR_STR,(float)0.5))
{
fclose($fp3);
$web = '<img src = "resim/diger/online.gif">';
}
else
{
$web = '<img src = "resim/diger/offline.gif">';
}
if ($fp4=@fsockopen($ip_ad,21, $ERROR_NO, $ERROR_STR,(float)0.5))
{
fclose($fp2);
$ftp = "<img src=resim/diger/online.gif>";
}
else
{
$ftp = "<img src=resim/diger/offline.gif>";
}
?>
1. Hata ise // Warning: Wrong parameter count for odbc_result() in C:\AppServ\www\sayfa\Online.php on line 17
Bu da Online.php dosyası
Kod:
<?
$count = 0;
$k2d=$ex($conn,"SELECT TOP ".$online." strCharID FROM CURRENTUSER");
if($islem == '')
$partingen1 = '
<table align="center" width="100%" border="0" bordercolor="cecece" cellpadding="1">
<td align="center"><img src = "https://www.ko-cuce.net/images/swf/sira.gif"></td>
<td align="center"><img src = "https://www.ko-cuce.net/images/swf/karakter.gif"></td>
<td align="center"><img src = "https://www.ko-cuce.net/images/swf/level.gif"></td>
<td align="center"><img src = "https://www.ko-cuce.net/images/swf/irk.gif"></td>
<td align="center"><img src = "https://www.ko-cuce.net/images/swf/clan.gif"></td>
<td align="center"><img src = "https://www.ko-cuce.net/images/swf/n-point.gif"></td>
<td align="center"><img src = "https://www.ko-cuce.net/images/swf/durum.gif"></td>
</tr>
';
echo $partingen1;
while (odbc_result($results)) {
// Data
$user = odbc_result($results, 1);
$info=odbc_exec($msconnect,"SELECT Level, Nation, Class, Knights, Loyalty FROM USERDATA WHERE strUserId = '".$user."'");
$lvl=odbc_result($info, 1);
$nation = getNation(odbc_result($info, 2));
$class = odbc_result($info,3);
$class = getClass($class);
$clan = odbc_result($info, 4);
$clanr=odbc_exec($msconnect,"SELECT IDNum, IDName FROM KNIGHTS WHERE IDNum = '$clan'");
$clanid=odbc_result($clanr, 1);
$clan=odbc_result($clanr, 2);
if ($clan == '') {
$clan=odbc_result($clanr, 1);
if ($clan == '') {
$clan = '<span><script>put_flash("swf/clanyok", 10, 9);</script></span></span>';
}else{
}
}
$np = odbc_result($info, 5);
$count++ ;
$k2d = odbc_exec($conn,"select count(*) from CURRENTUSER where strCharID='".$user."'");
$drmm = odbc_result($k2d,1);
if($drmm == 1) {$drm = '<font color="#006600">Online</font>'; }
else{$drm = '<font color="#FFFF00">Offline</font>'; }
echo '
<tr>
<td width="1%" align="center">'.$count.'</td>
<td align="center"><a href="index2.php?k2d=kullanici&islem=detay&user='.$user.'"title='.$user.'>'.$user.'</a></td>
<td width="1%" align="center">'.$lvl.'</td>
<td width="1%" align="center">'.$nation.'</td>
<td align="center"><a href="index2.php?k2d=clansira&islem=detay&sid='.$clanid.'"title="'.$lider.'">'.$clan.'</a></td>
<td align="center">'.$np.'</td>
<td align="center">'.$drm.'</td>
</tr>
';}
$partingen2 = '
<table align="center" width="100%" border="0" bordercolor="cecece" cellpadding="1">
<tr>
</tr>
</table>';
echo $partingen2;
?>
Şimdiden Teşekkür ederim...
Son düzenleme: