Skip to content

Commit 0781536

Browse files
authored
Merge pull request #1063 from ai91/feature/shoutboxfilter
Фильтр для истории событий в режиме site
2 parents c684106 + bd823fc commit 0781536

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

modules/shoutbox/shouts_search.inc.php

+9-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
global $getdata;
1414
global $clear;
1515
global $room_id;
16+
global $importance;
1617

1718
if ($this->action == 'admin' && $clear) {
1819
SQLExec("DELETE FROM shouts");
@@ -68,6 +69,13 @@
6869
$session->data['SHOUT_ROOM_ID'] = (int)$room_id;
6970
}
7071

72+
if ($importance) {
73+
$this->importance = $importance;
74+
}
75+
if ($this->importance) {
76+
$qry .= " AND IMPORTANCE>=" . (int)$this->importance;
77+
}
78+
7179
// search filters
7280
// QUERY READY
7381
global $save_qry;
@@ -111,7 +119,7 @@
111119
$limit = str_replace('LIMIT LIMIT', 'LIMIT', $limit);
112120

113121
$out['LIMIT'] = $this->limit;
114-
122+
$out['IMPORTANCE'] = $this->importance;
115123

116124
$res = SQLSelect("SELECT shouts.*, DATE_FORMAT(shouts.ADDED, '%H:%i') as DAT, TO_DAYS(shouts.ADDED) as DT, users.NAME, users.COLOR FROM shouts LEFT JOIN users ON shouts.MEMBER_ID=users.ID WHERE $qry ORDER BY shouts.ADDED DESC, ID DESC $limit");
117125

templates/shoutbox/shouts_search_site.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
clearTimeout(shoutTimer);
3636

3737
var url="<#ROOTHTML#>popup/shoutbox.html?";
38-
url=url+'&limit=<#LIMIT#>&getdata=1[#if REVERSE="1"#]&reverse=1[#endif#]';
38+
url=url+'&limit=<#LIMIT#>&getdata=1[#if REVERSE="1"#]&reverse=1[#endif#][#if IMPORTANCE!=""#]&importance=<#IMPORTANCE#>[#endif#]';
3939
$.ajax({
4040
url: url,
4141
}).done(function(data) {

0 commit comments

Comments
 (0)