~quam-plures-core/quam-plures/bug-614012

« back to all changes in this revision

Viewing changes to inc/sessions/model/_hit.class.php

  • Committer: yabs
  • Author(s): EdB
  • Date: 2010-07-05 15:24:36 UTC
  • mfrom: (7501.1.4 everything_in_one)
  • Revision ID: yabs@innervisions.org.uk-20100705152436-zdfylg1djrbsi18o
Implementing the huge EdB branch ;)

Show diffs side-by-side

added added

removed removed

Lines of Context:
394
394
                global $DB, $Debuglog;
395
395
                global $user_agents;
396
396
                global $template; // to detect agent_type (gets set in /qp_srvc/atom.php for example)
 
397
                global $viewmode; // Temporary template, if requested.
397
398
 
398
399
 
399
400
                // Init is_* members.
479
480
 
480
481
 
481
482
                /*
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.
 
484
                 *
 
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).
 
488
                 * 
 
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
 
499
                 *              anyway?).
486
500
                 */
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 ) )
 
502
                {
 
503
                        $used_template = $template;
 
504
                }
 
505
                else
 
506
                {
 
507
                        $used_template = param( 'viewmode', 'string', param( 'tempskin', 'string' ), true );
 
508
                }
 
509
 
 
510
                if( ! empty( $used_template ) && in_array( $used_template,
 
511
                                        array( '_atom', '_rdf', '_rss', '_rss2' ) ) )
489
512
                {
490
513
                        $Debuglog->add( 'detect_useragent(): RSS', 'hit' );
491
514
                        $this->agent_type = 'rss';