GeSHi Syntax Highlighter [Deleted]

How do you add codes to the drop down? Also I think there should be a little note in the code overlay telling how to do this. Otherwise no one knows.
 
How do you add codes to the drop down?
For a 'quick & dirty' method while debug mode is turned on and logged in as an admin to the ACP, go into...

ACP => Appearance => Template Modifications => {Digital Point Syntax Highlighter} editor_dialog_code

In the "Replace" text box add your new selections to the list of options. For example, for a new project I am working on I added ColdFusion to the list of choices.
Code:
<script src="{$javaScriptSource}/digitalpoint/syntax_highlighter.js?_v={$xenOptions.jsVersion}"></script>
$1
<option value="code=CFM">ColdFusion</option>
<option value="code=JavaScript">JavaScript</option>
<option value="code=CSS">CSS</option>
The value to use for the "code=" part has to match the name of file in your {xf}/library/DigitalPointSyntaxHighlighter/geshi folder. My new entry for ColdFusion, for example, would use "cfm.php" so "cfm" is the value to use for the code in the option while the "ColdFusion" text could be anything you want it to be.
 
I have error reports with this:

ErrorException: preg_replace_callback() [<a href='function.preg-replace-callback'>function.preg-replace-callback</a>]: Unknown modifier '.' - library/DigitalPointSyntaxHighlighter/geshi.php:3456

What is the problem? how i can fix it?

thanks!
 
The digitalpoint addon is nice, but it doesn't add the languages to the drop down list. Members have to do this manually which means it rarely gets used.
 
The digitalpoint addon is nice, but it doesn't add the languages to the drop down list. Members have to do this manually which means it rarely gets used.
It adds JavaScript and CSS to the drop-down by default... pretty sure if you added hundreds of languages to the drop-down (most of which people have never heard of), it's going to make them use it less, not more.
 
I found code thing, just forgot to come back and say.

It's the normal code pop up from the editor button for it.

There are no options.

How can I add/remove the code tags in the drop down menu? I would like to remove html, css, and add a few others, c#, java and C++ ;]
 
I found code thing, just forgot to come back and say.

How can I add/remove the code tags in the drop down menu? I would like to remove html, css, and add a few others, c#, java and C++ ;]
You would want to edit the normal xenforo editor_dialog_code template.
 
  • Like
Reactions: 1im
You would want to edit the normal xenforo editor_dialog_code template.
Can you explain more.
I added this code to editor_dialog_code but nothing happends.
i tried to add python, c++, c# to dropdown menu


Code:
<dl class="ctrlUnit">
    <dt>{xen:phrase language}:</dt>
    <dd><select name="redactor_code_type" id="redactor_code_type" class="textCtrl">
        <option value="code">{xen:phrase general_code}</option>
        <option value="php">PHP</option>
        <option value="html">HTML</option>
        <option value="python">Python</option>
        <option value="c++">C++</option>
        <option value="c#">C#</option>
    </select></dd>
</dl>

<dl class="ctrlUnit">
    <dt>{xen:phrase code}:</dt>
    <dd><textarea name="redactor_code_code" id="redactor_code_code" class="textCtrl" style="height: 100px; resize: none"></textarea></dd>
</dl>

<dl class="ctrlUnit submitUnit">
    <dt></dt>
    <dd>
        <input type="button" name="upload" class="redactor_modal_btn button primary" id="redactor_insert_code_btn" value="{xen:phrase insert}" />
        <a href="javascript:void(null);" class="redactor_modal_btn redactor_btn_modal_close button">{xen:phrase cancel}</a>
    </dd>
</dd>

Also it says it add java and css to dropdownmenu by default, i dosent do that here, i tried to reinstall.
plugin works at it should with CODE=python and so on
 
Last edited:
This update broke it:
Code:
ErrorException: Undefined index: LANG_NAME - library/DigitalPointSyntaxHighlighter/geshi.php:651
Generated By: Squawkers13, Today at 9:53 AM
Stack Trace

