Fix #314 add filter on attacks
This commit is contained in:
novgorodschi catalin
2026-07-29 08:02:23 +03:00
parent 4809626e40
commit e87c8ac824
6 changed files with 103 additions and 2 deletions
+8
View File
@@ -4283,3 +4283,11 @@ tz_def('ADM_PLUS_STATISTICS_KEEP_TIP', '0 keeps everything, so players see the f
tz_def('ALLYBONUS_YOURLEVEL', 'Your level');
tz_def('ALLYBONUS_UNLOCKS_IN', 'next unlocks in');
tz_def('ALLYBONUS_NEWMEMBER', 'New members gain access to higher levels gradually: level 2 after 24 hours in the alliance, level 3 after 48 hours, and so on.');
//////////////////////////////////////////////////////////////////////////////////////////////////////
// RAPOARTE - filtru dupa rezultatul luptei
//////////////////////////////////////////////////////////////////////////////////////////////////////
tz_def('TZ_RPT_ALL_RESULTS', 'All results');
tz_def('TZ_RPT_F_WON_NOLOSS', 'Won without losses');
tz_def('TZ_RPT_F_WON_LOSS', 'Won with losses');
tz_def('TZ_RPT_F_LOST', 'Lost');
+8
View File
@@ -4226,3 +4226,11 @@ tz_def('ADM_PLUS_STATISTICS_KEEP_TIP', '0 conserve tout, afin que les joueurs vo
tz_def('ALLYBONUS_YOURLEVEL', 'Votre niveau');
tz_def('ALLYBONUS_UNLOCKS_IN', 'prochain dans');
tz_def('ALLYBONUS_NEWMEMBER', 'Les nouveaux membres accèdent progressivement aux niveaux supérieurs : niveau 2 après 24 heures dans l\'alliance, niveau 3 après 48 heures, etc.');
//////////////////////////////////////////////////////////////////////////////////////////////////////
// RAPOARTE - filtru dupa rezultatul luptei
//////////////////////////////////////////////////////////////////////////////////////////////////////
tz_def('TZ_RPT_ALL_RESULTS', 'Tous les résultats');
tz_def('TZ_RPT_F_WON_NOLOSS', 'Gagné sans pertes');
tz_def('TZ_RPT_F_WON_LOSS', 'Gagné avec pertes');
tz_def('TZ_RPT_F_LOST', 'Perdu');
+8
View File
@@ -4023,3 +4023,11 @@ tz_def('ADM_PLUS_STATISTICS_KEEP_TIP', '0 pastreaza tot, ca jucatorii sa vada is
tz_def('ALLYBONUS_YOURLEVEL', 'Nivelul tau');
tz_def('ALLYBONUS_UNLOCKS_IN', 'urmatorul in');
tz_def('ALLYBONUS_NEWMEMBER', 'Membrii noi capata acces treptat la nivelurile mari: nivelul 2 dupa 24 de ore in alianta, nivelul 3 dupa 48 de ore si asa mai departe.');
//////////////////////////////////////////////////////////////////////////////////////////////////////
// RAPOARTE - filtru dupa rezultatul luptei
//////////////////////////////////////////////////////////////////////////////////////////////////////
tz_def('TZ_RPT_ALL_RESULTS', 'Toate rezultatele');
tz_def('TZ_RPT_F_WON_NOLOSS', 'Castigat fara pierderi');
tz_def('TZ_RPT_F_WON_LOSS', 'Castigat cu pierderi');
tz_def('TZ_RPT_F_LOST', 'Pierdut');
+28
View File
@@ -151,6 +151,34 @@ class Message
if (!is_array($type)) {
$type = [$type];
}
/**
* Filtru suplimentar dupa REZULTAT, pentru rapoartele de lupta.
*
* Rapoartele de alianta au deja acest filtru (sabii verzi/galbene);
* cele personale nu il aveau, desi informatia exista deja in ntype:
*
* 1 / 4 castigat fara pierderi (atacator / aparator)
* 2 / 5 castigat cu pierderi
* 3 / 6 / 7 pierdut
*
* Nu e nevoie de nicio schimbare in baza de date.
*/
if ((int) $get['t'] === 3 && isset($get['f'])) {
$results = array(
1 => array(1, 4), // victorie fara pierderi
2 => array(2, 5), // victorie cu pierderi
3 => array(3, 6, 7), // infrangere
);
$f = (int) $get['f'];
if (isset($results[$f])) {
// pastram doar tipurile care sunt SI in categorie, SI in rezultat
$type = array_values(array_intersect($type, $results[$f]));
}
}
$this->noticearray = $this->filter_by_value(
$database->getNotice($session->uid),
"ntype",
+14 -2
View File
@@ -58,7 +58,14 @@ $t = isset($_GET['t']) ? (int)$_GET['t'] : 0;
$o = isset($_GET['o']) ? (int)$_GET['o'] : 0;
// ======================== URL BUILD HELP ========================
$queryBase = (!empty($_GET['t'])) ? 't='.$_GET['t'].'&' : '';
// Baza pentru linkurile de paginare. Pastreaza si filtrul de rezultat (f),
// altfel trecerea la pagina urmatoare l-ar pierde si ai vedea din nou toate
// rapoartele de lupta.
$queryBase = (!empty($_GET['t'])) ? 't='.(int)$_GET['t'].'&' : '';
if (!empty($_GET['t']) && (int)$_GET['t'] === 3 && !empty($_GET['f'])) {
$queryBase .= 'f='.(int)$_GET['f'].'&';
}
?>
@@ -70,7 +77,12 @@ $queryBase = (!empty($_GET['t'])) ? 't='.$_GET['t'].'&' : '';
<tr>
<th colspan="2"><?php echo SUBJECT; ?>:</th>
<th class="sent">
<a href="berichte.php?o=1<?php echo (!empty($_GET['t']) ? '&amp;t='.$_GET['t'] : ''); ?>"><?php echo SENT; ?></a>
<a href="berichte.php?o=1<?php
echo (!empty($_GET['t']) ? '&amp;t='.(int)$_GET['t'] : '');
// pastram si filtrul de rezultat la sortare
echo (!empty($_GET['t']) && (int)$_GET['t'] === 3 && !empty($_GET['f']))
? '&amp;f='.(int)$_GET['f'] : '';
?>"><?php echo SENT; ?></a>
</th>
</tr>
</thead>
+37
View File
@@ -98,6 +98,43 @@ if(isset($_GET['newdid'])) {
}
?>
</div>
<?php
/**
* Filtru dupa rezultat, doar in categoria de atacuri.
*
* Rapoartele de alianta aveau deja acest filtru; cele personale nu. Informatia
* exista deja in ntype, deci nu e nevoie de nicio schimbare in baza de date
* (vezi Message::noticeType).
*/
if (isset($_GET['t']) && (int) $_GET['t'] === 3) {
$rptFilters = array(
0 => defined('TZ_RPT_ALL_RESULTS') ? TZ_RPT_ALL_RESULTS : 'All',
1 => defined('TZ_RPT_F_WON_NOLOSS') ? TZ_RPT_F_WON_NOLOSS : 'Won without losses',
2 => defined('TZ_RPT_F_WON_LOSS') ? TZ_RPT_F_WON_LOSS : 'Won with losses',
3 => defined('TZ_RPT_F_LOST') ? TZ_RPT_F_LOST : 'Lost',
);
$rptCurrent = isset($_GET['f']) ? (int) $_GET['f'] : 0;
echo '<div id="textmenu" class="rpt-result-filter">';
foreach ($rptFilters as $rptVal => $rptLabel) {
if ($rptVal > 0) {
echo ' | ';
}
$rptHref = 'berichte.php?t=3' . ($rptVal > 0 ? '&amp;f=' . $rptVal : '');
echo '<a href="' . $rptHref . '"'
. ($rptCurrent === $rptVal ? ' class="selected "' : '')
. '>' . htmlspecialchars($rptLabel, ENT_QUOTES, 'UTF-8') . '</a>';
}
echo '</div>';
}
?>
<?php
if (isset($_GET['id']))
{