Cum schimb din MD in YANG QUEST/PHP

Totalitatea subiectelor care nu respectă regulamentul impus in sectiunea "Probleme şi Întrebări" vor fi stocate aici.
Închis
Avatar utilizator
rawn3cr0
Nivel 2

Nivel 2
Mesaje: 226
Membru din: 08 Iul 2014, 01:26
Aprecieri: 149  
Mulţumiri: 6  
  Rezolvări prob.: 1
Medalii

Vreau sa fac un fel de shop offline php.
Am urmatorul quest/php , si vreau ca in loc de MD (coins) sa foloseasca yang (gold).

**Ex: Pun itemul in casuta asta >Imagine > se creeaza in baza > Imagine , dar am nevoie ca acel script PHP sa-mi citeasca in loc de COINS > GOLD (yang) Imagine

Cod: Selectaţi tot

<h2>Auction</h2>
<?php
if(isset($_SESSION['user_admin']) && checkInt($_SESSION['user_admin']) && $_SESSION['user_admin'] >= 0)
{
?>
<p><a href="?s=aukcia">Browse Auction</a> &bull; <a href="?s=aukcia_pridat">Add Item</a> &bull; <a href="?s=aukcia_moje">List Your Offers</a></p>
<!--<p>Zoznam itemov v aukcii.</p>-->
<?php
		if($_GET["id"] and $_GET["vnum"])
		{
			$kontrola = mysql_query("SELECT * FROM ".SQL_HP_DB.".auction_system WHERE id='".mysql_real_escape_string($_GET['id'])."' AND vnum='".mysql_real_escape_string($_GET['vnum'])."'");
			if(mysql_num_rows($kontrola) >= 1)
			{
				$sqlItem = "SELECT * FROM ".SQL_HP_DB.".auction_system WHERE id='".mysql_real_escape_string($_GET['id'])."' AND vnum='".mysql_real_escape_string($_GET['vnum'])."'";
				$sqlQry = mysql_query($sqlItem);
?>
				<table>
						<tr>
						  <th class="topLine">Name</th>
						  <th class="topLine">Owner</th>  
						  <th class="topLine">Price</th>
						  <th class="topLine">Action</th>
						</tr>
						<?PHP
						$x=0;
						while($getItems=mysql_fetch_object($sqlQry)) {
							$zF=($x%2==0) ? "tdunkel" : "thell";
							$getName = compareItems($getItems->vnum);
							$owner_id = mysql_real_escape_string($getItems->owner_id);
							$test10 = mysql_query("SELECT name FROM player.player WHERE account_id='".mysql_real_escape_string($owner_id)."'");
							$fetch10 = mysql_fetch_object($test10);
							echo'<tr>';
									echo'<td class="'.$zF.'">'.mysql_real_escape_string($getName['item']).'</td>
									<td class="'.$zF.'">'.mysql_real_escape_string($fetch10->name).'</td>
									<td class="'.$zF.'"><b><font color="green">'.mysql_real_escape_string($getItems->cena).'</font></b> coins</td>
									<td class="'.$zF.'" width="50">';
									if($_SESSION['user_coins'] >= $getItems->cena)
									{
										echo'<center><a href="?s=aukcia_kupit&id='.mysql_real_escape_string($getItems->id).'&vnum='.mysql_real_escape_string($getItems->vnum).'">
										<img src="img/buy0.png" onmouseover="javascript:this.src=\'img/buy1.png\'" onmouseout="javascript:this.src=\'img/buy0.png\'" title="Kúpiť">
										</a>';
									}
									else
									{
										echo'You do not have enough coins.';
									}
									echo'</td>
								</tr>';
							$x++;
						}
				echo'</table>';
				$sqlCmd = "SELECT * FROM ".SQL_HP_DB.".auction_system WHERE id='".mysql_real_escape_string($_GET['id'])."' AND vnum='".mysql_real_escape_string($_GET['vnum'])."'";
				$sqlQry = mysql_query($sqlCmd,$sqlServ);
				
				echo"<table class=\"itemlist\">\n<tr>\n";
				echo"<th class=\"topLine\">ID</th>\n";
				echo"<th class=\"topLine\">Item name</th>\n";
				echo"<th class=\"topLine\">Count</th>";
				echo"<th class=\"topLine\">Stones</th>\n";
				echo"<th class=\"topLine\">Bonuses</th>\n</tr>\n";  
				$x=0;
				while($getItems=mysql_fetch_object($sqlQry)) {
				  if(($x%2)==0) 
				  { 
					$zF="tdunkel"; 
				  }
				  else 
				  { 
					$zF="tdunkel"; 
				  }
			  
				  $getName = compareItems($getItems->vnum);
				  echo'<tr>';
				  echo'<td class="'.$zF.'">'.mysql_real_escape_string($getItems->id).'</td>';
				  echo'<td class="'.$zF.'">'.mysql_real_escape_string($getName['item']).'</td>';
				  echo'<td class="'.$zF.'">'.mysql_real_escape_string($getItems->count).'</td>';
				  
				  echo'<td class="'.$zF.'">';
				  for($i=0;$i<6;$i++) {
					if($i==0) { $akSocket = $getItems->socket0; }
					if($i==1) { $akSocket = $getItems->socket1; }
					if($i==2) { $akSocket = $getItems->socket2; }
					if($i==3) { $akSocket = $getItems->socket3; }
					if($i==4) { $akSocket = $getItems->socket4; }
					if($i==5) { $akSocket = $getItems->socket5; }
					echo'#'.($i+1).'&nbsp;';
					if(isset($itemSteine[$akSocket])) {
					  echo $itemSteine[$akSocket];
					}
					else {
					  echo $akSocket;
					}
					echo'<br/>';
				  
				  }
				  echo'</td>';
				  echo'<td class="'.$zF.'">';
				  for($i=0;$i<7;$i++) {
					if($i==0) { $akBoni = $getItems->attrtype0; $akWert = $getItems->attrvalue0; }
					if($i==1) { $akBoni = $getItems->attrtype1; $akWert = $getItems->attrvalue1; }
					if($i==2) { $akBoni = $getItems->attrtype2; $akWert = $getItems->attrvalue2; }
					if($i==3) { $akBoni = $getItems->attrtype3; $akWert = $getItems->attrvalue3; }
					if($i==4) { $akBoni = $getItems->attrtype4; $akWert = $getItems->attrvalue4; }
					if($i==5) { $akBoni = $getItems->attrtype5; $akWert = $getItems->attrvalue5; }
					if($i==6) { $akBoni = $getItems->attrtype6; $akWert = $getItems->attrvalue6; }
					echo'#'.($i+1).'&nbsp;';
					if(isset($itemBoni[$akBoni])) {
					  echo $itemBoni[$akBoni];
					}
					else {
					  echo $akBoni;
					}
					echo':&nbsp;'.$akWert;
					echo'<br/>';
				  
				  }
				  echo'</td>';
				  echo'</tr>';
				  $x++;
				}
				echo'</table>';
				echo'<p><a href="?s=aukcia">Back</a>';
			}
			else
			{
				echo'<p>This ID does not exist.</p>';
			}
		}
		else
		{
		$sqlItem = mysql_query("SELECT * FROM ".SQL_HP_DB.".auction_system");
		if(mysql_num_rows($sqlItem) >= 1)
		{
			echo'<table>
						<tr>
						  <th class="topLine">Name</th>
						  <th class="topLine">Owner</th>
						  <th class="topLine">Price</th>
						 <!-- <th class="topLine">ID Majiteľa</th> -->
						  <th class="topLine">Action</th>
						</tr>';
						$x=0;
						while($aukcia=mysql_fetch_object($sqlItem))
						{
							$owner_id = mysql_real_escape_string($aukcia->owner_id);
							$test10 = mysql_query("SELECT name FROM player.player WHERE account_id='".mysql_real_escape_string($owner_id)."'");
							$fetch10 = mysql_fetch_object($test10);
							$getName = compareItems($aukcia->vnum);
							$zF=($x%2==0) ? "tdunkel" : "thell";
							echo'<tr>
									<td class="'.$zF.'">'.mysql_real_escape_string($getName['item']).'</td>
									<td class="'.$zF.'">'.mysql_real_escape_string($fetch10->name).'</td>
									<td class="'.$zF.'"><b><font color="green">'.mysql_real_escape_string($aukcia->cena).' </font></b>Coins</td>
								<!--	<td class="'.$zF.'">'.mysql_real_escape_string($aukcia->owner_id).'</td> -->
									<td class="'.$zF.'">';
										echo'<center><a href="?s=aukcia&id='.mysql_real_escape_string($aukcia->id).'&vnum='.mysql_real_escape_string($aukcia->vnum).'">More Info</a></center>';
									echo'</td>
								</tr>';
							$x++;
						}
				echo'</table>';
			}
			else
			{
				echo'<br><p>The auctions are currently no items.</p>';
			}
		}
}
else
{
	echo'<p class="meldung">You must be logged in for this area.</p>';
}
?>
Avatar utilizator
rawn3cr0
Nivel 2

