mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-08-20 18:21:00 +00:00
Mark all as read
Mark all as read
This commit is contained in:
@@ -359,6 +359,26 @@ References: User ID/Message ID, Mode
|
||||
return mysqli_query($this->dblink,$q);
|
||||
}
|
||||
|
||||
/**
|
||||
* Buton "Read All" (cerut de Catalin, berichte.php): marcheaza TOATE
|
||||
* rapoartele necitite ale userului ca citite dintr-o singura interogare,
|
||||
* in loc sa deschizi fiecare in parte.
|
||||
*
|
||||
* Acelasi domeniu ca getNotice($uid) (doar del = 0) - deci acopera
|
||||
* exact ce se vede in lista, inclusiv rapoartele arhivate necitite
|
||||
* (ntype = 9).
|
||||
*/
|
||||
function noticeViewedAll($uid) {
|
||||
$uid = (int) $uid;
|
||||
|
||||
if ($uid <= 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$q = "UPDATE " . TB_PREFIX . "ndata set viewed = 1 WHERE uid = $uid AND viewed = 0 AND del = 0";
|
||||
return mysqli_query($this->dblink,$q);
|
||||
}
|
||||
|
||||
function addNotice($uid, $toWref, $ally, $type, $topic, $data, $time = 0) {
|
||||
list($uid, $toWref, $ally, $type, $topic, $data, $time) = $this->escape_input((int) $uid, (int) $toWref, (int) $ally, (int) $type, $topic, $data, (int) $time);
|
||||
|
||||
|
||||
@@ -198,6 +198,7 @@ tz_def('WAIT_FOR_CONFIRM', 'Wait for confirm');
|
||||
tz_def('CONFIRM', 'Confirm');
|
||||
tz_def('WRITE_MESS_WARN', '<b>Warning:</b> you can`t use the values <b>[message]</b> or <b>[/message]</b> in your message because it can cause problem with bbcode system');
|
||||
tz_def('NO_REPORTS', 'There are no reports available');
|
||||
tz_def('READ_ALL_REPORTS', 'Mark all as read');
|
||||
tz_def('ATTACKER', 'Attacker');
|
||||
tz_def('NATAR_COUNTERFORCE', 'Natar Counterforce');
|
||||
tz_def('FROM_THE_VILL', 'from the village');
|
||||
|
||||
@@ -204,6 +204,7 @@ tz_def('WAIT_FOR_CONFIRM', 'En attente de confirmation');
|
||||
tz_def('CONFIRM', 'Confirmer');
|
||||
tz_def('WRITE_MESS_WARN', '<b>Attention :</b> vous ne pouvez pas utiliser les balises <b>[message]</b> ou <b>[/message]</b> dans votre message car cela peut causer des problèmes avec le système BBCode.');
|
||||
tz_def('NO_REPORTS', 'Aucun rapport disponible');
|
||||
tz_def('READ_ALL_REPORTS', 'Marquer tout comme lu');
|
||||
tz_def('ATTACKER', 'Attaquant');
|
||||
tz_def('NATAR_COUNTERFORCE', 'Contre-offensive Natar');
|
||||
tz_def('FROM_THE_VILL', 'du village');
|
||||
|
||||
@@ -200,6 +200,7 @@ tz_def('WAIT_FOR_CONFIRM', 'Așteaptă confirmarea');
|
||||
tz_def('CONFIRM', 'Confirmă');
|
||||
tz_def('WRITE_MESS_WARN', '<b>Atenție:</b> nu poți folosi <b>[message]</b> sau <b>[/message]</b> în mesaj deoarece pot cauza probleme cu sistemul BBCode');
|
||||
tz_def('NO_REPORTS', 'Nu există rapoarte disponibile');
|
||||
tz_def('READ_ALL_REPORTS', 'Marchează toate ca citite');
|
||||
tz_def('ATTACKER', 'Atacator');
|
||||
tz_def('NATAR_COUNTERFORCE', 'Contraatac Natari');
|
||||
tz_def('FROM_THE_VILL', 'din satul');
|
||||
|
||||
@@ -201,6 +201,9 @@ class Message
|
||||
if (isset($post['start_x'])) {
|
||||
$this->unarchiveNotice($post);
|
||||
}
|
||||
if (isset($post['readall'])) {
|
||||
$this->readAllNotices();
|
||||
}
|
||||
}
|
||||
|
||||
public function quoteMessage($id)
|
||||
@@ -415,6 +418,20 @@ class Message
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Buton "Read All" (cerut de Catalin): marcheaza toate rapoartele
|
||||
* necitite ale userului ca citite dintr-o singura actiune, indiferent
|
||||
* de tab/filtru curent - la fel ca removeNotice/archiveNotice/
|
||||
* unarchiveNotice de mai sus (POST + redirect la lista de baza).
|
||||
*/
|
||||
private function readAllNotices()
|
||||
{
|
||||
global $database, $session;
|
||||
$database->noticeViewedAll((int) $session->uid);
|
||||
header("Location: berichte.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
private function getReadNotice($id)
|
||||
{
|
||||
global $database, $session;
|
||||
|
||||
Reference in New Issue
Block a user