Changeset 2746
- Timestamp:
- 12/30/06 18:05:28 (2 years ago)
- Location:
- branches/1.1-beta
- Files:
-
- 4 modified
-
blog/category/index.php (modified) (1 diff)
-
blog/tag/index.php (modified) (1 diff)
-
lib/model/entry.php (modified) (3 diffs)
-
lib/model/paging.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/1.1-beta/blog/category/index.php
r2666 r2746 18 18 $entries = array(); 19 19 if ($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']); 21 21 require ROOT . '/lib/piece/blog/begin.php'; 22 22 require ROOT . '/lib/piece/blog/list.php'; -
branches/1.1-beta/blog/tag/index.php
r2692 r2746 15 15 16 16 $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']); 18 18 require ROOT . '/lib/piece/blog/begin.php'; 19 19 require ROOT . '/lib/piece/blog/list.php'; -
branches/1.1-beta/lib/model/entry.php
r2723 r2746 139 139 } 140 140 141 function getEntriesWithPagingByCategory($owner, $category, $page, $count ) {141 function getEntriesWithPagingByCategory($owner, $category, $page, $count, $countItem) { 142 142 global $database, $folderURL, $suri; 143 143 if ($category === null) … … 155 155 WHERE e.owner = $owner AND e.draft = 0 $visibility $cond 156 156 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 160 function getEntriesWithPagingByTag($owner, $tag, $page, $count, $countItem = null) { 161 161 global $database, $folderURL, $suri; 162 162 if ($tag === null) … … 170 170 WHERE e.owner = $owner AND e.draft = 0 $visibility AND e.category >= 0 AND t.tag = '$tag' 171 171 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); 173 173 } 174 174 -
branches/1.1-beta/lib/model/paging.php
r2702 r2746 8 8 } 9 9 10 function fetchWithPaging($sql, $page, $count, $url = null, $prefix = '?page=' ) {10 function fetchWithPaging($sql, $page, $count, $url = null, $prefix = '?page=', $countItem = null) { 11 11 global $folderURL; 12 12 if ($url === null) … … 36 36 $offset = ($paging['page'] - 1) * $count; 37 37 if ($offset < 0) $offset = 0; 38 if ($countItem != null) $count = $countItem; 38 39 return array(DBQuery::queryAll("$sql LIMIT $offset, $count"), $paging); 39 40 }
