mirror of
https://github.com/claudehohl/Stikked.git
synced 2025-04-26 04:51:08 -05:00
rss
This commit is contained in:
parent
5b3eff3b72
commit
98b514f500
@ -6,6 +6,7 @@
|
|||||||
* - _form_prep()
|
* - _form_prep()
|
||||||
* - index()
|
* - index()
|
||||||
* - raw()
|
* - raw()
|
||||||
|
* - rss()
|
||||||
* - embed()
|
* - embed()
|
||||||
* - download()
|
* - download()
|
||||||
* - lists()
|
* - lists()
|
||||||
@ -300,8 +301,11 @@ class Main extends CI_Controller
|
|||||||
|
|
||||||
if ($check)
|
if ($check)
|
||||||
{
|
{
|
||||||
$data = $this->pastes->getPaste(3, true);
|
$data = $this->pastes->getReplies(3);
|
||||||
print_r($data);
|
$data['feed_url'] = '';
|
||||||
|
$data['page_description'] = '';
|
||||||
|
$data['page_language'] = '';
|
||||||
|
$data['creator_email'] = '';
|
||||||
$this->load->view('view/rss', $data);
|
$this->load->view('view/rss', $data);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
* - createPaste()
|
* - createPaste()
|
||||||
* - checkPaste()
|
* - checkPaste()
|
||||||
* - getPaste()
|
* - getPaste()
|
||||||
|
* - getReplies()
|
||||||
* - getLists()
|
* - getLists()
|
||||||
* - cron()
|
* - cron()
|
||||||
* Classes list:
|
* Classes list:
|
||||||
@ -298,6 +299,40 @@ class Pastes extends CI_Model
|
|||||||
return $data;
|
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)
|
function getLists($root = 'lists/', $seg = 2)
|
||||||
{
|
{
|
||||||
$this->load->library('pagination');
|
$this->load->library('pagination');
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
<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/">
|
<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>
|
<channel>
|
||||||
|
<title>Stikked</title>
|
||||||
<link><?php echo $feed_url; ?>
|
<link><?php echo $feed_url; ?>
|
||||||
<description><?php echo $page_description; ?></description>
|
<description><?php echo $page_description; ?></description>
|
||||||
<dc:language><?php echo $page_language; ?></dc:language>
|
<dc:language><?php echo $page_language; ?></dc:language>
|
||||||
@ -10,14 +11,14 @@
|
|||||||
<dc:rights>Copyright <?php echo gmdate("Y", time()); ?></dc:rights>
|
<dc:rights>Copyright <?php echo gmdate("Y", time()); ?></dc:rights>
|
||||||
<admin:generatoragent rdf:resource="http://www.codeigniter.com/">
|
<admin:generatoragent rdf:resource="http://www.codeigniter.com/">
|
||||||
|
|
||||||
<?php foreach($posts->result() as $post): ?>
|
<?php foreach($replies as $paste): ?>
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
<link><?php echo site_url('blog/posting/' . $post->id) ?>
|
<link><?php echo site_url('view/' . $paste['pid']) ?>
|
||||||
<guid><?php echo site_url('blog/posting/' . $post->id) ?></guid>
|
<guid><?php echo site_url('view/' . $paste['pid']) ?></guid>
|
||||||
|
|
||||||
<description><[CDATA[ <?php echo character_limiter($post->text, 200); ?> ]]></description>
|
<description><[CDATA[ <?php echo $paste['paste']; ?> ]]></description>
|
||||||
<pubdate><?php echo $post->date; ?></pubdate>
|
<pubdate><?php echo $paste['created']; ?></pubdate>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user