OSDN Git Service

MyHome設定遷移の修正
authorCake <cake_67@users.sourceforge.jp>
Sat, 25 Dec 2010 05:55:48 +0000 (14:55 +0900)
committerCake <cake_67@users.sourceforge.jp>
Sat, 25 Dec 2010 05:55:48 +0000 (14:55 +0900)
app/controllers/users_controller.php
app/views/users/index.ctp

index ab9e690..108fd1d 100644 (file)
@@ -83,11 +83,10 @@ class UsersController extends AppController {
        }
 
        function index() {
-               $mycharacters = array();
+               $characters = array();
                if (empty($this->site_configs['Site.myHome']['value']) && $this->params['url']['url'] == '/') {
-//                     $this->redirect(array('controller' => 'characters', 'action'=>'mycharacter'));
-                       $mycharacters = $this->requestAction(
-                               array('controller' => 'characters', 'action' => 'mycharacter'),
+                       $characters = $this->requestAction(
+                               array('controller' => 'characters', 'action' => 'index'),
                                array('return')
                        );
                } else {
@@ -102,12 +101,12 @@ class UsersController extends AppController {
 
                        // 全体の情報
                        self::_view($this->user_id);
+               }
 
-                       // お知らせ
-                       $this->set('news', $this->get_news());
-                       }
+               $this->set('characters', $characters);
 
-               $this->set('mycharacters', $mycharacters);
+               // お知らせ
+               $this->set('news', $this->get_news());
        }
 
        function view($id = null) {
index 498bd60..ff55906 100644 (file)
@@ -1,5 +1,15 @@
-<?php if (!empty($mycharacters)): ?>
-<?php echo $mycharacters ?>
+<?php if (!empty($characters)): ?>
+
+<?php
+if (isset($news)) {
+       echo $this->element('information', array(
+               'news' => $news,
+               'cache' => time() + Configure::read('Cache.expireLong'),
+       ));
+}
+?>
+
+<?php echo $characters ?>
 <?php else: ?>
 <div id="home" class="layout2colums users view">
 <?php