From 907a348674e95f18210e01dcac648ead18ff79cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Fri, 16 Mar 2012 17:09:12 +0100 Subject: [PATCH] Use offset for sorting --- acptemplate/chatRoomList.tpl | 4 ++-- file/lib/data/chat/room/ChatRoomAction.class.php | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/acptemplate/chatRoomList.tpl b/acptemplate/chatRoomList.tpl index 2a1582f..7e4ca7e 100644 --- a/acptemplate/chatRoomList.tpl +++ b/acptemplate/chatRoomList.tpl @@ -4,7 +4,7 @@ // @@ -30,7 +30,7 @@
{hascontent} -
    +
      {content} {foreach from=$objects item=chatRoom}
    1. diff --git a/file/lib/data/chat/room/ChatRoomAction.class.php b/file/lib/data/chat/room/ChatRoomAction.class.php index 4ebdacc..c1b5b92 100644 --- a/file/lib/data/chat/room/ChatRoomAction.class.php +++ b/file/lib/data/chat/room/ChatRoomAction.class.php @@ -71,6 +71,8 @@ public function validateUpdatePosition() { if (!isset($this->parameters['data']['structure'])) { throw new ValidateActionException('Missing parameter structure'); } + + if (!isset($this->parameters['data']['offset'])) $this->parameters['data']['offset'] = 0; } /** @@ -82,7 +84,7 @@ public function updatePosition() { $roomList->sqlLimit = 0; $roomList->readObjects(); - $i = 0; + $i = $this->parameters['data']['offset']; WCF::getDB()->beginTransaction(); foreach ($this->parameters['data']['structure'][0] as $roomID) { $room = $roomList->search($roomID);