Jump to content
×
×
  • Create New...
  • 0

Gilden Name & Char


BerkayAta

Question

15 answers to this question

Recommended Posts

  • 0

Is this some CMS? You could be more specific...

<div id="con-top">Charakter</div>
<div id="con-mid">
<?php
$char = mysql_real_escape_string($_GET['char']);
$sql = "SELECT * FROM player.player 
  LEFT JOIN player.player_index 
  ON player_index.id=player.account_id WHERE player.name = '".$char."'";
$ergebnis = mysql_query($sql,$sqlServ);
if (mysql_num_rows($ergebnis) == 0)
{
	echo '<p>Dieser Char existiert nicht!</p><br/><a href="index.php?s=ranking_chars">zur&uuml;ck</a>';
exit;
}
$row = mysql_fetch_assoc($ergebnis);
$lvl = $row['level'];
$skillgroup = $row['skill_group'];
$reich = $row['skill_group'];
$class = $row['job'];
$onlinemin = $row['playtime'];
$exp = $row['exp'];
$levelstep = $row['level_step'];
$name = $row['name'];
$empire = $row['empire'];

$gilde1 = "SELECT * FROM player.guild_member WHERE pid = '".$row['id']."'";
$gilde2 = mysql_query($gilde1,$sqlServ);
if (mysql_num_rows($gilde2) == 1)
{
	$gilde3 = mysql_fetch_assoc($gilde2);
	$gildeid = $gilde3['guild_id'];
	$gildenname1 = "SELECT name FROM player.guild WHERE id = '".$gildeid."'";
	$gildenname2 = mysql_query($gildenname1,$sqlServ);
	$gildenname3 = mysql_fetch_assoc($gildenname2);
	$gildenname = $gildenname3['name'];
}
	
echo "<div>
<table>
	<tr>
		<th class='topLine'>Name:</th>
		<td class='tdunkel'>".$name."</td>
	</tr>
	<tr>
		<th class='topLine'>Level:</th>
		<td class='tdunkel'>".$lvl."</td>
	</tr>
		<tr>
		<th class='topLine'>Reich:</th>
		<td class='tdunkel'>";
if($empire == "1") {
	echo '<img src="img/reiche/1.png" width="25" title="Rotes Reich">';
} elseif($empire == "2") {
	echo '<img src="img/reiche/2.png" width="25" title="Gelbes Reich">';
} else {
	echo '<img src="img/reiche/3.png" width="25" title="Blaues Reich">';
}
echo "</td>
	</tr>
<tr><th class='topLine'>Spielminuten:</th>
		<td class='tdunkel'>".$onlinemin."</td>
	</tr>
	<tr>
		<th class='topLine'>EXP:</th>
		<td class='tdunkel'>".$exp."</td>
	</tr>
	<tr>
		<th class='topLine'>Gilde:</th>";
if (isset($gildenname))
{
	echo "<td class='tdunkel'><a href='index.php?s=guild&guild=".$gildenname."' title='Zur Gilde'>".$gildenname."</a></td>";
}
else
{
	echo "<td class='tdunkel'>Keine Gilde</td>";
}
echo "</tr>
	<tr>
		<th class='topLine'>Geschlecht:</th>
		<td class='tdunkel'>";
if($class == "0" or $class == "2" or $class == "5" or $class == "7" and $class != "0")
{
	echo "M&auml;nnlich";
}
else
{
	echo "Weiblich";
}
echo "		</td>
	</tr>
	<tr>
		<th class='topLine'>Rasse/Lehre:</th>
		<td class='tdunkel'>";
