<div class="interest-user topicpad">
	<h3>Related topic</h3>
    <div class="trelated">
    	<span id="PublicTopic" class="topic-rlt">
        <?php if ($this->related_topics) { ?>
            <?php foreach($this->related_topics as $key => $val){ ?>
            <a href="topic/<?php echo $val['url_token']; ?>" class="glotopic umsg" data-message="&uid=<?php echo $val['topic_id']; ?>&card=topic"><?php echo $val['topic_title']; ?></a>
            <?php } ?>
        <?php } ?> 
		</span>
		<?php if ($this->user_info['permission']['is_administortar'] OR $this->user_info['permission']['is_moderator'] OR ($this->topic_info['topic_lock'] == 0 && $this->user_info['permission']['edit_topic'])) { ?>
	    <span id="editor_topicBtns" onclick="$.editor_topic_x(this);" title="Topic Edit" class="q_editor tny-small">Topic Edit</span>
	    <div class="editor_input tny-hide rightSide " id="editor_input_handle">
	    <p style="padding:5px 0; color:red; text-align:left;" id="tips_err"></p>
	    <input type="text" class="glotxtclass" value="Creating add related topic..." onKeyUp="$('#tips_err').hide();"  onfocus="$.focus(this,'Creating add related topic...');" maxlength="13" id="editor_input" ><a href="javascript:;" onClick="$.exit_topic();">Cancel</a>&nbsp;&nbsp;<a onclick="$.establish_topicx();" title="Make sure Add»" href="javascript:;" class="btn-blue2">Add»</a>
	   </div>
	   <?php } ?>
    </div>
    
</div>