• Previous message: [greg-dev] PATCH: implements rss.config.restrictrefresh (partially) and rss.config.hidelogin
  • Next message: [greg-dev] PATCH: implements rss.config.restrictrefresh (partially) and rss.config.hidelogin
  • Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

    [greg-dev] PATCH: implements rss.config.restrictrefresh (partially) and rss.config.hidelogin

    No worries - thanks for the software!
    
    I've attached a plugin called googleanalytics.php which inserts the
    Google Analytics scripts at the bottom of each page so you can keep
    track of who's visiting your site etc. (see
    http://analytics.google.com for more info).
    
    Sam
    
    <?php
    ###############################################################################
    # Gregarius - A PHP based RSS aggregator.
    # Copyright (C) 2003 - 2006 Marco Bonetti
    #
    ###############################################################################
    # This program is free software and open source software; you can redistribute
    # it and/or modify it under the terms of the GNU General Public License as
    # published by the Free Software Foundation; either version 2 of the License,
    # or (at your option) any later version.
    #
    # This program is distributed in the hope that it will be useful, but WITHOUT
    # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
    # more details.
    #
    # You should have received a copy of the GNU General Public License along
    # with this program; if not, write to the Free Software Foundation, Inc.,
    # 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  or visit
    # http://www.gnu.org/licenses/gpl.html
    #
    ###############################################################################
    # E-mail:      mbonetti at gmail dot com
    # Web page:    http://gregarius.net/
    #
    ###############################################################################
    
    
    /// Name: Google Analytics
    /// Author: Sam Johnston
    /// Description: Inserts Google Analytics scripts before body end tag.
    /// Version: 0.2
    /// Configuration: __googleanalytics_config
    
    /**
     * Changelog:
     *
     * 0.1 Initial release
     * 0.2 Added googleanalytics.uacct config option
     */
    
    define ('GOOGLEANALYTICS_CONFIG_UACCT', 'googleanalytics.uacct');
    $options = rss_plugins_get_option( GOOGLEANALYTICS_CONFIG_UACCT );
    
    function __googleanalytics_config() {
        $uacct = rss_plugins_get_option( GOOGLEANALYTICS_CONFIG_UACCT );
    
        if( rss_plugins_is_submit() ) {
            if(!empty($_REQUEST['uacct']))
    	{
                rss_plugins_add_option(GOOGLEANALYTICS_CONFIG_UACCT,
    $_REQUEST['uacct'], 'string');
            }
        }
        else
        {
    ?>
    <p>
      <input type='text' name='uacct' id='uacct' value='<?php echo( $uacct );?>' />
      <label for='uacct'>Google Urchin Account Code (eg UA-12345-1)</label>
    </p>
    <?php
        }
    }
    
    function __googleAnalyticsJs ($dummy) {
    ?>
          <script src="http://www.google-analytics.com/urchin.js"
    type="text/javascript">
          </script>
          <script type="text/javascript">
            _uacct = "<?php echo rss_plugins_get_option(
    GOOGLEANALYTICS_CONFIG_UACCT );?>";
            urchinTracker();
          </script>
    <?php
       return $dummy;
    }
    
    rss_set_hook('rss.plugins.bodyend','__googleAnalyticsJs');
    ?>
    
    On 9/14/06, Marco Bonetti <mbonetti at gmail.com> wrote:
    > Sam,
    >
    > I applied your patch in changeset [1581] with an additional bit thrown
    > in to neuter update.php (my solution looks pretty simple, I hope I'm
    > not missing something obvious.)
    >
    > I'll take a look at your second patch as soon as I have a couple minutes.
    >
    > Thank you for you help, by the way!
    >
    >  -m
    >
    >
    >
    >
    > On 9/14/06, Sam Johnston <samjie at gmail.com> wrote:
    > > Here's an update to my patch to make gregarius more multi-user
    > > friendly. This one hides the login div at the top right and the
    > > 'Admin' button, in addition to the 'Refresh' button, but it still
    > > doesn't neuter the update.php script...
    > >
    > > Looking good for http://citrite.org/rss so far though...
    > _______________________________________________
    > gregarius-dev mailing list
    > gregarius-dev at sinless.org
    > http://sinless.org/mailman/listinfo/gregarius-dev
    >
    -------------- next part --------------
    A non-text attachment was scrubbed...
    Name: googleanalytics.php
    Type: application/octet-stream
    Size: 2658 bytes
    Desc: not available
    Url : http://sinless.org/pipermail/gregarius-dev/attachments/20060914/d849a0d7/googleanalytics.obj
    
    Posted by Sam Johnston [reply] at Thu Sep 14 22:22:26 CEST 2006