Changeset 646
- Timestamp:
- 07/11/08 17:05:29 (3 months ago)
- Location:
- trunk/app
- Files:
-
- 5 added
- 2 removed
- 5 modified
-
config/routes.php (modified) (1 diff)
-
controllers/entries_controller.php (modified) (2 diffs)
-
views/catfaqs/view.ctp (modified) (1 diff)
-
views/entries/rss (added)
-
views/entries/rss.ctp (deleted)
-
views/entries/rss/rss.ctp (added)
-
views/layouts/rss.ctp (modified) (1 diff)
-
views/layouts/rss/default.ctp (added)
-
views/layouts/rubyx.ctp (modified) (2 diffs)
-
views/podcasts/rss (added)
-
views/podcasts/rss.ctp (deleted)
-
views/podcasts/rss/rss.ctp (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/config/routes.php
r635 r646 15 15 */ 16 16 // Router::connect('/tests', array('controller' => 'tests', 'action' => 'index')); 17 18 Router::parseExtensions('rss'); 17 19 ?> -
trunk/app/controllers/entries_controller.php
r645 r646 15 15 class EntriesController extends AppController { 16 16 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'); 20 20 21 21 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') … … 80 80 public function rss($username) 81 81 { 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 91 103 } 92 104 -
trunk/app/views/catfaqs/view.ctp
r541 r646 1 1 <?php 2 //die( var_dump($data));2 //die(debug($data)); 3 3 4 echo $html->div(null, $data['Catfaq']['title'] .' FAQ', array('style'=>'font-size:18pt;padding:5px; boder:1px solid #c0c0c0'));4 echo $html->div(null, $data['Catfaq']['title'] .' FAQ', array('style'=>'font-size:18pt;padding:5px;margin:15px auto;boder:1px solid #c0c0c0')); 5 5 6 6 foreach ($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 />'; 8 endforeach; 9 10 foreach ($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)); 11 15 echo '</div>'; 12 16 endforeach; -
trunk/app/views/layouts/rss.ctp
r610 r646 1 <?php header('Content-type: text/xml'); ?> 1 2 <?php echo '<?xml version="1.0" encoding="UTF-8" ?>'."\n"; ?> 2 3 <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"> -
trunk/app/views/layouts/rubyx.ctp
r637 r646 19 19 <meta name="author" content="Karamelo by Chipotle Software" /> 20 20 <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'; ?>" /> 22 22 23 23 <title> <?php echo $title_for_layout?> </title> … … 85 85 <div id="rss"><strong>RSS:</strong> 86 86 <?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')); 89 89 ?> 90 90 </div>
