482
* Detect requests for XML feeds by $template / $alt_tpl param.
483
* fp> TODO: this is WEAK! Do we really need to know before going into the template?
484
* dh> not necessary, but only where ->agent_type gets used (logging).
485
* Use $template, if not empty (may be set in /qp_srvc/atom.php for example), otherwise $alt_tpl.
483
* Detect requests for XML feeds by $template / $viewmode param.
485
* Use $template, if not empty (may be set in /qp_srvc/atom.php
486
* for example), otherwise $viewmode (and if that isn't set, $tempskin
487
* for b2evolution backward compatiblity).
489
* @todo fp> this is WEAK! Do we really need to know before going into the template?
490
* dh> not necessary, but only where ->agent_type gets used (logging).
491
* @todo Tblue> It would be less "weak" to call Template::get_default_type(),
492
* but that would mean having to instantiate a Template
493
* object! Another possibility: Use PHP's magic __get()
494
* method. I think combining both approaches would be a
495
* good solution (perhaps we could simply check whether
496
* the template name begins with an underscore? That
497
* would avoid having to instantiate a Template object
498
* (hmm, isn't that done in inc/_blog_main.inc.php
487
$used_template = empty( $template ) ? param( 'alt_tpl', 'string', '', true ) : $template;
488
if( in_array( $used_template, array( '_atom', '_rdf', '_rss', '_rss2' ) ) )
501
if( ! empty( $template ) )
503
$used_template = $template;
507
$used_template = param( 'viewmode', 'string', param( 'tempskin', 'string' ), true );
510
if( ! empty( $used_template ) && in_array( $used_template,
511
array( '_atom', '_rdf', '_rss', '_rss2' ) ) )
490
513
$Debuglog->add( 'detect_useragent(): RSS', 'hit' );
491
514
$this->agent_type = 'rss';