Skip to content

Commit 7b8158b

Browse files
committed
Close #2
1 parent cdc75d1 commit 7b8158b

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

application/language/english/forums/forums_lang.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
$lang['forums_reply'] = "Reply";
3939
$lang['forums_reply_posted'] = "Reply posted!";
4040
$lang['forums_posted_by'] = "Posted by ";
41+
$lang['forums_quote'] = "Quote this post";
4142

4243
//for librari's time_ago function
4344
$lang['forums_time_second'] = "second";

application/views/forums/talk.php

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,15 @@
3636

3737
<?php foreach ($posts as $post): ?>
3838
<div class="well">
39-
<?php echo htmlspecialchars_decode($post->post, ENT_QUOTES); ?><br/><br/>
40-
39+
<div id="post-<?php echo $post->id; ?>">
40+
<?php echo htmlspecialchars_decode($post->post, ENT_QUOTES); ?>
41+
</div>
42+
<br/><br/>
43+
<a class="btn btn-default" onclick="quote('post-<?php echo $post->id; ?>', '<?php echo $post->username; ?>')"><?php echo lang('forums_quote'); ?></a>
4144
<span class="pull-right">
4245
<?php echo lang('forums_posted_by') . $post->username; ?>, <?php echo $this->cibb->time_ago($post->date_add); ?>
4346
</span>
44-
<div class="clearfix" style="height: 30px;"></div>
45-
47+
<div class="clearfix" style="height: 20px;"></div>
4648
</div>
4749
<?php endforeach; ?>
4850

@@ -65,4 +67,13 @@
6567
echo '</div><div class="clearfix"></div>';
6668
echo form_close();
6769
?>
70+
<script>
71+
function quote(post, author)
72+
{
73+
var text = $('#'+post).html();
74+
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>';
75+
var value = $('textarea.editable').val();
76+
$('textarea.editable').val(value + quote);
77+
}
78+
</script>
6879
</div>

0 commit comments

Comments
 (0)