There's been calls for footnotes [[m:Footnotes]], and it is an ability
that I've wanted for my own wiki for a while, so I hacked up some changes
to Parser.php and Skin.php (from CVS about three weeks ago). I used the
formatHeading function as a template and I am not even a PHP novice, but
the code works okay.
I used [note:foo] as the syntax. There are, I'm sure better choices.
Known issues
* When you have section editing turned on, you can click on editing the
Notes section. You shouldn't be
able to do that because there is nothing really there.
* Double quotes in the note break the hovering behavior of the in text
reference
Thanks for MediaWiki!
-Forest Gregg
> $text = preg_replace( '/(^|\n)-----*/', '\\1<hr />', $text );
>
+ $text = $this->formatFootnotes( $text );
> $text = $this->doHeadings( $text );
/*
*
* This function accomplishes several tasks:
* 1) Auto-number footnotes
* 3) Add a Notes section on the bottom
* 4) Auto-anchor footnotes
*
* It loops through all footnotes, collects the necessary data, then
* splits up the
* string and re-inserts the newly formatted headlines.
*
*/
/* private */ function formatFootnotes( $text, $isMain=true )
{
# numMatches is only used to test if there are footnotes,
#should be better way
$numMatches = preg_match_all( '/\[note:(.*?)\]/i', $text,
$matches );
#check if there are any notes
if ($numMatches) {
# To perform operations on the HTML
$sk =& $this->mOptions->getSkin();
#footnote counter
$footnoteCount = 0;
foreach ( $matches[1] as $footnote ) {
$footnoteCount = $footnoteCount + 1;
#format notes that appear in bottom note section
$footnotes .= $sk->footLine($footnoteCount, $footnote);
#format footnote and hold it in refer
$refer[$footnoteCount] = $sk->footNum($footnoteCount,
$footnote);
}
#format endnotes section
$footnotes = $sk->endNotes($footnotes);
$blocks = preg_split( '/\[note:(.*?)\]/i', $text );
$i = 0;
foreach( $blocks as $block ) {
$full .= $block;
if( !empty( $refer[$i+1] ) ) {
$full .= $refer[$i+1];
}
$i++;
}
$full .= '<br />'.$footnotes;
return $full;
}
else {
return $text;
}
}
[edit]
Skin.php
function footLine( $number, $footnote ) {
$foot = '<a name="endnote'.$number.'" id="endnote'.$number.'"
title="Return to text"></a><a
href="#note'.$number.'">'.$number.'.</a> '.$footnote.'<br />';
return $foot;
}
function footNum( $number, $footnote ) {
return '<a
name="note'.$number.'"id="note'.$number.'"></a><sup><a
href="#endnote'.$number.'" title="'.$footnote.'">'.$number.'</a></sup>';
}
function endNotes ( $footnotes ) {
return
"\n".
'==Notes=='
."\n".
$footnotes;
}
Hi!
We are thinking of setting up a wiki in our department and are looking
at the different wikis out there.
However, one requirement is that it must run on oracle, for a variety
of reasons. (I'd like to avoid a discussion of how I am supposed to
convince my boss to install a second, isolated database in the department.)
Has anybody already managed to get the mediawiki running on an oracle db?
Can anybody think offhand of any problems that might arise?
Right now the only thing that comes to my mind is BLOB handling, which
is slightly different in oracle.
Anything else?
Lots of Greetings!
Volker
Hello,
It seems that wikipedia is using the 1.3.0beta4, does
it ? Or is it slightly different from this beta. When
do you think there will be a release candidate ? And
can i use it in a production env ? because if you use
it, it should be enough stable to give a try.
I wonder if its possible to personnalized the left
menu. I mean, integrating it in a portal for example ?
I just need to had other possibility in the menu.
Which files I should modify ?
Thanks,
Créez gratuitement votre Yahoo! Mail avec 100 Mo de stockage !
Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/
Dialoguez en direct avec vos amis grâce à Yahoo! Messenger !Téléchargez Yahoo! Messenger sur http://fr.messenger.yahoo.com
I went to some of the pages on MediaWiki, such as
http://meta.wikipedia.org/wiki/How_to_become_a_MediaWiki_hacker and
http://meta.wikipedia.org/wiki/MediaWiki_architecture, hoping this
would be explained.
I tried:
% cd mediawiki/phase3
% php ./index.php
%
That blank line was the output. In other words, there was no output.
I was hoping this would just work. I once set up a fairly large (or too
large) perl-based app and the ability to also invoke it from the
command line, and pass in parameters so that they would be treated as
if they came out of the http headers, was completely invaluable.
Is there some non-obvious way to turn this on?
thanx - ray
The link to an existing article ([[de:Kotelett]]) is shown as red
(non-existing). Re-saving the article doesn't repair it. I remember that
problem from before, but I thought that was fixed?
Magnus
I've got to catch up on work and other (non-PHP!) projects, so I'm not
going to be real active on MediaWiki and Wikipedia stuff for a while.
Please direct requests for upgrades etc to other people if possible.
-- brion vibber (brion @ pobox.com)
Hello.
We have a meeting tomorrow in Paris, with Jimbo and probably some
journalists.
So please avoid making the wiki crawl if possible :)
Many thanks
Nicolas 'Ryo'
Marco Krohn wrote:
> one of the big problems of Wikipedia
> is that when you read an article in Wikipedia you never can be sure if the
> page was vandalized a short time before you arrived.
Huh? Yes you can. You look at the history.
Admittedly, people don't tend to do that unless they (a) know Wikipedia
and how it works, and (b) have reason to believe that the article might
be a in vandalised state.
Timwi
Hi,
I think we should have some filtrer for the mailing lists against spams and
virus.
At least to reject non valid domains and virus with a few regex. This doesn't
take much CPU power, like a full antispam and virus does.
I can help setting one if needed.
Yann
--
http://www.non-violence.org/ | Site collaboratif sur la non-violence
http://www.forget-me.net/ | Alternatives sur le Net
http://fr.wikipedia.org/ | Encyclopédie libre
http://www.forget-me.net/pro/ | Formations et services Linux
The info you are requesting will buy you nothing. Even if you know the
article was accessed by a watcher after the last edit you cannot be
sure he read it and corrected errors. database wise it should be
simple to implement and since only some numbers are involved, the
operation should eat that much resources if properly done.
--
| ,__o
| _-\_<,
http://www.gnu.franken.de/ke/ | (*)/'(*)