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.
05-09-2008 @ 01:21 [ID:9372]
Hi,
I’m using the theme “Blixed” which has a different comment.php. There is no comment_text present in the file and I guess, something else is calling the function here. I have no idea where to put the cmmentslement here …
05-09-2008 @ 07:39 [ID:9373]
If you are talking about that blixed theme there is a <?php comment_text() ?>, if not provide me the URL of the theme to take a look.
05-09-2008 @ 09:08 [ID:9374]
Thnaks for the quick reply!
I use Blixed, (based on the original Blix theme, your lin refers to):
http://themecorp.com/themes/blixed/
05-09-2008 @ 09:26 [ID:9375]
I ‘ve Just downloaded it. There’s a file comments.php, go to line 42, find <?php comment_text() ?> and replace with <?php collapsiblecomments() ?> and if something goes wrong replace with the original line.
After you have activated the plugin it should work.
Let me know how it goes…
05-09-2008 @ 09:39 [ID:9376]
OK, this is really made me look stupid … thanks so much!
But to be honest, I had to upload the comment.php again to find the comment_text. The one I had on my site must have been modified by a plugin I once used (sexycomments), I believe. I swear it line 42 was different from the original … Is that possible?
Thanks again! I’m now on to collapsable element (which I already used in the past and know it works nicely!)
05-09-2008 @ 15:02 [ID:9377]
Hey, don’t worry, we all use many plugins and make lots of mods so it just happens from time to time to miss a few things but no big deal, have a nice day
13-09-2008 @ 22:37 [ID:9393]
Hey there. I love what you’re doing and have implemented this onto my blog. I just have one question.. For some reason the start of the comments box starts a little too far to the right causing it to overlap the sidebar slightly on the right hand side. Do you know how I can either move the comments box a little to the left or make it smaller so it doesn’t overlap anymore??
You can see this on my site on any comment page.
Here’s a link to one: http://worldramblers.com/a-stopover-in-bucharest/
15-09-2008 @ 08:16 [ID:9394]
Open collapsible-comments.php with a text editor like notepad (but NOT WORD), then find $CCstyle and put a margin-right about 10px. I guess this is caused by a div of your theme but it’s only CSS and can be fixed. You only need to play a bit with the CSS values.
16-09-2008 @ 20:37 [ID:9402]
Regarding comment 47, 48 – Thanks so much for the info.. That worked.
Bookmarks for 2008-9-18 « ゆめのあとさき said:
18-09-2008 @ 10:43 [ID:9404]
[...] ..::DeUCeD::.. – [...]
10-02-2009 @ 18:26 [ID:10316]
Really useful plugin!
Question
The collapsed text does not show character formatting.
Is there something we need to do?
Thanks!
11-02-2009 @ 12:15 [ID:10321]
Hi Rory, open collapsible-comments.php file and edit $CCstyle as the example there shows. All you need is a decent text editor like notepad.
24-03-2009 @ 07:13 [ID:10428]
Is this plug WP2.7 compatible? I just tried it, and click open sent me back to the top of the page.
24-03-2009 @ 07:39 [ID:10429]
Hi Mike, I’m running the latest WP 2.7.1 here and, as you see, there’s no problem. So best shot is that you got a theme for WP 2.7.1 where comment_text(); has been replaced by wp_list_comments(); and the solution is not as simple as you think. If your theme has n’t tweak it then check this link in my forum. But it requires a bit of knowledge to edit your functions.php file so if you have no experience on this you ‘d better get a backup before trying.
04-04-2009 @ 22:25 [ID:10465]
Hi there;
First of all, I just want to say how much I enjoy your Collapsible comments and Collapsible elements. I use both of them on my site, and they work perfectly. I just have a question for you, is it possible add a collapsible comment in a collapsible element? For example, on my site, I have some Howto’s which are embedded in your collapsible elements, but, I have a few on a single page. Instead of having a comments section at the bottom of the page for all my howto’s, I would prefer to have the collapsible comments for each collapsible element. Wow, that sounds confusing. I hope you understand. Thanx
06-04-2009 @ 08:53 [ID:10466]
Hi chris
Easy answer is NO. What i mean is that WordPress gets comments in every post so how can you divide comments based on a part of a post, that wouldn’t make any sense. So my plugin follows WordPress, if we suppose that you could have different areas in a post and each one having its own comments (but you cannot) then my plugins would work.
But from my experience there’s always a solution to everything or at least a workaround.
The most easy way is first you try lots of plugins that are dealing with FAQ pages (or even guestbooks) and see if they are close to what you want to achieve. Maybe you find something that you may tweak it.
A custom solution that i would try is that i would make many posts each one having ONE howto under a new “howto” category. Then i would construct a separate static page which would be like the index page but its “loop” would be based on this new “howto” category which whould show only but all the separate “howtos” posts along with their comments (which they would be collapsed) without titles, dates etc. That way you would give the illusion of one page.
It’s just an idea and i dont know if its possible and also requires lots of reading and experiment (search for custom loop and static pages on codex) but if i d want something special like this i would try it. I did something like this when i tried to embed my forum script. Its a separate STATIC page with something different in place of a post. As i said its only an idea, there maybe other ways or no way. But you ll have to try it for yourself and also requires understanding a bit of wordpress capabilities.
Regards.
06-04-2009 @ 22:45 [ID:10467]
Thanx Deuced;
that’s seems a tad too complicated, so, I’ll just leave it the way it is. And people can just comment regularly.
Thanx for the great plugins!!!
12-06-2009 @ 15:04 [ID:10729]
It worked on WP2.8! Thank you so much.
I added the code DeUCe wrote in the forum in function.php, and replaced the line of comments.php as below.
before:
<?php wp_list_comments(); ?>
after:
<?php wp_list_comments(‘type=all&callback=comment_format’); ?>
11-11-2009 @ 02:10 [ID:11007]
Hi there!
I love the collapsable idea since I am working on a system dat has lots of text. However, using 2.8.5 with Fusion as theme I am afraid that that wont work… Am I right?
Nevertheless I wish you could make it it compatible though
25-11-2009 @ 13:09 [ID:11012]
I havent use Fusion theme and i m sorry but right now i have no time to deal with collapsible comments update. If i can find the time to update it i ll make sure to check its compatibility with most of available themes. Sorry for that.