[drupal-devel] unlimited comments displayed on drupal.org is a hack?

Gabor Hojtsy gabor at hojtsy.hu
Thu Jan 27 12:58:16 UTC 2005


>> 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



More information about the drupal-devel mailing list