source: trunk/www.guidonia.net/wp/wp-content/plugins/parteibuch-aggregator/bdp-rssadmin-error.php@ 44

Last change on this file since 44 was 44, checked in by luciano, 14 years ago
File size: 1.3 KB
Line 
1<?php
2if ($user_level < 6) die ( __('Cheatin&#8217; uh?') );
3
4if($rss)
5 $result = $bdprss_db->get_site_by_id(intval($rss));
6else
7 $result ='';
8
9if($result)
10 $url = $result->{$bdprss_db->cfeedurl};
11else
12 $url = '';
13
14$result = $bdprss_db->getErrors($url);
15$cache = array();
16$sitename = false;
17?>
18<h2>Recent feed errors</h2>
19<?php
20if($result)
21{
22?>
23
24 <table width="100%" cellpadding="3" cellspacing="3">
25 <tr><th align='left'>Feed</th><th>#</th><th>Time of error</th><th align='left'>Error</th></tr>
26
27<?php
28 foreach($result as $r)
29 {
30 $url = $r->{$bdprss_db->efeedurl};
31 $id = $r->{$bdprss_db->eidentifier};
32 $ticks = $r->{$bdprss_db->etime};
33 $error = $r->{$bdprss_db->etext};
34
35 $error = preg_replace("/&#39;/", "'", $error);
36 $error = preg_replace('/&quot;/', '"', $error);
37
38 if(isset($cache[$url]))$sitename = $cache[$url];
39 if(!$sitename)
40 {
41 $result = $bdprss_db->get_site($url);
42 if($result)
43 {
44 $sitename = $result->{$bdprss_db->csitename};
45 $cache[$url] = $sitename;
46 }
47 }
48
49 if($sitename)
50 $url = "<a href='$url'>$sitename</a>";
51 else
52 $url = "<a href='$url'>$url</a>";
53
54 $age = PBALIB::gettheage($ticks);
55
56 echo "<tr align='center'><td align='left'>$url</td><td>$id</td>".
57 "<td>$age</td><td align='left'>".$error."</td></tr>\n";
58 }
59?>
60 </table>
61<?php
62}
63else
64{
65?>
66 <p>No errors found.</p>
67<?php
68}
69?>
Note: See TracBrowser for help on using the repository browser.