#0 /srv/spigot-forums/library/DigitalPointSyntaxHighlighter/geshi.php(651): XenForo_Application::handlePhpError(8, 'Undefined index...', '/srv/spigot-for...', 651, Array)
#1 /srv/spigot-forums/library/DigitalPointSyntaxHighlighter/BbCode/Formatter/Base.php(92): GeSHi->get_language_name()
#2 [internal function]: DigitalPointSyntaxHighlighter_BbCode_Formatter_Base->renderTagCode(Array, Array, Object(DigitalPointSyntaxHighlighter_BbCode_Formatter_Base))
#3 /srv/spigot-forums/library/XenForo/BbCode/Formatter/Base.php(664): call_user_func(Array, Array, Array, Object(DigitalPointSyntaxHighlighter_BbCode_Formatter_Base))
#4 /srv/spigot-forums/library/XenForo/BbCode/Formatter/Base.php(575): XenForo_BbCode_Formatter_Base->renderValidTag(Array, Array, Array)
#5 /srv/spigot-forums/library/XenForo/BbCode/Formatter/Base.php(488): XenForo_BbCode_Formatter_Base->renderTag(Array, Array, 0)
#6 /srv/spigot-forums/library/XenForo/BbCode/Formatter/Base.php(469): XenForo_BbCode_Formatter_Base->renderTreeElement(Array, Array, 0)
#7 /srv/spigot-forums/library/XenForo/BbCode/Formatter/Base.php(449): XenForo_BbCode_Formatter_Base->renderSubTree(Array, Array)
#8 /srv/spigot-forums/library/XenForo/BbCode/Parser.php(505): XenForo_BbCode_Formatter_Base->renderTree(Array, Array)
#9 /srv/spigot-forums/library/XenForo/BbCode/TextWrapper.php(117): XenForo_BbCode_Parser->render('The [I]spigot.y...', Array)
#10 /srv/spigot-forums/library/EWRcarta/ViewPublic/PageView.php(28): XenForo_BbCode_TextWrapper->__toString()
#11 /srv/spigot-forums/library/XenForo/ViewRenderer/Abstract.php(227): EWRcarta_ViewPublic_PageView->renderHtml()
#12 /srv/spigot-forums/library/XenForo/ViewRenderer/HtmlPublic.php(67): XenForo_ViewRenderer_Abstract->renderViewObject('EWRcarta_ViewPu...', 'Html', Array, 'EWRcarta_PageVi...')
#13 /srv/spigot-forums/library/XenForo/FrontController.php(582): XenForo_ViewRenderer_HtmlPublic->renderView('EWRcarta_ViewPu...', Array, 'EWRcarta_PageVi...', NULL)
#14 /srv/spigot-forums/library/XenForo/FrontController.php(158): XenForo_FrontController->renderView(Object(XenForo_ControllerResponse_View), Object(XenForo_ViewRenderer_HtmlPublic), Array)
#15 /srv/spigot-forums/index.php(13): XenForo_FrontController->run()
#16 {main}

Request State

array(3) {
  ["url"] => string(91) "http://www.spigotmc.org/wiki/spigot-configuration-spigot-yml/?redirect=spigot-configuration"
  ["_GET"] => array(2) {
    ["/wiki/spigot-configuration-spigot-yml/"] => string(0) ""
    ["redirect"] => string(20) "spigot-configuration"
  }
  ["_POST"] => array(0) {
  }
}
Finally retried the update, and it occurs when people use bogus languages, eg:
Code:
java -jar BuildTools.jar --rev 1.8

Needs to be squelched to not spam the error log @digitalpoint
 
How do I go about changing the css of the plugin? I looked in syntaxhighlighter.css and it doesn't have any css. The text background blends into the forum background, and it does not look good at all on my dark theme.
 
It doesn't apply its own CSS... It's just using the colors geshi uses. If you want to apply your own CSS, you'd just want to add your own CSS rules.
 
I have this bug...
upload_2015-10-30_2-42-50.webp

With this... (in CODE=js)

HTML:
{
"name": "acme/blog",
"type": "phpbb3-extension",
"description": "This will add an AI with mind reading capabilities to your board who will post your thoughts to a blog",
"homepage": "http://yourdomain.com/",
"version": "1.0.0",
"time": "2012-02-15",
"license": "GPLv2",
"authors": [
{
"name": "Unknown Bliss",
"email": "ub@yourdomain.com",
"homepage": "http://yourdomain.com"
},
{
"name": "imkingdavid",
"email": "ikd@yourdomain.com",
"homepage": "http://yourdomain.com"
}
},
"require": {
"php": ">=5.4",
"phpbb": ">=3.1.0"
},
"extra": {
"display-name": "phpBB Blog Extension",
"author-notes": "This extension requires PHP 10.4 RC2 and only works with MySQL 20.4 because AI and Mindreading is not supported in earlier versions. Donate via head transfer to address MCJFIDEO29495"
}
}
 
Hmmm... Looks like that might be a bug in geshi itself. If you run the code in the test area on geshi's website, does it work there?
 
upload_2015-10-30_22-56-54.webp
But not in XenForo...

the minimal extract to recreate the error is:

HTML:
[code=js]{
"version": "1.0.0",
}[/code]

Only with code=js, not with html and others (supposed)
 
Top Bottom