forked from chaosarium/lwt
-
Notifications
You must be signed in to change notification settings - Fork 20
/
do_feeds.php
689 lines (671 loc) · 28.5 KB
/
do_feeds.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
<?php
/**
* \file
* \brief Prepare RSS feeds.
*
* PHP version 8.1
*
* @category User_Interface
* @package Lwt
* @author andreask7 <[email protected]>
* @license Unlicense <http://unlicense.org/>
* @since 1.6.0-fork
* @since 2.7.1-fork Functional refactoring
*/
namespace Lwt\Interface\Do_Feeds;
require_once 'inc/session_utility.php';
function dummy_function_1(): array
{
global $tbpref;
$edit_text = 0;
$message = '';
$marked_items = implode(',', $_REQUEST['marked_items']);
$res = do_mysqli_query(
"SELECT * FROM (
SELECT * FROM {$tbpref}feedlinks
WHERE FlID IN ($marked_items)
ORDER BY FlNfID
) A
left join {$tbpref}newsfeeds ON NfID=FlNfID"
);
$count=$message1=$message2=$message3=$message4=0;
while ($row = mysqli_fetch_assoc($res)) {
if (get_nf_option($row['NfOptions'], 'edit_text') == 1) {
if ($edit_text==1) {
$count++;
} else {
echo '<form class="validate" action="do_feeds.php" method="post">';
$edit_text=1;
}
}
$doc = array();
$doc[0] = array(
'link' => empty($row['FlLink'])?('#'.$row['FlID']):$row['FlLink'],
'title' => $row['FlTitle'],
'audio' => $row['FlAudio'],
'text' => $row['FlText']
);
$NfName = (string) $row['NfName'];
$nf_id = (int) $row['NfID'];
$nf_options = $row['NfOptions'];
if (!$nf_tag_name = get_nf_option($nf_options, 'tag')) {
$nf_tag_name = mb_substr($NfName, 0, 20, "utf-8");
}
if (!$nf_max_texts = (int)get_nf_option($nf_options, 'max_texts')) {
$nf_max_texts = (int)getSettingWithDefault('set-max-texts-per-feed');
}
$texts = get_text_from_rsslink(
$doc, $row['NfArticleSectionTags'], $row['NfFilterTags'],
get_nf_option($nf_options, 'charset')
);
if (isset($texts['error'])) {
echo $texts['error']['message'];
foreach ($texts['error']['link'] as $err_links) {
runsql(
'UPDATE ' . $tbpref . 'feedlinks
SET FlLink=CONCAT(" ",FlLink)
where FlLink in ('.convert_string_to_sqlsyntax($err_links).')',
""
);
}
unset($texts['error']);
}
if (get_nf_option($nf_options, 'edit_text')==1) {
foreach ($texts as $text) {
?>
<table class="tab3" cellspacing="0" cellpadding="5">
<tr>
<td class="td1 right">
<input class="markcheck" type="checkbox" name="Nf_count[<?php echo $count; ?>]" value="<?php echo $count; ?>" checked="checked" />
Title:
</td>
<td class="td1">
<input type="text" class="notempty" name="feed[<?php echo $count; ?>][TxTitle]" value="<?php echo tohtml($text['TxTitle']); ?>" maxlength="200" size="60" />
<img src="icn/status-busy.png" title="Field must not be empty" alt="Field must not be empty" />
</td>
</tr>
<tr>
<td class="td1 right">Language:</td>
<td class="td1">
<select name="feed[<?php echo $count; ?>][TxLgID]" class="notempty setfocus">
<?php
$result = do_mysqli_query(
"SELECT LgName,LgID FROM " . $tbpref . "languages
where LgName<>'' ORDER BY LgName"
);
while ($row_l = mysqli_fetch_assoc($result)) {
echo '<option value="' . $row_l['LgID'] . '"';
if ($row['NfLgID']===$row_l['LgID']) {
echo ' selected="selected"';
}
echo '>' . $row_l['LgName'] . '</option>';
}
mysqli_free_result($result);
?>
</select>
</td>
</tr>
<tr>
<td class="td1 right">Text:</td>
<td class="td1">
<textarea
<?php echo getScriptDirectionTag((int) $row['NfLgID']); ?>
name="feed[<?php echo $count; ?>][TxText]" class="notempty checkbytes"
cols="60" rows="20"
><?php echo tohtml($text['TxText']); ?></textarea>
<img src="icn/status-busy.png" title="Field must not be empty"
alt="Field must not be empty" />
</td>
</tr>
<tr>
<td class="td1 right">Source URI:</td>
<td class="td1">
<input type="text" class="checkurl"
name="feed[<?php echo $count; ?>][TxSourceURI]"
value="<?php echo $text['TxSourceURI']; ?>" maxlength="1000"
size="60" />
</td>
</tr>
<tr>
<td class="td1 right">Tags:</td>
<td class="td1">
<ul name="feed[<?php echo $count; ?>][TagList][]"
style="width:340px;margin-top:0px;margin-bottom:0px;margin-left:2px;">
<li>
<?php echo $nf_tag_name; ?>
</li>
</ul>
<input type="hidden" name="feed[<?php echo $count; ?>][Nf_ID]" value="<?php echo $nf_id; ?>" />
<input type="hidden" name="feed[<?php echo $count; ?>][Nf_Max_Texts]" value="<?php echo $nf_max_texts; ?>" />
</td>
</tr>
<tr>
<td class="td1 right">Audio-URI:</td>
<td class="td1">
<input type="text" name="feed[<?php echo $count; ?>][TxAudioURI]" value="<?php echo $text['TxAudioURI']; ?>" maxlength="200" size="60" />
</td>
</tr>
</table>
<?php
}
} else {
do_mysqli_query(
'insert ignore into ' . $tbpref . 'tags2 (T2Text)
values("' . $nf_tag_name . '")'
);
foreach ($texts as $text) {
echo '<div class="msgblue">
<p class="hide_message">+++ "' . $text['TxTitle']. '" added! +++</p>
</div>';
do_mysqli_query(
'INSERT INTO ' . $tbpref . 'texts (
TxLgID,TxTitle,TxText,TxAudioURI,TxSourceURI
)
VALUES (
'.$row['NfLgID'].',' .
convert_string_to_sqlsyntax($text['TxTitle']) .','.
convert_string_to_sqlsyntax($text['TxText']) .','.
convert_string_to_sqlsyntax($text['TxAudioURI']) .','.
convert_string_to_sqlsyntax($text['TxSourceURI']) .'
)'
);
$id = get_last_key();
splitCheckText(
get_first_value(
'select TxText as value from ' . $tbpref . 'texts
where TxID = ' . $id
),
get_first_value(
'select TxLgID as value from ' . $tbpref . 'texts
where TxID = ' . $id
),
$id
);
runsql(
'insert into ' . $tbpref . 'texttags (TtTxID, TtT2ID)
select ' . $id . ', T2ID
from ' . $tbpref . 'tags2
where T2Text = "' . $nf_tag_name .'"',
""
);
}
get_texttags(1);
$result = do_mysqli_query(
"SELECT TtTxID FROM " . $tbpref . "texttags
join " . $tbpref . "tags2 on TtT2ID=T2ID
WHERE T2Text='". $nf_tag_name ."'"
);
$text_count=0;
$text_item = array();
while ($row = mysqli_fetch_assoc($result)) {
$text_item[$text_count++] = $row['TtTxID'];
}
mysqli_free_result($result);
if (!empty($text_item)) {
sort($text_item, SORT_NUMERIC);
if ($text_count>$nf_max_texts) {
$text_item=array_slice($text_item, 0, $text_count-$nf_max_texts);
foreach ($text_item as $text_ID) {
$temp = runsql(
'delete from ' . $tbpref . 'textitems2 where Ti2TxID = ' . $text_ID,
""
);
if (is_numeric($temp)) {
$message3 += (int) $temp;
}
$temp = runsql(
'delete from ' . $tbpref . 'sentences where SeTxID = ' . $text_ID,
""
);
if (is_numeric($temp)) {
$message2 += (int) $temp;
}
$temp = runsql(
'INSERT INTO ' . $tbpref . 'archivedtexts (
AtLgID, AtTitle, AtText,
AtAnnotatedText, AtAudioURI, AtSourceURI
)
SELECT TxLgID, TxTitle, TxText,
TxAnnotatedText, TxAudioURI, TxSourceURI
FROM ' . $tbpref . 'texts
WHERE TxID = ' . $text_ID,
""
);
if (is_numeric($temp)) {
$message4 += (int) $temp;
}
$id = get_last_key();
runsql(
'INSERT INTO ' . $tbpref . 'archtexttags (AgAtID, AgT2ID)
SELECT ' . $id . ', TtT2ID
FROM ' . $tbpref . 'texttags
WHERE TtTxID = ' . $text_ID,
""
);
$temp = runsql(
'DELETE FROM ' . $tbpref . 'texts
WHERE TxID = ' . $text_ID,
""
);
if (is_numeric($temp)) {
$message1 += (int) $temp;
}
adjust_autoincr('texts', 'TxID');
adjust_autoincr('sentences', 'SeID');
runsql(
"DELETE " . $tbpref . "texttags
FROM ("
. $tbpref . "texttags
LEFT JOIN " . $tbpref . "texts
ON TtTxID = TxID
)
WHERE TxID IS NULL",
''
);
}
}
}
}
}
mysqli_free_result($res);
if ($message4>0 || $message1>0) {
$message = "Texts archived: $message1 / Sentences deleted: $message2" .
" / Text items deleted: $message3";
}
if ($edit_text==1) {
?>
<input id="markaction" type="submit" value="Save" />
<input type="button" value="Cancel" onclick="location.href='do_feeds.php';" />
<input type="hidden" name="checked_feeds_save" value="1" />
</form>
<script type="text/javascript">
$(document).ready(function() {
$(document).scrollTo($('table').eq(0));
});
$('input[type="checkbox"]').change(function(){
var feed = '[name^=feed\\['+ $(this).val() +'\\]';
if(this.checked){
$(feed+']').prop('disabled', false);
$(feed+'\\[TxTitle\\]],'+feed+'\\[TxText\\]]').addClass("notempty");
$('ul'+feed+']').css("background","");
$('ul'+feed+'] li.tagit-new input').prop('disabled', false)
.addClass("ui-widget-content");
$('ul'+feed+'] a').css("display", "");
$('ul'+feed+'] li').css("color", "").css("background", "");
} else {
$(feed+']').prop('disabled', true).removeClass("notempty");
var bg=$('textarea'+feed+']').css("background");
$('ul'+feed+']').css("background",bg);
$('ul'+feed+'] li.tagit-new input').prop('disabled', true)
.removeClass("ui-widget-content");
$('ul'+feed+'] a').css("display", "none");
$('ul'+feed+'] li').css("color", $('textarea'+feed+']')
.css("color")).css("background", "transparent");
}
});
$('ul[name^="feed"]').each(function() {
var tagrepl=$(this).attr('name');
$(this).tagit({
availableTags : TEXTTAGS,
fieldName: tagrepl
});});
</script>
<?php
}
if ($edit_text==1) {
echo '</form>';
}
?>
<script type="text/javascript">
$(".hide_message").delay(2500).slideUp(1000);
</script>
<?php
return array($edit_text, $message);
}
function check_errors($message): void
{
if (isset($_REQUEST['checked_feeds_save'])) {
$message = write_rss_to_db($_REQUEST['feed']);
?>
<script type="text/javascript">
$(".hide_message").delay(2500).slideUp(1000);
</script>
<?php
}
if (isset($_SESSION['feed_loaded'])) {
foreach ($_SESSION['feed_loaded'] as $lf) {
if (substr($lf, 0, 5) == "Error") {
echo "\n<div class=\"red\"><p>";
} else {
echo "\n<div class=\"msgblue\"><p class=\"hide_message\">";
}
echo "+++ ",$lf," +++</p></div>";
}
?>
<script type="text/javascript">
$(".hide_message").delay(2500).slideUp(1000);
</script>
<?php
unset($_SESSION['feed_loaded']);
}
echo error_message_with_hide($message, false);
}
function dummy_function_2($currentlang, $currentfeed): void
{
global $tbpref, $debug;
$currentquery = (string) processSessParam("query", "currentrssquery", '', false);
$currentquerymode = (string) processSessParam(
"query_mode", "currentrssquerymode", 'title,desc,text', false
);
$currentregexmode = getSettingWithDefault("set-regex-mode");
$wh_query = $currentregexmode . 'like ' . convert_string_to_sqlsyntax(
($currentregexmode == '') ?
str_replace("*", "%", mb_strtolower($currentquery, 'UTF-8')) :
$currentquery
);
switch ($currentquerymode) {
case 'title,desc,text':
$wh_query=' and (FlTitle ' . $wh_query . ' or FlDescription ' . $wh_query . ' or FlText ' . $wh_query . ')';
break;
case 'title':
$wh_query=' and (FlTitle ' . $wh_query . ')';
break;
}
if ($currentquery!=='') {
if ($currentregexmode!=='') {
if (@mysqli_query($GLOBALS["DBCONNECTION"], 'select "test" rlike ' . convert_string_to_sqlsyntax($currentquery))===false) {
$currentquery='';
$wh_query = '';
unset($_SESSION['currentwordquery']);
if (isset($_REQUEST['query'])) {
echo '<p id="hide3" style="color:red;text-align:center;">+++ Warning: Invalid Search +++</p>';
}
}
}
} else {
$wh_query = '';
}
$currentpage = (int) processSessParam("page", "currentrsspage", '1', true);
$currentsort = (int) processDBParam("sort", 'currentrsssort', '2', true);
?>
<div class="flex-spaced">
<div title="Import of a single text, max. 65,000 bytes long, with optional audio">
<a href="edit_feeds.php?new_feed=1">
<img src="icn/feed--plus.png">
New Feed
</a>
</div>
<div>
<a href="edit_feeds.php?manage_feeds=1">
<img src="icn/plus-button.png" title="manage feeds" alt="manage feeds" />
Manage Feeds
</a>
</div>
<div>
<a href="edit_texts.php?query=&page=1">
<img src="icn/drawer--plus.png">
Active Texts
</a>
</div>
<div>
<a href="edit_archivedtexts.php?query=&page=1">
<img src="icn/drawer--minus.png">
Archived Texts
</a>
</div>
</div>
<form name="form1" action="#" onsubmit="document.form1.querybutton.click(); return false;">
<table class="tab2" cellspacing="0" cellpadding="5"><tr>
<th class="th1" colspan="4">
Filter <img src="icn/funnel.png" title="Filter" alt="Filter" />
<input type="button" value="Reset All" onclick="resetAll('do_feeds.php');" />
</th>
</tr>
<tr>
<td class="td1 center" style="width:30%;">
Language:
<select name="filterlang" onchange="{setLang(document.form1.filterlang,'do_feeds.php?page=1%26selected_feed=0');}">
<?php echo get_languages_selectoptions($currentlang, '[Filter off]'); ?>
</select>
</td>
<td class="td1 center" colspan="3">
<select name="query_mode" onchange="{val=document.form1.query.value;mode=document.form1.query_mode.value; location.href='do_feeds.php?page=1&query=' + val + '&query_mode=' + mode;return false;}">
<option value="title,desc,text"<?php
if ($currentquerymode=="title,desc,text") {
echo ' selected="selected"';
} ?>>Title, Desc., Text</option>
<option disabled="disabled">------------</option>
<option value="title"<?php
if ($currentquerymode=="title") {
echo ' selected="selected"';
} ?>>Title</option>
</select>
<span style="vertical-align: middle">
<?php
if ($currentregexmode=='') {
echo ' (Wildc.=*):';
} elseif ($currentregexmode=='r') {
echo 'RegEx Mode:';
} else {
echo 'RegEx(CS) Mode:';
}
?>
</span>
<input type="text" name="query" value="<?php echo tohtml($currentquery); ?>" maxlength="50" size="15" />
<input type="button" name="querybutton" value="Filter" onclick="{val=document.form1.query.value;val=encodeURIComponent(val); location.href='do_feeds.php?page=1&query=' + val;return false;}" />
<input type="button" value="Clear" onclick="{location.href='do_feeds.php?page=1&query=';return false;}" />
</td>
</tr>
<tr>
<td class="td1 center" colspan="2" style="width:70%;"><?php
if (!empty($currentlang)) {
$result = do_mysqli_query(
"SELECT NfName, NfID, NfUpdate FROM {$tbpref}newsfeeds
WHERE NfLgID=$currentlang ORDER BY NfUpdate DESC"
);
} else {
$result = do_mysqli_query(
"SELECT NfName, NfID, NfUpdate FROM {$tbpref}newsfeeds
ORDER BY NfUpdate DESC"
);
}
if (!mysqli_data_seek($result, 0)) {
echo ' no feed available</td><td class="td1"></td></tr></table></form>';
}
if (mysqli_data_seek($result, 0)) {
?>Newsfeed:
<select name="selected_feed" onchange="{val=document.form1.selected_feed.value;location.href='do_feeds.php?page=1&selected_feed=' + val;return false;}">
<option value="0">[Filter off]</option>
<?php
$feeds_list = '';
$time='';
while ($row = mysqli_fetch_assoc($result)) {
echo '<option value="' . $row['NfID'] . '"';
if ($currentfeed === $row['NfID']) {
echo ' selected="selected"';
$time = $row['NfUpdate'];
}
echo '>' . tohtml($row['NfName']) . '</option>';
$feeds_list .= ',' . $row['NfID'];
}
mysqli_free_result($result);
echo '</select>
</td>
<td class="td1 center" colspan="2">';
if ($currentfeed == 0 || $currentfeed == '' || strpos($feeds_list, $currentfeed) === false) {
$currentfeed = substr($feeds_list, 1);
// explode(',', $feeds_list)[0] may work as well (2.8.0)
}
if (strpos($currentfeed, ',')===false) {
echo '<a href="' . $_SERVER['PHP_SELF'] . '?page=1&load_feed=1&selected_feed=' . $currentfeed . '">
<span title="update feed"><img src="icn/arrow-circle-135.png" alt="-" /></span></a>';
} else {
echo '<a href="edit_feeds.php?multi_load_feed=1&selected_feed=' . $currentfeed . '">
update multiple feeds</a>';
}
if ($time) {
$diff = time() - (int) $time;
print_last_feed_update($diff);
}
echo '</td></tr>';
$sql = "SELECT count(*) AS value FROM {$tbpref}feedlinks
WHERE FlNfID in ($currentfeed)$wh_query";
$recno = (int)get_first_value($sql);
if ($debug) {
echo $sql . ' ===> ' . $recno;
}
if ($recno) {
$maxperpage = (int)getSettingWithDefault('set-articles-per-page');
$pages = $recno == 0 ? 0 : (intval(($recno-1) / $maxperpage) + 1);
if ($currentpage < 1) {
$currentpage = 1;
}
if ($currentpage > $pages) {
$currentpage = $pages;
}
$limit = 'LIMIT ' . (($currentpage-1) * $maxperpage) . ',' . $maxperpage;
$sorts = array('FlTitle','FlDate DESC','FlDate ASC');
$lsorts = count($sorts);
if ($currentsort < 1) {
$currentsort = 1;
}
if ($currentsort > $lsorts) {
$currentsort = $lsorts;
}
echo '<tr><th class="th1" style="width:30%;"> '. $total=$recno .' articles ';///
echo '</th><th class="th1">';
makePager($currentpage, $pages, 'do_feeds.php', 'form1');
?>
</th>
<th class="th1" colspan="2" nowrap="nowrap">
Sort Order:
<select name="sort" onchange="{val=document.form1.sort.options[document.form1.sort.selectedIndex].value; location.href='do_feeds.php?page=1&sort=' + val;return false;}"><?php echo get_textssort_selectoptions($currentsort); ?></select>
</th>
</tr>
</table></form>
<form name="form2" action="<?php echo $_SERVER['PHP_SELF'] ?>" method="post">
<table class="tab2" cellspacing="0" cellpadding="5">
<tr><th class="th1" colspan="2">Multi Actions <img src="icn/lightning.png" title="Multi Actions" alt="Multi Actions" /></th></tr>
<tr><td class="td1 center" style="width:30%;">
<input type="button" value="Mark All" onclick="selectToggle(true,'form2');" />
<input type="button" value="Mark None" onclick="selectToggle(false,'form2');" />
</td><td class="td1 center">
Marked Texts:
<input id="markaction" type="submit" value="Get Marked Texts" />
</td></tr></table>
<table class="tab2 sortable" cellspacing="0" cellpadding="5">
<tr>
<th class="th1 sorttable_nosort">Mark</th>
<th class="th1 clickable">Articles</th>
<th class="th1 sorttable_nosort">Link</th>
<th class="th1 clickable" style="min-width:90px;">Date</th>
</tr>
<?php
$result = do_mysqli_query(
"SELECT FlID, FlTitle, FlLink, FlDescription, FlDate,
FlAudio,TxID, AtID
FROM " . $tbpref . "feedlinks
left join " . $tbpref . "texts
on TxSourceURI=trim(FlLink)
left join " . $tbpref . "archivedtexts
on AtSourceURI=trim(FlLink)
WHERE FlNfID in ($currentfeed) ".$wh_query."
ORDER BY " . $sorts[$currentsort-1] . " ". $limit
);
while ($row = mysqli_fetch_assoc($result)) {
echo '<tr>';
if ($row['TxID']) {
echo '<td class="td1 center"><a href="do_text.php?start=' .
$row['TxID'] . '" >
<img src="icn/book-open-bookmark.png" title="Read" alt="-" /></a>';
} elseif ($row['AtID']) {
echo '<td class="td1 center"><span title="archived"><img src="icn/status-busy.png" alt="-" /></span>';
} elseif (!empty($row['FlLink']) && str_starts_with((string) $row['FlLink'], ' ')) {
echo '<td class="td1 center">
<img class="not_found" name="' .
$row['FlID'] .
'" title="download error" src="icn/exclamation-button.png" alt="-" />';
} else {
echo '<td class="td1 center"><input type="checkbox" class="markcheck" name="marked_items[]" value="' .
$row['FlID'] . '" />';
}
echo '</td>
<td class="td1 center">
<span title="' . htmlentities((string) $row['FlDescription'], ENT_QUOTES, 'UTF-8', false) . '"><b>' .
$row['FlTitle'] . '</b></span>';
if ($row['FlAudio']) {
echo '<a href="' . $row['FlAudio'] .
'" onclick="window.open(this.href, \'child\', \'scrollbars,width=650,height=600\'); return false;">
<img src="'; print_file_path('icn/speaker-volume.png'); echo '" alt="-" /></a>';
}
echo '</td>
<td class="td1 center" style="vertical-align: middle">';
if (
!empty($row['FlLink']) &&
!str_starts_with(trim((string) $row['FlLink']), '#')
) {
echo '<a href="' . trim((string) $row['FlLink']) . '" title="' .
trim((string) $row['FlLink']) . '" onclick="window.open(\'' .
$row['FlLink'] . '\');return false;">
<img src="icn/external.png" alt="-" /></a>';
}
echo '</td><td class="td1 center">' . $row['FlDate'] . '</td></tr>';
}
mysqli_free_result($result);
echo '</table>';
echo '</form>';
if ($pages > 1) {
echo '<form name="form3" method="get" action ="">
<table class="tab2" cellspacing="0" cellpadding="5">
<tr><th class="th1" style="width:30%;">';
echo $total;
echo '</th><th class="th1">';
makePager($currentpage, $pages, 'do_feeds.php', 'form3');
echo '</th></tr></table></form>';
}
} else {
echo '</table></form>';
}
}
?>
<script type="text/javascript">
$('img.not_found').on('click', function () {
var id = $(this).attr('name');
$(this).after('<label class="wrap_checkbox" for="'+id+'"><span></span></label>');
$(this).replaceWith(
'<input type="checkbox" class="markcheck" onchange="markClick()" id=' + id +
' value=' + id +' name="marked_items[]" />'
);
$(":input,.wrap_checkbox span,a:not([name^=rec]),select")
.each(function (i) { $(this).attr('tabindex', i + 1); });
});
</script>
<?php
}
function do_page(): void
{
session_start();
$currentlang = validateLang(
(string) processDBParam("filterlang", 'currentlanguage', '', false)
);
pagestart('My ' . getLanguage($currentlang) . ' Feeds', true);
$currentfeed = (string) processSessParam(
"selected_feed", "currentrssfeed", '', false
);
$edit_text = 0;
$message = '';
if (isset($_REQUEST['marked_items']) && is_array($_REQUEST['marked_items'])) {
list($edit_text, $message) = dummy_function_1();
}
check_errors($message);
if (isset($_REQUEST['load_feed']) || isset($_REQUEST['check_autoupdate'])
|| (isset($_REQUEST['markaction']) && $_REQUEST['markaction']=='update')
) {
load_feeds($currentfeed);
} else if (empty($edit_text)) {
dummy_function_2($currentlang, $currentfeed);
}
pageend();
}
do_page();
?>