Wiki BBCode


Goto page 1, 2  Next

Subject: Wiki BBCode
Well, I just developed a BBcode for my website (as I have just created a new wiki about Stephen King, I wanted to make a relation between them both)

So This is how it works:

Code: [Download] [Hide]
  1. [wiki]Article[/wiki] --> Do you know what [wiki]phpBB[wiki] mean?  
  2.  
  3. [wiki=Article]Text[/wiki] --> If you don't know what phpBB menas, click [wiki=Article]here[/wiki]  
  4.  
  5. [wiki art="Article"]Text[/wiki] --> Same as above 


If you wank to see a demo --> here

First you should save this image: to your ./images folder and name it as wkp.png

Second open ./includes/bbcode.php

Find
Code: [Download] [Hide]
  1. 'img' => array( 


Right before add:
Code: [Download] [Hide]
  1. 'wiki' => array(  
  2. 'nested' => false,  
  3. 'inurl' => false,  
  4. 'allow_empty' => false,  
  5. ), 


Find
Code: [Download] [Hide]
  1. // --- Disable Active Content Switch BEGIN --- 


Right Before add
Code: [Download] [Hide]
  1. // BBcode Wiki, by Roland at ka-tet-corp.com  
  2. if($tag === 'wiki')  
  3. {  
  4. $wiki_url='http://en.wikipedia.org/wiki/';  
  5. if($this->is_sig)  
  6. {  
  7. return $error;  
  8. }  
  9. if($item['iteration'] > 1)  
  10. {  
  11. return $error;  
  12. }  
  13. $wiki_text = '';  
  14. if(isset($item['params']['param']))  
  15. {  
  16. $wiki_text = htmlspecialchars($item['params']['param']);  
  17. }  
  18. elseif(isset($item['params']['art']))  
  19. {  
  20. $wiki_text = htmlspecialchars($item['params']['art']);  
  21. }  
  22. else  
  23. {  
  24. $wiki_text = $content;  
  25. }  
  26. $str = '<a href="' . $wiki_url . $wiki_text . '" target="_wiki">';  
  27. $str .= '<img src="./images/wkp.png" alt="Artículo de la wiKINGpedia">';  
  28. //$str .= $content;  
  29. return array(  
  30. 'valid' => true,  
  31. 'start' => $str,  
  32. 'end' => '</a>'  
  33. );  


Customization...

You should change the $wiki_url to whatever wiki you want to refer to (i.e: http://es.wikipedia.org/wiki/ for spanish, http://gl.wikipedia.org/wiki/ for galician or http://furry.wikia.com/wiki/ for a furry wikipedia... whatever you want)

And that's all...

Do you think it worths?

Last edited by Xusqui on Sun 17 Dec, 2006 08:49; edited 1 time in total
Subject: Re: Wiki BBCode
Nice one Xusqui :up:

Profile PM  
Subject: Re: Wiki BBCode
Yes, I think many people will find this useful.

I'll think about including this one too...

But only when I have enough time to test again all BBCodes and remake some buttons. :wink:

Thanks for your contribution!

Subject: Re: Wiki BBCode
Mighty Gorgon wrote: [View Post]
... and remake some buttons. :wink:


Which one :?:

Profile PM  
Subject: Re: Wiki BBCode
TheSteffen wrote: [View Post]
Mighty Gorgon wrote: [View Post]
... and remake some buttons. :wink:


Which one :?:

I didn't look at your new buttons yet... I'll look at them one day, and then I'll tell you if some of them need to be remade or not! :wink:

I'll leave BBCodes functions and buttons as one of the last things to be checked, since it's not a crucial issue right now...

Anyway, if you want to renew something about BBCodes graphics, you can do it... :wink:

Subject: Re: Wiki BBCode
I don't know why, but wiki bbcode doesn't work for me :?

Subject: Re: Wiki BBCode
mod also does not work with me

Subject: Re: Wiki BBCode
Fool of me!!!

I forgot it!!!

You should also find (inside includes/bbcode.php)

Code: [Download] [Hide]
  1. 'img' => array( 


And right before add:

Code: [Download] [Hide]
  1. 'wiki' => array(  
  2. 'nested' => false,  
  3. 'inurl' => false,  
  4. 'allow_empty' => false,  
  5. ), 


Sorry you both!!!

PS: I updated the 1st post too!

Subject: Re: Wiki BBCode
Is this MOD for Admin only, because I don't see and wiki button/icon when posting a message on your site!

Subject: Re: Wiki BBCode
Nop... It's not for admin only... It's just that it has no implemented button yet ;)

You have to write it inside a post to use it... I mean, you must write
Code: [Download] [Hide]
  1. [wiki]phpbb[/wiki] 
to use it ;) Maybe I'll write a button latter... Maybe not ;)

Does it work for you?

Subject: Re: Wiki BBCode
will try it tonight., I think a button will make it user friendly

BTW great MOD :mrgreen:

Subject: Re: Wiki BBCode
Xusqui wrote: [View Post]
Nop... It's not for admin only... It's just that it has no implemented button yet ;)

You have to write it inside a post to use it... I mean, you must write
Code: [Download] [Hide]
  1. [wiki]phpbb[/wiki] 
to use it ;) Maybe I'll write a button latter... Maybe not ;)

Does it work for you?


thank it work :up:

Subject: Re: Wiki BBCode
well i'm just starting working with php, and i did the wiki button, i'll post it here so anyone that wants to review it and fix it can.

I tested it and it worked fine.

IMPORTANT: Xusqui i changed the image name, sorry 'bout that.


Wiki BBcode.rar
Description: Wiki BBcode 
Download
Filename: Wiki BBcode.rar
Filesize: 2.88 KB
Downloaded: 318 Time(s)

Profile PM  
Subject: Re: Wiki BBCode
thanks for your contribution, Ishigo!!!

I'll try it tonite when I'll arrive home!!

Doesn't matter if you changed the name ;)

Greetz!!

Subject: Re: Wiki BBCode
Xusqui wrote: [View Post]
thanks for your contribution, Ishigo!!!

I'll try it tonite when I'll arrive home!!

Doesn't matter if you changed the name ;)

Greetz!!


Well, did it worked fine?

Profile PM  
Goto page 1, 2  Next

Page 1 of 2


  
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events

   

This is a "Lo-Fi" version of our main content. To view the full version with more information, formatting and images, please click here.

Powered by Icy Phoenix based on phpBB
Generation Time: 0.0994s (PHP: 22% SQL: 78%)
SQL queries: 12 - Debug Off - GZIP Enabled