Difference between revisions of "Extension talk:Friends.php"
From Organic Design wiki
m |
m |
||
(7 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
+ | ==Testing== | ||
+ | *http://mediawiki-1.12.organicdesign.co.nz/Sandbox?action=purge | ||
+ | ==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): | sql query (to get names of users who have edited a particular page): | ||
<pre> | <pre> | ||
Line 4: | Line 14: | ||
</pre> | </pre> | ||
− | |||
In this context we obtain the ''title_id'' in this way: | In this context we obtain the ''title_id'' in this way: | ||
<pre> | <pre> | ||
+ | function wgExplandTag( &$parser, &$text ) { | ||
$id = $wgTitle->getArticleID(); | $id = $wgTitle->getArticleID(); | ||
Line 17: | Line 27: | ||
while ($row = $dbr->fetchRow($res)) $list[] = $row[0]; | while ($row = $dbr->fetchRow($res)) $list[] = $row[0]; | ||
− | print_r($ | + | |
+ | $out = "<pre id=itworks>": | ||
+ | $out .= print_r($row, -1); | ||
+ | $out = "</pre>": | ||
+ | |||
+ | return $html; | ||
+ | } | ||
+ | </pre> | ||
+ | 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. | ||
+ | <pre> | ||
+ | HHHHHHHH | ||
+ | |||
+ | or | ||
+ | |||
+ | |||
+ | H | ||
+ | H | ||
+ | H | ||
+ | H | ||
+ | H | ||
</pre> | </pre> |
Latest revision as of 09:48, 25 March 2008
Contents
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&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