Not logged in. · Lost password · Register
Forum: General Help and Support Features and Functionality RSS
NAME in "Old Revisions" and "Last modified" instead of USER
Avatar
Wolfgang_F. #1
Member since Jul 2007 · 24 posts
Group memberships: Members
Show profile · Link to this post
Subject: NAME in "Old Revisions" and "Last modified" instead of USER
Is it possible to change some code in order to substitute @USER@ by @NAME@ in "Old Revisions" and "Last modified".

I would like to see Last modified: @DATE@ by @NAME@.
In my case: Last modified: ... by Wolfgang Fricke (istead of wolfgang).

Where do I have to change the php-code?

Thank you
Wolfgang
This post was edited on 2007-07-22, 13:36 by Wolfgang_F..
Avatar
3AtÜ #2
Member since Mar 2007 · 29 posts
Group memberships: Members
Show profile · Link to this post
Hi,
this is a very good idea. One quick solution could be, to retrieve the real name when reading the changelog.
Go to "inc/changelog.php" and at the following 2 items into the code. I don't know, how much overhead it produces, but it seems to work for the moment.

  1. for a function parseChangelogLine($line) {
  2.  // start hack
  3.  global $auth;
  4.  // end hack
  5.  
  6.  $tmp = explode("\t", $line);
  7.     if ($tmp!==false && count($tmp)>1) {
  8.       $info = array();
  9.       $info['date']  = (int)$tmp[0]; // unix timestamp
  10.       $info['ip']    = $tmp[1]; // IPv4 address (127.0.0.1)
  11.       $info['type']  = $tmp[2]; // log line type
  12.       $info['id']    = $tmp[3]; // page id
  13.       $info['user']  = $tmp[4]; // user name
  14.      
  15.       // start hack: fetch real name
  16.       $user = $auth->getUserData($info['user']);
  17.       $info['user'] = $user['name'];
  18.       // end hack
  19.      
  20.       $info['sum']   = $tmp[5]; // edit summary (or action reason)
  21.       $info['extra'] = rtrim($tmp[6], "\n"); // extra data (varies by line type)
  22.       return $info;
  23.  } else { return false; }
  24. }
Avatar
Wolfgang_F. #3
Member since Jul 2007 · 24 posts
Group memberships: Members
Show profile · Link to this post
Thank You!  :-)
This works fine with "Old Revisions" - for me it's a great improvement!

Just the Last-Modified-Line at the end of the page is not touched by this hack - does anybody know how to change this?
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2019-11-18, 19:08:48 (UTC +01:00)