How can I stop Syntext Highighting in MyBB with a mod
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #4
RE: How can I stop Syntext Highighting in MyBB with a mod
So, it's a plugin, so it'll be affected by the highlight problem.  MyCodes are parsed before the highlight occurs, but plugins run after (in fact, you're hooking right at the end, so it's affected by everything that goes on earlier).
There's not really a nice solution - all the ones I can think of are rather "hacky".

EDIT: you should really take a look at inc/class_parser.php
One of the suggestions I made above is to hack the MyCode cache, eg:

PHP Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
$plugins->add_hook('parse_message_start', 'my_wonderful_hack');
function my_wonderful_hack(&$m) {
 // ugly to assume $parser is the object being dealt with, but I don't see much other choice here
 global $parser;
 if(!is_object($parser)) return $m;
 if(empty($parser->mycode_cache)) {
  // unfortunately, $parser->cache_mycode is private, so we work around this through a dummy message parse
  $parser->parse_mycode('');
  if(empty($parser->mycode_cache)) return $m;
 }
 $mcc =& $parser->mycode_cache['standard'];
 if(!isset($mcc['find']['ed2k'])) {
  $mcc['find']['ed2k'] = "#ed2k://\|file\|(.*?)\|([0-9]+)\|(.*?)\|/#e";
  $mcc['replace']['ed2k'] = "parse_ed2k_stuff('$1')";
 }
 return $m;
}

Above is just an idea - you'll need to modify it to suit your needs.

As for wordwrap, it's a weakness in MyBB itself unfortunately: http://community.mybb.com/thread-43152.html


My Blog
(This post was last modified: 01-18-2011 09:19 AM by ZiNgA BuRgA.)
01-18-2011 08:57 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
RE: How can I stop Syntext Highighting in MyBB with a mod - ZiNgA BuRgA - 01-18-2011 08:57 AM

 Standard Tools
Forum Jump: