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

Changeset 12802


Ignore:
Timestamp:
Sep 3, 2009, 8:47:49 PM (13 years ago)
Author:
imamura623
Message:

#3236:デフォルトで登録日時で昇順表示の修正と昇順降順の切替追加

Location:
OpenPNE/branches/stable-2.14.x
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE/branches/stable-2.14.x/public_html/xhtml_style.php

    r10790 r12802  
    18041804        width: 66%;
    18051805}
     1806.albumImageList .partsHeading p.link,
    18061807.homeMainTable .partsHeading p.link {
    18071808        float: right;
  • OpenPNE/branches/stable-2.14.x/webapp/lib/db/album.php

    r12599 r12802  
    113113 * @return  array
    114114 */
    115 function db_album_c_album_image_list4c_album_id($c_album_id, $page = 1, $page_size = 10)
    116 {
    117     $sql = 'SELECT * FROM c_album_image WHERE c_album_id = ? ORDER BY c_album_image_id';
     115function db_album_c_album_image_list4c_album_id($c_album_id, $page = 1, $page_size = 10, $desc = 0)
     116{
     117    if ($desc == 0) {
     118        $sql = 'SELECT * FROM c_album_image WHERE c_album_id = ? ORDER BY c_album_image_id DESC';
     119    } else if ($desc == 1) {
     120        $sql = 'SELECT * FROM c_album_image WHERE c_album_id = ? ORDER BY c_album_image_id';
     121    }
     122
    118123    $params = array(intval($c_album_id));
    119     $list = db_get_all_page($sql, $page, $page_size, $params);
     124    $list = db_get_all_page($sql, $page, $page_size, $params);   
    120125
    121126    $sql = 'SELECT COUNT(c_album_image_id) FROM c_album_image WHERE c_album_id = ?';
     
    137142        }
    138143    }
    139     return array($list, $prev, $next, $total_num);
     144    return array($list, $prev, $next, $total_num, $desc);
    140145}
    141146
  • OpenPNE/branches/stable-2.14.x/webapp/modules/ktai/page/fh_album_image_list.php

    r10986 r12802  
    1919        $page = $requests['page'];
    2020        $is_thumbnail = $requests['is_thumbnail'];
     21        $desc = $_GET['desc'];
    2122        // ----------
    2223        $page_size = 10;
     
    7172        // メンバー情報
    7273        $this->set('target_member', $target_c_member);
     74       
     75        // 写真の順番を入れ替える
     76        if (empty($desc)){
     77           $desc = 0;
     78        }
     79        $this->set('desc', $desc);
    7380
    7481        // アルバムに登録された写真
    7582        list($album_image_list, $is_prev, $is_next, $total_num) =
    76             db_album_c_album_image_list4c_album_id($target_c_album_id, $page, $page_size);
     83            db_album_c_album_image_list4c_album_id($target_c_album_id, $page, $page_size, $desc);
    7784        $this->set('album_image_list', $album_image_list);
    7885        $this->set('page', $page);
  • OpenPNE/branches/stable-2.14.x/webapp/modules/ktai/templates/fh_album_image_list.tpl

    r10986 r12802  
    2121<input type="hidden" name="target_c_album_id" value="({$album_info.c_album_id})">
    2222<input type="hidden" name="page" value="({$page})">
     23<input type="hidden" name="desc" value="({$desc})">
    2324<input type="radio" value="1" name="is_thumbnail"({if $is_thumbnail}) checked="checked"({/if})>する 
    2425<input type="radio" value="0" name="is_thumbnail"({if !$is_thumbnail}) checked="checked"({/if})>しない<br>
    2526<input type="submit" value="表示を変更">
    2627</form>
     28
     29({if $desc == 0})
     30<a href="({t_url m=ktai a=page_fh_album_image_list})&amp;target_c_album_id=({$album_info.c_album_id})&amp;page=({$page})&amp;is_thumbnail=({$is_thumbnail})&amp;desc=({$desc+1})&amp;({$tail})">表示を降順に変更</a>
     31({elseif $desc == 1})
     32<a href="({t_url m=ktai a=page_fh_album_image_list})&amp;target_c_album_id=({$album_info.c_album_id})&amp;page=({$page})&amp;is_thumbnail=({$is_thumbnail})&amp;desc=({$desc-1})&amp;({$tail})">元に戻す</a>
     33({/if})
     34
    2735<hr color="#({$ktai_color_config.border_01})">
    2836
     
    5159<center>
    5260<a name="pager"></a>
    53 ({if $is_prev})<a href="({t_url m=ktai a=page_fh_album_image_list})&amp;target_c_album_id=({$album_info.c_album_id})&amp;page=({$page-1})&amp;is_thumbnail=({$is_thumbnail})&amp;({$tail})" accesskey="4">[i:128]前を表示</a>({/if})
     61({if $is_prev})<a href="({t_url m=ktai a=page_fh_album_image_list})&amp;target_c_album_id=({$album_info.c_album_id})&amp;page=({$page-1})&amp;is_thumbnail=({$is_thumbnail})&amp;desc=({$desc})&amp;({$tail})" accesskey="4">[i:128]前を表示</a>({/if})
    5462({if $is_prev && $is_next})&nbsp;({/if})
    55 ({if $is_next})<a href="({t_url m=ktai a=page_fh_album_image_list})&amp;target_c_album_id=({$album_info.c_album_id})&amp;page=({$page+1})&amp;is_thumbnail=({$is_thumbnail})&amp;({$tail})" accesskey="6">[i:130]次を表示</a>({/if})
     63({if $is_next})<a href="({t_url m=ktai a=page_fh_album_image_list})&amp;target_c_album_id=({$album_info.c_album_id})&amp;page=({$page+1})&amp;is_thumbnail=({$is_thumbnail})&amp;desc=({$desc})&amp;({$tail})" accesskey="6">[i:130]次を表示</a>({/if})
    5664<br>
    5765</center>
  • OpenPNE/branches/stable-2.14.x/webapp/modules/pc/page/fh_album.php

    r7994 r12802  
    1818        $target_c_album_id = $requests['target_c_album_id'];
    1919        $page = $requests['page'];
     20        $desc = $_GET['desc'];
    2021        // ----------
    2122        $page_size = 10;
     
    7273        $this->set('target_album_list', $album_subject_list);
    7374
     75        //アルバムに登録された写真の順番を切り替える変数
     76        if (empty($desc)){
     77            $desc = 0;
     78        }
     79        $this->set('desc', $desc);
     80         
    7481        //アルバムに登録された写真
    7582        list($list, $is_prev, $is_next, $total_num) =
    76             db_album_c_album_image_list4c_album_id($target_c_album_id, $page, $page_size);
     83            db_album_c_album_image_list4c_album_id($target_c_album_id, $page, $page_size, $desc);
    7784        $this->set('album_image_list', $list);
    7885
     
    8390        $this->set('total_num', $total_num);
    8491        $this->set('album_list_count', count($list));
    85 
     92       
    8693        return 'success';
    8794    }
  • OpenPNE/branches/stable-2.14.x/webapp/modules/pc/templates/fh_album.tpl

    r7262 r12802  
    6969({* {{{ albumImageList *})
    7070<div class="dparts albumImageList"><div class="parts">
    71 <div class="partsHeading"><h3>写真一覧</h3></div>
     71<div class="partsHeading"><h3>写真一覧</h3>
     72({if $desc == 0})
     73<p class="link"><a href="({t_url m=pc a=page_fh_album})&amp;page=({$page})&amp;target_c_album_id=({$target_c_album_id})&amp;desc=({$desc+1})">表示を降順に変更</a></p>
     74({elseif $desc == 1})
     75<p class="link"><a href="({t_url m=pc a=page_fh_album})&amp;page=({$page})&amp;target_c_album_id=({$target_c_album_id})&amp;desc=({$desc-1})">元に戻す</a></p>
     76({/if})
     77</div>
    7278
    7379({capture name=pager})({strip})
    7480<div class="pagerRelative">
    75 ({if $is_prev})<p class="prev"><a href="({t_url m=pc a=page_fh_album})&amp;page=({$page-1})&amp;target_c_album_id=({$target_c_album_id})">前を表示</a></p>({/if})
     81({if $is_prev})<p class="prev"><a href="({t_url m=pc a=page_fh_album})&amp;page=({$page-1})&amp;target_c_album_id=({$target_c_album_id})&amp;desc=({$desc})">前を表示</a></p>({/if})
    7682<p class="number">
    7783({$total_num})件中 ({$page*$page_size-$page_size+1})件~
     
    8389件を表示
    8490</p>
    85 ({if $is_next})<p class="next"><a href="({t_url m=pc a=page_fh_album})&amp;page=({$page+1})&amp;target_c_album_id=({$target_c_album_id})">次を表示</a></p>({/if})
     91({if $is_next})<p class="next"><a href="({t_url m=pc a=page_fh_album})&amp;page=({$page+1})&amp;target_c_album_id=({$target_c_album_id})&amp;desc=({$desc})">次を表示</a></p>({/if})
    8692</div>
    8793({/strip})({/capture})
Note: See TracChangeset for help on using the changeset viewer.