@@ -11,6 +11,8 @@ class panel extends module
11
11
{
12
12
13
13
var $ action ;
14
+ var $ print ;
15
+ var $ ajax ;
14
16
15
17
// --------------------------------------------------------------------
16
18
function __construct ()
@@ -126,7 +128,7 @@ function run()
126
128
include_once (DIR_MODULES . 'inc_panel_ajax.php ' );
127
129
}
128
130
129
- if ($ this ->print || $ _GET ['print ' ]) {
131
+ if ($ this ->print || ( isset ( $ _GET ['print ' ]) && $ _GET [ ' print ' ]) ) {
130
132
$ this ->print = 1 ;
131
133
$ out ['PRINT ' ] = 1 ;
132
134
}
@@ -156,7 +158,9 @@ function run()
156
158
$ modules = SQLSelect ($ sqlQuery );
157
159
$ old_cat = 'some_never_should_be_category_name ' ;
158
160
$ modulesCnt = count ($ modules );
159
-
161
+
162
+ $ getNOTY = SQLSelect ("select pln.*, pl.MODULE_NAME from plugins_noty pln join plugins pl on pln.PLUGINS_ID=pl.id WHERE pln.READ = '0' " );
163
+
160
164
for ($ i = 0 ; $ i < $ modulesCnt ; $ i ++) {
161
165
if ($ modules [$ i ]['NAME ' ] == $ this ->action ) {
162
166
$ modules [$ i ]['SELECTED ' ] = 1 ;
@@ -177,29 +181,29 @@ function run()
177
181
$ last_allow = $ i ;
178
182
}
179
183
180
- if (preg_match ('|<#(.*?)#>|si ' , $ modules [$ i ]['TITLE ' ], $ arr )) {
181
- $ titleSearchNoty = constant ($ arr [1 ]);
182
- } else {
183
- $ titleSearchNoty = $ modules [$ i ]['NAME ' ];
184
- }
185
-
186
- $ getNOTY = SQLSelect ("SELECT * FROM `plugins_noty` WHERE `PLUGINS_ID` = (SELECT ID FROM `plugins` WHERE `MODULE_NAME` = ' " .$ titleSearchNoty ."') AND `READ` = 0 ORDER BY `ADD` DESC LIMIT 10 " );
184
+ foreach ($ getNOTY as $ keyNoty => $ notyValue ) {
185
+ if ($ notyValue ['MODULE_NAME ' ] == $ modules [$ i ]["NAME " ]) {
187
186
188
- if (!empty ($ getNOTY )) {
189
- $ modules [$ i ]['PLUGINS_NOTY_COUNT ' ] = count ($ getNOTY );
190
- $ modules [$ i ]['PLUGINS_NOTY_COLOR ' ] = $ getNOTY [0 ]['TYPE ' ];
191
- $ modules [$ i ]['PLUGINS_ID ' ] = $ getNOTY [0 ]['PLUGINS_ID ' ];
187
+ if (preg_match ('|<#(.*?)#>|si ' , $ notyValue ['MODULE_NAME ' ], $ arr )) {
188
+ $ titleSearchNoty = constant ($ arr [1 ]);
189
+ } else {
190
+ $ titleSearchNoty = $ notyValue ['MODULE_NAME ' ];
191
+ }
192
192
193
- foreach ($ getNOTY as $ keyNoty => $ noty ) {
194
- $ getNOTY [$ keyNoty ]['ADD_HUMAN ' ] = date ('d.m.Y H:i ' , $ noty ['ADD ' ]);
193
+ $ modules [$ i ]['PLUGINS_NOTY_COUNT ' ] = $ modules [$ i ]['PLUGINS_NOTY_COUNT ' ]+1 ;
194
+ $ modules [$ i ]['PLUGINS_NOTY_COLOR ' ] = $ notyValue ['TYPE ' ];
195
+ $ modules [$ i ]['PLUGINS_ID ' ] = $ notyValue ['PLUGINS_ID ' ];
196
+
197
+ $ getNOTY [$ keyNoty ]['ADD_HUMAN ' ] = date ('d.m.Y H:i ' , $ notyValue ['ADD ' ]);
198
+
199
+ $ modules [$ i ]['PLUGINS_NOTY ' ][] = $ getNOTY [$ keyNoty ];
200
+
201
+ unset($ getNOTY [$ keyNoty ]);
202
+ } else {
203
+ $ modules [$ i ]['PLUGINS_ID ' ] = $ notyValue ['PLUGINS_ID ' ] ?? null ;
195
204
}
196
-
197
- $ modules [$ i ]['PLUGINS_NOTY ' ] = $ getNOTY ;
198
- } else {
199
- $ modules [$ i ]['PLUGINS_NOTY_COUNT ' ] = 0 ;
200
- $ modules [$ i ]['PLUGINS_ID ' ] = $ getNOTY [0 ]['PLUGINS_ID ' ];
201
205
}
202
-
206
+
203
207
if (file_exists (ROOT . 'img/modules/ ' . $ modules [$ i ]['NAME ' ] . '.png ' )) {
204
208
$ modules [$ i ]['ICON_SM ' ] = ROOTHTML . 'img/modules/ ' . $ modules [$ i ]['NAME ' ] . '.png ' ;
205
209
} else {
0 commit comments