Skip to content

Commit

Permalink
refs #1575 : sqlite-specific modifiation error fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
inureyes committed May 9, 2011
1 parent 613f978 commit 19917b6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions library/model/blog.entry.php
Original file line number Diff line number Diff line change
Expand Up @@ -395,9 +395,9 @@ function getEntryWithPaging($blogid, $id, $isNotice = false, $categoryId = false
$paging['pages'] = ($isNotice) ? getNoticesTotalCount($blogid) : getEntriesTotalCount($blogid);
}

for ($i = 1; $entry = array_shift($result); $i++) {
if ($entry['id'] != $id) {
if (array_push($paging['before'], $entry['id']) > 4) {
for ($i = 1; $entryId = array_shift($result); $i++) {
if ($entryId != $id) {
if (array_push($paging['before'], $entryId) > 4) {
if ($i == 5)
$paging['first'] = array_shift($paging['before']);
else
Expand All @@ -409,10 +409,10 @@ function getEntryWithPaging($blogid, $id, $isNotice = false, $categoryId = false
array_push($entries, $currentEntry);
$paging['after'] = array();
for ($i++; (count($paging['after']) < 4) && ($entry = array_shift($result)); $i++)
array_push($paging['after'], $entry['id']);
array_push($paging['after'], $entryId);
if ($i < $paging['pages']) {
while ($entry = array_shift($result))
$paging['last'] = $entry['id'];
$paging['last'] = $entryId;
}
if (count($paging['before']) > 0)
$paging['prev'] = $paging['before'][count($paging['before']) - 1];
Expand Down

0 comments on commit 19917b6

Please sign in to comment.