source: trunk/www.guidonia.net/wp/wp-content/plugins/parteibuch-aggregator/pba-admin-output.php@ 44

Last change on this file since 44 was 44, checked in by luciano, 14 years ago
File size: 17.8 KB
Line 
1<?php
2
3if ($user_level < 6) die ( __('Cheatin&#8217; uh?') );
4
5?>
6
7<h2><a href="edit.php?page=parteibuch-aggregator/bdp-rssadmin.php">Parteibuch Aggregator</a>: Configuration of output format #<?php echo $pboutput; ?></h2>
8
9<fieldset>
10
11<form method="post" action="<?php echo $selfreference; ?>">
12
13
14<?php
15
16global $bdprss_db;
17
18$pbastartconfig=0;
19if(isset($_GET['pbstart'])){
20 $pbastartconfig=abs(intval($_GET['pbstart']));
21}
22$pba_editpbaoutput_button='<input type="submit" name="pba_edit_output_button" value="&raquo;Save&raquo;" />';
23
24$result = $bdprss_db->get_pbaoutput($pboutput);
25
26if(!$result) {
27 echo "<p><b>Unexpected error:</b> could not find output format #$pboutput </p>\n";
28} else {
29 if($pbastartconfig > 0){
30 echo '<input type="hidden" name="pbstart" value="'.$pbastartconfig.'" />';
31 echo '<input type="hidden" name="action" value="status" />';
32 }
33
34 // setup stuff
35 $pbaoname = bdpDisplayCode($result->{$bdprss_db->pbaoname});
36 $pbaopage2hookin = abs(intval($result->{$bdprss_db->pbaopage2hookin}));
37
38//items to be displayed
39 $pbaodefaultlist = $result->{$bdprss_db->pbaodefaultlist};
40 $pbaoformattype = $result->{$bdprss_db->pbaoformattype};
41 $pbaomaxitems = $result->{$bdprss_db->pbaomaxitems};
42
43//item formatting
44 $pbaotemplate_ticker = bdpDisplayCode($result->{$bdprss_db->pbaotemplate_ticker});
45
46 $pbaoappend_extra_link = $result->{$bdprss_db->pbaoappend_extra_link};
47 $pbaoappend_cache_link = $result->{$bdprss_db->pbaoappend_cache_link};
48 $pbaoadd_social_bookmarks = $result->{$bdprss_db->pbaoadd_social_bookmarks};
49
50 $pbaosidebarwidget = bdpDisplayCode($result->{$bdprss_db->pbaosidebarwidget});
51
52 $pbaomaxlength = $result->{$bdprss_db->pbaomaxlength};
53 $pbaomaxwordlength = $result->{$bdprss_db->pbaomaxwordlength};
54 $pbaoitem_date_format = bdpDisplayCode($result->{$bdprss_db->pbaoitem_date_format});
55 $pbaoallowablexhtmltags = preg_split("','", $result->{$bdprss_db->pbaoallowablexhtmltags}, -1, PREG_SPLIT_NO_EMPTY);
56
57//cachepage options
58 $pbaoiscachable = bdpDisplayCode($result->{$bdprss_db->pbaoiscachable});
59 $pbaocacheviewpage = bdpDisplayCode($result->{$bdprss_db->pbaocacheviewpage});
60 $pba_otemplate_cache = bdpDisplayCode($result->{$bdprss_db->otemplate_cache});
61
62//feed options
63 $pba_channel_title = bdpDisplayCode($result->{$bdprss_db->pba_channel_title});
64 $pba_channel_link = bdpDisplayCode($result->{$bdprss_db->pba_channel_link});
65 $pba_channel_description = bdpDisplayCode($result->{$bdprss_db->pba_channel_description});
66 $pba_channel_language = bdpDisplayCode($result->{$bdprss_db->pba_channel_language});
67 $pba_channel_copyright = bdpDisplayCode($result->{$bdprss_db->pba_channel_copyright});
68
69//kalender options
70 $pba_otemplate_kalender = bdpDisplayCode($result->{$bdprss_db->otemplate_kalender});
71 $pba_oarchive_date_format = bdpDisplayCode($result->{$bdprss_db->oarchive_date_format});
72 $pba_okalendermonthslist = bdpDisplayCode($result->{$bdprss_db->okalendermonthslist});
73 $pba_okalenderboxtablecaption = bdpDisplayCode($result->{$bdprss_db->okalenderboxtablecaption});
74 $pba_okalender_last = bdpDisplayCode($result->{$bdprss_db->okalender_last});
75 $pba_okalender_next = bdpDisplayCode($result->{$bdprss_db->okalender_next});
76 $pba_okalenderboxdaysofweeklist = bdpDisplayCode($result->{$bdprss_db->okalenderboxdaysofweeklist});
77
78 $pbao_superparameter = bdpDisplayCode($result->{$bdprss_db->pbao_superparameter});
79
80 $pba_wp_pages=$bdprss_db->get_wp_published_pages();
81
82?>
83
84<table width="100%" cellspacing="2" cellpadding="5" class="editform">
85
86<tr valign="top">
87 <td align="left" colspan="2"><h4>Basic configuration</h4>
88 (You may change all values again as often as you like <a href="edit.php?page=parteibuch-aggregator/bdp-rssadmin.php">via the tools section of your blog&#39;s admin panel</a>)<br />&nbsp;<br />
89 </td>
90</tr>
91
92<tr valign="top">
93 <th width="40%" scope="row" align="left">
94 1. Give this output stream a name:<br />&nbsp;<br />&nbsp;<br />
95 </th>
96 <td>
97 <input type="hidden" name="pbaoidentifier" value="<?php echo $pboutput; ?>" />
98 <input type="text" name="pbaoname" value="<?php echo $pbaoname; ?>" size="50" />
99 <br/>(Just type in any name you like)<br /><br />
100 </td>
101</tr>
102
103<tr valign="top">
104 <th width="40%" scope="row" align="left">
105 2. Select a page where to display this output:
106 <br />&nbsp;<br />&nbsp;<br />
107 </th>
108 <td>
109
110<select name="pbaopage2hookin">
111
112<?php
113$pba_pagecount=count($pba_wp_pages);
114
115//now comes the select element to hook into a wordpress page;
116
117if($pba_pagecount > 0){
118 foreach($pba_wp_pages as $pba_page_key => $pba_wp_page){
119 $pba_selected_page="";
120 if ($pba_wp_page->ID == $pbaopage2hookin) $pba_selected_page=" selected";
121 if(0 == $pbaopage2hookin && $pbastartconfig == 1 && ($pba_page_key + 1) == $pba_pagecount) $pba_selected_page=" selected";
122 $pba_prepared_post_title=bdpDisplayCode($pba_wp_page->post_title);
123 if(strlen($pba_prepared_post_title) > 60) $pba_prepared_post_title = substr($pba_prepared_post_title,0,60) . " ...";
124 echo '<option value="'.$pba_wp_page->ID.'"'.$pba_selected_page.'>'.$pba_wp_page->ID.' - '.$pba_prepared_post_title.'</option>';
125 }
126}
127
128 $pba_selected_page="";
129 if ((0 == $pbaopage2hookin && $pbastartconfig == 0) || $pba_pagecount == 0) $pba_selected_page=" selected";
130 echo '<option value="0"'.$pba_selected_page.'>Do not display this output as a page of my blog&nbsp;&nbsp;&nbsp;</option>';
131
132echo '</select>';
133echo '<br />No choice fitting? Just <a title="Opens in new window: Create and publish a page on your blog" href="page-new.php" target="_blank">publish a new page</a> and then <a title="Refresh this page" href="">refresh</a>.<br /><br />';
134
135if($pba_pagecount == 0) echo '<br /><br /><b>Attentation please: No page found.</b> The Parteibuch Aggregator could not find any published <b>page</b> in your blog to hook into and show output. Maybe you want to <a title="Opens in new window: Create and publish a page on your blog" href="page-new.php" target="_blank">create and publish a page on your blog</a>? <br/><br/>After creating a page, you can come back here, <a title="Refresh this page" href="">refresh this page</a> and select the newly created page to hook this output stream into.<br /><br />';
136?>
137
138 </td>
139</tr>
140
141<?php
142//$mypbaformdebug .= $pbaopage2hookin;
143//if(true) echo '<tr valign="top"><td align="left" colspan="2">Debug: '.$mypbaformdebug . '</td></tr>';
144?>
145
146<tr valign="top">
147 <th width="40%" scope="row" align="left">
148 3. And hit the save button to complete:<br />&nbsp;<br />&nbsp;<br />
149 </th>
150 <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
151 <?php echo $pba_editpbaoutput_button; ?>
152 </td>
153</tr>
154
155</table>
156
157<hr/>
158
159<script type="text/javascript">
160function toggledisplay(pbatoggleid){
161 var pbatoggle = document.getElementById(pbatoggleid);
162 if (pbatoggle.style.display != 'block') {
163 pbatoggle.style.display = 'block';
164 }else {
165 if (pbatoggle.style.display == 'block') {
166 pbatoggle.style.display = 'none';
167 }
168 }
169}
170document.write('Do you love lot&#39;s of parameters? The above configuration will be probably enough to display a nice RSS aggregated page on your blog. But if you like, you may view and change with the link beneath many additional parameters. If you are unsure, just don&#39;t use them at all and leave all the additional parameters unchanged.<br /><br />');
171document.write(' [<a href="#" onclick="toggledisplay(\'pbaoutextendedconfig\');return false;">Toggle Additional Parameters</a>]<div id="pbaoutextendedconfig" style="display:none;">');
172</script><noscript>
173The above settings will be probably enough to display a nice RSS aggregated page on your blog. But if you are a freak and love parameters and templates, here you have some additional parameters for this output stream. If you don&#39;t know what to do with the following parameters and templates, just leave all the following parameters unchanged.
174</noscript>
175
176<table width="100%" cellspacing="2" cellpadding="5" class="editform">
177<tr valign="top"><td align="left" colspan="2"><h4>Additional parameters for this output configuration</h4></td></tr>
178<tr valign="top"><td align="left" colspan="2"><h4>Select which items shall be displayed in this output stream</h4></td></tr>
179
180<tr valign="top">
181 <th width="40%" scope="row">
182 Select a list filter:
183 </th>
184 <td>
185
186 <input type="radio" name="pbaodefaultlist"
187 value="0"<?php if(!$pbaodefaultlist) echo ' checked="checked"'; ?>>
188 No list filter - display items of all lists<br />
189<?php
190
191 global $bdprss_db;
192 $result = $bdprss_db->get_all_lists();
193 foreach($result as $r) {
194 $checked="";
195 if($r->identifier == $pbaodefaultlist) $checked=' checked="checked"';
196 echo '<input type="radio" name="pbaodefaultlist"
197 value="'.$r->identifier.'" '.$checked.'> '.$r->identifier.':
198 '.$r->name.'<br />';
199 }
200?>
201 </td>
202</tr>
203
204<tr valign="top">
205 <th width="40%" scope="row">
206 Maximum items per page:
207 </th>
208 <td>
209 <input type="text" name="pbaomaxitems"
210 value="<?php echo $pbaomaxitems; ?>" size="5" />
211 (Zero (0) means as many as possible)
212
213 </td>
214</tr>
215
216<tr valign="top">
217 <th width="40%" scope="row">
218 Output special sort order and time filter:
219 </th>
220 <td>
221
222 <input type="radio" name="pbaoformattype"
223 value="countrecentitem"<?php if($pbaoformattype == 'countrecentitem') echo ' checked="checked"'; ?>>
224 Standard - list by most recent items<br />
225 <input type="radio" name="pbaoformattype"
226 value="daterecentitem"<?php if($pbaoformattype == 'daterecentitem') echo ' checked="checked"'; ?>>
227 Special - list items of last 24 hours and sort by most recent item time<br />
228 <input type="radio" name="pbaoformattype"
229 value="sitealpha"<?php if($pbaoformattype == 'sitealpha') echo ' checked="checked"'; ?>>
230 Special - list just one item per site of last 31 days and sort alphabetically<br />
231 <input type="radio" name="pbaoformattype"
232 value="siteupdate"<?php if($pbaoformattype == 'siteupdate') echo ' checked="checked"'; ?>>
233 Special - list just one item per site of last 31 days and sort by most recent item time
234 </td>
235</tr>
236
237<tr valign="top"><td align="left" colspan="2"><h4>Format the output page</h4></td></tr>
238
239<tr valign="top">
240 <td width="40%">
241 <p>Template for this output page: <br>
242 see <a target="_blank" href="edit.php?page=parteibuch-aggregator/variables.php">here</a> some placeholder
243</p>
244 </td>
245 <td><textarea cols="60" rows="20" name="pbaotemplate_ticker"><?php
246echo $pbaotemplate_ticker;
247?></textarea>
248 </td>
249</tr>
250
251<tr valign="top">
252 <th width="40%" scope="row">
253 Append links to the items:
254 </th>
255 <td>
256 Link to item: <input type="checkbox" name="pbaoappend_extra_link"
257 value="Y" <?php if($pbaoappend_extra_link == 'Y') echo ' checked="checked"'; ?>>
258 &nbsp;&nbsp;&nbsp;To cache: <input type="checkbox" name="pbaoappend_cache_link"
259 value="Y" <?php if($pbaoappend_cache_link == 'Y') echo ' checked="checked"'; ?>>
260 &nbsp;&nbsp;&nbsp;Social bookmarks: <input type="checkbox" name="pbaoadd_social_bookmarks"
261 value="Y" <?php if($pbaoadd_social_bookmarks == 'Y') echo ' checked="checked"'; ?>>
262 </td>
263</tr>
264
265<tr valign="top"><td align="left" colspan="2"><h4>Format the items</h4></td></tr>
266
267<tr valign="top">
268 <th width="40%" scope="row">
269 Maximum words for each item:
270 </th>
271 <td>
272 <input type="text" name="pbaomaxlength" value="<?php echo $pbaomaxlength; ?>" size="5" /><br />
273 (zero = no maximum word limit)
274 </td>
275</tr>
276
277<tr valign="top">
278 <th width="40%" scope="row">
279 Maximum length of words in each item:
280 </th>
281 <td>
282 <input type="text" name="pbaomaxwordlength"
283 value="<?php echo $pbaomaxwordlength; ?>" size="5" /><br />
284 (zero = no maximum word limit)
285 </td>
286</tr>
287
288
289<tr valign="top">
290 <th width="40%" scope="row">
291 Item date format:
292 </th>
293 <td>
294 <input type="text" name="pbaoitem_date_format"
295 value="<?php echo $pbaoitem_date_format; ?>" size="30" /> (leave empty to show item age)
296 </td>
297</tr>
298
299<tr valign="top">
300 <th width="40%" scope="row">
301 XHTML tags to retain in list output:
302 </th>
303 <td>&nbsp;
304 </td>
305</tr>
306
307<?php
308
309 foreach($bdprssTagSet as $key => $value)
310 {
311 $tag = BDPRSS2::tagalise($key);
312 echo '<tr valign="top"><td width="40%" align="right">';
313 echo $key;
314 $checked = array_search($key, $pbaoallowablexhtmltags);
315 if($checked !== FALSE) $checked = "checked='checked' "; else $checked='';
316 echo "</td><td><input type='checkbox' name='$tag' $checked /> [";
317 foreach($value as $v) echo " $v";
318 echo "&nbsp;] </td></tr>\n";
319 }
320?>
321
322<tr valign="top"><td align="left" colspan="2"><h4>Format the widget</h4></td></tr>
323
324<tr valign="top">
325 <td width="40%">
326 <p>
327 <?php
328 echo "This is the template for what is output by the RSS Aggregator <a href='widgets.php'>widget</a>.
329 If you prefer to add the sidebar code manually to your sidebar, you may do it like this (the \"outputid\" defines which output you show):<br/>
330 \$pba_config['outputid']=".$pboutput."; <br/>
331 \$pba_config['show_sidebarwidget'] = 'Y'; <br/>
332 \$pba_return=@PBA::outputwrapper(\$pba_config); <br/>
333 echo \$pba_return['result'];";
334
335 ?>
336 <td><textarea cols="60" rows="10" name="pbaosidebarwidget"><?php
337echo $pbaosidebarwidget;
338?></textarea>
339 </td>
340
341
342<tr valign="top"><td align="left" colspan="2"><h4>Cache item presentation</h4></td></tr>
343
344<tr valign="top">
345 <th width="40%" scope="row">
346 Allow people to view the cache for the items:
347 </th>
348 <td>
349 <input type="checkbox" name="pbaoiscachable"
350 value="Y" <?php if($pbaoiscachable == 'Y') echo ' checked="checked"'; ?>>
351 </td>
352</tr>
353
354<tr valign="top">
355 <th width="40%" scope="row">
356 Template of cache page:
357 </th>
358 <td><textarea cols="60" rows="10" name="pba_otemplate_cache"><?php
359echo $pba_otemplate_cache;
360?></textarea>
361 </td>
362</tr>
363
364<tr valign="top">
365 <th width="40%" scope="row">
366 Special page for cache viewing:
367 </th>
368 <td>
369 <input type="text" name="pbaocacheviewpage"
370 value="<?php echo $pbaocacheviewpage; ?>" size="50" /><br />
371 (If you have a special page for cache viewing, put the URL in here)
372 </td>
373</tr>
374
375
376
377<tr valign="top"><td align="left" colspan="2"><h4>Feed Output Options</h4></td></tr>
378
379<tr valign="top">
380 <th width="40%" scope="row">
381 Feed Title in Output:
382 </th>
383 <td>
384 <input type="text" maxlength="100" name="pba_channel_title"
385 value="<?php echo $pba_channel_title; ?>" size="50" />
386 </td>
387</tr>
388
389<tr valign="top">
390 <th width="40%" scope="row">
391 Feed Channel WWW - Link:
392 </th>
393 <td>
394 <input type="text" maxlength="100" name="pba_channel_link"
395 value="<?php echo $pba_channel_link; ?>" size="50" /><br/>(if empty, post-&gt;guid from wordpress will be used)
396 </td>
397</tr>
398
399<tr valign="top">
400 <th width="40%" scope="row">
401 Feed Channel Description:
402 </th>
403 <td>
404 <input type="text" maxlength="200" name="pba_channel_description"
405 value="<?php echo $pba_channel_description; ?>" size="50" />
406 </td>
407</tr>
408
409<tr valign="top">
410 <th width="40%" scope="row">
411 Feed Channel Language Code:
412 </th>
413 <td>
414 <input type="text" maxlength="10" name="pba_channel_language"
415 value="<?php echo $pba_channel_language; ?>" size="10" />
416 </td>
417</tr>
418
419<tr valign="top">
420 <th width="40%" scope="row">
421 Feed Channel License:
422 </th>
423 <td>
424 <input type="text" maxlength="100" name="pba_channel_copyright"
425 value="<?php echo $pba_channel_copyright; ?>" size="50" />
426 </td>
427</tr>
428
429<tr valign="top">
430 <td align="left" colspan="2">
431 <h4>Calendar features</h4>
432 <p>The following values affect all calendar related features</p>
433 </td>
434</tr>
435
436<tr valign="top">
437 <th width="40%" scope="row">
438 Template of calendar page:
439 </th>
440 <td><textarea cols="60" rows="10" name="pba_otemplate_kalender"><?php
441echo $pba_otemplate_kalender;
442?></textarea>
443 </td>
444</tr>
445
446<tr valign="top">
447 <th width="40%" scope="row">
448 Format of calendar dates:
449 </th>
450 <td>
451 <input type="text" name="pba_oarchive_date_format"
452 value="<?php echo $pba_oarchive_date_format; ?>" size="30" /><br />
453 (Uses <a href="http://www.php.net/date">PHP date format</a>)
454 </td>
455</tr>
456
457<tr valign="top">
458 <th width="40%" scope="row">
459 Months in calendar:
460 </th>
461 <td>
462 <input type="text" name="pba_okalendermonthslist"
463 value="<?php echo $pba_okalendermonthslist; ?>" size="30" />
464 </td>
465</tr>
466
467<tr valign="top">
468 <td align="left" colspan="2">
469 <p>Additional values just for the calendar box</p>
470 </td>
471</tr>
472
473<tr valign="top">
474 <th width="40%" scope="row">
475 Caption id for calendar box table:
476 </th>
477 <td>
478 <input type="text" name="pba_okalenderboxtablecaption"
479 value="<?php echo $pba_okalenderboxtablecaption; ?>" size="20" />
480 </td>
481</tr>
482
483<tr valign="top">
484 <th width="40%" scope="row">
485 Caption: Earlier:
486 </th>
487 <td>
488 <input type="text" name="pba_okalender_last"
489 value="<?php echo $pba_okalender_last; ?>" size="10" /><br />
490 </td>
491</tr>
492
493<tr valign="top">
494 <th width="40%" scope="row">
495 Caption: Later
496 </th>
497 <td>
498 <input type="text" name="pba_okalender_next"
499 value="<?php echo $pba_okalender_next; ?>" size="10" /><br />
500 </td>
501</tr>
502
503<tr valign="top">
504 <th width="40%" scope="row">
505 List of weeks:
506 </th>
507 <td>
508 <input type="text" name="pba_okalenderboxdaysofweeklist"
509 value="<?php echo $pba_okalenderboxdaysofweeklist; ?>" size="50" /><br />
510 </td>
511</tr>
512
513<tr valign="top">
514 <td align="left" colspan="2">
515 <h4>Free flow parameter overwriting</h4>
516 <p>The following box allows to overwrite any default parameter</p>
517 </td>
518</tr>
519
520<tr valign="top">
521 <td>Free parameter input:<br>
522 Syntax: <br>
523 ###SUPERPARAMETER_Defaultparameter1_BEGIN###
524 New value for defaultparameter1
525 ###SUPERPARAMETER_END###
526 ###SUPERPARAMETER_Defaultparameter2_BEGIN###
527 New value for defaultparameter2
528 ###SUPERPARAMETER_END###
529 etc, any newline breaks will be recognized as
530 part of the parameter value, single true / false
531 will be converted to bool true and false
532 </td>
533 <td><textarea cols="60" rows="10" name="pbao_superparameter"><?php
534echo $pbao_superparameter;
535?></textarea>
536 </td>
537</tr>
538
539
540<tr valign="top">
541 <th width="40%" scope="row" align="left">
542 Hit the save button to save this configuration:<br />&nbsp;<br />&nbsp;<br />
543 </th>
544 <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
545 <?php echo $pba_editpbaoutput_button; ?>
546 </td>
547</tr>
548
549</table>
550
551<script type="text/javascript">
552document.write('</div>');
553</script>
554
555</form>
556
557</fieldset>
558
559<?php
560}
561?>
Note: See TracBrowser for help on using the repository browser.