MediaWiki footer viewcount

512 Views Asked by At

I'm using MediaWiki, wanna to show view count on foot.

My env:

MediaWiki 1.25.1

PHP 5.4.41

MySQL 5.5.43

Readed offical manual https://www.mediawiki.org/wiki/Manual:Footer but i dont know how to do.

It's say:

$wgHooks['SkinTemplateOutputPageBeforeExec'][] = 'lfTOSLink';
function lfTOSLink( $sk, &$tpl ) {
    $tpl->set( 'termsofservice', $sk->footerLink( 'termsofservice', 'termsofservicepage' ) );
    $tpl->data['footerlinks']['places'][] = 'termsofservice';
    return true;
}

how to change code of lfTOSLink to turn on viewcount?

3

There are 3 best solutions below

1
On BEST ANSWER

While the hit counter was removed in MediaWiki 1.25, Extension:HitCounters is now available to replace the core functionality, thanks to Mark A. Hershberger.

0
On

Viewcount was removed in MediaWiki 1.25. See the documentation of $wgDisableCounters for details and alternatives.

2
On

I degrade version to 1.21.1

Page footer's view count is working fine.

Reinstall a new instance 1.21.1

Use Maintenance scripts : DumpBackup , ImportDump , ImportImages

Succeed migrate data to 1.21.1 from 1.25.1