The numbered lines are not the default params. To get numbered lines you got to declare it in the params of the bbCodeMardag wrote:Thanks for the MODIt's great. I've got 3 questions:
1) At first, I had line numbers and now they are gone. What happened?
[syntax lang="php" lines="geshi-f"]<?php echo 'Hello World'; ?>[/syntax]
To get the numbered lines by default, do the following:
OPEN: includes/hooks/hook_syntax_highlighter.php
FIND:
Code: Select all
var $params = array();
Code: Select all
var $params = array('lines' => 'f');
You can... do be able to do that:Mardag wrote:2) Why can't I use the MOD using for example [php]<?php echo ""; ?>[/php]? I have to use [syntax=php]<?php echo ""; ?> [/syntax] instead.
OPEN: includes/hooks/hook_syntax_highlighter.php
FIND:
Code: Select all
var $auto_add_tags = false;
Code: Select all
var $auto_add_tags = true;
Not only is this highlighter has more languages, it is more advanced... I would prefer that phpBB has this by default rather then what they have.annab wrote:Isn't syntax highlighting already built into phpbb3? I use the normal code=php and it works just fine.
I eliminated that line altogether and replaced Syntax: with the name of the language that is being highlighted. Here is how you do that.tvrsh wrote:Hello, I have some little problem with this mod.
When I press Select button it select all the code, but with "Parsed in ... seconds, using GeSHi ...".
So when I paste this selected code somewhere there is one unnecessary string with Geshi info.
And one more question: How can I replace "Using ... Syntax Highlighting" string to string with Syntax, Select, Expand buttons. So it became like this:
Syntax: [ Download ] [ Show ] [ Select ] [ Toggle ] Using %1$s Syntax Highlighting
some code
Parsed in 0.022 seconds, using GeSHi 1.0.8.4
OPEN: includes/hooks/hook_syntax_highlighter.php
FIND:
Code: Select all
$header = '<div style="text-align: center; width: auto; font-family: Verdana, Arial, sans-serif; color: #808080; font-size: 12px; font-weight: bold; background-color: #f0f0ff; border-bottom: 1px solid #d0d0d0; padding: 2px;">' . sprintf($user->lang['XS_BBC_USING_SYNTAX'], '<span style="color: #900;">' . $syntax . '</span>') . '</div>';
Code: Select all
//$header = '<div style="text-align: center; width: auto; font-family: Verdana, Arial, sans-serif; color: #808080; font-size: 12px; font-weight: bold; background-color: #f0f0ff; border-bottom: 1px solid #d0d0d0; padding: 2px;">' . sprintf($user->lang['XS_BBC_USING_SYNTAX'], '<span style="color: #900;">' . $syntax . '</span>') . '</div>';
And to replace the Syntax: with the language name being highlighted, you would:
OPEN: includes/hooks/hook_syntax_highlighter.php
FIND:
Code: Select all
$str .= '<div class="syntax-header" id="codehdr2_' . $code_id . '" style="position: relative;"><b>' . $user->lang['XS_BBC_SYNTAX'] . '</b>:' . (empty($item['params']['file']) ? '' : ' (' . htmlspecialchars($item['params']['file']) . ')') . $download_text . ' [ <a href="javascript:void(0)" onclick="xs_show_hide(\'code_' . $code_id . '\', \'code2_' . $code_id . '\', \'\'); xs_show_hide(\'codehdr_' . $code_id . '\', \'codehdr2_' . $code_id . '\', \'\')">' . $user->lang['XS_BBC_HIDE'] . '</a> ]' . ( ($load_expand == true) ? '<script type="text/javascript">SXBB[id].writeCmd();</script>' : '') . '</div>';
Code: Select all
$str .= '<div class="syntax-header" id="codehdr2_' . $code_id . '" style="position: relative;"><b>' . strtoupper($syntax) . '</b>:' . (empty($item['params']['file']) ? '' : ' (' . htmlspecialchars($item['params']['file']) . ')') . $download_text . ' [ <a href="javascript:void(0)" onclick="xs_show_hide(\'code_' . $code_id . '\', \'code2_' . $code_id . '\', \'\'); xs_show_hide(\'codehdr_' . $code_id . '\', \'codehdr2_' . $code_id . '\', \'\')">' . $user->lang['XS_BBC_HIDE'] . '</a> ]' . ( ($load_expand == true) ? '<script type="text/javascript">SXBB[id].writeCmd();</script>' : '') . '</div>';