__section__
default
__description__
The printing of the comments

* can_moderate = boolean for whether current user is eligible to moderate
	at least one comment
* comment = hashref of main comment to display (if cid is specified)
* comments = big ol' arrayref of comments
* next = hashref of next comment for "next" link
* previous = hashref of previous comment for "previous" link
* sid = story ID
* cid = comment ID
* pid = base parent ID
* cc = number of siblings of this comment
* lvl = what nesting level we're at
* lcp = linkCommentPages value
__title__

__page__
misc
__lang__
en_US
__name__
printCommComments
__template__
[% can_del = (constants.authors_unlimited
		&& user.is_admin
		&& user.seclev >= constants.authors_unlimited
	) || user.acl.candelcomments_always;
   moderate_form   = (!discussion2 || can_del) && (can_moderate || user.acl.candelcomments_always);
   moderate_button = (can_moderate
	&& user.mode != 'archive'
	&& ( !user.state.discussion_archived || constants.comments_moddable_archived));
%]
[% IF moderate_form %]
	<form id="commentform" name="commentform" action="[% gSkin.rootdir %]/comments.pl" method="post">
[% END %]

[% IF discussion2 %]
[% IF !form.printdiv %]	<script src="[% constants.imagedir %]/comments.js?[% constants.cvs_tag_currentcode %]" type="text/javascript"></script>[% END %]
	<script type="text/javascript">
<!--
[%- IF gSkin.name != 'idle' %]
	D2.d2_keybindings_disable()[191] = 1;[% END # turn off '/' key %]
	window.onscroll = D2.d2act;
	D2.boxStatus(1);
[% Slash.jsSelectComments(Slash.db, constants, user, { sid => sid, cid => cid }, gSkin) %]
//-->
	</script>
[% END %]

[% IF cid && !discussion2 %]
	<ul id="commentlisting" class="[% user.mode %] d1">
	[% Slash.dispComment(comment) %]
	<div class="comment_footer">
	[% IF previous %]
		&lt;&lt;[% Slash.linkComment(previous, 1) %]
	[% END %]

	[% IF previous && (comment.pid || next) %]
		|
	[% END %]
	
	[% IF comment.pid %]
		[% Slash.linkComment(comment, 1) %]
	[% END %]

	[% IF next && (comment.pid || previous) %]
		|
	[% END %]

	[% IF next %]
		[% Slash.linkComment(next, 1) %]&gt;&gt;
	[% END %]
	</div>
	[% UNLESS constants.modal_prefs_active;
	   m1_classname = "Slash::" _ constants.m1_pluginname;
	   moddb = Slash.getObject(m1_classname);
	   IF moddb;
		   moddb.dispModCommentLog('cid', cid, {
			show_m2s =>	  constants.m2 ? (form.show_m2s.defined
							? form.show_m2s : user.m2_with_comm_mod)
						: 0,
			need_m2_form =>	  constants.m2 ? !moderate_form : 0,
			need_m2_button => constants.m2,
			title => " " });
	   END;
	   END; # constants.modal_prefs_active
	%]
[% END %]

	[% lcp %]
	[% IF lvl; END %]
	[% IF comments;
	     this_pid = discussion2 ? 0 : pid;
	     thread = Slash.displayThread(sid, this_pid, lvl, comments);
	   END %]
	[% IF thread || discussion2 %]
		[% IF !cid || discussion2 %]<ul id="commentlisting" class="[% discussion2 ? 'd2' : 'd1' %]">[% END %]
			[% thread || '' %]
			<li id="roothiddens" class="hide"></li>
		[% IF !cid || discussion2 %]</ul>[% END %]
	[% END %]
	[% IF cid && !discussion2 %]</ul>[% END %]
	[% IF lvl; END %]
	[% lcp %]

[% IF discussion2 %]
<div id="replyto_0"></div>
[% END %]

<div id="discussion_buttons">

[% IF discussion2 %]
<span class="nbutton"><p><b><a href="#" onclick="D2.ajaxFetchComments(0,1); return false"><span id="more_comments_num_a" class="hide">Get More Comments</span></a></b></p></span>
[% END %]

[% IF discussion2 && !user.state.discussion_archived && !user.state.discussion_future_nopost %]
<span class="nbutton"><p><b>[% Slash.linkComment({
	sid          => sid,
	cid          => cid,
	op           => 'reply',
	subject      => 'Reply',
	subject_only => 1,
	onclick      => (discussion2 ? "D2.replyTo(0); return false;" : '')
}) %]</b></p></span>
[% END %]

[% IF !user.is_anon %]
<span class="nbutton"><p><b><a href="[% gSkin.rootdir %]/my/comments"[% IF constants.modal_prefs_active %] onclick="getModalPrefs('d2', 'Discussion 2'); return false"[% END %]>Prefs</a></b></p></span>[% END %]

[% IF (can_moderate || user.acl.candelcomments_always) %]
<span class="nbutton"><p><b><a href="[% gSkin.rootdir %]/moderation.shtml">Moderator Help</a></b></p></span>[% END %]

[% IF moderate_form %]
	[% IF moderate_button %]
		[% IF can_del %]<span class="nbutton"><p><b>[% END %]
		<input type="hidden" name="op" value="moderate">
		<input type="hidden" name="sid" value="[% sid %]">
		<input type="hidden" name="cid" value="[% cid %]">
		<input type="hidden" name="pid" value="[% pid %]">
		[% IF can_del %]<a href="#" onclick="$('#commentform').submit(); return false">Delete</a></b></p></span>
		<a href="#" onclick="displayModalPrefHelp('discussion_delete_help'); return false" title="Click To Expand Help" class="help">?</a>
	        <div id="discussion_delete_help" class="modalprefhelp" style="display: none;">Checked comments will be deleted.</div>
	        [%- ELSE %]<input type="submit" value="moderate" class="button">
	        [% END %]
	[% END %]
[% END %]
</div>
[% IF moderate_form %]	</form>[% END %]

[% IF discussion2 %]
	<script type="text/javascript">
<!--
		D2.currents()['hidden']   = [% user.state.comments.totals.hidden  || 0 %];
		D2.currents()['full']     = [% user.state.comments.totals.full    || 0 %];
		D2.currents()['oneline']  = [% user.state.comments.totals.oneline || 0 %];
		// D2.currents_total([% (user.state.comments.totals.hidden || 0 ) + (user.state.comments.totals.full || 0) + (user.state.comments.totals.oneline || 0)  %]);

		D2.abbrev_comments({});
		D2.noshow_comments([[% user.state.comments.noshow.join(',') %]]);
		D2.pieces_comments([[% user.state.comments.pieces.join(',') %]]);
		D2.init_hiddens([[% user.state.comments.hiddens.join(',') %]]);

		D2.finishLoading();

[% UNLESS user.state.discussion_archived || user.state.discussion_future_nopost %]
		if (D2.thresh_totals()[6][6][1] == 0) {
			D2.replyTo(0, 1);
		}
[% END %]

//-->
	</script>
[% END %]

__seclev__
10000
__version__
$Id$
