I've had this installed since the early 3.8 days and I've got this working for vB4.1.0 with sorting still enabled. It's very hacky though so if you're not confident with hacking files then please don't follow these instructions as I offer no support for this - it is simply a list of things I did to get it working.
1) I added the items to additional.css as instructed
here.
2) I edited the "link sorttable javascript in <head>-section" plugin to remove the IMGDIR_BUTTON reference, resulting in...
PHP Code:
if(($vbulletin->options['stg_table_options']&64)&&in_array(THIS_SCRIPT, array('announcement','calendar','editpost', 'newreply','newthread','private','showpost','showthread','usernote'))){
$output = str_replace('</head>',"\t".'<style type="text/css">'."\n\t\tspan.sortarrow {position:absolute;}\n\t\tspan.sortarrow img {border:0;}\n\t\ta.sortheader {text-decoration:none; display:block; width:100%;}\n\t</style>\n\t".'<script type="text/javascript">'."\n\t".'</script>'."\n\t".'<script type="text/javascript" src="clientscript/sorttable.js"></script>'."\n".'</head>',$output);
}
3) I edited the clientscript/sorttable.js file and replace the IMGDIR_BUTTON references with hard coded paths, so this...
Code:
if (span.getAttribute("sortdir") == 'down') {
ARROW = ' <img src="' + IMGDIR_BUTTON + '/sortasc.gif" />';
newRows.reverse();
span.setAttribute('sortdir','up');
} else {
ARROW = ' <img src="' + IMGDIR_BUTTON + '/sortdesc.gif" />';
span.setAttribute('sortdir','down');
}
...becomes this on my site...
Code:
if (span.getAttribute("sortdir") == 'down') {
ARROW = ' <img src="images/buttons/sortasc.png" />';
newRows.reverse();
span.setAttribute('sortdir','up');
} else {
ARROW = ' <img src="images/buttons/sortdesc.png" />';
span.setAttribute('sortdir','down');
}
3) I edited the "parse vBCode table" plugin to remove the thead class reference, so...
PHP Code:
#if a head is specified, make it
if($bbcode_table['head']['enabled']==true){
$table_head = '<thead class="thead"><tr><th'.implode('</th><th',$table_head).'</th></tr></thead>';
}else{
$table_head = '';
}
...becomes...
PHP Code:
#if a head is specified, make it
if($bbcode_table['head']['enabled']==true){
$table_head = '<thead><tr><th'.implode('</th><th',$table_head).'</th></tr></thead>';
}else{
$table_head = '';
}
4) Within the same plugin I had to add the restore class to the table tag, so...
PHP Code:
if (strlen($bbcode_table['css']['table'])>0){
$table_html = '<table class="stg_table tborder stg_table_'.$bbcode_table['css']['table'];
}else{
$table_html = '<table class="stg_table tborder';
}
...becomes...
PHP Code:
if (strlen($bbcode_table['css']['table'])>0){
$table_html = '<table class="stg_table tborder restore stg_table_'.$bbcode_table['css']['table'];
}else{
$table_html = '<table class="stg_table tborder restore';
}
5) I ran the option: AdminCP -> Maintenance -> Update Counters -> Rebuild Post Cache
I want to reiterate, the above is simply what I've done to my site to get it working with the sort. I make no guarantee that it is the correct way to fix this or that it will work for anyone else.
With that said, I hope the above proves useful to someone.