diff --git a/config.php b/config.php index e3f1ebeb..67555204 100644 --- a/config.php +++ b/config.php @@ -185,6 +185,7 @@ $config = array( 'highscores_outfit' => true, // show player outfit? 'highscores_country_box' => false, // doesnt work yet! (not implemented) 'highscores_groups_hidden' => 4, // this group id and higher won't be shown on the highscores + 'highscores_length' => 100, // how many records per page on highscores // characters page 'characters' => array( // what things to display on character view page (true/false in each option) diff --git a/index.php b/index.php index 8c6f3d8c..b02c5860 100644 --- a/index.php +++ b/index.php @@ -89,6 +89,8 @@ else { '/^forum\/thread\/[0-9]+\/?$/' => array('subtopic' => 'forum', 'action' => 'show_thread', 'id' => '$2'), '/^forum\/thread\/[0-9]+\/[0-9]+\/?$/' => array('subtopic' => 'forum', 'action' => 'show_thread', 'id' => '$2', 'page' => '$3'), '/^gifts\/history\/?$/' => array('subtopic' => 'gifts', 'action' => 'show_history'), + '/^highscores\/[A-Za-z0-9-_]+\/[A-Za-z0-9-_]+\/[0-9]+\/?$/' => array('subtopic' => 'highscores', 'list' => '$1', 'vocation' => '$2', 'page' => '$3'), + '/^highscores\/[A-Za-z0-9-_]+\/[0-9]+\/?$/' => array('subtopic' => 'highscores', 'list' => '$1', 'page' => '$2'), '/^highscores\/[A-Za-z0-9-_]+\/[A-Za-z0-9-_]+\/?$/' => array('subtopic' => 'highscores', 'list' => '$1', 'vocation' => '$2'), '/^highscores\/[A-Za-z0-9-_\']+\/?$/' => array('subtopic' => 'highscores', 'list' => '$1'), '/^polls\/[0-9]+\/?$/' => array('subtopic' => 'polls', 'id' => '$1') diff --git a/system/pages/highscores.php b/system/pages/highscores.php index 587ca492..a4dd0b62 100644 --- a/system/pages/highscores.php +++ b/system/pages/highscores.php @@ -109,7 +109,7 @@ if($config['highscores_outfit']) { } } -$offset = $_page * 100; +$offset = $_page * $config['highscores_length']; if($skill <= POT::SKILL_LAST) { // skills if(fieldExist('skill_fist', 'players')) {// tfs 1.0 $skill_ids = array( @@ -186,7 +186,7 @@ foreach($skills as $player) $player['online'] = $query->rowCount() > 0; } - if(++$i <= 100) + if(++$i <= $config['highscores_length']) { if($skill == POT::SKILL__MAGIC) $player['value'] = $player['maglevel']; @@ -238,11 +238,11 @@ if(!$i) 0) - echo 'Previous Page'; + echo 'Previous Page'; //link to next page if any result will be on next page if($show_link_to_next_page) - echo 'Next Page'; + echo 'Next Page'; //end of page echo ' @@ -307,8 +307,8 @@ if($config['highscores_vocation_box']) - [ALL]
'; - for($i = 1; $i < count($config_vocations) / 2; $i++) { + [ALL]
'; + for($i = 1; $i <= $config['vocations_amount']; $i++) { echo '' . $config_vocations[$i] . '
'; } echo ' diff --git a/system/templates/characters.html.twig b/system/templates/characters.html.twig index 68fe412b..f5792656 100644 --- a/system/templates/characters.html.twig +++ b/system/templates/characters.html.twig @@ -244,7 +244,9 @@ {{ frag.time|date("j M Y, H:i") }} {{ frag.description }} + {% endfor %} + {% endif %} {{ hook(constant('HOOK_CHARACTERS_BEFORE_SIGNATURE')) }}