1 | <?php
|
---|
2 |
|
---|
3 | function get_pbadefaultparameter($parametername=''){
|
---|
4 |
|
---|
5 | $defaultparameter['outputid']=1;
|
---|
6 | $defaultparameter['outputname']='New output: please give it a meaningful name';
|
---|
7 | $defaultparameter['outputidfromurlallowed']=false;
|
---|
8 | $defaultparameter['searchphrase']="";
|
---|
9 |
|
---|
10 | $defaultparameter['feedrequest']=false;
|
---|
11 | $defaultparameter['tickerpage']="1";
|
---|
12 | $defaultparameter['archivdate']="";
|
---|
13 | $defaultparameter['maxitems']="N";
|
---|
14 | $defaultparameter['listid']=false;
|
---|
15 | $defaultparameter['listidfromurlallowed']=false;
|
---|
16 | $defaultparameter['hookintorewriterules']='auto';
|
---|
17 | $defaultparameter['short_cache_link']=false;
|
---|
18 | $defaultparameter['kalreq']=false; //true means, kalenderpage with kalender headers is desired by url
|
---|
19 | $defaultparameter['cacheid']=false;
|
---|
20 | $defaultparameter['formattype']="countrecentitem";
|
---|
21 | $defaultparameter['daterecentitemthreshold']=24 * 60 *60;
|
---|
22 | $defaultparameter['fromtimestamp']=0;
|
---|
23 | $defaultparameter['totimestamp']=0;
|
---|
24 | $defaultparameter['opsfilter']=false;
|
---|
25 | $defaultparameter['orderbysitename']=false;
|
---|
26 | $defaultparameter['sitealphathreshold']=31 * 24 * 60 *60;
|
---|
27 |
|
---|
28 | $defaultparameter['getoutputconfigbypageid']=false;
|
---|
29 | $defaultparameter['page2hookin']=0;
|
---|
30 |
|
---|
31 | //additional parameter to simulate known Parteibuch behaviour
|
---|
32 | $defaultparameter['specialpage1url']='N'; //'http://www.mein-parteibuch.com'; //set to N or to false to disable
|
---|
33 | $defaultparameter['suppressheaderonpage1']='N'; //only 'Y' will enable this feature
|
---|
34 | $defaultparameter['forceboxmaking']='';
|
---|
35 |
|
---|
36 | //search related values
|
---|
37 | $defaultparameter['searchenabled']=true;
|
---|
38 | $defaultparameter['search_page_baseurl']=""; //if empty, baseurl will be taken
|
---|
39 | $defaultparameter['searchactionhref'] = ""; //will be calculated in parameter bootstrap
|
---|
40 | $defaultparameter['hiddensearchformformvalues'] = ""; //will be calculated in parameter bootstrap
|
---|
41 |
|
---|
42 | //caching control
|
---|
43 | $defaultparameter['pba_full_cache_time']= 0; //use 0 to disable full this cache
|
---|
44 | $defaultparameter['pba_kalenderquery_cache_time']= 0; //use 0 to disable this cache
|
---|
45 | $defaultparameter['pba_feedlistquery_cache_time']= 0; //use 0 to disable this cache
|
---|
46 |
|
---|
47 | //boxonly: if just a box shall be given out, name the box here
|
---|
48 | //this single parameter shall replace parameters displayonlykalender, displayonlysearchbox, makeonlyfeedlist
|
---|
49 | $defaultparameter['displayonlybox']=""; //unset, false and 'N' should also mean, that not only a box was requested
|
---|
50 |
|
---|
51 | //parameters just for historic reference, replaced just after parameter bootstrap,
|
---|
52 | $defaultparameter['displayonlysearchbox']='N'; ////to be completely replaced by parameter displayonlybox
|
---|
53 | $defaultparameter['displayonlykalender']='N'; //to be completely replaced by parameter displayonlybox
|
---|
54 | $defaultparameter['makeonlyfeedlist']=false; //to be completely replaced by parameter displayonlybox
|
---|
55 | //just used, when ! displayonlybox )
|
---|
56 | $defaultparameter['opmlrequest']=false; //to be mapped to parameter displayonlybox
|
---|
57 | $defaultparameter['feedlistrequest']=false; //to be mapped to parameter displayonlybox
|
---|
58 |
|
---|
59 | //then all default parameters needed for output
|
---|
60 |
|
---|
61 | $defaultparameter['maxbodylength']=50;
|
---|
62 | $defaultparameter['maxwordlength']=35;
|
---|
63 | $defaultparameter['tagset']="";
|
---|
64 | $defaultparameter['formattedtagset']=""; //to be calculated later from $defaultparameter['tagset']
|
---|
65 | $defaultparameter['baseurl']="";
|
---|
66 | $defaultparameter['noextralink']="N"; //"Y" will suppress the extra link at the end of the item body
|
---|
67 | $defaultparameter['extralinktemplate']=" [<a href='###ITEM_URL###' >Link</a>]";
|
---|
68 | $defaultparameter['append_cache_link']="Y";
|
---|
69 | $defaultparameter['iscachable']="Y";
|
---|
70 | $defaultparameter['itemdateformat']="\ \(d.m.Y H:i\h\)\:";
|
---|
71 | $defaultparameter['splittitlebyseparator']=true; // separator shall not be clever chosen, but shall not be configurable, was before $useitemtitles
|
---|
72 | $defaultparameter['cacheviewpage']="";
|
---|
73 | $defaultparameter['cachelinktemplate']=" [<a href='###CACHEHREF###' rel='nofollow'>Cache</a>]";
|
---|
74 | $defaultparameter['add_social_bookmarks']='Y';
|
---|
75 | $defaultparameter['itemssbtemplate']='<script type="text/javascript">
|
---|
76 | document.write(\' [<a href="#" onclick="sbbview(\\\'sbbpt_id_###ITEM_ID###\\\',\\\'###ITEM_URL###\\\',\\\'###ITEM_NAME###\\\');return false;">Bookmarking</a>]<div id="sbbpt_id_###ITEM_ID###" class="social_bookmark" style="display:none;"></div>\');
|
---|
77 | </script>';
|
---|
78 | $defaultparameter['headersbtemplate']='<script type="text/javascript"
|
---|
79 | src="###URL2PLUGINDIR###social_bookmarks.php">
|
---|
80 | </script>';
|
---|
81 | $defaultparameter['url2plugindir']=""; // where to set such a value? this is a constant from wordpress and plugin installation
|
---|
82 | $defaultparameter['feedpage']="";
|
---|
83 | $defaultparameter['srequri']="";
|
---|
84 |
|
---|
85 | //widget values
|
---|
86 | $defaultparameter['show_sidebarwidget'] = 'N';
|
---|
87 | $defaultparameter['template_sidebarwidget'] = <<<HEREDOC
|
---|
88 | <li><b style="font-size: 1.2em;"><a title='Go to page of ###OUTPUTNAME###' href='###BASEURL###'>###OUTPUTNAME###</a><b>
|
---|
89 | (<a title='Link to feed of ###OUTPUTNAME###' href='###FEEDHREF###'>xml</a>)</li>
|
---|
90 |
|
---|
91 | ###LOOPBEGIN###<li><a href="###SITE_URL###" title="###SITE_DESCRIPTION###">###SITE_NAME###</a><small> (###ITEM_DATETIME###):</small> <b><a href="###ITEM_URL###">###ITEM_NAME###</a></b></li>
|
---|
92 | ###LOOPEND###
|
---|
93 |
|
---|
94 | <li><b>Feedroll</b> (<a title='List of feeds of ###OUTPUTNAME### as OPML' href='###FEEDOPMLHREF###'>opml</a>) (<a title='List of feeds of ###OUTPUTNAME###' href='###FEEDLISTHREF###'>feedlist</a>)</li>
|
---|
95 |
|
---|
96 | ###FEEDLISTSIDEBAR_BOX###
|
---|
97 |
|
---|
98 | <li style="text-align: center;"><br/>###SEARCH_BOX###</li>
|
---|
99 |
|
---|
100 | <li style="text-align: center;"><br/><small><a title="The Parteibuch Aggregator is a Wordpress-Plugin for feed aggregation" href="http://www.mein-parteibuch.com/blog/parteibuch-aggregator/">###PBA_VERSION###</a></small></li>
|
---|
101 | HEREDOC;
|
---|
102 |
|
---|
103 | //cache page values
|
---|
104 | $defaultparameter['template_cache'] = <<<HEREDOC
|
---|
105 | <h2>Cache-Eintrag ###ITEM_ID### im <a href='###BASEURL###'>Parteibuch Aggregator</a></h2>
|
---|
106 | <div class='centreblock'><h3><a href='###ITEM_URL###'>###ITEM_NAME###</a></h3>
|
---|
107 | ###ITEM_CACHEBODY###
|
---|
108 | <p class='postbyline'><em> By: <a href='###SITE_URL###' title='###SITE_DESCRIPTION###'>###ITEM_URL###</a>
|
---|
109 | <br />Posted: ###ITEM_DATEFEED### (ca.)
|
---|
110 | <br />RSS cached: ###ITEM_UPDATEDATE###
|
---|
111 | <br />Aggregator: <a title="The Parteibuch Aggregator is a Wordpress-Plugin for feed aggregation" href="http://www.mein-parteibuch.com/blog/parteibuch-aggregator/">###PBA_VERSION###</a>
|
---|
112 | </em></p></div>
|
---|
113 | HEREDOC;
|
---|
114 |
|
---|
115 | //feed values
|
---|
116 | $defaultparameter['channel_title']= "Parteibuch Aggregator Feed";
|
---|
117 | $defaultparameter['htmlpage']=""; //field channel_link in database, if empty, post->guid from wordpress will be used
|
---|
118 | $defaultparameter['channel_description']= "A fine feed collection generated with Parteibuch Aggregator";
|
---|
119 | $defaultparameter['channel_language']= "en";
|
---|
120 | $defaultparameter['channel_copyright']= "Pirate license";
|
---|
121 | $defaultparameter['template_feed'] = <<<HEREDOC
|
---|
122 | <?xml version="1.0" encoding="UTF-8"?>
|
---|
123 | <!-- generator="###PBA_VERSION###" -->
|
---|
124 | <rss version="2.0"
|
---|
125 | xmlns:content="http://purl.org/rss/1.0/modules/content/"
|
---|
126 | xmlns:wfw="http://wellformedweb.org/CommentAPI/"
|
---|
127 | xmlns:dc="http://purl.org/dc/elements/1.1/"
|
---|
128 | >
|
---|
129 | <channel>
|
---|
130 | <title>###CHANNEL_TITLE######ISSEARCHBEGIN### - Items containing ###SEARCHPHRASE######ISSEARCHEND######ISDATEBEGIN### - Items from date ###ARCHIVEDATE######ISDATEEND###</title>
|
---|
131 | <link>###HTMLHREF###</link>
|
---|
132 | <description>###CHANNEL_DESCRIPTION###</description>
|
---|
133 | <pubDate>###FIRSTITEM_DATEFEED###</pubDate>
|
---|
134 | <generator>###PBA_VERSION###</generator>
|
---|
135 | <language>###CHANNEL_LANGUAGE###</language>
|
---|
136 | <copyright>###CHANNEL_COPYRIGHT###</copyright>
|
---|
137 | ###LOOPBEGIN### <item>
|
---|
138 | <title>###SITE_NAME###: ###ITEM_NAME###</title>
|
---|
139 | <link>###ITEM_URL###</link>
|
---|
140 | <pubDate>###ITEM_DATEFEED###</pubDate>
|
---|
141 | <dc:creator>###SITE_NAME###</dc:creator>
|
---|
142 | <dc:source>###SITE_URL###</dc:source>
|
---|
143 | <dc:rights><![CDATA[###ITEM_LICENSE###]]></dc:rights>
|
---|
144 | <guid isPermaLink="true">###ITEM_URL###</guid>
|
---|
145 | <description><![CDATA[###ITEM_DESCRIPTION###]]></description>
|
---|
146 | <content:encoded><![CDATA[###ITEM_FEEDBODY###]]></content:encoded>
|
---|
147 | </item>
|
---|
148 | ###LOOPEND###</channel>
|
---|
149 | </rss>
|
---|
150 | HEREDOC;
|
---|
151 |
|
---|
152 |
|
---|
153 | //kalender values
|
---|
154 | $defaultparameter['template_kalender'] = <<<HEREDOC
|
---|
155 | <p><a href='###BASEURL###'>PBA</a>: Archive for ###KALENDERDATE###</p>
|
---|
156 | <p>###KALENDER_BOX###</p>
|
---|
157 | <p>###SEARCH_BOX###</p>
|
---|
158 | <p>(<a href='###FEEDLISTHREF###'>Feeds</a>) (<a href='###FEEDOPMLHREF###'>OPML</a>) </p> <p>###FEEDLISTSIDEBAR_BOX###</p>
|
---|
159 | <p>###KALENDERLIST_BOX###</p>
|
---|
160 |
|
---|
161 | <p>Generated with <a title="The Parteibuch Aggregator is a Wordpress-Plugin for feed aggregation" href="http://www.mein-parteibuch.com/blog/parteibuch-aggregator/">###PBA_VERSION###</a></p>
|
---|
162 | HEREDOC;
|
---|
163 |
|
---|
164 | $defaultparameter['kalender_as_list']=false; // nasty - true shall mean, that we will calculate a kalender as a list, whatever template analysis says
|
---|
165 | $defaultparameter['kalender_as_box']=false; // nasty - true shall mean, that we will calculate a kalender as a list, whatever template analysis says
|
---|
166 | $defaultparameter['kalendermonthslist']="January, February, March, April, May, June, July, August, September, October, November, December";
|
---|
167 | $defaultparameter['kalendernormaldateformat']='j.n.Y';
|
---|
168 |
|
---|
169 | //get parameters for box calendar
|
---|
170 | $defaultparameter['kalender_last']='Earlier'; //only needed for kalender as a box
|
---|
171 | $defaultparameter['kalender_next']='Later'; //only needed for kalender as a box
|
---|
172 | $defaultparameter['kalenderboxdaysofweeklist']="Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday";
|
---|
173 | $defaultparameter['kalenderboxtablecaption']=' style="text-align: center;" id="kalendertable"';
|
---|
174 |
|
---|
175 | //feedlist values
|
---|
176 | $defaultparameter['feedlistmaxage'] = (31 * 24 * 60 *60); //age of feeds to be listed in feedlist, in seconds, 0 means disabled age filter
|
---|
177 | $defaultparameter['dateformat_feedlistsidebar_box']='';
|
---|
178 | $defaultparameter['dateformat_feedlist_box']='';
|
---|
179 | $defaultparameter['dateformat_opml_box']='';
|
---|
180 |
|
---|
181 | //cache page format values
|
---|
182 |
|
---|
183 | //get age function value
|
---|
184 | $defaultparameter['ageunitsstring']="never: never, seconds: seconds, minutes: minutes, hours: hours, days: days, weeks: weeks, months: months, years: years, before: , beforeafter: ago,in: in";
|
---|
185 | $defaultparameter['ageunit']=false; //leave this false, gettheage will calculate an array from into it on first call
|
---|
186 |
|
---|
187 | //boundary values
|
---|
188 | $defaultparameter['maxitemslimit']=1000;
|
---|
189 |
|
---|
190 | //here are some default templates
|
---|
191 | $defaultparameter['template_ticker'] = <<<HEREDOC
|
---|
192 | <p>
|
---|
193 | ###ISSEARCHBEGIN###
|
---|
194 | <a href="###BASEURL###">###OUTPUTNAME###</a>: Items containing ###SEARCHPHRASE###
|
---|
195 | ###ISSEARCHEND###
|
---|
196 |
|
---|
197 | ###ISDATEBEGIN###
|
---|
198 | <a href="###BASEURL###">###OUTPUTNAME###</a>: Items from date ###ARCHIVEDATE###
|
---|
199 | ###ISDATEEND###
|
---|
200 |
|
---|
201 | ###ISNODATENOSEARCHBEGIN###
|
---|
202 | <a href="###BASEURL###">###OUTPUTNAME###</a>
|
---|
203 | ###ISNODATENOSEARCHEND###
|
---|
204 |
|
---|
205 | (###STARTITEM### - ###LASTITEM### of about ###FOUNDITEMS###) (<a href='###FEEDHREF###'>xml</a>) (<a href='###FEEDLISTHREF###'>Feedlist</a>)</p>
|
---|
206 |
|
---|
207 | <p>###SEARCH_BOX###</p>
|
---|
208 |
|
---|
209 | ###LOOPBEGIN###<p class="centreblock"><a href="###SITE_URL###" title="###SITE_DESCRIPTION###">###SITE_NAME###</a><small> (###ITEM_DATETIME###):</small> <b><a href="###ITEM_URL###">###ITEM_NAME###</a></b><br /><div class="storyContent">###ITEM_BODY###</div></p>
|
---|
210 | ###LOOPEND###
|
---|
211 |
|
---|
212 | <p><span style='position:relative; float:left; overflow:hidden; margin-left:10px;'>###LASTLINKBEGIN###<a href="###LASTPAGEHREF###">Page back</a>###LASTLINKEND###</span><span style='position:relative; float:left; overflow:hidden; margin-left:30px;'>Item (###STARTITEM### - ###LASTITEM### of about ###FOUNDITEMS###)</span><span style='position:relative; float:right; overflow:hidden; margin-right:10px;'>###NEXTLINKBEGIN###<a href="###NEXTPAGEHREF###">Next page</a>###NEXTLINKEND###</span></p>
|
---|
213 |
|
---|
214 | <p> </p>
|
---|
215 | <p>###KALENDERLIST_BOX###</p>
|
---|
216 | <p style="text-align: center;">Generiert mit <a title="The Parteibuch Aggregator is a Wordpress-Plugin for feed aggregation" href="http://www.mein-parteibuch.com/blog/parteibuch-aggregator/">###PBA_VERSION###</a></p>
|
---|
217 | HEREDOC;
|
---|
218 |
|
---|
219 | $defaultparameter['template_feedlist'] = <<<HEREDOC
|
---|
220 | ###LOOPBEGIN######FEEDLIST_LOOP_FEEDURL### ###LOOPEND###
|
---|
221 | HEREDOC;
|
---|
222 |
|
---|
223 | $defaultparameter['template_opml'] = <<<HEREDOC
|
---|
224 | <?xml version="1.0" encoding="UTF-8"?>
|
---|
225 | <opml version="1.1">
|
---|
226 | <head>
|
---|
227 | <title>Parteibuch Aggregator OPML</title>
|
---|
228 |
|
---|
229 | <dateCreated>###NOW###</dateCreated>
|
---|
230 | <ownerName>PBA</ownerName>
|
---|
231 | </head>
|
---|
232 | <body>
|
---|
233 | ###LOOPBEGIN### <outline title="###FEEDLIST_LOOP_SITE###" text="###FEEDLIST_LOOP_SITE###" htmlUrl="###FEEDLIST_LOOP_SITEURL###" type="rss" xmlUrl="###FEEDLIST_LOOP_FEEDURL###" />
|
---|
234 | ###LOOPEND###</body>
|
---|
235 | </opml>
|
---|
236 | HEREDOC;
|
---|
237 |
|
---|
238 | $defaultparameter['template_error'] = <<<HEREDOC
|
---|
239 | Oops! We have got errors: ###ERRORMESSAGE###
|
---|
240 | HEREDOC;
|
---|
241 |
|
---|
242 | //search box
|
---|
243 | $defaultparameter['template_search_box'] = <<<HEREDOC
|
---|
244 | <form method="get" id="searchform" action="###SEARCHACTIONHREF###">###HIDDENSEARCHFORMFORMVALUES###
|
---|
245 | <input type="text" value="###SEARCHPHRASE###" name="searchphrase" id="searchphrase" />
|
---|
246 | <input type="submit" id="searchsubmit" value="search aggregator" /></form>
|
---|
247 | HEREDOC;
|
---|
248 |
|
---|
249 | $defaultparameter['template_opml_box'] = <<<HEREDOC
|
---|
250 | <?xml version="1.0" encoding="UTF-8"?>
|
---|
251 | <opml version="1.1">
|
---|
252 | <head>
|
---|
253 | <title>Parteibuch Aggregator OPML</title>
|
---|
254 | <dateCreated>###NOW###</dateCreated>
|
---|
255 | <ownerName>PBA</ownerName>
|
---|
256 | </head>
|
---|
257 | <body>
|
---|
258 | ###LOOPBEGIN### <outline title="###FEEDLIST_LOOP_SITE###" text="###FEEDLIST_LOOP_SITE###" htmlUrl="###FEEDLIST_LOOP_SITEURL###" type="rss" xmlUrl="###FEEDLIST_LOOP_FEEDURL###" />
|
---|
259 | ###LOOPEND###</body>
|
---|
260 | </opml>
|
---|
261 | HEREDOC;
|
---|
262 |
|
---|
263 | $defaultparameter['template_feedlist_box'] = <<<HEREDOC
|
---|
264 | ###LOOPBEGIN######FEEDLIST_LOOP_FEEDURL### ###LOOPEND###
|
---|
265 | HEREDOC;
|
---|
266 |
|
---|
267 | $defaultparameter['template_feedlistsidebar_box'] = <<<HEREDOC
|
---|
268 | ###LOOPBEGIN###<li style="margin: 2px 0 0;"><small><a href='###FEEDLIST_LOOP_SITEURL###'
|
---|
269 | title='###FEEDLIST_LOOP_SITE###'>###FEEDLIST_LOOP_SITE###</a> <a href='###FEEDLIST_LOOP_FEEDURL###'
|
---|
270 | title='Feed - Last update: ###FEEDLIST_LOOP_DATE###'>(xml)</a></small></li>
|
---|
271 | ###LOOPEND###
|
---|
272 | HEREDOC;
|
---|
273 |
|
---|
274 | $defaultparameter['template_kalenderlist_box'] = <<<HEREDOC
|
---|
275 | <a title="Archive" href="###KALENDERHREF###">Archive</a>:
|
---|
276 | ###EARLIERLINKBEGIN###<a href='###KALENDER_LASTHREF###'>Earlier</a>###EARLIERLINKEND###
|
---|
277 | ###LOOPBEGIN###<a href='###KALENDERLOOP_HREF###'>###KALENDERLOOP_INLINKDATE###</a>  ###LOOPEND###
|
---|
278 | ###LATERLINKBEGIN###<a href='###KALENDER_NEXTHREF###'>Later</a>###LATERLINKEND###
|
---|
279 | <br />
|
---|
280 | HEREDOC;
|
---|
281 |
|
---|
282 | $defaultparameter['template_kalender_box'] = <<<HEREDOC
|
---|
283 | ###KALENDERBOX###
|
---|
284 | HEREDOC;
|
---|
285 |
|
---|
286 | //migration && debug values
|
---|
287 | $defaultparameter['forceoldoutput']=false;
|
---|
288 | $defaultparameter['debug']=false;
|
---|
289 | $defaultparameter['profiler_enabled']=false;
|
---|
290 |
|
---|
291 | if($parametername=="") {
|
---|
292 | return $defaultparameter;
|
---|
293 | } else {
|
---|
294 | if(isset($defaultparameter[$parametername])) {
|
---|
295 | $returnparameter = $defaultparameter[$parametername];
|
---|
296 | return $returnparameter;
|
---|
297 | }
|
---|
298 | }
|
---|
299 | } //end of function getdefaultparameter
|
---|
300 |
|
---|
301 | function get_pbadefaultsite($parametername=''){
|
---|
302 | //feed_url, site_name , description , site_license , site_url
|
---|
303 | $defaultparameter['feed_url']='http://www.mein-parteibuch.org/blog/the-cats-news-ticker-feed/';
|
---|
304 | $defaultparameter['site_name']='The Cats News Ticker';
|
---|
305 | $defaultparameter['description']='A Cats Feedmix';
|
---|
306 | $defaultparameter['site_license']='Pirate license';
|
---|
307 | $defaultparameter['site_url']='http://www.mein-parteibuch.org/';
|
---|
308 | if($parametername=="") {
|
---|
309 | return $defaultparameter;
|
---|
310 | } else {
|
---|
311 | if(isset($defaultparameter[$parametername])) {
|
---|
312 | $returnparameter = $defaultparameter[$parametername];
|
---|
313 | return $returnparameter;
|
---|
314 | }
|
---|
315 | }
|
---|
316 | } //end of function get_pbadefaultsite
|
---|
317 |
|
---|
318 | ?>
|
---|