Jump to content

Recommended Posts

  • Administrator

Tutorial realizat pe Metin2CMS V2.11

 

Mergem în include\sidebar\ranking.php
Căutăm:

<div class="col-md-4 top-inline top-inline-empire"><img src="<?php print $site_url; ?>images/empire/<?php print $empire=get_player_empire($player['account_id']); ?>.jpg" alt="<?php print emire_name($empire); ?>" title="<?php print emire_name($empire); ?>"></div>
Înlocuim cu:
<div class="col-md-4 top-inline top-inline-empire"><?php print $player['playtime']; ?><?php print $player['name']; ?></div>
Căutăm:
<div class="col-md-4 top-inline top-inline-empire"><img src="<?php print $site_url; ?>images/empire/<?php print $empire=get_guild_empire($guild['master']); ?>.jpg" alt="<?php print emire_name($empire); ?>" title="<?php print emire_name($empire); ?>"/></div>
Înlocuim cu:
<div class="col-md-4 top-inline top-inline-empire"><?php print $guild['ladder_point']; ?></div>

 

Mergem în include\functions\basic.php

Căutăm:

function top10players()

Înlocuim toată funcția cu:

(am adaugat playtime si order)

function top10players()
   {
      global $database;
      
      $banned_ids = getBannedAccounts();
      if($banned_ids)
         $stmt = $database->runQueryPlayer("SELECT id, name, account_id, playtime FROM player WHERE name NOT LIKE '[%]%' AND account_id NOT IN (".$banned_ids.") ORDER BY level DESC, exp DESC, playtime DESC, name ASC limit 5");
      else
         $stmt = $database->runQueryPlayer("SELECT id, name, account_id, playtime FROM player WHERE name NOT LIKE '[%]%' ORDER BY level DESC, exp DESC, playtime DESC, name ASC limit 5");
      $stmt->execute();
      $top = $stmt->fetchAll();
      
      return $top;
   }

Căutăm:

function top10guilds()

Înlocuim toată funcția cu:

(am adaugat leadder_points si order)

function top10guilds()
   {
      global $database;
      
      $stmt = $database->runQueryPlayer("SELECT name, master, ladder_point FROM guild WHERE name NOT LIKE '[%]%' ORDER BY level DESC, ladder_point DESC, exp DESC, name ASC limit 5");
      $stmt->execute();
      $top = $stmt->fetchAll();
      
      return $top;
   }

TREBUIE SA ARATE ASA

ClWvRZq.png

 

Acum trebuie sa editam si paginile ranking/players si ranking/guilds

 

Mergem în /pages/players.php

 

Căutăm: <tbody>

Înlocuim toată funcția cu:

(am adaugat playtime si order)

<?php 
  $banned_ids = getBannedAccounts();
  $records_per_page=15;
  
  if(isset($search))
  {
    if($banned_ids)
      $query = "SELECT id, name, account_id, level, exp, playtime FROM player WHERE name NOT LIKE '[%]%' AND account_id NOT IN (".$banned_ids.") AND name LIKE :search ORDER BY playtime DESC, exp DESC, level DESC, name ASC";
    else
      $query = "SELECT id, name, account_id, level, exp, playtime FROM player WHERE name NOT LIKE '[%]%' AND name LIKE :search ORDER BY playtime DESC, exp DESC, level 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, playtime FROM player WHERE name NOT LIKE '[%]%' AND account_id NOT IN (".$banned_ids.") ORDER BY playtime DESC, exp DESC, level DESC, name ASC";
    else
      $query = "SELECT id, name, account_id, level, exp, playtime FROM player WHERE name NOT LIKE '[%]%' ORDER BY playtime DESC, exp DESC, level DESC, name ASC";
    $newquery = $paginate->paging($query,$records_per_page);
    $paginate->dataview($newquery);
  }
?>

Căutăm:

<thead class="thead-inverse">

Adăugăm o linie nouă:

<th>Timp</th>

Mergem în /pages/guilds.php

Căutăm: <tbody>

 

Înlocuim toată funcția cu:

(am adaugat leadder_points si order)

<?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 ladder_point DESC, level 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 ladder_point DESC, level DESC, exp DESC, name ASC";
    $newquery = $paginate->paging($query,$records_per_page);
    $paginate->dataview($newquery);
  }
  
?>

 

Mergem în /include/classes/players.php

Căutăm:

<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>

Adăugăm o linie nouă:

<td><?php print $row['playtime']; ?></td>

TREBUIE SA ARATE ASA

(eu am scos si nivelul din top la voi apare diferit)

7GC8bin.png

 

Daca ai o problema deschide un tichet.

Link to comment
Share on other sites

  • 6 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...