So you've got a few people who like to leave really long comments on your blog. It's all well and good, but it's making your page run really long, and some people just don't want to scroll through all that just to get to the next comment.
This script will let you (after a certain point) put a "show more of this comment" link. (While the show/hide script is javascript – there's some php in there to show the "show/hide" link only when the comment reaches your "max"
If you already have the functions installed from this script, then skip this step. Otherwise, put this in between your <head> </head> tags.
<script language="Javascript">
<!–
function showMoreComments(varA12, varB12){
var1232 = ('varXYZ2' + (varA12));
varABC2 = ('varP2' + (varA12));
if( document.getElementById ) {
if( document.getElementById(var1232).style.display ) {
if( varB12 != 0 ) {
document.getElementById(var1232).style.display = "block";
document.getElementById(varABC2).style.display = "none";
} else { document.getElementById(var1232).style.display = "none";
document.getElementById(varABC2).style.display = "block"; }
} else { location.href = varB12;
return true; }
} else { location.href = varB12;
return true; }
}
//–>
</script>
Then this part completely replaces your existing MTComments section. (It'll even work INSIDE a "show/hide comments" block already on the page – so it's a show/hide, inside a show/hide)
<MTComments>
<?
if (strlen("<$MTCommentBody encode_php="qq"$>") > 100) {
?>
<span id="varP2<$MTCommentID$>">
<$MTCommentBody trim_to="100"$>
<p><a href="<$MTEntryLink$>#<$MTEntryID pad="1"$>" onclick="showMoreComments(<$MTCommentID$>,'<$MTEntryLink$>#<$MTEntryID pad="1"$>');return false;">
show the rest of the comment »
</a></p></span>
<div id="varXYZ2<$MTCommentID$>" style="display: none">
<$MTCommentBody$>
<p><a href="#<$MTCommentID pad="1"$>" onclick="showMoreComments(<$MTCommentID$>,0);return true;">
« hide rest of comment
</a></p></div>
<?
} else {
?>
<$MTCommentBody$>
<? } ?>
<p>Posted by <$MTCommentAuthorLink show_email="0"$> at <$MTCommentDate$></p><br /><br />
</MTComments>
Change the text as you want, and the number where you want to cut the comment off. (That 100 represents the number of characters. ie. letters, spaces, etc.)