A syntax highlighter is already built in to UBB.threads. You need need to either use [php ] or [html ] or [sql ] instead of the general [code] UBBcode commands, so that UBB.threads can know how you want things highlighted. Its on demand highlighting, since not all posts and pages will have code comments that need to be highlighted by applying JavaScript to every page.

The parser part of the UBBCode scripts that have been within UBB.threads for many many years. The Style Editor also allows an admin to set the colors which they want their syntax to highlight with -- this is handy for when using a custom style where the background colors are dark, and the text colors are light.

For your unique site needs, If you want to add JavaScript that is not already included with UBB.threads, you can add stuff using header inserts in the admin Control Panel.




edit: Thanks for the links. good reading.

Using the example html on the page of your last link, this is an example of the UBBcode syntax highlighter which is already in UBB.threads for many years. There is no need to add any additional JavaScript or bulk (duplicate features) to UBB.threads, especially features which are already part of the the UBB.threads core software.

HTML
<!DOCTYPE html>
<title>Title</title>

<style>body {width: 500px;}</style>

<script type="application/javascript">
  function $init() {return true;}
</script>

<body>
  <p checked class="title" id='title'>Title</p>
  <!-- here goes the rest of the page -->
</body>


Current developer of UBB.threads PHP Forum Software
Current Release: UBBT 7.7.5 // Preview: UBBT 8.0.0
isaac @ id242.com // my forum @ CelicaHobby.com