Recent Topics

1 Oct 04, 2007 16:38    

It is a pleasure to announce the release of the [url=http://cronicaslinuxeras.com/2007/10/04/extension_enlaces_wikipedia_b2evolution#english]Wikipedia Links Plugin[/url] for b2evolution 1.10.2. From the linked blog post:

This plugin will replace all ocurrence of tags of the form: [[en:Article Title]] with links to the corresponing article in the respective wikipedia international site (as specified by the two letter language code). For instance, an entry like [[en:DNA]] will produce a link to [url=http://en.wikipedia.org/wiki/DNA]DNA[/url], while an entry like [[no:Næringsstoff]] will produce a link to http://no.wikipedia.org/wiki/Næringsstoff.

There was once a [url=http://forums.b2evolution.net/viewtopic.php?t=2294&highlight=wikipedia]plugin which did similar things[/url],but it seems to have dissapeared. So I wrote this little one to fill the void.

For me at least this is very useful, because I'm constantly linking to wikipedia articles. Let me know what you think about it.

Warning: If you write in russian, hebrew, or some other non-latin charset this probably would not do what you want. In the few cases I tested, the result was a bunch of html entities in the post which I could not make work. Maybe someone who knows better than me can help fix this.

This plugin has nothing to do with the Wikilinks provided by the default b2evolution installation, which creates internal links with a wikipedia-like syntax.

Update (02/29/2008):

As far as I know this the coolest plugin around :) So I decided to update and fix a few things. From the [url=http://cronicaslinuxeras.com/actualizada-ext-enlaces-wikipedia-b2evol#wlinkup_en]Announcement in my blog[/url]:

This new version (0.99) of my Wikipedia Links plugin for b2evolution brings one bug fix and two improvements.

[list]

  • The bug fix: Conflict with the Smilies plugin that produced smilies instead of links to wikipedia in some cases.

  • Improvement (1): Now WL understands extended link format, for instance: [[es:Real Madrid Club de Fútbol|Real Madrid]], produces: [url=http://es.wikipedia.org/wiki/Real_Madrid_Club_de_F%C3%BAtbol]Real Madrid[/url].

  • Improvement (2): Now the links have a CSS class "wikipedia_link", so that you can style them using CSS stylesheets (Thanks to Afwas for this suggestion)

  • [/list:u].

    Enjoy.

    2 Oct 12, 2007 16:09

    This is a very beatiful plugin that hasn't gotten the attention it deserves. I am very fond of preg_replace statements like yours:

    $content = preg_replace( '#\[\[([[]]{2}):([^]+]+)\]\]#eis',


    (and it is more beatiful if phpBB didn't delete the alpha part :p )
    One suggestion. I changed the line:

    .'\">'


    in

    .'\" class=\"wikilink\">'


    so I am able to style the links, like making them green.

    Thanks.

    3 Oct 12, 2007 16:14

    Thanks Afwas. It's amazing what one can do with Regular Expressions.

    I've taken your suggestion, that would be line 80. When I a little free time, I'll update the package.

    4 Oct 17, 2007 13:47

    It is a great plugin indeed and thanks for it.
    @Afwas, try as I can I cannot get your class= trick to work with 2.0.2 !!

    5 Oct 17, 2007 16:08

    John wrote:

    @Afwas, try as I can I cannot get your class= trick to work with 2.0.2 !!

    It works in 2.0.2, see my [url=http://blog.hemminga.net/index.php?blog=9]testblog[/url]. The line in the plugin you want to change is line 80, as Austriaco pointed out and the style goes into your skin's css file (or better, in one of the all skins css files at ../blogs/rsc/css/) and looks similar to:

    a.wikilink {
    background: transparent url(../../img/wikipedia.png) center right no-repeat;
    padding-right: 18px;
    color: green;
    }
    a.wikilink:visited {
    color: lightseagreen;
    }

    Good luck

    6 Oct 17, 2007 22:07

    Yep, I've seen your working example and I do have 2.0.2.... it just doesn't want to play :)

    7 Oct 17, 2007 22:16

    John wrote:

    Yep, I've seen your working example and I do have 2.0.2.... it just doesn't want to play :)

    What's the source of your output? Only thing I can imagine is an error there.

    Good luck

    8 Oct 17, 2007 22:32

    It doesn't render the class="wikilink" at all.
    I did a direct cut n paste of your posted line

    .'\" class=\"wikilink\">'

    9 Oct 17, 2007 22:35

    @John:
    Did you do an uninstall / install of the plugin and a delete cache?

    Good luck

    10 Oct 17, 2007 22:39

    I'll give it a spin today.... Could be the issue

    11 Oct 17, 2007 23:31

    Total uninstall and reinstall worked :)

    12 Oct 17, 2007 23:40

    John wrote:

    Total uninstall and reinstall worked :)

    Nice to hear you got it running :p

    Well done


    Form is loading...