You are not logged in.
So...would it be possible to have something like
[wiki=HAL]this[/wiki]
and have it work like the normal url bbcode, except for the wiki?
[url=wiki.archlinux.org/index.php/HAL]this[/url]
Maybe not KISS, but definately useful
Offline
If you find out how that could be done in FluxBB, it may be considered. I doubt any forum maintainers are going to go out of their way to find it for themselves...
Offline
interesting
+pc: custom | AMD Opteron 175 | nForce4 Ultra | 2GB ram DDR400 | nVidia 9800GT 1GB | ArchLinux x86_64 w/ openbox
+laptop: Apple | MacBook (2,1) | 2GB ram | Mac OS X 10.4 -> DIED
+ultrabook: Dell | XPS 13 (9343) | 8GB ram | 256GB ssd | FullHD display | Windows 8.1 64bit ArchLinux x86_64 w/ Gnome
Offline
Looking into it, what version of fluxbb does this forum run? Anyone know?
Offline
Looking into it, what version of fluxbb does this forum run? Anyone know?
FluxBB 1.2.22.
Offline
Alright, I have a (somewhat messy) patch for fluxBB 1.2.22.
281,296d280
< //
< //Turns a [wiki=pagename]link[/wiki] bbcode into <a href="http://wikibase/pagename">link</a>
< //
< function handle_wiki_tag($pagename, $link = '')
< {
< global $pun_user;
<
< $wikiurl = 'http://wiki.archlinux.org/index.php/';
<
< $full_url = str_replace(' ', '_', $wikiurl.$pagename);
<
< $link = ($link == '' || $link == $pagename) ? ((strlen($pagename) > 55) ? substr($pagename, 0 , 39).' … '.substr($pagename, -10) : $pagename) : stripslashes($link);
<
< return '<a href="'.$full_url.'">'.$link.'</a>';
< }
<
337,339c321
< '#\[color=([a-zA-Z]*|\#?[0-9a-fA-F]{6})](.*?)\[/color\]#s',
< '#\[wiki\]([^\[<]*?)\[/wiki\]#e',
< '#\[wiki=([^\[<]*?)\](.*?)\[/wiki\]#e');
---
> '#\[color=([a-zA-Z]*|\#?[0-9a-fA-F]{6})](.*?)\[/color\]#s');
348,350c330
< '<span style="color: $1">$2</span>',
< 'handle_wiki_tag(\'$1\')',
< 'handle_wiki_tag(\'$1\', \'$2\')');
---
> '<span style="color: $1">$2</span>');
It is based on the handle_url_tag function and supports the following syntax:
[wiki]Arch Linux[/wiki] (returns <a href="http://wiki.archlinux.org/index.php/Arch_Linux">Arch Linux</a>)
[wiki=Arch Linux]Somesuch[/wiki] (returns <a href="http://wiki.archlinux.org/index.php/Arch_Linux">Somesuch</a>)
EDIT: The above patch is for /include/parser.php
Last edited by techprophet (2009-09-08 15:11:47)
Offline
techprophet wrote:Looking into it, what version of fluxbb does this forum run? Anyone know?
FluxBB 1.2.22.
huh, until now I thought this forum was run on punbb... Did it change while I wasn't looking?
Offline
yes: http://bbs.archlinux.org/viewtopic.php?id=79469
Please open a bug report in the website section of the Arch project to ask for this to be included.
Offline
I would prefer a plugin over a patch (even a simple one) which has to be applied to upstream code.
Offline
As of 1.2.22, there is no way to do a plugin instead of a patch. I believe in 1.4 there may be. If there is, I will make one for 1.4 as well.
Ref:
* http://fluxbb.org/wiki/v1.2:installing_modifications
* http://fluxbb.org/wiki/v1.2:customization
I would agree that plugin is better than patch. Patching can have unintended consequences, especially in the PHP world.
Last edited by techprophet (2009-09-09 01:07:35)
Offline