From: <ch...@us...> - 2011-10-10 22:00:16
|
Revision: 38146 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=38146&view=rev Author: chealer Date: 2011-10-10 22:00:09 +0000 (Mon, 10 Oct 2011) Log Message: ----------- Bookmarklib: Calculate the maximum folderId for the current user only in add_folder() Modified Paths: -------------- branches/8.x/lib/bookmarks/bookmarklib.php Modified: branches/8.x/lib/bookmarks/bookmarklib.php =================================================================== --- branches/8.x/lib/bookmarks/bookmarklib.php 2011-10-10 21:30:14 UTC (rev 38145) +++ branches/8.x/lib/bookmarks/bookmarklib.php 2011-10-10 22:00:09 UTC (rev 38146) @@ -92,15 +92,14 @@ return false; // Find the next folderId - $query = "select max(folderId) from `tiki_user_bookmarks_folders`"; - $maxId = $this->getOne($query); + $query = "select max(`folderId`) from `tiki_user_bookmarks_folders` WHERE `user`=?"; + $maxId = $this->getOne($query, array($user)); if( intval($maxId) == 0 ) { $maxId = 0; } - $maxId += 1; $query = "insert into `tiki_user_bookmarks_folders`(`folderId`, `name`,`parentId`,`user`) values(?,?,?,?)"; - $result = $this->query($query,array($maxId,$name,$parentId,$user)); + $result = $this->query($query,array($maxId + 1,$name,$parentId,$user)); } function replace_url($urlId, $folderId, $name, $url, $user) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |