/* キャッシュ削除 */
// ホーム関連
- function deleteCacheHome()
+ function deleteCacheHome($user_id = null)
{
$this->deleteCacheLastCharacters();
$this->deleteCacheAnonymousHome();
- $this->deleteCacheMyData();
+ $this->deleteCacheMyData($user_id);
}
// 最近更新されたキャラクター
// 未ログインホーム
function deleteCacheAnonymousHome()
{
- @unlink(CACHE.'views'.DS.'element__home_right');
+ @unlink(CACHE.'views'.DS.'element_0_user_index');
}
// 自セッション関連
- function deleteCacheMyData()
+ function deleteCacheMyData($user_id = null)
{
$Session = CorePlus::set_behavoir('Session');
+ if (!empty($user_id)) {
+ @unlink(CACHE.'views'.DS.'element_'.$user_id.'_user_index');
+ }
+
if (!$Session->id()) {
return false;
}
-
@unlink(CACHE.'views'.DS.'element_'.$Session->id().'_character_picture_table');
- @unlink(CACHE.'views'.DS.'element_'.$Session->id().'_home_left');
-
@unlink(CACHE.'views'.DS.'element_'.$Session->id().'_character_index');
}
if (!empty($user_id)) {
clearCache('_users_view_'.$user_id);
+ @unlink(CACHE.'views'.DS.'element_'.$user_id.'user_index');
@unlink(CACHE.'views'.DS.'element_'.$user_id.'_character_picture_table');
@unlink(CACHE.'views'.DS.'element_'.$user_id.'_character_view');
}
// 自セッション関連
$this->deleteCacheMyData();
- // Home
- $this->deleteCacheHome();
-
$this->deleteCacheCharacter($this->id, false);
if (isset($this->data['clearCache'])) {
+ $this->deleteCacheHome($this->data['clearCache']['user_id']);
$this->deleteCacheUser($this->data['clearCache']['user_id']);
$this->deleteCacheSystem($this->data['clearCache']['system_id'], false); // System一覧の更新遅れを修正する場合true
+ } else {
+ $this->deleteCacheHome();
}
// ProfileArchive
function deleteCache4User()
{
// 自セッション関連
- $this->deleteCacheMyData();
+ $this->deleteCacheMyData($this->id);
$this->deleteCacheHome();
$this->deleteCacheUser($this->id);
<?php if (isset($target_user_characters) && !empty($target_user_characters) && isset($target_user)): ?>
<!-- All User Characters -->
<?php
+ $rightCache = array(
+ 'time' => time() + Configure::read('Cache.expire'),
+ );
if ($owner) {
$more_url = array(
'controller' => 'characters',
'action' => 'mycharacter',
);
- $key = $session->id();
+ $rightCache = '';
} else {
$more_url = array(
'controller' => 'characters',
'action' => 'index',
$target_user['User']['id'],
);
- $key = null;
- $key .= "_". $target_user['User']['id'];
+ $rightCache = array_merge($rightCache, array(
+ 'key' => "_". $target_user['User']['id'],
+ ));
}
echo $this->element('character_picture_table', array(
'viewPublic' => true,
'more_url' => $more_url,
'other_url' => $add_url,
- 'cache' => array(
- 'time' => time() + Configure::read('Cache.expire'),
- 'key' => $key,
- )
+ 'cache' => $rightCache
));
?>
<?php endif; ?>
--- /dev/null
+<?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
+
+if ($user['User']['id']) {
+ $key = $session->id();
+
+ echo $this->element('home_left', array(
+ 'target_user' => $user,
+ 'owner' => true,
+ ));
+}
+
+echo $this->element('home_right', array(
+ 'target_user' => $user,
+ 'target_user_characters' => $target_user_characters,
+ 'owner' => true,
+ 'public_characters' => $public_characters,
+));
+
+?>
+</div>
+<?php endif; ?>
\ No newline at end of file
-<?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
-$key = null;
-
-if ($user['User']['id']) {
- $key = $session->id();
-
- echo $this->element('home_left', array(
- 'target_user' => $user,
- 'owner' => true,
- 'cache' => array(
- 'time' => time() + Configure::read('Cache.expire'),
- 'key' => $key,
- )
- ));
+$cacheSet['time'] = time() + Configure::read('Cache.expireShort');
+if (empty($character) || $user['User']['id']) {
+ $cacheSet['key'] = $user['User']['id'];
+} else {
+ $cacheSet['key'] = null;
}
-echo $this->element('home_right', array(
- 'target_user' => $user,
- 'target_user_characters' => $target_user_characters,
- 'owner' => true,
- 'public_characters' => $public_characters,
-));
+echo $this->element(
+ 'user_index',
+ array(
+ 'user' => $user,
+ 'news' => $news,
+ 'characters' => $characters,
+ 'cache' => $cacheSet,
+ )
+);
-?>
-</div>
-<?php endif; ?>
\ No newline at end of file