Changeset 2746

Show
Ignore:
Timestamp:
12/30/06 18:05:28 (2 years ago)
Author:
inureyes
Message:
  • 태그 보기와 카테고리 보기에서 목록만큼 글 수가 출력되는 부분을 페이지당 글 수 지정한 만큼만 나오도록 수정.
Location:
branches/1.1-beta
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • branches/1.1-beta/blog/category/index.php

    r2666 r2746  
    1818$entries = array(); 
    1919if ($skinSetting['showListOnCategory'] == 1 || $skinSetting['showListOnCategory'] == 0) 
    20     list($entries, $paging) = getEntriesWithPagingByCategory($owner, $category, $suri['page'], $blog['entriesOnList']); 
     20    list($entries, $paging) = getEntriesWithPagingByCategory($owner, $category, $suri['page'], $blog['entriesOnList'], $blog['entriesOnPage']); 
    2121require ROOT . '/lib/piece/blog/begin.php'; 
    2222require ROOT . '/lib/piece/blog/list.php'; 
  • branches/1.1-beta/blog/tag/index.php

    r2692 r2746  
    1515 
    1616    $list = array('title' => $suri['value'], 'items' => $listWithPaging[0], 'count' => $listWithPaging[1]['total']); 
    17     list($entries, $paging) = getEntriesWithPagingByTag($owner, $tag, $suri['page'], $blog['entriesOnList']); 
     17    list($entries, $paging) = getEntriesWithPagingByTag($owner, $tag, $suri['page'], $blog['entriesOnList'],$blog['entriesOnPage']); 
    1818    require ROOT . '/lib/piece/blog/begin.php'; 
    1919    require ROOT . '/lib/piece/blog/list.php'; 
  • branches/1.1-beta/lib/model/entry.php

    r2723 r2746  
    139139} 
    140140 
    141 function getEntriesWithPagingByCategory($owner, $category, $page, $count) { 
     141function getEntriesWithPagingByCategory($owner, $category, $page, $count, $countItem) { 
    142142    global $database, $folderURL, $suri; 
    143143    if ($category === null) 
     
    155155        WHERE e.owner = $owner AND e.draft = 0 $visibility $cond  
    156156        ORDER BY e.published DESC"; 
    157     return fetchWithPaging($sql, $page, $count, "$folderURL/{$suri['value']}"); 
    158 } 
    159  
    160 function getEntriesWithPagingByTag($owner, $tag, $page, $count) { 
     157    return fetchWithPaging($sql, $page, $count, "$folderURL/{$suri['value']}","?page=",$countItem); 
     158} 
     159 
     160function getEntriesWithPagingByTag($owner, $tag, $page, $count, $countItem = null) { 
    161161    global $database, $folderURL, $suri; 
    162162    if ($tag === null) 
     
    170170        WHERE e.owner = $owner AND e.draft = 0 $visibility AND e.category >= 0 AND t.tag = '$tag'  
    171171        ORDER BY e.published DESC"; 
    172     return fetchWithPaging($sql, $page, $count, "$folderURL/{$suri['value']}"); 
     172    return fetchWithPaging($sql, $page, $count, "$folderURL/{$suri['value']}","?page=", $countItem); 
    173173} 
    174174 
  • branches/1.1-beta/lib/model/paging.php

    r2702 r2746  
    88} 
    99 
    10 function fetchWithPaging($sql, $page, $count, $url = null, $prefix = '?page=') { 
     10function fetchWithPaging($sql, $page, $count, $url = null, $prefix = '?page=', $countItem = null) { 
    1111    global $folderURL; 
    1212    if ($url === null) 
     
    3636    $offset = ($paging['page'] - 1) * $count; 
    3737    if ($offset < 0) $offset = 0; 
     38    if ($countItem != null) $count = $countItem; 
    3839    return array(DBQuery::queryAll("$sql LIMIT $offset, $count"), $paging); 
    3940}