We've fixed the problem in SVN. If you want to apply the fix to Beta 2, here is the workaround.
Line 138 in gallery.php $sql .= " ORDER BY `num_comments`";
Change it to: $sql = "SELECT p.`id`, COUNT(`comment`) AS `num_comments` FROM `".$TABLE_PREFIX."pictures` p LEFT JOIN `".$TABLE_PREFIX."comments` c ON p.`id`=c.`parent_id` WHERE parent_album = ".$row["parent_album"]." GROUP BY p.`id` ORDER BY `num_comments` ";
Well, didn't work for me. I don't know what you mean with "Change it to:". When you insert a Select statement instead the ORDER BY clause, don't you post the query twice then?
I tried a little bit and did it like this:
Line 138 in gallery.php $sql .= " ORDER BY `num_comments`";
Change it to:
if($_SESSION["plogger_sortby"] == 'number_of_comments'){ $sql = "SELECT p.`id`, COUNT(`comment`) AS `num_comments` FROM `".$TABLE_PREFIX."pictures` p LEFT JOIN `".$TABLE_PREFIX."comments` c ON p.`id`=c.`parent_id` WHERE parent_album = ".$row["parent_album"]." GROUP BY p.`id` ORDER BY `num_comments` "; } else { $sql = "SELECT id FROM `".$TABLE_PREFIX."pictures` WHERE parent_album = ".$row["parent_album"];
and in line 159 (after deting) after closing the switch case, I closed the if clause with a }
I put your fix in. and I still get the error. here is the page http://www.konsolekingz.com/plogger/ Everything works but the actual large view of the image.
kingsoul, that fix does work... Make sure your editing the correct one.
For spck if you wish you fix the slideshow which you are correct that it is broken.. Then change the following:
Line 1132 in gallery.php Within the method ============== function generate_slideshow_js($id, $mode) {
FIND: ===== // determine sort ordering switch ($_SESSION["plogger_sortby"]){ case 'number_of_comments': $sql .= " ORDER BY `num_comments`";
REPLACE: ===== // determine sort ordering switch ($_SESSION["plogger_sortby"]){ case 'number_of_comments': $sql = "SELECT p.*, COUNT(`comment`) AS `num_comments` FROM `".$TABLE_PREFIX."pictures` p LEFT JOIN `".$TABLE_PREFIX."comments` c ON p.`id`=c.`parent_id` WHERE parent_album = '".$id."' GROUP BY p.`id` ORDER BY `num_comments` ";