Changeset 646

Show
Ignore:
Timestamp:
07/11/08 17:05:29 (3 months ago)
Author:
aarkerio
Message:

New RSS feeder

Location:
trunk/app
Files:
5 added
2 removed
5 modified

Legend:

Unmodified
Added
Removed
  • trunk/app/config/routes.php

    r635 r646  
    1515 */ 
    1616// Router::connect('/tests', array('controller' => 'tests', 'action' => 'index')); 
     17 
     18Router::parseExtensions('rss'); 
    1719?> 
  • trunk/app/controllers/entries_controller.php

    r645 r646  
    1515class EntriesController extends AppController { 
    1616  
    17  public $helpers       = array('Ajax', 'Fck', 'Gags'); 
    18   
    19  public $components    = array('Edublog', 'Portal', 'Search'); 
     17 public $helpers       = array('Ajax', 'Fck', 'Gags', 'Rss'); 
     18  
     19 public $components    = array('Edublog', 'Portal', 'Search', 'RequestHandler'); 
    2020 
    2121 public $paginate = array('limit' => 7, 'page' => 1, 'order' => array('Entry.id' => 'DESC'), 'fields'=> array('Entry.title', 'Entry.body', 'Entry.created', 'Entry.user_id', 'Entry.discution', 'Entry.subject_id', 'Entry.id', 'User.username', 'Subject.title', 'Subject.id') 
     
    8080 public function rss($username) 
    8181 { 
    82       $user_id = $this->Entry->User->field('id', array('User.username'=>$username)); 
    83       $this->Entry->unbindModel(array('hasMany'=>array('Comment')));       
    84       $this->layout    = 'rss'; 
    85       $conditions      = array("Entry.status"=>1, "Entry.user_id"=>$user_id); 
    86       $fields          = array("Entry.id", "Entry.title", "Entry.created", "Entry.body", "Entry.subject_id", "Entry.user_id", "User.username", "User.name_blog"); 
    87       $order           = 'Entry.id DESC'; 
    88       $limit           = 20; 
    89        
    90       $this->set('data', $this->Entry->findAll($conditions, $fields, $order, $limit)); 
     82   
     83  $channelData = array('title' => 'eduBlog Recent Writing | '. $username, 
     84               'link'  => array('controller' => 'entries', 'action' => 'view', $username), 
     85               'url'   => array('controller' => 'entries', 'action' => 'view', $username), 
     86               'description' => $username . ' eduBlog Recent on Karamelo', 
     87               'language' => 'es-mx' 
     88               ); 
     89 
     90  $user_id = $this->Entry->User->field('User.id', array('User.username'=>$username)); 
     91  
     92  $this->Entry->unbindModel(array('hasMany'=>array('Comment')));       
     93   
     94  $conditions      = array("Entry.status"=>1, "Entry.user_id"=>$user_id); 
     95  $fields          = array("Entry.id", "Entry.title", "Entry.created", "Entry.body", "Entry.subject_id", "Entry.user_id", "User.username", "User.name_blog"); 
     96  $order           = 'Entry.id DESC'; 
     97  $limit           = 20; 
     98       
     99  $entries = $this->Entry->findAll($conditions, $fields, $order, $limit); 
     100   
     101  $this->set(compact('channelData', 'entries')); 
     102 
    91103 } 
    92104  
  • trunk/app/views/catfaqs/view.ctp

    r541 r646  
    11<?php 
    2 //die(var_dump($data)); 
     2//die(debug($data)); 
    33 
    4 echo $html->div(null, $data['Catfaq']['title'] .' FAQ', array('style'=>'font-size:18pt;padding:5px;boder:1px solid #c0c0c0')); 
     4echo $html->div(null, $data['Catfaq']['title'] .' FAQ', array('style'=>'font-size:18pt;padding:5px;margin:15px auto;boder:1px solid #c0c0c0')); 
    55 
    66foreach ($data["Faq"] as $v): 
    7   echo '<div style="border:1px dotted gray;padding:4px;margin-bottom:15px">'; 
    8     echo $html->para(null, $v['question']); 
    9     echo $html->para(null, $v['answer']); 
    10     echo $html->para(null,$html->link($html->image('static/arrow_top.gif', array("alt"=>"Go top", "title"=>"Go top")), '#main', null, null, false)); 
     7  echo $html->link($v['question'], '#qa'.$v['id']) . '<br />'; 
     8endforeach; 
     9 
     10foreach ($data["Faq"] as $v): 
     11  echo '<div style="border:1px dotted gray;padding:4px;margin:15px 5px 3px 3px;color:#000" id="qa'.$v['id'].'">'; 
     12    echo $html->div(null, $v['question'], array('style'=>'font-weight:bold;')); 
     13    echo $html->div(null, $v['answer']); 
     14    echo $html->para(null,$html->link($html->image('static/arrow_top.gif', array('alt'=>'Go top', 'title'=>'Go top')), '#main', null, null, false)); 
    1115    echo '</div>'; 
    1216endforeach; 
  • trunk/app/views/layouts/rss.ctp

    r610 r646  
     1<?php header('Content-type: text/xml'); ?> 
    12<?php echo '<?xml version="1.0" encoding="UTF-8" ?>'."\n"; ?> 
    23<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"> 
  • trunk/app/views/layouts/rubyx.ctp

    r637 r646  
    1919<meta name="author" content="Karamelo by Chipotle Software" />  
    2020<meta name="copyright" content="Design/Code: Vit Dlouhy [Nuvio - www.nuvio.cz]; e-mail: vit.dlouhy@nuvio.cz" /> 
    21 <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php echo '/entries/rss/'.$blog['User']['username']; ?>" /> 
     21<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php echo '/entries/rss/'.$blog['User']['username'].'.rss'; ?>" /> 
    2222              
    2323<title> <?php echo $title_for_layout?> </title>  
     
    8585<div id="rss"><strong>RSS:</strong>  
    8686<?php 
    87  e($html->link('Blog', '/entries/rss/'.$blog['User']['username']) . '/');  
    88  e($html->link('Podcast', '/podcasts/rss/'.$blog['User']['username'])); 
     87 e($html->link('Blog', '/entries/rss/'.$blog['User']['username'] . '.rss'). ' / ');  
     88 e($html->link('Podcast', '/podcasts/rss/'.$blog['User']['username'].'rss')); 
    8989?> 
    9090</div>