| View previous topic :: View next topic |
| Author |
Message |
Austriaco Hooked :)

 Joined: 03 Feb 2005 Posts: 335
   votes: 11
|
Posted: Thu Oct 04, 2007 9:38 Post subject: [Plugin] Wikipedia Links Plugin |
|
|
It is a pleasure to announce the release of the Wikipedia Links Plugin for b2evolution 1.10.2. From the linked blog post:
| Quote: |
| 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 DNA, while an entry like [[no:Næringsstoff]] will produce a link to http://no.wikipedia.org/wiki/Næringsstoff. |
There was once a plugin which did similar things,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 Announcement in my blog:
| Quote: |
This new version (0.99) of my Wikipedia Links plugin for b2evolution brings one bug fix and two improvements.
- 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: Real Madrid.
- 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)
. |
Enjoy. _________________ Linux y otras cosas más
No more trackback Spam: DNS Trackback Anti-Spam Plugin
Let your readers share! ShareThis Plugin
Last edited by Austriaco on Fri Feb 29, 2008 9:19; edited 2 times in total |
|
| Back to top |
|
 |
Afwas Forum helper
 Joined: 03 Jan 2007 Posts: 3559
    votes: 63
|
Posted: Fri Oct 12, 2007 9:09 Post subject: |
|
|
This is a very beatiful plugin that hasn't gotten the attention it deserves. I am very fond of preg_replace statements like yours:
| PHP: |
|
$content = preg_replace( '#\[\[([[]]{2}):([^]+]+)\]\]#eis',
|
(and it is more beatiful if phpBB didn't delete the alpha part )
One suggestion. I changed the line:
in
| PHP: |
|
.'\" class=\"wikilink\">'
|
so I am able to style the links, like making them green.
Thanks. _________________

Join us at irc://irc.freenode.net#B2evolution
More B2evo goodies at http://www.blog.hemminga.net |
|
| Back to top |
|
 |
Austriaco Hooked :)

 Joined: 03 Feb 2005 Posts: 335
   votes: 11
|
Posted: Fri Oct 12, 2007 9:14 Post subject: |
|
|
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. _________________ Linux y otras cosas más
No more trackback Spam: DNS Trackback Anti-Spam Plugin
Let your readers share! ShareThis Plugin |
|
| Back to top |
|
 |
John the uncertain
Joined: 22 Jun 2004 Posts: 2147
     votes: 27
|
Posted: Wed Oct 17, 2007 6:47 Post subject: |
|
|
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 !! _________________ See the Sites in in Venice |
|
| Back to top |
|
 |
Afwas Forum helper
 Joined: 03 Jan 2007 Posts: 3559
    votes: 63
|
Posted: Wed Oct 17, 2007 9:08 Post subject: |
|
|
| 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 testblog. 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:
| Code: |
a.wikilink {
background: transparent url(../../img/wikipedia.png) center right no-repeat;
padding-right: 18px;
color: green;
}
a.wikilink:visited {
color: lightseagreen;
} |
Good luck _________________

Join us at irc://irc.freenode.net#B2evolution
More B2evo goodies at http://www.blog.hemminga.net |
|
| Back to top |
|
 |
John the uncertain
Joined: 22 Jun 2004 Posts: 2147
     votes: 27
|
Posted: Wed Oct 17, 2007 15:07 Post subject: |
|
|
Yep, I've seen your working example and I do have 2.0.2.... it just doesn't want to play  _________________ See the Sites in in Venice |
|
| Back to top |
|
 |
Afwas Forum helper
 Joined: 03 Jan 2007 Posts: 3559
    votes: 63
|
Posted: Wed Oct 17, 2007 15:16 Post subject: |
|
|
| 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 _________________

Join us at irc://irc.freenode.net#B2evolution
More B2evo goodies at http://www.blog.hemminga.net |
|
| Back to top |
|
 |
John the uncertain
Joined: 22 Jun 2004 Posts: 2147
     votes: 27
|
Posted: Wed Oct 17, 2007 15:32 Post subject: |
|
|
It doesn't render the class="wikilink" at all.
I did a direct cut n paste of your posted line
| PHP: |
|
.'\" class=\"wikilink\">'
|
_________________ See the Sites in in Venice |
|
| Back to top |
|
 |
Afwas Forum helper
 Joined: 03 Jan 2007 Posts: 3559
    votes: 63
|
|
| Back to top |
|
 |
John the uncertain
Joined: 22 Jun 2004 Posts: 2147
     votes: 27
|
Posted: Wed Oct 17, 2007 15:39 Post subject: |
|
|
I'll give it a spin today.... Could be the issue _________________ See the Sites in in Venice |
|
| Back to top |
|
 |
John the uncertain
Joined: 22 Jun 2004 Posts: 2147
     votes: 27
|
Posted: Wed Oct 17, 2007 16:31 Post subject: |
|
|
Total uninstall and reinstall worked  _________________ See the Sites in in Venice |
|
| Back to top |
|
 |
Afwas Forum helper
 Joined: 03 Jan 2007 Posts: 3559
    votes: 63
|
|
| Back to top |
|
 |
Austriaco Hooked :)

 Joined: 03 Feb 2005 Posts: 335
   votes: 11
|
|
| Back to top |
|
 |
|