Extension talk:Friends.php

From Organic Design wiki

Testing

To do

MW still seems to sanitise the output and converts certain chars into entities. It make this:

<img src='/wiki/thumb.php?f=Image:Rob.jpg&width=48'>

Become this:

<img src='/wiki/thumb.php?f=Image:Rob.jpg&amp;width=48'>

Tag function

sql query (to get names of users who have edited a particular page):

select distinct user_name from user,revision where user.user_id = revision.rev_user and revision.rev_page = 5000;

In this context we obtain the title_id in this way:

function wgExplandTag( &$parser, &$text ) { 
$id = $wgTitle->getArticleID();

$dbr  = &wfGetDB(DB_SLAVE);
$u = $dbr->tableName('user');
$r = $dbr->tableName('revision');

$sql = "select distinct user_name from $u,$r where $u.user_id = $r.rev_user and $r.rev_page = $id;";
$res  = $dbr->query($sql);

while ($row = $dbr->fetchRow($res)) $list[] = $row[0];

$out = "<pre id=itworks>":
$out .= print_r($row, -1);
$out = "

":

return $html; }

Example URL "$wgScriptPath/thumb.php?f=Image:Nad&width=48"


http://organicdesign.co.nz/wiki/Image:Nad

Design

Choices of a vertical or horizontal table of single cells displaying the image of the user and optinally the user's name with link to their user page.

HHHHHHHH

or


H
H
H
H
H