if($class == "0" or $class == "4")
{
	if($skillgroup == "1" and $skillgroup !="0")
	{
		echo "K&ouml;rperkrieger ";
	}
	elseif($skillgroup == "2" and $skillgroup !="0")
	{
		echo "Mentalkrieger ";
	}
	elseif($skillgroup == "0")
	{
		echo "Krieger - Keine Lehre";
	}	
}
elseif($class == "1" or $class == "5")
{
	if($skillgroup == "1" and $skillgroup !="0")
	{
		echo "Nahkampfninja ";
	}
	elseif($skillgroup == "2" and $skillgroup !="0")
	{
		echo "Fernkampfninja ";
	}
	elseif($skillgroup == "0")
	{
		echo "Ninja - Keine Lehre";
	}
}
elseif($class == "2" or $class == "6")
{
	if($skillgroup == "1" and $skillgroup !="0")
	{
		echo "Waffensura ";
	}
	elseif($skillgroup == "2" and $skillgroup !="0")
	{
		echo "Magiesura ";
	}
	elseif($skillgroup == "0")
	{
		echo "Sura - Keine Lehre";
	}
}
elseif($class == "3" or $class == "7")
{
	if($skillgroup == "1" and $skillgroup !="0")
	{
		echo "Drachenschamane ";
	}
	elseif($skillgroup == "2" and $skillgroup !="0")
	{
		echo "Heilschamane ";
	}
	elseif($skillgroup == "0")
	{
		echo "Schamane - Keine Lehre";
	}
}
else
{
echo "garnix";
}
echo "
		</td>
	</tr>
</table>
</div>";
?>
<br/>
<a href="index.php?s=ranking_chars">zur&uuml;ck</a>
</div>
<div id="con-bot"></div>
Link to comment
Share on other sites

  • 0
  • Premium
$sql = "SELECT * FROM player.player
  LEFT JOIN player.player_index
  ON player_index.id=player.account_id WHERE player.name = '".$char."'";
 
$gilde1 = "SELECT * FROM player.guild_member WHERE pid = '".$row['id']."'";
 
id is ambiguous, replace the first line with:
 
$sql = "SELECT *,player.id as id FROM player.player
  LEFT JOIN player.player_index
  ON player_index.id=player.account_id WHERE player.name = '".$char."'";

 

  • Love 1

 

 

Link to comment
Share on other sites

  • 0

 

$sql = "SELECT * FROM player.player
  LEFT JOIN player.player_index
  ON player_index.id=player.account_id WHERE player.name = '".$char."'";
 
$gilde1 = "SELECT * FROM player.guild_member WHERE pid = '".$row['id']."'";
 
id is ambiguous, replace the first line with:
 
$sql = "SELECT *,player.id as id FROM player.player
  LEFT JOIN player.player_index
  ON player_index.id=player.account_id WHERE player.name = '".$char."'";

 

 

Thanks Shogun admin. I have one last problem. Can I continue this topic or Should I open a new thread ?

Link to comment
Share on other sites

  • 0

You can continue here if it's about this CMS as well, and please tell us the name so we can label the topic correctly for reference

 

BX274M.png

 

Guild can't write guild members.

<div id="con-top">Lonca Bilgileri</div>
<div id="con-mid">

<?php
$guild = mysql_real_escape_string($_GET['guild']);
$sql = "SELECT * FROM player.guild WHERE name = '".$guild."'";
$ergebnis = mysql_query($sql,$sqlServ);
if (mysql_num_rows($ergebnis) == 0)
{
	echo '<br /><p>Lonca Yok</p><br/><a href="index.php?s=ranking_gilden">Bir önceki sayfaya git</a></div><div id="con-bot"></div>';
	exit;
}
$row = mysql_fetch_assoc($ergebnis);
$level = $row['level'];
$punkte = $row['ladder_point'];
$leader = $row['master'];
$name = $row['name'];
$exp = $row['exp'];
$win = $row['win'];
$draw = $row['draw'];
$loss = $row['loss'];
$name = $row['name'];

$reich1 = "SELECT * FROM player.player_index WHERE pid1 = '".$leader."' or pid2 = '".$leader."' or pid3 = '".$leader."' or pid4 = '".$leader."'";
$reich2 = mysql_query($reich1,$sqlServ);
$reich3 = mysql_fetch_assoc($reich2);
$empire = $reich3['empire'];

$member1 = "SELECT * FROM player.guild_member WHERE guild_id = '".$id."'";
$member2 = mysql_query($member1,$sqlServ);
$member3 = mysql_fetch_assoc($member2);

