• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Przerzucenie account_id do kolumny sell

Verdis

Ciekawy świata.
Joined
May 28, 2012
Messages
394
Reaction score
9
Location
Poland
Siemka,
jak zrobić aby po kupieniu postać od razu znikła z aukcji... ? mam z tym problem, po zakupie postać ciągle jest...
Code:
<?PHP
$main_content .= '<h3><div class="NewsHeadlineBackground" style="background-image:url(' . $layout_name . '/images/content/contentheader.png)"><font color="white"><font size="1"><b>Sprzedaż postaci</b></font></font></div></h3>';
$account_id = $SQL->query("SELECT id FROM accounts WHERE lastday < UNIX_TIMESTAMP() - 60 *60 *24 *".$config['site']['days_to_sell']."")->fetchAll();

   
   if ($account_id){
        $main_content .= '<TABLE BORDER=0 CELLPADDING=4 CELLSPACING=1 WIDTH=100%></TABLE><TABLE BORDER=0 CELLPADDING=4 CELLSPACING=1 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD WIDTH=20% CLASS=whites><B><center>Nick</center></B></TD><TD WIDTH=15% CLASS=whites><B><center>Level</center></B></TD><TD WIDTH=25% CLASS=whites><b><center>Vocation</center></B></TD><TD WIDTH=15% CLASS=whites><b><center>Buy</center></B></TD><TD WIDTH=20% CLASS=whites><b><center>Price</center></B></TD>';
        $counter = 0;
        foreach($account_id as $acc_id){
		
            $acc_idd = $acc_id['id'];
            $players = $SQL->query("SELECT id, name, level, group_id, promotion, vocation FROM players WHERE account_id = ".$acc_idd."")->fetchAll();
			
            foreach($players as $player){
            $counter++;

				if(is_int($number_of_rows / 2)) $bgcolor = $config['site']['darkborder']; else $bgcolor = $config['site']['lightborder']; 
					$number_of_rows++; 
				
					if ($player){
					$player_group = $player['group_id'];
					$player_name = $player['name'];
					$player_level = $player['level'];
					$player_id = $player['id'];
					$player_pro = $player['promotion'];
					$player_voc = $vocation_name[0][$player_pro][$player['vocation']];
					$koszt = (int) ceil($player["level"] / 0.7);
					if ($player_group < 2 && $player_level >= $config['site']['level_to_sell'] && $player_id > 6){
				$SQL->query("UPDATE `players` SET `sell` = ".$player_id ." WHERE `id` = ".$player_id .";");  
				$SQL->query("UPDATE `players` SET `account_id` = 1 WHERE `id` = ".$player_id .";");  
				
                    $main_content .= '<tr bgcolor="'.$bgcolor.'"><td><a href="?subtopic=characters&name='.$player_name.'"><center>'.$player_name.'</center></a></td><td><center>'.$player_level.'</center></td><td><center>'.$player_voc.'</center></td><td><center><a href="?subtopic=buychar&id='.$player_id.'">Buy</a></center></td><td><center>'.$koszt.'</center></td>';
                }
            }
            }
        }
        $main_content .= '</table>';
    }
    else{
       $main_content .= '<TABLE BORDER=0 CELLPADDING=4 CELLSPACING=1 WIDTH=100%></TABLE><TABLE BORDER=0 CELLPADDING=4 CELLSPACING=1 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD WIDTH=20% CLASS=whites><B><center>Nick</center></B></TD><TD WIDTH=15% CLASS=whites><B><center>Level</center></B></TD><TD WIDTH=25% CLASS=whites><b><center>Vocation</center></B></TD><TD WIDTH=15% CLASS=whites><b><center>Buy</center></B></TD><TD WIDTH=20% CLASS=whites><b><center>Price</center></B></TD></table>';
    }

?>

W kolumnie sell zapisuje mi się player id, a chciałbym żeby się zapisywało "account_id"
Jak zmieniam, po swojemu to potem nic się wgl. nie edytuje....
Albo są wartości z "kosmosu"
Proszę o pomoc ;]
 
Last edited:
Back
Top