Changeset 491
- Timestamp:
- 05/15/08 14:24:46 (8 months ago)
- Location:
- trunk/app
- Files:
-
- 6 modified
-
app_controller.php (modified) (1 diff)
-
controllers/entries_controller.php (modified) (1 diff)
-
views/entries/rss.ctp (modified) (3 diffs)
-
views/messages/display.ctp (modified) (4 diffs)
-
views/messages/sentmessages.ctp (modified) (1 diff)
-
views/users/edit.ctp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/app_controller.php
r427 r491 18 18 public function beforeFilter() 19 19 { 20 $this->Auth->fields = array('username' => 'email', 'password' => 'pwd');21 $this->Auth->loginAction = array('controller' => 'users', 'action' => 'login');22 $this->Auth->loginRedirect = array('controller' => 'news', 'action' => 'display');20 $this->Auth->fields = array('username' => 'email', 'password' => 'pwd'); 21 $this->Auth->loginAction = array('controller' => 'users', 'action' => 'login'); 22 $this->Auth->loginRedirect = array('controller' => 'news', 'action' => 'display'); 23 23 $this->Auth->logoutRedirect = '/news/display'; 24 $this->Auth->loginError = 'Invalid e-mail / password combination. Please try again'; 25 $this->Auth->authorize = 'controller'; 24 $this->Auth->loginError = 'Invalid e-mail / password combination. Please try again'; 25 $this->Auth->authorize = 'controller'; 26 $this->Auth->autoRedirect = true; 26 27 $this->Auth->deny('*'); 27 $this->Auth->autoRedirect = true;28 $this->set('cU', $this->Auth->user()); // $cU current user array to use in the views if user logged 28 29 $this->set('cU', $this->Auth->user()); // $cU current user array to use in the views if user logged in 29 30 } 30 31 -
trunk/app/controllers/entries_controller.php
r404 r491 39 39 { 40 40 $user_id = $this->Entry->User->field('id', array('User.username'=>$username)); 41 42 $this->Entry->unbindModel(array('hasMany'=>array('Comment'))); 43 41 $this->Entry->unbindModel(array('hasMany'=>array('Comment'))); 44 42 $this->layout = 'rss'; 45 46 43 $conditions = array("Entry.status"=>1, "Entry.user_id"=>$user_id); 47 48 44 $fields = array("Entry.id", "Entry.title", "Entry.created", "Entry.body", "Entry.subject_id", "Entry.user_id", "User.username"); 49 50 45 $order = 'Entry.id DESC'; 51 52 46 $limit = 20; 53 47 -
trunk/app/views/entries/rss.ctp
r431 r491 1 <?php 2 die(debug($data)); 3 ?> 1 4 <rss version="2.0"> 2 5 <channel> … … 7 10 8 11 <?php 9 /// die(var_dump($data)); 10 11 foreach ($data as $v) 12 { 13 12 foreach ($data as $v): 13 die(debug($v)); 14 14 $body = substr($v["Entry"]['body'],0,300) . "..."; 15 15 ?> 16 16 <item> 17 <title><?php echo $v["Entry"]['title']; ?></title>18 <link>http://<?php echo $_SERVER['SERVER_NAME'] ?>/users/entry/<?php echo $v["User"]['username']; ?>/<?php echo $v["Entry"]['id'] ?></link>19 <comments><?php echo $_SERVER['SERVER_NAME'] ?>/users/entry/<?php echo $v["User"]['username']; ?>/<?php echo $v["Entry"]['id'] ?></comments>17 <title><?php echo $v["Entry"]['title']; ?></title> 18 <link>http://<?php echo $_SERVER['SERVER_NAME'] ?>/users/entry/<?php echo $v["User"]['username']; ?>/<?php echo $v["Entry"]['id'] ?></link> 19 <comments><?php echo $_SERVER['SERVER_NAME'] ?>/users/entry/<?php echo $v["User"]['username']; ?>/<?php echo $v["Entry"]['id'] ?></comments> 20 20 <description><![CDATA['<?php echo $body ?>']]></description> 21 21 <pubDate><?php echo $v["Entry"]['created'] ?></pubDate> … … 23 23 <category><?php echo $v["Entry"]['subject_id']; ?></category> 24 24 <guid><?php echo $_SERVER['SERVER_NAME'] ?>/users/entry/<?php echo $v["User"]['username']; ?>/<?php echo $v["Entry"]['id'] ?></guid> 25 </item>26 <?php }?>25 </item> 26 <?php endforeach; ?> 27 27 28 28 </channel> -
trunk/app/views/messages/display.ctp
r484 r491 7 7 <?php 8 8 9 echo '<b>From</b>:' . $data[ "User"]["username"] . '<br />';10 echo '<b>Subject</b>: ' . $data[ "Message"]["title"] . '<br />';9 echo '<b>From</b>:' . $data['User']['username'] . '<br />'; 10 echo '<b>Subject</b>: ' . $data['Message']['title'] . '<br />'; 11 11 echo '<div style="padding:5px;background-color:#e7e6e6;margin:5px;">' . $data['Message']['body'] .'</div>'; 12 12 … … 14 14 15 15 echo $ajax->div("delbutton", array("style"=>"text-align:right")); 16 echo $gags->confirmDel($data['Message']['id'], 'messages'); 16 echo $form->create('Message', array('onsubmit'=>'return confirm(\'Are you sure to delete?\')','action'=>'delete')); 17 echo $form->hidden('Message.id', array('value'=>$data['Message']['id'])); 18 echo $form->end('Delete'); 17 19 echo $ajax->divEnd("delbutton"); 18 20 ?> … … 23 25 <?php 24 26 echo $ajax->form(); 25 echo $form->hidden('Message.username', array( "value"=>$cU['User']['username']));26 echo $form->hidden('Message.sender', array("value"=>$cU['User']['id']));27 echo $form->hidden('Message.message_id', array( "value"=> $data["Message"]["id"]));28 echo $form->hidden('Message.user_id', array( "value"=> $data["Message"]["sender"]));27 echo $form->hidden('Message.username', array('value'=>$cU['User']['username'])); 28 echo $form->hidden('Message.sender', array('value'=>$cU['User']['id'])); 29 echo $form->hidden('Message.message_id', array('value'=> $data["Message"]["id"])); 30 echo $form->hidden('Message.user_id', array('value'=> $data["Message"]["sender"])); 29 31 ?> 30 32 <fieldset> … … 35 37 echo $form->input('Message.title', array("size" => 35, "maxlength" => 50, "value"=> 'Re: ' . $data["Message"]["title"])) . "<br />"; 36 38 echo $form->label('Message.body', 'Message:').'<br />'; 37 echo $form->textarea('Message.body', array("cols"=>50, "rows"=>10, "value"=>"\n\n".'>> '.$data["User"]["username"] . ' wrote: ' . $data["Message"]["body"])); 38 echo $fck->load('MessageBody', 'Basic', 600, 160); 39 39 echo $form->textarea('Message.body', array("cols"=>50, "rows"=>10, "value"=>"\n\n".'>> '.$data["User"]["username"] .' wrote: ' . $data["Message"]["body"])); 40 40 echo $ajax->submit('Reply', array("url" => "/messages/add", 41 41 "update"=>"formhidden", -
trunk/app/views/messages/sentmessages.ctp
r490 r491 22 22 23 23 } 24 25 26 24 ?> 27 28 </td></tr>29 25 </table> 30 26 <script language="Javascript" type="text/javascript"> -
trunk/app/views/users/edit.ctp
r480 r491 30 30 echo $form->textarea('User.cv', array("cols" => 50, "rows" => 7)); 31 31 32 echo $form->input('User.quote', array("size" => 50, "maxlength" =>150));32 echo $form->input('User.quote', array("size" =>30, "maxlength"=>150)); 33 33 34 34 echo $form->label('User.newsletter', 'Subscribe to newsletter:' );