echo "<table>
	<tr>
		<th class='topLine'>Lonca Adı :</th>
		<td class='tdunkel'>".$name."</td>
	</tr>
	<tr>
		<th class='topLine'>Level :</th>
		<td class='tdunkel'>".$level."</td>
	</tr>
	<tr>
		<th class='topLine'>Sıra :</th>
		<td class='tdunkel'>".$punkte."</td>
	</tr>
	<tr>
		<th class='topLine'>Bayrak :</th>
		<td class='tdunkel'>";
if($empire == "1") {
	echo '<img src="img/reiche/1.png" title="Kırmızı Bayrak" alt="Kırmızı Bayrak"/>';
} elseif($empire == "2") {
	echo '<img src="img/reiche/2.png" title="Sarı Bayrak" alt="Sarı Bayrak"/>';
} else {
	echo '<img src="img/reiche/3.png" title="Mavi Bayrak" alt="Mavi Bayrak"/>';
}
echo "</td>
	</tr>
	<tr>
		<th class='topLine'>Exp :</th>
		<td class='tdunkel'>".$exp."</td>
	</tr>
	<tr>
		<th class='topLine'>Kazanılan :</th>
		<td class='tdunkel'>".$win."</td>
	</tr>
	<tr>
		<th class='topLine'>Beraberlik :</th>
		<td class='tdunkel'>".$draw."</td>
	</tr>
	<tr>
		<th class='topLine'>Kaybedilen :</th>
		<td class='tdunkel'>".$loss."</td>
	</tr>
	<tr>
		<th class='topLine'>Lonca Başkanı :</th>
		<td class='tdunkel'><a href='index.php?s=char&char=".charname($leader)."' title='Detay'>".charname($leader)."</a></td>
	</tr>
	<tr>
		<th class='topLine'>Lonca Üyeleri :</th>
		<td class='tdunkel'>";
while($member3 = mysql_fetch_assoc($member2))
{
	$member = $member3['pid'];
	echo "<a href='index.php?s=char&char=".charname($member)."' title='Detay'>".charname($member)."</a><br>";
}

echo "</td></tr></table>";
?>
<br/>

<a href="index.php?s=ranking_gilden">Bir önceki sayfaya git</a>
</div>
<div id="con-bot"></div>
Link to comment
Share on other sites

  • 0

Add in line 23:

 

$id = $row['id'];

 

Thanks. It's work :) I found a problem with ranking_gilden.

 

b8b76n.png

<?PHP
  $CPSeite = 25;
  $markierteZeile=0;
  if(isset($_GET['p'])) {
    if(!checkInt($_GET['p']) || !($_GET['p']>0)) $aSeite = 1;
    else $aSeite = $_GET['p'];
  }
  else { $aSeite = 1; }
  
  if(isset($_POST['Arama']) && $_POST['Arama']=='Arama') {
    if(!empty($_POST['gilde'])) {
      $sqlCmd="SELECT id,name,master,level,exp,ladder_point, rang
      FROM (
      
        SELECT id,name,master,level,exp,ladder_point, @num := @num +1 AS rang
        FROM (
        
          SELECT id,name,master,level,exp,ladder_point, @num :=0
          FROM player.guild
          ORDER BY level DESC, exp DESC, win DESC, ladder_point DESC
          
        ) AS t1
        
      ) AS t2
       
      WHERE name = '".mysql_real_escape_string($_POST['gilde'])."' LIMIT 1";
      $sqlQry=mysql_query($sqlCmd,$sqlServ);
      if(mysql_num_rows($sqlQry)>0) {
      
        $getRang = mysql_fetch_object($sqlQry);
        $aSeite = ceil($getRang->rang/$CPSeite);
        $markierteZeile = $getRang->rang;
      }
      
    }
    
  }
  
  $sqlCmd = "SELECT COUNT(*) as summeChars  
  FROM player.guild 
  ORDER BY level DESC, exp DESC, win DESC, ladder_point DESC";
  
  $sqlQry = mysql_query($sqlCmd,$sqlServ);
  
  $getSum = mysql_fetch_object($sqlQry);
  $cSeite = calcPages($getSum->summeChars,$aSeite,$CPSeite);
  
