mirror of
https://github.com/claudehohl/Stikked.git
synced 2025-04-26 13:01:08 -05:00
validating RSS feed
This commit is contained in:
parent
509f29db42
commit
497cdc3c40
@ -301,6 +301,7 @@ class Main extends CI_Controller
|
|||||||
|
|
||||||
if ($check)
|
if ($check)
|
||||||
{
|
{
|
||||||
|
$this->load->helper('text');
|
||||||
$paste = $this->pastes->getPaste(3);
|
$paste = $this->pastes->getPaste(3);
|
||||||
$data = $this->pastes->getReplies(3);
|
$data = $this->pastes->getReplies(3);
|
||||||
$data['page_title'] = $paste['title'] . ' - ' . $this->config->item('site_name');
|
$data['page_title'] = $paste['title'] . ' - ' . $this->config->item('site_name');
|
||||||
@ -352,6 +353,7 @@ class Main extends CI_Controller
|
|||||||
|
|
||||||
if ($this->uri->segment(2) == 'rss')
|
if ($this->uri->segment(2) == 'rss')
|
||||||
{
|
{
|
||||||
|
$this->load->helper('text');
|
||||||
$data['page_title'] = $this->config->item('site_name');
|
$data['page_title'] = $this->config->item('site_name');
|
||||||
$data['feed_url'] = site_url('lists/rss');
|
$data['feed_url'] = site_url('lists/rss');
|
||||||
$data['replies'] = $data['pastes'];
|
$data['replies'] = $data['pastes'];
|
||||||
|
@ -311,7 +311,7 @@ class Pastes extends CI_Model
|
|||||||
{
|
{
|
||||||
$pid = $this->uri->segment($seg);
|
$pid = $this->uri->segment($seg);
|
||||||
}
|
}
|
||||||
$this->db->select('title, name, created, pid, paste');
|
$this->db->select('title, name, created, pid, paste, raw');
|
||||||
$this->db->where('replyto', $pid);
|
$this->db->where('replyto', $pid);
|
||||||
$this->db->order_by('id', 'desc');
|
$this->db->order_by('id', 'desc');
|
||||||
$this->db->limit($amount);
|
$this->db->limit($amount);
|
||||||
@ -327,6 +327,7 @@ class Pastes extends CI_Model
|
|||||||
$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]['paste'] = $row['paste'];
|
$data['replies'][$n]['paste'] = $row['paste'];
|
||||||
|
$data['replies'][$n]['raw'] = $row['raw'];
|
||||||
$n++;
|
$n++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,7 @@ xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
|
|||||||
xmlns:slash="http://purl.org/rss/1.0/modules/slash/">
|
xmlns:slash="http://purl.org/rss/1.0/modules/slash/">
|
||||||
<channel>
|
<channel>
|
||||||
<title><?php echo $page_title; ?></title>
|
<title><?php echo $page_title; ?></title>
|
||||||
|
<description><?php echo $page_title; ?></description>
|
||||||
<atom:link href="<?php echo $feed_url; ?>" rel="self" type="application/rss+xml" />
|
<atom:link href="<?php echo $feed_url; ?>" rel="self" type="application/rss+xml" />
|
||||||
<link><?php echo base_url(); ?></link>
|
<link><?php echo base_url(); ?></link>
|
||||||
<language>en</language>
|
<language>en</language>
|
||||||
@ -16,9 +17,10 @@ xmlns:slash="http://purl.org/rss/1.0/modules/slash/">
|
|||||||
<item>
|
<item>
|
||||||
<title><?php echo $paste['title']; ?></title>
|
<title><?php echo $paste['title']; ?></title>
|
||||||
<link><?php echo site_url('view/' . $paste['pid']) ?></link>
|
<link><?php echo site_url('view/' . $paste['pid']) ?></link>
|
||||||
<pubDate><?php echo date('c', $paste['created']); ?></pubDate>
|
<pubDate><?php echo date('r', $paste['created']); ?></pubDate>
|
||||||
<dc:creator><?php echo $paste['name']; ?></dc:creator>
|
<dc:creator><?php echo $paste['name']; ?></dc:creator>
|
||||||
<guid isPermaLink="false"><?php echo site_url('view/' . $paste['pid']) ?></guid>
|
<guid isPermaLink="false"><?php echo site_url('view/' . $paste['pid']) ?></guid>
|
||||||
|
<description><![CDATA[<?php echo character_limiter($paste['raw'], 200); ?>]]></description>
|
||||||
<content:encoded><![CDATA[<?php echo $paste['paste']; ?>]]></content:encoded>
|
<content:encoded><![CDATA[<?php echo $paste['paste']; ?>]]></content:encoded>
|
||||||
</item>
|
</item>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user