lang field in replies

This commit is contained in:
Claude 2013-04-26 16:21:00 +02:00
parent cc06812e1a
commit e59a21c459
2 changed files with 6 additions and 3 deletions

View File

@ -257,7 +257,7 @@ class Pastes extends CI_Model
{ {
$amount = $this->config->item('per_page'); $amount = $this->config->item('per_page');
$page = ($this->uri->segment(3) ? $this->uri->segment(3) : 0); $page = ($this->uri->segment(3) ? $this->uri->segment(3) : 0);
$this->db->select('title, name, created, pid, snipurl'); $this->db->select('title, name, created, pid, lang');
$this->db->where('replyto', $data['pid']); $this->db->where('replyto', $data['pid']);
$this->db->order_by('id', 'desc'); $this->db->order_by('id', 'desc');
$this->db->limit($amount); $this->db->limit($amount);
@ -270,9 +270,9 @@ class Pastes extends CI_Model
{ {
$data['replies'][$n]['title'] = $row['title']; $data['replies'][$n]['title'] = $row['title'];
$data['replies'][$n]['name'] = $row['name']; $data['replies'][$n]['name'] = $row['name'];
$data['replies'][$n]['lang'] = $row['lang'];
$data['replies'][$n]['created'] = $row['created']; $data['replies'][$n]['created'] = $row['created'];
$data['replies'][$n]['pid'] = $row['pid']; $data['replies'][$n]['pid'] = $row['pid'];
$data['replies'][$n]['snipurl'] = $row['snipurl'];
$n++; $n++;
} }
$config['base_url'] = site_url('view/' . $data['pid']); $config['base_url'] = site_url('view/' . $data['pid']);
@ -354,14 +354,15 @@ class Pastes extends CI_Model
{ {
$data['replies'][$n]['title'] = $row['title']; $data['replies'][$n]['title'] = $row['title'];
$data['replies'][$n]['name'] = $row['name']; $data['replies'][$n]['name'] = $row['name'];
$data['replies'][$n]['lang'] = $row['lang'];
$data['replies'][$n]['created'] = $row['created']; $data['replies'][$n]['created'] = $row['created'];
$data['replies'][$n]['pid'] = $row['pid']; $data['replies'][$n]['pid'] = $row['pid'];
if ($this->uri->segment(2) == 'rss') if ($this->uri->segment(2) == 'rss')
{ {
$data['replies'][$n]['paste'] = $this->process->syntax(htmlspecialchars_decode($row['raw']) , $row['lang']); $data['replies'][$n]['paste'] = $this->process->syntax(htmlspecialchars_decode($row['raw']) , $row['lang']);
}
$data['replies'][$n]['raw'] = $row['raw']; $data['replies'][$n]['raw'] = $row['raw'];
}
$n++; $n++;
} }
} }

View File

@ -79,6 +79,7 @@ if(isset($insert)){
<tr> <tr>
<th class="title"><?php echo lang('table_title'); ?></th> <th class="title"><?php echo lang('table_title'); ?></th>
<th class="name"><?php echo lang('table_name'); ?></th> <th class="name"><?php echo lang('table_name'); ?></th>
<th class="name"><?php echo lang('table_lang'); ?></th>
<th class="time"><?php echo lang('table_time'); ?></th> <th class="time"><?php echo lang('table_time'); ?></th>
</tr> </tr>
@ -94,6 +95,7 @@ if(isset($insert)){
<tr class="<?php echo $eo; ?>"> <tr class="<?php echo $eo; ?>">
<td class="first"><a href="<?php echo site_url("view/".$reply['pid']); ?>"><?php echo $reply['title']; ?></a></td> <td class="first"><a href="<?php echo site_url("view/".$reply['pid']); ?>"><?php echo $reply['title']; ?></a></td>
<td><?php echo $reply['name']; ?></td> <td><?php echo $reply['name']; ?></td>
<td><?php echo $reply['lang']; ?></td>
<td><?php $p = explode(",", timespan($reply['created'], time())); echo $p[0];?> <?php echo lang('paste_ago'); ?>.</td> <td><?php $p = explode(",", timespan($reply['created'], time())); echo $p[0];?> <?php echo lang('paste_ago'); ?>.</td>
</tr> </tr>