Changeset 486

Show
Ignore:
Timestamp:
02/28/08 20:00:25 (10 months ago)
Author:
padams
Message:

added admin setting for disabling feed link tracking.

Location:
trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/modules/base/classes/settings.php

    r469 r486  
    410410                        'cache_objects'                                 => true, 
    411411                        'do_not_log_admins'                             => true, 
    412                         'do_not_log_ips'                                => '' 
     412                        'do_not_log_ips'                                => '', 
     413                        'track_feed_links'                                      => true 
    413414                         
    414415                        )); 
  • trunk/modules/base/templates/options_general.tpl

    r446 r486  
    135135        <BR> 
    136136 
     137        <fieldset name="owa-feed-options" class="options"> 
     138                <legend>Feed Tracking</legend> 
     139                 
     140                <div class="setting" id="feeds">         
     141                        <div class="title">Feed Link Tracking</div>  
     142                        <div class="description">Adds tracking parameters to RSS or Atom feeds links. This provides a way to track how many visitors come from your feeds.</div> 
     143                        <div class="field"> 
     144                                <select name="<?=$this->getNs();?>config[track_feed_links]"> 
     145         
     146                                        <option value="0" <? if ($config['track_feed_links'] == false):?>SELECTED<?endif;?>>Off</OPTION> 
     147                                        <option value="1" <? if ($config['track_feed_links'] == true):?>SELECTED<?endif;?>>On</OPTION> 
     148                                </select> 
     149                        </div> 
     150                </div> 
     151                 
     152        </fieldset> 
     153         
     154    <BR> 
     155         
    137156    <fieldset name="owa-event-options" class="options"> 
    138157                <legend>Event Handling</legend> 
  • trunk/owa_wp.php

    r481 r486  
    5959                // check for presence of '?' which is not present under URL rewrite conditions 
    6060         
    61                 if (strpos($link, "?") === false): 
    62                         // add the '?' if not found 
    63                         $link .= '?'; 
     61                if ($this->config['track_feed_links'] == true): 
     62                 
     63                        if (strpos($link, "?") === false): 
     64                                // add the '?' if not found 
     65                                $link .= '?'; 
     66                        endif; 
     67                         
     68                        // setup link template 
     69                        $link_template = "%s&amp;%s=%s&amp;%s=%s"; 
     70                                 
     71                        return sprintf($link_template, 
     72                                                   $link, 
     73                                                   $this->config['ns'].$this->config['source_param'], 
     74                                                   'feed', 
     75                                                   $this->config['ns'].$this->config['feed_subscription_param'], 
     76                                                   $_GET[$this->config['ns'].$this->config['feed_subscription_param']]); 
     77                else: 
     78                        return; 
    6479                endif; 
    65                  
    66                 // setup link template 
    67                 $link_template = "%s&amp;%s=%s&amp;%s=%s"; 
    68                          
    69                 return sprintf($link_template, 
    70                                            $link, 
    71                                            $this->config['ns'].$this->config['source_param'], 
    72                                            'feed', 
    73                                            $this->config['ns'].$this->config['feed_subscription_param'], 
    74                                            $_GET[$this->config['ns'].$this->config['feed_subscription_param']]); 
    75                                            
    7680        } 
    7781         
     
    8488        function add_feed_tracking($binfo) { 
    8589                 
    86                 $guid = crc32(getmypid().microtime()); 
     90                if ($this->config['track_feed_links'] == true): 
     91                        $guid = crc32(getmypid().microtime()); 
    8792                 
    88                 return $binfo."&amp;".$this->config['ns'].$this->config['feed_subscription_param']."=".$guid; 
     93                        return $binfo."&amp;".$this->config['ns'].$this->config['feed_subscription_param']."=".$guid; 
     94                else: 
     95                        return; 
     96                endif; 
    8997        } 
    9098