Skip to content

Commit

Permalink
Close #2
Browse files Browse the repository at this point in the history
  • Loading branch information
StorytellerCZ committed Jul 13, 2014
1 parent cdc75d1 commit 7b8158b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
1 change: 1 addition & 0 deletions application/language/english/forums/forums_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
$lang['forums_reply'] = "Reply";
$lang['forums_reply_posted'] = "Reply posted!";
$lang['forums_posted_by'] = "Posted by ";
$lang['forums_quote'] = "Quote this post";

//for librari's time_ago function
$lang['forums_time_second'] = "second";
Expand Down
19 changes: 15 additions & 4 deletions application/views/forums/talk.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,15 @@

<?php foreach ($posts as $post): ?>
<div class="well">
<?php echo htmlspecialchars_decode($post->post, ENT_QUOTES); ?><br/><br/>

<div id="post-<?php echo $post->id; ?>">
<?php echo htmlspecialchars_decode($post->post, ENT_QUOTES); ?>
</div>
<br/><br/>
<a class="btn btn-default" onclick="quote('post-<?php echo $post->id; ?>', '<?php echo $post->username; ?>')"><?php echo lang('forums_quote'); ?></a>
<span class="pull-right">
<?php echo lang('forums_posted_by') . $post->username; ?>, <?php echo $this->cibb->time_ago($post->date_add); ?>
</span>
<div class="clearfix" style="height: 30px;"></div>

<div class="clearfix" style="height: 20px;"></div>
</div>
<?php endforeach; ?>

Expand All @@ -65,4 +67,13 @@
echo '</div><div class="clearfix"></div>';
echo form_close();
?>
<script>
function quote(post, author)
{
var text = $('#'+post).html();
var quote = '<blockquote>'+text+'<span class="pull-right">'+'<a href="<?php echo base_url("forums/thread/".$thread->slug.'/'); ?>#'+post+'"><?php echo lang('forums_posted_by'); ?>'+author+'</a></span></blockquote>';
var value = $('textarea.editable').val();
$('textarea.editable').val(value + quote);
}
</script>
</div>

0 comments on commit 7b8158b

Please sign in to comment.