Hey all
I am coding my own wiki for my new site. At the moment i can make new wiki (if the tag does not exist) and i can edit posts.
Now what i want to be able to do is is say a user in the wiki posted [[text]] it will return as a link to the wiki tag.
How can i make this happen? how can i make [[text]] turn into <a href='wiki.php?tag=test'>text</a> ?
thanks all
WIKI: [[text]] will equal link
Started by b3nji, Jan 21 2006 07:09 PM
5 replies to this topic
#1
Posted 21 January 2006 - 07:09 PM
#2
Posted 21 January 2006 - 07:12 PM
The only thing i know about wiki is wikipedia. I've never done anything but read articles on wiki sites, but i would assume changing [[text]] into a link, would run the same as bbcode. Do a search of the database, and you'll come up with something.
#3
Posted 21 January 2006 - 07:19 PM
rc69, on Jan 22 2006, 12:12 AM, said:
The only thing i know about wiki is wikipedia. I've never done anything but read articles on wiki sites, but i would assume changing [[text]] into a link, would run the same as bbcode. Do a search of the database, and you'll come up with something.
will do thanks
well basically i am told i need to make a bb code.
For example.
"This is my [wiki] entry on my website"
how can i get [wiki] to equal: <a href='wiki.php?tag=wiki'>wiki< /a>?
#4
Posted 22 January 2006 - 12:19 AM
With php you can do:
<?php
echo preg_replace("/\[(.*)\]/", '<a href="wiki.php?tag=$1">$1</a>', 'This is my [wiki] entry on my website');
?>
Haven't tested it but it should work.
#5
Posted 22 January 2006 - 12:45 PM
b3nji, on Jan 21 2006, 07:12 PM, said:
http://www.pixel2life.com/tutorials/PHP_Co...1&d=1&ss=bbcode
Although, if you don't feel like sorting through that list of tutorials, i believe halopr0's code should work just fine.
p.s. Please don't triple post, use the edit button.
Edited by rc69, 22 January 2006 - 12:46 PM.
#6
Posted 22 January 2006 - 01:46 PM
I've never seen a triple post before...
And I think he thought that Pixel2Life was your website..
And I think he thought that Pixel2Life was your website..
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users
