Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1 | daniel-mar | 1 | <?php |
2 | |||
3 | if (!defined('WBLEGAL')) die('Kann nicht ohne Personal WebBase ausgeführt werden.'); |
||
4 | |||
5 | if (inetconn_ok()) |
||
6 | { |
||
7 | $res3 = db_query("SELECT `id`, `url`, `name`, `update_text_begin`, `update_text_end`, `update_lastchecked`, `update_lastcontent`, `update_checkurl`, `new_tag`, `broken_tag`, `user_cnid` FROM `".$WBConfig->getMySQLPrefix()."links` WHERE (`update_enabled` = '1') AND (((`update_lastchecked` <= DATE_SUB(NOW(), INTERVAL ".$configuration[$m2]['update_checkinterval_min']." MINUTE)) AND (`broken_tag` = '0')) OR ((`update_lastchecked` <= DATE_SUB(NOW(), INTERVAL ".$configuration[$m2]['kaputt_checkinterval_min']." MINUTE)) AND (`broken_tag` = '1'))) ORDER BY `id`"); |
||
8 | while ($row3 = db_fetch($res3)) |
||
9 | { |
||
10 | // Ist unsere Bedingung immer noch aktuell? Da sich die Cron-Scripts aufgrund Überlastung |
||
11 | // überschneiden können, könnte ohne diese Prüfung ein Link 10 Mal pro Sitzung geprüft werden |
||
12 | $res_check = db_query("SELECT `id` FROM `".$WBConfig->getMySQLPrefix()."links` WHERE (`update_enabled` = '1') AND (((`update_lastchecked` <= DATE_SUB(NOW(), INTERVAL ".$configuration[$m2]['update_checkinterval_min']." MINUTE)) AND (`broken_tag` = '0')) OR ((`update_lastchecked` <= DATE_SUB(NOW(), INTERVAL ".$configuration[$m2]['kaputt_checkinterval_min']." MINUTE)) AND (`broken_tag` = '1'))) AND (`id` = '".db_escape($row3['id'])."')"); |
||
13 | if (db_num($res_check) > 0) |
||
14 | { |
||
15 | db_query("UPDATE `".$WBConfig->getMySQLPrefix()."links` SET `update_lastchecked` = NOW() WHERE `id` = '".db_escape($row3['id'])."'"); |
||
16 | |||
17 | $update_checkurl = $row3['update_checkurl']; |
||
18 | |||
19 | if (strpos($update_checkurl, '://') === false) |
||
20 | $update_checkurl = 'http://'.$update_checkurl; |
||
21 | |||
22 | $update_checkurl = entferne_anker($update_checkurl); |
||
23 | $update_checkurl = decode_critical_html_characters($update_checkurl); |
||
24 | |||
25 | $a = zwischen_url($update_checkurl, decode_critical_html_characters($row3['update_text_begin']), decode_critical_html_characters($row3['update_text_end'])); |
||
26 | $fehler = $a === false; |
||
27 | |||
28 | // Debuginformationen |
||
29 | $debug = $a; |
||
30 | |||
31 | $a = md5($a); |
||
32 | $b = $row3['update_lastcontent']; |
||
33 | |||
34 | if ($fehler) |
||
35 | { |
||
36 | $kaputt = '1'; |
||
37 | $new = $row3['new_tag']; |
||
38 | } |
||
39 | else |
||
40 | { |
||
41 | $kaputt = '0'; |
||
42 | $new = ($a == $b) ? '0' : '1'; |
||
43 | } |
||
44 | |||
45 | if ($row3['broken_tag'] != $kaputt) |
||
46 | { |
||
47 | db_query("UPDATE `".$WBConfig->getMySQLPrefix()."links` SET `broken_tag` = '".db_escape($kaputt)."' WHERE `id` = '".db_escape($row3['id'])."'"); |
||
48 | } |
||
49 | |||
50 | if ($row3['new_tag'] != $new) |
||
51 | { |
||
52 | if ($new == '1') |
||
53 | { |
||
54 | db_query("UPDATE `".$WBConfig->getMySQLPrefix()."links` SET `new_tag` = '".db_escape($new)."', update_lastcontent = '".db_escape($a)."' WHERE `id` = '".db_escape($row3['id'])."'"); |
||
55 | |||
56 | // Dual-Crossover (statisch) |
||
57 | $x2 = 'common_links_notifier'; |
||
58 | $inp_user = $row3['user_cnid']; |
||
59 | |||
60 | $module_information = WBModuleHandler::get_module_information($x2); |
||
61 | |||
62 | if (file_exists('modules/'.$x2.'/static/'.$m2.'/notify.inc.php')) |
||
63 | { |
||
64 | include 'modules/'.$x2.'/static/'.$m2.'/notify.inc.php'; |
||
65 | } |
||
66 | } |
||
67 | else |
||
68 | { |
||
69 | db_query("UPDATE `".$WBConfig->getMySQLPrefix()."links` SET `new_tag` = '".db_escape($new)."' WHERE `id` = '".db_escape($row3['id'])."'"); |
||
70 | } |
||
71 | } |
||
72 | } |
||
73 | } |
||
74 | } |
||
75 | |||
76 | ?> |