mirror of
https://github.com/claudehohl/Stikked.git
synced 2025-04-25 12:31:06 -05:00
rss
This commit is contained in:
parent
d86ce778a2
commit
5b3eff3b72
@ -44,6 +44,7 @@ $route['scaffolding_trigger'] = "";
|
||||
$route['cron/:any'] = "main/cron";
|
||||
|
||||
$route['view/raw/:any'] = 'main/raw';
|
||||
$route['view/rss/:any'] = 'main/rss';
|
||||
$route['view/embed/:any'] = 'main/embed';
|
||||
$route['view/options'] = 'main/view_options';
|
||||
$route['view/download/:any'] = 'main/download';
|
||||
|
@ -293,6 +293,23 @@ class Main extends CI_Controller
|
||||
}
|
||||
}
|
||||
|
||||
function rss()
|
||||
{
|
||||
$this->load->model('pastes');
|
||||
$check = $this->pastes->checkPaste(3);
|
||||
|
||||
if ($check)
|
||||
{
|
||||
$data = $this->pastes->getPaste(3, true);
|
||||
print_r($data);
|
||||
$this->load->view('view/rss', $data);
|
||||
}
|
||||
else
|
||||
{
|
||||
show_404();
|
||||
}
|
||||
}
|
||||
|
||||
function embed()
|
||||
{
|
||||
$this->load->model('pastes');
|
||||
|
27
htdocs/application/views/view/rss.php
Normal file
27
htdocs/application/views/view/rss.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?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; ?>
|
||||
<description><?php echo $page_description; ?></description>
|
||||
<dc:language><?php echo $page_language; ?></dc:language>
|
||||
<dc:creator><?php echo $creator_email; ?></dc:creator>
|
||||
|
||||
<dc:rights>Copyright <?php echo gmdate("Y", time()); ?></dc:rights>
|
||||
<admin:generatoragent rdf:resource="http://www.codeigniter.com/">
|
||||
|
||||
<?php foreach($posts->result() as $post): ?>
|
||||
|
||||
<item>
|
||||
<link><?php echo site_url('blog/posting/' . $post->id) ?>
|
||||
<guid><?php echo site_url('blog/posting/' . $post->id) ?></guid>
|
||||
|
||||
<description><[CDATA[ <?php echo character_limiter($post->text, 200); ?> ]]></description>
|
||||
<pubdate><?php echo $post->date; ?></pubdate>
|
||||
</item>
|
||||
|
||||
<?php endforeach; ?>
|
||||
|
||||
</admin:generatoragent></channel>
|
||||
</rss>
|
||||
|
Loading…
x
Reference in New Issue
Block a user