Collapsible Comments is my plugin for WordPress. It was created for my personall needs and because i couldn’t find any other plugin to show a few words of each comment and open the full comment text by choice. Fell free to try it, share your opinion with me and make any suggestions!
Collapsible Comments version 3.8
Updated @ 21/07/2008
Download Collapsible Comments
(from the Wordpress Repository)
Collapsible Comments shows an excerpt of each comment on your blog (the first characters of each comment) and you can expand any comment inline by demand. That means you don’t have to scroll too deep to read the last comment and you can read only the comment you want without destructing your attention (or getting bored). It was developed for my needs because i get really long comments and the readers found annoying scrolling down to read the last unread comments (so as I).
After the succesfull installation you will see the first 130 characters of each comment and a link [+] which you can click it to open the box with the comment text. After reading it you could leave it opened and go to another one or close it by clicking the [-] link. There are also two additional links [Open ↓] and [Close ↑] which they also do the same job. Texts can be changed in collapsible-comments.php file. The separate CSS file has been removed to avoid multiple http requests but you can easily give your own style at the comment box by opening collapsible-comments.php file. There you can define the number of characters from which a comment should be in an “opened” or “closed” state by changing the value of $ccTEXT_lenght variable. Comments with less characters will start opened. There’s another variable named $CCstyle and is used to apply a style on comments and comment box. After that you are ready!
You can also leave a test comment in this page if you want to see it in action but make it long, more than 200 characters!
- Decompress and upload the folder collapsible-comments to the /wp-content/plugins/ directory.
- Activate the plugin through the ‘Plugins‘ menu in WordPress.
- Find the file comments.php in your theme directory and replace the expression <?php comment_text(); ?> with the <?php collapsiblecomments(); ?>
|
- Deactivate the plugin through the ‘Plugins‘ menu in WordPress.
- Delete the folder collapsible-comments from your /wp-content/plugins/ directory.
- Decompress and upload the folder collapsible-comments to the /wp-content/plugins/ directory.
- Activate the plugin through the ‘Plugins‘ menu in WordPress.
|
- Find the file comments.php in your theme directory and replace the expression <?php collapsiblecomments(); ?> with the <?php comment_text(); ?>
- Deactivate the plugin through the ‘Plugins‘ menu in WordPress.
- Delete the folder collapsible-comments from your /wp-content/plugins/ directory.
|
| Collapsible Comments is tested on WordPress 2.3 and above and acts nice on IE6, IE7, Opera, Firefox, Safari or any modern browser supporting javascript. It is compatible with all the plugins that i ‘m using (check my plugins page). It is advised to not install it along with other plugins which aim the same purpose and *always* keep a back up of your files. To install it you must have the ability to upload and edit some files. |
Version 3.8: WP2.6 compatible.
Version 3.7: Small fix to DIV value for html validation.
Version 3.6: Changed all SPANs to DIVs.
Version 3.5: Fix for PHP 4.X.X.
Version 3.4: CSS file has been removed. A Variable with the desired number of characters of an excerpt was added and lots of other changes.
Version 3.3: Small bug in CSS file.
Version 3.2: Invert .js code thx to Matteo for better handling collapsible elements.
Version 3.1: Doubleclick bug was smashed. More choices at the CSS file with styles for comment excerpt and comment text.
Version 3.0: Major changes so that it can be used to have collapsible elements within a page or post.
Version 2.0.1: Small changes to readme.txt file.
Version 2.0: Changes to the Javascript code so now the reader has the ability to leave OPENED as many comments as he wants.
Version 1.2: In order to customize the comment’s presentation, i put a separate css file so changes to “look ‘n feel” of the table who has the comments would be made there. I also put a separate js file so i could improve the javascript without changing the php file. Variables of text has been put in php file and the script can be localize. |
- Is this plugin free?
Yeah, this plugin is free. That means you can do whatever you like with it without paying, donating or doing anything dealing with money.
- May I alter it, change it, recode it?
You can do whatever you like with it.
- It didn’t work at my blog!
There maybe a conflict with other plugins. You ‘d better leave a comment here and I will try to help you. If you can’t use it just uninstall it.
- It destroyed my blog!
This plugin CAN’T destroy a blog. Read carefully the uninstallation process and everything will get back to normal.
- Does this plugin change my database/data/tables/comments?
NO! This plugin just calls a javascript function to show the comments you already have in your database but doesn’t changes your data or messing your database in anyway.
- Will this plugin make my page load faster?
NOT in anyway. Your page will load all the comments from the beginning. The difference is that it will show each one on demand.
- Is it useful for my blog?
Well, honestly I don’t know. I just find it useful for my blog because sometimes many readers leave really big comments and it’s annoying scrolling down too deep to read the unread ones. Here’s an example of one long post with more than 70 comments, half of them have more than 500 words! A heavy page but think it without that plugin!
- OK, so how can i use it to have collapsible elements like you do?
I made a separate plugin which you can see it at Collapsible Elements page. If you don’t need Collapsible Comments go and get Collapsible Elements plugin!
- Can i just have both Collapsible Elements and Collapsible Comments?
Yeah, you can, Collapsible Elements plugin checks if Collapsible Comments is activated and uses its Javascript without to load it again.
- Can you make it do “this” or “that”?
I could make almost anything but it takes time and the right mood. Just leave a wish and expect no promises.
|
Collapsible Comments is based on the Javascript i found on Arvind Satyanarayan example which toggles the visibility of multiple elements on a page, see the code in his website.
26-10-2007 @ 10:13
That’s a long test comment so click on [+] or Open :
If this plugin was pretty as a girl i ‘d fall in love with her but then again she ‘d be mad with me who would always looking under her skirt trying to find any spots to make her more and more pretty every now and then.
On the other hand, if one day this plugin will be as smart as a woman, she will leave me to find her own way seeking the road of perfection!
Let me think it once more:
If this plugin was pretty as a girl i ‘d fall in love with her but then again she ‘d be mad with me who would always looking under her skirt trying to find any spots to make her more and more pretty every now and then.
On the other hand, if one day this plugin will be as smart as a woman, she will leave me to find her own way seeking the road of perfection!
04-12-2007 @ 15:00
Beautiful plugin!
04-12-2007 @ 15:03
hey thx Lorenzo
06-12-2007 @ 21:55
Really nice plugin
07-12-2007 @ 08:46
Thx for your comment Andres. Have a nice day and keep a nice blog!
09-12-2007 @ 17:08
NICE PLUGIN …
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Fusce non orci eget justo facilisis mattis. In eu libero. Sed condimentum nunc commodo massa. Quisque vitae magna. Maecenas sed sem et enim ultrices viverra. Proin eu est. Suspendisse potenti. Morbi vel tellus. Morbi quis diam. Nunc ut justo. Suspendisse massa augue, consectetuer id, imperdiet et, auctor nec, nisl. Suspendisse erat ante, interdum eu, sagittis at, adipiscing at, turpis. Nam tempus eros. Aliquam suscipit elementum odio.
11-12-2007 @ 13:32
Cool!
And seems that works with OPERA browser too.
Shouldn’t you mention it?
Lot’s of ppl use it.
And how about Safari?
11-12-2007 @ 15:20
Hey Opera, as a matter of fact it will work with any browser supports javascript. But i will mention it at plugins’ compatibility section. Just don’t ask me to get a Mac!
14-12-2007 @ 11:30
cool plugin! I’m trying it out, thanks.
14-12-2007 @ 13:45
cool plug-in! I like it!
17-12-2007 @ 13:56
Hi ..::DeUCeD::.., really nice plugin, but i’ve found that you have to click twice in order to show comments in Safari. Any chance of a fix? (since safari has made it’s way onto windows too now
)
17-12-2007 @ 15:02
Well Dave, BUG is FIXED with latest release v3.1
it’s not the Safari but every browser. What happens is that the first time you wanna open a comment you need to click it twice but the next time the same comment box opens normally with one click. The same doesn’t happen in post where i collapse a table. That means i gotta see the JS code again to find the bug and i ‘m working on it.Thx!09-01-2008 @ 01:27
Just wanted you to know that I love your plugin, and I’ve included it in my latest post “Rock Start Wordpress Comments“.
09-01-2008 @ 05:19
very interesting.
i’m adding in RSS Reader
09-01-2008 @ 08:52
Thx JTPRATTT, I’m glad you find it useful and you liked it and honored to include it at your very interesting blog you got out there there!
Thx music
18-01-2008 @ 16:28
[...] Collapsible comments [...]
22-01-2008 @ 17:02
[...] Plugin Homepage [...]
27-02-2008 @ 13:37
nice plugin, but how to change that it show only 10 word’s or better only 80letters?? please send mi a mail how to do!!
27-02-2008 @ 13:48
Unfortunately the EXCERPT of a comment cannot accept any parameters but “returns” only the first 20 words of a comment and this cannot be changed. If WordPress core developers will fix it in a next release i will pass the parameters to the plugin. Right now i cannot give you any solution.
16-03-2008 @ 15:28
this is a testcomment… i hope i like it *g*
19-03-2008 @ 01:39
A very nice plugin.
Thank you.
10-04-2008 @ 10:44
Oh no. You probably are going to hate me soon. I tried to install this plugin and have run into some problems - mainly that the expression in the comments.php that you want me to change is not there.
I’m using the Sandbox theme. Would it be ok if we continued this by e-mail? I could send you the original sandbox comments.php. (I don’t know if you know but Sandbox will be one of the standard themes in the next wordpress release).
Please let me know here or just write me an e-mail. Thanks!!!
10-04-2008 @ 11:03
But it’s easier than you imagine! There are two lines, Line 43 and Line 69. Replace comment_text() with collapsiblecomments() and take a look.
12-04-2008 @ 07:58
Thank you soooo much!! It works!! I’m really excited! Odd thing, though - I could’ve sworn I tried that. Oh well. Now it works! Yippieh! Off to test your shout stream plugin. Will report back!
24-04-2008 @ 23:03
Updated to Version 3.4 and got this.
Plugin could not be activated because it triggered a fatal error.
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /localhost/wp-content/plugins/ collapsible-comments/collapsible-comments.php on line 55
24-04-2008 @ 23:37
Well Kris it was PHP 4.X.X message. I had only tested in PHP v5.2 but, anyway GET new version 3.6 and it should work! And tell your (local)host to upgrade.
29-04-2008 @ 00:20
Thanks ..::DeUCeD::..
No errors, thanks for the backward compatibility ; )
28-06-2008 @ 09:11
Hermoso. Realmente maravilloso plugin.
Mis felicitaciones y agradecimientos.
May I tweek it a little?
Cheers
28-06-2008 @ 09:22
Hi Sergio,
All wordpress plugins are released under GNU/GPL licence. That means you can change it, tweak it, fork it, do whatever you wanna do with it and use it wherever you like! I’m also declaring this in my FAQ 1&2. So feel free to to tweak it and if you need any help i ‘ll be around.
PS: A link of your version would make me happy but it’s not necessary.
21-07-2008 @ 16:54
You suggest changing:
”” with the ””
I had a look at comment.php file and I can mine looks like this
”” without the ‘;’
So do I need to insert ”” without the ‘;’ too?
22-07-2008 @ 08:38
Hi Timmy, replace comment_text() with collapsiblecomments() without ; and you should be OK.
23-07-2008 @ 02:21
Excellent plugin - Just what I’ve been looking for - thank You sooo much