Talk:MW: Whos Online Extension

From ChekMate Security Group

Contents

error with MediaWiki 1.9.0

Hi there, I really love your extension - it makes my wiki not so anonymous when visiting. Its always nice to see who is currently online.


So, till version 1.8.2 all worked fine. Now, after upgrading to MediaWiki 1.9.0 the extension gives errors:

Fatal error: Call to undefined function wfStrencode() in ....


Same with wfQuery. So it seems that wfStrencode() and wfQuery() has been removed by MediaWiki. Can you please tell me, what to change, that your extension will work again?!


Thanks a lot!

-- PyroM 09:51, 15 January 2007 (MST)

is there any way to show a list of users that are online? Andy


03:59, 9 July 2006 (UTC) - Smcnaught :


It would be possible by modifying the following:

  $sql = "select * from $wgDBprefix"."online where userid != 0";
  $res = $dbr->query ( $sql ) ;
  $registered = $dbr->numRows($res)   0;

  $output = "Guests: $guests Registered: $registered";

  return $output;

to:

  $sql = "select username from $wgDBprefix"."online where userid != 0";
  $res = $dbr->query ( $sql ) ;
  $registered = $dbr->numRows($res)   0;
  while( $row = $dbr->fetchObject( $res ) ){
    $Userlist .= "[[User:".$row->username."|".$row->username."]] ";
  }
  $dbr->freeResult( $res );
  $output = "Guests: $guests Registered: $registered ($Userlist)";
  return $wgOut->parse($output);

Produces something like:

Guests: 1 Registered: 1 (Smcnaught)

error with nowiki

hi,

on my wiki i get an "error" when i type the whosonline tag After a nowiki tag. other way round everythung works fine.

the error looks like:

ᅵUNIQ611344522c0a4aac-nowiki-7e8587f5408777600000001-QINU or look here: http://www.mitsuwiki.org/Nowiki_whosonline_error

-- (smcnaught) - Smcnaught - I am also available on irc.chekmate.org #MediaWiki:


I have been able to reproduce this issue but after a number of attempts have not yet found how to resolve it.

Who's Online, MediaWiki 1.9.1 not working.

Same issue,... any fix yet?

brian@phospher.com


Who's Online, Mediawiki 1.9.x not working (Fixed)

I had the same issue but i tried it different way and its working now.

i have added the following code at the end of includes/Setup.php file instead of making separate extension and adding at the end of localsettings.php file.


  function renderWhosOnline() {
  global $wgUser, $wgDBprefix,$wgVersion,$wgOut;
  global $wgOutputEncoding;
  require_once("includes/DatabaseFunctions.php");
  $Userlist = "";

  global $wgTitle;
  $ts = mktime();
  $now = gmdate("YmdHis", $ts   120);
  $ns = $wgTitle->getNamespace();
  $ti = wfStrencode($wgTitle->getDBkey());
  $version = preg_replace("/^([1-9]).([1-9]).*/", "\\1\\2", $wgVersion);
  if ($version>14) $sql = "UPDATE $wgDBprefix"."page SET page_touched='$now' WHERE page_namespace=$ns AND page_title='$ti'";
  else             $sql = "UPDATE $wgDBprefix"."cur SET cur_touched='$now' WHERE cur_namespace=$ns AND cur_title='$ti'";
  wfQuery($sql, DB_WRITE, "");

   $timeperiod = 3600; # number of seconds

  $DefaultEncoding = "ISO-8859-1";
  $DisableCache = true;
  $ts = mktime();
  $now = gmdate("YmdHis", $ts);
  $old = gmdate("YmdHis", $ts-$timeperiod);
  $userid = $wgUser->getID();
  $username = $wgUser->getName();
  $tblname = $wgDBprefix."online";

  $sql = "DELETE from $tblname WHERE username = '$username' OR timestamp < '$old' ";
  $db =


Can I place Whos on line under the toolbox

Can anyone help me place the whos online info under the Toolbox ?

Many thanks --Marke 03:46, 8 June 2007 (MDT)

  • Hi Marke! I don't even see the whos online info??? Please tell me where it is located, I see nothing on main page....--Lolo 19:39, 13 June 2007 (MDT)