Cupa TOP 3 clasament

Închis
Avatar utilizator
Warr007.
Veteran

Veteran
Mesaje: 1525
Membru din: 28 Noi 2016, 01:30
Server: Origins2
Regat: Shinsoo
Aprecieri: 224  
Mulţumiri: 2419  
Discord: Copiază ID
Medalii

Salutare, cum as putea pune si eu la primele 3 locuri din clasament cate o cupa
Mai exact as vrea sa arate cam asa: https://prnt.sc/jbnv5o

Cupa sa afla in img/gold.png - /img/silver.png - /img/bronz.png

Clasament jucatori:

Cod: Selectaţi tot

<div>
	<h3><?php print $lang['ranking'].' - '.$lang['players']; ?></h3>
	<div class="big-line"></div>
	<div class="padding-container">
		<div class="jumbotron jumbotron-fluid" style="padding: 1rem 2rem;">
			<form action="" method="POST">
				<div class="row">
					<div class="col-lg-7">
						<input type="text" name="search" class="form-control" placeholder="<?php print $lang['name']; ?>" value="<?php if(isset($search)) print $search; ?>">
					</div>
					<div class="col-lg-5">
						<button type="submit" class="btn btn-primary"><i class="fa fa-search fa-1" aria-hidden="true"></i> <?php print $lang['search']; ?></button>
					</div>
				</div>
			</form>
		</div>
		
		<table class="table table-striped table-hover">
			<thead class="thead-inverse">
				<tr>
					<th>#</th>
					<th><?php print $lang['name']; ?></th>
					<th><?php print $lang['empire']; ?></th>
					<th class="level-table"><?php print $lang['level']; ?></th>
					<th class="exp-table">EXP</th>
				</tr>
			</thead>
			<tbody>
				<?php 
					$banned_ids = getBannedAccounts();
					$records_per_page=10;
					
					if(isset($search))
					{
						if($banned_ids)
							$query = "SELECT id, name, account_id, level, exp FROM player WHERE name NOT LIKE '[%]%' AND account_id NOT IN (".$banned_ids.") AND name LIKE :search ORDER BY level DESC, exp DESC, playtime DESC, name ASC";
						else
							$query = "SELECT id, name, account_id, level, exp FROM player WHERE name NOT LIKE '[%]%' AND name LIKE :search ORDER BY level DESC, exp DESC, playtime DESC, name ASC";
						$newquery = $paginate->paging($query,$records_per_page);
						$paginate->dataview($newquery, $search);
					} else {
						if($banned_ids)
							$query = "SELECT id, name, account_id, level, exp FROM player WHERE name NOT LIKE '[%]%' AND account_id NOT IN (".$banned_ids.") ORDER BY level DESC, exp DESC, playtime DESC, name ASC";
						else
							$query = "SELECT id, name, account_id, level, exp FROM player WHERE name NOT LIKE '[%]%' ORDER BY level DESC, exp DESC, playtime DESC, name ASC";
						$newquery = $paginate->paging($query,$records_per_page);
						$paginate->dataview($newquery);
					}
				?>
			</tbody>
		</table>
		<?php
			if(isset($search))
				$paginate->paginglink($query,$records_per_page,$lang['first-page'],$lang['last-page'],$site_url,$search);
			else
				$paginate->paginglink($query,$records_per_page,$lang['first-page'],$lang['last-page'],$site_url);
		?>
	</div>
</div>
Clasament VIP:

Cod: Selectaţi tot

