<?php TPL::output('global/header.tpl.htm'); ?>

<?php if ($this->redirect_message) { ?>
<div class="rdmessage">
<?php foreach ($this->redirect_message AS $key => $message) { ?>
	<p class="qreset"><?php echo $message; ?></p>
<?php } ?>
</div>
<?php } ?>

<div class="tny-basic main tny-clear allbg">
	<div class="tny-left lsidebar">
		<div class="cMain">
		<h2 class="rel">
			<?php echo $this->question_info['question_content']; ?>
			
			<div class="q_rightBar abs">
				<?php if ($this->user_id) { ?>
					<a href="javascript:;" onclick="focus_question($(this), $(this), <?php echo $this->question_id; ?>);" class="btn-blue2 <?php if ($this->question_focus) { ?> cur<?php } ?>"><?php if ($this->question_focus) { ?>Un<?php } ?>follow</a>
					
					<a href="javascript:;" class="q_setBtn" onClick="$(this).siblings('.tipis').toggle();"></a>
					<div class="tny-data_list abs tipis">
						<em class="arrows"></em>
						<?php if ($_GET['column'] == 'log') { ?>
						<p class="tny-list_p"><a  href="question/<?php echo $this->question_id; ?>">Discussion question</a></p>
						<?php } else { ?>
						<p class="tny-list_p"><a  href="question/id-<?php echo $this->question_id; ?>__column-log__rf-false">Edit log</a></p>
						<?php } ?>
						
						<?php if ($this->user_info['permission']['is_administortar'] OR $this->user_info['permission']['is_moderator'] OR (!$this->question_info['lock'] AND $this->user_info['permission']['redirect_question'])) { ?>
							<?php if ($this->question_info['redirect']) { ?>
								<p class="tny-list_p"><a href="javascript:;" onclick="ajax_request(GET_BASE_URL + '/question/ajax/redirect/', 'item_id=<?php echo $this->question_id; ?>');">Cancel redirect</a></p>
							<?php } else { ?>
								<p class="tny-list_p"><a href="javascript:;" onclick="$.sQuestions({flgs:6,seif:this});">Question redirect</a></p>
							<?php } ?>
						<?php } ?>
						<?php if ($this->user_info['permission']['is_administortar'] OR $this->user_info['permission']['is_moderator']) { ?><p class="tny-list_p"><a href="javascript:;" onclick="ajax_request(GET_BASE_URL + '/question/ajax/lock/', 'question_id=<?php echo $this->question_id; ?>');"><?php if ($this->question_info['lock']) { ?>Unlock selected<?php } else { ?>Lock question<?php } ?></a></p><?php } ?>
					</div>
				<?php } ?>
			</div>
		</h2>
		
		<div class="q_topicManage">
			<span class="q_topicMuster" id="PublicTopic">
				<?php foreach($this->question_topics as $key => $val){ ?>
				<a class="glotopic umsg" data-message="&uid=<?php echo $val['topic_id'] ?>&card=topic" href="topic/<?php echo $val['url_token']; ?>"><?php echo $val['topic_title']; ?></a>
				<?php } ?>
			</span>
			<?php if ($this->user_id AND !$this->question_info['lock']) { ?><span class="q_editor tny-small" title="Topic Edit" onClick="$.topic.editor_topic({flg:this,make:false});" id="editor_topicBtns">Topic Edit</span><?php } ?>
		</div>
			
		<div class="q_con_txt ">
			<div class="tags_Mark tny-cl_01">
				<?php echo $this->question_info['question_detail']; ?>
			</div>
			
			<?php if ($this->question_info['attachs']) {  ?>
			<p class="q_con_imgs tny-alpHover">
				<?php foreach ($this->question_info['attachs'] AS $key => $attach) { ?>
				<?php if ($attach['is_image'] AND !in_array($attach['id'], $this->question_info['attachs_ids'])) { ?>
				<a href="<?php echo $attach['attachment']; ?>" target="_blank" data-fancybox-group="thumb" rel="lightbox"><img src="<?php echo $attach['attachment']; ?>" alt="<?php echo $attach['attach_name']; ?>" /></a>
				<?php } else if (!$attach['is_image']) { ?>
				<p class="questionacc"><a href="<?php echo download_url($attach['file_name'], $attach['attachment']); ?>" class="tny-txtHide"><em class="q_ico"></em><?php echo $attach['file_name']; ?></a></p>
				<?php } ?>
				<?php } ?>
			</p>
			<?php } ?>
		</div>
			
		<div class="questionElm">
		<?php echo date_friendly($this->question_info['add_time']); ?>
		
		<?php if (!$this->question_info['lock'] || ($this->question_info['comment_count'] > 0)) { ?>
		<a href="javascript:;" class="q_criticism" onclick="toggle_comments(<?php echo $this->question_id; ?>, 'question',this,$.Q.reCallarrows);"><?php echo $this->question_info['comment_count']; ?> Reviews</a>
		<?php } ?>
			
			<span class="q_participate rel">
				<a href="javascript:;" class="q_pate">Share</a>
				<div class="tny-data_list abs">
					
					<em class="arrows"></em>
					
					<p class="tny-list_p">
						<a href="javascript:;" class="q_wb" onClick="$.sQuestions({flgs:2,number:0,share_type:'question',target_id:<?php echo $this->question_info['question_id']; ?>});">External site</a>
					</p>
					<?php if ($this->user_id){ ?>
					<p class="tny-list_p">
						<a href="javascript:;" class="q_letter" onClick="$.sQuestions({flgs:2,number:1,share_type:'question',target_id:<?php echo $this->question_info['question_id']; ?>});">Message</a>
					</p>
					<?php } ?>
					<p class="tny-list_p">
						<a href="javascript:;" class="q_maill" onClick="$.sQuestions({flgs:2,number:2,share_type:'question',target_id:<?php echo $this->question_info['question_id']; ?>});">Mail</a>
					</p>
				</div>
			</span>
			
			<?php if ((!$this->question_info['lock'] AND ($this->question_info['published_uid'] == $this->user_id OR $this->user_info['permission']['edit_question'])) OR $this->user_info['permission']['is_administortar'] OR $this->user_info['permission']['is_moderator']) { ?><a class="q_edit" href="publish/question_id-<?php echo $this->question_id; ?>#question">Edit</a><?php } ?>
			<?php if (($this->user_info['permission']['is_administortar'] OR $this->user_info['permission']['is_moderator']) AND $this->question_info['ip']) { ?><a href="javascript:;" title="<?php echo long2ip($this->question_info['ip']); ?>" onclick="$.alert('System records the IP address of: <?php echo long2ip($this->question_info['ip']); ?>');" class="q_ip">IP adress</a><?php } ?>
			<?php if ($this->question_info['unverified_modify_count']) { ?><a href="question/id-<?php echo $this->question_id; ?>__column-log__rf-false" class="q_modification">Confirm to edit<em class="mtooltips tny-hide"><?php echo $this->question_info['unverified_modify_count']; ?></em></a><?php } ?>				
			<?php if ($this->user_id) { ?>
				<a class="q_help rel" href="javascript:;" onClick="$.sQuestions({flgs:8,report_type:'question', target_id:<?php echo $this->question_info['question_id']; ?>})">Report</a>
			<?php } ?>
			
			<?php if ($this->user_id != $this->question_info['published_uid'] AND $this->user_id) { ?>
				<a class="q_grateful rel" href="javascript:;" <?php if (!$this->question_thanks) { ?> onclick="question_thanks(<?php echo $this->question_info['question_id']; ?>, this);"<?php } ?>><?php if ($this->question_thanks) { ?>Have<?php } ?>Thank<?php if (!$this->question_thanks) { ?><span class="tips-black abs tny-hide"><em></em>Thank the owner of the question</span><?php } ?></a>
				<?php } ?>
		</div>
			
		<!--Comments START-->
		<div class="commentElm rel" id="question_comments_<?php echo $this->question_info['question_id']; ?>" style="display:none">
			<em class="arrows"></em>
		    <div name="comments_list"></div>
		    <!--Comment box START-->
		    <?php if ($this->question_info['lock']) { ?>
		    <!-- Has Locking -->
		    <?php } else if ($this->user_id) { ?>
		    <div id="save_question_comment_<?php echo $this->question_info['question_id']; ?>">
		    <form action="question/ajax/save_question_comment/question_id-<?php echo $this->question_info['question_id']; ?>" method="post">
		    <div class="tny-Mits tny-subBg">
		    	<textarea class="textArea" name="message" onFocus="$.focus(this,'Post a comment...',$.Q.txtarea(this));">Post a comment...</textarea>
		        <div class="subiv tny-hide"><a href="javascript:;">Cancel</a><a href="javascript:;" onclick="save_comment(this);" class="btn-gray2">Comment</a></div>
		    </div>
		    </form>
		    </div>
		    <?php } else { ?>
			<p style="padding:10px;">To review questions please <a href="account/login/">Login</a> or <a href="account/register/">Sign up</a></p>
			<?php } ?>
		    <!--Comment box END-->
		</div>
		<!--Comments END-->
		</div>
		
		<div class="b_restrain q_x2">
			<?php if ($_GET['column'] == 'log') { ?>
			<h3 class="trends-H3 qAll rel content-H3 "><a class="v_more tny-right" href="question/<?php echo $this->question_id; ?>">Back to the question »</a>Question editing log</h3>
			<ul class="q_pagelogs" id="c_log_list"></ul>
			
			<p id="io_log_more"><a class="ajax-more" href="javascript:;">Show More</a></p>
			<?php } else { ?>
			<h3 class="trends-H3 qAll rel content-H3 ">
				<?php if ($this->answer_count) { ?>
				<p class="navC abs">
					<?php if ($this->user_id){ ?>
						<a href="question/id-<?php echo $this->question_id; ?>__uid-focus" <?php if ($_GET['uid'] == 'focus') { ?>  class="cur"<?php } ?>>People followed</a>
						
						<a href="question/id-<?php echo $this->question_id; ?>__sort_key-add_time__sort-<?php if (($_GET['sort_key'] == 'add_time') && $_GET['sort'] == 'ASC') { ?>DESC<?php } else { ?>ASC<?php } ?>"<?php if ($_GET['sort_key'] == 'add_time') { ?> class="cur"<?php } ?>>Time<?php if (($_GET['sort_key'] == 'add_time') && $_GET['sort'] == 'DESC') { ?><em class="tny-small q_arrs_down"></em><?php } else { ?><em class="tny-small q_arrs_down q_arrs_up"></em><?php } ?></a>
						
						<a href="question/id-<?php echo $this->question_id; ?>__sort_key-agree_count__sort-DESC"<?php if ((!$_GET['uid'] && !$_GET['sort_key']) || $_GET['sort_key'] == 'agree_count') { ?> class="cur"<?php } ?>>Votes</a>
					<?php } ?>
				</p>
				<?php } ?>
				
				<?php echo $this->answer_count; ?> Replies
			</h3>
			
			<?php if ($this->answers) { foreach ($this->answers AS $key => $val) { ?>
			
			
			<?php if ($this->question_info['best_answer'] == $val['answer_id']) { ?><p class="winner_reply rel tny-linkGreen"><em class="winner_Cup abs"></em>Best reply</p><?php } ?>
			
			<div class="smodule qreplytxt answers_list" uninterested_count="<?php echo $val['uninterested_count']; ?>" force_fold="<?php echo $val['force_fold']; ?>" id="answer_list_<?php echo $val['answer_id']; ?>"><a name="answer_<?php echo $val['answer_id']; ?>"></a>
				<!--User avatar-->
				<?php if ($val['anonymous'] == 0) { ?><a class="suser tny-alpHover" href="people/<?php echo $val['url_token']; ?>"><img src="<?php echo get_avatar_url($val['uid'], 'mid'); ?>"  class="umsg" data-message="&uid=<?php echo $val['uid']; ?>&card=user" /></a><?php } else { ?><a class="suser tny-alpHover" href="javascript:;"><img src="<?php echo GET_STATIC_URL; ?>/common/avatar-mid-img.jpg" alt="Anonymous" title="Anonymous" /></a><?php } ?>
				
				<div class="s-txt rel">
					<p class="s_autograph tny-txtHide"><?php if ($val['anonymous']) { ?>Anonymous<?php } else { ?><a  class="umsg" data-message="&uid=<?php echo $val['uid']; ?>&card=user"  href="people/<?php echo $val['url_token']; ?>"><?php echo $val['user_name']; ?></a><?php if ($val['verified']) { ?> <em title="Certified" class="v tny-small"></em> <?php } ?><?php if ($val['signature']) { ?> - <?php echo $val['signature']; ?><?php } ?><?php } ?></p>
					<p class="sendorsepeople tny-gray tny-cl_02<?php if (!$val['agree_users']) { ?> tny-hide<?php } ?>"><span class="g_txt">Agree from:</span> <?php if ($val['agree_users']) { ?><?php $count = 0; foreach($val['agree_users'] AS $uid => $user) { ?><?php if ($count >= 5) { ?><em name="agee_people"<?php if ($count >= 5) { ?> style="display:none"<?php } ?>>, </em><?php } ?><a href="people/<?php echo $user['url_token']; ?>" data-id="<?php echo $uid;?>" class="umsg" data-message="&uid=<?php echo $uid;?>&card=user" name="agee_people" <?php if ($count >= 5) { ?> style="display:none"<?php } ?>><?php echo $user['user_name']; ?></a><?php if (count($val['agree_users']) != ++$count && $count < 5) { ?><em>, </em><?php } ?><?php } ?><?php } ?><?php if (count($val['agree_users']) >= 5) { ?><a class="v_more" href="javascript:;" onclick="$(this).parent().find('[name=agee_people]').show();$(this).hide();">More »</a><?php } ?></p>
					
					<div class="txtBreak tny-cl_01 tags_Mark"><?php echo FORMAT::parse_attachs($val['answer_content']); ?></div>
					
					<?php if ($val['attachs']) {  ?>
					<p class="q_con_imgs tny-alpHover">
						<?php foreach ($val['attachs'] AS $attach) { ?>
						<?php if ($attach['is_image'] AND !in_array($attach['id'], FORMAT::parse_attachs($val['answer_content'], true))) { ?>
						<a href="<?php echo $attach['attachment']; ?>" target="_blank" data-fancybox-group="thumb" rel="lightbox"><img src="<?php echo $attach['attachment']; ?>" alt="<?php echo $attach['attach_name']; ?>" /></a>
						<?php } else if (!$attach['is_image']) { ?>
						<p class="questionacc"><a href="<?php echo download_url($attach['file_name'], $attach['attachment']); ?>" class="tny-txtHide"><em class="q_ico"></em><?php echo $attach['file_name']; ?></a></p>
						<?php } ?>
						<?php } ?>
					</p>
					<?php } ?>
					
					<div class="questionElm">
						<?php echo date_friendly($val['add_time']); ?> 
						<?php if (!$this->question_info['lock'] || ($val['comment_count'] > 0)) { ?><a class="q_criticism" href="javascript:;" onclick="toggle_comments(<?php echo $val['answer_id']; ?>, 'answer',this,$.Q.reCallarrows);"><?php echo $val['comment_count']; ?> Reviews</a><?php } ?>
						<p class="q_hide">
							<?php if ($this->user_id != $val['uid'] AND $this->user_id) { ?>
							<a class="q_grateful rel" href="javascript:;" <?php if (!$val['user_rated_thanks']) { ?> onclick="answer_user_rate(<?php echo $val['answer_id']; ?>, 'thanks', this);"<?php } ?>><?php if ($val['user_rated_thanks']) { ?>Have<?php } ?>Thank<?php if (!$val['user_rated_thanks']) { ?><span class="tips-black abs tny-hide"><em></em>Thanks for the reply</span><?php } ?></a>
							<?php } ?>
		
							<a class="q_pate" href="javascript:;" onclick="$.sQuestions({flgs:2,number:0,share_type:'answer',target_id:<?php echo $val['answer_id']; ?>});">Share</a>
						
						<?php if ($this->user_id) { ?>
							<?php if ($this->user_info['permission']['is_administortar'] OR $this->user_info['permission']['is_moderator']) { ?>
							<a href="javascript:;" onclick="answer_force_fold(<?php echo $val['answer_id']; ?>, this);" class="q_help rel"><?php if ($val['force_fold']) { ?>Un<?php } ?>fold</a>
							<?php } else { ?>
							<a class="q_help rel" href="javascript:;" onclick="answer_user_rate(<?php echo $val['answer_id']; ?>, 'uninterested', this);"><?php if ($val['user_rated_uninterested']) { ?>Unfold<?php } ?>No help<span class="tips-black abs tny-hide"><em></em>There is no value to reply</span></a>
							<?php } ?>
							<a class="q_collect" onClick="$.Q.favorite(<?php echo $val['answer_id']; ?>);" href="javascript:;">Add to favorite</a>
						
							<?php if (($this->user_info['permission']['is_administortar'] OR $this->user_info['permission']['is_moderator']) OR ($val['uid'] == $this->user_id AND ((time() - $val['add_time']) < (get_setting('answer_edit_time') * 60) OR (!get_setting('answer_edit_time'))))) { ?>
							<a class="q_edit" href="javascript:;" onclick="$.sQuestions({flgs:5,tanyacms_id:<?php echo $val['answer_id']; ?>});">Edit</a>
							<?php } ?>
						<?php } ?>
						</p>
					</div>
					
					<!--Comments START-->
			        <div class="commentElm rel" id="answer_comments_<?php echo $val['answer_id']; ?>" style="display:none">
			        	<em class="arrows"></em>
				        <div name="comments_list"></div>
			            <!--Comment box START-->
			            <?php if ($this->user_id) { ?>
			            <div id="save_answer_comment_<?php echo $val['answer_id']; ?>">
				            <form action="question/ajax/save_answer_comment/answer_id-<?php echo $val['answer_id']; ?>" method="post">
				            <div class="tny-Mits tny-subBg">
				            	<textarea class="textArea" name="message" onFocus="$.focus(this,'Post a comment...',$.Q.txtarea(this));">Post a comment...</textarea>
				                <div class="subiv tny-hide"><a href="javascript:;">Cancel</a><a href="javascript:;" onclick="save_comment(this);" class="btn-gray2">Comment</a></div>
				            </div>
				            </form>
			            </div>
			            <?php } else { ?>
						<p style="padding:10px;">To participate in a question first <a href="account/login/">Login</a> or <a href="account/register/">Sign up</a></p>
						<?php } ?>
			            <!--Comment box END-->
			        </div>
			        <!--Comments END-->
			            
					<!--Agree number-->
					<?php if ($this->user_id AND $this->user_id != $val['uid']) { ?>
					<p class="sxs abs">
						<a  onclick="$.I.addCast(this, GET_USER_NAME, '<?php echo $val['answer_id']; ?>')" href="javascript:;" class="s_zt rel<?php if ($val['agree_status'] == '1') { ?> s_cur_z<?php } ?>"><span class="tips-black abs tny-hide"><em></em>Agree with the reply</span></a>
						<em class="s" data-number="<?php echo $val['agree_count']; ?>"><?php echo $val['agree_count']; ?></em>
						<a data-id="38" onclick="$.I.oppCast(this,GET_USER_NAME,'<?php echo $val['answer_id']; ?>')" href="javascript:;" class="s_fd rel<?php if ($val['agree_status'] == '-1') { ?> s_cur_f<?php } ?>"><span class="tips-black abs tny-hide"><em></em>Disagree with the reply</span></a></p>
	                <?php } else { ?>
					<p class="sxs abs">
	            		<a href="javascript:;" class="s_zt rel s_seif_z"></a>
	            		<em class="s"><?php echo $val['agree_count']; ?></em>
	            		<a href="javascript:;" class="s_fd rel s_seif_f"></a>
	                </p>
					<?php } ?>
				</div>
			</div>
			<?php } } ?>
			
			<!--Folded START-->
			<div class="smodule qreplytxt s_enpd" id="load_uninterested_answers" style="display: none;"><h4 class="enfoldment rel"><a href="javascript:;" class="a abs" onclick="$.alert('Folded back by most users think No help reply.');">Why is folded?</a><a href="javascript:;" onclick="$('#uninterested_answers_list').toggle();"><span class="hide_answers_count">0</span> Replies are folded</a></h4></div>
			
			<div style="display: none;" id="uninterested_answers_list"></div>
			<!--Folded END-->
		
			<?php echo $this->pagination; ?>
		
		<?php } ?>
		</div>
		
		<?php if ($_GET['column'] != 'log') { ?>
		<!--Reply box START-->
		<a name="answer_form"></a>
		<div class="replymain">
			<?php if ($this->question_info['lock']) { ?>
			<p align="center" style="padding:10px;">The question has been locked, cannot add more reply</p>
			<?php } else if (!$this->user_id) { ?>
			<p align="center" style="padding:10px;">Please <a href="account/login/">login</a> or <a href="account/register/">register</a> to reply to question</p>
			<?php } else if ($this->user_answered) { ?>
			<p align="center" style="padding:10px;">One question can only be replied once<?php if (get_setting('answer_edit_time')) { ?> you can speak after <?php echo get_setting('answer_edit_time'); ?> Minutes Edit Reply viewed Content<?php } ?></p>
			<?php } else if ((get_setting('answer_self_question') == "N") && ($this->user_id == $this->question_info['published_uid'])) { ?>
			<p align="center" style="padding:10px;">Cannot reply to your own question, you can edit content of the question</p>
			<?php } else { ?>
			<form action="question/ajax/save_answer/" onsubmit="return false;" method="post" id="answer_form">
	        	<input type="hidden" name="post_hash" value="<?php echo new_post_hash(); ?>" />
	        	<input type="hidden" name="question_id" value="<?php echo $this->question_id; ?>" />
	        	<input type="hidden" name="attach_access_key" value="<?php echo $this->attach_access_key; ?>" />
	        	
				<h5 class="tny-anony">
					<span class="tny-right anonymity">
					<?php if (!$this->question_focus) { ?>
						<input type="checkbox" name="auto_focus" value="1" checked="checked" id="tny-focus" title="Follow" /><label for="tny-focus">Follow</label> &nbsp; 
					<?php } ?>
					<?php if (get_setting('anonymous_enable') == 'Y') { ?>
						<input type="checkbox" name="anonymous" value="1" id="anonymity" title="Anonymous" /><label for="anonymity">Anonymous</label>
					<?php } ?>
					</span>
					
					<p class="anUserhandle">
						<a href="people/" class="imgUser"><img alt="<?php echo $this->user_info['user_name']; ?>" src="<?php echo get_avatar_url($this->user_info['uid'], 'mid'); ?>" /></a><b><a href="people/"><?php echo $this->user_info['user_name']; ?></a></b>
						<span class="reltxt tny-txtHide"><?php echo $this->user_info['signature']; ?></span>
					</p>
				</h5>
				
				<div class="relayHandle">
	                <textarea name="answer_content" id="answer_content" class="textArea advanced_editor"><?php echo $this->draft_content['message']; ?></textarea>
					<p class="tny-draft" id="answer_content_message"></a></p>
					<div class="acceMain rel" id="markItUpBtn">
						<div class="abs xAuto">
							<?php if ($this->human_valid) { ?>
							<span class="tny-anthcode"><img id="captcha" onclick="this.src = GET_BASE_URL + '/account/captcha/rnd-' + Math.floor(Math.random() * 10000);" src="" /><input type="text" onFocus="$.focus(this,'Verification code');" value="Verification code" name="seccode_verify" class="verification"/></span>
							<?php } ?>
							<a href="javascript:;" class="btn-raplay2" id="question_replay_submit" onclick="ajax_post($('#answer_form'));">Reply</a>
						</div>
						
						<div class="uploadMain" id="file_uploader_answer"></div>
					</div>
				</div>
			</form>
			<?php } ?>
		</div>
		<!--Reply box END-->
		<?php } ?>
	</div>
	
	<div class="rsidebar">
		<div class="rightMain">
			<?php if ($this->question_info['anonymous'] == 0) { ?>
			<div class="interest-user">
				<h3>Owner</h3>
				<p class="qsel">
					<a href="people/<?php echo $this->question_info['user_info']['url_token']; ?>" class="imgUser"><img alt="<?php echo $this->question_info['user_info']['user_name'];?>" src="<?php echo get_avatar_url($this->question_info['published_uid'], 'mid'); ?>" class="umsg" data-message="&uid=<?php echo $this->question_info['published_uid']; ?>&card=user" /></a>
					<a href="people/<?php echo $this->question_info['user_info']['url_token']; ?>" class="q_uname"><?php echo $this->question_info['user_info']['user_name']; ?></a><?php if ($this->question_info['user_info']['verified']) { ?> <em title="Certified" class="v tny-small"></em> <?php } ?><?php if ($this->question_info['published_uid'] != $this->user_id AND $this->user_id) { ?><a href="javascript:;" onclick="follow_people($(this), $(this).find('em'), <?php echo $this->question_info['published_uid']; ?>);" class="add-attention<?php if ($this->user_follow_check) { ?> cur<?php } ?>"><em><?php if ($this->user_follow_check) { ?>Un<?php } ?>follow</em></a><?php } ?>
					<span class="q_spx"><?php echo $this->question_info['user_info']['signature']; ?></span>
				</p>
			</div>
			<?php } ?>
			
			<?php if ($this->user_id AND !$this->question_info['lock']) { ?>
			<div class="interest-user">
				<h3>Invite people to reply</h3>
				<div class="q_invitation">
					<p class="q_tx" id="tny-tabs"><a href="javascript:;">Internal invitation<em class="mtooltips"<?php if (count($this->invite_users) == 0){ ?> style="display:none;"<?php } ?> id="invi_User" rel="<?php echo count($this->invite_users); ?>"><?php echo count($this->invite_users); ?></em></a> • <a href="javascript:;">Email invitation</a></p>
					<div class="tabs">
						<div class="editor_input rightSide tny-hide" id="tny-tabs_0">
							<p><input type="text" class="glotxtclass" value="Only invited users site..." id="invi_inputUser" data-rel="Invite" onKeyUp="$.I.searchUser(this,event,'search');$('#tips_err').hide();"  onfocus="$.focus(this,'Only invited users site...');"></p>
							<p style="color:red;height:30px; line-height:30px; text-align:left; display:none;" id="tips_err"></p>
							<ul id="invitation-ulist" class="invitation-ulist">
								<?php if ($this->invite_users) { ?>
								<?php foreach($this->invite_users as $key => $val){ ?>
								<li data-id="<?php echo $val['uid']; ?>"><a href="javascript:;" class="pic_xa tny-left"><img class="umsg" data-message="&uid=<?php echo $val['uid']; ?>&card=user" src="<?php echo get_avatar_url($val['uid'], 'mid'); ?>"></a><?php if ($val['sender_uid'] == $this->user_id){ ?><a class="btn-gray2 tny-right" href="javascript:;" data-id="<?php echo $val['uid']; ?>" onclick="$.disinvite_user(<?php echo $val['uid']; ?>,this,'<?php echo $val['user_name']; ?>')">Cancel invitation</a><?php } ?><span class="username_list" title="<?php echo $val['user_name']; ?>"><?php echo $val['user_name']; ?></span></li>
								<?php } ?>
								<?php } ?>
							</ul>
						</div>
						
						<div class="editor_input rightSide tny-hide" id="tny-tabs_1">
							<form id="email_invite_form" onSubmit="return false;" action="question/ajax/email_invite/question_id-<?php echo $this->question_id; ?>" method="post">
							<p>
								<input type="text" class="glotxtclass" value="Invitation by Email..." id="invi_inputMail" data-rel="Invite" onKeyUp="$('#tips_err').hide();" name="email" onfocus="$.focus(this,'Invitation by Email...');">
								<a title="Invite»" href="javascript:;" class="btn-blue2" onclick="ajax_post($('#email_invite_form'));">Invite»</a>
							</p>
							</form>
						</div>
					</div>
					
					<?php if ($this->helpful_users) { ?>
					<div class="q_trt">
						<h4>People who might be able to help you</h4>
						
						<?php foreach ($this->helpful_users AS $key => $val) { ?>
						<p class="qsel">
							<a href="people/<?php echo $val['url_token']; ?>" class="imgUser"><img alt="<?php echo $val['user_name']; ?>" class="umsg" data-message="&uid=<?php echo $val['uid']; ?>&card=user" src="<?php echo get_avatar_url($val['uid'], 'mid'); ?>" /></a>
							<a href="javascript:;" class="tny-right" onClick="$.invitation_user({fg:this,ex:'help',user:'<?php echo $val['user_name']; ?>',uid:<?php echo $val['uid']; ?>,url:'<?php echo get_avatar_url($val['uid'], 'mid'); ?>'})">Invite</a><span class="q_uname tny-txtHide" style="max-width:90px;"><a href="people/<?php echo $val['url_token']; ?>"><?php echo $val['user_name']; ?></a></span>
							<span class="q_spx"><?php echo utf8_substr($val['signature'], 0, 12, 'UTF-8', '...'); ?></span>
						</p>
						<?php } ?>
					</div>
					<?php } ?>
				</div>
			</div>
			<?php } ?>
			
			<?php if ($this->question_related_list) { ?>
			<div class="interest-user">
				<h3>Related question</h3>
				
				<div class="q_related_list">
				<?php foreach($this->question_related_list AS $key => $val) { ?>
				<a href="question/<?php echo $val['question_id']; ?>"><?php echo $val['question_content']; ?></a>
				<?php } ?>
				</div>
			</div>
			<?php } ?>
			
			<div class="interest-user">
				<h3>Question status</h3>
				<div class="q_state">
					<p>New activity: <span class="tny-blue"><?php echo date_friendly($this->question_info['update_time']); ?></span></p>
					<p>Views: <span class="tny-blue"><?php echo $this->question_info['view_count']; ?></span></p>
					<p>Follow: <span class="tny-blue"><?php echo $this->question_info['focus_count']; ?></span> people</p>
					<p class="quserList" id="focususers"></p>
				</div>
			</div>
		</div>
	</div>
</div>

<script type="text/javascript">
ATTACH_ACCESS_KEY = '<?php echo $this->attach_access_key; ?>';
ITEM_IDS = '<?php echo $_GET['item_id']; ?>';
COMMENT_UNFOLD = '<?php echo $_GET['comment']; ?>';
QUESTION_ID = <?php echo $this->question_id;?>;
UNINTERESTED_COUNT = <?php echo get_setting('uninterested_fold'); ?>;
//$.tabs('#tny-tabs',$.exit_operate);
$.exit_operate('#tny-tabs')

</script>

<script type="text/javascript" src="<?php echo GET_STATIC_URL; ?>/js/app/question_detail.js"></script>

<?php TPL::output('global/footer.tpl.htm'); ?>