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

Changeset 6772


Ignore:
Timestamp:
Apr 27, 2008, 2:15:47 PM (14 years ago)
Author:
ogawa
Message:

#2247:fh_albumで2列表示をするのに複雑な処理をしていた部分を修正

Location:
OpenPNE/trunk/webapp/modules/pc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE/trunk/webapp/modules/pc/page/fh_album.php

    r6759 r6772  
    3333            exit;
    3434        }
    35        
     35
    3636        $target_c_album = db_album_get_c_album4c_album_id($target_c_album_id);
    3737        $target_c_member_id = $target_c_album['c_member_id'];
     
    4141        } else {
    4242            $type = 'f';
    43            
     43
    4444            //check public flag
    4545            if (!pne_check_album_public_flag($target_c_album_id, $u)) {
     
    5151                openpne_redirect('pc', 'page_h_access_block');
    5252            }
    53            
     53
    5454            // あしあとをつける
    5555            db_ashiato_insert_c_ashiato($target_c_member_id, $u);
    5656        }
    57        
    58         $this->set("type", $type);
     57
     58        $this->set('type', $type);
    5959        $this->set('inc_navi', fetch_inc_navi($type, $target_c_member_id));
    60        
    61         $this->set('target_c_member_id',$target_c_member_id);
    62         $this->set('target_c_album_id',$target_c_album_id);
    63         $this->set('album_info',$target_c_album);
     60
     61        $this->set('target_c_member_id', $target_c_member_id);
     62        $this->set('target_c_album_id', $target_c_album_id);
     63        $this->set('album_info', $target_c_album);
    6464
    6565        //メンバー情報
    66         $this->set("target_member", db_member_c_member4c_member_id($target_c_member_id));
     66        $this->set('target_member', db_member_c_member4c_member_id($target_c_member_id));
    6767
    6868        //最新アルバム10件[サイドバー用]
    6969        $album_subject_list =  db_album_get_c_album_subject_list4c_member_id($target_c_member_id, 10, $u);
    70         $this->set("target_album_list",$album_subject_list);
     70        $this->set('target_album_list', $album_subject_list);
    7171
    7272        //アルバムに登録された写真
    73         $target_c_album_image = db_album_c_album_image_list4c_album_id($target_c_album_id, $page, $page_size);
    74         $this->set("target_album_image", $target_c_album_image[0]);
     73        list($list, $is_prev, $is_next, $total_num) =
     74            db_album_c_album_image_list4c_album_id($target_c_album_id, $page, $page_size);
     75        $this->set('album_image_list', $list);
    7576
    76         //アルバムの写真表示を2列にするための工夫?
    77         if(count($target_c_album_image[0])<$page_size){
    78          for($i=0;$i<=count($target_c_album_image[0]);$i++){
    79             if($i%2==0){
    80                 $temp1[$i]=$target_c_album_image[0][$i];
    81             }
    82             if($i%2==1){
    83                 $temp2[$i]=$target_c_album_image[0][$i];
    84             }
    85            }
    86          }else{
    87              for($i=0;$i<=$page_size;$i++){
    88             if($i%2==0){
    89                 $temp1[$i]=$target_c_album_image[0][$i];
    90             }
    91             if($i%2==1){
    92                 $temp2[$i]=$target_c_album_image[0][$i];
    93             }
    94            }
    95          }
    96    
    97         //アルバムの写真表示を2列にするための工夫?
    98         if(count($target_c_album_image[0])<$page_size){
    99           for($j=0;$j<(intval(ceil(count($target_c_album_image[0])/2)));$j++){
    100             $list_set1[0][$j][dual]=$temp1[$j+$j];
    101             $list_set1[0][$j][singular]=$temp2[$j+$j+1];
    102           }
    103         }else{
    104             for($j=0;$j<=($page_size/2-1);$j++){
    105             $list_set1[0][$j][dual]=$temp1[$j+$j];
    106             $list_set1[0][$j][singular]=$temp2[$j+$j+1];
    107           }
    108         }     
    109         $this->set("new_album_list", $list_set1[0]);
    110        
    11177        $this->set('page', $page);
    11278        $this->set('page_size', $page_size);
    113         $this->set('is_prev', $target_c_album_image[1]);
    114         $this->set('is_next', $target_c_album_image[2]);
    115         $this->set("total_num", $target_c_album_image[3]);
    116         $this->set('album_list_count', count($target_c_album_image[0]));
     79        $this->set('is_prev', $is_prev);
     80        $this->set('is_next', $is_next);
     81        $this->set('total_num', $total_num);
     82        $this->set('album_list_count', count($list));
    11783
    11884        return 'success';
  • OpenPNE/trunk/webapp/modules/pc/templates/fh_album.tpl

    r6759 r6772  
    6464({* unknown *})</div></div>
    6565
    66 ({if $target_album_image})
     66({if $album_image_list})
    6767
    6868({* unknown *})<div class="dparts"><div class="parts">
     
    8787({* unknown *})
    8888({* unknown *})<table>
    89 ({* unknown *})({foreach from=$new_album_list key=key item=album_item})
    90 ({* unknown *})<tr>
     89({* unknown *})({foreach from=$album_image_list item=item})
     90({* unknown *})({counter assign=_cnt})
     91({* unknown *})({if $_cnt % 2 == 1})<tr>({/if})
    9192({* unknown *})<td style="width: 50%; padding: 5px; text-align: center;">
    92 ({* unknown *})({if $album_item.dual.image_filename})
    93 ({* unknown *})<a href="({t_url m=pc a=page_fh_album_image_show})&amp;target_c_album_image_id=({$album_item.dual.c_album_image_id})"><img src="({t_img_url filename=$album_item.dual.image_filename w=180 h=180})" alt="" /></a><br />
    94 ({* unknown *})({if $type == "h"})<a href="({t_url m=pc a=page_h_album_image_edit})&amp;target_c_album_id=({$album_item.dual.c_album_id})&amp;target_c_album_image_id=({$album_item.dual.c_album_image_id})">写真を編集</a>({/if})
    95 ({* unknown *})<p>({$album_item.dual.image_description})</p>
     93({* unknown *})({if $item.image_filename})
     94({* unknown *})<a href="({t_url m=pc a=page_fh_album_image_show})&amp;target_c_album_image_id=({$item.c_album_image_id})"><img src="({t_img_url filename=$item.image_filename w=180 h=180})" alt="" /></a><br />
     95({* unknown *})({if $type == "h"})<a href="({t_url m=pc a=page_h_album_image_edit})&amp;target_c_album_id=({$item.c_album_id})&amp;target_c_album_image_id=({$item.c_album_image_id})">写真を編集</a>({/if})
     96({* unknown *})<p>({$item.image_description})</p>
    9697({* unknown *})({/if})
    9798({* unknown *})</td>
    98 ({* unknown *})<td style="width: 50%; padding: 5px; text-align: center;">
    99 ({* unknown *})({if $album_item.singular.image_filename})
    100 ({* unknown *})<a href="({t_url m=pc a=page_fh_album_image_show})&amp;target_c_album_image_id=({$album_item.singular.c_album_image_id})"><img src="({t_img_url filename=$album_item.singular.image_filename w=180 h=180})" alt="" /></a><br />
    101 ({* unknown *})({if $type == "h"})<a href="({t_url m=pc a=page_h_album_image_edit})&amp;target_c_album_id=({$album_item.singular.c_album_id})&amp;target_c_album_image_id=({$album_item.singular.c_album_image_id})">写真を編集</a>({/if})
    102 ({* unknown *})<p>({$album_item.singular.image_description})</p>
    103 ({* unknown *})({/if})
    104 ({* unknown *})</td>
    105 ({* unknown *})</tr>
     99({* unknown *})({if $_cnt % 2 == 0})</tr>({/if})
    106100({* unknown *})({/foreach})
     101({* unknown *})({if $_cnt % 2 == 1})<td></td></tr>({/if})
    107102({* unknown *})</table>
    108103({* unknown *})
     
    110105({* unknown *})
    111106({* unknown *})</div></div>
     107
    112108({/if})
    113109
Note: See TracChangeset for help on using the changeset viewer.