Difference between revisions of "Extension talk:Friends.php"

From Organic Design wiki
m
m (Design)
Line 33: Line 33:
 
==Design==
 
==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.
 
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.
 
+
<pre>
 
HHHHHHHH
 
HHHHHHHH
  
Line 44: Line 44:
 
H
 
H
 
H
 
H
 +
</pre>

Revision as of 03:59, 25 March 2008

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;

Parser function

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