Code

Code 2.2.0

No permission to download
Unfortunately, in your free add-on user can't set custom title for code block and highlighted lines:
View attachment 258726

Attached to this post fixed version for 2.2.7. Changes can be viewed here (mixed with _data and hashes.json deleting from original author with updating _output, sorry :().
Thank you for sharing, that fixed my copy to clipboard problem. :D
 
Wanna fix your codeblocks after uninstalling this plugin?

This addon lets the user define a title

The BBCode used by this addon has the title defined like this:

Code:
[CODE="cpp|OldTitleHere"]

If you've uninstalled this addon, it probably messed up your code blocks. The title would no longer appear and you would get no syntax highlighting.

Here is the regex to fix it using the "Post Content find / replace" Xenforo plugin.

DO NOT USE THIS UNLESS YOU KNOW WHAT YOURE DOING AND DOUBLE CHECK EVERYTHING, YOU COULD POTENTIALLY SCREW THINGS UP. BACKUP YOUR DATABASE FIRST

Code:
REGEX:
/\[CODE="([a-zA-Z]{1,20})\|(.{3,100})"\]/

REPLACE:
[B]${2}[/B][CODE=${1}]

Should look like this:

1647404065409.png

It simply takes the old title and bolds it, in a line above the code blocks and makes the syntax highlighting work.

Looks like this after you run it:
1647404359564.png

This query took a very long time on my board which has 10k + code blocks. I had to run it a few times because it timed out.
 
Last edited:
Unfortunately, in your free add-on user can't set custom title for code block and highlighted lines:
View attachment 258726

Attached to this post fixed version for 2.2.7. Changes can be viewed here (mixed with _data and hashes.json deleting from original author with updating _output, sorry :().

Do you know anything about this error?

Code:
Template public:post_macros: [E_DEPRECATED] strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated (src/addons/CMTV/Code/XF/BbCode/Renderer/Html.php:15)
 
Top Bottom