mirror of
https://github.com/claudehohl/Stikked.git
synced 2025-04-25 20:41:20 -05:00
sessionlist
This commit is contained in:
parent
8a5d5f2844
commit
32106be13e
@ -27,8 +27,9 @@ class Spamadmin extends CI_Controller
|
||||
function session()
|
||||
{
|
||||
$this->load->model('pastes');
|
||||
$session_id = 'sdf';
|
||||
$data = $this->pastes->getSpamLists($session_id);
|
||||
$session_id = $this->uri->segment(3);
|
||||
$data = $this->pastes->getSpamLists('spamadmin/session/' . $session_id, $seg = 4, $session_id);
|
||||
$data['session_id'] = $session_id;
|
||||
$this->load->view('list_sessionid', $data);
|
||||
}
|
||||
}
|
||||
|
@ -24,9 +24,14 @@ class Pastes extends CI_Model
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
function countPastes()
|
||||
function countPastes($session_id = false)
|
||||
{
|
||||
$this->db->where('private', 0);
|
||||
|
||||
if ($session_id)
|
||||
{
|
||||
$this->db->where('session_id', $session_id);
|
||||
}
|
||||
$query = $this->db->get('pastes');
|
||||
return $query->num_rows();
|
||||
}
|
||||
@ -367,22 +372,27 @@ class Pastes extends CI_Model
|
||||
return $data;
|
||||
}
|
||||
|
||||
function getSpamLists($root = 'spamadmin/', $seg = 2)
|
||||
function getSpamLists($root = 'spamadmin/', $seg = 2, $session_id = false)
|
||||
{
|
||||
$this->load->library('pagination');
|
||||
$this->load->library('process');
|
||||
$amount = $this->config->item('per_page');
|
||||
|
||||
if (!$this->uri->segment(2))
|
||||
if (!$this->uri->segment($seg))
|
||||
{
|
||||
$page = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$page = $this->uri->segment(2);
|
||||
$page = $this->uri->segment($seg);
|
||||
}
|
||||
$this->db->select('id, title, name, created, pid, lang, session_id');
|
||||
$this->db->where('private', 0);
|
||||
|
||||
if ($session_id)
|
||||
{
|
||||
$this->db->where('session_id', $session_id);
|
||||
}
|
||||
$this->db->order_by('created', 'desc');
|
||||
$query = $this->db->get('pastes', $amount, $page);
|
||||
|
||||
@ -402,7 +412,7 @@ class Pastes extends CI_Model
|
||||
}
|
||||
}
|
||||
$config['base_url'] = site_url($root);
|
||||
$config['total_rows'] = $this->countPastes();
|
||||
$config['total_rows'] = $this->countPastes($session_id);
|
||||
$config['per_page'] = $amount;
|
||||
$config['num_links'] = 9;
|
||||
$config['full_tag_open'] = '<div class="pages">';
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?php $this->load->view('defaults/header');?>
|
||||
<h1>Spamadmin</h1>
|
||||
<h1>Spamadmin - Pastes for sessionid <?php echo $session_id; ?></h1>
|
||||
|
||||
<?php
|
||||
function checkNum($num){
|
||||
@ -14,7 +14,6 @@
|
||||
<th class="name">Name</th>
|
||||
<th class="lang">Language</th>
|
||||
<th class="time">When</th>
|
||||
<th class="time">Session</th>
|
||||
</tr>
|
||||
<?php foreach($pastes as $paste) {
|
||||
if(checkNum($n) == TRUE) {
|
||||
@ -30,7 +29,6 @@
|
||||
<td><?php echo $paste['name']; ?></td>
|
||||
<td><?php echo $paste['lang']; ?></td>
|
||||
<td><?php $p = explode(",", timespan($paste['created'], time())); echo $p[0]; ?> ago.</td>
|
||||
<td><a href="<?php echo site_url('spamadmin/session/' . $paste['session_id']) ?>">[<?php echo substr($paste['session_id'], 0, 8); ?>...]</a></td>
|
||||
</tr>
|
||||
|
||||
<?php }?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user