mirror of
https://github.com/claudehohl/Stikked.git
synced 2025-04-25 20:41:20 -05:00
rss
This commit is contained in:
parent
5b3eff3b72
commit
98b514f500
@ -6,6 +6,7 @@
|
||||
* - _form_prep()
|
||||
* - index()
|
||||
* - raw()
|
||||
* - rss()
|
||||
* - embed()
|
||||
* - download()
|
||||
* - lists()
|
||||
@ -300,8 +301,11 @@ class Main extends CI_Controller
|
||||
|
||||
if ($check)
|
||||
{
|
||||
$data = $this->pastes->getPaste(3, true);
|
||||
print_r($data);
|
||||
$data = $this->pastes->getReplies(3);
|
||||
$data['feed_url'] = '';
|
||||
$data['page_description'] = '';
|
||||
$data['page_language'] = '';
|
||||
$data['creator_email'] = '';
|
||||
$this->load->view('view/rss', $data);
|
||||
}
|
||||
else
|
||||
|
@ -8,6 +8,7 @@
|
||||
* - createPaste()
|
||||
* - checkPaste()
|
||||
* - getPaste()
|
||||
* - getReplies()
|
||||
* - getLists()
|
||||
* - cron()
|
||||
* Classes list:
|
||||
@ -298,6 +299,40 @@ class Pastes extends CI_Model
|
||||
return $data;
|
||||
}
|
||||
|
||||
function getReplies($seg = 3)
|
||||
{
|
||||
$amount = $this->config->item('per_page');
|
||||
|
||||
if ($this->uri->segment($seg) == '')
|
||||
{
|
||||
redirect('');
|
||||
}
|
||||
else
|
||||
{
|
||||
$pid = $this->uri->segment($seg);
|
||||
}
|
||||
$this->db->select('title, name, created, pid, paste');
|
||||
$this->db->where('replyto', $pid);
|
||||
$this->db->order_by('id', 'desc');
|
||||
$this->db->limit($amount);
|
||||
$query = $this->db->get('pastes', $amount);
|
||||
|
||||
if ($query->num_rows() > 0)
|
||||
{
|
||||
$n = 0;
|
||||
foreach ($query->result_array() as $row)
|
||||
{
|
||||
$data['replies'][$n]['title'] = $row['title'];
|
||||
$data['replies'][$n]['name'] = $row['name'];
|
||||
$data['replies'][$n]['created'] = $row['created'];
|
||||
$data['replies'][$n]['pid'] = $row['pid'];
|
||||
$data['replies'][$n]['paste'] = $row['paste'];
|
||||
$n++;
|
||||
}
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
function getLists($root = 'lists/', $seg = 2)
|
||||
{
|
||||
$this->load->library('pagination');
|
||||
|
@ -1,8 +1,9 @@
|
||||
<?php echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n"; ?>
|
||||
<?php echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n"; ?>
|
||||
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/">
|
||||
|
||||
<channel>
|
||||
<link><?php echo $feed_url; ?>
|
||||
<title>Stikked</title>
|
||||
<link><?php echo $feed_url; ?>
|
||||
<description><?php echo $page_description; ?></description>
|
||||
<dc:language><?php echo $page_language; ?></dc:language>
|
||||
<dc:creator><?php echo $creator_email; ?></dc:creator>
|
||||
@ -10,14 +11,14 @@
|
||||
<dc:rights>Copyright <?php echo gmdate("Y", time()); ?></dc:rights>
|
||||
<admin:generatoragent rdf:resource="http://www.codeigniter.com/">
|
||||
|
||||
<?php foreach($posts->result() as $post): ?>
|
||||
<?php foreach($replies as $paste): ?>
|
||||
|
||||
<item>
|
||||
<link><?php echo site_url('blog/posting/' . $post->id) ?>
|
||||
<guid><?php echo site_url('blog/posting/' . $post->id) ?></guid>
|
||||
<link><?php echo site_url('view/' . $paste['pid']) ?>
|
||||
<guid><?php echo site_url('view/' . $paste['pid']) ?></guid>
|
||||
|
||||
<description><[CDATA[ <?php echo character_limiter($post->text, 200); ?> ]]></description>
|
||||
<pubdate><?php echo $post->date; ?></pubdate>
|
||||
<description><[CDATA[ <?php echo $paste['paste']; ?> ]]></description>
|
||||
<pubdate><?php echo $paste['created']; ?></pubdate>
|
||||
</item>
|
||||
|
||||
<?php endforeach; ?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user