<!--#
##
#	Project: PHPDISK File Storage Solution
#	This is NOT a freeware, use is subject to license terms.
#
#	Site: http://www.phpdisk.com
#
#	$Id: pd_topic.tpl.html 25 2011-03-04 07:36:51Z along $
#
#	Copyright (C) 2008-2011 PHPDisk Team. All Rights Reserved.
#
##
#-->
<!--#if($action =='new_topic' || $action =='edit_topic'){#-->
<div id="container">
<div class="tit">{$title}</div>
<div class="layout_box">
<div class="l">
<form action="{#urr("topic","")#}" method="post" onSubmit="return dosubmit(this);">
<input type="hidden" name="action" value="{$action}"/>
<input type="hidden" name="task" value="{$action}"/>
<input type="hidden" name="tid" value="{$tid}" />
<input type="hidden" name="userid" value="{$pd_uid}" />
<input type="hidden" name="formhash" value="{$formhash}" />
<table align="center" width="98%" cellpadding="4" cellspacing="0" border="0" id="f_tab" class="td_line">
<tr>
	<td width="30%"><span class="bold">{$L['subject']}</span>:<br /><span class="txtgray">{$L['subject_tips']}</span></td>
	<td><input type="text" name="subject" value="{$topic['subject']}" maxlength="80" size="35" /></td>
