mu.nu - It's mackerel stewed in chocolate!

April 29, 2004

Thingys & Doodads - IV

In this edition of Thingys & Doodads we'll look at an expanding / collapsing comment script from the Scripty Goddess.

This particular script is an "in-line" script for php sites. It will produce this:

Permalink | Show Comments(3) | Add Comment | Trackback(2) Installation instructions:

Cut and paste the following code between the tags in every page that you want to utilize the script:

<!-- Begin Scripty Goddess Show/Hide Comments -->
<script type="text/javascript">
function showMoreComments(entryID, entryLink, htmlObj)
extTextDivID = ('extText' + (entryID));
extLinkDivID = ('extLink' + (entryID));
if( document.getElementById ) {
if( document.getElementById(extTextDivID).style.display ) {
if( entryLink != 0 ) {
document.getElementById(extTextDivID).style.display = "block";
document.getElementById(extLinkDivID).style.display = "none";
htmlObj.blur();
else
document.getElementById(extTextDivID).style.display = "none";
document.getElementById(extLinkDivID).style.display = "block";

} else
location.href = entryLink;
return true;

} else
location.href = entryLink;
return true;

}
</script>
<!-- Begin Show/Hide Comments -->

Next, in the section of the Main Index Template, cut the code for the "posted by" section and paste the following code in:

<!-- Begin Scripty Goddess Show/Hide Comments -->
<div id="extLink<$MTEntryID$>">
<a href="<$MTEntryPermalink$>">Permalink</a>
<MTEntryIfAllowComments>
<?php if (<$MTEntryCommentCount$> > 0) ?>
| <a href="<$MTEntryPermalink$>" name="ext<$MTEntryID pad="1"$>" onclick="showMoreComments(<$MTEntryID$>,'<$MTEntryPermalink$>', this);return false;">Show Comments (<$MTEntryCommentCount$>)</a>
<?php ?>
| <a href="<$MTEntryPermalink$>#comments">Add your comment</a>
</MTEntryIfAllowComments>
<MTEntryIfAllowPings>
| <a href="<$MTCGIPath$><$MTTrackbackScript$>?__mode=view&entry_id=<$MTEntryID$>" onclick="OpenTrackback(this.href); return false">TrackBack (<$MTEntryTrackbackCount$>)</a>
</MTEntryIfAllowPings>
</div>
<div id="extText<$MTEntryID$>" style="display: none">
<a href="<$MTEntryPermalink$>">Permalink</a>
<MTEntryIfAllowComments>
| <a href="#ext<$MTEntryID pad="1"$>" onclick="showMoreComments(<$MTEntryID$>,0, this);return true;">Hide Comments</a>
| <a href="<$MTEntryPermalink$>#comments">Add your comment</a>
</MTEntryIfAllowComments>
<MTEntryIfAllowPings>
| <a href="<$MTCGIPath$><$MTTrackbackScript$>?__mode=view&entry_id=<$MTEntryID$>" onclick="OpenTrackback(this.href); return false">
TrackBack (<$MTEntryTrackbackCount$>)
</a>
</MTEntryIfAllowPings>
<MTEntryIfAllowComments>
<MTComments>
<$MTCommentBody$>
<p>Posted by <$MTCommentAuthorLink show_email="0"$> at <$MTCommentDate$></p><br>
</MTComments>
</MTEntryIfAllowComments>
<a href="<$MTEntryPermalink$>">Permalink</a>
<MTEntryIfAllowComments>
| <a href="#ext<$MTEntryID pad="1"$>" onclick="showMoreComments(<$MTEntryID$>,0, this);return true;">Hide Comments</a>
| <a href="<$MTEntryPermalink$>#comments">Add your comment</a>
</MTEntryIfAllowComments>
<MTEntryIfAllowPings>
| <a href="<$MTCGIPath$><$MTTrackbackScript$>?__mode=view&entry_id=<$MTEntryID$>" onclick="OpenTrackback(this.href); return false">TrackBack (<$MTEntryTrackbackCount$>)</a>
</MTEntryIfAllowPings>
</div>

As usual, you can edit any of the text labels to personalise the site with your own peculiar wit.

I have not tried this particular script so, if you have any problems installing it, go to the Scripty Goddess post and read the post and the following discussion thread.

Posted by: Madfish Willie at 10:22 PM | Comments (47) | Add Comment | Trackbacks (Suck)

1 Ooh, me likes.

Thanks!

BTW...does anyone know why the time on my blog is not reflective of the EST I programmed it to be in my blog config?

Posted by: Linda @ at April 30, 2004 02:17 AM

2 Me wonders exactly what the purpose of it is, as it seems to do what MT already does as far as I can tell, or maybe the example did not post correctly or is not displaying correctly for me.

Posted by: Kang A. Roo @ at April 30, 2004 03:35 PM

3 Put your glasses on and read it again.

Posted by: Madfish Willie @ at April 30, 2004 04:41 PM

4 Mr Madfish - how do we know if our site is php (ie that this will work on our site)?

Posted by: Simon @ at May 06, 2004 03:48 AM

5 It´s really a great joy being here. Your site is a varied mixture of the latest news, specified information and
activ power.

Posted by: Cathy Lee @ at November 23, 2004 10:53 AM

6 I love your site. It´s really a pleasure to read through all this interesting stuff and it home.

Posted by: Jamie Lee @ at January 19, 2005 09:19 AM

7 Hmm... nice site but be more informative!

Posted by: Cari @ at July 15, 2005 12:02 PM

8 WOW! I'll add your site to my bookmarks.

Posted by: EroComix @ at July 19, 2005 01:03 AM

9 Down clothing jeans same as the global economy 2009 is jeans campaigns With her challenging and down clothing first time the technology used in this sportswear watch to the design of the watch value embellishment high tech precision ceramic Chanel J12 casual wear sapphire crystal glass magnified many .

Posted by: Children's Clothing @ at May 05, 2011 05:40 AM

10 Nike Dunks ShoesNike DunksNike Dunk SBCheap Nike DunkNike Dunks HighCheap Nike ShoesNike Dunks Shoes BlogNike Dunks Shoes NewsBig Nike High WomensBlack Nike DunkBoys Nike DunkNike 6.0 Dunk SENike Dunk HighNike Dunk High WomenNike Dunk LowNike Dunk Low WomenNike SB Dunk MidRed Nike DunkWhite Black DunkWhite Nike DunkNike Dunk AB LowNike Dunk Low Pro SBNike Dunk Low SB

Posted by: nike dunks shoes @ at June 10, 2011 07:36 AM

11




I added it to favorites and i’ll be your constant reader.

Posted by: @ at June 28, 2011 02:54 AM

Hide Comments | Add Comment






Processing 0.01, elapsed 0.0216 seconds.
22 queries taking 0.0164 seconds, 33 records returned.
Page size 14 kb.
Powered by Minx 0.8 beta.