<div>
	<h3><?php print $lang['ranking'].' - '.$lang['players_vip']; ?></h3>
	<div class="big-line"></div>
	<div class="padding-container">
		<div class="jumbotron jumbotron-fluid" style="padding: 1rem 2rem;">
			<form action="" method="POST">
				<div class="row">
					<div class="col-lg-7">
						<input type="text" name="search" class="form-control" placeholder="<?php print $lang['name']; ?>" value="<?php if(isset($search)) print $search; ?>">
					</div>
					<div class="col-lg-5">
						<button type="submit" class="btn btn-primary"><i class="fa fa-search fa-1" aria-hidden="true"></i> <?php print $lang['search']; ?></button>
					</div>
				</div>
			</form>
		</div>
		
		<table class="table table-striped table-hover">
			<thead class="thead-inverse">
				<tr>
					<th>#</th>
					<th><?php print $lang['name']; ?></th>
					<th><?php print $lang['empire']; ?></th>
					<th class="level-table"><?php print $lang['level']; ?></th>
					<th class="exp-table">EXP</th>
				</tr>
			</thead>
			<tbody>
				<?php 
					$banned_ids = getBannedAccounts();
					$records_per_page=10;
					
					if(isset($search))
					{
						if($banned_ids)
							$query = "SELECT id, name, account_id, level, exp FROM player WHERE (name LIKE '[VIP]%' OR name LIKE '[MVP]%') AND account_id NOT IN (".$banned_ids.") AND name LIKE :search ORDER BY level DESC, exp DESC, playtime DESC, name ASC";
						else
							$query = "SELECT id, name, account_id, level, exp FROM player WHERE (name LIKE '[VIP]%' OR name LIKE '[MVP]%') AND name LIKE :search ORDER BY level DESC, exp DESC, playtime DESC, name ASC";
						$newquery = $paginate->paging($query,$records_per_page);
						$paginate->dataview($newquery, $search);
					} else {
						if($banned_ids)
							$query = "SELECT id, name, account_id, level, exp FROM player WHERE (name LIKE '[VIP]%' OR name LIKE '[MVP]%') AND account_id NOT IN (".$banned_ids.") ORDER BY level DESC, exp DESC, playtime DESC, name ASC";
						else
							$query = "SELECT id, name, account_id, level, exp FROM player WHERE (name LIKE '[VIP]%' OR name LIKE '[MVP]%') ORDER BY level DESC, exp DESC, playtime DESC, name ASC";
						$newquery = $paginate->paging($query,$records_per_page);
						$paginate->dataview($newquery);
					}
				?>
			</tbody>
		</table>
		<?php
			if(isset($search))
				$paginate->paginglink($query,$records_per_page,$lang['first-page'],$lang['last-page'],$site_url,$search);
			else
				$paginate->paginglink($query,$records_per_page,$lang['first-page'],$lang['last-page'],$site_url);
		?>
	</div>
</div>
Clasament bresle:

Cod: Selectaţi tot

<div>

	<h3><?php print $lang['ranking'].' - '.$lang['guilds']; ?></h3>
	<div class="big-line"></div>
	<div class="padding-container">
		<div class="jumbotron jumbotron-fluid" style="padding: 1rem 2rem;">
			<form action="" method="POST">
				<div class="row">
					<div class="col-lg-7">
						<input type="text" name="search" class="form-control" placeholder="<?php print $lang['guild']; ?>" value="<?php if(isset($search)) print $search; ?>">
					</div>
					<div class="col-lg-5">
						<button type="submit" class="btn btn-primary"><i class="fa fa-search fa-1" aria-hidden="true"></i> <?php print $lang['search']; ?></button>
					</div>
				</div>
			</form>
		</div>
		
		<table class="table table-striped table-hover">
			<thead class="thead-inverse">
				<tr>
					<th>#</th>
					<th><?php print $lang['guild']; ?></th>
					<th><?php print $lang['leader']; ?></th>
					<th><?php print $lang['empire']; ?></th>
					<th class="level-table"><?php print $lang['level']; ?></th>
					<th class="exp-table"><?php print $lang['points']; ?></th>
				</tr>
			</thead>
			<tbody>
				<?php		
					$records_per_page=10;

					if(isset($search))
					{
						$query = "SELECT id, name, master, level, ladder_point FROM guild WHERE name NOT LIKE '[%]%' AND name LIKE :search ORDER BY level DESC, ladder_point DESC, exp DESC, name ASC";
						$newquery = $paginate->paging($query,$records_per_page);
						$paginate->dataview($newquery, $search);
					} else {
						$query = "SELECT id, name, master, level, ladder_point FROM guild WHERE name NOT LIKE '[%]%' ORDER BY level DESC, ladder_point DESC, exp DESC, name ASC";
						$newquery = $paginate->paging($query,$records_per_page);
						$paginate->dataview($newquery);
					}
					
				?>
			</tbody>
		</table>
		<?php
			if(isset($search))
				$paginate->paginglink($query,$records_per_page,$lang['first-page'],$lang['last-page'],$site_url,$search);
			else
				$paginate->paginglink($query,$records_per_page,$lang['first-page'],$lang['last-page'],$site_url);
		?>
	</div>
