MyBB Community Forums

Full Version: Code syntax highlighting
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I love the wonderfulosity of the [php] tag, but I was hoping that there would be one to come out like vBulletin's [html] tag. I think these would all be popular:
  • HTML
  • JavaScript
  • CSS

Best of all would be if you could create a tag like this:

[webcode]<?php
// syntax highlights here
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<!-- More highlighting here WITHOUT switching to the [html] tag. -->
<head>
<style type="text/css">
/* Even more highlighting without the [css] tag! */
</style>
<script type="text/javascript">
// And more highlighting!
</script>
</head>
<body>
<!-- etc. -->
</body>
</html>[/webcode]

Just an idea!
I have one which does the above except CSS:
http://mods.mybboard.net/archive/view/sy...ghlighting
(should work on both MyBB 1.2.x and 1.4.x)

This one looks interesting too - you might want to try it:
http://mods.mybboard.net/archive/view/ge...ode-plugin
Thank you. But it doesn't seem to work in MyBB 1.4. Here's my test page:

http://board.lupus6x9.co.cc/showthread.php?tid=16

I copied all the files over and manually edited the parser class file (if($options['filter_badwords'] != "no") is actually just if($options['filter_badwords']) now), and it still doesn't work.
(2008-08-08, 11:33 PM)lupus6x9 Wrote: [ -> ]Thank you. But it doesn't seem to work in MyBB 1.4. Here's my test page:

http://board.lupus6x9.co.cc/showthread.php?tid=16
Quote:You are either not logged in or do not have permission to view this page. This could be because one of the following reasons:

1. You are not logged in or registered. Please use the form at the bottom of this page to login.
2. You do not have permission to access this page. Are you trying to access administrative pages or a resource that you shouldn't be? Check in the forum rules that you are allowed to perform this action.
3. Your account may have been disabled by an administrator, or it may be awaiting account activation.