[Plugin] Wikipedia Links Plugin

 
Post new topic   Reply to topic   printer-friendly view    b2evolution Forum Index -> Plugins & Extensions
View previous topic :: View next topic  
Author Message
Austriaco
Hooked :)
Hooked :)

Joined: 03 Feb 2005
Posts: 335
Reputation: 182.7Reputation: 182.7 add or subtract from this member's reputationadd or subtract from this member's reputation
votes: 11

PostPosted: Thu Oct 04, 2007 9:38    Post subject: [Plugin] Wikipedia Links Plugin Reply with quote

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 Smile 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
View user's profile Send private message Visit poster's website
Afwas
Forum helper

Joined: 03 Jan 2007
Posts: 3559
Reputation: 28.7Reputation: 28.7Reputation: 28.7 add or subtract from this member's reputationadd or subtract from this member's reputation
votes: 63

PostPosted: Fri Oct 12, 2007 9:09    Post subject: Reply with quote

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 Razz )
One suggestion. I changed the line:
PHP:
.'\">' 

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
View user's profile Send private message Visit poster's website Yahoo Messenger
Austriaco
Hooked :)
Hooked :)

Joined: 03 Feb 2005
Posts: 335
Reputation: 182.7Reputation: 182.7 add or subtract from this member's reputationadd or subtract from this member's reputation
votes: 11

PostPosted: Fri Oct 12, 2007 9:14    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
John
the uncertain

Joined: 22 Jun 2004
Posts: 2147
Reputation: 4.6Reputation: 4.6Reputation: 4.6Reputation: 4.6 add or subtract from this member's reputationadd or subtract from this member's reputation
votes: 27

PostPosted: Wed Oct 17, 2007 6:47    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Afwas
Forum helper

Joined: 03 Jan 2007
Posts: 3559
Reputation: 28.7Reputation: 28.7Reputation: 28.7 add or subtract from this member's reputationadd or subtract from this member's reputation
votes: 63

PostPosted: Wed Oct 17, 2007 9:08    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website Yahoo Messenger
John
the uncertain

Joined: 22 Jun 2004
Posts: 2147
Reputation: 4.6Reputation: 4.6Reputation: 4.6Reputation: 4.6 add or subtract from this member's reputationadd or subtract from this member's reputation
votes: 27

PostPosted: Wed Oct 17, 2007 15:07    Post subject: Reply with quote

Yep, I've seen your working example and I do have 2.0.2.... it just doesn't want to play Smile
_________________
See the Sites in in Venice
Back to top
View user's profile Send private message Visit poster's website
Afwas
Forum helper

Joined: 03 Jan 2007
Posts: 3559
Reputation: 28.7Reputation: 28.7Reputation: 28.7 add or subtract from this member's reputationadd or subtract from this member's reputation
votes: 63

PostPosted: Wed Oct 17, 2007 15:16    Post subject: Reply with quote

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

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
View user's profile Send private message Visit poster's website Yahoo Messenger
John
the uncertain

Joined: 22 Jun 2004
Posts: 2147
Reputation: 4.6Reputation: 4.6Reputation: 4.6Reputation: 4.6 add or subtract from this member's reputationadd or subtract from this member's reputation
votes: 27

PostPosted: Wed Oct 17, 2007 15:32    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Afwas
Forum helper

Joined: 03 Jan 2007
Posts: 3559
Reputation: 28.7Reputation: 28.7Reputation: 28.7 add or subtract from this member's reputationadd or subtract from this member's reputation
votes: 63

PostPosted: Wed Oct 17, 2007 15:35    Post subject: Reply with quote

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

Good luck

_________________

Join us at irc://irc.freenode.net#B2evolution
More B2evo goodies at http://www.blog.hemminga.net
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
John
the uncertain

Joined: 22 Jun 2004
Posts: 2147
Reputation: 4.6Reputation: 4.6Reputation: 4.6Reputation: 4.6 add or subtract from this member's reputationadd or subtract from this member's reputation
votes: 27

PostPosted: Wed Oct 17, 2007 15:39    Post subject: Reply with quote

I'll give it a spin today.... Could be the issue
_________________
See the Sites in in Venice
Back to top
View user's profile Send private message Visit poster's website
John
the uncertain

Joined: 22 Jun 2004
Posts: 2147
Reputation: 4.6Reputation: 4.6Reputation: 4.6Reputation: 4.6 add or subtract from this member's reputationadd or subtract from this member's reputation
votes: 27

PostPosted: Wed Oct 17, 2007 16:31    Post subject: Reply with quote

Total uninstall and reinstall worked Smile
_________________
See the Sites in in Venice
Back to top
View user's profile Send private message Visit poster's website
Afwas
Forum helper

Joined: 03 Jan 2007
Posts: 3559
Reputation: 28.7Reputation: 28.7Reputation: 28.7 add or subtract from this member's reputationadd or subtract from this member's reputation
votes: 63

PostPosted: Wed Oct 17, 2007 16:40    Post subject: Reply with quote

John wrote:
Total uninstall and reinstall worked Smile

Nice to hear you got it running Razz

Well done

_________________

Join us at irc://irc.freenode.net#B2evolution
More B2evo goodies at http://www.blog.hemminga.net
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Austriaco
Hooked :)
Hooked :)

Joined: 03 Feb 2005
Posts: 335
Reputation: 182.7Reputation: 182.7 add or subtract from this member's reputationadd or subtract from this member's reputation
votes: 11

PostPosted: Fri Feb 29, 2008 9:18    Post subject: Version 0.99 released. Reply with quote

I have released a new and improved version of this plugins, for all of those who are compulsive wikipedia linkers Smile

Read the updated initial post for the details or Go to my blog and read the gory details of the affair between Wikipedia Links and Smilies plugin

_________________
Linux y otras cosas más
No more trackback Spam: DNS Trackback Anti-Spam Plugin
Let your readers share! ShareThis Plugin
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    b2evolution Forum Index -> Plugins & Extensions All times are GMT - 5 Hours
Page 1 of 1


 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
b2evolution Support Forum RSS Feed Forums powered by php Bulletin Board