</div>
Avatar utilizator
Warr007.
Veteran

Veteran
Mesaje: 1525
Membru din: 28 Noi 2016, 01:30
Server: Origins2
Regat: Shinsoo
Aprecieri: 224  
Mulţumiri: 2419  
Discord: Copiază ID
Medalii

up
Avatar utilizator
Ionuţ
Web Master

Web Master
Mesaje: 1001
Membru din: 02 Sep 2013, 14:41
Server: Metin2CMS
Regat: Jinno
Aprecieri: 88  
Mulţumiri: 471  
Discord: Copiază ID
 Contact:
Medalii

nu merge asa tati, mergem in include/classes/players/guilds/vip .php
Fac exemplu pentru include/functions/players.php
Avem asta:

Cod: Selectaţi tot

		if($rowCount>0)
		{
			while($row=$stmt->fetch(PDO::FETCH_ASSOC))
			{	$number++;
				
				?>
			<tr>
				<th scope="row"><?php print $number; ?></th>
				<td><?php print $row['name']; ?></td>
				<td><img src="<?php print $site_url; ?>images/empire/<?php print $empire=get_player_empire($row['account_id']); ?>.jpg" alt="<?php print emire_name($empire); ?>" title="<?php print emire_name($empire); ?>"></td>
				<td class="level-table"><?php print $row['level']; ?></td>
				<td class="exp-table"><?php print $row['exp']; ?></td>
			</tr>
                <?php
			}
		}
Se inlocuieste cu:

Cod: Selectaţi tot

		if($rowCount>0)
		{
			while($row=$stmt->fetch(PDO::FETCH_ASSOC))
			{	$number++;
				
				?>
			<tr>
				<th scope="row">
					<?php 
						if($number==1)
							print '<img src="'.$site_url.'img/gold.png">';
						else if($number==2)
							print '<img src="'.$site_url.'img/silver.png">';
						else if($number==3)
							print '<img src="'.$site_url.'img/bronz.png">';
						else print $number;
					?>
				</th>
				<td><?php print $row['name']; ?></td>
				<td><img src="<?php print $site_url; ?>images/empire/<?php print $empire=get_player_empire($row['account_id']); ?>.jpg" alt="<?php print emire_name($empire); ?>" title="<?php print emire_name($empire); ?>"></td>
				<td class="level-table"><?php print $row['level']; ?></td>
				<td class="exp-table"><?php print $row['exp']; ?></td>
			</tr>
                <?php
			}
		}
Pentru acest mesaj, Ionuţ for the post:
Warr007.
Proiectele mele

Imagine
Afișează semnătura
Avatar utilizator
Warr007.
Veteran

Veteran
Mesaje: 1525
Membru din: 28 Noi 2016, 01:30
Server: Origins2
Regat: Shinsoo
Aprecieri: 224  
Mulţumiri: 2419  
Discord: Copiază ID
Medalii

T/C

Multumesc Ionut pentru ajutor. :)
Avatar utilizator
Iosif Deak
Fost Super Moderator

Fost Super Moderator
Mesaje: 1026
Membru din: 21 Iul 2014, 21:31
Server: eMetin.ro
Regat: Jinno
Aprecieri: 7  
Mulţumiri: 336  
Medalii

Subiect redirecționat.
Motiv: Problemă rezolvată, prin urmare acest subiect a fost mutat în Probleme Rezolvate.
Închis
Răspunsuri
3
Vizualizări
351
Răspunsuri
3
Vizualizări
793
Răspunsuri
2
Vizualizări
278

Înapoi la “Probleme Rezolvate”

  • Informaţie
  • Cine este conectat

    Utilizatori ce ce navighează pe acest forum: Niciun utilizator înregistrat și 1 vizitator