__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 discussion2 == "slashdot" %]
	<script src="[% constants.imagedir %]/comments.js?[% constants.cvs_tag_currentcode %]" type="text/javascript"></script>
	[%- END %]
	<script type="text/javascript">
<!--
	window.onscroll = d2act;
	boxStatus(1);
[% Slash.jsSelectComments(Slash.db, constants, user, { sid => sid, cid => cid }, gSkin) %]
//-->
	</script>
[% END %]

[% IF cid && !discussion2 %]
	<ul id="commentlisting" class="[% user.mode %]">
	[% 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 %]
	[% this_pid = discussion2 ? 0 : pid;
	   thread = Slash.displayThread(sid, this_pid, lvl, comments) %]
	[% IF thread || discussion2 %]
		[% IF !cid || discussion2 %]<ul id="commentlisting"[% IF discussion2 %] class="d2"[% END %]>[% 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="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 ? "replyTo(0); return false;" : '')
}) %]</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 %]
	</form>
[% END %]
</div>

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

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

		finishLoading();
//-->
	</script>
[% END %]

__seclev__
10000
__version__
$Id: printCommComments;misc;default,v 1.75 2008/04/10 18:43:44 pudge Exp $
