[drupal-devel] unlimited comments displayed on drupal.org is a hack?
Hi, The stock Drupal only allows setting of comment displays between 10 and 90. Drupal.org clearly has something which makes all comments display. The 'makeover node' for example has 155 comments, all displayed: http://drupal.org/node/11695 Is this some hack in the drupal.org code, or have I seriously missed some setting? It would probably be diserably to provide such a setting on the comment control panel wouldn't it? Goba
Is this some hack in the drupal.org code, or have I seriously missed some setting? It would probably be diserably to provide such a setting on the comment control panel wouldn't it?
It's a hack. I've done something similar by offering a display option for "999 comments" over at Gamegrene.com. In my phptemplate, I use: // changes/shortens the names of the available options, but // also adds a '999' option to the number of available comments. // this allows people to see all comments on one page, no flips. function phptemplate_comment_per_page_form($comments_per_page) { $options = ''; $comment_per_page = _comment_per_page(); $comment_per_page[] = '999'; foreach ($comment_per_page as $i) { $options .= " <option value=\"$i\"". ($comments_per_page == $i ? ' selected="selected"' : '') .'>'. t('%a comments/page', array('%a' => $i)) .'</option>'; } return "<select name=\"comments_per_page\">$options</select>\n"; } -- Morbus Iff ( be realistic. demand the impossible. ) Technical: http://www.oreillynet.com/pub/au/779 Culture: http://www.disobey.com/ and http://www.gamegrene.com/ icq: 2927491 / aim: akaMorbus / yahoo: morbus_iff / jabber.org: morbus
Is this some hack in the drupal.org code, or have I seriously missed some setting? It would probably be diserably to provide such a setting on the comment control panel wouldn't it?
It's a hack. I've done something similar by offering a display option for "999 comments" over at Gamegrene.com. In my phptemplate, I use:
// changes/shortens the names of the available options, but // also adds a '999' option to the number of available comments. // this allows people to see all comments on one page, no flips. function phptemplate_comment_per_page_form($comments_per_page) { $options = ''; $comment_per_page = _comment_per_page(); $comment_per_page[] = '999'; foreach ($comment_per_page as $i) { $options .= " <option value=\"$i\"". ($comments_per_page == $i ? ' selected="selected"' : '') .'>'. t('%a comments/page', array('%a' => $i)) .'</option>'; } return "<select name=\"comments_per_page\">$options</select>\n"; }
Would the 0 special number be fine to signal an unlimited number? Or to put differently: is it desired that users be able to disable comment display (by setting their comment dislay number to 0), or is 0 free to take to use as a special number for 'unlimited'? Just collecting information to form a patch :) Goba
Would the 0 special number be fine to signal an unlimited number? Or to put differently: is it desired that users be able to disable comment display (by setting their comment dislay number to 0), or is 0 free to take to use as a special number for 'unlimited'? Just collecting information to form a patch :)
Hrm. Well, if we want both functionality, I'd propose: -1: display all, no paging. 0: display no comments at all. In the long run, I think that EVEN if your patch DOESN'T address "no comments at all", and EVEN if everyone on here says "No, we'll never want no comments", I STILL think -1 is better for unlimited. By itself, "0" OoOozes "display none", not "display all", and if a -1 makes people go "hmm. that's an odd value, wander what that me... ah!" then, the code'll be better for it. -- Morbus Iff ( you are nothing without your robot car, NOTHING! ) Culture: http://www.disobey.com/ and http://www.gamegrene.com/ Spidering Hacks: http://amazon.com/exec/obidos/ASIN/0596005776/disobeycom icq: 2927491 / aim: akaMorbus / yahoo: morbus_iff / jabber.org: morbus
Gabor Hojtsy wrote:
Hi,
The stock Drupal only allows setting of comment displays between 10 and 90. Drupal.org clearly has something which makes all comments display. The 'makeover node' for example has 155 comments, all displayed:
Is this some hack in the drupal.org code, or have I seriously missed some setting? It would probably be diserably to provide such a setting on the comment control panel wouldn't it?
It's a drupal.org hack, sorry. We should /expand/ that setting's range. -- Dries Buytaert :: http://www.buytaert.net/
The stock Drupal only allows setting of comment displays between 10 and 90. Drupal.org clearly has something which makes all comments display. The 'makeover node' for example has 155 comments, all displayed:
Is this some hack in the drupal.org code, or have I seriously missed some setting? It would probably be diserably to provide such a setting on the comment control panel wouldn't it?
It's a drupal.org hack, sorry. We should /expand/ that setting's range.
Would adding 'unlimited' be fine? I ask because it might have performance implications for sites having too many comments, and users setting this to 'unlimited'. Goba
Would adding 'unlimited' be fine? I ask because it might have performance implications for sites having too many comments, and users setting this to 'unlimited'.
My largest comment-per-node is upwards around 600 now, with 75+ being common about 20% of the time. I've not seen any drastically evil performance hits, but then again, I only have 400+ users. -- Morbus Iff ( you are nothing without your robot car, NOTHING! ) Culture: http://www.disobey.com/ and http://www.gamegrene.com/ Spidering Hacks: http://amazon.com/exec/obidos/ASIN/0596005776/disobeycom icq: 2927491 / aim: akaMorbus / yahoo: morbus_iff / jabber.org: morbus
participants (3)
-
Dries Buytaert -
Gabor Hojtsy -
Morbus Iff