</tr>
<tr>
	<td><span class="bold">{$L['reward_credit']}</span>:<br /><span class="txtgray">{$L['reward_credit_tips']}</span></td>
	<td>
	<select name="reward_credit">
	<option value="0" {#ifselected(0,$topic['credit'])#}>0</option>
	<option value="5" {#ifselected(5,$topic['credit'])#}>5</option>
	<option value="10" {#ifselected(10,$topic['credit'])#}>10</option>
	<option value="20" {#ifselected(20,$topic['credit'])#}>20</option>
	<option value="50" {#ifselected(50,$topic['credit'])#}>50</option>
	</select>&nbsp;&nbsp;{$L['your_credit']}: <img src="images/credit_icon.gif" align="absmiddle" border="0" /><span class="txtblue">{$credit}</span>
	</td>
</tr>
<tr>
	<td><span class="bold">{$L['content']}</span>:<br /><span class="txtgray">{$L['content_tips']}</span></td>
	<td><textarea name="content" id="content" style="width:400px;height:120px">{$topic['content']}</textarea><br />
	<a href="javascript:void(0);" onclick="resize_textarea('content','plus');">[+]</a> <a href="javascript:void(0);" onclick="resize_textarea('content','sub');">[-]</a>
</td>
</tr>
<tr>
	<td>&nbsp;</td>
	<td><input type="submit" value="{$L['btn_submit']}"/>&nbsp;&nbsp;<input type="button" value="{$L['all_topics']}" onclick="go('{#urr("topic","")#}');" /></td>
</tr>
</table>
</form>
<script language="javascript">
function dosubmit(o){
	if(o.subject.value.strtrim().length <2){
		alert("{$L['subject_error']}");
		o.subject.focus();
		return false;
	}
	if(o.content.value.strtrim().length <2 || o.content.value.strtrim().length >1000){
		alert("{$L['content_error']}");
		o.content.focus();
		return false;
	}
}
</script>
</div>
<div class="r">
<div class="common_box">
	<div class="tit2">Tips: {$L['reward_right']}</div>
	<ul>
	<li class="txtgray"><img src="images/light.gif" align="absmiddle" border="0" /> {$L['reward_right_tips']}</li>
	</ul>
</div>
</div>
<div class="clear"></div>
</div>
</div>
<!--#}elseif($action =='view_topic'){#-->
<div id="container">
<div class="tit">{$L['view_topic']}</div>
<div class="layout_box">
<div class="l">
<div class="announce">
	<h2>{$topic['subject']}&nbsp;&nbsp;{$topic['credit']} {$topic['status']}</h2>
	<div class="content">{$topic['content']}
	<br /><br />
	<div align="right">
	{$L['asker']}: <a href="{$topic['a_space']}" target="_blank">{$topic['username']}</a>&nbsp;
	<!--#if(!$topic['is_closed'] && $topic['userid'] ==$pd_uid){#-->
	<a href="{$topic['a_edittopic']}">{$L['modify']}</a>&nbsp;
	<a href="{$topic['a_deltopic']}" onclick="return confirm('{$L['confirm_del_topic']}');">{$L['delete']}</a>
	<!--#}#-->
	</div>
	</div>
</div>
<br />
<br />
<!--#
if(count($reply_arr)){
	foreach($reply_arr as $k => $v){
#-->
<div class="{$v['reply_class']}">
<div><span class="txtblue">#{#($k+1)#}</span>&nbsp;&nbsp;{$v['content']}</div>
<br />
<div align="right">
{$L['replyer']}: <a href="{$v['a_space']}" target="_blank">{$v['username']}</a>&nbsp;&nbsp;
<span class="txtgray">{$v['in_time']}</span>&nbsp;&nbsp;
<!--#if(!$topic['is_closed'] && $topic['userid'] ==$pd_uid){#-->
<input type="button" value="{$L['right_answer']}" style="height:2em" onclick="go('{$v['a_choose_best']}');" />
<!--#}#-->
</div>
</div>
<br />
<!--#
	}
	unset($reply_arr);
}
#-->
<br /><br />
<div class="reply_box">
<!--#if(!$pd_uid){#-->
<div>{$L['not_login_tips']} <a href="{#urr("account","action=login")#}">{$L['login']}</a>&nbsp;&nbsp;<a href="{#urr("account","action=register")#}">{$L['register']}</a></div>
<!--#}elseif(!$topic['is_closed']){#-->
<form action="{#urr("topic","")#}" method="post" onsubmit="return dosubmit(this);">
<input type="hidden" name="action" value="{$action}" />
<input type="hidden" name="task" value="reply" />
<input type="hidden" name="tid" value="{$tid}" />
<input type="hidden" name="formhash" value="{$formhash}" />
<div class="f14">{$L['reply_topic']}</div>
<ul>
<li><textarea name="content" rows="6" cols="60"></textarea></li>
<li><input type="submit" value="{$L['btn_submit']}" />&nbsp;<span class="txtred" id="c1"></span></li>
</ul>
</form>
<script language="javascript">
function dosubmit(o){
	if(o.content.value.strtrim().length <2 || o.content.value.strtrim().length >1000){
		getId('c1').innerText = "{$L['reply_error']}";
		o.content.focus();
		return false;
	}
}
</script>
<!--#}#-->
</div>
</div>
<div class="r">
<div class="common_box">
	<div class="tit2">Tips: {$L['reward_right']}</div>
	<ul>
	<li class="txtgray"><img src="images/light.gif" align="absmiddle" border="0" /> {$L['reward_right_tips']}</li>
	</ul>
</div>
</div>
<div class="clear"></div>
</div>
</div>
<!--#}else{#-->
<div id="container">
<div class="tit">{$title}</div>
<div class="layout_box">
<div class="l">
<script language="javascript">
$(document).ready(function(){
	$("#f_tab tr").mouseover(function(){
		$(this).addClass("alt_bg");
	}).mouseout(function(){
		$(this).removeClass("alt_bg");
	});
});
</script>
<br />
<table align="center" width="98%" cellpadding="4" cellspacing="0" border="0" id="f_tab" class="td_line">
<!--#
if(count($topic_arr)){
#-->
<tr>
	<td width="50%" class="bold">{$L['topic_subject']}</td>
	<td align="center" class="bold">{$L['topic_reply']}</td>
	<td align="center" class="bold">{$L['topic_status']}</td>
	<td align="center" width="150" class="bold">{$L['topic_time']}</td>
</tr>
<!--#
	foreach($topic_arr as $k => $v){
		$color = ($k%2 ==0) ? 'color1' :'color4';
#-->
<tr class="{$color}" height="20">
	<td>{$v['credit']}&nbsp;<a href="{$v['a_viewtopic']}" target="_blank">{$v['topic_subject']}</a>&nbsp;(<a href="{$v['a_space']}" target="_blank"><em>{$v['username']}</em></a>)</td>
	<td align="center">{$v['reply_num']}</td>
	<td align="center">{$v['topic_status']}</td>
	<td align="center" width="150"  class="txtgray">{$v['topic_time']}</td>
</tr>
<!--#		
	}
	unset($topic_arr);
}else{	
#-->
<tr>
	<td colspan="6">{$L['topic_not_found']}</td>
</tr>
<!--#
}
#-->
<!--#if($page_nav){#-->
<tr>
	<td colspan="6">{$page_nav}</td>
</tr>
<!--#}#-->
</table>
</div>
<div class="r">
<div class="common_box">
	<div class="tit2">Tips: {$L['you_can']}</div>
	<ul>
	<li><input type="button" value="{$L['btn_new_topic']}" style="height:2em" onclick="go('{#urr("topic","action=new_topic")#}');" /></li>
	</ul>
</div>
</div>
<div class="clear"></div>
</div>
</div>
<!--#}#-->