Difference between revisions of "Extension talk:Friends.php"
From Organic Design wiki
(output html) |
(add thumbnailing) |
||
| Line 26: | Line 26: | ||
} | } | ||
</pre> | </pre> | ||
| + | Example URL | ||
| + | "$wgScriptPath/thumb.php?f=Image:Nad&width=48" | ||
| + | |||
| + | |||
| + | http://organicdesign.co.nz/wiki/Image:Nad | ||
Revision as of 03:57, 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"



