Is it possible to convert Wikipedia link style [[...]] ?

Is it possible to convert Wikipedia link style [[...]] ?

Postby Guest on Fri Jan 28, 2005 10:05 am

Hi

How can I create a filter (or plugin?) to convert usert inputs like
Code: Select all
[[this is a link to a Wikipedia Article]]


into something like
Code: Select all
http://www.wikipedia.org/index.php/this_is_a_link_to_a_Wikipedia_Article


Thanx
Klasu
Guest
 

Postby phunkphorce on Fri Jan 28, 2005 10:12 am

try writing a plugin. You could a plugin like the smileys plugin as an example on how to create plugins that act on posts.
phunkphorce
Lifetype Expert
 
Posts: 9028
Joined: Mon Aug 25, 2003 6:34 am
Location: Suomessa

Re: Is it possible to convert Wikipedia link style [[...]] ?

Postby Babu on Sat Apr 12, 2008 5:03 am

I tried to do a plugin in wordpress for this function. (Linking to my own wiki) I also would have a plugin like this in lifetype. But I dont have a idea how to do this in Lifetype.

This is the code I used for the wordpress plugin

Code: Select all

{


  $text = ereg_replace('\[\[(.*)\|(.*)\]\]','<a href="http://www.mywiki.com/index.php?title=\1">\2</a>', $text);
  $text = ereg_replace('\[\[(.*)\]\]','<a href="http://www.mywiki.com/index.php?title=\1">\1</a>', $text);
 
  return $text;
}



Well, but I dont know where to start. Could anyone give me a hint?
Babu
 
Posts: 12
Joined: Sat Mar 22, 2008 7:02 pm
LifeType Version: 1.2.6

Re: Is it possible to convert Wikipedia link style [[...]] ?

Postby jondaley on Sat Apr 12, 2008 8:55 pm

See the textparser plugin - you probably just have to follow the update instructions to get it to work with 1.2.

http://devel.lifetype.net/svn/plog/plug ... extparser/

http://wiki.lifetype.net/index.php/Porting_Plugins

Once you are done, if you upload the changes (or complete files) to bugs.lifetype.net, we can release it as a 1.2 plugin.
jondaley
Lifetype Expert
 
Posts: 6169
Joined: Thu May 20, 2004 6:19 pm
Location: Pittsburgh, PA, USA
LifeType Version: 1.2.11 devel branch

Re: Is it possible to convert Wikipedia link style [[...]] ?

Postby Babu on Sun Apr 13, 2008 8:48 am

Thank you for that info. I didnt know about the textparser plugin. Actually its way to powerfull for my needs. I was thinking maybe its possible to do a filter for this function. But I dont know which is the right file to add my changes.
Babu
 
Posts: 12
Joined: Sat Mar 22, 2008 7:02 pm
LifeType Version: 1.2.6


Return to General Plugin Development

cron