?>
<div id="con-top">Lonca Sıralaması</div>
<div id="con-mid">
<div class="center">

<form name="form">
<select name="link" SIZE="1" onChange="window.location.href = document.form.link.options[document.form.link.selectedIndex].value;">
<option selected value="#">Lonca Sıralaması</option>
<option value="?s=ranking_chars">Karakter Sıralaması</option>
</select>
</form>

<br/>
<form action="?s=ranking_gilden" method="POST">
      <b>Arama :</b>
      <input type="text" name="gilde" maxlength="20" size="20"  class="txt"/>
      <input type="submit" name="Arama" value="Arama" maxlength="20" size="20" class="button"/>
</form>
</div>

<table>
<tr>
  <th class="topLine">Sıra</th>
  <th class="topLine">Ad</th>
  <th class="topLine">Başkan</th>
  <th class="topLine">Level</th>
  <th class="topLine">Exp</th>
  <th class="topLine">Puan</th>
</tr>
<?PHP
  $sqlCmd = "SELECT id,name,master,level,exp,ladder_point 
  FROM player.guild 
  ORDER BY level DESC, exp DESC, win DESC, ladder_point DESC 
  LIMIT ".$cSeite[1].",".$CPSeite;
  $sqlQry = mysql_query($sqlCmd,$sqlServ);
  $x=$cSeite[1]+1;
  while($getPlayers = mysql_fetch_object($sqlQry)) {
    $zF = ($x%2==0) ? "thell" : "tdunkel";
    if(checkInt($markierteZeile) && $markierteZeile==$x) { $zF = "tmarkiert"; }
    echo "<tr>";
    echo "<td class="$zF">".$x."</td>";
    echo "<td class="$zF"><a href='index.php?s=guild&guild=".$getPlayers->name."'>".$getPlayers->name."</a></td>";
    echo "<td class="$zF"><a href='index.php?s=char&char=".charname($getPlayers->master)."'>".charname($getPlayers->master)."</a></td>";
    echo "<td class="$zF">".$getPlayers->level."</td>";
    echo "<td class="$zF">".$getPlayers->exp."</td>";
	echo "<td class="$zF">".$getPlayers->ladder_point."</td>";
    echo "</tr>";
    
    $x++;
    
  }
?>
</table>
<div class="center">
<?PHP
  $maxRange = 4;
  $maxStep = 15;
  $totalpages = ceil($numrows/$CPSeite);
  if(($aSeite-$maxRange)>0) $sStart = $aSeite-$maxRange;
  else $sStart = 1;
  if(($aSeite+$maxRange)<=$cSeite[0]) $sEnde = $aSeite+$maxRange;
  else $sEnde = $cSeite[0];
  
  if(($aSeite)>1) echo '<span class="ranking2"><a href="index.php?s=ranking_gilden&p=1">İlk</a></span> &laquo; ';
  
  
  for($i=$sStart;$i<=$sEnde;$i++) {
    $sKlasse = ($i==$aSeite) ? "ranking1" : "ranking2";
    echo'<span class="'.$sKlasse.'">';
    echo'<a href="index.php?s=ranking_gilden&p='.$i.'">'.$i.'</a></span>';
  }
  
  if(($aSeite+$maxStep)<=$cSeite[0]) echo ' &raquo; <span class="ranking2"><a href="index.php?s=ranking_gilden&p='.$totalpages.'">Son</span></a>';
?>
</div>
</div>
<div id="con-bot"></div>
Link to comment
Share on other sites

  • 0

Line 105

 

Replace

 

$totalpages = ceil($numrows/$CPSeite);

 

With

 

$totalpages = ceil(mysql_num_rows($sqlQry)/$CPSeite);

 

Thanks. It's work but Last (Son) button is don't work :( Shogun ?

 

djbAgV.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.