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

Last change on this file since 44 was 44, checked in by luciano, 15 years ago
File size: 11.6 KB
RevLine 
[44]1<?php
2 if ($user_level < 6) die ( __('Cheatin&#8217; uh?') ); // safety net to ctach cheets
3?>
4
5<h2>Managing the <a href="edit.php?page=parteibuch-aggregator/bdp-rssadmin.php">Parteibuch Aggregator</a> plugin</h2>
6
7<h3>The Parteibuch Aggregator has some stuff to configure:</h3>
8
9<ul>
10<li><b><a href="#addfeeds">1. add and manage the feeds</a></b> you wish to have in your Parteibuch Aggregator</li>
11<li><b><a href="#createlist">2. create/update lists</a></b> to group your feeds to lists that can be selected for filtering output</li>
12<li><b><a href="#createpbaoutput">3. create/update output formats and assign them to your blog pages</a></b></li>
13<li><b><a href="#globals">4. set/change some global configuration options</a></b> for the Parteibuch Aggregator</li>
14<?php
15if(function_exists('wp_register_sidebar_widget')){
16 echo '<li><b><a href="widgets.php">5. add widgets</a></b> with aggregated feeds to your sidebar</li>';
17}
18
19?>
20</ul>
21
22
23
24<p><hr /></p>
25
26<fieldset>
27<a name="addfeeds"></a>
28<h3>1: Feeds</h3>
29<h4>Add a new feed</h4>
30<form method="post" action="<?php echo $selfreference; ?>">
31 <table border="0" width="100%" cellspacing="2" cellpadding="5" class="editform">
32 <tr valign="middle">
33 <td align="left"><strong>RSS Address:</strong>
34 <input type="text" name="bdprss_new_feed_name" value="" size="60" />
35 <br />(multiple feeds can be entered as a comma separated list)<br/></td>
36 <td align="right">
37 <input type="submit" name="bdprss_add_feed_button" value="Add Feed &raquo;" />
38 </td>
39 </tr>
40 </table>
41</form>
42
43<?php
44global $bdprss_db;
45$overriden = FALSE;
46$result = $bdprss_db->get_all_sites();
47if($result) {
48?>
49 <hr width='50%' />
50 <h4>Current feeds</h4>
51 <table width="100%" cellpadding="3" cellspacing="3">
52<?php
53 $file = get_option('siteurl') . '/wp-admin/edit.php?page=' . PBA_DIRECTORY. '/bdp-rssadmin.php';
54 $now = $bdprss_db->now;
55
56 echo "<tr><th align='left'>Site and feed status</th><th>Site updated</th>".
57 "<th>GMT adj</th><th>Polling freq</th>".
58 "<th>Last poll</th><th>Cache updated</th><th>Next poll</th>".
59 "<th colspan='3'>Actions</th></tr>\n";
60
61 $benchmark = $now - (60 * 60 * 24 * 7); // highlight blogs with updates older than 7 days
62
63 if($result) {
64 $class='';
65 foreach($result as $r) {
66 $ref = $r->{$bdprss_db->cidentifier};
67 $url = $r->{$bdprss_db->cfeedurl};
68 $site = $r->{$bdprss_db->csitename};
69 $siteurl = $r->{$bdprss_db->csiteurl};
70 $description = $r->{$bdprss_db->cdescription};
71 $gmt = $r->{$bdprss_db->cgmtadjust};
72 $polled = PBALIB::gettheage( $r->{$bdprss_db->clastpolltime} );
73 $updated = PBALIB::gettheage( $r->{$bdprss_db->cupdatetime} );
74 $scheduled = PBALIB::gettheage( $r->{$bdprss_db->cnextpolltime} );
75 $pollingfreq = $r->{$bdprss_db->cpollingfreqmins};
76 if($scheduled == 'never') $scheduled = 'now';
77 $sno = $r->{$bdprss_db->csitenameoverride} == 'Y';
78
79 $siteUpdate = '';
80 $name = $url;
81 if($site)
82 {
83 $italics = ''; $unitalics = '';
84 if($sno) { $italics = '<b>*</b> <em>'; $unitalics = '</em>'; $overriden = TRUE; }
85 $name = "$italics<a href='$siteurl' title='$description'>"."$site</a>$unitalics";
86 $name .= " [<a href='$url' title='$url'>feed</a>]";
87
88 $ticks = $bdprss_db->get_most_recent_item_time($ref);
89 $bold = ''; $unbold ='';
90 if($ticks < $benchmark) { $bold = '<strong>'; $unbold ='</strong>'; }
91 $siteUpdate = " $bold".PBALIB::gettheage($ticks)."$unbold";
92 }
93
94 $bold = '';
95 $unbold = '';
96 if( $r->{$bdprss_db->clastpolltime} != $r->{$bdprss_db->cupdatetime} ) {
97 $bold = '<strong>';
98 $unbold = '</strong>';
99 }
100
101 $sbold = ''; $sunbold = '';
102 if($r->{$bdprss_db->cnextpolltime} < $now)
103 {
104 $sbold = '<strong>';
105 $sunbold = '</strong>';
106 }
107
108 $class = ('alternate' == $class) ? '' : 'alternate';
109
110 $errorCount = $bdprss_db->countErrors($url);
111 if($errorCount)
112 $name .= " <a href='".$file.
113 "&amp;action=errorlist&amp;rss=$ref'>[<strong>E&nbsp;$errorCount</strong>]</a>";
114
115 echo "<tr class='$class' valign='middle' align='center'>\n".
116 "\t<td align='left'>$name</td>\n".
117 "\t<td align='center'>$siteUpdate</td>\n".
118 "\t<td align='center'>";
119 if($gmt != 0.0) echo $gmt;
120 echo "</td>\n".
121 "\t<td align='center'>";
122 if( $pollingfreq ) echo "$pollingfreq minutes";
123 echo "</td>\n" .
124 "\t<td align='center'>$polled</td>\n" .
125 "\t<td align='center'>$bold $updated $unbold</td>\n".
126 "\t<td align='center'>$sbold $scheduled $sunbold</td>\n".
127 "\t<td align='center'><a href='" .$file.
128 "&amp;action=editfeed&amp;rss=$ref'>Edit</a></td>\n".
129 "\t<td align='center'><a href='" .$file.
130 "&amp;action=update&amp;rss=$ref'>Poll</a></td>\n".
131 "\t<td align='center'><a href='" .$file.
132 "&amp;action=delete&amp;rss=$ref'>Delete</a></td>\n".
133 "</tr>\n";
134 }
135 }
136}
137?>
138</table>
139
140<?php
141
142if($overriden)
143 echo "<p><b>Note:</b> Sites in italics have had their feed details overridden. ".
144 "To restore feed details: first edit the site, second un-tick the box to switch off the feed override, ".
145 "then hit the edit button, and finally poll the feed. </p>\n";
146
147// improved monitoring of feed errors
148if($bdprss_db->countErrors())
149{
150 echo "<hr width='50%' />\n\n<h4>Recent feed errrors</h4>\n\n";
151
152 echo "<table width='100%' cellpadding='3' cellspacing='3'>\n";
153 echo "<tr><td align='left'>".
154 "<a href='".$file."&amp;action=errorlist'>List all feed errors</a></td>\n";
155 echo "<td align='right'>".
156 "<a href='".$file."&amp;action=errordelete'>Delete the feed error table</a></td>\n";
157 echo "</tr></table>";
158}
159
160// lets put the list of URLs in the OUTPUT - they can be useful!
161if($result)
162{
163 echo "<hr width='50%' />\n\n<h4>A list of feeds</h4>\n\n";
164
165 echo "<p>This list can be copied and saved to a file. If you delete everything, ".
166 "you can paste the list into the add feeds box.</p>\n<p>";
167
168echo '<textarea cols="120" rows="5" readonly>';
169
170 $subsequent = false;
171 foreach($result as $r)
172 {
173 if($subsequent) echo " ";
174 $subsequent = true;
175 $url = $r->{$bdprss_db->cfeedurl};
176 echo $url;
177 }
178 echo "</textarea></p>\n";
179}
180?>
181</fieldset>
182
183<hr width='50%' />
184
185<fieldset>
186<h4>Manage feed related values</h4>
187
188<form method="post" action="<?php echo $selfreference; ?>">
189
190 <table border="0" width="100%" cellspacing="2" cellpadding="5" class="editform">
191 <tr valign="top">
192 <th width="40%" scope="row">
193 Standard feed polling frequency:
194 </th>
195 <td>
196 <input type="range" name="bdprss_new_frequency"
197 value="<?php echo get_option('bdprss_update_frequency'); ?>"
198 maxlength="3" size="3" /> minutes<br>
199 This frequency is used for all sites unless a non-standard
200 frequency is set above.
201 </td>
202 </tr>
203 <tr valign="top">
204 <th width="40%" scope="row">
205 Keep feed items for:
206 </th>
207 <td>
208 <input type="range" name="bdprss_keep_howlong"
209 value="<?php echo intval(get_option('bdprss_keep_howlong')); ?>"
210 maxlength="3" size="3" /> months (zero = forever)
211 </td>
212 </tr>
213 <tr valign="top">
214 <td align="right" colspan="2">
215 <input type="submit" name="bdprss_change_frequency_button"
216 value="Change &raquo;" />
217 </td>
218 </tr>
219 </table>
220
221</form>
222</fieldset>
223
224<hr width='50%' />
225
226<fieldset>
227<h4>Poll some RSS feeds</h4>
228<?php
229 echo "<table width='100%' cellpadding='3' cellspacing='3'>\n";
230 echo "<tr><td align='left'>".
231 "Be patient, this can take some time.";
232?></td><td align="right">
233
234<form method="post" action="<?php echo $selfreference; ?>">
235 <input type="submit" name="bdprss_poll_all_button" value="Poll some feeds" />
236</form>
237</td></tr></table>
238</fieldset>
239
240<p><hr /></p>
241
242<fieldset>
243<a name="createlist"></a>
244<h3>2: List filters</h3>
245
246<h4><a href="<?php echo "$selfreference&amp;action=createlist"; ?>">Create a new list filter</a></h4>
247
248<?php
249global $bdprss_db;
250$result = $bdprss_db->get_all_lists();
251$pbaoutputs = $bdprss_db->get_all_pbaoutputs();
252if($result) {
253 if($pbaoutputs){
254 foreach($pbaoutputs as $r) {
255 if(!isset($isdefaultlist[$r->{$bdprss_db->pbaodefaultlist}])) $isdefaultlist[$r->{$bdprss_db->pbaodefaultlist}] ="";
256 $isdefaultlist[$r->{$bdprss_db->pbaodefaultlist}] .= $r->{$bdprss_db->pbaoidentifier} . " ";
257 }
258 }
259
260?>
261
262 <h4>Current lists</h4>
263 <table width="100%" cellpadding="3" cellspacing="3">
264<?php
265 global $bdprss_db;
266
267 $file = get_option('siteurl') . '/wp-admin/edit.php?page=' . PBA_DIRECTORY. '/bdp-rssadmin.php';
268
269 echo "<tr><th>List ID</th><th width='60%'>Name</th><th colspan='3'>Actions</th></tr>\n";
270
271 if($result) {
272 $class = '';
273 foreach($result as $r) {
274 $id = $r->{$bdprss_db->lidentifier};
275 $name = htmlspecialchars($r->{$bdprss_db->lname});
276
277 $class = ('alternate' == $class) ? '' : 'alternate';
278
279 echo "<tr class='$class' valign='middle' align='center'>\n".
280 "<td>$id</td><td width='60%'>$name</td>".
281 "<td><a href='$selfreference&amp;action=editlist&amp;list=$id'>Edit</a></td><td>".
282 "<a title='Copy list filter #$id and edit it as new list ' href='$selfreference&amp;action=createlist&amp;list=$id'>Copy to new</a></td><td>";
283 if(!isset($isdefaultlist[$id])) {
284 echo "<a href='$selfreference&amp;action=dellist&amp;list=$id'>Delete</a>";
285 }else{
286 echo "Used by $isdefaultlist[$id]";
287 $displaylistnote=true;
288 }
289 echo "</td></tr>";
290 }
291 }
292}
293
294?>
295</table>
296</fieldset>
297<?php if($displaylistnote) echo "<p><b>Note:</b> List filters can only be deleted when they are not used as default list filter by any output format</p>\n"; ?>
298
299<p><hr /></p>
300
301<?php
302?>
303
304<fieldset>
305<a name="createpbaoutput"></a>
306<h3>3: Output streams</h3>
307
308<h4><a href="<?php echo "$selfreference&amp;action=createpbaoutput"; ?>">Create a new output format</a></h4>
309
310<?php
311global $bdprss_db;
312if(count($pbaoutputs)>=1) {
313?>
314
315 <h4>Current output streams</h4>
316 <table width="100%" cellpadding="3" cellspacing="3">
317<?php
318 global $bdprss_db;
319
320 $file = get_option('siteurl') . '/wp-admin/edit.php?page=' . PBA_DIRECTORY. '/bdp-rssadmin.php';
321
322 echo "<tr><th>Output format ID</th><th width='60%'>Name</th><th colspan='3'>Actions</th></tr>\n";
323
324 if($pbaoutputs) {
325 $class = '';
326 foreach($pbaoutputs as $r) {
327 $id = $r->{$bdprss_db->pbaoidentifier};
328 $name = htmlspecialchars($r->{$bdprss_db->pbaoname});
329
330 $class = ('alternate' == $class) ? '' : 'alternate';
331
332 echo "<tr class='$class' valign='middle' align='center'>\n".
333 "<td>$id</td><td width='60%'>$name</td>".
334 "<td><a href='$selfreference&amp;action=editpbaoutput&amp;pboutput=$id'>Edit</a></td>".
335 "<td><a title='Copy output format #$id and edit it as new pba output ' href='$selfreference&amp;action=createpbaoutput&amp;pboutput=$id'>Copy to new</a></td>".
336 "<td><a href='$selfreference&amp;action=delpbaoutput&amp;pboutput=$id'>Delete</a></td>".
337 "</tr>";
338 }
339 }
340}
341
342?>
343</table>
344</fieldset>
345
346
347
348<p><hr /></p>
349<a name="globals"></a>
350<h3>4. Manage some global options of the Parteibuch Aggregator</h3>
351<?php echo "<a href='$selfreference&amp;action=options'><b>Manage global options</b></a>"; ?>
352&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Do you want to have a look into programmer&#39;s hell? Go and get here <?php echo "<a href='$selfreference&amp;action=status'><b>some raw status info</b></a>."; ?>
353
354<p><hr /></p>
355
356<fieldset>
357<h3>Notes:</h3>
358<ul>
359
360<li>Although <b>designed for <a href="http://wordpress.org/">Wordpress'</a> single site RSS feeds</b>,
361this system should work with the RDF feeds generated by <a href="http://www.sixapart.com/">Typepad</a>
362and the ATOM feeds generated by <a href="http://www.blogger.com/start">Blogger</a>.
363It will not work with synthetic or multi-channel RSS or ATOM feeds.</li>
364
365<li>The number of feeds you will be able to carry will depend on the volume of traffic to your site,
366and the polling frequency. Typically each hit to your site will update one feed. The more visitors per hour,
367and the wider the polling interval, the more feeds you will be able to carry. </li>
368
369</ul>
370</fieldset>
371
Note: See TracBrowser for help on using the repository browser.