ここの情報は古いです。ご理解頂いた上でお取り扱いください。

source: OpenPNE/branches/stable-2.14.x/webapp/modules/pc/page/fh_album.php @ 13013

Last change on this file since 13013 was 13013, checked in by imamura623, 13 years ago

#3236:コードのシンプル化、pc_page_h_album_image_insert_dialogの並び順変更

File size: 3.0 KB
Line 
1<?php
2/**
3 * @copyright 2005-2008 OpenPNE Project
4 * @license   http://www.php.net/license/3_01.txt PHP License 3.01
5 */
6
7class pc_page_fh_album extends OpenPNE_Action
8{
9    function execute($requests)
10    {
11        if (!OPENPNE_USE_ALBUM) {
12            handle_kengen_error();
13        }
14
15        $u = $GLOBALS['AUTH']->uid();
16
17        // --- リクエスト変数
18        $target_c_album_id = $requests['target_c_album_id'];
19        $page = $requests['page'];
20        $desc = $requests['desc'];
21        // ----------
22        $page_size = 10;
23
24        // target が指定されていない
25        if (!$target_c_album_id) {
26            openpne_redirect('pc', 'page_h_err_fh_album');
27        }
28        // target のアルバムが存在しない
29        if (!p_common_is_active_c_album_id($target_c_album_id)) {
30            openpne_redirect('pc', 'page_h_err_fh_album');
31        }
32
33        $target_c_album = db_album_get_c_album4c_album_id($target_c_album_id);
34        $target_c_member_id = $target_c_album['c_member_id'];
35        $target_c_member = db_member_c_member4c_member_id($target_c_member_id);
36
37        // メンバーが存在しない
38        if (!$target_c_member) {
39            openpne_redirect('pc', 'page_h_err_fh_album');
40        }
41
42        if ($target_c_member_id == $u) {
43            $type = 'h';
44        } else {
45            $type = 'f';
46
47            //check public flag
48            if (!pne_check_album_public_flag($target_c_album_id, $u)) {
49                openpne_redirect('pc', 'page_h_err_fh_album');
50            }
51
52            // アクセスブロック
53            if (db_member_is_access_block($u, $target_c_member_id)) {
54                openpne_redirect('pc', 'page_h_access_block');
55            }
56
57            // あしあとをつける
58            db_ashiato_insert_c_ashiato($target_c_member_id, $u);
59        }
60
61        $this->set('type', $type);
62        $this->set('inc_navi', fetch_inc_navi($type, $target_c_member_id));
63
64        $this->set('target_c_member_id', $target_c_member_id);
65        $this->set('target_c_album_id', $target_c_album_id);
66        $this->set('album_info', $target_c_album);
67
68        //メンバー情報
69        $this->set('target_member', $target_c_member);
70
71        //最新アルバム10件[サイドバー用]
72        $album_subject_list =  db_album_get_c_album_subject_list4c_member_id($target_c_member_id, 10, $u);
73        $this->set('target_album_list', $album_subject_list);
74
75        //アルバムに登録された写真の順番を切り替える変数
76        $this->set('desc', $desc);
77
78        //アルバムに登録された写真
79        list($list, $is_prev, $is_next, $total_num) =
80            db_album_c_album_image_list4c_album_id($target_c_album_id, $page, $page_size, $desc);
81        $this->set('album_image_list', $list);
82
83        $this->set('page', $page);
84        $this->set('page_size', $page_size);
85        $this->set('is_prev', $is_prev);
86        $this->set('is_next', $is_next);
87        $this->set('total_num', $total_num);
88        $this->set('album_list_count', count($list));
89
90        return 'success';
91    }
92}
93
94?>
Note: See TracBrowser for help on using the repository browser.