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

Changeset 6771


Ignore:
Timestamp:
Apr 27, 2008, 1:48:32 PM (11 years ago)
Author:
ogawa
Message:

#2307:フォトアルバムの並び順がリストと詳細ページで違う場合があったのを修正

Location:
OpenPNE/trunk/webapp
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE/trunk/webapp/lib/db/album.php

    r6759 r6771  
    115115function db_album_c_album_image_list4c_album_id($c_album_id, $page = 1, $page_size = 10)
    116116{
    117     $sql = 'SELECT * FROM c_album_image WHERE c_album_id = ? ORDER BY r_datetime DESC';
     117    $sql = 'SELECT * FROM c_album_image WHERE c_album_id = ? ORDER BY c_album_image_id DESC';
    118118    $params = array(intval($c_album_id));
    119119    $list = db_get_all_page($sql, $page, $page_size, $params);
     
    142142/**
    143143 * 指定したアルバム写真の前の写真IDを取得する
    144  * @param int $c_member_id
     144 *
    145145 * @param int $c_album_id
    146146 * @param int $c_album_image_id
    147  * @param int $u
    148  */
    149 function db_album_image_c_album_image_id_prev4c_album_id($c_member_id, $c_album_id, $c_album_image_id, $u = null)
    150 {
    151     $public_flag_condition = db_album_public_flag_condition($c_member_id, $u);
    152 
    153     $select  = 'SELECT c_album_image.c_album_image_id ';
    154     $from    = ' FROM c_album_image, c_album';
    155     $where   = ' WHERE c_album.c_album_id = c_album_image.c_album_id' .
    156                 ' AND c_album.c_member_id = ?' .
    157                 ' AND c_album.c_album_id = ?' .
    158                 ' AND c_album_image.c_album_image_id < ?'
    159                 . $public_flag_condition;
    160     $orderby = ' ORDER BY c_album_image.c_album_image_id DESC';
    161     $sql = $select . $from . $where . $orderby;
    162     $params = array(intval($c_member_id),intval($c_album_id),intval($c_album_image_id));
    163 
     147 */
     148function db_album_image_c_album_image_id_prev4c_album_id($c_album_id, $c_album_image_id)
     149{
     150    $sql = 'SELECT c_album_image_id FROM c_album_image WHERE c_album_id = ? AND c_album_image_id < ? ORDER BY c_album_image_id DESC';
     151    $params = array(intval($c_album_id), intval($c_album_image_id));
    164152    return db_get_one($sql, $params);
    165153}
     
    167155/**
    168156 * 指定したアルバム写真の次の写真IDを取得する
    169  * @param int $c_member_id
     157 *
    170158 * @param int $c_album_id
    171159 * @param int $c_album_image_id
    172  * @param int $u
    173  */
    174 function db_album_image_c_album_image_id_next4c_album_id($c_member_id, $c_album_id, $c_album_image_id, $u = null)
    175 {
    176     $public_flag_condition = db_album_public_flag_condition($c_member_id, $u);
    177 
    178     $select  = 'SELECT c_album_image.c_album_image_id ';
    179     $from    = ' FROM c_album_image, c_album';
    180     $where   = ' WHERE c_album.c_album_id = c_album_image.c_album_id' .
    181                 ' AND c_album.c_member_id = ?' .
    182                 ' AND c_album.c_album_id = ?' .
    183                 ' AND c_album_image.c_album_image_id > ?'
    184                 . $public_flag_condition;
    185     $orderby = ' ORDER BY c_album_image.c_album_image_id ASC';
    186     $sql = $select . $from . $where . $orderby;
    187     $params = array(intval($c_member_id),intval($c_album_id),intval($c_album_image_id));
    188 
     160 */
     161function db_album_image_c_album_image_id_next4c_album_id($c_album_id, $c_album_image_id)
     162{
     163    $sql = 'SELECT c_album_image_id FROM c_album_image WHERE c_album_id = ? AND c_album_image_id > ? ORDER BY c_album_image_id';
     164    $params = array(intval($c_album_id), intval($c_album_image_id));
    189165    return db_get_one($sql, $params);
    190166}
  • OpenPNE/trunk/webapp/modules/ktai/page/fh_album_image_show.php

    r6759 r6771  
    6060        $this->set('type', $type);
    6161        $this->set('c_album_image', $target_c_album_image);
    62         $this->set('c_album_iamge_id_prev', db_album_image_c_album_image_id_prev4c_album_id($target_c_member_id, $target_c_album_id, $target_c_album_image_id, $u));
    63         $this->set('c_album_iamge_id_next', db_album_image_c_album_image_id_next4c_album_id($target_c_member_id, $target_c_album_id, $target_c_album_image_id, $u));
     62        $this->set('c_album_iamge_id_prev', db_album_image_c_album_image_id_prev4c_album_id($target_c_album_id, $target_c_album_image_id));
     63        $this->set('c_album_iamge_id_next', db_album_image_c_album_image_id_next4c_album_id($target_c_album_id, $target_c_album_image_id));
    6464
    6565        $this->set('album_info', $target_c_album);
  • OpenPNE/trunk/webapp/modules/pc/page/fh_album_image_show.php

    r6745 r6771  
    6161        $this->set('inc_navi', fetch_inc_navi($type, $target_c_member_id));
    6262        $this->set('c_album_image', $target_c_album_image);
    63         $this->set('c_album_iamge_id_prev', db_album_image_c_album_image_id_prev4c_album_id($target_c_member_id, $target_c_album_id, $target_c_album_image_id, $u));
    64         $this->set('c_album_iamge_id_next', db_album_image_c_album_image_id_next4c_album_id($target_c_member_id, $target_c_album_id, $target_c_album_image_id, $u));
     63        $this->set('c_album_iamge_id_prev', db_album_image_c_album_image_id_prev4c_album_id($target_c_album_id, $target_c_album_image_id));
     64        $this->set('c_album_iamge_id_next', db_album_image_c_album_image_id_next4c_album_id($target_c_album_id, $target_c_album_image_id));
    6565
    6666        return 'success';
Note: See TracChangeset for help on using the changeset viewer.