+ Reply to Thread
Results 1 to 9 of 9

Thread: Change page counter to count only unique visits? Not ever single hit.

Share/Bookmark
  1. #1

    Question Change page counter to count only unique visits? Not ever single hit.

    One thing that I would like to change is the counter so that it counts unique views and not merely hits. My counter is way off. In a way, it's nice to see so many hits, but it's not nearly accurate.

  2. #2
    Super Moderator Michael Daly will become famous soon enough Michael Daly will become famous soon enough Michael Daly's Avatar
    Join Date
    May 2006
    Location
    Homeless and OTR, Canada
    Posts
    4,418
    Rep Power
    10

    Default

    The counter is cached with the rest of the page, so it only changes occasionally.

    If you want the counter to work differently, you'd have to write an extension to do so.
    Private message are for private information. Please post public questions. Thanks

  3. #3

    Default

    Unless you have a great attachment to the counter appearing on every page (or to Special:PopularPages), I would suggest that you disable the counter in favor of either webserver log analysis software or a third-party analytics service.

  4. #4
    Member gryzor is on a distinguished road gryzor's Avatar
    Join Date
    Jun 2007
    Location
    Athens, Greece
    Posts
    59
    Rep Power
    4

    Default

    By the way, what should be added to a skin to make the counter show? I'm trying out a skin that doesn't have it in its php...

  5. #5
    Senior Member Subfader is an unknown quantity at this point
    Join Date
    Feb 2009
    Posts
    432
    Rep Power
    2

    Default

    the counter works most effictivly. could be worse. atm F5 doesn't raise it, that's better than nothing.

  6. #6

    Default

    Quote Originally Posted by gryzor View Post
    By the way, what should be added to a skin to make the counter show? I'm trying out a skin that doesn't have it in its php...
    It really depends on the skin. The relevant portion from MonoBook.php is:
    Code:
    			<div class="visualClear"></div>
    			<div id="footer">
    <?php
    		if($this->data['poweredbyico']) { ?>
    				<div id="f-poweredbyico"><?php $this->html('poweredbyico') ?></div>
    <?php 	}
    		if($this->data['copyrightico']) { ?>
    				<div id="f-copyrightico"><?php $this->html('copyrightico') ?></div>
    <?php	}
    
    		// Generate additional footer links
    		$footerlinks = array(
    			'lastmod', 'viewcount', 'numberofwatchingusers', 'credits', 'copyright',
    			'privacy', 'about', 'disclaimer', 'tagline',
    		);
    		$validFooterLinks = array();
    		foreach( $footerlinks as $aLink ) {
    			if( isset( $this->data[$aLink] ) && $this->data[$aLink] ) {
    				$validFooterLinks[] = $aLink;
    			}
    		}
    		if ( count( $validFooterLinks ) > 0 ) {
    ?>			<ul id="f-list">
    <?php
    			foreach( $validFooterLinks as $aLink ) {
    				if( isset( $this->data[$aLink] ) && $this->data[$aLink] ) {
    ?>					<li id="<?php echo$aLink?>"><?php $this->html($aLink) ?></li>
    <?php 			}
    			}
    ?>
    			</ul>
    <?php	}
    ?>
    		</div>
    </div>
    Quote Originally Posted by Subfader View Post
    the counter works most effictivly. could be worse. atm F5 doesn't raise it, that's better than nothing.
    I suspect that's only because your browser caches the page and F5 doesn't generally bypass the cache. If you tried ctrl-F5/ctrl-shift-R instead, I imagine the counter would rise.

  7. #7
    Member gryzor is on a distinguished road gryzor's Avatar
    Join Date
    Jun 2007
    Location
    Athens, Greece
    Posts
    59
    Rep Power
    4

    Default

    Thanks, mate, I just logged back in the say I found it:

    Code:
    $footerlinks = array(
    						'viewcount',
    etc. So the variable is 'viewcount', as you have highlighted!

    Is there a complete list of all the variables one can use in the arrays?

    Thanks for your trouble

  8. #8

    Default

    Quote Originally Posted by gryzor View Post
    Is there a complete list of all the variables one can use in the arrays?
    I believe MonoBook uses all of them, but they're generated in includes/Skin.php and includes/SkinTemplate.php.

  9. #9
    Senior Member Subfader is an unknown quantity at this point
    Join Date
    Feb 2009
    Posts
    432
    Rep Power
    2

    Default

    Quote Originally Posted by Emufarmers View Post
    If you tried ctrl-F5/ctrl-shift-R instead, I imagine the counter would rise.
    Well that purges the cache But you're right, other browsers purge the cache with F5 like Chrome(?).

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. How do I embed a unique page ID?
    By Noobie2 in forum Customizing MediaWiki
    Replies: 4
    Last Post: September 11th, 2008, 05:30
  2. Keeping a running count on a page
    By halcyon1234 in forum WikiCode Formatting
    Replies: 5
    Last Post: August 27th, 2008, 04:26
  3. how to generate a unique page title?
    By Hensa in forum MediaWiki General Discussion
    Replies: 3
    Last Post: June 5th, 2008, 02:48
  4. how to disable the diff and page counter
    By mwPaul in forum Configuration
    Replies: 4
    Last Post: January 1st, 2008, 19:16
  5. Meta Tags for Each Page (Unique)
    By Brain916 in forum WikiCode Formatting
    Replies: 1
    Last Post: July 5th, 2007, 16:46

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts