__section__
default
__description__

__title__

__page__
searchtoo
__lang__
en_US
__name__
searchform
__template__
[% IF op == 'comments' || op == 'stories' || op == 'submissions' || op == 'polls';
	tref = Slash.db.getTopic(form.tid);
   END;
   IF op == 'stories' || op == 'submissions';
	sections = 1;
	topics   = 1;
   END;
%]

<table width="100%" cellpadding="3" cellspacing="0" border="0"><tr><td>

[% IF tref.image %]
	<img src="[% constants.imagedir %]/topics/[% tref.image %]"
	align="RIGHT" border="0" alt="[% tref.alttext %]"
	hspace="30" vspace="10" width="[% tref.width %]"
	height="[% tref.height %]">
[% END %]

<form action="[% gSkin.rootdir %][% env.script_name %]" method="get">
	<br>
	<input type="hidden" name="tid" value="[% form.tid %]">
	<input type="text" size="40" name="query" value="[% form.query %]">
	[% IF op == 'stories';
		authors = Slash.db.getDescriptions("all-authors");
		newauthors = { "" => Slash.getData("all_authors") };
		FOREACH author = authors.keys;
			newauthors.$author = authors.$author;
		END;
		Slash.createSelect("author", newauthors, form.author, 1, 0, 1);
	END %]

	[% sort = Slash.db.getDescriptions('sortorder');
	   Slash.createSelect("sort", sort, form.sort, 1)
	%]

	<input type="submit" value="Search"><br>

	<input type="radio" name="op" value="stories"[% constants.markup_checked_attribute IF op == 'stories' %]> Stories
	<input type="radio" name="op" value="comments"[% constants.markup_checked_attribute IF op == 'comments' %]> Comments
	<input type="radio" name="op" value="users"[% constants.markup_checked_attribute IF op == 'users' %]> Users
	<input type="radio" name="op" value="polls"[% constants.markup_checked_attribute IF op == 'polls' %]> Polls
	[% IF constants.search_journal_enabled %]
		<input type="radio" name="op" value="journals"[% constants.markup_checked_attribute IF op == 'journals' %]> Journals
	[% END %]
	[% IF constants.rss_store %]
		[% IF constants.search_rss_enabled || user.is_admin %]
			<input type="radio" name="op" value="rss"[% constants.markup_checked_attribute IF op == 'rss' %]> RSS Headlines
		[% END %]
	[% END %]
	[% IF constants.submiss_view || user.is_admin %]
		<input type="radio" name="op" value="submissions"[% constants.markup_checked_attribute IF op == 'submissions' %]> Submissions
	[% END %]
	<br>

	[% IF op == 'users' %]
	<input type="checkbox" name="journal_only" value="1"[% constants.markup_checked_attribute IF form.journal_only == '1' %]> Users with Journals
	[% END %]

	[% IF op == 'submissions';
		submission_notes = Slash.db.getDescriptions('submission-notes');
		Slash.createSelect("note", submission_notes, form.note, 1, 0, 1);
	END %]

	[% IF op == 'comments';
		formats = Slash.db.getDescriptions('threshcodes');
		threshold_select = Slash.createSelect('threshold', formats, form.threshold, 1);
	%]
		Threshold [% threshold_select %]
		<input type="hidden" name="sid" value="[% form.sid %]">
	[% END %]
	<p>
</form>

[% IF sections || topics %]
</td></tr><tr><td>
[%
   topics = Slash.db.getTopicTree();

   listnames = {};
   IF form.tid;
      topic_children = Slash.db.getAllChildrenTids(form.tid);
   ELSE;
      topic_children = topics.${constants.mainpage_nexus_tid}.children;
   END;

   FOREACH t = topic_children;
      NEXT IF !topics.$t.searchable;
      listnames.${topics.$t.textname} = t;
   END;
   
   listcount = listnames.size / 3;
   listex = listnames.size mod 3;
   i = 0;
%]
<b><a href="[% gSkin.rootdir %][% env.script_name %]">[% constants.sitename %]</a>
[% IF !topics.${form.tid}.nexus && topics.${form.tid}.parent;
   thisparent = topics.${form.tid}.parent.keys.nsort.0;
   IF thisparent == constants.mainpage_nexus_tid;
      thisparent = topics.${form.tid}.parent.keys.nsort.1;
   END;
   IF thisparent %]
:: <a href="[% gSkin.rootdir %][% env.script_name %]?tid=[% thisparent %]">[% topics.$thisparent.textname %]</a>
[% END; END; IF form.tid %]
:: <a href="[% gSkin.rootdir %][% env.script_name %]?tid=[% form.tid %]">[% topics.${form.tid}.textname %]</a>
[% END; IF listnames.size %]
Topics</b>
[% END %]
</td></tr><tr><td>

[% IF listnames.size %]
<table cellpadding="10" width="100%">
<tr><td valign="top">

<ul>
[% FOREACH s = listnames.keys.sort -%]
<li><a href="[% gSkin.rootdir %][% env.script_name %]?tid=[% listnames.$s %]">[% s %]</a>[%
   IF user.is_admin %] [<a href="[% gSkin.rootdir %]/admin.pl?op=topics&amp;nexttid=[% listnames.$s %]">edit</a>] [%
END %]</li>
[%- i = i + 1;
    IF i == listcount.int || i == 0;
       IF i == listcount.int && listex;
          listext = listex = 1;
          i = -1;
          NEXT;
       END;
%]</ul></td>
<td valign="top">

<ul>[% END; END # FOREACH %]
</td></tr>
</table>
[% END # IF listnames.size %]

[% END # IF sections || topics %]
</td></tr></table>


__seclev__
100
__version__
$Id$
