Once again, Promoguy had a neat request for a script. Based on this script that shows/hides comments. (which is originally based on this script for showing hiding extended entries)
This script will let you selectively show the comments for ONE particular post "automatically"… that is, the default for the post(s) you select is SHOWING the comments. (and the rest will still default to hiding the comments)
Here is the revised script for the show/hide comments:
Somewhere in between the <head> and </head> of your html page, put this (if you've already installed the show/hide comments, then you probably already have this part done):
<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>
Put this line above your <$MTEntryBody$> tag:
<script language="javascript">
var openit = "false";
</script>
paste this where you want your comments to go on the main index template (if you previously installed the show/hide comments, this goes IN PLACE of the old code you had)
<MTEntryIfAllowComments>
<script language="javascript">
if (openit == "true") {
document.write('<span id="varP2<$MTEntryID$>" class="extended" style="display: none">');
} else {
document.write('<span id="varP2<$MTEntryID$>" class="extended" >');
}
</script>
<noscript>
<span id="varP2<$MTEntryID$>" class="extended">
</noscript>
<a href="<$MTEntryLink$>#<$MTEntryID pad="1"$>" onclick="showMoreComments(<$MTEntryID$>,'<$MTEntryLink$>#<$MTEntryID pad="1"$>');return false;">show comments right here »</h4></a><br /></span>
<script language="javascript">
if (openit == "true") {
document.write('<div id="varXYZ2<$MTEntryID$>">');
} else {
document.write('<div id="varXYZ2<$MTEntryID$>" style="display: none">');
}
</script>
<noscript>
<div id="varXYZ2<$MTEntryID$>" style="display: none">
</noscript>
<div style="background-color: #D4D4D4; layer-background-color: #D4D4D4; border: 2px none #D4D4D4; padding-left: 10px; padding-right: 10px;">
<h4 align="right">—————————————————————————<a href="#<$MTEntryID pad="1"$>" onclick="showMoreComments(<$MTEntryID$>,0);return
true;">« hide comments</a></h4>
<MTComments>
<$MTCommentBody$>
<h4>Posted by <$MTCommentAuthorLink$> at <$MTCommentDate$></h4><br /><br />
</MTComments>
<h4 align="right">—————————————————————————<a href="#<$MTEntryID pad="1"$>" onclick="showMoreComments(<$MTEntryID$>,0);return
true;">« hide comments</a></h4></div>
</div>
</MTEntryIfAllowComments>
THEN, In the post you want to have auto-show the comments, put this line somewhere in the actual TEXT of your post: (don't worry, it shouldn't show up):
<script language="javascript">var openit="true";</script>
The end. I only did a quick test on this, so if something acts funny let me know. (we'll move any lengthy problems/discussions "off line" (ie. email) if there's a lot of back and forth, and just come back with solutions, so fixes in the comments are easier to find…)