Nivel 2
Mesaje: 226
Membru din: 08 Iul 2014, 01:26
Aprecieri: 149  
Mulţumiri: 6  
  Rezolvări prob.: 1
Medalii

Up!
Avatar utilizator
Jnebun
Nivel 1

Nivel 1
Mesaje: 113
Membru din: 15 Oct 2015, 15:57
Aprecieri: 0
Mulţumiri: 19  
Medalii

Uite aicea , dar php-ul asta nu are "update" cea ce inseamna ca nu modifica yangul dupe ce ai cumparat ceva,mai trebuie sa fie inca un fisier.

Cod: Selectaţi tot

<h2>Auction</h2>
<?php
if(isset($_SESSION['user_admin']) && checkInt($_SESSION['user_admin']) && $_SESSION['user_admin'] >= 0)
{
?>
<p><a href="?s=aukcia">Browse Auction</a> &bull; <a href="?s=aukcia_pridat">Add Item</a> &bull; <a href="?s=aukcia_moje">List Your Offers</a></p>
<!--<p>Zoznam itemov v aukcii.</p>-->
<?php
      if($_GET["id"] and $_GET["vnum"])
      {
         $kontrola = mysql_query("SELECT * FROM ".SQL_HP_DB.".auction_system WHERE id='".mysql_real_escape_string($_GET['id'])."' AND vnum='".mysql_real_escape_string($_GET['vnum'])."'");
         if(mysql_num_rows($kontrola) >= 1)
         {
            $sqlItem = "SELECT * FROM ".SQL_HP_DB.".auction_system WHERE id='".mysql_real_escape_string($_GET['id'])."' AND vnum='".mysql_real_escape_string($_GET['vnum'])."'";
            $sqlQry = mysql_query($sqlItem);
?>
            <table>
                  <tr>
                    <th class="topLine">Name</th>
                    <th class="topLine">Owner</th>  
                    <th class="topLine">Price</th>
                    <th class="topLine">Action</th>
                  </tr>
                  <?PHP
                  $x=0;
                  while($getItems=mysql_fetch_object($sqlQry)) {
                     $zF=($x%2==0) ? "tdunkel" : "thell";
                     $getName = compareItems($getItems->vnum);
                     $owner_id = mysql_real_escape_string($getItems->owner_id);
                     $test10 = mysql_query("SELECT name,gold FROM player.player WHERE account_id='".mysql_real_escape_string($owner_id)."'");
                     $fetch10 = mysql_fetch_object($test10);
                     echo'<tr>';
                           echo'<td class="'.$zF.'">'.mysql_real_escape_string($getName['item']).'</td>
                           <td class="'.$zF.'">'.mysql_real_escape_string($fetch10->name).'</td>
                           <td class="'.$zF.'"><b><font color="green">'.mysql_real_escape_string($getItems->cena).'</font></b> yang</td>
                           <td class="'.$zF.'" width="50">';
                           if($fetch10->gold >= $getItems->cena)
                           {
                              echo'<center><a href="?s=aukcia_kupit&id='.mysql_real_escape_string($getItems->id).'&vnum='.mysql_real_escape_string($getItems->vnum).'">
                              <img src="img/buy0.png" onmouseover="javascript:this.src=\'img/buy1.png\'" onmouseout="javascript:this.src=\'img/buy0.png\'" title="Kúpiť">
                              </a>';
                           }
                           else
                           {
                              echo'You do not have enough yang.';
                           }
                           echo'</td>
                        </tr>';
                     $x++;
                  }
            echo'</table>';
            $sqlCmd = "SELECT * FROM ".SQL_HP_DB.".auction_system WHERE id='".mysql_real_escape_string($_GET['id'])."' AND vnum='".mysql_real_escape_string($_GET['vnum'])."'";
            $sqlQry = mysql_query($sqlCmd,$sqlServ);
            
            echo"<table class=\"itemlist\">\n<tr>\n";
            echo"<th class=\"topLine\">ID</th>\n";
            echo"<th class=\"topLine\">Item name</th>\n";
            echo"<th class=\"topLine\">Count</th>";
            echo"<th class=\"topLine\">Stones</th>\n";
            echo"<th class=\"topLine\">Bonuses</th>\n</tr>\n";  
            $x=0;
            while($getItems=mysql_fetch_object($sqlQry)) {
              if(($x%2)==0) 
              { 
               $zF="tdunkel"; 
              }
              else 
              { 
               $zF="tdunkel"; 
              }
           
              $getName = compareItems($getItems->vnum);
              echo'<tr>';
              echo'<td class="'.$zF.'">'.mysql_real_escape_string($getItems->id).'</td>';
              echo'<td class="'.$zF.'">'.mysql_real_escape_string($getName['item']).'</td>';
              echo'<td class="'.$zF.'">'.mysql_real_escape_string($getItems->count).'</td>';
              
              echo'<td class="'.$zF.'">';
              for($i=0;$i<6;$i++) {
               if($i==0) { $akSocket = $getItems->socket0; }
               if($i==1) { $akSocket = $getItems->socket1; }
               if($i==2) { $akSocket = $getItems->socket2; }
               if($i==3) { $akSocket = $getItems->socket3; }
               if($i==4) { $akSocket = $getItems->socket4; }
               if($i==5) { $akSocket = $getItems->socket5; }
               echo'#'.($i+1).'&nbsp;';
               if(isset($itemSteine[$akSocket])) {
                 echo $itemSteine[$akSocket];
               }
               else {
                 echo $akSocket;
               }
               echo'<br/>';
              
              }
              echo'</td>';
              echo'<td class="'.$zF.'">';
              for($i=0;$i<7;$i++) {
               if($i==0) { $akBoni = $getItems->attrtype0; $akWert = $getItems->attrvalue0; }
               if($i==1) { $akBoni = $getItems->attrtype1; $akWert = $getItems->attrvalue1; }
               if($i==2) { $akBoni = $getItems->attrtype2; $akWert = $getItems->attrvalue2; }
               if($i==3) { $akBoni = $getItems->attrtype3; $akWert = $getItems->attrvalue3; }
               if($i==4) { $akBoni = $getItems->attrtype4; $akWert = $getItems->attrvalue4; }
               if($i==5) { $akBoni = $getItems->attrtype5; $akWert = $getItems->attrvalue5; }
               if($i==6) { $akBoni = $getItems->attrtype6; $akWert = $getItems->attrvalue6; }
               echo'#'.($i+1).'&nbsp;';
               if(isset($itemBoni[$akBoni])) {
                 echo $itemBoni[$akBoni];
               }
               else {
                 echo $akBoni;
               }
               echo':&nbsp;'.$akWert;
               echo'<br/>';
              
              }
              echo'</td>';
              echo'</tr>';
              $x++;
            }
            echo'</table>';
            echo'<p><a href="?s=aukcia">Back</a>';
         }
         else
         {
            echo'<p>This ID does not exist.</p>';
         }
      }
      else
      {
      $sqlItem = mysql_query("SELECT * FROM ".SQL_HP_DB.".auction_system");
      if(mysql_num_rows($sqlItem) >= 1)
      {
         echo'<table>
                  <tr>
                    <th class="topLine">Name</th>
                    <th class="topLine">Owner</th>
                    <th class="topLine">Price</th>
                   <!-- <th class="topLine">ID Majiteľa</th> -->
                    <th class="topLine">Action</th>
                  </tr>';
                  $x=0;
                  while($aukcia=mysql_fetch_object($sqlItem))
                  {
                     $owner_id = mysql_real_escape_string($aukcia->owner_id);
                     $test10 = mysql_query("SELECT name FROM player.player WHERE account_id='".mysql_real_escape_string($owner_id)."'");
                     $fetch10 = mysql_fetch_object($test10);
                     $getName = compareItems($aukcia->vnum);
                     $zF=($x%2==0) ? "tdunkel" : "thell";
                     echo'<tr>
                           <td class="'.$zF.'">'.mysql_real_escape_string($getName['item']).'</td>
                           <td class="'.$zF.'">'.mysql_real_escape_string($fetch10->name).'</td>
                           <td class="'.$zF.'"><b><font color="green">'.mysql_real_escape_string($aukcia->cena).' </font></b>Yang</td>
                        <!--   <td class="'.$zF.'">'.mysql_real_escape_string($aukcia->owner_id).'</td> -->
                           <td class="'.$zF.'">';
                              echo'<center><a href="?s=aukcia&id='.mysql_real_escape_string($aukcia->id).'&vnum='.mysql_real_escape_string($aukcia->vnum).'">More Info</a></center>';
                           echo'</td>
                        </tr>';
                     $x++;
                  }
            echo'</table>';
         }
         else
         {
            echo'<br><p>The auctions are currently no items.</p>';
         }
      }
}
else
{
   echo'<p class="meldung">You must be logged in for this area.</p>';
}
?>
Avatar utilizator
Yahiko
Membru Club

Membru Club
Mesaje: 3865
Membru din: 25 Mai 2015, 18:31
Aprecieri: 0
Mulţumiri: 4857  
Discord: Copiază ID
 Contact:
Medalii

Subiect inactiv, arhivat.
*Contact Discord: Yahiko#2936
*Doar SMS: 0749592613
*Grup discord: Click
Cu stimă,
Yahiko.

GL & HF
Afișează semnătura
Închis
Răspunsuri
0
Vizualizări
71
Răspunsuri
1
Vizualizări
259

Înapoi la “Arhivă Probleme şi Întrebări”

  • Informaţie
  • Cine este conectat

    Utilizatori ce ce navighează pe acest forum: Niciun utilizator înregistrat și 75 vizitatori