Discussion:
progress
Joerg Baach
2007-03-05 17:59:39 UTC
Permalink
Hi *,

just wanted to give a word - I am still alive, reading and playing
around with the mediawiki software, short of creating my first code.
Things are getting a bit clearer, some stuff is a bit surprising
(following my mysql.log).

Tomorrow I will be mostly offline, heading to London, but having stuff
on my Laptop on the ferry. I will give you a note on wednesday, maybe
already some first code bits then, but most likely quite a couple of
questions. ;-)

Yours,

Joerg
Joerg Baach
2007-03-07 10:56:58 UTC
Permalink
Hi *,

just another quick update.

Attached you find my 'trying out different things' file, which shows you
the first sql for the table, and my tries to get some Hooks and Outputs
going.

One of the things that I am wondering at the moment is how to display
forms, links and other output on normal Article pages just using hooks.
The last thing I tried yesterday was the DiffViewHeader, which would
allow for managing the revisiontags (needs to be renamed). I could
output the results using BeforePageDisplay, and wgOut->addHtml, and some
css to move stuff to the top, but this does not seem to be that clean.

Now, to get help with questions like that, where do you recommend to
look for answers? This list, #wikipedia, another mailinglist?

Cheers,

Joerg

----------------
<?
/*
--
-- Table structure for table `revisiontags`
--
CREATE TABLE `revisiontags` (
`rt_id` int(10) NOT NULL auto_increment,
`rt_rev_id` int(10) NOT NULL,
`rt_dimension` varchar(255) NOT NULL,
`rt_tag` int(2) NOT NULL,
`rt_user` int(5) NOT NULL,
`rt_timestamp` char(14) NOT NULL,
`rt_comment` varchar(255) default NULL,
PRIMARY KEY (`rt_id`),
KEY `rt_rev_id` (`rt_rev_id`,`rt_dimension`,`rt_tag`,`rt_timestamp`)
) CHARSET=latin1 COMMENT='Revision Tags Extension' AUTO_INCREMENT=1 ;


Possible Hooks
--------------

'BeforePageDisplay': Called just before outputting a page (all kinds of,
articles, special, history, preview, diff, edit, ...)
Can be used to set custom CSS/JS
$out: OutputPage object


'OutputPageBeforeHTML': a page has been processed by the parser and
the resulting HTML is about to be displayed.
$parserOutput: the parserOutput (object) that corresponds to the page
$text: the text that will be displayed, in HTML (string)

*/

class RevisionTags {

var $dimensions = array('quality'=>array('tags'=>array(0=>'none',

1=>'unvandalised',
2=>'superb'),
'comments'=>True,
'default'=>0));


function writeTag($rev_id,$dimension,$tag,$user,$comment) {


}

function getTagsForRevision($rev_id) {


}

function writeStuff(&$out) {
global $mediaWiki;
if ($out->isArticle())
$text = 'Yeah, Article';
else
$text = 'Something else';
$out->addHTML("<blink>$text</blink>");

}

function addToDiff(&$diff,&$oldrev,&$newrev) {
global $wgOut;
$id = $newrev->getId();
$self = $_SERVER['PHP_SELF'];
$form = "
<form action='$self/Special:RevisionTags'>
Tag new revision $id:<br>";
foreach ($this->dimensions as $dimension=>$content) {
$form.="$dimension <select name='$dimension'>";
foreach ($content['tags'] as $idx=>$label) {
$form.="<option value='$idx'>$label</option>";
}
$form.="</select>";

}
$form.="<input type='submit' value='tag'></form>";
$wgOut->addHTML($form);

}


}


$revtags = new RevisionTags();
#$wgHooks['BeforePageDisplay'][] = array($revtags, 'writeStuff');
$wgHooks['DiffViewHeader'][] = array($revtags, 'addToDiff');
?>
P. Birken
2007-03-07 11:18:28 UTC
Permalink
Ah, something to see!
Post by Joerg Baach
Now, to get help with questions like that, where do you recommend to
look for answers? This list, #wikipedia, another mailinglist?
On this list are several people who are very familiar with MediaWiki,
so I think that this list will work. There is also the list wikitech
(http://lists.wikimedia.org/mailman/listinfo/wikitech-l), which is
quite active, but is mirrored in the net.

As for the IRC, there is #wikimedia-tech.

Cheers,

Philipp
Erik Moeller
2007-03-07 17:41:04 UTC
Permalink
Post by Joerg Baach
One of the things that I am wondering at the moment is how to display
forms, links and other output on normal Article pages just using hooks.
The last thing I tried yesterday was the DiffViewHeader, which would
allow for managing the revisiontags (needs to be renamed). I could
output the results using BeforePageDisplay, and wgOut->addHtml, and some
css to move stuff to the top, but this does not seem to be that clean.
It should be fine to create a branch of the core with additional
hooks, as required.

Please coordinate this with Brion (brion-e+***@public.gmane.org , brion on IRC) who
is also on this mailing list.
Post by Joerg Baach
Now, to get help with questions like that, where do you recommend to
look for answers? This list, #wikipedia, another mailinglist?
The correct mailing list is wikitech-l; on IRC (irc.freenode.net), use
#mediawiki (#wikimedia-tech is more for server admin issues).
--
Peace & Love,
Erik

DISCLAIMER: This message does not represent an official position of
the Wikimedia Foundation or its Board of Trustees.

"An old, rigid civilization is reluctantly dying. Something new, open,
free and exciting is waking up." -- Ming the Mechanic
Loading...