phpbb php bbcode

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

phpbb php bbcode

Post by s.dot »

http://www.phpbb.com/mods/db/index.php? ... rib_id=769

Is all I could find to add a php bbcode button and syntax highlighter to a forum I'm working on. Which mod is it that this board uses (or is it a custom mod?).

I'd go with the one above, but it only has 142 downloads =/ So I suspect it's not the one I'm looking for.

phpbb v 2.0.22
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

We're using Geshi, with some custom-ish stuff for the php tag.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

Does geshi become available as a phpbb mod? Or is that custom done as well.

I really only need the php button, but geshi would be cool too.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

It's an older mod...

You should be able to dig out exactly what's been changed in the moderator boards (MOD discussion, I believe.)
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

Oh. I couldn't. I hate copying (even with permission) :P

I'll figure something out! Thanks feyd.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

So i tried installing the geshi mod. No luck.

So i figured I did something wrong.

Did a clean phpbb install. Installed the multiple bbcodes mod, and then tried the geshi mod again.

No luck.

Nothing shows up in the bbcode bar, and syntax="php" /syntax doesn't work.

Any suggestions?
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

Okay, I tinkered around and found the problem. It appears someone copy/pasted the MOD instructions, thus making entities show up as their character counterparts.

Code: Select all

if ( $board_config['syntax_status'] != SYNTAX_NO_PARSE )
    {
        $text = preg_replace("/\[syntax:$uid=\"?([a-zA-Z0-9\-_\+\#\$\%]+)\"?\](.*?)\[\/syntax:$uid\]/sie", "'{$bbcode_tpl['syntax_open']}' . geshi_highlight('\\2', '\\1', '$uid') . '{$bbcode_tpl['syntax_close']}'", $text);
    }
    else
    {
        $text = preg_replace("/\[syntax:$uid=(\"?[a-zA-Z0-9\-_\+\#\$\%]+\"?)\](.*?)\[\/syntax:$uid\]/si", "[syntax=\\1]\\2
", $text);
}

...........

$text = bbencode_first_pass_pda($text, $uid, '#\[syntax=(\\\"[a-zA-Z0-9\-_]+\\\")\]#is', '[/syntax]', '', false, '', "[syntax:$uid=\\1]");[/syntax]

Those quotes (") in the regex should be "

I'm not entirely sure, as it may be a server configuration that is doing that -- I'm not familiar with phpbb coding. But changing those did the trick.

Hope this is usefull for someone else having the same problem.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Post Reply